Skip to content

Commit

Permalink
Update Connect to v1.1.6 (#1188)
Browse files Browse the repository at this point in the history
* Update Connect to v1.1.6

* Fix build

* Fix tests

* Fix tests

* Fix prettier

* InProggress true

* bump version to last stable version

---------

Co-authored-by: Sebastian Scatularo <[email protected]>
  • Loading branch information
yuli-ferna and sebastianscatularo authored Nov 25, 2024
1 parent 417df15 commit a5b2406
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
8 changes: 4 additions & 4 deletions apps/connect/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"aptos": "^1.21.0",
"bech32": "^2.0.0",
"dompurify": "^3.0.6",
Expand Down
2 changes: 1 addition & 1 deletion apps/connect/src/env/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const wormholeConnectConfigCommon: Partial<WormholeConnectConfig> = {
href: `https://wormholescan.io/#/txs?address={:address}&network=${CLUSTER}`,
},
menu: [],
// showInProgressWidget: true,
showInProgressWidget: true,
},
network: CLUSTER,
rpcs: {},
Expand Down
2 changes: 1 addition & 1 deletion apps/connect/src/providers/telemetry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 6 additions & 1 deletion apps/connect/src/providers/telemetry.ts
Original file line number Diff line number Diff line change
@@ -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<WormholeConnectConfig["eventHandler"]>
Expand Down Expand Up @@ -72,6 +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 attributes: { [key: string]: string | number | undefined } = {
fromChain: e.details.fromChain.toString(),
toChain: e.details.toChain.toString(),
Expand All @@ -81,7 +86,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:
Expand Down

0 comments on commit a5b2406

Please sign in to comment.