@lucid-evolution/utils 0.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/dist/index.js ADDED
@@ -0,0 +1,1080 @@
1
+ // src/native.ts
2
+ import * as CML from "@dcspark/cardano-multiplatform-lib-nodejs";
3
+ var toNativeScript = (native) => {
4
+ switch (native.type) {
5
+ case "sig":
6
+ return CML.NativeScript.new_script_pubkey(
7
+ CML.Ed25519KeyHash.from_hex(native.keyHash)
8
+ );
9
+ case "before":
10
+ return CML.NativeScript.new_script_invalid_hereafter(BigInt(native.slot));
11
+ case "after":
12
+ return CML.NativeScript.new_script_invalid_before(BigInt(native.slot));
13
+ case "all": {
14
+ const nativeList = CML.NativeScriptList.new();
15
+ native.scripts.map((script) => nativeList.add(toNativeScript(script)));
16
+ return CML.NativeScript.new_script_all(nativeList);
17
+ }
18
+ case "any": {
19
+ const nativeList = CML.NativeScriptList.new();
20
+ native.scripts.map((script) => nativeList.add(toNativeScript(script)));
21
+ return CML.NativeScript.new_script_any(nativeList);
22
+ }
23
+ case "atLeast": {
24
+ const nativeList = CML.NativeScriptList.new();
25
+ native.scripts.map((script) => nativeList.add(toNativeScript(script)));
26
+ return CML.NativeScript.new_script_n_of_k(
27
+ BigInt(native.required),
28
+ nativeList
29
+ );
30
+ }
31
+ }
32
+ };
33
+ var nativeJSFromJson = (native) => {
34
+ return {
35
+ type: "Native",
36
+ script: toNativeScript(native).to_cbor_hex()
37
+ };
38
+ };
39
+
40
+ // src/address.ts
41
+ import * as CML3 from "@dcspark/cardano-multiplatform-lib-nodejs";
42
+
43
+ // src/network.ts
44
+ function networkToId(network) {
45
+ switch (network) {
46
+ case "Preview":
47
+ return 0;
48
+ case "Preprod":
49
+ return 0;
50
+ case "Custom":
51
+ return 0;
52
+ case "Mainnet":
53
+ return 1;
54
+ default:
55
+ throw new Error("Network not found");
56
+ }
57
+ }
58
+
59
+ // src/scripts.ts
60
+ import * as CML2 from "@dcspark/cardano-multiplatform-lib-nodejs";
61
+
62
+ // src/cbor.ts
63
+ import { applyDoubleCborEncoding } from "lucid-cardano";
64
+
65
+ // src/scripts.ts
66
+ function validatorToAddress(network, validator, stakeCredential) {
67
+ const validatorHash = validatorToScriptHash(validator);
68
+ if (stakeCredential) {
69
+ return CML2.BaseAddress.new(
70
+ networkToId(network),
71
+ CML2.Credential.new_script(CML2.ScriptHash.from_hex(validatorHash)),
72
+ stakeCredential.type === "Key" ? CML2.Credential.new_pub_key(
73
+ CML2.Ed25519KeyHash.from_hex(stakeCredential.hash)
74
+ ) : CML2.Credential.new_script(
75
+ CML2.ScriptHash.from_hex(stakeCredential.hash)
76
+ )
77
+ ).to_address().to_bech32(void 0);
78
+ } else {
79
+ return CML2.EnterpriseAddress.new(
80
+ networkToId(network),
81
+ CML2.Credential.new_script(CML2.ScriptHash.from_hex(validatorHash))
82
+ ).to_address().to_bech32(void 0);
83
+ }
84
+ }
85
+ function validatorToScriptHash(validator) {
86
+ switch (validator.type) {
87
+ case "Native":
88
+ return CML2.NativeScript.from_cbor_hex(validator.script).hash().to_hex();
89
+ case "PlutusV1":
90
+ return CML2.PlutusScript.from_v1(
91
+ CML2.PlutusV1Script.from_cbor_hex(
92
+ applyDoubleCborEncoding(validator.script)
93
+ )
94
+ ).hash().to_hex();
95
+ case "PlutusV2":
96
+ return CML2.PlutusScript.from_v2(
97
+ CML2.PlutusV2Script.from_cbor_hex(
98
+ applyDoubleCborEncoding(validator.script)
99
+ )
100
+ ).hash().to_hex();
101
+ default:
102
+ throw new Error("No variant matched");
103
+ }
104
+ }
105
+ function toScriptRef(script) {
106
+ switch (script.type) {
107
+ case "Native":
108
+ return CML2.Script.new_native(
109
+ CML2.NativeScript.from_cbor_hex(script.script)
110
+ );
111
+ case "PlutusV1":
112
+ return CML2.Script.new_plutus_v1(
113
+ CML2.PlutusV1Script.from_cbor_hex(
114
+ applyDoubleCborEncoding(script.script)
115
+ )
116
+ );
117
+ case "PlutusV2":
118
+ return CML2.Script.new_plutus_v2(
119
+ CML2.PlutusV2Script.from_cbor_hex(
120
+ applyDoubleCborEncoding(script.script)
121
+ )
122
+ );
123
+ default:
124
+ throw new Error("No variant matched.");
125
+ }
126
+ }
127
+ function fromScriptRef(scriptRef) {
128
+ const kind = scriptRef.kind();
129
+ switch (kind) {
130
+ case 0:
131
+ return {
132
+ type: "Native",
133
+ script: scriptRef.as_native().to_cbor_hex()
134
+ };
135
+ case 1:
136
+ return {
137
+ type: "PlutusV1",
138
+ script: scriptRef.as_plutus_v1().to_cbor_hex()
139
+ };
140
+ case 2:
141
+ return {
142
+ type: "PlutusV2",
143
+ script: scriptRef.as_plutus_v2().to_cbor_hex()
144
+ };
145
+ default:
146
+ throw new Error("No variant matched.");
147
+ }
148
+ }
149
+ function mintingPolicyToId(mintingPolicy) {
150
+ return validatorToScriptHash(mintingPolicy);
151
+ }
152
+ function nativeFromJson(nativeScript) {
153
+ return nativeJSFromJson(nativeScript);
154
+ }
155
+ function nativeScriptFromJson(nativeScript) {
156
+ return {
157
+ type: "Native",
158
+ script: CML2.NativeScript.from_json(
159
+ JSON.stringify(nativeScript)
160
+ ).to_cbor_hex()
161
+ };
162
+ }
163
+
164
+ // src/address.ts
165
+ function addressFromHexOrBech32(address) {
166
+ try {
167
+ return CML3.Address.from_hex(address);
168
+ } catch (_e) {
169
+ try {
170
+ return CML3.Address.from_bech32(address);
171
+ } catch (_e2) {
172
+ throw new Error("Could not deserialize address.");
173
+ }
174
+ }
175
+ }
176
+ function credentialToRewardAddress(network, stakeCredential) {
177
+ return CML3.RewardAddress.new(
178
+ networkToId(network),
179
+ stakeCredential.type === "Key" ? CML3.Credential.new_pub_key(
180
+ CML3.Ed25519KeyHash.from_hex(stakeCredential.hash)
181
+ ) : CML3.Credential.new_script(
182
+ CML3.ScriptHash.from_hex(stakeCredential.hash)
183
+ )
184
+ ).to_address().to_bech32(void 0);
185
+ }
186
+ function validatorToRewardAddress(network, validator) {
187
+ const validatorHash = validatorToScriptHash(validator);
188
+ return CML3.RewardAddress.new(
189
+ networkToId(network),
190
+ CML3.Credential.new_script(CML3.ScriptHash.from_hex(validatorHash))
191
+ ).to_address().to_bech32(void 0);
192
+ }
193
+ function getAddressDetails(address) {
194
+ try {
195
+ const parsedAddress = CML3.BaseAddress.from_address(
196
+ CML3.Address.from_bech32(address)
197
+ );
198
+ const paymentCredential = parsedAddress.payment().kind() === 0 ? {
199
+ type: "Key",
200
+ // hash: toHex(
201
+ // parsedAddress.payment_cred().to_keyhash()!.to_bytes(),
202
+ // ),
203
+ hash: parsedAddress.payment().as_pub_key().to_hex()
204
+ } : {
205
+ type: "Script",
206
+ // hash: toHex(
207
+ // parsedAddress.payment_cred().to_scripthash()!.to_bytes(),
208
+ // ),
209
+ hash: parsedAddress.payment().as_script().to_hex()
210
+ };
211
+ const stakeCredential = parsedAddress.stake().kind() === 0 ? (
212
+ // parsedAddress.stake_cred().kind() === 0
213
+ {
214
+ type: "Key",
215
+ hash: parsedAddress.stake().as_pub_key().to_hex()
216
+ // hash: toHex(parsedAddress.stake_cred().to_keyhash()!.to_bytes()),
217
+ }
218
+ ) : {
219
+ type: "Script",
220
+ // hash: toHex(parsedAddress.stake_cred().to_scripthash()!.to_bytes()),
221
+ hash: parsedAddress.stake().as_script().to_hex()
222
+ };
223
+ return {
224
+ type: "Base",
225
+ networkId: parsedAddress.to_address().network_id(),
226
+ address: {
227
+ bech32: parsedAddress.to_address().to_bech32(void 0),
228
+ // hex: toHex(parsedAddress.to_address().to_bytes()),
229
+ hex: parsedAddress.to_address().to_hex()
230
+ },
231
+ paymentCredential,
232
+ stakeCredential
233
+ };
234
+ } catch (_e) {
235
+ }
236
+ try {
237
+ const parsedAddress = CML3.EnterpriseAddress.from_address(
238
+ CML3.Address.from_bech32(address)
239
+ );
240
+ const paymentCredential = parsedAddress.payment().kind() === 0 ? {
241
+ type: "Key",
242
+ // hash: toHex(parsedAddress.payment_cred().to_keyhash()!.to_bytes()),
243
+ hash: parsedAddress.payment().as_pub_key().to_hex()
244
+ } : {
245
+ type: "Script",
246
+ hash: (
247
+ // parsedAddress.payment_cred().to_scripthash()!.to_bytes()
248
+ parsedAddress.payment().as_script().to_hex()
249
+ )
250
+ };
251
+ return {
252
+ type: "Enterprise",
253
+ networkId: parsedAddress.to_address().network_id(),
254
+ address: {
255
+ bech32: parsedAddress.to_address().to_bech32(void 0),
256
+ hex: parsedAddress.to_address().to_hex()
257
+ },
258
+ paymentCredential
259
+ };
260
+ } catch (_e) {
261
+ }
262
+ try {
263
+ const parsedAddress = CML3.PointerAddress.from_address(
264
+ CML3.Address.from_bech32(address)
265
+ );
266
+ const paymentCredential = parsedAddress?.payment().kind() === 0 ? {
267
+ type: "Key",
268
+ // hash: toHex(parsedAddress.payment_cred().to_keyhash()!.to_bytes()),
269
+ hash: parsedAddress.payment().as_pub_key().to_hex()
270
+ } : {
271
+ type: "Script",
272
+ // hash: toHex( parsedAddress.payment_cred().to_scripthash()!.to_bytes()),
273
+ hash: parsedAddress.payment().as_script().to_hex()
274
+ };
275
+ return {
276
+ type: "Pointer",
277
+ networkId: parsedAddress.to_address().network_id(),
278
+ address: {
279
+ bech32: parsedAddress.to_address().to_bech32(void 0),
280
+ // hex: toHex(parsedAddress.to_address().to_bytes()),
281
+ hex: parsedAddress.to_address().to_hex()
282
+ },
283
+ paymentCredential
284
+ };
285
+ } catch (_e) {
286
+ }
287
+ try {
288
+ const parsedAddress = CML3.RewardAddress.from_address(
289
+ CML3.Address.from_bech32(address)
290
+ );
291
+ const stakeCredential = parsedAddress.payment().kind() === 0 ? {
292
+ type: "Key",
293
+ hash: parsedAddress.payment().as_pub_key().to_hex()
294
+ } : {
295
+ type: "Script",
296
+ hash: parsedAddress.payment().as_script().to_hex()
297
+ };
298
+ return {
299
+ type: "Reward",
300
+ networkId: parsedAddress.to_address().network_id(),
301
+ address: {
302
+ bech32: parsedAddress.to_address().to_bech32(void 0),
303
+ // hex: toHex(parsedAddress.to_address().to_bytes()),
304
+ hex: parsedAddress.to_address().to_hex()
305
+ },
306
+ stakeCredential
307
+ };
308
+ } catch (_e) {
309
+ }
310
+ try {
311
+ const parsedAddress = ((address2) => {
312
+ try {
313
+ return CML3.ByronAddress.from_cbor_hex(address2);
314
+ } catch (_e) {
315
+ try {
316
+ return CML3.ByronAddress.from_base58(address2);
317
+ } catch (_e2) {
318
+ throw new Error("Could not deserialize address.");
319
+ }
320
+ }
321
+ })(address);
322
+ return {
323
+ type: "Byron",
324
+ networkId: parsedAddress.content().network_id(),
325
+ address: {
326
+ bech32: "",
327
+ // hex: toHex(parsedAddress.to_address().to_bytes()),
328
+ hex: parsedAddress.to_address().to_hex()
329
+ }
330
+ };
331
+ } catch (_e) {
332
+ }
333
+ throw new Error("No address type matched for: " + address);
334
+ }
335
+
336
+ // src/cost_model.ts
337
+ import * as CML4 from "@dcspark/cardano-multiplatform-lib-nodejs";
338
+ function createCostModels(costModels) {
339
+ const costmdls = CML4.CostModels.new();
340
+ const costmdlV1 = CML4.IntList.new();
341
+ Object.values(costModels.PlutusV2).forEach((cost) => {
342
+ costmdlV1.add(CML4.Int.new(BigInt(cost)));
343
+ });
344
+ costmdls.set_plutus_v1(costmdlV1);
345
+ const costmdlV2 = CML4.IntList.new();
346
+ Object.values(costModels.PlutusV2).forEach((cost) => {
347
+ costmdlV2.add(CML4.Int.new(BigInt(cost)));
348
+ });
349
+ costmdls.set_plutus_v2(costmdlV2);
350
+ return costmdls;
351
+ }
352
+ var PROTOCOL_PARAMETERS_DEFAULT = {
353
+ minFeeA: 44,
354
+ minFeeB: 155381,
355
+ maxTxSize: 16384,
356
+ maxValSize: 5e3,
357
+ keyDeposit: 2000000n,
358
+ poolDeposit: 500000000n,
359
+ priceMem: 0.0577,
360
+ priceStep: 721e-7,
361
+ maxTxExMem: 14000000n,
362
+ maxTxExSteps: 10000000000n,
363
+ coinsPerUtxoByte: 4310n,
364
+ collateralPercentage: 150,
365
+ maxCollateralInputs: 3,
366
+ costModels: {
367
+ PlutusV1: {
368
+ "addInteger-cpu-arguments-intercept": 205665,
369
+ "addInteger-cpu-arguments-slope": 812,
370
+ "addInteger-memory-arguments-intercept": 1,
371
+ "addInteger-memory-arguments-slope": 1,
372
+ "appendByteString-cpu-arguments-intercept": 1e3,
373
+ "appendByteString-cpu-arguments-slope": 571,
374
+ "appendByteString-memory-arguments-intercept": 0,
375
+ "appendByteString-memory-arguments-slope": 1,
376
+ "appendString-cpu-arguments-intercept": 1e3,
377
+ "appendString-cpu-arguments-slope": 24177,
378
+ "appendString-memory-arguments-intercept": 4,
379
+ "appendString-memory-arguments-slope": 1,
380
+ "bData-cpu-arguments": 1e3,
381
+ "bData-memory-arguments": 32,
382
+ "blake2b_256-cpu-arguments-intercept": 117366,
383
+ "blake2b_256-cpu-arguments-slope": 10475,
384
+ "blake2b_256-memory-arguments": 4,
385
+ "cekApplyCost-exBudgetCPU": 23e3,
386
+ "cekApplyCost-exBudgetMemory": 100,
387
+ "cekBuiltinCost-exBudgetCPU": 23e3,
388
+ "cekBuiltinCost-exBudgetMemory": 100,
389
+ "cekConstCost-exBudgetCPU": 23e3,
390
+ "cekConstCost-exBudgetMemory": 100,
391
+ "cekDelayCost-exBudgetCPU": 23e3,
392
+ "cekDelayCost-exBudgetMemory": 100,
393
+ "cekForceCost-exBudgetCPU": 23e3,
394
+ "cekForceCost-exBudgetMemory": 100,
395
+ "cekLamCost-exBudgetCPU": 23e3,
396
+ "cekLamCost-exBudgetMemory": 100,
397
+ "cekStartupCost-exBudgetCPU": 100,
398
+ "cekStartupCost-exBudgetMemory": 100,
399
+ "cekVarCost-exBudgetCPU": 23e3,
400
+ "cekVarCost-exBudgetMemory": 100,
401
+ "chooseData-cpu-arguments": 19537,
402
+ "chooseData-memory-arguments": 32,
403
+ "chooseList-cpu-arguments": 175354,
404
+ "chooseList-memory-arguments": 32,
405
+ "chooseUnit-cpu-arguments": 46417,
406
+ "chooseUnit-memory-arguments": 4,
407
+ "consByteString-cpu-arguments-intercept": 221973,
408
+ "consByteString-cpu-arguments-slope": 511,
409
+ "consByteString-memory-arguments-intercept": 0,
410
+ "consByteString-memory-arguments-slope": 1,
411
+ "constrData-cpu-arguments": 89141,
412
+ "constrData-memory-arguments": 32,
413
+ "decodeUtf8-cpu-arguments-intercept": 497525,
414
+ "decodeUtf8-cpu-arguments-slope": 14068,
415
+ "decodeUtf8-memory-arguments-intercept": 4,
416
+ "decodeUtf8-memory-arguments-slope": 2,
417
+ "divideInteger-cpu-arguments-constant": 196500,
418
+ "divideInteger-cpu-arguments-model-arguments-intercept": 453240,
419
+ "divideInteger-cpu-arguments-model-arguments-slope": 220,
420
+ "divideInteger-memory-arguments-intercept": 0,
421
+ "divideInteger-memory-arguments-minimum": 1,
422
+ "divideInteger-memory-arguments-slope": 1,
423
+ "encodeUtf8-cpu-arguments-intercept": 1e3,
424
+ "encodeUtf8-cpu-arguments-slope": 28662,
425
+ "encodeUtf8-memory-arguments-intercept": 4,
426
+ "encodeUtf8-memory-arguments-slope": 2,
427
+ "equalsByteString-cpu-arguments-constant": 245e3,
428
+ "equalsByteString-cpu-arguments-intercept": 216773,
429
+ "equalsByteString-cpu-arguments-slope": 62,
430
+ "equalsByteString-memory-arguments": 1,
431
+ "equalsData-cpu-arguments-intercept": 1060367,
432
+ "equalsData-cpu-arguments-slope": 12586,
433
+ "equalsData-memory-arguments": 1,
434
+ "equalsInteger-cpu-arguments-intercept": 208512,
435
+ "equalsInteger-cpu-arguments-slope": 421,
436
+ "equalsInteger-memory-arguments": 1,
437
+ "equalsString-cpu-arguments-constant": 187e3,
438
+ "equalsString-cpu-arguments-intercept": 1e3,
439
+ "equalsString-cpu-arguments-slope": 52998,
440
+ "equalsString-memory-arguments": 1,
441
+ "fstPair-cpu-arguments": 80436,
442
+ "fstPair-memory-arguments": 32,
443
+ "headList-cpu-arguments": 43249,
444
+ "headList-memory-arguments": 32,
445
+ "iData-cpu-arguments": 1e3,
446
+ "iData-memory-arguments": 32,
447
+ "ifThenElse-cpu-arguments": 80556,
448
+ "ifThenElse-memory-arguments": 1,
449
+ "indexByteString-cpu-arguments": 57667,
450
+ "indexByteString-memory-arguments": 4,
451
+ "lengthOfByteString-cpu-arguments": 1e3,
452
+ "lengthOfByteString-memory-arguments": 10,
453
+ "lessThanByteString-cpu-arguments-intercept": 197145,
454
+ "lessThanByteString-cpu-arguments-slope": 156,
455
+ "lessThanByteString-memory-arguments": 1,
456
+ "lessThanEqualsByteString-cpu-arguments-intercept": 197145,
457
+ "lessThanEqualsByteString-cpu-arguments-slope": 156,
458
+ "lessThanEqualsByteString-memory-arguments": 1,
459
+ "lessThanEqualsInteger-cpu-arguments-intercept": 204924,
460
+ "lessThanEqualsInteger-cpu-arguments-slope": 473,
461
+ "lessThanEqualsInteger-memory-arguments": 1,
462
+ "lessThanInteger-cpu-arguments-intercept": 208896,
463
+ "lessThanInteger-cpu-arguments-slope": 511,
464
+ "lessThanInteger-memory-arguments": 1,
465
+ "listData-cpu-arguments": 52467,
466
+ "listData-memory-arguments": 32,
467
+ "mapData-cpu-arguments": 64832,
468
+ "mapData-memory-arguments": 32,
469
+ "mkCons-cpu-arguments": 65493,
470
+ "mkCons-memory-arguments": 32,
471
+ "mkNilData-cpu-arguments": 22558,
472
+ "mkNilData-memory-arguments": 32,
473
+ "mkNilPairData-cpu-arguments": 16563,
474
+ "mkNilPairData-memory-arguments": 32,
475
+ "mkPairData-cpu-arguments": 76511,
476
+ "mkPairData-memory-arguments": 32,
477
+ "modInteger-cpu-arguments-constant": 196500,
478
+ "modInteger-cpu-arguments-model-arguments-intercept": 453240,
479
+ "modInteger-cpu-arguments-model-arguments-slope": 220,
480
+ "modInteger-memory-arguments-intercept": 0,
481
+ "modInteger-memory-arguments-minimum": 1,
482
+ "modInteger-memory-arguments-slope": 1,
483
+ "multiplyInteger-cpu-arguments-intercept": 69522,
484
+ "multiplyInteger-cpu-arguments-slope": 11687,
485
+ "multiplyInteger-memory-arguments-intercept": 0,
486
+ "multiplyInteger-memory-arguments-slope": 1,
487
+ "nullList-cpu-arguments": 60091,
488
+ "nullList-memory-arguments": 32,
489
+ "quotientInteger-cpu-arguments-constant": 196500,
490
+ "quotientInteger-cpu-arguments-model-arguments-intercept": 453240,
491
+ "quotientInteger-cpu-arguments-model-arguments-slope": 220,
492
+ "quotientInteger-memory-arguments-intercept": 0,
493
+ "quotientInteger-memory-arguments-minimum": 1,
494
+ "quotientInteger-memory-arguments-slope": 1,
495
+ "remainderInteger-cpu-arguments-constant": 196500,
496
+ "remainderInteger-cpu-arguments-model-arguments-intercept": 453240,
497
+ "remainderInteger-cpu-arguments-model-arguments-slope": 220,
498
+ "remainderInteger-memory-arguments-intercept": 0,
499
+ "remainderInteger-memory-arguments-minimum": 1,
500
+ "remainderInteger-memory-arguments-slope": 1,
501
+ "sha2_256-cpu-arguments-intercept": 806990,
502
+ "sha2_256-cpu-arguments-slope": 30482,
503
+ "sha2_256-memory-arguments": 4,
504
+ "sha3_256-cpu-arguments-intercept": 1927926,
505
+ "sha3_256-cpu-arguments-slope": 82523,
506
+ "sha3_256-memory-arguments": 4,
507
+ "sliceByteString-cpu-arguments-intercept": 265318,
508
+ "sliceByteString-cpu-arguments-slope": 0,
509
+ "sliceByteString-memory-arguments-intercept": 4,
510
+ "sliceByteString-memory-arguments-slope": 0,
511
+ "sndPair-cpu-arguments": 85931,
512
+ "sndPair-memory-arguments": 32,
513
+ "subtractInteger-cpu-arguments-intercept": 205665,
514
+ "subtractInteger-cpu-arguments-slope": 812,
515
+ "subtractInteger-memory-arguments-intercept": 1,
516
+ "subtractInteger-memory-arguments-slope": 1,
517
+ "tailList-cpu-arguments": 41182,
518
+ "tailList-memory-arguments": 32,
519
+ "trace-cpu-arguments": 212342,
520
+ "trace-memory-arguments": 32,
521
+ "unBData-cpu-arguments": 31220,
522
+ "unBData-memory-arguments": 32,
523
+ "unConstrData-cpu-arguments": 32696,
524
+ "unConstrData-memory-arguments": 32,
525
+ "unIData-cpu-arguments": 43357,
526
+ "unIData-memory-arguments": 32,
527
+ "unListData-cpu-arguments": 32247,
528
+ "unListData-memory-arguments": 32,
529
+ "unMapData-cpu-arguments": 38314,
530
+ "unMapData-memory-arguments": 32,
531
+ "verifyEd25519Signature-cpu-arguments-intercept": 9462713,
532
+ "verifyEd25519Signature-cpu-arguments-slope": 1021,
533
+ "verifyEd25519Signature-memory-arguments": 10
534
+ },
535
+ PlutusV2: {
536
+ "addInteger-cpu-arguments-intercept": 205665,
537
+ "addInteger-cpu-arguments-slope": 812,
538
+ "addInteger-memory-arguments-intercept": 1,
539
+ "addInteger-memory-arguments-slope": 1,
540
+ "appendByteString-cpu-arguments-intercept": 1e3,
541
+ "appendByteString-cpu-arguments-slope": 571,
542
+ "appendByteString-memory-arguments-intercept": 0,
543
+ "appendByteString-memory-arguments-slope": 1,
544
+ "appendString-cpu-arguments-intercept": 1e3,
545
+ "appendString-cpu-arguments-slope": 24177,
546
+ "appendString-memory-arguments-intercept": 4,
547
+ "appendString-memory-arguments-slope": 1,
548
+ "bData-cpu-arguments": 1e3,
549
+ "bData-memory-arguments": 32,
550
+ "blake2b_256-cpu-arguments-intercept": 117366,
551
+ "blake2b_256-cpu-arguments-slope": 10475,
552
+ "blake2b_256-memory-arguments": 4,
553
+ "cekApplyCost-exBudgetCPU": 23e3,
554
+ "cekApplyCost-exBudgetMemory": 100,
555
+ "cekBuiltinCost-exBudgetCPU": 23e3,
556
+ "cekBuiltinCost-exBudgetMemory": 100,
557
+ "cekConstCost-exBudgetCPU": 23e3,
558
+ "cekConstCost-exBudgetMemory": 100,
559
+ "cekDelayCost-exBudgetCPU": 23e3,
560
+ "cekDelayCost-exBudgetMemory": 100,
561
+ "cekForceCost-exBudgetCPU": 23e3,
562
+ "cekForceCost-exBudgetMemory": 100,
563
+ "cekLamCost-exBudgetCPU": 23e3,
564
+ "cekLamCost-exBudgetMemory": 100,
565
+ "cekStartupCost-exBudgetCPU": 100,
566
+ "cekStartupCost-exBudgetMemory": 100,
567
+ "cekVarCost-exBudgetCPU": 23e3,
568
+ "cekVarCost-exBudgetMemory": 100,
569
+ "chooseData-cpu-arguments": 19537,
570
+ "chooseData-memory-arguments": 32,
571
+ "chooseList-cpu-arguments": 175354,
572
+ "chooseList-memory-arguments": 32,
573
+ "chooseUnit-cpu-arguments": 46417,
574
+ "chooseUnit-memory-arguments": 4,
575
+ "consByteString-cpu-arguments-intercept": 221973,
576
+ "consByteString-cpu-arguments-slope": 511,
577
+ "consByteString-memory-arguments-intercept": 0,
578
+ "consByteString-memory-arguments-slope": 1,
579
+ "constrData-cpu-arguments": 89141,
580
+ "constrData-memory-arguments": 32,
581
+ "decodeUtf8-cpu-arguments-intercept": 497525,
582
+ "decodeUtf8-cpu-arguments-slope": 14068,
583
+ "decodeUtf8-memory-arguments-intercept": 4,
584
+ "decodeUtf8-memory-arguments-slope": 2,
585
+ "divideInteger-cpu-arguments-constant": 196500,
586
+ "divideInteger-cpu-arguments-model-arguments-intercept": 453240,
587
+ "divideInteger-cpu-arguments-model-arguments-slope": 220,
588
+ "divideInteger-memory-arguments-intercept": 0,
589
+ "divideInteger-memory-arguments-minimum": 1,
590
+ "divideInteger-memory-arguments-slope": 1,
591
+ "encodeUtf8-cpu-arguments-intercept": 1e3,
592
+ "encodeUtf8-cpu-arguments-slope": 28662,
593
+ "encodeUtf8-memory-arguments-intercept": 4,
594
+ "encodeUtf8-memory-arguments-slope": 2,
595
+ "equalsByteString-cpu-arguments-constant": 245e3,
596
+ "equalsByteString-cpu-arguments-intercept": 216773,
597
+ "equalsByteString-cpu-arguments-slope": 62,
598
+ "equalsByteString-memory-arguments": 1,
599
+ "equalsData-cpu-arguments-intercept": 1060367,
600
+ "equalsData-cpu-arguments-slope": 12586,
601
+ "equalsData-memory-arguments": 1,
602
+ "equalsInteger-cpu-arguments-intercept": 208512,
603
+ "equalsInteger-cpu-arguments-slope": 421,
604
+ "equalsInteger-memory-arguments": 1,
605
+ "equalsString-cpu-arguments-constant": 187e3,
606
+ "equalsString-cpu-arguments-intercept": 1e3,
607
+ "equalsString-cpu-arguments-slope": 52998,
608
+ "equalsString-memory-arguments": 1,
609
+ "fstPair-cpu-arguments": 80436,
610
+ "fstPair-memory-arguments": 32,
611
+ "headList-cpu-arguments": 43249,
612
+ "headList-memory-arguments": 32,
613
+ "iData-cpu-arguments": 1e3,
614
+ "iData-memory-arguments": 32,
615
+ "ifThenElse-cpu-arguments": 80556,
616
+ "ifThenElse-memory-arguments": 1,
617
+ "indexByteString-cpu-arguments": 57667,
618
+ "indexByteString-memory-arguments": 4,
619
+ "lengthOfByteString-cpu-arguments": 1e3,
620
+ "lengthOfByteString-memory-arguments": 10,
621
+ "lessThanByteString-cpu-arguments-intercept": 197145,
622
+ "lessThanByteString-cpu-arguments-slope": 156,
623
+ "lessThanByteString-memory-arguments": 1,
624
+ "lessThanEqualsByteString-cpu-arguments-intercept": 197145,
625
+ "lessThanEqualsByteString-cpu-arguments-slope": 156,
626
+ "lessThanEqualsByteString-memory-arguments": 1,
627
+ "lessThanEqualsInteger-cpu-arguments-intercept": 204924,
628
+ "lessThanEqualsInteger-cpu-arguments-slope": 473,
629
+ "lessThanEqualsInteger-memory-arguments": 1,
630
+ "lessThanInteger-cpu-arguments-intercept": 208896,
631
+ "lessThanInteger-cpu-arguments-slope": 511,
632
+ "lessThanInteger-memory-arguments": 1,
633
+ "listData-cpu-arguments": 52467,
634
+ "listData-memory-arguments": 32,
635
+ "mapData-cpu-arguments": 64832,
636
+ "mapData-memory-arguments": 32,
637
+ "mkCons-cpu-arguments": 65493,
638
+ "mkCons-memory-arguments": 32,
639
+ "mkNilData-cpu-arguments": 22558,
640
+ "mkNilData-memory-arguments": 32,
641
+ "mkNilPairData-cpu-arguments": 16563,
642
+ "mkNilPairData-memory-arguments": 32,
643
+ "mkPairData-cpu-arguments": 76511,
644
+ "mkPairData-memory-arguments": 32,
645
+ "modInteger-cpu-arguments-constant": 196500,
646
+ "modInteger-cpu-arguments-model-arguments-intercept": 453240,
647
+ "modInteger-cpu-arguments-model-arguments-slope": 220,
648
+ "modInteger-memory-arguments-intercept": 0,
649
+ "modInteger-memory-arguments-minimum": 1,
650
+ "modInteger-memory-arguments-slope": 1,
651
+ "multiplyInteger-cpu-arguments-intercept": 69522,
652
+ "multiplyInteger-cpu-arguments-slope": 11687,
653
+ "multiplyInteger-memory-arguments-intercept": 0,
654
+ "multiplyInteger-memory-arguments-slope": 1,
655
+ "nullList-cpu-arguments": 60091,
656
+ "nullList-memory-arguments": 32,
657
+ "quotientInteger-cpu-arguments-constant": 196500,
658
+ "quotientInteger-cpu-arguments-model-arguments-intercept": 453240,
659
+ "quotientInteger-cpu-arguments-model-arguments-slope": 220,
660
+ "quotientInteger-memory-arguments-intercept": 0,
661
+ "quotientInteger-memory-arguments-minimum": 1,
662
+ "quotientInteger-memory-arguments-slope": 1,
663
+ "remainderInteger-cpu-arguments-constant": 196500,
664
+ "remainderInteger-cpu-arguments-model-arguments-intercept": 453240,
665
+ "remainderInteger-cpu-arguments-model-arguments-slope": 220,
666
+ "remainderInteger-memory-arguments-intercept": 0,
667
+ "remainderInteger-memory-arguments-minimum": 1,
668
+ "remainderInteger-memory-arguments-slope": 1,
669
+ "serialiseData-cpu-arguments-intercept": 1159724,
670
+ "serialiseData-cpu-arguments-slope": 392670,
671
+ "serialiseData-memory-arguments-intercept": 0,
672
+ "serialiseData-memory-arguments-slope": 2,
673
+ "sha2_256-cpu-arguments-intercept": 806990,
674
+ "sha2_256-cpu-arguments-slope": 30482,
675
+ "sha2_256-memory-arguments": 4,
676
+ "sha3_256-cpu-arguments-intercept": 1927926,
677
+ "sha3_256-cpu-arguments-slope": 82523,
678
+ "sha3_256-memory-arguments": 4,
679
+ "sliceByteString-cpu-arguments-intercept": 265318,
680
+ "sliceByteString-cpu-arguments-slope": 0,
681
+ "sliceByteString-memory-arguments-intercept": 4,
682
+ "sliceByteString-memory-arguments-slope": 0,
683
+ "sndPair-cpu-arguments": 85931,
684
+ "sndPair-memory-arguments": 32,
685
+ "subtractInteger-cpu-arguments-intercept": 205665,
686
+ "subtractInteger-cpu-arguments-slope": 812,
687
+ "subtractInteger-memory-arguments-intercept": 1,
688
+ "subtractInteger-memory-arguments-slope": 1,
689
+ "tailList-cpu-arguments": 41182,
690
+ "tailList-memory-arguments": 32,
691
+ "trace-cpu-arguments": 212342,
692
+ "trace-memory-arguments": 32,
693
+ "unBData-cpu-arguments": 31220,
694
+ "unBData-memory-arguments": 32,
695
+ "unConstrData-cpu-arguments": 32696,
696
+ "unConstrData-memory-arguments": 32,
697
+ "unIData-cpu-arguments": 43357,
698
+ "unIData-memory-arguments": 32,
699
+ "unListData-cpu-arguments": 32247,
700
+ "unListData-memory-arguments": 32,
701
+ "unMapData-cpu-arguments": 38314,
702
+ "unMapData-memory-arguments": 32,
703
+ "verifyEcdsaSecp256k1Signature-cpu-arguments": 35892428,
704
+ "verifyEcdsaSecp256k1Signature-memory-arguments": 10,
705
+ "verifyEd25519Signature-cpu-arguments-intercept": 57996947,
706
+ "verifyEd25519Signature-cpu-arguments-slope": 18975,
707
+ "verifyEd25519Signature-memory-arguments": 10,
708
+ "verifySchnorrSecp256k1Signature-cpu-arguments-intercept": 38887044,
709
+ "verifySchnorrSecp256k1Signature-cpu-arguments-slope": 32947,
710
+ "verifySchnorrSecp256k1Signature-memory-arguments": 10
711
+ }
712
+ }
713
+ };
714
+
715
+ // src/credential.ts
716
+ import * as CML5 from "@dcspark/cardano-multiplatform-lib-nodejs";
717
+ function credentialToAddress(network, paymentCredential, stakeCredential) {
718
+ if (stakeCredential) {
719
+ return CML5.BaseAddress.new(
720
+ networkToId(network),
721
+ paymentCredential.type === "Key" ? CML5.Credential.new_pub_key(
722
+ CML5.Ed25519KeyHash.from_hex(paymentCredential.hash)
723
+ ) : CML5.Credential.new_script(
724
+ CML5.ScriptHash.from_hex(paymentCredential.hash)
725
+ ),
726
+ stakeCredential.type === "Key" ? CML5.Credential.new_pub_key(
727
+ CML5.Ed25519KeyHash.from_hex(stakeCredential.hash)
728
+ ) : CML5.Credential.new_script(
729
+ CML5.ScriptHash.from_hex(stakeCredential.hash)
730
+ )
731
+ ).to_address().to_bech32(void 0);
732
+ } else {
733
+ return CML5.EnterpriseAddress.new(
734
+ networkToId(network),
735
+ paymentCredential.type === "Key" ? CML5.Credential.new_pub_key(
736
+ CML5.Ed25519KeyHash.from_hex(paymentCredential.hash)
737
+ ) : CML5.Credential.new_script(
738
+ CML5.ScriptHash.from_hex(paymentCredential.hash)
739
+ )
740
+ ).to_address().to_bech32(void 0);
741
+ }
742
+ }
743
+ function scriptHashToCredential(scriptHash) {
744
+ return {
745
+ type: "Script",
746
+ hash: scriptHash
747
+ };
748
+ }
749
+ function keyHashToCredential(keyHash) {
750
+ return {
751
+ type: "Key",
752
+ hash: keyHash
753
+ };
754
+ }
755
+ function paymentCredentialOf(address) {
756
+ const { paymentCredential } = getAddressDetails(address);
757
+ if (!paymentCredential) {
758
+ throw new Error(
759
+ "The specified address does not contain a payment credential."
760
+ );
761
+ }
762
+ return paymentCredential;
763
+ }
764
+ function stakeCredentialOf(rewardAddress) {
765
+ const { stakeCredential } = getAddressDetails(rewardAddress);
766
+ if (!stakeCredential) {
767
+ throw new Error(
768
+ "The specified address does not contain a stake credential."
769
+ );
770
+ }
771
+ return stakeCredential;
772
+ }
773
+
774
+ // src/datum.ts
775
+ import * as CML6 from "@dcspark/cardano-multiplatform-lib-nodejs";
776
+ function datumToHash(datum) {
777
+ return CML6.hash_plutus_data(CML6.PlutusData.from_cbor_hex(datum)).to_hex();
778
+ }
779
+
780
+ // src/keys.ts
781
+ import { generateMnemonic } from "@lucid-evolution/bip39";
782
+ import * as CML7 from "@dcspark/cardano-multiplatform-lib-nodejs";
783
+ function generatePrivateKey() {
784
+ return CML7.PrivateKey.generate_ed25519().to_bech32();
785
+ }
786
+ function generateSeedPhrase() {
787
+ return generateMnemonic(256);
788
+ }
789
+ function toPublicKey(privateKey) {
790
+ return CML7.PrivateKey.from_bech32(privateKey).to_public().to_bech32();
791
+ }
792
+
793
+ // src/label.ts
794
+ import { fromHex } from "@lucid-evolution/core-utils";
795
+ import { crc8 } from "@lucid-evolution/crc8";
796
+ function toLabel(num) {
797
+ if (num < 0 || num > 65535) {
798
+ throw new Error(
799
+ `Label ${num} out of range: min label 1 - max label 65535.`
800
+ );
801
+ }
802
+ const numHex = num.toString(16).padStart(4, "0");
803
+ return "0" + numHex + checksum(numHex) + "0";
804
+ }
805
+ function fromLabel(label) {
806
+ if (label.length !== 8 || !(label[0] === "0" && label[7] === "0")) {
807
+ return null;
808
+ }
809
+ const numHex = label.slice(1, 5);
810
+ const num = parseInt(numHex, 16);
811
+ const check = label.slice(5, 7);
812
+ return check === checksum(numHex) ? num : null;
813
+ }
814
+ function checksum(num) {
815
+ return crc8(fromHex(num)).toString(16).padStart(2, "0");
816
+ }
817
+
818
+ // src/time.ts
819
+ import {
820
+ SLOT_CONFIG_NETWORK,
821
+ slotToBeginUnixTime,
822
+ unixTimeToEnclosingSlot
823
+ } from "@lucid-evolution/plutus";
824
+ function unixTimeToSlot(network, unixTime) {
825
+ return unixTimeToEnclosingSlot(unixTime, SLOT_CONFIG_NETWORK[network]);
826
+ }
827
+ function slotToUnixTime(network, slot) {
828
+ return slotToBeginUnixTime(slot, SLOT_CONFIG_NETWORK[network]);
829
+ }
830
+
831
+ // src/utxo.ts
832
+ import * as CML9 from "@dcspark/cardano-multiplatform-lib-nodejs";
833
+
834
+ // src/value.ts
835
+ import { toText } from "@lucid-evolution/core-utils";
836
+ import * as CML8 from "@dcspark/cardano-multiplatform-lib-nodejs";
837
+ function valueToAssets(value) {
838
+ const assets = {};
839
+ assets["lovelace"] = value.coin();
840
+ const ma = value.multi_asset();
841
+ if (ma) {
842
+ const multiAssets = ma.keys();
843
+ for (let j = 0; j < multiAssets.len(); j++) {
844
+ const policy = multiAssets.get(j);
845
+ const policyAssets = ma.get_assets(policy);
846
+ const assetNames = policyAssets.keys();
847
+ for (let k = 0; k < assetNames.len(); k++) {
848
+ const policyAsset = assetNames.get(k);
849
+ const quantity = policyAssets.get(policyAsset);
850
+ const unit = policy.to_hex() + policyAsset.to_cbor_hex();
851
+ assets[unit] = quantity;
852
+ }
853
+ }
854
+ }
855
+ return assets;
856
+ }
857
+ function assetsToValue(assets) {
858
+ const multiAsset = CML8.MultiAsset.new();
859
+ const lovelace = assets["lovelace"];
860
+ const units = Object.keys(assets);
861
+ const policies = Array.from(
862
+ new Set(
863
+ units.filter((unit) => unit !== "lovelace").map((unit) => unit.slice(0, 56))
864
+ )
865
+ );
866
+ policies.forEach((policy) => {
867
+ const policyUnits = units.filter((unit) => unit.slice(0, 56) === policy);
868
+ const assetsValue = CML8.MapAssetNameToCoin.new();
869
+ policyUnits.forEach((unit) => {
870
+ assetsValue.insert(
871
+ CML8.AssetName.from_str(toText(unit.slice(56))),
872
+ BigInt(assets[unit])
873
+ );
874
+ });
875
+ multiAsset.insert_assets(CML8.ScriptHash.from_hex(policy), assetsValue);
876
+ });
877
+ return CML8.Value.new(lovelace, multiAsset);
878
+ }
879
+ function fromUnit(unit) {
880
+ const policyId = unit.slice(0, 56);
881
+ const assetName = unit.slice(56) || null;
882
+ const label = fromLabel(unit.slice(56, 64));
883
+ const name = (() => {
884
+ const hexName = Number.isInteger(label) ? unit.slice(64) : unit.slice(56);
885
+ return hexName || null;
886
+ })();
887
+ return { policyId, assetName, name, label };
888
+ }
889
+ function toUnit(policyId, name, label) {
890
+ const hexLabel = Number.isInteger(label) ? toLabel(label) : "";
891
+ const n = name ? name : "";
892
+ if ((n + hexLabel).length > 64) {
893
+ throw new Error("Asset name size exceeds 32 bytes.");
894
+ }
895
+ if (policyId.length !== 56) {
896
+ throw new Error(`Policy id invalid: ${policyId}.`);
897
+ }
898
+ return policyId + hexLabel + n;
899
+ }
900
+ function addAssets(...assets) {
901
+ return assets.reduce((a, b) => {
902
+ for (const k in b) {
903
+ if (Object.hasOwn(b, k)) {
904
+ a[k] = (a[k] || 0n) + b[k];
905
+ }
906
+ }
907
+ return a;
908
+ }, {});
909
+ }
910
+
911
+ // src/utxo.ts
912
+ var utxoToTransactionOutput = (utxo) => {
913
+ const address = (() => {
914
+ try {
915
+ return CML9.Address.from_bech32(utxo.address);
916
+ } catch (_e) {
917
+ return CML9.ByronAddress.from_base58(utxo.address).to_address();
918
+ }
919
+ })();
920
+ const datumOption = (() => {
921
+ if (utxo.datumHash) {
922
+ return CML9.DatumOption.new_hash(CML9.DatumHash.from_hex(utxo.datumHash));
923
+ }
924
+ if (!utxo.datumHash && utxo.datum) {
925
+ return CML9.DatumOption.new_datum(
926
+ CML9.PlutusData.from_cbor_hex(utxo.datum)
927
+ );
928
+ }
929
+ })();
930
+ const scriptRef = (() => {
931
+ if (utxo.scriptRef) {
932
+ return toScriptRef(utxo.scriptRef);
933
+ }
934
+ })();
935
+ return CML9.TransactionOutput.new(
936
+ address,
937
+ assetsToValue(utxo.assets),
938
+ datumOption,
939
+ scriptRef
940
+ );
941
+ };
942
+ var utxoToTransactionInput = (utxo) => {
943
+ return CML9.TransactionInput.new(
944
+ CML9.TransactionHash.from_hex(utxo.txHash),
945
+ BigInt(utxo.outputIndex)
946
+ );
947
+ };
948
+ function utxoToCore(utxo) {
949
+ const address = (() => {
950
+ try {
951
+ return CML9.Address.from_bech32(utxo.address);
952
+ } catch (_e) {
953
+ return CML9.ByronAddress.from_base58(utxo.address).to_address();
954
+ }
955
+ })();
956
+ const datumOption = (() => {
957
+ if (utxo.datumHash) {
958
+ return CML9.DatumOption.new_hash(CML9.DatumHash.from_hex(utxo.datumHash));
959
+ }
960
+ if (!utxo.datumHash && utxo.datum) {
961
+ return CML9.DatumOption.new_datum(
962
+ CML9.PlutusData.from_cbor_hex(utxo.datum)
963
+ );
964
+ }
965
+ })();
966
+ const scriptRef = (() => {
967
+ if (utxo.scriptRef) {
968
+ return toScriptRef(utxo.scriptRef);
969
+ }
970
+ })();
971
+ const output = CML9.TransactionOutput.new(
972
+ address,
973
+ assetsToValue(utxo.assets),
974
+ datumOption,
975
+ scriptRef
976
+ );
977
+ return CML9.TransactionUnspentOutput.new(
978
+ CML9.TransactionInput.new(
979
+ CML9.TransactionHash.from_hex(utxo.txHash),
980
+ BigInt(utxo.outputIndex)
981
+ ),
982
+ output
983
+ );
984
+ }
985
+ function utxosToCores(utxos) {
986
+ const result = [];
987
+ utxos.map(utxoToCore).forEach((utxo) => result.push(utxo));
988
+ return result;
989
+ }
990
+ function coreToUtxo(coreUtxo) {
991
+ return {
992
+ ...coreToOutRef(CML9.TransactionInput.from_cbor_hex(coreUtxo.to_cbor_hex())),
993
+ ...coreToTxOutput(
994
+ CML9.TransactionOutput.from_cbor_hex(coreUtxo.to_cbor_hex())
995
+ )
996
+ };
997
+ }
998
+ function coresToUtxos(utxos) {
999
+ const result = [];
1000
+ for (let i = 0; i < utxos.length; i++) {
1001
+ result.push(coreToUtxo(utxos[i]));
1002
+ }
1003
+ return result;
1004
+ }
1005
+ function coreToOutRef(input) {
1006
+ return {
1007
+ txHash: input.transaction_id().to_hex(),
1008
+ outputIndex: parseInt(input.index().toString())
1009
+ };
1010
+ }
1011
+ function coresToOutRefs(inputs) {
1012
+ const result = [];
1013
+ for (let i = 0; i < inputs.length; i++) {
1014
+ result.push(coreToOutRef(inputs[i]));
1015
+ }
1016
+ return result;
1017
+ }
1018
+ function coreToTxOutput(output) {
1019
+ return {
1020
+ assets: valueToAssets(output.amount()),
1021
+ address: output.address().to_bech32(void 0),
1022
+ datumHash: output.datum()?.as_hash()?.to_hex(),
1023
+ datum: output.datum()?.as_datum()?.to_cbor_hex(),
1024
+ scriptRef: output.script_ref() && fromScriptRef(output.script_ref())
1025
+ };
1026
+ }
1027
+ function coresToTxOutputs(outputs) {
1028
+ const result = [];
1029
+ for (let i = 0; i < outputs.length; i++) {
1030
+ result.push(coreToTxOutput(outputs[i]));
1031
+ }
1032
+ return result;
1033
+ }
1034
+ export {
1035
+ PROTOCOL_PARAMETERS_DEFAULT,
1036
+ addAssets,
1037
+ addressFromHexOrBech32,
1038
+ applyDoubleCborEncoding,
1039
+ assetsToValue,
1040
+ coreToOutRef,
1041
+ coreToTxOutput,
1042
+ coreToUtxo,
1043
+ coresToOutRefs,
1044
+ coresToTxOutputs,
1045
+ coresToUtxos,
1046
+ createCostModels,
1047
+ credentialToAddress,
1048
+ credentialToRewardAddress,
1049
+ datumToHash,
1050
+ fromLabel,
1051
+ fromScriptRef,
1052
+ fromUnit,
1053
+ generatePrivateKey,
1054
+ generateSeedPhrase,
1055
+ getAddressDetails,
1056
+ keyHashToCredential,
1057
+ mintingPolicyToId,
1058
+ nativeFromJson,
1059
+ nativeJSFromJson,
1060
+ nativeScriptFromJson,
1061
+ networkToId,
1062
+ paymentCredentialOf,
1063
+ scriptHashToCredential,
1064
+ slotToUnixTime,
1065
+ stakeCredentialOf,
1066
+ toLabel,
1067
+ toNativeScript,
1068
+ toPublicKey,
1069
+ toScriptRef,
1070
+ toUnit,
1071
+ unixTimeToSlot,
1072
+ utxoToCore,
1073
+ utxoToTransactionInput,
1074
+ utxoToTransactionOutput,
1075
+ utxosToCores,
1076
+ validatorToAddress,
1077
+ validatorToRewardAddress,
1078
+ validatorToScriptHash,
1079
+ valueToAssets
1080
+ };