pontus-x_cli 0.0.6 → 1.0.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 +558 -154
- package/bin/dev.js +7 -0
- package/bin/run.js +7 -0
- package/dist/commands/access.d.ts +9 -0
- package/dist/commands/access.js +23 -0
- package/dist/commands/access.js.map +1 -0
- package/dist/commands/change-price.d.ts +13 -0
- package/dist/commands/change-price.js +49 -0
- package/dist/commands/change-price.js.map +1 -0
- package/dist/commands/check-participant-compliance.d.ts +10 -0
- package/dist/commands/check-participant-compliance.js +54 -0
- package/dist/commands/check-participant-compliance.js.map +1 -0
- package/dist/commands/compute-results.d.ts +12 -0
- package/dist/commands/compute-results.js +40 -0
- package/dist/commands/compute-results.js.map +1 -0
- package/dist/commands/compute-status.d.ts +12 -0
- package/dist/commands/compute-status.js +40 -0
- package/dist/commands/compute-status.js.map +1 -0
- package/dist/commands/compute.d.ts +14 -0
- package/dist/commands/compute.js +66 -0
- package/dist/commands/compute.js.map +1 -0
- package/dist/commands/edit-algo.d.ts +16 -0
- package/dist/commands/edit-algo.js +51 -0
- package/dist/commands/edit-algo.js.map +1 -0
- package/dist/commands/edit-asset-url.d.ts +13 -0
- package/dist/commands/edit-asset-url.js +55 -0
- package/dist/commands/edit-asset-url.js.map +1 -0
- package/dist/commands/edit-trusted-algos.d.ts +13 -0
- package/dist/commands/edit-trusted-algos.js +54 -0
- package/dist/commands/edit-trusted-algos.js.map +1 -0
- package/dist/commands/export-private-key.d.ts +11 -0
- package/dist/commands/export-private-key.js +67 -0
- package/dist/commands/export-private-key.js.map +1 -0
- package/dist/commands/generate-asset-credentials.d.ts +15 -0
- package/dist/commands/generate-asset-credentials.js +59 -0
- package/dist/commands/generate-asset-credentials.js.map +1 -0
- package/dist/commands/generate-did-web.d.ts +10 -0
- package/dist/commands/generate-did-web.js +39 -0
- package/dist/commands/generate-did-web.js.map +1 -0
- package/dist/commands/generate-participant-credentials.d.ts +12 -0
- package/dist/commands/generate-participant-credentials.js +51 -0
- package/dist/commands/generate-participant-credentials.js.map +1 -0
- package/dist/commands/get.d.ts +9 -0
- package/dist/commands/get.js +23 -0
- package/dist/commands/get.js.map +1 -0
- package/dist/commands/login.d.ts +14 -0
- package/dist/commands/login.js +51 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +6 -0
- package/dist/commands/logout.js +24 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/publish.d.ts +15 -0
- package/dist/commands/publish.js +107 -0
- package/dist/commands/publish.js.map +1 -0
- package/dist/commands/revoke.d.ts +12 -0
- package/dist/commands/revoke.js +50 -0
- package/dist/commands/revoke.js.map +1 -0
- package/dist/commands/self-description.d.ts +13 -0
- package/dist/commands/self-description.js +53 -0
- package/dist/commands/self-description.js.map +1 -0
- package/dist/config.d.ts +48 -0
- package/dist/config.js +106 -117
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -347
- package/dist/index.js.map +1 -1
- package/dist/lib/gaia-x_compliance/generate-credentials/index.d.ts +1 -0
- package/dist/lib/gaia-x_compliance/generate-credentials/index.js +176 -0
- package/dist/lib/gaia-x_compliance/generate-credentials/index.js.map +1 -0
- package/dist/lib/gaia-x_compliance/generate-credentials/templates/dataset.hbs +75 -0
- package/dist/{gaia-x_compliance/generate-participant-credentials → lib/gaia-x_compliance/generate-credentials}/templates/participant.hbs +5 -1
- package/dist/lib/gaia-x_compliance/generate-credentials/templates/service.hbs +55 -0
- package/dist/lib/publishFromFile.d.ts +2 -0
- package/dist/lib/publishFromFile.js +143 -0
- package/dist/lib/publishFromFile.js.map +1 -0
- package/dist/types/schema.d.ts +2 -0
- package/dist/types/schema.js +8 -0
- package/dist/types/schema.js.map +1 -0
- package/dist/types/schema.json +474 -0
- package/dist/utils/connection.d.ts +13 -0
- package/dist/utils/connection.js +11 -19
- package/dist/utils/connection.js.map +1 -1
- package/oclif.manifest.json +830 -0
- package/package.json +69 -32
- package/dist/aquarius-query/index.js +0 -30
- package/dist/aquarius-query/index.js.map +0 -1
- package/dist/export-key-as-json/index.js +0 -27
- package/dist/export-key-as-json/index.js.map +0 -1
- package/dist/gaia-x_compliance/generate-did-web/index.js +0 -14
- package/dist/gaia-x_compliance/generate-did-web/index.js.map +0 -1
- package/dist/gaia-x_compliance/generate-participant-credentials/index.js +0 -161
- package/dist/gaia-x_compliance/generate-participant-credentials/index.js.map +0 -1
- package/dist/publish/samples/algo/index.js +0 -62
- package/dist/publish/samples/algo/index.js.map +0 -1
- package/dist/publish/samples/basic-predictor/index.js +0 -82
- package/dist/publish/samples/basic-predictor/index.js.map +0 -1
- package/dist/publish/samples/data/index.js +0 -55
- package/dist/publish/samples/data/index.js.map +0 -1
- package/dist/utils/index.js +0 -20
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/package-version.js +0 -22
- package/dist/utils/package-version.js.map +0 -1
- package/dist/utils/publish-script-runner.js +0 -60
- package/dist/utils/publish-script-runner.js.map +0 -1
- /package/dist/{gaia-x_compliance/generate-participant-credentials → lib/gaia-x_compliance/generate-credentials}/templates/lrn-request.hbs +0 -0
- /package/dist/{gaia-x_compliance/generate-participant-credentials → lib/gaia-x_compliance/generate-credentials}/templates/tandc.hbs +0 -0
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/PublishConfig",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"ConsumerParameter": {
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"default": {
|
|
9
|
+
"description": "Field default value. For select types, string key of default option.",
|
|
10
|
+
"type": "string"
|
|
11
|
+
},
|
|
12
|
+
"description": {
|
|
13
|
+
"description": "Field description.",
|
|
14
|
+
"type": "string"
|
|
15
|
+
},
|
|
16
|
+
"label": {
|
|
17
|
+
"description": "Displayed field label.",
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"name": {
|
|
21
|
+
"description": "Parameter name.",
|
|
22
|
+
"type": "string"
|
|
23
|
+
},
|
|
24
|
+
"options": {
|
|
25
|
+
"description": "For select types, a list of options.",
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
"required": {
|
|
29
|
+
"description": "Defines if customer input for this field is mandatory.",
|
|
30
|
+
"type": "boolean"
|
|
31
|
+
},
|
|
32
|
+
"type": {
|
|
33
|
+
"description": "Field type.",
|
|
34
|
+
"enum": [
|
|
35
|
+
"text",
|
|
36
|
+
"number",
|
|
37
|
+
"boolean",
|
|
38
|
+
"select"
|
|
39
|
+
],
|
|
40
|
+
"type": "string"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"required": [
|
|
44
|
+
"name",
|
|
45
|
+
"type",
|
|
46
|
+
"label",
|
|
47
|
+
"required",
|
|
48
|
+
"description",
|
|
49
|
+
"default"
|
|
50
|
+
],
|
|
51
|
+
"type": "object"
|
|
52
|
+
},
|
|
53
|
+
"ExtendedConsumerParameter": {
|
|
54
|
+
"additionalProperties": false,
|
|
55
|
+
"properties": {
|
|
56
|
+
"default": {
|
|
57
|
+
"description": "Field default value. For select types, string key of default option.",
|
|
58
|
+
"type": "string"
|
|
59
|
+
},
|
|
60
|
+
"description": {
|
|
61
|
+
"description": "Field description.",
|
|
62
|
+
"type": "string"
|
|
63
|
+
},
|
|
64
|
+
"label": {
|
|
65
|
+
"description": "Displayed field label.",
|
|
66
|
+
"type": "string"
|
|
67
|
+
},
|
|
68
|
+
"name": {
|
|
69
|
+
"description": "Parameter name.",
|
|
70
|
+
"type": "string"
|
|
71
|
+
},
|
|
72
|
+
"options": {
|
|
73
|
+
"items": {
|
|
74
|
+
"additionalProperties": {
|
|
75
|
+
"type": "string"
|
|
76
|
+
},
|
|
77
|
+
"type": "object"
|
|
78
|
+
},
|
|
79
|
+
"type": "array"
|
|
80
|
+
},
|
|
81
|
+
"required": {
|
|
82
|
+
"description": "Defines if customer input for this field is mandatory.",
|
|
83
|
+
"type": "boolean"
|
|
84
|
+
},
|
|
85
|
+
"type": {
|
|
86
|
+
"description": "Field type.",
|
|
87
|
+
"enum": [
|
|
88
|
+
"text",
|
|
89
|
+
"number",
|
|
90
|
+
"boolean",
|
|
91
|
+
"select"
|
|
92
|
+
],
|
|
93
|
+
"type": "string"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"required": [
|
|
97
|
+
"default",
|
|
98
|
+
"description",
|
|
99
|
+
"label",
|
|
100
|
+
"name",
|
|
101
|
+
"required",
|
|
102
|
+
"type"
|
|
103
|
+
],
|
|
104
|
+
"type": "object"
|
|
105
|
+
},
|
|
106
|
+
"FileTypes": {
|
|
107
|
+
"enum": [
|
|
108
|
+
"url",
|
|
109
|
+
"graphql",
|
|
110
|
+
"arweave",
|
|
111
|
+
"ipfs",
|
|
112
|
+
"smartcontract"
|
|
113
|
+
],
|
|
114
|
+
"type": "string"
|
|
115
|
+
},
|
|
116
|
+
"MetadataConfig": {
|
|
117
|
+
"additionalProperties": false,
|
|
118
|
+
"properties": {
|
|
119
|
+
"additionalInformation": {
|
|
120
|
+
"description": "Stores additional information, this is customizable by publisher"
|
|
121
|
+
},
|
|
122
|
+
"algorithm": {
|
|
123
|
+
"additionalProperties": false,
|
|
124
|
+
"properties": {
|
|
125
|
+
"consumerParameters": {
|
|
126
|
+
"description": "Array of objects describing the consumer parameters",
|
|
127
|
+
"items": {
|
|
128
|
+
"$ref": "#/definitions/ConsumerParameter"
|
|
129
|
+
},
|
|
130
|
+
"type": "array"
|
|
131
|
+
},
|
|
132
|
+
"container": {
|
|
133
|
+
"additionalProperties": false,
|
|
134
|
+
"description": "Object describing the Docker container image.",
|
|
135
|
+
"properties": {
|
|
136
|
+
"checksum": {
|
|
137
|
+
"description": "Checksum of the Docker image.",
|
|
138
|
+
"type": "string"
|
|
139
|
+
},
|
|
140
|
+
"consumerParameters": {
|
|
141
|
+
"description": "Array of objects describing the consumer parameters",
|
|
142
|
+
"items": {
|
|
143
|
+
"$ref": "#/definitions/ConsumerParameter"
|
|
144
|
+
},
|
|
145
|
+
"type": "array"
|
|
146
|
+
},
|
|
147
|
+
"entrypoint": {
|
|
148
|
+
"description": "The command to execute, or script to run inside the Docker image.",
|
|
149
|
+
"type": "string"
|
|
150
|
+
},
|
|
151
|
+
"image": {
|
|
152
|
+
"description": "Name of the Docker image.",
|
|
153
|
+
"type": "string"
|
|
154
|
+
},
|
|
155
|
+
"tag": {
|
|
156
|
+
"description": "Tag of the Docker image.",
|
|
157
|
+
"type": "string"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"required": [
|
|
161
|
+
"entrypoint",
|
|
162
|
+
"image",
|
|
163
|
+
"tag",
|
|
164
|
+
"checksum"
|
|
165
|
+
],
|
|
166
|
+
"type": "object"
|
|
167
|
+
},
|
|
168
|
+
"language": {
|
|
169
|
+
"description": "Programming language used to implement the software.",
|
|
170
|
+
"type": "string"
|
|
171
|
+
},
|
|
172
|
+
"rawcode": {
|
|
173
|
+
"description": "Rawcode",
|
|
174
|
+
"type": "string"
|
|
175
|
+
},
|
|
176
|
+
"version": {
|
|
177
|
+
"description": "Version of the software preferably in SemVer notation.",
|
|
178
|
+
"type": "string"
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"required": [
|
|
182
|
+
"container"
|
|
183
|
+
],
|
|
184
|
+
"type": "object"
|
|
185
|
+
},
|
|
186
|
+
"author": {
|
|
187
|
+
"description": "Name of the entity generating this data (e.g. Tfl, Disney Corp, etc.).",
|
|
188
|
+
"type": "string"
|
|
189
|
+
},
|
|
190
|
+
"categories": {
|
|
191
|
+
"description": "Array of categories associated to the asset. Note: recommended to use tags instead of this.",
|
|
192
|
+
"items": {
|
|
193
|
+
"type": "string"
|
|
194
|
+
},
|
|
195
|
+
"type": "array"
|
|
196
|
+
},
|
|
197
|
+
"contentLanguage": {
|
|
198
|
+
"description": "The language of the content. Use one of the language codes from the IETF BCP 47 standard",
|
|
199
|
+
"type": "string"
|
|
200
|
+
},
|
|
201
|
+
"copyrightHolder": {
|
|
202
|
+
"description": "The party holding the legal copyright. Empty by default.",
|
|
203
|
+
"type": "string"
|
|
204
|
+
},
|
|
205
|
+
"description": {
|
|
206
|
+
"description": "Details of what the resource is.",
|
|
207
|
+
"type": "string"
|
|
208
|
+
},
|
|
209
|
+
"license": {
|
|
210
|
+
"description": "Short name referencing the license of the asset. If it’s not specified, the following value will be added: “No License Specified”.",
|
|
211
|
+
"type": "string"
|
|
212
|
+
},
|
|
213
|
+
"links": {
|
|
214
|
+
"description": "Mapping of URL strings for data samples, or links to find out more information. Links may be to either a URL or another asset.",
|
|
215
|
+
"items": {
|
|
216
|
+
"type": "string"
|
|
217
|
+
},
|
|
218
|
+
"type": "array"
|
|
219
|
+
},
|
|
220
|
+
"name": {
|
|
221
|
+
"description": "Descriptive name or title of the asset.",
|
|
222
|
+
"type": "string"
|
|
223
|
+
},
|
|
224
|
+
"tags": {
|
|
225
|
+
"description": "Array of keywords or tags used to describe this content. Empty by default.",
|
|
226
|
+
"items": {
|
|
227
|
+
"type": "string"
|
|
228
|
+
},
|
|
229
|
+
"type": "array"
|
|
230
|
+
},
|
|
231
|
+
"type": {
|
|
232
|
+
"description": "Asset type. Includes \"dataset\" (e.g. csv file), \"algorithm\" (e.g. Python script). Each type needs a different subset of metadata attributes.",
|
|
233
|
+
"enum": [
|
|
234
|
+
"dataset",
|
|
235
|
+
"algorithm"
|
|
236
|
+
],
|
|
237
|
+
"type": "string"
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"required": [
|
|
241
|
+
"author",
|
|
242
|
+
"description",
|
|
243
|
+
"license",
|
|
244
|
+
"name",
|
|
245
|
+
"type"
|
|
246
|
+
],
|
|
247
|
+
"type": "object"
|
|
248
|
+
},
|
|
249
|
+
"NftCreateDataWithoutOwner": {
|
|
250
|
+
"additionalProperties": false,
|
|
251
|
+
"properties": {
|
|
252
|
+
"name": {
|
|
253
|
+
"type": "string"
|
|
254
|
+
},
|
|
255
|
+
"symbol": {
|
|
256
|
+
"type": "string"
|
|
257
|
+
},
|
|
258
|
+
"templateIndex": {
|
|
259
|
+
"type": "number"
|
|
260
|
+
},
|
|
261
|
+
"tokenURI": {
|
|
262
|
+
"type": "string"
|
|
263
|
+
},
|
|
264
|
+
"transferable": {
|
|
265
|
+
"type": "boolean"
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"required": [
|
|
269
|
+
"name",
|
|
270
|
+
"symbol",
|
|
271
|
+
"templateIndex",
|
|
272
|
+
"tokenURI",
|
|
273
|
+
"transferable"
|
|
274
|
+
],
|
|
275
|
+
"type": "object"
|
|
276
|
+
},
|
|
277
|
+
"PublishConfig": {
|
|
278
|
+
"additionalProperties": false,
|
|
279
|
+
"properties": {
|
|
280
|
+
"allowAlgorithmNetworkAccess": {
|
|
281
|
+
"type": "boolean"
|
|
282
|
+
},
|
|
283
|
+
"credentials": {
|
|
284
|
+
"additionalProperties": false,
|
|
285
|
+
"properties": {
|
|
286
|
+
"allow": {
|
|
287
|
+
"items": {
|
|
288
|
+
"type": "string"
|
|
289
|
+
},
|
|
290
|
+
"type": "array"
|
|
291
|
+
},
|
|
292
|
+
"deny": {
|
|
293
|
+
"items": {
|
|
294
|
+
"type": "string"
|
|
295
|
+
},
|
|
296
|
+
"type": "array"
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
"type": "object"
|
|
300
|
+
},
|
|
301
|
+
"metadata": {
|
|
302
|
+
"$ref": "#/definitions/MetadataConfig"
|
|
303
|
+
},
|
|
304
|
+
"nftData": {
|
|
305
|
+
"$ref": "#/definitions/NftCreateDataWithoutOwner"
|
|
306
|
+
},
|
|
307
|
+
"service": {
|
|
308
|
+
"additionalProperties": false,
|
|
309
|
+
"properties": {
|
|
310
|
+
"consumerParameters": {
|
|
311
|
+
"items": {
|
|
312
|
+
"$ref": "#/definitions/ExtendedConsumerParameter"
|
|
313
|
+
},
|
|
314
|
+
"type": "array"
|
|
315
|
+
},
|
|
316
|
+
"datatoken": {
|
|
317
|
+
"additionalProperties": false,
|
|
318
|
+
"properties": {
|
|
319
|
+
"name": {
|
|
320
|
+
"type": "string"
|
|
321
|
+
},
|
|
322
|
+
"symbol": {
|
|
323
|
+
"type": "string"
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
"required": [
|
|
327
|
+
"name",
|
|
328
|
+
"symbol"
|
|
329
|
+
],
|
|
330
|
+
"type": "object"
|
|
331
|
+
},
|
|
332
|
+
"fileType": {
|
|
333
|
+
"$ref": "#/definitions/FileTypes"
|
|
334
|
+
},
|
|
335
|
+
"files": {
|
|
336
|
+
"items": {
|
|
337
|
+
"$ref": "#/definitions/ServiceFileType"
|
|
338
|
+
},
|
|
339
|
+
"type": "array"
|
|
340
|
+
},
|
|
341
|
+
"pricing": {
|
|
342
|
+
"additionalProperties": false,
|
|
343
|
+
"properties": {
|
|
344
|
+
"amount": {
|
|
345
|
+
"type": "number"
|
|
346
|
+
},
|
|
347
|
+
"currency": {
|
|
348
|
+
"enum": [
|
|
349
|
+
"OCEAN",
|
|
350
|
+
"EUROe"
|
|
351
|
+
],
|
|
352
|
+
"type": "string"
|
|
353
|
+
},
|
|
354
|
+
"type": {
|
|
355
|
+
"enum": [
|
|
356
|
+
"free",
|
|
357
|
+
"fixed"
|
|
358
|
+
],
|
|
359
|
+
"type": "string"
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
"required": [
|
|
363
|
+
"type"
|
|
364
|
+
],
|
|
365
|
+
"type": "object"
|
|
366
|
+
},
|
|
367
|
+
"serviceEndpoint": {
|
|
368
|
+
"type": "string"
|
|
369
|
+
},
|
|
370
|
+
"serviceType": {
|
|
371
|
+
"$ref": "#/definitions/ServiceTypes"
|
|
372
|
+
},
|
|
373
|
+
"timeout": {
|
|
374
|
+
"type": "number"
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
"required": [
|
|
378
|
+
"serviceType",
|
|
379
|
+
"fileType",
|
|
380
|
+
"serviceEndpoint",
|
|
381
|
+
"timeout",
|
|
382
|
+
"files",
|
|
383
|
+
"pricing",
|
|
384
|
+
"datatoken"
|
|
385
|
+
],
|
|
386
|
+
"type": "object"
|
|
387
|
+
},
|
|
388
|
+
"trustOwnerAlgorithms": {
|
|
389
|
+
"type": "boolean"
|
|
390
|
+
},
|
|
391
|
+
"trustedAlgorithmPublishers": {
|
|
392
|
+
"items": {
|
|
393
|
+
"type": "string"
|
|
394
|
+
},
|
|
395
|
+
"type": "array"
|
|
396
|
+
},
|
|
397
|
+
"trustedAlgorithms": {
|
|
398
|
+
"items": {
|
|
399
|
+
"$ref": "#/definitions/TrustedAlgorithmAsset"
|
|
400
|
+
},
|
|
401
|
+
"type": "array"
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
"required": [
|
|
405
|
+
"metadata",
|
|
406
|
+
"nftData",
|
|
407
|
+
"service"
|
|
408
|
+
],
|
|
409
|
+
"type": "object"
|
|
410
|
+
},
|
|
411
|
+
"ServiceFileType": {
|
|
412
|
+
"$ref": "#/definitions/UrlFile"
|
|
413
|
+
},
|
|
414
|
+
"ServiceTypes": {
|
|
415
|
+
"enum": [
|
|
416
|
+
"access",
|
|
417
|
+
"compute"
|
|
418
|
+
],
|
|
419
|
+
"type": "string"
|
|
420
|
+
},
|
|
421
|
+
"TrustedAlgorithmAsset": {
|
|
422
|
+
"additionalProperties": false,
|
|
423
|
+
"properties": {
|
|
424
|
+
"did": {
|
|
425
|
+
"type": "string"
|
|
426
|
+
},
|
|
427
|
+
"serviceIds": {
|
|
428
|
+
"items": {
|
|
429
|
+
"type": "string"
|
|
430
|
+
},
|
|
431
|
+
"type": "array"
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
"required": [
|
|
435
|
+
"did"
|
|
436
|
+
],
|
|
437
|
+
"type": "object"
|
|
438
|
+
},
|
|
439
|
+
"UrlFile": {
|
|
440
|
+
"additionalProperties": false,
|
|
441
|
+
"properties": {
|
|
442
|
+
"headers": {
|
|
443
|
+
"additionalProperties": {
|
|
444
|
+
"type": "string"
|
|
445
|
+
},
|
|
446
|
+
"description": "Headers key value pairs associated with the asset GET request",
|
|
447
|
+
"type": "object"
|
|
448
|
+
},
|
|
449
|
+
"index": {
|
|
450
|
+
"description": "File index.",
|
|
451
|
+
"type": "number"
|
|
452
|
+
},
|
|
453
|
+
"method": {
|
|
454
|
+
"description": "HTTP method used",
|
|
455
|
+
"type": "string"
|
|
456
|
+
},
|
|
457
|
+
"type": {
|
|
458
|
+
"const": "url",
|
|
459
|
+
"type": "string"
|
|
460
|
+
},
|
|
461
|
+
"url": {
|
|
462
|
+
"description": "File URL.",
|
|
463
|
+
"type": "string"
|
|
464
|
+
}
|
|
465
|
+
},
|
|
466
|
+
"required": [
|
|
467
|
+
"type",
|
|
468
|
+
"url",
|
|
469
|
+
"method"
|
|
470
|
+
],
|
|
471
|
+
"type": "object"
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Nautilus } from '@deltadao/nautilus';
|
|
2
|
+
import { Wallet } from 'ethers';
|
|
3
|
+
import { FixedRatePricingConfigGenerator, NetworkConfig } from '../config';
|
|
4
|
+
export declare class Connection {
|
|
5
|
+
wallet: Wallet;
|
|
6
|
+
nautilus: Nautilus;
|
|
7
|
+
networkConfig: NetworkConfig;
|
|
8
|
+
pricingConfig: {
|
|
9
|
+
[p: string]: FixedRatePricingConfigGenerator;
|
|
10
|
+
};
|
|
11
|
+
private constructor();
|
|
12
|
+
static connect(envOverrides?: Record<string, string>): Promise<Connection>;
|
|
13
|
+
}
|
package/dist/utils/connection.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.Connection = void 0;
|
|
7
|
-
const dotenv_1 = __importDefault(require("dotenv"));
|
|
8
|
-
dotenv_1.default.config();
|
|
9
|
-
const config_1 = require("../config");
|
|
10
|
-
const ethers_1 = require("ethers");
|
|
11
4
|
const nautilus_1 = require("@deltadao/nautilus");
|
|
5
|
+
const ethers_1 = require("ethers");
|
|
6
|
+
const config_1 = require("../config");
|
|
12
7
|
class Connection {
|
|
13
8
|
constructor(wallet, nautilus, networkConfig, pricingConfig) {
|
|
14
9
|
this.wallet = wallet;
|
|
@@ -16,27 +11,24 @@ class Connection {
|
|
|
16
11
|
this.networkConfig = networkConfig;
|
|
17
12
|
this.pricingConfig = pricingConfig;
|
|
18
13
|
}
|
|
19
|
-
static async connect() {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
process.exit(1);
|
|
14
|
+
static async connect(envOverrides) {
|
|
15
|
+
const env = Object.assign(Object.assign({}, process.env), envOverrides);
|
|
16
|
+
if (!env.NETWORK) {
|
|
17
|
+
throw new Error(`Set your network in the .env file. Supported networks are ${Object.values(config_1.Network).join(', ')}.`);
|
|
24
18
|
}
|
|
25
|
-
const selectedEnvNetwork =
|
|
19
|
+
const selectedEnvNetwork = env.NETWORK.toUpperCase();
|
|
26
20
|
if (!(selectedEnvNetwork in config_1.Network)) {
|
|
27
|
-
|
|
28
|
-
process.exit(1);
|
|
21
|
+
throw new Error(`Invalid network selection: ${selectedEnvNetwork}. Supported networks are ${Object.values(config_1.Network).join(', ')}.`);
|
|
29
22
|
}
|
|
30
23
|
console.log(`Your selected network is ${config_1.Network[selectedEnvNetwork]}`);
|
|
31
24
|
const networkConfig = config_1.NETWORK_CONFIGS[selectedEnvNetwork];
|
|
32
25
|
const pricingConfig = config_1.PRICING_CONFIGS[selectedEnvNetwork];
|
|
33
|
-
if (!
|
|
34
|
-
|
|
26
|
+
if (!env.PRIVATE_KEY) {
|
|
27
|
+
throw new Error(`Login to retrieve your private key using "pontusx-cli login keyFile.json"` +
|
|
35
28
|
` and do not forget to logout when finished.`);
|
|
36
|
-
process.exit(1);
|
|
37
29
|
}
|
|
38
30
|
const provider = new ethers_1.providers.JsonRpcProvider(networkConfig.nodeUri);
|
|
39
|
-
const wallet = new ethers_1.Wallet(
|
|
31
|
+
const wallet = new ethers_1.Wallet(env.PRIVATE_KEY, provider);
|
|
40
32
|
const nautilus = await nautilus_1.Nautilus.create(wallet, networkConfig);
|
|
41
33
|
console.log(`Connected as ${wallet.address}`);
|
|
42
34
|
return new Connection(wallet, nautilus, networkConfig, pricingConfig);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/utils/connection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/utils/connection.ts"],"names":[],"mappings":";;;AAAA,iDAA2C;AAC3C,mCAAwC;AAExC,sCAAmH;AAEnH,MAAa,UAAU;IACrB,YACS,MAAc,EACd,QAAkB,EAClB,aAA4B,EAC5B,aAA6D;QAH7D,WAAM,GAAN,MAAM,CAAQ;QACd,aAAQ,GAAR,QAAQ,CAAU;QAClB,kBAAa,GAAb,aAAa,CAAe;QAC5B,kBAAa,GAAb,aAAa,CAAgD;IACnE,CAAC;IAEG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,YAAqC;QAC/D,MAAM,GAAG,mCAAO,OAAO,CAAC,GAAG,GAAK,YAAY,CAAC,CAAA;QAE7C,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,6DAA6D,MAAM,CAAC,MAAM,CAAC,gBAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACpH,CAAC;QAED,MAAM,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAA;QACpD,IAAI,CAAC,CAAC,kBAAkB,IAAI,gBAAO,CAAC,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CACb,8BAA8B,kBAAkB,4BAA4B,MAAM,CAAC,MAAM,CAAC,gBAAO,CAAC,CAAC,IAAI,CACrG,IAAI,CACL,GAAG,CACL,CAAA;QACH,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,4BAA4B,gBAAO,CAAC,kBAA6B,CAAC,EAAE,CAAC,CAAA;QACjF,MAAM,aAAa,GAAG,wBAAe,CAAC,kBAA6B,CAAC,CAAA;QACpE,MAAM,aAAa,GAAG,wBAAe,CAAC,kBAA6B,CAAC,CAAA;QACpE,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CACb,2EAA2E;gBACzE,6CAA6C,CAChD,CAAA;QACH,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,kBAAS,CAAC,eAAe,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;QACrE,MAAM,MAAM,GAAG,IAAI,eAAM,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAA;QACpD,MAAM,QAAQ,GAAG,MAAM,mBAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;QAC7D,OAAO,CAAC,GAAG,CAAC,gBAAgB,MAAM,CAAC,OAAO,EAAE,CAAC,CAAA;QAC7C,OAAO,IAAI,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,CAAC,CAAA;IACvE,CAAC;CACF;AAxCD,gCAwCC"}
|