Skip to content

Commit e046136

Browse files
committed
fix e2e test
Signed-off-by: Alex Matson <[email protected]>
1 parent 6ba88f6 commit e046136

File tree

13 files changed

+323
-112
lines changed

13 files changed

+323
-112
lines changed

api-specs/openrpc-user-api.json

Lines changed: 72 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,48 @@
5858
},
5959
"description": "Removes a new network configuration (similar to EIP-3085)."
6060
},
61+
{
62+
"name": "listNetworks",
63+
"params": [],
64+
"result": {
65+
"name": "result",
66+
"schema": {
67+
"title": "ListNetworksResult",
68+
"type": "object",
69+
"properties": {
70+
"networks": {
71+
"title": "networks",
72+
"type": "array",
73+
"items": {
74+
"$ref": "#/components/schemas/Network"
75+
}
76+
}
77+
},
78+
"required": ["networks"]
79+
}
80+
}
81+
},
82+
{
83+
"name": "listIdps",
84+
"params": [],
85+
"result": {
86+
"name": "result",
87+
"schema": {
88+
"title": "ListIdpsResult",
89+
"type": "object",
90+
"properties": {
91+
"idps": {
92+
"title": "idps",
93+
"type": "array",
94+
"items": {
95+
"$ref": "#/components/schemas/Idp"
96+
}
97+
}
98+
},
99+
"required": ["idps"]
100+
}
101+
}
102+
},
61103
{
62104
"name": "createWallet",
63105
"params": [
@@ -335,27 +377,6 @@
335377
},
336378
"description": "Executes a signed transaction."
337379
},
338-
{
339-
"name": "listNetworks",
340-
"params": [],
341-
"result": {
342-
"name": "result",
343-
"schema": {
344-
"title": "ListNetworksResult",
345-
"type": "object",
346-
"properties": {
347-
"networks": {
348-
"title": "networks",
349-
"type": "array",
350-
"items": {
351-
"$ref": "#/components/schemas/Network"
352-
}
353-
}
354-
},
355-
"required": ["networks"]
356-
}
357-
}
358-
},
359380
{
360381
"name": "addSession",
361382
"description": "Adds a network session.",
@@ -467,10 +488,40 @@
467488
],
468489
"additionalProperties": false
469490
},
491+
"Idp": {
492+
"title": "Idp",
493+
"type": "object",
494+
"description": "Structure representing the Identity Providers",
495+
"properties": {
496+
"id": {
497+
"title": "id",
498+
"type": "string",
499+
"description": "ID of the identity provider"
500+
},
501+
"type": {
502+
"title": "type",
503+
"type": "string",
504+
"description": "Type of identity provider (OAuth2 or Self-Signed)"
505+
},
506+
"issuer": {
507+
"title": "issuer",
508+
"type": "string",
509+
"description": "Issuer of identity provider"
510+
},
511+
"configUrl": {
512+
"title": "configUrl",
513+
"type": "string",
514+
"description": "URL to fetch the identity provider configuration"
515+
}
516+
},
517+
"required": ["id", "type", "issuer"],
518+
"additionalProperties": false
519+
},
470520
"Auth": {
471521
"title": "auth",
472522
"type": "object",
473523
"description": "Represents the type of auth for a specified network",
524+
"additionalProperties": false,
474525
"properties": {
475526
"method": {
476527
"title": "method",

core/wallet-dapp-rpc-client/src/openrpc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@
452452
"networkId": {
453453
"title": "networkId",
454454
"type": "string",
455-
"description": "A CAIP-2 compliant network ID, e.g. 'canton:da-mainnet'."
455+
"description": "A CAIP-2 compliant chain ID, e.g. 'canton:da-mainnet'."
456456
}
457457
},
458458
"required": ["kernel", "isConnected"]

core/wallet-store-sql/src/bootstrap.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ export async function bootstrap(
1313
logger: Logger
1414
): Promise<void> {
1515
const store = new StoreSql(db, logger)
16+
17+
// Load all IDPs from config into the store
18+
await Promise.all(config.idps.map((idp) => store.addIdp(idp)))
19+
20+
// Load all networks from config into the store
1621
await Promise.all(
1722
config.networks.map((network) => store.addNetwork(network))
1823
)

core/wallet-user-rpc-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@canton-network/core-wallet-user-rpc-client",
3-
"version": "0.0.0",
3+
"version": "0.11.0",
44
"type": "module",
55
"description": "TypeScript client generated by OpenRPC",
66
"repository": "github:hyperledger-labs/splice-wallet-kernel",

core/wallet-user-rpc-client/src/index.ts

Lines changed: 63 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,11 @@ export type Audience = string
4646
*/
4747
export interface Auth {
4848
method: Method
49-
scope?: Scope
50-
clientId?: ClientId
49+
scope: Scope
50+
clientId: ClientId
5151
clientSecret?: ClientSecret
52-
issuer: Issuer
53-
audience?: Audience
54-
[k: string]: any
52+
issuer?: Issuer
53+
audience: Audience
5554
}
5655
/**
5756
*
@@ -131,6 +130,37 @@ export type PreparedTransactionHash = string
131130
export type CommandId = string
132131
export type Signature = string
133132
export type SignedBy = string
133+
export type Networks = Network[]
134+
/**
135+
*
136+
* ID of the identity provider
137+
*
138+
*/
139+
export type Id = string
140+
/**
141+
*
142+
* Type of identity provider (OAuth2 or Self-Signed)
143+
*
144+
*/
145+
export type Type = string
146+
/**
147+
*
148+
* URL to fetch the identity provider configuration
149+
*
150+
*/
151+
export type ConfigUrl = string
152+
/**
153+
*
154+
* Structure representing the Identity Providers
155+
*
156+
*/
157+
export interface Idp {
158+
id: Id
159+
type: Type
160+
issuer: Issuer
161+
configUrl?: ConfigUrl
162+
}
163+
export type Idps = Idp[]
134164
/**
135165
*
136166
* The party hint and name of the wallet.
@@ -166,7 +196,6 @@ export interface Wallet {
166196
}
167197
export type Added = Wallet[]
168198
export type Removed = Wallet[]
169-
export type Networks = Network[]
170199
/**
171200
*
172201
* The access token for the session.
@@ -236,6 +265,14 @@ export interface AddSessionParams {
236265
*
237266
*/
238267
export type Null = null
268+
export interface ListNetworksResult {
269+
networks: Networks
270+
[k: string]: any
271+
}
272+
export interface ListIdpsResult {
273+
idps: Idps
274+
[k: string]: any
275+
}
239276
export interface CreateWalletResult {
240277
wallet: Wallet
241278
[k: string]: any
@@ -268,10 +305,6 @@ export interface SignResult {
268305
export interface ExecuteResult {
269306
[key: string]: any
270307
}
271-
export interface ListNetworksResult {
272-
networks: Networks
273-
[k: string]: any
274-
}
275308
/**
276309
*
277310
* Structure representing the connected network session
@@ -294,6 +327,8 @@ export interface ListSessionsResult {
294327

295328
export type AddNetwork = (params: AddNetworkParams) => Promise<Null>
296329
export type RemoveNetwork = (params: RemoveNetworkParams) => Promise<Null>
330+
export type ListNetworks = () => Promise<ListNetworksResult>
331+
export type ListIdps = () => Promise<ListIdpsResult>
297332
export type CreateWallet = (
298333
params: CreateWalletParams
299334
) => Promise<CreateWalletResult>
@@ -307,7 +342,6 @@ export type ListWallets = (
307342
export type SyncWallets = () => Promise<SyncWalletsResult>
308343
export type Sign = (params: SignParams) => Promise<SignResult>
309344
export type Execute = (params: ExecuteParams) => Promise<ExecuteResult>
310-
export type ListNetworks = () => Promise<ListNetworksResult>
311345
export type AddSession = (params: AddSessionParams) => Promise<AddSessionResult>
312346
export type ListSessions = () => Promise<ListSessionsResult>
313347

@@ -336,6 +370,24 @@ export class SpliceWalletJSONRPCUserAPI {
336370
...params: Parameters<RemoveNetwork>
337371
): ReturnType<RemoveNetwork>
338372

373+
/**
374+
*
375+
*/
376+
// tslint:disable-next-line:max-line-length
377+
public async request(
378+
method: 'listNetworks',
379+
...params: Parameters<ListNetworks>
380+
): ReturnType<ListNetworks>
381+
382+
/**
383+
*
384+
*/
385+
// tslint:disable-next-line:max-line-length
386+
public async request(
387+
method: 'listIdps',
388+
...params: Parameters<ListIdps>
389+
): ReturnType<ListIdps>
390+
339391
/**
340392
*
341393
*/
@@ -399,15 +451,6 @@ export class SpliceWalletJSONRPCUserAPI {
399451
...params: Parameters<Execute>
400452
): ReturnType<Execute>
401453

402-
/**
403-
*
404-
*/
405-
// tslint:disable-next-line:max-line-length
406-
public async request(
407-
method: 'listNetworks',
408-
...params: Parameters<ListNetworks>
409-
): ReturnType<ListNetworks>
410-
411454
/**
412455
*
413456
*/

0 commit comments

Comments
 (0)