Constructors

  • Parameters

    • crossbarUrl: string
    • Optional verbose: boolean

    Returns CrossbarClient

Properties

crossbarUrl: string
feedCache: Map<string, CrossbarFetchResponse>
verbose: boolean

Methods

  • GET /fetch/:feedHash Fetch data from the crossbar using the provided feedHash

    Parameters

    • feedHash: string

      The hash of the feed to fetch data for

    Returns Promise<{
        feedHash: string;
        jobs: IOracleJob[];
        queueHex: string;
    }>

    • The data fetched from the crossbar
  • GET /updates/evm/:chainId/:aggregatorIds Fetch updates for EVM network feeds from the crossbar

    Parameters

    • param0: {
          aggregatorIds: string[];
          chainId: number;
      }

      The chain ID and aggregator IDs to fetch updates for

      • aggregatorIds: string[]
      • chainId: number

    Returns Promise<{
        encoded: string[];
        results: EVMResult[];
    }>

    Promise<{ results: EVMResult[]; encoded: string[] }> - The updates for the specified feeds

  • GET /updates/solana/:network/:feedpubkeys Fetch updates for Solana network feeds from the crossbar

    Parameters

    • network: string

      The Solana network to fetch updates for

    • feedpubkeys: string[]

      The public keys of the feeds to fetch updates for

    • Optional numSignatures: number

      The number of signatures to fetch (optional)

    Returns Promise<{
        lookupTables: string[];
        pullIx: TransactionInstruction;
        responses: {
            errors: string;
            oracle: string;
            result: number;
        }[];
        success: boolean;
    }[]>

    • The updates for the specified feeds
  • GET /randomness/evm/:chainId/:randomnessId

    Parameters

    • param0: {
          chainId: number;
          randomnessId: string;
      }

      The chain ID and randomness ID to resolve

      • chainId: number
      • randomnessId: string

    Returns Promise<{
        encoded: string;
        response: {
            recovery_id: number;
            signature: string;
            value: string;
        };
    }>

  • GET /simulate/evm/:network/:aggregatorIds Simulate fetching Solana feed results from the crossbar

    Parameters

    • network: number

      The Solana network to simulate

    • aggregatorIds: string[]

      The public keys of the feeds to simulate

    Returns Promise<{
        aggregatorId: string;
        feedHash: string;
        results: number[];
    }[]>

    • The simulated feed results
  • GET /simulate/:feedHashes Simulate fetching feed results from the crossbar using feed hashes

    Parameters

    • feedHashes: string[]

      The hashes of the feeds to simulate

    Returns Promise<{
        feedHash: string;
        results: number[];
    }[]>

    • The simulated feed results
  • GET /simulate/solana/:network/:feedpubkeys Simulate fetching Solana feed results from the crossbar

    Parameters

    • network: string

      The Solana network to simulate

    • feedpubkeys: string[]

      The public keys of the feeds to simulate

    Returns Promise<{
        feed: string;
        feedHash: string;
        results: number[];
    }[]>

    • The simulated feed results
  • POST /store Store oracle jobs on the crossbar, associated with a queue address

    Parameters

    • queueAddress: string

      The address of the queue

    • jobs: IOracleJob[]

      The oracle jobs to store

    Returns Promise<{
        cid: string;
        feedHash: string;
        queueHex: string;
    }>

    • The stored data information