Options
All
  • Public
  • Public/Protected
  • All
Menu

@certusone/wormhole-sdk

Index

References

Namespaces

Enumerations

Interfaces

Type aliases

Variables

Functions

References

getSignedBatchVAAWithRetry

Re-exports getSignedBatchVAAWithRetry

getSignedVAAWithRetry

Re-exports getSignedVAAWithRetry

postVaaSolana

Re-exports postVaaSolana

postVaaSolanaWithRetry

Re-exports postVaaSolanaWithRetry

Type aliases

ChainContracts

ChainContracts: {[ chain in ChainName]: Contracts }

ChainId

ChainId: typeof CHAINS[ChainName]

ChainIdToName

ChainIdToName: {-readonly [ key in keyof typeof CHAINS as typeof CHAINS[key]]-?: key }

ChainName

ChainName: keyof typeof CHAINS

ContractUpgrade

ContractUpgrade: CoreContractUpgrade | PortalContractUpgrade<"TokenBridge"> | PortalContractUpgrade<"NFTBridge">

Contracts

Contracts: { core: string | undefined; nft_bridge: string | undefined; token_bridge: string | undefined }

Type declaration

  • core: string | undefined
  • nft_bridge: string | undefined
  • token_bridge: string | undefined

CosmWasmChainId

CosmWasmChainId: typeof CHAINS[CosmWasmChainName]

CosmWasmChainName

CosmWasmChainName: "terra" | "terra2" | "injective" | "xpla" | "sei"

EVMChainId

EVMChainId: typeof CHAINS[EVMChainName]

All the EVM-based chain ids that Wormhole supports

EVMChainName

EVMChainName: "ethereum" | "bsc" | "polygon" | "avalanche" | "oasis" | "aurora" | "fantom" | "karura" | "acala" | "klaytn" | "celo" | "moonbeam" | "neon" | "arbitrum" | "optimism" | "gnosis" | "base" | "sepolia"

All the EVM-based chain names that Wormhole supports

Encoding

Encoding: "uint8" | "uint16" | "uint32" | "uint64" | "uint128" | "uint256" | "bytes32" | "address"

Network

Network: "MAINNET" | "TESTNET" | "DEVNET"

ParsedAttestMetaVaa

ParsedAttestMetaVaa: ParsedAssetMetaVaa

Payload

SignedVaa

SignedVaa: Uint8Array | Buffer

SolanaChainName

SolanaChainName: "solana" | "pythnet"

All the Solana-based chain names that Wormhole supports

TerraChainId

TerraChainId: typeof CHAINS[TerraChainName]

TerraChainName

TerraChainName: "terra" | "terra2"

Variables

Const APTOS_DEPLOYER_ADDRESS

APTOS_DEPLOYER_ADDRESS: "0108bc32f7de18a5f6e1e7d6ee7aff9f5fc858d0d87ac0da94dd8d2a5d267d6b" = "0108bc32f7de18a5f6e1e7d6ee7aff9f5fc858d0d87ac0da94dd8d2a5d267d6b"

Const APTOS_DEPLOYER_ADDRESS_DEVNET

APTOS_DEPLOYER_ADDRESS_DEVNET: "277fa055b6a73c42c0662d5236c65c864ccbf2d4abd21f174a30c8b786eab84b" = "277fa055b6a73c42c0662d5236c65c864ccbf2d4abd21f174a30c8b786eab84b"

Const APTOS_TOKEN_BRIDGE_EMITTER_ADDRESS

APTOS_TOKEN_BRIDGE_EMITTER_ADDRESS: "0000000000000000000000000000000000000000000000000000000000000001" = "0000000000000000000000000000000000000000000000000000000000000001"

Const CHAINS

CHAINS: { acala: 12; algorand: 8; aptos: 22; arbitrum: 23; aurora: 9; avalanche: 6; base: 30; bsc: 4; btc: 29; celo: 14; ethereum: 2; fantom: 10; gnosis: 25; injective: 19; karura: 11; klaytn: 13; moonbeam: 16; near: 15; neon: 17; oasis: 7; optimism: 24; osmosis: 20; polygon: 5; pythnet: 26; sei: 32; sepolia: 10002; solana: 1; sui: 21; terra: 3; terra2: 18; unset: 0; wormchain: 3104; xpla: 28 } = ...

Type declaration

  • acala: 12
  • algorand: 8
  • aptos: 22
  • arbitrum: 23
  • aurora: 9
  • avalanche: 6
  • base: 30
  • bsc: 4
  • btc: 29
  • celo: 14
  • ethereum: 2
  • fantom: 10
  • gnosis: 25
  • injective: 19
  • karura: 11
  • klaytn: 13
  • moonbeam: 16
  • near: 15
  • neon: 17
  • oasis: 7
  • optimism: 24
  • osmosis: 20
  • polygon: 5
  • pythnet: 26
  • sei: 32
  • sepolia: 10002
  • solana: 1
  • sui: 21
  • terra: 3
  • terra2: 18
  • unset: 0
  • wormchain: 3104
  • xpla: 28

Const CHAIN_ID_ACALA

CHAIN_ID_ACALA: 12 = ...

Const CHAIN_ID_ALGORAND

CHAIN_ID_ALGORAND: 8 = ...

Const CHAIN_ID_APTOS

CHAIN_ID_APTOS: 22 = ...

Const CHAIN_ID_ARBITRUM

CHAIN_ID_ARBITRUM: 23 = ...

Const CHAIN_ID_AURORA

CHAIN_ID_AURORA: 9 = ...

Const CHAIN_ID_AVAX

CHAIN_ID_AVAX: 6 = ...

Const CHAIN_ID_BASE

CHAIN_ID_BASE: 30 = ...

Const CHAIN_ID_BSC

CHAIN_ID_BSC: 4 = ...

Const CHAIN_ID_BTC

CHAIN_ID_BTC: 29 = ...

Const CHAIN_ID_CELO

CHAIN_ID_CELO: 14 = ...

Const CHAIN_ID_ETH

CHAIN_ID_ETH: 2 = ...

Const CHAIN_ID_FANTOM

CHAIN_ID_FANTOM: 10 = ...

Const CHAIN_ID_GNOSIS

CHAIN_ID_GNOSIS: 25 = ...

Const CHAIN_ID_INJECTIVE

CHAIN_ID_INJECTIVE: 19 = ...

Const CHAIN_ID_KARURA

CHAIN_ID_KARURA: 11 = ...

Const CHAIN_ID_KLAYTN

CHAIN_ID_KLAYTN: 13 = ...

Const CHAIN_ID_MOONBEAM

CHAIN_ID_MOONBEAM: 16 = ...

Const CHAIN_ID_NEAR

CHAIN_ID_NEAR: 15 = ...

Const CHAIN_ID_NEON

CHAIN_ID_NEON: 17 = ...

Const CHAIN_ID_OASIS

CHAIN_ID_OASIS: 7 = ...

Const CHAIN_ID_OPTIMISM

CHAIN_ID_OPTIMISM: 24 = ...

Const CHAIN_ID_OSMOSIS

CHAIN_ID_OSMOSIS: 20 = ...

Const CHAIN_ID_POLYGON

CHAIN_ID_POLYGON: 5 = ...

Const CHAIN_ID_PYTHNET

CHAIN_ID_PYTHNET: 26 = ...

Const CHAIN_ID_SEI

CHAIN_ID_SEI: 32 = ...

Const CHAIN_ID_SEPOLIA

CHAIN_ID_SEPOLIA: 10002 = ...

Const CHAIN_ID_SOLANA

CHAIN_ID_SOLANA: 1 = ...

Const CHAIN_ID_SUI

CHAIN_ID_SUI: 21 = ...

Const CHAIN_ID_TERRA

CHAIN_ID_TERRA: 3 = ...

Const CHAIN_ID_TERRA2

CHAIN_ID_TERRA2: 18 = ...

Const CHAIN_ID_TO_NAME

CHAIN_ID_TO_NAME: ChainIdToName = ...

Const CHAIN_ID_UNSET

CHAIN_ID_UNSET: 0 = ...

Const CHAIN_ID_WORMCHAIN

CHAIN_ID_WORMCHAIN: 3104 = ...

Const CHAIN_ID_XPLA

CHAIN_ID_XPLA: 28 = ...

Const CONTRACTS

CONTRACTS: { DEVNET: { acala: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; algorand: { core: string; nft_bridge: undefined; token_bridge: string }; aptos: { core: string; nft_bridge: string; token_bridge: string }; arbitrum: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; aurora: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; avalanche: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; base: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; bsc: { core: string; nft_bridge: string; token_bridge: string }; btc: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; celo: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; ethereum: { core: string; nft_bridge: string; token_bridge: string }; fantom: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; gnosis: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; injective: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; karura: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; klaytn: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; moonbeam: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; near: { core: string; nft_bridge: undefined; token_bridge: string }; neon: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; oasis: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; optimism: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; osmosis: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; polygon: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; pythnet: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; sei: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; sepolia: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; solana: { core: string; nft_bridge: string; token_bridge: string }; sui: { core: string; nft_bridge: undefined; token_bridge: string }; terra: { core: string; nft_bridge: string; token_bridge: string }; terra2: { core: string; nft_bridge: undefined; token_bridge: string }; unset: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; wormchain: { core: string; nft_bridge: undefined; token_bridge: string }; xpla: { core: undefined; nft_bridge: undefined; token_bridge: undefined } }; MAINNET: { acala: { core: string; nft_bridge: string; token_bridge: string }; algorand: { core: string; nft_bridge: undefined; token_bridge: string }; aptos: { core: string; nft_bridge: string; token_bridge: string }; arbitrum: { core: string; nft_bridge: string; token_bridge: string }; aurora: { core: string; nft_bridge: string; token_bridge: string }; avalanche: { core: string; nft_bridge: string; token_bridge: string }; base: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; bsc: { core: string; nft_bridge: string; token_bridge: string }; btc: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; celo: { core: string; nft_bridge: string; token_bridge: string }; ethereum: { core: string; nft_bridge: string; token_bridge: string }; fantom: { core: string; nft_bridge: string; token_bridge: string }; gnosis: { core: string; nft_bridge: undefined; token_bridge: undefined }; injective: { core: string; nft_bridge: undefined; token_bridge: string }; karura: { core: string; nft_bridge: string; token_bridge: string }; klaytn: { core: string; nft_bridge: string; token_bridge: string }; moonbeam: { core: string; nft_bridge: string; token_bridge: string }; near: { core: string; nft_bridge: undefined; token_bridge: string }; neon: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; oasis: { core: string; nft_bridge: string; token_bridge: string }; optimism: { core: string; nft_bridge: string; token_bridge: string }; osmosis: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; polygon: { core: string; nft_bridge: string; token_bridge: string }; pythnet: { core: string; nft_bridge: undefined; token_bridge: undefined }; sei: { core: string; nft_bridge: undefined; token_bridge: string }; sepolia: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; solana: { core: string; nft_bridge: string; token_bridge: string }; sui: { core: string; nft_bridge: undefined; token_bridge: string }; terra: { core: string; nft_bridge: undefined; token_bridge: string }; terra2: { core: string; nft_bridge: undefined; token_bridge: string }; unset: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; wormchain: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; xpla: { core: string; nft_bridge: undefined; token_bridge: string } }; TESTNET: { acala: { core: string; nft_bridge: string; token_bridge: string }; algorand: { core: string; nft_bridge: undefined; token_bridge: string }; aptos: { core: string; nft_bridge: undefined; token_bridge: string }; arbitrum: { core: string; nft_bridge: string; token_bridge: string }; aurora: { core: string; nft_bridge: string; token_bridge: string }; avalanche: { core: string; nft_bridge: string; token_bridge: string }; base: { core: string; nft_bridge: string; token_bridge: string }; bsc: { core: string; nft_bridge: string; token_bridge: string }; btc: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; celo: { core: string; nft_bridge: string; token_bridge: string }; ethereum: { core: string; nft_bridge: string; token_bridge: string }; fantom: { core: string; nft_bridge: string; token_bridge: string }; gnosis: { core: string; nft_bridge: undefined; token_bridge: undefined }; injective: { core: string; nft_bridge: undefined; token_bridge: string }; karura: { core: string; nft_bridge: string; token_bridge: string }; klaytn: { core: string; nft_bridge: string; token_bridge: string }; moonbeam: { core: string; nft_bridge: string; token_bridge: string }; near: { core: string; nft_bridge: undefined; token_bridge: string }; neon: { core: string; nft_bridge: string; token_bridge: string }; oasis: { core: string; nft_bridge: string; token_bridge: string }; optimism: { core: string; nft_bridge: string; token_bridge: string }; osmosis: { core: string; nft_bridge: undefined; token_bridge: undefined }; polygon: { core: string; nft_bridge: string; token_bridge: string }; pythnet: { core: string; nft_bridge: undefined; token_bridge: undefined }; sei: { core: string; nft_bridge: undefined; token_bridge: string }; sepolia: { core: string; nft_bridge: string; token_bridge: string }; solana: { core: string; nft_bridge: string; token_bridge: string }; sui: { core: string; nft_bridge: undefined; token_bridge: string }; terra: { core: string; nft_bridge: undefined; token_bridge: string }; terra2: { core: string; nft_bridge: undefined; token_bridge: string }; unset: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; wormchain: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; xpla: { core: string; nft_bridge: undefined; token_bridge: string } } } = ...

Contracts addresses on testnet and mainnet

Type declaration

  • DEVNET: { acala: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; algorand: { core: string; nft_bridge: undefined; token_bridge: string }; aptos: { core: string; nft_bridge: string; token_bridge: string }; arbitrum: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; aurora: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; avalanche: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; base: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; bsc: { core: string; nft_bridge: string; token_bridge: string }; btc: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; celo: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; ethereum: { core: string; nft_bridge: string; token_bridge: string }; fantom: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; gnosis: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; injective: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; karura: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; klaytn: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; moonbeam: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; near: { core: string; nft_bridge: undefined; token_bridge: string }; neon: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; oasis: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; optimism: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; osmosis: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; polygon: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; pythnet: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; sei: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; sepolia: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; solana: { core: string; nft_bridge: string; token_bridge: string }; sui: { core: string; nft_bridge: undefined; token_bridge: string }; terra: { core: string; nft_bridge: string; token_bridge: string }; terra2: { core: string; nft_bridge: undefined; token_bridge: string }; unset: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; wormchain: { core: string; nft_bridge: undefined; token_bridge: string }; xpla: { core: undefined; nft_bridge: undefined; token_bridge: undefined } }
    • acala: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • algorand: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • aptos: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • arbitrum: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • aurora: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • avalanche: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • base: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • bsc: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • btc: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • celo: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • ethereum: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • fantom: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • gnosis: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • injective: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • karura: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • klaytn: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • moonbeam: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • near: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • neon: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • oasis: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • optimism: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • osmosis: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • polygon: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • pythnet: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • sei: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • sepolia: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • solana: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • sui: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • terra: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • terra2: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • unset: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • wormchain: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • xpla: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
  • MAINNET: { acala: { core: string; nft_bridge: string; token_bridge: string }; algorand: { core: string; nft_bridge: undefined; token_bridge: string }; aptos: { core: string; nft_bridge: string; token_bridge: string }; arbitrum: { core: string; nft_bridge: string; token_bridge: string }; aurora: { core: string; nft_bridge: string; token_bridge: string }; avalanche: { core: string; nft_bridge: string; token_bridge: string }; base: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; bsc: { core: string; nft_bridge: string; token_bridge: string }; btc: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; celo: { core: string; nft_bridge: string; token_bridge: string }; ethereum: { core: string; nft_bridge: string; token_bridge: string }; fantom: { core: string; nft_bridge: string; token_bridge: string }; gnosis: { core: string; nft_bridge: undefined; token_bridge: undefined }; injective: { core: string; nft_bridge: undefined; token_bridge: string }; karura: { core: string; nft_bridge: string; token_bridge: string }; klaytn: { core: string; nft_bridge: string; token_bridge: string }; moonbeam: { core: string; nft_bridge: string; token_bridge: string }; near: { core: string; nft_bridge: undefined; token_bridge: string }; neon: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; oasis: { core: string; nft_bridge: string; token_bridge: string }; optimism: { core: string; nft_bridge: string; token_bridge: string }; osmosis: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; polygon: { core: string; nft_bridge: string; token_bridge: string }; pythnet: { core: string; nft_bridge: undefined; token_bridge: undefined }; sei: { core: string; nft_bridge: undefined; token_bridge: string }; sepolia: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; solana: { core: string; nft_bridge: string; token_bridge: string }; sui: { core: string; nft_bridge: undefined; token_bridge: string }; terra: { core: string; nft_bridge: undefined; token_bridge: string }; terra2: { core: string; nft_bridge: undefined; token_bridge: string }; unset: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; wormchain: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; xpla: { core: string; nft_bridge: undefined; token_bridge: string } }
    • acala: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • algorand: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • aptos: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • arbitrum: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • aurora: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • avalanche: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • base: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • bsc: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • btc: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • celo: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • ethereum: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • fantom: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • gnosis: { core: string; nft_bridge: undefined; token_bridge: undefined }
      • core: string
      • nft_bridge: undefined
      • token_bridge: undefined
    • injective: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • karura: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • klaytn: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • moonbeam: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • near: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • neon: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • oasis: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • optimism: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • osmosis: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • polygon: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • pythnet: { core: string; nft_bridge: undefined; token_bridge: undefined }
      • core: string
      • nft_bridge: undefined
      • token_bridge: undefined
    • sei: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • sepolia: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • solana: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • sui: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • terra: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • terra2: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • unset: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • wormchain: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • xpla: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
  • TESTNET: { acala: { core: string; nft_bridge: string; token_bridge: string }; algorand: { core: string; nft_bridge: undefined; token_bridge: string }; aptos: { core: string; nft_bridge: undefined; token_bridge: string }; arbitrum: { core: string; nft_bridge: string; token_bridge: string }; aurora: { core: string; nft_bridge: string; token_bridge: string }; avalanche: { core: string; nft_bridge: string; token_bridge: string }; base: { core: string; nft_bridge: string; token_bridge: string }; bsc: { core: string; nft_bridge: string; token_bridge: string }; btc: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; celo: { core: string; nft_bridge: string; token_bridge: string }; ethereum: { core: string; nft_bridge: string; token_bridge: string }; fantom: { core: string; nft_bridge: string; token_bridge: string }; gnosis: { core: string; nft_bridge: undefined; token_bridge: undefined }; injective: { core: string; nft_bridge: undefined; token_bridge: string }; karura: { core: string; nft_bridge: string; token_bridge: string }; klaytn: { core: string; nft_bridge: string; token_bridge: string }; moonbeam: { core: string; nft_bridge: string; token_bridge: string }; near: { core: string; nft_bridge: undefined; token_bridge: string }; neon: { core: string; nft_bridge: string; token_bridge: string }; oasis: { core: string; nft_bridge: string; token_bridge: string }; optimism: { core: string; nft_bridge: string; token_bridge: string }; osmosis: { core: string; nft_bridge: undefined; token_bridge: undefined }; polygon: { core: string; nft_bridge: string; token_bridge: string }; pythnet: { core: string; nft_bridge: undefined; token_bridge: undefined }; sei: { core: string; nft_bridge: undefined; token_bridge: string }; sepolia: { core: string; nft_bridge: string; token_bridge: string }; solana: { core: string; nft_bridge: string; token_bridge: string }; sui: { core: string; nft_bridge: undefined; token_bridge: string }; terra: { core: string; nft_bridge: undefined; token_bridge: string }; terra2: { core: string; nft_bridge: undefined; token_bridge: string }; unset: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; wormchain: { core: undefined; nft_bridge: undefined; token_bridge: undefined }; xpla: { core: string; nft_bridge: undefined; token_bridge: string } }
    • acala: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • algorand: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • aptos: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • arbitrum: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • aurora: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • avalanche: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • base: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • bsc: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • btc: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • celo: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • ethereum: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • fantom: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • gnosis: { core: string; nft_bridge: undefined; token_bridge: undefined }
      • core: string
      • nft_bridge: undefined
      • token_bridge: undefined
    • injective: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • karura: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • klaytn: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • moonbeam: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • near: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • neon: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • oasis: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • optimism: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • osmosis: { core: string; nft_bridge: undefined; token_bridge: undefined }
      • core: string
      • nft_bridge: undefined
      • token_bridge: undefined
    • polygon: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • pythnet: { core: string; nft_bridge: undefined; token_bridge: undefined }
      • core: string
      • nft_bridge: undefined
      • token_bridge: undefined
    • sei: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • sepolia: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • solana: { core: string; nft_bridge: string; token_bridge: string }
      • core: string
      • nft_bridge: string
      • token_bridge: string
    • sui: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • terra: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • terra2: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string
    • unset: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • wormchain: { core: undefined; nft_bridge: undefined; token_bridge: undefined }
      • core: undefined
      • nft_bridge: undefined
      • token_bridge: undefined
    • xpla: { core: string; nft_bridge: undefined; token_bridge: string }
      • core: string
      • nft_bridge: undefined
      • token_bridge: string

Const MAX_VAA_DECIMALS

MAX_VAA_DECIMALS: 8 = 8

Const METADATA_REPLACE

METADATA_REPLACE: RegExp = ...

Const TERRA_REDEEMED_CHECK_WALLET_ADDRESS

TERRA_REDEEMED_CHECK_WALLET_ADDRESS: "terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v" = "terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v"

Const WSOL_ADDRESS

WSOL_ADDRESS: "So11111111111111111111111111111111111111112" = "So11111111111111111111111111111111111111112"

Const WSOL_DECIMALS

WSOL_DECIMALS: 9 = 9

Functions

approveEth

  • approveEth(tokenBridgeAddress: string, tokenAddress: string, signer: ethers.Signer, amount: ethers.BigNumberish, overrides?: Overrides & { from?: string | Promise<string> }): Promise<ContractReceipt>
  • Parameters

    • tokenBridgeAddress: string
    • tokenAddress: string
    • signer: ethers.Signer
    • amount: ethers.BigNumberish
    • overrides: Overrides & { from?: string | Promise<string> } = {}

    Returns Promise<ContractReceipt>

assertChain

  • assertChain(chain: number | string): asserts chain is "unset" | "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" | "wormchain" | "sepolia" | ChainId
  • Asserts that the given number or string is a valid chain, and throws otherwise. After calling this function, the type of chain will be narrowed to ChainId or ChainName thanks to the type assertion in the return type.

    A typical use-case might look like

    // c has type 'string'
    assertChain(c)
    // c now has type 'ChainName'
    

    Parameters

    • chain: number | string

    Returns asserts chain is "unset" | "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" | "wormchain" | "sepolia" | ChainId

assertEVMChain

assertKnownPayload

attestFromAlgorand

  • attestFromAlgorand(client: Algodv2, tokenBridgeId: bigint, bridgeId: bigint, senderAddr: string, assetId: bigint): Promise<TransactionSignerPair[]>
  • Attest an already created asset If you create a new asset on algorand and want to transfer it elsewhere, you create an attestation for it on algorand... pass that vaa to the target chain.. submit it.. then you can transfer from algorand to that target chain

    Parameters

    • client: Algodv2

      An Algodv2 client

    • tokenBridgeId: bigint

      The ID of the token bridge

    • bridgeId: bigint
    • senderAddr: string
    • assetId: bigint

      The asset index

    Returns Promise<TransactionSignerPair[]>

    Transaction ID

attestFromAptos

  • attestFromAptos(tokenBridgeAddress: string, tokenChain: ChainId, tokenAddress: string): Types.EntryFunctionPayload
  • Attest given token from Aptos.

    Parameters

    • tokenBridgeAddress: string

      Address of token bridge

    • tokenChain: ChainId

      Origin chain ID

    • tokenAddress: string

      Address of token on origin chain

    Returns Types.EntryFunctionPayload

    Transaction payload

attestFromEth

  • attestFromEth(tokenBridgeAddress: string, signer: ethers.Signer, tokenAddress: string, overrides?: PayableOverrides & { from?: string | Promise<string> }): Promise<ethers.ContractReceipt>
  • Parameters

    • tokenBridgeAddress: string
    • signer: ethers.Signer
    • tokenAddress: string
    • overrides: PayableOverrides & { from?: string | Promise<string> } = {}

    Returns Promise<ethers.ContractReceipt>

attestFromInjective

  • attestFromInjective(tokenBridgeAddress: string, walletAddress: string, asset: string): Promise<MsgExecuteContractInjective>
  • Creates attestation message

    Parameters

    • tokenBridgeAddress: string

      Address of Inj token bridge contract

    • walletAddress: string

      Address of wallet in inj format

    • asset: string

      Name or address of the asset to be attested For native assets the asset string is the denomination. For foreign assets the asset string is the inj address of the foreign asset

    Returns Promise<MsgExecuteContractInjective>

    Message to be broadcast

attestFromSolana

  • attestFromSolana(connection: Connection, bridgeAddress: PublicKeyInitData, tokenBridgeAddress: PublicKeyInitData, payerAddress: PublicKeyInitData, mintAddress: PublicKeyInitData, commitment?: Commitment): Promise<Transaction>
  • Parameters

    • connection: Connection
    • bridgeAddress: PublicKeyInitData
    • tokenBridgeAddress: PublicKeyInitData
    • payerAddress: PublicKeyInitData
    • mintAddress: PublicKeyInitData
    • Optional commitment: Commitment

    Returns Promise<Transaction>

attestFromSui

  • attestFromSui(provider: JsonRpcProvider, coreBridgeStateObjectId: string, tokenBridgeStateObjectId: string, coinType: string, feeAmount?: BigInt): Promise<TransactionBlock>
  • Parameters

    • provider: JsonRpcProvider
    • coreBridgeStateObjectId: string
    • tokenBridgeStateObjectId: string
    • coinType: string
    • feeAmount: BigInt = ...

    Returns Promise<TransactionBlock>

attestFromTerra

  • attestFromTerra(tokenBridgeAddress: string, walletAddress: string, asset: string): Promise<MsgExecuteContract>
  • Parameters

    • tokenBridgeAddress: string
    • walletAddress: string
    • asset: string

    Returns Promise<MsgExecuteContract>

attestFromXpla

  • attestFromXpla(tokenBridgeAddress: string, walletAddress: string, asset: string): XplaMsgExecuteContract
  • Parameters

    • tokenBridgeAddress: string
    • walletAddress: string
    • asset: string

    Returns XplaMsgExecuteContract

attestNearFromNear

  • attestNearFromNear(provider: Provider, coreBridge: string, tokenBridge: string): Promise<FunctionCallOptions>

attestTokenFromNear

  • attestTokenFromNear(provider: Provider, coreBridge: string, tokenBridge: string, asset: string): Promise<FunctionCallOptions[]>
  • Parameters

    • provider: Provider
    • coreBridge: string
    • tokenBridge: string
    • asset: string

    Returns Promise<FunctionCallOptions[]>

buildTokenId

callFunctionNear

  • callFunctionNear(provider: Provider, accountId: string, methodName: string, args?: any): Promise<any>
  • Parameters

    • provider: Provider
    • accountId: string
    • methodName: string
    • Optional args: any

    Returns Promise<any>

chunks

  • chunks<T>(array: T[], size: number): T[][]

coalesceChainId

coalesceChainName

coalesceCosmWasmChainId

Const coalesceModuleAddress

  • coalesceModuleAddress(str: string): string
  • Returns module address from given fully qualified type/module address.

    Parameters

    • str: string

      FQT or module address

    Returns string

    Module address

createNonce

  • createNonce(): Buffer

createWrappedOnAlgorand

  • createWrappedOnAlgorand(client: Algodv2, tokenBridgeId: bigint, bridgeId: bigint, senderAddr: string, attestVAA: Uint8Array): Promise<TransactionSignerPair[]>

createWrappedOnAptos

  • createWrappedOnAptos(tokenBridgeAddress: string, attestVAA: Uint8Array): Types.EntryFunctionPayload
  • Constructs payload to create wrapped asset.

    Note that this function is typically called in tandem with createWrappedTypeOnAptos because we must first create the CoinType that is used by create_wrapped_coin<CoinType>. Since it's not possible to create a resource and use it in the same transaction, this is broken into separate transactions.

    Parameters

    • tokenBridgeAddress: string

      Address of token bridge

    • attestVAA: Uint8Array

      Bytes of attest VAA

    Returns Types.EntryFunctionPayload

    Transaction payload

createWrappedOnEth

  • createWrappedOnEth(tokenBridgeAddress: string, signer: ethers.Signer, signedVAA: Uint8Array, overrides?: Overrides & { from?: string | Promise<string> }): Promise<ethers.ContractReceipt>
  • Parameters

    • tokenBridgeAddress: string
    • signer: ethers.Signer
    • signedVAA: Uint8Array
    • overrides: Overrides & { from?: string | Promise<string> } = {}

    Returns Promise<ethers.ContractReceipt>

Const createWrappedOnInjective

  • createWrappedOnInjective(tokenBridgeAddress: string, walletAddress: string, signedVAA: Uint8Array): Promise<MsgExecuteContractInjective>
  • Parameters

    • tokenBridgeAddress: string
    • walletAddress: string
    • signedVAA: Uint8Array

    Returns Promise<MsgExecuteContractInjective>

createWrappedOnNear

  • createWrappedOnNear(provider: Provider, tokenBridge: string, attestVAA: Uint8Array): Promise<FunctionCallOptions[]>

createWrappedOnSolana

  • createWrappedOnSolana(connection: Connection, bridgeAddress: PublicKeyInitData, tokenBridgeAddress: PublicKeyInitData, payerAddress: PublicKeyInitData, signedVaa: SignedVaa, commitment?: Commitment): Promise<Transaction>
  • Parameters

    • connection: Connection
    • bridgeAddress: PublicKeyInitData
    • tokenBridgeAddress: PublicKeyInitData
    • payerAddress: PublicKeyInitData
    • signedVaa: SignedVaa
    • Optional commitment: Commitment

    Returns Promise<Transaction>

createWrappedOnSui

  • createWrappedOnSui(provider: JsonRpcProvider, coreBridgeStateObjectId: string, tokenBridgeStateObjectId: string, signerAddress: string, coinPackageId: string, wrappedAssetSetupType: string, attestVAA: Uint8Array): Promise<TransactionBlock>
  • Parameters

    • provider: JsonRpcProvider
    • coreBridgeStateObjectId: string
    • tokenBridgeStateObjectId: string
    • signerAddress: string
    • coinPackageId: string
    • wrappedAssetSetupType: string
    • attestVAA: Uint8Array

    Returns Promise<TransactionBlock>

createWrappedOnSuiPrepare

  • createWrappedOnSuiPrepare(provider: JsonRpcProvider, coreBridgeStateObjectId: string, tokenBridgeStateObjectId: string, decimals: number, signerAddress: string): Promise<TransactionBlock>
  • Parameters

    • provider: JsonRpcProvider
    • coreBridgeStateObjectId: string
    • tokenBridgeStateObjectId: string
    • decimals: number
    • signerAddress: string

    Returns Promise<TransactionBlock>

createWrappedOnTerra

  • createWrappedOnTerra(tokenBridgeAddress: string, walletAddress: string, signedVAA: Uint8Array): Promise<MsgExecuteContract>

createWrappedOnXpla

  • createWrappedOnXpla(tokenBridgeAddress: string, walletAddress: string, signedVAA: Uint8Array): XplaMsgExecuteContract

createWrappedTypeOnAptos

  • createWrappedTypeOnAptos(tokenBridgeAddress: string, attestVAA: Uint8Array): Types.EntryFunctionPayload
  • Constructs payload to create wrapped asset type. The type is of form {{address}}::coin::T, where address is sha256_hash(tokenBridgeAddress | chainID | "::" | originAddress | 0xFF).

    Note that the typical createWrapped call is broken into two parts on Aptos because we must first create the CoinType that is used by create_wrapped_coin<CoinType>. Since it's not possible to create a resource and use it in the same transaction, this is broken into separate transactions.

    Parameters

    • tokenBridgeAddress: string

      Address of token bridge

    • attestVAA: Uint8Array

      Bytes of attest VAA

    Returns Types.EntryFunctionPayload

    Transaction payload

Const deriveCollectionHashFromTokenId

  • deriveCollectionHashFromTokenId(tokenId: TokenId): Promise<Uint8Array>
  • Get a hash that uniquely identifies a collection on Aptos.

    Parameters

    • tokenId: TokenId

    Returns Promise<Uint8Array>

    Collection hash

Const deriveResourceAccountAddress

  • deriveResourceAccountAddress(nftBridgeAddress: string, originChain: "unset" | "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" | "wormchain" | "sepolia" | ChainId, originAddress: Uint8Array): Promise<null | string>
  • The NFT bridge creates resource accounts, which in turn create a collection and mint a single token for each transferred NFT. This method derives the address of that resource account from the given origin chain and address.

    Parameters

    • nftBridgeAddress: string
    • originChain: "unset" | "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" | "wormchain" | "sepolia" | ChainId
    • originAddress: Uint8Array

      External address of NFT on origin chain

    Returns Promise<null | string>

    Address of resource account

Const deriveTokenHashFromTokenId

  • deriveTokenHashFromTokenId(tokenId: TokenId): Promise<Uint8Array>
  • Get a hash that uniquely identifies a token on Aptos.

    Native tokens in Aptos are uniquely identified by a hash of creator address, collection name, token name, and property version. This hash is converted to a bigint in the tokenId field in NFT transfer VAAs.

    Parameters

    • tokenId: TokenId

    Returns Promise<Uint8Array>

    Token hash identifying the token

encode

  • encode(type: Encoding, val: any): string

encodeString

  • encodeString(str: string): Buffer

ensureHexPrefix

  • ensureHexPrefix(x: string): string

Const generateSignAndSubmitEntryFunction

  • generateSignAndSubmitEntryFunction(client: AptosClient, sender: AptosAccount, payload: EntryFunctionPayload, opts?: Partial<SubmitTransactionRequest>): Promise<UserTransaction$1>
  • Generate, sign, and submit a transaction calling the given entry function with the given arguments. Prevents transaction submission and throws if the transaction fails.

    This is separated from generateSignAndSubmitScript because it makes use of AptosClient's generateTransaction which pulls ABIs from the node and uses them to encode arguments automatically.

    Parameters

    • client: AptosClient

      Client used to transfer data to/from Aptos node

    • sender: AptosAccount

      Account that will submit transaction

    • payload: EntryFunctionPayload

      Payload containing unencoded fully qualified entry function, types, and arguments

    • Optional opts: Partial<SubmitTransactionRequest>

      Override default transaction options

    Returns Promise<UserTransaction$1>

    Data from transaction after is has been successfully submitted to mempool

Const generateSignAndSubmitScript

  • generateSignAndSubmitScript(client: AptosClient, sender: AptosAccount, payload: TransactionPayloadScript, opts?: Partial<SubmitTransactionRequest>): Promise<Transaction$1>
  • Generate, sign, and submit a transaction containing given bytecode. Prevents transaction submission and throws if the transaction fails.

    Unlike generateSignAndSubmitEntryFunction, this function must construct a RawTransaction manually because generateTransaction does not have support for scripts for which there are no corresponding on-chain ABIs. Type/argument encoding is left to the caller.

    Parameters

    • client: AptosClient

      Client used to transfer data to/from Aptos node

    • sender: AptosAccount

      Account that will submit transaction

    • payload: TransactionPayloadScript

      Payload containing compiled bytecode and encoded types/arguments

    • Optional opts: Partial<SubmitTransactionRequest>

      Override default transaction options

    Returns Promise<Transaction$1>

    Data from transaction after is has been successfully submitted to mempool

getAllowanceEth

  • getAllowanceEth(tokenBridgeAddress: string, tokenAddress: string, signer: ethers.Signer): Promise<BigNumber>

Const getAssetFullyQualifiedType

  • getAssetFullyQualifiedType(tokenBridgeAddress: string, originChain: ChainId, originAddress: string): null | string
  • Derives the fully qualified type of the asset defined by the given origin chain and address.

    Parameters

    • tokenBridgeAddress: string

      Address of token bridge (32 bytes)

    • originChain: ChainId

      Chain ID of chain that original asset is from

    • originAddress: string

      Native address of asset; if origin chain ID is 22 (Aptos), this is the asset's fully qualified type

    Returns null | string

    The fully qualified type on Aptos for the given asset

getClaimAddressSolana

  • getClaimAddressSolana(programAddress: PublicKeyInitData, signedVaa: SignedVaa): Promise<PublicKey>

getEmitterAddressAlgorand

  • getEmitterAddressAlgorand(appId: bigint): string

getEmitterAddressEth

  • getEmitterAddressEth(contractAddress: number | BytesLike | Hexable): string

Const getEmitterAddressInjective

  • getEmitterAddressInjective(programAddress: string): Promise<string>

getEmitterAddressNear

  • getEmitterAddressNear(programAddress: string): string

getEmitterAddressSolana

  • getEmitterAddressSolana(programAddress: PublicKeyInitData): string

getEmitterAddressTerra

  • getEmitterAddressTerra(programAddress: string): Promise<string>

Const getEmitterAddressXpla

  • getEmitterAddressXpla(programAddress: string): Promise<string>

Const getExternalAddressFromType

  • getExternalAddressFromType(fullyQualifiedType: string): string
  • Hashes the given type. Because fully qualified types are a concept unique to Aptos, this output acts as the address on other chains.

    Parameters

    • fullyQualifiedType: string

      Fully qualified type on Aptos

    Returns string

    External address corresponding to given type

Const getForeignAssetAddress

  • getForeignAssetAddress(tokenBridgeAddress: string, originChain: ChainId, originAddress: string): null | string
  • Derive the module address for an asset defined by the given origin chain and address.

    Parameters

    • tokenBridgeAddress: string

      Address of token bridge (32 bytes)

    • originChain: ChainId

      Chain ID of chain that original asset is from

    • originAddress: string

      Native address of asset

    Returns null | string

    The module address for the given asset

getForeignAssetAlgorand

  • getForeignAssetAlgorand(client: Algodv2, tokenBridgeId: bigint, chain: ChainId | ChainName, contract: string): Promise<bigint | null>

getForeignAssetAptos

  • getForeignAssetAptos(client: AptosClient, tokenBridgeAddress: string, originChain: ChainId | ChainName, originAddress: string): Promise<string | null>
  • Get qualified type of asset on Aptos given its origin info.

    Parameters

    • client: AptosClient

      Client used to transfer data to/from Aptos node

    • tokenBridgeAddress: string

      Address of token bridge

    • originChain: ChainId | ChainName

      Chain ID of chain asset is originally from

    • originAddress: string

      Asset address on origin chain

    Returns Promise<string | null>

    Fully qualified type of asset on Aptos

getForeignAssetEth

  • getForeignAssetEth(tokenBridgeAddress: string, provider: ethers.Signer | ethers.providers.Provider, originChain: ChainId | ChainName, originAsset: Uint8Array): Promise<string | null>
  • Returns a foreign asset address on Ethereum for a provided native chain and asset address, AddressZero if it does not exist

    Parameters

    • tokenBridgeAddress: string
    • provider: ethers.Signer | ethers.providers.Provider
    • originChain: ChainId | ChainName
    • originAsset: Uint8Array

      zero pad to 32 bytes

    Returns Promise<string | null>

getForeignAssetInjective

  • getForeignAssetInjective(tokenBridgeAddress: string, client: ChainGrpcWasmApi, originChain: ChainId | ChainName, originAsset: Uint8Array): Promise<string | null>
  • Returns the address of the foreign asset

    Parameters

    • tokenBridgeAddress: string

      Address of token bridge contact

    • client: ChainGrpcWasmApi

      Holds the wallet and signing information

    • originChain: ChainId | ChainName

      The chainId of the origin of the asset

    • originAsset: Uint8Array

      The address of the origin asset

    Returns Promise<string | null>

    The foreign asset address or null

getForeignAssetNear

  • getForeignAssetNear(provider: Provider, tokenAccount: string, chain: ChainId | ChainName, contract: string): Promise<string | null>

getForeignAssetSolana

  • getForeignAssetSolana(connection: Connection, tokenBridgeAddress: PublicKeyInitData, originChain: ChainId | ChainName, originAsset: Uint8Array, commitment?: Commitment): Promise<string | null>
  • Returns a foreign asset address on Solana for a provided native chain and asset address

    Parameters

    • connection: Connection
    • tokenBridgeAddress: PublicKeyInitData
    • originChain: ChainId | ChainName
    • originAsset: Uint8Array

      zero pad to 32 bytes

    • Optional commitment: Commitment

    Returns Promise<string | null>

getForeignAssetSui

  • getForeignAssetSui(provider: JsonRpcProvider, tokenBridgeStateObjectId: string, originChain: ChainId | ChainName, originAddress: Uint8Array): Promise<string | null>

getForeignAssetTerra

  • getForeignAssetTerra(tokenBridgeAddress: string, client: LCDClient, originChain: ChainId | ChainName, originAsset: Uint8Array): Promise<string | null>

getForeignAssetXpla

  • getForeignAssetXpla(tokenBridgeAddress: string, client: XplaLCDClient, originChain: ChainId | ChainName, originAsset: Uint8Array): Promise<string | null>

getGovernorIsVAAEnqueued

  • getGovernorIsVAAEnqueued(host: string, emitterChain: ChainId | ChainName, emitterAddress: string, sequence: string, extraGrpcOpts?: {}): Promise<GovernorIsVAAEnqueuedResponse>

getGovernorIsVAAEnqueuedWithRetry

  • getGovernorIsVAAEnqueuedWithRetry(hosts: string[], emitterChain: ChainId | ChainName, emitterAddress: string, sequence: string, extraGrpcOpts?: {}, retryTimeout?: number, retryAttempts?: number): Promise<GovernorIsVAAEnqueuedResponse>

getIsTransferCompletedAlgorand

  • getIsTransferCompletedAlgorand(client: Algodv2, appId: bigint, signedVAA: Uint8Array): Promise<boolean>
  • Returns true if this transfer was completed on Algorand

    Parameters

    • client: Algodv2

      AlgodV2 client

    • appId: bigint

      Most likely the Token bridge ID

    • signedVAA: Uint8Array

      VAA to check

    Returns Promise<boolean>

    true if VAA has been redeemed, false otherwise

getIsTransferCompletedAptos

  • getIsTransferCompletedAptos(client: AptosClient, tokenBridgeAddress: string, transferVAA: Uint8Array): Promise<boolean>
  • Determine whether or not the transfer in the given VAA has completed on Aptos.

    Parameters

    • client: AptosClient

      Client used to transfer data to/from Aptos node

    • tokenBridgeAddress: string

      Address of token bridge

    • transferVAA: Uint8Array

      Bytes of transfer VAA

    Returns Promise<boolean>

    True if transfer is completed

getIsTransferCompletedEth

  • getIsTransferCompletedEth(tokenBridgeAddress: string, provider: ethers.Signer | ethers.providers.Provider, signedVAA: Uint8Array): Promise<boolean>

getIsTransferCompletedInjective

  • getIsTransferCompletedInjective(tokenBridgeAddress: string, signedVAA: Uint8Array, client: ChainGrpcWasmApi): Promise<boolean>
  • Return if the VAA has been redeemed or not

    Parameters

    • tokenBridgeAddress: string

      The Injective token bridge contract address

    • signedVAA: Uint8Array

      The signed VAA byte array

    • client: ChainGrpcWasmApi

      Holds the wallet and signing information

    Returns Promise<boolean>

    true if the VAA has been redeemed.

getIsTransferCompletedNear

  • getIsTransferCompletedNear(provider: Provider, tokenBridge: string, signedVAA: Uint8Array): Promise<boolean>

getIsTransferCompletedSolana

  • getIsTransferCompletedSolana(tokenBridgeAddress: PublicKeyInitData, signedVAA: SignedVaa, connection: Connection, commitment?: Commitment): Promise<boolean>

getIsTransferCompletedSui

  • getIsTransferCompletedSui(provider: JsonRpcProvider, tokenBridgeStateObjectId: string, transferVAA: Uint8Array): Promise<boolean>

getIsTransferCompletedTerra

  • getIsTransferCompletedTerra(tokenBridgeAddress: string, signedVAA: Uint8Array, client: LCDClient, gasPriceUrl: string): Promise<boolean>

getIsTransferCompletedTerra2

  • getIsTransferCompletedTerra2(tokenBridgeAddress: string, signedVAA: Uint8Array, client: LCDClient): Promise<boolean>
  • This function is used to check if a VAA has been redeemed on terra2 by querying the token bridge contract.

    Parameters

    • tokenBridgeAddress: string

      The token bridge address (bech32)

    • signedVAA: Uint8Array

      The signed VAA byte array

    • client: LCDClient

      The LCD client. Only used for querying, not transactions will be signed

    Returns Promise<boolean>

getIsTransferCompletedXpla

  • getIsTransferCompletedXpla(tokenBridgeAddress: string, signedVAA: Uint8Array, client: XplaLCDClient): Promise<boolean>

getIsWrappedAssetAlgorand

  • getIsWrappedAssetAlgorand(client: Algodv2, tokenBridgeId: bigint, assetId: bigint): Promise<boolean>
  • Returns whethor or not an asset on Algorand is a wormhole wrapped asset

    Parameters

    • client: Algodv2

      Algodv2 client

    • tokenBridgeId: bigint

      token bridge ID

    • assetId: bigint

      Algorand asset index

    Returns Promise<boolean>

    true if the asset is wrapped

getIsWrappedAssetAptos

  • getIsWrappedAssetAptos(client: AptosClient, tokenBridgeAddress: string, assetFullyQualifiedType: string): Promise<boolean>
  • Determines whether or not given address is wrapped or native to Aptos.

    Parameters

    • client: AptosClient

      Client used to transfer data to/from Aptos node

    • tokenBridgeAddress: string

      Address of token bridge

    • assetFullyQualifiedType: string

      Fully qualified type of asset

    Returns Promise<boolean>

    True if asset is wrapped

getIsWrappedAssetEth

  • getIsWrappedAssetEth(tokenBridgeAddress: string, provider: ethers.Signer | ethers.providers.Provider, assetAddress: string): Promise<boolean>
  • Returns whether or not an asset address on Ethereum is a wormhole wrapped asset

    Parameters

    • tokenBridgeAddress: string
    • provider: ethers.Signer | ethers.providers.Provider
    • assetAddress: string

    Returns Promise<boolean>

getIsWrappedAssetInjective

  • getIsWrappedAssetInjective(tokenBridgeAddress: string, client: ChainGrpcWasmApi, assetAddress: string): Promise<boolean>
  • Checks if the asset is a wrapped asset

    Parameters

    • tokenBridgeAddress: string

      The address of the Injective token bridge contract

    • client: ChainGrpcWasmApi

      Connection/wallet information

    • assetAddress: string

      Address of the asset in Injective format

    Returns Promise<boolean>

    true if asset is a wormhole wrapped asset

getIsWrappedAssetNear

  • getIsWrappedAssetNear(tokenBridge: string, asset: string): boolean

Const getIsWrappedAssetSol

  • getIsWrappedAssetSol(connection: Connection, tokenBridgeAddress: PublicKeyInitData, mintAddress: PublicKeyInitData, commitment?: Commitment): Promise<boolean>
  • Parameters

    • connection: Connection
    • tokenBridgeAddress: PublicKeyInitData
    • mintAddress: PublicKeyInitData
    • Optional commitment: Commitment

    Returns Promise<boolean>

getIsWrappedAssetSolana

  • getIsWrappedAssetSolana(connection: Connection, tokenBridgeAddress: PublicKeyInitData, mintAddress: PublicKeyInitData, commitment?: Commitment): Promise<boolean>
  • Returns whether or not an asset on Solana is a wormhole wrapped asset

    Parameters

    • connection: Connection
    • tokenBridgeAddress: PublicKeyInitData
    • mintAddress: PublicKeyInitData
    • Optional commitment: Commitment

    Returns Promise<boolean>

getIsWrappedAssetSui

  • getIsWrappedAssetSui(provider: JsonRpcProvider, tokenBridgeStateObjectId: string, type: string): Promise<boolean>

getIsWrappedAssetTerra

  • getIsWrappedAssetTerra(tokenBridgeAddress: string, client: LCDClient, assetAddress: string): Promise<boolean>

getOriginalAssetAlgorand

  • getOriginalAssetAlgorand(client: Algodv2, tokenBridgeId: bigint, assetId: bigint): Promise<WormholeWrappedInfo>
  • Returns an origin chain and asset address on {originChain} for a provided Wormhole wrapped address

    Parameters

    • client: Algodv2

      Algodv2 client

    • tokenBridgeId: bigint

      Application ID of the token bridge

    • assetId: bigint

      Algorand asset index

    Returns Promise<WormholeWrappedInfo>

    wrapped wormhole information structure

getOriginalAssetAptos

  • getOriginalAssetAptos(client: AptosClient, tokenBridgePackageId: string, fullyQualifiedType: string): Promise<WormholeWrappedInfo>
  • Gets the origin chain ID and address of an asset on Aptos, given its fully qualified type.

    Parameters

    • client: AptosClient

      Client used to transfer data to/from Aptos node

    • tokenBridgePackageId: string

      Address of token bridge

    • fullyQualifiedType: string

      Fully qualified type of asset

    Returns Promise<WormholeWrappedInfo>

    Original chain ID and address of asset

getOriginalAssetCosmWasm

getOriginalAssetEth

  • getOriginalAssetEth(tokenBridgeAddress: string, provider: ethers.Signer | ethers.providers.Provider, wrappedAddress: string, lookupChain: ChainId | ChainName): Promise<WormholeWrappedInfo>

getOriginalAssetInjective

  • getOriginalAssetInjective(wrappedAddress: string, client: ChainGrpcWasmApi): Promise<WormholeWrappedInfo>
  • Returns information about the asset

    Parameters

    • wrappedAddress: string

      Address of the asset in wormhole wrapped format (hex string)

    • client: ChainGrpcWasmApi

      WASM api client

    Returns Promise<WormholeWrappedInfo>

    Information about the asset

getOriginalAssetNear

  • getOriginalAssetNear(provider: Provider, tokenAccount: string, assetAccount: string): Promise<WormholeWrappedInfo>

Const getOriginalAssetSol

  • getOriginalAssetSol(connection: Connection, tokenBridgeAddress: PublicKeyInitData, mintAddress: PublicKeyInitData, commitment?: Commitment): Promise<WormholeWrappedInfo>

getOriginalAssetSolana

  • getOriginalAssetSolana(connection: Connection, tokenBridgeAddress: PublicKeyInitData, mintAddress: PublicKeyInitData, commitment?: Commitment): Promise<WormholeWrappedInfo>
  • Returns a origin chain and asset address on {originChain} for a provided Wormhole wrapped address

    Parameters

    • connection: Connection
    • tokenBridgeAddress: PublicKeyInitData
    • mintAddress: PublicKeyInitData
    • Optional commitment: Commitment

    Returns Promise<WormholeWrappedInfo>

getOriginalAssetSui

  • getOriginalAssetSui(provider: JsonRpcProvider, tokenBridgeStateObjectId: string, coinType: string): Promise<WormholeWrappedInfo>

getOriginalAssetTerra

  • getOriginalAssetTerra(client: TerraLCDClient, wrappedAddress: string): Promise<WormholeWrappedInfo>

getOriginalAssetXpla

  • getOriginalAssetXpla(client: XplaLCDClient, wrappedAddress: string): Promise<WormholeWrappedInfo>

getSignedBatchVAA

  • getSignedBatchVAA(host: string, emitterChain: ChainId | ChainName, transactionId: Uint8Array, nonce: number, extraGrpcOpts?: {}): Promise<GetSignedBatchVAAResponse>

getSignedVAA

  • getSignedVAA(host: string, emitterChain: ChainId | ChainName, emitterAddress: string, sequence: string, extraGrpcOpts?: {}): Promise<GetSignedVAAResponse>

getSignedVAAHash

  • getSignedVAAHash(signedVaa: SignedVaa): string

Const getTokenIdFromTokenHash

  • getTokenIdFromTokenHash(client: AptosClient, nftBridgeAddress: string, tokenHash: Uint8Array): Promise<TokenId>
  • Get creator address, collection name, token name, and property version from a token hash. Note that this method is meant to be used for native tokens that have already been registered in the NFT bridge.

    The token hash is stored in the tokenId field of NFT transfer VAAs and is calculated by the operations in deriveTokenHashFromTokenId.

    Parameters

    • client: AptosClient
    • nftBridgeAddress: string
    • tokenHash: Uint8Array

      Token hash

    Returns Promise<TokenId>

    Token ID

getTypeFromExternalAddress

  • getTypeFromExternalAddress(client: AptosClient, tokenBridgeAddress: string, fullyQualifiedTypeHash: string): Promise<string | null>
  • Given a hash, returns the fully qualified type by querying the corresponding TypeInfo.

    Parameters

    • client: AptosClient

      Client used to transfer data to/from Aptos node

    • tokenBridgeAddress: string

      Address of token bridge

    • fullyQualifiedTypeHash: string

      Hash of fully qualified type

    Returns Promise<string | null>

    The fully qualified type associated with the given hash

hashAccount

  • hashAccount(provider: Provider, tokenBridge: string, account: string): Promise<{ accountHash: string; isRegistered: boolean }>
  • Parameters

    • provider: Provider
    • tokenBridge: string
    • account: string

    Returns Promise<{ accountHash: string; isRegistered: boolean }>

hashLookup

  • hashLookup(provider: Provider, tokenBridge: string, hash: string): Promise<{ found: boolean; value: string }>
  • Parameters

    • provider: Provider
    • tokenBridge: string
    • hash: string

    Returns Promise<{ found: boolean; value: string }>

hex

  • hex(x: string): Buffer

Const hexToNativeAssetString

  • hexToNativeAssetString(h: undefined | string, c: ChainId): undefined | string
  • Convert an address in a wormhole's 32-byte hex representation into a chain's native string representation.

    deprecated

    since 0.3.0, use tryHexToNativeString instead.

    Parameters

    Returns undefined | string

Const hexToNativeString

  • hexToNativeString(h: undefined | string, c: "unset" | "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" | "wormchain" | "sepolia" | ChainId): undefined | string
  • Convert an address in a wormhole's 32-byte hex representation into a chain's native string representation.

    deprecated

    since 0.3.0, use tryHexToNativeString instead.

    Parameters

    • h: undefined | string
    • c: "unset" | "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" | "wormchain" | "sepolia" | ChainId

    Returns undefined | string

Const hexToUint8Array

  • hexToUint8Array(h: string): Uint8Array

impossible

  • impossible(a: never): any

isBytes

  • isBytes(value: any): value is Bytes
  • Parameters

    • value: any

    Returns value is Bytes

isChain

  • isChain(chain: number | string): chain is "unset" | "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" | "wormchain" | "sepolia" | ChainId
  • Returns true when called with a valid chain, and narrows the type in the "true" branch to ChainId or ChainName thanks to the type predicate in the return type.

    A typical use-case might look like

    foo = isChain(c) ? doSomethingWithChainId(c) : handleInvalidCase()
    

    Parameters

    • chain: number | string

    Returns chain is "unset" | "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" | "wormchain" | "sepolia" | ChainId

isCosmWasmChain

isEVMChain

Const isHexNativeTerra

  • isHexNativeTerra(h: string): boolean
  • Returns true iff the hex string represents a native Terra denom.

    Native assets on terra don't have an associated smart contract address, just like eth isn't an ERC-20 contract on Ethereum.

    The difference is that the EVM implementations of Portal don't support eth directly, and instead require swapping to an ERC-20 wrapped eth (WETH) contract first.

    The Terra implementation instead supports Terra-native denoms without wrapping to CW-20 token first. As these denoms don't have an address, they are encoded in the Portal payloads by the setting the first byte to 1. This encoding is safe, because the first 12 bytes of the 32-byte wormhole address space are not used on Terra otherwise, as cosmos addresses are 20 bytes wide.

    Parameters

    • h: string

    Returns boolean

isNativeCosmWasmDenom

  • isNativeCosmWasmDenom(chainId: CosmWasmChainId, address: string): boolean

Const isNativeDenomInjective

  • isNativeDenomInjective(denom: string): boolean

Const isNativeDenomXpla

  • isNativeDenomXpla(denom: string): boolean

isTerraChain

Const isValidAptosType

  • isValidAptosType(str: string): boolean
  • Test if given string is a valid fully qualified type of moduleAddress::moduleName::structName.

    Parameters

    • str: string

      String to test

    Returns boolean

    Whether or not given string is a valid type

keccak256

  • keccak256(data: ethers.BytesLike): Buffer

logNearGas

  • logNearGas(result: any, comment: string): void

Const nativeTerraHexToDenom

  • nativeTerraHexToDenom(h: string): string

Const nativeToHexString

  • nativeToHexString(address: undefined | string, chain: "unset" | "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" | "wormchain" | "sepolia" | ChainId): null | string
  • Convert an address in a chain's native representation into a 32-byte hex string understood by wormhole.

    deprecated

    since 0.3.0, use tryNativeToHexString instead.

    throws

    if address is a malformed string for the given chain id

    Parameters

    • address: undefined | string
    • chain: "unset" | "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" | "wormchain" | "sepolia" | ChainId

    Returns null | string

parse

parseAttestMetaPayload

  • parseAttestMetaPayload(payload: Buffer): AssetMeta

parseAttestMetaVaa

parseEnvelope

  • parseEnvelope(buffer: Buffer): VAA<Buffer>

parseGovernancePayload

  • parseGovernancePayload(payload: Buffer): Governance

parseGovernanceVaa

parseNFTPayload

  • parseNFTPayload(payload: Buffer): { name: string; originAddress: string; originChain: number; symbol: string; targetAddress: string; targetChain: number; tokenId: BigNumber; uri: string }
  • Parameters

    • payload: Buffer

    Returns { name: string; originAddress: string; originChain: number; symbol: string; targetAddress: string; targetChain: number; tokenId: BigNumber; uri: string }

    • name: string
    • originAddress: string
    • originChain: number
    • symbol: string
    • targetAddress: string
    • targetChain: number
    • tokenId: BigNumber
    • uri: string

parseNftBridgeRegisterChainGovernancePayload

  • parseNftBridgeRegisterChainGovernancePayload(payload: Buffer): NftRegisterChain

parseNftBridgeRegisterChainVaa

parseNftBridgeUpgradeContractGovernancePayload

parseNftBridgeUpgradeContractVaa

parseNftTransferPayload

  • parseNftTransferPayload(payload: Buffer): NftTransfer

parseNftTransferVaa

parseSequenceFromLogAlgorand

  • parseSequenceFromLogAlgorand(result: Record<string, any>): string

parseSequenceFromLogAptos

  • parseSequenceFromLogAptos(coreBridgeAddress: string, result: Types.UserTransaction): string | null
  • Given a transaction result, return the first WormholeMessage event sequence

    Parameters

    • coreBridgeAddress: string

      Wormhole Core bridge address

    • result: Types.UserTransaction

      the result of client.waitForTransactionWithResult(txHash)

    Returns string | null

    sequence

parseSequenceFromLogEth

  • parseSequenceFromLogEth(receipt: ContractReceipt, bridgeAddress: string): string

parseSequenceFromLogInjective

  • parseSequenceFromLogInjective(info: any): string

parseSequenceFromLogNear

  • parseSequenceFromLogNear(outcome: FinalExecutionOutcome): string | null

parseSequenceFromLogSolana

  • parseSequenceFromLogSolana(info: TransactionResponse): string

parseSequenceFromLogSui

  • parseSequenceFromLogSui(originalCoreBridgePackageId: string, response: SuiTransactionBlockResponse): string | null

parseSequenceFromLogTerra

  • parseSequenceFromLogTerra(info: TxInfo): string

parseSequenceFromLogXpla

  • parseSequenceFromLogXpla(info: XplaTxInfo): string

parseSequencesFromLogEth

  • parseSequencesFromLogEth(receipt: ContractReceipt, bridgeAddress: string): string[]

parseSequencesFromLogSolana

  • parseSequencesFromLogSolana(info: TransactionResponse): undefined | string[]

parseSequencesFromLogTerra

  • parseSequencesFromLogTerra(info: TxInfo): string[]

Const parseSmartContractStateResponse

  • parseSmartContractStateResponse(__namedParameters: QuerySmartContractStateResponse): any

parseTokenBridgeRegisterChainGovernancePayload

parseTokenBridgeRegisterChainVaa

parseTokenBridgeUpgradeContractGovernancePayload

parseTokenBridgeUpgradeContractVaa

parseTokenTransferPayload

parseTokenTransferVaa

parseTransferPayload

  • parseTransferPayload(payload: Buffer): { amount: bigint; fee: undefined | bigint; fromAddress: undefined | string; originAddress: string; originChain: number; targetAddress: string; targetChain: number }
  • Parameters

    • payload: Buffer

    Returns { amount: bigint; fee: undefined | bigint; fromAddress: undefined | string; originAddress: string; originChain: number; targetAddress: string; targetChain: number }

    • amount: bigint
    • fee: undefined | bigint
    • fromAddress: undefined | string
    • originAddress: string
    • originChain: number
    • targetAddress: string
    • targetChain: number

parseVaa

Const queryExternalId

  • queryExternalId(client: LCDClient | LCDClient, tokenBridgeAddress: string, externalTokenId: string): Promise<undefined | null | string>
  • Parameters

    • client: LCDClient | LCDClient
    • tokenBridgeAddress: string
    • externalTokenId: string

    Returns Promise<undefined | null | string>

Const queryExternalIdInjective

  • queryExternalIdInjective(client: ChainGrpcWasmApi, tokenBridgeAddress: string, externalTokenId: string): Promise<null | string>
  • Parameters

    • client: ChainGrpcWasmApi
    • tokenBridgeAddress: string
    • externalTokenId: string

    Returns Promise<null | string>

redeemAndUnwrapOnSolana

  • redeemAndUnwrapOnSolana(connection: Connection, bridgeAddress: PublicKeyInitData, tokenBridgeAddress: PublicKeyInitData, payerAddress: PublicKeyInitData, signedVaa: SignedVaa, commitment?: Commitment): Promise<Transaction>
  • Parameters

    • connection: Connection
    • bridgeAddress: PublicKeyInitData
    • tokenBridgeAddress: PublicKeyInitData
    • payerAddress: PublicKeyInitData
    • signedVaa: SignedVaa
    • Optional commitment: Commitment

    Returns Promise<Transaction>

redeemOnAlgorand

  • redeemOnAlgorand(client: Algodv2, tokenBridgeId: bigint, bridgeId: bigint, vaa: Uint8Array, senderAddr: string): Promise<TransactionSignerPair[]>
  • This basically just submits the VAA to Algorand

    Parameters

    • client: Algodv2

      AlgodV2 client

    • tokenBridgeId: bigint

      Token bridge ID

    • bridgeId: bigint

      Core bridge ID

    • vaa: Uint8Array

      The VAA to be redeemed

    • senderAddr: string

    Returns Promise<TransactionSignerPair[]>

    Transaction ID(s)

redeemOnAptos

  • redeemOnAptos(client: AptosClient, tokenBridgeAddress: string, transferVAA: Uint8Array): Promise<Types.EntryFunctionPayload>
  • Register the token specified in the given VAA in the transfer recipient's account if necessary and complete the transfer.

    Parameters

    • client: AptosClient

      Client used to transfer data to/from Aptos node

    • tokenBridgeAddress: string

      Address of token bridge

    • transferVAA: Uint8Array

      Bytes of transfer VAA

    Returns Promise<Types.EntryFunctionPayload>

    Transaction payload

redeemOnEth

  • redeemOnEth(tokenBridgeAddress: string, signer: ethers.Signer, signedVAA: Uint8Array, overrides?: Overrides & { from?: string | Promise<string> }): Promise<ContractReceipt>
  • Parameters

    • tokenBridgeAddress: string
    • signer: ethers.Signer
    • signedVAA: Uint8Array
    • overrides: Overrides & { from?: string | Promise<string> } = {}

    Returns Promise<ContractReceipt>

redeemOnEthNative

  • redeemOnEthNative(tokenBridgeAddress: string, signer: ethers.Signer, signedVAA: Uint8Array, overrides?: Overrides & { from?: string | Promise<string> }): Promise<ContractReceipt>
  • Parameters

    • tokenBridgeAddress: string
    • signer: ethers.Signer
    • signedVAA: Uint8Array
    • overrides: Overrides & { from?: string | Promise<string> } = {}

    Returns Promise<ContractReceipt>

Const redeemOnInjective

  • redeemOnInjective(tokenBridgeAddress: string, walletAddress: string, signedVAA: Uint8Array): Promise<MsgExecuteContractInjective>
  • Parameters

    • tokenBridgeAddress: string
    • walletAddress: string
    • signedVAA: Uint8Array

    Returns Promise<MsgExecuteContractInjective>

redeemOnNear

  • redeemOnNear(provider: Provider, account: string, tokenBridge: string, vaa: Uint8Array): Promise<FunctionCallOptions[]>
  • Parameters

    • provider: Provider
    • account: string
    • tokenBridge: string
    • vaa: Uint8Array

    Returns Promise<FunctionCallOptions[]>

redeemOnSolana

  • redeemOnSolana(connection: Connection, bridgeAddress: PublicKeyInitData, tokenBridgeAddress: PublicKeyInitData, payerAddress: PublicKeyInitData, signedVaa: SignedVaa, feeRecipientAddress?: PublicKeyInitData, commitment?: Commitment): Promise<Transaction>
  • Parameters

    • connection: Connection
    • bridgeAddress: PublicKeyInitData
    • tokenBridgeAddress: PublicKeyInitData
    • payerAddress: PublicKeyInitData
    • signedVaa: SignedVaa
    • Optional feeRecipientAddress: PublicKeyInitData
    • Optional commitment: Commitment

    Returns Promise<Transaction>

redeemOnSui

  • redeemOnSui(provider: JsonRpcProvider, coreBridgeStateObjectId: string, tokenBridgeStateObjectId: string, transferVAA: Uint8Array): Promise<TransactionBlock>
  • Parameters

    • provider: JsonRpcProvider
    • coreBridgeStateObjectId: string
    • tokenBridgeStateObjectId: string
    • transferVAA: Uint8Array

    Returns Promise<TransactionBlock>

redeemOnTerra

  • redeemOnTerra(tokenBridgeAddress: string, walletAddress: string, signedVAA: Uint8Array): Promise<MsgExecuteContract>
  • Parameters

    • tokenBridgeAddress: string
    • walletAddress: string
    • signedVAA: Uint8Array

    Returns Promise<MsgExecuteContract>

redeemOnXpla

  • redeemOnXpla(tokenBridgeAddress: string, walletAddress: string, signedVAA: Uint8Array): XplaMsgExecuteContract
  • Parameters

    • tokenBridgeAddress: string
    • walletAddress: string
    • signedVAA: Uint8Array

    Returns XplaMsgExecuteContract

registerAccount

  • registerAccount(account: string, tokenBridge: string): { args: { account: string }; attachedDeposit: BN; contractId: string; gas: BN; methodName: string }
  • Parameters

    • account: string
    • tokenBridge: string

    Returns { args: { account: string }; attachedDeposit: BN; contractId: string; gas: BN; methodName: string }

    • args: { account: string }
      • account: string
    • attachedDeposit: BN
    • contractId: string
    • gas: BN
    • methodName: string

safeBigIntToNumber

  • safeBigIntToNumber(b: bigint): number

serialiseVAA

sign

submitVAAOnInjective

  • submitVAAOnInjective(tokenBridgeAddress: string, walletAddress: string, signedVAA: Uint8Array): Promise<MsgExecuteContractInjective>
  • Submits the supplied VAA to Injective

    Parameters

    • tokenBridgeAddress: string

      Address of Inj token bridge contract

    • walletAddress: string

      Address of wallet in inj format

    • signedVAA: Uint8Array

      VAA with the attestation message

    Returns Promise<MsgExecuteContractInjective>

    Message to be broadcast

textToHexString

  • textToHexString(name: string): string

textToUint8Array

  • textToUint8Array(name: string): Uint8Array

toChainId

toChainName

toCosmWasmChainId

transferFromAlgorand

  • transferFromAlgorand(client: Algodv2, tokenBridgeId: bigint, bridgeId: bigint, senderAddr: string, assetId: bigint, qty: bigint, receiver: string, chain: ChainId | ChainName, fee: bigint, payload?: Uint8Array | null): Promise<TransactionSignerPair[]>
  • Transfers an asset from Algorand to a receiver on another chain

    Parameters

    • client: Algodv2

      AlgodV2 client

    • tokenBridgeId: bigint

      Application ID of the token bridge

    • bridgeId: bigint

      Application ID of the core bridge

    • senderAddr: string
    • assetId: bigint

      Asset index

    • qty: bigint

      Quantity to transfer

    • receiver: string

      Receiving account

    • chain: ChainId | ChainName

      Reeiving chain

    • fee: bigint

      Transfer fee

    • payload: Uint8Array | null = null

      payload for payload3 transfers

    Returns Promise<TransactionSignerPair[]>

    Sequence number of confirmation

transferFromAptos

  • transferFromAptos(tokenBridgeAddress: string, fullyQualifiedType: string, amount: string, recipientChain: ChainId | ChainName, recipient: Uint8Array, relayerFee?: string, payload?: string): Types.EntryFunctionPayload
  • Transfer an asset on Aptos to another chain.

    Parameters

    • tokenBridgeAddress: string

      Address of token bridge

    • fullyQualifiedType: string

      Full qualified type of asset to transfer

    • amount: string

      Amount to send to recipient

    • recipientChain: ChainId | ChainName

      Target chain

    • recipient: Uint8Array

      Recipient's address on target chain

    • relayerFee: string = "0"

      Fee to pay relayer

    • payload: string = ""

      Payload3 data, leave undefined for basic token transfers

    Returns Types.EntryFunctionPayload

    Transaction payload

transferFromEth

  • transferFromEth(tokenBridgeAddress: string, signer: ethers.Signer, tokenAddress: string, amount: ethers.BigNumberish, recipientChain: ChainId | ChainName, recipientAddress: Uint8Array, relayerFee?: ethers.BigNumberish, overrides?: PayableOverrides & { from?: string | Promise<string> }, payload?: Uint8Array | null): Promise<ContractReceipt>
  • Parameters

    • tokenBridgeAddress: string
    • signer: ethers.Signer
    • tokenAddress: string
    • amount: ethers.BigNumberish
    • recipientChain: ChainId | ChainName
    • recipientAddress: Uint8Array
    • relayerFee: ethers.BigNumberish = 0
    • overrides: PayableOverrides & { from?: string | Promise<string> } = {}
    • payload: Uint8Array | null = null

    Returns Promise<ContractReceipt>

transferFromEthNative

  • transferFromEthNative(tokenBridgeAddress: string, signer: ethers.Signer, amount: ethers.BigNumberish, recipientChain: ChainId | ChainId, recipientAddress: Uint8Array, relayerFee?: ethers.BigNumberish, overrides?: PayableOverrides & { from?: string | Promise<string> }, payload?: Uint8Array | null): Promise<ContractReceipt>
  • Parameters

    • tokenBridgeAddress: string
    • signer: ethers.Signer
    • amount: ethers.BigNumberish
    • recipientChain: ChainId | ChainId
    • recipientAddress: Uint8Array
    • relayerFee: ethers.BigNumberish = 0
    • overrides: PayableOverrides & { from?: string | Promise<string> } = {}
    • payload: Uint8Array | null = null

    Returns Promise<ContractReceipt>

transferFromInjective

  • transferFromInjective(walletAddress: string, tokenBridgeAddress: string, tokenAddress: string, amount: string, recipientChain: ChainId | ChainName, recipientAddress: Uint8Array, relayerFee?: string, payload?: Uint8Array | null): Promise<default[]>
  • Creates the necessary messages to transfer an asset

    Parameters

    • walletAddress: string

      Address of the Inj wallet

    • tokenBridgeAddress: string

      Address of the token bridge contract

    • tokenAddress: string

      Address of the token being transferred

    • amount: string

      Amount of token to be transferred

    • recipientChain: ChainId | ChainName

      Destination chain

    • recipientAddress: Uint8Array

      Destination wallet address

    • relayerFee: string = "0"

      Relayer fee

    • payload: Uint8Array | null = null

      Optional payload

    Returns Promise<default[]>

    Transfer messages to be sent on chain

transferFromSolana

  • transferFromSolana(connection: Connection, bridgeAddress: PublicKeyInitData, tokenBridgeAddress: PublicKeyInitData, payerAddress: PublicKeyInitData, fromAddress: PublicKeyInitData, mintAddress: PublicKeyInitData, amount: bigint, targetAddress: Uint8Array | Buffer, targetChain: ChainId | ChainName, originAddress?: Uint8Array | Buffer, originChain?: ChainId | ChainName, fromOwnerAddress?: PublicKeyInitData, relayerFee?: bigint, payload?: Uint8Array | Buffer | null, commitment?: Commitment): Promise<Transaction>
  • Parameters

    • connection: Connection
    • bridgeAddress: PublicKeyInitData
    • tokenBridgeAddress: PublicKeyInitData
    • payerAddress: PublicKeyInitData
    • fromAddress: PublicKeyInitData
    • mintAddress: PublicKeyInitData
    • amount: bigint
    • targetAddress: Uint8Array | Buffer
    • targetChain: ChainId | ChainName
    • Optional originAddress: Uint8Array | Buffer
    • Optional originChain: ChainId | ChainName
    • Optional fromOwnerAddress: PublicKeyInitData
    • relayerFee: bigint = ...
    • payload: Uint8Array | Buffer | null = null
    • Optional commitment: Commitment

    Returns Promise<Transaction>

transferFromSui

  • transferFromSui(provider: JsonRpcProvider, coreBridgeStateObjectId: string, tokenBridgeStateObjectId: string, coins: SuiCoinObject[], coinType: string, amount: bigint, recipientChain: ChainId | ChainName, recipient: Uint8Array, feeAmount?: bigint, relayerFee?: bigint, payload?: Uint8Array | null): Promise<TransactionBlock>
  • Parameters

    • provider: JsonRpcProvider
    • coreBridgeStateObjectId: string
    • tokenBridgeStateObjectId: string
    • coins: SuiCoinObject[]
    • coinType: string
    • amount: bigint
    • recipientChain: ChainId | ChainName
    • recipient: Uint8Array
    • feeAmount: bigint = ...
    • relayerFee: bigint = ...
    • payload: Uint8Array | null = null

    Returns Promise<TransactionBlock>

transferFromTerra

  • transferFromTerra(walletAddress: string, tokenBridgeAddress: string, tokenAddress: string, amount: string, recipientChain: ChainId | ChainName, recipientAddress: Uint8Array, relayerFee?: string, payload?: Uint8Array | null): Promise<MsgExecuteContract[]>
  • Parameters

    • walletAddress: string
    • tokenBridgeAddress: string
    • tokenAddress: string
    • amount: string
    • recipientChain: ChainId | ChainName
    • recipientAddress: Uint8Array
    • relayerFee: string = "0"
    • payload: Uint8Array | null = null

    Returns Promise<MsgExecuteContract[]>

transferFromXpla

  • transferFromXpla(walletAddress: string, tokenBridgeAddress: string, tokenAddress: string, amount: string, recipientChain: ChainId | ChainName, recipientAddress: Uint8Array, relayerFee?: string, payload?: Uint8Array | null): XplaMsgExecuteContract[]
  • Parameters

    • walletAddress: string
    • tokenBridgeAddress: string
    • tokenAddress: string
    • amount: string
    • recipientChain: ChainId | ChainName
    • recipientAddress: Uint8Array
    • relayerFee: string = "0"
    • payload: Uint8Array | null = null

    Returns XplaMsgExecuteContract[]

transferNativeSol

  • transferNativeSol(connection: Connection, bridgeAddress: PublicKeyInitData, tokenBridgeAddress: PublicKeyInitData, payerAddress: PublicKeyInitData, amount: bigint, targetAddress: Uint8Array | Buffer, targetChain: ChainId | ChainName, relayerFee?: bigint, payload?: Uint8Array | Buffer | null, commitment?: Commitment): Promise<Transaction>
  • Parameters

    • connection: Connection
    • bridgeAddress: PublicKeyInitData
    • tokenBridgeAddress: PublicKeyInitData
    • payerAddress: PublicKeyInitData
    • amount: bigint
    • targetAddress: Uint8Array | Buffer
    • targetChain: ChainId | ChainName
    • relayerFee: bigint = ...
    • payload: Uint8Array | Buffer | null = null
    • Optional commitment: Commitment

    Returns Promise<Transaction>

transferNearFromNear

  • transferNearFromNear(provider: Provider, coreBridge: string, tokenBridge: string, qty: bigint, receiver: Uint8Array, chain: ChainId | ChainName, fee: bigint, payload?: string): Promise<FunctionCallOptions>
  • Parameters

    • provider: Provider
    • coreBridge: string
    • tokenBridge: string
    • qty: bigint
    • receiver: Uint8Array
    • chain: ChainId | ChainName
    • fee: bigint
    • payload: string = ""

    Returns Promise<FunctionCallOptions>

transferTokenFromNear

  • transferTokenFromNear(provider: Provider, account: string, coreBridge: string, tokenBridge: string, assetId: string, qty: bigint, receiver: Uint8Array, chain: ChainId | ChainName, fee: bigint, payload?: string): Promise<FunctionCallOptions[]>
  • Parameters

    • provider: Provider
    • account: string
    • coreBridge: string
    • tokenBridge: string
    • assetId: string
    • qty: bigint
    • receiver: Uint8Array
    • chain: ChainId | ChainName
    • fee: bigint
    • payload: string = ""

    Returns Promise<FunctionCallOptions[]>

Const tryHexToNativeAssetString

  • tryHexToNativeAssetString(h: string, c: ChainId): string
  • Convert an address in a wormhole's 32-byte hex representation into a chain's native string representation.

    throws

    if address is not the right length for the given chain

    Parameters

    Returns string

Const tryHexToNativeString

  • tryHexToNativeString(h: string, c: "unset" | "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" | "wormchain" | "sepolia" | ChainId): string
  • Convert an address in a wormhole's 32-byte hex representation into a chain's native string representation.

    throws

    if address is not the right length for the given chain

    Parameters

    • h: string
    • c: "unset" | "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" | "wormchain" | "sepolia" | ChainId

    Returns string

Const tryHexToNativeStringNear

  • tryHexToNativeStringNear(provider: Provider, tokenBridge: string, address: string): Promise<string>
  • Parameters

    • provider: Provider
    • tokenBridge: string
    • address: string

    Returns Promise<string>

Const tryNativeToHexString

  • tryNativeToHexString(address: string, chain: "unset" | "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" | "wormchain" | "sepolia" | ChainId): string
  • Convert an address in a chain's native representation into a 32-byte hex string understood by wormhole.

    throws

    if address is a malformed string for the given chain id

    Parameters

    • address: string
    • chain: "unset" | "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" | "wormchain" | "sepolia" | ChainId

    Returns string

tryNativeToUint8Array

  • tryNativeToUint8Array(address: string, chain: ChainId | ChainName): Uint8Array
  • Convert an address in a chain's native representation into a 32-byte array understood by wormhole.

    throws

    if address is a malformed string for the given chain id

    Parameters

    Returns Uint8Array

Const tryUint8ArrayToNative

  • tryUint8ArrayToNative(a: Uint8Array, chain: "unset" | "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" | "wormchain" | "sepolia" | ChainId): string
  • Convert an address in a wormhole's 32-byte array representation into a chain's native string representation.

    throws

    if address is not the right length for the given chain

    Parameters

    • a: Uint8Array
    • chain: "unset" | "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" | "wormchain" | "sepolia" | ChainId

    Returns string

typeWidth

Const uint8ArrayToHex

  • uint8ArrayToHex(a: Uint8Array): string

Const uint8ArrayToNative

  • uint8ArrayToNative(a: Uint8Array, chainId: ChainId): undefined | string
  • Convert an address in a chain's native representation into a 32-byte hex string understood by wormhole.

    deprecated

    since 0.3.0, use tryUint8ArrayToNative instead.

    throws

    if address is a malformed string for the given chain id

    Parameters

    Returns undefined | string

Const updateWrappedOnAlgorand

  • updateWrappedOnAlgorand(client: Algodv2, tokenBridgeId: bigint, bridgeId: bigint, senderAddr: string, attestVAA: Uint8Array): Promise<TransactionSignerPair[]>

Const updateWrappedOnAptos

  • updateWrappedOnAptos(tokenBridgeAddress: string, attestVAA: Uint8Array): Types.EntryFunctionPayload

updateWrappedOnEth

  • updateWrappedOnEth(tokenBridgeAddress: string, signer: ethers.Signer, signedVAA: Uint8Array, overrides?: Overrides & { from?: string | Promise<string> }): Promise<ContractReceipt>
  • Parameters

    • tokenBridgeAddress: string
    • signer: ethers.Signer
    • signedVAA: Uint8Array
    • overrides: Overrides & { from?: string | Promise<string> } = {}

    Returns Promise<ContractReceipt>

Const updateWrappedOnInjective

  • updateWrappedOnInjective(tokenBridgeAddress: string, walletAddress: string, signedVAA: Uint8Array): Promise<MsgExecuteContractInjective>
  • Parameters

    • tokenBridgeAddress: string
    • walletAddress: string
    • signedVAA: Uint8Array

    Returns Promise<MsgExecuteContractInjective>

Const updateWrappedOnNear

  • updateWrappedOnNear(provider: Provider, tokenBridge: string, attestVAA: Uint8Array): Promise<FunctionCallOptions[]>

Const updateWrappedOnSolana

  • updateWrappedOnSolana(connection: Connection, bridgeAddress: PublicKeyInitData, tokenBridgeAddress: PublicKeyInitData, payerAddress: PublicKeyInitData, signedVaa: SignedVaa, commitment?: Commitment): Promise<Transaction>
  • Parameters

    • connection: Connection
    • bridgeAddress: PublicKeyInitData
    • tokenBridgeAddress: PublicKeyInitData
    • payerAddress: PublicKeyInitData
    • signedVaa: SignedVaa
    • Optional commitment: Commitment

    Returns Promise<Transaction>

updateWrappedOnSui

  • updateWrappedOnSui(provider: JsonRpcProvider, coreBridgeStateObjectId: string, tokenBridgeStateObjectId: string, coinPackageId: string, attestVAA: Uint8Array): Promise<TransactionBlock>
  • Parameters

    • provider: JsonRpcProvider
    • coreBridgeStateObjectId: string
    • tokenBridgeStateObjectId: string
    • coinPackageId: string
    • attestVAA: Uint8Array

    Returns Promise<TransactionBlock>

Const updateWrappedOnTerra

  • updateWrappedOnTerra(tokenBridgeAddress: string, walletAddress: string, signedVAA: Uint8Array): Promise<MsgExecuteContract>

Const updateWrappedOnXpla

  • updateWrappedOnXpla(tokenBridgeAddress: string, walletAddress: string, signedVAA: Uint8Array): XplaMsgExecuteContract

vaaDigest

Generated using TypeDoc