@@ -18,7 +18,7 @@ import BigNumber from "bignumber.js";
1818import * as Comlink from "comlink" ;
1919import { NamadaKeychain } from "hooks/useNamadaKeychain" ;
2020import { buildTx , EncodedTxData , isPublicKeyRevealed } from "lib/query" ;
21- import { Address , ChainSettings , FrontendFeeConfig , GasConfig } from "types" ;
21+ import { Address , ChainSettings , FrontendFee , GasConfig } from "types" ;
2222import { getSdkInstance } from "utils/sdk" ;
2323import {
2424 IbcTransfer ,
@@ -169,7 +169,7 @@ export const createShieldingTransferTx = async (
169169 props : ShieldingTransferProps [ ] ,
170170 gasConfig : GasConfig ,
171171 rpcUrl : string ,
172- frontendFeeConfig : FrontendFeeConfig ,
172+ frontendFee : FrontendFee ,
173173 memo ?: string
174174) : Promise < EncodedTxData < ShieldingTransferProps > | undefined > => {
175175 const source = props [ 0 ] ?. data [ 0 ] ?. source ;
@@ -192,7 +192,7 @@ export const createShieldingTransferTx = async (
192192 buildTxFn : async ( workerLink ) => {
193193 const publicKeyRevealed = await isPublicKeyRevealed ( account . address ) ;
194194 const frontendSusFee = frontendSusMsgFromConfig (
195- frontendFeeConfig ,
195+ frontendFee ,
196196 token ,
197197 "transparent"
198198 ) ;
@@ -228,7 +228,7 @@ export const createUnshieldingTransferTx = async (
228228 gasConfig : GasConfig ,
229229 rpcUrl : string ,
230230 disposableSigner : GenDisposableSignerResponse ,
231- frontendFeeConfig : FrontendFeeConfig ,
231+ frontendFee : FrontendFee ,
232232 memo ?: string
233233) : Promise < EncodedTxData < UnshieldingTransferProps > | undefined > => {
234234 const { publicKey : signerPublicKey } = disposableSigner ;
@@ -253,7 +253,7 @@ export const createUnshieldingTransferTx = async (
253253 nativeToken : chain . nativeTokenAddress ,
254254 buildTxFn : async ( workerLink ) => {
255255 const frontendSusFee = frontendSusMsgFromConfig (
256- frontendFeeConfig ,
256+ frontendFee ,
257257 token ,
258258 "transparent"
259259 ) ;
@@ -289,7 +289,7 @@ export const createIbcTx = async (
289289 gasConfig : GasConfig ,
290290 rpcUrl : string ,
291291 signerPublicKey : string ,
292- frontendFeeConfig : FrontendFeeConfig ,
292+ frontendFee : FrontendFee ,
293293 memo ?: string
294294) : Promise < EncodedTxData < IbcTransferProps > > => {
295295 let bparams : BparamsMsgValue [ ] | undefined ;
@@ -305,11 +305,11 @@ export const createIbcTx = async (
305305 nativeToken : chain . nativeTokenAddress ,
306306 buildTxFn : async ( workerLink ) => {
307307 const firstProps = props [ 0 ] ;
308- const frontendSusFee = frontendSusMsgFromConfig (
309- frontendFeeConfig ,
310- firstProps . token ,
311- "transparent"
312- ) ;
308+ const isUnshielding = firstProps . gasSpendingKey === firstProps . source ;
309+ const frontendSusFee =
310+ isUnshielding ?
311+ frontendSusMsgFromConfig ( frontendFee , firstProps . token , "transparent" )
312+ : undefined ;
313313 const msgValue : IbcTransferProps = {
314314 ...firstProps ,
315315 gasSpendingKey : firstProps . gasSpendingKey ,
0 commit comments