Skip to content

Commit

Permalink
examples: fix type imports
Browse files Browse the repository at this point in the history
  • Loading branch information
kev1n-peters committed Aug 1, 2024
1 parent 37808d3 commit fc1926e
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 51 deletions.
16 changes: 4 additions & 12 deletions examples/src/cctp.ts
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
17 changes: 5 additions & 12 deletions examples/src/cosmos.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion examples/src/createWrapped.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
8 changes: 5 additions & 3 deletions examples/src/helpers/helpers.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
3 changes: 1 addition & 2 deletions examples/src/parseVaa.ts
Original file line number Diff line number Diff line change
@@ -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 () {
Expand Down
3 changes: 2 additions & 1 deletion examples/src/quorum.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
11 changes: 2 additions & 9 deletions examples/src/repairVaa.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
15 changes: 4 additions & 11 deletions examples/src/tokenBridge.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit fc1926e

Please sign in to comment.