createNetwork
Usage
Basic usage
import { createNetwork } from '@stacks/network';
// From a network name string
const network = createNetwork('mainnet');
// From a network constant
import { STACKS_TESTNET } from '@stacks/network';
const network = createNetwork(STACKS_TESTNET);With an API key
import { createNetwork } from '@stacks/network';
const network = createNetwork('testnet', 'my-hiro-api-key');With an options object
import { createNetwork } from '@stacks/network';
const network = createNetwork({
network: 'mainnet',
apiKey: 'my-hiro-api-key',
});With custom API key options
With custom client options
Notes
Signature
Returns
Parameters
Overload 1: Network only
Parameter
Type
Description
Overload 2: Network + API key
Parameter
Type
Description
Overload 3: Options object
Property
Type
Required
Description
Last updated
Was this helpful?