Type Alias: BitcoinApiConfig ​
BitcoinApiConfig =
object
Defined in: packages/api/src/types.ts:90
Bitcoin API configuration options. The network field is required and determines default REST/RPC endpoints. Optional rest and rpc fields override individual endpoints on top of the network defaults.
Example ​
// Use regtest defaults (localhost Polar + Esplora)
{ network: 'regtest' }
// Use testnet4 with a custom REST endpoint
{ network: 'testnet4', rest: { host: 'https://my-mempool.example/api' } }
// Use regtest with custom RPC credentials, default REST
{ network: 'regtest', rpc: { host: 'http://mynode:18443', username: 'u', password: 'p' } }Properties ​
executor? ​
optionalexecutor?:HttpExecutor
Defined in: packages/api/src/types.ts:102
Optional HTTP executor for sans-I/O usage. Defaults to global fetch. Inject a custom executor to intercept requests in tests or route through a proxy without monkey-patching globals.
network ​
network:
NetworkName
Defined in: packages/api/src/types.ts:92
Bitcoin network name (e.g., 'regtest', 'testnet4', 'bitcoin').
rest? ​
optionalrest?:Partial<RestConfig>
Defined in: packages/api/src/types.ts:94
Override REST client settings on top of network defaults.
rpc? ​
optionalrpc?:RpcConfig
Defined in: packages/api/src/types.ts:96
Override RPC client settings on top of network defaults.
timeoutMs? ​
optionaltimeoutMs?:number
Defined in: packages/api/src/types.ts:109
Optional request timeout in milliseconds for REST calls. When set, wraps the HTTP executor with an AbortSignal.timeout(). Has no effect when a custom executor is provided (the custom executor is responsible for its own timeouts).