stack-counter-sdk
v0.1.33
Published
TypeScript SDK for collaborative on-chain counters on the Stacks blockchain — increment, snapshot, audit history.
Maintainers
Readme
stack-counter-sdk
TypeScript SDK for collaborative on-chain counters on the Stacks blockchain — increment, snapshot, audit history.
Install
npm install stack-counter-sdkUsage
import { buildReadOnlyUrl, parseContractId } from 'stack-counter-sdk';
const contract = parseContractId('SP16F6839630K5XX06KE7KVNSNMYBK89912NH6N4C.stack-counter-a1');
if (contract) {
const url = buildReadOnlyUrl({ contract, functionName: 'get-counter' });
console.log(url);
}What's inside
constants— network endpoints, project-specific defaultsutils— address/contract-name validation, parsing, formatting, STX conversioncontract— read-only call URL helperstypes—CounterStateand related shapes
Scripts
npm test # vitest run
npm run typecheck # tsc --noEmit
npm run lint # eslint
npm run build # tsup → dist/License
MIT
