Constructs a Gateway instance
The Anchor program instance
The URL of the switchboard gateway
Optional
oracleKey: PublicKeyOptional specific oracle key
Readonly
gatewayThe URL of the switchboard gateway
Optional
Readonly
oracleOptional specific oracle key
Readonly
programThe Anchor program instance
Fetches signatures from the gateway. REST API endpoint: /api/v1/gateway_attest_enclave
A promise that resolves to the attestation response.
Sends a request to the gateway bridge enclave.
REST API endpoint: /api/v1/gateway_bridge_enclave
A promise that resolves to the response.
Fetches a quote from the gateway.
REST API endpoint: /api/v1/gateway_fetch_quote
A promise that resolves to the quote response.
Fetches the randomness reveal from the gateway.
The parameters for the randomness reveal.
The randomness reveal response.
Fetches signatures from the gateway.
REST API endpoint: /api/v1/fetch_signatures
A promise that resolves to the feed evaluation responses.
Fetches signatures from the gateway without pre-encoded jobs REST API endpoint: /api/v1/fetch_signatures_batch
A promise that resolves to the feed evaluation responses.
Fetches signatures using consensus mechanism REST API endpoint: /api/v1/fetch_signatures_consensus
A promise that resolves to the consensus response.
Fetches signatures from the gateway.
REST API endpoint: /api/v1/fetch_signatures
A promise that resolves to the feed evaluation responses.
Fetches signatures from the gateway. REST API endpoint: /api/v1/fetch_signatures_batch
A promise that resolves to the feed evaluation responses.
Fetches signatures from multiple feeds
A promise that resolves to the feed evaluation responses.
Initializes a Surge instance
The parameters for the surge instance
The API key for authentication
Optional
verbose?: booleanWhether to enable verbose logging
A new instance of dSurge
Gateway interface for oracle communication
The Gateway class provides the connection between your application and Switchboard oracle operators. It handles:
Gateways are geo-distributed endpoints that route requests to available oracle operators for optimal performance.
Variable Overrides
Variable overrides allow you to dynamically customize oracle task execution by providing key-value pairs that replace variables within oracle jobs. This is particularly useful for:
Usage Examples
Variable Syntax in Jobs
Variables in oracle jobs use the
${VARIABLE_NAME}
syntax:Best Practices
Gateway