@orderly.network/trading 3.1.8 → 3.1.9-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1163,6 +1163,7 @@ var init_faucet_ui = __esm({
1163
1163
  function useFaucetScript() {
1164
1164
  const { t } = i18n.useTranslation();
1165
1165
  const { connectedChain, namespace } = hooks.useWalletConnector();
1166
+ const [, { isTestnetChain }] = hooks.useChains();
1166
1167
  const { state, account } = hooks.useAccount();
1167
1168
  const config = hooks.useConfig();
1168
1169
  const operatorUrl = config.get("operatorUrl");
@@ -1174,8 +1175,8 @@ function useFaucetScript() {
1174
1175
  if (!connectedChain || !connectedChain.id) {
1175
1176
  return false;
1176
1177
  }
1177
- return (state.status === types.AccountStatusEnum.EnableTrading || state.status === types.AccountStatusEnum.EnableTradingWithoutConnected) && utils.isTestnet(parseInt(connectedChain.id));
1178
- }, [state, connectedChain]);
1178
+ return (state.status === types.AccountStatusEnum.EnableTrading || state.status === types.AccountStatusEnum.EnableTradingWithoutConnected) && isTestnetChain(connectedChain.id);
1179
+ }, [state, connectedChain, isTestnetChain]);
1179
1180
  const getFaucet = () => {
1180
1181
  if (loading) {
1181
1182
  return;
@@ -6784,14 +6785,14 @@ var useAccountSheetScript = (props) => {
6784
6785
  const { hide } = ui.useModal();
6785
6786
  const config = hooks.useConfig();
6786
6787
  const { connectedChain, disconnect, namespace } = hooks.useWalletConnector();
6788
+ const [, { isTestnetChain }] = hooks.useChains();
6787
6789
  const chainId = account.chainId || connectedChain?.id || linkDeviceStorage?.chainId;
6788
6790
  const showGetTestUSDC = React12.useMemo(() => {
6789
6791
  if (chainId) {
6790
- return (state.status === types.AccountStatusEnum.EnableTrading || state.status === types.AccountStatusEnum.EnableTradingWithoutConnected) && // @ts-ignore
6791
- utils.isTestnet(parseInt(chainId));
6792
+ return (state.status === types.AccountStatusEnum.EnableTrading || state.status === types.AccountStatusEnum.EnableTradingWithoutConnected) && isTestnetChain(chainId);
6792
6793
  }
6793
6794
  return false;
6794
- }, [state.status, chainId]);
6795
+ }, [state.status, chainId, isTestnetChain]);
6795
6796
  const chainName = useGetChains(chainId);
6796
6797
  const operatorUrl = config.get("operatorUrl");
6797
6798
  const onCopyAddress = () => {