JavaScript SDK
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 here
Desired modules can be selected using the modules and/or excludeModules query params.
// Selected modules to fetch
const params = {
modules: “token”, “farm”, “liquidity”
};
const selectedData = await client.getPortfolioData(address, params);
Last updated