@ledgerhq/revault-sdk 0.29.11 → 0.29.20
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/lib/bake.cjs +16 -4
- package/lib/bake.cjs.map +1 -1
- package/lib/bake.d.cts +72 -2
- package/lib/bake.d.ts +72 -2
- package/lib/bake.js +14 -2
- package/lib/bake.js.map +1 -1
- package/lib/{crypto-CKLQSwr3.cjs → crypto-12UztU2T.cjs} +3 -3
- package/lib/{crypto-CKLQSwr3.cjs.map → crypto-12UztU2T.cjs.map} +1 -1
- package/lib/{crypto-hrnmToQa.js → crypto-BUAUyEPl.js} +2 -2
- package/lib/{crypto-hrnmToQa.js.map → crypto-BUAUyEPl.js.map} +1 -1
- package/lib/crypto.cjs +1 -1
- package/lib/crypto.js +1 -2
- package/lib/{device-DMdUA_7n.cjs → device-BWSC26gt.cjs} +22 -14
- package/lib/device-BWSC26gt.cjs.map +1 -0
- package/lib/{device-CQB6rcaQ.js → device-CnwyjFdY.js} +17 -15
- package/lib/device-CnwyjFdY.js.map +1 -0
- package/lib/device.cjs +2 -1
- package/lib/device.d.cts +2 -2
- package/lib/device.d.ts +2 -2
- package/lib/device.js +1 -2
- package/lib/engine.cjs +31 -34
- package/lib/engine.cjs.map +1 -1
- package/lib/engine.d.cts +2 -2
- package/lib/engine.d.ts +2 -2
- package/lib/engine.js +29 -32
- package/lib/engine.js.map +1 -1
- package/lib/{index-CXTNydcn.d.ts → index-B4-2j2Wc.d.ts} +1 -1
- package/lib/{index-Dmz16pyp.d.cts → index-Bk2lcsFR.d.cts} +2 -1
- package/lib/{index-C_YBAG0l.d.ts → index-C9beP7g-.d.ts} +2 -1
- package/lib/{index-D8zJ3Ysz.d.cts → index-CGIwLtSY.d.cts} +1 -1
- package/lib/index.cjs +1 -1
- package/lib/onboarding.cjs +2 -2
- package/lib/onboarding.d.cts +10 -1
- package/lib/onboarding.d.ts +10 -1
- package/lib/onboarding.js +1 -1
- package/lib/{rolldown-runtime-y5ARvAq5.cjs → rolldown-runtime-Gi87jfEt.cjs} +1 -1
- package/lib/{types-B4YDSE9A.d.ts → types-CfYB9MxO.d.ts} +1 -1
- package/lib/{types-B7ILvJLO.d.cts → types-DKgBom7c.d.cts} +1 -1
- package/lib/{utils-qv4hwX4J.cjs → utils-AeGt6yXB.cjs} +2 -2
- package/lib/{utils-qv4hwX4J.cjs.map → utils-AeGt6yXB.cjs.map} +1 -1
- package/package.json +14 -14
- package/lib/device-CQB6rcaQ.js.map +0 -1
- package/lib/device-DMdUA_7n.cjs.map +0 -1
package/lib/bake.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as Logger } from "./logger-DHtgWA66.cjs";
|
|
2
2
|
import { n as RouterInputs, t as RevaultApiTRPCClient } from "./trpc-BCwyqVKi.cjs";
|
|
3
|
-
import { S as WithWorkspace, f as Engine, x as WithPsdAuth, y as WithDevice } from "./types-
|
|
4
|
-
import "./index-
|
|
3
|
+
import { S as WithWorkspace, f as Engine, x as WithPsdAuth, y as WithDevice } from "./types-DKgBom7c.cjs";
|
|
4
|
+
import "./index-CGIwLtSY.cjs";
|
|
5
5
|
import z from "zod";
|
|
6
6
|
import { VaultRequestResponse } from "@ledgerhq/revault-api";
|
|
7
7
|
//#region src/bake/types.d.ts
|
|
@@ -61,6 +61,16 @@ declare const zManifestGovernanceRule: z.ZodObject<{
|
|
|
61
61
|
min: z.ZodNullable<z.ZodString>;
|
|
62
62
|
max: z.ZodNullable<z.ZodString>;
|
|
63
63
|
}, z.core.$strip>>;
|
|
64
|
+
fiatThreshold: z.ZodOptional<z.ZodObject<{
|
|
65
|
+
max: z.ZodString;
|
|
66
|
+
currency: z.ZodEnum<{
|
|
67
|
+
CHF: "CHF";
|
|
68
|
+
EUR: "EUR";
|
|
69
|
+
GBP: "GBP";
|
|
70
|
+
JPY: "JPY";
|
|
71
|
+
USD: "USD";
|
|
72
|
+
}>;
|
|
73
|
+
}, z.core.$strict>>;
|
|
64
74
|
whitelistNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
65
75
|
}, z.core.$strict>;
|
|
66
76
|
type ManifestGovernanceRule = z.infer<typeof zManifestGovernanceRule>;
|
|
@@ -92,6 +102,16 @@ declare const zManifestPolicy: z.ZodObject<{
|
|
|
92
102
|
min: z.ZodNullable<z.ZodString>;
|
|
93
103
|
max: z.ZodNullable<z.ZodString>;
|
|
94
104
|
}, z.core.$strip>>;
|
|
105
|
+
fiatThreshold: z.ZodOptional<z.ZodObject<{
|
|
106
|
+
max: z.ZodString;
|
|
107
|
+
currency: z.ZodEnum<{
|
|
108
|
+
CHF: "CHF";
|
|
109
|
+
EUR: "EUR";
|
|
110
|
+
GBP: "GBP";
|
|
111
|
+
JPY: "JPY";
|
|
112
|
+
USD: "USD";
|
|
113
|
+
}>;
|
|
114
|
+
}, z.core.$strict>>;
|
|
95
115
|
whitelistNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
96
116
|
}, z.core.$strict>>;
|
|
97
117
|
}, z.core.$strict>;
|
|
@@ -136,6 +156,16 @@ declare const zManifestAccount: z.ZodObject<{
|
|
|
136
156
|
min: z.ZodNullable<z.ZodString>;
|
|
137
157
|
max: z.ZodNullable<z.ZodString>;
|
|
138
158
|
}, z.core.$strip>>;
|
|
159
|
+
fiatThreshold: z.ZodOptional<z.ZodObject<{
|
|
160
|
+
max: z.ZodString;
|
|
161
|
+
currency: z.ZodEnum<{
|
|
162
|
+
CHF: "CHF";
|
|
163
|
+
EUR: "EUR";
|
|
164
|
+
GBP: "GBP";
|
|
165
|
+
JPY: "JPY";
|
|
166
|
+
USD: "USD";
|
|
167
|
+
}>;
|
|
168
|
+
}, z.core.$strict>>;
|
|
139
169
|
whitelistNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
140
170
|
}, z.core.$strict>>;
|
|
141
171
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -362,6 +392,16 @@ declare const zManifestWorkspace: z.ZodObject<{
|
|
|
362
392
|
min: z.ZodNullable<z.ZodString>;
|
|
363
393
|
max: z.ZodNullable<z.ZodString>;
|
|
364
394
|
}, z.core.$strip>>;
|
|
395
|
+
fiatThreshold: z.ZodOptional<z.ZodObject<{
|
|
396
|
+
max: z.ZodString;
|
|
397
|
+
currency: z.ZodEnum<{
|
|
398
|
+
CHF: "CHF";
|
|
399
|
+
EUR: "EUR";
|
|
400
|
+
GBP: "GBP";
|
|
401
|
+
JPY: "JPY";
|
|
402
|
+
USD: "USD";
|
|
403
|
+
}>;
|
|
404
|
+
}, z.core.$strict>>;
|
|
365
405
|
whitelistNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
366
406
|
}, z.core.$strict>>;
|
|
367
407
|
}, z.core.$strict>>>;
|
|
@@ -397,6 +437,16 @@ declare const zManifestWorkspace: z.ZodObject<{
|
|
|
397
437
|
min: z.ZodNullable<z.ZodString>;
|
|
398
438
|
max: z.ZodNullable<z.ZodString>;
|
|
399
439
|
}, z.core.$strip>>;
|
|
440
|
+
fiatThreshold: z.ZodOptional<z.ZodObject<{
|
|
441
|
+
max: z.ZodString;
|
|
442
|
+
currency: z.ZodEnum<{
|
|
443
|
+
CHF: "CHF";
|
|
444
|
+
EUR: "EUR";
|
|
445
|
+
GBP: "GBP";
|
|
446
|
+
JPY: "JPY";
|
|
447
|
+
USD: "USD";
|
|
448
|
+
}>;
|
|
449
|
+
}, z.core.$strict>>;
|
|
400
450
|
whitelistNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
401
451
|
}, z.core.$strict>>;
|
|
402
452
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -587,6 +637,16 @@ declare const zManifest: z.ZodObject<{
|
|
|
587
637
|
min: z.ZodNullable<z.ZodString>;
|
|
588
638
|
max: z.ZodNullable<z.ZodString>;
|
|
589
639
|
}, z.core.$strip>>;
|
|
640
|
+
fiatThreshold: z.ZodOptional<z.ZodObject<{
|
|
641
|
+
max: z.ZodString;
|
|
642
|
+
currency: z.ZodEnum<{
|
|
643
|
+
CHF: "CHF";
|
|
644
|
+
EUR: "EUR";
|
|
645
|
+
GBP: "GBP";
|
|
646
|
+
JPY: "JPY";
|
|
647
|
+
USD: "USD";
|
|
648
|
+
}>;
|
|
649
|
+
}, z.core.$strict>>;
|
|
590
650
|
whitelistNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
591
651
|
}, z.core.$strict>>;
|
|
592
652
|
}, z.core.$strict>>>;
|
|
@@ -622,6 +682,16 @@ declare const zManifest: z.ZodObject<{
|
|
|
622
682
|
min: z.ZodNullable<z.ZodString>;
|
|
623
683
|
max: z.ZodNullable<z.ZodString>;
|
|
624
684
|
}, z.core.$strip>>;
|
|
685
|
+
fiatThreshold: z.ZodOptional<z.ZodObject<{
|
|
686
|
+
max: z.ZodString;
|
|
687
|
+
currency: z.ZodEnum<{
|
|
688
|
+
CHF: "CHF";
|
|
689
|
+
EUR: "EUR";
|
|
690
|
+
GBP: "GBP";
|
|
691
|
+
JPY: "JPY";
|
|
692
|
+
USD: "USD";
|
|
693
|
+
}>;
|
|
694
|
+
}, z.core.$strict>>;
|
|
625
695
|
whitelistNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
626
696
|
}, z.core.$strict>>;
|
|
627
697
|
}, z.core.$strict>, z.ZodObject<{
|
package/lib/bake.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as Logger } from "./logger-DHtgWA66.js";
|
|
2
2
|
import { n as RouterInputs, t as RevaultApiTRPCClient } from "./trpc-BCwyqVKi.js";
|
|
3
|
-
import { S as WithWorkspace, f as Engine, x as WithPsdAuth, y as WithDevice } from "./types-
|
|
4
|
-
import "./index-
|
|
3
|
+
import { S as WithWorkspace, f as Engine, x as WithPsdAuth, y as WithDevice } from "./types-CfYB9MxO.js";
|
|
4
|
+
import "./index-B4-2j2Wc.js";
|
|
5
5
|
import z from "zod";
|
|
6
6
|
import { VaultRequestResponse } from "@ledgerhq/revault-api";
|
|
7
7
|
//#region src/bake/types.d.ts
|
|
@@ -61,6 +61,16 @@ declare const zManifestGovernanceRule: z.ZodObject<{
|
|
|
61
61
|
min: z.ZodNullable<z.ZodString>;
|
|
62
62
|
max: z.ZodNullable<z.ZodString>;
|
|
63
63
|
}, z.core.$strip>>;
|
|
64
|
+
fiatThreshold: z.ZodOptional<z.ZodObject<{
|
|
65
|
+
max: z.ZodString;
|
|
66
|
+
currency: z.ZodEnum<{
|
|
67
|
+
CHF: "CHF";
|
|
68
|
+
EUR: "EUR";
|
|
69
|
+
GBP: "GBP";
|
|
70
|
+
JPY: "JPY";
|
|
71
|
+
USD: "USD";
|
|
72
|
+
}>;
|
|
73
|
+
}, z.core.$strict>>;
|
|
64
74
|
whitelistNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
65
75
|
}, z.core.$strict>;
|
|
66
76
|
type ManifestGovernanceRule = z.infer<typeof zManifestGovernanceRule>;
|
|
@@ -92,6 +102,16 @@ declare const zManifestPolicy: z.ZodObject<{
|
|
|
92
102
|
min: z.ZodNullable<z.ZodString>;
|
|
93
103
|
max: z.ZodNullable<z.ZodString>;
|
|
94
104
|
}, z.core.$strip>>;
|
|
105
|
+
fiatThreshold: z.ZodOptional<z.ZodObject<{
|
|
106
|
+
max: z.ZodString;
|
|
107
|
+
currency: z.ZodEnum<{
|
|
108
|
+
CHF: "CHF";
|
|
109
|
+
EUR: "EUR";
|
|
110
|
+
GBP: "GBP";
|
|
111
|
+
JPY: "JPY";
|
|
112
|
+
USD: "USD";
|
|
113
|
+
}>;
|
|
114
|
+
}, z.core.$strict>>;
|
|
95
115
|
whitelistNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
96
116
|
}, z.core.$strict>>;
|
|
97
117
|
}, z.core.$strict>;
|
|
@@ -136,6 +156,16 @@ declare const zManifestAccount: z.ZodObject<{
|
|
|
136
156
|
min: z.ZodNullable<z.ZodString>;
|
|
137
157
|
max: z.ZodNullable<z.ZodString>;
|
|
138
158
|
}, z.core.$strip>>;
|
|
159
|
+
fiatThreshold: z.ZodOptional<z.ZodObject<{
|
|
160
|
+
max: z.ZodString;
|
|
161
|
+
currency: z.ZodEnum<{
|
|
162
|
+
CHF: "CHF";
|
|
163
|
+
EUR: "EUR";
|
|
164
|
+
GBP: "GBP";
|
|
165
|
+
JPY: "JPY";
|
|
166
|
+
USD: "USD";
|
|
167
|
+
}>;
|
|
168
|
+
}, z.core.$strict>>;
|
|
139
169
|
whitelistNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
140
170
|
}, z.core.$strict>>;
|
|
141
171
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -362,6 +392,16 @@ declare const zManifestWorkspace: z.ZodObject<{
|
|
|
362
392
|
min: z.ZodNullable<z.ZodString>;
|
|
363
393
|
max: z.ZodNullable<z.ZodString>;
|
|
364
394
|
}, z.core.$strip>>;
|
|
395
|
+
fiatThreshold: z.ZodOptional<z.ZodObject<{
|
|
396
|
+
max: z.ZodString;
|
|
397
|
+
currency: z.ZodEnum<{
|
|
398
|
+
CHF: "CHF";
|
|
399
|
+
EUR: "EUR";
|
|
400
|
+
GBP: "GBP";
|
|
401
|
+
JPY: "JPY";
|
|
402
|
+
USD: "USD";
|
|
403
|
+
}>;
|
|
404
|
+
}, z.core.$strict>>;
|
|
365
405
|
whitelistNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
366
406
|
}, z.core.$strict>>;
|
|
367
407
|
}, z.core.$strict>>>;
|
|
@@ -397,6 +437,16 @@ declare const zManifestWorkspace: z.ZodObject<{
|
|
|
397
437
|
min: z.ZodNullable<z.ZodString>;
|
|
398
438
|
max: z.ZodNullable<z.ZodString>;
|
|
399
439
|
}, z.core.$strip>>;
|
|
440
|
+
fiatThreshold: z.ZodOptional<z.ZodObject<{
|
|
441
|
+
max: z.ZodString;
|
|
442
|
+
currency: z.ZodEnum<{
|
|
443
|
+
CHF: "CHF";
|
|
444
|
+
EUR: "EUR";
|
|
445
|
+
GBP: "GBP";
|
|
446
|
+
JPY: "JPY";
|
|
447
|
+
USD: "USD";
|
|
448
|
+
}>;
|
|
449
|
+
}, z.core.$strict>>;
|
|
400
450
|
whitelistNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
401
451
|
}, z.core.$strict>>;
|
|
402
452
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -587,6 +637,16 @@ declare const zManifest: z.ZodObject<{
|
|
|
587
637
|
min: z.ZodNullable<z.ZodString>;
|
|
588
638
|
max: z.ZodNullable<z.ZodString>;
|
|
589
639
|
}, z.core.$strip>>;
|
|
640
|
+
fiatThreshold: z.ZodOptional<z.ZodObject<{
|
|
641
|
+
max: z.ZodString;
|
|
642
|
+
currency: z.ZodEnum<{
|
|
643
|
+
CHF: "CHF";
|
|
644
|
+
EUR: "EUR";
|
|
645
|
+
GBP: "GBP";
|
|
646
|
+
JPY: "JPY";
|
|
647
|
+
USD: "USD";
|
|
648
|
+
}>;
|
|
649
|
+
}, z.core.$strict>>;
|
|
590
650
|
whitelistNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
591
651
|
}, z.core.$strict>>;
|
|
592
652
|
}, z.core.$strict>>>;
|
|
@@ -622,6 +682,16 @@ declare const zManifest: z.ZodObject<{
|
|
|
622
682
|
min: z.ZodNullable<z.ZodString>;
|
|
623
683
|
max: z.ZodNullable<z.ZodString>;
|
|
624
684
|
}, z.core.$strip>>;
|
|
685
|
+
fiatThreshold: z.ZodOptional<z.ZodObject<{
|
|
686
|
+
max: z.ZodString;
|
|
687
|
+
currency: z.ZodEnum<{
|
|
688
|
+
CHF: "CHF";
|
|
689
|
+
EUR: "EUR";
|
|
690
|
+
GBP: "GBP";
|
|
691
|
+
JPY: "JPY";
|
|
692
|
+
USD: "USD";
|
|
693
|
+
}>;
|
|
694
|
+
}, z.core.$strict>>;
|
|
625
695
|
whitelistNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
626
696
|
}, z.core.$strict>>;
|
|
627
697
|
}, z.core.$strict>, z.ZodObject<{
|
package/lib/bake.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as createDeviceIndexResolver, r as fetchAll } from "./utils-CW0gdJME.js";
|
|
2
|
-
import { t as genKeys } from "./crypto-
|
|
2
|
+
import { t as genKeys } from "./crypto-BUAUyEPl.js";
|
|
3
3
|
import invariant from "invariant";
|
|
4
4
|
import { match } from "ts-pattern";
|
|
5
5
|
import _ from "lodash";
|
|
@@ -369,6 +369,7 @@ async function bakeWorkspace(options, logger) {
|
|
|
369
369
|
};
|
|
370
370
|
}),
|
|
371
371
|
...rule.threshold !== void 0 ? { threshold: rule.threshold } : {},
|
|
372
|
+
...rule.fiatThreshold !== void 0 ? { fiatThreshold: rule.fiatThreshold } : {},
|
|
372
373
|
...rule.whitelistNames !== void 0 ? { whitelistIds: rule.whitelistNames.map(whitelistIdFromName) } : {}
|
|
373
374
|
};
|
|
374
375
|
}
|
|
@@ -769,7 +770,7 @@ async function bakeWorkspace(options, logger) {
|
|
|
769
770
|
}
|
|
770
771
|
}
|
|
771
772
|
async function resolveDevicesIndexes(users) {
|
|
772
|
-
return
|
|
773
|
+
return users.reduce((acc, cur) => acc.then(async (acc) => {
|
|
773
774
|
acc.push(await withDeviceIndex(cur));
|
|
774
775
|
return acc;
|
|
775
776
|
}), Promise.resolve([]));
|
|
@@ -1035,6 +1036,7 @@ async function recipeWorkspace(options, logger) {
|
|
|
1035
1036
|
};
|
|
1036
1037
|
}),
|
|
1037
1038
|
...threshold,
|
|
1039
|
+
...rule.fiatThreshold !== void 0 ? { fiatThreshold: rule.fiatThreshold } : {},
|
|
1038
1040
|
...rule.whitelistIds && rule.whitelistIds.length > 0 ? { whitelistNames: rule.whitelistIds.map(whitelistNameFromId) } : {}
|
|
1039
1041
|
};
|
|
1040
1042
|
}
|
|
@@ -1117,6 +1119,16 @@ const zManifestGovernanceRule = z.object({
|
|
|
1117
1119
|
min: z.string().nullable(),
|
|
1118
1120
|
max: z.string().nullable()
|
|
1119
1121
|
}).optional(),
|
|
1122
|
+
fiatThreshold: z.object({
|
|
1123
|
+
max: z.string(),
|
|
1124
|
+
currency: z.enum([
|
|
1125
|
+
"USD",
|
|
1126
|
+
"EUR",
|
|
1127
|
+
"GBP",
|
|
1128
|
+
"JPY",
|
|
1129
|
+
"CHF"
|
|
1130
|
+
])
|
|
1131
|
+
}).strict().optional(),
|
|
1120
1132
|
whitelistNames: z.array(z.string()).optional()
|
|
1121
1133
|
}).strict();
|
|
1122
1134
|
const zManifestPolicyAsset = z.object({
|