@winsznx/pixsdk
v1.0.0
Published
TypeScript SDK for the STX Canvas — a 100x100 collaborative pixel grid on Stacks
Maintainers
Readme
@winsznx/pixsdk
TypeScript SDK for the STX Canvas — a 100x100 collaborative pixel grid on the Stacks blockchain.
Installation
npm install @winsznx/pixsdk @stacks/transactions @stacks/networkQuick Start
import { PixClient } from "@winsznx/pixsdk";
const client = new PixClient({
contractAddress: "SP...",
contractName: "stx-canvas",
network: "mainnet",
});
const pixel = await client.getPixel(42, 7);
const state = await client.getLiveState();
const txid = await client.paintPixel(10, 20, "#00FF94", "your-private-key");API
| Method | Returns | Description |
| --- | --- | --- |
| getPixel(x, y) | PixelResult | Fetch pixel data |
| getTotalPainted() | number | Total paint operations |
| getPainterCount(addr) | number | Paint count for address |
| isPixelPainted(x, y) | boolean | Check if painted |
| paintPixel(x, y, color, key) | string | Paint and return tx ID |
| getLiveState() | LiveState | Computed live metrics |
License
MIT
