Skip to main content

OHLCVService Actions

2 actions registered.

NameDeprecated
subscribe
unsubscribe

OHLCVService:subscribe​

Package: @metamask/core-backend

Subscribe to an OHLCV channel. If this is the first subscriber for the given asset/interval/currency combination a WebSocket subscription is created. Additional calls for the same combination only bump the reference count.

Parameters:

NameDescription
optionsThe subscription parameters.

Returns: A promise that resolves once the subscription is established.

Handler signature:

(options: OHLCVSubscriptionOptions) => Promise<void>

OHLCVService:unsubscribe​

Package: @metamask/core-backend

Unsubscribe from an OHLCV channel. Decrements the reference count and, when it reaches zero, starts a grace-period timer before actually unsubscribing from the WebSocket to absorb rapid navigation patterns.

Parameters:

NameDescription
optionsThe subscription parameters to unsubscribe from.

Returns: A promise that resolves once the unsubscription is processed.

Handler signature:

(options: OHLCVSubscriptionOptions) => Promise<void>