Type Parameters

Hierarchy

  • Wormhole

Constructors

Properties

_chains: Map<"Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia", ChainContext<N, "Solana" | "Algorand" | "Near" | "Sui" | "Aptos" | "Btc" | "Evm" | "Cosmwasm", "Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia">>
_network: N
_platforms: Map<"Solana" | "Algorand" | "Near" | "Sui" | "Aptos" | "Btc" | "Evm" | "Cosmwasm", PlatformContext<N, "Solana" | "Algorand" | "Near" | "Sui" | "Aptos" | "Btc" | "Evm" | "Cosmwasm">>

Accessors

Methods

  • Creates a CircleTransfer object to move Native USDC from one chain to another

    Parameters

    • amount: bigint

      the amount to transfer

    • from: ChainAddress

      the address to transfer from

    • to: ChainAddress

      the address to transfer to

    • automatic: boolean

      whether to use automatic delivery

    • Optional payload: Uint8Array

      the payload to send with the transfer

    • Optional nativeGas: bigint

      the amount of native gas to send with the transfer

    Returns Promise<CircleTransfer<N>>

    the CircleTransfer object

    Throws

    Errors if the chain or protocol is not supported

  • Fetches the balance of a given token for a wallet

    Type Parameters

    • C extends "Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia"

    Parameters

    • chain: C

      The chain name or id

    • token: TokenAddress<C>
    • walletAddress: string

      The wallet address

    Returns Promise<bigint>

    The token balance of the wormhole asset as a BigNumber

  • Returns the chain "context", i.e. the class with chain-specific logic and methods

    Type Parameters

    • C extends "Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia"

    Parameters

    • chain: C

      the chain name

    Returns ChainContext<N, ChainToPlatform<C>, C>

    the chain context class

    Throws

    Errors if context is not found

  • Parameters

    • msgHash: string
    • timeout: number = DEFAULT_TASK_TIMEOUT

    Returns Promise<string>

  • Gets the contract addresses for a given chain

    Parameters

    • chain: "Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia"

      the chain name or chain id

    Returns Contracts

    the contract addresses

  • Gets the number of decimals for a token on a given chain

    Type Parameters

    • C extends "Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia"

    Parameters

    • chain: C

      The chain name or id of the token/representation

    • token: TokenAddress<C>

      The token address

    Returns Promise<bigint>

    The number of decimals

  • Returns the platform object, i.e. the class with platform-specific logic and methods

    Type Parameters

    • P extends "Solana" | "Algorand" | "Near" | "Sui" | "Aptos" | "Btc" | "Evm" | "Cosmwasm"

    Parameters

    • platformName: P

    Returns PlatformContext<N, P>

    the platform context class

    Throws

    Errors if platform is not found

  • Gets the associated token account for chains that require it (only Solana currently).

    Type Parameters

    • SC extends "Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia"

    • RC extends "Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia"

    Parameters

    • sendingChain: SC

      the chain name of the source token

    • sendingToken: TokenAddress<SC> | TokenId<SC>

      the TokenId or address of the source token

    • recipient: ChainAddress<RC>

      the address of the recipient

    Returns Promise<ChainAddress<RC>>

  • Get the status of a transaction, identified by the chain, emitter address, and sequence number

    Parameters

    • chain: "Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia"

      the chain name

    • emitter: UniversalAddress | NativeAddress<"Solana" | "Algorand" | "Near" | "Sui" | "Aptos" | "Btc" | "Evm" | "Cosmwasm">

      the emitter address

    • sequence: bigint

      the sequence number

    • timeout: number = DEFAULT_TASK_TIMEOUT

    Returns Promise<TransactionStatus>

    the TransactionStatus

  • Gets a VAA from the API or Guardian RPC, finality must be met before the VAA will be available.

    Type Parameters

    • T extends PayloadLiteral | PayloadDiscriminator

    • C extends "Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia"

    Parameters

    • chain: C

      The chain name

    • emitter: AccountAddress<C>

      The emitter address

    • sequence: bigint

      The sequence number

    • decodeAs: T
    • timeout: number = DEFAULT_TASK_TIMEOUT

      The total amount of time to wait for the VAA to be available

    Returns Promise<DistributiveVAA<ExtractLiteral<T>>>

    The VAA if available

    Throws

    Errors if the VAA is not available after the retries

  • Gets the Raw VAA Bytes from the API or Guardian RPC, finality must be met before the VAA will be available.

    Type Parameters

    • C extends "Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia"

    Parameters

    • chain: C

      The chain name

    • emitter: AccountAddress<C>

      The emitter address

    • sequence: bigint

      The sequence number

    • timeout: number = DEFAULT_TASK_TIMEOUT

    Returns Promise<Uint8Array>

    The VAA bytes if available

    Throws

    Errors if the VAA is not available after the retries

  • Gets the TokenId for a token representation on any chain These are the Wormhole wrapped token addresses, not necessarily the cannonical version of that token

    Type Parameters

    • C extends "Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia"

    Parameters

    • chain: C

      The chain name or id to get the wrapped token address

    • token: TokenId<"Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia">

    Returns Promise<TokenId<C>>

    The TokenId on the given chain, null if it does not exist

    Throws

    Errors if the chain is not supported or the token does not exist

  • Parse an address to a universal address

    Type Parameters

    • C extends "Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia"

    Parameters

    • chain: C
    • address: string

      The native address

    Returns NativeAddress<C>

    The address in the universal format

  • Parses all relevant information from a transaction given the sending tx hash and sending chain

    Parameters

    • chain: "Solana" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Algorand" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Btc" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia"

      The sending chain name or id

    • txid: string
    • Optional timeout: number

    Returns Promise<WormholeMessageId[]>

    The parsed WormholeMessageId

  • Creates a TokenTransfer object to move a token from one chain to another

    Parameters

    • token: TokenId | "native"

      the token to transfer

    • amount: bigint

      the amount to transfer

    • from: ChainAddress

      the address to transfer from

    • to: ChainAddress

      the address to transfer to

    • automatic: boolean

      whether to use automatic delivery

    • Optional payload: Uint8Array

      the payload to send with the transfer

    • Optional nativeGas: bigint

      the amount of native gas to send with the transfer

    Returns Promise<TokenTransfer<N>>

    the TokenTransfer object

    Throws

    Errors if the chain or protocol is not supported

Generated using TypeDoc