Skip to content

Commit 285c6bd

Browse files
authored
Merge pull request #261 from Emurgo/feature/change-transactionbuilder-creation
Feature/change transactionbuilder creation
2 parents efaa6dd + ef9ee74 commit 285c6bd

File tree

3 files changed

+253
-127
lines changed

3 files changed

+253
-127
lines changed

rust/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/pkg/cardano_serialization_lib.js.flow

Lines changed: 79 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,14 @@ declare export var NetworkIdKind: {|
265265
+Mainnet: 1, // 1
266266
|};
267267

268+
/**
269+
*/
270+
271+
declare export var StakeCredKind: {|
272+
+Key: 0, // 0
273+
+Script: 1, // 1
274+
|};
275+
268276
/**
269277
*/
270278

@@ -293,14 +301,6 @@ declare export var RedeemerTagKind: {|
293301
+Reward: 3, // 3
294302
|};
295303

296-
/**
297-
*/
298-
299-
declare export var CoinSelectionStrategyCIP2: {|
300-
+LargestFirst: 0, // 0
301-
+RandomImprove: 1, // 1
302-
|};
303-
304304
/**
305305
* Used to choosed the schema for a script JSON string
306306
*/
@@ -333,9 +333,9 @@ declare export var MetadataJsonSchema: {|
333333
/**
334334
*/
335335

336-
declare export var StakeCredKind: {|
337-
+Key: 0, // 0
338-
+Script: 1, // 1
336+
declare export var CoinSelectionStrategyCIP2: {|
337+
+LargestFirst: 0, // 0
338+
+RandomImprove: 1, // 1
339339
|};
340340

341341
/**
@@ -5244,29 +5244,10 @@ declare export class TransactionBuilder {
52445244
): void;
52455245

52465246
/**
5247-
* If set to true, add_change_if_needed will try
5248-
* to put pure Coin in a separate output from assets
5249-
* @param {boolean} prefer_pure_change
5250-
*/
5251-
set_prefer_pure_change(prefer_pure_change: boolean): void;
5252-
5253-
/**
5254-
* @param {LinearFee} linear_fee
5255-
* @param {BigNum} pool_deposit
5256-
* @param {BigNum} key_deposit
5257-
* @param {number} max_value_size
5258-
* @param {number} max_tx_size
5259-
* @param {BigNum} coins_per_utxo_word
5247+
* @param {TransactionBuilderConfig} cfg
52605248
* @returns {TransactionBuilder}
52615249
*/
5262-
static new(
5263-
linear_fee: LinearFee,
5264-
pool_deposit: BigNum,
5265-
key_deposit: BigNum,
5266-
max_value_size: number,
5267-
max_tx_size: number,
5268-
coins_per_utxo_word: BigNum
5269-
): TransactionBuilder;
5250+
static new(cfg: TransactionBuilderConfig): TransactionBuilder;
52705251

52715252
/**
52725253
* does not include refunds or withdrawals
@@ -5340,6 +5321,72 @@ declare export class TransactionBuilder {
53405321
*/
53415322
min_fee(): BigNum;
53425323
}
5324+
/**
5325+
*/
5326+
declare export class TransactionBuilderConfig {
5327+
free(): void;
5328+
}
5329+
/**
5330+
*/
5331+
declare export class TransactionBuilderConfigBuilder {
5332+
free(): void;
5333+
5334+
/**
5335+
* @returns {TransactionBuilderConfigBuilder}
5336+
*/
5337+
static new(): TransactionBuilderConfigBuilder;
5338+
5339+
/**
5340+
* @param {LinearFee} fee_algo
5341+
* @returns {TransactionBuilderConfigBuilder}
5342+
*/
5343+
fee_algo(fee_algo: LinearFee): TransactionBuilderConfigBuilder;
5344+
5345+
/**
5346+
* @param {BigNum} pool_deposit
5347+
* @returns {TransactionBuilderConfigBuilder}
5348+
*/
5349+
pool_deposit(pool_deposit: BigNum): TransactionBuilderConfigBuilder;
5350+
5351+
/**
5352+
* @param {BigNum} key_deposit
5353+
* @returns {TransactionBuilderConfigBuilder}
5354+
*/
5355+
key_deposit(key_deposit: BigNum): TransactionBuilderConfigBuilder;
5356+
5357+
/**
5358+
* @param {number} max_value_size
5359+
* @returns {TransactionBuilderConfigBuilder}
5360+
*/
5361+
max_value_size(max_value_size: number): TransactionBuilderConfigBuilder;
5362+
5363+
/**
5364+
* @param {number} max_tx_size
5365+
* @returns {TransactionBuilderConfigBuilder}
5366+
*/
5367+
max_tx_size(max_tx_size: number): TransactionBuilderConfigBuilder;
5368+
5369+
/**
5370+
* @param {BigNum} coins_per_utxo_word
5371+
* @returns {TransactionBuilderConfigBuilder}
5372+
*/
5373+
coins_per_utxo_word(
5374+
coins_per_utxo_word: BigNum
5375+
): TransactionBuilderConfigBuilder;
5376+
5377+
/**
5378+
* @param {boolean} prefer_pure_change
5379+
* @returns {TransactionBuilderConfigBuilder}
5380+
*/
5381+
prefer_pure_change(
5382+
prefer_pure_change: boolean
5383+
): TransactionBuilderConfigBuilder;
5384+
5385+
/**
5386+
* @returns {TransactionBuilderConfig}
5387+
*/
5388+
build(): TransactionBuilderConfig;
5389+
}
53435390
/**
53445391
*/
53455392
declare export class TransactionHash {

0 commit comments

Comments
 (0)