@canton-network/core-wallet-store 0.10.0 → 0.11.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/Store.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { Idp } from '@canton-network/core-wallet-auth';
1
2
  import { Network } from './config/schema';
2
3
  export declare enum AddressType {
3
4
  PaperAddress = "PaperAddress",
@@ -13,17 +14,24 @@ export interface SigningProvider {
13
14
  addressType: AddressType;
14
15
  }
15
16
  export interface WalletFilter {
16
- chainIds?: string[];
17
+ networkIds?: string[];
17
18
  signingProviderIds?: string[];
18
19
  }
20
+ export interface UpdateWallet {
21
+ status: string;
22
+ partyId: string;
23
+ }
19
24
  export interface Wallet {
20
25
  primary: boolean;
21
26
  partyId: PartyId;
22
27
  hint: string;
23
28
  publicKey: string;
24
29
  namespace: string;
25
- chainId: string;
30
+ networkId: string;
26
31
  signingProviderId: string;
32
+ externalTxId?: string;
33
+ topologyTransactions?: string;
34
+ status?: string;
27
35
  }
28
36
  export interface Session {
29
37
  network: string;
@@ -41,15 +49,22 @@ export interface Store {
41
49
  getPrimaryWallet(): Promise<Wallet | undefined>;
42
50
  setPrimaryWallet(partyId: PartyId): Promise<void>;
43
51
  addWallet(wallet: Wallet): Promise<void>;
52
+ updateWallet(params: UpdateWallet): Promise<void>;
53
+ removeWallet(partyId: PartyId): Promise<void>;
44
54
  getSession(): Promise<Session | undefined>;
45
55
  setSession(session: Session): Promise<void>;
46
56
  removeSession(): Promise<void>;
47
- getNetwork(chainId: string): Promise<Network>;
57
+ getIdp(idpId: string): Promise<Idp>;
58
+ listIdps(): Promise<Array<Idp>>;
59
+ updateIdp(idp: Idp): Promise<void>;
60
+ addIdp(idp: Idp): Promise<void>;
61
+ removeIdp(idpId: string): Promise<void>;
62
+ getNetwork(networkId: string): Promise<Network>;
48
63
  getCurrentNetwork(): Promise<Network>;
49
64
  listNetworks(): Promise<Array<Network>>;
50
65
  updateNetwork(network: Network): Promise<void>;
51
66
  addNetwork(network: Network): Promise<void>;
52
- removeNetwork(chainId: string): Promise<void>;
67
+ removeNetwork(networkId: string): Promise<void>;
53
68
  setTransaction(tx: Transaction): Promise<void>;
54
69
  getTransaction(commandId: string): Promise<Transaction | undefined>;
55
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Store.d.ts","sourceRoot":"","sources":["../src/Store.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAEzC,oBAAY,WAAW;IACnB,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;CAC9B;AAED,MAAM,MAAM,OAAO,GAAG,MAAM,CAAA;AAE5B,MAAM,WAAW,aAAa;IAC1B,eAAe,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,eAAe;IAC5B,iBAAiB,EAAE,MAAM,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,WAAW,CAAA;CAC3B;AAED,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;CAChC;AAED,MAAM,WAAW,MAAM;IACnB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,iBAAiB,EAAE,MAAM,CAAA;CAE5B;AAID,MAAM,WAAW,OAAO;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,WAAW;IACxB,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAA;IACpD,SAAS,EAAE,MAAM,CAAA;IACjB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,uBAAuB,E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,CAAC,CAAA;IACvC,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3C,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAG/C,cAAc,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9C,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAA;CACtE"}
@@ -7,10 +7,11 @@ export declare const ledgerApiSchema: z.ZodObject<{
7
7
  baseUrl: string;
8
8
  }>;
9
9
  export declare const networkSchema: z.ZodObject<{
10
+ id: z.ZodString;
10
11
  name: z.ZodString;
11
- chainId: z.ZodString;
12
- synchronizerId: z.ZodString;
13
12
  description: z.ZodString;
13
+ synchronizerId: z.ZodString;
14
+ identityProviderId: z.ZodString;
14
15
  ledgerApi: z.ZodObject<{
15
16
  baseUrl: z.ZodString;
16
17
  }, "strip", z.ZodTypeAny, {
@@ -18,304 +19,210 @@ export declare const networkSchema: z.ZodObject<{
18
19
  }, {
19
20
  baseUrl: string;
20
21
  }>;
21
- auth: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
22
- identityProviderId: z.ZodString;
23
- type: z.ZodLiteral<"password">;
24
- issuer: z.ZodString;
25
- configUrl: z.ZodString;
22
+ auth: z.ZodDiscriminatedUnion<"method", [z.ZodObject<{
23
+ method: z.ZodLiteral<"authorization_code">;
26
24
  audience: z.ZodString;
27
- tokenUrl: z.ZodString;
28
- grantType: z.ZodString;
29
25
  scope: z.ZodString;
30
26
  clientId: z.ZodString;
31
- admin: z.ZodOptional<z.ZodObject<{
32
- clientId: z.ZodString;
33
- clientSecret: z.ZodString;
34
- }, "strip", z.ZodTypeAny, {
35
- clientId: string;
36
- clientSecret: string;
37
- }, {
38
- clientId: string;
39
- clientSecret: string;
40
- }>>;
41
27
  }, "strip", z.ZodTypeAny, {
42
- clientId: string;
43
- type: "password";
44
- identityProviderId: string;
45
- issuer: string;
46
- configUrl: string;
28
+ method: "authorization_code";
47
29
  audience: string;
48
- tokenUrl: string;
49
- grantType: string;
50
30
  scope: string;
51
- admin?: {
52
- clientId: string;
53
- clientSecret: string;
54
- } | undefined;
55
- }, {
56
31
  clientId: string;
57
- type: "password";
58
- identityProviderId: string;
59
- issuer: string;
60
- configUrl: string;
32
+ }, {
33
+ method: "authorization_code";
61
34
  audience: string;
62
- tokenUrl: string;
63
- grantType: string;
64
35
  scope: string;
65
- admin?: {
66
- clientId: string;
67
- clientSecret: string;
68
- } | undefined;
36
+ clientId: string;
69
37
  }>, z.ZodObject<{
70
- identityProviderId: z.ZodString;
71
- type: z.ZodLiteral<"implicit">;
72
- issuer: z.ZodString;
73
- configUrl: z.ZodString;
38
+ method: z.ZodLiteral<"client_credentials">;
74
39
  audience: z.ZodString;
75
40
  scope: z.ZodString;
76
41
  clientId: z.ZodString;
77
- admin: z.ZodOptional<z.ZodObject<{
78
- clientId: z.ZodString;
79
- clientSecret: z.ZodString;
80
- }, "strip", z.ZodTypeAny, {
81
- clientId: string;
82
- clientSecret: string;
83
- }, {
84
- clientId: string;
85
- clientSecret: string;
86
- }>>;
42
+ clientSecret: z.ZodString;
87
43
  }, "strip", z.ZodTypeAny, {
88
- clientId: string;
89
- type: "implicit";
90
- identityProviderId: string;
91
- issuer: string;
92
- configUrl: string;
44
+ method: "client_credentials";
93
45
  audience: string;
94
46
  scope: string;
95
- admin?: {
96
- clientId: string;
97
- clientSecret: string;
98
- } | undefined;
99
- }, {
100
47
  clientId: string;
101
- type: "implicit";
102
- identityProviderId: string;
103
- issuer: string;
104
- configUrl: string;
48
+ clientSecret: string;
49
+ }, {
50
+ method: "client_credentials";
105
51
  audience: string;
106
52
  scope: string;
107
- admin?: {
108
- clientId: string;
109
- clientSecret: string;
110
- } | undefined;
53
+ clientId: string;
54
+ clientSecret: string;
111
55
  }>, z.ZodObject<{
112
- identityProviderId: z.ZodString;
113
- type: z.ZodLiteral<"client_credentials">;
56
+ method: z.ZodLiteral<"self_signed">;
114
57
  issuer: z.ZodString;
115
- configUrl: z.ZodString;
116
58
  audience: z.ZodString;
117
59
  scope: z.ZodString;
118
60
  clientId: z.ZodString;
119
61
  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
62
  }, "strip", z.ZodTypeAny, {
63
+ method: "self_signed";
64
+ audience: string;
65
+ scope: string;
131
66
  clientId: string;
132
67
  clientSecret: string;
133
- type: "client_credentials";
134
- identityProviderId: string;
135
68
  issuer: string;
136
- configUrl: string;
69
+ }, {
70
+ method: "self_signed";
137
71
  audience: string;
138
72
  scope: string;
139
- admin?: {
140
- clientId: string;
141
- clientSecret: string;
142
- } | undefined;
143
- }, {
144
73
  clientId: string;
145
74
  clientSecret: string;
146
- type: "client_credentials";
147
- identityProviderId: string;
148
75
  issuer: string;
149
- configUrl: string;
76
+ }>]>;
77
+ adminAuth: z.ZodOptional<z.ZodDiscriminatedUnion<"method", [z.ZodObject<{
78
+ method: z.ZodLiteral<"authorization_code">;
79
+ audience: z.ZodString;
80
+ scope: z.ZodString;
81
+ clientId: z.ZodString;
82
+ }, "strip", z.ZodTypeAny, {
83
+ method: "authorization_code";
150
84
  audience: string;
151
85
  scope: string;
152
- admin?: {
153
- clientId: string;
154
- clientSecret: string;
155
- } | undefined;
86
+ clientId: string;
87
+ }, {
88
+ method: "authorization_code";
89
+ audience: string;
90
+ scope: string;
91
+ clientId: string;
156
92
  }>, z.ZodObject<{
157
- identityProviderId: z.ZodString;
158
- type: z.ZodLiteral<"self_signed">;
159
- issuer: z.ZodString;
93
+ method: z.ZodLiteral<"client_credentials">;
160
94
  audience: z.ZodString;
161
95
  scope: z.ZodString;
162
96
  clientId: z.ZodString;
163
97
  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
98
  }, "strip", z.ZodTypeAny, {
99
+ method: "client_credentials";
100
+ audience: string;
101
+ scope: string;
175
102
  clientId: string;
176
103
  clientSecret: string;
177
- type: "self_signed";
178
- identityProviderId: string;
179
- issuer: string;
104
+ }, {
105
+ method: "client_credentials";
106
+ audience: string;
107
+ scope: string;
108
+ clientId: string;
109
+ clientSecret: string;
110
+ }>, z.ZodObject<{
111
+ method: z.ZodLiteral<"self_signed">;
112
+ issuer: z.ZodString;
113
+ audience: z.ZodString;
114
+ scope: z.ZodString;
115
+ clientId: z.ZodString;
116
+ clientSecret: z.ZodString;
117
+ }, "strip", z.ZodTypeAny, {
118
+ method: "self_signed";
180
119
  audience: string;
181
120
  scope: string;
182
- admin?: {
183
- clientId: string;
184
- clientSecret: string;
185
- } | undefined;
186
- }, {
187
121
  clientId: string;
188
122
  clientSecret: string;
189
- type: "self_signed";
190
- identityProviderId: string;
191
123
  issuer: string;
124
+ }, {
125
+ method: "self_signed";
192
126
  audience: string;
193
127
  scope: string;
194
- admin?: {
195
- clientId: string;
196
- clientSecret: string;
197
- } | undefined;
198
- }>]>;
128
+ clientId: string;
129
+ clientSecret: string;
130
+ issuer: string;
131
+ }>]>>;
199
132
  }, "strip", z.ZodTypeAny, {
133
+ id: string;
200
134
  name: string;
201
- chainId: string;
202
- synchronizerId: string;
203
135
  description: string;
136
+ synchronizerId: string;
137
+ identityProviderId: string;
204
138
  ledgerApi: {
205
139
  baseUrl: string;
206
140
  };
207
141
  auth: {
208
- clientId: string;
209
- type: "password";
210
- identityProviderId: string;
211
- issuer: string;
212
- configUrl: string;
142
+ method: "authorization_code";
213
143
  audience: string;
214
- tokenUrl: string;
215
- grantType: string;
216
144
  scope: string;
217
- admin?: {
218
- clientId: string;
219
- clientSecret: string;
220
- } | undefined;
221
- } | {
222
145
  clientId: string;
223
- type: "implicit";
224
- identityProviderId: string;
225
- issuer: string;
226
- configUrl: string;
146
+ } | {
147
+ method: "client_credentials";
227
148
  audience: string;
228
149
  scope: string;
229
- admin?: {
230
- clientId: string;
231
- clientSecret: string;
232
- } | undefined;
150
+ clientId: string;
151
+ clientSecret: string;
233
152
  } | {
153
+ method: "self_signed";
154
+ audience: string;
155
+ scope: string;
234
156
  clientId: string;
235
157
  clientSecret: string;
236
- type: "client_credentials";
237
- identityProviderId: string;
238
158
  issuer: string;
239
- configUrl: string;
159
+ };
160
+ adminAuth?: {
161
+ method: "authorization_code";
240
162
  audience: string;
241
163
  scope: string;
242
- admin?: {
243
- clientId: string;
244
- clientSecret: string;
245
- } | undefined;
164
+ clientId: string;
246
165
  } | {
166
+ method: "client_credentials";
167
+ audience: string;
168
+ scope: string;
247
169
  clientId: string;
248
170
  clientSecret: string;
249
- type: "self_signed";
250
- identityProviderId: string;
251
- issuer: string;
171
+ } | {
172
+ method: "self_signed";
252
173
  audience: string;
253
174
  scope: string;
254
- admin?: {
255
- clientId: string;
256
- clientSecret: string;
257
- } | undefined;
258
- };
175
+ clientId: string;
176
+ clientSecret: string;
177
+ issuer: string;
178
+ } | undefined;
259
179
  }, {
180
+ id: string;
260
181
  name: string;
261
- chainId: string;
262
- synchronizerId: string;
263
182
  description: string;
183
+ synchronizerId: string;
184
+ identityProviderId: string;
264
185
  ledgerApi: {
265
186
  baseUrl: string;
266
187
  };
267
188
  auth: {
268
- clientId: string;
269
- type: "password";
270
- identityProviderId: string;
271
- issuer: string;
272
- configUrl: string;
189
+ method: "authorization_code";
273
190
  audience: string;
274
- tokenUrl: string;
275
- grantType: string;
276
191
  scope: string;
277
- admin?: {
278
- clientId: string;
279
- clientSecret: string;
280
- } | undefined;
281
- } | {
282
192
  clientId: string;
283
- type: "implicit";
284
- identityProviderId: string;
285
- issuer: string;
286
- configUrl: string;
193
+ } | {
194
+ method: "client_credentials";
287
195
  audience: string;
288
196
  scope: string;
289
- admin?: {
290
- clientId: string;
291
- clientSecret: string;
292
- } | undefined;
197
+ clientId: string;
198
+ clientSecret: string;
293
199
  } | {
200
+ method: "self_signed";
201
+ audience: string;
202
+ scope: string;
294
203
  clientId: string;
295
204
  clientSecret: string;
296
- type: "client_credentials";
297
- identityProviderId: string;
298
205
  issuer: string;
299
- configUrl: string;
206
+ };
207
+ adminAuth?: {
208
+ method: "authorization_code";
300
209
  audience: string;
301
210
  scope: string;
302
- admin?: {
303
- clientId: string;
304
- clientSecret: string;
305
- } | undefined;
211
+ clientId: string;
306
212
  } | {
213
+ method: "client_credentials";
214
+ audience: string;
215
+ scope: string;
307
216
  clientId: string;
308
217
  clientSecret: string;
309
- type: "self_signed";
310
- identityProviderId: string;
311
- issuer: string;
218
+ } | {
219
+ method: "self_signed";
312
220
  audience: string;
313
221
  scope: string;
314
- admin?: {
315
- clientId: string;
316
- clientSecret: string;
317
- } | undefined;
318
- };
222
+ clientId: string;
223
+ clientSecret: string;
224
+ issuer: string;
225
+ } | undefined;
319
226
  }>;
320
227
  export declare const storeConfigSchema: z.ZodObject<{
321
228
  connection: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -355,11 +262,40 @@ export declare const storeConfigSchema: z.ZodObject<{
355
262
  user: string;
356
263
  password: string;
357
264
  }>]>;
265
+ idps: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
266
+ id: z.ZodString;
267
+ type: z.ZodLiteral<"self_signed">;
268
+ issuer: z.ZodString;
269
+ }, "strip", z.ZodTypeAny, {
270
+ type: "self_signed";
271
+ issuer: string;
272
+ id: string;
273
+ }, {
274
+ type: "self_signed";
275
+ issuer: string;
276
+ id: string;
277
+ }>, z.ZodObject<{
278
+ id: z.ZodString;
279
+ type: z.ZodLiteral<"oauth">;
280
+ issuer: z.ZodString;
281
+ configUrl: z.ZodString;
282
+ }, "strip", z.ZodTypeAny, {
283
+ type: "oauth";
284
+ issuer: string;
285
+ id: string;
286
+ configUrl: string;
287
+ }, {
288
+ type: "oauth";
289
+ issuer: string;
290
+ id: string;
291
+ configUrl: string;
292
+ }>]>, "many">;
358
293
  networks: z.ZodArray<z.ZodObject<{
294
+ id: z.ZodString;
359
295
  name: z.ZodString;
360
- chainId: z.ZodString;
361
- synchronizerId: z.ZodString;
362
296
  description: z.ZodString;
297
+ synchronizerId: z.ZodString;
298
+ identityProviderId: z.ZodString;
363
299
  ledgerApi: z.ZodObject<{
364
300
  baseUrl: z.ZodString;
365
301
  }, "strip", z.ZodTypeAny, {
@@ -367,304 +303,210 @@ export declare const storeConfigSchema: z.ZodObject<{
367
303
  }, {
368
304
  baseUrl: string;
369
305
  }>;
370
- auth: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
371
- identityProviderId: z.ZodString;
372
- type: z.ZodLiteral<"password">;
373
- issuer: z.ZodString;
374
- configUrl: z.ZodString;
306
+ auth: z.ZodDiscriminatedUnion<"method", [z.ZodObject<{
307
+ method: z.ZodLiteral<"authorization_code">;
375
308
  audience: z.ZodString;
376
- tokenUrl: z.ZodString;
377
- grantType: z.ZodString;
378
309
  scope: z.ZodString;
379
310
  clientId: z.ZodString;
380
- admin: z.ZodOptional<z.ZodObject<{
381
- clientId: z.ZodString;
382
- clientSecret: z.ZodString;
383
- }, "strip", z.ZodTypeAny, {
384
- clientId: string;
385
- clientSecret: string;
386
- }, {
387
- clientId: string;
388
- clientSecret: string;
389
- }>>;
390
311
  }, "strip", z.ZodTypeAny, {
391
- clientId: string;
392
- type: "password";
393
- identityProviderId: string;
394
- issuer: string;
395
- configUrl: string;
312
+ method: "authorization_code";
396
313
  audience: string;
397
- tokenUrl: string;
398
- grantType: string;
399
314
  scope: string;
400
- admin?: {
401
- clientId: string;
402
- clientSecret: string;
403
- } | undefined;
404
- }, {
405
315
  clientId: string;
406
- type: "password";
407
- identityProviderId: string;
408
- issuer: string;
409
- configUrl: string;
316
+ }, {
317
+ method: "authorization_code";
410
318
  audience: string;
411
- tokenUrl: string;
412
- grantType: string;
413
319
  scope: string;
414
- admin?: {
415
- clientId: string;
416
- clientSecret: string;
417
- } | undefined;
320
+ clientId: string;
418
321
  }>, z.ZodObject<{
419
- identityProviderId: z.ZodString;
420
- type: z.ZodLiteral<"implicit">;
421
- issuer: z.ZodString;
422
- configUrl: z.ZodString;
322
+ method: z.ZodLiteral<"client_credentials">;
423
323
  audience: z.ZodString;
424
324
  scope: z.ZodString;
425
325
  clientId: z.ZodString;
426
- admin: z.ZodOptional<z.ZodObject<{
427
- clientId: z.ZodString;
428
- clientSecret: z.ZodString;
429
- }, "strip", z.ZodTypeAny, {
430
- clientId: string;
431
- clientSecret: string;
432
- }, {
433
- clientId: string;
434
- clientSecret: string;
435
- }>>;
326
+ clientSecret: z.ZodString;
436
327
  }, "strip", z.ZodTypeAny, {
437
- clientId: string;
438
- type: "implicit";
439
- identityProviderId: string;
440
- issuer: string;
441
- configUrl: string;
328
+ method: "client_credentials";
442
329
  audience: string;
443
330
  scope: string;
444
- admin?: {
445
- clientId: string;
446
- clientSecret: string;
447
- } | undefined;
448
- }, {
449
331
  clientId: string;
450
- type: "implicit";
451
- identityProviderId: string;
452
- issuer: string;
453
- configUrl: string;
332
+ clientSecret: string;
333
+ }, {
334
+ method: "client_credentials";
454
335
  audience: string;
455
336
  scope: string;
456
- admin?: {
457
- clientId: string;
458
- clientSecret: string;
459
- } | undefined;
337
+ clientId: string;
338
+ clientSecret: string;
460
339
  }>, z.ZodObject<{
461
- identityProviderId: z.ZodString;
462
- type: z.ZodLiteral<"client_credentials">;
340
+ method: z.ZodLiteral<"self_signed">;
463
341
  issuer: z.ZodString;
464
- configUrl: z.ZodString;
465
342
  audience: z.ZodString;
466
343
  scope: z.ZodString;
467
344
  clientId: z.ZodString;
468
345
  clientSecret: z.ZodString;
469
- admin: z.ZodOptional<z.ZodObject<{
470
- clientId: z.ZodString;
471
- clientSecret: z.ZodString;
472
- }, "strip", z.ZodTypeAny, {
473
- clientId: string;
474
- clientSecret: string;
475
- }, {
476
- clientId: string;
477
- clientSecret: string;
478
- }>>;
479
346
  }, "strip", z.ZodTypeAny, {
347
+ method: "self_signed";
348
+ audience: string;
349
+ scope: string;
480
350
  clientId: string;
481
351
  clientSecret: string;
482
- type: "client_credentials";
483
- identityProviderId: string;
484
352
  issuer: string;
485
- configUrl: string;
353
+ }, {
354
+ method: "self_signed";
486
355
  audience: string;
487
356
  scope: string;
488
- admin?: {
489
- clientId: string;
490
- clientSecret: string;
491
- } | undefined;
492
- }, {
493
357
  clientId: string;
494
358
  clientSecret: string;
495
- type: "client_credentials";
496
- identityProviderId: string;
497
359
  issuer: string;
498
- configUrl: string;
360
+ }>]>;
361
+ adminAuth: z.ZodOptional<z.ZodDiscriminatedUnion<"method", [z.ZodObject<{
362
+ method: z.ZodLiteral<"authorization_code">;
363
+ audience: z.ZodString;
364
+ scope: z.ZodString;
365
+ clientId: z.ZodString;
366
+ }, "strip", z.ZodTypeAny, {
367
+ method: "authorization_code";
368
+ audience: string;
369
+ scope: string;
370
+ clientId: string;
371
+ }, {
372
+ method: "authorization_code";
499
373
  audience: string;
500
374
  scope: string;
501
- admin?: {
502
- clientId: string;
503
- clientSecret: string;
504
- } | undefined;
375
+ clientId: string;
505
376
  }>, z.ZodObject<{
506
- identityProviderId: z.ZodString;
507
- type: z.ZodLiteral<"self_signed">;
508
- issuer: z.ZodString;
377
+ method: z.ZodLiteral<"client_credentials">;
509
378
  audience: z.ZodString;
510
379
  scope: z.ZodString;
511
380
  clientId: z.ZodString;
512
381
  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
382
  }, "strip", z.ZodTypeAny, {
383
+ method: "client_credentials";
384
+ audience: string;
385
+ scope: string;
524
386
  clientId: string;
525
387
  clientSecret: string;
526
- type: "self_signed";
527
- identityProviderId: string;
528
- issuer: string;
388
+ }, {
389
+ method: "client_credentials";
390
+ audience: string;
391
+ scope: string;
392
+ clientId: string;
393
+ clientSecret: string;
394
+ }>, z.ZodObject<{
395
+ method: z.ZodLiteral<"self_signed">;
396
+ issuer: z.ZodString;
397
+ audience: z.ZodString;
398
+ scope: z.ZodString;
399
+ clientId: z.ZodString;
400
+ clientSecret: z.ZodString;
401
+ }, "strip", z.ZodTypeAny, {
402
+ method: "self_signed";
529
403
  audience: string;
530
404
  scope: string;
531
- admin?: {
532
- clientId: string;
533
- clientSecret: string;
534
- } | undefined;
535
- }, {
536
405
  clientId: string;
537
406
  clientSecret: string;
538
- type: "self_signed";
539
- identityProviderId: string;
540
407
  issuer: string;
408
+ }, {
409
+ method: "self_signed";
541
410
  audience: string;
542
411
  scope: string;
543
- admin?: {
544
- clientId: string;
545
- clientSecret: string;
546
- } | undefined;
547
- }>]>;
412
+ clientId: string;
413
+ clientSecret: string;
414
+ issuer: string;
415
+ }>]>>;
548
416
  }, "strip", z.ZodTypeAny, {
417
+ id: string;
549
418
  name: string;
550
- chainId: string;
551
- synchronizerId: string;
552
419
  description: string;
420
+ synchronizerId: string;
421
+ identityProviderId: string;
553
422
  ledgerApi: {
554
423
  baseUrl: string;
555
424
  };
556
425
  auth: {
557
- clientId: string;
558
- type: "password";
559
- identityProviderId: string;
560
- issuer: string;
561
- configUrl: string;
426
+ method: "authorization_code";
562
427
  audience: string;
563
- tokenUrl: string;
564
- grantType: string;
565
428
  scope: string;
566
- admin?: {
567
- clientId: string;
568
- clientSecret: string;
569
- } | undefined;
570
- } | {
571
429
  clientId: string;
572
- type: "implicit";
573
- identityProviderId: string;
574
- issuer: string;
575
- configUrl: string;
430
+ } | {
431
+ method: "client_credentials";
576
432
  audience: string;
577
433
  scope: string;
578
- admin?: {
579
- clientId: string;
580
- clientSecret: string;
581
- } | undefined;
434
+ clientId: string;
435
+ clientSecret: string;
582
436
  } | {
437
+ method: "self_signed";
438
+ audience: string;
439
+ scope: string;
583
440
  clientId: string;
584
441
  clientSecret: string;
585
- type: "client_credentials";
586
- identityProviderId: string;
587
442
  issuer: string;
588
- configUrl: string;
443
+ };
444
+ adminAuth?: {
445
+ method: "authorization_code";
589
446
  audience: string;
590
447
  scope: string;
591
- admin?: {
592
- clientId: string;
593
- clientSecret: string;
594
- } | undefined;
448
+ clientId: string;
595
449
  } | {
450
+ method: "client_credentials";
451
+ audience: string;
452
+ scope: string;
596
453
  clientId: string;
597
454
  clientSecret: string;
598
- type: "self_signed";
599
- identityProviderId: string;
600
- issuer: string;
455
+ } | {
456
+ method: "self_signed";
601
457
  audience: string;
602
458
  scope: string;
603
- admin?: {
604
- clientId: string;
605
- clientSecret: string;
606
- } | undefined;
607
- };
459
+ clientId: string;
460
+ clientSecret: string;
461
+ issuer: string;
462
+ } | undefined;
608
463
  }, {
464
+ id: string;
609
465
  name: string;
610
- chainId: string;
611
- synchronizerId: string;
612
466
  description: string;
467
+ synchronizerId: string;
468
+ identityProviderId: string;
613
469
  ledgerApi: {
614
470
  baseUrl: string;
615
471
  };
616
472
  auth: {
617
- clientId: string;
618
- type: "password";
619
- identityProviderId: string;
620
- issuer: string;
621
- configUrl: string;
473
+ method: "authorization_code";
622
474
  audience: string;
623
- tokenUrl: string;
624
- grantType: string;
625
475
  scope: string;
626
- admin?: {
627
- clientId: string;
628
- clientSecret: string;
629
- } | undefined;
630
- } | {
631
476
  clientId: string;
632
- type: "implicit";
633
- identityProviderId: string;
634
- issuer: string;
635
- configUrl: string;
477
+ } | {
478
+ method: "client_credentials";
636
479
  audience: string;
637
480
  scope: string;
638
- admin?: {
639
- clientId: string;
640
- clientSecret: string;
641
- } | undefined;
481
+ clientId: string;
482
+ clientSecret: string;
642
483
  } | {
484
+ method: "self_signed";
485
+ audience: string;
486
+ scope: string;
643
487
  clientId: string;
644
488
  clientSecret: string;
645
- type: "client_credentials";
646
- identityProviderId: string;
647
489
  issuer: string;
648
- configUrl: string;
490
+ };
491
+ adminAuth?: {
492
+ method: "authorization_code";
649
493
  audience: string;
650
494
  scope: string;
651
- admin?: {
652
- clientId: string;
653
- clientSecret: string;
654
- } | undefined;
495
+ clientId: string;
655
496
  } | {
497
+ method: "client_credentials";
498
+ audience: string;
499
+ scope: string;
656
500
  clientId: string;
657
501
  clientSecret: string;
658
- type: "self_signed";
659
- identityProviderId: string;
660
- issuer: string;
502
+ } | {
503
+ method: "self_signed";
661
504
  audience: string;
662
505
  scope: string;
663
- admin?: {
664
- clientId: string;
665
- clientSecret: string;
666
- } | undefined;
667
- };
506
+ clientId: string;
507
+ clientSecret: string;
508
+ issuer: string;
509
+ } | undefined;
668
510
  }>, "many">;
669
511
  }, "strip", z.ZodTypeAny, {
670
512
  connection: {
@@ -680,66 +522,63 @@ export declare const storeConfigSchema: z.ZodObject<{
680
522
  user: string;
681
523
  password: string;
682
524
  };
525
+ idps: ({
526
+ type: "self_signed";
527
+ issuer: string;
528
+ id: string;
529
+ } | {
530
+ type: "oauth";
531
+ issuer: string;
532
+ id: string;
533
+ configUrl: string;
534
+ })[];
683
535
  networks: {
536
+ id: string;
684
537
  name: string;
685
- chainId: string;
686
- synchronizerId: string;
687
538
  description: string;
539
+ synchronizerId: string;
540
+ identityProviderId: string;
688
541
  ledgerApi: {
689
542
  baseUrl: string;
690
543
  };
691
544
  auth: {
692
- clientId: string;
693
- type: "password";
694
- identityProviderId: string;
695
- issuer: string;
696
- configUrl: string;
545
+ method: "authorization_code";
697
546
  audience: string;
698
- tokenUrl: string;
699
- grantType: string;
700
547
  scope: string;
701
- admin?: {
702
- clientId: string;
703
- clientSecret: string;
704
- } | undefined;
705
- } | {
706
548
  clientId: string;
707
- type: "implicit";
708
- identityProviderId: string;
709
- issuer: string;
710
- configUrl: string;
549
+ } | {
550
+ method: "client_credentials";
711
551
  audience: string;
712
552
  scope: string;
713
- admin?: {
714
- clientId: string;
715
- clientSecret: string;
716
- } | undefined;
553
+ clientId: string;
554
+ clientSecret: string;
717
555
  } | {
556
+ method: "self_signed";
557
+ audience: string;
558
+ scope: string;
718
559
  clientId: string;
719
560
  clientSecret: string;
720
- type: "client_credentials";
721
- identityProviderId: string;
722
561
  issuer: string;
723
- configUrl: string;
562
+ };
563
+ adminAuth?: {
564
+ method: "authorization_code";
724
565
  audience: string;
725
566
  scope: string;
726
- admin?: {
727
- clientId: string;
728
- clientSecret: string;
729
- } | undefined;
567
+ clientId: string;
730
568
  } | {
569
+ method: "client_credentials";
570
+ audience: string;
571
+ scope: string;
731
572
  clientId: string;
732
573
  clientSecret: string;
733
- type: "self_signed";
734
- identityProviderId: string;
735
- issuer: string;
574
+ } | {
575
+ method: "self_signed";
736
576
  audience: string;
737
577
  scope: string;
738
- admin?: {
739
- clientId: string;
740
- clientSecret: string;
741
- } | undefined;
742
- };
578
+ clientId: string;
579
+ clientSecret: string;
580
+ issuer: string;
581
+ } | undefined;
743
582
  }[];
744
583
  }, {
745
584
  connection: {
@@ -755,66 +594,63 @@ export declare const storeConfigSchema: z.ZodObject<{
755
594
  user: string;
756
595
  password: string;
757
596
  };
597
+ idps: ({
598
+ type: "self_signed";
599
+ issuer: string;
600
+ id: string;
601
+ } | {
602
+ type: "oauth";
603
+ issuer: string;
604
+ id: string;
605
+ configUrl: string;
606
+ })[];
758
607
  networks: {
608
+ id: string;
759
609
  name: string;
760
- chainId: string;
761
- synchronizerId: string;
762
610
  description: string;
611
+ synchronizerId: string;
612
+ identityProviderId: string;
763
613
  ledgerApi: {
764
614
  baseUrl: string;
765
615
  };
766
616
  auth: {
767
- clientId: string;
768
- type: "password";
769
- identityProviderId: string;
770
- issuer: string;
771
- configUrl: string;
617
+ method: "authorization_code";
772
618
  audience: string;
773
- tokenUrl: string;
774
- grantType: string;
775
619
  scope: string;
776
- admin?: {
777
- clientId: string;
778
- clientSecret: string;
779
- } | undefined;
780
- } | {
781
620
  clientId: string;
782
- type: "implicit";
783
- identityProviderId: string;
784
- issuer: string;
785
- configUrl: string;
621
+ } | {
622
+ method: "client_credentials";
786
623
  audience: string;
787
624
  scope: string;
788
- admin?: {
789
- clientId: string;
790
- clientSecret: string;
791
- } | undefined;
625
+ clientId: string;
626
+ clientSecret: string;
792
627
  } | {
628
+ method: "self_signed";
629
+ audience: string;
630
+ scope: string;
793
631
  clientId: string;
794
632
  clientSecret: string;
795
- type: "client_credentials";
796
- identityProviderId: string;
797
633
  issuer: string;
798
- configUrl: string;
634
+ };
635
+ adminAuth?: {
636
+ method: "authorization_code";
799
637
  audience: string;
800
638
  scope: string;
801
- admin?: {
802
- clientId: string;
803
- clientSecret: string;
804
- } | undefined;
639
+ clientId: string;
805
640
  } | {
641
+ method: "client_credentials";
642
+ audience: string;
643
+ scope: string;
806
644
  clientId: string;
807
645
  clientSecret: string;
808
- type: "self_signed";
809
- identityProviderId: string;
810
- issuer: string;
646
+ } | {
647
+ method: "self_signed";
811
648
  audience: string;
812
649
  scope: string;
813
- admin?: {
814
- clientId: string;
815
- clientSecret: string;
816
- } | undefined;
817
- };
650
+ clientId: string;
651
+ clientSecret: string;
652
+ issuer: string;
653
+ } | undefined;
818
654
  }[];
819
655
  }>;
820
656
  export type StoreConfig = z.infer<typeof storeConfigSchema>;
@@ -1 +1 @@
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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 id: zod.z.string(),
16
17
  name: zod.z.string(),
17
- chainId: zod.z.string(),
18
- synchronizerId: zod.z.string(),
19
18
  description: zod.z.string(),
19
+ synchronizerId: zod.z.string(),
20
+ identityProviderId: zod.z.string(),
20
21
  ledgerApi: ledgerApiSchema,
21
- auth: coreWalletAuth.authSchema
22
+ auth: coreWalletAuth.authSchema,
23
+ adminAuth: coreWalletAuth.authSchema.optional()
22
24
  });
23
25
  var storeConfigSchema = zod.z.object({
24
26
  connection: zod.z.discriminatedUnion("type", [
@@ -38,6 +40,7 @@ var storeConfigSchema = zod.z.object({
38
40
  database: zod.z.string()
39
41
  })
40
42
  ]),
43
+ idps: zod.z.array(coreWalletAuth.idpSchema),
41
44
  networks: zod.z.array(networkSchema)
42
45
  });
43
46
 
@@ -1 +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"]}
1
+ {"version":3,"sources":["../src/Store.ts","../src/config/schema.ts"],"names":["A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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,IAAA,EAAMA,KAAA,CAAE,KAAA,CAAME,wBAAS,CAAA;AAAA,EACvB,QAAA,EAAUF,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 { Idp } from '@canton-network/core-wallet-auth'\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 networkIds?: string[]\n signingProviderIds?: string[]\n}\n\nexport interface UpdateWallet {\n status: string\n partyId: string\n}\n\nexport interface Wallet {\n primary: boolean\n partyId: PartyId\n hint: string\n publicKey: string\n namespace: string\n networkId: string\n signingProviderId: string\n externalTxId?: string\n topologyTransactions?: string\n status?: 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 updateWallet(params: UpdateWallet): Promise<void>\n removeWallet(partyId: PartyId): Promise<void>\n\n // Session methods\n getSession(): Promise<Session | undefined>\n setSession(session: Session): Promise<void>\n removeSession(): Promise<void>\n\n // IDP methods\n getIdp(idpId: string): Promise<Idp>\n listIdps(): Promise<Array<Idp>>\n updateIdp(idp: Idp): Promise<void>\n addIdp(idp: Idp): Promise<void>\n removeIdp(idpId: string): Promise<void>\n\n // Network methods\n getNetwork(networkId: 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(networkId: 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, idpSchema } 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 id: z.string(),\n name: z.string(),\n description: z.string(),\n synchronizerId: z.string(),\n identityProviderId: z.string(),\n ledgerApi: ledgerApiSchema,\n auth: authSchema,\n adminAuth: authSchema.optional(),\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 idps: z.array(idpSchema),\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,4 @@
1
- import { authSchema } from '@canton-network/core-wallet-auth';
1
+ import { authSchema, idpSchema } from '@canton-network/core-wallet-auth';
2
2
  import { z } from 'zod';
3
3
 
4
4
  // src/Store.ts
@@ -11,12 +11,14 @@ var ledgerApiSchema = z.object({
11
11
  baseUrl: z.string().url()
12
12
  });
13
13
  var networkSchema = z.object({
14
+ id: z.string(),
14
15
  name: z.string(),
15
- chainId: z.string(),
16
- synchronizerId: z.string(),
17
16
  description: z.string(),
17
+ synchronizerId: z.string(),
18
+ identityProviderId: z.string(),
18
19
  ledgerApi: ledgerApiSchema,
19
- auth: authSchema
20
+ auth: authSchema,
21
+ adminAuth: authSchema.optional()
20
22
  });
21
23
  var storeConfigSchema = z.object({
22
24
  connection: z.discriminatedUnion("type", [
@@ -36,6 +38,7 @@ var storeConfigSchema = z.object({
36
38
  database: z.string()
37
39
  })
38
40
  ]),
41
+ idps: z.array(idpSchema),
39
42
  networks: z.array(networkSchema)
40
43
  });
41
44
 
package/dist/index.js.map CHANGED
@@ -1 +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"]}
1
+ {"version":3,"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AAE,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,IAAA,EAAM,CAAA,CAAE,KAAA,CAAM,SAAS,CAAA;AAAA,EACvB,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 { Idp } from '@canton-network/core-wallet-auth'\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 networkIds?: string[]\n signingProviderIds?: string[]\n}\n\nexport interface UpdateWallet {\n status: string\n partyId: string\n}\n\nexport interface Wallet {\n primary: boolean\n partyId: PartyId\n hint: string\n publicKey: string\n namespace: string\n networkId: string\n signingProviderId: string\n externalTxId?: string\n topologyTransactions?: string\n status?: 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 updateWallet(params: UpdateWallet): Promise<void>\n removeWallet(partyId: PartyId): Promise<void>\n\n // Session methods\n getSession(): Promise<Session | undefined>\n setSession(session: Session): Promise<void>\n removeSession(): Promise<void>\n\n // IDP methods\n getIdp(idpId: string): Promise<Idp>\n listIdps(): Promise<Array<Idp>>\n updateIdp(idp: Idp): Promise<void>\n addIdp(idp: Idp): Promise<void>\n removeIdp(idpId: string): Promise<void>\n\n // Network methods\n getNetwork(networkId: 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(networkId: 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, idpSchema } 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 id: z.string(),\n name: z.string(),\n description: z.string(),\n synchronizerId: z.string(),\n identityProviderId: z.string(),\n ledgerApi: ledgerApiSchema,\n auth: authSchema,\n adminAuth: authSchema.optional(),\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 idps: z.array(idpSchema),\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.10.0",
3
+ "version": "0.11.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",
@@ -17,7 +17,7 @@
17
17
  "test": "jest --passWithNoTests"
18
18
  },
19
19
  "dependencies": {
20
- "@canton-network/core-wallet-auth": "^0.11.0",
20
+ "@canton-network/core-wallet-auth": "^0.12.0",
21
21
  "zod": "^3.25.64"
22
22
  },
23
23
  "devDependencies": {