@@ -17,7 +17,7 @@ import BigNumber from "bignumber.js";
1717import * as Comlink from "comlink" ;
1818import { NamadaKeychain } from "hooks/useNamadaKeychain" ;
1919import { buildTx , EncodedTxData , isPublicKeyRevealed } from "lib/query" ;
20- import { Address , ChainSettings , GasConfig } from "types" ;
20+ import { Address , ChainSettings , FrontendFeeConfig , GasConfig } from "types" ;
2121import { getSdkInstance } from "utils/sdk" ;
2222import {
2323 IbcTransfer ,
@@ -168,7 +168,8 @@ export const createShieldingTransferTx = async (
168168 props : ShieldingTransferProps [ ] ,
169169 gasConfig : GasConfig ,
170170 rpcUrl : string ,
171- memo ?: string
171+ memo ?: string ,
172+ frontendFeeConfig ?: FrontendFeeConfig
172173) : Promise < EncodedTxData < ShieldingTransferProps > | undefined > => {
173174 const source = props [ 0 ] ?. data [ 0 ] ?. source ;
174175 const destination = props [ 0 ] ?. target ;
@@ -193,6 +194,10 @@ export const createShieldingTransferTx = async (
193194 target : destination ,
194195 data : [ { source, token, amount } ] ,
195196 bparams,
197+ frontendSusFee : frontendFeeConfig && {
198+ address : frontendFeeConfig . target ,
199+ amount : frontendFeeConfig . percentage . toString ( ) ,
200+ } ,
196201 } ;
197202 const msg : Shield = {
198203 type : "shield" ,
@@ -220,7 +225,8 @@ export const createUnshieldingTransferTx = async (
220225 gasConfig : GasConfig ,
221226 rpcUrl : string ,
222227 disposableSigner : GenDisposableSignerResponse ,
223- memo ?: string
228+ memo ?: string ,
229+ frontendFeeConfig ?: FrontendFeeConfig
224230) : Promise < EncodedTxData < UnshieldingTransferProps > | undefined > => {
225231 const { publicKey : signerPublicKey } = disposableSigner ;
226232
@@ -247,6 +253,10 @@ export const createUnshieldingTransferTx = async (
247253 source,
248254 data : [ { target : destination , token, amount } ] ,
249255 bparams,
256+ frontendSusFee : frontendFeeConfig && {
257+ address : frontendFeeConfig . target ,
258+ amount : frontendFeeConfig . percentage . toString ( ) ,
259+ } ,
250260 } ;
251261
252262 const msg : Unshield = {
@@ -274,7 +284,8 @@ export const createIbcTx = async (
274284 gasConfig : GasConfig ,
275285 rpcUrl : string ,
276286 signerPublicKey : string ,
277- memo ?: string
287+ memo ?: string ,
288+ frontendFeeConfig ?: FrontendFeeConfig
278289) : Promise < EncodedTxData < IbcTransferProps > > => {
279290 let bparams : BparamsMsgValue [ ] | undefined ;
280291 if ( account . type === AccountType . Ledger ) {
@@ -292,6 +303,10 @@ export const createIbcTx = async (
292303 ...props [ 0 ] ,
293304 gasSpendingKey : props [ 0 ] . gasSpendingKey ,
294305 bparams,
306+ frontendSusFee : frontendFeeConfig && {
307+ address : frontendFeeConfig . target ,
308+ amount : frontendFeeConfig . percentage . toString ( ) ,
309+ } ,
295310 } ;
296311
297312 // We only check if we need to reveal the public key if the gas spending key is not provided
@@ -326,7 +341,8 @@ export const createOsmosisSwapTx = async (
326341 gasConfig : GasConfig ,
327342 rpcUrl : string ,
328343 disposableSigner : GenDisposableSignerResponse ,
329- memo ?: string
344+ memo ?: string ,
345+ frontendFeeConfig ?: FrontendFeeConfig
330346) : Promise < EncodedTxData < OsmosisSwapProps > > => {
331347 const { publicKey : signerPublicKey } = disposableSigner ;
332348
@@ -349,6 +365,10 @@ export const createOsmosisSwapTx = async (
349365 ...transfer ,
350366 gasSpendingKey : transfer . gasSpendingKey ,
351367 bparams,
368+ frontendSusFee : frontendFeeConfig && {
369+ address : frontendFeeConfig . target ,
370+ amount : frontendFeeConfig . percentage . toString ( ) ,
371+ } ,
352372 } ,
353373 } ;
354374 const msg : OsmosisSwap = {
0 commit comments