Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace token_bridge

Index

Interfaces

Functions

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>

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[]>

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

getAllowanceEth

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

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>

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>

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

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

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

Generated using TypeDoc