Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions packages/connect/src/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2500,6 +2500,4 @@ export const styles = String.raw`
--tw-gradient-to-position: 100%;
}
}
}

`
}`
20 changes: 17 additions & 3 deletions packages/connect/src/utils/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,23 @@ export const waitForTransactionReceipt = async ({
publicClient,
confirmations
}: WaitForTransactionReceiptInput): Promise<TransactionReceipt> => {
const { receipt } = await indexerClient.fetchTransactionReceipt({
txnHash
})
const RECEIPT_MAX_WAIT_MINUTES = 3
const startTime = Date.now()
const maxWaitTime = RECEIPT_MAX_WAIT_MINUTES * 60 * 1000

let receipt: TransactionReceipt | undefined

while (Date.now() - startTime < maxWaitTime && !receipt) {
const response = await indexerClient.fetchTransactionReceipt({
txnHash
})

receipt = response.receipt
}

if (!receipt) {
throw new Error('Timeout: Transaction receipt not found')
}

if (confirmations) {
const blockConfirmationPromise = new Promise<void>(resolve => {
Expand Down