@canton-network/wallet-gateway-remote 1.6.0 → 1.7.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 +9 -2
- package/dist/dapp-api/controller.d.ts.map +1 -1
- package/dist/dapp-api/controller.js +27 -12
- package/dist/dapp-api/controller.test.js +23 -6
- package/dist/dapp-api/server.d.ts.map +1 -1
- package/dist/dapp-api/server.js +24 -12
- package/dist/env.d.ts +1 -0
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +1 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +4 -1
- package/dist/ledger/transaction-service.d.ts +0 -12
- package/dist/ledger/transaction-service.d.ts.map +1 -1
- package/dist/ledger/transaction-service.js +28 -46
- package/dist/ledger/transaction-service.test.js +70 -26
- package/dist/ledger/wallet-sync-service.test.js +2 -1
- package/dist/middleware/apiKeyAuth.d.ts.map +1 -1
- package/dist/middleware/apiKeyAuth.js +12 -3
- package/dist/middleware/securityHeaders.d.ts +3 -0
- package/dist/middleware/securityHeaders.d.ts.map +1 -0
- package/dist/middleware/securityHeaders.js +10 -0
- package/dist/middleware/securityHeaders.test.d.ts +2 -0
- package/dist/middleware/securityHeaders.test.d.ts.map +1 -0
- package/dist/middleware/securityHeaders.test.js +18 -0
- package/dist/middleware/sessionHandler.d.ts.map +1 -1
- package/dist/middleware/sessionHandler.js +3 -1
- package/dist/signing/signing-worker.d.ts +1 -2
- package/dist/signing/signing-worker.d.ts.map +1 -1
- package/dist/signing/signing-worker.js +7 -3
- package/dist/signing/signing-worker.test.js +2 -0
- package/dist/user-api/controller.d.ts.map +1 -1
- package/dist/user-api/controller.js +90 -41
- package/dist/user-api/controller.test.js +191 -18
- package/dist/user-api/rpc-gen/typings.d.ts +46 -7
- package/dist/user-api/rpc-gen/typings.d.ts.map +1 -1
- package/dist/user-api/token-network-matching.d.ts +4 -0
- package/dist/user-api/token-network-matching.d.ts.map +1 -0
- package/dist/user-api/token-network-matching.js +56 -0
- package/dist/web/frontend/404/index.html +2 -2
- package/dist/web/frontend/activities/index.html +3 -4
- package/dist/web/frontend/approve/index.html +3 -5
- package/dist/web/frontend/assets/404-C0zn3s5P.js +5 -0
- package/dist/web/frontend/assets/activities-BuOktGvz.js +61 -0
- package/dist/web/frontend/assets/addIdentityProvider-D91uvfNz.js +28 -0
- package/dist/web/frontend/assets/addNetwork-DP0iR59C.js +38 -0
- package/dist/web/frontend/assets/addParty-DUoPRmUF.js +45 -0
- package/dist/web/frontend/assets/approve-BSMrd3FM.js +21 -0
- package/dist/web/frontend/assets/callback-oLJBpxTj.js +3 -0
- package/dist/web/frontend/assets/identityProviders-DQlERLUf.js +71 -0
- package/dist/web/frontend/assets/index-BjhQnXf1.js +2 -0
- package/dist/web/frontend/assets/{index-CFnOucPK.js → index-BoxNLwXf.js} +629 -570
- package/dist/web/frontend/assets/index-D5Xh-WxM.js +91 -0
- package/dist/web/frontend/assets/login-GZTP8nvF.js +10 -0
- package/dist/web/frontend/assets/networks-DHe8V-HP.js +73 -0
- package/dist/web/frontend/assets/reviewIdentityProvider-tg2atORE.js +43 -0
- package/dist/web/frontend/assets/reviewNetwork-ZZv-rrzm.js +43 -0
- package/dist/web/frontend/assets/settings-BC6X9ar3.js +37 -0
- package/dist/web/frontend/callback/index.html +2 -2
- package/dist/web/frontend/identity-providers/add/index.html +2 -3
- package/dist/web/frontend/identity-providers/index.html +2 -3
- package/dist/web/frontend/identity-providers/review/index.html +2 -3
- package/dist/web/frontend/index.html +1 -1
- package/dist/web/frontend/login/index.html +2 -3
- package/dist/web/frontend/networks/add/index.html +2 -3
- package/dist/web/frontend/networks/index.html +2 -3
- package/dist/web/frontend/networks/review/index.html +2 -3
- package/dist/web/frontend/parties/add/index.html +3 -5
- package/dist/web/frontend/parties/index.html +2 -4
- package/dist/web/frontend/settings/index.html +2 -3
- package/dist/web/server.d.ts +1 -1
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/server.js +3 -3
- package/package.json +29 -29
- package/dist/web/frontend/assets/404-C4hCL2o8.js +0 -5
- package/dist/web/frontend/assets/activities-Bq7yMMQY.js +0 -61
- package/dist/web/frontend/assets/addIdentityProvider-DRJWLhHF.js +0 -28
- package/dist/web/frontend/assets/addNetwork-CJUaKP1q.js +0 -38
- package/dist/web/frontend/assets/addParty-2ObTLGIL.js +0 -45
- package/dist/web/frontend/assets/approve-BuA5DGC2.js +0 -21
- package/dist/web/frontend/assets/callback-C5vJWFLq.js +0 -1
- package/dist/web/frontend/assets/identityProviders-78FbpzYL.js +0 -71
- package/dist/web/frontend/assets/index-BTH_md6b.js +0 -91
- package/dist/web/frontend/assets/index-CiMGhYb1.js +0 -2
- package/dist/web/frontend/assets/login-Dyn1o6fW.js +0 -10
- package/dist/web/frontend/assets/networks-_el10AWP.js +0 -73
- package/dist/web/frontend/assets/reviewIdentityProvider-DodUZ2mY.js +0 -43
- package/dist/web/frontend/assets/reviewNetwork-BFMtmKEL.js +0 -43
- package/dist/web/frontend/assets/settings-BBmkIfYm.js +0 -37
- package/dist/web/frontend/assets/state-DkxLvywv.js +0 -1
- package/dist/web/frontend/assets/utils-DvJKIYxT.js +0 -1
|
@@ -33,6 +33,15 @@ const pendingTransaction = {
|
|
|
33
33
|
origin: 'https://dapp.example',
|
|
34
34
|
createdAt: new Date('2026-01-01T00:00:00.000Z'),
|
|
35
35
|
};
|
|
36
|
+
const signedTransaction = {
|
|
37
|
+
...pendingTransaction,
|
|
38
|
+
status: 'signed',
|
|
39
|
+
signedAt: new Date('2026-01-01T00:01:00.000Z'),
|
|
40
|
+
};
|
|
41
|
+
const executedTransaction = {
|
|
42
|
+
...pendingTransaction,
|
|
43
|
+
status: 'executed',
|
|
44
|
+
};
|
|
36
45
|
const signParams = {
|
|
37
46
|
transactionId: pendingTransaction.id,
|
|
38
47
|
partyId: wallet.partyId,
|
|
@@ -93,7 +102,7 @@ describe('TransactionService', () => {
|
|
|
93
102
|
});
|
|
94
103
|
describe('sign', () => {
|
|
95
104
|
describe('participant', () => {
|
|
96
|
-
it('returns a signed result
|
|
105
|
+
it('returns a signed result and persists signed status', async () => {
|
|
97
106
|
const store = createStore();
|
|
98
107
|
const service = createService(store, {
|
|
99
108
|
[SigningProvider.PARTICIPANT]: createDriver({}),
|
|
@@ -106,7 +115,12 @@ describe('TransactionService', () => {
|
|
|
106
115
|
signedBy: wallet.namespace,
|
|
107
116
|
partyId: wallet.partyId,
|
|
108
117
|
});
|
|
109
|
-
expect(store.getTransaction).
|
|
118
|
+
expect(store.getTransaction).toHaveBeenCalledWith(pendingTransaction.id);
|
|
119
|
+
expect(store.setTransactionSigned).toHaveBeenCalledWith(pendingTransaction.id, expect.any(Date));
|
|
120
|
+
expect(emit).toHaveBeenCalledWith('txChanged', expect.objectContaining({
|
|
121
|
+
id: pendingTransaction.id,
|
|
122
|
+
status: 'signed',
|
|
123
|
+
}));
|
|
110
124
|
});
|
|
111
125
|
});
|
|
112
126
|
describe('wallet-kernel', () => {
|
|
@@ -249,11 +263,11 @@ describe('TransactionService', () => {
|
|
|
249
263
|
});
|
|
250
264
|
});
|
|
251
265
|
describe('dfns', () => {
|
|
252
|
-
it('
|
|
266
|
+
it('returns the driver signature when signing completes', async () => {
|
|
253
267
|
const signTransaction = vi.fn().mockResolvedValue({
|
|
254
268
|
status: 'signed',
|
|
255
269
|
txId: 'dfns-tx-1',
|
|
256
|
-
signature: '
|
|
270
|
+
signature: 'dfns-signature',
|
|
257
271
|
});
|
|
258
272
|
const store = createStore();
|
|
259
273
|
const service = createService(store, {
|
|
@@ -264,39 +278,64 @@ describe('TransactionService', () => {
|
|
|
264
278
|
const result = await service.sign(authContext, walletWithProvider(SigningProvider.DFNS), signParams);
|
|
265
279
|
expect(result).toEqual({
|
|
266
280
|
status: 'signed',
|
|
267
|
-
signature: '
|
|
281
|
+
signature: 'dfns-signature',
|
|
268
282
|
signedBy: wallet.namespace,
|
|
269
283
|
partyId: wallet.partyId,
|
|
270
284
|
externalTxId: 'dfns-tx-1',
|
|
271
285
|
});
|
|
272
286
|
});
|
|
273
287
|
});
|
|
288
|
+
it.each([
|
|
289
|
+
{
|
|
290
|
+
name: 'participant',
|
|
291
|
+
provider: SigningProvider.PARTICIPANT,
|
|
292
|
+
auth: authContext,
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
name: 'wallet-kernel',
|
|
296
|
+
provider: SigningProvider.WALLET_KERNEL,
|
|
297
|
+
auth: authContext,
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: 'blockdaemon',
|
|
301
|
+
provider: SigningProvider.BLOCKDAEMON,
|
|
302
|
+
auth: authContextWithEmail,
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
name: 'fireblocks',
|
|
306
|
+
provider: SigningProvider.FIREBLOCKS,
|
|
307
|
+
auth: authContext,
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
name: 'dfns',
|
|
311
|
+
provider: SigningProvider.DFNS,
|
|
312
|
+
auth: authContext,
|
|
313
|
+
},
|
|
314
|
+
])('rejects signing an already executed transaction for $name', async ({ provider, auth }) => {
|
|
315
|
+
const store = createStore(executedTransaction);
|
|
316
|
+
const service = createService(store, {
|
|
317
|
+
[provider]: createDriver({}),
|
|
318
|
+
}, notifier, logger);
|
|
319
|
+
const providerWallet = walletWithProvider(provider);
|
|
320
|
+
await expect(service.sign(auth, providerWallet, signParams)).rejects.toThrow('Cannot sign an already executed transaction');
|
|
321
|
+
expect(store.setTransactionSigned).not.toHaveBeenCalled();
|
|
322
|
+
expect(store.setTransactionStatus).not.toHaveBeenCalled();
|
|
323
|
+
});
|
|
274
324
|
});
|
|
275
325
|
describe('execute', () => {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
const store = createStore(signedTransaction);
|
|
284
|
-
const service = createService(store, {}, notifier, logger);
|
|
285
|
-
const result = await service.execute(authContext.userId, walletWithProvider(SigningProvider.DFNS), signedTransaction);
|
|
286
|
-
expect(store.setTransactionStatus).toHaveBeenCalledWith(signedTransaction.id, 'executed', { externalTxId: 'dfns-update-id' });
|
|
287
|
-
expect(emit).toHaveBeenCalledWith('txChanged', expect.objectContaining({ status: 'executed' }));
|
|
288
|
-
expect(result).toEqual({ updateId: 'dfns-update-id' });
|
|
289
|
-
});
|
|
290
|
-
it('throws when the transaction has no external tx id', async () => {
|
|
291
|
-
const service = createService(createStore(), {}, notifier, logger);
|
|
292
|
-
await expect(service.execute(authContext.userId, walletWithProvider(SigningProvider.DFNS), pendingTransaction)).rejects.toThrow('Cannot execute Dfns transaction without externalTxId from Dfns');
|
|
293
|
-
});
|
|
326
|
+
it.each(['pending', 'failed', 'executed'])('throws when execute is called for a %s transaction', async (status) => {
|
|
327
|
+
const service = createService(createStore(), {}, notifier, logger);
|
|
328
|
+
const transaction = {
|
|
329
|
+
...pendingTransaction,
|
|
330
|
+
status,
|
|
331
|
+
};
|
|
332
|
+
expect(() => service.execute(authContext.userId, wallet, transaction, executeParams)).toThrow(`Cannot execute a ${status} transaction. Expected status: signed.`);
|
|
294
333
|
});
|
|
295
334
|
describe('participant', () => {
|
|
296
335
|
it('submits the prepared transaction to the ledger', async () => {
|
|
297
336
|
const participantWallet = walletWithProvider(SigningProvider.PARTICIPANT);
|
|
298
337
|
const transaction = {
|
|
299
|
-
...
|
|
338
|
+
...signedTransaction,
|
|
300
339
|
payload: {
|
|
301
340
|
commandId: pendingTransaction.commandId,
|
|
302
341
|
commands: [],
|
|
@@ -322,7 +361,12 @@ describe('TransactionService', () => {
|
|
|
322
361
|
});
|
|
323
362
|
});
|
|
324
363
|
describe('external signing providers', () => {
|
|
325
|
-
it(
|
|
364
|
+
it.each([
|
|
365
|
+
SigningProvider.WALLET_KERNEL,
|
|
366
|
+
SigningProvider.BLOCKDAEMON,
|
|
367
|
+
SigningProvider.FIREBLOCKS,
|
|
368
|
+
SigningProvider.DFNS,
|
|
369
|
+
])('executes with the provided signature for %s', async (signingProviderId) => {
|
|
326
370
|
const signedTransaction = {
|
|
327
371
|
...pendingTransaction,
|
|
328
372
|
status: 'signed',
|
|
@@ -335,7 +379,7 @@ describe('TransactionService', () => {
|
|
|
335
379
|
postWithRetry,
|
|
336
380
|
};
|
|
337
381
|
const service = createService(store, {}, notifier, logger);
|
|
338
|
-
const result = await service.execute(authContext.userId,
|
|
382
|
+
const result = await service.execute(authContext.userId, walletWithProvider(signingProviderId), signedTransaction, executeParams, ledgerClient, network);
|
|
339
383
|
expect(postWithRetry).toHaveBeenCalledWith('/v2/interactive-submission/executeAndWait', expect.objectContaining({
|
|
340
384
|
userId: authContext.userId,
|
|
341
385
|
preparedTransaction: pendingTransaction.preparedTransaction,
|
|
@@ -203,8 +203,9 @@ describe('WalletSyncService - multi-network features', () => {
|
|
|
203
203
|
const setSession = async (networkId) => {
|
|
204
204
|
await store.setSession({
|
|
205
205
|
id: `sess-${networkId}`,
|
|
206
|
+
origin: 'dapp-1',
|
|
206
207
|
network: networkId,
|
|
207
|
-
accessToken: 'token',
|
|
208
|
+
accessToken: 'test-access-token',
|
|
208
209
|
});
|
|
209
210
|
};
|
|
210
211
|
beforeEach(async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiKeyAuth.d.ts","sourceRoot":"","sources":["../../src/middleware/apiKeyAuth.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC9D,OAAO,EACH,SAAS,EAGZ,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAA;AAMzD,wBAAgB,UAAU,CACtB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,EAC/B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,IAEA,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"apiKeyAuth.d.ts","sourceRoot":"","sources":["../../src/middleware/apiKeyAuth.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC9D,OAAO,EACH,SAAS,EAGZ,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAA;AAMzD,wBAAgB,UAAU,CACtB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,EAC/B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,IAEA,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,wDA2IhE"}
|
|
@@ -37,13 +37,15 @@ export function apiKeyAuth(store, dappApiPath, logger) {
|
|
|
37
37
|
// temporary auth context to access the store with the API key user
|
|
38
38
|
const authStore = store.withAuthContext({
|
|
39
39
|
userId: matchingKey.userId,
|
|
40
|
-
accessToken:
|
|
40
|
+
accessToken: hashedApiKey,
|
|
41
41
|
});
|
|
42
42
|
// automatically initiate a session for the API key user
|
|
43
|
+
const sessionId = v4();
|
|
43
44
|
await authStore.setSession({
|
|
44
|
-
id:
|
|
45
|
+
id: sessionId,
|
|
46
|
+
origin: `apikey:${matchingKey.id}`,
|
|
45
47
|
network: matchingKey.networkId,
|
|
46
|
-
accessToken:
|
|
48
|
+
accessToken: hashedApiKey,
|
|
47
49
|
});
|
|
48
50
|
const network = await authStore.getNetwork(matchingKey.networkId);
|
|
49
51
|
const idp = await authStore.getIdp(network.identityProviderId);
|
|
@@ -74,6 +76,13 @@ export function apiKeyAuth(store, dappApiPath, logger) {
|
|
|
74
76
|
accessToken: serviceAccountCtx.accessToken,
|
|
75
77
|
email: matchingKey.email || undefined,
|
|
76
78
|
};
|
|
79
|
+
// we need to override the session now, so that the accessToken matches what the controller expects (accessToken == serviceAccount token)
|
|
80
|
+
await authStore.setSession({
|
|
81
|
+
id: sessionId,
|
|
82
|
+
origin: `apikey:${matchingKey.id}`,
|
|
83
|
+
network: matchingKey.networkId,
|
|
84
|
+
accessToken: serviceAccountCtx.accessToken,
|
|
85
|
+
});
|
|
77
86
|
req.authContext = context;
|
|
78
87
|
return next();
|
|
79
88
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"securityHeaders.d.ts","sourceRoot":"","sources":["../../src/middleware/securityHeaders.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE9D,wBAAgB,eAAe,KACnB,MAAM,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,UAM3D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
export function securityHeaders() {
|
|
4
|
+
return (_req, res, next) => {
|
|
5
|
+
res.setHeader('X-Frame-Options', 'DENY');
|
|
6
|
+
res.setHeader('Content-Security-Policy', "frame-ancestors 'none';");
|
|
7
|
+
res.setHeader('X-Content-Type-Options', 'nosniff');
|
|
8
|
+
next();
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"securityHeaders.test.d.ts","sourceRoot":"","sources":["../../src/middleware/securityHeaders.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
4
|
+
import { securityHeaders } from './securityHeaders.js';
|
|
5
|
+
describe('securityHeaders', () => {
|
|
6
|
+
it('sets the expected security response headers', () => {
|
|
7
|
+
const setHeader = vi.fn();
|
|
8
|
+
const next = vi.fn();
|
|
9
|
+
const middleware = securityHeaders();
|
|
10
|
+
const req = {};
|
|
11
|
+
const res = { setHeader };
|
|
12
|
+
middleware(req, res, next);
|
|
13
|
+
expect(setHeader).toHaveBeenCalledWith('X-Frame-Options', 'DENY');
|
|
14
|
+
expect(setHeader).toHaveBeenCalledWith('Content-Security-Policy', "frame-ancestors 'none';");
|
|
15
|
+
expect(setHeader).toHaveBeenCalledWith('X-Content-Type-Options', 'nosniff');
|
|
16
|
+
expect(next).toHaveBeenCalledOnce();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionHandler.d.ts","sourceRoot":"","sources":["../../src/middleware/sessionHandler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAA;AAEzD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC1B,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,EAC/B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EACtC,MAAM,EAAE,MAAM,IAEA,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"sessionHandler.d.ts","sourceRoot":"","sources":["../../src/middleware/sessionHandler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAA;AAEzD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC1B,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,EAC/B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EACtC,MAAM,EAAE,MAAM,IAEA,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,mBA+BhE"}
|
|
@@ -23,7 +23,9 @@ export function sessionHandler(store, allowedPaths, logger) {
|
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
25
25
|
logger.debug('Checking for active session for ' + context?.userId);
|
|
26
|
-
const session = await store
|
|
26
|
+
const session = await store
|
|
27
|
+
.withAuthContext(context)
|
|
28
|
+
.getSession(context?.accessToken || '');
|
|
27
29
|
if (!session) {
|
|
28
30
|
logger.debug('No active session found for ' + context?.userId);
|
|
29
31
|
res.status(401).json({ error: 'No active session found' });
|
|
@@ -47,8 +47,7 @@ export interface SigningWorkerOptions {
|
|
|
47
47
|
*
|
|
48
48
|
* - returns early while the provider still reports `pending` (worker logs and
|
|
49
49
|
* waits for the next tick), or
|
|
50
|
-
* - calls `execute()` once signing is `signed
|
|
51
|
-
* at sign-time, so execute only reconciles local state).
|
|
50
|
+
* - calls `execute()` once signing is `signed`.
|
|
52
51
|
*
|
|
53
52
|
* A transaction is re-read before processing so a concurrent DApp call or an
|
|
54
53
|
* earlier tick that already completed it is skipped.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signing-worker.d.ts","sourceRoot":"","sources":["../../src/signing/signing-worker.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;AAC5D,OAAO,EAAE,KAAK,EAAuB,MAAM,mCAAmC,CAAA;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAE5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAG1D,YAAY,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AAE9E,+CAA+C;AAC/C,MAAM,WAAW,oBAAoB;IACjC,+EAA+E;IAC/E,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,cAAc,CAAA;IAC9B,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;IAC/B,mBAAmB,EAAE,mBAAmB,CAAA;IACxC,MAAM,EAAE,MAAM,CAAA;CACjB;AAED
|
|
1
|
+
{"version":3,"file":"signing-worker.d.ts","sourceRoot":"","sources":["../../src/signing/signing-worker.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;AAC5D,OAAO,EAAE,KAAK,EAAuB,MAAM,mCAAmC,CAAA;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAE5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAG1D,YAAY,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AAE9E,+CAA+C;AAC/C,MAAM,WAAW,oBAAoB;IACjC,+EAA+E;IAC/E,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,cAAc,CAAA;IAC9B,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;IAC/B,mBAAmB,EAAE,mBAAmB,CAAA;IACxC,MAAM,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,qBAAa,aAAa;IAIV,OAAO,CAAC,QAAQ,CAAC,OAAO;IAHpC,OAAO,CAAC,KAAK,CAA4C;IACzD,OAAO,CAAC,OAAO,CAAQ;gBAEM,OAAO,EAAE,oBAAoB;IAE1D,gEAAgE;IAChE,KAAK,IAAI,IAAI;IAcb,iCAAiC;IACjC,IAAI,IAAI,IAAI;IAOZ;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA0B3B;;;;OAIG;YACW,cAAc;CAoI/B"}
|
|
@@ -36,8 +36,7 @@ import { resolveAutomationRunContext } from './service-account-session.js';
|
|
|
36
36
|
*
|
|
37
37
|
* - returns early while the provider still reports `pending` (worker logs and
|
|
38
38
|
* waits for the next tick), or
|
|
39
|
-
* - calls `execute()` once signing is `signed
|
|
40
|
-
* at sign-time, so execute only reconciles local state).
|
|
39
|
+
* - calls `execute()` once signing is `signed`.
|
|
41
40
|
*
|
|
42
41
|
* A transaction is re-read before processing so a concurrent DApp call or an
|
|
43
42
|
* earlier tick that already completed it is skipped.
|
|
@@ -130,7 +129,12 @@ export class SigningWorker {
|
|
|
130
129
|
logger.debug({ refreshedTx }, 'Skipping signing worker tick: transaction no longer pending');
|
|
131
130
|
return;
|
|
132
131
|
}
|
|
133
|
-
const
|
|
132
|
+
const session = await store.getSession(runContext.authContext.accessToken);
|
|
133
|
+
if (!session) {
|
|
134
|
+
logger.error({ userId, networkId, transactionId: transaction.id }, 'Signing worker tick failed: session not found');
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const notifier = this.options.notificationService.getNotifier(session.id);
|
|
134
138
|
const transactionLogger = this.options.logger.child({
|
|
135
139
|
component: 'TransactionService',
|
|
136
140
|
});
|
|
@@ -90,6 +90,7 @@ const pendingTransaction = {
|
|
|
90
90
|
function createWorker(storeOverrides = {}) {
|
|
91
91
|
const scopedStore = {
|
|
92
92
|
setSession: vi.fn().mockResolvedValue(undefined),
|
|
93
|
+
getSession: vi.fn().mockResolvedValue({ id: 'session-1' }),
|
|
93
94
|
getPrimaryWallet: vi.fn().mockResolvedValue(wallet),
|
|
94
95
|
getAllWallets: vi.fn().mockResolvedValue([wallet, aliceWallet]),
|
|
95
96
|
getTransaction: vi.fn().mockResolvedValue(pendingTransaction),
|
|
@@ -100,6 +101,7 @@ function createWorker(storeOverrides = {}) {
|
|
|
100
101
|
.mockResolvedValue([pendingTransaction]),
|
|
101
102
|
getIdp: vi.fn().mockResolvedValue(idp),
|
|
102
103
|
getNetwork: vi.fn().mockResolvedValue(m2mNetwork),
|
|
104
|
+
getSession: vi.fn().mockResolvedValue({ id: 'session-1' }),
|
|
103
105
|
withAuthContext: vi.fn().mockReturnValue(scopedStore),
|
|
104
106
|
...storeOverrides,
|
|
105
107
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/user-api/controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/user-api/controller.ts"],"names":[],"mappings":"AAgDA,OAAO,EAAE,KAAK,EAAW,MAAM,mCAAmC,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAC5E,OAAO,EAEH,WAAW,EAKd,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAEhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAanE,eAAO,MAAM,cAAc,GACvB,YAAY,UAAU,EACtB,SAAS,MAAM,EACf,OAAO,KAAK,EACZ,qBAAqB,mBAAmB,EACxC,aAAa,WAAW,GAAG,SAAS,EACpC,SAAS,cAAc,EACvB,SAAS,MAAM,EACf,cAAc,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgmCvB,CAAA"}
|
|
@@ -14,6 +14,7 @@ import { v4 } from 'uuid';
|
|
|
14
14
|
import { TransactionService } from '../ledger/transaction-service.js';
|
|
15
15
|
import { rpcErrors } from '@canton-network/core-rpc-errors';
|
|
16
16
|
import crypto from 'crypto';
|
|
17
|
+
import { assertTokenClaimsMatchNetwork } from './token-network-matching.js';
|
|
17
18
|
export const userController = (kernelInfo, userUrl, store, notificationService, authContext, drivers, _logger, adminUserId) => {
|
|
18
19
|
const logger = _logger.child({ component: 'user-controller' });
|
|
19
20
|
const provider = {
|
|
@@ -149,7 +150,6 @@ export const userController = (kernelInfo, userUrl, store, notificationService,
|
|
|
149
150
|
if (!network.adminAuth) {
|
|
150
151
|
throw new Error('No admin auth configured');
|
|
151
152
|
}
|
|
152
|
-
const notifier = notificationService.getNotifier(connectedContext.userId);
|
|
153
153
|
const adminTokenProvider = AuthTokenProvider.fromGatewayConfig(idp, network.adminAuth, logger);
|
|
154
154
|
const partyAllocator = new PartyAllocationService({
|
|
155
155
|
synchronizerId: network.synchronizerId,
|
|
@@ -172,12 +172,13 @@ export const userController = (kernelInfo, userUrl, store, notificationService,
|
|
|
172
172
|
await service.syncWallets();
|
|
173
173
|
// Notify about the change and return the new wallet
|
|
174
174
|
const wallets = await store.getWallets();
|
|
175
|
-
|
|
175
|
+
notificationService
|
|
176
|
+
.getNotifier(connectedContext.userId)
|
|
177
|
+
.emit('accountsChanged', wallets);
|
|
176
178
|
return { wallet };
|
|
177
179
|
},
|
|
178
180
|
allocatePartyForWallet: async (params) => {
|
|
179
181
|
const connectedContext = assertConnected(authContext);
|
|
180
|
-
const userId = connectedContext.userId;
|
|
181
182
|
const network = await store.getCurrentNetwork();
|
|
182
183
|
if (!network) {
|
|
183
184
|
throw new Error('No network session found');
|
|
@@ -216,17 +217,17 @@ export const userController = (kernelInfo, userUrl, store, notificationService,
|
|
|
216
217
|
const wallets = await store.getWallets();
|
|
217
218
|
const wallet = wallets.find((w) => w.partyId === existingWallet.partyId &&
|
|
218
219
|
w.networkId === network.id);
|
|
219
|
-
|
|
220
|
-
|
|
220
|
+
notificationService
|
|
221
|
+
.getNotifier(connectedContext.userId)
|
|
222
|
+
.emit('accountsChanged', wallets);
|
|
221
223
|
return { wallet };
|
|
222
224
|
},
|
|
223
225
|
setPrimaryWallet: async (params) => {
|
|
224
226
|
await store.setPrimaryWallet(params.partyId);
|
|
225
|
-
const notifier = authContext?.userId
|
|
226
|
-
? notificationService.getNotifier(authContext.userId)
|
|
227
|
-
: undefined;
|
|
228
227
|
const wallets = await store.getWallets();
|
|
229
|
-
|
|
228
|
+
notificationService
|
|
229
|
+
.getNotifier(authContext.userId)
|
|
230
|
+
.emit('accountsChanged', wallets);
|
|
230
231
|
return null;
|
|
231
232
|
},
|
|
232
233
|
removeWallet: async (params) => {
|
|
@@ -246,8 +247,11 @@ export const userController = (kernelInfo, userUrl, store, notificationService,
|
|
|
246
247
|
throw new Error('No primary wallet found');
|
|
247
248
|
}
|
|
248
249
|
const connectedContext = assertConnected(authContext);
|
|
249
|
-
const
|
|
250
|
-
|
|
250
|
+
const session = await store.getSession(connectedContext.accessToken);
|
|
251
|
+
if (!session) {
|
|
252
|
+
throw new Error('No active session found');
|
|
253
|
+
}
|
|
254
|
+
const notifier = notificationService.getNotifier(session.id);
|
|
251
255
|
const transactionService = new TransactionService(store, logger, drivers, notifier);
|
|
252
256
|
logDynamically(logger, 'signing transaction with params', {
|
|
253
257
|
info: { transactionId: signParams.transactionId },
|
|
@@ -272,7 +276,11 @@ export const userController = (kernelInfo, userUrl, store, notificationService,
|
|
|
272
276
|
if (pending.userId !== userId) {
|
|
273
277
|
throw new Error(`Message signing request ${pending.id} is not owned by user ${userId}`);
|
|
274
278
|
}
|
|
275
|
-
const
|
|
279
|
+
const session = await store.getSession(assertConnected(authContext).accessToken);
|
|
280
|
+
if (!session) {
|
|
281
|
+
throw new Error('No active session found');
|
|
282
|
+
}
|
|
283
|
+
const notifier = notificationService.getNotifier(session.id);
|
|
276
284
|
const emitFailedAndPersist = async (details) => {
|
|
277
285
|
// Best-effort: make sure listeners see a terminal state.
|
|
278
286
|
try {
|
|
@@ -411,7 +419,11 @@ export const userController = (kernelInfo, userUrl, store, notificationService,
|
|
|
411
419
|
if (network === undefined) {
|
|
412
420
|
throw new Error('No network session found');
|
|
413
421
|
}
|
|
414
|
-
const
|
|
422
|
+
const session = await store.getSession(connectedContext.accessToken);
|
|
423
|
+
if (!session) {
|
|
424
|
+
throw new Error('No active session found');
|
|
425
|
+
}
|
|
426
|
+
const notifier = notificationService.getNotifier(session.id);
|
|
415
427
|
const ledgerClient = new LedgerClient({
|
|
416
428
|
baseUrl: new URL(network.ledgerApi.baseUrl),
|
|
417
429
|
logger,
|
|
@@ -436,18 +448,20 @@ export const userController = (kernelInfo, userUrl, store, notificationService,
|
|
|
436
448
|
},
|
|
437
449
|
addSession: async function (params) {
|
|
438
450
|
try {
|
|
451
|
+
const connectedContext = assertConnected(authContext);
|
|
452
|
+
const { userId, accessToken } = connectedContext;
|
|
439
453
|
const newSessionId = v4();
|
|
440
454
|
logger.info(`Adding session with ID ${newSessionId} for network ${params.networkId}`);
|
|
441
455
|
const network = await store.getNetwork(params.networkId);
|
|
456
|
+
const idp = await store.getIdp(network.identityProviderId);
|
|
457
|
+
assertTokenClaimsMatchNetwork(accessToken, network, idp);
|
|
442
458
|
await store.setSession({
|
|
443
459
|
id: newSessionId,
|
|
460
|
+
origin: params.origin,
|
|
444
461
|
network: params.networkId,
|
|
445
|
-
accessToken:
|
|
462
|
+
accessToken: connectedContext.accessToken || '',
|
|
446
463
|
});
|
|
447
|
-
const
|
|
448
|
-
// Assumption: `setSession` calls `assertConnected`, so its safe to declare that the authContext is defined.
|
|
449
|
-
const { userId, accessToken } = authContext;
|
|
450
|
-
const notifier = notificationService.getNotifier(userId);
|
|
464
|
+
const notifier = notificationService.getNotifier(newSessionId);
|
|
451
465
|
const ledgerClient = new LedgerClient({
|
|
452
466
|
baseUrl: new URL(network.ledgerApi.baseUrl),
|
|
453
467
|
logger,
|
|
@@ -474,21 +488,36 @@ export const userController = (kernelInfo, userUrl, store, notificationService,
|
|
|
474
488
|
};
|
|
475
489
|
notifier.emit('statusChanged', statusEvent);
|
|
476
490
|
notifier.emit('connected', statusEvent);
|
|
477
|
-
//
|
|
491
|
+
// Only bootstrap wallets the first time a session is created.
|
|
492
|
+
// Session creation must remain successful when the ledger or
|
|
493
|
+
// wallet synchronization is unavailable.
|
|
478
494
|
const wallets = await store.getWallets();
|
|
479
|
-
if (wallets.length
|
|
480
|
-
if (!
|
|
481
|
-
|
|
495
|
+
if (wallets.length === 0) {
|
|
496
|
+
if (!status.isConnected) {
|
|
497
|
+
logger.warn({
|
|
498
|
+
networkId: network.id,
|
|
499
|
+
reason: status.reason,
|
|
500
|
+
}, 'Skipping initial wallet sync because the ledger is unavailable');
|
|
501
|
+
}
|
|
502
|
+
else {
|
|
503
|
+
try {
|
|
504
|
+
if (!network.adminAuth) {
|
|
505
|
+
throw new Error('No admin auth configured');
|
|
506
|
+
}
|
|
507
|
+
const adminAccessTokenProvider = AuthTokenProvider.fromGatewayConfig(idp, network.adminAuth, logger);
|
|
508
|
+
const partyAllocator = new PartyAllocationService({
|
|
509
|
+
synchronizerId: network.synchronizerId,
|
|
510
|
+
accessTokenProvider: adminAccessTokenProvider,
|
|
511
|
+
httpLedgerUrl: network.ledgerApi.baseUrl,
|
|
512
|
+
logger,
|
|
513
|
+
});
|
|
514
|
+
const service = new WalletSyncService(store, ledgerClient, connectedContext, logger, drivers, partyAllocator);
|
|
515
|
+
await service.syncWallets();
|
|
516
|
+
}
|
|
517
|
+
catch (error) {
|
|
518
|
+
logger.warn({ err: error, networkId: network.id }, 'Initial wallet sync failed; keeping session active');
|
|
519
|
+
}
|
|
482
520
|
}
|
|
483
|
-
const adminAccessTokenProvider = AuthTokenProvider.fromGatewayConfig(idp, network.adminAuth, logger);
|
|
484
|
-
const partyAllocator = new PartyAllocationService({
|
|
485
|
-
synchronizerId: network.synchronizerId,
|
|
486
|
-
accessTokenProvider: adminAccessTokenProvider,
|
|
487
|
-
httpLedgerUrl: network.ledgerApi.baseUrl,
|
|
488
|
-
logger,
|
|
489
|
-
});
|
|
490
|
-
const service = new WalletSyncService(store, ledgerClient, authContext, logger, drivers, partyAllocator);
|
|
491
|
-
await service.syncWallets();
|
|
492
521
|
}
|
|
493
522
|
const rights = await store.getUserRights(network.id);
|
|
494
523
|
return {
|
|
@@ -505,7 +534,7 @@ export const userController = (kernelInfo, userUrl, store, notificationService,
|
|
|
505
534
|
};
|
|
506
535
|
}
|
|
507
536
|
catch (error) {
|
|
508
|
-
logger.error(
|
|
537
|
+
logger.error(error, 'Failed to add session');
|
|
509
538
|
throw new Error(`Failed to add session`, {
|
|
510
539
|
cause: error,
|
|
511
540
|
});
|
|
@@ -513,9 +542,13 @@ export const userController = (kernelInfo, userUrl, store, notificationService,
|
|
|
513
542
|
},
|
|
514
543
|
removeSession: async () => {
|
|
515
544
|
logger.info({ authContext }, 'Removing session');
|
|
516
|
-
const
|
|
517
|
-
const
|
|
518
|
-
|
|
545
|
+
const { accessToken } = assertConnected(authContext);
|
|
546
|
+
const session = await store.getSession(accessToken);
|
|
547
|
+
if (!session) {
|
|
548
|
+
return null;
|
|
549
|
+
}
|
|
550
|
+
const notifier = notificationService.getNotifier(session.id);
|
|
551
|
+
await store.removeSession(accessToken);
|
|
519
552
|
notifier.emit('statusChanged', {
|
|
520
553
|
provider: provider,
|
|
521
554
|
connection: {
|
|
@@ -528,10 +561,13 @@ export const userController = (kernelInfo, userUrl, store, notificationService,
|
|
|
528
561
|
session: undefined,
|
|
529
562
|
userUrl: `${userUrl}/login/`,
|
|
530
563
|
});
|
|
564
|
+
notifier.emit('logout');
|
|
531
565
|
return null;
|
|
532
566
|
},
|
|
567
|
+
// TODO: follow up with store.listSessions to display all sessions in the UI
|
|
533
568
|
listSessions: async () => {
|
|
534
|
-
const
|
|
569
|
+
const token = authContext.accessToken;
|
|
570
|
+
const session = await store.getSession(token);
|
|
535
571
|
if (!session) {
|
|
536
572
|
return { sessions: [] };
|
|
537
573
|
}
|
|
@@ -548,6 +584,7 @@ export const userController = (kernelInfo, userUrl, store, notificationService,
|
|
|
548
584
|
sessions: [
|
|
549
585
|
{
|
|
550
586
|
id: session.id,
|
|
587
|
+
origin: session.origin,
|
|
551
588
|
network: {
|
|
552
589
|
...network,
|
|
553
590
|
ledgerApi: network.ledgerApi.baseUrl,
|
|
@@ -589,9 +626,10 @@ export const userController = (kernelInfo, userUrl, store, notificationService,
|
|
|
589
626
|
result.disabled.length === 0) {
|
|
590
627
|
return result;
|
|
591
628
|
}
|
|
592
|
-
const notifier = notificationService.getNotifier(userId);
|
|
593
629
|
const wallets = await store.getWallets();
|
|
594
|
-
|
|
630
|
+
notificationService
|
|
631
|
+
.getNotifier(userId)
|
|
632
|
+
.emit('accountsChanged', wallets);
|
|
595
633
|
return result;
|
|
596
634
|
},
|
|
597
635
|
isWalletSyncNeeded: async () => {
|
|
@@ -646,8 +684,10 @@ export const userController = (kernelInfo, userUrl, store, notificationService,
|
|
|
646
684
|
}),
|
|
647
685
|
};
|
|
648
686
|
},
|
|
649
|
-
listTransactions: async function () {
|
|
650
|
-
const
|
|
687
|
+
listTransactions: async function (params) {
|
|
688
|
+
const txCount = await store.transactionsCount();
|
|
689
|
+
const page = await store.listTransactions(params);
|
|
690
|
+
const transactions = page.transactions;
|
|
651
691
|
const txs = transactions.map((transaction) => ({
|
|
652
692
|
id: transaction.id,
|
|
653
693
|
commandId: transaction.commandId,
|
|
@@ -670,7 +710,16 @@ export const userController = (kernelInfo, userUrl, store, notificationService,
|
|
|
670
710
|
externalTxId: transaction.externalTxId,
|
|
671
711
|
}),
|
|
672
712
|
}));
|
|
673
|
-
|
|
713
|
+
if (page.nextCursor === null) {
|
|
714
|
+
return { transactions: txs, count: txCount };
|
|
715
|
+
}
|
|
716
|
+
else {
|
|
717
|
+
return {
|
|
718
|
+
transactions: txs,
|
|
719
|
+
nextCursor: page.nextCursor,
|
|
720
|
+
count: txCount,
|
|
721
|
+
};
|
|
722
|
+
}
|
|
674
723
|
},
|
|
675
724
|
deleteTransaction: async (params) => {
|
|
676
725
|
const transaction = await store.getTransaction(params.transactionId);
|