1.1.0 • Published 2 months ago

@stepfinance/step-api-sdk v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 months ago

Step API SDK

This SDK provides a simple and efficient way to interact with the Step API.

Installation

Install the SDK using pnpm:

npm install @stepfinance/step-api-sdk

Usage

Initialize the Client

To start using the SDK, initialize the StepAPIClient with your API key:

import { StepAPIClient } from ‘@stepfinance/step-api-sdk’

const API_KEY = "<your-key-here>";

// Insert an API key generated from your dashboard
const client = new StepAPIClient(API_KEY);

Fetch Portfolio Data

Retrieve portfolio data for a specific wallet address:

(async () => {
  try {
    const data = await client.getPortfolioData(address, {
      modules: "token,nft,liquidity",
    });

    console.log("Positions:", data);
  } catch (error) {
    console.error("Error fetching positions:", error);
  }
})();

API Reference

See the API Reference for more information.

Testing

Run the tests to ensure the SDK works as expected:

pnpm test