npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

achievement-poap

v1.0.7

Published

Achievement POAP SDK on Stacks (Bitcoin L2)

Readme

Achievement POAP SDK

A professional, lightweight JavaScript/TypeScript SDK for interacting with the Achievement POAP smart contract on Stacks (Bitcoin's Layer 2).

This SDK provides utility classes to effortlessly fetch POAP events from the blockchain and build standardized transaction objects for minting, transferring, and creating events, which can be broadcasted via @stacks/transactions or used with Stacks wallets.

Installation

npm install achievement-poap @stacks/transactions @stacks/network

Initialization

Import and initialize the AchievementPOAP class. By default, it points to the official mainnet smart contract.

import { AchievementPOAP } from 'achievement-poap';
import { StacksMainnet, StacksTestnet } from '@stacks/network';

// 1. Default setup (Points automatically to the official Mainnet contract)
const poap = new AchievementPOAP();

// 2. Custom setup (e.g. Testnet or a custom contract deployment)
const customPoap = new AchievementPOAP({
    contractAddress: '<TESTNET_STX_ADDRESS>',
    contractName: 'achievement-poap',
    network: new StacksTestnet()
});

Usage

1. Fetching Event Information

Fetch on-chain metadata for a specific POAP event ID.

import { cvToJSON } from '@stacks/transactions';

async function checkEvent() {
    // Get raw Clarity value
    const eventCV = await poap.getEvent(1);
    
    // Convert to readable JSON
    console.log(cvToJSON(eventCV));
}

2. Getting the Global Mint Fee

The minting fee is configured globally on the contract.

import { cvToValue } from '@stacks/transactions';

async function checkFee() {
    const feeCV = await poap.getMintFee();
    console.log(`Current Mint Fee: ${cvToValue(feeCV)} microSTX`);
}

3. Minting a POAP

Build a transaction payload to mint an NFT for a specific event. This outputs a standard makeContractCall transaction object.

import { broadcastTransaction } from '@stacks/transactions';

async function mint() {
    const senderKey = 'YOUR_PRIVATE_KEY_HERE';
    const eventId = 1;

    // Generate the unsigned or strictly signed transaction payload
    const transaction = await poap.buildMintTransaction(eventId, senderKey);

    // Broadcast to the network
    const txid = await broadcastTransaction(transaction, poap.network);
    console.log(`Mint TX successfully broadcasted! TXID: ${txid}`);
}

4. Transferring a POAP

Build a transaction to transfer an owned POAP to another Principal address.

async function transferToken() {
    const senderKey = 'YOUR_PRIVATE_KEY_HERE';
    
    const transaction = await poap.buildTransferTransaction(
        5, // Token ID
        '<SENDER_STX_ADDRESS>', // Sender Stacks Address
        '<RECIPIENT_STX_ADDRESS>', // Recipient Stacks Address
        senderKey
    );

    const txid = await broadcastTransaction(transaction, poap.network);
    console.log(`Transfer TXID: ${txid}`);
}

5. Creating a POAP Event (Admin Only)

If you are the deployer of the contract, you can create new POAP events using the SDK.

async function deployEvent() {
    const adminKey = 'ADMIN_PRIVATE_KEY';
    
    const eventDetails = {
        name: "My Awesome Hackathon",
        description: "Awarded to participants of the 2026 Hackathon",
        maxSupply: 1000,
        startBlock: 120000, // Stacks block height
        endBlock: 140000,
        metadataUri: "ipfs://QmYourHashHere"
    };

    const transaction = await poap.buildCreateEventTransaction(eventDetails, adminKey);
    const txid = await broadcastTransaction(transaction, poap.network);
}

Dependencies

  • peer dependencies: @stacks/transactions, @stacks/network

License

MIT License