///
import type { SwitchboardV2 } from "./idl";
import * as anchor from "@coral-xyz/anchor";
import Big from "big.js";
export * from "./idl";
export type Accounts = anchor.IdlAccounts;
export type AggregatorAccountData = Accounts["aggregatorAccountData"];
export type JobAccountData = Accounts["jobAccountData"];
export type PermissionAccountData = Accounts["permissionAccountData"];
export type LeaseAccountData = Accounts["leaseAccountData"];
export type OracleQueueAccountData = Accounts["oracleQueueAccountData"];
export type OracleAccountData = Accounts["oracleAccountData"];
/**
* Check if a transaction object is a VersionedTransaction or not
*
* @param tx
* @returns bool
*/
export declare const isVersionedTransaction: (tx: any) => tx is anchor.web3.VersionedTransaction;
export declare class AnchorWallet implements anchor.Wallet {
readonly payer: anchor.web3.Keypair;
constructor(payer: anchor.web3.Keypair);
get publicKey(): anchor.web3.PublicKey;
signTransaction(tx: T): Promise;
signAllTransactions(txs: T[]): Promise;
}
/** A Switchboard V2 wrapper to assist in decoding onchain accounts */
export default class SwitchboardProgram {
/**
* Switchboard Mainnet Program ID
* SW1TCH7qEPTdLsDHRgPuMQjbQxKdH2aBStViMFnt64f
*/
static oracleProgramId: anchor.web3.PublicKey;
/**
* Default confirmation options for fetching Solana data
*/
static defaultConfirmOptions: anchor.web3.ConfirmOptions;
/**
* Switchboard Anchor program object
*/
program: anchor.Program;
/**
* Selected Solana cluster
*/
cluster: "devnet" | "mainnet-beta";
constructor(program: anchor.Program, cluster: "devnet" | "mainnet-beta");
/**
* Return the Switchboard program
* @param connection optional connection object if not using the default endpoints
* @param confirmOptions optional confirmation options. defaults to commitment level 'confirmed'
*/
static load(connection?: anchor.web3.Connection, confirmOptions?: anchor.web3.ConfirmOptions): Promise;
/**
* Return the Switchboard mainnet-beta program
* @param connection optional connection object if not using the default endpoints
* @param confirmOptions optional confirmation options. defaults to commitment level 'confirmed'
*/
static loadMainnet(connection?: anchor.web3.Connection, confirmOptions?: anchor.web3.ConfirmOptions): Promise;
/** Parse an aggregators account data and return the latest confirmed result if valid
* @param aggregator an aggregators deserialized account data
* @param maxStaleness the maximum duration in seconds before a result is considered invalid. Defaults to 0 which ignores any checks
* @returns latest confirmed result as a big.js or null if the latest confirmed round has insufficient oracle responses or data is too stale
*/
private getLatestAggregatorValue;
/** Fetch and decode an aggregator account
* @param aggregatorPubkey the aggregator's public key
* @param commitment optional connection commitment level
* @returns deserialized aggregator account, as specified by the Switchboard IDL
*/
fetchAggregator(aggregatorPubkey: anchor.web3.PublicKey, commitment?: anchor.web3.Commitment): Promise;
/** Fetch and decode an aggregator's latest confirmed value if valid
* @param aggregatorPubkey the aggregator's public key
* @param commitment optional connection commitment level
* @param maxStaleness the maximum duration in seconds before a result is considered invalid. Defaults to 0 which ignores any checks
* @returns latest confirmed result as a big.js or null if the latest confirmed round has insufficient oracle responses or data is too stale
*/
fetchAggregatorLatestValue(aggregatorPubkey: anchor.web3.PublicKey, commitment?: anchor.web3.Commitment, maxStaleness?: number): Promise;
/** Decode an aggregator's account info
* @param accountInfo the aggregatror's account info
* @returns deserialized aggregator account, as specified by the Switchboard IDL
*/
decodeAggregator(accountInfo: anchor.web3.AccountInfo): AggregatorAccountData;
/** Decode an aggregator and get the latest confirmed round
* @param accountInfo the aggregator's account info
* @param maxStaleness the maximum duration in seconds before a result is considered invalid. Defaults to 0 which ignores any checks
* @returns latest confirmed result as a big.js or null if the latest confirmed round has insufficient oracle responses or data is too stale
*/
decodeLatestAggregatorValue(accountInfo: anchor.web3.AccountInfo, maxStaleness?: number): Big | null;
}
//# sourceMappingURL=index.d.ts.map