{"_id":"@degenlab/stacks-testing-helpers","_rev":"2-52b62ccb9433c803e5d8175ee80c9a22","name":"@degenlab/stacks-testing-helpers","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.1":{"name":"@degenlab/stacks-testing-helpers","version":"1.0.1","author":{"name":"DegenLab"},"license":"ISC","_id":"@degenlab/stacks-testing-helpers@1.0.1","maintainers":[{"name":"bowtiedblox","email":"degenlabsetups@gmail.com"}],"homepage":"https://github.com/degen-lab/stacks-testing-helpers#readme","bugs":{"url":"https://github.com/degen-lab/stacks-testing-helpers/issues"},"dist":{"shasum":"dc608ef8199d82827bef2668672eee9e87af587b","tarball":"https://registry.npmjs.org/@degenlab/stacks-testing-helpers/-/stacks-testing-helpers-1.0.1.tgz","fileCount":12,"integrity":"sha512-iNYAa2+r8Wh8J7u5LjWo7xRSqU8o2uUpAFBWFnSGXjbdHNC+6BxlgRcnDGMqokjMBwYxoqEtaXv8jeKU0BfYyw==","signatures":[{"sig":"MEYCIQCq2nL0P/n+U3oEkVSsakZf2KgqU2ycYbTWmR9EVoQhIgIhAKG+Fe+MIDAR5ncCjyD1hfOAEZ4AJBgQUYjodsOCdw/F","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":61296},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"6a4eb1b2eca9cf7349c8cb928cf2895af9aaffff","scripts":{"test":"vitest","build":"tsc"},"_npmUser":{"name":"bowtiedblox","email":"degenlabsetups@gmail.com"},"repository":{"url":"git+https://github.com/degen-lab/stacks-testing-helpers.git","type":"git"},"_npmVersion":"11.6.3","description":"This library provides a convenient wrapper for testing and developing on Bitcoin and Stacks. It offers helper functions to mock different scenarios.","directories":{},"_nodeVersion":"22.15.0","dependencies":{"bip32":"^4.0.0","bip39":"^3.1.0","ecpair":"^2.1.0","vitest":"^1.6.0","fast-check":"^3.19.0","typescript":"^5.5.2","bitcoinjs-lib":"^6.1.6","tiny-secp256k1":"^2.2.3","@stacks/transactions":"^6.15.0","@hirosystems/clarinet-sdk":"^2.6.0","bitcoin-address-validation":"^2.2.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/stacks-testing-helpers_1.0.1_1765295169519_0.0883362060967332","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@degenlab/stacks-testing-helpers","version":"1.0.2","publishConfig":{"access":"public","provenance":true},"description":"This library provides a convenient wrapper for testing and developing on Bitcoin and Stacks. It offers helper functions to mock different scenarios.","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","test":"vitest"},"author":{"name":"DegenLab"},"license":"ISC","dependencies":{"@hirosystems/clarinet-sdk":"^2.6.0","@stacks/transactions":"^6.15.0","bip32":"^4.0.0","bip39":"^3.1.0","bitcoin-address-validation":"^2.2.3","bitcoinjs-lib":"^6.1.6","ecpair":"^2.1.0","fast-check":"^3.19.0","tiny-secp256k1":"^2.2.3","typescript":"^5.5.2","vitest":"^1.6.0"},"repository":{"url":"git+https://github.com/degen-lab/stacks-testing-helpers.git","type":"git"},"gitHead":"eac883430a10b4002fb66af6c644dea4c924c2c7","_id":"@degenlab/stacks-testing-helpers@1.0.2","bugs":{"url":"https://github.com/degen-lab/stacks-testing-helpers/issues"},"homepage":"https://github.com/degen-lab/stacks-testing-helpers#readme","_nodeVersion":"20.19.6","_npmVersion":"11.6.4","dist":{"integrity":"sha512-SaHOA7FtGeaiGKP/ChB09Nl/Haa9+Fsnmu7ElNpj3nQD4RcKI6vZ4r1jBROVj+xoa9Z6Lo7tec1Wdps2RMDL0A==","shasum":"bbb96e28768c6937933ad8cccdc78c40569f454a","tarball":"https://registry.npmjs.org/@degenlab/stacks-testing-helpers/-/stacks-testing-helpers-1.0.2.tgz","fileCount":12,"unpackedSize":61611,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@degenlab%2fstacks-testing-helpers@1.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCX9ruwpGBz2JdbjO/U5HRNpobPT2lXuN3Wb9ihXKSICgIhAI5JK1X5t7c8zkroQfAyuWc9tMAlmsLhOScQ9kcPCIY2"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:13cd2c32-bcc7-4c67-af1e-d15cda913af0"}},"directories":{},"maintainers":[{"name":"bowtiedblox","email":"degenlabsetups@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/stacks-testing-helpers_1.0.2_1765299144250_0.9935530116400375"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-09T15:46:09.408Z","modified":"2025-12-09T16:52:24.792Z","1.0.1":"2025-12-09T15:46:09.679Z","1.0.2":"2025-12-09T16:52:24.384Z"},"bugs":{"url":"https://github.com/degen-lab/stacks-testing-helpers/issues"},"author":{"name":"DegenLab"},"license":"ISC","homepage":"https://github.com/degen-lab/stacks-testing-helpers#readme","repository":{"url":"git+https://github.com/degen-lab/stacks-testing-helpers.git","type":"git"},"description":"This library provides a convenient wrapper for testing and developing on Bitcoin and Stacks. It offers helper functions to mock different scenarios.","maintainers":[{"name":"bowtiedblox","email":"degenlabsetups@gmail.com"}],"readme":"# stacks-testing-helpers [![npm](https://img.shields.io/npm/v/stacks-testing-helpers?color=red)](https://www.npmjs.com/package/stacks-testing-helpers)\n\nThis library provides a convenient wrapper for testing and developing on Bitcoin and Stacks. It offers helper functions to mock different scenarios.\n\nThe functions which require simnet can only be used inside a [clarinet](https://github.com/hirosystems/clarinet?tab=readme-ov-file#getting-started-with-clarinet) project.\n\n## Contents\n\n<details>\n  <summary>PoxHelpers</summary>\n  <ul>\n    <li><a href=\"#currentrewardcyclemock\">currentRewardCycleMock</a></li>\n    <li><a href=\"#burnheighttorewardcyclemock\">burnHeightToRewardCycleMock</a></li>\n    <li><a href=\"#rewardcycletoburnheightmock\">rewardCycleToBurnHeightMock</a></li>\n    <li><a href=\"#getpoxinfomock\">getPoxInfoMock</a></li>\n    <li><a href=\"#getstackingminimummock\">getStackingMinimumMock</a></li>\n    <li><a href=\"#blocksuntilrewardphasemock\">blocksUntilRewardPhaseMock</a></li>\n    <li><a href=\"#customblocksuntilrewardphasemock\">customBlocksUntilRewardPhaseMock</a></li>\n    <li><a href=\"#blocksuntilpreparephasemock\">blocksUntilPreparePhaseMock</a></li>\n    <li><a href=\"#customblocksuntilpreparephasemock\">customBlocksUntilPreparePhaseMock</a></li>\n    <li><a href=\"#isinpreparephasemock\">isInPreparePhaseMock</a></li>\n  </ul>\n</details>\n\n<details>\n  <summary>StacksUtils</summary>\n  <ul>\n    <li><a href=\"#burnblockheight\">burnBlockHeight</a></li>\n    <li><a href=\"#chainid\">chainId</a></li>\n    <li><a href=\"#contractcaller\">contractCaller</a></li>\n    <li><a href=\"#stxliquidsupply\">stxLiquidSupply</a></li>\n    <li><a href=\"#stxaccount\">stxAccount</a></li>\n    <li><a href=\"#getdatavar\">getDataVar</a></li>\n    <li><a href=\"#getmapentry\">getMapEntry</a></li>\n  </ul>\n</details>\n\n<details>\n  <summary>BitcoinUtils</summary>\n  <ul>\n    <li><a href=\"#mnemonictopubkeyleather\">mnemonicToPubKeyLeather</a></li>\n    <li><a href=\"#mnemonictopubkeyxverse\">mnemonicToPubKeyXverse</a></li>\n    <li><a href=\"#mnemonictoaddressleather\">mnemonicToAddressLeather</a></li>\n    <li><a href=\"#mnemonictoaddressxverse\">mnemonicToAddressXverse</a></li>\n    <li><a href=\"#mnemonictoprivkeyleather\">mnemonicToPrivKeyLeather</a></li>\n    <li><a href=\"#mnemonictoprivkeyxverse\">mnemonicToPrivKeyXverse</a></li>\n    <li><a href=\"#poxaddrtobtcaddr\">poxAddrToBtcAddr</a></li>\n    <li><a href=\"#getxpub\">getXPub</a></li>\n    <li><a href=\"#getaddressfromxpub\">getAddressFromXpub</a></li>\n    <li><a href=\"#validateaddress\">validateAddress</a></li>\n    <li><a href=\"#wiftopublickey\">wifToPublicKey</a></li>\n    <li><a href=\"#wiftoprivatekey\">wifToPrivateKey</a></li>\n    <li><a href=\"#mnemonictoaddress\">mnemonicToAddress</a></li>\n    <li><a href=\"#mnemonictopubkey\">mnemonicToPubKey</a></li>\n    <li><a href=\"#mnemonictoprivkey\">mnemonicToPrivKey</a></li>\n  </ul>\n</details>\n\n## PoxHelpers\n\n### currentRewardCycleMock\n\nThis function is used for getting the current reward cycle of the given Simnet instance.\n\n```typescript\nimport { currentRewardCycleMock } from 'stacks-testing-helpers';\n\nconst address = 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM'; // STX address\n\nconst currentRewardCycle = currentRewardCycleMock(simnet, address);\n```\n\n### burnHeightToRewardCycleMock\n\nThis function is used for identifying what cycle a given burn height belongs to for a given Simnet instance.\n\n```typescript\nimport { burnHeightToRewardCycleMock } from 'stacks-testing-helpers';\n\nconst address = 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM'; // STX address\nconst height = 2050; //any number\n\nconst rewardCycle = burnHeightToRewardCycleMock(simnet, address, height);\n```\n\n### rewardCycleToBurnHeightMock\n\nThis function is used for getting the burn height that a cycle starts at for a given Simnet instance.\n\n```typescript\nimport { rewardCycleToBurnHeightMock } from 'stacks-testing-helpers';\n\nconst address = 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM'; // STX address\nconst rewCycle = 2; //any number\n\nconst burnHeight = rewardCycleToBurnHeightMock(simnet, address, rewCycle);\n```\n\n### getPoxInfoMock\n\nThis function is used for getting the following information about the pox contract as a javascript dictionary:\n\n- 'first-burnchain-block-height': The activation burn height of the PoX Contract.\n- 'min-amount-ustx': The minimum amount of uSTX required for a stacking slot.\n- 'prepare-cycle-length': The length of the preparation cycle (in burn blocks).\n- 'reward-cycle-id': The identifier of the reward cycle.\n- 'reward-cycle-length': The length of the reward cycle (in burn blocks).\n- 'total-liquid-supply-ustx': The total liquid supply of uSTX.\n\n```typescript\nimport { getPoxInfoMock } from 'stacks-testing-helpers';\n\nconst address = 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM'; // STX address\n\nconst poxInfo = getPoxInfoMock(simnet, address);\n```\n\n### getStackingMinimumMock\n\nThis function is used for getting the stacking minimum of the pox contract for a given Simnet instance.\n\n```typescript\nimport { getStackingMinimumMock } from 'stacks-testing-helpers';\n\nconst address = 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM'; // STX address\n\nconst stackingMinimum = getStackingMinimumMock(simnet, address);\n```\n\n### blocksUntilRewardPhaseMock\n\nThis function is used for getting the remaining blocks until the start of the next reward phase for a given Simnet instance, if the current block is a reward phase block then it will return 0.\n\n```typescript\nimport { blocksUntilRewardPhaseMock } from 'stacks-testing-helpers';\n\nconst blocksUntilRew = blocksUntilRewardPhaseMock(simnet);\n```\n\n### customBlocksUntilRewardPhaseMock\n\nThis function is used for getting the remaining blocks before the reward phase begins for a given burn\nheight with the default `rewardCycleLength = 1050`, `prepareCycleLength = 50`, `startBurnHeight = 0`, if the given burn block is a reward phase block then it will return 0.\n\n```typescript\nimport { customBlocksUntilRewardPhaseMock } from 'stacks-testing-helpers';\n\nconst burnHeight = 2005;\n\nconst blocksUntilRew = customBlocksUntilRewardPhaseMock(burnHeight);\n```\n\nAlso there can be entered custom `rewardCycleLength`, `prepareCycleLength`, `startBurnHeight`:\n\n```typescript\nimport { customBlocksUntilRewardPhaseMock } from 'stacks-testing-helpers';\n\nconst burnHeight = 2005;\nconst rewardCycleLength = 40;\nconst prepareCycleLength = 500;\nconst startBurnHt = 100;\n\nconst blocksUntilRew = customBlocksUntilRewardPhaseMock(\n  burnHeight,\n  rewardCycleLength,\n  prepareCycleLength,\n  startBurnHt\n);\n```\n\n### blocksUntilPreparePhaseMock\n\nThis function is used for getting the remaining blocks until the start of the next prepare phase for a given Simnet instance, if the current block is a prepare phase block then it will return 0.\n\n```typescript\nimport { blocksUntilPreparePhaseMock } from 'stacks-testing-helpers';\n\nconst blocksUntilPrepare = blocksUntilPreparePhaseMock(simnet);\n```\n\n### customBlocksUntilPreparePhaseMock\n\nThis function is used for getting the remaining blocks before the prepare phase begins for a given burn\nheight with the default `rewardCycleLength = 1050`, `prepareCycleLength = 50`, `startBurnHeight = 0`, if the given burn block is a prepare phase block then it will return 0.\n\n```typescript\nimport { customBlocksUntilPreparePhaseMock } from 'stacks-testing-helpers';\n\nconst blockHeight = 2005;\n\nconst blocksUntilRew = customBlocksUntilPreparePhaseMock(blockHeight);\n```\n\nAlso there can be entered custom `rewardCycleLength`, `prepareCycleLength`, `startBurnHeight`:\n\n```typescript\nimport { customBlocksUntilPreparePhaseMock } from 'stacks-testing-helpers';\n\nconst blockHeight = 2005;\nconst rewardCycleLength = 40;\nconst prepareCycleLength = 500;\nconst startBurnHt = 100;\n\nconst blocksUntilPrepare = customBlocksUntilPreparePhaseMock(\n  blockHeight,\n  rewardCycleLength,\n  prepareCycleLength,\n  startBurnHt\n);\n```\n\n### isInPreparePhaseMock\n\nThis function is used for checking if the given burn height is a prepare phase block of a given Simnet instance, returning a boolean.\n\n```typescript\nimport { isInPreparePhaseMock } from 'stacks-testing-helpers';\n\nconst address = 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM'; // STX address\nconst burnHeight = 2059;\n\nconst isPreparePhase = isInPreparePhaseMock(simnet, address, height);\n```\n\n## StacksUtils\n\n### burnBlockHeight\n\nThis function queries the Simnet instance to retrieve the current burn block height.\n\n```typescript\nimport { burnBlockHeight } from 'stacks-testing-helpers';\n\nconst burnHeight = burnBlockHeight(simnet);\n```\n\n### chainId\n\nThis function queries the Simnet instance to retrieve the chain ID.\n\n```typescript\nimport { chainId } from 'stacks-testing-helpers';\n\nconst id = chainId(simnet);\n```\n\n### contractCaller\n\nThis function queries the Simnet instance to retrieve the contract caller.\n\n```typescript\nimport { contractCaller } from 'stacks-testing-helpers';\n\nconst caller = contractCaller(simnet);\n```\n\n### stxLiquidSupply\n\nThis function queries the Simnet instance to retrieve the current liquid supply of STX.\n\n```typescript\nimport { stxLiquidSupply } from 'stacks-testing-helpers';\n\nconst liquidSupply = stxLiquidSupply(simnet);\n```\n\n### stxAccount\n\nThis function queries the Simnet instance to retrieve the details of the specified STX account as a javascript dictionary:\n\n- 'locked': The locked amount in ustx.\n- 'unlock-height': The height where the locked amount will be unlocked.\n- 'unlocked': The unlocked amount in ustx.\n\n```typescript\nimport { stxAccount } from 'stacks-testing-helpers';\n\nconst address = 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM'; // STX address\n\nconst account = stxAccount(simnet, address);\n```\n\n### getDataVar\n\nThis function queries the Simnet instance to retrieve the value of a specific data variable from the specified contract.\n\n```typescript\nimport { getDataVar } from 'stacks-testing-helpers';\n\nconst contract = 'your-contract';\nconst varName = 'your-data-variable';\n\nconst dataVar = getDataVar(simnet, contract, varName);\n```\n\n### getMapEntry\n\nThis function queries the Simnet instance to retrieve the entry of a specific map, identified by its name and key (as ClarityValue), from the specified contract.\n\n```typescript\nimport { getMapEntry } from 'stacks-testing-helpers';\nimport { Cl } from '@stacks/transactions';\n\nconst contract = 'your-contract';\nconst mapName = 'your-map-name';\nconst mapKey = Cl.tuple({ 'your-key': 'your-value' });\n\nconst mapEntry = getMapEntry(simnet, contract, mapName, mapKey);\n```\n\n## BitcoinUtils\n\n### mnemonicToPubKeyLeather\n\nThis function derives the public key from a given mnemonic phrase using the specified derivation path for Leather Wallet (BIP84) with the default values `network = 0`, `accountIndex = 0`, `change = 0` and `addressIndex = 0`.\n\n```typescript\nimport { mnemonicToPubKeyLeather } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\n\nconst pubKey = mnemonicToPubKeyLeather(mnemonic);\n```\n\nThere can also be custom values:\n\n```typescript\nimport { mnemonicToPubKeyLeather } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\nconst network = 1;\nconst accountIndex = 1;\nconst change = 0;\nconst addressIndex = 2;\n\nconst pubKey = mnemonicToPubKeyLeather(\n  mnemonic,\n  network,\n  accountIndex,\n  change,\n  addressIndex\n);\n```\n\n### mnemonicToPubKeyXverse\n\nThis function derives the public key from a given mnemonic phrase using the specified derivation path for Xverse (BIP49) with the default values `network = 0`, `accountIndex = 0`, `change = 0` and `addressIndex = 0`.\n\n```typescript\nimport { mnemonicToPubKeyXverse } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\n\nconst publicKey = mnemonicToPubKeyXverse(mnemonic);\n```\n\nThere can also be custom values:\n\n```typescript\nimport { mnemonicToPubKeyXverse } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\nconst network = 1;\nconst accountIndex = 1;\nconst change = 0;\nconst addressIndex = 2;\n\nconst publicKey = mnemonicToPubKeyXverse(\n  mnemonic,\n  network,\n  accountIndex,\n  change,\n  addressIndex\n);\n```\n\n### mnemonicToAddressLeather\n\nThis function derives the address from a given mnemonic phrase using the specified derivation path for Leather Wallet (BIP84) with the default values `network = 0`, `accountIndex = 0`, `change = 0` and `addressIndex = 0`.\n\n```typescript\nimport { mnemonicToAddressLeather } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\n\nconst address = mnemonicToAddressLeather(mnemonic);\n```\n\nThere can also be custom values:\n\n```typescript\nimport { mnemonicToAddressLeather } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\nconst network = 1;\nconst accountIndex = 1;\nconst change = 0;\nconst addressIndex = 2;\n\nconst address = mnemonicToAddressLeather(\n  mnemonic,\n  network,\n  accountIndex,\n  change,\n  addressIndex\n);\n```\n\n### mnemonicToAddressXverse\n\nThis function derives the address from a given mnemonic phrase using the specified derivation path for Xverse Wallet (BIP49) with the default values `network = 0`, `accountIndex = 0`, `change = 0` and `addressIndex = 0`.\n\n```typescript\nimport { mnemonicToAddressXverse } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\n\nconst address = mnemonicToAddressXverse(mnemonic);\n```\n\nThere can also be custom values:\n\n```typescript\nimport { mnemonicToAddressXverse } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\nconst network = 1;\nconst accountIndex = 1;\nconst change = 0;\nconst addressIndex = 2;\n\nconst address = mnemonicToAddressXverse(\n  mnemonic,\n  network,\n  accountIndex,\n  change,\n  addressIndex\n);\n```\n\n### mnemonicToPrivKeyLeather\n\nThis function derives the private key from a given mnemonic phrase using the specified derivation path for Leather Wallet (BIP84) with the default values `network = 0`, `accountIndex = 0`, `change = 0` and `addressIndex = 0`.\n\n```typescript\nimport { mnemonicToPrivKeyLeather } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\n\nconst privateKey = mnemonicToPrivKeyLeather(mnemonic);\n```\n\nThere can also be custom values:\n\n```typescript\nimport { mnemonicToPrivKeyLeather } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\nconst network = 1;\nconst accountIndex = 1;\nconst change = 0;\nconst addressIndex = 2;\n\nconst privateKey = mnemonicToPrivKeyLeather(\n  mnemonic,\n  network,\n  accountIndex,\n  change,\n  addressIndex\n);\n```\n\n### mnemonicToPrivKeyXverse\n\nThis function derives the private key from a given mnemonic phrase using the specified derivation path for Xverse Wallet (BIP49) with the default values `network = 0`, `accountIndex = 0`, `change = 0` and `addressIndex = 0`.\n\n```typescript\nimport { mnemonicToPrivKeyXverse } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\n\nconst privateKey = mnemonicToPrivKeyXverse(mnemonic);\n```\n\nThere can also be custom values:\n\n```typescript\nimport { mnemonicToPrivKeyXverse } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\nconst network = 1;\nconst accountIndex = 1;\nconst change = 0;\nconst addressIndex = 2;\n\nconst privateKey = mnemonicToPrivKeyXverse(\n  mnemonic,\n  network,\n  accountIndex,\n  change,\n  addressIndex\n);\n```\n\n### poxAddrToBtcAddr\n\nThis function converts a PoX address to a BTC address.\n\n```typescript\nimport { poxAddrToBtcAddr, versions } from 'stacks-testing-helpers';\n\nconst version = versions.your_version;\nconst hashbytes = 'hashbytes';\nconst network = 'mainnet'; // or 'testnet' or 'devnet' or 'mocknet'\n\nconst address = poxAddrToBtcAddr(version, hashbytes, network);\n```\n\n### getXPub\n\nThis function derives the extended public key (xPub) from a given mnemonic phrase using the specified derivation path with the default values `network = 0` and `accountIndex = 0`.\n\n```typescript\nimport { getXPub, AddressType } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\nconst addressType = 'your_address_type'; // \"p2pkh\" | \"p2sh\" | \"p2wpkh\" | \"p2wsh\" | \"p2tr\";\n\nconst xPub = getXPub(mnemonic, addressType);\n```\n\nThere can also be custom values:\n\n```typescript\nimport { getXPub, AddressType } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\nconst addressType = 'your_address_type'; // \"p2pkh\" | \"p2sh\" | \"p2wpkh\" | \"p2wsh\" | \"p2tr\";\nconst network = 1;\nconst accountIndex = 2;\n\nconst xPub = getXPub(mnemonic, addressType, network, accountIndex);\n```\n\n### getAddressFromXpub\n\nThis function derives the address from a given extended public key (xPub) using the specified derivation path with the default values `isTestnet = false`, `change = 0` and `addressIndex = 0`.\n\n```typescript\nimport { getAddressFromXpub, AddressType } from 'stacks-testing-helpers';\n\nconst xpub = 'your-xpub';\nconst addressType = 'your_address_type'; // \"p2pkh\" | \"p2sh\" | \"p2wpkh\" | \"p2wsh\" | \"p2tr\";\n\nconst address = getAddressFromXpub(xpub, addressType);\n```\n\nThere can also be custom values:\n\n```typescript\nimport { getAddressFromXpub, AddressType } from 'stacks-testing-helpers';\n\nconst xpub = 'your-xpub';\nconst addressType = 'your_address_type'; // \"p2pkh\" | \"p2sh\" | \"p2wpkh\" | \"p2wsh\" | \"p2tr\";\nconst network = 1;\nconst accountIndex = 2;\n\nconst address = getAddressFromXpub(xpub, addressType, network, accountIndex);\n```\n\n### validateAddress\n\nThis function validates a given Bitcoin address for the specified network.\n\n```typescript\nimport { validateAddress, Network } from 'stacks-testing-helpers';\n\nconst btcAddress = 'your-btc-address';\nconst network = Network.your_network;\n\nconst valid = validateAddress(btcAddress, network);\n```\n\n### wifToPublicKey\n\nThis function converts a WIF (Wallet Import Format) key to a public key in hexadecimal format with default `network = 0` for mainnet.\n\n```typescript\nimport { wifToPublicKey } from 'stacks-testing-helpers';\n\nconst wif = 'your-wif';\n\nconst publicKey = wifToPublicKey(btcAddress);\n```\n\nThere can also be custom values:\n\n```typescript\nimport { wifToPublicKey } from 'stacks-testing-helpers';\n\nconst wif = 'your-wif';\nconst network = 1; // for testnet\n\nconst publicKey = wifToPublicKey(btcAddress, network);\n```\n\n### wifToPrivateKey\n\nThis function converts a WIF (Wallet Import Format) key to a private key in hexadecimal format with default `network = 0` for mainnet.\n\n```typescript\nimport { wifToPrivateKey } from 'stacks-testing-helpers';\n\nconst wif = 'your-wif';\n\nconst privateKey = wifToPrivateKey(btcAddress);\n```\n\nThere can also be custom values:\n\n```typescript\nimport { wifToPrivateKey } from 'stacks-testing-helpers';\n\nconst wif = 'your-wif';\nconst network = 1; // for testnet\n\nconst privateKey = wifToPrivateKey(btcAddress, network);\n```\n\n### mnemonicToAddress\n\nThis function derives a Bitcoin address from a given mnemonic phrase using the specified derivation path with the default values `network = 0`, `accountIndex = 0`, `change = 0` and `addressIndex = 0`.\n\n```typescript\nimport { mnemonicToAddress } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\nconst addressType = 'your_address_type'; // \"p2pkh\" | \"p2sh\" | \"p2wpkh\" | \"p2wsh\" | \"p2tr\";\n\nconst address = mnemonicToAddress(mnemonic, addressType);\n```\n\nThere can also be custom values:\n\n```typescript\nimport { mnemonicToAddress } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\nconst addressType = 'your_address_type'; // \"p2pkh\" | \"p2sh\" | \"p2wpkh\" | \"p2wsh\" | \"p2tr\";\nconst network = 1;\nconst accountIndex = 1;\nconst change = 0;\nconst addressIndex = 2;\n\nconst address = mnemonicToAddress(\n  mnemonic,\n  addressType,\n  network,\n  accountIndex,\n  change,\n  addressIndex\n);\n```\n\n### mnemonicToPubKey\n\nThis function derives a public key from a given mnemonic phrase using the specified derivation path with the default values `network = 0`, `accountIndex = 0`, `change = 0` and `addressIndex = 0`.\n\n```typescript\nimport { mnemonicToPubKey } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\nconst addressType = 'your_address_type'; // \"p2pkh\" | \"p2sh\" | \"p2wpkh\" | \"p2wsh\" | \"p2tr\";\n\nconst publicKey = mnemonicToPubKey(mnemonic, addressType);\n```\n\nThere can also be custom values:\n\n```typescript\nimport { mnemonicToPubKey } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\nconst addressType = 'your_address_type'; // \"p2pkh\" | \"p2sh\" | \"p2wpkh\" | \"p2wsh\" | \"p2tr\";\nconst network = 1;\nconst accountIndex = 1;\nconst change = 0;\nconst addressIndex = 2;\n\nconst publicKey = mnemonicToPubKey(\n  mnemonic,\n  addressType,\n  network,\n  accountIndex,\n  change,\n  addressIndex\n);\n```\n\n### mnemonicToPrivKey\n\nThis function derives a private key from a given mnemonic phrase using the specified derivation path with the default values `network = 0`, `accountIndex = 0`, `change = 0` and `addressIndex = 0`.\n\n```typescript\nimport { mnemonicToAddress } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\nconst addressType = 'your_address_type'; // \"p2pkh\" | \"p2sh\" | \"p2wpkh\" | \"p2wsh\" | \"p2tr\";\n\nconst privateKey = mnemonicToPrivKey(mnemonic, addressType);\n```\n\nThere can also be custom values:\n\n```typescript\nimport { mnemonicToPrivKey } from 'stacks-testing-helpers';\n\nconst mnemonic = 'your-mnemonic-phrase';\nconst addressType = 'your_address_type'; // \"p2pkh\" | \"p2sh\" | \"p2wpkh\" | \"p2wsh\" | \"p2tr\";\nconst network = 1;\nconst accountIndex = 1;\nconst change = 0;\nconst addressIndex = 2;\n\nconst privateKey = mnemonicToPrivKey(\n  mnemonic,\n  addressType,\n  network,\n  accountIndex,\n  change,\n  addressIndex\n);\n```\n","readmeFilename":"README.md"}