NetworkClientParam
Usage
import { NetworkClientParam } from '@stacks/network';
// Functions that use NetworkClientParam accept these options:
async function myApiCall(opts: { data: string } & NetworkClientParam) {
// opts.network — optional, defaults to mainnet
// opts.client — optional, overrides the network's client
}
// Pass just a network string
await myApiCall({ data: 'hello', network: 'testnet' });
// Or override the client entirely
await myApiCall({
data: 'hello',
client: {
baseUrl: 'https://my-custom-node.example.com',
},
});Notes
Definition
Last updated
Was this helpful?