kira-wallet 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.
Files changed (58) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +116 -0
  3. package/THIRD_PARTY_NOTICES.md +13 -0
  4. package/bin/kira.cjs +8 -0
  5. package/curve_pricing.py +86 -0
  6. package/docs/AGENT_TOOLS.md +53 -0
  7. package/docs/CLI.md +144 -0
  8. package/docs/JOB_CONTRACT.md +111 -0
  9. package/docs/KIRA_JOBS_BUILD_REPORT.md +92 -0
  10. package/docs/KIRA_REDESIGN_REPORT.md +125 -0
  11. package/docs/ONBOARDING_CHAT_CONTRACT.md +36 -0
  12. package/docs/RELEASE.md +45 -0
  13. package/docs/WALLET_CAPABILITIES.md +98 -0
  14. package/docs/character/brand-generation.json +20 -0
  15. package/docs/character/workspace-generation.json +29 -0
  16. package/docs/screenshots/kira-jobs-desktop.jpg +0 -0
  17. package/kira_agent.py +280 -0
  18. package/kira_cli.py +263 -0
  19. package/kira_config.py +98 -0
  20. package/kira_jobs.py +504 -0
  21. package/kira_tools.py +104 -0
  22. package/networks.json +214 -0
  23. package/onchain.cjs +34 -0
  24. package/package.json +78 -0
  25. package/pipeline-onchain.cjs +284 -0
  26. package/research.py +39 -0
  27. package/sources/job-envelope-v1.schema.json +469 -0
  28. package/sources/job-request-v1.schema.json +352 -0
  29. package/sources/mintclub-bond-abi.json +1457 -0
  30. package/sources/rpc-candidates.json +294 -0
  31. package/sources/uniswap-deployments.json +18261 -0
  32. package/viewer/README.md +119 -0
  33. package/viewer/chain_images.py +21 -0
  34. package/viewer/details.py +119 -0
  35. package/viewer/model.py +216 -0
  36. package/viewer/refresh-curve-prices.cjs +35 -0
  37. package/viewer/refresh_prices.py +97 -0
  38. package/viewer/server.py +153 -0
  39. package/viewer/static/agent.css +100 -0
  40. package/viewer/static/agent.js +203 -0
  41. package/viewer/static/app.js +252 -0
  42. package/viewer/static/favicon.svg +1 -0
  43. package/viewer/static/index.html +139 -0
  44. package/viewer/static/jobs.js +113 -0
  45. package/viewer/static/kira-attention.png +0 -0
  46. package/viewer/static/kira-explain.png +0 -0
  47. package/viewer/static/kira-logo.png +0 -0
  48. package/viewer/static/kira-research.png +0 -0
  49. package/viewer/static/kira-review.png +0 -0
  50. package/viewer/static/kira.png +0 -0
  51. package/viewer/static/style.css +51 -0
  52. package/viewer/static/watching-model.js +129 -0
  53. package/viewer/static/watching.js +167 -0
  54. package/viewer/static/workspace-model.js +43 -0
  55. package/viewer/static/workspace.css +463 -0
  56. package/viewer/static/workspace.js +102 -0
  57. package/viewer/token_images.py +137 -0
  58. package/wallet.py +389 -0
@@ -0,0 +1,469 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:kira:job-envelope:1",
4
+ "title": "Kira persisted job envelope v1",
5
+ "type": "object",
6
+ "required": [
7
+ "attempt",
8
+ "cancel_requested",
9
+ "chains",
10
+ "checkpoint",
11
+ "created_at",
12
+ "errors",
13
+ "events",
14
+ "input",
15
+ "job_id",
16
+ "key_hash",
17
+ "operation",
18
+ "previous_result",
19
+ "request_hash",
20
+ "result",
21
+ "schema_version",
22
+ "sequence",
23
+ "stage",
24
+ "state",
25
+ "updated_at"
26
+ ],
27
+ "properties": {
28
+ "updated_at": {
29
+ "type": "string",
30
+ "format": "date-time"
31
+ },
32
+ "raw_hash": {
33
+ "type": "string",
34
+ "pattern": "^[0-9a-f]{64}$"
35
+ },
36
+ "previous_result": {
37
+ "type": [
38
+ "object",
39
+ "null"
40
+ ]
41
+ },
42
+ "attempt": {
43
+ "type": "integer",
44
+ "minimum": 0
45
+ },
46
+ "stage": {
47
+ "type": "string",
48
+ "minLength": 1
49
+ },
50
+ "operation": {
51
+ "enum": [
52
+ "wallet.add",
53
+ "wallet.refresh",
54
+ "prices.refresh",
55
+ "wallet.setTags",
56
+ "settings.rpc",
57
+ "settings.discovery"
58
+ ]
59
+ },
60
+ "result": {
61
+ "type": [
62
+ "object",
63
+ "null"
64
+ ]
65
+ },
66
+ "key_hash": {
67
+ "type": "string",
68
+ "pattern": "^[0-9a-f]{64}$"
69
+ },
70
+ "control_raw": {
71
+ "type": "object",
72
+ "propertyNames": {
73
+ "pattern": "^[0-9a-f]{64}$"
74
+ },
75
+ "additionalProperties": {
76
+ "type": "string",
77
+ "pattern": "^[0-9a-f]{64}$"
78
+ }
79
+ },
80
+ "errors": {
81
+ "type": "array",
82
+ "items": {
83
+ "type": "object",
84
+ "required": [
85
+ "code",
86
+ "message"
87
+ ],
88
+ "properties": {
89
+ "code": {
90
+ "type": "string"
91
+ },
92
+ "message": {
93
+ "type": "string"
94
+ }
95
+ },
96
+ "additionalProperties": false
97
+ }
98
+ },
99
+ "state": {
100
+ "enum": [
101
+ "queued",
102
+ "running",
103
+ "interrupted",
104
+ "succeeded",
105
+ "partial",
106
+ "failed",
107
+ "cancelled"
108
+ ]
109
+ },
110
+ "control_receipts": {
111
+ "type": "object",
112
+ "propertyNames": {
113
+ "pattern": "^[0-9a-f]{64}$"
114
+ },
115
+ "additionalProperties": {
116
+ "type": "string",
117
+ "pattern": "^[0-9a-f]{64}$"
118
+ }
119
+ },
120
+ "schema_version": {
121
+ "const": 1
122
+ },
123
+ "job_id": {
124
+ "type": "string",
125
+ "format": "uuid"
126
+ },
127
+ "created_at": {
128
+ "type": "string",
129
+ "format": "date-time"
130
+ },
131
+ "cancel_requested": {
132
+ "type": "boolean"
133
+ },
134
+ "sequence": {
135
+ "type": "integer",
136
+ "minimum": 0
137
+ },
138
+ "events": {
139
+ "type": "array",
140
+ "items": {
141
+ "type": "object",
142
+ "required": [
143
+ "stage",
144
+ "observed_at",
145
+ "counts"
146
+ ],
147
+ "properties": {
148
+ "stage": {
149
+ "type": "string"
150
+ },
151
+ "observed_at": {
152
+ "type": "string",
153
+ "format": "date-time"
154
+ },
155
+ "counts": {
156
+ "type": "object",
157
+ "additionalProperties": {
158
+ "type": "integer",
159
+ "minimum": 0
160
+ }
161
+ },
162
+ "context": {
163
+ "type": "object"
164
+ }
165
+ },
166
+ "additionalProperties": false
167
+ }
168
+ },
169
+ "chains": {
170
+ "type": "object",
171
+ "propertyNames": {
172
+ "pattern": "^[0-9]+$"
173
+ },
174
+ "additionalProperties": {
175
+ "type": "object",
176
+ "required": [
177
+ "block_number",
178
+ "endpoint_index",
179
+ "status"
180
+ ],
181
+ "properties": {
182
+ "block_number": {
183
+ "type": [
184
+ "string",
185
+ "null"
186
+ ],
187
+ "pattern": "^[0-9]+$"
188
+ },
189
+ "endpoint_index": {
190
+ "type": [
191
+ "integer",
192
+ "null"
193
+ ],
194
+ "minimum": 0
195
+ },
196
+ "status": {
197
+ "enum": [
198
+ "complete",
199
+ "partial",
200
+ "unavailable",
201
+ "unknown"
202
+ ]
203
+ }
204
+ },
205
+ "additionalProperties": false
206
+ }
207
+ },
208
+ "request_hash": {
209
+ "type": "string",
210
+ "pattern": "^[0-9a-f]{64}$"
211
+ },
212
+ "input": {
213
+ "type": "object"
214
+ },
215
+ "checkpoint": {
216
+ "type": "string",
217
+ "pattern": "^snapshots/jobs/[0-9a-f-]{36}$"
218
+ },
219
+ "provider_configuration": {
220
+ "type": "object",
221
+ "required": [
222
+ "rpc_mode",
223
+ "discovery_provider",
224
+ "public_fallback",
225
+ "endpoint_refs"
226
+ ],
227
+ "properties": {
228
+ "rpc_mode": {
229
+ "enum": [
230
+ "public",
231
+ "custom"
232
+ ]
233
+ },
234
+ "discovery_provider": {
235
+ "enum": [
236
+ "none",
237
+ "alchemy"
238
+ ]
239
+ },
240
+ "public_fallback": {
241
+ "type": "boolean"
242
+ },
243
+ "endpoint_refs": {
244
+ "type": "object",
245
+ "additionalProperties": {
246
+ "type": "string",
247
+ "pattern": "^[A-Z_][A-Z0-9_]{0,99}$"
248
+ }
249
+ }
250
+ },
251
+ "additionalProperties": false
252
+ },
253
+ "started_at": {
254
+ "type": "string",
255
+ "format": "date-time"
256
+ }
257
+ },
258
+ "additionalProperties": false,
259
+ "allOf": [
260
+ {
261
+ "if": {
262
+ "properties": {
263
+ "operation": {
264
+ "const": "wallet.add"
265
+ }
266
+ }
267
+ },
268
+ "then": {
269
+ "properties": {
270
+ "input": {
271
+ "type": "object",
272
+ "properties": {
273
+ "address": {
274
+ "type": "string",
275
+ "pattern": "^0x[0-9a-fA-F]{40}$"
276
+ },
277
+ "tag": {
278
+ "type": "string",
279
+ "minLength": 1,
280
+ "maxLength": 200
281
+ }
282
+ },
283
+ "required": [
284
+ "address",
285
+ "tag"
286
+ ],
287
+ "additionalProperties": false
288
+ }
289
+ }
290
+ }
291
+ },
292
+ {
293
+ "if": {
294
+ "properties": {
295
+ "operation": {
296
+ "const": "wallet.refresh"
297
+ }
298
+ }
299
+ },
300
+ "then": {
301
+ "properties": {
302
+ "input": {
303
+ "type": "object",
304
+ "properties": {
305
+ "wallet": {
306
+ "type": "string",
307
+ "pattern": "^0x[0-9a-fA-F]{40}$"
308
+ }
309
+ },
310
+ "required": [
311
+ "wallet"
312
+ ],
313
+ "additionalProperties": false
314
+ }
315
+ }
316
+ }
317
+ },
318
+ {
319
+ "if": {
320
+ "properties": {
321
+ "operation": {
322
+ "const": "prices.refresh"
323
+ }
324
+ }
325
+ },
326
+ "then": {
327
+ "properties": {
328
+ "input": {
329
+ "type": "object",
330
+ "properties": {
331
+ "wallet": {
332
+ "type": "string",
333
+ "pattern": "^0x[0-9a-fA-F]{40}$"
334
+ }
335
+ },
336
+ "required": [
337
+ "wallet"
338
+ ],
339
+ "additionalProperties": false
340
+ }
341
+ }
342
+ }
343
+ },
344
+ {
345
+ "if": {
346
+ "properties": {
347
+ "operation": {
348
+ "const": "wallet.setTags"
349
+ }
350
+ }
351
+ },
352
+ "then": {
353
+ "properties": {
354
+ "input": {
355
+ "type": "object",
356
+ "properties": {
357
+ "wallet": {
358
+ "type": "string",
359
+ "pattern": "^0x[0-9a-fA-F]{40}$"
360
+ },
361
+ "tags": {
362
+ "type": "array",
363
+ "items": {
364
+ "type": "string",
365
+ "minLength": 1,
366
+ "maxLength": 200
367
+ },
368
+ "minItems": 1,
369
+ "maxItems": 20,
370
+ "uniqueItems": true
371
+ }
372
+ },
373
+ "required": [
374
+ "wallet",
375
+ "tags"
376
+ ],
377
+ "additionalProperties": false
378
+ }
379
+ }
380
+ }
381
+ },
382
+ {
383
+ "if": {
384
+ "properties": {
385
+ "operation": {
386
+ "const": "settings.rpc"
387
+ }
388
+ }
389
+ },
390
+ "then": {
391
+ "properties": {
392
+ "input": {
393
+ "type": "object",
394
+ "properties": {
395
+ "mode": {
396
+ "enum": [
397
+ "public",
398
+ "custom"
399
+ ]
400
+ },
401
+ "chains": {
402
+ "type": "object",
403
+ "maxProperties": 30,
404
+ "propertyNames": {
405
+ "pattern": "^[0-9]+$"
406
+ },
407
+ "additionalProperties": {
408
+ "type": "object",
409
+ "required": [
410
+ "url_env"
411
+ ],
412
+ "properties": {
413
+ "url_env": {
414
+ "type": "string",
415
+ "pattern": "^[A-Z_][A-Z0-9_]{0,99}$"
416
+ }
417
+ },
418
+ "additionalProperties": false
419
+ }
420
+ },
421
+ "allow_public_fallback": {
422
+ "type": "boolean"
423
+ }
424
+ },
425
+ "required": [
426
+ "mode",
427
+ "chains",
428
+ "allow_public_fallback"
429
+ ],
430
+ "additionalProperties": false
431
+ }
432
+ }
433
+ }
434
+ },
435
+ {
436
+ "if": {
437
+ "properties": {
438
+ "operation": {
439
+ "const": "settings.discovery"
440
+ }
441
+ }
442
+ },
443
+ "then": {
444
+ "properties": {
445
+ "input": {
446
+ "type": "object",
447
+ "properties": {
448
+ "provider": {
449
+ "enum": [
450
+ "none",
451
+ "alchemy"
452
+ ]
453
+ },
454
+ "key_env": {
455
+ "type": "string",
456
+ "pattern": "^[A-Z_][A-Z0-9_]{0,99}$"
457
+ }
458
+ },
459
+ "required": [
460
+ "provider",
461
+ "key_env"
462
+ ],
463
+ "additionalProperties": false
464
+ }
465
+ }
466
+ }
467
+ }
468
+ ]
469
+ }