diff --git a/package.json b/package.json index 67b5e765b..836512b21 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@aztec/bridge-clients", - "version": "0.1.73", + "version": "0.1.74", "description": "This repo contains the solidity files and typescript helper class for all of the Aztec Connect Bridge Contracts", "repository": "git@github.com:AztecProtocol/aztec-connect-bridges.git", "license": "Apache-2.0", diff --git a/src/client/element/element-bridge-data.test.ts b/src/client/element/element-bridge-data.test.ts index 04450bb7f..1cb4bc9c6 100644 --- a/src/client/element/element-bridge-data.test.ts +++ b/src/client/element/element-bridge-data.test.ts @@ -186,7 +186,7 @@ describe("element bridge data", () => { EthAddress.ZERO, EthAddress.ZERO, EthAddress.ZERO, - "https://api.aztec.network/aztec-connect-prod/falafel/graphql", + "https://api.aztec.network/aztec-connect-prod/falafel", ); // can pass in dummy values here as the above factories do all of the work }; diff --git a/src/client/element/element-bridge-data.ts b/src/client/element/element-bridge-data.ts index 31625e7c9..772c04411 100644 --- a/src/client/element/element-bridge-data.ts +++ b/src/client/element/element-bridge-data.ts @@ -69,7 +69,7 @@ export class ElementBridgeData implements BridgeDataFieldGetters { private elementBridgeContract: ElementBridge, private balancerContract: IVault, private rollupContract: RollupProcessor, - private falafelGraphQlEndpoint: string, + private falafelEndpoint: string, ) {} static create( @@ -77,13 +77,13 @@ export class ElementBridgeData implements BridgeDataFieldGetters { elementBridgeAddress: EthAddress, balancerAddress: EthAddress, rollupContractAddress: EthAddress, - falafelGraphQlEndpoint: string, + falafelEndpoint: string, ) { const ethersProvider = createWeb3Provider(provider); const elementBridgeContract = ElementBridge__factory.connect(elementBridgeAddress.toString(), ethersProvider); const rollupContract = RollupProcessor__factory.connect(rollupContractAddress.toString(), ethersProvider); const vaultContract = IVault__factory.connect(balancerAddress.toString(), ethersProvider); - return new ElementBridgeData(elementBridgeContract, vaultContract, rollupContract, falafelGraphQlEndpoint); + return new ElementBridgeData(elementBridgeContract, vaultContract, rollupContract, falafelEndpoint); } private async storeEventBlocks(events: AsyncDefiBridgeProcessedEvent[]) { @@ -117,25 +117,14 @@ export class ElementBridgeData implements BridgeDataFieldGetters { private async getBlockNumber(interactionNonce: number) { const id = Math.floor(interactionNonce / 32); - const query = `query Block($id: Int!) { - block: rollup(id: $id) { - ethTxHash - } - }`; - const response = await fetch(this.falafelGraphQlEndpoint, { + const response = await fetch(`${this.falafelEndpoint}/rollup/${id}`, { headers: { "Content-Type": "application/json" }, - method: "POST", - body: JSON.stringify({ - query, - operationName: "Block", - variables: { id }, - }), + method: "GET", }); const data = await response.json(); - const txhash = `0x${data["data"]["block"]["ethTxHash"]}`; - const tx = await this.elementBridgeContract.provider.getTransactionReceipt(txhash); + const tx = await this.elementBridgeContract.provider.getTransactionReceipt(data["ethTxHash"]); return tx.blockNumber; }