Spool SDK

Spool SDK is a stateless npm package written in TypeScript.
It is a facade that wraps RPC calls from and to the Spool smart contracts as well as API calls to subgraph and the Spool analytics server.

Production Mode

To use this package, import it as follows:

import {SpoolSdk, SpoolSdkParameters} from '@spool.fi/spool-sdk';

It needs to be initialized with correct parameters before it can be used.
Also, a web3 Provider object (or Signer) needs to be passed! [provider = read-only]

import type {BaseProvider} from '@ethersproject/providers';

const sdk = new SpoolSdk(
    providerOrSigner: BaseProvider | Signer,
    params: SpoolSdkParameters
)

The default config parameters can be found here.
Please make sure to pass only LOWER CASE addresses.

Once initialized, the SDK can be used to retrieve data like this:

sdk.spools.getAllSpools()

sdk.fees.getEstimatedFeesEarned(...)

Development

To install and use this npm package from source, run the following command (it generates types from smart contract ABIs)

npm i
npm run build:prod

results matching ""

    No results matching ""