@canton-network/wallet-gateway-remote 0.1.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 +25 -0
- package/dist/auth/jwt-auth-service.d.ts +11 -0
- package/dist/auth/jwt-auth-service.d.ts.map +1 -0
- package/dist/auth/jwt-auth-service.js +50 -0
- package/dist/config/Config.d.ts +590 -0
- package/dist/config/Config.d.ts.map +1 -0
- package/dist/config/Config.js +19 -0
- package/dist/config/Config.test.d.ts +2 -0
- package/dist/config/Config.test.d.ts.map +1 -0
- package/dist/config/Config.test.js +19 -0
- package/dist/config/ConfigUtils.d.ts +5 -0
- package/dist/config/ConfigUtils.d.ts.map +1 -0
- package/dist/config/ConfigUtils.js +14 -0
- package/dist/dapp-api/controller.d.ts +18 -0
- package/dist/dapp-api/controller.d.ts.map +1 -0
- package/dist/dapp-api/controller.js +101 -0
- package/dist/dapp-api/rpc-gen/index.d.ts +36 -0
- package/dist/dapp-api/rpc-gen/index.d.ts.map +1 -0
- package/dist/dapp-api/rpc-gen/index.js +17 -0
- package/dist/dapp-api/rpc-gen/typings.d.ts +337 -0
- package/dist/dapp-api/rpc-gen/typings.d.ts.map +1 -0
- package/dist/dapp-api/rpc-gen/typings.js +3 -0
- package/dist/dapp-api/server.d.ts +6 -0
- package/dist/dapp-api/server.d.ts.map +1 -0
- package/dist/dapp-api/server.js +62 -0
- package/dist/dapp-api/server.test.d.ts +2 -0
- package/dist/dapp-api/server.test.d.ts.map +1 -0
- package/dist/dapp-api/server.test.js +45 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/init.d.ts +9 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +77 -0
- package/dist/ledger/party-allocation-service.d.ts +34 -0
- package/dist/ledger/party-allocation-service.d.ts.map +1 -0
- package/dist/ledger/party-allocation-service.js +50 -0
- package/dist/ledger/party-allocation-service.test.d.ts +2 -0
- package/dist/ledger/party-allocation-service.test.d.ts.map +1 -0
- package/dist/ledger/party-allocation-service.test.js +85 -0
- package/dist/ledger/wallet-sync-service.d.ts +18 -0
- package/dist/ledger/wallet-sync-service.d.ts.map +1 -0
- package/dist/ledger/wallet-sync-service.js +90 -0
- package/dist/middleware/jsonRpcHandler.d.ts +9 -0
- package/dist/middleware/jsonRpcHandler.d.ts.map +1 -0
- package/dist/middleware/jsonRpcHandler.js +102 -0
- package/dist/middleware/jwtAuth.d.ts +5 -0
- package/dist/middleware/jwtAuth.d.ts.map +1 -0
- package/dist/middleware/jwtAuth.js +20 -0
- package/dist/middleware/rateLimit.d.ts +2 -0
- package/dist/middleware/rateLimit.d.ts.map +1 -0
- package/dist/middleware/rateLimit.js +9 -0
- package/dist/notification/NotificationService.d.ts +11 -0
- package/dist/notification/NotificationService.d.ts.map +1 -0
- package/dist/notification/NotificationService.js +5 -0
- package/dist/user-api/controller.d.ts +23 -0
- package/dist/user-api/controller.d.ts.map +1 -0
- package/dist/user-api/controller.js +336 -0
- package/dist/user-api/rpc-gen/index.d.ts +42 -0
- package/dist/user-api/rpc-gen/index.d.ts.map +1 -0
- package/dist/user-api/rpc-gen/index.js +19 -0
- package/dist/user-api/rpc-gen/typings.d.ts +297 -0
- package/dist/user-api/rpc-gen/typings.d.ts.map +1 -0
- package/dist/user-api/rpc-gen/typings.js +3 -0
- package/dist/user-api/server.d.ts +7 -0
- package/dist/user-api/server.d.ts.map +1 -0
- package/dist/user-api/server.js +20 -0
- package/dist/user-api/server.test.d.ts +2 -0
- package/dist/user-api/server.test.d.ts.map +1 -0
- package/dist/user-api/server.test.js +38 -0
- package/dist/web/frontend/404/index.html +20 -0
- package/dist/web/frontend/approve/index.html +23 -0
- package/dist/web/frontend/assets/404-BHkjVWlW.js +16 -0
- package/dist/web/frontend/assets/approve-lRsfAWmm.js +157 -0
- package/dist/web/frontend/assets/callback-QrXhW3mX.js +1 -0
- package/dist/web/frontend/assets/handle-errors-BcwHAkCd.js +1 -0
- package/dist/web/frontend/assets/index-BknZMPaI.css +5 -0
- package/dist/web/frontend/assets/index-BxdGgjHv.js +1 -0
- package/dist/web/frontend/assets/index-D-GexOrJ.js +697 -0
- package/dist/web/frontend/assets/index-TZrNw7dA.css +1 -0
- package/dist/web/frontend/assets/login-HUymBqli.js +159 -0
- package/dist/web/frontend/assets/networks-BZihbVwK.js +221 -0
- package/dist/web/frontend/assets/rpc-client-CCUlY3sp.js +1 -0
- package/dist/web/frontend/assets/state-DKGJ6EmM.js +9 -0
- package/dist/web/frontend/assets/state-manager-BNW0y5PZ.js +23 -0
- package/dist/web/frontend/assets/wallets-BoN6kUME.js +214 -0
- package/dist/web/frontend/callback/index.html +13 -0
- package/dist/web/frontend/icon.png +0 -0
- package/dist/web/frontend/index.html +19 -0
- package/dist/web/frontend/login/index.html +21 -0
- package/dist/web/frontend/networks/index.html +20 -0
- package/dist/web/frontend/wallets/index.html +22 -0
- package/dist/web/server.d.ts +2 -0
- package/dist/web/server.d.ts.map +1 -0
- package/dist/web/server.js +30 -0
- package/package.json +86 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Name of network
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export type Name = string;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* Description of network
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export type Description = string;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* Synchronizer ID
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
export type SynchronizerId = string;
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* Network Id
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
export type ChainId = string;
|
|
25
|
+
export type Type = string;
|
|
26
|
+
export type TokenUrl = string;
|
|
27
|
+
export type GrantType = string;
|
|
28
|
+
export type Scope = string;
|
|
29
|
+
export type ClientId = string;
|
|
30
|
+
export type Issuer = string;
|
|
31
|
+
export type ConfigUrl = string;
|
|
32
|
+
export type Audience = string;
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* Represents the type of auth (implicit or password) for a specified network
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
export interface Auth {
|
|
39
|
+
authType?: Type;
|
|
40
|
+
tokenUrl?: TokenUrl;
|
|
41
|
+
grantType?: GrantType;
|
|
42
|
+
scope?: Scope;
|
|
43
|
+
clientId?: ClientId;
|
|
44
|
+
issuer: Issuer;
|
|
45
|
+
configUrl: ConfigUrl;
|
|
46
|
+
audience?: Audience;
|
|
47
|
+
[k: string]: any;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* Ledger api url
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
export type LedgerApi = string;
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* Structure representing the Networks
|
|
58
|
+
*
|
|
59
|
+
*/
|
|
60
|
+
export interface Network {
|
|
61
|
+
name: Name;
|
|
62
|
+
description: Description;
|
|
63
|
+
synchronizerId: SynchronizerId;
|
|
64
|
+
chainId: ChainId;
|
|
65
|
+
auth: Auth;
|
|
66
|
+
ledgerApi: LedgerApi;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* Ledger api url
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
export type NetworkName = string;
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
* Set as primary wallet for dApp usage.
|
|
77
|
+
*
|
|
78
|
+
*/
|
|
79
|
+
export type Primary = boolean;
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
82
|
+
* The party hint and name of the wallet.
|
|
83
|
+
*
|
|
84
|
+
*/
|
|
85
|
+
export type PartyHint = string;
|
|
86
|
+
/**
|
|
87
|
+
*
|
|
88
|
+
* The signing provider ID the wallet corresponds to.
|
|
89
|
+
*
|
|
90
|
+
*/
|
|
91
|
+
export type SigningProviderId = string;
|
|
92
|
+
export type PartyId = string;
|
|
93
|
+
/**
|
|
94
|
+
*
|
|
95
|
+
* Filter wallets by network IDs.
|
|
96
|
+
*
|
|
97
|
+
*/
|
|
98
|
+
export type ChainIds = ChainId[];
|
|
99
|
+
/**
|
|
100
|
+
*
|
|
101
|
+
* Filter wallets by signing provider IDs.
|
|
102
|
+
*
|
|
103
|
+
*/
|
|
104
|
+
export type SigningProviderIds = SigningProviderId[];
|
|
105
|
+
/**
|
|
106
|
+
*
|
|
107
|
+
* Filter for the wallets to be returned.
|
|
108
|
+
*
|
|
109
|
+
*/
|
|
110
|
+
export interface WalletFilter {
|
|
111
|
+
chainIds?: ChainIds;
|
|
112
|
+
signingProviderIds?: SigningProviderIds;
|
|
113
|
+
[k: string]: any;
|
|
114
|
+
}
|
|
115
|
+
export type PreparedTransaction = string;
|
|
116
|
+
export type PreparedTransactionHash = string;
|
|
117
|
+
/**
|
|
118
|
+
*
|
|
119
|
+
* The command ID of the transaction to be executed.
|
|
120
|
+
*
|
|
121
|
+
*/
|
|
122
|
+
export type CommandId = string;
|
|
123
|
+
export type Signature = string;
|
|
124
|
+
export type SignedBy = string;
|
|
125
|
+
/**
|
|
126
|
+
*
|
|
127
|
+
* The party hint and name of the wallet.
|
|
128
|
+
*
|
|
129
|
+
*/
|
|
130
|
+
export type Hint = string;
|
|
131
|
+
/**
|
|
132
|
+
*
|
|
133
|
+
* The public key of the party.
|
|
134
|
+
*
|
|
135
|
+
*/
|
|
136
|
+
export type PublicKey = string;
|
|
137
|
+
/**
|
|
138
|
+
*
|
|
139
|
+
* The namespace of the party.
|
|
140
|
+
*
|
|
141
|
+
*/
|
|
142
|
+
export type Namespace = string;
|
|
143
|
+
/**
|
|
144
|
+
*
|
|
145
|
+
* Structure representing a wallet
|
|
146
|
+
*
|
|
147
|
+
*/
|
|
148
|
+
export interface Wallet {
|
|
149
|
+
primary: Primary;
|
|
150
|
+
partyId: PartyId;
|
|
151
|
+
hint: Hint;
|
|
152
|
+
publicKey: PublicKey;
|
|
153
|
+
namespace: Namespace;
|
|
154
|
+
chainId: ChainId;
|
|
155
|
+
signingProviderId: SigningProviderId;
|
|
156
|
+
[k: string]: any;
|
|
157
|
+
}
|
|
158
|
+
export type Added = Wallet[];
|
|
159
|
+
export type Removed = Wallet[];
|
|
160
|
+
export type Networks = Network[];
|
|
161
|
+
/**
|
|
162
|
+
*
|
|
163
|
+
* The access token for the session.
|
|
164
|
+
*
|
|
165
|
+
*/
|
|
166
|
+
export type AccessToken = string;
|
|
167
|
+
export type Status = 'connected' | 'disconnected';
|
|
168
|
+
/**
|
|
169
|
+
*
|
|
170
|
+
* Structure representing the connected network session
|
|
171
|
+
*
|
|
172
|
+
*/
|
|
173
|
+
export interface Session {
|
|
174
|
+
network: Network;
|
|
175
|
+
accessToken: AccessToken;
|
|
176
|
+
status: Status;
|
|
177
|
+
}
|
|
178
|
+
export type Sessions = Session[];
|
|
179
|
+
export interface AddNetworkParams {
|
|
180
|
+
network: Network;
|
|
181
|
+
[k: string]: any;
|
|
182
|
+
}
|
|
183
|
+
export interface RemoveNetworkParams {
|
|
184
|
+
networkName: NetworkName;
|
|
185
|
+
[k: string]: any;
|
|
186
|
+
}
|
|
187
|
+
export interface CreateWalletParams {
|
|
188
|
+
primary?: Primary;
|
|
189
|
+
partyHint: PartyHint;
|
|
190
|
+
chainId: ChainId;
|
|
191
|
+
signingProviderId: SigningProviderId;
|
|
192
|
+
[k: string]: any;
|
|
193
|
+
}
|
|
194
|
+
export interface SetPrimaryWalletParams {
|
|
195
|
+
partyId: PartyId;
|
|
196
|
+
[k: string]: any;
|
|
197
|
+
}
|
|
198
|
+
export interface RemoveWalletParams {
|
|
199
|
+
partyId: PartyId;
|
|
200
|
+
[k: string]: any;
|
|
201
|
+
}
|
|
202
|
+
export interface ListWalletsParams {
|
|
203
|
+
filter?: WalletFilter;
|
|
204
|
+
[k: string]: any;
|
|
205
|
+
}
|
|
206
|
+
export interface SignParams {
|
|
207
|
+
preparedTransaction: PreparedTransaction;
|
|
208
|
+
preparedTransactionHash: PreparedTransactionHash;
|
|
209
|
+
commandId: CommandId;
|
|
210
|
+
partyId: PartyId;
|
|
211
|
+
[k: string]: any;
|
|
212
|
+
}
|
|
213
|
+
export interface ExecuteParams {
|
|
214
|
+
signature: Signature;
|
|
215
|
+
partyId: PartyId;
|
|
216
|
+
commandId: CommandId;
|
|
217
|
+
signedBy: SignedBy;
|
|
218
|
+
[k: string]: any;
|
|
219
|
+
}
|
|
220
|
+
export interface AddSessionParams {
|
|
221
|
+
chainId: ChainId;
|
|
222
|
+
[k: string]: any;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
*
|
|
226
|
+
* Represents a null value, used in responses where no data is returned.
|
|
227
|
+
*
|
|
228
|
+
*/
|
|
229
|
+
export type Null = null;
|
|
230
|
+
export interface CreateWalletResult {
|
|
231
|
+
wallet: Wallet;
|
|
232
|
+
[k: string]: any;
|
|
233
|
+
}
|
|
234
|
+
export interface RemovePartyResult {
|
|
235
|
+
[key: string]: any;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
*
|
|
239
|
+
* An array of wallets that match the filter criteria.
|
|
240
|
+
*
|
|
241
|
+
*/
|
|
242
|
+
export type ListWalletsResult = Wallet[];
|
|
243
|
+
/**
|
|
244
|
+
*
|
|
245
|
+
* Added and removed wallets as a result of the sync.
|
|
246
|
+
*
|
|
247
|
+
*/
|
|
248
|
+
export interface SyncWalletsResult {
|
|
249
|
+
added: Added;
|
|
250
|
+
removed: Removed;
|
|
251
|
+
[k: string]: any;
|
|
252
|
+
}
|
|
253
|
+
export interface SignResult {
|
|
254
|
+
signature: Signature;
|
|
255
|
+
partyId: PartyId;
|
|
256
|
+
signedBy: SignedBy;
|
|
257
|
+
[k: string]: any;
|
|
258
|
+
}
|
|
259
|
+
export interface ExecuteResult {
|
|
260
|
+
[key: string]: any;
|
|
261
|
+
}
|
|
262
|
+
export interface ListNetworksResult {
|
|
263
|
+
networks: Networks;
|
|
264
|
+
[k: string]: any;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
*
|
|
268
|
+
* Structure representing the connected network session
|
|
269
|
+
*
|
|
270
|
+
*/
|
|
271
|
+
export interface AddSessionResult {
|
|
272
|
+
network: Network;
|
|
273
|
+
accessToken: AccessToken;
|
|
274
|
+
status: Status;
|
|
275
|
+
}
|
|
276
|
+
export interface ListSessionsResult {
|
|
277
|
+
sessions: Sessions;
|
|
278
|
+
[k: string]: any;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
*
|
|
282
|
+
* Generated! Represents an alias to any of the provided schemas
|
|
283
|
+
*
|
|
284
|
+
*/
|
|
285
|
+
export type AddNetwork = (params: AddNetworkParams) => Promise<Null>;
|
|
286
|
+
export type RemoveNetwork = (params: RemoveNetworkParams) => Promise<Null>;
|
|
287
|
+
export type CreateWallet = (params: CreateWalletParams) => Promise<CreateWalletResult>;
|
|
288
|
+
export type SetPrimaryWallet = (params: SetPrimaryWalletParams) => Promise<Null>;
|
|
289
|
+
export type RemoveWallet = (params: RemoveWalletParams) => Promise<RemovePartyResult>;
|
|
290
|
+
export type ListWallets = (params: ListWalletsParams) => Promise<ListWalletsResult>;
|
|
291
|
+
export type SyncWallets = () => Promise<SyncWalletsResult>;
|
|
292
|
+
export type Sign = (params: SignParams) => Promise<SignResult>;
|
|
293
|
+
export type Execute = (params: ExecuteParams) => Promise<ExecuteResult>;
|
|
294
|
+
export type ListNetworks = () => Promise<ListNetworksResult>;
|
|
295
|
+
export type AddSession = (params: AddSessionParams) => Promise<AddSessionResult>;
|
|
296
|
+
export type ListSessions = () => Promise<ListSessionsResult>;
|
|
297
|
+
//# sourceMappingURL=typings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typings.d.ts","sourceRoot":"","sources":["../../../src/user-api/rpc-gen/typings.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,MAAM,MAAM,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MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAC5D,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,gBAAgB,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAA;AAChF,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Store } from '@canton-network/core-wallet-store';
|
|
2
|
+
import { AuthService, AuthAware } from '@canton-network/core-wallet-auth';
|
|
3
|
+
import { NotificationService } from '../notification/NotificationService.js';
|
|
4
|
+
import { KernelInfo } from '../config/Config.js';
|
|
5
|
+
import { SigningDriverInterface, SigningProvider } from '@canton-network/core-signing-lib';
|
|
6
|
+
export declare const user: (kernelInfo: KernelInfo, notificationService: NotificationService, authService: AuthService, drivers: Partial<Record<SigningProvider, SigningDriverInterface>>, store: Store & AuthAware<Store>) => import("express-serve-static-core").Express;
|
|
7
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/user-api/server.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;AAIzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EACH,sBAAsB,EACtB,eAAe,EAClB,MAAM,kCAAkC,CAAA;AAIzC,eAAO,MAAM,IAAI,GACb,YAAY,UAAU,EACtB,qBAAqB,mBAAmB,EACxC,aAAa,WAAW,EACxB,SAAS,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,sBAAsB,CAAC,CAAC,EACjE,OAAO,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,gDAwBlC,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import express from 'express';
|
|
4
|
+
import { userController } from './controller.js';
|
|
5
|
+
import { pino } from 'pino';
|
|
6
|
+
import { jsonRpcHandler } from '../middleware/jsonRpcHandler.js';
|
|
7
|
+
import { jwtAuth } from '../middleware/jwtAuth.js';
|
|
8
|
+
import { rpcRateLimit } from '../middleware/rateLimit.js';
|
|
9
|
+
import cors from 'cors';
|
|
10
|
+
const logger = pino({ name: 'main', level: 'debug' });
|
|
11
|
+
export const user = (kernelInfo, notificationService, authService, drivers, store) => {
|
|
12
|
+
const user = express();
|
|
13
|
+
user.use(cors());
|
|
14
|
+
user.use(express.json());
|
|
15
|
+
user.use('/rpc', rpcRateLimit, jwtAuth(authService, logger), (req, res, next) => jsonRpcHandler({
|
|
16
|
+
controller: userController(kernelInfo, store.withAuthContext(req.authContext), notificationService, req.authContext, drivers, logger),
|
|
17
|
+
logger,
|
|
18
|
+
})(req, res, next));
|
|
19
|
+
return user;
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.test.d.ts","sourceRoot":"","sources":["../../src/user-api/server.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { expect, jest, test } from '@jest/globals';
|
|
4
|
+
import request from 'supertest';
|
|
5
|
+
import { user } from './server.js';
|
|
6
|
+
import { StoreInternal } from '@canton-network/core-wallet-store-inmemory';
|
|
7
|
+
import { ConfigUtils } from '../config/ConfigUtils.js';
|
|
8
|
+
import { pino } from 'pino';
|
|
9
|
+
import { sink } from 'pino-test';
|
|
10
|
+
const authService = {
|
|
11
|
+
verifyToken: async () => {
|
|
12
|
+
return new Promise((resolve) => resolve({ userId: 'user123', accessToken: 'token123' }));
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
const configPath = '../test/config.json';
|
|
16
|
+
const config = ConfigUtils.loadConfigFile(configPath);
|
|
17
|
+
const store = new StoreInternal(config.store, pino(sink()));
|
|
18
|
+
const notificationService = {
|
|
19
|
+
getNotifier: jest.fn().mockReturnValue({
|
|
20
|
+
on: jest.fn(),
|
|
21
|
+
emit: jest.fn(),
|
|
22
|
+
removeListener: jest.fn(),
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
test('call connect rpc', async () => {
|
|
26
|
+
const drivers = {};
|
|
27
|
+
const response = await request(user(config.kernel, notificationService, authService, drivers, store))
|
|
28
|
+
.post('/rpc')
|
|
29
|
+
.send({ jsonrpc: '2.0', id: 0, method: 'listNetworks', params: [] })
|
|
30
|
+
.set('Accept', 'application/json');
|
|
31
|
+
const json = await response.body.result;
|
|
32
|
+
expect(response.statusCode).toBe(200);
|
|
33
|
+
expect(json.networks.length).toBe(4);
|
|
34
|
+
expect(json.networks[0].name).toBe('Local (password IDP)');
|
|
35
|
+
expect(json.networks[1].name).toBe('Local (OAuth IDP)');
|
|
36
|
+
expect(json.networks[2].name).toBe('Local (OAuth IDP - Client Credentials)');
|
|
37
|
+
expect(json.networks[3].name).toBe('Devnet (Auth0)');
|
|
38
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<title>Wallet Kernel - Not found</title>
|
|
6
|
+
<script type="module" crossorigin src="/assets/404-BHkjVWlW.js"></script>
|
|
7
|
+
<link rel="modulepreload" crossorigin href="/assets/state-manager-BNW0y5PZ.js">
|
|
8
|
+
<link rel="modulepreload" crossorigin href="/assets/index-D-GexOrJ.js">
|
|
9
|
+
<link rel="modulepreload" crossorigin href="/assets/index-BxdGgjHv.js">
|
|
10
|
+
<link rel="stylesheet" crossorigin href="/assets/index-TZrNw7dA.css">
|
|
11
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BknZMPaI.css">
|
|
12
|
+
</head>
|
|
13
|
+
|
|
14
|
+
<body>
|
|
15
|
+
<app-layout iconSrc="/icon.png">
|
|
16
|
+
<user-ui-auth-redirect></user-ui-auth-redirect>
|
|
17
|
+
<user-ui-404></user-ui-404>
|
|
18
|
+
</app-layout>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<title>Wallet Kernel - Approve Write Request</title>
|
|
6
|
+
<script type="module" crossorigin src="/assets/approve-lRsfAWmm.js"></script>
|
|
7
|
+
<link rel="modulepreload" crossorigin href="/assets/state-manager-BNW0y5PZ.js">
|
|
8
|
+
<link rel="modulepreload" crossorigin href="/assets/index-D-GexOrJ.js">
|
|
9
|
+
<link rel="modulepreload" crossorigin href="/assets/index-BxdGgjHv.js">
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/state-DKGJ6EmM.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/rpc-client-CCUlY3sp.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/handle-errors-BcwHAkCd.js">
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-TZrNw7dA.css">
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BknZMPaI.css">
|
|
15
|
+
</head>
|
|
16
|
+
|
|
17
|
+
<body>
|
|
18
|
+
<app-layout iconSrc="/icon.png">
|
|
19
|
+
<user-ui-auth-redirect></user-ui-auth-redirect>
|
|
20
|
+
<user-ui-approve></user-ui-approve>
|
|
21
|
+
</app-layout>
|
|
22
|
+
</body>
|
|
23
|
+
</html>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{i as k,a as z,x as O,t as P}from"./state-manager-BNW0y5PZ.js";import"./index-BxdGgjHv.js";import"./index-D-GexOrJ.js";var C=Object.create,p=Object.defineProperty,E=Object.getOwnPropertyDescriptor,b=(r,e)=>(e=Symbol[r])?e:Symbol.for("Symbol."+r),h=r=>{throw TypeError(r)},I=(r,e,a)=>e in r?p(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,j=(r,e)=>p(r,"name",{value:e,configurable:!0}),A=r=>[,,,C((r==null?void 0:r[b("metadata")])??null)],D=["class","method","getter","setter","accessor","field","value","get","set"],w=r=>r!==void 0&&typeof r!="function"?h("Function expected"):r,F=(r,e,a,i,t)=>({kind:D[r],name:e,metadata:i,addInitializer:o=>a._?h("Already initialized"):t.push(w(o||null))}),M=(r,e)=>I(e,b("metadata"),r[3]),N=(r,e,a,i)=>{for(var t=0,o=r[e>>1],n=o&&o.length;t<n;t++)o[t].call(a);return i},T=(r,e,a,i,t,o)=>{var n,u,m,l=e&7,f=!1,x=0,g=r[x]||(r[x]=[]),d=l&&(t=t.prototype,l<5&&(l>3||!f)&&E(t,a));j(t,a);for(var _=i.length-1;_>=0;_--)m=F(l,a,u={},r[3],g),n=(0,i[_])(t,m),u._=1,w(n)&&(t=n);return M(r,t),d&&p(t,a,d),f?l^4?o:d:t},y,s,S;y=[P("user-ui-404")];const v=class v extends(S=k){connectedCallback(){super.connectedCallback()}render(){return O`
|
|
2
|
+
<div class="wrapper">
|
|
3
|
+
<not-found />
|
|
4
|
+
</div>
|
|
5
|
+
`}};v.styles=z`
|
|
6
|
+
:host {
|
|
7
|
+
display: block;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
padding: 0rem;
|
|
10
|
+
max-width: 900px;
|
|
11
|
+
margin: 20% auto;
|
|
12
|
+
font-family: var(--swk-font, Arial, sans-serif);
|
|
13
|
+
color: var(--text-color, #222);
|
|
14
|
+
padding: 20px;
|
|
15
|
+
}
|
|
16
|
+
`;let c=v;s=A(S);c=T(s,0,"ApproveUi",y,c);N(s,1,c);
|