generated from proofoftom/buidler-waffle-typechain-quasar
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get recipientId from transaction hash instead of query the subgraph
- Loading branch information
Showing
6 changed files
with
64 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { TransactionReceipt } from '@ethersproject/abstract-provider' | ||
import sdk from '@/graphql/sdk' | ||
|
||
/** | ||
* Check if the transaction in the receipt exists in the subgraph | ||
* @param receipt transaction receipt | ||
* @returns true if the latest block number in subgraph is greater than the transaction block number | ||
*/ | ||
export async function isTransactionInSubgraph(receipt: TransactionReceipt): Promise<boolean> { | ||
const data = await sdk.GetLatestBlockNumber() | ||
|
||
if (!data._meta?.block.number) { | ||
return false | ||
} | ||
|
||
return data._meta.block.number > receipt.blockNumber | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters