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/sdkPeer dependencies:
npm install viem axios bignumber.js @bitcoinerlab/secp256k1 bitcoinjs-libConfiguration
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
| Option | Type | Required | Description |
|---|---|---|---|
env | Env | Yes | Environment selection (prod, testnet, dev) |
providers | ProviderGetters | No | Wallet provider functions |
partner | PartnerConfig | No | Partner identification |
modules | readonly AnyModule[] | No | Custom 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