From 975f18f2efe99c12ef08b2d68a76819e5aa2bfcd Mon Sep 17 00:00:00 2001 From: tolgahan-arikan Date: Tue, 17 Dec 2024 20:53:58 +0300 Subject: [PATCH] Do not throw error if waas connector is not found (#219) --- packages/kit/src/hooks/useCheckWaasFeeOptions.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/kit/src/hooks/useCheckWaasFeeOptions.ts b/packages/kit/src/hooks/useCheckWaasFeeOptions.ts index dd2531dd..926344d2 100644 --- a/packages/kit/src/hooks/useCheckWaasFeeOptions.ts +++ b/packages/kit/src/hooks/useCheckWaasFeeOptions.ts @@ -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 })