Skip to content

Commit

Permalink
Merge pull request #307 from hayes-mysten/main
Browse files Browse the repository at this point in the history
feat(kit): Only report effects if the wallet has implemented the reportTransactionEffects feature
  • Loading branch information
bruceeewong authored Oct 16, 2024
2 parents 525c2ec + 3918fbc commit 2728867
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions packages/kit/src/components/WalletProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -347,14 +347,16 @@ 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 {
await _wallet.reportTransactionEffects({
effects: effectsB64,
account,
chain: chain.id as IdentifierString,
});
} catch (error) {
console.warn("Failed to report transaction effects:", error);
}
}

return {
Expand Down

0 comments on commit 2728867

Please sign in to comment.