API Methods
Complete reference for all data-fetching methods available through sdk.api.*.
deposits()
Retrieves all deposits for an address.
const deposits = await sdk.api.deposits('0x1234...');Returns: Deposit[]
interface Deposit {
isNative: boolean;
txHash: string;
eventIndex: number;
amount: string;
tokenAmount: string;
chain: string;
blockHeight: number;
blockTime: string;
notarizationStatus: string;
sessionState: string;
claimTxHash?: string;
isClaimed: boolean;
sanctioned: boolean;
}unstakes()
Fetches unstake records with optional filtering.
const unstakes = await sdk.api.unstakes('0x1234...', {
show_redeems: true,
show_unstakes: true,
to_native: true,
});Parameters:
| Parameter | Type | Description |
|---|---|---|
show_redeems | boolean | Include redeem records |
show_unstakes | boolean | Include unstake records |
to_native | boolean | Filter for native BTC redemptions |
Returns: Unstake[]
interface Unstake {
isNative: boolean;
txHash: string;
chain: string;
blockHeight: number;
blockTime: string;
address: string;
amount: string;
payoutAmount?: string;
payoutTxStatus?: string;
notarizationStatus: string;
}points()
Access Lux points for an address.
// Current season
const points = await sdk.api.points('0x1234...');
// Specific season
const seasonPoints = await sdk.api.points('0x1234...', { season: 2 });exchangeRatio()
Get current exchange rates for supported tokens.
const ratios = await sdk.api.exchangeRatio();
// LBTC ratios
const lbtcPerBtc = ratios.LBTC.tokenBTCRatio; // How many LBTC per 1 BTC
const btcPerLbtc = ratios.LBTC.BTCTokenRatio; // How many BTC per 1 LBTCdepositAddress()
Retrieve an existing BTC deposit address for a recipient on a specified chain.
const address = await sdk.api.depositAddress(
'0x1234...', // recipient
chainId, // target chain
{
partnerId: 'YOUR_PARTNER_ID', // optional
token: 'LBTC', // optional
}
);Returns the existing deposit address or throws if none exists.
All methods handle cross-chain operations across Ethereum, Sui, Solana, and Starknet networks.
Last updated on