@bsv/wallet-toolbox-client
Version:
Client only Wallet Storage
100 lines • 2.58 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EntityBase = void 0;
exports.createSyncMap = createSyncMap;
class EntityBase {
constructor(api) {
this.api = api;
}
/**
* An entity may decode properties of the underlying Api object on construction.
*
* The `toApi` method forces an `updateApi` before returning the underlying,
* now updated, Api object.
*
* @returns The underlying Api object with any entity decoded properties updated.
*/
toApi() {
this.updateApi();
return this.api;
}
}
exports.EntityBase = EntityBase;
function createSyncMap() {
const r = {
provenTx: {
entityName: 'provenTx',
idMap: {},
maxUpdated_at: undefined,
count: 0
},
outputBasket: {
entityName: 'outputBasket',
idMap: {},
maxUpdated_at: undefined,
count: 0
},
transaction: {
entityName: 'transaction',
idMap: {},
maxUpdated_at: undefined,
count: 0
},
provenTxReq: {
entityName: 'provenTxReq',
idMap: {},
maxUpdated_at: undefined,
count: 0
},
txLabel: {
entityName: 'txLabel',
idMap: {},
maxUpdated_at: undefined,
count: 0
},
txLabelMap: {
entityName: 'txLabelMap',
idMap: {},
maxUpdated_at: undefined,
count: 0
},
output: {
entityName: 'output',
idMap: {},
maxUpdated_at: undefined,
count: 0
},
outputTag: {
entityName: 'outputTag',
idMap: {},
maxUpdated_at: undefined,
count: 0
},
outputTagMap: {
entityName: 'outputTagMap',
idMap: {},
maxUpdated_at: undefined,
count: 0
},
certificate: {
entityName: 'certificate',
idMap: {},
maxUpdated_at: undefined,
count: 0
},
certificateField: {
entityName: 'certificateField',
idMap: {},
maxUpdated_at: undefined,
count: 0
},
commission: {
entityName: 'commission',
idMap: {},
maxUpdated_at: undefined,
count: 0
}
};
return r;
}
//# sourceMappingURL=EntityBase.js.map