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

@haneullabs/zksend

v1.0.2

Published

Create claimable links for transferring coins and NFTs

Readme

@haneullabs/zksend

Create claimable links for transferring coins and NFTs. Recipients can claim assets via URL without needing a wallet set up beforehand.

Installation

npm install @haneullabs/zksend

Limitations

  • zkSend only supports Mainnet and Testnet at this time.
  • Objects within links must be publicly transferrable.

Create a link

You can start creating your own zkSend link using the ZkSendLinkBuilder class. This class constructor takes an object with the following options:

  • sender (required) - The address of the sender / creator of the link.
  • client (optional) - The @haneullabs/haneul client used to fetch data to construct the link. If not provided, a default client will be used.
  • network (optional) - The network that the link will be created for. Defaults to mainnet.
import { ZkSendLinkBuilder } from '@haneullabs/zksend';

const link = new ZkSendLinkBuilder({
	sender: '0x...',
});

Adding HANEUL to the link

You can add HANEUL to the link by calling link.addClaimableMist(). This method takes the following params:

  • amount (required) - The amount of GEUNHWA (the base unit of HANEUL) to add to the link.

Adding non-HANEUL coins to the link

You can add non-HANEUL coins to the link by calling link.addClaimableBalance(). This method takes the following params:

  • coinType (required) - The coin type of the coin to add to the link (e.g. 0x2::haneul::HANEUL).
  • amount (required) - The amount of the coin to add to the link. Represented in the base unit of the coin.

The SDK will automatically perform the necessary coin management logic to transfer the defined amount, such as merging and splitting coin objects.

Adding objects to the link

You can add a publicly-transferrable object to the link by calling link.addClaimableObject(). This method takes the following params:

  • id (required) - The ID of the object. This must be owned by the sender you configured when creating the link.

Adding objects created in the same transaction

You can create objects to add to links in the same transaction the link is created in by using link.addClaimableObjectRef():

  • ref (required) - The reference to the object you want to add to the link.
  • type (required) - The move type of the object you are adding
const tx = new Transaction();

const link = new ZkSendLinkBuilder({
	sender: '0x...',
});

const newObject = tx.moveCall({
	target: `${PACKAGE_ID}::your_module::mint`,
});

link.addClaimableObjectRef({
	ref: newObject,
	type: `${PACKAGE_ID}::your_module::YourType`,
});

// Adds the link creation transactions to the transaction
link.createSendTransaction({
	transaction: tx,
});

Getting the link URL

At any time, you can get the URL for the link by calling link.getLink().

Submitting the link transaction

Once you have built your zkSend link, you need to execute a transaction to transfer assets and make the link claimable.

You can call the link.createSendTransaction() method, which returns a Transaction object that you can sign and submit.

const tx = await link.createSendTransaction();

const { bytes, signature } = tx.sign({ client, signer: keypair });

const result = await client.executeTransactionBlock({
	transactionBlock: bytes,
	signature,
});

If you have a keypair you would like to send the transaction with, you can use the create method as shorthand for creating the send transaction, signing it, and submitting it:

await link.create({
	signer: yourKeypair,
	// Wait until the new link is ready to be indexed so it is claimable
	waitForTransaction: true,
});

Claiming a link

To claim a link via the SDK you can use the ZkSendLink class:

import { ZkSendLink } from '@haneullabs/zksend';

// create a link instance from a URL
const link = await ZkSendLink.fromUrl('https://zksend.com/claim#$abc...');

// list what claimable assets the link has
const { nfts, balances } = link.assets;

// claim all the assets from the link
await link.claimAssets(addressOfClaimer);

Listing links you have created

To list the links created by a specific address, you can use the listCreatedLinks function:

import { listCreatedLinks } from '@haneullabs/zksend';

const { links, hasNextPage, cursor } = await listCreatedLinks({
	address: addressOfCreator,
});

// get the claimable assets for this link (will be empty if the link has been claimed)
const { nfts, balances } = await links[0].assets;

Listing transactions and the links they created

getSentTransactionsWithLinks will return a list of transactions sent by the provided address. Each result will include the transaction that was sent, along with an array containing any links that were created or regenerated by that transaction.

import { getSentTransactionsWithLinks } from '@haneullabs/zksend';

const { data, hasNextPage, nextCursor } = await getSentTransactionsWithLinks({
	address: addressOfCreator,
});

for (const { transaction, links } of data) {
	// get the claimable assets for this link (will be empty if the link has been claimed)
	const firstLink = links[0];

	// link is claimed
	firstLink.claimed;
	const { nfts, balances } = firstLink.assets;

	// claim link
	await firstLink.link.claimAssets(addressOfClaimer);
}

By default getSentTransactionsWithLinks will not load the assets for claimed links. This can be changed by passing loadClaimedAssets: true to the function.

Regenerating links

If you lose a link you've created, you can re-generate the link (this can only done from the address that originally created the link):

import { listCreatedLinks } from '@haneullabs/zksend';

const { links, hasNextPage, cursor } = await listCreatedLinks({
	address: addressOfCreator,
});

// url will be the new link url
const { url, transaction } = await links[0].link.createRegenerateTransaction(addressOfLinkCreator);

// Execute the transaction to regenerate the link
const result = await client.signAndExecuteTransaction({
	transaction,
	signer: keypair,
});

Bulk link creation

To create multiple links in a single transaction, you can use ZkSendLinkBuilder.createLinks:

const links = [];

for (let i = 0; i < 10; i++) {
	const link = new ZkSendLinkBuilder({
		client,
		sender: keypair.toSuiAddress(),
	});

	link.addClaimableMist(100n);
	links.push(link);
}

const urls = links.map((link) => link.getLink());

const tx = await ZkSendLinkBuilder.createLinks({
	links,
});

const result = await client.signAndExecuteTransaction({
	transaction: tx,
	signer: keypair,
});

Documentation

See the zkSend SDK documentation for more details.