stacks-clicker-sdk
v1.0.0
Published
The official SDK for integrating the Stacks Clicker smart contracts into your dApp. Effortlessly build transactions to click, tip, and vote on the network.
Maintainers
Readme
Stacks Clicker SDK
The official SDK for integrating the Stacks Clicker smart contracts into your dApp. Effortlessly build transaction payloads to interact with the Clicker, TipJar, and QuickPoll contracts.
Installation
npm install stacks-clicker-sdkUsage
This SDK exposes a vanilla class that generates strictly-typed transaction payloads compatible with WalletConnect, AppKit, or @stacks/connect.
import { StacksClickerSDK } from 'stacks-clicker-sdk';
// Initialize the SDK targeting Mainnet
const sdk = new StacksClickerSDK({ network: 'mainnet' });
// 1. Generate a Multi-Click payload
const clickTx = sdk.multiClick(100);
// Use the payload with your preferred wallet provider
// Example using @walletconnect/universal-provider (AppKit)
await provider.request({
method: 'stx_callContract',
params: clickTx
});
// 2. Tip the creators
const tipTx = sdk.tip(5000000); // 5 STX
// 3. Vote on a poll
const voteTx = sdk.vote(pollId, optionId);Features
- Framework Agnostic: Works seamlessly with React, Vue, Svelte, or Vanilla JavaScript.
- Wallet Agnostic: Purely functional payloads compatible with Xverse, Leather, and WalletConnect.
- Zero Heavy Dependencies: Pure functional builders. Fully typed in TypeScript.
License
MIT
