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-sdk

npm install mobula-sdk
2

Second Step

Import the { Mobula } class

import { Mobula } from "mobula-sdk"

Example

Initiate the SDK as shown below

myproject.ts
import { Mobula } from "mobula-sdk";
import { Order } from "mobula-sdk/dist/sdk/models/operations";

async function run() {
  const sdk = new Mobula({
    apiKeyAuth: "<YOUR_API_KEY_HERE>",
  });

  const res = await sdk.fetchWalletTransactions({
    blockchains: "56,Ethereum",
    wallet: "0xd99cB89A20822B0448936DF4f36803778CA5a003",
  });

  if (res.statusCode == 200) {
    // handle response
  }
}
run();
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,