Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix type timeoutTimestamp #1071

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions src/pages/Balance/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import { cosmosNetworks, feeEstimate, getNetworkGasPrice } from 'helper';
import { CwIcs20LatestClient } from '@oraichain/common-contracts-sdk';
import { TransferBackMsg } from '@oraichain/common-contracts-sdk/build/CwIcs20Latest.types';
import { OraiswapRouterQueryClient, OraiswapTokenClient } from '@oraichain/oraidex-contracts-sdk';
import { Long } from 'cosmjs-types/helpers';
import { MsgTransfer } from 'cosmjs-types/ibc/applications/transfer/v1/tx';
import CosmJs, { collectWallet, connectWithSigner, getCosmWasmClient } from 'libs/cosmjs';
import KawaiiverseJs from 'libs/kawaiiversejs';
Expand Down Expand Up @@ -73,7 +72,7 @@ export const transferIBC = async (data: {
sender: fromAddress,
receiver: toAddress,
memo,
timeoutTimestamp: Long.fromString(calculateTimeoutTimestamp(ibcInfo.timeout)),
timeoutTimestamp: BigInt(calculateTimeoutTimestamp(ibcInfo.timeout)),
timeoutHeight: undefined
};
let feeDenom = fromToken.denom;
Expand Down Expand Up @@ -191,10 +190,15 @@ export const transferIBCMultiple = async (
}));
const offlineSigner = await collectWallet(fromChainId);
// Initialize the gaia api with the offline signer that is injected by Keplr extension.
const client = await connectWithSigner(rpc, offlineSigner, fromChainId === 'injective-1' ? 'injective' : 'cosmwasm', {
gasPrice: GasPrice.fromString(`${await getNetworkGasPrice(fromChainId)}${feeDenom}`),
broadcastPollIntervalMs: 600
});
const client = await connectWithSigner(
rpc,
offlineSigner as any,
fromChainId === 'injective-1' ? 'injective' : 'cosmwasm',
{
gasPrice: GasPrice.fromString(`${await getNetworkGasPrice(fromChainId)}${feeDenom}`),
broadcastPollIntervalMs: 600
}
);
// hardcode fix bug osmosis
let fee: 'auto' | number = 'auto';
if (fromChainId === 'osmosis-1') fee = 3;
Expand Down Expand Up @@ -236,7 +240,7 @@ export const transferTokenErc20Cw20Map = async ({
sender: fromAddress,
receiver: toAddress,
memo: ibcMemo,
timeoutTimestamp: calculateTimeoutTimestamp(ibcInfo.timeout)
timeoutTimestamp: BigInt(calculateTimeoutTimestamp(ibcInfo.timeout))
})
};

Expand Down
4 changes: 2 additions & 2 deletions src/rest/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import { Position } from '@oraichain/oraidex-contracts-sdk/build/OraiswapV3.type
import { generateSwapOperationMsgs, simulateSwap } from '@oraichain/oraidex-universal-swap';
import { oraichainTokens, tokenMap, tokens } from 'config/bridgeTokens';
import { network } from 'config/networks';
import { Long } from 'cosmjs-types/helpers';
import { MsgTransfer } from 'cosmjs-types/ibc/applications/transfer/v1/tx';
import isEqual from 'lodash/isEqual';
import { RemainingOraibTokenItem } from 'pages/Balance/StuckOraib/useGetOraiBridgeBalances';
Expand Down Expand Up @@ -685,7 +684,8 @@ function generateMoveOraib2OraiMessages(
sender: fromAddress,
receiver: toAddress,
memo: '',
timeoutTimestamp: Long.fromString(calculateTimeoutTimestamp(ibcInfo.timeout))
timeoutHeight: undefined,
timeoutTimestamp: BigInt(calculateTimeoutTimestamp(ibcInfo.timeout))
});
}
return transferMsgs;
Expand Down
Loading