Prerequisite

Before starting with the Mobula API SDK, ensure you have Node.js installed on your machine.

Download and install Node.js from here

Installation

1

First Step

Install mobula-api-sdk

npm install mobula-api-sdk
2

Second Step

Import the { Mobula } class

import { Mobula } from "mobula-api-sdk"

Example

Initiate the SDK as shown below

myproject.ts
import { Mobula } from "mobula-api-sdk";

const mobula = new Mobula("YOUR_API_KEY_HERE");

mobula
  .fetchWalletHistoryBalance({
    wallet: "0x77A89C51f106D6cD547542a3A83FE73cB4459135",
  })
  .then((response) => {
    console.log(response);
  })
  .catch((error) => {
    console.error("Error:", error);
  });
Replace YOUR_API_KEY_HERE with your API key

Response

The data is contained in the request body

body: '{"data":{"wallet":["0x77a89c51f106d6cd547542a3a83fe73cb4459135"],"balance_usd":186.11174894116627,"balance_history":
[[1650788304000,0],[1650788305000,0],[1650874705000,40.94737444508439],
[1650961105000,41.43979364186007],[1651047505000,41.52255389488385],
[1651133905000,39.98507396566903],[1651220305000,41.36797682434358],
[1651306705000,39.94252843778348],[1651393105000,38.42918052538283],
[1651479505000,38.44553804299468],[1651565905000,42.12988132520523],
[1651652305000,41.08260516823677],[1651738705000,42.932806984287325],
[1651825105000,40.20314283431752],[1661265693000,61.1200498094'... 51976 more characters,