英文:
Keplr keeps overriding fees set from the frontend
问题
我意识到Keplr一直在覆盖我在前端dapp中设置的费用,因此它没有考虑我合同中设置的合同溢价。我如何强制Keplr使用前端设置的费用?
const broadcastResult = await signingClient.signAndBroadcast(
accounts[0].address,
[msgAny],
"auto",
memo,
);
英文:
I realize that Keplr keeps overriding the fees that I set in my frontend dapp and therefore it's not considering the contract premium set for my contract. How can I force Keplr to use the fees set in the frontend?
const broadcastResult = await signingClient.signAndBroadcast(
accounts[0].address,
[msgAny],
"auto",
memo,
);
答案1
得分: 1
默认情况下,Keplr会在签名页面上覆盖交易费用,而不管前端是否已经定义了自己的费用,这在arch3.js中是一种情况。这导致在某些情况下交易费用显著增加。为解决这个问题,我们建议Dapp前端使用Keplr中的交互式选项(https://docs.keplr.app/api/#interaction-options)功能。此功能将优先考虑前端建议的费用,而不是覆盖它。
window.keplr.defaultOptions = {
sign: {
preferNoSetFee: true,
}
}
英文:
By default, Keplr overrides the transaction fee on the signing page, regardless of whether the frontend has defined its own fees which is the case with arch3.js. This has led to significantly higher transaction fees in some instances. To address this problem, we recommend that dapp frontends make use of the Interactive Options (https://docs.keplr.app/api/#interaction-options) feature within Keplr. This feature will give priority to the frontend-suggested fee instead of overriding it.
window.keplr.defaultOptions = {
sign: {
preferNoSetFee: true,
}
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论