cbs-proxy-client
Introduction
A simple javascript library to interact with the cbs-proxy.
Getting started
Testing
- Run Cyclos.
- Run the
cbs-proxy
npm test
Usage
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 = await const primaryAccountId = await // get all transfers after a certain timestampconst primaryAccountToTransfersSinceTimestamp = await const primaryAccountFromTransfersSinceTimestamp = await