Step API
  • Overview
    • Introduction
    • Getting Started
    • JavaScript SDK
    • Purchasing
    • Credit Usage
    • Rate Limiting
    • Authentication
  • API Reference
    • Portfolio
    • TX History
Powered by GitBook
On this page
  1. Overview

JavaScript SDK

PreviousGetting StartedNextPurchasing

Last updated 3 months ago

Step Finance provides a Javascript library that includes TypeScript definitions for the API response data and a simple client for making requests. Access to the API requires a valid API key which can be generated after purchasing a plan on our website

npm install @stepfinance/step-api-sdk

Next you may create the SolanaDataAPIClient using the API key from your dashboard.

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 positions for a given wallet
const data = await client.getPortfolioData(address);
console.log(data)

User portfolio data is grouped into one of several modules. some of which have subgroups. A single module or subgroup will contain positions fetched from a number DeFi providers. A complete list of providers can be found

Desired modules can be selected using the and/or query params.

// Selected modules to fetch
const params = {
  modules: “token”, “farm”, “liquidity”
};

const selectedData = await client.getPortfolioData(address, params);
here
modules
excludeModules