@@ -172,6 +172,26 @@ declare export function decode_metadatum_to_json_str(
172
172
*/
173
173
declare export function min_fee(tx: Transaction, linear_fee: LinearFee): BigNum;
174
174
175
+ /**
176
+ * @param {ExUnits} ex_units
177
+ * @param {ExUnitPrices} ex_unit_prices
178
+ * @returns {BigNum}
179
+ */
180
+ declare export function calculate_ex_units_ceil_cost(
181
+ ex_units: ExUnits,
182
+ ex_unit_prices: ExUnitPrices
183
+ ): BigNum;
184
+
185
+ /**
186
+ * @param {Transaction} tx
187
+ * @param {ExUnitPrices} ex_unit_prices
188
+ * @returns {BigNum}
189
+ */
190
+ declare export function min_script_fee(
191
+ tx: Transaction,
192
+ ex_unit_prices: ExUnitPrices
193
+ ): BigNum;
194
+
175
195
/**
176
196
* @param {string} password
177
197
* @param {string} salt
@@ -648,6 +668,11 @@ declare export class BigInt {
648
668
*/
649
669
static from_bytes(bytes: Uint8Array): BigInt;
650
670
671
+ /**
672
+ * @returns {boolean}
673
+ */
674
+ is_zero(): boolean;
675
+
651
676
/**
652
677
* @returns {BigNum | void}
653
678
*/
@@ -663,6 +688,34 @@ declare export class BigInt {
663
688
* @returns {string}
664
689
*/
665
690
to_str(): string;
691
+
692
+ /**
693
+ * @param {BigInt} other
694
+ * @returns {BigInt}
695
+ */
696
+ add(other: BigInt): BigInt;
697
+
698
+ /**
699
+ * @param {BigInt} other
700
+ * @returns {BigInt}
701
+ */
702
+ mul(other: BigInt): BigInt;
703
+
704
+ /**
705
+ * @returns {BigInt}
706
+ */
707
+ static one(): BigInt;
708
+
709
+ /**
710
+ * @returns {BigInt}
711
+ */
712
+ increment(): BigInt;
713
+
714
+ /**
715
+ * @param {BigInt} other
716
+ * @returns {BigInt}
717
+ */
718
+ div_ceil(other: BigInt): BigInt;
666
719
}
667
720
/**
668
721
*/
@@ -696,6 +749,11 @@ declare export class BigNum {
696
749
*/
697
750
static zero(): BigNum;
698
751
752
+ /**
753
+ * @returns {BigNum}
754
+ */
755
+ static one(): BigNum;
756
+
699
757
/**
700
758
* @returns {boolean}
701
759
*/
@@ -1533,6 +1591,11 @@ declare export class Ed25519KeyHashes {
1533
1591
* @param {Ed25519KeyHash} elem
1534
1592
*/
1535
1593
add(elem: Ed25519KeyHash): void;
1594
+
1595
+ /**
1596
+ * @returns {Ed25519KeyHashes | void}
1597
+ */
1598
+ to_option(): Ed25519KeyHashes | void;
1536
1599
}
1537
1600
/**
1538
1601
*/
@@ -3052,6 +3115,13 @@ declare export class PlutusData {
3052
3115
constr_plutus_data: ConstrPlutusData
3053
3116
): PlutusData;
3054
3117
3118
+ /**
3119
+ * Same as `.new_constr_plutus_data` but creates constr with empty data list
3120
+ * @param {BigNum} alternative
3121
+ * @returns {PlutusData}
3122
+ */
3123
+ static new_empty_constr_plutus_data(alternative: BigNum): PlutusData;
3124
+
3055
3125
/**
3056
3126
* @param {PlutusMap} map
3057
3127
* @returns {PlutusData}
@@ -4258,6 +4328,11 @@ declare export class Redeemers {
4258
4328
* @param {Redeemer} elem
4259
4329
*/
4260
4330
add(elem: Redeemer): void;
4331
+
4332
+ /**
4333
+ * @returns {ExUnits}
4334
+ */
4335
+ total_ex_units(): ExUnits;
4261
4336
}
4262
4337
/**
4263
4338
*/
@@ -5292,6 +5367,16 @@ declare export class TransactionBuilder {
5292
5367
*/
5293
5368
add_inputs_from(inputs: TransactionUnspentOutputs, strategy: number): void;
5294
5369
5370
+ /**
5371
+ * @param {TxInputsBuilder} inputs
5372
+ */
5373
+ set_inputs(inputs: TxInputsBuilder): void;
5374
+
5375
+ /**
5376
+ * @param {TxInputsBuilder} collateral
5377
+ */
5378
+ set_collateral(collateral: TxInputsBuilder): void;
5379
+
5295
5380
/**
5296
5381
* We have to know what kind of inputs these are to know what kind of mock witnesses to create since
5297
5382
* 1) mock witnesses have different lengths depending on the type which changes the expecting fee
@@ -5684,6 +5769,11 @@ declare export class TransactionBuilder {
5684
5769
*/
5685
5770
remove_script_data_hash(): void;
5686
5771
5772
+ /**
5773
+ * @param {Ed25519KeyHash} key
5774
+ */
5775
+ add_required_signer(key: Ed25519KeyHash): void;
5776
+
5687
5777
/**
5688
5778
* @returns {number}
5689
5779
*/
@@ -5754,6 +5844,12 @@ declare export class TransactionBuilderConfigBuilder {
5754
5844
coins_per_utxo_word: BigNum
5755
5845
): TransactionBuilderConfigBuilder;
5756
5846
5847
+ /**
5848
+ * @param {ExUnitPrices} ex_unit_prices
5849
+ * @returns {TransactionBuilderConfigBuilder}
5850
+ */
5851
+ ex_unit_prices(ex_unit_prices: ExUnitPrices): TransactionBuilderConfigBuilder;
5852
+
5757
5853
/**
5758
5854
* @param {BigNum} pool_deposit
5759
5855
* @returns {TransactionBuilderConfigBuilder}
@@ -6346,6 +6442,158 @@ declare export class TxBuilderConstants {
6346
6442
*/
6347
6443
static plutus_default_cost_models(): Costmdls;
6348
6444
}
6445
+ /**
6446
+ */
6447
+ declare export class TxInputsBuilder {
6448
+ free(): void;
6449
+
6450
+ /**
6451
+ * @returns {TxInputsBuilder}
6452
+ */
6453
+ static new(): TxInputsBuilder;
6454
+
6455
+ /**
6456
+ * We have to know what kind of inputs these are to know what kind of mock witnesses to create since
6457
+ * 1) mock witnesses have different lengths depending on the type which changes the expecting fee
6458
+ * 2) Witnesses are a set so we need to get rid of duplicates to avoid over-estimating the fee
6459
+ * @param {Ed25519KeyHash} hash
6460
+ * @param {TransactionInput} input
6461
+ * @param {Value} amount
6462
+ */
6463
+ add_key_input(
6464
+ hash: Ed25519KeyHash,
6465
+ input: TransactionInput,
6466
+ amount: Value
6467
+ ): void;
6468
+
6469
+ /**
6470
+ * This method adds the input to the builder BUT leaves a missing spot for the witness native script
6471
+ *
6472
+ * After adding the input with this method, use `.add_required_native_input_scripts`
6473
+ * and `.add_required_plutus_input_scripts` to add the witness scripts
6474
+ *
6475
+ * Or instead use `.add_native_script_input` and `.add_plutus_script_input`
6476
+ * to add inputs right along with the script, instead of the script hash
6477
+ * @param {ScriptHash} hash
6478
+ * @param {TransactionInput} input
6479
+ * @param {Value} amount
6480
+ */
6481
+ add_script_input(
6482
+ hash: ScriptHash,
6483
+ input: TransactionInput,
6484
+ amount: Value
6485
+ ): void;
6486
+
6487
+ /**
6488
+ * This method will add the input to the builder and also register the required native script witness
6489
+ * @param {NativeScript} script
6490
+ * @param {TransactionInput} input
6491
+ * @param {Value} amount
6492
+ */
6493
+ add_native_script_input(
6494
+ script: NativeScript,
6495
+ input: TransactionInput,
6496
+ amount: Value
6497
+ ): void;
6498
+
6499
+ /**
6500
+ * This method will add the input to the builder and also register the required plutus witness
6501
+ * @param {PlutusWitness} witness
6502
+ * @param {TransactionInput} input
6503
+ * @param {Value} amount
6504
+ */
6505
+ add_plutus_script_input(
6506
+ witness: PlutusWitness,
6507
+ input: TransactionInput,
6508
+ amount: Value
6509
+ ): void;
6510
+
6511
+ /**
6512
+ * @param {ByronAddress} hash
6513
+ * @param {TransactionInput} input
6514
+ * @param {Value} amount
6515
+ */
6516
+ add_bootstrap_input(
6517
+ hash: ByronAddress,
6518
+ input: TransactionInput,
6519
+ amount: Value
6520
+ ): void;
6521
+
6522
+ /**
6523
+ * Note that for script inputs this method will use underlying generic `.add_script_input`
6524
+ * which leaves a required empty spot for the script witness (or witnesses in case of Plutus).
6525
+ * You can use `.add_native_script_input` or `.add_plutus_script_input` directly to register the input along with the witness.
6526
+ * @param {Address} address
6527
+ * @param {TransactionInput} input
6528
+ * @param {Value} amount
6529
+ */
6530
+ add_input(address: Address, input: TransactionInput, amount: Value): void;
6531
+
6532
+ /**
6533
+ * Returns the number of still missing input scripts (either native or plutus)
6534
+ * Use `.add_required_native_input_scripts` or `.add_required_plutus_input_scripts` to add the missing scripts
6535
+ * @returns {number}
6536
+ */
6537
+ count_missing_input_scripts(): number;
6538
+
6539
+ /**
6540
+ * Try adding the specified scripts as witnesses for ALREADY ADDED script inputs
6541
+ * Any scripts that don't match any of the previously added inputs will be ignored
6542
+ * Returns the number of remaining required missing witness scripts
6543
+ * Use `.count_missing_input_scripts` to find the number of still missing scripts
6544
+ * @param {NativeScripts} scripts
6545
+ * @returns {number}
6546
+ */
6547
+ add_required_native_input_scripts(scripts: NativeScripts): number;
6548
+
6549
+ /**
6550
+ * Try adding the specified scripts as witnesses for ALREADY ADDED script inputs
6551
+ * Any scripts that don't match any of the previously added inputs will be ignored
6552
+ * Returns the number of remaining required missing witness scripts
6553
+ * Use `.count_missing_input_scripts` to find the number of still missing scripts
6554
+ * @param {PlutusWitnesses} scripts
6555
+ * @returns {number}
6556
+ */
6557
+ add_required_plutus_input_scripts(scripts: PlutusWitnesses): number;
6558
+
6559
+ /**
6560
+ * Returns a copy of the current script input witness scripts in the builder
6561
+ * @returns {NativeScripts | void}
6562
+ */
6563
+ get_native_input_scripts(): NativeScripts | void;
6564
+
6565
+ /**
6566
+ * Returns a copy of the current plutus input witness scripts in the builder.
6567
+ * NOTE: each plutus witness will be cloned with a specific corresponding input index
6568
+ * @returns {PlutusWitnesses | void}
6569
+ */
6570
+ get_plutus_input_scripts(): PlutusWitnesses | void;
6571
+
6572
+ /**
6573
+ * @returns {number}
6574
+ */
6575
+ len(): number;
6576
+
6577
+ /**
6578
+ * @param {Ed25519KeyHash} key
6579
+ */
6580
+ add_required_signer(key: Ed25519KeyHash): void;
6581
+
6582
+ /**
6583
+ * @param {Ed25519KeyHashes} keys
6584
+ */
6585
+ add_required_signers(keys: Ed25519KeyHashes): void;
6586
+
6587
+ /**
6588
+ * @returns {TransactionInputs}
6589
+ */
6590
+ inputs(): TransactionInputs;
6591
+
6592
+ /**
6593
+ * @returns {TransactionInputs | void}
6594
+ */
6595
+ inputs_option(): TransactionInputs | void;
6596
+ }
6349
6597
/**
6350
6598
*/
6351
6599
declare export class URL {
0 commit comments