From fc1926eb5383bdcb9c51eaf90c06c48fa43a322a Mon Sep 17 00:00:00 2001 From: Kevin Peters Date: Thu, 1 Aug 2024 08:48:29 -0500 Subject: [PATCH] examples: fix type imports --- examples/src/cctp.ts | 16 ++++------------ examples/src/cosmos.ts | 17 +++++------------ examples/src/createWrapped.ts | 2 +- examples/src/helpers/helpers.ts | 8 +++++--- examples/src/parseVaa.ts | 3 +-- examples/src/quorum.ts | 3 ++- examples/src/repairVaa.ts | 11 ++--------- examples/src/tokenBridge.ts | 15 ++++----------- 8 files changed, 24 insertions(+), 51 deletions(-) diff --git a/examples/src/cctp.ts b/examples/src/cctp.ts index aa48fdee6..54e91682e 100644 --- a/examples/src/cctp.ts +++ b/examples/src/cctp.ts @@ -1,17 +1,9 @@ -import { - Chain, - CircleTransfer, - Network, - Signer, - TransactionId, - TransferState, - Wormhole, - amount, - wormhole, -} from "@wormhole-foundation/sdk"; +import type { Network, Signer, TransactionId, Wormhole } from "@wormhole-foundation/sdk"; +import { CircleTransfer, amount, wormhole } from "@wormhole-foundation/sdk"; import evm from "@wormhole-foundation/sdk/evm"; import solana from "@wormhole-foundation/sdk/solana"; -import { SignerStuff, getSigner, waitForRelay } from "./helpers/index.js"; +import type { SignerStuff } from "./helpers/index.js"; +import { getSigner, waitForRelay } from "./helpers/index.js"; /* Notes: diff --git a/examples/src/cosmos.ts b/examples/src/cosmos.ts index 1f7bf8aa3..c84962446 100644 --- a/examples/src/cosmos.ts +++ b/examples/src/cosmos.ts @@ -1,20 +1,13 @@ -import { - Chain, - GatewayTransfer, - GatewayTransferDetails, - Network, - TokenId, - Wormhole, - amount, - wormhole, -} from "@wormhole-foundation/sdk"; +import type { Chain, GatewayTransferDetails, Network, TokenId } from "@wormhole-foundation/sdk"; +import { GatewayTransfer, Wormhole, amount, wormhole } from "@wormhole-foundation/sdk"; // Import the platform specific packages import cosmwasm from "@wormhole-foundation/sdk/cosmwasm"; import evm from "@wormhole-foundation/sdk/evm"; import solana from "@wormhole-foundation/sdk/solana"; -import { SignerStuff, getSigner } from "./helpers/index.js"; +import type { SignerStuff } from "./helpers/index.js"; +import { getSigner } from "./helpers/index.js"; // We're going to transfer into, around, and out of the Cosmos ecosystem // First on Avalanche, transparently through gateway and over IBC to Cosmoshub @@ -66,7 +59,7 @@ import { SignerStuff, getSigner } from "./helpers/index.js"; : await transferIntoCosmos(wh, token, amt, leg1, leg2); console.log("Route 1 (External => Cosmos)", route1); - // Lookup the Gateway representation of the wrappd token + // Lookup the Gateway representation of the wrapped token const { denom } = route1.ibcTransfers![0]!.data; const cosmosTokenAddress = Wormhole.parseAddress("Wormchain", denom); diff --git a/examples/src/createWrapped.ts b/examples/src/createWrapped.ts index d4917e2ef..25d2eab80 100644 --- a/examples/src/createWrapped.ts +++ b/examples/src/createWrapped.ts @@ -1,4 +1,4 @@ -import { TokenId, Wormhole, signSendWait, wormhole } from "@wormhole-foundation/sdk"; +import { Wormhole, signSendWait, wormhole } from "@wormhole-foundation/sdk"; import evm from "@wormhole-foundation/sdk/evm"; import solana from "@wormhole-foundation/sdk/solana"; diff --git a/examples/src/helpers/helpers.ts b/examples/src/helpers/helpers.ts index 2c474f300..536442544 100644 --- a/examples/src/helpers/helpers.ts +++ b/examples/src/helpers/helpers.ts @@ -1,13 +1,15 @@ -import { +import type { Chain, ChainAddress, ChainContext, - DEFAULT_TASK_TIMEOUT, Network, Signer, + TxHash, +} from "@wormhole-foundation/sdk"; +import { + DEFAULT_TASK_TIMEOUT, TokenTransfer, TransferState, - TxHash, Wormhole, amount, api, diff --git a/examples/src/parseVaa.ts b/examples/src/parseVaa.ts index b0a0de7b6..843fc7725 100644 --- a/examples/src/parseVaa.ts +++ b/examples/src/parseVaa.ts @@ -1,13 +1,12 @@ +import type { Layout } from "@wormhole-foundation/sdk"; import { UniversalAddress, createVAA, deserialize, serialize, encoding, - Layout, serializeLayout, deserializeLayout, - serializePayload, } from "@wormhole-foundation/sdk"; (async function () { diff --git a/examples/src/quorum.ts b/examples/src/quorum.ts index d4dc7e3c8..00c2d63d5 100644 --- a/examples/src/quorum.ts +++ b/examples/src/quorum.ts @@ -1,4 +1,5 @@ -import { Chain, api, toChain, wormhole } from "@wormhole-foundation/sdk"; +import type { Chain } from "@wormhole-foundation/sdk"; +import { api, toChain, wormhole } from "@wormhole-foundation/sdk"; import algorand from "@wormhole-foundation/sdk/algorand"; import cosmwasm from "@wormhole-foundation/sdk/cosmwasm"; import evm from "@wormhole-foundation/sdk/evm"; diff --git a/examples/src/repairVaa.ts b/examples/src/repairVaa.ts index cfe443f35..61a30bf0a 100644 --- a/examples/src/repairVaa.ts +++ b/examples/src/repairVaa.ts @@ -1,12 +1,5 @@ -import { - SignatureUtils, - VAA, - WormholeCore, - encoding, - keccak256, - serialize, - wormhole, -} from "@wormhole-foundation/sdk"; +import type { VAA, WormholeCore } from "@wormhole-foundation/sdk"; +import { SignatureUtils, encoding, keccak256, serialize, wormhole } from "@wormhole-foundation/sdk"; import evm from "@wormhole-foundation/sdk/evm"; // If a VAA contains signatures from an older guardian set, it can be repaired by removing the invalid signatures and setting the new guardian set index. diff --git a/examples/src/tokenBridge.ts b/examples/src/tokenBridge.ts index c2c095be5..5c2de84e2 100644 --- a/examples/src/tokenBridge.ts +++ b/examples/src/tokenBridge.ts @@ -1,19 +1,12 @@ -import { - Chain, - Network, - TokenId, - TokenTransfer, - Wormhole, - amount, - isTokenId, - wormhole, -} from "@wormhole-foundation/sdk"; +import type { Chain, Network, TokenId } from "@wormhole-foundation/sdk"; +import { TokenTransfer, Wormhole, amount, isTokenId, wormhole } from "@wormhole-foundation/sdk"; // Import the platform-specific packages import evm from "@wormhole-foundation/sdk/evm"; import solana from "@wormhole-foundation/sdk/solana"; -import { SignerStuff, getSigner, waitLog } from "./helpers/index.js"; +import type { SignerStuff } from "./helpers/index.js"; +import { getSigner, waitLog } from "./helpers/index.js"; (async function () { // Init Wormhole object, passing config for which network