@anastasia-labs/cardano-multiplatform-lib-browser 5.3.1-6 → 5.3.1-7
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.
|
@@ -183,113 +183,172 @@ export function encode_json_str_to_plutus_datum(json: string, schema: CardanoNod
|
|
|
183
183
|
*/
|
|
184
184
|
export function decode_plutus_datum_to_json_str(datum: PlutusData, schema: CardanoNodePlutusDatumSchema): string;
|
|
185
185
|
/**
|
|
186
|
-
* Which version of the CIP25 spec to use. See CIP25 for details.
|
|
187
|
-
* This will change how things are encoded but for the most part contains
|
|
188
|
-
* the same information.
|
|
189
186
|
*/
|
|
190
|
-
export enum
|
|
187
|
+
export enum DatumOptionKind {
|
|
188
|
+
Hash = 0,
|
|
189
|
+
Datum = 1,
|
|
190
|
+
}
|
|
191
191
|
/**
|
|
192
|
-
*
|
|
192
|
+
* JSON <-> PlutusData conversion schemas.
|
|
193
|
+
* Follows ScriptDataJsonSchema in cardano-cli defined at:
|
|
194
|
+
* https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/ScriptData.hs#L254
|
|
195
|
+
*
|
|
196
|
+
* All methods here have the following restrictions due to limitations on dependencies:
|
|
197
|
+
* * JSON numbers above u64::MAX (positive) or below i64::MIN (negative) will throw errors
|
|
198
|
+
* * Hex strings for bytes don't accept odd-length (half-byte) strings.
|
|
199
|
+
* cardano-cli seems to support these however but it seems to be different than just 0-padding
|
|
200
|
+
* on either side when tested so proceed with caution
|
|
193
201
|
*/
|
|
194
|
-
|
|
202
|
+
export enum CardanoNodePlutusDatumSchema {
|
|
195
203
|
/**
|
|
196
|
-
*
|
|
204
|
+
* ScriptDataJsonNoSchema in cardano-node.
|
|
205
|
+
*
|
|
206
|
+
* This is the format used by --script-data-value in cardano-cli
|
|
207
|
+
* This tries to accept most JSON but does not support the full spectrum of Plutus datums.
|
|
208
|
+
* From JSON:
|
|
209
|
+
* * null/true/false/floats NOT supported
|
|
210
|
+
* * strings starting with 0x are treated as hex bytes. All other strings are encoded as their utf8 bytes.
|
|
211
|
+
* To JSON:
|
|
212
|
+
* * ConstrPlutusData not supported in ANY FORM (neither keys nor values)
|
|
213
|
+
* * Lists not supported in keys
|
|
214
|
+
* * Maps not supported in keys
|
|
197
215
|
*/
|
|
198
|
-
|
|
216
|
+
BasicConversions = 0,
|
|
217
|
+
/**
|
|
218
|
+
* ScriptDataJsonDetailedSchema in cardano-node.
|
|
219
|
+
*
|
|
220
|
+
* This is the format used by --script-data-file in cardano-cli
|
|
221
|
+
* This covers almost all (only minor exceptions) Plutus datums, but the JSON must conform to a strict schema.
|
|
222
|
+
* The schema specifies that ALL keys and ALL values must be contained in a JSON map with 2 cases:
|
|
223
|
+
* 1. For ConstrPlutusData there must be two fields "constructor" contianing a number and "fields" containing its fields
|
|
224
|
+
* e.g. { "constructor": 2, "fields": [{"int": 2}, {"list": [{"bytes": "CAFEF00D"}]}]}
|
|
225
|
+
* 2. For all other cases there must be only one field named "int", "bytes", "list" or "map"
|
|
226
|
+
* BigInteger's value is a JSON number e.g. {"int": 100}
|
|
227
|
+
* Bytes' value is a hex string representing the bytes WITHOUT any prefix e.g. {"bytes": "CAFEF00D"}
|
|
228
|
+
* Lists' value is a JSON list of its elements encoded via the same schema e.g. {"list": [{"bytes": "CAFEF00D"}]}
|
|
229
|
+
* Maps' value is a JSON list of objects, one for each key-value pair in the map, with keys "k" and "v"
|
|
230
|
+
* respectively with their values being the plutus datum encoded via this same schema
|
|
231
|
+
* e.g. {"map": [
|
|
232
|
+
* {"k": {"int": 2}, "v": {"int": 5}},
|
|
233
|
+
* {"k": {"map": [{"k": {"list": [{"int": 1}]}, "v": {"bytes": "FF03"}}]}, "v": {"list": []}}
|
|
234
|
+
* ]}
|
|
235
|
+
* From JSON:
|
|
236
|
+
* * null/true/false/floats NOT supported
|
|
237
|
+
* * the JSON must conform to a very specific schema
|
|
238
|
+
* To JSON:
|
|
239
|
+
* * all Plutus datums should be fully supported outside of the integer range limitations outlined above.
|
|
240
|
+
*/
|
|
241
|
+
DetailedSchema = 1,
|
|
199
242
|
}
|
|
200
243
|
/**
|
|
201
244
|
*/
|
|
202
|
-
export enum
|
|
203
|
-
|
|
204
|
-
|
|
245
|
+
export enum GovActionKind {
|
|
246
|
+
ParameterChangeAction = 0,
|
|
247
|
+
HardForkInitiationAction = 1,
|
|
248
|
+
TreasuryWithdrawalsAction = 2,
|
|
249
|
+
NoConfidence = 3,
|
|
250
|
+
UpdateCommittee = 4,
|
|
251
|
+
NewConstitution = 5,
|
|
252
|
+
InfoAction = 6,
|
|
205
253
|
}
|
|
206
254
|
/**
|
|
207
255
|
*/
|
|
208
|
-
export enum
|
|
209
|
-
|
|
210
|
-
|
|
256
|
+
export enum AddressKind {
|
|
257
|
+
Base = 0,
|
|
258
|
+
Ptr = 1,
|
|
259
|
+
Enterprise = 2,
|
|
260
|
+
Reward = 3,
|
|
261
|
+
Byron = 4,
|
|
211
262
|
}
|
|
212
263
|
/**
|
|
213
264
|
*/
|
|
214
|
-
export enum
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
DRepScriptHash = 3,
|
|
219
|
-
StakingPoolKeyHash = 4,
|
|
265
|
+
export enum MetadataJsonSchema {
|
|
266
|
+
NoConversions = 0,
|
|
267
|
+
BasicConversions = 1,
|
|
268
|
+
DetailedSchema = 2,
|
|
220
269
|
}
|
|
221
270
|
/**
|
|
222
271
|
*/
|
|
223
|
-
export enum
|
|
272
|
+
export enum ChangeSelectionAlgo {
|
|
273
|
+
Default = 0,
|
|
274
|
+
}
|
|
224
275
|
/**
|
|
225
|
-
* Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
|
|
226
276
|
*/
|
|
227
|
-
|
|
277
|
+
export enum SpendingDataKind {
|
|
278
|
+
SpendingDataPubKey = 0,
|
|
279
|
+
SpendingDataScript = 1,
|
|
280
|
+
SpendingDataRedeem = 2,
|
|
281
|
+
}
|
|
228
282
|
/**
|
|
229
|
-
*
|
|
283
|
+
* Which version of the CIP25 spec to use. See CIP25 for details.
|
|
284
|
+
* This will change how things are encoded but for the most part contains
|
|
285
|
+
* the same information.
|
|
230
286
|
*/
|
|
231
|
-
|
|
287
|
+
export enum CIP25Version {
|
|
232
288
|
/**
|
|
233
|
-
*
|
|
289
|
+
* Initial version of CIP25 with only string (utf8) asset names allowed.
|
|
234
290
|
*/
|
|
235
|
-
|
|
291
|
+
V1 = 0,
|
|
236
292
|
/**
|
|
237
|
-
*
|
|
293
|
+
* Second version of CIP25. Supports any type of asset names.
|
|
238
294
|
*/
|
|
239
|
-
|
|
295
|
+
V2 = 1,
|
|
240
296
|
}
|
|
241
297
|
/**
|
|
242
298
|
*/
|
|
243
|
-
export enum
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
299
|
+
export enum RedeemerTag {
|
|
300
|
+
Spend = 0,
|
|
301
|
+
Mint = 1,
|
|
302
|
+
Cert = 2,
|
|
303
|
+
Reward = 3,
|
|
304
|
+
Voting = 4,
|
|
305
|
+
Proposing = 5,
|
|
247
306
|
}
|
|
248
307
|
/**
|
|
249
308
|
*/
|
|
250
|
-
export enum
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
PlutusV3 = 2,
|
|
309
|
+
export enum RedeemersKind {
|
|
310
|
+
ArrLegacyRedeemer = 0,
|
|
311
|
+
MapRedeemerKeyToRedeemerVal = 1,
|
|
254
312
|
}
|
|
255
313
|
/**
|
|
256
314
|
*/
|
|
257
|
-
export enum
|
|
258
|
-
|
|
259
|
-
|
|
315
|
+
export enum TransactionOutputKind {
|
|
316
|
+
AlonzoFormatTxOut = 0,
|
|
317
|
+
ConwayFormatTxOut = 1,
|
|
260
318
|
}
|
|
261
319
|
/**
|
|
262
320
|
*/
|
|
263
|
-
export enum
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
321
|
+
export enum ScriptKind {
|
|
322
|
+
Native = 0,
|
|
323
|
+
PlutusV1 = 1,
|
|
324
|
+
PlutusV2 = 2,
|
|
325
|
+
PlutusV3 = 3,
|
|
267
326
|
}
|
|
268
327
|
/**
|
|
269
328
|
*/
|
|
270
|
-
export enum
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
NewConstitution = 5,
|
|
277
|
-
InfoAction = 6,
|
|
329
|
+
export enum TransactionMetadatumKind {
|
|
330
|
+
Map = 0,
|
|
331
|
+
List = 1,
|
|
332
|
+
Int = 2,
|
|
333
|
+
Bytes = 3,
|
|
334
|
+
Text = 4,
|
|
278
335
|
}
|
|
279
336
|
/**
|
|
280
337
|
*/
|
|
281
|
-
export enum
|
|
282
|
-
|
|
283
|
-
|
|
338
|
+
export enum NativeScriptKind {
|
|
339
|
+
ScriptPubkey = 0,
|
|
340
|
+
ScriptAll = 1,
|
|
341
|
+
ScriptAny = 2,
|
|
342
|
+
ScriptNOfK = 3,
|
|
343
|
+
ScriptInvalidBefore = 4,
|
|
344
|
+
ScriptInvalidHereafter = 5,
|
|
284
345
|
}
|
|
285
346
|
/**
|
|
286
347
|
*/
|
|
287
|
-
export enum
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
Reward = 3,
|
|
292
|
-
Byron = 4,
|
|
348
|
+
export enum RelayKind {
|
|
349
|
+
SingleHostAddr = 0,
|
|
350
|
+
SingleHostName = 1,
|
|
351
|
+
MultiHostName = 2,
|
|
293
352
|
}
|
|
294
353
|
/**
|
|
295
354
|
*/
|
|
@@ -313,56 +372,70 @@ export enum CertificateKind {
|
|
|
313
372
|
UpdateDrepCert = 16,
|
|
314
373
|
}
|
|
315
374
|
/**
|
|
375
|
+
* Careful: this enum doesn't include the network ID part of the header
|
|
376
|
+
* ex: base address isn't 0b0000_0000 but instead 0b0000
|
|
377
|
+
* Use `header_matches_kind` if you don't want to implement the bitwise operators yourself
|
|
316
378
|
*/
|
|
317
|
-
export enum
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
379
|
+
export enum AddressHeaderKind {
|
|
380
|
+
BasePaymentKeyStakeKey = 0,
|
|
381
|
+
BasePaymentScriptStakeKey = 1,
|
|
382
|
+
BasePaymentKeyStakeScript = 2,
|
|
383
|
+
BasePaymentScriptStakeScript = 3,
|
|
384
|
+
PointerKey = 4,
|
|
385
|
+
PointerScript = 5,
|
|
386
|
+
EnterpriseKey = 6,
|
|
387
|
+
EnterpriseScript = 7,
|
|
388
|
+
Byron = 8,
|
|
389
|
+
RewardKey = 14,
|
|
390
|
+
RewardScript = 15,
|
|
322
391
|
}
|
|
323
392
|
/**
|
|
324
393
|
*/
|
|
325
|
-
export enum
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
394
|
+
export enum VoterKind {
|
|
395
|
+
ConstitutionalCommitteeHotKeyHash = 0,
|
|
396
|
+
ConstitutionalCommitteeHotScriptHash = 1,
|
|
397
|
+
DRepKeyHash = 2,
|
|
398
|
+
DRepScriptHash = 3,
|
|
399
|
+
StakingPoolKeyHash = 4,
|
|
329
400
|
}
|
|
330
401
|
/**
|
|
331
402
|
*/
|
|
332
|
-
export enum
|
|
333
|
-
Native = 0,
|
|
334
|
-
PlutusV1 = 1,
|
|
335
|
-
PlutusV2 = 2,
|
|
336
|
-
PlutusV3 = 3,
|
|
337
|
-
}
|
|
403
|
+
export enum CoinSelectionStrategyCIP2 {
|
|
338
404
|
/**
|
|
405
|
+
* Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
|
|
339
406
|
*/
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
407
|
+
LargestFirst = 0,
|
|
408
|
+
/**
|
|
409
|
+
* Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
|
|
410
|
+
*/
|
|
411
|
+
RandomImprove = 1,
|
|
412
|
+
/**
|
|
413
|
+
* Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
|
|
414
|
+
*/
|
|
415
|
+
LargestFirstMultiAsset = 2,
|
|
416
|
+
/**
|
|
417
|
+
* Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
|
|
418
|
+
*/
|
|
419
|
+
RandomImproveMultiAsset = 3,
|
|
343
420
|
}
|
|
344
421
|
/**
|
|
345
422
|
*/
|
|
346
|
-
export enum
|
|
347
|
-
|
|
348
|
-
|
|
423
|
+
export enum Vote {
|
|
424
|
+
No = 0,
|
|
425
|
+
Yes = 1,
|
|
426
|
+
Abstain = 2,
|
|
349
427
|
}
|
|
350
428
|
/**
|
|
351
429
|
*/
|
|
352
|
-
export enum
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
Cert = 2,
|
|
356
|
-
Reward = 3,
|
|
357
|
-
Voting = 4,
|
|
358
|
-
Proposing = 5,
|
|
430
|
+
export enum StakeDistributionKind {
|
|
431
|
+
SingleKey = 0,
|
|
432
|
+
BootstrapEra = 1,
|
|
359
433
|
}
|
|
360
434
|
/**
|
|
361
435
|
*/
|
|
362
|
-
export enum
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
MultiHostName = 2,
|
|
436
|
+
export enum CredentialKind {
|
|
437
|
+
PubKey = 0,
|
|
438
|
+
Script = 1,
|
|
366
439
|
}
|
|
367
440
|
/**
|
|
368
441
|
*/
|
|
@@ -375,29 +448,9 @@ export enum PlutusDataKind {
|
|
|
375
448
|
}
|
|
376
449
|
/**
|
|
377
450
|
*/
|
|
378
|
-
export enum
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
ScriptAny = 2,
|
|
382
|
-
ScriptNOfK = 3,
|
|
383
|
-
ScriptInvalidBefore = 4,
|
|
384
|
-
ScriptInvalidHereafter = 5,
|
|
385
|
-
}
|
|
386
|
-
/**
|
|
387
|
-
*/
|
|
388
|
-
export enum TransactionMetadatumKind {
|
|
389
|
-
Map = 0,
|
|
390
|
-
List = 1,
|
|
391
|
-
Int = 2,
|
|
392
|
-
Bytes = 3,
|
|
393
|
-
Text = 4,
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
*/
|
|
397
|
-
export enum AuxiliaryDataKind {
|
|
398
|
-
Shelley = 0,
|
|
399
|
-
ShelleyMA = 1,
|
|
400
|
-
Conway = 2,
|
|
451
|
+
export enum ChunkableStringKind {
|
|
452
|
+
Single = 0,
|
|
453
|
+
Chunked = 1,
|
|
401
454
|
}
|
|
402
455
|
/**
|
|
403
456
|
*/
|
|
@@ -406,92 +459,39 @@ export enum NonceKind {
|
|
|
406
459
|
Hash = 1,
|
|
407
460
|
}
|
|
408
461
|
/**
|
|
409
|
-
* Careful: this enum doesn't include the network ID part of the header
|
|
410
|
-
* ex: base address isn't 0b0000_0000 but instead 0b0000
|
|
411
|
-
* Use `header_matches_kind` if you don't want to implement the bitwise operators yourself
|
|
412
462
|
*/
|
|
413
|
-
export enum
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
BasePaymentKeyStakeScript = 2,
|
|
417
|
-
BasePaymentScriptStakeScript = 3,
|
|
418
|
-
PointerKey = 4,
|
|
419
|
-
PointerScript = 5,
|
|
420
|
-
EnterpriseKey = 6,
|
|
421
|
-
EnterpriseScript = 7,
|
|
422
|
-
Byron = 8,
|
|
423
|
-
RewardKey = 14,
|
|
424
|
-
RewardScript = 15,
|
|
463
|
+
export enum DelegationDistributionKind {
|
|
464
|
+
Weighted = 0,
|
|
465
|
+
Legacy = 1,
|
|
425
466
|
}
|
|
426
467
|
/**
|
|
427
468
|
*/
|
|
428
|
-
export enum
|
|
429
|
-
|
|
469
|
+
export enum DRepKind {
|
|
470
|
+
Key = 0,
|
|
471
|
+
Script = 1,
|
|
472
|
+
AlwaysAbstain = 2,
|
|
473
|
+
AlwaysNoConfidence = 3,
|
|
430
474
|
}
|
|
431
475
|
/**
|
|
432
|
-
* JSON <-> PlutusData conversion schemas.
|
|
433
|
-
* Follows ScriptDataJsonSchema in cardano-cli defined at:
|
|
434
|
-
* https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/ScriptData.hs#L254
|
|
435
|
-
*
|
|
436
|
-
* All methods here have the following restrictions due to limitations on dependencies:
|
|
437
|
-
* * JSON numbers above u64::MAX (positive) or below i64::MIN (negative) will throw errors
|
|
438
|
-
* * Hex strings for bytes don't accept odd-length (half-byte) strings.
|
|
439
|
-
* cardano-cli seems to support these however but it seems to be different than just 0-padding
|
|
440
|
-
* on either side when tested so proceed with caution
|
|
441
|
-
*/
|
|
442
|
-
export enum CardanoNodePlutusDatumSchema {
|
|
443
|
-
/**
|
|
444
|
-
* ScriptDataJsonNoSchema in cardano-node.
|
|
445
|
-
*
|
|
446
|
-
* This is the format used by --script-data-value in cardano-cli
|
|
447
|
-
* This tries to accept most JSON but does not support the full spectrum of Plutus datums.
|
|
448
|
-
* From JSON:
|
|
449
|
-
* * null/true/false/floats NOT supported
|
|
450
|
-
* * strings starting with 0x are treated as hex bytes. All other strings are encoded as their utf8 bytes.
|
|
451
|
-
* To JSON:
|
|
452
|
-
* * ConstrPlutusData not supported in ANY FORM (neither keys nor values)
|
|
453
|
-
* * Lists not supported in keys
|
|
454
|
-
* * Maps not supported in keys
|
|
455
|
-
*/
|
|
456
|
-
BasicConversions = 0,
|
|
457
|
-
/**
|
|
458
|
-
* ScriptDataJsonDetailedSchema in cardano-node.
|
|
459
|
-
*
|
|
460
|
-
* This is the format used by --script-data-file in cardano-cli
|
|
461
|
-
* This covers almost all (only minor exceptions) Plutus datums, but the JSON must conform to a strict schema.
|
|
462
|
-
* The schema specifies that ALL keys and ALL values must be contained in a JSON map with 2 cases:
|
|
463
|
-
* 1. For ConstrPlutusData there must be two fields "constructor" contianing a number and "fields" containing its fields
|
|
464
|
-
* e.g. { "constructor": 2, "fields": [{"int": 2}, {"list": [{"bytes": "CAFEF00D"}]}]}
|
|
465
|
-
* 2. For all other cases there must be only one field named "int", "bytes", "list" or "map"
|
|
466
|
-
* BigInteger's value is a JSON number e.g. {"int": 100}
|
|
467
|
-
* Bytes' value is a hex string representing the bytes WITHOUT any prefix e.g. {"bytes": "CAFEF00D"}
|
|
468
|
-
* Lists' value is a JSON list of its elements encoded via the same schema e.g. {"list": [{"bytes": "CAFEF00D"}]}
|
|
469
|
-
* Maps' value is a JSON list of objects, one for each key-value pair in the map, with keys "k" and "v"
|
|
470
|
-
* respectively with their values being the plutus datum encoded via this same schema
|
|
471
|
-
* e.g. {"map": [
|
|
472
|
-
* {"k": {"int": 2}, "v": {"int": 5}},
|
|
473
|
-
* {"k": {"map": [{"k": {"list": [{"int": 1}]}, "v": {"bytes": "FF03"}}]}, "v": {"list": []}}
|
|
474
|
-
* ]}
|
|
475
|
-
* From JSON:
|
|
476
|
-
* * null/true/false/floats NOT supported
|
|
477
|
-
* * the JSON must conform to a very specific schema
|
|
478
|
-
* To JSON:
|
|
479
|
-
* * all Plutus datums should be fully supported outside of the integer range limitations outlined above.
|
|
480
476
|
*/
|
|
481
|
-
|
|
477
|
+
export enum ByronAddrType {
|
|
478
|
+
PublicKey = 0,
|
|
479
|
+
Script = 1,
|
|
480
|
+
Redeem = 2,
|
|
482
481
|
}
|
|
483
482
|
/**
|
|
484
483
|
*/
|
|
485
|
-
export enum
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
484
|
+
export enum AuxiliaryDataKind {
|
|
485
|
+
Shelley = 0,
|
|
486
|
+
ShelleyMA = 1,
|
|
487
|
+
Conway = 2,
|
|
489
488
|
}
|
|
490
489
|
/**
|
|
491
490
|
*/
|
|
492
|
-
export enum
|
|
493
|
-
|
|
494
|
-
|
|
491
|
+
export enum Language {
|
|
492
|
+
PlutusV1 = 0,
|
|
493
|
+
PlutusV2 = 1,
|
|
494
|
+
PlutusV3 = 2,
|
|
495
495
|
}
|
|
496
496
|
/**
|
|
497
497
|
*/
|
|
@@ -766,173 +766,173 @@ function getArrayU64FromWasm0(ptr, len) {
|
|
|
766
766
|
return getBigUint64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
|
|
767
767
|
}
|
|
768
768
|
/**
|
|
769
|
-
* Which version of the CIP25 spec to use. See CIP25 for details.
|
|
770
|
-
* This will change how things are encoded but for the most part contains
|
|
771
|
-
* the same information.
|
|
772
769
|
*/
|
|
773
|
-
export const
|
|
770
|
+
export const DatumOptionKind = Object.freeze({ Hash:0,"0":"Hash",Datum:1,"1":"Datum", });
|
|
774
771
|
/**
|
|
775
|
-
*
|
|
772
|
+
* JSON <-> PlutusData conversion schemas.
|
|
773
|
+
* Follows ScriptDataJsonSchema in cardano-cli defined at:
|
|
774
|
+
* https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/ScriptData.hs#L254
|
|
775
|
+
*
|
|
776
|
+
* All methods here have the following restrictions due to limitations on dependencies:
|
|
777
|
+
* * JSON numbers above u64::MAX (positive) or below i64::MIN (negative) will throw errors
|
|
778
|
+
* * Hex strings for bytes don't accept odd-length (half-byte) strings.
|
|
779
|
+
* cardano-cli seems to support these however but it seems to be different than just 0-padding
|
|
780
|
+
* on either side when tested so proceed with caution
|
|
776
781
|
*/
|
|
777
|
-
|
|
782
|
+
export const CardanoNodePlutusDatumSchema = Object.freeze({
|
|
778
783
|
/**
|
|
779
|
-
*
|
|
784
|
+
* ScriptDataJsonNoSchema in cardano-node.
|
|
785
|
+
*
|
|
786
|
+
* This is the format used by --script-data-value in cardano-cli
|
|
787
|
+
* This tries to accept most JSON but does not support the full spectrum of Plutus datums.
|
|
788
|
+
* From JSON:
|
|
789
|
+
* * null/true/false/floats NOT supported
|
|
790
|
+
* * strings starting with 0x are treated as hex bytes. All other strings are encoded as their utf8 bytes.
|
|
791
|
+
* To JSON:
|
|
792
|
+
* * ConstrPlutusData not supported in ANY FORM (neither keys nor values)
|
|
793
|
+
* * Lists not supported in keys
|
|
794
|
+
* * Maps not supported in keys
|
|
780
795
|
*/
|
|
781
|
-
|
|
796
|
+
BasicConversions:0,"0":"BasicConversions",
|
|
782
797
|
/**
|
|
798
|
+
* ScriptDataJsonDetailedSchema in cardano-node.
|
|
799
|
+
*
|
|
800
|
+
* This is the format used by --script-data-file in cardano-cli
|
|
801
|
+
* This covers almost all (only minor exceptions) Plutus datums, but the JSON must conform to a strict schema.
|
|
802
|
+
* The schema specifies that ALL keys and ALL values must be contained in a JSON map with 2 cases:
|
|
803
|
+
* 1. For ConstrPlutusData there must be two fields "constructor" contianing a number and "fields" containing its fields
|
|
804
|
+
* e.g. { "constructor": 2, "fields": [{"int": 2}, {"list": [{"bytes": "CAFEF00D"}]}]}
|
|
805
|
+
* 2. For all other cases there must be only one field named "int", "bytes", "list" or "map"
|
|
806
|
+
* BigInteger's value is a JSON number e.g. {"int": 100}
|
|
807
|
+
* Bytes' value is a hex string representing the bytes WITHOUT any prefix e.g. {"bytes": "CAFEF00D"}
|
|
808
|
+
* Lists' value is a JSON list of its elements encoded via the same schema e.g. {"list": [{"bytes": "CAFEF00D"}]}
|
|
809
|
+
* Maps' value is a JSON list of objects, one for each key-value pair in the map, with keys "k" and "v"
|
|
810
|
+
* respectively with their values being the plutus datum encoded via this same schema
|
|
811
|
+
* e.g. {"map": [
|
|
812
|
+
* {"k": {"int": 2}, "v": {"int": 5}},
|
|
813
|
+
* {"k": {"map": [{"k": {"list": [{"int": 1}]}, "v": {"bytes": "FF03"}}]}, "v": {"list": []}}
|
|
814
|
+
* ]}
|
|
815
|
+
* From JSON:
|
|
816
|
+
* * null/true/false/floats NOT supported
|
|
817
|
+
* * the JSON must conform to a very specific schema
|
|
818
|
+
* To JSON:
|
|
819
|
+
* * all Plutus datums should be fully supported outside of the integer range limitations outlined above.
|
|
783
820
|
*/
|
|
784
|
-
|
|
821
|
+
DetailedSchema:1,"1":"DetailedSchema", });
|
|
785
822
|
/**
|
|
786
823
|
*/
|
|
787
|
-
export const
|
|
824
|
+
export const GovActionKind = Object.freeze({ ParameterChangeAction:0,"0":"ParameterChangeAction",HardForkInitiationAction:1,"1":"HardForkInitiationAction",TreasuryWithdrawalsAction:2,"2":"TreasuryWithdrawalsAction",NoConfidence:3,"3":"NoConfidence",UpdateCommittee:4,"4":"UpdateCommittee",NewConstitution:5,"5":"NewConstitution",InfoAction:6,"6":"InfoAction", });
|
|
788
825
|
/**
|
|
789
826
|
*/
|
|
790
|
-
export const
|
|
827
|
+
export const AddressKind = Object.freeze({ Base:0,"0":"Base",Ptr:1,"1":"Ptr",Enterprise:2,"2":"Enterprise",Reward:3,"3":"Reward",Byron:4,"4":"Byron", });
|
|
791
828
|
/**
|
|
792
829
|
*/
|
|
793
|
-
export const
|
|
830
|
+
export const MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
|
|
794
831
|
/**
|
|
795
|
-
* Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
|
|
796
832
|
*/
|
|
797
|
-
|
|
833
|
+
export const ChangeSelectionAlgo = Object.freeze({ Default:0,"0":"Default", });
|
|
798
834
|
/**
|
|
799
|
-
* Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
|
|
800
835
|
*/
|
|
801
|
-
|
|
836
|
+
export const SpendingDataKind = Object.freeze({ SpendingDataPubKey:0,"0":"SpendingDataPubKey",SpendingDataScript:1,"1":"SpendingDataScript",SpendingDataRedeem:2,"2":"SpendingDataRedeem", });
|
|
802
837
|
/**
|
|
803
|
-
*
|
|
838
|
+
* Which version of the CIP25 spec to use. See CIP25 for details.
|
|
839
|
+
* This will change how things are encoded but for the most part contains
|
|
840
|
+
* the same information.
|
|
804
841
|
*/
|
|
805
|
-
|
|
842
|
+
export const CIP25Version = Object.freeze({
|
|
806
843
|
/**
|
|
807
|
-
*
|
|
844
|
+
* Initial version of CIP25 with only string (utf8) asset names allowed.
|
|
808
845
|
*/
|
|
809
|
-
|
|
846
|
+
V1:0,"0":"V1",
|
|
810
847
|
/**
|
|
848
|
+
* Second version of CIP25. Supports any type of asset names.
|
|
811
849
|
*/
|
|
812
|
-
|
|
850
|
+
V2:1,"1":"V2", });
|
|
813
851
|
/**
|
|
814
852
|
*/
|
|
815
|
-
export const
|
|
853
|
+
export const RedeemerTag = Object.freeze({ Spend:0,"0":"Spend",Mint:1,"1":"Mint",Cert:2,"2":"Cert",Reward:3,"3":"Reward",Voting:4,"4":"Voting",Proposing:5,"5":"Proposing", });
|
|
816
854
|
/**
|
|
817
855
|
*/
|
|
818
|
-
export const
|
|
856
|
+
export const RedeemersKind = Object.freeze({ ArrLegacyRedeemer:0,"0":"ArrLegacyRedeemer",MapRedeemerKeyToRedeemerVal:1,"1":"MapRedeemerKeyToRedeemerVal", });
|
|
819
857
|
/**
|
|
820
858
|
*/
|
|
821
|
-
export const
|
|
859
|
+
export const TransactionOutputKind = Object.freeze({ AlonzoFormatTxOut:0,"0":"AlonzoFormatTxOut",ConwayFormatTxOut:1,"1":"ConwayFormatTxOut", });
|
|
822
860
|
/**
|
|
823
861
|
*/
|
|
824
|
-
export const
|
|
862
|
+
export const ScriptKind = Object.freeze({ Native:0,"0":"Native",PlutusV1:1,"1":"PlutusV1",PlutusV2:2,"2":"PlutusV2",PlutusV3:3,"3":"PlutusV3", });
|
|
825
863
|
/**
|
|
826
864
|
*/
|
|
827
|
-
export const
|
|
865
|
+
export const TransactionMetadatumKind = Object.freeze({ Map:0,"0":"Map",List:1,"1":"List",Int:2,"2":"Int",Bytes:3,"3":"Bytes",Text:4,"4":"Text", });
|
|
828
866
|
/**
|
|
829
867
|
*/
|
|
830
|
-
export const
|
|
868
|
+
export const NativeScriptKind = Object.freeze({ ScriptPubkey:0,"0":"ScriptPubkey",ScriptAll:1,"1":"ScriptAll",ScriptAny:2,"2":"ScriptAny",ScriptNOfK:3,"3":"ScriptNOfK",ScriptInvalidBefore:4,"4":"ScriptInvalidBefore",ScriptInvalidHereafter:5,"5":"ScriptInvalidHereafter", });
|
|
831
869
|
/**
|
|
832
870
|
*/
|
|
833
|
-
export const
|
|
871
|
+
export const RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
|
|
834
872
|
/**
|
|
835
873
|
*/
|
|
836
|
-
export const
|
|
874
|
+
export const CertificateKind = Object.freeze({ StakeRegistration:0,"0":"StakeRegistration",StakeDeregistration:1,"1":"StakeDeregistration",StakeDelegation:2,"2":"StakeDelegation",PoolRegistration:3,"3":"PoolRegistration",PoolRetirement:4,"4":"PoolRetirement",RegCert:5,"5":"RegCert",UnregCert:6,"6":"UnregCert",VoteDelegCert:7,"7":"VoteDelegCert",StakeVoteDelegCert:8,"8":"StakeVoteDelegCert",StakeRegDelegCert:9,"9":"StakeRegDelegCert",VoteRegDelegCert:10,"10":"VoteRegDelegCert",StakeVoteRegDelegCert:11,"11":"StakeVoteRegDelegCert",AuthCommitteeHotCert:12,"12":"AuthCommitteeHotCert",ResignCommitteeColdCert:13,"13":"ResignCommitteeColdCert",RegDrepCert:14,"14":"RegDrepCert",UnregDrepCert:15,"15":"UnregDrepCert",UpdateDrepCert:16,"16":"UpdateDrepCert", });
|
|
837
875
|
/**
|
|
876
|
+
* Careful: this enum doesn't include the network ID part of the header
|
|
877
|
+
* ex: base address isn't 0b0000_0000 but instead 0b0000
|
|
878
|
+
* Use `header_matches_kind` if you don't want to implement the bitwise operators yourself
|
|
838
879
|
*/
|
|
839
|
-
export const
|
|
880
|
+
export const AddressHeaderKind = Object.freeze({ BasePaymentKeyStakeKey:0,"0":"BasePaymentKeyStakeKey",BasePaymentScriptStakeKey:1,"1":"BasePaymentScriptStakeKey",BasePaymentKeyStakeScript:2,"2":"BasePaymentKeyStakeScript",BasePaymentScriptStakeScript:3,"3":"BasePaymentScriptStakeScript",PointerKey:4,"4":"PointerKey",PointerScript:5,"5":"PointerScript",EnterpriseKey:6,"6":"EnterpriseKey",EnterpriseScript:7,"7":"EnterpriseScript",Byron:8,"8":"Byron",RewardKey:14,"14":"RewardKey",RewardScript:15,"15":"RewardScript", });
|
|
840
881
|
/**
|
|
841
882
|
*/
|
|
842
|
-
export const
|
|
883
|
+
export const VoterKind = Object.freeze({ ConstitutionalCommitteeHotKeyHash:0,"0":"ConstitutionalCommitteeHotKeyHash",ConstitutionalCommitteeHotScriptHash:1,"1":"ConstitutionalCommitteeHotScriptHash",DRepKeyHash:2,"2":"DRepKeyHash",DRepScriptHash:3,"3":"DRepScriptHash",StakingPoolKeyHash:4,"4":"StakingPoolKeyHash", });
|
|
843
884
|
/**
|
|
844
885
|
*/
|
|
845
|
-
export const
|
|
886
|
+
export const CoinSelectionStrategyCIP2 = Object.freeze({
|
|
846
887
|
/**
|
|
888
|
+
* Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
|
|
847
889
|
*/
|
|
848
|
-
|
|
890
|
+
LargestFirst:0,"0":"LargestFirst",
|
|
849
891
|
/**
|
|
892
|
+
* Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
|
|
850
893
|
*/
|
|
851
|
-
|
|
894
|
+
RandomImprove:1,"1":"RandomImprove",
|
|
852
895
|
/**
|
|
896
|
+
* Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
|
|
853
897
|
*/
|
|
854
|
-
|
|
898
|
+
LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
|
|
855
899
|
/**
|
|
900
|
+
* Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
|
|
856
901
|
*/
|
|
857
|
-
|
|
902
|
+
RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
|
|
858
903
|
/**
|
|
859
904
|
*/
|
|
860
|
-
export const
|
|
905
|
+
export const Vote = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
|
|
861
906
|
/**
|
|
862
907
|
*/
|
|
863
|
-
export const
|
|
908
|
+
export const StakeDistributionKind = Object.freeze({ SingleKey:0,"0":"SingleKey",BootstrapEra:1,"1":"BootstrapEra", });
|
|
864
909
|
/**
|
|
865
910
|
*/
|
|
866
|
-
export const
|
|
911
|
+
export const CredentialKind = Object.freeze({ PubKey:0,"0":"PubKey",Script:1,"1":"Script", });
|
|
867
912
|
/**
|
|
868
913
|
*/
|
|
869
|
-
export const
|
|
914
|
+
export const PlutusDataKind = Object.freeze({ ConstrPlutusData:0,"0":"ConstrPlutusData",Map:1,"1":"Map",List:2,"2":"List",Integer:3,"3":"Integer",Bytes:4,"4":"Bytes", });
|
|
870
915
|
/**
|
|
871
|
-
* Careful: this enum doesn't include the network ID part of the header
|
|
872
|
-
* ex: base address isn't 0b0000_0000 but instead 0b0000
|
|
873
|
-
* Use `header_matches_kind` if you don't want to implement the bitwise operators yourself
|
|
874
916
|
*/
|
|
875
|
-
export const
|
|
917
|
+
export const ChunkableStringKind = Object.freeze({ Single:0,"0":"Single",Chunked:1,"1":"Chunked", });
|
|
876
918
|
/**
|
|
877
919
|
*/
|
|
878
|
-
export const
|
|
920
|
+
export const NonceKind = Object.freeze({ Identity:0,"0":"Identity",Hash:1,"1":"Hash", });
|
|
879
921
|
/**
|
|
880
|
-
* JSON <-> PlutusData conversion schemas.
|
|
881
|
-
* Follows ScriptDataJsonSchema in cardano-cli defined at:
|
|
882
|
-
* https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/ScriptData.hs#L254
|
|
883
|
-
*
|
|
884
|
-
* All methods here have the following restrictions due to limitations on dependencies:
|
|
885
|
-
* * JSON numbers above u64::MAX (positive) or below i64::MIN (negative) will throw errors
|
|
886
|
-
* * Hex strings for bytes don't accept odd-length (half-byte) strings.
|
|
887
|
-
* cardano-cli seems to support these however but it seems to be different than just 0-padding
|
|
888
|
-
* on either side when tested so proceed with caution
|
|
889
922
|
*/
|
|
890
|
-
export const
|
|
923
|
+
export const DelegationDistributionKind = Object.freeze({ Weighted:0,"0":"Weighted",Legacy:1,"1":"Legacy", });
|
|
891
924
|
/**
|
|
892
|
-
* ScriptDataJsonNoSchema in cardano-node.
|
|
893
|
-
*
|
|
894
|
-
* This is the format used by --script-data-value in cardano-cli
|
|
895
|
-
* This tries to accept most JSON but does not support the full spectrum of Plutus datums.
|
|
896
|
-
* From JSON:
|
|
897
|
-
* * null/true/false/floats NOT supported
|
|
898
|
-
* * strings starting with 0x are treated as hex bytes. All other strings are encoded as their utf8 bytes.
|
|
899
|
-
* To JSON:
|
|
900
|
-
* * ConstrPlutusData not supported in ANY FORM (neither keys nor values)
|
|
901
|
-
* * Lists not supported in keys
|
|
902
|
-
* * Maps not supported in keys
|
|
903
925
|
*/
|
|
904
|
-
|
|
926
|
+
export const DRepKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
|
|
905
927
|
/**
|
|
906
|
-
* ScriptDataJsonDetailedSchema in cardano-node.
|
|
907
|
-
*
|
|
908
|
-
* This is the format used by --script-data-file in cardano-cli
|
|
909
|
-
* This covers almost all (only minor exceptions) Plutus datums, but the JSON must conform to a strict schema.
|
|
910
|
-
* The schema specifies that ALL keys and ALL values must be contained in a JSON map with 2 cases:
|
|
911
|
-
* 1. For ConstrPlutusData there must be two fields "constructor" contianing a number and "fields" containing its fields
|
|
912
|
-
* e.g. { "constructor": 2, "fields": [{"int": 2}, {"list": [{"bytes": "CAFEF00D"}]}]}
|
|
913
|
-
* 2. For all other cases there must be only one field named "int", "bytes", "list" or "map"
|
|
914
|
-
* BigInteger's value is a JSON number e.g. {"int": 100}
|
|
915
|
-
* Bytes' value is a hex string representing the bytes WITHOUT any prefix e.g. {"bytes": "CAFEF00D"}
|
|
916
|
-
* Lists' value is a JSON list of its elements encoded via the same schema e.g. {"list": [{"bytes": "CAFEF00D"}]}
|
|
917
|
-
* Maps' value is a JSON list of objects, one for each key-value pair in the map, with keys "k" and "v"
|
|
918
|
-
* respectively with their values being the plutus datum encoded via this same schema
|
|
919
|
-
* e.g. {"map": [
|
|
920
|
-
* {"k": {"int": 2}, "v": {"int": 5}},
|
|
921
|
-
* {"k": {"map": [{"k": {"list": [{"int": 1}]}, "v": {"bytes": "FF03"}}]}, "v": {"list": []}}
|
|
922
|
-
* ]}
|
|
923
|
-
* From JSON:
|
|
924
|
-
* * null/true/false/floats NOT supported
|
|
925
|
-
* * the JSON must conform to a very specific schema
|
|
926
|
-
* To JSON:
|
|
927
|
-
* * all Plutus datums should be fully supported outside of the integer range limitations outlined above.
|
|
928
928
|
*/
|
|
929
|
-
|
|
929
|
+
export const ByronAddrType = Object.freeze({ PublicKey:0,"0":"PublicKey",Script:1,"1":"Script",Redeem:2,"2":"Redeem", });
|
|
930
930
|
/**
|
|
931
931
|
*/
|
|
932
|
-
export const
|
|
932
|
+
export const AuxiliaryDataKind = Object.freeze({ Shelley:0,"0":"Shelley",ShelleyMA:1,"1":"ShelleyMA",Conway:2,"2":"Conway", });
|
|
933
933
|
/**
|
|
934
934
|
*/
|
|
935
|
-
export const
|
|
935
|
+
export const Language = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
|
|
936
936
|
|
|
937
937
|
const AddrAttributesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
938
938
|
? { register: () => {}, unregister: () => {} }
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anastasia-labs/cardano-multiplatform-lib-browser",
|
|
3
3
|
"description": "Multiplatform WASM SDK containing the most common CML crates for Cardano blockchain functionality",
|
|
4
|
-
"version": "5.3.1-
|
|
4
|
+
"version": "5.3.1-7",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|