id,language,category,name,description,code,imports_or_contract,notes
1,clarity,info,get-pox-info,"Get current PoX cycle info","(contract-call? .pox-4 get-pox-info)","SP000000000000000000002Q6VF78.pox-4","Returns cycle number reward-cycle-length prepare-cycle-length min-threshold"
2,clarity,info,get-stacker-info,"Get stacker status","(contract-call? .pox-4 get-stacker-info stacker)","SP000000000000000000002Q6VF78.pox-4","Returns lock-period pox-addr start-burn-ht unlock-burn-ht"
3,clarity,stack,stack-stx,"Stack STX directly","(contract-call? .pox-4 stack-stx amount-ustx pox-addr start-burn-ht lock-period)","SP000000000000000000002Q6VF78.pox-4","Minimum 100000 STX (100000000000 microSTX)"
4,clarity,stack,stack-increase,"Increase stacked amount","(contract-call? .pox-4 stack-increase increase-by)","SP000000000000000000002Q6VF78.pox-4","Add more STX to existing stack"
5,clarity,stack,stack-extend,"Extend stacking period","(contract-call? .pox-4 stack-extend extend-count pox-addr)","SP000000000000000000002Q6VF78.pox-4","Extend lock period by cycles"
6,clarity,delegate,delegate-stx,"Delegate to pool operator","(contract-call? .pox-4 delegate-stx amount-ustx delegate-to until-burn-ht pox-addr)","SP000000000000000000002Q6VF78.pox-4","Pool will stack on your behalf"
7,clarity,delegate,revoke-delegate,"Revoke delegation","(contract-call? .pox-4 revoke-delegate-stx)","SP000000000000000000002Q6VF78.pox-4","Cancel delegation after unlock"
8,clarity,pool,fast-pool-delegate,"Delegate to Fast Pool","(contract-call? 'SP21YTSM60CAY6D011EZVEVNKXVW8FVZE198XEFFP.pox4-fast-pool-v3 delegate-stx amount)","SP21YTSM60CAY6D011EZVEVNKXVW8FVZE198XEFFP.pox4-fast-pool-v3","Popular community pool ~8% APY"
9,clarity,pool,planbetter-pool,"Delegate to PlanBetter Pool","(contract-call? 'SP1K1A1PMGW2ZJCNF46NWZWHG8TS1D23EGH1KNK60.pox4-pools delegate amount)","SP1K1A1PMGW2ZJCNF46NWZWHG8TS1D23EGH1KNK60.pox4-pools","Community pool variable APY"
10,clarity,pool,stackingdao-deposit,"Deposit to StackingDAO","(contract-call? 'SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.stacking-dao-core-v1 deposit amount)","SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.stacking-dao-core-v1","Get stSTX liquid stacking token"
11,clarity,rewards,get-reward-info,"Get stacking rewards","(contract-call? .pox-4 get-stacking-minimum)","SP000000000000000000002Q6VF78.pox-4","Returns minimum STX to stack"
12,clarity,address,create-pox-address,"Create PoX BTC address","{ version: (buff 1) hashbytes: (buff 32) }","N/A","Tuple for BTC reward address (version 0x00-0x06)"
13,clarity,cycle,get-current-cycle,"Get current reward cycle","(contract-call? .pox-4 current-pox-reward-cycle)","SP000000000000000000002Q6VF78.pox-4","Returns current cycle number"
14,clarity,cycle,burn-height-to-cycle,"Convert block to cycle","(contract-call? .pox-4 burn-height-to-reward-cycle height)","SP000000000000000000002Q6VF78.pox-4","Get cycle number from block height"
15,clarity,status,check-delegation,"Check delegation status","(contract-call? .pox-4 get-delegation-info stacker)","SP000000000000000000002Q6VF78.pox-4","Returns amount-ustx delegated-to until-burn-ht pox-addr"
16,api,info,get-pox-info-api,"Get PoX info via API","const response = await fetch('https://api.hiro.so/v2/pox'); const poxInfo = await response.json(); console.log(poxInfo.current_cycle)","fetch or axios","Returns current_cycle min_threshold prepare_length reward_slots"
17,api,info,get-stacker-status,"Get stacker status via API","const response = await fetch(`https://api.hiro.so/extended/v1/address/${address}/stacking`); const status = await response.json()","fetch or axios","Returns stacked amount locked unlock_height pox_address"
18,javascript,address,create-pox-address-js,"Create PoX address tuple in JavaScript","import { bufferCV tupleCV } from '@stacks/transactions'; const poxAddr = tupleCV({ version: bufferCV(Buffer.from([0x00])) hashbytes: bufferCV(Buffer.from('bitcoin_pubkey_hash' 'hex')) })","import { bufferCV tupleCV } from '@stacks/transactions'","Version: 0x00=P2PKH 0x01=P2SH 0x04=P2WPKH 0x05=P2WSH"
19,javascript,stack,stack-stx-tx,"Build stack STX transaction","const txOptions = { contractAddress: 'SP000000000000000000002Q6VF78' contractName: 'pox-4' functionName: 'stack-stx' functionArgs: [uintCV(amountMicroStx) poxAddrCV uintCV(startBurnHeight) uintCV(lockPeriod)] senderKey: privateKey network anchorMode: AnchorMode.Any }; const tx = await makeContractCall(txOptions)","import { makeContractCall uintCV AnchorMode } from '@stacks/transactions'","Lock period: 1-12 cycles; amount must meet minimum threshold"
20,javascript,delegate,delegate-stx-tx,"Build delegate STX transaction","const txOptions = { contractAddress: 'SP000000000000000000002Q6VF78' contractName: 'pox-4' functionName: 'delegate-stx' functionArgs: [uintCV(amountMicroStx) principalCV(delegateAddress) noneCV() someCV(poxAddrCV)] senderKey: privateKey network }; const tx = await makeContractCall(txOptions)","import { makeContractCall uintCV principalCV noneCV someCV } from '@stacks/transactions'","Delegate to pool operator; use noneCV() for until-burn-ht to delegate indefinitely"
21,javascript,pool,stackingdao-deposit-tx,"Deposit to StackingDAO via SDK","const txOptions = { contractAddress: 'SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG' contractName: 'stacking-dao-core-v1' functionName: 'deposit' functionArgs: [uintCV(amountMicroStx)] senderKey: privateKey network }; const tx = await makeContractCall(txOptions); await broadcastTransaction({ transaction: tx network })","import { makeContractCall uintCV broadcastTransaction } from '@stacks/transactions'","Receive stSTX liquid stacking token; auto-compounds rewards"
22,javascript,cycle,get-current-cycle-js,"Calculate current PoX cycle from block height","function getCurrentCycle(blockHeight) { const FIRST_BURNCHAIN_BLOCK = 666050; const REWARD_CYCLE_LENGTH = 2100; return Math.floor((blockHeight - FIRST_BURNCHAIN_BLOCK) / REWARD_CYCLE_LENGTH) }","None","Mainnet constants; testnet uses different values"
23,javascript,rewards,estimate-stacking-rewards,"Estimate stacking rewards","async function estimateRewards(amountStx durationCycles) { const res = await fetch('https://api.hiro.so/v2/pox'); const poxInfo = await res.json(); const totalStacked = poxInfo.total_liquid_supply_ustx * 0.25; const yourShare = amountStx / (totalStacked / 1000000); const btcPerCycle = 1000; return btcPerCycle * yourShare * durationCycles }","fetch","Approximate estimation; actual rewards vary based on Bitcoin block rewards"
24,api,pool,get-pool-info,"Get stacking pool information","const response = await fetch('https://api.hiro.so/extended/v1/pox/cycles/${cycleNumber}/signers'); const poolData = await response.json()","fetch or axios","Returns signers weight signing_key pool_address for cycle"
25,javascript,validation,validate-stacking-eligibility,"Check if address can stack","async function canStack(address amount) { const poxRes = await fetch('https://api.hiro.so/v2/pox'); const poxInfo = await poxRes.json(); const minThreshold = poxInfo.min_threshold_ustx; const balanceRes = await fetch(`https://api.hiro.so/extended/v1/address/${address}/balances`); const balance = await balanceRes.json(); return balance.stx.balance >= amount && amount >= minThreshold }","fetch","Validates balance and minimum threshold; returns boolean"