@@ -293,6 +293,14 @@ declare export var RedeemerTagKind: {|
293293 +Reward: 3, // 3
294294|};
295295
296+ /**
297+ */
298+
299+ declare export var CoinSelectionStrategyCIP2: {|
300+ +LargestFirst: 0, // 0
301+ +RandomImprove: 1, // 1
302+ |};
303+
296304/**
297305 * Used to choosed the schema for a script JSON string
298306 */
@@ -322,14 +330,6 @@ declare export var MetadataJsonSchema: {|
322330 +DetailedSchema: 2, // 2
323331|};
324332
325- /**
326- */
327-
328- declare export var CoinSelectionStrategyCIP2: {|
329- +LargestFirst: 0, // 0
330- +RandomImprove: 1, // 1
331- |};
332-
333333/**
334334 */
335335
@@ -2434,6 +2434,13 @@ declare export class Mint {
24342434 */
24352435 static new(): Mint;
24362436
2437+ /**
2438+ * @param {ScriptHash} key
2439+ * @param {MintAssets} value
2440+ * @returns {Mint}
2441+ */
2442+ static new_from_entry(key: ScriptHash, value: MintAssets): Mint;
2443+
24372444 /**
24382445 * @returns {number}
24392446 */
@@ -2456,6 +2463,16 @@ declare export class Mint {
24562463 * @returns {ScriptHashes}
24572464 */
24582465 keys(): ScriptHashes;
2466+
2467+ /**
2468+ * @returns {MultiAsset}
2469+ */
2470+ to_multiasset(): MultiAsset;
2471+
2472+ /**
2473+ * @returns {Value}
2474+ */
2475+ to_value(): Value;
24592476}
24602477/**
24612478 */
@@ -2467,6 +2484,13 @@ declare export class MintAssets {
24672484 */
24682485 static new(): MintAssets;
24692486
2487+ /**
2488+ * @param {AssetName} key
2489+ * @param {Int} value
2490+ * @returns {MintAssets}
2491+ */
2492+ static new_from_entry(key: AssetName, value: Int): MintAssets;
2493+
24702494 /**
24712495 * @returns {number}
24722496 */
@@ -5027,6 +5051,45 @@ declare export class TransactionBuilder {
50275051 ): BigNum;
50285052
50295053 /**
5054+ * Add output by specifying the Address and Value
5055+ * @param {Address} address
5056+ * @param {Value} amount
5057+ */
5058+ add_output_amount(address: Address, amount: Value): void;
5059+
5060+ /**
5061+ * Add output by specifying the Address and Coin (BigNum)
5062+ * Output will have no additional assets
5063+ * @param {Address} address
5064+ * @param {BigNum} coin
5065+ */
5066+ add_output_coin(address: Address, coin: BigNum): void;
5067+
5068+ /**
5069+ * Add output by specifying the Address, the Coin (BigNum), and the MultiAsset
5070+ * @param {Address} address
5071+ * @param {BigNum} coin
5072+ * @param {MultiAsset} multiasset
5073+ */
5074+ add_output_coin_and_asset(
5075+ address: Address,
5076+ coin: BigNum,
5077+ multiasset: MultiAsset
5078+ ): void;
5079+
5080+ /**
5081+ * Add output by specifying the Address and the MultiAsset
5082+ * The output will be set to contain the minimum required amount of Coin
5083+ * @param {Address} address
5084+ * @param {MultiAsset} multiasset
5085+ */
5086+ add_output_asset_and_min_required_coin(
5087+ address: Address,
5088+ multiasset: MultiAsset
5089+ ): void;
5090+
5091+ /**
5092+ * Add explicit output via a TransactionOutput object
50305093 * @param {TransactionOutput} output
50315094 */
50325095 add_output(output: TransactionOutput): void;
@@ -5064,11 +5127,118 @@ declare export class TransactionBuilder {
50645127 set_withdrawals(withdrawals: Withdrawals): void;
50655128
50665129 /**
5130+ * Set explicit auxiliary data via an AuxiliaryData object
5131+ * It might contain some metadata plus native or Plutus scripts
50675132 * @param {AuxiliaryData} auxiliary_data
50685133 */
50695134 set_auxiliary_data(auxiliary_data: AuxiliaryData): void;
50705135
50715136 /**
5137+ * Set metadata using a GeneralTransactionMetadata object
5138+ * It will be set to the existing or new auxiliary data in this builder
5139+ * @param {GeneralTransactionMetadata} metadata
5140+ */
5141+ set_metadata(metadata: GeneralTransactionMetadata): void;
5142+
5143+ /**
5144+ * Add a single metadatum using TransactionMetadatumLabel and TransactionMetadatum objects
5145+ * It will be securely added to existing or new metadata in this builder
5146+ * @param {BigNum} key
5147+ * @param {TransactionMetadatum} val
5148+ */
5149+ add_metadatum(key: BigNum, val: TransactionMetadatum): void;
5150+
5151+ /**
5152+ * Add a single JSON metadatum using a TransactionMetadatumLabel and a String
5153+ * It will be securely added to existing or new metadata in this builder
5154+ * @param {BigNum} key
5155+ * @param {string} val
5156+ */
5157+ add_json_metadatum(key: BigNum, val: string): void;
5158+
5159+ /**
5160+ * Add a single JSON metadatum using a TransactionMetadatumLabel, a String, and a MetadataJsonSchema object
5161+ * It will be securely added to existing or new metadata in this builder
5162+ * @param {BigNum} key
5163+ * @param {string} val
5164+ * @param {number} schema
5165+ */
5166+ add_json_metadatum_with_schema(
5167+ key: BigNum,
5168+ val: string,
5169+ schema: number
5170+ ): void;
5171+
5172+ /**
5173+ * Set explicit Mint object to this builder
5174+ * it will replace any previously existing mint
5175+ * @param {Mint} mint
5176+ */
5177+ set_mint(mint: Mint): void;
5178+
5179+ /**
5180+ * Add a mint entry to this builder using a PolicyID and MintAssets object
5181+ * It will be securely added to existing or new Mint in this builder
5182+ * It will replace any existing mint assets with the same PolicyID
5183+ * @param {ScriptHash} policy_id
5184+ * @param {MintAssets} mint_assets
5185+ */
5186+ set_mint_asset(policy_id: ScriptHash, mint_assets: MintAssets): void;
5187+
5188+ /**
5189+ * Add a mint entry to this builder using a PolicyID, AssetName, and Int object for amount
5190+ * It will be securely added to existing or new Mint in this builder
5191+ * It will replace any previous existing amount same PolicyID and AssetName
5192+ * @param {ScriptHash} policy_id
5193+ * @param {AssetName} asset_name
5194+ * @param {Int} amount
5195+ */
5196+ add_mint_asset(
5197+ policy_id: ScriptHash,
5198+ asset_name: AssetName,
5199+ amount: Int
5200+ ): void;
5201+
5202+ /**
5203+ * Add a mint entry together with an output to this builder
5204+ * Using a PolicyID, AssetName, Int for amount, Address, and Coin (BigNum) objects
5205+ * The asset will be securely added to existing or new Mint in this builder
5206+ * A new output will be added with the specified Address, the Coin value, and the minted asset
5207+ * @param {ScriptHash} policy_id
5208+ * @param {AssetName} asset_name
5209+ * @param {Int} amount
5210+ * @param {Address} address
5211+ * @param {BigNum} output_coin
5212+ */
5213+ add_mint_asset_and_output(
5214+ policy_id: ScriptHash,
5215+ asset_name: AssetName,
5216+ amount: Int,
5217+ address: Address,
5218+ output_coin: BigNum
5219+ ): void;
5220+
5221+ /**
5222+ * Add a mint entry together with an output to this builder
5223+ * Using a PolicyID, AssetName, Int for amount, and Address objects
5224+ * The asset will be securely added to existing or new Mint in this builder
5225+ * A new output will be added with the specified Address and the minted asset
5226+ * The output will be set to contain the minimum required amount of Coin
5227+ * @param {ScriptHash} policy_id
5228+ * @param {AssetName} asset_name
5229+ * @param {Int} amount
5230+ * @param {Address} address
5231+ */
5232+ add_mint_asset_and_output_min_required_coin(
5233+ policy_id: ScriptHash,
5234+ asset_name: AssetName,
5235+ amount: Int,
5236+ address: Address
5237+ ): void;
5238+
5239+ /**
5240+ * If set to true, add_change_if_needed will try
5241+ * to put pure Coin in a separate output from assets
50725242 * @param {boolean} prefer_pure_change
50735243 */
50745244 set_prefer_pure_change(prefer_pure_change: boolean): void;
@@ -5103,6 +5273,12 @@ declare export class TransactionBuilder {
51035273 */
51045274 get_implicit_input(): Value;
51055275
5276+ /**
5277+ * mint as value
5278+ * @returns {Value}
5279+ */
5280+ get_mint_value(): Value;
5281+
51065282 /**
51075283 * does not include fee
51085284 * @returns {Value}
@@ -5121,6 +5297,9 @@ declare export class TransactionBuilder {
51215297
51225298 /**
51235299 * Warning: this function will mutate the /fee/ field
5300+ * Make sure to call this function last after setting all other tx-body properties
5301+ * Editing inputs, outputs, mint, etc. after change been calculated
5302+ * might cause a mismatch in calculated fee versus the required fee
51245303 * @param {Address} address
51255304 * @returns {boolean}
51265305 */
0 commit comments