- Run Cyclos.
- Run the
npm install cbs-proxy-client
const createCbsProxyObject =// this object handles authentication and manages session tokens for you.const proxyClient = await// get all transfers after a certain timestampconst primaryAccountToTransfersSinceTimestamp = await proxyClientconst primaryAccountFromTransfersSinceTimestamp = await proxyClient
Pure versions of all the functions can also be used.
Pure functions are useful since you can use them anywhere in your code without needing to pass around a stateful object.
The below code effectively does the same thing as the previous example:
const getSessionToken getPrimaryAccountId getTransfersToPrimaryAccountPure getTransfersFromPrimaryAccountPure =// get authentication token, and your primaryAccountIdconst sessionToken = awaitconst primaryAccountId = await// get all transfers after a certain timestampconst primaryAccountToTransfersSinceTimestamp = awaitconst primaryAccountFromTransfersSinceTimestamp = await