STAMPS JS
Note: This library is intended for browser use only.
STAMPS JS is the Software Development Kit (SDK) for the STAMP Protocol. Developers can use this SDK to integrate the STAMP Protocol into their applications.
Installation
Install STAMPS JS using npm:
npm install @permaweb/stampjs
Usage
Here's an example of how to use STAMPS JS:
import Stamps from '@permaweb/stampjs';
import { WarpFactory } from 'warp-contracts';
import { InjectedArweaveSigner } from 'warp-contracts-plugin-signature';
import Arweave from 'arweave';
const signer = new InjectedArweaveSigner(globalThis.arweaveWallet)
signer.getAddress = globalThis.arweaveWallet.getActiveAddress
await signer.setPublicKey()
const stamps = Stamps.init({
warp: WarpFactory.forMainnet(),
arweave: Arweave.init({}),
wallet: signer,
dre: 'https://dre-u.warp.cc/contract',
graphql: 'https://arweave.net/graphql'
});
await stamps.stamp(TX, [qty], [tags]);
const { total } = await stamps.count(TX);
const counts = await stamps.counts(TXs);
> NOTE: hasStamped can take a single TX or a set of TXs
const stamped = await stamps.hasStamped(TX);
or
const stampedResults = await stamps.hasStamped([TX1, TX2, TX3])
const results = await stamps.hasStamped([tx1, tx2, tx3])
const balance = await stamps.balance();
For more information, visit the STAMPS Protocol website.