@pepeenthusiast/pepeblocks-client
v0.9.5
Published
A lightweight TypeScript/JavaScript client for the Pepeblocks API, providing access to blockchain data, inscriptions, PRC-20 tokens, mempool info, and more.
Readme
@pepeenthusiast/pepeblocks-client
A lightweight TypeScript/JavaScript client for the Pepeblocks API, providing access to blockchain data, inscriptions, PRC-20 tokens, mempool info, and more.
Works in both Node.js and browser environments.
Node.js Usage
npm install @pepeenthusiast/pepeblocks-clientimport { PepeblocksClient, NetworkTag } from "@pepeenthusiast/pepeblocks-client";
const client = new PepeblocksClient({
network: NetworkTag.Mainnet,
});
const summary = await client.getSummary();
console.log(summary);Browser Usage
You can load the library directly in the browser using a script tag:
<script src="https://unpkg.com/@pepeenthusiast/pepeblocks-client/dist/index.umd.js"></script>
<script>
// The global variable is "Pepeblocks"
const client = new Pepeblocks.PepeblocksClient({
network: Pepeblocks.NetworkTag.Mainnet
});
client.getSummary().then(console.log);
</script>API Overview
Info
client.getStatus();
client.getSummary();Addresses
client.getAddresses(page, limit);
client.getAddress(address);
client.getAddressTransactions(address);
client.getAddressChainTransactions(address);
client.getAddressMempoolTransactions(address);Blocks
client.getBlock(hash);
client.getBlockHeader(hash);
client.getBlockHash(height);
client.getBlockStatus(hash);
client.getBlocksTipHeight();
client.getBlocksTipHash();
client.getBlockTransactionId(hash, index);
client.getBlockTransactionIds(hash);
client.getBlockTransactions(hash, max_txs, start_index);
client.getBlocks(limit, startHeight);Transactions
client.getTransaction(txid);
client.getTransactionHex(txid);
client.getTransactionMerkleblockProof(txid);
client.getTransactionMerkleProof(txid);
client.getTransactionOutspend(txid, vout);
client.getTransactionStatus(txid);Inscriptions
client.getInscriptions(limit, from);
client.getInscription(id);
client.getBlockInscriptions(query, page);
client.getTransactionInscriptions(txid);
client.getOutputInscriptions(id);
client.getAddressInscriptions(address, limit, page);PRC-20 Tokens
client.getTokens(page, limit, sort);
client.getTokenDetails(tick);
client.getTokenHolders(tick, page, limit);
client.getTokenEvents(tick, limit, offset, search);
client.getAddressTokens(address, limit, offset, search);
client.getTransactionTokenEvents(txid);
client.getAddressTokenHistory(address, tick, limit, offset, search);UTXOs
client.getSpendingsUtxos(address, page, limit);
client.getInscriptionsUtxos(address, page, limit);Mempool
client.getMempool();
client.getMempoolTransactionIds();
client.getMempoolRecent();Broadcast Transaction
client.sendTransaction(txHex);