Skip to content

Commit

Permalink
remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
barnjamin committed Oct 16, 2023
1 parent 390a8de commit d60b7cf
Show file tree
Hide file tree
Showing 13 changed files with 67 additions and 99 deletions.
5 changes: 2 additions & 3 deletions connect/src/protocols/gatewayTransfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@ import {
toGatewayMsg,
toNative,
} from "@wormhole-foundation/sdk-definitions";
import { signSendWait } from "../common";
import { fetchIbcXfer, isTokenBridgeVaaRedeemed, retry } from "../tasks";
import { Wormhole } from "../wormhole";
import {
AttestationId,
TransferState,
WormholeTransfer,
} from "../wormholeTransfer";
import { retry, fetchIbcXfer, isTokenBridgeVaaRedeemed } from "../tasks";
import { signSendWait } from "../common";
import { DEFAULT_TASK_TIMEOUT } from "../config";

export class GatewayTransfer implements WormholeTransfer {
static chain: ChainName = "Wormchain";
Expand Down
24 changes: 11 additions & 13 deletions connect/src/protocols/tokenTransfer.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
import {
NativeAddress,
UniversalAddress,
UnsignedTransaction,
VAA,
deserialize,
Signer,
TransactionId,
TxHash,
UnsignedTransaction,
VAA,
WormholeMessageId,
TransactionId,
isWormholeMessageId,
deserialize,
isTransactionIdentifier,
isWormholeMessageId,
toNative,
} from "@wormhole-foundation/sdk-definitions";
import { isTokenTransferDetails, TokenTransferDetails } from "../types";
import { signSendWait } from "../common";
import { retry } from "../tasks";
import { TokenTransferDetails, isTokenTransferDetails } from "../types";
import { Wormhole } from "../wormhole";
import {
WormholeTransfer,
TransferState,
AttestationId,
TransferState,
WormholeTransfer,
} from "../wormholeTransfer";
import { Wormhole } from "../wormhole";
import { signSendWait } from "../common";
import { retry } from "../tasks";

/**
* What do with multiple transactions or VAAs?
Expand Down
7 changes: 1 addition & 6 deletions connect/src/tasks.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
ChainName,
PlatformName,
stripPrefix,
toChainId,
} from "@wormhole-foundation/sdk-base";
import { PlatformName } from "@wormhole-foundation/sdk-base";
import {
GatewayTransferMsg,
GatewayTransferWithPayloadMsg,
Expand Down
6 changes: 3 additions & 3 deletions connect/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ChainId, Network } from "@wormhole-foundation/sdk-base";
import { Network } from "@wormhole-foundation/sdk-base";
import {
ChainAddress,
ChainsConfig,
TokenId,
TransactionId,
WormholeMessageId,
TokenId,
ChainsConfig,
} from "@wormhole-foundation/sdk-definitions";

export type WormholeConfig = {
Expand Down
4 changes: 2 additions & 2 deletions core/definitions/src/attestation.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ChainName } from "@wormhole-foundation/sdk-base";
import { VAA } from "./vaa";
import { SequenceId } from "./types";
import { UniversalAddress } from "./universalAddress";
import { SequenceId, TransactionId } from "./types";
import { VAA } from "./vaa";

// Wormhole Message Identifier
// used to fetch a VAA
Expand Down
24 changes: 10 additions & 14 deletions core/definitions/src/chain.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
import {
ChainName,
PlatformName,
ProtocolName,
} from "@wormhole-foundation/sdk-base";
import { ChainName, PlatformName } from "@wormhole-foundation/sdk-base";

import { NativeAddress } from "./address";
import { WormholeMessageId } from "./attestation";
import { Platform } from "./platform";
import {
AutomaticCircleBridge,
CircleBridge,
supportsAutomaticCircleBridge,
supportsCircleBridge,
} from "./protocols/cctp";
import { IbcBridge, supportsIbcBridge } from "./protocols/ibc";
import {
AutomaticTokenBridge,
TokenBridge,
supportsAutomaticTokenBridge,
supportsTokenBridge,
} from "./protocols/tokenBridge";
import {
supportsAutomaticCircleBridge,
supportsCircleBridge,
AutomaticCircleBridge,
CircleBridge,
} from "./protocols/cctp";
import { supportsIbcBridge, IbcBridge } from "./protocols/ibc";
import { RpcConnection } from "./rpc";
import { ChainConfig, SignedTx } from "./types";
import { WormholeMessageId } from "./attestation";
import { UniversalAddress } from "./universalAddress";
import { NativeAddress } from "./address";

export abstract class ChainContext<P extends PlatformName> {
abstract platform: Platform<P>;
Expand Down
9 changes: 4 additions & 5 deletions core/definitions/src/platform.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import {
PlatformName,
ChainName,
Network,
PlatformName,
} from "@wormhole-foundation/sdk-base";
import { NativeAddress } from "./address";
import { WormholeMessageId } from "./attestation";
import { ChainContext } from "./chain";
import { RpcConnection } from "./rpc";
import { ChainConfig, ChainsConfig, TokenId, TxHash } from "./types";
import { WormholeMessageId } from "./attestation";
import { SignedTx } from "./types";
import { NativeAddress } from "./address";
import { ChainsConfig, SignedTx, TokenId, TxHash } from "./types";
import { UniversalAddress } from "./universalAddress";

export interface PlatformUtils<P extends PlatformName> {
Expand Down
1 change: 0 additions & 1 deletion core/definitions/src/protocols/ibc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
ChainId,
ChainName,
PlatformName,
isChainId,
toChainId,
} from "@wormhole-foundation/sdk-base";
import { ChainAddress, NativeAddress, UniversalOrNative } from "../address";
Expand Down
18 changes: 9 additions & 9 deletions examples/src/cctp.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CCTPTransfer, Wormhole } from "@wormhole-foundation/connect-sdk";
import { Wormhole } from "@wormhole-foundation/connect-sdk";
// TODO: should we re-export the things they need? should we rename the underlying packages?
import { EvmPlatform } from "@wormhole-foundation/connect-sdk-evm";
import { TransferStuff, getStuff, waitLog } from "./helpers";
Expand All @@ -25,7 +25,7 @@ AutoRelayer takes a 0.1usdc fee when xfering to any chain beside goerli, which i
const destination = await getStuff(rcvChain);

// Manual Circle USDC CCTP Transfer
// await cctpTransfer(wh, 8_000_000n, source, destination, false);
await cctpTransfer(wh, 8_000_000n, source, destination, false);

// Automatic Circle USDC CCTP Transfer
// await cctpTransfer(wh, 19_000_000n, source, destination, true);
Expand All @@ -38,13 +38,13 @@ AutoRelayer takes a 0.1usdc fee when xfering to any chain beside goerli, which i
// This is especially helpful for chains with longer time to finality where you don't want
// to have to wait for the attestation to be generated.

const xfer = await CCTPTransfer.from(wh, {
chain: "Ethereum",
txid: "0x28054d963e2a671f9e62b9cefa5d67fb857dd8f2259ce645e136bf7957354a09",
});
console.log(xfer);
console.log(await xfer.fetchAttestation(60 * 60 * 1000));
console.log(await xfer.completeTransfer(destination.signer));
// const xfer = await CCTPTransfer.from(wh, {
// chain: "Ethereum",
// txid: "0x28054d963e2a671f9e62b9cefa5d67fb857dd8f2259ce645e136bf7957354a09",
// });
// console.log(xfer);
// console.log(await xfer.fetchAttestation(60 * 60 * 1000));
// console.log(await xfer.completeTransfer(destination.signer));

//const xfer = await CCTPTransfer.from(wh, {
// message:
Expand Down
7 changes: 1 addition & 6 deletions examples/src/cosmos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ import {
toNative,
} from "@wormhole-foundation/connect-sdk";
// Import the platform specific packages
import {
CosmwasmIbcBridge,
CosmwasmPlatform,
CosmwasmUtils,
Gateway,
} from "@wormhole-foundation/connect-sdk-cosmwasm";
import { CosmwasmPlatform } from "@wormhole-foundation/connect-sdk-cosmwasm";
import { EvmPlatform } from "@wormhole-foundation/connect-sdk-evm";

import { TransferStuff, getStuff } from "./helpers";
Expand Down
21 changes: 10 additions & 11 deletions examples/src/helpers/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
import {
Signer,
ChainContext,
ChainAddress,
nativeChainAddress,
TransferState,
WormholeTransfer,
ChainContext,
ChainName,
PlatformName,
PlatformToChains,
Signer,
TransferState,
WormholeTransfer,
nativeChainAddress,
rpcAddress,
} from "@wormhole-foundation/connect-sdk";

import bs58 from "bs58";
import { ethers } from "ethers";
import { Keypair } from "@solana/web3.js";
import { DirectSecp256k1HdWallet, Registry } from "@cosmjs/proto-signing";
import { SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate";
import { AminoTypes, defaultRegistryTypes } from "@cosmjs/stargate";
import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";
import { Keypair } from "@solana/web3.js";
import {
chainToAddressPrefix,
cosmwasmNetworkChainToChainId,
cosmwasmNetworkChainToRestUrls,
} from "@wormhole-foundation/connect-sdk-cosmwasm";
import bs58 from "bs58";
import { ethers } from "ethers";

import { CosmosEvmSigner, CosmosSigner, EvmSigner, SolSigner } from "./signers";
import { ChainRestAuthApi } from "@injectivelabs/sdk-ts";
import { CosmosEvmSigner, CosmosSigner, EvmSigner, SolSigner } from "./signers";

// read in from `.env`
require("dotenv").config();
Expand Down
22 changes: 11 additions & 11 deletions examples/src/helpers/signers.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
import {
Signer,
SignedTx,
UnsignedTransaction,
ChainName,
PlatformToChains,
} from "@wormhole-foundation/connect-sdk";
import { ethers } from "ethers";
import { Keypair, Transaction } from "@solana/web3.js";
import { AccountData } from "@cosmjs/proto-signing";
import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
import { SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate";
import { AccountData } from "@cosmjs/proto-signing";
import {
ChainRestAuthApi,
DEFAULT_STD_FEE,
Expand All @@ -19,6 +9,16 @@ import {
TxClient,
createTransaction,
} from "@injectivelabs/sdk-ts";
import { Keypair } from "@solana/web3.js";
import {
ChainName,
PlatformToChains,
SignedTx,
Signer,
UnsignedTransaction,
} from "@wormhole-foundation/connect-sdk";
import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
import { ethers } from "ethers";

import {
CosmwasmUnsignedTransaction,
Expand Down
18 changes: 3 additions & 15 deletions examples/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
import { getNetworkInfo, Network as INetwork } from "@injectivelabs/networks";
import {
PrivateKey,
TxGrpcApi,
ChainRestAuthApi,
createTransaction,
Msgs,
MsgExecuteContractCompat,
DEFAULT_STD_FEE,
TxClient,
} from "@injectivelabs/sdk-ts";
import {
ChainAddress,
ChainName,
Network,
Wormhole,
toNative,
Wormhole,
} from "@wormhole-foundation/connect-sdk";
import { EvmPlatform } from "@wormhole-foundation/connect-sdk-evm";
import { SolanaPlatform } from "@wormhole-foundation/connect-sdk-solana";
import {
CosmwasmChain,
CosmwasmPlatform,
} from "@wormhole-foundation/connect-sdk-cosmwasm";
import { EvmPlatform } from "@wormhole-foundation/connect-sdk-evm";
import { SolanaPlatform } from "@wormhole-foundation/connect-sdk-solana";

import { getStuff } from "./helpers";

Expand Down

0 comments on commit d60b7cf

Please sign in to comment.