Documentation
    Preparing search index...
    Index

    Constructors

    • Parameters

      • provider: SuiClient
      • pythStateId: string
      • wormholeStateId: string

      Returns SuiPythClient

    Properties

    provider: SuiClient
    pythStateId: string
    wormholeStateId: string

    Methods

    • Returns the cached base update fee, fetching it if necessary.

      Returns Promise<number>

    • Get the price feed object ID for a given feed ID, caching the promise.

      Parameters

      • feedId: string

      Returns Promise<undefined | string>

    • Fetches the price table object ID for the current state ID, caching the promise.

      Returns Promise<{ fieldType: string; id: string }>

      Price table object ID and field type

    • Fetches the package ID for the Pyth contract, with caching.

      Returns Promise<string>

    • Fetches the package ID for the Wormhole contract, with caching.

      Returns Promise<string>

    • Adds the necessary commands for updating the Pyth price feeds to the transaction block.

      Parameters

      • tx: Transaction

        Transaction block to add commands to.

      • updates: Uint8Array<ArrayBufferLike>[]

        Array of price feed updates received from the price service.

      • feedIds: string[]

        Array of feed IDs to update (in hex format).

      Returns Promise<string[]>

    • Verifies the VAAs using the Wormhole contract.

      Parameters

      • vaas: Uint8Array<ArrayBufferLike>[]

        Array of VAA buffers to verify.

      • tx: Transaction

        Transaction block to add commands to.

      Returns Promise<{ $kind: "NestedResult"; NestedResult: [number, number] }[]>

      Array of verified VAAs.