Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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%;
}
}
}

`
}`
17 changes: 9 additions & 8 deletions packages/connect/src/utils/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,20 +214,21 @@ export const waitForTransactionReceipt = async ({
let receipt: TransactionReceipt | undefined

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

receipt = response.receipt
try {
const response = await indexerClient.fetchTransactionReceipt({
txnHash,
maxBlockWait: 400
})

// Additional wait time between requests. fetchTransactionReceipt will wait for 400 blocks, but this could be short amount of time if the blocktime is very short
if (!receipt) {
receipt = response.receipt
} catch (e) {
// Wait a little bit between request in case of very small block times
await new Promise(resolve => setTimeout(resolve, WAIT_TIME_BETWEEN_REQUESTS_MS))
}
}

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

if (confirmations) {
Expand Down