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"

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

    Parameters

    • chain: C

      the chain name

    Returns ChainContext<N, P, C>

    the chain context class

    Throws

    Errors if context is not found

  • Gets the CircleAttestation corresponding to the message hash logged in the transfer transaction.

    Parameters

    • msgHash: string

      The keccak256 hash of the message emitted by the circle contract

    • timeout: number = DEFAULT_TASK_TIMEOUT

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

    Returns Promise<string>

    The CircleAttestation as a string, if available

    Throws

    Errors if the CircleAttestation is not available after the retries

  • 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

  • Taking a the original TokenId for some wrapped token 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

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

    The Original TokenId corresponding to the token id passed,

    Throws

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

  • 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

    • 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

    • recipient: ChainAddress<C>

      the address of the primary account that may require a separate token account

    • token: TokenId<C>

      the TokenId of the token to get the token account for

    Returns Promise<ChainAddress<C>>

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

    Parameters

    • wormholeMessageId: WormholeMessageId

      the message id for the Wormhole Message to get transaction status for

    • 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

    • wormholeMessageId: WormholeMessageId

      The WormholeMessageId corresponding to the VAA to be fetched

    • decodeAs: T

      The VAA type to decode the bytes as

    • 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 a VAA from the API or Guardian RPC, finality must be met before the VAA will be available.

    Type Parameters

    Parameters

    • txid: string

      The Transaction Hash corresponding to the transaction that cause the wormhole core contract to emit a vaa

    • decodeAs: T

      The VAA type to decode the bytes as

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

    Parameters

    • wormholeMessageId: WormholeMessageId

      The WormholeMessageId corresponding to the VAA to be fetched

    • timeout: number = DEFAULT_TASK_TIMEOUT

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

    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

  • 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

  • Parse an address from its canonincal string format to a NativeAddress

    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 the address is for

    • address: string

      The native address in canonical string format

    Returns ChainAddress<C>

    The ChainAddress

  • Parse an address from its canonincal string format to a NativeAddress

    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 the address is for

    • address: string

      The address in canonical string format

    Returns NativeAddress<C>

    The address in the NativeAddress format

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

    Type Parameters

    • N extends "Mainnet" | "Testnet" | "Devnet"

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

    • 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: ChainContext<N, P, C>

      The sending chain name or context

    • txid: string
    • Optional timeout: number

    Returns Promise<WormholeMessageId[]>

    The parsed WormholeMessageId

Generated using TypeDoc