@node-dlc/messaging
Version:
DLC Messaging Protocol
28 lines • 827 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChainMemoryStore = void 0;
/**
* In-memory implementation of the IDlcStore.
*/
class ChainMemoryStore {
constructor() {
this._dlcTxs = new Map();
}
get dlcTransactionsListCount() {
return this._dlcTxs.size;
}
async findDlcTransactionsList() {
return Array.from(this._dlcTxs.values());
}
async findDlcTransactions(contractId) {
return this._dlcTxs.get(contractId);
}
async saveDlcTransactions(dlcTransactions) {
this._dlcTxs.set(dlcTransactions.contractId, dlcTransactions);
}
async deleteDlcTransactions(contractId) {
this._dlcTxs.delete(contractId);
}
}
exports.ChainMemoryStore = ChainMemoryStore;
//# sourceMappingURL=ChainMemoryStore.js.map