@canton-network/wallet-gateway-remote 0.18.0 → 0.19.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/Config.d.ts +19 -15
- package/dist/config/Config.d.ts.map +1 -1
- package/dist/config/Config.js +5 -1
- package/dist/config/Config.test.js +8 -8
- package/dist/config/ConfigUtils.js +6 -6
- package/dist/dapp-api/controller.d.ts.map +1 -1
- package/dist/dapp-api/controller.js +71 -31
- package/dist/dapp-api/rpc-gen/typings.d.ts +41 -54
- package/dist/dapp-api/rpc-gen/typings.d.ts.map +1 -1
- package/dist/dapp-api/server.test.js +1 -5
- package/dist/example-config.d.ts +3 -0
- package/dist/example-config.d.ts.map +1 -1
- package/dist/example-config.js +3 -0
- package/dist/index.js +2 -2
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +10 -5
- package/dist/ledger/wallet-sync-service.test.js +3 -0
- package/dist/user-api/controller.d.ts +3 -1
- package/dist/user-api/controller.d.ts.map +1 -1
- package/dist/user-api/controller.js +120 -40
- package/dist/user-api/rpc-gen/index.d.ts +6 -0
- package/dist/user-api/rpc-gen/index.d.ts.map +1 -1
- package/dist/user-api/rpc-gen/index.js +2 -0
- package/dist/user-api/rpc-gen/typings.d.ts +37 -24
- package/dist/user-api/rpc-gen/typings.d.ts.map +1 -1
- package/dist/user-api/server.d.ts +1 -1
- package/dist/user-api/server.d.ts.map +1 -1
- package/dist/user-api/server.js +2 -2
- package/dist/user-api/server.test.js +1 -1
- package/dist/utils.d.ts +2 -3
- package/dist/utils.d.ts.map +1 -1
- package/dist/web/frontend/404/index.html +5 -5
- package/dist/web/frontend/approve/index.html +6 -6
- package/dist/web/frontend/assets/404-BQsvObfu.js +8 -0
- package/dist/web/frontend/assets/approve-BLORPbEM.js +17 -0
- package/dist/web/frontend/assets/{callback-CVGmyjFw.js → callback-C7kRcm3U.js} +1 -1
- package/dist/web/frontend/assets/index-DPbaEEZi.js +1722 -0
- package/dist/web/frontend/assets/{decode-CLJkuAIr.js → index-NP2zGQqX.js} +1 -1
- package/dist/web/frontend/assets/login-p5H_f9In.js +7 -0
- package/dist/web/frontend/assets/settings-89wZp5vZ.js +37 -0
- package/dist/web/frontend/assets/{state-D-NnR2Q_.js → state-TjGUBiUh.js} +1 -1
- package/dist/web/frontend/assets/transactions-BnROcA2_.js +28 -0
- package/dist/web/frontend/assets/wallets-TPeR2lS2.js +63 -0
- package/dist/web/frontend/callback/index.html +4 -4
- package/dist/web/frontend/index.html +3 -3
- package/dist/web/frontend/login/index.html +5 -5
- package/dist/web/frontend/settings/index.html +5 -5
- package/dist/web/frontend/transactions/index.html +6 -6
- package/dist/web/frontend/wallets/index.html +5 -5
- package/package.json +19 -19
- package/dist/web/frontend/assets/404-Cdu0PFS_.js +0 -16
- package/dist/web/frontend/assets/approve-B-AjC3qs.js +0 -227
- package/dist/web/frontend/assets/index-7OK83THX.css +0 -1
- package/dist/web/frontend/assets/index-DUTzHvwi.js +0 -1158
- package/dist/web/frontend/assets/login-BpjPKEmn.js +0 -186
- package/dist/web/frontend/assets/settings-DFCq6vOq.js +0 -28
- package/dist/web/frontend/assets/transactions-Cn8Y2p7-.js +0 -140
- package/dist/web/frontend/assets/wallets-B4lynciv.js +0 -267
package/dist/config/Config.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare const serverConfigSchema: z.ZodObject<{
|
|
|
13
13
|
tls: z.ZodOptional<z.ZodBoolean>;
|
|
14
14
|
requestSizeLimit: z.ZodDefault<z.ZodString>;
|
|
15
15
|
requestRateLimit: z.ZodDefault<z.ZodNumber>;
|
|
16
|
+
admin: z.ZodOptional<z.ZodString>;
|
|
16
17
|
}, z.core.$strip>;
|
|
17
18
|
export declare const configSchema: z.ZodObject<{
|
|
18
19
|
kernel: z.ZodObject<{
|
|
@@ -29,6 +30,7 @@ export declare const configSchema: z.ZodObject<{
|
|
|
29
30
|
tls: z.ZodOptional<z.ZodBoolean>;
|
|
30
31
|
requestSizeLimit: z.ZodDefault<z.ZodString>;
|
|
31
32
|
requestRateLimit: z.ZodDefault<z.ZodNumber>;
|
|
33
|
+
admin: z.ZodOptional<z.ZodString>;
|
|
32
34
|
}, z.core.$strip>>;
|
|
33
35
|
store: z.ZodObject<{
|
|
34
36
|
connection: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -44,6 +46,23 @@ export declare const configSchema: z.ZodObject<{
|
|
|
44
46
|
password: z.ZodString;
|
|
45
47
|
database: z.ZodString;
|
|
46
48
|
}, z.core.$strip>], "type">;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
signingStore: z.ZodObject<{
|
|
51
|
+
connection: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
52
|
+
type: z.ZodLiteral<"memory">;
|
|
53
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
54
|
+
type: z.ZodLiteral<"sqlite">;
|
|
55
|
+
database: z.ZodString;
|
|
56
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
57
|
+
type: z.ZodLiteral<"postgres">;
|
|
58
|
+
host: z.ZodString;
|
|
59
|
+
port: z.ZodNumber;
|
|
60
|
+
user: z.ZodString;
|
|
61
|
+
password: z.ZodString;
|
|
62
|
+
database: z.ZodString;
|
|
63
|
+
}, z.core.$strip>], "type">;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
bootstrap: z.ZodObject<{
|
|
47
66
|
idps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
48
67
|
id: z.ZodString;
|
|
49
68
|
type: z.ZodLiteral<"self_signed">;
|
|
@@ -103,21 +122,6 @@ export declare const configSchema: z.ZodObject<{
|
|
|
103
122
|
}, z.core.$strip>], "method">>;
|
|
104
123
|
}, z.core.$strip>>;
|
|
105
124
|
}, z.core.$strip>;
|
|
106
|
-
signingStore: z.ZodObject<{
|
|
107
|
-
connection: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
108
|
-
type: z.ZodLiteral<"memory">;
|
|
109
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
110
|
-
type: z.ZodLiteral<"sqlite">;
|
|
111
|
-
database: z.ZodString;
|
|
112
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
113
|
-
type: z.ZodLiteral<"postgres">;
|
|
114
|
-
host: z.ZodString;
|
|
115
|
-
port: z.ZodNumber;
|
|
116
|
-
user: z.ZodString;
|
|
117
|
-
password: z.ZodString;
|
|
118
|
-
database: z.ZodString;
|
|
119
|
-
}, z.core.$strip>], "type">;
|
|
120
|
-
}, z.core.$strip>;
|
|
121
125
|
}, z.core.$strip>;
|
|
122
126
|
export type KernelInfo = z.infer<typeof kernelInfoSchema>;
|
|
123
127
|
export type ServerConfig = z.infer<typeof serverConfigSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/config/Config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/config/Config.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,gBAAgB;;;;iBAY3B,CAAA;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;iBA0C7B,CAAA;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMvB,CAAA;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AACzD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAC7D,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA"}
|
package/dist/config/Config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { storeConfigSchema } from '@canton-network/core-wallet-store';
|
|
3
|
+
import { storeConfigSchema, bootstrapConfigSchema, } from '@canton-network/core-wallet-store';
|
|
4
4
|
import { storeConfigSchema as signingStoreConfigSchema } from '@canton-network/core-signing-store-sql';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
export const kernelInfoSchema = z.object({
|
|
@@ -47,10 +47,14 @@ export const serverConfigSchema = z.object({
|
|
|
47
47
|
requestRateLimit: z.number().default(10000).meta({
|
|
48
48
|
description: 'The maximum number of requests per minute from a single IP address. Defaults to 10000.',
|
|
49
49
|
}),
|
|
50
|
+
admin: z.string().optional().meta({
|
|
51
|
+
description: 'The JWT claim (e.g. "sub") identifying the admin user. If set, requests with a matching claim will be granted admin privileges.',
|
|
52
|
+
}),
|
|
50
53
|
});
|
|
51
54
|
export const configSchema = z.object({
|
|
52
55
|
kernel: kernelInfoSchema,
|
|
53
56
|
server: z.preprocess((val) => val ?? {}, serverConfigSchema),
|
|
54
57
|
store: storeConfigSchema,
|
|
55
58
|
signingStore: signingStoreConfigSchema,
|
|
59
|
+
bootstrap: bootstrapConfigSchema,
|
|
56
60
|
});
|
|
@@ -4,13 +4,13 @@ import { expect, test } from '@jest/globals';
|
|
|
4
4
|
import { ConfigUtils } from './ConfigUtils.js';
|
|
5
5
|
test('config from json file', async () => {
|
|
6
6
|
const resp = ConfigUtils.loadConfigFile('../test/config.json');
|
|
7
|
-
expect(resp.
|
|
8
|
-
expect(resp.
|
|
9
|
-
expect(resp.
|
|
10
|
-
expect(resp.
|
|
11
|
-
expect(resp.
|
|
12
|
-
expect(resp.
|
|
13
|
-
if (resp.
|
|
14
|
-
expect(resp.
|
|
7
|
+
expect(resp.bootstrap.networks[0].name).toBe('Local (OAuth IDP)');
|
|
8
|
+
expect(resp.bootstrap.networks[0].ledgerApi.baseUrl).toBe('http://127.0.0.1:5003');
|
|
9
|
+
expect(resp.bootstrap.networks[0].auth.clientId).toBe('operator');
|
|
10
|
+
expect(resp.bootstrap.networks[0].auth.scope).toBe('openid daml_ledger_api offline_access');
|
|
11
|
+
expect(resp.bootstrap.networks[0].auth.method).toBe('authorization_code');
|
|
12
|
+
expect(resp.bootstrap.networks[2].auth.method).toBe('client_credentials');
|
|
13
|
+
if (resp.bootstrap.networks[2].auth.method === 'client_credentials') {
|
|
14
|
+
expect(resp.bootstrap.networks[2].auth.audience).toBe('https://daml.com/jwt/aud/participant/participant1::1220d44fc1c3ba0b5bdf7b956ee71bc94ebe2d23258dc268fdf0824fbaeff2c61424');
|
|
15
15
|
}
|
|
16
16
|
});
|
|
@@ -15,11 +15,11 @@ export class ConfigUtils {
|
|
|
15
15
|
* 3. Each Network's identityProviderId maps to an existing IDP (in config)
|
|
16
16
|
* 4. Each Network's auth method is compatible with its IDP type
|
|
17
17
|
*/
|
|
18
|
-
const duplicateIdpId = hasDuplicateElement(config.
|
|
18
|
+
const duplicateIdpId = hasDuplicateElement(config.bootstrap.idps.map((idp) => idp.id));
|
|
19
19
|
if (duplicateIdpId) {
|
|
20
20
|
throw new Error(`Non-unique IDP IDs found in config file: ${duplicateIdpId}`);
|
|
21
21
|
}
|
|
22
|
-
const duplicateNetworkId = hasDuplicateElement(config.
|
|
22
|
+
const duplicateNetworkId = hasDuplicateElement(config.bootstrap.networks.map((network) => network.id));
|
|
23
23
|
if (duplicateNetworkId) {
|
|
24
24
|
throw new Error(`Non-unique Network IDs found in config file: ${duplicateNetworkId}`);
|
|
25
25
|
}
|
|
@@ -48,8 +48,8 @@ function hasDuplicateElement(list) {
|
|
|
48
48
|
return duplicate;
|
|
49
49
|
}
|
|
50
50
|
function validateNetworkToIdpMapping(config) {
|
|
51
|
-
for (const network of config.
|
|
52
|
-
const idp = config.
|
|
51
|
+
for (const network of config.bootstrap.networks) {
|
|
52
|
+
const idp = config.bootstrap.idps.find((idp) => idp.id === network.identityProviderId);
|
|
53
53
|
if (typeof idp === 'undefined') {
|
|
54
54
|
return { networkId: network.id, idpId: network.identityProviderId };
|
|
55
55
|
}
|
|
@@ -60,8 +60,8 @@ const SUPPORTED_IDP_METHODS = {
|
|
|
60
60
|
oauth: ['authorization_code', 'client_credentials'],
|
|
61
61
|
};
|
|
62
62
|
function validateNetworkAuthMethods(config) {
|
|
63
|
-
for (const network of config.
|
|
64
|
-
const idp = config.
|
|
63
|
+
for (const network of config.bootstrap.networks) {
|
|
64
|
+
const idp = config.bootstrap.idps.find((idp) => idp.id === network.identityProviderId);
|
|
65
65
|
if (!SUPPORTED_IDP_METHODS[idp.type].includes(network.auth.method)) {
|
|
66
66
|
return {
|
|
67
67
|
networkId: network.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/dapp-api/controller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAW/E,OAAO,EAAE,KAAK,EAAe,MAAM,mCAAmC,CAAA;AAQtE,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,SAAS,MAAM,EACf,SAAS,MAAM,EACf,OAAO,KAAK,EACZ,qBAAqB,mBAAmB,EACxC,SAAS,MAAM,EACf,QAAQ,MAAM,GAAG,IAAI,EACrB,UAAU,WAAW;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/dapp-api/controller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAW/E,OAAO,EAAE,KAAK,EAAe,MAAM,mCAAmC,CAAA;AAQtE,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,SAAS,MAAM,EACf,SAAS,MAAM,EACf,OAAO,KAAK,EACZ,qBAAqB,mBAAmB,EACxC,SAAS,MAAM,EACf,QAAQ,MAAM,GAAG,IAAI,EACrB,UAAU,WAAW;;;;;;;;;;;;;;CAwQxB,CAAA"}
|
|
@@ -11,14 +11,13 @@ export const dappController = (kernelInfo, dappUrl, userUrl, store, notification
|
|
|
11
11
|
connect: async () => {
|
|
12
12
|
if (!context || !(await store.getSession())) {
|
|
13
13
|
return {
|
|
14
|
-
kernel: kernelInfo,
|
|
15
14
|
isConnected: false,
|
|
16
15
|
isNetworkConnected: false,
|
|
17
16
|
networkReason: 'Unauthenticated',
|
|
18
17
|
userUrl: `${userUrl}/login/`,
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
|
-
const session = await store.getSession()
|
|
20
|
+
// const session = await store.getSession()
|
|
22
21
|
const network = await store.getCurrentNetwork();
|
|
23
22
|
const ledgerClient = new LedgerClient({
|
|
24
23
|
baseUrl: new URL(network.ledgerApi.baseUrl),
|
|
@@ -28,26 +27,35 @@ export const dappController = (kernelInfo, dappUrl, userUrl, store, notification
|
|
|
28
27
|
});
|
|
29
28
|
const status = await networkStatus(ledgerClient);
|
|
30
29
|
const notifier = notificationService.getNotifier(context.userId);
|
|
31
|
-
const
|
|
32
|
-
|
|
30
|
+
const provider = {
|
|
31
|
+
id: kernelInfo.id,
|
|
32
|
+
version: 'TODO',
|
|
33
|
+
providerType: kernelInfo.clientType,
|
|
34
|
+
url: dappUrl,
|
|
35
|
+
userUrl: `${userUrl}/login/`,
|
|
36
|
+
};
|
|
37
|
+
const connection = {
|
|
33
38
|
isConnected: true,
|
|
39
|
+
reason: 'OK',
|
|
34
40
|
isNetworkConnected: status.isConnected,
|
|
35
41
|
networkReason: status.reason ? status.reason : 'OK',
|
|
42
|
+
userUrl: `${userUrl}/login/`,
|
|
43
|
+
};
|
|
44
|
+
const statusEvent = {
|
|
45
|
+
provider,
|
|
46
|
+
connection,
|
|
36
47
|
network: {
|
|
37
48
|
networkId: network.id,
|
|
38
|
-
ledgerApi:
|
|
39
|
-
|
|
40
|
-
},
|
|
49
|
+
ledgerApi: network.ledgerApi.baseUrl,
|
|
50
|
+
accessToken: context.accessToken,
|
|
41
51
|
},
|
|
42
52
|
session: {
|
|
43
|
-
id: session?.id,
|
|
44
53
|
accessToken: context.accessToken,
|
|
45
54
|
userId: context.userId,
|
|
46
55
|
},
|
|
47
|
-
userUrl: `${userUrl}/login/`,
|
|
48
56
|
};
|
|
49
|
-
notifier.emit('statusChanged',
|
|
50
|
-
return
|
|
57
|
+
notifier.emit('statusChanged', statusEvent);
|
|
58
|
+
return connection;
|
|
51
59
|
},
|
|
52
60
|
disconnect: async () => {
|
|
53
61
|
if (!context) {
|
|
@@ -57,11 +65,18 @@ export const dappController = (kernelInfo, dappUrl, userUrl, store, notification
|
|
|
57
65
|
const notifier = notificationService.getNotifier(context.userId);
|
|
58
66
|
await store.removeSession();
|
|
59
67
|
notifier.emit('statusChanged', {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
68
|
+
provider: {
|
|
69
|
+
id: kernelInfo.id,
|
|
70
|
+
providerType: kernelInfo.clientType,
|
|
71
|
+
url: dappUrl,
|
|
72
|
+
userUrl: `${userUrl}/login/`,
|
|
73
|
+
},
|
|
74
|
+
connection: {
|
|
75
|
+
isConnected: false,
|
|
76
|
+
reason: 'disconnect',
|
|
77
|
+
isNetworkConnected: false,
|
|
78
|
+
networkReason: 'disconnect',
|
|
79
|
+
},
|
|
65
80
|
});
|
|
66
81
|
}
|
|
67
82
|
return null;
|
|
@@ -113,28 +128,51 @@ export const dappController = (kernelInfo, dappUrl, userUrl, store, notification
|
|
|
113
128
|
notifier.emit('txChanged', { status: 'pending', commandId });
|
|
114
129
|
const synchronizerId = network.synchronizerId ??
|
|
115
130
|
(await ledgerClient.getSynchronizerId());
|
|
116
|
-
const
|
|
131
|
+
const response = await prepareSubmission(context.userId, wallet.partyId, synchronizerId, params, ledgerClient);
|
|
132
|
+
//TODO: remove and handle normally when v3_3 is not supported anymore
|
|
133
|
+
const costEstimation = 'costEstimation' in response
|
|
134
|
+
? response.costEstimation
|
|
135
|
+
: undefined;
|
|
117
136
|
const transaction = {
|
|
118
137
|
commandId,
|
|
119
138
|
status: 'pending',
|
|
120
|
-
preparedTransaction,
|
|
121
|
-
preparedTransactionHash,
|
|
139
|
+
preparedTransaction: response.preparedTransaction,
|
|
140
|
+
preparedTransactionHash: response.preparedTransactionHash,
|
|
122
141
|
payload: params,
|
|
123
142
|
origin: origin || null,
|
|
124
143
|
createdAt: new Date(),
|
|
125
144
|
};
|
|
145
|
+
logger.info({
|
|
146
|
+
actAs: params.actAs || [wallet.partyId],
|
|
147
|
+
readAs: params.readAs || [],
|
|
148
|
+
userId: context.userId,
|
|
149
|
+
commandId,
|
|
150
|
+
commands: params.commands?.[0],
|
|
151
|
+
confirmationRequestTrafficCostEstimation: costEstimation?.confirmationRequestTrafficCostEstimation,
|
|
152
|
+
}, 'prepared transaction traffic estimation');
|
|
126
153
|
store.setTransaction(transaction);
|
|
127
154
|
return {
|
|
128
|
-
|
|
155
|
+
// closeafteraction query param flag makes approving or deleting tx close the popup
|
|
156
|
+
userUrl: `${userUrl}/approve/index.html?commandId=${commandId}&closeafteraction`,
|
|
129
157
|
};
|
|
130
158
|
},
|
|
131
159
|
status: async () => {
|
|
160
|
+
const provider = {
|
|
161
|
+
id: kernelInfo.id,
|
|
162
|
+
version: 'TODO',
|
|
163
|
+
providerType: kernelInfo.clientType,
|
|
164
|
+
url: dappUrl,
|
|
165
|
+
userUrl: `${userUrl}/login/`,
|
|
166
|
+
};
|
|
132
167
|
if (!context || !(await store.getSession())) {
|
|
133
168
|
return {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
169
|
+
provider: provider,
|
|
170
|
+
connection: {
|
|
171
|
+
isConnected: false,
|
|
172
|
+
reason: 'Unauthenticated',
|
|
173
|
+
isNetworkConnected: false,
|
|
174
|
+
networkReason: 'Unauthenticated',
|
|
175
|
+
},
|
|
138
176
|
};
|
|
139
177
|
}
|
|
140
178
|
const session = await store.getSession();
|
|
@@ -147,15 +185,17 @@ export const dappController = (kernelInfo, dappUrl, userUrl, store, notification
|
|
|
147
185
|
});
|
|
148
186
|
const status = await networkStatus(ledgerClient);
|
|
149
187
|
return {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
188
|
+
provider: provider,
|
|
189
|
+
connection: {
|
|
190
|
+
isConnected: true,
|
|
191
|
+
reason: 'OK',
|
|
192
|
+
isNetworkConnected: status.isConnected,
|
|
193
|
+
networkReason: status.reason ? status.reason : 'OK',
|
|
194
|
+
},
|
|
154
195
|
network: {
|
|
155
196
|
networkId: network.id,
|
|
156
|
-
ledgerApi:
|
|
157
|
-
|
|
158
|
-
},
|
|
197
|
+
ledgerApi: network.ledgerApi.baseUrl,
|
|
198
|
+
accessToken: context.accessToken,
|
|
159
199
|
},
|
|
160
200
|
session: {
|
|
161
201
|
id: session?.id,
|
|
@@ -64,7 +64,6 @@ export interface DisclosedContract {
|
|
|
64
64
|
contractId?: ContractId;
|
|
65
65
|
createdEventBlob: CreatedEventBlob;
|
|
66
66
|
synchronizerId?: SynchronizerId;
|
|
67
|
-
[k: string]: any;
|
|
68
67
|
}
|
|
69
68
|
/**
|
|
70
69
|
*
|
|
@@ -90,19 +89,25 @@ export type Resource = string;
|
|
|
90
89
|
export type Body = string;
|
|
91
90
|
/**
|
|
92
91
|
*
|
|
93
|
-
* The unique identifier of the
|
|
92
|
+
* The unique identifier of the Provider.
|
|
94
93
|
*
|
|
95
94
|
*/
|
|
96
|
-
export type
|
|
95
|
+
export type ProviderId = string;
|
|
97
96
|
/**
|
|
98
97
|
*
|
|
99
|
-
* The
|
|
98
|
+
* The version of the Provider.
|
|
100
99
|
*
|
|
101
100
|
*/
|
|
102
|
-
export type
|
|
101
|
+
export type Version = string;
|
|
103
102
|
/**
|
|
104
103
|
*
|
|
105
|
-
* The
|
|
104
|
+
* The type of client that implements the Provider.
|
|
105
|
+
*
|
|
106
|
+
*/
|
|
107
|
+
export type ProviderType = 'browser' | 'desktop' | 'mobile' | 'remote';
|
|
108
|
+
/**
|
|
109
|
+
*
|
|
110
|
+
* The URL of the Wallet Provider.
|
|
106
111
|
*
|
|
107
112
|
*/
|
|
108
113
|
export type Url = string;
|
|
@@ -114,15 +119,15 @@ export type Url = string;
|
|
|
114
119
|
export type UserUrl = string;
|
|
115
120
|
/**
|
|
116
121
|
*
|
|
117
|
-
* Represents a
|
|
122
|
+
* Represents a Provider.
|
|
118
123
|
*
|
|
119
124
|
*/
|
|
120
|
-
export interface
|
|
121
|
-
id:
|
|
122
|
-
|
|
125
|
+
export interface Provider {
|
|
126
|
+
id: ProviderId;
|
|
127
|
+
version?: Version;
|
|
128
|
+
providerType?: ProviderType;
|
|
123
129
|
url?: Url;
|
|
124
130
|
userUrl?: UserUrl;
|
|
125
|
-
[k: string]: any;
|
|
126
131
|
}
|
|
127
132
|
/**
|
|
128
133
|
*
|
|
@@ -130,6 +135,12 @@ export interface KernelInfo {
|
|
|
130
135
|
*
|
|
131
136
|
*/
|
|
132
137
|
export type IsConnected = boolean;
|
|
138
|
+
/**
|
|
139
|
+
*
|
|
140
|
+
* Reason for the wallet state, e.g., 'no signing provider matched'.
|
|
141
|
+
*
|
|
142
|
+
*/
|
|
143
|
+
export type Reason = string;
|
|
133
144
|
/**
|
|
134
145
|
*
|
|
135
146
|
* Whether or not a connection to a network is established.
|
|
@@ -142,6 +153,13 @@ export type IsNetworkConnected = boolean;
|
|
|
142
153
|
*
|
|
143
154
|
*/
|
|
144
155
|
export type NetworkReason = string;
|
|
156
|
+
export interface ConnectResult {
|
|
157
|
+
isConnected: IsConnected;
|
|
158
|
+
reason?: Reason;
|
|
159
|
+
isNetworkConnected: IsNetworkConnected;
|
|
160
|
+
networkReason?: NetworkReason;
|
|
161
|
+
userUrl?: UserUrl;
|
|
162
|
+
}
|
|
145
163
|
/**
|
|
146
164
|
*
|
|
147
165
|
* The network ID the wallet corresponds to.
|
|
@@ -153,16 +171,13 @@ export type NetworkId = string;
|
|
|
153
171
|
* The base URL of the ledger API.
|
|
154
172
|
*
|
|
155
173
|
*/
|
|
156
|
-
export type
|
|
174
|
+
export type LedgerApiUrl = string;
|
|
157
175
|
/**
|
|
158
176
|
*
|
|
159
|
-
*
|
|
177
|
+
* JWT authentication token.
|
|
160
178
|
*
|
|
161
179
|
*/
|
|
162
|
-
export
|
|
163
|
-
baseUrl: BaseUrl;
|
|
164
|
-
[k: string]: any;
|
|
165
|
-
}
|
|
180
|
+
export type AccessToken = string;
|
|
166
181
|
/**
|
|
167
182
|
*
|
|
168
183
|
* Network information, if connected to a network.
|
|
@@ -170,15 +185,9 @@ export interface LedgerApiConfig {
|
|
|
170
185
|
*/
|
|
171
186
|
export interface Network {
|
|
172
187
|
networkId: NetworkId;
|
|
173
|
-
ledgerApi?:
|
|
174
|
-
|
|
188
|
+
ledgerApi?: LedgerApiUrl;
|
|
189
|
+
accessToken?: AccessToken;
|
|
175
190
|
}
|
|
176
|
-
/**
|
|
177
|
-
*
|
|
178
|
-
* JWT authentication token.
|
|
179
|
-
*
|
|
180
|
-
*/
|
|
181
|
-
export type AccessToken = string;
|
|
182
191
|
/**
|
|
183
192
|
*
|
|
184
193
|
* The user identifier.
|
|
@@ -193,20 +202,6 @@ export type UserId = string;
|
|
|
193
202
|
export interface Session {
|
|
194
203
|
accessToken: AccessToken;
|
|
195
204
|
userId: UserId;
|
|
196
|
-
[k: string]: any;
|
|
197
|
-
}
|
|
198
|
-
export interface StatusEvent {
|
|
199
|
-
kernel: KernelInfo;
|
|
200
|
-
isConnected: IsConnected;
|
|
201
|
-
isNetworkConnected: IsNetworkConnected;
|
|
202
|
-
networkReason?: NetworkReason;
|
|
203
|
-
network?: Network;
|
|
204
|
-
session?: Session;
|
|
205
|
-
[k: string]: any;
|
|
206
|
-
}
|
|
207
|
-
export interface ConnectResult {
|
|
208
|
-
userUrl: UserUrl;
|
|
209
|
-
[k: string]: any;
|
|
210
205
|
}
|
|
211
206
|
/**
|
|
212
207
|
*
|
|
@@ -275,12 +270,6 @@ export type TopologyTransactions = string;
|
|
|
275
270
|
*
|
|
276
271
|
*/
|
|
277
272
|
export type Disabled = boolean;
|
|
278
|
-
/**
|
|
279
|
-
*
|
|
280
|
-
* Reason for the wallet state, e.g., 'no signing provider matched'.
|
|
281
|
-
*
|
|
282
|
-
*/
|
|
283
|
-
export type Reason = string;
|
|
284
273
|
/**
|
|
285
274
|
*
|
|
286
275
|
* Structure representing a wallet
|
|
@@ -299,7 +288,6 @@ export interface Wallet {
|
|
|
299
288
|
topologyTransactions?: TopologyTransactions;
|
|
300
289
|
disabled?: Disabled;
|
|
301
290
|
reason?: Reason;
|
|
302
|
-
[k: string]: any;
|
|
303
291
|
}
|
|
304
292
|
/**
|
|
305
293
|
*
|
|
@@ -408,7 +396,6 @@ export interface PrepareExecuteParams {
|
|
|
408
396
|
disclosedContracts?: DisclosedContracts;
|
|
409
397
|
synchronizerId?: SynchronizerId;
|
|
410
398
|
packageIdSelectionPreference?: PackageIdSelectionPreference;
|
|
411
|
-
[k: string]: any;
|
|
412
399
|
}
|
|
413
400
|
/**
|
|
414
401
|
*
|
|
@@ -417,7 +404,6 @@ export interface PrepareExecuteParams {
|
|
|
417
404
|
*/
|
|
418
405
|
export interface SignMessageParams {
|
|
419
406
|
message: Message;
|
|
420
|
-
[k: string]: any;
|
|
421
407
|
}
|
|
422
408
|
/**
|
|
423
409
|
*
|
|
@@ -428,9 +414,13 @@ export interface LedgerApiParams {
|
|
|
428
414
|
requestMethod: RequestMethod;
|
|
429
415
|
resource: Resource;
|
|
430
416
|
body?: Body;
|
|
431
|
-
[k: string]: any;
|
|
432
417
|
}
|
|
433
|
-
export
|
|
418
|
+
export interface StatusEvent {
|
|
419
|
+
provider: Provider;
|
|
420
|
+
connection: ConnectResult;
|
|
421
|
+
network?: Network;
|
|
422
|
+
session?: Session;
|
|
423
|
+
}
|
|
434
424
|
/**
|
|
435
425
|
*
|
|
436
426
|
* Represents a null value, used in responses where no data is returned.
|
|
@@ -439,7 +429,6 @@ export type StatusEventAsync = StatusEvent & ConnectResult;
|
|
|
439
429
|
export type Null = null;
|
|
440
430
|
export interface PrepareExecuteResult {
|
|
441
431
|
userUrl: UserUrl;
|
|
442
|
-
[k: string]: any;
|
|
443
432
|
}
|
|
444
433
|
/**
|
|
445
434
|
*
|
|
@@ -448,7 +437,6 @@ export interface PrepareExecuteResult {
|
|
|
448
437
|
*/
|
|
449
438
|
export interface SignMessageResult {
|
|
450
439
|
signature: Signature;
|
|
451
|
-
[k: string]: any;
|
|
452
440
|
}
|
|
453
441
|
/**
|
|
454
442
|
*
|
|
@@ -457,7 +445,6 @@ export interface SignMessageResult {
|
|
|
457
445
|
*/
|
|
458
446
|
export interface LedgerApiResult {
|
|
459
447
|
response: Response;
|
|
460
|
-
[k: string]: any;
|
|
461
448
|
}
|
|
462
449
|
/**
|
|
463
450
|
*
|
|
@@ -483,7 +470,7 @@ export type TxChangedEvent = TxChangedPendingEvent | TxChangedSignedEvent | TxCh
|
|
|
483
470
|
*
|
|
484
471
|
*/
|
|
485
472
|
export type Status = () => Promise<StatusEvent>;
|
|
486
|
-
export type Connect = () => Promise<
|
|
473
|
+
export type Connect = () => Promise<ConnectResult>;
|
|
487
474
|
export type Disconnect = () => Promise<Null>;
|
|
488
475
|
export type GetActiveNetwork = () => Promise<Network>;
|
|
489
476
|
export type PrepareExecute = (params: PrepareExecuteParams) => Promise<PrepareExecuteResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typings.d.ts","sourceRoot":"","sources":["../../../src/dapp-api/rpc-gen/typings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typings.d.ts","sourceRoot":"","sources":["../../../src/dapp-api/rpc-gen/typings.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAE9B;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACrB;AACD;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAA;AAC1B;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG,KAAK,EAAE,CAAA;AAC3B;;;;GAIG;AACH,MAAM,MAAM,MAAM,GAAG,KAAK,EAAE,CAAA;AAC5B;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAA;AAC/B;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAA;AAC/B;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAA;AACrC;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAA;AACnC;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,cAAc,CAAC,EAAE,cAAc,CAAA;CAClC;AACD;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,EAAE,CAAA;AACpD,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAC9B;;;;GAIG;AACH,MAAM,MAAM,4BAA4B,GAAG,SAAS,EAAE,CAAA;AACtD;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAA;AAC5B,MAAM,MAAM,aAAa,GA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G,MAAM,EAAE,CAAA;AACzC;;;;GAIG;AACH,MAAM,MAAM,cAAc,GACpB,qBAAqB,GACrB,oBAAoB,GACpB,sBAAsB,GACtB,oBAAoB,CAAA;AAC1B;;;;GAIG;AAEH,MAAM,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAA;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,gBAAgB,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;AACrD,MAAM,MAAM,cAAc,GAAG,CACzB,MAAM,EAAE,oBAAoB,KAC3B,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAClC,MAAM,MAAM,WAAW,GAAG,CACtB,MAAM,EAAE,iBAAiB,KACxB,OAAO,CAAC,iBAAiB,CAAC,CAAA;AAC/B,MAAM,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,eAAe,CAAC,CAAA;AAC7E,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAA;AAClD,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAA;AACxD,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,CAAC,oBAAoB,CAAC,CAAA;AACjE,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;AACrD,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAC5D,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,CAAA"}
|
|
@@ -18,7 +18,7 @@ const authService = {
|
|
|
18
18
|
};
|
|
19
19
|
const configPath = '../test/config.json';
|
|
20
20
|
const config = ConfigUtils.loadConfigFile(configPath);
|
|
21
|
-
const store = new StoreInternal(config.
|
|
21
|
+
const store = new StoreInternal(config.bootstrap, pino(sink()));
|
|
22
22
|
const notificationService = new NotificationService(pino(sink()));
|
|
23
23
|
test('call connect rpc', async () => {
|
|
24
24
|
const app = express();
|
|
@@ -35,10 +35,6 @@ test('call connect rpc', async () => {
|
|
|
35
35
|
id: 0,
|
|
36
36
|
jsonrpc: '2.0',
|
|
37
37
|
result: {
|
|
38
|
-
kernel: {
|
|
39
|
-
id: 'remote-da',
|
|
40
|
-
clientType: 'remote',
|
|
41
|
-
},
|
|
42
38
|
isConnected: false,
|
|
43
39
|
isNetworkConnected: false,
|
|
44
40
|
networkReason: 'Unauthenticated',
|
package/dist/example-config.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ declare const _default: {
|
|
|
10
10
|
allowedOrigins: "*";
|
|
11
11
|
requestSizeLimit: string;
|
|
12
12
|
requestRateLimit: number;
|
|
13
|
+
admin: string;
|
|
13
14
|
};
|
|
14
15
|
signingStore: {
|
|
15
16
|
connection: {
|
|
@@ -22,6 +23,8 @@ declare const _default: {
|
|
|
22
23
|
type: "sqlite";
|
|
23
24
|
database: string;
|
|
24
25
|
};
|
|
26
|
+
};
|
|
27
|
+
bootstrap: {
|
|
25
28
|
idps: ({
|
|
26
29
|
id: string;
|
|
27
30
|
type: "self_signed";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example-config.d.ts","sourceRoot":"","sources":["../src/example-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"example-config.d.ts","sourceRoot":"","sources":["../src/example-config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBA6FkB"}
|
package/dist/example-config.js
CHANGED
|
@@ -12,6 +12,7 @@ export default {
|
|
|
12
12
|
allowedOrigins: '*',
|
|
13
13
|
requestSizeLimit: '5mb',
|
|
14
14
|
requestRateLimit: 10000,
|
|
15
|
+
admin: 'sub',
|
|
15
16
|
},
|
|
16
17
|
signingStore: {
|
|
17
18
|
connection: {
|
|
@@ -24,6 +25,8 @@ export default {
|
|
|
24
25
|
type: 'sqlite',
|
|
25
26
|
database: 'store.sqlite',
|
|
26
27
|
},
|
|
28
|
+
},
|
|
29
|
+
bootstrap: {
|
|
27
30
|
idps: [
|
|
28
31
|
{
|
|
29
32
|
id: 'idp-example-self-signed',
|