diff --git a/.changeset/healthy-sloths-joke.md b/.changeset/healthy-sloths-joke.md new file mode 100644 index 0000000000..60c355340e --- /dev/null +++ b/.changeset/healthy-sloths-joke.md @@ -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 diff --git a/packages/core/src/controllers/SwapController.ts b/packages/core/src/controllers/SwapController.ts index 2126e3fdb5..4b392b96a9 100644 --- a/packages/core/src/controllers/SwapController.ts +++ b/packages/core/src/controllers/SwapController.ts @@ -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 || '', diff --git a/packages/core/src/utils/TypeUtil.ts b/packages/core/src/utils/TypeUtil.ts index dd02829590..8a4e3a0323 100644 --- a/packages/core/src/utils/TypeUtil.ts +++ b/packages/core/src/utils/TypeUtil.ts @@ -631,6 +631,7 @@ export type Event = swapToToken: string swapFromAmount: string swapToAmount: string + message: string } } | {