@odatano/core 2.0.0-rc.5 → 2.0.0-rc.51
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/@cds-models/CardanoAgentService/index.d.ts +99 -51
- package/@cds-models/CardanoAgentService/index.js +15 -0
- package/@cds-models/CardanoBackendService/index.d.ts +358 -0
- package/@cds-models/CardanoBackendService/index.js +41 -0
- package/@cds-models/CardanoIndexerService/index.d.ts +594 -11
- package/@cds-models/CardanoIndexerService/index.js +74 -0
- package/@cds-models/CardanoODataService/index.d.ts +417 -57
- package/@cds-models/CardanoODataService/index.js +42 -0
- package/@cds-models/CardanoSignService/index.d.ts +45 -19
- package/@cds-models/CardanoSignService/index.js +4 -0
- package/@cds-models/CardanoTransactionService/index.d.ts +70 -44
- package/@cds-models/CardanoTransactionService/index.js +5 -0
- package/@cds-models/CardanoWorkerService/index.d.ts +35 -22
- package/@cds-models/CardanoWorkerService/index.js +2 -0
- package/@cds-models/index.d.ts +114 -4
- package/@cds-models/index.js +20 -4
- package/@cds-models/odatano/cardano/index.d.ts +451 -32
- package/@cds-models/odatano/cardano/index.js +48 -0
- package/README.md +103 -167
- package/db/schema.cds +2455 -1705
- package/db/types.cds +456 -295
- package/package.json +41 -53
- package/scripts/deploy-schema.mjs +113 -0
- package/scripts/migrate-schema.mjs +528 -0
- package/scripts/migrate-slot-leader.mjs +96 -0
- package/src/index.d.ts +20 -21
- package/src/index.js +45 -31
- package/src/plugin.js +17 -35
- package/srv/blockchain/asset-decimals.d.ts +7 -0
- package/srv/blockchain/asset-decimals.js +91 -0
- package/srv/blockchain/backends/blockfrost-backend.d.ts +25 -137
- package/srv/blockchain/backends/blockfrost-backend.js +125 -215
- package/srv/blockchain/backends/call-signal.d.ts +7 -0
- package/srv/blockchain/backends/call-signal.js +22 -0
- package/srv/blockchain/backends/cardano-backend.d.ts +100 -189
- package/srv/blockchain/backends/cardano-backend.js +29 -5
- package/srv/blockchain/backends/koios-backend.d.ts +108 -170
- package/srv/blockchain/backends/koios-backend.js +488 -482
- package/srv/blockchain/backends/odatano-backend.d.ts +55 -0
- package/srv/blockchain/backends/odatano-backend.js +211 -0
- package/srv/blockchain/backends/ogmios-backend.d.ts +122 -190
- package/srv/blockchain/backends/ogmios-backend.js +683 -327
- package/srv/blockchain/backends/ogmios-frame-guard.d.ts +14 -0
- package/srv/blockchain/backends/ogmios-frame-guard.js +89 -0
- package/srv/blockchain/cardano-client.d.ts +71 -241
- package/srv/blockchain/cardano-client.js +354 -322
- package/srv/blockchain/cardano-indexer.d.ts +295 -283
- package/srv/blockchain/cardano-indexer.js +1690 -502
- package/srv/blockchain/cardano-tx-builder.d.ts +25 -89
- package/srv/blockchain/cardano-tx-builder.js +164 -140
- package/srv/blockchain/circuit-breaker.d.ts +2 -13
- package/srv/blockchain/circuit-breaker.js +11 -15
- package/srv/blockchain/crawler/account-snapshots.d.ts +29 -0
- package/srv/blockchain/crawler/account-snapshots.js +173 -0
- package/srv/blockchain/crawler/asset-decimals-backfill.d.ts +17 -0
- package/srv/blockchain/crawler/asset-decimals-backfill.js +56 -0
- package/srv/blockchain/crawler/asset-registry-backfill.d.ts +46 -0
- package/srv/blockchain/crawler/asset-registry-backfill.js +157 -0
- package/srv/blockchain/crawler/asset-slice-backfill.d.ts +35 -0
- package/srv/blockchain/crawler/asset-slice-backfill.js +149 -0
- package/srv/blockchain/crawler/certificate-backfill.d.ts +56 -0
- package/srv/blockchain/crawler/certificate-backfill.js +174 -0
- package/srv/blockchain/crawler/crawler.d.ts +125 -81
- package/srv/blockchain/crawler/crawler.js +738 -167
- package/srv/blockchain/crawler/credential-backfill.d.ts +30 -0
- package/srv/blockchain/crawler/credential-backfill.js +101 -0
- package/srv/blockchain/crawler/hooks.d.ts +2 -17
- package/srv/blockchain/crawler/index.d.ts +1 -8
- package/srv/blockchain/crawler/index.js +31 -17
- package/srv/blockchain/crawler/input-asset-copies.d.ts +34 -0
- package/srv/blockchain/crawler/input-asset-copies.js +161 -0
- package/srv/blockchain/crawler/key-pages.d.ts +12 -0
- package/srv/blockchain/crawler/key-pages.js +48 -0
- package/srv/blockchain/crawler/metadata-position-backfill.d.ts +22 -0
- package/srv/blockchain/crawler/metadata-position-backfill.js +59 -0
- package/srv/blockchain/crawler/output-datum-backfill.d.ts +41 -0
- package/srv/blockchain/crawler/output-datum-backfill.js +100 -0
- package/srv/blockchain/crawler/sync-state.d.ts +31 -47
- package/srv/blockchain/crawler/sync-state.js +135 -128
- package/srv/blockchain/crawler/transaction-backfill.d.ts +46 -0
- package/srv/blockchain/crawler/transaction-backfill.js +271 -0
- package/srv/blockchain/crawler/utxo-set-import.d.ts +66 -0
- package/srv/blockchain/crawler/utxo-set-import.js +399 -0
- package/srv/blockchain/crawler/window-plan.d.ts +31 -0
- package/srv/blockchain/crawler/window-plan.js +59 -0
- package/srv/blockchain/ledger-state.d.ts +62 -0
- package/srv/blockchain/ledger-state.js +521 -0
- package/srv/blockchain/pending-spends.d.ts +16 -0
- package/srv/blockchain/pending-spends.js +81 -0
- package/srv/blockchain/pool-metadata.d.ts +15 -0
- package/srv/blockchain/pool-metadata.js +132 -0
- package/srv/blockchain/request-coalescer.d.ts +2 -16
- package/srv/blockchain/request-coalescer.js +2 -16
- package/srv/blockchain/signing/cose-verifier.d.ts +3 -17
- package/srv/blockchain/signing/cose-verifier.js +146 -70
- package/srv/blockchain/signing/external-signer.d.ts +15 -115
- package/srv/blockchain/signing/external-signer.js +22 -131
- package/srv/blockchain/signing/failed-recheck.d.ts +17 -0
- package/srv/blockchain/signing/failed-recheck.js +135 -0
- package/srv/blockchain/signing/hsm-signer.d.ts +10 -54
- package/srv/blockchain/signing/hsm-signer.js +28 -79
- package/srv/blockchain/signing/landing-proof.d.ts +60 -0
- package/srv/blockchain/signing/landing-proof.js +224 -0
- package/srv/blockchain/signing/signature-verifier.d.ts +9 -47
- package/srv/blockchain/signing/signature-verifier.js +71 -87
- package/srv/blockchain/signing/submission-finalizer.d.ts +37 -45
- package/srv/blockchain/signing/submission-finalizer.js +280 -86
- package/srv/blockchain/stored-chain.d.ts +19 -0
- package/srv/blockchain/stored-chain.js +258 -0
- package/srv/blockchain/transaction-building/buildooor-tx.d.ts +31 -229
- package/srv/blockchain/transaction-building/buildooor-tx.js +663 -421
- package/srv/blockchain/transaction-building/cardano-tx.d.ts +9 -37
- package/srv/blockchain/transaction-presence.d.ts +12 -0
- package/srv/blockchain/transaction-presence.js +29 -0
- package/srv/blockchain/transaction-rows.d.ts +12 -0
- package/srv/blockchain/transaction-rows.js +44 -0
- package/srv/blockchain/wallet-worker/build-request.d.ts +8 -23
- package/srv/blockchain/wallet-worker/build-request.js +40 -353
- package/srv/blockchain/wallet-worker/confirmation-tracker.d.ts +27 -47
- package/srv/blockchain/wallet-worker/confirmation-tracker.js +158 -61
- package/srv/blockchain/wallet-worker/index.d.ts +1 -1
- package/srv/blockchain/wallet-worker/index.js +3 -11
- package/srv/blockchain/wallet-worker/invalidation.d.ts +35 -0
- package/srv/blockchain/wallet-worker/invalidation.js +128 -0
- package/srv/blockchain/wallet-worker/job-store.d.ts +58 -150
- package/srv/blockchain/wallet-worker/job-store.js +200 -273
- package/srv/blockchain/wallet-worker/lease-heartbeat.d.ts +2 -26
- package/srv/blockchain/wallet-worker/lease-heartbeat.js +6 -28
- package/srv/blockchain/wallet-worker/signers.d.ts +5 -24
- package/srv/blockchain/wallet-worker/signers.js +4 -12
- package/srv/blockchain/wallet-worker/wallet-worker.d.ts +29 -82
- package/srv/blockchain/wallet-worker/wallet-worker.js +334 -198
- package/srv/cardano-agent-service.cds +122 -84
- package/srv/cardano-agent-service.js +12 -9
- package/srv/cardano-backend-service.cds +81 -0
- package/srv/cardano-backend-service.d.ts +2 -0
- package/srv/cardano-backend-service.js +259 -0
- package/srv/cardano-indexer-service.cds +393 -18
- package/srv/cardano-indexer-service.d.ts +5 -1
- package/srv/cardano-indexer-service.js +477 -16
- package/srv/cardano-service.cds +426 -269
- package/srv/cardano-service.js +640 -217
- package/srv/cardano-sign-service.cds +211 -180
- package/srv/cardano-sign-service.js +210 -287
- package/srv/cardano-tx-service.cds +462 -370
- package/srv/cardano-tx-service.js +283 -800
- package/srv/cardano-ui.cds +16 -16
- package/srv/cardano-worker-service.cds +141 -125
- package/srv/cardano-worker-service.js +104 -61
- package/srv/cbor/cip68.d.ts +13 -0
- package/srv/cbor/cip68.js +56 -0
- package/srv/cbor/index.d.ts +3 -1
- package/srv/cbor/index.js +9 -1
- package/srv/cbor/parse.d.ts +30 -18
- package/srv/cbor/parse.js +44 -9
- package/srv/cbor/plutus-data-json.d.ts +20 -0
- package/srv/cbor/plutus-data-json.js +32 -0
- package/srv/config.d.ts +117 -0
- package/srv/config.js +419 -0
- package/srv/server.d.ts +15 -110
- package/srv/server.js +83 -405
- package/srv/utils/agent-access.d.ts +11 -0
- package/srv/utils/agent-access.js +86 -0
- package/srv/utils/agent-grants-config.d.ts +0 -46
- package/srv/utils/agent-grants-config.js +17 -85
- package/srv/utils/agent-grants.d.ts +106 -122
- package/srv/utils/agent-grants.js +538 -237
- package/srv/utils/agent-token-auth.d.ts +4 -99
- package/srv/utils/agent-token-auth.js +62 -186
- package/srv/utils/backend-request-handler.d.ts +3 -17
- package/srv/utils/backend-request-handler.js +3 -18
- package/srv/utils/build-request.d.ts +52 -0
- package/srv/utils/build-request.js +487 -0
- package/srv/utils/collections.d.ts +4 -10
- package/srv/utils/collections.js +14 -10
- package/srv/utils/const.d.ts +32 -75
- package/srv/utils/const.js +40 -80
- package/srv/utils/crypto.d.ts +3 -12
- package/srv/utils/crypto.js +11 -25
- package/srv/utils/db-indexes.d.ts +31 -0
- package/srv/utils/db-indexes.js +185 -0
- package/srv/utils/db-kind.d.ts +23 -0
- package/srv/utils/db-kind.js +42 -0
- package/srv/utils/db-sanitize.d.ts +20 -0
- package/srv/utils/db-sanitize.js +80 -0
- package/srv/utils/deep-json.d.ts +6 -0
- package/srv/utils/deep-json.js +240 -0
- package/srv/utils/detached-run.d.ts +41 -0
- package/srv/utils/detached-run.js +101 -0
- package/srv/utils/epoch-slots.d.ts +14 -0
- package/srv/utils/epoch-slots.js +45 -0
- package/srv/utils/error-codes.d.ts +26 -75
- package/srv/utils/error-codes.js +27 -72
- package/srv/utils/errors.d.ts +55 -187
- package/srv/utils/errors.js +161 -235
- package/srv/utils/lease.d.ts +20 -0
- package/srv/utils/lease.js +62 -0
- package/srv/utils/liveness.d.ts +12 -0
- package/srv/utils/liveness.js +35 -0
- package/srv/utils/mappers.d.ts +111 -223
- package/srv/utils/mappers.js +432 -371
- package/srv/utils/navigation.d.ts +17 -0
- package/srv/utils/navigation.js +52 -0
- package/srv/utils/network-context.d.ts +0 -1
- package/srv/utils/network-context.js +9 -15
- package/srv/utils/paging.d.ts +31 -0
- package/srv/utils/paging.js +43 -0
- package/srv/utils/pg-inline-json.d.ts +8 -0
- package/srv/utils/pg-inline-json.js +58 -0
- package/srv/utils/pg-order-nulls.d.ts +14 -0
- package/srv/utils/pg-order-nulls.js +54 -0
- package/srv/utils/plutus-placeholders.d.ts +16 -22
- package/srv/utils/plutus-placeholders.js +62 -33
- package/srv/utils/rate-limiter.d.ts +2 -21
- package/srv/utils/rate-limiter.js +5 -17
- package/srv/utils/readiness.d.ts +12 -0
- package/srv/utils/readiness.js +29 -0
- package/srv/utils/reference-script.d.ts +19 -0
- package/srv/utils/reference-script.js +84 -0
- package/srv/utils/resolution.d.ts +13 -0
- package/srv/utils/resolution.js +47 -0
- package/srv/utils/result-numbers.d.ts +15 -0
- package/srv/utils/result-numbers.js +61 -0
- package/srv/utils/row-values.d.ts +7 -0
- package/srv/utils/row-values.js +27 -0
- package/srv/utils/service-events.d.ts +0 -24
- package/srv/utils/service-events.js +3 -25
- package/srv/utils/signing-helper.d.ts +3 -20
- package/srv/utils/signing-helper.js +35 -64
- package/srv/utils/tx-build-helper.d.ts +25 -105
- package/srv/utils/tx-build-helper.js +108 -156
- package/srv/utils/tx-request-parsers.d.ts +82 -33
- package/srv/utils/tx-request-parsers.js +401 -49
- package/srv/utils/tx-utils.d.ts +3 -27
- package/srv/utils/tx-utils.js +32 -50
- package/srv/utils/types.d.ts +294 -232
- package/srv/utils/types.js +2 -22
- package/srv/utils/validators.d.ts +22 -92
- package/srv/utils/validators.js +60 -170
package/srv/cardano-ui.cds
CHANGED
|
@@ -891,13 +891,13 @@ annotate srv.Addresses with @(
|
|
|
891
891
|
$Type : 'UI.ReferenceFacet',
|
|
892
892
|
Label : 'Assets',
|
|
893
893
|
Target : 'assets/@UI.LineItem',
|
|
894
|
-
|
|
894
|
+
@UI.Hidden: (not hasAssets)
|
|
895
895
|
},
|
|
896
896
|
{
|
|
897
897
|
$Type : 'UI.ReferenceFacet',
|
|
898
898
|
Label : 'UTxOs',
|
|
899
899
|
Target : 'utxos/@UI.LineItem',
|
|
900
|
-
|
|
900
|
+
@UI.Hidden: (not hasUTxOs)
|
|
901
901
|
}
|
|
902
902
|
],
|
|
903
903
|
|
|
@@ -1075,7 +1075,7 @@ annotate srv.AddressUTxOs with @(
|
|
|
1075
1075
|
$Type : 'UI.ReferenceFacet',
|
|
1076
1076
|
Label : 'Assets',
|
|
1077
1077
|
Target : 'assets/@UI.LineItem',
|
|
1078
|
-
|
|
1078
|
+
@UI.Hidden: (not hasAssets)
|
|
1079
1079
|
},
|
|
1080
1080
|
{
|
|
1081
1081
|
$Type : 'UI.ReferenceFacet',
|
|
@@ -1305,19 +1305,19 @@ annotate srv.Transactions with @(
|
|
|
1305
1305
|
$Type : 'UI.ReferenceFacet',
|
|
1306
1306
|
Label : 'Metadata',
|
|
1307
1307
|
Target : 'metadata/@UI.LineItem',
|
|
1308
|
-
|
|
1308
|
+
@UI.Hidden: (not hasMetadata)
|
|
1309
1309
|
},
|
|
1310
1310
|
{
|
|
1311
1311
|
$Type : 'UI.ReferenceFacet',
|
|
1312
1312
|
Label : 'Inputs',
|
|
1313
1313
|
Target : 'inputs/@UI.LineItem',
|
|
1314
|
-
|
|
1314
|
+
@UI.Hidden: (not hasInputs)
|
|
1315
1315
|
},
|
|
1316
1316
|
{
|
|
1317
1317
|
$Type : 'UI.ReferenceFacet',
|
|
1318
1318
|
Label : 'Outputs',
|
|
1319
1319
|
Target : 'outputs/@UI.LineItem',
|
|
1320
|
-
|
|
1320
|
+
@UI.Hidden: (not hasOutputs)
|
|
1321
1321
|
}
|
|
1322
1322
|
],
|
|
1323
1323
|
|
|
@@ -1451,7 +1451,7 @@ annotate srv.TransactionInputs with @(
|
|
|
1451
1451
|
$Type : 'UI.ReferenceFacet',
|
|
1452
1452
|
Label : 'Assets',
|
|
1453
1453
|
Target : 'assets/@UI.LineItem',
|
|
1454
|
-
|
|
1454
|
+
@UI.Hidden: (not hasAssets)
|
|
1455
1455
|
},
|
|
1456
1456
|
{
|
|
1457
1457
|
$Type : 'UI.ReferenceFacet',
|
|
@@ -1625,7 +1625,7 @@ annotate srv.TransactionOutputs with @(
|
|
|
1625
1625
|
$Type : 'UI.ReferenceFacet',
|
|
1626
1626
|
Label : 'Assets',
|
|
1627
1627
|
Target : 'assets/@UI.LineItem',
|
|
1628
|
-
|
|
1628
|
+
@UI.Hidden: (not hasAssets)
|
|
1629
1629
|
},
|
|
1630
1630
|
{
|
|
1631
1631
|
$Type : 'UI.ReferenceFacet',
|
|
@@ -1860,7 +1860,7 @@ annotate srv.Accounts with @(
|
|
|
1860
1860
|
$Type : 'UI.ReferenceFacet',
|
|
1861
1861
|
Label : 'Addresses',
|
|
1862
1862
|
Target : 'Address/@UI.LineItem',
|
|
1863
|
-
|
|
1863
|
+
@UI.Hidden: (not hasAddresses)
|
|
1864
1864
|
}
|
|
1865
1865
|
],
|
|
1866
1866
|
|
|
@@ -2301,19 +2301,19 @@ annotate txsrv.TransactionBuilds with @(
|
|
|
2301
2301
|
$Type : 'UI.ReferenceFacet',
|
|
2302
2302
|
Label : 'Inputs',
|
|
2303
2303
|
Target : 'inputs/@UI.LineItem',
|
|
2304
|
-
|
|
2304
|
+
@UI.Hidden: (not hasInputs)
|
|
2305
2305
|
},
|
|
2306
2306
|
{
|
|
2307
2307
|
$Type : 'UI.ReferenceFacet',
|
|
2308
2308
|
Label : 'Outputs',
|
|
2309
2309
|
Target : 'outputs/@UI.LineItem',
|
|
2310
|
-
|
|
2310
|
+
@UI.Hidden: (not hasOutputs)
|
|
2311
2311
|
},
|
|
2312
2312
|
{
|
|
2313
2313
|
$Type : 'UI.ReferenceFacet',
|
|
2314
2314
|
Label : 'Submission',
|
|
2315
2315
|
Target : 'submission/@UI.FieldGroup#SubmissionDetails',
|
|
2316
|
-
|
|
2316
|
+
@UI.Hidden: (not wasSubmitted)
|
|
2317
2317
|
}
|
|
2318
2318
|
],
|
|
2319
2319
|
|
|
@@ -2439,7 +2439,7 @@ annotate txsrv.TransactionBuildInputs with @(
|
|
|
2439
2439
|
$Type : 'UI.ReferenceFacet',
|
|
2440
2440
|
Label : 'Assets',
|
|
2441
2441
|
Target : 'assets/@UI.LineItem',
|
|
2442
|
-
|
|
2442
|
+
@UI.Hidden: (not hasAssets)
|
|
2443
2443
|
},
|
|
2444
2444
|
{
|
|
2445
2445
|
$Type : 'UI.ReferenceFacet',
|
|
@@ -2611,7 +2611,7 @@ annotate txsrv.TransactionBuildOutputs with @(
|
|
|
2611
2611
|
$Type : 'UI.ReferenceFacet',
|
|
2612
2612
|
Label : 'Assets',
|
|
2613
2613
|
Target : 'assets/@UI.LineItem',
|
|
2614
|
-
|
|
2614
|
+
@UI.Hidden: (not hasAssets)
|
|
2615
2615
|
},
|
|
2616
2616
|
{
|
|
2617
2617
|
$Type : 'UI.ReferenceFacet',
|
|
@@ -2796,13 +2796,13 @@ annotate txsrv.TransactionSubmissions with @(
|
|
|
2796
2796
|
$Type : 'UI.ReferenceFacet',
|
|
2797
2797
|
Label : 'Error Details',
|
|
2798
2798
|
Target : '@UI.FieldGroup#ErrorDetails',
|
|
2799
|
-
|
|
2799
|
+
@UI.Hidden: (not hasErrors)
|
|
2800
2800
|
},
|
|
2801
2801
|
{
|
|
2802
2802
|
$Type : 'UI.ReferenceFacet',
|
|
2803
2803
|
Label : 'Errors',
|
|
2804
2804
|
Target : 'errors/@UI.LineItem',
|
|
2805
|
-
|
|
2805
|
+
@UI.Hidden: (not hasErrors)
|
|
2806
2806
|
}
|
|
2807
2807
|
],
|
|
2808
2808
|
|
|
@@ -1,125 +1,141 @@
|
|
|
1
|
-
using {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
@
|
|
23
|
-
@
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
@title : '
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
@
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
@title: '
|
|
93
|
-
@title: '
|
|
94
|
-
@title: '
|
|
95
|
-
@title: '
|
|
96
|
-
@title: '
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
@
|
|
101
|
-
@
|
|
102
|
-
action CancelJob(
|
|
103
|
-
@title: 'Job Id' jobId : UUID
|
|
104
|
-
) returns Boolean;
|
|
105
|
-
|
|
106
|
-
@title : 'Get Job Status'
|
|
107
|
-
@description: 'Current lifecycle state of a wallet job (non-admins: own jobs only)'
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
@
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
@
|
|
122
|
-
@
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
1
|
+
using { WalletJobKind, ResolvedOutcome } from '../db/types';
|
|
2
|
+
using {odatano.cardano as db} from '../db/schema';
|
|
3
|
+
|
|
4
|
+
// Async wallet jobs signed with server-held keys, which are never accepted or returned here.
|
|
5
|
+
// Control actions and foreign jobs need Admin. A job needs the wallet's requiresRole and, on an
|
|
6
|
+
// HSM wallet, hsm.requiresRole. An agent token gets a 403 on every event of this service.
|
|
7
|
+
@requires: 'Transact'
|
|
8
|
+
@odatano.agent: 'closed'
|
|
9
|
+
service CardanoWorkerService @(impl: './cardano-worker-service') {
|
|
10
|
+
|
|
11
|
+
@readonly
|
|
12
|
+
@title : 'Wallet Jobs'
|
|
13
|
+
@description: 'Asynchronous wallet-worker jobs. Non-admin callers see their own jobs only.'
|
|
14
|
+
@restrict : [
|
|
15
|
+
{ grant: 'READ', to: 'Admin' },
|
|
16
|
+
{ grant: 'READ', where: 'createdBy = $user' }
|
|
17
|
+
]
|
|
18
|
+
// dedupKey is the internal backing column of the idempotency constraint.
|
|
19
|
+
entity WalletJobs as projection on db.CardanoWalletJobs excluding { dedupKey };
|
|
20
|
+
|
|
21
|
+
@readonly
|
|
22
|
+
@title : 'Worker Wallets'
|
|
23
|
+
@description: 'Registered server-side worker wallets (addresses and stats only; no key material, no lease internals)'
|
|
24
|
+
entity WorkerWallets as projection on db.CardanoWorkerWallets excluding { leaseOwner, leaseUntil };
|
|
25
|
+
|
|
26
|
+
@title : 'Wallet Job Submission Result'
|
|
27
|
+
type JobSubmissionResult {
|
|
28
|
+
jobId : UUID;
|
|
29
|
+
status : String(12);
|
|
30
|
+
deduplicated : Boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@title : 'Wallet Job Status'
|
|
34
|
+
type JobStatus {
|
|
35
|
+
jobId : UUID;
|
|
36
|
+
walletId : String(50);
|
|
37
|
+
kind : String(12);
|
|
38
|
+
status : String(12);
|
|
39
|
+
attempt : Integer;
|
|
40
|
+
txHash : String(64);
|
|
41
|
+
fee : String;
|
|
42
|
+
errorCode : String(50);
|
|
43
|
+
errorMessage : String(500);
|
|
44
|
+
submittedAt : Timestamp;
|
|
45
|
+
confirmedAt : Timestamp;
|
|
46
|
+
finishedAt : Timestamp;
|
|
47
|
+
resolution : String(500);
|
|
48
|
+
invalidationTxHash : String(64);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@title : 'Worker Status'
|
|
52
|
+
type WorkerStatus {
|
|
53
|
+
running : Boolean;
|
|
54
|
+
wallets : many String;
|
|
55
|
+
executing : many String;
|
|
56
|
+
awaitingConfirmation : Integer;
|
|
57
|
+
pendingJobs : Integer;
|
|
58
|
+
unresolvedJobs : Integer; // jobs an operator has to resolve (ResolveJob)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Terminal job outcome. Subscribe in process, or wait over HTTP with GetJobStatus(waitMs). */
|
|
62
|
+
event jobConfirmed {
|
|
63
|
+
jobId : UUID;
|
|
64
|
+
walletId : String(50);
|
|
65
|
+
kind : String(12);
|
|
66
|
+
txHash : String(64);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
event jobFailed {
|
|
70
|
+
jobId : UUID;
|
|
71
|
+
walletId : String(50);
|
|
72
|
+
kind : String(12);
|
|
73
|
+
txHash : String(64); // null when the job never reached the chain
|
|
74
|
+
errorCode : String(50);
|
|
75
|
+
errorMessage : String(500);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** The transaction can no longer land and nothing shows whether it did; ResolveJob settles it. */
|
|
79
|
+
event jobUnresolved {
|
|
80
|
+
jobId : UUID;
|
|
81
|
+
walletId : String(50);
|
|
82
|
+
kind : String(12);
|
|
83
|
+
txHash : String(64);
|
|
84
|
+
errorMessage : String(500);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@title : 'Submit Wallet Job'
|
|
88
|
+
@description: 'Queue an asynchronous transaction job for a worker wallet. Returns immediately with a jobId; poll GetJobStatus for the outcome. The request JSON is the same payload shape as the corresponding Build* action; senderAddress is always overridden with the wallet address. A retry with the same idempotencyKey and request returns the job that holds the key; another request under that key is a 409.'
|
|
89
|
+
@odatano.agent: 'operator'
|
|
90
|
+
action SubmitWalletJob(
|
|
91
|
+
@title: 'Wallet Id' walletId : String(50),
|
|
92
|
+
@title: 'Job Kind' @assert.range kind : WalletJobKind,
|
|
93
|
+
@title: 'Request JSON' requestJson : LargeString,
|
|
94
|
+
@title: 'Idempotency Key' idempotencyKey : String(100),
|
|
95
|
+
@title: 'Priority' @assert.range: [0, 10000] priority : Integer,
|
|
96
|
+
@title: 'Not Before' notBefore : Timestamp
|
|
97
|
+
) returns JobSubmissionResult;
|
|
98
|
+
|
|
99
|
+
@title : 'Cancel Job'
|
|
100
|
+
@description: 'Cancel a still-pending job. Jobs that started building may already reach the chain and cannot be cancelled.'
|
|
101
|
+
@odatano.agent: 'operator'
|
|
102
|
+
action CancelJob(
|
|
103
|
+
@title: 'Job Id' jobId : UUID
|
|
104
|
+
) returns Boolean;
|
|
105
|
+
|
|
106
|
+
@title : 'Get Job Status'
|
|
107
|
+
@description: 'Current lifecycle state of a wallet job (non-admins: own jobs only). With waitMs the call answers as soon as the job is confirmed, failed, cancelled or unresolved, or after that time with the state it has then. Keep waitMs below the timeout of the proxies in front of the service.'
|
|
108
|
+
@odatano.agent: 'operator'
|
|
109
|
+
function GetJobStatus(
|
|
110
|
+
@title: 'Job Id' jobId : UUID,
|
|
111
|
+
@title: 'Wait (ms)' @assert.range: [0, 30000] waitMs : Integer
|
|
112
|
+
) returns JobStatus;
|
|
113
|
+
|
|
114
|
+
@title : 'Get Worker Status'
|
|
115
|
+
@description: 'Live worker summary: running state, wallets, in-flight executions, confirmation backlog, queue depth'
|
|
116
|
+
@odatano.agent: 'operator'
|
|
117
|
+
function GetWorkerStatus() returns WorkerStatus;
|
|
118
|
+
|
|
119
|
+
@title : 'Resolve Job'
|
|
120
|
+
@description: 'Settle an unresolved job after reading the chain: confirmed when its transaction is on chain with passing scripts, failed when it is not and can no longer land. failed is refused with 409 while the transaction is not expired and an input of it is unspent. txHash, when given, must be the job transaction. The job and its submission record follow the outcome; the job keeps its idempotency key either way.'
|
|
121
|
+
@requires : 'Admin'
|
|
122
|
+
@odatano.agent: 'operator'
|
|
123
|
+
action ResolveJob(
|
|
124
|
+
@title: 'Job Id' jobId : UUID not null,
|
|
125
|
+
@title: 'Outcome' @assert.range outcome : ResolvedOutcome not null,
|
|
126
|
+
@title: 'Transaction Hash' txHash : String(64),
|
|
127
|
+
@title: 'Note' note : String(300)
|
|
128
|
+
) returns JobStatus;
|
|
129
|
+
|
|
130
|
+
@title : 'Pause Worker'
|
|
131
|
+
@description: 'Stop the local worker instance (finishes in-flight steps; queued jobs stay pending).'
|
|
132
|
+
@requires : 'Admin'
|
|
133
|
+
@odatano.agent: 'operator'
|
|
134
|
+
action PauseWorker() returns Boolean;
|
|
135
|
+
|
|
136
|
+
@title : 'Resume Worker'
|
|
137
|
+
@description: 'Start/restart the local worker instance using the configured wallets.'
|
|
138
|
+
@requires : 'Admin'
|
|
139
|
+
@odatano.agent: 'operator'
|
|
140
|
+
action ResumeWorker() returns Boolean;
|
|
141
|
+
}
|