@canton-network/core-wallet-store 0.9.0 → 0.10.0
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/dist/config/schema.d.ts +190 -324
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/index.cjs +49 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +44 -4
- package/dist/index.js.map +1 -0
- package/package.json +6 -4
- package/dist/Store.js +0 -8
- package/dist/config/schema.js +0 -76
package/dist/config/schema.d.ts
CHANGED
|
@@ -6,290 +6,6 @@ export declare const ledgerApiSchema: z.ZodObject<{
|
|
|
6
6
|
}, {
|
|
7
7
|
baseUrl: string;
|
|
8
8
|
}>;
|
|
9
|
-
declare const clientCredentials: z.ZodObject<{
|
|
10
|
-
clientId: z.ZodString;
|
|
11
|
-
clientSecret: z.ZodString;
|
|
12
|
-
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
clientId: string;
|
|
14
|
-
clientSecret: string;
|
|
15
|
-
}, {
|
|
16
|
-
clientId: string;
|
|
17
|
-
clientSecret: string;
|
|
18
|
-
}>;
|
|
19
|
-
declare const passwordAuthSchema: z.ZodObject<{
|
|
20
|
-
identityProviderId: z.ZodString;
|
|
21
|
-
type: z.ZodLiteral<"password">;
|
|
22
|
-
issuer: z.ZodString;
|
|
23
|
-
configUrl: z.ZodString;
|
|
24
|
-
audience: z.ZodString;
|
|
25
|
-
tokenUrl: z.ZodString;
|
|
26
|
-
grantType: z.ZodString;
|
|
27
|
-
scope: z.ZodString;
|
|
28
|
-
clientId: z.ZodString;
|
|
29
|
-
admin: z.ZodOptional<z.ZodObject<{
|
|
30
|
-
clientId: z.ZodString;
|
|
31
|
-
clientSecret: z.ZodString;
|
|
32
|
-
}, "strip", z.ZodTypeAny, {
|
|
33
|
-
clientId: string;
|
|
34
|
-
clientSecret: string;
|
|
35
|
-
}, {
|
|
36
|
-
clientId: string;
|
|
37
|
-
clientSecret: string;
|
|
38
|
-
}>>;
|
|
39
|
-
}, "strip", z.ZodTypeAny, {
|
|
40
|
-
type: "password";
|
|
41
|
-
clientId: string;
|
|
42
|
-
identityProviderId: string;
|
|
43
|
-
issuer: string;
|
|
44
|
-
configUrl: string;
|
|
45
|
-
audience: string;
|
|
46
|
-
tokenUrl: string;
|
|
47
|
-
grantType: string;
|
|
48
|
-
scope: string;
|
|
49
|
-
admin?: {
|
|
50
|
-
clientId: string;
|
|
51
|
-
clientSecret: string;
|
|
52
|
-
} | undefined;
|
|
53
|
-
}, {
|
|
54
|
-
type: "password";
|
|
55
|
-
clientId: string;
|
|
56
|
-
identityProviderId: string;
|
|
57
|
-
issuer: string;
|
|
58
|
-
configUrl: string;
|
|
59
|
-
audience: string;
|
|
60
|
-
tokenUrl: string;
|
|
61
|
-
grantType: string;
|
|
62
|
-
scope: string;
|
|
63
|
-
admin?: {
|
|
64
|
-
clientId: string;
|
|
65
|
-
clientSecret: string;
|
|
66
|
-
} | undefined;
|
|
67
|
-
}>;
|
|
68
|
-
declare const implicitAuthSchema: z.ZodObject<{
|
|
69
|
-
identityProviderId: z.ZodString;
|
|
70
|
-
type: z.ZodLiteral<"implicit">;
|
|
71
|
-
issuer: z.ZodString;
|
|
72
|
-
configUrl: z.ZodString;
|
|
73
|
-
audience: z.ZodString;
|
|
74
|
-
scope: z.ZodString;
|
|
75
|
-
clientId: z.ZodString;
|
|
76
|
-
admin: z.ZodOptional<z.ZodObject<{
|
|
77
|
-
clientId: z.ZodString;
|
|
78
|
-
clientSecret: z.ZodString;
|
|
79
|
-
}, "strip", z.ZodTypeAny, {
|
|
80
|
-
clientId: string;
|
|
81
|
-
clientSecret: string;
|
|
82
|
-
}, {
|
|
83
|
-
clientId: string;
|
|
84
|
-
clientSecret: string;
|
|
85
|
-
}>>;
|
|
86
|
-
}, "strip", z.ZodTypeAny, {
|
|
87
|
-
type: "implicit";
|
|
88
|
-
clientId: string;
|
|
89
|
-
identityProviderId: string;
|
|
90
|
-
issuer: string;
|
|
91
|
-
configUrl: string;
|
|
92
|
-
audience: string;
|
|
93
|
-
scope: string;
|
|
94
|
-
admin?: {
|
|
95
|
-
clientId: string;
|
|
96
|
-
clientSecret: string;
|
|
97
|
-
} | undefined;
|
|
98
|
-
}, {
|
|
99
|
-
type: "implicit";
|
|
100
|
-
clientId: string;
|
|
101
|
-
identityProviderId: string;
|
|
102
|
-
issuer: string;
|
|
103
|
-
configUrl: string;
|
|
104
|
-
audience: string;
|
|
105
|
-
scope: string;
|
|
106
|
-
admin?: {
|
|
107
|
-
clientId: string;
|
|
108
|
-
clientSecret: string;
|
|
109
|
-
} | undefined;
|
|
110
|
-
}>;
|
|
111
|
-
declare const clientCredentialAuthSchema: z.ZodObject<{
|
|
112
|
-
identityProviderId: z.ZodString;
|
|
113
|
-
type: z.ZodLiteral<"client_credentials">;
|
|
114
|
-
issuer: z.ZodString;
|
|
115
|
-
configUrl: z.ZodString;
|
|
116
|
-
audience: z.ZodString;
|
|
117
|
-
scope: z.ZodString;
|
|
118
|
-
clientId: z.ZodString;
|
|
119
|
-
clientSecret: z.ZodString;
|
|
120
|
-
admin: z.ZodOptional<z.ZodObject<{
|
|
121
|
-
clientId: z.ZodString;
|
|
122
|
-
clientSecret: z.ZodString;
|
|
123
|
-
}, "strip", z.ZodTypeAny, {
|
|
124
|
-
clientId: string;
|
|
125
|
-
clientSecret: string;
|
|
126
|
-
}, {
|
|
127
|
-
clientId: string;
|
|
128
|
-
clientSecret: string;
|
|
129
|
-
}>>;
|
|
130
|
-
}, "strip", z.ZodTypeAny, {
|
|
131
|
-
type: "client_credentials";
|
|
132
|
-
clientId: string;
|
|
133
|
-
clientSecret: string;
|
|
134
|
-
identityProviderId: string;
|
|
135
|
-
issuer: string;
|
|
136
|
-
configUrl: string;
|
|
137
|
-
audience: string;
|
|
138
|
-
scope: string;
|
|
139
|
-
admin?: {
|
|
140
|
-
clientId: string;
|
|
141
|
-
clientSecret: string;
|
|
142
|
-
} | undefined;
|
|
143
|
-
}, {
|
|
144
|
-
type: "client_credentials";
|
|
145
|
-
clientId: string;
|
|
146
|
-
clientSecret: string;
|
|
147
|
-
identityProviderId: string;
|
|
148
|
-
issuer: string;
|
|
149
|
-
configUrl: string;
|
|
150
|
-
audience: string;
|
|
151
|
-
scope: string;
|
|
152
|
-
admin?: {
|
|
153
|
-
clientId: string;
|
|
154
|
-
clientSecret: string;
|
|
155
|
-
} | undefined;
|
|
156
|
-
}>;
|
|
157
|
-
export declare const authSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
158
|
-
identityProviderId: z.ZodString;
|
|
159
|
-
type: z.ZodLiteral<"password">;
|
|
160
|
-
issuer: z.ZodString;
|
|
161
|
-
configUrl: z.ZodString;
|
|
162
|
-
audience: z.ZodString;
|
|
163
|
-
tokenUrl: z.ZodString;
|
|
164
|
-
grantType: z.ZodString;
|
|
165
|
-
scope: z.ZodString;
|
|
166
|
-
clientId: z.ZodString;
|
|
167
|
-
admin: z.ZodOptional<z.ZodObject<{
|
|
168
|
-
clientId: z.ZodString;
|
|
169
|
-
clientSecret: z.ZodString;
|
|
170
|
-
}, "strip", z.ZodTypeAny, {
|
|
171
|
-
clientId: string;
|
|
172
|
-
clientSecret: string;
|
|
173
|
-
}, {
|
|
174
|
-
clientId: string;
|
|
175
|
-
clientSecret: string;
|
|
176
|
-
}>>;
|
|
177
|
-
}, "strip", z.ZodTypeAny, {
|
|
178
|
-
type: "password";
|
|
179
|
-
clientId: string;
|
|
180
|
-
identityProviderId: string;
|
|
181
|
-
issuer: string;
|
|
182
|
-
configUrl: string;
|
|
183
|
-
audience: string;
|
|
184
|
-
tokenUrl: string;
|
|
185
|
-
grantType: string;
|
|
186
|
-
scope: string;
|
|
187
|
-
admin?: {
|
|
188
|
-
clientId: string;
|
|
189
|
-
clientSecret: string;
|
|
190
|
-
} | undefined;
|
|
191
|
-
}, {
|
|
192
|
-
type: "password";
|
|
193
|
-
clientId: string;
|
|
194
|
-
identityProviderId: string;
|
|
195
|
-
issuer: string;
|
|
196
|
-
configUrl: string;
|
|
197
|
-
audience: string;
|
|
198
|
-
tokenUrl: string;
|
|
199
|
-
grantType: string;
|
|
200
|
-
scope: string;
|
|
201
|
-
admin?: {
|
|
202
|
-
clientId: string;
|
|
203
|
-
clientSecret: string;
|
|
204
|
-
} | undefined;
|
|
205
|
-
}>, z.ZodObject<{
|
|
206
|
-
identityProviderId: z.ZodString;
|
|
207
|
-
type: z.ZodLiteral<"implicit">;
|
|
208
|
-
issuer: z.ZodString;
|
|
209
|
-
configUrl: z.ZodString;
|
|
210
|
-
audience: z.ZodString;
|
|
211
|
-
scope: z.ZodString;
|
|
212
|
-
clientId: z.ZodString;
|
|
213
|
-
admin: z.ZodOptional<z.ZodObject<{
|
|
214
|
-
clientId: z.ZodString;
|
|
215
|
-
clientSecret: z.ZodString;
|
|
216
|
-
}, "strip", z.ZodTypeAny, {
|
|
217
|
-
clientId: string;
|
|
218
|
-
clientSecret: string;
|
|
219
|
-
}, {
|
|
220
|
-
clientId: string;
|
|
221
|
-
clientSecret: string;
|
|
222
|
-
}>>;
|
|
223
|
-
}, "strip", z.ZodTypeAny, {
|
|
224
|
-
type: "implicit";
|
|
225
|
-
clientId: string;
|
|
226
|
-
identityProviderId: string;
|
|
227
|
-
issuer: string;
|
|
228
|
-
configUrl: string;
|
|
229
|
-
audience: string;
|
|
230
|
-
scope: string;
|
|
231
|
-
admin?: {
|
|
232
|
-
clientId: string;
|
|
233
|
-
clientSecret: string;
|
|
234
|
-
} | undefined;
|
|
235
|
-
}, {
|
|
236
|
-
type: "implicit";
|
|
237
|
-
clientId: string;
|
|
238
|
-
identityProviderId: string;
|
|
239
|
-
issuer: string;
|
|
240
|
-
configUrl: string;
|
|
241
|
-
audience: string;
|
|
242
|
-
scope: string;
|
|
243
|
-
admin?: {
|
|
244
|
-
clientId: string;
|
|
245
|
-
clientSecret: string;
|
|
246
|
-
} | undefined;
|
|
247
|
-
}>, z.ZodObject<{
|
|
248
|
-
identityProviderId: z.ZodString;
|
|
249
|
-
type: z.ZodLiteral<"client_credentials">;
|
|
250
|
-
issuer: z.ZodString;
|
|
251
|
-
configUrl: z.ZodString;
|
|
252
|
-
audience: z.ZodString;
|
|
253
|
-
scope: z.ZodString;
|
|
254
|
-
clientId: z.ZodString;
|
|
255
|
-
clientSecret: z.ZodString;
|
|
256
|
-
admin: z.ZodOptional<z.ZodObject<{
|
|
257
|
-
clientId: z.ZodString;
|
|
258
|
-
clientSecret: z.ZodString;
|
|
259
|
-
}, "strip", z.ZodTypeAny, {
|
|
260
|
-
clientId: string;
|
|
261
|
-
clientSecret: string;
|
|
262
|
-
}, {
|
|
263
|
-
clientId: string;
|
|
264
|
-
clientSecret: string;
|
|
265
|
-
}>>;
|
|
266
|
-
}, "strip", z.ZodTypeAny, {
|
|
267
|
-
type: "client_credentials";
|
|
268
|
-
clientId: string;
|
|
269
|
-
clientSecret: string;
|
|
270
|
-
identityProviderId: string;
|
|
271
|
-
issuer: string;
|
|
272
|
-
configUrl: string;
|
|
273
|
-
audience: string;
|
|
274
|
-
scope: string;
|
|
275
|
-
admin?: {
|
|
276
|
-
clientId: string;
|
|
277
|
-
clientSecret: string;
|
|
278
|
-
} | undefined;
|
|
279
|
-
}, {
|
|
280
|
-
type: "client_credentials";
|
|
281
|
-
clientId: string;
|
|
282
|
-
clientSecret: string;
|
|
283
|
-
identityProviderId: string;
|
|
284
|
-
issuer: string;
|
|
285
|
-
configUrl: string;
|
|
286
|
-
audience: string;
|
|
287
|
-
scope: string;
|
|
288
|
-
admin?: {
|
|
289
|
-
clientId: string;
|
|
290
|
-
clientSecret: string;
|
|
291
|
-
} | undefined;
|
|
292
|
-
}>]>;
|
|
293
9
|
export declare const networkSchema: z.ZodObject<{
|
|
294
10
|
name: z.ZodString;
|
|
295
11
|
chainId: z.ZodString;
|
|
@@ -323,8 +39,8 @@ export declare const networkSchema: z.ZodObject<{
|
|
|
323
39
|
clientSecret: string;
|
|
324
40
|
}>>;
|
|
325
41
|
}, "strip", z.ZodTypeAny, {
|
|
326
|
-
type: "password";
|
|
327
42
|
clientId: string;
|
|
43
|
+
type: "password";
|
|
328
44
|
identityProviderId: string;
|
|
329
45
|
issuer: string;
|
|
330
46
|
configUrl: string;
|
|
@@ -337,8 +53,8 @@ export declare const networkSchema: z.ZodObject<{
|
|
|
337
53
|
clientSecret: string;
|
|
338
54
|
} | undefined;
|
|
339
55
|
}, {
|
|
340
|
-
type: "password";
|
|
341
56
|
clientId: string;
|
|
57
|
+
type: "password";
|
|
342
58
|
identityProviderId: string;
|
|
343
59
|
issuer: string;
|
|
344
60
|
configUrl: string;
|
|
@@ -369,8 +85,8 @@ export declare const networkSchema: z.ZodObject<{
|
|
|
369
85
|
clientSecret: string;
|
|
370
86
|
}>>;
|
|
371
87
|
}, "strip", z.ZodTypeAny, {
|
|
372
|
-
type: "implicit";
|
|
373
88
|
clientId: string;
|
|
89
|
+
type: "implicit";
|
|
374
90
|
identityProviderId: string;
|
|
375
91
|
issuer: string;
|
|
376
92
|
configUrl: string;
|
|
@@ -381,8 +97,8 @@ export declare const networkSchema: z.ZodObject<{
|
|
|
381
97
|
clientSecret: string;
|
|
382
98
|
} | undefined;
|
|
383
99
|
}, {
|
|
384
|
-
type: "implicit";
|
|
385
100
|
clientId: string;
|
|
101
|
+
type: "implicit";
|
|
386
102
|
identityProviderId: string;
|
|
387
103
|
issuer: string;
|
|
388
104
|
configUrl: string;
|
|
@@ -412,9 +128,9 @@ export declare const networkSchema: z.ZodObject<{
|
|
|
412
128
|
clientSecret: string;
|
|
413
129
|
}>>;
|
|
414
130
|
}, "strip", z.ZodTypeAny, {
|
|
415
|
-
type: "client_credentials";
|
|
416
131
|
clientId: string;
|
|
417
132
|
clientSecret: string;
|
|
133
|
+
type: "client_credentials";
|
|
418
134
|
identityProviderId: string;
|
|
419
135
|
issuer: string;
|
|
420
136
|
configUrl: string;
|
|
@@ -425,9 +141,9 @@ export declare const networkSchema: z.ZodObject<{
|
|
|
425
141
|
clientSecret: string;
|
|
426
142
|
} | undefined;
|
|
427
143
|
}, {
|
|
428
|
-
type: "client_credentials";
|
|
429
144
|
clientId: string;
|
|
430
145
|
clientSecret: string;
|
|
146
|
+
type: "client_credentials";
|
|
431
147
|
identityProviderId: string;
|
|
432
148
|
issuer: string;
|
|
433
149
|
configUrl: string;
|
|
@@ -437,6 +153,48 @@ export declare const networkSchema: z.ZodObject<{
|
|
|
437
153
|
clientId: string;
|
|
438
154
|
clientSecret: string;
|
|
439
155
|
} | undefined;
|
|
156
|
+
}>, z.ZodObject<{
|
|
157
|
+
identityProviderId: z.ZodString;
|
|
158
|
+
type: z.ZodLiteral<"self_signed">;
|
|
159
|
+
issuer: z.ZodString;
|
|
160
|
+
audience: z.ZodString;
|
|
161
|
+
scope: z.ZodString;
|
|
162
|
+
clientId: z.ZodString;
|
|
163
|
+
clientSecret: z.ZodString;
|
|
164
|
+
admin: z.ZodOptional<z.ZodObject<{
|
|
165
|
+
clientId: z.ZodString;
|
|
166
|
+
clientSecret: z.ZodString;
|
|
167
|
+
}, "strip", z.ZodTypeAny, {
|
|
168
|
+
clientId: string;
|
|
169
|
+
clientSecret: string;
|
|
170
|
+
}, {
|
|
171
|
+
clientId: string;
|
|
172
|
+
clientSecret: string;
|
|
173
|
+
}>>;
|
|
174
|
+
}, "strip", z.ZodTypeAny, {
|
|
175
|
+
clientId: string;
|
|
176
|
+
clientSecret: string;
|
|
177
|
+
type: "self_signed";
|
|
178
|
+
identityProviderId: string;
|
|
179
|
+
issuer: string;
|
|
180
|
+
audience: string;
|
|
181
|
+
scope: string;
|
|
182
|
+
admin?: {
|
|
183
|
+
clientId: string;
|
|
184
|
+
clientSecret: string;
|
|
185
|
+
} | undefined;
|
|
186
|
+
}, {
|
|
187
|
+
clientId: string;
|
|
188
|
+
clientSecret: string;
|
|
189
|
+
type: "self_signed";
|
|
190
|
+
identityProviderId: string;
|
|
191
|
+
issuer: string;
|
|
192
|
+
audience: string;
|
|
193
|
+
scope: string;
|
|
194
|
+
admin?: {
|
|
195
|
+
clientId: string;
|
|
196
|
+
clientSecret: string;
|
|
197
|
+
} | undefined;
|
|
440
198
|
}>]>;
|
|
441
199
|
}, "strip", z.ZodTypeAny, {
|
|
442
200
|
name: string;
|
|
@@ -447,8 +205,8 @@ export declare const networkSchema: z.ZodObject<{
|
|
|
447
205
|
baseUrl: string;
|
|
448
206
|
};
|
|
449
207
|
auth: {
|
|
450
|
-
type: "password";
|
|
451
208
|
clientId: string;
|
|
209
|
+
type: "password";
|
|
452
210
|
identityProviderId: string;
|
|
453
211
|
issuer: string;
|
|
454
212
|
configUrl: string;
|
|
@@ -461,8 +219,8 @@ export declare const networkSchema: z.ZodObject<{
|
|
|
461
219
|
clientSecret: string;
|
|
462
220
|
} | undefined;
|
|
463
221
|
} | {
|
|
464
|
-
type: "implicit";
|
|
465
222
|
clientId: string;
|
|
223
|
+
type: "implicit";
|
|
466
224
|
identityProviderId: string;
|
|
467
225
|
issuer: string;
|
|
468
226
|
configUrl: string;
|
|
@@ -473,9 +231,9 @@ export declare const networkSchema: z.ZodObject<{
|
|
|
473
231
|
clientSecret: string;
|
|
474
232
|
} | undefined;
|
|
475
233
|
} | {
|
|
476
|
-
type: "client_credentials";
|
|
477
234
|
clientId: string;
|
|
478
235
|
clientSecret: string;
|
|
236
|
+
type: "client_credentials";
|
|
479
237
|
identityProviderId: string;
|
|
480
238
|
issuer: string;
|
|
481
239
|
configUrl: string;
|
|
@@ -485,6 +243,18 @@ export declare const networkSchema: z.ZodObject<{
|
|
|
485
243
|
clientId: string;
|
|
486
244
|
clientSecret: string;
|
|
487
245
|
} | undefined;
|
|
246
|
+
} | {
|
|
247
|
+
clientId: string;
|
|
248
|
+
clientSecret: string;
|
|
249
|
+
type: "self_signed";
|
|
250
|
+
identityProviderId: string;
|
|
251
|
+
issuer: string;
|
|
252
|
+
audience: string;
|
|
253
|
+
scope: string;
|
|
254
|
+
admin?: {
|
|
255
|
+
clientId: string;
|
|
256
|
+
clientSecret: string;
|
|
257
|
+
} | undefined;
|
|
488
258
|
};
|
|
489
259
|
}, {
|
|
490
260
|
name: string;
|
|
@@ -495,8 +265,8 @@ export declare const networkSchema: z.ZodObject<{
|
|
|
495
265
|
baseUrl: string;
|
|
496
266
|
};
|
|
497
267
|
auth: {
|
|
498
|
-
type: "password";
|
|
499
268
|
clientId: string;
|
|
269
|
+
type: "password";
|
|
500
270
|
identityProviderId: string;
|
|
501
271
|
issuer: string;
|
|
502
272
|
configUrl: string;
|
|
@@ -509,8 +279,8 @@ export declare const networkSchema: z.ZodObject<{
|
|
|
509
279
|
clientSecret: string;
|
|
510
280
|
} | undefined;
|
|
511
281
|
} | {
|
|
512
|
-
type: "implicit";
|
|
513
282
|
clientId: string;
|
|
283
|
+
type: "implicit";
|
|
514
284
|
identityProviderId: string;
|
|
515
285
|
issuer: string;
|
|
516
286
|
configUrl: string;
|
|
@@ -521,9 +291,9 @@ export declare const networkSchema: z.ZodObject<{
|
|
|
521
291
|
clientSecret: string;
|
|
522
292
|
} | undefined;
|
|
523
293
|
} | {
|
|
524
|
-
type: "client_credentials";
|
|
525
294
|
clientId: string;
|
|
526
295
|
clientSecret: string;
|
|
296
|
+
type: "client_credentials";
|
|
527
297
|
identityProviderId: string;
|
|
528
298
|
issuer: string;
|
|
529
299
|
configUrl: string;
|
|
@@ -533,6 +303,18 @@ export declare const networkSchema: z.ZodObject<{
|
|
|
533
303
|
clientId: string;
|
|
534
304
|
clientSecret: string;
|
|
535
305
|
} | undefined;
|
|
306
|
+
} | {
|
|
307
|
+
clientId: string;
|
|
308
|
+
clientSecret: string;
|
|
309
|
+
type: "self_signed";
|
|
310
|
+
identityProviderId: string;
|
|
311
|
+
issuer: string;
|
|
312
|
+
audience: string;
|
|
313
|
+
scope: string;
|
|
314
|
+
admin?: {
|
|
315
|
+
clientId: string;
|
|
316
|
+
clientSecret: string;
|
|
317
|
+
} | undefined;
|
|
536
318
|
};
|
|
537
319
|
}>;
|
|
538
320
|
export declare const storeConfigSchema: z.ZodObject<{
|
|
@@ -560,18 +342,18 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
560
342
|
database: z.ZodString;
|
|
561
343
|
}, "strip", z.ZodTypeAny, {
|
|
562
344
|
type: "postgres";
|
|
563
|
-
password: string;
|
|
564
345
|
database: string;
|
|
565
346
|
host: string;
|
|
566
347
|
port: number;
|
|
567
348
|
user: string;
|
|
349
|
+
password: string;
|
|
568
350
|
}, {
|
|
569
351
|
type: "postgres";
|
|
570
|
-
password: string;
|
|
571
352
|
database: string;
|
|
572
353
|
host: string;
|
|
573
354
|
port: number;
|
|
574
355
|
user: string;
|
|
356
|
+
password: string;
|
|
575
357
|
}>]>;
|
|
576
358
|
networks: z.ZodArray<z.ZodObject<{
|
|
577
359
|
name: z.ZodString;
|
|
@@ -606,8 +388,8 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
606
388
|
clientSecret: string;
|
|
607
389
|
}>>;
|
|
608
390
|
}, "strip", z.ZodTypeAny, {
|
|
609
|
-
type: "password";
|
|
610
391
|
clientId: string;
|
|
392
|
+
type: "password";
|
|
611
393
|
identityProviderId: string;
|
|
612
394
|
issuer: string;
|
|
613
395
|
configUrl: string;
|
|
@@ -620,8 +402,8 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
620
402
|
clientSecret: string;
|
|
621
403
|
} | undefined;
|
|
622
404
|
}, {
|
|
623
|
-
type: "password";
|
|
624
405
|
clientId: string;
|
|
406
|
+
type: "password";
|
|
625
407
|
identityProviderId: string;
|
|
626
408
|
issuer: string;
|
|
627
409
|
configUrl: string;
|
|
@@ -652,8 +434,8 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
652
434
|
clientSecret: string;
|
|
653
435
|
}>>;
|
|
654
436
|
}, "strip", z.ZodTypeAny, {
|
|
655
|
-
type: "implicit";
|
|
656
437
|
clientId: string;
|
|
438
|
+
type: "implicit";
|
|
657
439
|
identityProviderId: string;
|
|
658
440
|
issuer: string;
|
|
659
441
|
configUrl: string;
|
|
@@ -664,8 +446,8 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
664
446
|
clientSecret: string;
|
|
665
447
|
} | undefined;
|
|
666
448
|
}, {
|
|
667
|
-
type: "implicit";
|
|
668
449
|
clientId: string;
|
|
450
|
+
type: "implicit";
|
|
669
451
|
identityProviderId: string;
|
|
670
452
|
issuer: string;
|
|
671
453
|
configUrl: string;
|
|
@@ -695,9 +477,9 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
695
477
|
clientSecret: string;
|
|
696
478
|
}>>;
|
|
697
479
|
}, "strip", z.ZodTypeAny, {
|
|
698
|
-
type: "client_credentials";
|
|
699
480
|
clientId: string;
|
|
700
481
|
clientSecret: string;
|
|
482
|
+
type: "client_credentials";
|
|
701
483
|
identityProviderId: string;
|
|
702
484
|
issuer: string;
|
|
703
485
|
configUrl: string;
|
|
@@ -708,9 +490,9 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
708
490
|
clientSecret: string;
|
|
709
491
|
} | undefined;
|
|
710
492
|
}, {
|
|
711
|
-
type: "client_credentials";
|
|
712
493
|
clientId: string;
|
|
713
494
|
clientSecret: string;
|
|
495
|
+
type: "client_credentials";
|
|
714
496
|
identityProviderId: string;
|
|
715
497
|
issuer: string;
|
|
716
498
|
configUrl: string;
|
|
@@ -720,6 +502,48 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
720
502
|
clientId: string;
|
|
721
503
|
clientSecret: string;
|
|
722
504
|
} | undefined;
|
|
505
|
+
}>, z.ZodObject<{
|
|
506
|
+
identityProviderId: z.ZodString;
|
|
507
|
+
type: z.ZodLiteral<"self_signed">;
|
|
508
|
+
issuer: z.ZodString;
|
|
509
|
+
audience: z.ZodString;
|
|
510
|
+
scope: z.ZodString;
|
|
511
|
+
clientId: z.ZodString;
|
|
512
|
+
clientSecret: z.ZodString;
|
|
513
|
+
admin: z.ZodOptional<z.ZodObject<{
|
|
514
|
+
clientId: z.ZodString;
|
|
515
|
+
clientSecret: z.ZodString;
|
|
516
|
+
}, "strip", z.ZodTypeAny, {
|
|
517
|
+
clientId: string;
|
|
518
|
+
clientSecret: string;
|
|
519
|
+
}, {
|
|
520
|
+
clientId: string;
|
|
521
|
+
clientSecret: string;
|
|
522
|
+
}>>;
|
|
523
|
+
}, "strip", z.ZodTypeAny, {
|
|
524
|
+
clientId: string;
|
|
525
|
+
clientSecret: string;
|
|
526
|
+
type: "self_signed";
|
|
527
|
+
identityProviderId: string;
|
|
528
|
+
issuer: string;
|
|
529
|
+
audience: string;
|
|
530
|
+
scope: string;
|
|
531
|
+
admin?: {
|
|
532
|
+
clientId: string;
|
|
533
|
+
clientSecret: string;
|
|
534
|
+
} | undefined;
|
|
535
|
+
}, {
|
|
536
|
+
clientId: string;
|
|
537
|
+
clientSecret: string;
|
|
538
|
+
type: "self_signed";
|
|
539
|
+
identityProviderId: string;
|
|
540
|
+
issuer: string;
|
|
541
|
+
audience: string;
|
|
542
|
+
scope: string;
|
|
543
|
+
admin?: {
|
|
544
|
+
clientId: string;
|
|
545
|
+
clientSecret: string;
|
|
546
|
+
} | undefined;
|
|
723
547
|
}>]>;
|
|
724
548
|
}, "strip", z.ZodTypeAny, {
|
|
725
549
|
name: string;
|
|
@@ -730,8 +554,8 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
730
554
|
baseUrl: string;
|
|
731
555
|
};
|
|
732
556
|
auth: {
|
|
733
|
-
type: "password";
|
|
734
557
|
clientId: string;
|
|
558
|
+
type: "password";
|
|
735
559
|
identityProviderId: string;
|
|
736
560
|
issuer: string;
|
|
737
561
|
configUrl: string;
|
|
@@ -744,8 +568,8 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
744
568
|
clientSecret: string;
|
|
745
569
|
} | undefined;
|
|
746
570
|
} | {
|
|
747
|
-
type: "implicit";
|
|
748
571
|
clientId: string;
|
|
572
|
+
type: "implicit";
|
|
749
573
|
identityProviderId: string;
|
|
750
574
|
issuer: string;
|
|
751
575
|
configUrl: string;
|
|
@@ -756,9 +580,9 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
756
580
|
clientSecret: string;
|
|
757
581
|
} | undefined;
|
|
758
582
|
} | {
|
|
759
|
-
type: "client_credentials";
|
|
760
583
|
clientId: string;
|
|
761
584
|
clientSecret: string;
|
|
585
|
+
type: "client_credentials";
|
|
762
586
|
identityProviderId: string;
|
|
763
587
|
issuer: string;
|
|
764
588
|
configUrl: string;
|
|
@@ -768,6 +592,18 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
768
592
|
clientId: string;
|
|
769
593
|
clientSecret: string;
|
|
770
594
|
} | undefined;
|
|
595
|
+
} | {
|
|
596
|
+
clientId: string;
|
|
597
|
+
clientSecret: string;
|
|
598
|
+
type: "self_signed";
|
|
599
|
+
identityProviderId: string;
|
|
600
|
+
issuer: string;
|
|
601
|
+
audience: string;
|
|
602
|
+
scope: string;
|
|
603
|
+
admin?: {
|
|
604
|
+
clientId: string;
|
|
605
|
+
clientSecret: string;
|
|
606
|
+
} | undefined;
|
|
771
607
|
};
|
|
772
608
|
}, {
|
|
773
609
|
name: string;
|
|
@@ -778,8 +614,8 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
778
614
|
baseUrl: string;
|
|
779
615
|
};
|
|
780
616
|
auth: {
|
|
781
|
-
type: "password";
|
|
782
617
|
clientId: string;
|
|
618
|
+
type: "password";
|
|
783
619
|
identityProviderId: string;
|
|
784
620
|
issuer: string;
|
|
785
621
|
configUrl: string;
|
|
@@ -792,8 +628,8 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
792
628
|
clientSecret: string;
|
|
793
629
|
} | undefined;
|
|
794
630
|
} | {
|
|
795
|
-
type: "implicit";
|
|
796
631
|
clientId: string;
|
|
632
|
+
type: "implicit";
|
|
797
633
|
identityProviderId: string;
|
|
798
634
|
issuer: string;
|
|
799
635
|
configUrl: string;
|
|
@@ -804,9 +640,9 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
804
640
|
clientSecret: string;
|
|
805
641
|
} | undefined;
|
|
806
642
|
} | {
|
|
807
|
-
type: "client_credentials";
|
|
808
643
|
clientId: string;
|
|
809
644
|
clientSecret: string;
|
|
645
|
+
type: "client_credentials";
|
|
810
646
|
identityProviderId: string;
|
|
811
647
|
issuer: string;
|
|
812
648
|
configUrl: string;
|
|
@@ -816,6 +652,18 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
816
652
|
clientId: string;
|
|
817
653
|
clientSecret: string;
|
|
818
654
|
} | undefined;
|
|
655
|
+
} | {
|
|
656
|
+
clientId: string;
|
|
657
|
+
clientSecret: string;
|
|
658
|
+
type: "self_signed";
|
|
659
|
+
identityProviderId: string;
|
|
660
|
+
issuer: string;
|
|
661
|
+
audience: string;
|
|
662
|
+
scope: string;
|
|
663
|
+
admin?: {
|
|
664
|
+
clientId: string;
|
|
665
|
+
clientSecret: string;
|
|
666
|
+
} | undefined;
|
|
819
667
|
};
|
|
820
668
|
}>, "many">;
|
|
821
669
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -826,11 +674,11 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
826
674
|
database: string;
|
|
827
675
|
} | {
|
|
828
676
|
type: "postgres";
|
|
829
|
-
password: string;
|
|
830
677
|
database: string;
|
|
831
678
|
host: string;
|
|
832
679
|
port: number;
|
|
833
680
|
user: string;
|
|
681
|
+
password: string;
|
|
834
682
|
};
|
|
835
683
|
networks: {
|
|
836
684
|
name: string;
|
|
@@ -841,8 +689,8 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
841
689
|
baseUrl: string;
|
|
842
690
|
};
|
|
843
691
|
auth: {
|
|
844
|
-
type: "password";
|
|
845
692
|
clientId: string;
|
|
693
|
+
type: "password";
|
|
846
694
|
identityProviderId: string;
|
|
847
695
|
issuer: string;
|
|
848
696
|
configUrl: string;
|
|
@@ -855,8 +703,8 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
855
703
|
clientSecret: string;
|
|
856
704
|
} | undefined;
|
|
857
705
|
} | {
|
|
858
|
-
type: "implicit";
|
|
859
706
|
clientId: string;
|
|
707
|
+
type: "implicit";
|
|
860
708
|
identityProviderId: string;
|
|
861
709
|
issuer: string;
|
|
862
710
|
configUrl: string;
|
|
@@ -867,9 +715,9 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
867
715
|
clientSecret: string;
|
|
868
716
|
} | undefined;
|
|
869
717
|
} | {
|
|
870
|
-
type: "client_credentials";
|
|
871
718
|
clientId: string;
|
|
872
719
|
clientSecret: string;
|
|
720
|
+
type: "client_credentials";
|
|
873
721
|
identityProviderId: string;
|
|
874
722
|
issuer: string;
|
|
875
723
|
configUrl: string;
|
|
@@ -879,6 +727,18 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
879
727
|
clientId: string;
|
|
880
728
|
clientSecret: string;
|
|
881
729
|
} | undefined;
|
|
730
|
+
} | {
|
|
731
|
+
clientId: string;
|
|
732
|
+
clientSecret: string;
|
|
733
|
+
type: "self_signed";
|
|
734
|
+
identityProviderId: string;
|
|
735
|
+
issuer: string;
|
|
736
|
+
audience: string;
|
|
737
|
+
scope: string;
|
|
738
|
+
admin?: {
|
|
739
|
+
clientId: string;
|
|
740
|
+
clientSecret: string;
|
|
741
|
+
} | undefined;
|
|
882
742
|
};
|
|
883
743
|
}[];
|
|
884
744
|
}, {
|
|
@@ -889,11 +749,11 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
889
749
|
database: string;
|
|
890
750
|
} | {
|
|
891
751
|
type: "postgres";
|
|
892
|
-
password: string;
|
|
893
752
|
database: string;
|
|
894
753
|
host: string;
|
|
895
754
|
port: number;
|
|
896
755
|
user: string;
|
|
756
|
+
password: string;
|
|
897
757
|
};
|
|
898
758
|
networks: {
|
|
899
759
|
name: string;
|
|
@@ -904,8 +764,8 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
904
764
|
baseUrl: string;
|
|
905
765
|
};
|
|
906
766
|
auth: {
|
|
907
|
-
type: "password";
|
|
908
767
|
clientId: string;
|
|
768
|
+
type: "password";
|
|
909
769
|
identityProviderId: string;
|
|
910
770
|
issuer: string;
|
|
911
771
|
configUrl: string;
|
|
@@ -918,8 +778,8 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
918
778
|
clientSecret: string;
|
|
919
779
|
} | undefined;
|
|
920
780
|
} | {
|
|
921
|
-
type: "implicit";
|
|
922
781
|
clientId: string;
|
|
782
|
+
type: "implicit";
|
|
923
783
|
identityProviderId: string;
|
|
924
784
|
issuer: string;
|
|
925
785
|
configUrl: string;
|
|
@@ -930,9 +790,9 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
930
790
|
clientSecret: string;
|
|
931
791
|
} | undefined;
|
|
932
792
|
} | {
|
|
933
|
-
type: "client_credentials";
|
|
934
793
|
clientId: string;
|
|
935
794
|
clientSecret: string;
|
|
795
|
+
type: "client_credentials";
|
|
936
796
|
identityProviderId: string;
|
|
937
797
|
issuer: string;
|
|
938
798
|
configUrl: string;
|
|
@@ -942,16 +802,22 @@ export declare const storeConfigSchema: z.ZodObject<{
|
|
|
942
802
|
clientId: string;
|
|
943
803
|
clientSecret: string;
|
|
944
804
|
} | undefined;
|
|
805
|
+
} | {
|
|
806
|
+
clientId: string;
|
|
807
|
+
clientSecret: string;
|
|
808
|
+
type: "self_signed";
|
|
809
|
+
identityProviderId: string;
|
|
810
|
+
issuer: string;
|
|
811
|
+
audience: string;
|
|
812
|
+
scope: string;
|
|
813
|
+
admin?: {
|
|
814
|
+
clientId: string;
|
|
815
|
+
clientSecret: string;
|
|
816
|
+
} | undefined;
|
|
945
817
|
};
|
|
946
818
|
}[];
|
|
947
819
|
}>;
|
|
948
820
|
export type StoreConfig = z.infer<typeof storeConfigSchema>;
|
|
949
|
-
export type Auth = z.infer<typeof authSchema>;
|
|
950
821
|
export type Network = z.infer<typeof networkSchema>;
|
|
951
|
-
export type ImplicitAuth = z.infer<typeof implicitAuthSchema>;
|
|
952
|
-
export type PasswordAuth = z.infer<typeof passwordAuthSchema>;
|
|
953
|
-
export type ClientCredentials = z.infer<typeof clientCredentials>;
|
|
954
|
-
export type ClientCredentialAuth = z.infer<typeof clientCredentialAuthSchema>;
|
|
955
822
|
export type LedgerApi = z.infer<typeof ledgerApiSchema>;
|
|
956
|
-
export {};
|
|
957
823
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,eAAe;;;;;;EAE1B,CAAA;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOxB,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB5B,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAC3D,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AACnD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var coreWalletAuth = require('@canton-network/core-wallet-auth');
|
|
4
|
+
var zod = require('zod');
|
|
5
|
+
|
|
6
|
+
// src/Store.ts
|
|
7
|
+
var AddressType = /* @__PURE__ */ ((AddressType2) => {
|
|
8
|
+
AddressType2["PaperAddress"] = "PaperAddress";
|
|
9
|
+
AddressType2["CCSPAddress"] = "CCSPAddress";
|
|
10
|
+
return AddressType2;
|
|
11
|
+
})(AddressType || {});
|
|
12
|
+
var ledgerApiSchema = zod.z.object({
|
|
13
|
+
baseUrl: zod.z.string().url()
|
|
14
|
+
});
|
|
15
|
+
var networkSchema = zod.z.object({
|
|
16
|
+
name: zod.z.string(),
|
|
17
|
+
chainId: zod.z.string(),
|
|
18
|
+
synchronizerId: zod.z.string(),
|
|
19
|
+
description: zod.z.string(),
|
|
20
|
+
ledgerApi: ledgerApiSchema,
|
|
21
|
+
auth: coreWalletAuth.authSchema
|
|
22
|
+
});
|
|
23
|
+
var storeConfigSchema = zod.z.object({
|
|
24
|
+
connection: zod.z.discriminatedUnion("type", [
|
|
25
|
+
zod.z.object({
|
|
26
|
+
type: zod.z.literal("memory")
|
|
27
|
+
}),
|
|
28
|
+
zod.z.object({
|
|
29
|
+
type: zod.z.literal("sqlite"),
|
|
30
|
+
database: zod.z.string()
|
|
31
|
+
}),
|
|
32
|
+
zod.z.object({
|
|
33
|
+
type: zod.z.literal("postgres"),
|
|
34
|
+
host: zod.z.string(),
|
|
35
|
+
port: zod.z.number(),
|
|
36
|
+
user: zod.z.string(),
|
|
37
|
+
password: zod.z.string(),
|
|
38
|
+
database: zod.z.string()
|
|
39
|
+
})
|
|
40
|
+
]),
|
|
41
|
+
networks: zod.z.array(networkSchema)
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
exports.AddressType = AddressType;
|
|
45
|
+
exports.ledgerApiSchema = ledgerApiSchema;
|
|
46
|
+
exports.networkSchema = networkSchema;
|
|
47
|
+
exports.storeConfigSchema = storeConfigSchema;
|
|
48
|
+
//# sourceMappingURL=index.cjs.map
|
|
49
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Store.ts","../src/config/schema.ts"],"names":["AddressType","z","authSchema"],"mappings":";;;;;;AAMO,IAAK,WAAA,qBAAAA,YAAAA,KAAL;AACH,EAAAA,aAAA,cAAA,CAAA,GAAe,cAAA;AACf,EAAAA,aAAA,aAAA,CAAA,GAAc,aAAA;AAFN,EAAA,OAAAA,YAAAA;AAAA,CAAA,EAAA,WAAA,IAAA,EAAA;ACAL,IAAM,eAAA,GAAkBC,MAAE,MAAA,CAAO;AAAA,EACpC,OAAA,EAASA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA;AACxB,CAAC;AAEM,IAAM,aAAA,GAAgBA,MAAE,MAAA,CAAO;AAAA,EAClC,IAAA,EAAMA,MAAE,MAAA,EAAO;AAAA,EACf,OAAA,EAASA,MAAE,MAAA,EAAO;AAAA,EAClB,cAAA,EAAgBA,MAAE,MAAA,EAAO;AAAA,EACzB,WAAA,EAAaA,MAAE,MAAA,EAAO;AAAA,EACtB,SAAA,EAAW,eAAA;AAAA,EACX,IAAA,EAAMC;AACV,CAAC;AAEM,IAAM,iBAAA,GAAoBD,MAAE,MAAA,CAAO;AAAA,EACtC,UAAA,EAAYA,KAAA,CAAE,kBAAA,CAAmB,MAAA,EAAQ;AAAA,IACrCA,MAAE,MAAA,CAAO;AAAA,MACL,IAAA,EAAMA,KAAA,CAAE,OAAA,CAAQ,QAAQ;AAAA,KAC3B,CAAA;AAAA,IACDA,MAAE,MAAA,CAAO;AAAA,MACL,IAAA,EAAMA,KAAA,CAAE,OAAA,CAAQ,QAAQ,CAAA;AAAA,MACxB,QAAA,EAAUA,MAAE,MAAA;AAAO,KACtB,CAAA;AAAA,IACDA,MAAE,MAAA,CAAO;AAAA,MACL,IAAA,EAAMA,KAAA,CAAE,OAAA,CAAQ,UAAU,CAAA;AAAA,MAC1B,IAAA,EAAMA,MAAE,MAAA,EAAO;AAAA,MACf,IAAA,EAAMA,MAAE,MAAA,EAAO;AAAA,MACf,IAAA,EAAMA,MAAE,MAAA,EAAO;AAAA,MACf,QAAA,EAAUA,MAAE,MAAA,EAAO;AAAA,MACnB,QAAA,EAAUA,MAAE,MAAA;AAAO,KACtB;AAAA,GACJ,CAAA;AAAA,EACD,QAAA,EAAUA,KAAA,CAAE,KAAA,CAAM,aAAa;AACnC,CAAC","file":"index.cjs","sourcesContent":["// Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n// Account\n\nimport { Network } from './config/schema'\n\nexport enum AddressType {\n PaperAddress = 'PaperAddress',\n CCSPAddress = 'CCSPAddress',\n}\n\nexport type PartyId = string\n\nexport interface SigningDriver {\n signingDriverId: string\n}\n\nexport interface SigningProvider {\n signingProviderId: string\n privateKey?: string\n addressType: AddressType\n}\n\nexport interface WalletFilter {\n chainIds?: string[]\n signingProviderIds?: string[]\n}\n\nexport interface Wallet {\n primary: boolean\n partyId: PartyId\n hint: string\n publicKey: string\n namespace: string\n chainId: string\n signingProviderId: string\n // hosted: [network]\n}\n\n// Session management\n\nexport interface Session {\n network: string\n accessToken: string\n}\n\nexport interface Transaction {\n status: 'pending' | 'signed' | 'executed' | 'failed'\n commandId: string\n preparedTransaction: string\n preparedTransactionHash: string\n payload?: unknown\n}\n\n// Store interface for managing wallets, sessions, networks, and transactions\n\nexport interface Store {\n // Wallet methods\n getWallets(filter?: WalletFilter): Promise<Array<Wallet>>\n getPrimaryWallet(): Promise<Wallet | undefined>\n setPrimaryWallet(partyId: PartyId): Promise<void>\n addWallet(wallet: Wallet): Promise<void>\n // removeWallet(partyId: Wallet): Promise<void>\n\n // Session methods\n getSession(): Promise<Session | undefined>\n setSession(session: Session): Promise<void>\n removeSession(): Promise<void>\n\n // Network methods\n getNetwork(chainId: string): Promise<Network>\n getCurrentNetwork(): Promise<Network>\n listNetworks(): Promise<Array<Network>>\n updateNetwork(network: Network): Promise<void>\n addNetwork(network: Network): Promise<void>\n removeNetwork(chainId: string): Promise<void>\n\n // Transaction methods\n setTransaction(tx: Transaction): Promise<void>\n getTransaction(commandId: string): Promise<Transaction | undefined>\n}\n","// Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { authSchema } from '@canton-network/core-wallet-auth'\nimport { z } from 'zod'\n\nexport const ledgerApiSchema = z.object({\n baseUrl: z.string().url(),\n})\n\nexport const networkSchema = z.object({\n name: z.string(),\n chainId: z.string(),\n synchronizerId: z.string(),\n description: z.string(),\n ledgerApi: ledgerApiSchema,\n auth: authSchema,\n})\n\nexport const storeConfigSchema = z.object({\n connection: z.discriminatedUnion('type', [\n z.object({\n type: z.literal('memory'),\n }),\n z.object({\n type: z.literal('sqlite'),\n database: z.string(),\n }),\n z.object({\n type: z.literal('postgres'),\n host: z.string(),\n port: z.number(),\n user: z.string(),\n password: z.string(),\n database: z.string(),\n }),\n ]),\n networks: z.array(networkSchema),\n})\n\nexport type StoreConfig = z.infer<typeof storeConfigSchema>\nexport type Network = z.infer<typeof networkSchema>\nexport type LedgerApi = z.infer<typeof ledgerApiSchema>\n"]}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { authSchema } from '@canton-network/core-wallet-auth';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
// src/Store.ts
|
|
5
|
+
var AddressType = /* @__PURE__ */ ((AddressType2) => {
|
|
6
|
+
AddressType2["PaperAddress"] = "PaperAddress";
|
|
7
|
+
AddressType2["CCSPAddress"] = "CCSPAddress";
|
|
8
|
+
return AddressType2;
|
|
9
|
+
})(AddressType || {});
|
|
10
|
+
var ledgerApiSchema = z.object({
|
|
11
|
+
baseUrl: z.string().url()
|
|
12
|
+
});
|
|
13
|
+
var networkSchema = z.object({
|
|
14
|
+
name: z.string(),
|
|
15
|
+
chainId: z.string(),
|
|
16
|
+
synchronizerId: z.string(),
|
|
17
|
+
description: z.string(),
|
|
18
|
+
ledgerApi: ledgerApiSchema,
|
|
19
|
+
auth: authSchema
|
|
20
|
+
});
|
|
21
|
+
var storeConfigSchema = z.object({
|
|
22
|
+
connection: z.discriminatedUnion("type", [
|
|
23
|
+
z.object({
|
|
24
|
+
type: z.literal("memory")
|
|
25
|
+
}),
|
|
26
|
+
z.object({
|
|
27
|
+
type: z.literal("sqlite"),
|
|
28
|
+
database: z.string()
|
|
29
|
+
}),
|
|
30
|
+
z.object({
|
|
31
|
+
type: z.literal("postgres"),
|
|
32
|
+
host: z.string(),
|
|
33
|
+
port: z.number(),
|
|
34
|
+
user: z.string(),
|
|
35
|
+
password: z.string(),
|
|
36
|
+
database: z.string()
|
|
37
|
+
})
|
|
38
|
+
]),
|
|
39
|
+
networks: z.array(networkSchema)
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export { AddressType, ledgerApiSchema, networkSchema, storeConfigSchema };
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Store.ts","../src/config/schema.ts"],"names":["AddressType"],"mappings":";;;;AAMO,IAAK,WAAA,qBAAAA,YAAAA,KAAL;AACH,EAAAA,aAAA,cAAA,CAAA,GAAe,cAAA;AACf,EAAAA,aAAA,aAAA,CAAA,GAAc,aAAA;AAFN,EAAA,OAAAA,YAAAA;AAAA,CAAA,EAAA,WAAA,IAAA,EAAA;ACAL,IAAM,eAAA,GAAkB,EAAE,MAAA,CAAO;AAAA,EACpC,OAAA,EAAS,CAAA,CAAE,MAAA,EAAO,CAAE,GAAA;AACxB,CAAC;AAEM,IAAM,aAAA,GAAgB,EAAE,MAAA,CAAO;AAAA,EAClC,IAAA,EAAM,EAAE,MAAA,EAAO;AAAA,EACf,OAAA,EAAS,EAAE,MAAA,EAAO;AAAA,EAClB,cAAA,EAAgB,EAAE,MAAA,EAAO;AAAA,EACzB,WAAA,EAAa,EAAE,MAAA,EAAO;AAAA,EACtB,SAAA,EAAW,eAAA;AAAA,EACX,IAAA,EAAM;AACV,CAAC;AAEM,IAAM,iBAAA,GAAoB,EAAE,MAAA,CAAO;AAAA,EACtC,UAAA,EAAY,CAAA,CAAE,kBAAA,CAAmB,MAAA,EAAQ;AAAA,IACrC,EAAE,MAAA,CAAO;AAAA,MACL,IAAA,EAAM,CAAA,CAAE,OAAA,CAAQ,QAAQ;AAAA,KAC3B,CAAA;AAAA,IACD,EAAE,MAAA,CAAO;AAAA,MACL,IAAA,EAAM,CAAA,CAAE,OAAA,CAAQ,QAAQ,CAAA;AAAA,MACxB,QAAA,EAAU,EAAE,MAAA;AAAO,KACtB,CAAA;AAAA,IACD,EAAE,MAAA,CAAO;AAAA,MACL,IAAA,EAAM,CAAA,CAAE,OAAA,CAAQ,UAAU,CAAA;AAAA,MAC1B,IAAA,EAAM,EAAE,MAAA,EAAO;AAAA,MACf,IAAA,EAAM,EAAE,MAAA,EAAO;AAAA,MACf,IAAA,EAAM,EAAE,MAAA,EAAO;AAAA,MACf,QAAA,EAAU,EAAE,MAAA,EAAO;AAAA,MACnB,QAAA,EAAU,EAAE,MAAA;AAAO,KACtB;AAAA,GACJ,CAAA;AAAA,EACD,QAAA,EAAU,CAAA,CAAE,KAAA,CAAM,aAAa;AACnC,CAAC","file":"index.js","sourcesContent":["// Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n// Account\n\nimport { Network } from './config/schema'\n\nexport enum AddressType {\n PaperAddress = 'PaperAddress',\n CCSPAddress = 'CCSPAddress',\n}\n\nexport type PartyId = string\n\nexport interface SigningDriver {\n signingDriverId: string\n}\n\nexport interface SigningProvider {\n signingProviderId: string\n privateKey?: string\n addressType: AddressType\n}\n\nexport interface WalletFilter {\n chainIds?: string[]\n signingProviderIds?: string[]\n}\n\nexport interface Wallet {\n primary: boolean\n partyId: PartyId\n hint: string\n publicKey: string\n namespace: string\n chainId: string\n signingProviderId: string\n // hosted: [network]\n}\n\n// Session management\n\nexport interface Session {\n network: string\n accessToken: string\n}\n\nexport interface Transaction {\n status: 'pending' | 'signed' | 'executed' | 'failed'\n commandId: string\n preparedTransaction: string\n preparedTransactionHash: string\n payload?: unknown\n}\n\n// Store interface for managing wallets, sessions, networks, and transactions\n\nexport interface Store {\n // Wallet methods\n getWallets(filter?: WalletFilter): Promise<Array<Wallet>>\n getPrimaryWallet(): Promise<Wallet | undefined>\n setPrimaryWallet(partyId: PartyId): Promise<void>\n addWallet(wallet: Wallet): Promise<void>\n // removeWallet(partyId: Wallet): Promise<void>\n\n // Session methods\n getSession(): Promise<Session | undefined>\n setSession(session: Session): Promise<void>\n removeSession(): Promise<void>\n\n // Network methods\n getNetwork(chainId: string): Promise<Network>\n getCurrentNetwork(): Promise<Network>\n listNetworks(): Promise<Array<Network>>\n updateNetwork(network: Network): Promise<void>\n addNetwork(network: Network): Promise<void>\n removeNetwork(chainId: string): Promise<void>\n\n // Transaction methods\n setTransaction(tx: Transaction): Promise<void>\n getTransaction(commandId: string): Promise<Transaction | undefined>\n}\n","// Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { authSchema } from '@canton-network/core-wallet-auth'\nimport { z } from 'zod'\n\nexport const ledgerApiSchema = z.object({\n baseUrl: z.string().url(),\n})\n\nexport const networkSchema = z.object({\n name: z.string(),\n chainId: z.string(),\n synchronizerId: z.string(),\n description: z.string(),\n ledgerApi: ledgerApiSchema,\n auth: authSchema,\n})\n\nexport const storeConfigSchema = z.object({\n connection: z.discriminatedUnion('type', [\n z.object({\n type: z.literal('memory'),\n }),\n z.object({\n type: z.literal('sqlite'),\n database: z.string(),\n }),\n z.object({\n type: z.literal('postgres'),\n host: z.string(),\n port: z.number(),\n user: z.string(),\n password: z.string(),\n database: z.string(),\n }),\n ]),\n networks: z.array(networkSchema),\n})\n\nexport type StoreConfig = z.infer<typeof storeConfigSchema>\nexport type Network = z.infer<typeof networkSchema>\nexport type LedgerApi = z.infer<typeof ledgerApiSchema>\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canton-network/core-wallet-store",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The Store API provides persistency for the Wallet Gateway",
|
|
6
6
|
"repository": "github:hyperledger-labs/splice-wallet-kernel",
|
|
@@ -10,13 +10,14 @@
|
|
|
10
10
|
"main": "./dist/index.js",
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"scripts": {
|
|
13
|
-
"build": "tsc -
|
|
14
|
-
"dev": "tsc -
|
|
13
|
+
"build": "tsup && tsc -p tsconfig.types.json",
|
|
14
|
+
"dev": "tsup --watch --onSuccess \"tsc -p tsconfig.types.json\"",
|
|
15
15
|
"flatpack": "yarn pack --out \"$FLATPACK_OUTDIR\"",
|
|
16
16
|
"clean": "tsc -b --clean; rm -rf dist",
|
|
17
|
-
"test": "
|
|
17
|
+
"test": "jest --passWithNoTests"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
+
"@canton-network/core-wallet-auth": "^0.11.0",
|
|
20
21
|
"zod": "^3.25.64"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
"jest": "^30.0.0",
|
|
28
29
|
"ts-jest": "^29.4.0",
|
|
29
30
|
"ts-jest-resolver": "^2.0.1",
|
|
31
|
+
"tsup": "^8.5.0",
|
|
30
32
|
"typescript": "^5.8.3"
|
|
31
33
|
},
|
|
32
34
|
"files": [
|
package/dist/Store.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
// Account
|
|
4
|
-
export var AddressType;
|
|
5
|
-
(function (AddressType) {
|
|
6
|
-
AddressType["PaperAddress"] = "PaperAddress";
|
|
7
|
-
AddressType["CCSPAddress"] = "CCSPAddress";
|
|
8
|
-
})(AddressType || (AddressType = {}));
|
package/dist/config/schema.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
export const ledgerApiSchema = z.object({
|
|
5
|
-
baseUrl: z.string().url(),
|
|
6
|
-
});
|
|
7
|
-
const clientCredentials = z.object({
|
|
8
|
-
clientId: z.string(),
|
|
9
|
-
clientSecret: z.string(),
|
|
10
|
-
});
|
|
11
|
-
const passwordAuthSchema = z.object({
|
|
12
|
-
identityProviderId: z.string(),
|
|
13
|
-
type: z.literal('password'),
|
|
14
|
-
issuer: z.string(),
|
|
15
|
-
configUrl: z.string(),
|
|
16
|
-
audience: z.string(),
|
|
17
|
-
tokenUrl: z.string(),
|
|
18
|
-
grantType: z.string(),
|
|
19
|
-
scope: z.string(),
|
|
20
|
-
clientId: z.string(),
|
|
21
|
-
admin: z.optional(clientCredentials),
|
|
22
|
-
});
|
|
23
|
-
const implicitAuthSchema = z.object({
|
|
24
|
-
identityProviderId: z.string(),
|
|
25
|
-
type: z.literal('implicit'),
|
|
26
|
-
issuer: z.string(),
|
|
27
|
-
configUrl: z.string(),
|
|
28
|
-
audience: z.string(),
|
|
29
|
-
scope: z.string(),
|
|
30
|
-
clientId: z.string(),
|
|
31
|
-
admin: z.optional(clientCredentials),
|
|
32
|
-
});
|
|
33
|
-
const clientCredentialAuthSchema = z.object({
|
|
34
|
-
identityProviderId: z.string(),
|
|
35
|
-
type: z.literal('client_credentials'),
|
|
36
|
-
issuer: z.string(),
|
|
37
|
-
configUrl: z.string(),
|
|
38
|
-
audience: z.string(),
|
|
39
|
-
scope: z.string(),
|
|
40
|
-
clientId: z.string(),
|
|
41
|
-
clientSecret: z.string(),
|
|
42
|
-
admin: z.optional(clientCredentials),
|
|
43
|
-
});
|
|
44
|
-
export const authSchema = z.discriminatedUnion('type', [
|
|
45
|
-
passwordAuthSchema,
|
|
46
|
-
implicitAuthSchema,
|
|
47
|
-
clientCredentialAuthSchema,
|
|
48
|
-
]);
|
|
49
|
-
export const networkSchema = z.object({
|
|
50
|
-
name: z.string(),
|
|
51
|
-
chainId: z.string(),
|
|
52
|
-
synchronizerId: z.string(),
|
|
53
|
-
description: z.string(),
|
|
54
|
-
ledgerApi: ledgerApiSchema,
|
|
55
|
-
auth: authSchema,
|
|
56
|
-
});
|
|
57
|
-
export const storeConfigSchema = z.object({
|
|
58
|
-
connection: z.discriminatedUnion('type', [
|
|
59
|
-
z.object({
|
|
60
|
-
type: z.literal('memory'),
|
|
61
|
-
}),
|
|
62
|
-
z.object({
|
|
63
|
-
type: z.literal('sqlite'),
|
|
64
|
-
database: z.string(),
|
|
65
|
-
}),
|
|
66
|
-
z.object({
|
|
67
|
-
type: z.literal('postgres'),
|
|
68
|
-
host: z.string(),
|
|
69
|
-
port: z.number(),
|
|
70
|
-
user: z.string(),
|
|
71
|
-
password: z.string(),
|
|
72
|
-
database: z.string(),
|
|
73
|
-
}),
|
|
74
|
-
]),
|
|
75
|
-
networks: z.array(networkSchema),
|
|
76
|
-
});
|