1.0.15 • Published 3 days ago

@spool.fi/spool-v2-sdk v1.0.15

Weekly downloads
-
License
MIT
Repository
-
Last release
3 days ago

Spool v2 SDK

Spool v2 SDK is a TypeScript npm package that provides a convenient way to interact with the Spool smart contracts and subgraph. It encapsulates RPC calls to the Spool smart contract as well as API calls to the subgraph, making it easier for developers to integrate Spool functionality into their applications.

Installation

To install the Spool v2 SDK, use the following npm command:

npm install "@spool.fi/spool-v2-sdk"

Getting Started

To use the Spool v2 SDK, you need to create an instance of the SpoolSdk class. Here's how you can do it:

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

const spoolSDK = new SpoolSdk(
    config: SDKConfig,
    signerOrProvider: Signer | Provider
)

The first parameter is the SDK config, which includes the subgraph URL, price feed URL, rewards URL, and ContractAddresses.

The second parameter, signerOrProvider, is a bit more intricate and calls for additional clarification. Before delving into the specifics, it's important to highlight that the SpoolSDK accommodates both view-only functions and state-changing functions. The nature of this parameter hinges on your intended SDK usage. If your intention is solely to employ the SDK for view-only functions, the Provider class suffices. However, if you intend to use state-changing functions, you will need a Signer or Fireblocks provider to execute transactions.

Usage

Below is a straightforward illustration on how to use an SDK.

const vaultDetailsQuery: VaultDetailsQuery = {
  vaultAddress: 'vault_address',
};
const result: Number = await spoolSDK.getVaultTVRInUSD(vaultDetailsQuery);
1.0.15

3 days ago

1.0.14

17 days ago

1.0.13

21 days ago

1.0.12

26 days ago

1.0.11

1 month ago

1.0.10

1 month ago

1.0.9

1 month ago

1.0.8-dev.6

1 month ago

1.0.8-dev.5

2 months ago

1.0.8-dev.4

2 months ago

1.0.8-dev.2

2 months ago

1.0.8-dev.3

2 months ago

1.0.8-dev.1

2 months ago

1.0.7-dev.2

2 months ago

1.0.8

2 months ago

1.0.7-dev.1

2 months ago

1.0.7

2 months ago

1.0.6

2 months ago

1.0.5

3 months ago

1.0.4-dev.1

3 months ago

1.0.3

6 months ago

1.0.2

7 months ago

1.0.1

8 months ago

1.0.0

8 months ago

0.0.2

9 months ago

0.0.1

9 months ago

0.0.1-dev.3

9 months ago

0.0.1-dev.2

9 months ago

0.0.1-dev.1

9 months ago