@bsv/wallet-toolbox-client 1.3.6 → 1.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/src/SetupClient.d.ts +126 -0
- package/out/src/SetupClient.d.ts.map +1 -0
- package/out/src/SetupClient.js +220 -0
- package/out/src/SetupClient.js.map +1 -0
- package/out/src/SetupWallet.d.ts +100 -0
- package/out/src/SetupWallet.d.ts.map +1 -0
- package/out/src/SetupWallet.js +3 -0
- package/out/src/SetupWallet.js.map +1 -0
- package/out/src/Wallet.d.ts +2 -2
- package/out/src/Wallet.d.ts.map +1 -1
- package/out/src/Wallet.js +15 -8
- package/out/src/Wallet.js.map +1 -1
- package/out/src/index.client.d.ts +2 -0
- package/out/src/index.client.d.ts.map +1 -1
- package/out/src/index.client.js +2 -0
- package/out/src/index.client.js.map +1 -1
- package/out/src/sdk/WalletStorage.interfaces.d.ts +14 -0
- package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
- package/out/src/storage/StorageIdb.d.ts +208 -0
- package/out/src/storage/StorageIdb.d.ts.map +1 -0
- package/out/src/storage/StorageIdb.js +2296 -0
- package/out/src/storage/StorageIdb.js.map +1 -0
- package/out/src/storage/WalletStorageManager.d.ts +1 -0
- package/out/src/storage/WalletStorageManager.d.ts.map +1 -1
- package/out/src/storage/WalletStorageManager.js +40 -0
- package/out/src/storage/WalletStorageManager.js.map +1 -1
- package/out/src/storage/index.client.d.ts +1 -0
- package/out/src/storage/index.client.d.ts.map +1 -1
- package/out/src/storage/index.client.js +1 -0
- package/out/src/storage/index.client.js.map +1 -1
- package/out/src/storage/methods/ListActionsSpecOp.d.ts +16 -0
- package/out/src/storage/methods/ListActionsSpecOp.d.ts.map +1 -0
- package/out/src/storage/methods/ListActionsSpecOp.js +40 -0
- package/out/src/storage/methods/ListActionsSpecOp.js.map +1 -0
- package/out/src/storage/methods/ListOutputsSpecOp.d.ts +26 -0
- package/out/src/storage/methods/ListOutputsSpecOp.d.ts.map +1 -0
- package/out/src/storage/methods/ListOutputsSpecOp.js +71 -0
- package/out/src/storage/methods/ListOutputsSpecOp.js.map +1 -0
- package/out/src/storage/methods/listActionsIdb.d.ts +5 -0
- package/out/src/storage/methods/listActionsIdb.d.ts.map +1 -0
- package/out/src/storage/methods/listActionsIdb.js +155 -0
- package/out/src/storage/methods/listActionsIdb.js.map +1 -0
- package/out/src/storage/methods/listOutputsIdb.d.ts +5 -0
- package/out/src/storage/methods/listOutputsIdb.d.ts.map +1 -0
- package/out/src/storage/methods/listOutputsIdb.js +181 -0
- package/out/src/storage/methods/listOutputsIdb.js.map +1 -0
- package/out/src/storage/methods/purgeDataIdb.d.ts +4 -0
- package/out/src/storage/methods/purgeDataIdb.d.ts.map +1 -0
- package/out/src/storage/methods/purgeDataIdb.js +9 -0
- package/out/src/storage/methods/purgeDataIdb.js.map +1 -0
- package/out/src/storage/methods/reviewStatusIdb.d.ts +20 -0
- package/out/src/storage/methods/reviewStatusIdb.d.ts.map +1 -0
- package/out/src/storage/methods/reviewStatusIdb.js +35 -0
- package/out/src/storage/methods/reviewStatusIdb.js.map +1 -0
- package/out/src/storage/schema/StorageIdbSchema.d.ts +133 -0
- package/out/src/storage/schema/StorageIdbSchema.d.ts.map +1 -0
- package/out/src/storage/schema/StorageIdbSchema.js +3 -0
- package/out/src/storage/schema/StorageIdbSchema.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listActionsIdb = listActionsIdb;
|
|
4
|
+
const sdk_1 = require("@bsv/sdk");
|
|
5
|
+
const index_client_1 = require("../../index.client");
|
|
6
|
+
const sdk_2 = require("../../sdk");
|
|
7
|
+
const ListActionsSpecOp_1 = require("./ListActionsSpecOp");
|
|
8
|
+
async function listActionsIdb(storage, auth, vargs) {
|
|
9
|
+
const limit = vargs.limit;
|
|
10
|
+
const offset = vargs.offset;
|
|
11
|
+
const r = {
|
|
12
|
+
totalActions: 0,
|
|
13
|
+
actions: []
|
|
14
|
+
};
|
|
15
|
+
let specOp = undefined;
|
|
16
|
+
let specOpLabels = [];
|
|
17
|
+
let labels = [];
|
|
18
|
+
for (const label of vargs.labels) {
|
|
19
|
+
if ((0, sdk_2.isListActionsSpecOp)(label)) {
|
|
20
|
+
specOp = (0, ListActionsSpecOp_1.getLabelToSpecOp)()[label];
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
labels.push(label);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if ((specOp === null || specOp === void 0 ? void 0 : specOp.labelsToIntercept) !== undefined) {
|
|
27
|
+
const intercept = specOp.labelsToIntercept;
|
|
28
|
+
const labels2 = labels;
|
|
29
|
+
labels = [];
|
|
30
|
+
if (intercept.length === 0) {
|
|
31
|
+
specOpLabels = labels2;
|
|
32
|
+
}
|
|
33
|
+
for (const label of labels2) {
|
|
34
|
+
if (intercept.indexOf(label) >= 0) {
|
|
35
|
+
specOpLabels.push(label);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
labels.push(label);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
let labelIds = [];
|
|
43
|
+
if (labels.length > 0) {
|
|
44
|
+
await storage.filterTxLabels({ partial: { userId: auth.userId, isDeleted: false } }, tl => {
|
|
45
|
+
if (labels.includes(tl.label)) {
|
|
46
|
+
labelIds.push(tl.txLabelId);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const isQueryModeAll = vargs.labelQueryMode === 'all';
|
|
51
|
+
if (isQueryModeAll && labelIds.length < labels.length)
|
|
52
|
+
// all the required labels don't exist, impossible to satisfy.
|
|
53
|
+
return r;
|
|
54
|
+
if (!isQueryModeAll && labelIds.length === 0 && labels.length > 0)
|
|
55
|
+
// any and only non-existing labels, impossible to satisfy.
|
|
56
|
+
return r;
|
|
57
|
+
const stati = (specOp === null || specOp === void 0 ? void 0 : specOp.setStatusFilter)
|
|
58
|
+
? specOp.setStatusFilter()
|
|
59
|
+
: ['completed', 'unprocessed', 'sending', 'unproven', 'unsigned', 'nosend', 'nonfinal'];
|
|
60
|
+
const noLabels = labelIds.length === 0;
|
|
61
|
+
const txs = await storage.findTransactions({
|
|
62
|
+
partial: { userId: auth.userId },
|
|
63
|
+
status: stati,
|
|
64
|
+
paged: { limit: vargs.limit, offset: vargs.offset },
|
|
65
|
+
noRawTx: true
|
|
66
|
+
}, labelIds, isQueryModeAll);
|
|
67
|
+
if (txs.length === vargs.limit) {
|
|
68
|
+
r.totalActions = await storage.countTransactions({ partial: { userId: auth.userId }, status: stati }, labelIds, isQueryModeAll);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
r.totalActions = txs.length;
|
|
72
|
+
}
|
|
73
|
+
if (specOp === null || specOp === void 0 ? void 0 : specOp.postProcess) {
|
|
74
|
+
await specOp.postProcess(storage, auth, vargs, specOpLabels, txs);
|
|
75
|
+
}
|
|
76
|
+
for (const tx of txs) {
|
|
77
|
+
const wtx = {
|
|
78
|
+
txid: tx.txid || '',
|
|
79
|
+
satoshis: tx.satoshis || 0,
|
|
80
|
+
status: tx.status,
|
|
81
|
+
isOutgoing: !!tx.isOutgoing,
|
|
82
|
+
description: tx.description || '',
|
|
83
|
+
version: tx.version || 0,
|
|
84
|
+
lockTime: tx.lockTime || 0
|
|
85
|
+
};
|
|
86
|
+
r.actions.push(wtx);
|
|
87
|
+
}
|
|
88
|
+
if (vargs.includeLabels || vargs.includeInputs || vargs.includeOutputs) {
|
|
89
|
+
await Promise.all(txs.map(async (tx, i) => {
|
|
90
|
+
var _a, _b, _c;
|
|
91
|
+
//let i = -1
|
|
92
|
+
//for (const tx of txs) {
|
|
93
|
+
// i++
|
|
94
|
+
const action = r.actions[i];
|
|
95
|
+
if (vargs.includeLabels) {
|
|
96
|
+
action.labels = (await storage.getLabelsForTransactionId(tx.transactionId)).map(l => l.label);
|
|
97
|
+
}
|
|
98
|
+
if (vargs.includeOutputs) {
|
|
99
|
+
const outputs = await storage.findOutputs({
|
|
100
|
+
partial: { transactionId: tx.transactionId },
|
|
101
|
+
noScript: !vargs.includeOutputLockingScripts
|
|
102
|
+
});
|
|
103
|
+
action.outputs = [];
|
|
104
|
+
for (const o of outputs) {
|
|
105
|
+
await storage.extendOutput(o, true, true);
|
|
106
|
+
const wo = {
|
|
107
|
+
satoshis: o.satoshis || 0,
|
|
108
|
+
spendable: !!o.spendable,
|
|
109
|
+
tags: ((_a = o.tags) === null || _a === void 0 ? void 0 : _a.map(t => t.tag)) || [],
|
|
110
|
+
outputIndex: Number(o.vout),
|
|
111
|
+
outputDescription: o.outputDescription || '',
|
|
112
|
+
basket: ((_b = o.basket) === null || _b === void 0 ? void 0 : _b.name) || ''
|
|
113
|
+
};
|
|
114
|
+
if (vargs.includeOutputLockingScripts)
|
|
115
|
+
wo.lockingScript = (0, index_client_1.asString)(o.lockingScript || []);
|
|
116
|
+
action.outputs.push(wo);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (vargs.includeInputs) {
|
|
120
|
+
const inputs = await storage.findOutputs({
|
|
121
|
+
partial: { spentBy: tx.transactionId },
|
|
122
|
+
noScript: !vargs.includeInputSourceLockingScripts
|
|
123
|
+
});
|
|
124
|
+
action.inputs = [];
|
|
125
|
+
if (inputs.length > 0) {
|
|
126
|
+
const rawTx = await storage.getRawTxOfKnownValidTransaction(tx.txid);
|
|
127
|
+
let bsvTx = undefined;
|
|
128
|
+
if (rawTx) {
|
|
129
|
+
bsvTx = sdk_1.Transaction.fromBinary(rawTx);
|
|
130
|
+
}
|
|
131
|
+
for (const o of inputs) {
|
|
132
|
+
await storage.extendOutput(o, true, true);
|
|
133
|
+
const input = bsvTx === null || bsvTx === void 0 ? void 0 : bsvTx.inputs.find(v => v.sourceTXID === o.txid && v.sourceOutputIndex === o.vout);
|
|
134
|
+
const wo = {
|
|
135
|
+
sourceOutpoint: `${o.txid}.${o.vout}`,
|
|
136
|
+
sourceSatoshis: o.satoshis || 0,
|
|
137
|
+
inputDescription: o.outputDescription || '',
|
|
138
|
+
sequenceNumber: (input === null || input === void 0 ? void 0 : input.sequence) || 0
|
|
139
|
+
};
|
|
140
|
+
action.inputs.push(wo);
|
|
141
|
+
if (vargs.includeInputSourceLockingScripts) {
|
|
142
|
+
wo.sourceLockingScript = (0, index_client_1.asString)(o.lockingScript || []);
|
|
143
|
+
}
|
|
144
|
+
if (vargs.includeInputUnlockingScripts) {
|
|
145
|
+
wo.unlockingScript = (_c = input === null || input === void 0 ? void 0 : input.unlockingScript) === null || _c === void 0 ? void 0 : _c.toHex();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
//}
|
|
151
|
+
}));
|
|
152
|
+
}
|
|
153
|
+
return r;
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=listActionsIdb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listActionsIdb.js","sourceRoot":"","sources":["../../../../../src/storage/methods/listActionsIdb.ts"],"names":[],"mappings":";;AAcA,wCAsKC;AApLD,kCAOiB;AAEjB,qDAA6D;AAC7D,mCAAkE;AAElE,2DAAyE;AAElE,KAAK,UAAU,cAAc,CAClC,OAAmB,EACnB,IAAgB,EAChB,KAA+B;IAE/B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAA;IACzB,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAA;IAE3B,MAAM,CAAC,GAAsB;QAC3B,YAAY,EAAE,CAAC;QACf,OAAO,EAAE,EAAE;KACZ,CAAA;IAED,IAAI,MAAM,GAAkC,SAAS,CAAA;IACrD,IAAI,YAAY,GAAa,EAAE,CAAA;IAC/B,IAAI,MAAM,GAAa,EAAE,CAAA;IACzB,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjC,IAAI,IAAA,y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EAAE,CAAC;4BACvC,EAAE,CAAC,eAAe,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,eAAe,0CAAE,KAAK,EAAE,CAAA;wBACtD,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;YACD,GAAG;QACL,CAAC,CAAC,CACH,CAAA;IACH,CAAC;IACD,OAAO,CAAC,CAAA;AACV,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ListOutputsResult, OriginatorDomainNameStringUnder250Bytes } from '@bsv/sdk';
|
|
2
|
+
import { sdk } from '../../index.client';
|
|
3
|
+
import { StorageIdb } from '../StorageIdb';
|
|
4
|
+
export declare function listOutputsIdb(storage: StorageIdb, auth: sdk.AuthId, vargs: sdk.ValidListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListOutputsResult>;
|
|
5
|
+
//# sourceMappingURL=listOutputsIdb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listOutputsIdb.d.ts","sourceRoot":"","sources":["../../../../../src/storage/methods/listOutputsIdb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,iBAAiB,EAAE,uCAAuC,EAAgB,MAAM,UAAU,CAAA;AAEzG,OAAO,EAAY,GAAG,EAAuB,MAAM,oBAAoB,CAAA;AAEvE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAG1C,wBAAsB,cAAc,CAClC,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE,GAAG,CAAC,MAAM,EAChB,KAAK,EAAE,GAAG,CAAC,oBAAoB,EAC/B,UAAU,CAAC,EAAE,uCAAuC,GACnD,OAAO,CAAC,iBAAiB,CAAC,CA0L5B"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listOutputsIdb = listOutputsIdb;
|
|
4
|
+
const sdk_1 = require("@bsv/sdk");
|
|
5
|
+
const index_client_1 = require("../../index.client");
|
|
6
|
+
const ListOutputsSpecOp_1 = require("./ListOutputsSpecOp");
|
|
7
|
+
async function listOutputsIdb(storage, auth, vargs, originator) {
|
|
8
|
+
const userId = (0, index_client_1.verifyId)(auth.userId);
|
|
9
|
+
const limit = vargs.limit;
|
|
10
|
+
const offset = vargs.offset;
|
|
11
|
+
const r = {
|
|
12
|
+
totalOutputs: 0,
|
|
13
|
+
outputs: []
|
|
14
|
+
};
|
|
15
|
+
/*
|
|
16
|
+
ListOutputsArgs {
|
|
17
|
+
basket: BasketStringUnder300Bytes
|
|
18
|
+
|
|
19
|
+
tags?: OutputTagStringUnder300Bytes[]
|
|
20
|
+
tagQueryMode?: 'all' | 'any' // default any
|
|
21
|
+
|
|
22
|
+
limit?: PositiveIntegerDefault10Max10000
|
|
23
|
+
offset?: PositiveIntegerOrZero
|
|
24
|
+
}
|
|
25
|
+
*/
|
|
26
|
+
let specOp = undefined;
|
|
27
|
+
let basketId = undefined;
|
|
28
|
+
const basketsById = {};
|
|
29
|
+
if (vargs.basket) {
|
|
30
|
+
let b = vargs.basket;
|
|
31
|
+
specOp = (0, ListOutputsSpecOp_1.getBasketToSpecOp)()[b];
|
|
32
|
+
b = specOp ? (specOp.useBasket ? specOp.useBasket : '') : b;
|
|
33
|
+
if (b) {
|
|
34
|
+
const baskets = await storage.findOutputBaskets({
|
|
35
|
+
partial: { userId, name: b }
|
|
36
|
+
});
|
|
37
|
+
if (baskets.length !== 1) {
|
|
38
|
+
// If basket does not exist, result is no outputs.
|
|
39
|
+
return r;
|
|
40
|
+
}
|
|
41
|
+
const basket = baskets[0];
|
|
42
|
+
basketId = basket.basketId;
|
|
43
|
+
basketsById[basketId] = basket;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
let tags = [...vargs.tags];
|
|
47
|
+
const specOpTags = [];
|
|
48
|
+
if (specOp && specOp.tagsParamsCount) {
|
|
49
|
+
specOpTags.push(...tags.splice(0, Math.min(tags.length, specOp.tagsParamsCount)));
|
|
50
|
+
}
|
|
51
|
+
if (specOp && specOp.tagsToIntercept) {
|
|
52
|
+
// Pull out tags used by current specOp
|
|
53
|
+
const ts = tags;
|
|
54
|
+
tags = [];
|
|
55
|
+
for (const t of ts) {
|
|
56
|
+
if (specOp.tagsToIntercept.length === 0 || specOp.tagsToIntercept.indexOf(t) >= 0) {
|
|
57
|
+
specOpTags.push(t);
|
|
58
|
+
if (t === 'all') {
|
|
59
|
+
basketId = undefined;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
tags.push(t);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (specOp && specOp.resultFromTags) {
|
|
68
|
+
const r = await specOp.resultFromTags(storage, auth, vargs, specOpTags);
|
|
69
|
+
return r;
|
|
70
|
+
}
|
|
71
|
+
let tagIds = [];
|
|
72
|
+
if (tags && tags.length > 0) {
|
|
73
|
+
await storage.filterOutputTags({ partial: { userId, isDeleted: false } }, ot => {
|
|
74
|
+
if (tags.includes(ot.tag)) {
|
|
75
|
+
tagIds.push(ot.outputTagId);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
const isQueryModeAll = vargs.tagQueryMode === 'all';
|
|
80
|
+
if (isQueryModeAll && tagIds.length < tags.length)
|
|
81
|
+
// all the required tags don't exist, impossible to satisfy.
|
|
82
|
+
return r;
|
|
83
|
+
if (!isQueryModeAll && tagIds.length === 0 && tags.length > 0)
|
|
84
|
+
// any and only non-existing labels, impossible to satisfy.
|
|
85
|
+
return r;
|
|
86
|
+
const noTags = tagIds.length === 0;
|
|
87
|
+
const includeSpent = false;
|
|
88
|
+
const stati = ['completed', 'unproven', 'nosend'];
|
|
89
|
+
const args = {
|
|
90
|
+
partial: {
|
|
91
|
+
userId,
|
|
92
|
+
basketId,
|
|
93
|
+
spendable: !includeSpent ? true : undefined
|
|
94
|
+
},
|
|
95
|
+
txStatus: stati,
|
|
96
|
+
noScript: true
|
|
97
|
+
};
|
|
98
|
+
if (!specOp || !specOp.ignoreLimit)
|
|
99
|
+
args.paged = { limit, offset };
|
|
100
|
+
let outputs = await storage.findOutputs(args, tagIds, isQueryModeAll);
|
|
101
|
+
if (outputs.length === vargs.limit) {
|
|
102
|
+
args.paged = undefined;
|
|
103
|
+
r.totalOutputs = await storage.countOutputs(args, tagIds, isQueryModeAll);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
r.totalOutputs = outputs.length;
|
|
107
|
+
}
|
|
108
|
+
if (specOp) {
|
|
109
|
+
if (specOp.filterOutputs)
|
|
110
|
+
outputs = await specOp.filterOutputs(storage, auth, vargs, specOpTags, outputs);
|
|
111
|
+
if (specOp.resultFromOutputs) {
|
|
112
|
+
const r = await specOp.resultFromOutputs(storage, auth, vargs, specOpTags, outputs);
|
|
113
|
+
return r;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/*
|
|
117
|
+
ListOutputsArgs {
|
|
118
|
+
include?: 'locking scripts' | 'entire transactions'
|
|
119
|
+
includeCustomInstructions?: BooleanDefaultFalse
|
|
120
|
+
includeTags?: BooleanDefaultFalse
|
|
121
|
+
includeLabels?: BooleanDefaultFalse
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
ListOutputsResult {
|
|
125
|
+
totalOutputs: PositiveIntegerOrZero
|
|
126
|
+
BEEF?: BEEF
|
|
127
|
+
outputs: Array<WalletOutput>
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
WalletOutput {
|
|
131
|
+
satoshis: SatoshiValue
|
|
132
|
+
spendable: boolean
|
|
133
|
+
outpoint: OutpointString
|
|
134
|
+
|
|
135
|
+
customInstructions?: string
|
|
136
|
+
lockingScript?: HexString
|
|
137
|
+
tags?: OutputTagStringUnder300Bytes[]
|
|
138
|
+
labels?: LabelStringUnder300Bytes[]
|
|
139
|
+
}
|
|
140
|
+
*/
|
|
141
|
+
const labelsByTxid = {};
|
|
142
|
+
const beef = new sdk_1.Beef();
|
|
143
|
+
for (const o of outputs) {
|
|
144
|
+
const wo = {
|
|
145
|
+
satoshis: Number(o.satoshis),
|
|
146
|
+
spendable: !!o.spendable,
|
|
147
|
+
outpoint: `${o.txid}.${o.vout}`
|
|
148
|
+
};
|
|
149
|
+
r.outputs.push(wo);
|
|
150
|
+
//if (vargs.includeBasket && o.basketId) {
|
|
151
|
+
// if (!basketsById[o.basketId]) {
|
|
152
|
+
// basketsById[o.basketId] = verifyTruthy(await dsk.findOutputBasketId(o.basketId!, trx))
|
|
153
|
+
// }
|
|
154
|
+
// wo.basket = basketsById[o.basketId].name
|
|
155
|
+
//}
|
|
156
|
+
if (vargs.includeCustomInstructions && o.customInstructions)
|
|
157
|
+
wo.customInstructions = o.customInstructions;
|
|
158
|
+
if (vargs.includeLabels && o.txid) {
|
|
159
|
+
if (labelsByTxid[o.txid] === undefined) {
|
|
160
|
+
labelsByTxid[o.txid] = (await storage.getLabelsForTransactionId(o.transactionId)).map(l => l.label);
|
|
161
|
+
}
|
|
162
|
+
wo.labels = labelsByTxid[o.txid];
|
|
163
|
+
}
|
|
164
|
+
if (vargs.includeTags) {
|
|
165
|
+
wo.tags = (await storage.getTagsForOutputId(o.outputId)).map(t => t.tag);
|
|
166
|
+
}
|
|
167
|
+
if (vargs.includeLockingScripts) {
|
|
168
|
+
await storage.validateOutputScript(o);
|
|
169
|
+
if (o.lockingScript)
|
|
170
|
+
wo.lockingScript = (0, index_client_1.asString)(o.lockingScript);
|
|
171
|
+
}
|
|
172
|
+
if (vargs.includeTransactions && !beef.findTxid(o.txid)) {
|
|
173
|
+
await storage.getValidBeefForKnownTxid(o.txid, beef, undefined, vargs.knownTxids);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (vargs.includeTransactions) {
|
|
177
|
+
r.BEEF = beef.toBinary();
|
|
178
|
+
}
|
|
179
|
+
return r;
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=listOutputsIdb.js.map
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AwB,CAAC,CAAC,CAAC,IAAK,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;QACpF,CAAC;IACH,CAAC;IAED,IAAI,KAAK,CAAC,mBAAmB,EAAE,CAAC;QAC9B,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;IAC1B,CAAC;IAED,OAAO,CAAC,CAAA;AACV,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purgeDataIdb.d.ts","sourceRoot":"","sources":["../../../../../src/storage/methods/purgeDataIdb.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,wBAAsB,YAAY,CAChC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,GAAG,CAAC,WAAW,EACvB,GAAG,CAAC,EAAE,GAAG,CAAC,QAAQ,GACjB,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAI3B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.purgeDataIdb = purgeDataIdb;
|
|
4
|
+
async function purgeDataIdb(storage, params, trx) {
|
|
5
|
+
const r = { count: 0, log: '' };
|
|
6
|
+
// TODO: implement purgeDataIdb
|
|
7
|
+
return r;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=purgeDataIdb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purgeDataIdb.js","sourceRoot":"","sources":["../../../../../src/storage/methods/purgeDataIdb.ts"],"names":[],"mappings":";;AAMA,oCAQC;AARM,KAAK,UAAU,YAAY,CAChC,OAAmB,EACnB,MAAuB,EACvB,GAAkB;IAElB,MAAM,CAAC,GAAqB,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAA;IACjD,+BAA+B;IAC/B,OAAO,CAAC,CAAA;AACV,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { sdk } from '../../index.client';
|
|
2
|
+
import { StorageIdb } from '../StorageIdb';
|
|
3
|
+
/**
|
|
4
|
+
* Looks for unpropagated state:
|
|
5
|
+
*
|
|
6
|
+
* 1. set transactions to 'failed' if not already failed and provenTxReq with matching txid has status of 'invalid'.
|
|
7
|
+
* 2. sets transactions to 'completed' if provenTx with matching txid exists and current provenTxId is null.
|
|
8
|
+
* 3. sets outputs to spendable true, spentBy undefined if spentBy is a transaction with status 'failed'.
|
|
9
|
+
*
|
|
10
|
+
* @param storage
|
|
11
|
+
* @param args
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare function reviewStatusIdb(storage: StorageIdb, args: {
|
|
15
|
+
agedLimit: Date;
|
|
16
|
+
trx?: sdk.TrxToken;
|
|
17
|
+
}): Promise<{
|
|
18
|
+
log: string;
|
|
19
|
+
}>;
|
|
20
|
+
//# sourceMappingURL=reviewStatusIdb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reviewStatusIdb.d.ts","sourceRoot":"","sources":["../../../../../src/storage/methods/reviewStatusIdb.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE;IAAE,SAAS,EAAE,IAAI,CAAC;IAAC,GAAG,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAA;CAAE,GAC5C,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAsB1B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.reviewStatusIdb = reviewStatusIdb;
|
|
4
|
+
/**
|
|
5
|
+
* Looks for unpropagated state:
|
|
6
|
+
*
|
|
7
|
+
* 1. set transactions to 'failed' if not already failed and provenTxReq with matching txid has status of 'invalid'.
|
|
8
|
+
* 2. sets transactions to 'completed' if provenTx with matching txid exists and current provenTxId is null.
|
|
9
|
+
* 3. sets outputs to spendable true, spentBy undefined if spentBy is a transaction with status 'failed'.
|
|
10
|
+
*
|
|
11
|
+
* @param storage
|
|
12
|
+
* @param args
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
async function reviewStatusIdb(storage, args) {
|
|
16
|
+
const r = { log: '' };
|
|
17
|
+
// 1. set transactions to 'failed' if not already failed and provenTxReq with matching txid has status of 'invalid'.
|
|
18
|
+
const invalidTxids = [];
|
|
19
|
+
await storage.filterProvenTxReqs({ partial: { status: 'invalid' } }, txReq => {
|
|
20
|
+
invalidTxids.push(txReq.txid);
|
|
21
|
+
});
|
|
22
|
+
for (const txid of invalidTxids) {
|
|
23
|
+
const txs = await storage.findTransactions({ partial: { txid } });
|
|
24
|
+
for (const tx of txs) {
|
|
25
|
+
if (tx.status !== 'failed') {
|
|
26
|
+
r.log += `transaction ${tx.transactionId} updated to status of 'failed' was ${tx.status}\n`;
|
|
27
|
+
await storage.updateTransactionStatus('failed', tx.transactionId);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// 2. sets transactions to 'completed' if provenTx with matching txid exists and current provenTxId is null.
|
|
32
|
+
// 3. sets outputs to spendable true, spentBy undefined if spentBy is a transaction with status 'failed'.
|
|
33
|
+
return r;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=reviewStatusIdb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reviewStatusIdb.js","sourceRoot":"","sources":["../../../../../src/storage/methods/reviewStatusIdb.ts"],"names":[],"mappings":";;AAiBA,0CAyBC;AApCD;;;;;;;;;;GAUG;AACI,KAAK,UAAU,eAAe,CACnC,OAAmB,EACnB,IAA6C;IAE7C,MAAM,CAAC,GAAoB,EAAE,GAAG,EAAE,EAAE,EAAE,CAAA;IAEtC,oHAAoH;IACpH,MAAM,YAAY,GAAa,EAAE,CAAA;IACjC,MAAM,OAAO,CAAC,kBAAkB,CAAC,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE;QAC3E,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC/B,CAAC,CAAC,CAAA;IACF,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE,CAAC;QAChC,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;QACjE,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;YACrB,IAAI,EAAE,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;gBAC3B,CAAC,CAAC,GAAG,IAAI,eAAe,EAAE,CAAC,aAAa,sCAAsC,EAAE,CAAC,MAAM,IAAI,CAAA;gBAC3F,MAAM,OAAO,CAAC,uBAAuB,CAAC,QAAQ,EAAE,EAAE,CAAC,aAAa,CAAC,CAAA;YACnE,CAAC;QACH,CAAC;IACH,CAAC;IAED,4GAA4G;IAC5G,yGAAyG;IAEzG,OAAO,CAAC,CAAA;AACV,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Base64String, PubKeyHex, HexString } from '@bsv/sdk';
|
|
2
|
+
import { ProvenTxReqStatus, SyncStatus, TransactionStatus } from '../../sdk';
|
|
3
|
+
import { TableCertificate, TableCertificateField, TableCommission, TableMonitorEvent, TableOutput, TableOutputBasket, TableOutputTag, TableOutputTagMap, TableProvenTx, TableProvenTxReq, TableSyncState, TableSettings, TableTransaction, TableTxLabel, TableTxLabelMap, TableUser } from '../index.client';
|
|
4
|
+
export interface StorageIdbSchema {
|
|
5
|
+
certificates: {
|
|
6
|
+
key: number;
|
|
7
|
+
value: TableCertificate;
|
|
8
|
+
indexes: {
|
|
9
|
+
userId: number;
|
|
10
|
+
userId_type_certifier_serialNumber: [number, Base64String, PubKeyHex, Base64String];
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
certificateFields: {
|
|
14
|
+
key: number;
|
|
15
|
+
value: TableCertificateField;
|
|
16
|
+
indexes: {
|
|
17
|
+
userId: number;
|
|
18
|
+
certificateId: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
commissions: {
|
|
22
|
+
key: number;
|
|
23
|
+
value: TableCommission;
|
|
24
|
+
indexes: {
|
|
25
|
+
userId: number;
|
|
26
|
+
transactionId: number;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
monitorEvents: {
|
|
30
|
+
key: number;
|
|
31
|
+
value: TableMonitorEvent;
|
|
32
|
+
};
|
|
33
|
+
outputs: {
|
|
34
|
+
key: number;
|
|
35
|
+
value: TableOutput;
|
|
36
|
+
indexes: {
|
|
37
|
+
userId: number;
|
|
38
|
+
transactionId: number;
|
|
39
|
+
basketId: number;
|
|
40
|
+
spentBy: string;
|
|
41
|
+
transactionId_vout_userId: [number, number, number];
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
outputBaskets: {
|
|
45
|
+
key: number;
|
|
46
|
+
value: TableOutputBasket;
|
|
47
|
+
indexes: {
|
|
48
|
+
userId: number;
|
|
49
|
+
name_userId: [string, number];
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
outputTags: {
|
|
53
|
+
key: number;
|
|
54
|
+
value: TableOutputTag;
|
|
55
|
+
indexes: {
|
|
56
|
+
userId: number;
|
|
57
|
+
tag_userId: [string, number];
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
outputTagMaps: {
|
|
61
|
+
key: number;
|
|
62
|
+
value: TableOutputTagMap;
|
|
63
|
+
indexes: {
|
|
64
|
+
outputTagId: number;
|
|
65
|
+
outputId: number;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
provenTxs: {
|
|
69
|
+
key: number;
|
|
70
|
+
value: TableProvenTx;
|
|
71
|
+
indexes: {
|
|
72
|
+
txid: HexString;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
provenTxReqs: {
|
|
76
|
+
key: number;
|
|
77
|
+
value: TableProvenTxReq;
|
|
78
|
+
indexes: {
|
|
79
|
+
provenTxId: number;
|
|
80
|
+
txid: HexString;
|
|
81
|
+
status: ProvenTxReqStatus;
|
|
82
|
+
batch: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
syncStates: {
|
|
86
|
+
key: number;
|
|
87
|
+
value: TableSyncState;
|
|
88
|
+
indexes: {
|
|
89
|
+
userId: number;
|
|
90
|
+
refNum: string;
|
|
91
|
+
status: SyncStatus;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
settings: {
|
|
95
|
+
key: number;
|
|
96
|
+
value: TableSettings;
|
|
97
|
+
indexes: Record<string, never>;
|
|
98
|
+
};
|
|
99
|
+
transactions: {
|
|
100
|
+
key: number;
|
|
101
|
+
value: TableTransaction;
|
|
102
|
+
indexes: {
|
|
103
|
+
userId: number;
|
|
104
|
+
provenTxId: number;
|
|
105
|
+
reference: string;
|
|
106
|
+
status: TransactionStatus;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
txLabels: {
|
|
110
|
+
key: number;
|
|
111
|
+
value: TableTxLabel;
|
|
112
|
+
indexes: {
|
|
113
|
+
userId: number;
|
|
114
|
+
label_userId: [string, number];
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
txLabelMaps: {
|
|
118
|
+
key: number;
|
|
119
|
+
value: TableTxLabelMap;
|
|
120
|
+
indexes: {
|
|
121
|
+
transactionId: number;
|
|
122
|
+
txLabelId: number;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
users: {
|
|
126
|
+
key: number;
|
|
127
|
+
value: TableUser;
|
|
128
|
+
indexes: {
|
|
129
|
+
identityKey: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=StorageIdbSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageIdbSchema.d.ts","sourceRoot":"","sources":["../../../../../src/storage/schema/StorageIdbSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAC7D,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAC5E,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,SAAS,EACV,MAAM,iBAAiB,CAAA;AAExB,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE;QACZ,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,gBAAgB,CAAA;QACvB,OAAO,EAAE;YACP,MAAM,EAAE,MAAM,CAAA;YACd,kCAAkC,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,CAAC,CAAA;SACpF,CAAA;KACF,CAAA;IACD,iBAAiB,EAAE;QACjB,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,qBAAqB,CAAA;QAC5B,OAAO,EAAE;YACP,MAAM,EAAE,MAAM,CAAA;YACd,aAAa,EAAE,MAAM,CAAA;SACtB,CAAA;KACF,CAAA;IACD,WAAW,EAAE;QACX,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,eAAe,CAAA;QACtB,OAAO,EAAE;YACP,MAAM,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ChB,OAAO,EAAE;YACP,WAAW,EAAE,MAAM,CAAA;SACpB,CAAA;KACF,CAAA;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageIdbSchema.js","sourceRoot":"","sources":["../../../../../src/storage/schema/StorageIdbSchema.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bsv/wallet-toolbox-client",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.9",
|
|
4
4
|
"description": "Client only Wallet Storage",
|
|
5
5
|
"main": "./out/src/index.client.js",
|
|
6
6
|
"types": "./out/src/index.client.d.ts",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"homepage": "https://github.com/bitcoin-sv/wallet-toolbox#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@bsv/sdk": "^1.4.20"
|
|
23
|
+
"@bsv/sdk": "^1.4.20",
|
|
24
|
+
"idb": "^8.0.2"
|
|
24
25
|
}
|
|
25
26
|
}
|