@winsznx/petsdk
v0.1.0
Published
The official TypeScript SDK for StxPet
Downloads
80,518
Maintainers
Readme
StxPet SDK
The official TypeScript SDK for interacting with the StxPet smart contract on the Stacks blockchain.
Installation
npm install @winsznx/petsdkUsage
import { StxPetClient } from '@winsznx/petsdk';
const client = new StxPetClient({
contractAddress: 'SP...',
contractName: 'stx-pet-v1',
network: 'mainnet'
});
// Fetch pet state
const state = await client.getLiveState();
console.log('Pet Hunger:', state.effectiveHunger);
// Submit an action
const txid = await client.submitAction('feed', 'YOUR_PRIVATE_KEY');
console.log('Transaction submitted:', txid);License
MIT
