@orderly.network/hooks 0.0.75 → 0.0.77
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 +24 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.mjs
CHANGED
|
@@ -3006,6 +3006,7 @@ var useChains = (networkId, options = {}) => {
|
|
|
3006
3006
|
{
|
|
3007
3007
|
network_infos: {
|
|
3008
3008
|
name: "Arbitrum Goerli",
|
|
3009
|
+
shortName: "Arbitrum Goerli",
|
|
3009
3010
|
public_rpc_url: "https://goerli-rollup.arbitrum.io/rpc",
|
|
3010
3011
|
chain_id: 421613,
|
|
3011
3012
|
currency_symbol: "ETH",
|
|
@@ -3024,7 +3025,8 @@ var useChains = (networkId, options = {}) => {
|
|
|
3024
3025
|
const item = mergeDeepRight(chain, {
|
|
3025
3026
|
name: key,
|
|
3026
3027
|
network_infos: {
|
|
3027
|
-
bridgeless: orderlyChainIds.has(chain.network_infos.chain_id)
|
|
3028
|
+
bridgeless: orderlyChainIds.has(chain.network_infos.chain_id),
|
|
3029
|
+
shortName: key
|
|
3028
3030
|
},
|
|
3029
3031
|
token_infos: chain.token_infos.filter(
|
|
3030
3032
|
(token) => !!token.swap_enable
|
|
@@ -3154,7 +3156,7 @@ var useDeposit = (options) => {
|
|
|
3154
3156
|
address: USDC?.address,
|
|
3155
3157
|
decimals: USDC?.decimals,
|
|
3156
3158
|
chainId: chain.network_infos.chain_id,
|
|
3157
|
-
network: chain.network_infos.
|
|
3159
|
+
network: chain.network_infos.shortName
|
|
3158
3160
|
// chainId: 42161,
|
|
3159
3161
|
};
|
|
3160
3162
|
}, []);
|
|
@@ -3578,7 +3580,7 @@ var useWooCrossSwapQuery = () => {
|
|
|
3578
3580
|
start();
|
|
3579
3581
|
const params = {
|
|
3580
3582
|
// src_network: inputs.srcNetwork,
|
|
3581
|
-
src_network: inputs.srcNetwork
|
|
3583
|
+
src_network: inputs.srcNetwork,
|
|
3582
3584
|
dst_network: "arbitrum",
|
|
3583
3585
|
src_token: inputs.srcToken,
|
|
3584
3586
|
dst_token: inputs.dstToken,
|
|
@@ -3659,20 +3661,29 @@ var useCrossSwap = () => {
|
|
|
3659
3661
|
}, [txHashFromBridge.current]);
|
|
3660
3662
|
const checkLayerStatus = useCallback((txHash) => {
|
|
3661
3663
|
const check = async (txHash2) => {
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3664
|
+
try {
|
|
3665
|
+
const { messages } = await client.getMessagesBySrcTxHash(txHash2);
|
|
3666
|
+
if (messages.length > 0) {
|
|
3667
|
+
const { status: status2 } = messages[0];
|
|
3668
|
+
if (status2 === "INFLIGHT" /* INFLIGHT */) {
|
|
3669
|
+
setTimeout(() => {
|
|
3670
|
+
check(txHash2);
|
|
3671
|
+
}, 1e3);
|
|
3672
|
+
}
|
|
3673
|
+
setLayerStatus(status2);
|
|
3674
|
+
if (status2 === "DELIVERED" /* DELIVERED */) {
|
|
3675
|
+
setBridgeMessage(messages[0]);
|
|
3676
|
+
txHashFromBridge.current = messages[0].dstTxHash;
|
|
3677
|
+
}
|
|
3678
|
+
if (status2 === "FAILED" /* FAILED */) {
|
|
3679
|
+
setBridgeMessage(messages[0]);
|
|
3680
|
+
}
|
|
3681
|
+
} else {
|
|
3666
3682
|
setTimeout(() => {
|
|
3667
3683
|
check(txHash2);
|
|
3668
3684
|
}, 1e3);
|
|
3669
3685
|
}
|
|
3670
|
-
|
|
3671
|
-
if (status2 === "DELIVERED" /* DELIVERED */) {
|
|
3672
|
-
setBridgeMessage(messages[0]);
|
|
3673
|
-
txHashFromBridge.current = messages[0].dstTxHash;
|
|
3674
|
-
}
|
|
3675
|
-
} else {
|
|
3686
|
+
} catch (e) {
|
|
3676
3687
|
setTimeout(() => {
|
|
3677
3688
|
check(txHash2);
|
|
3678
3689
|
}, 1e3);
|