@munityclubs/spl-burn-verify
v0.1.0
Published
Storage-neutral SPL Token-2022 burn transaction verification helpers.
Downloads
150
Maintainers
Readme
@munityclubs/spl-burn-verify
Storage-neutral SPL Token-2022 burn transaction verification helpers.
Munity uses this pattern for burn-to-unlock utility flows. The package verifies parsed Solana transaction objects without owning RPC, database, or app-specific state.
Install
npm install @munityclubs/spl-burn-verifyUsage
import { verifyBurnParsedTransaction } from "@munityclubs/spl-burn-verify";
const result = verifyBurnParsedTransaction({
tx: parsedTransaction,
txSig,
expectedAuthority: wallet,
expectedMint: tokenMint,
minAmountRaw: 100_000_000_000n,
decimals: 6,
});
console.log(result.amountRaw, result.authority);What It Checks
- Transaction did not fail
- Parsed instruction type is
burnorburnChecked - Instruction uses the SPL Token-2022 program by default
- Mint matches the expected mint
- Raw burn amount meets the minimum
burnCheckeddecimals match the expected mint decimals- Expected authority signed the transaction
Apps still need to fetch the parsed transaction, check confirmation status, and store one-time burn usage in their own persistence layer.
Development
yarn install
yarn testLicense
Apache-2.0
