Skip to main content

Configuration

Create the client with defaults for Liquidium mainnet:

import { LiquidiumClient } from "@liquidium/client";

const client = new LiquidiumClient();

Pass config when your app needs custom transports, headers, canister IDs, or EVM read support:

const client = new LiquidiumClient({
apiBaseUrl: "https://app.liquidium.fi/api/sdk",
headers: {
"x-client-name": "my-app",
},
evmRpcUrl: import.meta.env.VITE_EVM_RPC_URL,
});

Config Fields

FieldUse
environmentSelect bundled canister IDs. The SDK currently bundles only "mainnet".
icHostOverride the ICP replica host.
identitySend signed canister calls with a caller identity.
apiBaseUrlOverride the Liquidium SDK HTTP API root. Defaults to https://app.liquidium.fi/api/sdk.
headersAdd headers to SDK HTTP API requests.
canisterIdsPartially override lending, ethDeposit, simpleLoans, or pools.{btc,usdt,usdc,icp} for custom deployments.
fetchProvide a custom fetch implementation.
timeoutMsSet the SDK API request timeout in milliseconds. Defaults to 30_000.
evmRpcUrlCreate a viem public client for EVM reads.
evmRpcHeadersAdd headers to EVM RPC requests.
evmPublicClientUse an existing viem-compatible read client. When supplied, it takes precedence over evmRpcUrl and evmRpcHeaders.

Use nested canister overrides:

const client = new LiquidiumClient({
canisterIds: {
lending: "aaaaa-aa",
simpleLoans: "u5rm3-niaaa-aaaar-qb7eq-cai",
pools: {
btc: "bbbbb-bb",
},
},
});

Removed flat keys such as instantLoans, btcPool, and ercPool are rejected with LiquidiumErrorCode.VALIDATION_ERROR.

Set VITE_INFURA_API_KEY or VITE_EVM_RPC_URL when you run an example that needs Ethereum reads.