@anastasia-labs/cardano-multiplatform-lib-nodejs 6.0.1-1 → 6.0.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 +265 -246
- package/cardano_multiplatform_lib.js +407 -387
- 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,97 +161,85 @@ 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
|
-
*
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* @param {TransactionOutput} output
|
|
174
|
-
* @param {bigint} coins_per_utxo_byte
|
|
164
|
+
*
|
|
165
|
+
* * Min fee for JUST the script, NOT including ref inputs
|
|
166
|
+
*
|
|
167
|
+
* @param {Transaction} tx
|
|
168
|
+
* @param {ExUnitPrices} ex_unit_prices
|
|
175
169
|
* @returns {bigint}
|
|
176
170
|
*/
|
|
177
|
-
export function
|
|
171
|
+
export function min_script_fee(tx: Transaction, ex_unit_prices: ExUnitPrices): bigint;
|
|
178
172
|
/**
|
|
179
|
-
* @param {
|
|
180
|
-
* @param {
|
|
181
|
-
* @returns {
|
|
173
|
+
* @param {Transaction} tx
|
|
174
|
+
* @param {LinearFee} linear_fee
|
|
175
|
+
* @returns {bigint}
|
|
182
176
|
*/
|
|
183
|
-
export function
|
|
177
|
+
export function min_no_script_fee(tx: Transaction, linear_fee: LinearFee): bigint;
|
|
184
178
|
/**
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
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}
|
|
188
188
|
*/
|
|
189
|
-
export function
|
|
189
|
+
export function min_fee(tx: Transaction, linear_fee: LinearFee, ex_unit_prices: ExUnitPrices, total_ref_script_size: bigint): bigint;
|
|
190
190
|
/**
|
|
191
191
|
*/
|
|
192
|
-
export enum
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
export enum MetadataJsonSchema {
|
|
193
|
+
NoConversions = 0,
|
|
194
|
+
BasicConversions = 1,
|
|
195
|
+
DetailedSchema = 2,
|
|
195
196
|
}
|
|
196
197
|
/**
|
|
197
198
|
*/
|
|
198
|
-
export enum
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
export enum AddressKind {
|
|
200
|
+
Base = 0,
|
|
201
|
+
Ptr = 1,
|
|
202
|
+
Enterprise = 2,
|
|
203
|
+
Reward = 3,
|
|
204
|
+
Byron = 4,
|
|
202
205
|
}
|
|
203
206
|
/**
|
|
204
207
|
*/
|
|
205
|
-
export enum
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
Conway = 2,
|
|
208
|
+
export enum CredentialKind {
|
|
209
|
+
PubKey = 0,
|
|
210
|
+
Script = 1,
|
|
209
211
|
}
|
|
210
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.
|
|
211
216
|
*/
|
|
212
|
-
export enum
|
|
213
|
-
NoConversions = 0,
|
|
214
|
-
BasicConversions = 1,
|
|
215
|
-
DetailedSchema = 2,
|
|
216
|
-
}
|
|
217
|
+
export enum CIP25Version {
|
|
217
218
|
/**
|
|
219
|
+
* Initial version of CIP25 with only string (utf8) asset names allowed.
|
|
218
220
|
*/
|
|
219
|
-
|
|
220
|
-
Native = 0,
|
|
221
|
-
PlutusV1 = 1,
|
|
222
|
-
PlutusV2 = 2,
|
|
223
|
-
PlutusV3 = 3,
|
|
224
|
-
}
|
|
221
|
+
V1 = 0,
|
|
225
222
|
/**
|
|
226
|
-
*
|
|
227
|
-
* ex: base address isn't 0b0000_0000 but instead 0b0000
|
|
228
|
-
* Use `header_matches_kind` if you don't want to implement the bitwise operators yourself
|
|
223
|
+
* Second version of CIP25. Supports any type of asset names.
|
|
229
224
|
*/
|
|
230
|
-
|
|
231
|
-
BasePaymentKeyStakeKey = 0,
|
|
232
|
-
BasePaymentScriptStakeKey = 1,
|
|
233
|
-
BasePaymentKeyStakeScript = 2,
|
|
234
|
-
BasePaymentScriptStakeScript = 3,
|
|
235
|
-
PointerKey = 4,
|
|
236
|
-
PointerScript = 5,
|
|
237
|
-
EnterpriseKey = 6,
|
|
238
|
-
EnterpriseScript = 7,
|
|
239
|
-
Byron = 8,
|
|
240
|
-
RewardKey = 14,
|
|
241
|
-
RewardScript = 15,
|
|
225
|
+
V2 = 1,
|
|
242
226
|
}
|
|
243
227
|
/**
|
|
244
228
|
*/
|
|
245
|
-
export enum
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
Proposing = 5,
|
|
229
|
+
export enum VoterKind {
|
|
230
|
+
ConstitutionalCommitteeHotKeyHash = 0,
|
|
231
|
+
ConstitutionalCommitteeHotScriptHash = 1,
|
|
232
|
+
DRepKeyHash = 2,
|
|
233
|
+
DRepScriptHash = 3,
|
|
234
|
+
StakingPoolKeyHash = 4,
|
|
252
235
|
}
|
|
253
236
|
/**
|
|
254
237
|
*/
|
|
255
|
-
export enum
|
|
256
|
-
|
|
257
|
-
|
|
238
|
+
export enum ScriptKind {
|
|
239
|
+
Native = 0,
|
|
240
|
+
PlutusV1 = 1,
|
|
241
|
+
PlutusV2 = 2,
|
|
242
|
+
PlutusV3 = 3,
|
|
258
243
|
}
|
|
259
244
|
/**
|
|
260
245
|
*/
|
|
@@ -265,41 +250,16 @@ export enum Vote {
|
|
|
265
250
|
}
|
|
266
251
|
/**
|
|
267
252
|
*/
|
|
268
|
-
export enum
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
*/
|
|
272
|
-
LargestFirst = 0,
|
|
273
|
-
/**
|
|
274
|
-
* Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
|
|
275
|
-
*/
|
|
276
|
-
RandomImprove = 1,
|
|
277
|
-
/**
|
|
278
|
-
* Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
|
|
279
|
-
*/
|
|
280
|
-
LargestFirstMultiAsset = 2,
|
|
281
|
-
/**
|
|
282
|
-
* Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
|
|
283
|
-
*/
|
|
284
|
-
RandomImproveMultiAsset = 3,
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
*/
|
|
288
|
-
export enum AddressKind {
|
|
289
|
-
Base = 0,
|
|
290
|
-
Ptr = 1,
|
|
291
|
-
Enterprise = 2,
|
|
292
|
-
Reward = 3,
|
|
293
|
-
Byron = 4,
|
|
253
|
+
export enum NonceKind {
|
|
254
|
+
Identity = 0,
|
|
255
|
+
Hash = 1,
|
|
294
256
|
}
|
|
295
257
|
/**
|
|
296
258
|
*/
|
|
297
|
-
export enum
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
Bytes = 3,
|
|
302
|
-
Text = 4,
|
|
259
|
+
export enum RelayKind {
|
|
260
|
+
SingleHostAddr = 0,
|
|
261
|
+
SingleHostName = 1,
|
|
262
|
+
MultiHostName = 2,
|
|
303
263
|
}
|
|
304
264
|
/**
|
|
305
265
|
* JSON <-> PlutusData conversion schemas.
|
|
@@ -355,43 +315,41 @@ export enum CardanoNodePlutusDatumSchema {
|
|
|
355
315
|
}
|
|
356
316
|
/**
|
|
357
317
|
*/
|
|
358
|
-
export enum
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
318
|
+
export enum RedeemerTag {
|
|
319
|
+
Spend = 0,
|
|
320
|
+
Mint = 1,
|
|
321
|
+
Cert = 2,
|
|
322
|
+
Reward = 3,
|
|
323
|
+
Voting = 4,
|
|
324
|
+
Proposing = 5,
|
|
365
325
|
}
|
|
366
326
|
/**
|
|
367
327
|
*/
|
|
368
|
-
export enum
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
328
|
+
export enum CoinSelectionStrategyCIP2 {
|
|
329
|
+
/**
|
|
330
|
+
* Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
|
|
331
|
+
*/
|
|
332
|
+
LargestFirst = 0,
|
|
372
333
|
/**
|
|
334
|
+
* Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
|
|
373
335
|
*/
|
|
374
|
-
|
|
375
|
-
Key = 0,
|
|
376
|
-
Script = 1,
|
|
377
|
-
AlwaysAbstain = 2,
|
|
378
|
-
AlwaysNoConfidence = 3,
|
|
379
|
-
}
|
|
336
|
+
RandomImprove = 1,
|
|
380
337
|
/**
|
|
338
|
+
* Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
|
|
381
339
|
*/
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
Bytes = 4,
|
|
340
|
+
LargestFirstMultiAsset = 2,
|
|
341
|
+
/**
|
|
342
|
+
* Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
|
|
343
|
+
*/
|
|
344
|
+
RandomImproveMultiAsset = 3,
|
|
388
345
|
}
|
|
389
346
|
/**
|
|
390
347
|
*/
|
|
391
|
-
export enum
|
|
392
|
-
|
|
348
|
+
export enum DRepKind {
|
|
349
|
+
Key = 0,
|
|
393
350
|
Script = 1,
|
|
394
|
-
|
|
351
|
+
AlwaysAbstain = 2,
|
|
352
|
+
AlwaysNoConfidence = 3,
|
|
395
353
|
}
|
|
396
354
|
/**
|
|
397
355
|
*/
|
|
@@ -416,12 +374,12 @@ export enum CertificateKind {
|
|
|
416
374
|
}
|
|
417
375
|
/**
|
|
418
376
|
*/
|
|
419
|
-
export enum
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
377
|
+
export enum PlutusDataKind {
|
|
378
|
+
ConstrPlutusData = 0,
|
|
379
|
+
Map = 1,
|
|
380
|
+
List = 2,
|
|
381
|
+
Integer = 3,
|
|
382
|
+
Bytes = 4,
|
|
425
383
|
}
|
|
426
384
|
/**
|
|
427
385
|
*/
|
|
@@ -431,21 +389,48 @@ export enum DelegationDistributionKind {
|
|
|
431
389
|
}
|
|
432
390
|
/**
|
|
433
391
|
*/
|
|
434
|
-
export enum
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
392
|
+
export enum GovActionKind {
|
|
393
|
+
ParameterChangeAction = 0,
|
|
394
|
+
HardForkInitiationAction = 1,
|
|
395
|
+
TreasuryWithdrawalsAction = 2,
|
|
396
|
+
NoConfidence = 3,
|
|
397
|
+
UpdateCommittee = 4,
|
|
398
|
+
NewConstitution = 5,
|
|
399
|
+
InfoAction = 6,
|
|
438
400
|
}
|
|
439
401
|
/**
|
|
440
402
|
*/
|
|
441
|
-
export enum
|
|
442
|
-
|
|
443
|
-
|
|
403
|
+
export enum Language {
|
|
404
|
+
PlutusV1 = 0,
|
|
405
|
+
PlutusV2 = 1,
|
|
406
|
+
PlutusV3 = 2,
|
|
444
407
|
}
|
|
445
408
|
/**
|
|
446
409
|
*/
|
|
447
|
-
export enum
|
|
448
|
-
|
|
410
|
+
export enum StakeDistributionKind {
|
|
411
|
+
SingleKey = 0,
|
|
412
|
+
BootstrapEra = 1,
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
*/
|
|
416
|
+
export enum ChunkableStringKind {
|
|
417
|
+
Single = 0,
|
|
418
|
+
Chunked = 1,
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
*/
|
|
422
|
+
export enum TransactionMetadatumKind {
|
|
423
|
+
Map = 0,
|
|
424
|
+
List = 1,
|
|
425
|
+
Int = 2,
|
|
426
|
+
Bytes = 3,
|
|
427
|
+
Text = 4,
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
*/
|
|
431
|
+
export enum DatumOptionKind {
|
|
432
|
+
Hash = 0,
|
|
433
|
+
Datum = 1,
|
|
449
434
|
}
|
|
450
435
|
/**
|
|
451
436
|
*/
|
|
@@ -456,47 +441,62 @@ export enum SpendingDataKind {
|
|
|
456
441
|
}
|
|
457
442
|
/**
|
|
458
443
|
*/
|
|
459
|
-
export enum
|
|
460
|
-
|
|
461
|
-
|
|
444
|
+
export enum RedeemersKind {
|
|
445
|
+
ArrLegacyRedeemer = 0,
|
|
446
|
+
MapRedeemerKeyToRedeemerVal = 1,
|
|
462
447
|
}
|
|
463
448
|
/**
|
|
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
|
|
464
452
|
*/
|
|
465
|
-
export enum
|
|
466
|
-
|
|
467
|
-
|
|
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,
|
|
468
465
|
}
|
|
469
466
|
/**
|
|
470
|
-
* Which version of the CIP25 spec to use. See CIP25 for details.
|
|
471
|
-
* This will change how things are encoded but for the most part contains
|
|
472
|
-
* the same information.
|
|
473
467
|
*/
|
|
474
|
-
export enum
|
|
468
|
+
export enum TransactionOutputKind {
|
|
469
|
+
AlonzoFormatTxOut = 0,
|
|
470
|
+
ConwayFormatTxOut = 1,
|
|
471
|
+
}
|
|
475
472
|
/**
|
|
476
|
-
* Initial version of CIP25 with only string (utf8) asset names allowed.
|
|
477
473
|
*/
|
|
478
|
-
|
|
474
|
+
export enum ByronAddrType {
|
|
475
|
+
PublicKey = 0,
|
|
476
|
+
Script = 1,
|
|
477
|
+
Redeem = 2,
|
|
478
|
+
}
|
|
479
479
|
/**
|
|
480
|
-
* Second version of CIP25. Supports any type of asset names.
|
|
481
480
|
*/
|
|
482
|
-
|
|
481
|
+
export enum NativeScriptKind {
|
|
482
|
+
ScriptPubkey = 0,
|
|
483
|
+
ScriptAll = 1,
|
|
484
|
+
ScriptAny = 2,
|
|
485
|
+
ScriptNOfK = 3,
|
|
486
|
+
ScriptInvalidBefore = 4,
|
|
487
|
+
ScriptInvalidHereafter = 5,
|
|
483
488
|
}
|
|
484
489
|
/**
|
|
485
490
|
*/
|
|
486
|
-
export enum
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
NoConfidence = 3,
|
|
491
|
-
UpdateCommittee = 4,
|
|
492
|
-
NewConstitution = 5,
|
|
493
|
-
InfoAction = 6,
|
|
491
|
+
export enum AuxiliaryDataKind {
|
|
492
|
+
Shelley = 0,
|
|
493
|
+
ShelleyMA = 1,
|
|
494
|
+
Conway = 2,
|
|
494
495
|
}
|
|
495
496
|
/**
|
|
496
497
|
*/
|
|
497
|
-
export enum
|
|
498
|
-
|
|
499
|
-
Datum = 1,
|
|
498
|
+
export enum ChangeSelectionAlgo {
|
|
499
|
+
Default = 0,
|
|
500
500
|
}
|
|
501
501
|
/**
|
|
502
502
|
*/
|
|
@@ -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.
|