Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace utils

Index

Type aliases

Variables

Functions

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

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

Network

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

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

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

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

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

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

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

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

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

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

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

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

Const parseSmartContractStateResponse

  • parseSmartContractStateResponse(__namedParameters: QuerySmartContractStateResponse): any

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

Const queryExternalIdInjective

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

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

    Returns Promise<null | string>

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

textToHexString

  • textToHexString(name: string): string

textToUint8Array

  • textToUint8Array(name: string): Uint8Array

toChainId

toChainName

toCosmWasmChainId

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

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

Generated using TypeDoc