Hierarchy

  • Wormhole

Constructors

Properties

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

Accessors

Methods

  • Creates a CCTPTransfer 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<CCTPTransfer>

    the CCTPTransfer object

    Throws

    Errors if the chain or protocol is not supported

  • Fetches the balance of a given token for a wallet

    Parameters

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

      The chain name or id

    • token: NativeAddress<"Evm" | "Solana" | "Cosmwasm" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near"> | UniversalAddress | "native"
    • walletAddress: string

      The wallet address

    Returns Promise<null | 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

    Parameters

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

      the chain name

    Returns ChainContext<"Evm" | "Solana" | "Cosmwasm" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near">

    the chain context class

    Throws

    Errors if context is not found

  • Parameters

    • msgHash: string
    • timeout: number = DEFAULT_TASK_TIMEOUT

    Returns Promise<null | string>

  • Gets the contract addresses for a given chain

    Parameters

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

      the chain name or chain id

    Returns undefined | Contracts

    the contract addresses

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

    Parameters

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

      The chain name or id of the token/representation

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

    Returns Promise<bigint>

    The number of decimals

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

    Parameters

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

      the chain name or platform name

    Returns Platform<"Evm" | "Solana" | "Cosmwasm" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near">

    the platform context class

    Throws

    Errors if platform is not found

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

    Parameters

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

      the chain name of the source token

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

      the TokenId or address of the source token

    • recipient: ChainAddress

      the address of the recipient

    Returns Promise<ChainAddress>

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

    Parameters

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

      the chain name

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

      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

    Parameters

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

      The chain name

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

      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<undefined | 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.

    Parameters

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

      The chain name

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

      The emitter address

    • sequence: bigint

      The sequence number

    • timeout: number = DEFAULT_TASK_TIMEOUT

    Returns Promise<undefined | 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

    Parameters

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

      The chain name or id

    • token: TokenId

    Returns Promise<TokenId>

    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

  • Converts a human friendly decimal number to base units for the token passed

    Parameters

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

      The chain name

    • token: NativeAddress<"Evm" | "Solana" | "Cosmwasm" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near"> | UniversalAddress | "native"
    • amount: string | number

      The decimal number as a string to convert into base units

    Returns Promise<bigint>

    The amount converted to base units as a BigNumber

  • Parse an address to a universal address

    Parameters

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

      The native address

    Returns NativeAddress<"Evm" | "Solana" | "Cosmwasm" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near">

    The address in the universal format

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

    Parameters

    • chain: "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "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>

    the TokenTransfer object

    Throws

    Errors if the chain or protocol is not supported

Generated using TypeDoc