@odatano/core 1.7.10 → 1.9.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/@cds-models/CardanoODataService/index.d.ts +66 -42
- package/@cds-models/CardanoODataService/index.d.ts.map +1 -1
- package/@cds-models/CardanoODataService/index.js.map +1 -1
- package/@cds-models/CardanoODataService/index.ts +11 -7
- package/@cds-models/odatano/cardano/index.d.ts +70 -46
- package/@cds-models/odatano/cardano/index.d.ts.map +1 -1
- package/@cds-models/odatano/cardano/index.js +2 -2
- package/@cds-models/odatano/cardano/index.js.map +1 -1
- package/@cds-models/odatano/cardano/index.ts +13 -13
- package/LICENSE +1 -24
- package/README.md +102 -96
- package/db/schema.cds +18 -18
- package/db/types.cds +3 -3
- package/package.json +25 -11
- package/src/index.d.ts +29 -0
- package/src/index.js +1 -0
- package/src/plugin.d.ts +2 -0
- package/src/plugin.js +6 -0
- package/srv/blockchain/backends/blockfrost-backend.d.ts +155 -0
- package/srv/blockchain/backends/blockfrost-backend.js +19 -8
- package/srv/blockchain/backends/cardano-backend.d.ts +182 -0
- package/srv/blockchain/backends/koios-backend.d.ts +171 -0
- package/srv/blockchain/backends/koios-backend.js +69 -27
- package/srv/blockchain/backends/ogmios-backend.d.ts +188 -0
- package/srv/blockchain/backends/ogmios-backend.js +175 -108
- package/srv/blockchain/cardano-client.d.ts +279 -0
- package/srv/blockchain/cardano-client.js +134 -33
- package/srv/blockchain/cardano-indexer.d.ts +330 -0
- package/srv/blockchain/cardano-indexer.js +51 -8
- package/srv/blockchain/cardano-tx-builder.d.ts +113 -0
- package/srv/blockchain/cardano-tx-builder.js +64 -57
- package/srv/blockchain/circuit-breaker.d.ts +37 -0
- package/srv/blockchain/circuit-breaker.js +11 -2
- package/srv/blockchain/request-coalescer.d.ts +23 -0
- package/srv/blockchain/signing/external-signer.d.ts +146 -0
- package/srv/blockchain/signing/external-signer.js +23 -0
- package/srv/blockchain/signing/hsm-signer.d.ts +74 -0
- package/srv/blockchain/signing/hsm-signer.js +20 -5
- package/srv/blockchain/signing/signature-verifier.d.ts +56 -0
- package/srv/blockchain/signing/signature-verifier.js +79 -79
- package/srv/blockchain/transaction-building/buildooor-tx.d.ts +236 -0
- package/srv/blockchain/transaction-building/buildooor-tx.js +632 -173
- package/srv/blockchain/transaction-building/cardano-tx.d.ts +47 -0
- package/srv/cardano-service.cds +23 -3
- package/srv/cardano-service.d.ts +2 -0
- package/srv/cardano-service.js +26 -6
- package/srv/cardano-sign-service.cds +5 -0
- package/srv/cardano-sign-service.d.ts +2 -0
- package/srv/cardano-sign-service.js +221 -134
- package/srv/cardano-tx-service.cds +8 -0
- package/srv/cardano-tx-service.d.ts +12 -0
- package/srv/cardano-tx-service.js +170 -111
- package/srv/cbor/index.d.ts +2 -0
- package/srv/cbor/parse.d.ts +64 -0
- package/srv/server.d.ts +90 -0
- package/srv/server.js +52 -41
- package/srv/utils/backend-request-handler.d.ts +20 -0
- package/srv/utils/const.d.ts +183 -0
- package/srv/utils/const.js +13 -6
- package/srv/utils/error-codes.d.ts +79 -0
- package/srv/utils/errors.d.ts +259 -0
- package/srv/utils/errors.js +22 -7
- package/srv/utils/mappers.d.ts +260 -0
- package/srv/utils/mappers.js +34 -10
- package/srv/utils/plutus-placeholders.d.ts +35 -0
- package/srv/utils/plutus-placeholders.js +6 -17
- package/srv/utils/signing-helper.d.ts +23 -0
- package/srv/utils/signing-helper.js +11 -49
- package/srv/utils/tx-build-helper.d.ts +76 -0
- package/srv/utils/tx-build-helper.js +29 -80
- package/srv/utils/types.d.ts +653 -0
- package/srv/utils/validators.d.ts +145 -0
- package/srv/utils/validators.js +28 -1
- package/@cds-models/CardanoWatcherAdminService/index.js +0 -109
- package/@cds-models/CardanoWatcherAdminService/index.js.map +0 -1
- package/@cds-models/CardanoWatcherAdminService/index.ts +0 -263
- package/@cds-models/cds/outbox/index.js.map +0 -1
- package/@cds-models/cds/xt/MTXServices/index.js +0 -8
- package/@cds-models/cds/xt/MTXServices/index.js.map +0 -1
- package/@cds-models/cds/xt/MTXServices/index.ts +0 -4
- package/@cds-models/odatano/reeve/index.js +0 -77
- package/@cds-models/odatano/reeve/index.js.map +0 -1
- package/@cds-models/odatano/reeve/index.ts +0 -57
- package/@cds-models/odatano/transactions/index.js +0 -55
- package/@cds-models/odatano/transactions/index.js.map +0 -1
- package/@cds-models/odatano/transactions/index.ts +0 -18
- package/@cds-models/odatano/watch/index.js +0 -114
- package/@cds-models/odatano/watch/index.js.map +0 -1
- package/@cds-models/odatano/watch/index.ts +0 -110
- package/config/preview/cardano-node/alonzo-genesis.json +0 -196
- package/config/preview/cardano-node/byron-genesis.json +0 -117
- package/config/preview/cardano-node/config.json +0 -118
- package/config/preview/cardano-node/conway-genesis.json +0 -297
- package/config/preview/cardano-node/shelley-genesis.json +0 -68
- package/config/preview/cardano-node/topology.json +0 -19
- package/output/sora/iter0_base.json +0 -32
- package/output/sora/iter0_base.mp4 +0 -0
- package/output/sora/logo_ref_1280x720.png +0 -0
- package/output/sora/odatano_full_logo_sky_ref_1280x720.png +0 -0
- package/output/sora/odatano_full_logo_transparent.png +0 -0
- package/output/sora/odatano_full_logo_transparent_dark.png +0 -0
- package/output/sora/odatano_full_logo_v4_8s.json +0 -32
- package/output/sora/odatano_full_logo_v4_8s.mp4 +0 -0
- package/output/sora/odatano_full_logo_v5_create.json +0 -15
- package/output/sora/odatano_full_logo_v5_fixes.json +0 -15
- package/output/sora/odatano_full_logo_v5_fixes.mp4 +0 -0
- package/output/sora/odatano_logo_v1.json +0 -32
- package/output/sora/odatano_logo_v1.mp4 +0 -0
- package/output/sora/odatano_o_only_clean.png +0 -0
- package/output/sora/odatano_o_sky_ref_1280x720.png +0 -0
- package/output/sora/odatano_o_sky_v2_8s.json +0 -32
- package/output/sora/odatano_o_sky_v2_8s.mp4 +0 -0
- package/output/sora/odatano_o_sky_v3_create.json +0 -15
- package/output/sora/odatano_o_sky_v3_splash_text.json +0 -15
- package/output/sora/odatano_o_sky_v3_splash_text.mp4 +0 -0
- package/output/sora/odatano_v6_composite_exact_logo.mp4 +0 -0
- package/output/sora/odatano_v6_composite_exact_logo_clean.mp4 +0 -0
- package/output/sora/odatano_v6_composite_exact_logo_final.mp4 +0 -0
- package/output/sora/odatano_v6_endframe.jpg +0 -0
- package/output/sora/odatano_v6_endframe_clean.jpg +0 -0
- package/output/sora/odatano_v6_endframe_final.jpg +0 -0
- package/output/sora/odatano_v7_1_earlylogo_fadeoldtext.mp4 +0 -0
- package/output/sora/odatano_v7_1_end.jpg +0 -0
- package/output/sora/odatano_v7_1_transition.jpg +0 -0
- package/output/sora/odatano_v7_2_original2d_keep_sky.mp4 +0 -0
- package/output/sora/odatano_v7_endframe_nobg.jpg +0 -0
- package/output/sora/odatano_v7_endframe_nobg_cleanend.jpg +0 -0
- package/output/sora/odatano_v7_spin_splash_logo_nobg.mp4 +0 -0
- package/output/sora/odatano_v7_spin_splash_logo_nobg_cleanend.mp4 +0 -0
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/plugin.d.ts.map +0 -1
- package/src/plugin.js.map +0 -1
- package/srv/blockchain/backends/blockfrost-backend.d.ts.map +0 -1
- package/srv/blockchain/backends/blockfrost-backend.js.map +0 -1
- package/srv/blockchain/backends/cardano-backend.d.ts.map +0 -1
- package/srv/blockchain/backends/cardano-backend.js.map +0 -1
- package/srv/blockchain/backends/gerolamo-backend.d.ts.map +0 -1
- package/srv/blockchain/backends/gerolamo-backend.js +0 -321
- package/srv/blockchain/backends/gerolamo-backend.js.map +0 -1
- package/srv/blockchain/backends/koios-backend.d.ts.map +0 -1
- package/srv/blockchain/backends/koios-backend.js.map +0 -1
- package/srv/blockchain/backends/ogmios-backend.d.ts.map +0 -1
- package/srv/blockchain/backends/ogmios-backend.js.map +0 -1
- package/srv/blockchain/cardano-client.d.ts.map +0 -1
- package/srv/blockchain/cardano-client.js.map +0 -1
- package/srv/blockchain/cardano-indexer.d.ts.map +0 -1
- package/srv/blockchain/cardano-indexer.js.map +0 -1
- package/srv/blockchain/cardano-tx-builder.d.ts.map +0 -1
- package/srv/blockchain/cardano-tx-builder.js.map +0 -1
- package/srv/blockchain/circuit-breaker.d.ts.map +0 -1
- package/srv/blockchain/circuit-breaker.js.map +0 -1
- package/srv/blockchain/request-coalescer.d.ts.map +0 -1
- package/srv/blockchain/request-coalescer.js.map +0 -1
- package/srv/blockchain/signing/external-signer.d.ts.map +0 -1
- package/srv/blockchain/signing/external-signer.js.map +0 -1
- package/srv/blockchain/signing/hsm-signer.d.ts.map +0 -1
- package/srv/blockchain/signing/hsm-signer.js.map +0 -1
- package/srv/blockchain/signing/signature-verifier.d.ts.map +0 -1
- package/srv/blockchain/signing/signature-verifier.js.map +0 -1
- package/srv/blockchain/transaction-building/buildooor-tx.d.ts.map +0 -1
- package/srv/blockchain/transaction-building/buildooor-tx.js.map +0 -1
- package/srv/blockchain/transaction-building/cardano-tx.d.ts.map +0 -1
- package/srv/blockchain/transaction-building/cardano-tx.js.map +0 -1
- package/srv/blockchain/transaction-building/csl-tx.d.ts.map +0 -1
- package/srv/blockchain/transaction-building/csl-tx.js +0 -922
- package/srv/blockchain/transaction-building/csl-tx.js.map +0 -1
- package/srv/blockchain/transaction-building/tx-builder-registry.d.ts.map +0 -1
- package/srv/blockchain/transaction-building/tx-builder-registry.js +0 -69
- package/srv/blockchain/transaction-building/tx-builder-registry.js.map +0 -1
- package/srv/cardano-service.d.ts.map +0 -1
- package/srv/cardano-service.js.map +0 -1
- package/srv/cardano-sign-service.d.ts.map +0 -1
- package/srv/cardano-sign-service.js.map +0 -1
- package/srv/cardano-tx-service.d.ts.map +0 -1
- package/srv/cardano-tx-service.js.map +0 -1
- package/srv/cbor/index.d.ts.map +0 -1
- package/srv/cbor/index.js.map +0 -1
- package/srv/cbor/parse.d.ts.map +0 -1
- package/srv/cbor/parse.js.map +0 -1
- package/srv/server.d.ts.map +0 -1
- package/srv/server.js.map +0 -1
- package/srv/utils/backend-request-handler.d.ts.map +0 -1
- package/srv/utils/backend-request-handler.js.map +0 -1
- package/srv/utils/const.d.ts.map +0 -1
- package/srv/utils/const.js.map +0 -1
- package/srv/utils/error-codes.d.ts.map +0 -1
- package/srv/utils/error-codes.js.map +0 -1
- package/srv/utils/errors.d.ts.map +0 -1
- package/srv/utils/errors.js.map +0 -1
- package/srv/utils/mappers.d.ts.map +0 -1
- package/srv/utils/mappers.js.map +0 -1
- package/srv/utils/plutus-placeholders.d.ts.map +0 -1
- package/srv/utils/plutus-placeholders.js.map +0 -1
- package/srv/utils/signing-helper.d.ts.map +0 -1
- package/srv/utils/signing-helper.js.map +0 -1
- package/srv/utils/tx-build-helper.d.ts.map +0 -1
- package/srv/utils/tx-build-helper.js.map +0 -1
- package/srv/utils/types.d.ts.map +0 -1
- package/srv/utils/types.js.map +0 -1
- package/srv/utils/validators.d.ts.map +0 -1
- package/srv/utils/validators.js.map +0 -1
|
@@ -0,0 +1,653 @@
|
|
|
1
|
+
import { LedgerProtocolParameter } from "#cds-models/odatano/cardano";
|
|
2
|
+
/**
|
|
3
|
+
* Hex-encoded string (lower/upper-case depending on source)
|
|
4
|
+
*/
|
|
5
|
+
export type Hex = string;
|
|
6
|
+
/**
|
|
7
|
+
* Lovelace amount (integer) - represented as string to preserve precision for values > Number.MAX_SAFE_INTEGER.
|
|
8
|
+
* Cardano max supply = 45B ADA = 45,000,000,000,000,000 lovelace (exceeds MAX_SAFE_INTEGER).
|
|
9
|
+
* Provider APIs (Blockfrost, Koios) return lovelace as strings. Harmonic Labs uses bigint internally.
|
|
10
|
+
*/
|
|
11
|
+
export type Lovelace = number | string;
|
|
12
|
+
/**
|
|
13
|
+
* JSON Value Type - Represents any valid JSON value
|
|
14
|
+
*/
|
|
15
|
+
export type JSONValue = string | number | boolean | {
|
|
16
|
+
[key: string]: JSONValue;
|
|
17
|
+
} | JSONValue[] | null;
|
|
18
|
+
/**
|
|
19
|
+
* Amount Data Structure Type - Multi-asset amount line as returned by common Cardano APIs
|
|
20
|
+
*/
|
|
21
|
+
export interface Amount {
|
|
22
|
+
unit: string;
|
|
23
|
+
quantity: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Transaction Input Data Structure Type
|
|
27
|
+
*/
|
|
28
|
+
export interface TxInputLine {
|
|
29
|
+
address: string;
|
|
30
|
+
amount: Amount[];
|
|
31
|
+
txHash: Hex;
|
|
32
|
+
outputIndex: number;
|
|
33
|
+
dataHash?: Hex | null;
|
|
34
|
+
inlineDatum?: string | null;
|
|
35
|
+
referenceScriptHash?: Hex | null;
|
|
36
|
+
isCollateral?: boolean;
|
|
37
|
+
isReference?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Transaction Output Data Structure Type
|
|
41
|
+
*/
|
|
42
|
+
export interface TxOutputLine {
|
|
43
|
+
address: string;
|
|
44
|
+
amount: Amount[];
|
|
45
|
+
txHash: Hex;
|
|
46
|
+
outputIndex: number;
|
|
47
|
+
dataHash: string | null;
|
|
48
|
+
inlineDatum: string | null;
|
|
49
|
+
isCollateral: boolean;
|
|
50
|
+
referenceScriptHash?: Hex | null;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Transaction Data Structure Type - Normalized transaction structure
|
|
54
|
+
*/
|
|
55
|
+
export interface Transaction {
|
|
56
|
+
hash: Hex;
|
|
57
|
+
blockHash: Hex;
|
|
58
|
+
blockHeight: number;
|
|
59
|
+
slot: number;
|
|
60
|
+
index: number;
|
|
61
|
+
fee: Lovelace | string;
|
|
62
|
+
deposit: Lovelace | string;
|
|
63
|
+
size: number;
|
|
64
|
+
blockTime: number;
|
|
65
|
+
outputAmount?: Amount[];
|
|
66
|
+
inputs: TxInputLine[];
|
|
67
|
+
outputs: TxOutputLine[];
|
|
68
|
+
metadata?: MetadataLabelTx[];
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Address Data Structure Type - Address view, including current value and known UTxOs
|
|
72
|
+
*/
|
|
73
|
+
export interface Address {
|
|
74
|
+
address: string;
|
|
75
|
+
stakeAddress: string | null;
|
|
76
|
+
type: string;
|
|
77
|
+
isScript: boolean;
|
|
78
|
+
amount: Amount[];
|
|
79
|
+
utxos: UTxO[];
|
|
80
|
+
transactions?: Transaction[];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* UTxO Data Structure Type - Unspent transaction outputs (UTxOs)
|
|
84
|
+
*/
|
|
85
|
+
export interface UTxO {
|
|
86
|
+
txHash: Hex;
|
|
87
|
+
outputIndex: number;
|
|
88
|
+
address: string;
|
|
89
|
+
amount: Amount[];
|
|
90
|
+
blockHash?: Hex;
|
|
91
|
+
datumHash?: Hex | null;
|
|
92
|
+
scriptRef?: Hex | null;
|
|
93
|
+
inlineDatum?: string | null;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Block Data Structure Type - Basic block information structure
|
|
97
|
+
*/
|
|
98
|
+
export interface BlockData {
|
|
99
|
+
time: number;
|
|
100
|
+
height: number | null;
|
|
101
|
+
hash: string;
|
|
102
|
+
slot: number | null;
|
|
103
|
+
slotLeader: string;
|
|
104
|
+
epoch: number | null;
|
|
105
|
+
epochSlot: number | null;
|
|
106
|
+
size: number;
|
|
107
|
+
txCount: number;
|
|
108
|
+
fees?: string | null;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Supply Data Structure Type - Network supply information
|
|
112
|
+
*/
|
|
113
|
+
export interface Supply {
|
|
114
|
+
max: string;
|
|
115
|
+
total: string;
|
|
116
|
+
circulating: string;
|
|
117
|
+
locked: string;
|
|
118
|
+
treasury: string;
|
|
119
|
+
reserves: string;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Stake Data Structure Type - Network stake information
|
|
123
|
+
*/
|
|
124
|
+
export interface Stake {
|
|
125
|
+
live: string;
|
|
126
|
+
active: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Network Information Data Structure Type - Network supply and stake information
|
|
130
|
+
*/
|
|
131
|
+
export interface NetworkInformation {
|
|
132
|
+
supply: Supply;
|
|
133
|
+
stake: Stake;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Epoch Data Structure Type - Epoch information
|
|
137
|
+
*/
|
|
138
|
+
export interface EpochData {
|
|
139
|
+
epoch: number;
|
|
140
|
+
start_time: number;
|
|
141
|
+
end_time: number;
|
|
142
|
+
first_block_time: number;
|
|
143
|
+
last_block_time: number;
|
|
144
|
+
block_count: number;
|
|
145
|
+
tx_count: number;
|
|
146
|
+
output: string;
|
|
147
|
+
fees: string;
|
|
148
|
+
active_stake: string | null;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Metadata Label Transaction Data Structure Type - Transaction metadata under a specific label
|
|
152
|
+
*/
|
|
153
|
+
export interface MetadataLabelTx {
|
|
154
|
+
txHash: Hex;
|
|
155
|
+
label: number | string;
|
|
156
|
+
json?: JSONValue;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Account Data Structure Type - Stake account information
|
|
160
|
+
*/
|
|
161
|
+
export interface AccountData {
|
|
162
|
+
stakeaddress: string;
|
|
163
|
+
active: boolean;
|
|
164
|
+
activeEpoch: number;
|
|
165
|
+
controlledAmount: string;
|
|
166
|
+
rewardsSum: string;
|
|
167
|
+
withdrawalsSum: string;
|
|
168
|
+
reservesSum: string;
|
|
169
|
+
treasurySum: string;
|
|
170
|
+
withdrawableAmount: string;
|
|
171
|
+
poolId: string | null;
|
|
172
|
+
drepId: string | null;
|
|
173
|
+
addresses: Address[];
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Pool Data Structure Type - Pool information
|
|
177
|
+
*/
|
|
178
|
+
export interface PoolData {
|
|
179
|
+
poolId: string;
|
|
180
|
+
vrfKeyHash: string;
|
|
181
|
+
blocksMinted: number;
|
|
182
|
+
blocksEpoch: number;
|
|
183
|
+
liveStake: string;
|
|
184
|
+
liveSize: number;
|
|
185
|
+
liveSaturation: number;
|
|
186
|
+
liveDelegators: number;
|
|
187
|
+
activeStake: string;
|
|
188
|
+
activeSize: number;
|
|
189
|
+
pledge: string;
|
|
190
|
+
margin: number;
|
|
191
|
+
fixedCost: string;
|
|
192
|
+
rewardAccount: string;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Drep Data Structure Type - Drep information
|
|
196
|
+
*/
|
|
197
|
+
export interface DrepData {
|
|
198
|
+
drepId: string;
|
|
199
|
+
hex: string;
|
|
200
|
+
amount: string;
|
|
201
|
+
hasScript: boolean;
|
|
202
|
+
lastActiveEpoch: number;
|
|
203
|
+
retired: boolean;
|
|
204
|
+
expired: boolean;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Asset Info Data Structure Type - Normalized native-asset metadata + supply.
|
|
208
|
+
* Backends provide overlapping but non-identical fields; the mapper produces
|
|
209
|
+
* this canonical shape. Fields that one backend doesn't expose are null.
|
|
210
|
+
*/
|
|
211
|
+
export interface AssetInfo {
|
|
212
|
+
unit: string;
|
|
213
|
+
policyId: string;
|
|
214
|
+
assetNameHex: string;
|
|
215
|
+
assetName: string | null;
|
|
216
|
+
fingerprint: string;
|
|
217
|
+
totalSupply: string;
|
|
218
|
+
mintOrBurnCount: number;
|
|
219
|
+
initialMintTxHash: string | null;
|
|
220
|
+
initialMintTime: number | null;
|
|
221
|
+
onchainMetadata: JSONValue | null;
|
|
222
|
+
registryName: string | null;
|
|
223
|
+
registryTicker: string | null;
|
|
224
|
+
registryDecimals: number | null;
|
|
225
|
+
registryDescription: string | null;
|
|
226
|
+
registryUrl: string | null;
|
|
227
|
+
registryLogo: string | null;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Asset History Entry - single mint or burn event.
|
|
231
|
+
* `quantity` is always the ABSOLUTE amount; sign info lives in `action`.
|
|
232
|
+
*/
|
|
233
|
+
export interface AssetHistoryEntry {
|
|
234
|
+
unit: string;
|
|
235
|
+
txHash: string;
|
|
236
|
+
action: 'mint' | 'burn';
|
|
237
|
+
quantity: string;
|
|
238
|
+
blockTime: number | null;
|
|
239
|
+
blockHeight: number | null;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Ledger Protocol Parameters Data Structure Type - Current protocol parameters
|
|
243
|
+
*/
|
|
244
|
+
export type LedgerProtocolParameters = {
|
|
245
|
+
network: string;
|
|
246
|
+
epoch: number;
|
|
247
|
+
minFeeA: number;
|
|
248
|
+
minFeeB: number;
|
|
249
|
+
maxBlockSize: number;
|
|
250
|
+
maxTxSize: number;
|
|
251
|
+
maxBlockHeaderSize: number;
|
|
252
|
+
keyDeposit: string;
|
|
253
|
+
poolDeposit: string;
|
|
254
|
+
eMax: number;
|
|
255
|
+
nOpt: number;
|
|
256
|
+
a0: number;
|
|
257
|
+
rho: number;
|
|
258
|
+
tau: number;
|
|
259
|
+
minPoolCost: string;
|
|
260
|
+
decentralisationParam: number;
|
|
261
|
+
extraEntropy: string | null;
|
|
262
|
+
protocolMajorVer: number;
|
|
263
|
+
protocolMinorVer: number;
|
|
264
|
+
minUtxo: string;
|
|
265
|
+
nonce: string;
|
|
266
|
+
costModels: string;
|
|
267
|
+
priceMem: number | null;
|
|
268
|
+
priceStep: number | null;
|
|
269
|
+
maxTxExMem: string | null;
|
|
270
|
+
maxTxExSteps: string | null;
|
|
271
|
+
maxBlockExMem: string | null;
|
|
272
|
+
maxBlockExSteps: string | null;
|
|
273
|
+
maxValSize: string | null;
|
|
274
|
+
collateralPercent: number | null;
|
|
275
|
+
maxCollateralInputs: number | null;
|
|
276
|
+
coinsPerUtxoSize: string | null;
|
|
277
|
+
fetchedAt: string;
|
|
278
|
+
source: string;
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* Mint/Burn Asset Action Type
|
|
282
|
+
*/
|
|
283
|
+
export type MintAction = {
|
|
284
|
+
/** Asset unit to mint/burn (policyId + assetName) */
|
|
285
|
+
assetUnit: string;
|
|
286
|
+
/** Quantity to mint (positive) or burn (negative) */
|
|
287
|
+
quantity: bigint;
|
|
288
|
+
/** Optional redeemer data (integer). Defaults to 0 if not specified. */
|
|
289
|
+
redeemer?: number;
|
|
290
|
+
};
|
|
291
|
+
/**
|
|
292
|
+
* Plutus Script Execution Type - For spending from script addresses
|
|
293
|
+
*/
|
|
294
|
+
export type PlutusScriptExecution = {
|
|
295
|
+
/** Validator script (CBOR hex) */
|
|
296
|
+
validatorScript: string;
|
|
297
|
+
/** The UTxO at the script address to consume */
|
|
298
|
+
scriptUtxo: {
|
|
299
|
+
txHash: string;
|
|
300
|
+
outputIndex: number;
|
|
301
|
+
};
|
|
302
|
+
/** Redeemer data (JSON value that will be converted to PlutusData) */
|
|
303
|
+
redeemer: JSONValue;
|
|
304
|
+
/** Datum data (JSON value, optional - required for hash-based datums) */
|
|
305
|
+
datum?: JSONValue;
|
|
306
|
+
};
|
|
307
|
+
/**
|
|
308
|
+
* Transaction Build Request Type - Parameters for building a transaction, including optional minting and Plutus execution details
|
|
309
|
+
*/
|
|
310
|
+
export type TxBuildRequest = {
|
|
311
|
+
network: 'mainnet' | 'preprod' | 'preview';
|
|
312
|
+
senderAddress: string;
|
|
313
|
+
recipientAddress: string;
|
|
314
|
+
lovelaceAmount: string;
|
|
315
|
+
changeAddress?: string;
|
|
316
|
+
metadataJson?: JSONValue;
|
|
317
|
+
/** Multi-asset amounts to send (optional) */
|
|
318
|
+
assets?: Amount[];
|
|
319
|
+
/** Mint/Burn actions (optional) */
|
|
320
|
+
mintActions?: MintAction[];
|
|
321
|
+
/** Minting policy script (CBOR hex, required if mintActions specified) */
|
|
322
|
+
mintingPolicyScript?: string;
|
|
323
|
+
/** Plutus script execution (optional) - for spending from script addresses */
|
|
324
|
+
plutusScriptExecution?: PlutusScriptExecution;
|
|
325
|
+
/** Inline datum to attach to the recipient output (optional) - for locking at script addresses */
|
|
326
|
+
outputDatum?: JSONValue;
|
|
327
|
+
/** Required signers - Ed25519 key hashes (hex, 28 bytes each) */
|
|
328
|
+
requiredSigners?: string[];
|
|
329
|
+
/** Script parameters — PlutusData JSON array applied to script before building */
|
|
330
|
+
scriptParams?: JSONValue[];
|
|
331
|
+
/** Optional inline datum for minted token output (PlutusData JSON, parsed) */
|
|
332
|
+
inlineDatum?: JSONValue;
|
|
333
|
+
/** Optional custom redeemer for the minting policy (PlutusData JSON, parsed) */
|
|
334
|
+
mintRedeemer?: JSONValue;
|
|
335
|
+
/** When true, route output to enterprise script address derived from applied script hash */
|
|
336
|
+
lockOnScript?: boolean;
|
|
337
|
+
/**
|
|
338
|
+
* Optional UTxOs that MUST be consumed as inputs. Resolved and added to the TxBuilder
|
|
339
|
+
* BEFORE coin selection runs. Coin selection then only covers the remaining shortfall.
|
|
340
|
+
* Deduplicated against plutusScriptExecution.scriptUtxo in spend transactions.
|
|
341
|
+
* Primary use case: one-shot minting seeds (policy parameterized with a specific TxOutRef).
|
|
342
|
+
*/
|
|
343
|
+
forceInputs?: Array<{
|
|
344
|
+
txHash: string;
|
|
345
|
+
outputIndex: number;
|
|
346
|
+
}>;
|
|
347
|
+
/**
|
|
348
|
+
* Optional CIP-31 reference inputs (read-only, not consumed). Resolved to full UTxOs
|
|
349
|
+
* and passed as readonlyRefInputs to Buildooor. The validator can read these UTxOs'
|
|
350
|
+
* datums/values without consuming them (e.g., oracle feeds, shared config).
|
|
351
|
+
*/
|
|
352
|
+
referenceInputs?: Array<{
|
|
353
|
+
txHash: string;
|
|
354
|
+
outputIndex: number;
|
|
355
|
+
}>;
|
|
356
|
+
/**
|
|
357
|
+
* Optional additional outputs appended after the primary recipient output, before change.
|
|
358
|
+
* Each extra output is independently min-ADA checked. Used for multi-output state-machine
|
|
359
|
+
* transitions (e.g. counter update + batch NFT outputs in a single transaction).
|
|
360
|
+
*/
|
|
361
|
+
extraOutputs?: Array<{
|
|
362
|
+
address: string;
|
|
363
|
+
lovelaceAmount: string;
|
|
364
|
+
assets?: Array<{
|
|
365
|
+
unit: string;
|
|
366
|
+
quantity: string;
|
|
367
|
+
}>;
|
|
368
|
+
inlineDatum?: JSONValue;
|
|
369
|
+
referenceScript?: string;
|
|
370
|
+
}>;
|
|
371
|
+
/**
|
|
372
|
+
* Optional Plutus V3 validator CBOR hex to attach as a referenceScript on the primary
|
|
373
|
+
* recipient output (CIP-33). Adding a ref script significantly increases the output's
|
|
374
|
+
* min-ADA — consumers must provide enough lovelaceAmount to cover it.
|
|
375
|
+
*/
|
|
376
|
+
referenceScript?: string;
|
|
377
|
+
/**
|
|
378
|
+
* Optional validity-interval start in Posix milliseconds. Sets `invalidBefore`
|
|
379
|
+
* on the built transaction so that Plutus validators checking
|
|
380
|
+
* `expect Finite(lower) = tx.validity_range.lower_bound.bound_type` see a finite bound.
|
|
381
|
+
* Defaults inside the builder to `Date.now() - 120_000` (script builds only).
|
|
382
|
+
*/
|
|
383
|
+
validityStartMs?: string;
|
|
384
|
+
/**
|
|
385
|
+
* Optional validity-interval end in Posix milliseconds. Sets `invalidAfter` (ledger TTL).
|
|
386
|
+
* Defaults inside the builder to `Date.now() + 3_600_000` (script builds only).
|
|
387
|
+
*/
|
|
388
|
+
validityEndMs?: string;
|
|
389
|
+
};
|
|
390
|
+
/**
|
|
391
|
+
* Transaction Build Request for Mint/Burn operations - requires mintActions and mintingPolicyScript
|
|
392
|
+
*/
|
|
393
|
+
export type TxBuildMintRequest = TxBuildRequest & {
|
|
394
|
+
mintActions: MintAction[];
|
|
395
|
+
mintingPolicyScript: string;
|
|
396
|
+
};
|
|
397
|
+
/**
|
|
398
|
+
* Transaction Build Request for Plutus spending - requires plutusScriptExecution
|
|
399
|
+
*/
|
|
400
|
+
export type TxBuildPlutusSpendRequest = TxBuildRequest & {
|
|
401
|
+
plutusScriptExecution: PlutusScriptExecution;
|
|
402
|
+
};
|
|
403
|
+
/**
|
|
404
|
+
* Execution Budget for Plutus scripts
|
|
405
|
+
*/
|
|
406
|
+
export type ExecutionBudget = {
|
|
407
|
+
memory: number;
|
|
408
|
+
cpu: number;
|
|
409
|
+
};
|
|
410
|
+
/**
|
|
411
|
+
* Script evaluation result from Ogmios
|
|
412
|
+
*/
|
|
413
|
+
/**
|
|
414
|
+
* Ogmios validator descriptor — `purpose:index` (e.g., "spend:0", "mint:1")
|
|
415
|
+
* or a structured object with purpose + index fields depending on Ogmios version.
|
|
416
|
+
*/
|
|
417
|
+
export type ScriptValidator = string | {
|
|
418
|
+
purpose: string;
|
|
419
|
+
index: number;
|
|
420
|
+
};
|
|
421
|
+
export type ScriptEvaluationResult = {
|
|
422
|
+
validator: ScriptValidator;
|
|
423
|
+
budget: ExecutionBudget;
|
|
424
|
+
};
|
|
425
|
+
/**
|
|
426
|
+
* Transaction evaluator function type - evaluates script execution units
|
|
427
|
+
*/
|
|
428
|
+
export type TxEvaluator = (unsignedTxCbor: string) => Promise<ScriptEvaluationResult[]>;
|
|
429
|
+
/**
|
|
430
|
+
* Transaction Build Context Type - Context for building a transaction
|
|
431
|
+
*/
|
|
432
|
+
export type TxBuildContext = {
|
|
433
|
+
utxos: UTxO[];
|
|
434
|
+
protocolParameters: LedgerProtocolParameter;
|
|
435
|
+
/** Optional evaluator for dynamic script execution unit calculation (requires Ogmios) */
|
|
436
|
+
evaluateTransaction?: TxEvaluator;
|
|
437
|
+
/** CIP-31 reference input UTxOs (read-only, not consumed). Resolved from referenceInputs refs. */
|
|
438
|
+
referenceInputUtxos?: UTxO[];
|
|
439
|
+
};
|
|
440
|
+
/**
|
|
441
|
+
* Transaction Build Result Type
|
|
442
|
+
*/
|
|
443
|
+
export type TxBuildResult = {
|
|
444
|
+
senderAddress?: string;
|
|
445
|
+
network?: 'mainnet' | 'preprod' | 'preview';
|
|
446
|
+
builderEngine?: string;
|
|
447
|
+
unsignedTxCbor: string;
|
|
448
|
+
txBodyHash: string;
|
|
449
|
+
feeLovelace: string;
|
|
450
|
+
sizeBytes?: number;
|
|
451
|
+
inputs: Array<{
|
|
452
|
+
txHash: string;
|
|
453
|
+
index: number;
|
|
454
|
+
lovelace: string;
|
|
455
|
+
}>;
|
|
456
|
+
outputs: Array<{
|
|
457
|
+
address: string;
|
|
458
|
+
lovelace: string;
|
|
459
|
+
}>;
|
|
460
|
+
metaDataCborHex?: string;
|
|
461
|
+
changeOutput?: {
|
|
462
|
+
address: string;
|
|
463
|
+
lovelace: string;
|
|
464
|
+
};
|
|
465
|
+
warnings: string[];
|
|
466
|
+
/** Blake2b-224 hash of the script (= policy ID for minting), if a script was provided */
|
|
467
|
+
scriptHash?: string;
|
|
468
|
+
/** Blake2b-224 hash of the minting policy script (= policy ID), set in combined spend+mint transactions. */
|
|
469
|
+
mintScriptHash?: string;
|
|
470
|
+
/** Enterprise script address derived from applied script hash (bech32). Set when lockOnScript=true. */
|
|
471
|
+
scriptAddress?: string;
|
|
472
|
+
/** Number of forced inputs actually included in the built transaction (0 if forceInputs was not used). */
|
|
473
|
+
forcedInputsUsed?: number;
|
|
474
|
+
/** Number of CIP-31 reference inputs included in the built transaction (0 if referenceInputs was not used). */
|
|
475
|
+
referenceInputsUsed?: number;
|
|
476
|
+
};
|
|
477
|
+
/**
|
|
478
|
+
* Supported external signer types
|
|
479
|
+
*/
|
|
480
|
+
export declare enum ExternalSignerType {
|
|
481
|
+
/** Cardano CLI - Reference implementation for signing */
|
|
482
|
+
CARDANO_CLI = "cardano-cli",
|
|
483
|
+
/** Browser wallets (Nami, Eternl, Flint, etc.) */
|
|
484
|
+
BROWSER_WALLET = "browser-wallet",
|
|
485
|
+
/** Hardware wallets (Ledger, Trezor) */
|
|
486
|
+
HARDWARE_WALLET = "hardware-wallet",
|
|
487
|
+
/** Custom/Unknown signer */
|
|
488
|
+
CUSTOM = "custom",
|
|
489
|
+
/** Hardware Security Module (server-side PKCS#11) */
|
|
490
|
+
HSM = "hsm"
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Signing request status
|
|
494
|
+
*/
|
|
495
|
+
export declare enum SigningStatus {
|
|
496
|
+
/** Request created, awaiting signing */
|
|
497
|
+
PENDING = "pending",
|
|
498
|
+
/** Transaction has been signed */
|
|
499
|
+
SIGNED = "signed",
|
|
500
|
+
/** Signature verified, ready for submission */
|
|
501
|
+
VERIFIED = "verified",
|
|
502
|
+
/** Transaction submitted to network */
|
|
503
|
+
SUBMITTED = "submitted",
|
|
504
|
+
/** Signing or verification failed */
|
|
505
|
+
FAILED = "failed",
|
|
506
|
+
/** Request expired (not signed within TTL) */
|
|
507
|
+
EXPIRED = "expired"
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Instructions for external signers
|
|
511
|
+
*/
|
|
512
|
+
export interface SigningInstructions {
|
|
513
|
+
/** Signer type hint (which tool/wallet to use) */
|
|
514
|
+
signerTypeHint: ExternalSignerType;
|
|
515
|
+
/** Human-readable message to display */
|
|
516
|
+
message: string;
|
|
517
|
+
/** Cardano network */
|
|
518
|
+
network: string;
|
|
519
|
+
/** CIP-30 signing request format (for browser wallets) */
|
|
520
|
+
cip30SigningRequest?: {
|
|
521
|
+
/** Transaction CBOR to sign */
|
|
522
|
+
txCbor: string;
|
|
523
|
+
/** Whether to include partial witnesses */
|
|
524
|
+
partialSign: boolean;
|
|
525
|
+
};
|
|
526
|
+
/** Copy-pasteable cardano-cli signing recipe (for CLI/hardware signers) */
|
|
527
|
+
cardanoCliCommand?: string;
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Unsigned transaction export payload for external signers
|
|
531
|
+
*
|
|
532
|
+
* This is the standardized format returned by BuildTransaction actions.
|
|
533
|
+
* External signers use this payload to sign the transaction.
|
|
534
|
+
*/
|
|
535
|
+
export interface UnsignedTxExportPayload {
|
|
536
|
+
/** Unique identifier for this signing request */
|
|
537
|
+
signingRequestId: string;
|
|
538
|
+
/** Deterministic reference ID linking to the build */
|
|
539
|
+
buildId: string;
|
|
540
|
+
/** Transaction body hash (the data to be signed) */
|
|
541
|
+
txBodyHash: string;
|
|
542
|
+
/** Unsigned transaction CBOR in hex format */
|
|
543
|
+
unsignedTxCbor: string;
|
|
544
|
+
/** Cardano network (mainnet | preprod | preview) */
|
|
545
|
+
network: string;
|
|
546
|
+
/** Timestamp when the request was created (ISO 8601) */
|
|
547
|
+
createdAt: string;
|
|
548
|
+
/** Timestamp when the request expires (ISO 8601) */
|
|
549
|
+
expiresAt: string;
|
|
550
|
+
/** Required signers (public key hashes) if known */
|
|
551
|
+
requiredSigners?: string[];
|
|
552
|
+
/** Signing instructions for the external signer */
|
|
553
|
+
signingInstructions: SigningInstructions;
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Signed transaction submission payload
|
|
557
|
+
*/
|
|
558
|
+
export interface SignedTxPayload {
|
|
559
|
+
/** Original signing request ID */
|
|
560
|
+
signingRequestId: string;
|
|
561
|
+
/** Build ID from the original build */
|
|
562
|
+
buildId: string;
|
|
563
|
+
/** Signed transaction CBOR */
|
|
564
|
+
signedTxCbor: string;
|
|
565
|
+
/** Signer type used */
|
|
566
|
+
signerType: ExternalSignerType;
|
|
567
|
+
/** Optional: Signer identification (wallet name, etc.) */
|
|
568
|
+
signerInfo?: string;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Signing workflow state
|
|
572
|
+
*/
|
|
573
|
+
export interface SigningWorkflowState {
|
|
574
|
+
/** Current status of the signing workflow */
|
|
575
|
+
status: SigningStatus;
|
|
576
|
+
/** Signing request details */
|
|
577
|
+
request: UnsignedTxExportPayload;
|
|
578
|
+
/** Signed transaction (if available) */
|
|
579
|
+
signedTxCbor?: string;
|
|
580
|
+
/** Verification result (if verified) */
|
|
581
|
+
verificationResult?: SignatureVerificationResult;
|
|
582
|
+
/** Transaction hash after submission */
|
|
583
|
+
txHash?: string;
|
|
584
|
+
/** Error message if failed */
|
|
585
|
+
errorMessage?: string;
|
|
586
|
+
/** Timestamps for tracking */
|
|
587
|
+
timestamps: {
|
|
588
|
+
created: string;
|
|
589
|
+
signed?: string;
|
|
590
|
+
verified?: string;
|
|
591
|
+
submitted?: string;
|
|
592
|
+
failed?: string;
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* Result of signature verification
|
|
597
|
+
*/
|
|
598
|
+
export interface SignatureVerificationResult {
|
|
599
|
+
/** Whether the signature is valid */
|
|
600
|
+
isValid: boolean;
|
|
601
|
+
/** Transaction body hash from the signed transaction */
|
|
602
|
+
txBodyHash: string;
|
|
603
|
+
/** Number of witnesses (signatures) found */
|
|
604
|
+
witnessCount: number;
|
|
605
|
+
/** List of public key hashes that signed the transaction */
|
|
606
|
+
signerKeyHashes: string[];
|
|
607
|
+
/** Any warnings during verification */
|
|
608
|
+
warnings: string[];
|
|
609
|
+
/** Error message if verification failed */
|
|
610
|
+
errorMessage?: string;
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Options for signature verification
|
|
614
|
+
*/
|
|
615
|
+
export interface VerificationOptions {
|
|
616
|
+
/** Expected transaction body hash (from the build) */
|
|
617
|
+
expectedTxBodyHash?: string;
|
|
618
|
+
/** Whether to require at least one signature */
|
|
619
|
+
requireSignature?: boolean;
|
|
620
|
+
/** List of required signer key hashes (public key hashes) */
|
|
621
|
+
requiredSigners?: string[];
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* HSM Configuration for PKCS#11 integration
|
|
625
|
+
*/
|
|
626
|
+
export interface HsmConfig {
|
|
627
|
+
/** Whether HSM signing is enabled */
|
|
628
|
+
enabled: boolean;
|
|
629
|
+
/** Path to the PKCS#11 shared library (.so/.dll) */
|
|
630
|
+
pkcs11Module: string;
|
|
631
|
+
/** PKCS#11 slot index */
|
|
632
|
+
slot: number;
|
|
633
|
+
/** PKCS#11 user PIN */
|
|
634
|
+
pin: string;
|
|
635
|
+
/** Key identifier (hex string, e.g., "0x0001") */
|
|
636
|
+
keyId?: string;
|
|
637
|
+
/** Key label for CKA_LABEL lookup */
|
|
638
|
+
keyLabel?: string;
|
|
639
|
+
/** Optional CDS role required for HSM actions (SignWithHsm, SignAndSubmitWithHsm, GetHsmStatus). When set, only users with this role can invoke HSM operations. */
|
|
640
|
+
requiresRole?: string;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* HSM signing result
|
|
644
|
+
*/
|
|
645
|
+
export interface HsmSignResult {
|
|
646
|
+
/** Ed25519 signature (64 bytes, hex) */
|
|
647
|
+
signatureHex: string;
|
|
648
|
+
/** Ed25519 public key (32 bytes, hex) */
|
|
649
|
+
publicKeyHex: string;
|
|
650
|
+
/** Public key hash (blake2b-224, 28 bytes, hex) */
|
|
651
|
+
publicKeyHash: string;
|
|
652
|
+
}
|
|
653
|
+
//# sourceMappingURL=types.d.ts.map
|