@spool.fi/spool-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.5.13 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @spool.fi/spool-sdk

Weekly Downloads

66

Version

0.5.13

License

MIT

Unpacked Size

2.17 MB

Total Files

7

Last publish

Collaborators

  • szehao
  • heng.solidant
  • tadej.solidant
  • anze.solidant