From c373dd3a7c112d99a67ddb5e3d4331115a976de9 Mon Sep 17 00:00:00 2001 From: Michael Hayes Date: Tue, 9 Jul 2024 19:29:18 -0700 Subject: [PATCH 1/2] Only report effects if the wallet has implemented the reportTransactionEffects feature --- .../kit/src/components/WalletProvider.tsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/kit/src/components/WalletProvider.tsx b/packages/kit/src/components/WalletProvider.tsx index b0ad2aa..bb2a83a 100644 --- a/packages/kit/src/components/WalletProvider.tsx +++ b/packages/kit/src/components/WalletProvider.tsx @@ -347,14 +347,17 @@ export const WalletProvider = (props: WalletProviderProps) => { ); } - try { - await _wallet.reportTransactionEffects({ - effects: effectsB64, - account, - chain: chain.id as IdentifierString, - }); - } catch (error) { - console.warn("Failed to report transaction effects:", error); + if (_wallet.hasFeature(FeatureName.SUI__REPORT_TRANSACTION_EFFECTS)) { + try { + _wallet.hasFeature('') + await _wallet.reportTransactionEffects({ + effects: effectsB64, + account, + chain: chain.id as IdentifierString, + }); + } catch (error) { + console.warn("Failed to report transaction effects:", error); + } } return { From 3918fbc542a6a140a28339491d68dc4c1bd4c7bd Mon Sep 17 00:00:00 2001 From: Bruce Wang Date: Wed, 16 Oct 2024 12:55:53 -0400 Subject: [PATCH 2/2] chore: clean code --- packages/kit/src/components/WalletProvider.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/kit/src/components/WalletProvider.tsx b/packages/kit/src/components/WalletProvider.tsx index bb2a83a..6fc8b9c 100644 --- a/packages/kit/src/components/WalletProvider.tsx +++ b/packages/kit/src/components/WalletProvider.tsx @@ -349,7 +349,6 @@ export const WalletProvider = (props: WalletProviderProps) => { if (_wallet.hasFeature(FeatureName.SUI__REPORT_TRANSACTION_EFFECTS)) { try { - _wallet.hasFeature('') await _wallet.reportTransactionEffects({ effects: effectsB64, account,