when 1
diff --git a/src/trade/twap/hooks.ts b/src/trade/twap/hooks.ts
index 2a42ca2..4c25cd6 100644
--- a/src/trade/twap/hooks.ts
+++ b/src/trade/twap/hooks.ts
@@ -11,7 +11,7 @@ import { useTwapContext } from "./twap-context";
import BN from "bignumber.js";
import { useToExactAmount } from "../hooks";
import {
- MAX_FILL_DELAY_FORMATTED,
+ MAX_FILL_DELAY_DAYS,
MIN_DURATION_MINUTES,
MIN_FILL_DELAY_MINUTES,
} from "@orbs-network/twap-sdk";
@@ -118,7 +118,7 @@ const useFillDelayWarning = () => {
return `Min. trade interval is ${MIN_FILL_DELAY_MINUTES} minutes`;
}
if (warnings.minFillDelay) {
- return `Max. trade interval is ${MAX_FILL_DELAY_FORMATTED} days`;
+ return `Max. trade interval is ${MAX_FILL_DELAY_DAYS} days`;
}
}, [warnings.maxFillDelay, warnings.minFillDelay]);
};
diff --git a/src/trade/twap/orders/orders.tsx b/src/trade/twap/orders/orders.tsx
index e86b8dc..d346732 100644
--- a/src/trade/twap/orders/orders.tsx
+++ b/src/trade/twap/orders/orders.tsx
@@ -19,9 +19,11 @@ import {
format,
makeElipsisAddress,
useTokensList,
+ wagmiConfig,
+ waitForConfirmations,
} from "@/lib";
import { Token } from "@/types";
-import { Order, OrderStatus, OrderType } from "@orbs-network/twap-sdk";
+import { Order, OrderStatus, OrderType, TwapAbi } from "@orbs-network/twap-sdk";
import { AvatarImage } from "@radix-ui/react-avatar";
import { ArrowRightIcon, ChevronDownIcon } from "lucide-react";
import { useCallback, useMemo } from "react";
@@ -30,6 +32,14 @@ import { OrdersContextProvider, useOrdersContext } from "./orders-context";
import { useGroupedOrders, useOrdersQuery } from "./use-orders-query";
import { useExplorer, useToExactAmount } from "@/trade/hooks";
import moment from "moment";
+import { useMutation } from "@tanstack/react-query";
+import { useTwapContext } from "../twap-context";
+import {
+ writeContract,
+ simulateContract,
+ getTransactionReceipt,
+} from "wagmi/actions";
+import { useAccount } from "wagmi";
export function Orders() {
return (
@@ -41,19 +51,17 @@ export function Orders() {
}
const OrdersModal = () => {
- const { isOpen, setIsOpen, selectedOrderID,setSelectedOrderID } = useOrdersContext();
-
- const onClose = useCallback(
- () => {
- if(selectedOrderID){
- setSelectedOrderID(undefined);
- }else{
- setIsOpen(false);
- }
- },
- [setIsOpen, selectedOrderID, setSelectedOrderID],
- )
-
+ const { isOpen, setIsOpen, selectedOrderID, setSelectedOrderID } =
+ useOrdersContext();
+
+ const onClose = useCallback(() => {
+ if (selectedOrderID) {
+ setSelectedOrderID(undefined);
+ } else {
+ setIsOpen(false);
+ }
+ }, [setIsOpen, selectedOrderID, setSelectedOrderID]);
+
return (