Bitcoin Stamps Cursed Stamps CursedClass SDK Documentation
This SDK provides functions to interact with the StampChain API for managing and retrieving cursed stamps data. It supports fetching cursed stamps by page and block index. The StampsClass can be used to fetch individual cursed stamps using their negative stamp number, tx_hash, or stamp_hash
import { PROTOCOL_IDENTIFIERS as SUBPROTOCOLS } from "../utils/protocol.ts";
RESPONSE_LIMIT
: The default limit for fetching cursed stamps (set to 200).STAMPCHAIN_API_URL
: The base URL for the StampChain API (https://stampchain.io/api/v2
).
Fetches a specific page of cursed stamps from the API. Can be used with pagination.
limit
: The number of stamps to fetch per page. Defaults toRESPONSE_LIMIT
.page
: The page number to fetch. Defaults to 1.sort_order
: The order in which to sort the stamps. Can be 'asc' or 'desc'. Defaults to 'asc'.
Promise<Object>
: An object containing the fetched page of cursed stamps.
const stampsPage = await CursedClass.fetch_cursed_stamps_by_page(
100,
2,
"desc",
);
Fetches cursed stamps by block index from the API.
block_index
: The block index for which to fetch the cursed stamps.
Promise<Object>
: The data returned by the API. This includes information about the cursed stamps for the given block index.
const cursedStampsData = await CursedClass.get_cursed_stamps_by_block_index(
830000,
);