API Methods

This section explains how to fetch deposits, unstakes, points, and exchange rates using the Data API.


Overview

The SDK provides data-fetching methods under the api namespace. These methods query Lombard's backend APIs.

import { createLombardSDK } from '@lombard.finance/sdk';
import { config } from './lib/lombard';

const sdk = createLombardSDK(config);

deposits

Fetch all deposits for an address.

const deposits = await sdk.api.deposits('0x1234...');
// deposits: Deposit[]

Response Type

See Deposit in packages/sdk/src/api-functions/getDepositsByAddress/getDepositsByAddress.ts

interface Deposit {
  isNative: boolean;
  txHash: string;
  eventIndex: number;
  amount: BigNumber;
  tokenAmount?: BigNumber;
  depositAddress?: string;
  fromAddress?: string;
  toAddress?: string;
  toChainId: ChainId | SuiChain | SolanaChain | StarknetChainId;
  fromChainId?: ChainId | SuiChain | SolanaChain | StarknetChainId;
  blockHeight?: number;
  blockTime?: number;
  notarizationStatus: ENotarizationStatus;
  sessionState: ESessionState;
  claimTxHash?: string;
  isClaimed: boolean;
  sanctioned?: boolean;
}

unstakes

Fetch all unstakes for an address.

Response Type

See Unstake in packages/sdk/src/api-functions/getUnstakesByAddress/getUnstakesByAddress.ts


points

Fetch Lux points for an address.


exchangeRatio

Fetch the current exchange ratios for all supported tokens.


depositAddress

Get an existing BTC deposit address for a recipient.

With Options


Last updated