Skip to content

Commit

Permalink
pumb sdk universal swap osmosis
Browse files Browse the repository at this point in the history
  • Loading branch information
haunv3 committed Dec 22, 2023
1 parent 6f57b2d commit 41bc0eb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
20 changes: 9 additions & 11 deletions src/pages/Balance/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ExecuteInstruction, ExecuteResult } from '@cosmjs/cosmwasm-stargate';
import { Coin, coin } from '@cosmjs/proto-signing';
import { DeliverTxResponse, GasPrice, StdFee } from '@cosmjs/stargate';
import { DeliverTxResponse, GasPrice } from '@cosmjs/stargate';
import {
CosmosChainId,
IBCInfo,
Expand All @@ -11,7 +11,13 @@ import {
ibcInfosOld,
oraichain2oraib,
BigDecimal,
GAS_ESTIMATION_BRIDGE_DEFAULT
GAS_ESTIMATION_BRIDGE_DEFAULT,
buildMultipleExecuteMessages,
calculateTimeoutTimestamp,
getEncodedExecuteContractMsgs,
parseTokenInfo,
toAmount,
MULTIPLIER_ESTIMATE_OSMOSIS
} from '@oraichain/oraidex-common';
import { flattenTokens, kawaiiTokens, tokenMap } from 'config/bridgeTokens';
import { chainInfos } from 'config/chainInfos';
Expand All @@ -20,13 +26,6 @@ import { feeEstimate, getNetworkGasPrice } from 'helper';

import { CwIcs20LatestClient } from '@oraichain/common-contracts-sdk';
import { TransferBackMsg } from '@oraichain/common-contracts-sdk/build/CwIcs20Latest.types';
import {
buildMultipleExecuteMessages,
calculateTimeoutTimestamp,
getEncodedExecuteContractMsgs,
parseTokenInfo,
toAmount
} from '@oraichain/oraidex-common';
import { OraiswapTokenClient } from '@oraichain/oraidex-contracts-sdk';
import { Long } from 'cosmjs-types/helpers';
import { MsgTransfer } from 'cosmjs-types/ibc/applications/transfer/v1/tx';
Expand Down Expand Up @@ -179,8 +178,7 @@ export const transferIBCMultiple = async (
});
// hardcode fix bug osmosis
let fee: 'auto' | number = 'auto';
const MULTIPLIER_OSMOSIS = 3;
if (fromChainId === 'osmosis-1') fee = MULTIPLIER_OSMOSIS;
if (fromChainId === 'osmosis-1') fee = MULTIPLIER_ESTIMATE_OSMOSIS;
const result = await client.signAndBroadcast(fromAddress, encodedMessages, fee);
return result as DeliverTxResponse;
};
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2916,10 +2916,10 @@
react-dom "^18.2.0"
react-use "^17.4.0"

"@oraichain/oraidex-common@^1.0.44":
version "1.0.45"
resolved "https://registry.yarnpkg.com/@oraichain/oraidex-common/-/oraidex-common-1.0.45.tgz#15ba8962e25e99ad0b3f5376f0a2d9ed87ae06e4"
integrity sha512-aaNXqWndvajzBN8rQXgyyi371D3GbDpYbg4ivvo6t2DkPJb5EfI8xYit0wHTfbjWHgRFdjUaJ24NzmaKpfBPpg==
"@oraichain/oraidex-common@^1.0.45":
version "1.0.50"
resolved "https://registry.yarnpkg.com/@oraichain/oraidex-common/-/oraidex-common-1.0.50.tgz#e9c273834c71ced049af05f9b83ec3de0e616788"
integrity sha512-Uo17OTbgEHOaJM4necO77gpkaPatMWvbLqBtgjJN9zEHe3YzQP8rQ7wlxkF4Ooy8zojEaY+Xwq7Eja0Ri9PYSg==
dependencies:
"@ethersproject/providers" "^5.0.10"
"@keplr-wallet/types" "^0.11.38"
Expand All @@ -2941,11 +2941,11 @@
integrity sha512-Uai30rSSn7h46lBLFuVbW96ErXAWRxfvEP+CNm/TXyGIw8VRtTaebQAqldsbxzYwBVEYbwDwZMHRGQWrsJBkJg==

"@oraichain/oraidex-universal-swap@^1.0.35":
version "1.0.35"
resolved "https://registry.yarnpkg.com/@oraichain/oraidex-universal-swap/-/oraidex-universal-swap-1.0.35.tgz#4c4ae8cd1b1138b6f50887dbf3616f1dddf64c99"
integrity sha512-7zjkpCfQoQInoS5L4GcIADQWFrh348QfTN+Eckc75akuUllIClMwOBC5i1VuCHqYlXplRO7qjId0n9aUICYTwQ==
version "1.0.40"
resolved "https://registry.yarnpkg.com/@oraichain/oraidex-universal-swap/-/oraidex-universal-swap-1.0.40.tgz#7669a957a1be9786b7a786b9a9b9d30e16de1941"
integrity sha512-M9QGY0CJTl5qjTf2CMGtan5Rkh+1y/1se7hvoDMhmZor5pxQ6ub5IgWRP1HkU8g0Bg+dmLsqhx22wzh+zL/eHQ==
dependencies:
"@oraichain/oraidex-common" "^1.0.44"
"@oraichain/oraidex-common" "^1.0.45"
"@oraichain/oraidex-contracts-sdk" "^1.0.24"
bech32 "1.1.4"
ethers "^5.0.15"
Expand Down

0 comments on commit 41bc0eb

Please sign in to comment.