@anastasia-labs/cardano-multiplatform-lib-nodejs 6.0.1 → 6.0.2-2

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.
@@ -17,6 +17,18 @@ 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
+ /**
20
32
  * @param {AuxiliaryData} auxiliary_data
21
33
  * @returns {AuxiliaryDataHash}
22
34
  */
@@ -92,6 +104,33 @@ export function get_implicit_input(txbody: TransactionBody, pool_deposit: bigint
92
104
  */
93
105
  export function get_deposit(txbody: TransactionBody, pool_deposit: bigint, key_deposit: bigint): bigint;
94
106
  /**
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
+ /**
95
134
  * Converts JSON to Metadata according to MetadataJsonSchema
96
135
  * @param {string} json
97
136
  * @param {MetadataJsonSchema} schema
@@ -106,47 +145,11 @@ export function encode_json_str_to_metadatum(json: string, schema: MetadataJsonS
106
145
  */
107
146
  export function decode_metadatum_to_json_str(metadatum: TransactionMetadatum, schema: MetadataJsonSchema): string;
108
147
  /**
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
- /**
127
148
  * @param {Redeemers} redeemers
128
149
  * @returns {ExUnits}
129
150
  */
130
151
  export function compute_total_ex_units(redeemers: Redeemers): ExUnits;
131
152
  /**
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
- /**
150
153
  * @param {TransactionHash} tx_body_hash
151
154
  * @param {ByronAddress} addr
152
155
  * @param {LegacyDaedalusPrivateKey} key
@@ -161,39 +164,29 @@ export function make_daedalus_bootstrap_witness(tx_body_hash: TransactionHash, a
161
164
  */
162
165
  export function make_icarus_bootstrap_witness(tx_body_hash: TransactionHash, addr: ByronAddress, key: Bip32PrivateKey): BootstrapWitness;
163
166
  /**
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}
167
+ * @param {TransactionHash} tx_body_hash
168
+ * @param {PrivateKey} sk
169
+ * @returns {Vkeywitness}
170
170
  */
171
- export function min_script_fee(tx: Transaction, ex_unit_prices: ExUnitPrices): bigint;
171
+ export function make_vkey_witness(tx_body_hash: TransactionHash, sk: PrivateKey): Vkeywitness;
172
172
  /**
173
- * @param {Transaction} tx
174
- * @param {LinearFee} linear_fee
173
+ * @param {TransactionOutput} output
174
+ * @param {bigint} coins_per_utxo_byte
175
175
  * @returns {bigint}
176
176
  */
177
- export function min_no_script_fee(tx: Transaction, linear_fee: LinearFee): bigint;
177
+ export function min_ada_required(output: TransactionOutput, coins_per_utxo_byte: bigint): bigint;
178
178
  /**
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}
179
+ * @param {string} json
180
+ * @param {CardanoNodePlutusDatumSchema} schema
181
+ * @returns {PlutusData}
188
182
  */
189
- export function min_fee(tx: Transaction, linear_fee: LinearFee, ex_unit_prices: ExUnitPrices, total_ref_script_size: bigint): bigint;
183
+ export function encode_json_str_to_plutus_datum(json: string, schema: CardanoNodePlutusDatumSchema): PlutusData;
190
184
  /**
185
+ * @param {PlutusData} datum
186
+ * @param {CardanoNodePlutusDatumSchema} schema
187
+ * @returns {string}
191
188
  */
192
- export enum MetadataJsonSchema {
193
- NoConversions = 0,
194
- BasicConversions = 1,
195
- DetailedSchema = 2,
196
- }
189
+ export function decode_plutus_datum_to_json_str(datum: PlutusData, schema: CardanoNodePlutusDatumSchema): string;
197
190
  /**
198
191
  */
199
192
  export enum AddressKind {
@@ -205,61 +198,24 @@ export enum AddressKind {
205
198
  }
206
199
  /**
207
200
  */
208
- export enum CredentialKind {
209
- PubKey = 0,
210
- Script = 1,
211
- }
212
- /**
213
- * Which version of the CIP25 spec to use. See CIP25 for details.
214
- * This will change how things are encoded but for the most part contains
215
- * the same information.
216
- */
217
- export enum CIP25Version {
218
- /**
219
- * Initial version of CIP25 with only string (utf8) asset names allowed.
220
- */
221
- V1 = 0,
222
- /**
223
- * Second version of CIP25. Supports any type of asset names.
224
- */
225
- V2 = 1,
226
- }
227
- /**
228
- */
229
- export enum VoterKind {
230
- ConstitutionalCommitteeHotKeyHash = 0,
231
- ConstitutionalCommitteeHotScriptHash = 1,
232
- DRepKeyHash = 2,
233
- DRepScriptHash = 3,
234
- StakingPoolKeyHash = 4,
235
- }
236
- /**
237
- */
238
- export enum ScriptKind {
239
- Native = 0,
240
- PlutusV1 = 1,
241
- PlutusV2 = 2,
242
- PlutusV3 = 3,
243
- }
244
- /**
245
- */
246
- export enum Vote {
247
- No = 0,
248
- Yes = 1,
249
- Abstain = 2,
250
- }
251
- /**
252
- */
253
- export enum NonceKind {
254
- Identity = 0,
255
- Hash = 1,
256
- }
257
- /**
258
- */
259
- export enum RelayKind {
260
- SingleHostAddr = 0,
261
- SingleHostName = 1,
262
- MultiHostName = 2,
201
+ export enum CertificateKind {
202
+ StakeRegistration = 0,
203
+ StakeDeregistration = 1,
204
+ StakeDelegation = 2,
205
+ PoolRegistration = 3,
206
+ PoolRetirement = 4,
207
+ RegCert = 5,
208
+ UnregCert = 6,
209
+ VoteDelegCert = 7,
210
+ StakeVoteDelegCert = 8,
211
+ StakeRegDelegCert = 9,
212
+ VoteRegDelegCert = 10,
213
+ StakeVoteRegDelegCert = 11,
214
+ AuthCommitteeHotCert = 12,
215
+ ResignCommitteeColdCert = 13,
216
+ RegDrepCert = 14,
217
+ UnregDrepCert = 15,
218
+ UpdateDrepCert = 16,
263
219
  }
264
220
  /**
265
221
  * JSON <-> PlutusData conversion schemas.
@@ -315,6 +271,13 @@ export enum CardanoNodePlutusDatumSchema {
315
271
  }
316
272
  /**
317
273
  */
274
+ export enum Vote {
275
+ No = 0,
276
+ Yes = 1,
277
+ Abstain = 2,
278
+ }
279
+ /**
280
+ */
318
281
  export enum RedeemerTag {
319
282
  Spend = 0,
320
283
  Mint = 1,
@@ -324,6 +287,59 @@ export enum RedeemerTag {
324
287
  Proposing = 5,
325
288
  }
326
289
  /**
290
+ * Careful: this enum doesn't include the network ID part of the header
291
+ * ex: base address isn't 0b0000_0000 but instead 0b0000
292
+ * Use `header_matches_kind` if you don't want to implement the bitwise operators yourself
293
+ */
294
+ export enum AddressHeaderKind {
295
+ BasePaymentKeyStakeKey = 0,
296
+ BasePaymentScriptStakeKey = 1,
297
+ BasePaymentKeyStakeScript = 2,
298
+ BasePaymentScriptStakeScript = 3,
299
+ PointerKey = 4,
300
+ PointerScript = 5,
301
+ EnterpriseKey = 6,
302
+ EnterpriseScript = 7,
303
+ Byron = 8,
304
+ RewardKey = 14,
305
+ RewardScript = 15,
306
+ }
307
+ /**
308
+ */
309
+ export enum StakeDistributionKind {
310
+ SingleKey = 0,
311
+ BootstrapEra = 1,
312
+ }
313
+ /**
314
+ */
315
+ export enum NonceKind {
316
+ Identity = 0,
317
+ Hash = 1,
318
+ }
319
+ /**
320
+ */
321
+ export enum SpendingDataKind {
322
+ SpendingDataPubKey = 0,
323
+ SpendingDataScript = 1,
324
+ SpendingDataRedeem = 2,
325
+ }
326
+ /**
327
+ */
328
+ export enum ChunkableStringKind {
329
+ Single = 0,
330
+ Chunked = 1,
331
+ }
332
+ /**
333
+ */
334
+ export enum NativeScriptKind {
335
+ ScriptPubkey = 0,
336
+ ScriptAll = 1,
337
+ ScriptAny = 2,
338
+ ScriptNOfK = 3,
339
+ ScriptInvalidBefore = 4,
340
+ ScriptInvalidHereafter = 5,
341
+ }
342
+ /**
327
343
  */
328
344
  export enum CoinSelectionStrategyCIP2 {
329
345
  /**
@@ -345,47 +361,29 @@ export enum CoinSelectionStrategyCIP2 {
345
361
  }
346
362
  /**
347
363
  */
348
- export enum DRepKind {
349
- Key = 0,
350
- Script = 1,
351
- AlwaysAbstain = 2,
352
- AlwaysNoConfidence = 3,
364
+ export enum RedeemersKind {
365
+ ArrLegacyRedeemer = 0,
366
+ MapRedeemerKeyToRedeemerVal = 1,
353
367
  }
354
368
  /**
355
369
  */
356
- export enum CertificateKind {
357
- StakeRegistration = 0,
358
- StakeDeregistration = 1,
359
- StakeDelegation = 2,
360
- PoolRegistration = 3,
361
- PoolRetirement = 4,
362
- RegCert = 5,
363
- UnregCert = 6,
364
- VoteDelegCert = 7,
365
- StakeVoteDelegCert = 8,
366
- StakeRegDelegCert = 9,
367
- VoteRegDelegCert = 10,
368
- StakeVoteRegDelegCert = 11,
369
- AuthCommitteeHotCert = 12,
370
- ResignCommitteeColdCert = 13,
371
- RegDrepCert = 14,
372
- UnregDrepCert = 15,
373
- UpdateDrepCert = 16,
370
+ export enum Language {
371
+ PlutusV1 = 0,
372
+ PlutusV2 = 1,
373
+ PlutusV3 = 2,
374
374
  }
375
375
  /**
376
376
  */
377
- export enum PlutusDataKind {
378
- ConstrPlutusData = 0,
379
- Map = 1,
380
- List = 2,
381
- Integer = 3,
382
- Bytes = 4,
377
+ export enum RelayKind {
378
+ SingleHostAddr = 0,
379
+ SingleHostName = 1,
380
+ MultiHostName = 2,
383
381
  }
384
382
  /**
385
383
  */
386
- export enum DelegationDistributionKind {
387
- Weighted = 0,
388
- Legacy = 1,
384
+ export enum CredentialKind {
385
+ PubKey = 0,
386
+ Script = 1,
389
387
  }
390
388
  /**
391
389
  */
@@ -400,68 +398,68 @@ export enum GovActionKind {
400
398
  }
401
399
  /**
402
400
  */
403
- export enum Language {
404
- PlutusV1 = 0,
405
- PlutusV2 = 1,
406
- PlutusV3 = 2,
401
+ export enum VoterKind {
402
+ ConstitutionalCommitteeHotKeyHash = 0,
403
+ ConstitutionalCommitteeHotScriptHash = 1,
404
+ DRepKeyHash = 2,
405
+ DRepScriptHash = 3,
406
+ StakingPoolKeyHash = 4,
407
407
  }
408
408
  /**
409
409
  */
410
- export enum StakeDistributionKind {
411
- SingleKey = 0,
412
- BootstrapEra = 1,
410
+ export enum DRepKind {
411
+ Key = 0,
412
+ Script = 1,
413
+ AlwaysAbstain = 2,
414
+ AlwaysNoConfidence = 3,
413
415
  }
414
416
  /**
415
417
  */
416
- export enum ChunkableStringKind {
417
- Single = 0,
418
- Chunked = 1,
418
+ export enum DatumOptionKind {
419
+ Hash = 0,
420
+ Datum = 1,
419
421
  }
420
422
  /**
423
+ * Which version of the CIP25 spec to use. See CIP25 for details.
424
+ * This will change how things are encoded but for the most part contains
425
+ * the same information.
421
426
  */
422
- export enum TransactionMetadatumKind {
423
- Map = 0,
424
- List = 1,
425
- Int = 2,
426
- Bytes = 3,
427
- Text = 4,
427
+ export enum CIP25Version {
428
+ /**
429
+ * Initial version of CIP25 with only string (utf8) asset names allowed.
430
+ */
431
+ V1 = 0,
432
+ /**
433
+ * Second version of CIP25. Supports any type of asset names.
434
+ */
435
+ V2 = 1,
428
436
  }
429
437
  /**
430
438
  */
431
- export enum DatumOptionKind {
432
- Hash = 0,
433
- Datum = 1,
439
+ export enum PlutusDataKind {
440
+ ConstrPlutusData = 0,
441
+ Map = 1,
442
+ List = 2,
443
+ Integer = 3,
444
+ Bytes = 4,
434
445
  }
435
446
  /**
436
447
  */
437
- export enum SpendingDataKind {
438
- SpendingDataPubKey = 0,
439
- SpendingDataScript = 1,
440
- SpendingDataRedeem = 2,
448
+ export enum AuxiliaryDataKind {
449
+ Shelley = 0,
450
+ ShelleyMA = 1,
451
+ Conway = 2,
441
452
  }
442
453
  /**
443
454
  */
444
- export enum RedeemersKind {
445
- ArrLegacyRedeemer = 0,
446
- MapRedeemerKeyToRedeemerVal = 1,
455
+ export enum DelegationDistributionKind {
456
+ Weighted = 0,
457
+ Legacy = 1,
447
458
  }
448
459
  /**
449
- * Careful: this enum doesn't include the network ID part of the header
450
- * ex: base address isn't 0b0000_0000 but instead 0b0000
451
- * Use `header_matches_kind` if you don't want to implement the bitwise operators yourself
452
460
  */
453
- export enum AddressHeaderKind {
454
- BasePaymentKeyStakeKey = 0,
455
- BasePaymentScriptStakeKey = 1,
456
- BasePaymentKeyStakeScript = 2,
457
- BasePaymentScriptStakeScript = 3,
458
- PointerKey = 4,
459
- PointerScript = 5,
460
- EnterpriseKey = 6,
461
- EnterpriseScript = 7,
462
- Byron = 8,
463
- RewardKey = 14,
464
- RewardScript = 15,
461
+ export enum ChangeSelectionAlgo {
462
+ Default = 0,
465
463
  }
466
464
  /**
467
465
  */
@@ -471,32 +469,34 @@ export enum TransactionOutputKind {
471
469
  }
472
470
  /**
473
471
  */
474
- export enum ByronAddrType {
475
- PublicKey = 0,
476
- Script = 1,
477
- Redeem = 2,
472
+ export enum TransactionMetadatumKind {
473
+ Map = 0,
474
+ List = 1,
475
+ Int = 2,
476
+ Bytes = 3,
477
+ Text = 4,
478
478
  }
479
479
  /**
480
480
  */
481
- export enum NativeScriptKind {
482
- ScriptPubkey = 0,
483
- ScriptAll = 1,
484
- ScriptAny = 2,
485
- ScriptNOfK = 3,
486
- ScriptInvalidBefore = 4,
487
- ScriptInvalidHereafter = 5,
481
+ export enum MetadataJsonSchema {
482
+ NoConversions = 0,
483
+ BasicConversions = 1,
484
+ DetailedSchema = 2,
488
485
  }
489
486
  /**
490
487
  */
491
- export enum AuxiliaryDataKind {
492
- Shelley = 0,
493
- ShelleyMA = 1,
494
- Conway = 2,
488
+ export enum ByronAddrType {
489
+ PublicKey = 0,
490
+ Script = 1,
491
+ Redeem = 2,
495
492
  }
496
493
  /**
497
494
  */
498
- export enum ChangeSelectionAlgo {
499
- Default = 0,
495
+ export enum ScriptKind {
496
+ Native = 0,
497
+ PlutusV1 = 1,
498
+ PlutusV2 = 2,
499
+ PlutusV3 = 3,
500
500
  }
501
501
  /**
502
502
  */
@@ -1072,51 +1072,6 @@ 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
- *
1120
1075
  * * Serialize this type to CBOR bytes
1121
1076
  * * This type type supports encoding preservation so this will preserve round-trip CBOR formats.
1122
1077
  * * If created from scratch the CBOR will be canonical.
@@ -1177,6 +1132,51 @@ export class AssetName {
1177
1132
  * @returns {AssetName}
1178
1133
  */
1179
1134
  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
  */