UNPKG

@getalby/paidmcp

Version:

Charge for your MCP Server tools using Nostr Wallet Connect

16 lines (15 loc) 451 B
export class MemoryStorage { _validPaymentHashes; constructor() { this._validPaymentHashes = []; } async isValid(paymentHash) { return this._validPaymentHashes.includes(paymentHash); } async setValid(paymentHash, valid) { this._validPaymentHashes = this._validPaymentHashes.filter((h) => h !== paymentHash); if (valid) { this._validPaymentHashes.push(paymentHash); } } }