Optionalverbose: booleanReadonlycrossbarReadonlyfeedReadonlyoracleReadonlyverboseThe hash of the feed to fetch data for
GET /updates/evm/:chainId/:aggregatorIds Fetch updates for EVM network feeds from the crossbar
The chain ID and aggregator IDs to fetch updates for
Promise<{ results: EVMResult[]; encoded: string[] }> - The updates for the specified feeds
Fetch a Gateway instance for the specified network with caching
This method fetches gateway URLs from the crossbar service and creates a Gateway instance. Results are cached per network to avoid repeated network calls.
Optionalnetwork: stringNetwork to fetch gateway for (devnet/testnet/mainnet). If not provided, uses the network set via setNetwork()
GET /gateways Fetch all gateways from the crossbar
Optionalnetwork: string = 'mainnet'Optional network parameter (devnet/testnet/mainnet). Defaults to mainnet.
GET /updates/iota/:network/:aggregatorAddresses Fetch updates for Iota network feeds from the crossbar
The Iota network to fetch updates for (mainnet / testnet)
The addresses of the aggregators to fetch updates for
GET /v2/fetch/:feedHash Fetch OracleFeed data from a crossbar server using the provided feedId
The identifier of the OracleFeed to fetch
GET /oracle/quote/:aggregatorIds Fetch the quote for the given aggregator IDs
The aggregator IDs to fetch the quote for
The network to fetch the quote for (mainnet / testnet)
GET /oracles Fetch all oracles for a given network
Optionalnetwork: stringOptional network parameter (devnet/mainnet). Defaults to mainnet.
POST /gateways/fetch_signatures
The request parameters
Optionalnetwork: stringOptional network parameter (devnet/mainnet). Defaults to mainnet.
POST /gateways/fetch_signatures_consensus Fetch consensus signatures from oracles for a given set of feed requests
The request parameters with camelCase fields
Optionalnetwork: stringOptional network parameter (devnet/mainnet). Defaults to mainnet.
// Using FeedRequestV1
const feedRequestV1 = CrossbarClient.createFeedRequestV1(
['base64EncodedJob1', 'base64EncodedJob2'],
1000000, // maxVariance
3 // minResponses
);
// Using FeedRequestV2
const feedRequestV2 = CrossbarClient.createFeedRequestV2('base64EncodedProtoBuf');
const response = await client.fetchSignaturesConsensus({
apiVersion: '1.0',
recentHash: 'someRecentHash',
signatureScheme: 'ed25519',
hashScheme: 'sha256',
feedRequests: [feedRequestV1, feedRequestV2],
numOracles: 3,
useTimestamp: false
});
GET /updates/solana/:network/:feedpubkeys Fetch updates for Solana network feeds from the crossbar
The Solana network to fetch updates for
The public keys of the feeds to fetch updates for
OptionalnumSignatures: numberThe number of signatures to fetch (optional)
GET /updates/sui/:network/:aggregatorAddresses Fetch updates for Sui network feeds from the crossbar
The Sui network to fetch updates for (mainnet / testnet)
The addresses of the aggregators to fetch updates for
GET /v2/update/{feedHashes} Fetch V2 oracle consensus updates for feed hashes with enhanced chain support
Array of feed hashes to fetch updates for
Optionaloptions: V2UpdateQueryOptional query parameters for the request
// Basic usage with single feed hash
const response = await client.fetchV2Update(
['0x7418dc6408f5e0eb4724dabd81922ee7b0814a43abc2b30ea7a08222cd1e23ee']
);
// With chain-specific options for Sui mainnet
const response = await client.fetchV2Update(
['0x7418dc6408f5e0eb4724dabd81922ee7b0814a43abc2b30ea7a08222cd1e23ee'],
{
chain: 'sui',
network: 'mainnet',
use_timestamp: true,
num_oracles: 5
}
);
// Multiple feed hashes with custom gateway
const response = await client.fetchV2Update(
[
'0x7418dc6408f5e0eb4724dabd81922ee7b0814a43abc2b30ea7a08222cd1e23ee',
'0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
],
{
network: 'testnet',
gateway: 'https://custom-gateway.example.com',
signature_scheme: 'Secp256k1'
}
);
Get the currently configured default network
The current network (mainnet or devnet)
GET /randomness/evm/:chainId/:randomnessId
The chain ID and randomness ID to resolve
Set the default network for CrossbarClient operations
This network will be used as the default for all operations that accept a network parameter. Individual method calls can still override this by passing their own network parameter.
The network to use (SolanaMainnet or SolanaDevnet)
GET /simulate/evm/:network/:aggregatorIds Simulate fetching Solana feed results from the crossbar
The Solana network to simulate
The public keys of the feeds to simulate
POST /v2/simulate/proto Simulate an OracleFeed from a protobuf object or feed hash
The OracleFeed protobuf object or feed hash to simulate
OptionalincludeReceipts: booleanWhether to include receipts in the response
OptionalvariableOverrides: Record<string, string>Variable overrides for the simulation
Optionalnetwork: stringNetwork to use for simulation. If not provided, uses the network set via setNetwork()
Simulate fetching feed results from the crossbar using feed hashes
The hashes of the feeds to simulate
OptionalincludeReceipts: booleanWhether to include receipts in the response
GET /simulate/iota/:network/:aggregatorAddresses Simulate fetching Iota feed results from the crossbar
The Iota network to simulate (mainnet / testnet)
The feed IDs to simulate
OptionalincludeReceipts: booleanWhether to include receipts in the response
POST /simulate/jobs Simulate oracle jobs execution without storing them
The simulation request containing jobs and optional parameters
Simulate V2 oracle feeds with variable overrides and network selection
The hashes of the V2 feeds to simulate
OptionalincludeReceipts: booleanWhether to include receipts in the response
OptionalvariableOverrides: Record<string, string>Variable overrides for the simulation
Optionalnetwork: stringNetwork to use for simulation (defaults to "mainnet")
GET /simulate/solana/:network/:feedpubkeys Simulate fetching Solana feed results from the crossbar
The Solana network to simulate
The public keys of the feeds to simulate
GET /simulate/sui/:network/:aggregatorAddresses Simulate fetching Sui feed results from the crossbar
The Sui network to simulate (mainnet / testnet)
The feed IDs to simulate
OptionalincludeReceipts: booleanWhether to include receipts in the response
POST /store Store oracle jobs on the crossbar, associated with a queue address
The address of the queue
The oracle jobs to store
POST /v2/store Store an OracleFeed on IPFS using crossbar.
The OracleFeed to store
StaticcreateCreate a FeedRequestV1 object
Base64 encoded oracle jobs
Maximum variance allowed for the feed
Minimum number of oracle responses required
StaticcreateCreate a FeedRequestV2 object
Base64 encoded feed protobuf
StaticdefaultOptionalverbose: boolean
GET /fetch/:feedHash Fetch data from the crossbar using the provided feedHash