Websocket API
Listening to Fast data via Websocket
Base URL
The base URL for Fast is dependent on which Fast instance you're using. The URL will be in the form:
wss://<fast-identifier>.fast.jp.stork-oracle.networkThe main instance of fast is:
wss://fast.jp.stork-oracle.networkAuthentication
All WebSocket connection requests must include an Authorization header with the value set as Basic <token>. For example, if your token is gmork123:
wscat -c 'wss://fast.jp.stork-oracle.network/ws' -H "Authorization: Basic gmork123"Endpoints
/ws
Description
Subscribe to listen to Stork Fast data streams.
Query Parameters
Stork Fast supports a number of query parameters to configure messages coming from Stork Fast.
Channel
The channel query parameter specifies the channel Fast should send data to you on. Latency does not differ between channels. The following channels are generally available:
10ms: Fixed rate messages every 10ms20ms: Fixed rate messages every 20ms50ms: Fixed rate messages every 50ms100ms: Fixed rate messages every 100ms500ms: Fixed rate messages every 500ms1s: Fixed rate messages every 1sreal_time: Messages only on value change, no faster than 1ms
Message Type
The message_type query parameter determines the structure of the data coming from Fast. Fast currently supports two message types:
unsigned: An unsigned message type, primarily intended for human readabilitysigned_ecdsa: A verifiable message type including an ECDSA signature. Comprised of a single bit-packed payload for maximum on-chain efficiency. Not human-readable.
Messages
Subscribe Message
Description
Subscribe to receive updates for the specified assets.
Fields
type: Type of the message. In this case,subscribeassets: An array of uint16 asset IDs
Example
Unsubscribe Message
Description
Unsubscribe from updates for a subset of subscribed assets.
Fields
type: Type of the message. In this case,unsubscribedata: An array of uint16 asset IDs
Example
Unsigned Message
Description
An unsigned non-verifiable message type containing human-readable asset updates.
Fields
type: Type of the message. In this case,unsignedtax: Taxonomy ID the Fast instance is usingts: The UNIX nanosecond timestamp for the messagea: An array of asset value pairs in the form of{"id": int, "v": string}id: uint16 asset IDv: 10^18 scaled value as a string
Example
Signed ECDSA Message
Description
An ECDSA signed verifiable message type containing a bitpacked payload for submission on-chain.
Fields
type: Type of the message. In this case,signed_ecdsap: The bitpacked verifiable payload in the form of a hex string. The first 65 bytes of this payload are the signature
Example
Last updated