Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into hotfix/lum-889
Browse files Browse the repository at this point in the history
  • Loading branch information
greedyboi committed Feb 27, 2024
2 parents b0e4cb4 + 5f27035 commit 8fd13bc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/constant/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ export enum WalletProvider {
}

export const AUTOCONNECT_STORAGE_KEY = 'autoconnect_storage_key';

export const GAS_MULTIPLIER = 2;
17 changes: 9 additions & 8 deletions src/utils/lumClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { EncodeObject, OfflineSigner } from '@cosmjs/proto-signing';
import { Dec, IntPretty } from '@keplr-wallet/unit';

import { LumApi } from 'api';
import { GAS_MULTIPLIER } from 'constant';
import { AggregatedDepositModel, DepositModel, LumWalletModel, PoolModel, PrizeModel } from 'models';
import { PoolsUtils } from 'utils';

Expand Down Expand Up @@ -365,7 +366,7 @@ class LumClient {
const gasEstimated = await this.signingClient.simulate(wallet.address, [message], '');
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(GAS_MULTIPLIER))).maxDecimals(0).locale(false).toString(),
};

const broadcastResult = await this.signingClient.signAndBroadcast(wallet.address, [message], fee);
Expand All @@ -390,7 +391,7 @@ class LumClient {
const gasEstimated = await this.signingClient.simulate(wallet.address, [message], '');
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(GAS_MULTIPLIER))).maxDecimals(0).locale(false).toString(),
};

const broadcastResult = await this.signingClient.signAndBroadcast(wallet.address, [message], fee);
Expand Down Expand Up @@ -430,7 +431,7 @@ class LumClient {
const gasEstimated = await this.signingClient.simulate(wallet.address, messages, '');
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(GAS_MULTIPLIER))).maxDecimals(0).locale(false).toString(),
};

const broadcastResult = await this.signingClient.signAndBroadcast(wallet.address, messages, fee);
Expand All @@ -455,7 +456,7 @@ class LumClient {
const gasEstimated = await this.signingClient.simulate(wallet.address, [message], '');
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(GAS_MULTIPLIER))).maxDecimals(0).locale(false).toString(),
};

const broadcastResult = await this.signingClient.signAndBroadcast(wallet.address, [message], fee);
Expand All @@ -480,7 +481,7 @@ class LumClient {
const gasEstimated = await this.signingClient.simulate(wallet.address, [message], '');
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(GAS_MULTIPLIER))).maxDecimals(0).locale(false).toString(),
};

const broadcastResult = await this.signingClient.signAndBroadcast(wallet.address, [message], fee);
Expand Down Expand Up @@ -509,7 +510,7 @@ class LumClient {
const gasEstimated = await this.signingClient.simulate(wallet.address, messages, '');
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(GAS_MULTIPLIER))).maxDecimals(0).locale(false).toString(),
};

const broadcastResult = await this.signingClient.signAndBroadcast(wallet.address, messages, fee);
Expand Down Expand Up @@ -583,7 +584,7 @@ class LumClient {
const gasEstimated = await this.signingClient.simulate(wallet.address, messages, '');
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(GAS_MULTIPLIER))).maxDecimals(0).locale(false).toString(),
};

const broadcastResult = await this.signingClient.signAndBroadcast(wallet.address, messages, fee);
Expand Down Expand Up @@ -614,7 +615,7 @@ class LumClient {
const gasEstimated = await this.signingClient.simulate(wallet.address, [message], '');
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(GAS_MULTIPLIER))).maxDecimals(0).locale(false).toString(),
};

const broadcastResult = await this.signingClient.signAndBroadcast(wallet.address, [message], fee);
Expand Down
4 changes: 2 additions & 2 deletions src/utils/walletClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Coin } from '@keplr-wallet/types';
import { Dec, IntPretty } from '@keplr-wallet/unit';
import { cosmos, fromAscii, getSigningIbcClient, ibc } from '@lum-network/sdk-javascript';

import { ApiConstants } from 'constant';
import { ApiConstants, GAS_MULTIPLIER } from 'constant';
import { I18n, NumbersUtils } from 'utils';

import { showErrorToast } from './toast';
Expand Down Expand Up @@ -147,7 +147,7 @@ class WalletClient {
const gasEstimated = await this.walletClient.simulate(fromWallet, [msg], '');
const fee = {
amount: coins('25000', feesDenom),
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(GAS_MULTIPLIER))).maxDecimals(0).locale(false).toString(),
};

const res = await this.walletClient.signAndBroadcast(fromWallet, [msg], fee);
Expand Down

0 comments on commit 8fd13bc

Please sign in to comment.