@@ -293,6 +293,14 @@ declare export var RedeemerTagKind: {|
293
293
+Reward: 3, // 3
294
294
|};
295
295
296
+ /**
297
+ */
298
+
299
+ declare export var CoinSelectionStrategyCIP2: {|
300
+ +LargestFirst: 0, // 0
301
+ +RandomImprove: 1, // 1
302
+ |};
303
+
296
304
/**
297
305
* Used to choosed the schema for a script JSON string
298
306
*/
@@ -322,14 +330,6 @@ declare export var MetadataJsonSchema: {|
322
330
+DetailedSchema: 2, // 2
323
331
|};
324
332
325
- /**
326
- */
327
-
328
- declare export var CoinSelectionStrategyCIP2: {|
329
- +LargestFirst: 0, // 0
330
- +RandomImprove: 1, // 1
331
- |};
332
-
333
333
/**
334
334
*/
335
335
@@ -2434,6 +2434,13 @@ declare export class Mint {
2434
2434
*/
2435
2435
static new(): Mint;
2436
2436
2437
+ /**
2438
+ * @param {ScriptHash} key
2439
+ * @param {MintAssets} value
2440
+ * @returns {Mint}
2441
+ */
2442
+ static new_from_entry(key: ScriptHash, value: MintAssets): Mint;
2443
+
2437
2444
/**
2438
2445
* @returns {number}
2439
2446
*/
@@ -2456,6 +2463,18 @@ declare export class Mint {
2456
2463
* @returns {ScriptHashes}
2457
2464
*/
2458
2465
keys(): ScriptHashes;
2466
+
2467
+ /**
2468
+ * Returns the multiasset where only positive (minting) entries are present
2469
+ * @returns {MultiAsset}
2470
+ */
2471
+ as_positive_multiasset(): MultiAsset;
2472
+
2473
+ /**
2474
+ * Returns the multiasset where only negative (burning) entries are present
2475
+ * @returns {MultiAsset}
2476
+ */
2477
+ as_negative_multiasset(): MultiAsset;
2459
2478
}
2460
2479
/**
2461
2480
*/
@@ -2467,6 +2486,13 @@ declare export class MintAssets {
2467
2486
*/
2468
2487
static new(): MintAssets;
2469
2488
2489
+ /**
2490
+ * @param {AssetName} key
2491
+ * @param {Int} value
2492
+ * @returns {MintAssets}
2493
+ */
2494
+ static new_from_entry(key: AssetName, value: Int): MintAssets;
2495
+
2470
2496
/**
2471
2497
* @returns {number}
2472
2498
*/
@@ -5027,6 +5053,45 @@ declare export class TransactionBuilder {
5027
5053
): BigNum;
5028
5054
5029
5055
/**
5056
+ * Add output by specifying the Address and Value
5057
+ * @param {Address} address
5058
+ * @param {Value} amount
5059
+ */
5060
+ add_output_amount(address: Address, amount: Value): void;
5061
+
5062
+ /**
5063
+ * Add output by specifying the Address and Coin (BigNum)
5064
+ * Output will have no additional assets
5065
+ * @param {Address} address
5066
+ * @param {BigNum} coin
5067
+ */
5068
+ add_output_coin(address: Address, coin: BigNum): void;
5069
+
5070
+ /**
5071
+ * Add output by specifying the Address, the Coin (BigNum), and the MultiAsset
5072
+ * @param {Address} address
5073
+ * @param {BigNum} coin
5074
+ * @param {MultiAsset} multiasset
5075
+ */
5076
+ add_output_coin_and_asset(
5077
+ address: Address,
5078
+ coin: BigNum,
5079
+ multiasset: MultiAsset
5080
+ ): void;
5081
+
5082
+ /**
5083
+ * Add output by specifying the Address and the MultiAsset
5084
+ * The output will be set to contain the minimum required amount of Coin
5085
+ * @param {Address} address
5086
+ * @param {MultiAsset} multiasset
5087
+ */
5088
+ add_output_asset_and_min_required_coin(
5089
+ address: Address,
5090
+ multiasset: MultiAsset
5091
+ ): void;
5092
+
5093
+ /**
5094
+ * Add explicit output via a TransactionOutput object
5030
5095
* @param {TransactionOutput} output
5031
5096
*/
5032
5097
add_output(output: TransactionOutput): void;
@@ -5064,11 +5129,123 @@ declare export class TransactionBuilder {
5064
5129
set_withdrawals(withdrawals: Withdrawals): void;
5065
5130
5066
5131
/**
5132
+ * @returns {AuxiliaryData | void}
5133
+ */
5134
+ get_auxiliary_data(): AuxiliaryData | void;
5135
+
5136
+ /**
5137
+ * Set explicit auxiliary data via an AuxiliaryData object
5138
+ * It might contain some metadata plus native or Plutus scripts
5067
5139
* @param {AuxiliaryData} auxiliary_data
5068
5140
*/
5069
5141
set_auxiliary_data(auxiliary_data: AuxiliaryData): void;
5070
5142
5071
5143
/**
5144
+ * Set metadata using a GeneralTransactionMetadata object
5145
+ * It will be set to the existing or new auxiliary data in this builder
5146
+ * @param {GeneralTransactionMetadata} metadata
5147
+ */
5148
+ set_metadata(metadata: GeneralTransactionMetadata): void;
5149
+
5150
+ /**
5151
+ * Add a single metadatum using TransactionMetadatumLabel and TransactionMetadatum objects
5152
+ * It will be securely added to existing or new metadata in this builder
5153
+ * @param {BigNum} key
5154
+ * @param {TransactionMetadatum} val
5155
+ */
5156
+ add_metadatum(key: BigNum, val: TransactionMetadatum): void;
5157
+
5158
+ /**
5159
+ * Add a single JSON metadatum using a TransactionMetadatumLabel and a String
5160
+ * It will be securely added to existing or new metadata in this builder
5161
+ * @param {BigNum} key
5162
+ * @param {string} val
5163
+ */
5164
+ add_json_metadatum(key: BigNum, val: string): void;
5165
+
5166
+ /**
5167
+ * Add a single JSON metadatum using a TransactionMetadatumLabel, a String, and a MetadataJsonSchema object
5168
+ * It will be securely added to existing or new metadata in this builder
5169
+ * @param {BigNum} key
5170
+ * @param {string} val
5171
+ * @param {number} schema
5172
+ */
5173
+ add_json_metadatum_with_schema(
5174
+ key: BigNum,
5175
+ val: string,
5176
+ schema: number
5177
+ ): void;
5178
+
5179
+ /**
5180
+ * Set explicit Mint object to this builder
5181
+ * it will replace any previously existing mint
5182
+ * @param {Mint} mint
5183
+ */
5184
+ set_mint(mint: Mint): void;
5185
+
5186
+ /**
5187
+ * Add a mint entry to this builder using a PolicyID and MintAssets object
5188
+ * It will be securely added to existing or new Mint in this builder
5189
+ * It will replace any existing mint assets with the same PolicyID
5190
+ * @param {ScriptHash} policy_id
5191
+ * @param {MintAssets} mint_assets
5192
+ */
5193
+ set_mint_asset(policy_id: ScriptHash, mint_assets: MintAssets): void;
5194
+
5195
+ /**
5196
+ * Add a mint entry to this builder using a PolicyID, AssetName, and Int object for amount
5197
+ * It will be securely added to existing or new Mint in this builder
5198
+ * It will replace any previous existing amount same PolicyID and AssetName
5199
+ * @param {ScriptHash} policy_id
5200
+ * @param {AssetName} asset_name
5201
+ * @param {Int} amount
5202
+ */
5203
+ add_mint_asset(
5204
+ policy_id: ScriptHash,
5205
+ asset_name: AssetName,
5206
+ amount: Int
5207
+ ): void;
5208
+
5209
+ /**
5210
+ * Add a mint entry together with an output to this builder
5211
+ * Using a PolicyID, AssetName, Int for amount, Address, and Coin (BigNum) objects
5212
+ * The asset will be securely added to existing or new Mint in this builder
5213
+ * A new output will be added with the specified Address, the Coin value, and the minted asset
5214
+ * @param {ScriptHash} policy_id
5215
+ * @param {AssetName} asset_name
5216
+ * @param {Int} amount
5217
+ * @param {Address} address
5218
+ * @param {BigNum} output_coin
5219
+ */
5220
+ add_mint_asset_and_output(
5221
+ policy_id: ScriptHash,
5222
+ asset_name: AssetName,
5223
+ amount: Int,
5224
+ address: Address,
5225
+ output_coin: BigNum
5226
+ ): void;
5227
+
5228
+ /**
5229
+ * Add a mint entry together with an output to this builder
5230
+ * Using a PolicyID, AssetName, Int for amount, and Address objects
5231
+ * The asset will be securely added to existing or new Mint in this builder
5232
+ * A new output will be added with the specified Address and the minted asset
5233
+ * The output will be set to contain the minimum required amount of Coin
5234
+ * @param {ScriptHash} policy_id
5235
+ * @param {AssetName} asset_name
5236
+ * @param {Int} amount
5237
+ * @param {Address} address
5238
+ */
5239
+ add_mint_asset_and_output_min_required_coin(
5240
+ policy_id: ScriptHash,
5241
+ asset_name: AssetName,
5242
+ amount: Int,
5243
+ address: Address
5244
+ ): void;
5245
+
5246
+ /**
5247
+ * If set to true, add_change_if_needed will try
5248
+ * to put pure Coin in a separate output from assets
5072
5249
* @param {boolean} prefer_pure_change
5073
5250
*/
5074
5251
set_prefer_pure_change(prefer_pure_change: boolean): void;
@@ -5121,6 +5298,9 @@ declare export class TransactionBuilder {
5121
5298
5122
5299
/**
5123
5300
* Warning: this function will mutate the /fee/ field
5301
+ * Make sure to call this function last after setting all other tx-body properties
5302
+ * Editing inputs, outputs, mint, etc. after change been calculated
5303
+ * might cause a mismatch in calculated fee versus the required fee
5124
5304
* @param {Address} address
5125
5305
* @returns {boolean}
5126
5306
*/
@@ -5137,10 +5317,21 @@ declare export class TransactionBuilder {
5137
5317
output_sizes(): Uint32Array;
5138
5318
5139
5319
/**
5320
+ * Returns object the body of the new transaction
5321
+ * Auxiliary data itself is not included
5322
+ * You can use `get_auxiliary_date` or `build_tx`
5140
5323
* @returns {TransactionBody}
5141
5324
*/
5142
5325
build(): TransactionBody;
5143
5326
5327
+ /**
5328
+ * Returns full Transaction object with the body and the auxiliary data
5329
+ * NOTE: witness_set is set to just empty set
5330
+ * NOTE: is_valid set to true
5331
+ * @returns {Transaction}
5332
+ */
5333
+ build_tx(): Transaction;
5334
+
5144
5335
/**
5145
5336
* warning: sum of all parts of a transaction must equal 0. You cannot just set the fee to the min value and forget about it
5146
5337
* warning: min_fee may be slightly larger than the actual minimum fee (ex: a few lovelaces)
@@ -5827,6 +6018,12 @@ declare export class Value {
5827
6018
*/
5828
6019
static new(coin: BigNum): Value;
5829
6020
6021
+ /**
6022
+ * @param {MultiAsset} multiasset
6023
+ * @returns {Value}
6024
+ */
6025
+ static new_from_assets(multiasset: MultiAsset): Value;
6026
+
5830
6027
/**
5831
6028
* @returns {Value}
5832
6029
*/
0 commit comments