Install the latest nakamoto version with npm install @stacks/stacking@latest.
The StackingClient in @stacks/stacking was updated to match the latest pox-4 contract.
Added StackingClient.signPoxSignature()
Added Pox4SignatureTopic enum
New stacking arguments for StackingClient.stack, StackingClient.stackExtend, StackingClient.stackIncrease, StackingClient.stackAggregationCommit, StackingClient.stackAggregationCommitIndexed, and StackingClient.stackAggregationIncrease
To test using the Nakamoto testnet, you can use the StacksTestnet network with a custom URL. The Nakamoto testnet is being hosted at https://api.testnet.hiro.so. Use this URL like this:
import { StacksTestnet } from "@stacks/network"const network = new StacksTestnet({ url: "https://api.testnet.hiro.so"})
const { txid } = await client.stack({ amountMicroStx: 10_000_000_000_000, // this can be at most the signature `maxAmount` poxAddress: MY_BTC_ADDRESS, cycles: 2, // this needs to match signature `period` burnBlockHeight: CURRENT_BURN_BLOCK_HEIGHT, // NEW ARGS signerKey: MY_SIGNER_PUBLIC_KEY, signerSignature: signature, maxAmount: 10_000_000_000_000, authId: 123n, privateKey: MY_STX_PRIVATE_KEY})