@anastasia-labs/cardano-multiplatform-lib-nodejs 6.0.1-2 → 6.0.2-1
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/cardano_multiplatform_lib.d.ts +304 -285
- package/cardano_multiplatform_lib.js +432 -412
- package/cardano_multiplatform_lib_bg.wasm +0 -0
- package/package.json +1 -1
|
@@ -17,18 +17,6 @@ export function emip3_encrypt_with_password(password: string, salt: string, nonc
|
|
|
17
17
|
*/
|
|
18
18
|
export function emip3_decrypt_with_password(password: string, data: string): string;
|
|
19
19
|
/**
|
|
20
|
-
* encodes arbitrary bytes into chunks of 64 bytes (the limit for bytes) as a list to be valid Metadata
|
|
21
|
-
* @param {Uint8Array} bytes
|
|
22
|
-
* @returns {TransactionMetadatum}
|
|
23
|
-
*/
|
|
24
|
-
export function encode_arbitrary_bytes_as_metadatum(bytes: Uint8Array): TransactionMetadatum;
|
|
25
|
-
/**
|
|
26
|
-
* decodes from chunks of bytes in a list to a byte vector if that is the metadata format, otherwise returns None
|
|
27
|
-
* @param {TransactionMetadatum} metadata
|
|
28
|
-
* @returns {Uint8Array | undefined}
|
|
29
|
-
*/
|
|
30
|
-
export function decode_arbitrary_bytes_from_metadatum(metadata: TransactionMetadatum): Uint8Array | undefined;
|
|
31
|
-
/**
|
|
32
20
|
* @param {AuxiliaryData} auxiliary_data
|
|
33
21
|
* @returns {AuxiliaryDataHash}
|
|
34
22
|
*/
|
|
@@ -104,33 +92,6 @@ export function get_implicit_input(txbody: TransactionBody, pool_deposit: bigint
|
|
|
104
92
|
*/
|
|
105
93
|
export function get_deposit(txbody: TransactionBody, pool_deposit: bigint, key_deposit: bigint): bigint;
|
|
106
94
|
/**
|
|
107
|
-
*
|
|
108
|
-
* * Min fee for JUST the script, NOT including ref inputs
|
|
109
|
-
*
|
|
110
|
-
* @param {Transaction} tx
|
|
111
|
-
* @param {ExUnitPrices} ex_unit_prices
|
|
112
|
-
* @returns {bigint}
|
|
113
|
-
*/
|
|
114
|
-
export function min_script_fee(tx: Transaction, ex_unit_prices: ExUnitPrices): bigint;
|
|
115
|
-
/**
|
|
116
|
-
* @param {Transaction} tx
|
|
117
|
-
* @param {LinearFee} linear_fee
|
|
118
|
-
* @returns {bigint}
|
|
119
|
-
*/
|
|
120
|
-
export function min_no_script_fee(tx: Transaction, linear_fee: LinearFee): bigint;
|
|
121
|
-
/**
|
|
122
|
-
*
|
|
123
|
-
* * Calculates the cost of all ref scripts
|
|
124
|
-
* * * `total_ref_script_size` - Total size (original, not hashes) of all ref scripts. Duplicate scripts are counted as many times as they occur
|
|
125
|
-
*
|
|
126
|
-
* @param {Transaction} tx
|
|
127
|
-
* @param {LinearFee} linear_fee
|
|
128
|
-
* @param {ExUnitPrices} ex_unit_prices
|
|
129
|
-
* @param {bigint} total_ref_script_size
|
|
130
|
-
* @returns {bigint}
|
|
131
|
-
*/
|
|
132
|
-
export function min_fee(tx: Transaction, linear_fee: LinearFee, ex_unit_prices: ExUnitPrices, total_ref_script_size: bigint): bigint;
|
|
133
|
-
/**
|
|
134
95
|
* Converts JSON to Metadata according to MetadataJsonSchema
|
|
135
96
|
* @param {string} json
|
|
136
97
|
* @param {MetadataJsonSchema} schema
|
|
@@ -145,11 +106,47 @@ export function encode_json_str_to_metadatum(json: string, schema: MetadataJsonS
|
|
|
145
106
|
*/
|
|
146
107
|
export function decode_metadatum_to_json_str(metadatum: TransactionMetadatum, schema: MetadataJsonSchema): string;
|
|
147
108
|
/**
|
|
109
|
+
* @param {string} json
|
|
110
|
+
* @param {CardanoNodePlutusDatumSchema} schema
|
|
111
|
+
* @returns {PlutusData}
|
|
112
|
+
*/
|
|
113
|
+
export function encode_json_str_to_plutus_datum(json: string, schema: CardanoNodePlutusDatumSchema): PlutusData;
|
|
114
|
+
/**
|
|
115
|
+
* @param {PlutusData} datum
|
|
116
|
+
* @param {CardanoNodePlutusDatumSchema} schema
|
|
117
|
+
* @returns {string}
|
|
118
|
+
*/
|
|
119
|
+
export function decode_plutus_datum_to_json_str(datum: PlutusData, schema: CardanoNodePlutusDatumSchema): string;
|
|
120
|
+
/**
|
|
121
|
+
* @param {TransactionOutput} output
|
|
122
|
+
* @param {bigint} coins_per_utxo_byte
|
|
123
|
+
* @returns {bigint}
|
|
124
|
+
*/
|
|
125
|
+
export function min_ada_required(output: TransactionOutput, coins_per_utxo_byte: bigint): bigint;
|
|
126
|
+
/**
|
|
148
127
|
* @param {Redeemers} redeemers
|
|
149
128
|
* @returns {ExUnits}
|
|
150
129
|
*/
|
|
151
130
|
export function compute_total_ex_units(redeemers: Redeemers): ExUnits;
|
|
152
131
|
/**
|
|
132
|
+
* encodes arbitrary bytes into chunks of 64 bytes (the limit for bytes) as a list to be valid Metadata
|
|
133
|
+
* @param {Uint8Array} bytes
|
|
134
|
+
* @returns {TransactionMetadatum}
|
|
135
|
+
*/
|
|
136
|
+
export function encode_arbitrary_bytes_as_metadatum(bytes: Uint8Array): TransactionMetadatum;
|
|
137
|
+
/**
|
|
138
|
+
* decodes from chunks of bytes in a list to a byte vector if that is the metadata format, otherwise returns None
|
|
139
|
+
* @param {TransactionMetadatum} metadata
|
|
140
|
+
* @returns {Uint8Array | undefined}
|
|
141
|
+
*/
|
|
142
|
+
export function decode_arbitrary_bytes_from_metadatum(metadata: TransactionMetadatum): Uint8Array | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* @param {TransactionHash} tx_body_hash
|
|
145
|
+
* @param {PrivateKey} sk
|
|
146
|
+
* @returns {Vkeywitness}
|
|
147
|
+
*/
|
|
148
|
+
export function make_vkey_witness(tx_body_hash: TransactionHash, sk: PrivateKey): Vkeywitness;
|
|
149
|
+
/**
|
|
153
150
|
* @param {TransactionHash} tx_body_hash
|
|
154
151
|
* @param {ByronAddress} addr
|
|
155
152
|
* @param {LegacyDaedalusPrivateKey} key
|
|
@@ -164,29 +161,45 @@ export function make_daedalus_bootstrap_witness(tx_body_hash: TransactionHash, a
|
|
|
164
161
|
*/
|
|
165
162
|
export function make_icarus_bootstrap_witness(tx_body_hash: TransactionHash, addr: ByronAddress, key: Bip32PrivateKey): BootstrapWitness;
|
|
166
163
|
/**
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
164
|
+
*
|
|
165
|
+
* * Min fee for JUST the script, NOT including ref inputs
|
|
166
|
+
*
|
|
167
|
+
* @param {Transaction} tx
|
|
168
|
+
* @param {ExUnitPrices} ex_unit_prices
|
|
169
|
+
* @returns {bigint}
|
|
170
170
|
*/
|
|
171
|
-
export function
|
|
171
|
+
export function min_script_fee(tx: Transaction, ex_unit_prices: ExUnitPrices): bigint;
|
|
172
172
|
/**
|
|
173
|
-
* @param {
|
|
174
|
-
* @param {
|
|
173
|
+
* @param {Transaction} tx
|
|
174
|
+
* @param {LinearFee} linear_fee
|
|
175
175
|
* @returns {bigint}
|
|
176
176
|
*/
|
|
177
|
-
export function
|
|
177
|
+
export function min_no_script_fee(tx: Transaction, linear_fee: LinearFee): bigint;
|
|
178
178
|
/**
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
179
|
+
*
|
|
180
|
+
* * Calculates the cost of all ref scripts
|
|
181
|
+
* * * `total_ref_script_size` - Total size (original, not hashes) of all ref scripts. Duplicate scripts are counted as many times as they occur
|
|
182
|
+
*
|
|
183
|
+
* @param {Transaction} tx
|
|
184
|
+
* @param {LinearFee} linear_fee
|
|
185
|
+
* @param {ExUnitPrices} ex_unit_prices
|
|
186
|
+
* @param {bigint} total_ref_script_size
|
|
187
|
+
* @returns {bigint}
|
|
182
188
|
*/
|
|
183
|
-
export function
|
|
189
|
+
export function min_fee(tx: Transaction, linear_fee: LinearFee, ex_unit_prices: ExUnitPrices, total_ref_script_size: bigint): bigint;
|
|
184
190
|
/**
|
|
185
|
-
* @param {PlutusData} datum
|
|
186
|
-
* @param {CardanoNodePlutusDatumSchema} schema
|
|
187
|
-
* @returns {string}
|
|
188
191
|
*/
|
|
189
|
-
export
|
|
192
|
+
export enum DelegationDistributionKind {
|
|
193
|
+
Weighted = 0,
|
|
194
|
+
Legacy = 1,
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
*/
|
|
198
|
+
export enum AuxiliaryDataKind {
|
|
199
|
+
Shelley = 0,
|
|
200
|
+
ShelleyMA = 1,
|
|
201
|
+
Conway = 2,
|
|
202
|
+
}
|
|
190
203
|
/**
|
|
191
204
|
*/
|
|
192
205
|
export enum ChunkableStringKind {
|
|
@@ -195,6 +208,27 @@ export enum ChunkableStringKind {
|
|
|
195
208
|
}
|
|
196
209
|
/**
|
|
197
210
|
*/
|
|
211
|
+
export enum CertificateKind {
|
|
212
|
+
StakeRegistration = 0,
|
|
213
|
+
StakeDeregistration = 1,
|
|
214
|
+
StakeDelegation = 2,
|
|
215
|
+
PoolRegistration = 3,
|
|
216
|
+
PoolRetirement = 4,
|
|
217
|
+
RegCert = 5,
|
|
218
|
+
UnregCert = 6,
|
|
219
|
+
VoteDelegCert = 7,
|
|
220
|
+
StakeVoteDelegCert = 8,
|
|
221
|
+
StakeRegDelegCert = 9,
|
|
222
|
+
VoteRegDelegCert = 10,
|
|
223
|
+
StakeVoteRegDelegCert = 11,
|
|
224
|
+
AuthCommitteeHotCert = 12,
|
|
225
|
+
ResignCommitteeColdCert = 13,
|
|
226
|
+
RegDrepCert = 14,
|
|
227
|
+
UnregDrepCert = 15,
|
|
228
|
+
UpdateDrepCert = 16,
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
*/
|
|
198
232
|
export enum ScriptKind {
|
|
199
233
|
Native = 0,
|
|
200
234
|
PlutusV1 = 1,
|
|
@@ -202,52 +236,13 @@ export enum ScriptKind {
|
|
|
202
236
|
PlutusV3 = 3,
|
|
203
237
|
}
|
|
204
238
|
/**
|
|
205
|
-
* Careful: this enum doesn't include the network ID part of the header
|
|
206
|
-
* ex: base address isn't 0b0000_0000 but instead 0b0000
|
|
207
|
-
* Use `header_matches_kind` if you don't want to implement the bitwise operators yourself
|
|
208
|
-
*/
|
|
209
|
-
export enum AddressHeaderKind {
|
|
210
|
-
BasePaymentKeyStakeKey = 0,
|
|
211
|
-
BasePaymentScriptStakeKey = 1,
|
|
212
|
-
BasePaymentKeyStakeScript = 2,
|
|
213
|
-
BasePaymentScriptStakeScript = 3,
|
|
214
|
-
PointerKey = 4,
|
|
215
|
-
PointerScript = 5,
|
|
216
|
-
EnterpriseKey = 6,
|
|
217
|
-
EnterpriseScript = 7,
|
|
218
|
-
Byron = 8,
|
|
219
|
-
RewardKey = 14,
|
|
220
|
-
RewardScript = 15,
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
*/
|
|
224
|
-
export enum RelayKind {
|
|
225
|
-
SingleHostAddr = 0,
|
|
226
|
-
SingleHostName = 1,
|
|
227
|
-
MultiHostName = 2,
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
239
|
*/
|
|
231
|
-
export enum
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
*/
|
|
239
|
-
export enum StakeDistributionKind {
|
|
240
|
-
SingleKey = 0,
|
|
241
|
-
BootstrapEra = 1,
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
*/
|
|
245
|
-
export enum VoterKind {
|
|
246
|
-
ConstitutionalCommitteeHotKeyHash = 0,
|
|
247
|
-
ConstitutionalCommitteeHotScriptHash = 1,
|
|
248
|
-
DRepKeyHash = 2,
|
|
249
|
-
DRepScriptHash = 3,
|
|
250
|
-
StakingPoolKeyHash = 4,
|
|
240
|
+
export enum AddressKind {
|
|
241
|
+
Base = 0,
|
|
242
|
+
Ptr = 1,
|
|
243
|
+
Enterprise = 2,
|
|
244
|
+
Reward = 3,
|
|
245
|
+
Byron = 4,
|
|
251
246
|
}
|
|
252
247
|
/**
|
|
253
248
|
* Which version of the CIP25 spec to use. See CIP25 for details.
|
|
@@ -266,165 +261,48 @@ export enum CIP25Version {
|
|
|
266
261
|
}
|
|
267
262
|
/**
|
|
268
263
|
*/
|
|
269
|
-
export enum NonceKind {
|
|
270
|
-
Identity = 0,
|
|
271
|
-
Hash = 1,
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
*/
|
|
275
|
-
export enum MetadataJsonSchema {
|
|
276
|
-
NoConversions = 0,
|
|
277
|
-
BasicConversions = 1,
|
|
278
|
-
DetailedSchema = 2,
|
|
279
|
-
}
|
|
280
|
-
/**
|
|
281
|
-
*/
|
|
282
|
-
export enum AuxiliaryDataKind {
|
|
283
|
-
Shelley = 0,
|
|
284
|
-
ShelleyMA = 1,
|
|
285
|
-
Conway = 2,
|
|
286
|
-
}
|
|
287
|
-
/**
|
|
288
|
-
*/
|
|
289
|
-
export enum CredentialKind {
|
|
290
|
-
PubKey = 0,
|
|
291
|
-
Script = 1,
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
*/
|
|
295
|
-
export enum ChangeSelectionAlgo {
|
|
296
|
-
Default = 0,
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
*/
|
|
300
|
-
export enum Vote {
|
|
301
|
-
No = 0,
|
|
302
|
-
Yes = 1,
|
|
303
|
-
Abstain = 2,
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
*/
|
|
307
264
|
export enum DatumOptionKind {
|
|
308
265
|
Hash = 0,
|
|
309
266
|
Datum = 1,
|
|
310
267
|
}
|
|
311
268
|
/**
|
|
312
269
|
*/
|
|
313
|
-
export enum DelegationDistributionKind {
|
|
314
|
-
Weighted = 0,
|
|
315
|
-
Legacy = 1,
|
|
316
|
-
}
|
|
317
|
-
/**
|
|
318
|
-
*/
|
|
319
270
|
export enum TransactionOutputKind {
|
|
320
271
|
AlonzoFormatTxOut = 0,
|
|
321
272
|
ConwayFormatTxOut = 1,
|
|
322
273
|
}
|
|
323
274
|
/**
|
|
324
275
|
*/
|
|
325
|
-
export enum
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
Reward = 3,
|
|
330
|
-
Voting = 4,
|
|
331
|
-
Proposing = 5,
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
*/
|
|
335
|
-
export enum Language {
|
|
336
|
-
PlutusV1 = 0,
|
|
337
|
-
PlutusV2 = 1,
|
|
338
|
-
PlutusV3 = 2,
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
*/
|
|
342
|
-
export enum SpendingDataKind {
|
|
343
|
-
SpendingDataPubKey = 0,
|
|
344
|
-
SpendingDataScript = 1,
|
|
345
|
-
SpendingDataRedeem = 2,
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
*/
|
|
349
|
-
export enum GovActionKind {
|
|
350
|
-
ParameterChangeAction = 0,
|
|
351
|
-
HardForkInitiationAction = 1,
|
|
352
|
-
TreasuryWithdrawalsAction = 2,
|
|
353
|
-
NoConfidence = 3,
|
|
354
|
-
UpdateCommittee = 4,
|
|
355
|
-
NewConstitution = 5,
|
|
356
|
-
InfoAction = 6,
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
*/
|
|
360
|
-
export enum RedeemersKind {
|
|
361
|
-
ArrLegacyRedeemer = 0,
|
|
362
|
-
MapRedeemerKeyToRedeemerVal = 1,
|
|
363
|
-
}
|
|
364
|
-
/**
|
|
365
|
-
*/
|
|
366
|
-
export enum AddressKind {
|
|
367
|
-
Base = 0,
|
|
368
|
-
Ptr = 1,
|
|
369
|
-
Enterprise = 2,
|
|
370
|
-
Reward = 3,
|
|
371
|
-
Byron = 4,
|
|
372
|
-
}
|
|
373
|
-
/**
|
|
374
|
-
*/
|
|
375
|
-
export enum ByronAddrType {
|
|
376
|
-
PublicKey = 0,
|
|
377
|
-
Script = 1,
|
|
378
|
-
Redeem = 2,
|
|
379
|
-
}
|
|
380
|
-
/**
|
|
381
|
-
*/
|
|
382
|
-
export enum NativeScriptKind {
|
|
383
|
-
ScriptPubkey = 0,
|
|
384
|
-
ScriptAll = 1,
|
|
385
|
-
ScriptAny = 2,
|
|
386
|
-
ScriptNOfK = 3,
|
|
387
|
-
ScriptInvalidBefore = 4,
|
|
388
|
-
ScriptInvalidHereafter = 5,
|
|
389
|
-
}
|
|
390
|
-
/**
|
|
391
|
-
*/
|
|
392
|
-
export enum CertificateKind {
|
|
393
|
-
StakeRegistration = 0,
|
|
394
|
-
StakeDeregistration = 1,
|
|
395
|
-
StakeDelegation = 2,
|
|
396
|
-
PoolRegistration = 3,
|
|
397
|
-
PoolRetirement = 4,
|
|
398
|
-
RegCert = 5,
|
|
399
|
-
UnregCert = 6,
|
|
400
|
-
VoteDelegCert = 7,
|
|
401
|
-
StakeVoteDelegCert = 8,
|
|
402
|
-
StakeRegDelegCert = 9,
|
|
403
|
-
VoteRegDelegCert = 10,
|
|
404
|
-
StakeVoteRegDelegCert = 11,
|
|
405
|
-
AuthCommitteeHotCert = 12,
|
|
406
|
-
ResignCommitteeColdCert = 13,
|
|
407
|
-
RegDrepCert = 14,
|
|
408
|
-
UnregDrepCert = 15,
|
|
409
|
-
UpdateDrepCert = 16,
|
|
276
|
+
export enum MetadataJsonSchema {
|
|
277
|
+
NoConversions = 0,
|
|
278
|
+
BasicConversions = 1,
|
|
279
|
+
DetailedSchema = 2,
|
|
410
280
|
}
|
|
411
281
|
/**
|
|
412
282
|
*/
|
|
413
|
-
export enum
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
Integer = 3,
|
|
418
|
-
Bytes = 4,
|
|
283
|
+
export enum RelayKind {
|
|
284
|
+
SingleHostAddr = 0,
|
|
285
|
+
SingleHostName = 1,
|
|
286
|
+
MultiHostName = 2,
|
|
419
287
|
}
|
|
420
288
|
/**
|
|
421
289
|
*/
|
|
422
|
-
export enum
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
290
|
+
export enum DRepKind {
|
|
291
|
+
Key = 0,
|
|
292
|
+
Script = 1,
|
|
293
|
+
AlwaysAbstain = 2,
|
|
294
|
+
AlwaysNoConfidence = 3,
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
*/
|
|
298
|
+
export enum StakeDistributionKind {
|
|
299
|
+
SingleKey = 0,
|
|
300
|
+
BootstrapEra = 1,
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
*/
|
|
304
|
+
export enum ChangeSelectionAlgo {
|
|
305
|
+
Default = 0,
|
|
428
306
|
}
|
|
429
307
|
/**
|
|
430
308
|
*/
|
|
@@ -447,6 +325,45 @@ export enum CoinSelectionStrategyCIP2 {
|
|
|
447
325
|
RandomImproveMultiAsset = 3,
|
|
448
326
|
}
|
|
449
327
|
/**
|
|
328
|
+
*/
|
|
329
|
+
export enum ByronAddrType {
|
|
330
|
+
PublicKey = 0,
|
|
331
|
+
Script = 1,
|
|
332
|
+
Redeem = 2,
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
*/
|
|
336
|
+
export enum RedeemerTag {
|
|
337
|
+
Spend = 0,
|
|
338
|
+
Mint = 1,
|
|
339
|
+
Cert = 2,
|
|
340
|
+
Reward = 3,
|
|
341
|
+
Voting = 4,
|
|
342
|
+
Proposing = 5,
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
*/
|
|
346
|
+
export enum VoterKind {
|
|
347
|
+
ConstitutionalCommitteeHotKeyHash = 0,
|
|
348
|
+
ConstitutionalCommitteeHotScriptHash = 1,
|
|
349
|
+
DRepKeyHash = 2,
|
|
350
|
+
DRepScriptHash = 3,
|
|
351
|
+
StakingPoolKeyHash = 4,
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
*/
|
|
355
|
+
export enum RedeemersKind {
|
|
356
|
+
ArrLegacyRedeemer = 0,
|
|
357
|
+
MapRedeemerKeyToRedeemerVal = 1,
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
*/
|
|
361
|
+
export enum SpendingDataKind {
|
|
362
|
+
SpendingDataPubKey = 0,
|
|
363
|
+
SpendingDataScript = 1,
|
|
364
|
+
SpendingDataRedeem = 2,
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
450
367
|
* JSON <-> PlutusData conversion schemas.
|
|
451
368
|
* Follows ScriptDataJsonSchema in cardano-cli defined at:
|
|
452
369
|
* https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/ScriptData.hs#L254
|
|
@@ -500,6 +417,89 @@ export enum CardanoNodePlutusDatumSchema {
|
|
|
500
417
|
}
|
|
501
418
|
/**
|
|
502
419
|
*/
|
|
420
|
+
export enum GovActionKind {
|
|
421
|
+
ParameterChangeAction = 0,
|
|
422
|
+
HardForkInitiationAction = 1,
|
|
423
|
+
TreasuryWithdrawalsAction = 2,
|
|
424
|
+
NoConfidence = 3,
|
|
425
|
+
UpdateCommittee = 4,
|
|
426
|
+
NewConstitution = 5,
|
|
427
|
+
InfoAction = 6,
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Careful: this enum doesn't include the network ID part of the header
|
|
431
|
+
* ex: base address isn't 0b0000_0000 but instead 0b0000
|
|
432
|
+
* Use `header_matches_kind` if you don't want to implement the bitwise operators yourself
|
|
433
|
+
*/
|
|
434
|
+
export enum AddressHeaderKind {
|
|
435
|
+
BasePaymentKeyStakeKey = 0,
|
|
436
|
+
BasePaymentScriptStakeKey = 1,
|
|
437
|
+
BasePaymentKeyStakeScript = 2,
|
|
438
|
+
BasePaymentScriptStakeScript = 3,
|
|
439
|
+
PointerKey = 4,
|
|
440
|
+
PointerScript = 5,
|
|
441
|
+
EnterpriseKey = 6,
|
|
442
|
+
EnterpriseScript = 7,
|
|
443
|
+
Byron = 8,
|
|
444
|
+
RewardKey = 14,
|
|
445
|
+
RewardScript = 15,
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
*/
|
|
449
|
+
export enum TransactionMetadatumKind {
|
|
450
|
+
Map = 0,
|
|
451
|
+
List = 1,
|
|
452
|
+
Int = 2,
|
|
453
|
+
Bytes = 3,
|
|
454
|
+
Text = 4,
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
*/
|
|
458
|
+
export enum Language {
|
|
459
|
+
PlutusV1 = 0,
|
|
460
|
+
PlutusV2 = 1,
|
|
461
|
+
PlutusV3 = 2,
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
*/
|
|
465
|
+
export enum NativeScriptKind {
|
|
466
|
+
ScriptPubkey = 0,
|
|
467
|
+
ScriptAll = 1,
|
|
468
|
+
ScriptAny = 2,
|
|
469
|
+
ScriptNOfK = 3,
|
|
470
|
+
ScriptInvalidBefore = 4,
|
|
471
|
+
ScriptInvalidHereafter = 5,
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
*/
|
|
475
|
+
export enum CredentialKind {
|
|
476
|
+
PubKey = 0,
|
|
477
|
+
Script = 1,
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
*/
|
|
481
|
+
export enum Vote {
|
|
482
|
+
No = 0,
|
|
483
|
+
Yes = 1,
|
|
484
|
+
Abstain = 2,
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
*/
|
|
488
|
+
export enum PlutusDataKind {
|
|
489
|
+
ConstrPlutusData = 0,
|
|
490
|
+
Map = 1,
|
|
491
|
+
List = 2,
|
|
492
|
+
Integer = 3,
|
|
493
|
+
Bytes = 4,
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
*/
|
|
497
|
+
export enum NonceKind {
|
|
498
|
+
Identity = 0,
|
|
499
|
+
Hash = 1,
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
*/
|
|
503
503
|
export class AddrAttributes {
|
|
504
504
|
free(): void;
|
|
505
505
|
/**
|
|
@@ -1072,6 +1072,51 @@ export class AssetName {
|
|
|
1072
1072
|
free(): void;
|
|
1073
1073
|
/**
|
|
1074
1074
|
*
|
|
1075
|
+
* * Create an AssetName from utf8 string. 64 byte (not char!) maximum.
|
|
1076
|
+
*
|
|
1077
|
+
* @param {string} utf8_str
|
|
1078
|
+
* @returns {AssetName}
|
|
1079
|
+
*/
|
|
1080
|
+
static from_str(utf8_str: string): AssetName;
|
|
1081
|
+
/**
|
|
1082
|
+
*
|
|
1083
|
+
* * AssetName as a utf8 string if it's possible. Will error if the asset is not utf8
|
|
1084
|
+
*
|
|
1085
|
+
* @returns {string}
|
|
1086
|
+
*/
|
|
1087
|
+
to_str(): string;
|
|
1088
|
+
/**
|
|
1089
|
+
*
|
|
1090
|
+
* * Direct raw bytes without any CBOR structure
|
|
1091
|
+
*
|
|
1092
|
+
* @returns {Uint8Array}
|
|
1093
|
+
*/
|
|
1094
|
+
to_raw_bytes(): Uint8Array;
|
|
1095
|
+
/**
|
|
1096
|
+
*
|
|
1097
|
+
* * Parse from the direct raw bytes, without any CBOR structure
|
|
1098
|
+
*
|
|
1099
|
+
* @param {Uint8Array} bytes
|
|
1100
|
+
* @returns {AssetName}
|
|
1101
|
+
*/
|
|
1102
|
+
static from_raw_bytes(bytes: Uint8Array): AssetName;
|
|
1103
|
+
/**
|
|
1104
|
+
*
|
|
1105
|
+
* * Direct raw bytes without any CBOR structure, as a hex-encoded string
|
|
1106
|
+
*
|
|
1107
|
+
* @returns {string}
|
|
1108
|
+
*/
|
|
1109
|
+
to_hex(): string;
|
|
1110
|
+
/**
|
|
1111
|
+
*
|
|
1112
|
+
* * Parse from a hex string of the direct raw bytes, without any CBOR structure
|
|
1113
|
+
*
|
|
1114
|
+
* @param {string} input
|
|
1115
|
+
* @returns {AssetName}
|
|
1116
|
+
*/
|
|
1117
|
+
static from_hex(input: string): AssetName;
|
|
1118
|
+
/**
|
|
1119
|
+
*
|
|
1075
1120
|
* * Serialize this type to CBOR bytes
|
|
1076
1121
|
* * This type type supports encoding preservation so this will preserve round-trip CBOR formats.
|
|
1077
1122
|
* * If created from scratch the CBOR will be canonical.
|
|
@@ -1132,51 +1177,6 @@ export class AssetName {
|
|
|
1132
1177
|
* @returns {AssetName}
|
|
1133
1178
|
*/
|
|
1134
1179
|
static from_json(json: string): AssetName;
|
|
1135
|
-
/**
|
|
1136
|
-
*
|
|
1137
|
-
* * Create an AssetName from utf8 string. 64 byte (not char!) maximum.
|
|
1138
|
-
*
|
|
1139
|
-
* @param {string} utf8_str
|
|
1140
|
-
* @returns {AssetName}
|
|
1141
|
-
*/
|
|
1142
|
-
static from_str(utf8_str: string): AssetName;
|
|
1143
|
-
/**
|
|
1144
|
-
*
|
|
1145
|
-
* * AssetName as a utf8 string if it's possible. Will error if the asset is not utf8
|
|
1146
|
-
*
|
|
1147
|
-
* @returns {string}
|
|
1148
|
-
*/
|
|
1149
|
-
to_str(): string;
|
|
1150
|
-
/**
|
|
1151
|
-
*
|
|
1152
|
-
* * Direct raw bytes without any CBOR structure
|
|
1153
|
-
*
|
|
1154
|
-
* @returns {Uint8Array}
|
|
1155
|
-
*/
|
|
1156
|
-
to_raw_bytes(): Uint8Array;
|
|
1157
|
-
/**
|
|
1158
|
-
*
|
|
1159
|
-
* * Parse from the direct raw bytes, without any CBOR structure
|
|
1160
|
-
*
|
|
1161
|
-
* @param {Uint8Array} bytes
|
|
1162
|
-
* @returns {AssetName}
|
|
1163
|
-
*/
|
|
1164
|
-
static from_raw_bytes(bytes: Uint8Array): AssetName;
|
|
1165
|
-
/**
|
|
1166
|
-
*
|
|
1167
|
-
* * Direct raw bytes without any CBOR structure, as a hex-encoded string
|
|
1168
|
-
*
|
|
1169
|
-
* @returns {string}
|
|
1170
|
-
*/
|
|
1171
|
-
to_hex(): string;
|
|
1172
|
-
/**
|
|
1173
|
-
*
|
|
1174
|
-
* * Parse from a hex string of the direct raw bytes, without any CBOR structure
|
|
1175
|
-
*
|
|
1176
|
-
* @param {string} input
|
|
1177
|
-
* @returns {AssetName}
|
|
1178
|
-
*/
|
|
1179
|
-
static from_hex(input: string): AssetName;
|
|
1180
1180
|
}
|
|
1181
1181
|
/**
|
|
1182
1182
|
*/
|
|
@@ -7597,6 +7597,25 @@ export class PlutusData {
|
|
|
7597
7597
|
free(): void;
|
|
7598
7598
|
/**
|
|
7599
7599
|
*
|
|
7600
|
+
* * Convert to a Datum that will serialize equivalent to cardano-node's format
|
|
7601
|
+
* *
|
|
7602
|
+
* * Please VERY STRONGLY consider using PlutusData::from_cbor_bytes() instead wherever possible.
|
|
7603
|
+
* * You should try to never rely on a tool encoding CBOR a certain way as there are many possible,
|
|
7604
|
+
* * and just because it matches with a specific datum, doesn't mean that a different datum won't differ.
|
|
7605
|
+
* * This is critical as that means the datum hash won't match.
|
|
7606
|
+
* * After creation a datum (or other hashable CBOR object) should only be treated as raw CBOR bytes,
|
|
7607
|
+
* * or through a type that respects its specific CBOR format e.g. CML's PlutusData::from_cbor_bytes()
|
|
7608
|
+
* *
|
|
7609
|
+
* * This function is just here in case there's no possible way at all to create from CBOR bytes and
|
|
7610
|
+
* * thus cold only be constructed manually and then had this function called on it.
|
|
7611
|
+
* *
|
|
7612
|
+
* * This is also the format that CSL and Lucid use
|
|
7613
|
+
*
|
|
7614
|
+
* @returns {PlutusData}
|
|
7615
|
+
*/
|
|
7616
|
+
to_cardano_node_format(): PlutusData;
|
|
7617
|
+
/**
|
|
7618
|
+
*
|
|
7600
7619
|
* * Serialize this type to CBOR bytes
|
|
7601
7620
|
* * This type type supports encoding preservation so this will preserve round-trip CBOR formats.
|
|
7602
7621
|
* * If created from scratch the CBOR will be canonical.
|