From 7b563be9c1d7bbff49fea3047b28a4fd69a82aa9 Mon Sep 17 00:00:00 2001 From: Manuel Date: Mon, 8 Apr 2024 11:16:16 +0200 Subject: [PATCH] feat: add dymension chain support --- .../staking_sdk/wallet_operations/cosmos/ethermint_utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/screens/staking/lib/staking_sdk/wallet_operations/cosmos/ethermint_utils.ts b/src/screens/staking/lib/staking_sdk/wallet_operations/cosmos/ethermint_utils.ts index 09b8a44b..10b2c2ab 100644 --- a/src/screens/staking/lib/staking_sdk/wallet_operations/cosmos/ethermint_utils.ts +++ b/src/screens/staking/lib/staking_sdk/wallet_operations/cosmos/ethermint_utils.ts @@ -297,6 +297,7 @@ export const signAndBroadcastEthermint = async ( const aminoMessages = messages.map((m) => aminoTypes.toAmino(m)); const isInjective = account.networkId === StakingNetworkId.Injective; + const emptyCosmosSignatures = account.networkId === StakingNetworkId.Dymension; const timeoutHeight = isInjective ? BigInt(currentHeight) + BigInt(500) @@ -346,6 +347,7 @@ export const signAndBroadcastEthermint = async ( typeUrl, value: ExtensionOptionsWeb3Tx.encode( ExtensionOptionsWeb3Tx.fromPartial({ + feePayer: emptyCosmosSignatures ? account.address : undefined, feePayerSig: fromBase64(signature.signature), typedDataChainId: EthermintChainIdHelper.parse( signed.chain_id, @@ -387,7 +389,7 @@ export const signAndBroadcastEthermint = async ( : undefined, }), ).finish(), - signatures: [fromBase64(signature.signature)], + signatures: !emptyCosmosSignatures ? [fromBase64(signature.signature)] : [new Uint8Array(0)], }); const tx = TxRaw.encode(txRaw).finish();