From e2adafd83b7ceb96e756af617f4f26ae1ab350ef Mon Sep 17 00:00:00 2001 From: yuli-ferna Date: Fri, 22 Nov 2024 09:24:00 -0300 Subject: [PATCH 1/7] Update Connect to v1.1.6 --- apps/connect/package-lock.json | 8 ++++---- apps/connect/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/connect/package-lock.json b/apps/connect/package-lock.json index 7c1c18673..51ea74717 100644 --- a/apps/connect/package-lock.json +++ b/apps/connect/package-lock.json @@ -15,7 +15,7 @@ "@mui/material": "^5.12.1", "@tanstack/react-query": "^5.14.2", "@wormhole-foundation/sdk": "^1.0.0", - "@wormhole-foundation/wormhole-connect": "^1.1.5", + "@wormhole-foundation/wormhole-connect": "^1.1.6-beta.0-development", "aptos": "^1.21.0", "bech32": "^2.0.0", "dompurify": "^3.0.6", @@ -17795,9 +17795,9 @@ } }, "node_modules/@wormhole-foundation/wormhole-connect": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/wormhole-connect/-/wormhole-connect-1.1.5.tgz", - "integrity": "sha512-OCFLjwQVMcjxb8Hue8qOHcJANsse55glonhwY7L4HPviGeDT5zvlaGo1xn+iFFHeJY/F2JRX4y9MMaaBTf2iog==", + "version": "1.1.6-beta.0-development", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/wormhole-connect/-/wormhole-connect-1.1.6-beta.0-development.tgz", + "integrity": "sha512-y3GkMR7vTlFm0he57nrP86j8+gmqmw44L+1+8Pc4LhI+204xwvzThavwIjTFBj7WNq/VR06vmwKChsd73/XyJA==", "dependencies": { "@coral-xyz/anchor": "^0.29.0", "@cosmjs/cosmwasm-stargate": "^0.31.3", diff --git a/apps/connect/package.json b/apps/connect/package.json index 40baf7c77..a8ec3f286 100644 --- a/apps/connect/package.json +++ b/apps/connect/package.json @@ -31,7 +31,7 @@ "@mui/material": "^5.12.1", "@tanstack/react-query": "^5.14.2", "@wormhole-foundation/sdk": "^1.0.0", - "@wormhole-foundation/wormhole-connect": "^1.1.5", + "@wormhole-foundation/wormhole-connect": "^1.1.6-beta.0-development", "aptos": "^1.21.0", "bech32": "^2.0.0", "dompurify": "^3.0.6", From e16d9ff0246e130eaa9762faacff3e219f618a76 Mon Sep 17 00:00:00 2001 From: yuli-ferna Date: Fri, 22 Nov 2024 10:11:36 -0300 Subject: [PATCH 2/7] Fix build --- apps/connect/src/providers/telemetry.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/connect/src/providers/telemetry.ts b/apps/connect/src/providers/telemetry.ts index 84c17dd4e..44896267c 100644 --- a/apps/connect/src/providers/telemetry.ts +++ b/apps/connect/src/providers/telemetry.ts @@ -1,6 +1,7 @@ import mixpanel from "mixpanel-browser"; import { isPreview, isProduction } from "../utils/constants"; import type { WormholeConnectConfig } from "@wormhole-foundation/wormhole-connect"; +import { amount as sdkAmount } from "@wormhole-foundation/sdk"; export type WormholeConnectEvent = Parameters< NonNullable @@ -72,6 +73,7 @@ export const eventHandler = (e: WormholeConnectEvent) => { // Convert WormholeConnectEvent to Attributes const isTransferError = e.type === "transfer.error" || e.type === "transfer.redeem.error"; + const amount = sdkAmount.whole(e.details.amount as sdkAmount.Amount); const attributes: { [key: string]: string | number | undefined } = { fromChain: e.details.fromChain.toString(), toChain: e.details.toChain.toString(), @@ -81,7 +83,7 @@ export const eventHandler = (e: WormholeConnectEvent) => { toTokenAddress: getTokenAddress(e.details.toToken), txId: e.details.txId, USDAmount: e.details.USDAmount, - amount: e.details.amount, + amount: amount, connectVersion: e.meta.version, connectHash: e.meta.hash, route: From a4eacd3eb0ee5cf652b4793d332334dc67476f4e Mon Sep 17 00:00:00 2001 From: yuli-ferna Date: Fri, 22 Nov 2024 10:31:43 -0300 Subject: [PATCH 3/7] Fix tests --- apps/connect/src/providers/telemetry.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/connect/src/providers/telemetry.ts b/apps/connect/src/providers/telemetry.ts index 44896267c..b94b4a495 100644 --- a/apps/connect/src/providers/telemetry.ts +++ b/apps/connect/src/providers/telemetry.ts @@ -73,7 +73,7 @@ export const eventHandler = (e: WormholeConnectEvent) => { // Convert WormholeConnectEvent to Attributes const isTransferError = e.type === "transfer.error" || e.type === "transfer.redeem.error"; - const amount = sdkAmount.whole(e.details.amount as sdkAmount.Amount); + const amount = typeof e.details.amount === 'number' ? e.details.amount : sdkAmount.whole(e.details.amount as sdkAmount.Amount); const attributes: { [key: string]: string | number | undefined } = { fromChain: e.details.fromChain.toString(), toChain: e.details.toChain.toString(), From e2dd81550345eee824af1ac8e18de8ec3f1e4029 Mon Sep 17 00:00:00 2001 From: yuli-ferna Date: Fri, 22 Nov 2024 10:52:24 -0300 Subject: [PATCH 4/7] Fix tests --- apps/connect/src/providers/telemetry.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/connect/src/providers/telemetry.test.ts b/apps/connect/src/providers/telemetry.test.ts index a88d6c97b..12224825d 100644 --- a/apps/connect/src/providers/telemetry.test.ts +++ b/apps/connect/src/providers/telemetry.test.ts @@ -20,7 +20,7 @@ describe("telemetry", () => { fromChain: "Bsc", toChain: "arbitrum", txId: "txId", - amount: 0.0001, + amount: { amount: "1", decimals: 4 }, USDAmount: 123.456, toToken: { symbol: "osETH", From 739f86026f6b061412669a0ba5b28c1d6596d056 Mon Sep 17 00:00:00 2001 From: yuli-ferna Date: Fri, 22 Nov 2024 10:59:54 -0300 Subject: [PATCH 5/7] Fix prettier --- apps/connect/src/providers/telemetry.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/connect/src/providers/telemetry.ts b/apps/connect/src/providers/telemetry.ts index b94b4a495..5a447beaf 100644 --- a/apps/connect/src/providers/telemetry.ts +++ b/apps/connect/src/providers/telemetry.ts @@ -73,7 +73,10 @@ export const eventHandler = (e: WormholeConnectEvent) => { // Convert WormholeConnectEvent to Attributes const isTransferError = e.type === "transfer.error" || e.type === "transfer.redeem.error"; - const amount = typeof e.details.amount === 'number' ? e.details.amount : sdkAmount.whole(e.details.amount as sdkAmount.Amount); + const amount = + typeof e.details.amount === "number" + ? e.details.amount + : sdkAmount.whole(e.details.amount as sdkAmount.Amount); const attributes: { [key: string]: string | number | undefined } = { fromChain: e.details.fromChain.toString(), toChain: e.details.toChain.toString(), From a63850b4e7d8a3f7c2f9c1ebd4fe6d73042c772b Mon Sep 17 00:00:00 2001 From: yuli-ferna Date: Fri, 22 Nov 2024 12:56:25 -0300 Subject: [PATCH 6/7] InProggress true --- apps/connect/src/env/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/connect/src/env/common.ts b/apps/connect/src/env/common.ts index cbb1c2b7e..46ea6aadb 100644 --- a/apps/connect/src/env/common.ts +++ b/apps/connect/src/env/common.ts @@ -48,7 +48,7 @@ export const wormholeConnectConfigCommon: Partial = { href: `https://wormholescan.io/#/txs?address={:address}&network=${CLUSTER}`, }, menu: [], - // showInProgressWidget: true, + showInProgressWidget: true, }, network: CLUSTER, rpcs: {}, From 987ea20644d2d6ac3ff19fe0235c826d7618d8ae Mon Sep 17 00:00:00 2001 From: Sebastian Scatularo Date: Mon, 25 Nov 2024 16:49:41 -0300 Subject: [PATCH 7/7] bump version to last stable version --- apps/connect/package-lock.json | 8 ++++---- apps/connect/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/connect/package-lock.json b/apps/connect/package-lock.json index 51ea74717..05294bd07 100644 --- a/apps/connect/package-lock.json +++ b/apps/connect/package-lock.json @@ -15,7 +15,7 @@ "@mui/material": "^5.12.1", "@tanstack/react-query": "^5.14.2", "@wormhole-foundation/sdk": "^1.0.0", - "@wormhole-foundation/wormhole-connect": "^1.1.6-beta.0-development", + "@wormhole-foundation/wormhole-connect": "^1.1.6", "aptos": "^1.21.0", "bech32": "^2.0.0", "dompurify": "^3.0.6", @@ -17795,9 +17795,9 @@ } }, "node_modules/@wormhole-foundation/wormhole-connect": { - "version": "1.1.6-beta.0-development", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/wormhole-connect/-/wormhole-connect-1.1.6-beta.0-development.tgz", - "integrity": "sha512-y3GkMR7vTlFm0he57nrP86j8+gmqmw44L+1+8Pc4LhI+204xwvzThavwIjTFBj7WNq/VR06vmwKChsd73/XyJA==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/wormhole-connect/-/wormhole-connect-1.1.6.tgz", + "integrity": "sha512-6v7p8sn1HTAY0XLmqE8VCWhwBQh9Eqafx19HXXvSP6k3oEa/G2soGZqXX0Eg2V5/gH/5hB6VvuKWSa9KoMmrVA==", "dependencies": { "@coral-xyz/anchor": "^0.29.0", "@cosmjs/cosmwasm-stargate": "^0.31.3", diff --git a/apps/connect/package.json b/apps/connect/package.json index a8ec3f286..85ce99aca 100644 --- a/apps/connect/package.json +++ b/apps/connect/package.json @@ -31,7 +31,7 @@ "@mui/material": "^5.12.1", "@tanstack/react-query": "^5.14.2", "@wormhole-foundation/sdk": "^1.0.0", - "@wormhole-foundation/wormhole-connect": "^1.1.6-beta.0-development", + "@wormhole-foundation/wormhole-connect": "^1.1.6", "aptos": "^1.21.0", "bech32": "^2.0.0", "dompurify": "^3.0.6",