STACKS_DEVNET
Pre-configured StacksNetwork object for a local devnet environment (e.g. Clarinet's local blockchain). Uses http://localhost:3999 as the default base URL.
Usage
import { STACKS_DEVNET } from '@stacks/network';
console.log(STACKS_DEVNET.client.baseUrl);
// 'http://localhost:3999'Most @stacks/transactions functions accept a network string directly:
import { makeContractCall, Cl } from '@stacks/transactions';
const tx = await makeContractCall({
contractAddress: 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM',
contractName: 'my-contract',
functionName: 'my-function',
functionArgs: [Cl.uint(1)],
senderKey: '753b7cc01a1a2e86221266a154af739463fce51219d97e4f856cd7200c3bd2a601',
network: 'devnet', // equivalent to passing STACKS_DEVNET
});Notes
Devnet inherits all testnet settings (chain ID, transaction version, address versions) but uses different magic bytes (
id) and a local API URL.Addresses on devnet use the same format as testnet (
ST/SN).
Definition
Last updated
Was this helpful?