This class represents an oracle account on chain.

Constructors

Properties

lut: null | AddressLookupTableAccount
program: Program
pubkey: PublicKey

Methods

  • Loads the oracle data and checks if the oracle is verified.

    Returns Promise<[boolean, number]>

    A promise that resolves to a tuple containing a boolean indicating if the oracle is verified and the expiration time of the verification.

    if the oracle account does not exist.

  • Creates a new oracle account. linked to the specified queue. After creation the oracle still must receive run approval and verify their enclave measurement.

    Parameters

    • program: Program

      The program that owns the oracle account.

    • params: { queue: PublicKey }
      • queue: PublicKey

        The queue that the oracle will be linked to.

    Returns Promise<[Oracle, TransactionInstruction[], Keypair]>

    A promise that resolves to a tuple containing the oracle account and the transaction signature.

  • Creates a new oracle account for SVM chains (non-solana). linked to the specified queue. After creation the oracle still must receive run approval and verify their enclave measurement.

    Parameters

    • program: Program

      The program that owns the oracle account.

    • params: { queue: PublicKey; sourceOracleKey: PublicKey }
      • queue: PublicKey

        The queue that the oracle will be linked to.

      • sourceOracleKey: PublicKey

    Returns Promise<[Oracle, TransactionInstruction[]]>

    A promise that resolves to a tuple containing the oracle account and the transaction signature.

  • Loads the oracle data for a list of Oracle accounts from on chain.

    Parameters

    • program: Program

      The program that owns the oracle accounts.

    • keys: PublicKey[]

      The public keys of the oracle accounts to load.

    Returns Promise<(null | OracleAccountData)[]>

    A promise that resolves to an array of oracle data.

    if any of the oracle accounts do not exist.