@orderly.network/trading 3.1.10 → 3.1.11

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.mjs CHANGED
@@ -9,7 +9,7 @@ import { PositionHistoryWidget, LiquidationWidget, PositionsWidget, MobileLiquid
9
9
  import { Decimal, commifyOptional, removeTrailingZeros, formatSymbol, optimizeSymbolDisplay, getPrecisionByNumber } from '@orderly.network/utils';
10
10
  import { AssetsModule } from '@orderly.network/portfolio';
11
11
  import { DesktopOrderListWidget, TabType, MobileOrderListWidget } from '@orderly.network/ui-orders';
12
- import { AuthGuard } from '@orderly.network/ui-connector';
12
+ import { AuthGuard, useOnboardingModal, useChainChangeValidation } from '@orderly.network/ui-connector';
13
13
  import { OrderEntryWidget, LTVRiskTooltipWidget } from '@orderly.network/ui-order-entry';
14
14
  import { DepositStatusWidget, DepositAndWithdrawWithSheetId, TransferSheetId, DepositAndWithdrawWithDialogId, TransferDialogId } from '@orderly.network/ui-transfer';
15
15
  import { TradingviewWidget } from '@orderly.network/ui-tradingview';
@@ -6998,7 +6998,9 @@ var Chain = (props) => {
6998
6998
  modal.show(ChainSelectorSheetId, {
6999
6999
  // networkId: props.networkId,
7000
7000
  bridgeLessOnly: false,
7001
- isWrongNetwork: props.wrongNetwork
7001
+ isWrongNetwork: props.wrongNetwork,
7002
+ onChainChangeBefore: props.onChainChangeBefore,
7003
+ onChainChangeAfter: props.onChainChangeAfter
7002
7004
  }).then(
7003
7005
  (r) => {
7004
7006
  if (r?.chainId) {
@@ -7049,19 +7051,27 @@ var Chain = (props) => {
7049
7051
  }
7050
7052
  );
7051
7053
  };
7052
- var useChainScript = () => {
7054
+ var useChainScript = (options = {}) => {
7053
7055
  const config = useConfig();
7054
7056
  const { wrongNetwork, currentChainId, setCurrentChainId } = useAppContext();
7057
+ const { onChainChangeBefore, onChainChangeAfter } = useChainChangeValidation({
7058
+ onAccountValidated: options.onAccountValidated
7059
+ });
7055
7060
  const networkId = config.get("networkId");
7056
7061
  return {
7057
7062
  currentChainId,
7058
7063
  setCurrentChainId,
7059
7064
  networkId,
7060
- wrongNetwork
7065
+ wrongNetwork,
7066
+ onChainChangeBefore,
7067
+ onChainChangeAfter
7061
7068
  };
7062
7069
  };
7063
7070
  var ChainWidget = () => {
7064
- const state = useChainScript();
7071
+ const { handleAccountStatus } = useOnboardingModal();
7072
+ const state = useChainScript({
7073
+ onAccountValidated: handleAccountStatus
7074
+ });
7065
7075
  return /* @__PURE__ */ jsx(Chain, { ...state });
7066
7076
  };
7067
7077
  var BottomNavBar = (props) => {