@orderly.network/wallet-connector-privy 2.5.0 → 2.5.1
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.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
package/dist/index.d.mts
CHANGED
|
@@ -96,6 +96,7 @@ interface WalletConnectorPrivyProps extends PropsWithChildren {
|
|
|
96
96
|
headerProps?: {
|
|
97
97
|
mobile: React.ReactNode;
|
|
98
98
|
};
|
|
99
|
+
enableSwapDeposit?: boolean;
|
|
99
100
|
}
|
|
100
101
|
declare function WalletConnectorPrivyProvider(props: WalletConnectorPrivyProps): React.JSX.Element | null;
|
|
101
102
|
|
package/dist/index.d.ts
CHANGED
|
@@ -96,6 +96,7 @@ interface WalletConnectorPrivyProps extends PropsWithChildren {
|
|
|
96
96
|
headerProps?: {
|
|
97
97
|
mobile: React.ReactNode;
|
|
98
98
|
};
|
|
99
|
+
enableSwapDeposit?: boolean;
|
|
99
100
|
}
|
|
100
101
|
declare function WalletConnectorPrivyProvider(props: WalletConnectorPrivyProps): React.JSX.Element | null;
|
|
101
102
|
|
package/dist/index.js
CHANGED
|
@@ -2887,6 +2887,11 @@ function WalletConnectorPrivyProvider(props) {
|
|
|
2887
2887
|
});
|
|
2888
2888
|
return chainTypeObj;
|
|
2889
2889
|
}, [initChains]);
|
|
2890
|
+
const { data: swapChainInfoRes, isLoading: swapLoading } = hooks.useSWR(
|
|
2891
|
+
!props.customChains && props.enableSwapDeposit ? "https://fi-api.woo.org/swap_support" : null,
|
|
2892
|
+
fetcher,
|
|
2893
|
+
commonSwrOpts
|
|
2894
|
+
);
|
|
2890
2895
|
const { data: mainnetChainInfoRes } = hooks.useSWR(
|
|
2891
2896
|
!props.customChains ? "https://api.orderly.org/v1/public/chain_info" : null,
|
|
2892
2897
|
fetcher,
|
|
@@ -2897,11 +2902,6 @@ function WalletConnectorPrivyProvider(props) {
|
|
|
2897
2902
|
fetcher,
|
|
2898
2903
|
commonSwrOpts
|
|
2899
2904
|
);
|
|
2900
|
-
const { data: swapChainInfoRes } = hooks.useSWR(
|
|
2901
|
-
!props.customChains ? "https://fi-api.woo.org/swap_support" : null,
|
|
2902
|
-
fetcher,
|
|
2903
|
-
commonSwrOpts
|
|
2904
|
-
);
|
|
2905
2905
|
const handleCustomerChains = () => {
|
|
2906
2906
|
const testChains = processChainInfo(
|
|
2907
2907
|
props.customChains.testnet?.map((item) => item.network_infos)
|
|
@@ -2987,7 +2987,7 @@ function WalletConnectorPrivyProvider(props) {
|
|
|
2987
2987
|
if (props.customChains) {
|
|
2988
2988
|
return;
|
|
2989
2989
|
}
|
|
2990
|
-
if (!mainnetChainInfoRes || !testChainInfoRes ||
|
|
2990
|
+
if (!mainnetChainInfoRes || !testChainInfoRes || swapLoading) {
|
|
2991
2991
|
return;
|
|
2992
2992
|
}
|
|
2993
2993
|
let testChainsList = [];
|
|
@@ -2999,7 +2999,7 @@ function WalletConnectorPrivyProvider(props) {
|
|
|
2999
2999
|
const testChains = processChainInfo(testChainsList);
|
|
3000
3000
|
const mainnetChains2 = processChainInfo(mainnetChainsList);
|
|
3001
3001
|
const swapChains = processChainInfo(
|
|
3002
|
-
formatSwapChainInfo(swapChainInfoRes?.data)
|
|
3002
|
+
formatSwapChainInfo(swapChainInfoRes?.data || {})
|
|
3003
3003
|
);
|
|
3004
3004
|
const chains = [...testChains, ...mainnetChains2];
|
|
3005
3005
|
const filterSwapChains = swapChains.filter(
|
|
@@ -3017,7 +3017,8 @@ function WalletConnectorPrivyProvider(props) {
|
|
|
3017
3017
|
props.customChains,
|
|
3018
3018
|
mainnetChainInfoRes,
|
|
3019
3019
|
testChainInfoRes,
|
|
3020
|
-
swapChainInfoRes
|
|
3020
|
+
swapChainInfoRes,
|
|
3021
|
+
swapLoading
|
|
3021
3022
|
]);
|
|
3022
3023
|
React19.useEffect(() => {
|
|
3023
3024
|
if (props.customChains) {
|