-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4807670
commit 473b6c5
Showing
8 changed files
with
131 additions
and
48 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
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
29 changes: 29 additions & 0 deletions
29
packages/app-portal/src/systems/Chains/eth/utils/transaction.ts
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,29 @@ | ||
import { | ||
PublicClient, | ||
TransactionReceipt, | ||
WaitForTransactionReceiptParameters, | ||
} from 'viem'; | ||
|
||
export async function getTransactionReceipt({ | ||
ethPublicClient, | ||
txHash, | ||
waitOptions, | ||
}: { | ||
ethPublicClient: PublicClient; | ||
txHash: `0x${string}`; | ||
waitOptions?: Omit<WaitForTransactionReceiptParameters, 'hash'>; | ||
}): Promise<TransactionReceipt> { | ||
let receipt: TransactionReceipt; | ||
try { | ||
receipt = await ethPublicClient.getTransactionReceipt({ | ||
hash: txHash, | ||
}); | ||
} catch (_err: unknown) { | ||
// workaround in place because waitForTransactionReceipt stop working after first time using it | ||
receipt = await ethPublicClient.waitForTransactionReceipt({ | ||
...(waitOptions ? waitOptions : {}), | ||
hash: txHash, | ||
}); | ||
} | ||
return receipt; | ||
} |
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