quartz-lantern-sdk
v0.1.2
Published
TypeScript SDK for community-guestbook Clarity contract interactions on Stacks.
Maintainers
Readme
quartz-lantern-sdk
TypeScript SDK for interacting with the community-guestbook Clarity contract.
Deployed Mainnet Contract
- Contract ID:
SP2V3QE7H5D09N108CJ4QPS281Z3XAZVD87R8FJ27.community-guestbook
Features
- Typed read-only helpers for community metadata, entry feeds, cooldown checks, and user eligibility
- Typed contract call payload builders for create-community, sign-guestbook, and owner admin flows
- Compatible with
@stacks/connectrequest APIs - Publish-ready setup with lint, typecheck, tests, and build checks
Installation
npm install quartz-lantern-sdk @stacks/transactionsQuick Start
import { CommunityGuestbookSDK } from "quartz-lantern-sdk";
const sdk = new CommunityGuestbookSDK({
contractAddress: "SP2V3QE7H5D09N108CJ4QPS281Z3XAZVD87R8FJ27",
contractName: "community-guestbook",
network: "mainnet",
apiBaseUrl: "https://api.hiro.so",
});
const count = await sdk.getCommunityCount();
const communities = await sdk.getAllCommunities();Build tx payloads
const createPayload = sdk.buildCreateCommunity("Builders Hub", "Welcome!", 10);
const signPayload = sdk.buildSignGuestbook(1, "Hello from Stacks!");
const pausePayload = sdk.buildSetCommunityActive(1, false);
const ratePayload = sdk.buildSetRateLimit(1, 20);Execute with Stacks Connect
import { request } from "@stacks/connect";
await sdk.requestContractCall(request, signPayload);End-to-End Examples
A write flow example (create, sign, pause) is available in:
examples/connect-flow.ts
A read-only feed example (list communities and entries) is available in:
examples/read-only-feed.ts
API Methods
buildCreateCommunity(name, description, rateLimitBlocks)buildSignGuestbook(communityId, message)buildSetCommunityActive(communityId, isActive)buildSetRateLimit(communityId, newRateLimit)getCommunityCount()getCommunity(communityId)getEntry(communityId, entryId)getLastEntryHeight(communityId, who)canSignNow(communityId, who)getAllCommunities()getCommunityEntries(communityId)
Development
npm run lint
npm run typecheck
npm test
npm run buildPublish checks
npm run prepublishOnly
npm run pack:check
npm run publish:dry-runLicense
MIT
