Skip to content

Commit

Permalink
Do not throw error if waas connector is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
tolgahan-arikan committed Dec 17, 2024
1 parent 7fe369c commit a2bbde4
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 a2bbde4

Please sign in to comment.