Pay-per-use APIs on Stacks blockchain
Instantly refill any Stacks wallet with STX or sBTC. Perfect for testing, onboarding new users, or topping up wallets programmatically.
Calculate potential yield on sBTC deposits. Returns APY projections based on current DeFi rates and historical performance.
Deposit sBTC into a yield-generating vault. Automatically compounds interest and manages positions across DeFi protocols.
Withdraw sBTC plus accrued yield from the vault. Includes automatic position unwinding and fee calculation.
// Install: npm install @pbtc21/x402-client import { X402Client } from "@pbtc21/x402-client"; const client = new X402Client({ mnemonic: "your wallet mnemonic", network: "mainnet" }); // Call any endpoint - payment is automatic const result = await client.call( "https://coin-refill.p-d07.workers.dev/refill", { body: { token: "STX", amount: 1000000, recipient: "SP..." } } ); console.log(result.data, result.payment.txid);