Skip to Content

Start Here

Install the SDK, configure your environment, connect wallets, and make your first API calls. This section covers the integration workflow, partner setup, and testnet configuration.


Installation

Install the main package and peer dependencies:

npm install @lombard.finance/sdk

Peer dependencies:

npm install viem axios bignumber.js @bitcoinerlab/secp256k1 bitcoinjs-lib

Configuration

Create a centralized config object using createConfig():

import { createConfig, Env } from '@lombard.finance/sdk'; const config = createConfig({ env: Env.prod, // Environment: prod, testnet, dev providers: { // Optional wallet providers evm: () => window.ethereum, }, partner: { // Optional partner config partnerId: 'YOUR_PARTNER_ID', }, }); export { config };

Configuration Options

OptionTypeRequiredDescription
envEnvYesEnvironment selection (prod, testnet, dev)
providersProviderGettersNoWallet provider functions
partnerPartnerConfigNoPartner identification
modulesreadonly AnyModule[]NoCustom module integration

Usage Patterns

Full SDK Object

Provides unified access to all features:

import { createLombardSDK } from '@lombard.finance/sdk'; import { config } from './lib/lombard'; const sdk = createLombardSDK(config); // Access chain operations const stake = sdk.chain.btc.stake({ /* ... */ }); // Access data APIs const deposits = await sdk.api.deposits('0x...');

Best for exploratory development and prototyping.

Modular Factories

Import only the functions you need for better tree-shaking:

import { btcStake } from '@lombard.finance/sdk'; import { config } from './lib/lombard'; const stake = btcStake(config, { /* ... */ });

Best for production builds where bundle size matters.

Both approaches use the same configuration object. Export the config from a central location for consistent reuse throughout your application.

Last updated on