Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace nft_bridge

Index

Functions

createMetaOnSolana

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

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

    Returns Promise<Transaction>

getForeignAssetAptos

  • getForeignAssetAptos(client: AptosClient, nftBridgeAddress: string, originChain: ChainId | ChainName, originAddress: Uint8Array, tokenId?: Uint8Array | Buffer | bigint): Promise<TokenTypes.TokenId | null>
  • Get the token id of a foreign asset on Aptos. Tokens on Aptos are identified by the tuple (creatorAddress, collectionName, tokenName, propertyVersion), which this method returns as an object.

    This method also supports native assets, in which case it expects the token hash (which can be obtained from deriveTokenHashFromTokenId).

    Parameters

    • client: AptosClient
    • nftBridgeAddress: string
    • originChain: ChainId | ChainName
    • originAddress: Uint8Array

      External address of token on origin chain, or token hash if origin chain is Aptos

    • Optional tokenId: Uint8Array | Buffer | bigint

      Token id of token on origin chain, unnecessary if origin chain is Aptos

    Returns Promise<TokenTypes.TokenId | null>

    Unique token identifier on Aptos

getForeignAssetEth

  • getForeignAssetEth(nftBridgeAddress: 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

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

      zero pad to 32 bytes

    Returns Promise<string | null>

Const getForeignAssetSol

  • getForeignAssetSol(nftBridgeAddress: PublicKeyInitData, originChain: ChainId | ChainName, originAsset: string | Uint8Array | Buffer, tokenId: Uint8Array | Buffer | bigint): Promise<string>

getForeignAssetSolana

  • getForeignAssetSolana(nftBridgeAddress: PublicKeyInitData, originChain: ChainId | ChainName, originAsset: string | Uint8Array | Buffer, tokenId: Uint8Array | Buffer | bigint): Promise<string>
  • Returns a foreign asset address on Solana for a provided native chain and asset address

    Parameters

    • nftBridgeAddress: PublicKeyInitData
    • originChain: ChainId | ChainName
    • originAsset: string | Uint8Array | Buffer

      zero pad to 32 bytes

    • tokenId: Uint8Array | Buffer | bigint

    Returns Promise<string>

getForeignAssetTerra

  • getForeignAssetTerra(nftBridgeAddress: string, client: LCDClient, originChain: ChainId, originAsset: Uint8Array): Promise<string | null>
  • Returns a foreign asset address on Terra for a provided native chain and asset address

    Parameters

    • nftBridgeAddress: string
    • client: LCDClient
    • originChain: ChainId
    • originAsset: Uint8Array

    Returns Promise<string | null>

getIsTransferCompletedAptos

  • getIsTransferCompletedAptos(client: AptosClient, nftBridgeAddress: string, transferVaa: Uint8Array): Promise<boolean>

getIsTransferCompletedEth

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

getIsTransferCompletedSolana

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

getIsTransferCompletedTerra

  • getIsTransferCompletedTerra(nftBridgeAddress: string, signedVAA: Uint8Array, client: LCDClient, gasPriceUrl: string): Promise<any>

getIsWrappedAssetAptos

  • getIsWrappedAssetAptos(client: AptosClient, nftBridgeAddress: string, creatorAddress: string): Promise<boolean>

getIsWrappedAssetEth

  • getIsWrappedAssetEth(nftBridgeAddress: 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

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

    Returns Promise<boolean>

Const getIsWrappedAssetSol

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

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

    Returns Promise<boolean>

getIsWrappedAssetSolana

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

    Parameters

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

    Returns Promise<boolean>

getOriginalAssetAptos

  • getOriginalAssetAptos(client: AptosClient, nftBridgeAddress: string, tokenId: TokenTypes.TokenId): Promise<WormholeWrappedNFTInfo>
  • Given a token ID, returns the original asset chain and address. If this is a native asset, the asset address will be the collection hash.

    Parameters

    • client: AptosClient
    • nftBridgeAddress: string
    • tokenId: TokenTypes.TokenId

      An object containing creator address, collection name, token name, and property version, which together uniquely identify a token on Aptos. For wrapped assets, property version will be 0.

    Returns Promise<WormholeWrappedNFTInfo>

    Object containing origin chain and Wormhole compatible 32-byte asset address.

getOriginalAssetEth

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

Const getOriginalAssetSol

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

getOriginalAssetSolana

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

    Parameters

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

    Returns Promise<WormholeWrappedNFTInfo>

getOriginalAssetTerra

isNFTVAASolanaNative

  • isNFTVAASolanaNative(signedVAA: Uint8Array): Promise<boolean>

redeemOnAptos

  • redeemOnAptos(nftBridgeAddress: string, transferVAA: Uint8Array): Promise<Types.EntryFunctionPayload>
  • Parameters

    • nftBridgeAddress: string
    • transferVAA: Uint8Array

    Returns Promise<Types.EntryFunctionPayload>

redeemOnEth

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

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

    Returns Promise<ethers.ContractReceipt>

redeemOnSolana

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

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

    Returns Promise<Transaction>

redeemOnTerra

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

    • nftBridgeAddress: string
    • walletAddress: string
    • signedVAA: Uint8Array

    Returns Promise<MsgExecuteContract>

transferFromAptos

  • transferFromAptos(nftBridgeAddress: string, creatorAddress: string, collectionName: string, tokenName: string, propertyVersion: number, recipientChain: ChainId | ChainName, recipient: Uint8Array): Types.EntryFunctionPayload
  • Parameters

    • nftBridgeAddress: string
    • creatorAddress: string
    • collectionName: string
    • tokenName: string
    • propertyVersion: number
    • recipientChain: ChainId | ChainName
    • recipient: Uint8Array

    Returns Types.EntryFunctionPayload

transferFromEth

  • transferFromEth(nftBridgeAddress: string, signer: ethers.Signer, tokenAddress: string, tokenID: ethers.BigNumberish, recipientChain: ChainId | ChainName, recipientAddress: Uint8Array, overrides?: Overrides & { from?: string | Promise<string> }): Promise<ethers.ContractReceipt>
  • Parameters

    • nftBridgeAddress: string
    • signer: ethers.Signer
    • tokenAddress: string
    • tokenID: ethers.BigNumberish
    • recipientChain: ChainId | ChainName
    • recipientAddress: Uint8Array
    • overrides: Overrides & { from?: string | Promise<string> } = {}

    Returns Promise<ethers.ContractReceipt>

transferFromSolana

  • transferFromSolana(connection: Connection, bridgeAddress: PublicKeyInitData, nftBridgeAddress: PublicKeyInitData, payerAddress: PublicKeyInitData, fromAddress: PublicKeyInitData, mintAddress: PublicKeyInitData, targetAddress: Uint8Array | Buffer, targetChain: ChainId | ChainName, originAddress?: Uint8Array | Buffer, originChain?: ChainId | ChainName, originTokenId?: Uint8Array | Buffer | number | bigint, commitment?: Commitment): Promise<Transaction>
  • Parameters

    • connection: Connection
    • bridgeAddress: PublicKeyInitData
    • nftBridgeAddress: PublicKeyInitData
    • payerAddress: PublicKeyInitData
    • fromAddress: PublicKeyInitData
    • mintAddress: PublicKeyInitData
    • targetAddress: Uint8Array | Buffer
    • targetChain: ChainId | ChainName
    • Optional originAddress: Uint8Array | Buffer
    • Optional originChain: ChainId | ChainName
    • Optional originTokenId: Uint8Array | Buffer | number | bigint
    • Optional commitment: Commitment

    Returns Promise<Transaction>

transferFromTerra

  • transferFromTerra(walletAddress: string, nftBridgeAddress: string, tokenAddress: string, tokenID: string, recipientChain: ChainId | ChainName, recipientAddress: Uint8Array): Promise<MsgExecuteContract[]>
  • Parameters

    • walletAddress: string
    • nftBridgeAddress: string
    • tokenAddress: string
    • tokenID: string
    • recipientChain: ChainId | ChainName
    • recipientAddress: Uint8Array

    Returns Promise<MsgExecuteContract[]>

Generated using TypeDoc