This class represents an oracle account on chain.

Constructors

Properties

lut: AddressLookupTableAccount
program: Program<Idl>
pubkey: PublicKey

Methods

  • Loads the oracle data for this Oracle account from on chain.

    Returns Promise<any>

    A promise that resolves to the oracle data.

    Throws

    if the oracle account does not exist.

  • Parameters

    • params: {
          authority: PublicKey;
      }
      • authority: PublicKey

    Returns Promise<TransactionInstruction>

  • Get the pubkey of the stats account for this oracle.

    Returns Promise<PublicKey>

    A promise that resolves to the pubkey of the stats account.

  • Parameters

    • params: {
          authority: PublicKey;
          overrideMint?: PublicKey;
          overrideStakePool?: PublicKey;
      }
      • authority: PublicKey
      • Optional overrideMint?: PublicKey
      • Optional overrideStakePool?: PublicKey

    Returns Promise<TransactionInstruction>

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

    Throws

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

      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.

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

    Parameters

    • program: Program<Idl>

      The program that owns the oracle accounts.

    • keys: PublicKey[]

      The public keys of the oracle accounts to load.

    Returns Promise<any[]>

    A promise that resolves to an array of oracle data.

    Throws

    if any of the oracle accounts do not exist.