@alkanes/ts-sdk API Reference
Complete TypeScript SDK reference for the Alkanes protocol
The @alkanes/ts-sdk provides a unified TypeScript interface for interacting with the Alkanes protocol. This page documents all available classes and their methods.
Table of Contents
AlkanesProvider
The main entry point for all SDK functionality. Provides access to all sub-clients after initialization.
import { AlkanesProvider } from '@alkanes/ts-sdk';
const provider = new AlkanesProvider({
network: 'mainnet', // 'mainnet' | 'testnet' | 'signet' | 'regtest' | 'local'
rpcUrl?: string, // Optional: Override RPC URL
dataApiUrl?: string, // Optional: Override Data API URL
bitcoinNetwork?: Network, // Optional: Custom bitcoinjs-lib network
});
// IMPORTANT: Must initialize before using
await provider.initialize();
// Access sub-clients
provider.esplora // EsploraClient
provider.alkanes // AlkanesRpcClient
provider.metashrew // MetashrewClient
provider.lua // LuaClient
provider.dataApi // DataApiClient
provider.espo // EspoClient
provider.bitcoin // BitcoinRpcClientProperties
| Property | Type | Description |
|---|---|---|
rpcUrl | string | The JSON-RPC endpoint URL |
dataApiUrl | string | The Data API endpoint URL |
network | Network | bitcoinjs-lib network object |
networkType | string | Network type: mainnet, testnet, signet, regtest |
networkPreset | string | The network preset name used |
Methods
initialize()
async initialize(): Promise<void>Initialize the provider by loading the WASM module. Must be called before using any sub-clients.
const provider = new AlkanesProvider({ network: 'mainnet' });
await provider.initialize();
// Now ready to usegetProvider()
async getProvider(): Promise<WebProvider>Get the underlying WASM WebProvider instance. Automatically initializes if needed.
getBlockHeight()
async getBlockHeight(): Promise<number>Convenience method to get the current blockchain height.
const height = await provider.getBlockHeight();
console.log('Current height:', height); // e.g., 927618Typed Transaction Methods
alkanesExecuteTyped()
async alkanesExecuteTyped(params: {
toAddresses: string[];
inputRequirements: string;
protostones: string;
feeRate?: number;
envelopeHex?: string;
fromAddresses?: string[];
changeAddress?: string;
traceEnabled?: boolean;
mineEnabled?: boolean;
autoConfirm?: boolean;
}): Promise<TransactionBroadcast>Execute an Alkanes contract call with full type safety. Returns a TransactionBroadcast object with transaction() for immediate tx info and receipt() for lazy-loaded traces.
toAddresses(string[]) – Recipient addressesinputRequirements(string) – Token inputs required (e.g., '2:0:1000000')protostones(string) – Protostone call format (e.g., '[2,0,77]:v0:v0')feeRate(number) – Fee rate in sat/vBenvelopeHex(string) – WASM bytecode hex for contract deploytraceEnabled(boolean) – Enable execution tracingmineEnabled(boolean) – Auto-mine block (regtest only)
const broadcast = await provider.alkanesExecuteTyped({
toAddresses: [walletAddress],
inputRequirements: '',
protostones: '[2,0,77]:v0:v0', // Mint DIESEL
feeRate: 1,
traceEnabled: true,
mineEnabled: true,
});
const tx = broadcast.transaction();
console.log('TXID:', tx.txid);
const traces = await broadcast.receipt();frbtcWrapTyped()
async frbtcWrapTyped(params: {
amount: bigint | number;
toAddress: string;
fromAddress?: string;
changeAddress?: string;
feeRate?: number;
traceEnabled?: boolean;
mineEnabled?: boolean;
autoConfirm?: boolean;
}): Promise<TransactionResult>Wrap BTC to frBTC (the wrapped Bitcoin token on Alkanes). Essential for participating in Alkanes DeFi.
amount(bigint | number) – Amount in satoshis to wraptoAddress(string) – Recipient address for frBTCfromAddress(string) – Source address for BTCfeeRate(number) – Fee rate in sat/vBmineEnabled(boolean) – Auto-mine block (regtest only)
const result = await provider.frbtcWrapTyped({
amount: BigInt(100000000), // 1 BTC
toAddress: walletAddress,
feeRate: 1,
mineEnabled: true,
});
console.log('Wrapped! TXID:', result.reveal_txid);alkanesInitPoolTyped()
async alkanesInitPoolTyped(params: {
factoryId: { block: number; tx: number };
token0: { block: number; tx: number };
token1: { block: number; tx: number };
amount0: string | number | bigint;
amount1: string | number | bigint;
minimumLp?: string | number | bigint;
toAddress: string;
fromAddress?: string;
feeRate?: number;
trace?: boolean;
autoConfirm?: boolean;
}): Promise<string>Initialize a new AMM liquidity pool with two tokens.
factoryId(AlkaneId) – AMM Factory contract IDtoken0(AlkaneId) – First token of the pairtoken1(AlkaneId) – Second token of the pairamount0(string) – Initial amount of token0amount1(string) – Initial amount of token1minimumLp(string) – Minimum LP tokens (slippage protection)
const txid = await provider.alkanesInitPoolTyped({
factoryId: { block: 4, tx: 65522 },
token0: { block: 2, tx: 0 }, // DIESEL
token1: { block: 32, tx: 0 }, // frBTC
amount0: '300000000',
amount1: '50000',
toAddress: walletAddress,
feeRate: 1,
});alkanesSwapTyped()
async alkanesSwapTyped(params: {
factoryId: { block: number; tx: number };
path: Array<{ block: number; tx: number }>;
inputAmount: string | number | bigint;
minimumOutput: string | number | bigint;
expires: number;
toAddress: string;
fromAddress?: string;
feeRate?: number;
trace?: boolean;
autoConfirm?: boolean;
}): Promise<string>Execute a token swap through AMM pools. Supports multi-hop routing.
factoryId(AlkaneId) – AMM Factory contract IDpath(AlkaneId[]) – Swap path from input to output tokeninputAmount(string) – Amount of input token to swapminimumOutput(string) – Minimum acceptable output (slippage protection)expires(number) – Expiration block height
const txid = await provider.alkanesSwapTyped({
factoryId: { block: 4, tx: 65522 },
path: [
{ block: 2, tx: 0 }, // DIESEL (in)
{ block: 32, tx: 0 }, // frBTC (out)
],
inputAmount: '100000000',
minimumOutput: '10',
expires: currentHeight + 10,
toAddress: walletAddress,
feeRate: 1,
});EsploraClient
Client for Esplora-compatible Bitcoin block explorer API. Provides UTXO data, transaction information, and address balances.
Accessed via provider.esplora
getAddressUtxos()
async getAddressUtxos(address: string): Promise<UTXO[]>Get all UTXOs for a Bitcoin address. Essential for calculating BTC balance and building transactions.
address(string) – Bitcoin address (any format)
const utxos = await provider.esplora.getAddressUtxos('bc1q...');
const balance = utxos.reduce((sum, u) => sum + u.value, 0);
console.log('Balance:', balance, 'sats');getAddressInfo()
async getAddressInfo(address: string): Promise<AddressInfo>Get aggregated address information including transaction count and balances.
address(string) – Bitcoin address
getAddressTxs()
async getAddressTxs(address: string): Promise<Transaction[]>Get transaction history for an address.
address(string) – Bitcoin address
getTx()
async getTx(txid: string): Promise<Transaction>Get detailed transaction information by txid.
txid(string) – Transaction ID (hex)
getTxStatus()
async getTxStatus(txid: string): Promise<TxStatus>Get confirmation status of a transaction.
txid(string) – Transaction ID
getTxHex()
async getTxHex(txid: string): Promise<string>Get raw transaction hex.
txid(string) – Transaction ID
getBlocksTipHeight()
async getBlocksTipHeight(): Promise<number>Get the current blockchain tip height.
getBlocksTipHash()
async getBlocksTipHash(): Promise<string>Get the current blockchain tip block hash.
broadcastTx()
async broadcastTx(txHex: string): Promise<string>Broadcast a signed transaction to the network.
txHex(string) – Signed transaction hex
AlkanesRpcClient
Client for Alkanes-specific RPC methods. Handles token balances, contract simulation, and protocol operations.
Accessed via provider.alkanes
getBalance()
async getBalance(address: string): Promise<AlkaneBalance[]>Get all Alkane token balances for an address. Internally uses the protorunesbyaddress view function.
address(string) – Bitcoin address
const balances = await provider.alkanes.getBalance('bc1q...');
for (const b of balances) {
const id = `${b.alkane_id.block}:${b.alkane_id.tx}`;
console.log(`${id}: ${b.balance}`);
}getByAddress()
async getByAddress(address: string, blockTag?: string, protocolTag?: number): Promise<OutpointBalances>Get detailed balance information by address with outpoint data. Returns balance sheets per UTXO.
address(string) – Bitcoin addressblockTag(string) – Block height or 'latest'protocolTag(number) – Protocol tag (default: 1 for Alkanes)
getByOutpoint()
async getByOutpoint(outpoint: Outpoint, blockTag?: string, protocolTag?: number): Promise<BalanceSheet>Get balance sheet for a specific UTXO outpoint.
outpoint(Outpoint) – { txid: string, vout: number }blockTag(string) – Block height or 'latest'protocolTag(number) – Protocol tag (default: 1)
getBytecode()
async getBytecode(alkaneId: AlkaneId, blockTag?: string): Promise<string>Get the WASM bytecode of an Alkane contract.
alkaneId(AlkaneId) – { block: number, tx: number }blockTag(string) – Block height or 'latest'
simulate()
async simulate(contractId: AlkaneId, contextJson: string, blockTag?: string): Promise<SimulateResult>Simulate a contract call without broadcasting. Used for read operations and gas estimation.
contractId(AlkaneId) – Target contract IDcontextJson(string) – JSON-encoded call contextblockTag(string) – Block height or 'latest'
// Simulate a pool reserves query
const result = await provider.alkanes.simulate(
{ block: 2, tx: 77087 },
JSON.stringify({ opcode: 101 }), // getReserves
'latest'
);execute()
async execute(paramsJson: string): Promise<ExecuteResult>Build a transaction that executes a contract call.
paramsJson(string) – JSON-encoded execution parameters
trace()
async trace(outpoint: Outpoint): Promise<TraceResult>Trace the history of tokens on an outpoint.
outpoint(Outpoint) – { txid: string, vout: number }
view()
async view(contractId: AlkaneId, viewFn: string, params: unknown[], blockTag?: string): Promise<unknown>Call a view function on a contract.
contractId(AlkaneId) – Target contract IDviewFn(string) – View function nameparams(unknown[]) – Function parametersblockTag(string) – Block height or 'latest'
getAllPools()
async getAllPools(factoryId?: AlkaneId): Promise<AlkaneId[]>Get all AMM pools from a factory contract.
factoryId(AlkaneId) – Factory contract ID (optional)
getAllPoolsWithDetails()
async getAllPoolsWithDetails(factoryId?: AlkaneId, chunkSize?: number, maxConcurrent?: number): Promise<PoolDetails[]>Get all pools with their reserve and token details.
factoryId(AlkaneId) – Factory contract IDchunkSize(number) – Batch size for queriesmaxConcurrent(number) – Max concurrent requests
getPendingUnwraps()
async getPendingUnwraps(blockTag?: string): Promise<PendingUnwrap[]>Get pending BTC unwrap requests from the frBTC contract.
blockTag(string) – Block height or 'latest'
MetashrewClient
Low-level client for metashrew_view RPC calls. Provides direct access to indexer state queries.
Accessed via provider.metashrew
getHeight()
async getHeight(): Promise<number>Get the current indexed blockchain height from the metashrew indexer.
const height = await provider.metashrew.getHeight();
console.log('Indexed height:', height);getStateRoot()
async getStateRoot(height?: number): Promise<string>Get the state root hash at a specific height.
height(number) – Block height (optional, defaults to latest)
getBlockHash()
async getBlockHash(height: number): Promise<string>Get block hash at a specific height.
height(number) – Block height
view()
async view(viewFn: string, payload: string, blockTag?: string): Promise<string>Execute a metashrew_view call. This is the low-level method for querying indexer state.
viewFn(string) – View function name (e.g., 'simulate', 'protorunesbyaddress')payload(string) – Hex-encoded protobuf payloadblockTag(string) – Block height or 'latest'
// Query pool reserves
const response = await provider.metashrew.view(
'simulate',
'0x2096ce382a06029fda04e7073001', // DIESEL/frBTC pool
'latest'
);
// Parse the hex response...LuaClient
Client for executing Lua scripts on the server. Supports automatic scripthash caching for improved performance.
Accessed via provider.lua
eval()
async eval(script: string, args?: unknown[]): Promise<LuaResult>Execute a Lua script with automatic scripthash caching. This is the recommended method for Lua execution. It computes the SHA256 hash of the script and tries the cached version first (lua_evalsaved), falling back to full execution (lua_evalscript) if not cached.
script(string) – Lua script contentargs(unknown[]) – Arguments passed to the script as 'args' global
const result = await provider.lua.eval(`
local height = tonumber(_RPC.metashrew_height()) or 0
local params = args[1] or {}
return {
height = height,
address = params[1]
}
`, [['bc1q...']]);
console.log('Height:', result.returns.height);
console.log('RPC calls:', result.calls);
console.log('Runtime:', result.runtime, 'ms');evalScript()
async evalScript(script: string): Promise<LuaResult>Execute a Lua script directly without caching. Use this only when you need to bypass the scripthash cache (e.g., for one-time scripts).
script(string) – Lua script content
DataApiClient
Client for the Data API endpoints. Provides market data, pool information, candles, and holder statistics.
Accessed via provider.dataApi
Market Data
getBitcoinPrice()
async getBitcoinPrice(): Promise<BitcoinPrice>Get the current Bitcoin price in USD.
const price = await provider.dataApi.getBitcoinPrice();
console.log('BTC Price:', '$' + price.usd.toLocaleString());getBitcoinMarketChart()
async getBitcoinMarketChart(days: number): Promise<MarketChart>Get historical Bitcoin price data.
days(number) – Number of days of history
Pool Data
getPools()
async getPools(factoryId?: string): Promise<Pool[]>Get all pools from the data API.
factoryId(string) – Filter by factory (optional)
getReserves()
async getReserves(pool: string): Promise<Reserves>Get current reserves for a pool.
pool(string) – Pool ID (e.g., '2:77087')
getCandles()
async getCandles(pool: string, interval: string, startTime: number, endTime: number, limit?: number): Promise<Candle[]>Get OHLCV candle data for a pool.
pool(string) – Pool IDinterval(string) – Candle interval (e.g., '1h', '1d')startTime(number) – Start timestamp (seconds)endTime(number) – End timestamp (seconds)limit(number) – Max candles to return
getTrades()
async getTrades(pool: string, startTime?: number, endTime?: number, limit?: number): Promise<Trade[]>Get trade history for a pool.
pool(string) – Pool IDstartTime(number) – Start timestamp (optional)endTime(number) – End timestamp (optional)limit(number) – Max trades to return
Pool History
getPoolHistory()
async getPoolHistory(poolId: string, category: string, limit?: number, offset?: number): Promise<HistoryEntry[]>Get pool history by category (swap, mint, burn, all).
poolId(string) – Pool IDcategory(string) – 'swap' | 'mint' | 'burn' | 'all'limit(number) – Max entriesoffset(number) – Pagination offset
getSwapHistory()
async getSwapHistory(poolId: string, limit?: number, offset?: number): Promise<SwapEntry[]>Get swap history for a pool.
poolId(string) – Pool IDlimit(number) – Max entriesoffset(number) – Pagination offset
getMintHistory()
async getMintHistory(poolId: string, limit?: number, offset?: number): Promise<MintEntry[]>Get liquidity mint history for a pool.
poolId(string) – Pool IDlimit(number) – Max entriesoffset(number) – Pagination offset
getBurnHistory()
async getBurnHistory(poolId: string, limit?: number, offset?: number): Promise<BurnEntry[]>Get liquidity burn history for a pool.
poolId(string) – Pool IDlimit(number) – Max entriesoffset(number) – Pagination offset
Balance & Token Data
getAlkanesByAddress()
async getAlkanesByAddress(address: string): Promise<AlkaneBalance[]>Get Alkane token balances for an address via the Data API.
address(string) – Bitcoin address
getAddressBalances()
async getAddressBalances(address: string, includeOutpoints?: boolean): Promise<AddressBalances>Get comprehensive address balances.
address(string) – Bitcoin addressincludeOutpoints(boolean) – Include per-UTXO breakdown
getHolders()
async getHolders(alkane: string, page?: number, limit?: number): Promise<Holder[]>Get token holder list for an Alkane.
alkane(string) – Alkane ID (e.g., '2:0')page(number) – Page number (0-indexed)limit(number) – Results per page
getHoldersCount()
async getHoldersCount(alkane: string): Promise<number>Get total number of holders for an Alkane.
alkane(string) – Alkane ID
getKeys()
async getKeys(alkane: string, prefix: string, limit?: number): Promise<string[]>Get storage keys for an Alkane contract.
alkane(string) – Alkane IDprefix(string) – Key prefix filterlimit(number) – Max keys to return
EspoClient
Client for the Espo indexer. Provides alkanes data and AMM analytics through two modules: Essentials (balances, holders, storage) and AMM Data (candles, trades, pools, swap routing).
Accessed via provider.espo
Essentials Module
ping()
async ping(): Promise<string>Ping the Espo server to check connectivity.
const response = await provider.espo.ping();
console.log(response); // 'pong'getHeight()
async getHeight(): Promise<number>Get the current block height processed by the Espo indexer.
const height = await provider.espo.getHeight();
console.log('Espo height:', height);getAddressBalances()
async getAddressBalances(address: string, includeOutpoints?: boolean): Promise<any>Get alkanes balances for a Bitcoin address with optional outpoint details.
address(string) – Bitcoin addressincludeOutpoints(boolean) – Include detailed UTXO information (default: false)
const balances = await provider.espo.getAddressBalances('bc1q...', true);
console.log(balances.balances); // { '840000:1': '1000000', ... }
console.log(balances.outpoints); // [{ outpoint: 'txid:0', entries: [...] }]getAddressOutpoints()
async getAddressOutpoints(address: string): Promise<any>Get all outpoints containing alkanes for an address.
address(string) – Bitcoin address
getOutpointBalances()
async getOutpointBalances(outpoint: string): Promise<any>Get alkanes balances at a specific UTXO outpoint.
outpoint(string) – Outpoint in format 'txid:vout'
getHolders()
async getHolders(alkaneId: string, page?: number, limit?: number): Promise<any>Get paginated list of holders for an alkane token.
alkaneId(string) – Alkane ID in format 'block:tx'page(number) – Page number (default: 0)limit(number) – Items per page (default: 100)
const holders = await provider.espo.getHolders('840000:1', 0, 50);
console.log('Total holders:', holders.total);
console.log('Page:', holders.items);getHoldersCount()
async getHoldersCount(alkaneId: string): Promise<number>Get the total number of unique holders for an alkane token.
alkaneId(string) – Alkane ID in format 'block:tx'
getKeys()
async getKeys(alkaneId: string, page?: number, limit?: number): Promise<any>Get storage keys for an alkane contract with pagination and UTF-8 decoding.
alkaneId(string) – Alkane ID in format 'block:tx'page(number) – Page number (default: 0)limit(number) – Items per page (default: 100)
AMM Data Module
ammdataPing()
async ammdataPing(): Promise<string>Ping the AMM Data module to check connectivity.
getCandles()
async getCandles(pool: string, timeframe?: string, side?: string, limit?: number, page?: number): Promise<any>Get OHLCV candlestick data for a liquidity pool.
pool(string) – Pool ID in format 'block:tx'timeframe(string) – Candle interval: '10m', '1h', '1d', '1w', '1M'side(string) – Price side: 'base' or 'quote'limit(number) – Number of candles (default: 100)page(number) – Page number (default: 0)
const candles = await provider.espo.getCandles(
'840100:5',
'1h',
'base',
100,
0
);
console.log(candles.candles); // [{ open, high, low, close, volume, ... }]getTrades()
async getTrades(pool: string, limit?: number, page?: number, side?: string, filterSide?: string, sort?: string, dir?: string): Promise<any>Get trade history for a pool with comprehensive filtering and sorting.
pool(string) – Pool ID in format 'block:tx'limit(number) – Number of trades (default: 100)page(number) – Page number (default: 0)side(string) – Price side: 'base' or 'quote'filterSide(string) – Filter by trade side: 'buy', 'sell', or 'all'sort(string) – Sort fielddir(string) – Sort direction: 'asc' or 'desc'
getPools()
async getPools(limit?: number, page?: number): Promise<any>Get all AMM pools with pagination.
limit(number) – Number of pools (default: 100)page(number) – Page number (default: 0)
findBestSwapPath()
async findBestSwapPath(tokenIn: string, tokenOut: string, mode?: string, amountIn?: string, amountOut?: string, amountOutMin?: string, amountInMax?: string, availableIn?: string, feeBps?: number, maxHops?: number): Promise<any>Find the optimal multi-hop swap path between two tokens using advanced routing algorithms.
tokenIn(string) – Input token IDtokenOut(string) – Output token IDmode(string) – Swap mode: 'exact_in', 'exact_out', or 'implicit'amountIn(string) – Input amount (for exact_in mode)amountOut(string) – Output amount (for exact_out mode)amountOutMin(string) – Minimum acceptable outputamountInMax(string) – Maximum acceptable inputavailableIn(string) – Available input amountfeeBps(number) – Fee in basis points (e.g., 30 = 0.3%)maxHops(number) – Maximum number of hops (default: 3)
const path = await provider.espo.findBestSwapPath(
'840000:1',
'840000:2',
'exact_in',
'1000000',
undefined,
'900000',
undefined,
undefined,
30,
3
);
console.log('Amount out:', path.amount_out);
console.log('Hops:', path.hops);getBestMevSwap()
async getBestMevSwap(token: string, feeBps?: number, maxHops?: number): Promise<any>Find the best MEV (Maximal Extractable Value) arbitrage opportunity for a token across all available pools.
token(string) – Token ID to find arbitrage forfeeBps(number) – Fee in basis points (default: 30)maxHops(number) – Maximum number of hops (default: 3)
const mev = await provider.espo.getBestMevSwap('840000:1', 30, 3);
if (mev.profit > 0) {
console.log('Profit:', mev.profit);
console.log('Route:', mev.hops);
}BitcoinRpcClient
Client for Bitcoin Core RPC methods. Provides block data, transaction broadcasting, and network information.
Accessed via provider.bitcoin
getBlockCount()
async getBlockCount(): Promise<number>Get the current block count from Bitcoin Core.
getBlockHash()
async getBlockHash(height: number): Promise<string>Get block hash at a specific height.
height(number) – Block height
getBlock()
async getBlock(hash: string, raw?: boolean): Promise<Block>Get block data by hash.
hash(string) – Block hashraw(boolean) – Return raw hex instead of parsed
sendRawTransaction()
async sendRawTransaction(hex: string): Promise<string>Broadcast a raw transaction.
hex(string) – Signed transaction hex
getTransaction()
async getTransaction(txid: string, blockHash?: string): Promise<Transaction>Get transaction details.
txid(string) – Transaction IDblockHash(string) – Block hash hint (optional)
getBlockchainInfo()
async getBlockchainInfo(): Promise<BlockchainInfo>Get blockchain state information.
getNetworkInfo()
async getNetworkInfo(): Promise<NetworkInfo>Get network peer information.
getMempoolInfo()
async getMempoolInfo(): Promise<MempoolInfo>Get mempool statistics.
estimateSmartFee()
async estimateSmartFee(target: number): Promise<FeeEstimate>Estimate fee rate for confirmation target.
target(number) – Target blocks for confirmation
generateToAddress()
async generateToAddress(nblocks: number, address: string): Promise<string[]>Generate blocks (regtest only).
nblocks(number) – Number of blocks to generateaddress(string) – Address for block rewards
Types
Common types used throughout the SDK.
// Alkane identifier
interface AlkaneId {
block: number; // Block number where the alkane was created
tx: number; // Transaction index within the block
}
// Token balance
interface AlkaneBalance {
alkane_id: AlkaneId; // Or 'id' in some responses
balance: string; // Or 'amount' - raw balance (divide by 10^decimals)
symbol?: string;
name?: string;
}
// UTXO
interface UTXO {
txid: string;
vout: number;
value: number; // Satoshis
status: {
confirmed: boolean;
block_height?: number;
block_hash?: string;
block_time?: number;
};
}
// Outpoint reference
interface Outpoint {
txid: string;
vout: number;
}
// Lua execution result
interface LuaResult {
calls: number; // Number of RPC calls made
returns: any; // Script return value
runtime: number; // Execution time in ms
}
// Provider configuration
interface ProviderConfig {
network: 'mainnet' | 'testnet' | 'signet' | 'regtest' | 'local';
rpcUrl?: string;
dataApiUrl?: string;
bitcoinNetwork?: Network; // bitcoinjs-lib network
}
// Network presets
const NETWORK_PRESETS = {
mainnet: {
networkType: 'mainnet',
rpcUrl: 'https://mainnet.subfrost.io/v4/jsonrpc',
dataApiUrl: 'https://mainnet.subfrost.io/v4/jsonrpc',
},
testnet: { ... },
signet: { ... },
regtest: { ... },
local: { ... },
};For usage examples and patterns, see the TS SDK Guide.