Skip to content

Commit

Permalink
Do not throw error if waas connector is not found (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
tolgahan-arikan authored Dec 17, 2024
1 parent 798efef commit 975f18f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/kit/src/hooks/useCheckWaasFeeOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,20 @@ export function useCheckWaasFeeOptions(): (params: { transactions: Transaction[]

return async ({ transactions, chainId }) => {
if (!waasConnector) {
throw new Error('WaaS connector not found')
return {
feeQuote: undefined,
feeOptions: undefined,
isSponsored: true
}
}

const waasProvider = (waasConnector as any).sequenceWaasProvider
if (!waasProvider) {
throw new Error('WaaS provider not found')
return {
feeQuote: undefined,
feeOptions: undefined,
isSponsored: true
}
}

return waasProvider.checkTransactionFeeOptions({ transactions, chainId })
Expand Down

0 comments on commit 975f18f

Please sign in to comment.