Skip to content

Commit c85d7e5

Browse files
authored
fix: consolidate specs and fix open() (#1010)
Signed-off-by: Marc Juchli <[email protected]>
1 parent 814582f commit c85d7e5

File tree

12 files changed

+231
-950
lines changed

12 files changed

+231
-950
lines changed

api-specs/openrpc-dapp-api.json

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"result": {
1313
"name": "result",
1414
"schema": {
15-
"$ref": "#/components/schemas/StatusEvent"
15+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/StatusEvent"
1616
}
1717
},
1818
"description": "Returns the current status of the wallet gateway session."
@@ -23,7 +23,7 @@
2323
"result": {
2424
"name": "result",
2525
"schema": {
26-
"$ref": "#/components/schemas/StatusEvent"
26+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/StatusEvent"
2727
}
2828
},
2929
"description": "Ensures ledger connectivity and returns the connected network information along with the user access token. Network ID should follow CAIP-2 and represent the synchronizerId."
@@ -34,7 +34,7 @@
3434
"result": {
3535
"name": "result",
3636
"schema": {
37-
"$ref": "#/components/schemas/Null"
37+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/Null"
3838
}
3939
},
4040
"description": "Invoke a disconnect of the wallet gateway session."
@@ -69,7 +69,7 @@
6969
"name": "params",
7070
"schema": {
7171
"title": "prepareReturnParams",
72-
"$ref": "#/components/schemas/JsPrepareSubmissionRequest"
72+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/JsPrepareSubmissionRequest"
7373
}
7474
}
7575
],
@@ -79,7 +79,7 @@
7979
"title": "prepareReturnResult",
8080
"properties": {
8181
"response": {
82-
"$ref": "#/components/schemas/JsPrepareSubmissionResponse"
82+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/JsPrepareSubmissionResponse"
8383
}
8484
},
8585
"required": ["response"]
@@ -94,7 +94,7 @@
9494
"name": "params",
9595
"schema": {
9696
"title": "prepareExecuteParams",
97-
"$ref": "#/components/schemas/JsPrepareSubmissionRequest"
97+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/JsPrepareSubmissionRequest"
9898
}
9999
}
100100
],
@@ -105,7 +105,7 @@
105105
"type": "object",
106106
"properties": {
107107
"tx": {
108-
"$ref": "#/components/schemas/TxChangedExecutedEvent"
108+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/TxChangedExecutedEvent"
109109
}
110110
},
111111
"required": ["tx"]
@@ -120,30 +120,14 @@
120120
"name": "params",
121121
"schema": {
122122
"title": "ledgerApiParams",
123-
"type": "object",
124-
"properties": {
125-
"requestMethod": {
126-
"title": "requestMethod",
127-
"type": "string",
128-
"enum": ["GET", "POST", "PUT", "DELETE"]
129-
},
130-
"resource": {
131-
"title": "resource",
132-
"type": "string"
133-
},
134-
"body": {
135-
"title": "body",
136-
"type": "string"
137-
}
138-
},
139-
"required": ["requestMethod", "resource"]
123+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/LedgerApiRequest"
140124
}
141125
}
142126
],
143127
"result": {
144128
"name": "result",
145129
"schema": {
146-
"$ref": "#/components/schemas/LedgerApiResult"
130+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/LedgerApiResult"
147131
}
148132
},
149133
"description": "Proxy for the JSON-API endpoints. Injects authorization headers automatically."
@@ -154,7 +138,7 @@
154138
"result": {
155139
"name": "result",
156140
"schema": {
157-
"$ref": "#/components/schemas/AccountsChangedEvent"
141+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/AccountsChangedEvent"
158142
}
159143
}
160144
},
@@ -164,7 +148,7 @@
164148
"result": {
165149
"name": "result",
166150
"schema": {
167-
"$ref": "#/components/schemas/RequestAccountsResult"
151+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/RequestAccountsResult"
168152
}
169153
},
170154
"description": "Lists the addresses (wallets) with their properties; including which network they are associated to and with signing provider is used."
@@ -175,7 +159,7 @@
175159
"result": {
176160
"name": "result",
177161
"schema": {
178-
"$ref": "#/components/schemas/TxChangedEvent"
162+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/TxChangedEvent"
179163
}
180164
}
181165
}
@@ -209,7 +193,7 @@
209193
"description": "The URL of the Wallet Gateway."
210194
},
211195
"userUrl": {
212-
"$ref": "#/components/schemas/UserUrl"
196+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/UserUrl"
213197
}
214198
},
215199
"required": ["id", "clientType"]
@@ -238,10 +222,10 @@
238222
"description": "Structure representing the request for prepare and execute calls",
239223
"properties": {
240224
"commandId": {
241-
"$ref": "#/components/schemas/CommandId"
225+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/CommandId"
242226
},
243227
"commands": {
244-
"$ref": "#/components/schemas/JsCommands"
228+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/JsCommands"
245229
},
246230
"actAs": {
247231
"title": "actAs",
@@ -266,7 +250,7 @@
266250
"type": "array",
267251
"description": "List of contract IDs to be disclosed with the command.",
268252
"items": {
269-
"$ref": "#/components/schemas/DisclosedContract"
253+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/DisclosedContract"
270254
}
271255
},
272256
"synchronizerId": {
@@ -336,6 +320,27 @@
336320
}
337321
}
338322
},
323+
"LedgerApiRequest": {
324+
"title": "LedgerApiRequest",
325+
"type": "object",
326+
"description": "Ledger API request structure",
327+
"properties": {
328+
"requestMethod": {
329+
"title": "requestMethod",
330+
"type": "string",
331+
"enum": ["GET", "POST", "PUT", "DELETE"]
332+
},
333+
"resource": {
334+
"title": "resource",
335+
"type": "string"
336+
},
337+
"body": {
338+
"title": "body",
339+
"type": "string"
340+
}
341+
},
342+
"required": ["requestMethod", "resource"]
343+
},
339344
"AccountsChangedEvent": {
340345
"title": "AccountsChangedEvent",
341346
"type": "array",
@@ -370,7 +375,7 @@
370375
"description": "The status of the transaction."
371376
},
372377
"commandId": {
373-
"$ref": "#/components/schemas/CommandId"
378+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/CommandId"
374379
}
375380
},
376381
"required": ["status", "commandId"]
@@ -412,10 +417,10 @@
412417
"description": "The status of the transaction."
413418
},
414419
"commandId": {
415-
"$ref": "#/components/schemas/CommandId"
420+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/CommandId"
416421
},
417422
"payload": {
418-
"$ref": "#/components/schemas/TxChangedSignedPayload"
423+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/TxChangedSignedPayload"
419424
}
420425
},
421426
"required": ["status", "commandId", "payload"]
@@ -451,10 +456,10 @@
451456
"description": "The status of the transaction."
452457
},
453458
"commandId": {
454-
"$ref": "#/components/schemas/CommandId"
459+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/CommandId"
455460
},
456461
"payload": {
457-
"$ref": "#/components/schemas/TxChangedExecutedPayload"
462+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/TxChangedExecutedPayload"
458463
}
459464
},
460465
"required": ["status", "commandId", "payload"]
@@ -472,7 +477,7 @@
472477
"description": "The status of the transaction."
473478
},
474479
"commandId": {
475-
"$ref": "#/components/schemas/CommandId"
480+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/CommandId"
476481
}
477482
},
478483
"required": ["status", "commandId"]
@@ -482,16 +487,16 @@
482487
"description": "Event emitted when a transaction changes.",
483488
"oneOf": [
484489
{
485-
"$ref": "#/components/schemas/TxChangedPendingEvent"
490+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/TxChangedPendingEvent"
486491
},
487492
{
488-
"$ref": "#/components/schemas/TxChangedSignedEvent"
493+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/TxChangedSignedEvent"
489494
},
490495
{
491-
"$ref": "#/components/schemas/TxChangedExecutedEvent"
496+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/TxChangedExecutedEvent"
492497
},
493498
{
494-
"$ref": "#/components/schemas/TxChangedFailedEvent"
499+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/TxChangedFailedEvent"
495500
}
496501
]
497502
},
@@ -500,7 +505,7 @@
500505
"type": "object",
501506
"properties": {
502507
"kernel": {
503-
"$ref": "#/components/schemas/KernelInfo"
508+
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/KernelInfo"
504509
},
505510
"isConnected": {
506511
"title": "isConnected",
@@ -517,9 +522,6 @@
517522
"type": "string",
518523
"description": "If not connected to a network, the reason why."
519524
},
520-
"userUrl": {
521-
"$ref": "#/components/schemas/UserUrl"
522-
},
523525
"network": {
524526
"title": "network",
525527
"type": "object",

0 commit comments

Comments
 (0)