WormholeCore provides a consistent interface to interact with the Wormhole core messaging protocol.

Type Parameters

  • N extends Network = Network

  • C extends Chain = Chain

Hierarchy

  • WormholeCore

Methods

  • Get the guardian set data corresponding to the index

    Parameters

    • index: number

    Returns Promise<GuardianSet>

  • Get the current guardian set index

    Returns Promise<number>

  • Get the fee for publishing a message

    Returns Promise<bigint>

  • Parse a transaction to get the VAA message it produced

    Parameters

    • txid: string

      the transaction hash to parse

    Returns Promise<VAA<"Uint8Array">[]>

    the VAA message produced by the transaction

  • Parse a transaction to get its message id

    Parameters

    • txid: string

      the transaction hash to parse

    Returns Promise<WormholeMessageId[]>

    the message ids produced by the transaction

  • Publish a message

    Parameters

    • sender: AccountAddress<C>

      The address of the sender

    • message: string | Uint8Array

      The message to send

    • nonce: number

      A number that may be set if needed for the application, may be 0 if unneeded

    • consistencyLevel: number

      The consistency level to reach before the guardians should sign the message see the docs for more information

    Returns AsyncGenerator<UnsignedTransaction<N, C>, any, unknown>

    a stream of unsigned transactions to be signed and submitted on chain

  • Verify a VAA against the core contract

    Parameters

    • sender: AccountAddress<C>

      the sender of the transaction

    • vaa: VAA<PayloadLiteral>

      the VAA to verify

    Returns AsyncGenerator<UnsignedTransaction<N, C>, any, unknown>

    a stream of unsigned transactions to be signed and submitted on chain

Generated using TypeDoc