Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding feerate to mint and burn #4318

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion ironfish-cli/src/commands/wallet/burn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ export class Burn extends IronfishCommand {
minimum: 1n,
flagName: 'fee',
}),
feeRate: IronFlag({
char: 'r',
description: 'The fee rate amount in IRON/Kilobyte',
minimum: 1n,
flagName: 'fee rate',
}),
amount: IronFlag({
char: 'a',
description: 'Amount of coins to burn',
Expand Down Expand Up @@ -149,12 +155,13 @@ export class Burn extends IronfishCommand {
},
],
fee: flags.fee ? CurrencyUtils.encode(flags.fee) : null,
feeRate: flags.feeRate ? CurrencyUtils.encode(flags.feeRate) : null,
expiration: flags.expiration,
confirmations: flags.confirmations,
}

let raw: RawTransaction
if (params.fee === null) {
if (params.fee === null && params.feeRate === null) {
raw = await selectFee({
client,
transaction: params,
Expand Down
10 changes: 8 additions & 2 deletions ironfish-cli/src/commands/wallet/mint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ export class Mint extends IronfishCommand {
minimum: 1n,
flagName: 'fee',
}),
feeRate: IronFlag({
char: 'r',
description: 'The fee rate amount in IRON/Kilobyte',
minimum: 1n,
flagName: 'fee rate',
}),
amount: IronFlag({
char: 'a',
description: 'Amount of coins to mint in IRON',
Expand Down Expand Up @@ -210,13 +216,13 @@ export class Mint extends IronfishCommand {
},
],
fee: flags.fee ? CurrencyUtils.encode(flags.fee) : null,
feeRate: flags.feeRate ? CurrencyUtils.encode(flags.feeRate) : null,
expiration: flags.expiration,
confirmations: flags.confirmations,
}

let raw: RawTransaction

if (params.fee === null) {
if (params.fee === null && params.feeRate === null) {
raw = await selectFee({
client,
transaction: params,
Expand Down