MinimaRpcBackend
@totemsdk/realtime / MinimaRpcBackend
Class: MinimaRpcBackend
Plug-in interface for the portfolio data source.
Implement this to use any chain provider — LookupNode, a raw Minima RPC, a custom indexer — instead of the default Axia hosted API.
Examples
— sovereign LookupNode
import { LookupBackend } from '@totemsdk/realtime';
import { connectLookupNode } from '@totemsdk/lookup-client';
const client = await connectLookupNode({ hyperswarmTopic: 'abc...' });
const manager = createPortfolioStreamManager(deps, {
backend: new LookupBackend(client),
});
— direct Minima node (polling)
import { MinimaRpcBackend } from '@totemsdk/realtime';
import { createMinimaRpcClient } from '@totemsdk/minima-rpc';
const rpc = createMinimaRpcClient({ host: 'localhost', port: 9005 });
const manager = createPortfolioStreamManager(deps, {
backend: new MinimaRpcBackend(rpc),
});
Implements
Constructors
Constructor
new MinimaRpcBackend(
client):MinimaRpcBackend
Parameters
client
Returns
MinimaRpcBackend
Properties
supportsPush
readonlysupportsPush:false=false
Whether this backend delivers push updates via subscribe().
If false or absent the manager will call getPortfolio() on a timer.
Implementation of
Methods
getPortfolio()
getPortfolio(
address):Promise<PortfolioEntry[]>
Fetch the current portfolio for one address. Called for the initial snapshot and for poll cycles on non-push backends.
Parameters
address
string
Returns
Promise<PortfolioEntry[]>