@orderly.network/hooks 0.0.66 → 0.0.68
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 +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.mjs
CHANGED
|
@@ -1750,7 +1750,7 @@ var useOrderStream = ({
|
|
|
1750
1750
|
status,
|
|
1751
1751
|
symbol,
|
|
1752
1752
|
side,
|
|
1753
|
-
size =
|
|
1753
|
+
size = 10
|
|
1754
1754
|
} = {}) => {
|
|
1755
1755
|
const ee = useEventEmitter();
|
|
1756
1756
|
const { data: markPrices = {} } = useMarkPricesStream();
|
|
@@ -1758,6 +1758,8 @@ var useOrderStream = ({
|
|
|
1758
1758
|
const [doUpdateOrder] = useMutation("/v1/order", "PUT");
|
|
1759
1759
|
const ordersResponse = usePrivateInfiniteQuery(
|
|
1760
1760
|
(pageIndex, previousPageData) => {
|
|
1761
|
+
if (previousPageData && !previousPageData.length)
|
|
1762
|
+
return null;
|
|
1761
1763
|
const search = new URLSearchParams([
|
|
1762
1764
|
["size", size.toString()],
|
|
1763
1765
|
["page", `${pageIndex + 1}`]
|
|
@@ -1818,9 +1820,14 @@ var useOrderStream = ({
|
|
|
1818
1820
|
}
|
|
1819
1821
|
});
|
|
1820
1822
|
}, []);
|
|
1823
|
+
const loadMore = () => {
|
|
1824
|
+
ordersResponse.setSize(ordersResponse.size + 1);
|
|
1825
|
+
};
|
|
1821
1826
|
return [
|
|
1822
1827
|
orders,
|
|
1823
1828
|
{
|
|
1829
|
+
isLoading: ordersResponse.isLoading,
|
|
1830
|
+
loadMore,
|
|
1824
1831
|
cancelAllOrders,
|
|
1825
1832
|
updateOrder,
|
|
1826
1833
|
cancelOrder
|
|
@@ -3128,6 +3135,7 @@ var useWithdraw = () => {
|
|
|
3128
3135
|
};
|
|
3129
3136
|
var isNativeTokenChecker = (address) => address === nativeTokenAddress;
|
|
3130
3137
|
var useDeposit = (options) => {
|
|
3138
|
+
console.log("useDeposit options:", options);
|
|
3131
3139
|
const { onlyTestnet } = useContext(OrderlyContext);
|
|
3132
3140
|
const [balanceRevalidating, setBalanceRevalidating] = useState(false);
|
|
3133
3141
|
const [allowanceRevalidating, setAllowanceRevalidating] = useState(false);
|
|
@@ -3205,7 +3213,7 @@ var useDeposit = (options) => {
|
|
|
3205
3213
|
const getAllowance = useCallback(
|
|
3206
3214
|
async (address, vaultAddress) => {
|
|
3207
3215
|
console.log("getAllowance", address, vaultAddress);
|
|
3208
|
-
if (!address)
|
|
3216
|
+
if (!address || !vaultAddress)
|
|
3209
3217
|
return;
|
|
3210
3218
|
if (address && isNativeTokenChecker(address))
|
|
3211
3219
|
return;
|
|
@@ -3966,7 +3974,6 @@ var useSwap = () => {
|
|
|
3966
3974
|
if (loading)
|
|
3967
3975
|
return;
|
|
3968
3976
|
start();
|
|
3969
|
-
console.log("---------", inputs);
|
|
3970
3977
|
try {
|
|
3971
3978
|
const result = await account5.walletClient.sendTransaction(
|
|
3972
3979
|
woofiDexDepositorAdress,
|