@bsv/wallet-toolbox 2.0.18 → 2.0.19
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/CHANGELOG.md +4 -0
- package/docs/client.md +88 -51
- package/docs/wallet.md +88 -51
- package/out/src/WalletPermissionsManager.d.ts.map +1 -1
- package/out/src/WalletPermissionsManager.js +3 -1
- package/out/src/WalletPermissionsManager.js.map +1 -1
- package/out/src/sdk/WalletStorage.interfaces.d.ts +2 -0
- package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
- package/out/src/storage/StorageIdb.d.ts.map +1 -1
- package/out/src/storage/StorageIdb.js +4 -0
- package/out/src/storage/StorageIdb.js.map +1 -1
- package/out/src/storage/StorageKnex.d.ts.map +1 -1
- package/out/src/storage/StorageKnex.js +4 -0
- package/out/src/storage/StorageKnex.js.map +1 -1
- package/out/src/storage/methods/listActionsIdb.d.ts.map +1 -1
- package/out/src/storage/methods/listActionsIdb.js +17 -3
- package/out/src/storage/methods/listActionsIdb.js.map +1 -1
- package/out/src/storage/methods/listActionsKnex.d.ts.map +1 -1
- package/out/src/storage/methods/listActionsKnex.js +28 -2
- package/out/src/storage/methods/listActionsKnex.js.map +1 -1
- package/out/src/storage/sync/StorageMySQLDojoReader.d.ts.map +1 -1
- package/out/src/storage/sync/StorageMySQLDojoReader.js +4 -0
- package/out/src/storage/sync/StorageMySQLDojoReader.js.map +1 -1
- package/out/src/utility/brc114ActionTimeLabels.d.ts +9 -0
- package/out/src/utility/brc114ActionTimeLabels.d.ts.map +1 -0
- package/out/src/utility/brc114ActionTimeLabels.js +51 -0
- package/out/src/utility/brc114ActionTimeLabels.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type ParsedBrc114ActionTimeLabels = {
|
|
2
|
+
from?: number;
|
|
3
|
+
to?: number;
|
|
4
|
+
timeFilterRequested: boolean;
|
|
5
|
+
remainingLabels: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare function parseBrc114ActionTimeLabels(labels: string[] | undefined): ParsedBrc114ActionTimeLabels;
|
|
8
|
+
export declare function makeBrc114ActionTimeLabel(unixMillis: number): string;
|
|
9
|
+
//# sourceMappingURL=brc114ActionTimeLabels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brc114ActionTimeLabels.d.ts","sourceRoot":"","sources":["../../../src/utility/brc114ActionTimeLabels.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,4BAA4B,GAAG;IACzC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,mBAAmB,EAAE,OAAO,CAAA;IAC5B,eAAe,EAAE,MAAM,EAAE,CAAA;CAC1B,CAAA;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,4BAA4B,CA4CtG;AAED,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEpE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseBrc114ActionTimeLabels = parseBrc114ActionTimeLabels;
|
|
4
|
+
exports.makeBrc114ActionTimeLabel = makeBrc114ActionTimeLabel;
|
|
5
|
+
const WERR_errors_1 = require("../sdk/WERR_errors");
|
|
6
|
+
function parseBrc114ActionTimeLabels(labels) {
|
|
7
|
+
let from = undefined;
|
|
8
|
+
let to = undefined;
|
|
9
|
+
const remainingLabels = [];
|
|
10
|
+
let timeFilterRequested = false;
|
|
11
|
+
for (const label of labels || []) {
|
|
12
|
+
if (label.startsWith('action time from ')) {
|
|
13
|
+
timeFilterRequested = true;
|
|
14
|
+
if (from !== undefined)
|
|
15
|
+
throw new WERR_errors_1.WERR_INVALID_PARAMETER('labels', 'valid. Duplicate action time from label.');
|
|
16
|
+
const v = label.slice('action time from '.length);
|
|
17
|
+
if (!/^[0-9]+$/.test(v))
|
|
18
|
+
throw new WERR_errors_1.WERR_INVALID_PARAMETER('labels', 'valid. Invalid action time from timestamp value.');
|
|
19
|
+
const n = Number(v);
|
|
20
|
+
if (!Number.isSafeInteger(n) || n < 0)
|
|
21
|
+
throw new WERR_errors_1.WERR_INVALID_PARAMETER('labels', 'valid. Invalid action time from timestamp value.');
|
|
22
|
+
if (Number.isNaN(new Date(n).getTime()))
|
|
23
|
+
throw new WERR_errors_1.WERR_INVALID_PARAMETER('labels', 'valid. Invalid action time from timestamp value.');
|
|
24
|
+
from = n;
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (label.startsWith('action time to ')) {
|
|
28
|
+
timeFilterRequested = true;
|
|
29
|
+
if (to !== undefined)
|
|
30
|
+
throw new WERR_errors_1.WERR_INVALID_PARAMETER('labels', 'valid. Duplicate action time to label.');
|
|
31
|
+
const v = label.slice('action time to '.length);
|
|
32
|
+
if (!/^[0-9]+$/.test(v))
|
|
33
|
+
throw new WERR_errors_1.WERR_INVALID_PARAMETER('labels', 'valid. Invalid action time to timestamp value.');
|
|
34
|
+
const n = Number(v);
|
|
35
|
+
if (!Number.isSafeInteger(n) || n < 0)
|
|
36
|
+
throw new WERR_errors_1.WERR_INVALID_PARAMETER('labels', 'valid. Invalid action time to timestamp value.');
|
|
37
|
+
if (Number.isNaN(new Date(n).getTime()))
|
|
38
|
+
throw new WERR_errors_1.WERR_INVALID_PARAMETER('labels', 'valid. Invalid action time to timestamp value.');
|
|
39
|
+
to = n;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
remainingLabels.push(label);
|
|
43
|
+
}
|
|
44
|
+
if (from !== undefined && to !== undefined && from >= to)
|
|
45
|
+
throw new WERR_errors_1.WERR_INVALID_PARAMETER('labels', 'valid. action time from must be less than action time to.');
|
|
46
|
+
return { from, to, timeFilterRequested, remainingLabels };
|
|
47
|
+
}
|
|
48
|
+
function makeBrc114ActionTimeLabel(unixMillis) {
|
|
49
|
+
return `action time ${unixMillis}`;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=brc114ActionTimeLabels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brc114ActionTimeLabels.js","sourceRoot":"","sources":["../../../src/utility/brc114ActionTimeLabels.ts"],"names":[],"mappings":";;AASA,kEA4CC;AAED,8DAEC;AAzDD,oDAA2D;AAS3D,SAAgB,2BAA2B,CAAC,MAA4B;IACtE,IAAI,IAAI,GAAuB,SAAS,CAAA;IACxC,IAAI,EAAE,GAAuB,SAAS,CAAA;IACtC,MAAM,eAAe,GAAa,EAAE,CAAA;IACpC,IAAI,mBAAmB,GAAG,KAAK,CAAA;IAE/B,KAAK,MAAM,KAAK,IAAI,MAAM,IAAI,EAAE,EAAE,CAAC;QACjC,IAAI,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAAE,CAAC;YAC1C,mBAAmB,GAAG,IAAI,CAAA;YAC1B,IAAI,IAAI,KAAK,SAAS;gBAAE,MAAM,IAAI,oCAAsB,CAAC,QAAQ,EAAE,0CAA0C,CAAC,CAAA;YAC9G,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAA;YACjD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;gBACrB,MAAM,IAAI,oCAAsB,CAAC,QAAQ,EAAE,kDAAkD,CAAC,CAAA;YAChG,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;YACnB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;gBACnC,MAAM,IAAI,oCAAsB,CAAC,QAAQ,EAAE,kDAAkD,CAAC,CAAA;YAChG,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;gBACrC,MAAM,IAAI,oCAAsB,CAAC,Q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