Skip to content

Commit

Permalink
feat: add error message to swap_error event (#3154)
Browse files Browse the repository at this point in the history
Co-authored-by: enesozturk <[email protected]>
  • Loading branch information
tomiir and enesozturk authored Nov 8, 2024
1 parent f9a9d64 commit 6d1f9df
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .changeset/healthy-sloths-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
'@apps/laboratory': patch
'@reown/appkit': patch
'@reown/appkit-core': patch
'@apps/demo': patch
'@apps/gallery': patch
'@reown/appkit-adapter-ethers': patch
'@reown/appkit-adapter-ethers5': patch
'@reown/appkit-adapter-polkadot': patch
'@reown/appkit-adapter-solana': patch
'@reown/appkit-adapter-wagmi': patch
'@reown/appkit-utils': patch
'@reown/appkit-cdn': patch
'@reown/appkit-common': patch
'@reown/appkit-experimental': patch
'@reown/appkit-polyfills': patch
'@reown/appkit-scaffold-ui': patch
'@reown/appkit-siwe': patch
'@reown/appkit-siwx': patch
'@reown/appkit-ui': patch
'@reown/appkit-wallet': patch
---

Adds error message to swap error event
1 change: 1 addition & 0 deletions packages/core/src/controllers/SwapController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,7 @@ export const SwapController = {
type: 'track',
event: 'SWAP_ERROR',
properties: {
message: error?.shortMessage || error?.message || 'Unknown',
network: ChainController.state.activeCaipNetwork?.caipNetworkId || '',
swapFromToken: this.state.sourceToken?.symbol || '',
swapToToken: this.state.toToken?.symbol || '',
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/utils/TypeUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ export type Event =
swapToToken: string
swapFromAmount: string
swapToAmount: string
message: string
}
}
| {
Expand Down

0 comments on commit 6d1f9df

Please sign in to comment.