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

[QUERY] Setting Fee for particular transactions separately #717

Closed
arnabghose997 opened this issue Apr 24, 2023 · 2 comments
Closed

[QUERY] Setting Fee for particular transactions separately #717

arnabghose997 opened this issue Apr 24, 2023 · 2 comments

Comments

@arnabghose997
Copy link

We can set the general Gas Price option through suggestChainExperimental through one of the following fields :

gasPriceStep: { low: 0.01, avergage: 0.025, high: 0.04 } }

This essential applicable to all Transactions of a blockchain transactions. Does Keplr provides the functionality which allows to set different fee for specific Transactions? So, that once the user tries to perform those specific transactions, the fee options being displayed in UI will be different from the usual one.

@delivan
Copy link
Member

delivan commented Apr 26, 2023

To set a different fee for each tx, simply pass a different gas when passing the fee to the API that signs or broadcasts tx.

...
const fee = {
  amount: [
    {
       denom: "uosmo",
       // this is ignored if `preferNoSetFee` is not true in `KeplrSignOptions`(ref: https://docs.keplr.app/api/#interaction-options)
       amount: "5000",
    },
  ],
  // you can set this conditionally by tx
  gas: "200000",
};
...

the fee is calculated for each gasPriceStep passed in suggestChainExperimental. so it allow the user to choose fee by options. (ex. low fee = gas * gasPriceStep.low)

@arnabghose997
Copy link
Author

@delivan Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants