@canton-network/wallet-gateway-remote 0.6.1 → 0.8.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/README.md +11 -1
- package/dist/auth/jwt-auth-service.d.ts.map +1 -1
- package/dist/auth/jwt-auth-service.js +5 -0
- package/dist/auth/jwt-unsafe-auth-service.d.ts.map +1 -1
- package/dist/auth/jwt-unsafe-auth-service.js +5 -0
- package/dist/config/Config.d.ts +1 -1
- package/dist/dapp-api/controller.d.ts.map +1 -1
- package/dist/dapp-api/controller.js +25 -11
- package/dist/dapp-api/rpc-gen/typings.d.ts +102 -12
- package/dist/dapp-api/rpc-gen/typings.d.ts.map +1 -1
- package/dist/example-config.d.ts +82 -0
- package/dist/example-config.d.ts.map +1 -0
- package/dist/example-config.js +84 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -7
- package/dist/ledger/party-allocation-service.d.ts +8 -2
- package/dist/ledger/party-allocation-service.d.ts.map +1 -1
- package/dist/ledger/party-allocation-service.js +9 -6
- package/dist/ledger/party-allocation-service.test.js +6 -1
- package/dist/user-api/controller.d.ts +4 -0
- package/dist/user-api/controller.d.ts.map +1 -1
- package/dist/user-api/controller.js +68 -9
- package/dist/user-api/rpc-gen/index.d.ts +12 -0
- package/dist/user-api/rpc-gen/index.d.ts.map +1 -1
- package/dist/user-api/rpc-gen/index.js +4 -0
- package/dist/user-api/rpc-gen/typings.d.ts +79 -27
- package/dist/user-api/rpc-gen/typings.d.ts.map +1 -1
- package/dist/user-api/server.test.js +8 -5
- package/dist/web/frontend/404/index.html +2 -2
- package/dist/web/frontend/approve/index.html +5 -7
- package/dist/web/frontend/assets/{404-CT3y_TOo.js → 404-CK2XmoLz.js} +3 -3
- package/dist/web/frontend/assets/{approve-aBUJf8IZ.js → approve-C-O7VrUc.js} +14 -8
- package/dist/web/frontend/assets/{callback-F-xYJVy-.js → callback-Bgkm99UY.js} +1 -1
- package/dist/web/frontend/assets/{index-CkNk7mKn.js → index-BVQSWRTn.js} +473 -187
- package/dist/web/frontend/assets/{login-BbI2P4fJ.js → login-FaVg_LJv.js} +3 -3
- package/dist/web/frontend/assets/settings-YzEHE3VQ.js +26 -0
- package/dist/web/frontend/assets/{state-DvPMGcqb.js → state-xH49VD_k.js} +1 -1
- package/dist/web/frontend/assets/{wallets-DC9a3FFG.js → wallets-CsSlR4-u.js} +1 -1
- package/dist/web/frontend/callback/index.html +2 -2
- package/dist/web/frontend/index.html +3 -4
- package/dist/web/frontend/login/index.html +5 -6
- package/dist/web/frontend/{networks → settings}/index.html +6 -8
- package/dist/web/frontend/wallets/index.html +5 -7
- package/package.json +17 -17
- package/dist/web/frontend/assets/handle-errors-C5Ovml71.js +0 -1
- package/dist/web/frontend/assets/networks-amJnI8M-.js +0 -225
package/README.md
CHANGED
|
@@ -26,7 +26,17 @@ By default, the service runs on port `3030`, but this can be overridden via the
|
|
|
26
26
|
|
|
27
27
|
## Configuration
|
|
28
28
|
|
|
29
|
-
A configuration file is required to start up the Gateway.
|
|
29
|
+
A configuration file is required to start up the Gateway. Create an example config to edit as a starting point:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
wallet-gateway --config-example > config.json
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
To show the full [JSON Schema](https://json-schema.org/) representation of the configuration file:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
wallet-gateway --config-schema
|
|
39
|
+
```
|
|
30
40
|
|
|
31
41
|
# Developing
|
|
32
42
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwt-auth-service.d.ts","sourceRoot":"","sources":["../../src/auth/jwt-auth-service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAA;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAE7B;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,KAAK,EAAE,QAAQ,MAAM,KAAG,
|
|
1
|
+
{"version":3,"file":"jwt-auth-service.d.ts","sourceRoot":"","sources":["../../src/auth/jwt-auth-service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAA;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAE7B;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,KAAK,EAAE,QAAQ,MAAM,KAAG,WAiE5D,CAAA"}
|
|
@@ -27,6 +27,11 @@ export const jwtAuthService = (store, logger) => ({
|
|
|
27
27
|
logger.warn(`No identity provider found for issuer: ${iss}`);
|
|
28
28
|
return undefined;
|
|
29
29
|
}
|
|
30
|
+
const scope = decoded.scope;
|
|
31
|
+
if (!scope) {
|
|
32
|
+
logger.warn('JWT does not contain a scope');
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
30
35
|
if (idp.type == 'self_signed') {
|
|
31
36
|
logger.debug(idp, 'Using self-signed IDP');
|
|
32
37
|
const sub = decoded.sub;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwt-unsafe-auth-service.d.ts","sourceRoot":"","sources":["../../src/auth/jwt-unsafe-auth-service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAA;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAE7B;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,KAAK,EAAE,QAAQ,MAAM,KAAG,
|
|
1
|
+
{"version":3,"file":"jwt-unsafe-auth-service.d.ts","sourceRoot":"","sources":["../../src/auth/jwt-unsafe-auth-service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAA;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAE7B;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,KAAK,EAAE,QAAQ,MAAM,KAAG,WAqD5D,CAAA"}
|
|
@@ -26,6 +26,11 @@ export const jwtAuthService = (store, logger) => ({
|
|
|
26
26
|
logger.warn('JWT does not contain a subject');
|
|
27
27
|
return undefined;
|
|
28
28
|
}
|
|
29
|
+
const scope = decoded.scope;
|
|
30
|
+
if (!scope) {
|
|
31
|
+
logger.warn('JWT does not contain a scope');
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
29
34
|
const idps = await store.listIdps();
|
|
30
35
|
const idp = idps.find((i) => i.issuer === iss);
|
|
31
36
|
if (!idp) {
|
package/dist/config/Config.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export declare const configSchema: z.ZodObject<{
|
|
|
40
40
|
id: z.ZodString;
|
|
41
41
|
name: z.ZodString;
|
|
42
42
|
description: z.ZodString;
|
|
43
|
-
synchronizerId: z.ZodString
|
|
43
|
+
synchronizerId: z.ZodOptional<z.ZodString>;
|
|
44
44
|
identityProviderId: z.ZodString;
|
|
45
45
|
ledgerApi: z.ZodObject<{
|
|
46
46
|
baseUrl: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/dapp-api/controller.ts"],"names":[],"mappings":"AAIA,OAAO,EAAmB,WAAW,EAAE,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/dapp-api/controller.ts"],"names":[],"mappings":"AAIA,OAAO,EAAmB,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAQ/E,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAA;AAQzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAC5E,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAG7B,eAAO,MAAM,cAAc,GACvB,YAAY,gBAAgB,EAC5B,OAAO,KAAK,EACZ,qBAAqB,mBAAmB,EACxC,SAAS,MAAM,EACf,UAAU,WAAW;;;;;;;;;;;;;CAkNxB,CAAA"}
|
|
@@ -46,6 +46,8 @@ export const dappController = (kernelInfo, store, notificationService, _logger,
|
|
|
46
46
|
notifier.emit('statusChanged', {
|
|
47
47
|
kernel: kernelInfo,
|
|
48
48
|
isConnected: false,
|
|
49
|
+
isNetworkConnected: false,
|
|
50
|
+
networkReason: 'Unauthenticated',
|
|
49
51
|
userUrl: 'http://localhost:3030/login/', // TODO: pull user URL from config
|
|
50
52
|
});
|
|
51
53
|
}
|
|
@@ -84,9 +86,12 @@ export const dappController = (kernelInfo, store, notificationService, _logger,
|
|
|
84
86
|
const ledgerClient = new LedgerClient(new URL(network.ledgerApi.baseUrl), logger, false, context.accessToken);
|
|
85
87
|
const userId = context.userId;
|
|
86
88
|
const notifier = notificationService.getNotifier(userId);
|
|
87
|
-
|
|
89
|
+
params.commandId = params.commandId || v4();
|
|
90
|
+
const commandId = params.commandId;
|
|
88
91
|
notifier.emit('txChanged', { status: 'pending', commandId });
|
|
89
|
-
const
|
|
92
|
+
const synchronizerId = network.synchronizerId ??
|
|
93
|
+
(await ledgerClient.getSynchronizerId());
|
|
94
|
+
const { preparedTransactionHash, preparedTransaction = '' } = await prepareSubmission(context.userId, wallet.partyId, synchronizerId, params, ledgerClient);
|
|
90
95
|
store.setTransaction({
|
|
91
96
|
commandId,
|
|
92
97
|
status: 'pending',
|
|
@@ -96,7 +101,7 @@ export const dappController = (kernelInfo, store, notificationService, _logger,
|
|
|
96
101
|
});
|
|
97
102
|
return {
|
|
98
103
|
// TODO: pull user base URL / port from config
|
|
99
|
-
userUrl: `http://localhost:3030/approve/index.html?commandId=${commandId}
|
|
104
|
+
userUrl: `http://localhost:3030/approve/index.html?commandId=${commandId}`,
|
|
100
105
|
};
|
|
101
106
|
},
|
|
102
107
|
prepareReturn: async (params) => {
|
|
@@ -109,7 +114,7 @@ export const dappController = (kernelInfo, store, notificationService, _logger,
|
|
|
109
114
|
throw new Error('No primary wallet found');
|
|
110
115
|
}
|
|
111
116
|
const ledgerClient = new LedgerClient(new URL(network.ledgerApi.baseUrl), logger, false, context.accessToken);
|
|
112
|
-
return prepareSubmission(context.userId, wallet.partyId, network.synchronizerId, params
|
|
117
|
+
return prepareSubmission(context.userId, wallet.partyId, network.synchronizerId, params, ledgerClient);
|
|
113
118
|
},
|
|
114
119
|
status: async () => {
|
|
115
120
|
if (!context) {
|
|
@@ -149,18 +154,27 @@ export const dappController = (kernelInfo, store, notificationService, _logger,
|
|
|
149
154
|
},
|
|
150
155
|
});
|
|
151
156
|
};
|
|
152
|
-
async function prepareSubmission(userId, partyId, synchronizerId,
|
|
157
|
+
async function prepareSubmission(userId, partyId, synchronizerId, params, ledgerClient) {
|
|
158
|
+
// Map disclosed contracts to ledger api format (which wrongly defines optional fields as mandatory)
|
|
159
|
+
const disclosedContracts = params.disclosedContracts?.map((d) => {
|
|
160
|
+
return {
|
|
161
|
+
templateId: d.templateId || '',
|
|
162
|
+
contractId: d.contractId || '',
|
|
163
|
+
createdEventBlob: d.createdEventBlob,
|
|
164
|
+
synchronizerId: d.synchronizerId || '',
|
|
165
|
+
};
|
|
166
|
+
}) || [];
|
|
153
167
|
const prepareParams = {
|
|
154
168
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- because OpenRPC codegen type is incompatible with ledger codegen type
|
|
155
|
-
commands: commands,
|
|
156
|
-
commandId: commandId || v4(),
|
|
169
|
+
commands: params.commands,
|
|
170
|
+
commandId: params.commandId || v4(),
|
|
157
171
|
userId,
|
|
158
|
-
actAs: [partyId],
|
|
159
|
-
readAs: [],
|
|
160
|
-
disclosedContracts
|
|
172
|
+
actAs: params.actAs || [partyId],
|
|
173
|
+
readAs: params.readAs || [],
|
|
174
|
+
disclosedContracts,
|
|
161
175
|
synchronizerId,
|
|
162
176
|
verboseHashing: false,
|
|
163
|
-
packageIdSelectionPreference: [],
|
|
177
|
+
packageIdSelectionPreference: params.packageIdSelectionPreference || [],
|
|
164
178
|
};
|
|
165
179
|
return await ledgerClient.postWithRetry('/v2/interactive-submission/prepare', prepareParams);
|
|
166
180
|
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* The unique identifier of the command associated with the transaction.
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export type CommandId = string;
|
|
1
7
|
/**
|
|
2
8
|
*
|
|
3
9
|
* Structure representing JS commands for transaction execution
|
|
@@ -6,6 +12,73 @@
|
|
|
6
12
|
export interface JsCommands {
|
|
7
13
|
[key: string]: any;
|
|
8
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* The party that signed the transaction.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export type Party = string;
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* Set of parties on whose behalf the command should be executed, if submitted. If not set, the primary wallet's party is used.
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
export type ActAs = Party[];
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* Set of parties that should be granted read access to the command, if submitted. If not set, no additional read parties are granted.
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
export type ReadAs = Party[];
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* The template identifier of the disclosed contract.
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
export type TemplateId = string;
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* The unique identifier of the disclosed contract.
|
|
42
|
+
*
|
|
43
|
+
*/
|
|
44
|
+
export type ContractId = string;
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* The blob data of the created event for the disclosed contract.
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
export type CreatedEventBlob = string;
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* If not set, a suitable synchronizer that this node is connected to will be chosen.
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
export type SynchronizerId = string;
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
* Structure representing a disclosed contract for transaction execution
|
|
60
|
+
*
|
|
61
|
+
*/
|
|
62
|
+
export interface DisclosedContract {
|
|
63
|
+
templateId?: TemplateId;
|
|
64
|
+
contractId?: ContractId;
|
|
65
|
+
createdEventBlob: CreatedEventBlob;
|
|
66
|
+
synchronizerId?: SynchronizerId;
|
|
67
|
+
[k: string]: any;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* List of contract IDs to be disclosed with the command.
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
74
|
+
export type DisclosedContracts = DisclosedContract[];
|
|
75
|
+
export type PackageId = string;
|
|
76
|
+
/**
|
|
77
|
+
*
|
|
78
|
+
* The package-id selection preference of the client for resolving package names and interface instances in command submission and interpretation
|
|
79
|
+
*
|
|
80
|
+
*/
|
|
81
|
+
export type PackageIdSelectionPreference = PackageId[];
|
|
9
82
|
export type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
10
83
|
export type Resource = string;
|
|
11
84
|
export type Body = string;
|
|
@@ -119,6 +192,12 @@ export type Primary = boolean;
|
|
|
119
192
|
*
|
|
120
193
|
*/
|
|
121
194
|
export type PartyId = string;
|
|
195
|
+
/**
|
|
196
|
+
*
|
|
197
|
+
* The status of the wallet.
|
|
198
|
+
*
|
|
199
|
+
*/
|
|
200
|
+
export type WalletStatus = 'initialized' | 'allocated';
|
|
122
201
|
/**
|
|
123
202
|
*
|
|
124
203
|
* The party hint and name of the wallet.
|
|
@@ -163,6 +242,7 @@ export type TopologyTransactions = string;
|
|
|
163
242
|
export interface Wallet {
|
|
164
243
|
primary: Primary;
|
|
165
244
|
partyId: PartyId;
|
|
245
|
+
status: WalletStatus;
|
|
166
246
|
hint: Hint;
|
|
167
247
|
publicKey: PublicKey;
|
|
168
248
|
namespace: Namespace;
|
|
@@ -178,12 +258,6 @@ export interface Wallet {
|
|
|
178
258
|
*
|
|
179
259
|
*/
|
|
180
260
|
export type StatusPending = 'pending';
|
|
181
|
-
/**
|
|
182
|
-
*
|
|
183
|
-
* The unique identifier of the command associated with the transaction.
|
|
184
|
-
*
|
|
185
|
-
*/
|
|
186
|
-
export type CommandId = string;
|
|
187
261
|
/**
|
|
188
262
|
*
|
|
189
263
|
* Event emitted when a transaction is pending.
|
|
@@ -211,12 +285,6 @@ export type Signature = string;
|
|
|
211
285
|
*
|
|
212
286
|
*/
|
|
213
287
|
export type SignedBy = string;
|
|
214
|
-
/**
|
|
215
|
-
*
|
|
216
|
-
* The party that signed the transaction.
|
|
217
|
-
*
|
|
218
|
-
*/
|
|
219
|
-
export type Party = string;
|
|
220
288
|
/**
|
|
221
289
|
*
|
|
222
290
|
* Payload for the TxChangedSignedEvent.
|
|
@@ -284,12 +352,34 @@ export interface TxChangedFailedEvent {
|
|
|
284
352
|
status: StatusFailed;
|
|
285
353
|
commandId: CommandId;
|
|
286
354
|
}
|
|
355
|
+
/**
|
|
356
|
+
*
|
|
357
|
+
* Structure representing the request for prepare and execute calls
|
|
358
|
+
*
|
|
359
|
+
*/
|
|
287
360
|
export interface PrepareReturnParams {
|
|
361
|
+
commandId?: CommandId;
|
|
288
362
|
commands: JsCommands;
|
|
363
|
+
actAs?: ActAs;
|
|
364
|
+
readAs?: ReadAs;
|
|
365
|
+
disclosedContracts?: DisclosedContracts;
|
|
366
|
+
synchronizerId?: SynchronizerId;
|
|
367
|
+
packageIdSelectionPreference?: PackageIdSelectionPreference;
|
|
289
368
|
[k: string]: any;
|
|
290
369
|
}
|
|
370
|
+
/**
|
|
371
|
+
*
|
|
372
|
+
* Structure representing the request for prepare and execute calls
|
|
373
|
+
*
|
|
374
|
+
*/
|
|
291
375
|
export interface PrepareExecuteParams {
|
|
376
|
+
commandId?: CommandId;
|
|
292
377
|
commands: JsCommands;
|
|
378
|
+
actAs?: ActAs;
|
|
379
|
+
readAs?: ReadAs;
|
|
380
|
+
disclosedContracts?: DisclosedContracts;
|
|
381
|
+
synchronizerId?: SynchronizerId;
|
|
382
|
+
packageIdSelectionPreference?: PackageIdSelectionPreference;
|
|
293
383
|
[k: string]: any;
|
|
294
384
|
}
|
|
295
385
|
export interface LedgerApiParams {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typings.d.ts","sourceRoot":"","sources":["../../../src/dapp-api/rpc-gen/typings.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACrB;AACD,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAA;AAC7D,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAA;AAC7B,MAAM,MAAM,IAAI,GAAG,MAAM,CAAA;AACzB;;;;GAIG;AACH,MAAM,MAAM,EAAE,GAAG,MAAM,CAAA;AACvB;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;AACpE;;;;GAIG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,CAAA;AACxB;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,EAAE,CAAA;IACN,UAAU,EAAE,UAAU,CAAA;IACtB,GAAG,CAAC,EAAE,GAAG,CAAA;IACT,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB;AACD;;;;GAIG;AACH,MAAM,MAAM,WAAW,G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;AAC/C,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,CAAA;AAClD,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;AAC5C,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAA;AAC9D,MAAM,MAAM,aAAa,GAAG,CACxB,MAAM,EAAE,mBAAmB,KAC1B,OAAO,CAAC,mBAAmB,CAAC,CAAA;AACjC,MAAM,MAAM,cAAc,GAAG,CACzB,MAAM,EAAE,oBAAoB,KAC3B,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAClC,MAAM,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,eAAe,CAAC,CAAA;AAC7E,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,gBAAgB,CAAC,CAAA;AACzD,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAA;AACxD,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC,oBAAoB,CAAC,CAAA;AACnE,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAClE,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,CAAA"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
kernel: {
|
|
3
|
+
id: string;
|
|
4
|
+
clientType: "remote";
|
|
5
|
+
url: string;
|
|
6
|
+
userUrl: string;
|
|
7
|
+
};
|
|
8
|
+
signingStore: {
|
|
9
|
+
connection: {
|
|
10
|
+
type: "sqlite";
|
|
11
|
+
database: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
store: {
|
|
15
|
+
connection: {
|
|
16
|
+
type: "sqlite";
|
|
17
|
+
database: string;
|
|
18
|
+
};
|
|
19
|
+
idps: ({
|
|
20
|
+
id: string;
|
|
21
|
+
type: "self_signed";
|
|
22
|
+
issuer: string;
|
|
23
|
+
configUrl?: never;
|
|
24
|
+
} | {
|
|
25
|
+
id: string;
|
|
26
|
+
type: "oauth";
|
|
27
|
+
issuer: string;
|
|
28
|
+
configUrl: string;
|
|
29
|
+
})[];
|
|
30
|
+
networks: ({
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
description: string;
|
|
34
|
+
identityProviderId: string;
|
|
35
|
+
auth: {
|
|
36
|
+
method: "self_signed";
|
|
37
|
+
issuer: string;
|
|
38
|
+
audience: string;
|
|
39
|
+
scope: string;
|
|
40
|
+
clientId: string;
|
|
41
|
+
clientSecret: string;
|
|
42
|
+
};
|
|
43
|
+
adminAuth: {
|
|
44
|
+
method: "self_signed";
|
|
45
|
+
issuer: string;
|
|
46
|
+
scope: string;
|
|
47
|
+
audience: string;
|
|
48
|
+
clientId: string;
|
|
49
|
+
clientSecret: string;
|
|
50
|
+
};
|
|
51
|
+
ledgerApi: {
|
|
52
|
+
baseUrl: string;
|
|
53
|
+
};
|
|
54
|
+
} | {
|
|
55
|
+
id: string;
|
|
56
|
+
name: string;
|
|
57
|
+
description: string;
|
|
58
|
+
identityProviderId: string;
|
|
59
|
+
auth: {
|
|
60
|
+
method: "authorization_code";
|
|
61
|
+
clientId: string;
|
|
62
|
+
scope: string;
|
|
63
|
+
audience: string;
|
|
64
|
+
issuer?: never;
|
|
65
|
+
clientSecret?: never;
|
|
66
|
+
};
|
|
67
|
+
adminAuth: {
|
|
68
|
+
method: "client_credentials";
|
|
69
|
+
scope: string;
|
|
70
|
+
audience: string;
|
|
71
|
+
clientId: string;
|
|
72
|
+
clientSecret: string;
|
|
73
|
+
issuer?: never;
|
|
74
|
+
};
|
|
75
|
+
ledgerApi: {
|
|
76
|
+
baseUrl: string;
|
|
77
|
+
};
|
|
78
|
+
})[];
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
export default _default;
|
|
82
|
+
//# sourceMappingURL=example-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example-config.d.ts","sourceRoot":"","sources":["../src/example-config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBAoFkB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
export default {
|
|
4
|
+
kernel: {
|
|
5
|
+
id: 'remote-da',
|
|
6
|
+
clientType: 'remote',
|
|
7
|
+
url: 'http://localhost:3030/api/v0/dapp',
|
|
8
|
+
userUrl: 'http://localhost:3030',
|
|
9
|
+
},
|
|
10
|
+
signingStore: {
|
|
11
|
+
connection: {
|
|
12
|
+
type: 'sqlite',
|
|
13
|
+
database: 'signing_store.sqlite',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
store: {
|
|
17
|
+
connection: {
|
|
18
|
+
type: 'sqlite',
|
|
19
|
+
database: 'store.sqlite',
|
|
20
|
+
},
|
|
21
|
+
idps: [
|
|
22
|
+
{
|
|
23
|
+
id: 'idp-example-self-signed',
|
|
24
|
+
type: 'self_signed',
|
|
25
|
+
issuer: 'unsafe-auth',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'idp-example-oauth',
|
|
29
|
+
type: 'oauth',
|
|
30
|
+
issuer: 'https://oauth.example.com/',
|
|
31
|
+
configUrl: 'https://oauth.example.com/.well-known/openid-configuration',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
networks: [
|
|
35
|
+
{
|
|
36
|
+
id: 'canton:example-self-signed',
|
|
37
|
+
name: 'Canton Local (Self Signed)',
|
|
38
|
+
description: 'A network that connects to a Canton participant using self-signed tokens',
|
|
39
|
+
identityProviderId: 'idp-example-self-signed',
|
|
40
|
+
auth: {
|
|
41
|
+
method: 'self_signed',
|
|
42
|
+
issuer: 'self-signed',
|
|
43
|
+
audience: '<REPLACE_PARTICIPANT_AUDIENCE>',
|
|
44
|
+
scope: 'openid daml_ledger_api offline_access',
|
|
45
|
+
clientId: '<REPLACE_CLIENT_ID>',
|
|
46
|
+
clientSecret: 'unsafe',
|
|
47
|
+
},
|
|
48
|
+
adminAuth: {
|
|
49
|
+
method: 'self_signed',
|
|
50
|
+
issuer: 'self-signed',
|
|
51
|
+
scope: 'daml_ledger_api',
|
|
52
|
+
audience: '<REPLACE_PARTICIPANT_AUDIENCE>',
|
|
53
|
+
clientId: '<REPLACE_ADMIN_CLIENT_ID>',
|
|
54
|
+
clientSecret: 'unsafe',
|
|
55
|
+
},
|
|
56
|
+
ledgerApi: {
|
|
57
|
+
baseUrl: 'http://127.0.0.1:2975',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: 'canton:example-oauth',
|
|
62
|
+
name: 'Canton Local (OAuth IDP)',
|
|
63
|
+
description: 'A network that connects to a Canton participant using an OAuth IDP',
|
|
64
|
+
identityProviderId: 'idp-example-oauth',
|
|
65
|
+
auth: {
|
|
66
|
+
method: 'authorization_code',
|
|
67
|
+
clientId: '<REPLACE_USER_CLIENT_ID>',
|
|
68
|
+
scope: 'openid daml_ledger_api offline_access',
|
|
69
|
+
audience: '<REPLACE_PARTICIPANT_AUDIENCE>',
|
|
70
|
+
},
|
|
71
|
+
adminAuth: {
|
|
72
|
+
method: 'client_credentials',
|
|
73
|
+
scope: 'daml_ledger_api',
|
|
74
|
+
audience: '<REPLACE_PARTICIPANT_AUDIENCE>',
|
|
75
|
+
clientId: '<REPLACE_ADMIN_CLIENT_ID>',
|
|
76
|
+
clientSecret: '<REPLACE_ADMIN_CLIENT_SECRET>',
|
|
77
|
+
},
|
|
78
|
+
ledgerApi: {
|
|
79
|
+
baseUrl: 'http://127.0.0.1:2975',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
declare const options: {
|
|
3
3
|
config: string;
|
|
4
|
+
configSchema: boolean;
|
|
5
|
+
configExample: boolean;
|
|
4
6
|
port: string | true;
|
|
5
7
|
logFormat: "json" | "pretty";
|
|
6
|
-
storeType: "sqlite" | "postgres";
|
|
7
8
|
};
|
|
8
9
|
export type CliOptions = typeof options;
|
|
9
10
|
export {};
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAiEA,QAAA,MAAM,OAAO;;;;;;CAAiB,CAAA;AAE9B,MAAM,MAAM,UAAU,GAAG,OAAO,OAAO,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,9 @@ import { readFileSync } from 'fs';
|
|
|
9
9
|
import { join, dirname } from 'path';
|
|
10
10
|
import { fileURLToPath } from 'url';
|
|
11
11
|
import pino from 'pino';
|
|
12
|
+
import z from 'zod';
|
|
13
|
+
import { configSchema } from './config/Config.js';
|
|
14
|
+
import exampleConfig from './example-config.js';
|
|
12
15
|
const __filename = fileURLToPath(import.meta.url);
|
|
13
16
|
const __dirname = dirname(__filename);
|
|
14
17
|
const pkg = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf8'));
|
|
@@ -17,14 +20,21 @@ const program = new Command()
|
|
|
17
20
|
.version(pkg.version)
|
|
18
21
|
.description('Run a remotely hosted Wallet Gateway')
|
|
19
22
|
.option('-c, --config <path>', 'set config path', './config.json')
|
|
23
|
+
.option('--config-schema', 'output the config schema and exit', false)
|
|
24
|
+
.option('--config-example', 'output an example config and exit', false)
|
|
20
25
|
.option('-p, --port [port]', 'set port', '3030')
|
|
21
26
|
.addOption(new Option('-f, --log-format <format>', 'set log format')
|
|
22
27
|
.choices(['json', 'pretty'])
|
|
23
28
|
.default('pretty'))
|
|
24
|
-
.addOption(new Option('-s, --store-type <type>', 'set store type')
|
|
25
|
-
.choices(['sqlite', 'postgres'])
|
|
26
|
-
.default('sqlite'))
|
|
27
29
|
.action((opts) => {
|
|
30
|
+
if (opts.configSchema) {
|
|
31
|
+
console.log(JSON.stringify(z.toJSONSchema(configSchema), null, 2));
|
|
32
|
+
process.exit(0);
|
|
33
|
+
}
|
|
34
|
+
if (opts.configExample) {
|
|
35
|
+
console.log(JSON.stringify(exampleConfig, null, 2));
|
|
36
|
+
process.exit(0);
|
|
37
|
+
}
|
|
28
38
|
// Define project-global logger
|
|
29
39
|
const logger = pino({
|
|
30
40
|
name: 'main',
|
|
@@ -43,9 +53,15 @@ const program = new Command()
|
|
|
43
53
|
// Parse only the options (without executing commands) to get config path
|
|
44
54
|
program.parseOptions(process.argv);
|
|
45
55
|
const options = program.opts();
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
56
|
+
// Add a documented stub
|
|
57
|
+
let db = new Command('db')
|
|
58
|
+
.description('Database management commands')
|
|
59
|
+
.allowUnknownOption(true);
|
|
60
|
+
const hasDb = process.argv.slice(2).includes('db');
|
|
61
|
+
if (hasDb) {
|
|
62
|
+
const config = ConfigUtils.loadConfigFile(options.config);
|
|
63
|
+
db = createCLI(config.store);
|
|
64
|
+
}
|
|
65
|
+
program.addCommand(db.name('db'));
|
|
50
66
|
// Now parse normally for execution/help
|
|
51
67
|
program.parseAsync(process.argv);
|
|
@@ -11,10 +11,16 @@ type SigningCbFn = (hash: string) => Promise<string>;
|
|
|
11
11
|
* This service provides an abstraction for Canton party allocation that seamlessly handles both internal and external parties.
|
|
12
12
|
*/
|
|
13
13
|
export declare class PartyAllocationService {
|
|
14
|
-
private synchronizerId;
|
|
15
14
|
private logger;
|
|
16
15
|
private ledgerClient;
|
|
17
|
-
|
|
16
|
+
private synchronizerId;
|
|
17
|
+
constructor({ synchronizerId, accessTokenProvider, httpLedgerUrl, logger, accessToken, }: {
|
|
18
|
+
synchronizerId?: string;
|
|
19
|
+
accessTokenProvider: AccessTokenProvider;
|
|
20
|
+
httpLedgerUrl: string;
|
|
21
|
+
logger: Logger;
|
|
22
|
+
accessToken?: string;
|
|
23
|
+
});
|
|
18
24
|
/**
|
|
19
25
|
* Allocates an internal participant party for a user.
|
|
20
26
|
* @param userId The ID of the user.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"party-allocation-service.d.ts","sourceRoot":"","sources":["../../src/ledger/party-allocation-service.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,2BAA2B,EAG9B,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAE7B,MAAM,MAAM,cAAc,GAAG;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,KAAK,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;AAEpD;;GAEG;AACH,qBAAa,sBAAsB;
|
|
1
|
+
{"version":3,"file":"party-allocation-service.d.ts","sourceRoot":"","sources":["../../src/ledger/party-allocation-service.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,2BAA2B,EAG9B,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAE7B,MAAM,MAAM,cAAc,GAAG;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,KAAK,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;AAEpD;;GAEG;AACH,qBAAa,sBAAsB;IAC/B,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,YAAY,CAAc;IAClC,OAAO,CAAC,cAAc,CAAoB;gBAE9B,EACR,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,MAAM,EACN,WAAW,GACd,EAAE;QACC,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,mBAAmB,EAAE,mBAAmB,CAAA;QACxC,aAAa,EAAE,MAAM,CAAA;QACrB,MAAM,EAAE,MAAM,CAAA;QACd,WAAW,CAAC,EAAE,MAAM,CAAA;KACvB;IAYD;;;;OAIG;IACG,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAE1E;;;;;;OAMG;IACG,aAAa,CACf,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,WAAW,GAC7B,OAAO,CAAC,cAAc,CAAC;IAoB1B;;;OAGG;IACH,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAMnD;;;;OAIG;IACG,4BAA4B,CAC9B,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,2BAA2B,CAAC;IAevC;;;;;;OAMG;IACG,+BAA+B,CACjC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EAAE,EACtB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC;YAgCJ,qBAAqB;YAuBrB,qBAAqB;CAsCtC"}
|
|
@@ -5,10 +5,10 @@ import { LedgerClient, TopologyWriteService, } from '@canton-network/core-ledger
|
|
|
5
5
|
* This service provides an abstraction for Canton party allocation that seamlessly handles both internal and external parties.
|
|
6
6
|
*/
|
|
7
7
|
export class PartyAllocationService {
|
|
8
|
-
constructor(synchronizerId, accessTokenProvider, httpLedgerUrl, logger, accessToken
|
|
9
|
-
this.synchronizerId = synchronizerId;
|
|
8
|
+
constructor({ synchronizerId, accessTokenProvider, httpLedgerUrl, logger, accessToken, }) {
|
|
10
9
|
this.logger = logger;
|
|
11
|
-
this.
|
|
10
|
+
this.synchronizerId = synchronizerId;
|
|
11
|
+
this.ledgerClient = new LedgerClient(new URL(httpLedgerUrl), this.logger, true, accessToken ?? '', accessTokenProvider);
|
|
12
12
|
}
|
|
13
13
|
async allocateParty(userId, hint, publicKey, signingCallback) {
|
|
14
14
|
if (publicKey !== undefined && signingCallback !== undefined) {
|
|
@@ -22,10 +22,12 @@ export class PartyAllocationService {
|
|
|
22
22
|
return TopologyWriteService.createFingerprintFromKey(publicKey);
|
|
23
23
|
}
|
|
24
24
|
async generateTopologyTransactions(hint, publicKey) {
|
|
25
|
-
|
|
25
|
+
const synchronizerId = this.synchronizerId ?? (await this.ledgerClient.getSynchronizerId());
|
|
26
|
+
return this.ledgerClient.generateTopology(synchronizerId, publicKey, hint);
|
|
26
27
|
}
|
|
27
28
|
async allocatePartyWithExistingWallet(namespace, transactions, signature, userId) {
|
|
28
|
-
const
|
|
29
|
+
const synchronizerId = this.synchronizerId ?? (await this.ledgerClient.getSynchronizerId());
|
|
30
|
+
const res = await this.ledgerClient.allocateExternalParty(synchronizerId, transactions.map((transaction) => ({
|
|
29
31
|
transaction,
|
|
30
32
|
})), [
|
|
31
33
|
{
|
|
@@ -51,10 +53,11 @@ export class PartyAllocationService {
|
|
|
51
53
|
return { hint, namespace, partyId: res.partyDetails.party };
|
|
52
54
|
}
|
|
53
55
|
async allocateExternalParty(userId, hint, publicKey, signingCallback) {
|
|
56
|
+
const synchronizerId = this.synchronizerId ?? (await this.ledgerClient.getSynchronizerId());
|
|
54
57
|
const namespace = this.createFingerprintFromKey(publicKey);
|
|
55
58
|
const transactions = await this.generateTopologyTransactions(hint, publicKey);
|
|
56
59
|
const signature = await signingCallback(transactions.multiHash);
|
|
57
|
-
const res = await this.ledgerClient.allocateExternalParty(
|
|
60
|
+
const res = await this.ledgerClient.allocateExternalParty(synchronizerId, transactions.topologyTransactions.map((transaction) => ({
|
|
58
61
|
transaction,
|
|
59
62
|
})), [
|
|
60
63
|
{
|