@orderly.network/hooks 0.0.75 → 0.0.76

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
@@ -3015,6 +3015,7 @@ var useChains = (networkId, options = {}) => {
3015
3015
  {
3016
3016
  network_infos: {
3017
3017
  name: "Arbitrum Goerli",
3018
+ shortName: "Arbitrum Goerli",
3018
3019
  public_rpc_url: "https://goerli-rollup.arbitrum.io/rpc",
3019
3020
  chain_id: 421613,
3020
3021
  currency_symbol: "ETH",
@@ -3033,7 +3034,8 @@ var useChains = (networkId, options = {}) => {
3033
3034
  const item = ramda.mergeDeepRight(chain, {
3034
3035
  name: key,
3035
3036
  network_infos: {
3036
- bridgeless: orderlyChainIds.has(chain.network_infos.chain_id)
3037
+ bridgeless: orderlyChainIds.has(chain.network_infos.chain_id),
3038
+ shortName: key
3037
3039
  },
3038
3040
  token_infos: chain.token_infos.filter(
3039
3041
  (token) => !!token.swap_enable
@@ -3163,7 +3165,7 @@ var useDeposit = (options) => {
3163
3165
  address: USDC?.address,
3164
3166
  decimals: USDC?.decimals,
3165
3167
  chainId: chain.network_infos.chain_id,
3166
- network: chain.network_infos.name
3168
+ network: chain.network_infos.shortName
3167
3169
  // chainId: 42161,
3168
3170
  };
3169
3171
  }, []);
@@ -3587,7 +3589,7 @@ var useWooCrossSwapQuery = () => {
3587
3589
  start();
3588
3590
  const params = {
3589
3591
  // src_network: inputs.srcNetwork,
3590
- src_network: inputs.srcNetwork.toLowerCase(),
3592
+ src_network: inputs.srcNetwork,
3591
3593
  dst_network: "arbitrum",
3592
3594
  src_token: inputs.srcToken,
3593
3595
  dst_token: inputs.dstToken,
@@ -3668,20 +3670,29 @@ var useCrossSwap = () => {
3668
3670
  }, [txHashFromBridge.current]);
3669
3671
  const checkLayerStatus = React2.useCallback((txHash) => {
3670
3672
  const check = async (txHash2) => {
3671
- const { messages } = await client.getMessagesBySrcTxHash(txHash2);
3672
- if (messages.length > 0) {
3673
- const { status: status2 } = messages[0];
3674
- if (status2 === "INFLIGHT" /* INFLIGHT */) {
3673
+ try {
3674
+ const { messages } = await client.getMessagesBySrcTxHash(txHash2);
3675
+ if (messages.length > 0) {
3676
+ const { status: status2 } = messages[0];
3677
+ if (status2 === "INFLIGHT" /* INFLIGHT */) {
3678
+ setTimeout(() => {
3679
+ check(txHash2);
3680
+ }, 1e3);
3681
+ }
3682
+ setLayerStatus(status2);
3683
+ if (status2 === "DELIVERED" /* DELIVERED */) {
3684
+ setBridgeMessage(messages[0]);
3685
+ txHashFromBridge.current = messages[0].dstTxHash;
3686
+ }
3687
+ if (status2 === "FAILED" /* FAILED */) {
3688
+ setBridgeMessage(messages[0]);
3689
+ }
3690
+ } else {
3675
3691
  setTimeout(() => {
3676
3692
  check(txHash2);
3677
3693
  }, 1e3);
3678
3694
  }
3679
- setLayerStatus(status2);
3680
- if (status2 === "DELIVERED" /* DELIVERED */) {
3681
- setBridgeMessage(messages[0]);
3682
- txHashFromBridge.current = messages[0].dstTxHash;
3683
- }
3684
- } else {
3695
+ } catch (e) {
3685
3696
  setTimeout(() => {
3686
3697
  check(txHash2);
3687
3698
  }, 1e3);