From 5cc4fa7684ab85aa609ac200f1b2fa79625aa4d5 Mon Sep 17 00:00:00 2001 From: Karim Dalaize Date: Tue, 27 Feb 2024 16:51:49 +0100 Subject: [PATCH 1/2] [Updated] gas multiplier --- src/utils/client.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/utils/client.ts b/src/utils/client.ts index 7e48306..47135a6 100644 --- a/src/utils/client.ts +++ b/src/utils/client.ts @@ -30,9 +30,11 @@ const { delegate, beginRedelegate, undelegate } = cosmos.staking.v1beta1.Message const { withdrawDelegatorReward, setWithdrawAddress } = cosmos.distribution.v1beta1.MessageComposer.withTypeUrl; const { vote } = cosmos.gov.v1beta1.MessageComposer.withTypeUrl; +const rpcUrl = new URL(process.env.REACT_APP_RPC_URL ?? 'rpc.cosmos.directory/lumnetwork'); + class WalletClient { private lumInfos: LumInfo | null = null; - private node: string = new URL(process.env.REACT_APP_RPC_URL).hostname; + private node: string = rpcUrl.hostname + rpcUrl.pathname; private chainId: string | null = null; private queryClient: Awaited> | null = null; private cosmosSigningClient: SigningStargateClient | null = null; @@ -471,7 +473,7 @@ class WalletClient { const gasEstimated = await this.cosmosSigningClient.simulate(fromWallet.address, [sendMsg], memo); const fee = { amount: coins('25000', MICRO_LUM_DENOM), - gas: new IntPretty(new Dec(gasEstimated).mul(new Dec(1.3))).maxDecimals(0).locale(false).toString(), + gas: new IntPretty(new Dec(gasEstimated).mul(new Dec(2))).maxDecimals(0).locale(false).toString(), }; // Fetch chain id @@ -518,7 +520,7 @@ class WalletClient { const gasEstimated = await this.cosmosSigningClient.simulate(fromWallet.address, [delegateMsg], memo); const fee = { amount: coins('25000', MICRO_LUM_DENOM), - gas: new IntPretty(new Dec(gasEstimated).mul(new Dec(1.3))).maxDecimals(0).locale(false).toString(), + gas: new IntPretty(new Dec(gasEstimated).mul(new Dec(2))).maxDecimals(0).locale(false).toString(), }; // Fetch chain id @@ -565,7 +567,7 @@ class WalletClient { const gasEstimated = await this.cosmosSigningClient.simulate(fromWallet.address, [undelegateMsg], memo); const fee = { amount: coins('25000', MICRO_LUM_DENOM), - gas: new IntPretty(new Dec(gasEstimated).mul(new Dec(1.3))).maxDecimals(0).locale(false).toString(), + gas: new IntPretty(new Dec(gasEstimated).mul(new Dec(2))).maxDecimals(0).locale(false).toString(), }; // Fetch chain id @@ -602,7 +604,7 @@ class WalletClient { const gasEstimated = await this.cosmosSigningClient.simulate(fromWallet.address, [getRewardMsg], memo); const fee = { amount: coins('25000', MICRO_LUM_DENOM), - gas: new IntPretty(new Dec(gasEstimated).mul(new Dec(1.3))).maxDecimals(0).locale(false).toString(), + gas: new IntPretty(new Dec(gasEstimated).mul(new Dec(2))).maxDecimals(0).locale(false).toString(), }; // Fetch chain id @@ -645,7 +647,7 @@ class WalletClient { const gasEstimated = await this.cosmosSigningClient.simulate(fromWallet.address, messages, memo); const fee = { amount: coins('25000', MICRO_LUM_DENOM), - gas: new IntPretty(new Dec(gasEstimated).mul(new Dec(1.3))).maxDecimals(0).locale(false).toString(), + gas: new IntPretty(new Dec(gasEstimated).mul(new Dec(2))).maxDecimals(0).locale(false).toString(), }; // Fetch chain id @@ -699,7 +701,7 @@ class WalletClient { const gasEstimated = await this.cosmosSigningClient.simulate(fromWallet.address, [redelegateMsg], memo); const fee = { amount: coins('25000', MICRO_LUM_DENOM), - gas: new IntPretty(new Dec(gasEstimated).mul(new Dec(1.3))).maxDecimals(0).locale(false).toString(), + gas: new IntPretty(new Dec(gasEstimated).mul(new Dec(2))).maxDecimals(0).locale(false).toString(), }; // Fetch chain id @@ -740,7 +742,7 @@ class WalletClient { const gasEstimated = await this.cosmosSigningClient.simulate(fromWallet.address, [voteMsg], undefined); const fee = { amount: coins('25000', MICRO_LUM_DENOM), - gas: new IntPretty(new Dec(gasEstimated).mul(new Dec(1.3))).maxDecimals(0).locale(false).toString(), + gas: new IntPretty(new Dec(gasEstimated).mul(new Dec(2))).maxDecimals(0).locale(false).toString(), }; // Fetch chain id @@ -777,7 +779,7 @@ class WalletClient { const gasEstimated = await this.cosmosSigningClient.simulate(fromWallet.address, [setWithdrawAddressMsg], memo); const fee = { amount: coins('25000', MICRO_LUM_DENOM), - gas: new IntPretty(new Dec(gasEstimated).mul(new Dec(1.3))).maxDecimals(0).locale(false).toString(), + gas: new IntPretty(new Dec(gasEstimated).mul(new Dec(2))).maxDecimals(0).locale(false).toString(), }; // Fetch chain id From d3b255f6c722303e67dbb00402f1aa7e8c413669 Mon Sep 17 00:00:00 2001 From: Karim Dalaize Date: Tue, 27 Feb 2024 16:57:11 +0100 Subject: [PATCH 2/2] =?UTF-8?q?[Updated]=C2=A0Submodule=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend-elements | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend-elements b/src/frontend-elements index 1fca3ff..1e2d287 160000 --- a/src/frontend-elements +++ b/src/frontend-elements @@ -1 +1 @@ -Subproject commit 1fca3ffcbaa4a5d694a975c35a75097ffabeba14 +Subproject commit 1e2d287264abfdcdb176cc55625d0edcd5494a33