@odatano/core 2.0.0-rc.1 → 2.0.0-rc.11
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 +255 -0
- package/@cds-models/CardanoAgentService/index.js +36 -0
- package/@cds-models/CardanoIndexerService/index.d.ts +37 -2
- package/@cds-models/CardanoIndexerService/index.js +4 -0
- package/@cds-models/CardanoSignService/index.d.ts +5 -2
- package/@cds-models/CardanoTransactionService/index.d.ts +9 -9
- package/@cds-models/odatano/cardano/index.d.ts +86 -0
- package/@cds-models/odatano/cardano/index.js +6 -0
- package/README.md +62 -4
- package/db/schema.cds +105 -0
- package/package.json +9 -3
- package/src/index.d.ts +6 -0
- package/src/index.js +21 -1
- package/src/plugin.js +33 -30
- package/srv/blockchain/backends/blockfrost-backend.js +1 -10
- package/srv/blockchain/backends/koios-backend.js +1 -10
- package/srv/blockchain/backends/ogmios-backend.d.ts +29 -4
- package/srv/blockchain/backends/ogmios-backend.js +96 -7
- package/srv/blockchain/backends/ogmios-frame-guard.d.ts +77 -0
- package/srv/blockchain/backends/ogmios-frame-guard.js +181 -0
- package/srv/blockchain/cardano-indexer.d.ts +18 -0
- package/srv/blockchain/cardano-indexer.js +58 -3
- package/srv/blockchain/crawler/crawler.d.ts +55 -0
- package/srv/blockchain/crawler/crawler.js +153 -3
- package/srv/blockchain/crawler/index.d.ts +9 -0
- package/srv/blockchain/crawler/index.js +37 -4
- package/srv/blockchain/crawler/sync-state.d.ts +13 -1
- package/srv/blockchain/crawler/sync-state.js +24 -2
- package/srv/blockchain/transaction-building/buildooor-tx.d.ts +20 -0
- package/srv/blockchain/transaction-building/buildooor-tx.js +104 -20
- package/srv/blockchain/wallet-worker/build-request.js +35 -6
- package/srv/blockchain/wallet-worker/confirmation-tracker.d.ts +32 -1
- package/srv/blockchain/wallet-worker/confirmation-tracker.js +91 -29
- package/srv/blockchain/wallet-worker/job-store.d.ts +11 -0
- package/srv/blockchain/wallet-worker/job-store.js +42 -9
- package/srv/cardano-agent-service.cds +150 -0
- package/srv/cardano-agent-service.d.ts +2 -0
- package/srv/cardano-agent-service.js +16 -0
- package/srv/cardano-indexer-service.cds +36 -3
- package/srv/cardano-indexer-service.js +3 -0
- package/srv/cardano-service.js +57 -3
- package/srv/cardano-sign-service.cds +200 -180
- package/srv/cardano-tx-service.cds +32 -26
- package/srv/cardano-tx-service.js +96 -38
- package/srv/cardano-worker-service.cds +125 -125
- package/srv/server.d.ts +2 -1
- package/srv/server.js +18 -34
- package/srv/utils/agent-grants-config.d.ts +65 -0
- package/srv/utils/agent-grants-config.js +148 -0
- package/srv/utils/agent-grants.d.ts +314 -0
- package/srv/utils/agent-grants.js +821 -0
- package/srv/utils/agent-token-auth.d.ts +19 -0
- package/srv/utils/agent-token-auth.js +81 -0
- package/srv/utils/db-sanitize.d.ts +40 -0
- package/srv/utils/db-sanitize.js +98 -0
- package/srv/utils/errors.d.ts +18 -0
- package/srv/utils/errors.js +24 -1
- package/srv/utils/liveness.d.ts +23 -0
- package/srv/utils/liveness.js +49 -0
- package/srv/utils/mappers.d.ts +27 -0
- package/srv/utils/mappers.js +67 -7
- package/srv/utils/rate-limiter.d.ts +57 -0
- package/srv/utils/rate-limiter.js +126 -0
- package/srv/utils/tx-request-parsers.d.ts +13 -0
- package/srv/utils/tx-request-parsers.js +32 -0
- package/srv/utils/types.d.ts +34 -0
|
@@ -1,180 +1,200 @@
|
|
|
1
|
-
using {odatano.cardano as db} from '../db/schema';
|
|
2
|
-
using {Bech32} from '../db/types';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Cardano Sign Service
|
|
6
|
-
*
|
|
7
|
-
* Handles the external signing workflow for Cardano transactions, including:
|
|
8
|
-
* - Creating signing requests with transaction details and signing instructions
|
|
9
|
-
* - Verifying signatures of signed transactions and storing verification results
|
|
10
|
-
* - Submitting verified transactions to the blockchain and tracking submission status
|
|
11
|
-
* - Providing actions for signing with a Hardware Security Module (HSM) and retrieving HSM status
|
|
12
|
-
*
|
|
13
|
-
* Security note: see CardanoODataService (cardano-service.cds) for the rationale
|
|
14
|
-
*
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
@
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
@
|
|
33
|
-
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
1
|
+
using {odatano.cardano as db} from '../db/schema';
|
|
2
|
+
using {Bech32} from '../db/types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Cardano Sign Service
|
|
6
|
+
*
|
|
7
|
+
* Handles the external signing workflow for Cardano transactions, including:
|
|
8
|
+
* - Creating signing requests with transaction details and signing instructions
|
|
9
|
+
* - Verifying signatures of signed transactions and storing verification results
|
|
10
|
+
* - Submitting verified transactions to the blockchain and tracking submission status
|
|
11
|
+
* - Providing actions for signing with a Hardware Security Module (HSM) and retrieving HSM status
|
|
12
|
+
*
|
|
13
|
+
* Security note: see CardanoODataService (cardano-service.cds) for the rationale on auth
|
|
14
|
+
* without per-resource ownership enforcement. Deliberately NO service-level @requires:
|
|
15
|
+
* CAP checks it on every request BEFORE the operation annotation, which silenced the
|
|
16
|
+
* `any` on VerifyDataSignature (anonymous callers got the 401 challenge first). The
|
|
17
|
+
* requirement therefore sits on each element; VerifyDataSignature alone is public.
|
|
18
|
+
*/
|
|
19
|
+
// Service-level 'any' on purpose: CAP authorizes the service BEFORE the operation and
|
|
20
|
+
// treats a service without a service-level @requires as authenticated-user under
|
|
21
|
+
// NODE_ENV=production, which would 401 the anonymous operation below despite its own
|
|
22
|
+
// 'any'. Every element carries its requirement; the service itself refuses nothing.
|
|
23
|
+
@requires: 'any'
|
|
24
|
+
service CardanoSignService @(impl: './cardano-sign-service') {
|
|
25
|
+
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
// Signing Workflow Projections
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
@readonly
|
|
30
|
+
@title : 'Signature Verifications'
|
|
31
|
+
@description: 'Projection for Signature Verifications - stores verification results'
|
|
32
|
+
@requires : 'authenticated-user'
|
|
33
|
+
entity SignatureVerifications as projection on db.SignatureVerifications;
|
|
34
|
+
|
|
35
|
+
@readonly
|
|
36
|
+
@title : 'Address Signing Requests'
|
|
37
|
+
@description: 'Projection for retrieving signing requests by address'
|
|
38
|
+
@requires : 'authenticated-user'
|
|
39
|
+
entity AddressSigningRequests as projection on db.AddressSigningRequests;
|
|
40
|
+
|
|
41
|
+
@readonly
|
|
42
|
+
@title : 'Transaction Builds'
|
|
43
|
+
@description: 'Projection for Transaction Builds - needed by CreateSigningRequest to look up build details'
|
|
44
|
+
@requires : 'authenticated-user'
|
|
45
|
+
entity TransactionBuilds as projection on db.TransactionBuilds;
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@readonly
|
|
49
|
+
@title : 'Transaction Submissions'
|
|
50
|
+
@description: 'Projection for Transaction Submissions - stores submission results'
|
|
51
|
+
@requires : 'authenticated-user'
|
|
52
|
+
entity TransactionSubmissions as projection on db.TransactionSubmissions;
|
|
53
|
+
|
|
54
|
+
@readonly
|
|
55
|
+
@title : 'Signing Requests'
|
|
56
|
+
@description: 'Projection for Signing Requests - tracks signing workflow'
|
|
57
|
+
@requires : 'authenticated-user'
|
|
58
|
+
entity SigningRequests as projection on db.SigningRequests;
|
|
59
|
+
|
|
60
|
+
@title : 'Verify Signature'
|
|
61
|
+
@description: 'Verify the signature of a signed transaction. Stores the verification result for audit trail.'
|
|
62
|
+
@requires : 'authenticated-user'
|
|
63
|
+
action VerifySignature(
|
|
64
|
+
@title: 'Signing Request ID'
|
|
65
|
+
@description: 'The unique identifier of the signing request'
|
|
66
|
+
signingRequestId: UUID,
|
|
67
|
+
@title: 'Signed Transaction CBOR'
|
|
68
|
+
@description: 'The signed transaction CBOR to verify'
|
|
69
|
+
signedTxCbor: String,
|
|
70
|
+
@title: 'Signer Type'
|
|
71
|
+
@description: 'Type of signer used (cardano-cli | browser-wallet | hardware-wallet | custom)'
|
|
72
|
+
signerType: String(20),
|
|
73
|
+
@title: 'Signer Info'
|
|
74
|
+
@description: 'Additional signer information (wallet name, etc.)'
|
|
75
|
+
signerInfo: String(100),
|
|
76
|
+
@title: 'Sender Address'
|
|
77
|
+
@description: 'Optional sender address for ownership verification. When provided, verifies the signing request belongs to this address.'
|
|
78
|
+
address: Bech32) returns SignatureVerifications;
|
|
79
|
+
|
|
80
|
+
@title : 'Submit Verified Transaction'
|
|
81
|
+
@description: 'Verify and submit a signed transaction in one step. Updates the signing request status and creates submission record.'
|
|
82
|
+
@requires : 'authenticated-user'
|
|
83
|
+
action SubmitVerifiedTransaction(
|
|
84
|
+
@title: 'Signing Request ID'
|
|
85
|
+
@description: 'The unique identifier of the signing request'
|
|
86
|
+
signingRequestId: UUID,
|
|
87
|
+
@title: 'Signed Transaction CBOR'
|
|
88
|
+
@description: 'The signed transaction CBOR'
|
|
89
|
+
signedTxCbor: String,
|
|
90
|
+
@title: 'Signer Type'
|
|
91
|
+
@description: 'Type of signer used'
|
|
92
|
+
signerType: String(20),
|
|
93
|
+
@title: 'Signer Info'
|
|
94
|
+
@description: 'Additional signer information'
|
|
95
|
+
signerInfo: String(100),
|
|
96
|
+
@title: 'Sender Address'
|
|
97
|
+
@description: 'Optional sender address for ownership verification. When provided, verifies the signing request belongs to this address.'
|
|
98
|
+
address: Bech32,
|
|
99
|
+
@title: 'Defer Submit'
|
|
100
|
+
@description: 'When true, verify + claim run on the caller''s transaction and the network submit happens detached AFTER the caller''s commit. Returns immediately with the tx hash (= tx body hash) and status ''pending''. Designed for in-process CAP consumers whose request transaction would otherwise deadlock the pooled sqlite connection (KNOWN_ISSUES #11). Track the outcome via the signing request / submission status.'
|
|
101
|
+
deferSubmit: Boolean) returns TransactionSubmissions;
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
// ---------------------------------------------------------------------------
|
|
105
|
+
// CIP-30 signData (COSE_Sign1) message-signature verification
|
|
106
|
+
// ---------------------------------------------------------------------------
|
|
107
|
+
|
|
108
|
+
// Public override: this action is the crypto check behind wallet-based LOGIN,
|
|
109
|
+
// so the caller is not yet authenticated. It is a stateless verification —
|
|
110
|
+
// no DB write, no key access, no state — so exposing it leaks nothing.
|
|
111
|
+
@requires : 'any'
|
|
112
|
+
@title : 'Verify Data Signature (CIP-30 signData)'
|
|
113
|
+
@description: 'Verify a COSE_Sign1 message signature against a bech32 address. Confirms the Ed25519 signature, that the signer key hashes to the address payment credential, and (optionally) that the signed payload matches an expected value.'
|
|
114
|
+
action VerifyDataSignature(
|
|
115
|
+
@description: 'Bech32 address the wallet claimed to sign with'
|
|
116
|
+
address : Bech32,
|
|
117
|
+
@description: 'Hex-encoded COSE_Sign1 CBOR (the `signature` field from CIP-30 signData)'
|
|
118
|
+
coseSignature : String,
|
|
119
|
+
@description: 'Hex-encoded COSE_Key CBOR (the `key` field from CIP-30 signData)'
|
|
120
|
+
coseKey : String,
|
|
121
|
+
@description: 'Optional expected UTF-8 payload; when set, the signed payload must equal it (anti-replay). When omitted, the decoded payload is returned for the caller to check.'
|
|
122
|
+
expectedPayload: String) returns {
|
|
123
|
+
@description: 'Whether the signature is valid and all checks passed' valid : Boolean;
|
|
124
|
+
@description: 'Failure detail when not valid' reason : String;
|
|
125
|
+
@description: 'UTF-8 of the signed payload, echoed back' signedPayload : String;
|
|
126
|
+
@description: 'Hex blake2b-224 of the signer public key' signerVkh : String;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
// ---------------------------------------------------------------------------
|
|
130
|
+
// General Signing Workflow Actions
|
|
131
|
+
// ---------------------------------------------------------------------------
|
|
132
|
+
|
|
133
|
+
@title : 'Create Signing Request'
|
|
134
|
+
@description: 'Create a signing request for external signing. Returns transaction details, signing instructions, and CLI commands. The request is persisted for audit trail.'
|
|
135
|
+
@requires : 'authenticated-user'
|
|
136
|
+
action CreateSigningRequest(
|
|
137
|
+
@title: 'Build ID'
|
|
138
|
+
@description: 'The unique identifier of the transaction build'
|
|
139
|
+
buildId: UUID,
|
|
140
|
+
@title: 'Message to Signer'
|
|
141
|
+
@description: 'A message to include for the signer'
|
|
142
|
+
message: String) returns SigningRequests;
|
|
143
|
+
|
|
144
|
+
@title : 'Get Signing Request'
|
|
145
|
+
@description: 'Retrieve an existing signing request by ID'
|
|
146
|
+
@requires : 'authenticated-user'
|
|
147
|
+
action GetSigningRequest(
|
|
148
|
+
@title: 'Signing Request ID'
|
|
149
|
+
@description: 'The unique identifier of the signing request'
|
|
150
|
+
signingRequestId: UUID) returns SigningRequests;
|
|
151
|
+
|
|
152
|
+
@title : 'Address Signing Requests'
|
|
153
|
+
@description: 'Projection for retrieving signing requests by address'
|
|
154
|
+
@requires : 'authenticated-user'
|
|
155
|
+
action GetSigningRequestsByAddress(
|
|
156
|
+
@title: 'Bech32 Address'
|
|
157
|
+
@description: 'The Bech32 encoded address to retrieve signing requests for'
|
|
158
|
+
address: Bech32) returns array of AddressSigningRequests;
|
|
159
|
+
|
|
160
|
+
// ---------------------------------------------------------------------------
|
|
161
|
+
// HSM (Hardware Security Module) Signing Actions
|
|
162
|
+
// ---------------------------------------------------------------------------
|
|
163
|
+
|
|
164
|
+
@title : 'Sign with HSM'
|
|
165
|
+
@description: 'Sign a transaction using the configured Hardware Security Module. Creates a signing request, signs with the HSM, and verifies the signature. Returns the signing request with status verified.'
|
|
166
|
+
@requires : 'authenticated-user'
|
|
167
|
+
action SignWithHsm(
|
|
168
|
+
@title: 'Build ID'
|
|
169
|
+
@description: 'The unique identifier of the transaction build to sign'
|
|
170
|
+
buildId: UUID,
|
|
171
|
+
@title: 'Sender Address'
|
|
172
|
+
@description: 'Optional sender address for ownership verification. When provided, verifies the build belongs to this address.'
|
|
173
|
+
address: Bech32) returns SigningRequests;
|
|
174
|
+
|
|
175
|
+
@title : 'Sign and Submit with HSM'
|
|
176
|
+
@description: 'Sign a transaction using the HSM and submit it to the blockchain in one atomic operation. Returns the transaction submission details.'
|
|
177
|
+
@requires : 'authenticated-user'
|
|
178
|
+
action SignAndSubmitWithHsm(
|
|
179
|
+
@title: 'Build ID'
|
|
180
|
+
@description: 'The unique identifier of the transaction build to sign and submit'
|
|
181
|
+
buildId: UUID,
|
|
182
|
+
@title: 'Sender Address'
|
|
183
|
+
@description: 'Optional sender address for ownership verification. When provided, verifies the build belongs to this address.'
|
|
184
|
+
address: Bech32,
|
|
185
|
+
@title: 'Defer Submit'
|
|
186
|
+
@description: 'When true, sign + verify + claim run on the caller''s transaction and the network submit happens detached AFTER the caller''s commit (see SubmitVerifiedTransaction.deferSubmit).'
|
|
187
|
+
deferSubmit: Boolean) returns TransactionSubmissions;
|
|
188
|
+
|
|
189
|
+
@title : 'Get HSM Status'
|
|
190
|
+
@description: 'Check the current status of the HSM connection and key availability.'
|
|
191
|
+
@requires : 'authenticated-user'
|
|
192
|
+
action GetHsmStatus() returns {
|
|
193
|
+
@title: 'Connected' @description: 'Whether the HSM session is active' connected : Boolean;
|
|
194
|
+
@title: 'Key ID' @description: 'The PKCS#11 key identifier in use' keyId : String;
|
|
195
|
+
@title: 'Key Label' @description: 'The PKCS#11 key label in use' keyLabel : String;
|
|
196
|
+
@title: 'Public Key Hash' @description: 'Blake2b-224 hash of the HSM Ed25519 public key (= Cardano verification key hash)' publicKeyHash : String;
|
|
197
|
+
@title: 'Cardano Address' @description: 'Enterprise Cardano address derived from the HSM public key' cardanoAddress : String;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
using {odatano.cardano as db} from '../db/schema';
|
|
2
|
-
using {
|
|
2
|
+
using {
|
|
3
|
+
Bech32,
|
|
4
|
+
Lovelace
|
|
5
|
+
} from '../db/types';
|
|
3
6
|
|
|
4
7
|
|
|
5
8
|
/**
|
|
@@ -43,20 +46,21 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
43
46
|
@description: 'Projection for Transaction Build Output Assets'
|
|
44
47
|
entity TransactionBuildOutputAssets as projection on db.TransactionBuildOutputAssets;
|
|
45
48
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
@readonly
|
|
50
|
+
@title : 'Transaction Submissions'
|
|
51
|
+
@description: 'Projection for Transaction Submissions'
|
|
49
52
|
entity TransactionSubmissions as projection on db.TransactionSubmissions
|
|
50
53
|
actions {
|
|
51
54
|
@title : 'Check Submission Status'
|
|
52
55
|
@description: 'Check the status of a submitted transaction by querying the blockchain for confirmation'
|
|
53
56
|
action CheckSubmissionStatus() returns TransactionSubmissions;
|
|
54
57
|
};
|
|
58
|
+
|
|
55
59
|
/**
|
|
56
60
|
* TransactionSubmissions status flow:
|
|
57
|
-
* pending
|
|
58
|
-
* submitted
|
|
59
|
-
* pending | submitted
|
|
61
|
+
* pending -> [submit to chain] -> submitted (internal, in SubmitTransaction handler)
|
|
62
|
+
* submitted -> [CheckSubmissionStatus] confirmed | stays submitted (conditional)
|
|
63
|
+
* pending | submitted -> failed (blockchain error)
|
|
60
64
|
*/
|
|
61
65
|
annotate CardanoTransactionService.TransactionSubmissions with @flow.status: status actions {
|
|
62
66
|
CheckSubmissionStatus @from : [ #submitted];
|
|
@@ -117,7 +121,7 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
117
121
|
validityStartMs: String,
|
|
118
122
|
@title: 'Validity End (Posix ms)'
|
|
119
123
|
@description: 'Optional. Validity-interval end in Posix milliseconds. Passed through to the builder only; for non-script transfers the builder leaves bounds unset unless provided.'
|
|
120
|
-
validityEndMs: String)
|
|
124
|
+
validityEndMs: String) returns TransactionBuilds;
|
|
121
125
|
|
|
122
126
|
@title : 'Build Transaction with Metadata'
|
|
123
127
|
@description: 'Build a transaction with custom metadata from sender to recipient with specified amount and change address'
|
|
@@ -136,7 +140,7 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
136
140
|
changeAddress: Bech32,
|
|
137
141
|
@title: 'Metadata JSON'
|
|
138
142
|
@description: 'The JSON representation of the transaction metadata as string'
|
|
139
|
-
metadataJson: String)
|
|
143
|
+
metadataJson: String) returns TransactionBuilds;
|
|
140
144
|
|
|
141
145
|
@title : 'Build Multi-Asset Transaction'
|
|
142
146
|
@description: 'Build a transaction to send native assets (tokens) along with ADA'
|
|
@@ -167,7 +171,7 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
167
171
|
validityStartMs: String,
|
|
168
172
|
@title: 'Validity End (Posix ms)'
|
|
169
173
|
@description: 'Optional. Validity-interval end in Posix milliseconds. Passed through to the builder only; for non-script transfers the builder leaves bounds unset unless provided.'
|
|
170
|
-
validityEndMs: String)
|
|
174
|
+
validityEndMs: String) returns TransactionBuilds;
|
|
171
175
|
|
|
172
176
|
@title : 'Build Minting Transaction'
|
|
173
177
|
@description: 'Build a transaction to mint or burn native assets'
|
|
@@ -182,10 +186,10 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
182
186
|
@description: 'The amount of ADA to send with minted assets in lovelace'
|
|
183
187
|
lovelaceAmount: Lovelace,
|
|
184
188
|
@title: 'Mint Actions JSON'
|
|
185
|
-
@description: 'JSON array of mint/burn actions (format: [{"assetUnit":"policyId+assetName","quantity":"amount"}])'
|
|
189
|
+
@description: 'JSON array of mint/burn actions (format: [{"assetUnit":"policyId+assetName","quantity":"amount"}]). Multi-policy mints: each action may additionally carry its own "mintingPolicyScript" (CBOR hex, pre-applied) and "redeemerJson" (JSON-encoded PlutusData string), overriding the top-level policy/redeemer for that action. Actions resolving to the same policy must agree on their redeemer (the ledger carries one redeemer per policy).'
|
|
186
190
|
mintActionsJson: String,
|
|
187
191
|
@title: 'Minting Policy Script'
|
|
188
|
-
@description: 'The minting policy script in CBOR hex format'
|
|
192
|
+
@description: 'The minting policy script in CBOR hex format. Actions without a per-action mintingPolicyScript mint under this script.'
|
|
189
193
|
mintingPolicyScript: String,
|
|
190
194
|
@title: 'Change Address'
|
|
191
195
|
@description: 'The Bech32 encoded address for returning change -defaults to sender address if not specified'
|
|
@@ -211,6 +215,9 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
211
215
|
@title: 'Reference Inputs JSON'
|
|
212
216
|
@description: 'Optional JSON array of {txHash, outputIndex} UTxOs to include as CIP-31 reference inputs (read-only, not consumed). Use for oracle feeds, shared config UTxOs, or script reference UTxOs. Buildooor builder only.'
|
|
213
217
|
referenceInputsJson: String,
|
|
218
|
+
@title: 'Extra Outputs JSON'
|
|
219
|
+
@description: 'Optional JSON array of additional outputs [{address, lovelaceAmount, assets?, inlineDatumJson?, referenceScriptHex?}] appended after the primary recipient output. When present, the extra outputs carry the minted assets (declare each minted unit in an entry''s assets) and the primary output stays ADA-only — used to place each minted token on its own output with its own inline datum (e.g. datum-bound predicate tokens). Each entry is independently min-ADA checked.'
|
|
220
|
+
extraOutputsJson: String,
|
|
214
221
|
@title: 'Metadata JSON'
|
|
215
222
|
@description: 'Optional transaction metadata as JSON (CIP-20 / label-674 etc.). Object keyed by numeric label string. Attached as auxiliary_data to the mint tx so chain-watchers can correlate off-chain context (receipt IDs, free-form notes).'
|
|
216
223
|
metadataJson: String,
|
|
@@ -222,14 +229,14 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
222
229
|
validityStartMs: String,
|
|
223
230
|
@title: 'Validity End (Posix ms)'
|
|
224
231
|
@description: 'Optional. Sets the transaction validity-interval end in Posix milliseconds. Required finite value for Plutus validators that call expect Finite(upper) on tx.validity_range.upper_bound. Defaults to now + 3 600 000 ms when omitted.'
|
|
225
|
-
validityEndMs: String)
|
|
232
|
+
validityEndMs: String) returns TransactionBuilds;
|
|
226
233
|
|
|
227
234
|
@title : 'Get Build Details'
|
|
228
235
|
@description: 'Retrieve transaction build details using the Build Id'
|
|
229
236
|
action GetBuildDetails(
|
|
230
237
|
@title: 'Build Id'
|
|
231
238
|
@description: 'The unique identifier of the transaction build'
|
|
232
|
-
buildId: UUID)
|
|
239
|
+
buildId: UUID) returns TransactionBuilds;
|
|
233
240
|
|
|
234
241
|
@title : 'Submit Transaction'
|
|
235
242
|
@description: 'Submit a transaction to the Cardano network using a build ID and signed CBOR'
|
|
@@ -239,7 +246,7 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
239
246
|
buildId: UUID,
|
|
240
247
|
@title: 'Signed Transaction CBOR'
|
|
241
248
|
@description: 'The CBOR of the signed transaction'
|
|
242
|
-
signedTxCbor: String)
|
|
249
|
+
signedTxCbor: String) returns TransactionSubmissions;
|
|
243
250
|
|
|
244
251
|
@title : 'Submit Signed Transaction'
|
|
245
252
|
@description: 'Submit a signed transaction to the Cardano network'
|
|
@@ -249,7 +256,7 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
249
256
|
signedTxCbor: String,
|
|
250
257
|
@title: 'Network'
|
|
251
258
|
@description: 'The Cardano network to submit the transaction to (e.g., mainnet, testnet)'
|
|
252
|
-
network: String(10))
|
|
259
|
+
network: String(10)) returns TransactionSubmissions;
|
|
253
260
|
|
|
254
261
|
@title : 'Build Plutus Spend Transaction'
|
|
255
262
|
@description: 'Build a transaction to spend a UTxO locked at a Plutus script address'
|
|
@@ -326,13 +333,14 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
326
333
|
action SetCollateral(
|
|
327
334
|
@title: 'Address'
|
|
328
335
|
@description: 'The Bech32 encoded address to check and set up collateral for'
|
|
329
|
-
address: Bech32)
|
|
336
|
+
address: Bech32) returns TransactionBuilds;
|
|
337
|
+
|
|
330
338
|
@title : 'Address Transaction Builds'
|
|
331
339
|
@description: 'Projection for retrieving transaction builds by address'
|
|
332
340
|
action GetTransactionBuildsByAddress(
|
|
333
341
|
@title: 'Bech32 Address'
|
|
334
342
|
@description: 'The Bech32 encoded address to retrieve transaction builds for'
|
|
335
|
-
address: Bech32)
|
|
343
|
+
address: Bech32) returns array of AddressTransactionBuilds;
|
|
336
344
|
|
|
337
345
|
@title : 'Derive Script Address'
|
|
338
346
|
@description: 'Utility: Apply optional PlutusData parameters to a validator script and return its enterprise script address (bech32) and script hash (28-byte hex). Pure derivation, no transaction built, no blockchain call.'
|
|
@@ -346,19 +354,17 @@ service CardanoTransactionService @(impl: './cardano-tx-service') {
|
|
|
346
354
|
@title: 'Network'
|
|
347
355
|
@description: 'Optional network override (mainnet, preview, preprod). Defaults to the configured network.'
|
|
348
356
|
network: String(10)) returns {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
357
|
+
scriptAddress : String(120);
|
|
358
|
+
scriptHash : String(56);
|
|
359
|
+
};
|
|
352
360
|
|
|
353
361
|
@title : 'Extract Payment Key Hash'
|
|
354
362
|
@description: 'Utility: Decode a Bech32 Cardano address and return its 28-byte payment credential hash (hex). Pure bech32 decoding — no blockchain call. Use to obtain the key hash for requiredSignersJson on Plutus actions.'
|
|
355
363
|
action ExtractPaymentKeyHash(
|
|
356
364
|
@title: 'Address'
|
|
357
365
|
@description: 'The Bech32 encoded Cardano address (addr / addr_test)'
|
|
358
|
-
address: Bech32)
|
|
359
|
-
|
|
360
|
-
|
|
366
|
+
address: Bech32) returns {
|
|
367
|
+
paymentKeyHash : String(56);
|
|
368
|
+
};
|
|
361
369
|
|
|
362
370
|
}
|
|
363
|
-
|
|
364
|
-
|