@kaspacom/mpp-kaspa-redeemer
v0.1.2
Published
Kaspa transaction redeemer for MPP provider settlement artifacts.
Downloads
370
Readme
@kaspacom/mpp-kaspa-redeemer
Kaspa settlement redeemer for MPP provider servers.
This package turns a stored ApiPaymentChannel settlement artifact into a
provider-signed settlement transaction and submits it either through an injected
submitter or through an injected Kaspa WASM RpcClient.
It does not own the provider private key, the database, or the node. The provider application supplies those at runtime.
Usage
import { createKaspaSettlementRedeemer } from "@kaspacom/mpp-kaspa-redeemer";
import { startSettlementWorker } from "@kaspacom/mpp-provider";
const redeemer = createKaspaSettlementRedeemer({
kaspa,
providerPrivateKey: process.env.API_PAYMENT_PROVIDER_PRIVATE_KEY,
rpcUrl: process.env.KASPA_WRPC_URL,
networkId: "testnet-10",
});
startSettlementWorker({
candidates: storage,
redeemer,
});The candidate must include settlementArtifact; @kaspacom/mpp-storage-postgres
only returns candidates when the latest accepted voucher sequence has a matching
stored settlement artifact.
Runtime Boundary
The package expects the same runtime primitives used by the wallet-lab proof path:
PrivateKeyTransaction.deserializeFromJSONScriptBuilderSighashType.AllcreateInputSignature- optional
RpcClientfor direct wRPC submission
This keeps the package usable from Node services without bundling a specific Kaspa WASM build or storing wallet material in the package.
