timelock-sdk 0.0.116 → 0.0.118
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/{client-CxAAahmW.d.ts → client-Cgi8okgz.d.cts} +4 -4
- package/dist/{client-C1AigaVu.d.cts → client-DHaoz1Iz.d.ts} +138 -138
- package/dist/client.cjs +8 -18
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +7 -11
- package/dist/client.js.map +1 -1
- package/dist/{optionUtils-DQakRJ_U.cjs → optionUtils-ZSFOJxaV.cjs} +1 -4
- package/dist/{optionUtils-DQakRJ_U.cjs.map → optionUtils-ZSFOJxaV.cjs.map} +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.d.cts +1 -1
- package/dist/package.d.ts +1 -1
- package/package.json +7 -7
package/dist/client.cjs
CHANGED
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
const require_optionUtils = require('./optionUtils-
|
|
4
|
+
const require_optionUtils = require('./optionUtils-ZSFOJxaV.cjs');
|
|
5
5
|
const require_optionsMarket = require('./optionsMarket-D6zrIXc3.cjs');
|
|
6
6
|
const require_singleOwnerVault = require('./singleOwnerVault-gf2zNZVk.cjs');
|
|
7
7
|
let viem = require("viem");
|
|
8
|
-
viem = require_optionUtils.__toESM(viem);
|
|
9
8
|
let react = require("react");
|
|
10
9
|
react = require_optionUtils.__toESM(react);
|
|
11
10
|
let wagmi = require("wagmi");
|
|
12
|
-
wagmi = require_optionUtils.__toESM(wagmi);
|
|
13
11
|
let graphql_request = require("graphql-request");
|
|
14
|
-
graphql_request = require_optionUtils.__toESM(graphql_request);
|
|
15
12
|
let graphql_tag = require("graphql-tag");
|
|
16
13
|
graphql_tag = require_optionUtils.__toESM(graphql_tag);
|
|
17
14
|
let viem_actions = require("viem/actions");
|
|
18
|
-
viem_actions = require_optionUtils.__toESM(viem_actions);
|
|
19
15
|
let __tanstack_react_query = require("@tanstack/react-query");
|
|
20
|
-
__tanstack_react_query = require_optionUtils.__toESM(__tanstack_react_query);
|
|
21
16
|
let zod = require("zod");
|
|
22
|
-
zod = require_optionUtils.__toESM(zod);
|
|
23
17
|
|
|
24
18
|
//#region src/generated/graphql.ts
|
|
25
19
|
const UserOptionFieldsFragmentDoc = graphql_tag.default`
|
|
@@ -523,7 +517,7 @@ const useExerciseOption = (marketAddr) => {
|
|
|
523
517
|
]
|
|
524
518
|
});
|
|
525
519
|
await (0, viem_actions.waitForTransactionReceipt)(client, { hash });
|
|
526
|
-
await sleep(
|
|
520
|
+
await sleep(200);
|
|
527
521
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
528
522
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
529
523
|
queryClient.invalidateQueries({ queryKey: ["readContract"] });
|
|
@@ -660,7 +654,7 @@ const useMintOption = (marketAddr) => {
|
|
|
660
654
|
]
|
|
661
655
|
});
|
|
662
656
|
await (0, viem_actions.waitForTransactionReceipt)(client, { hash });
|
|
663
|
-
await sleep(
|
|
657
|
+
await sleep(200);
|
|
664
658
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
665
659
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
666
660
|
queryClient.invalidateQueries({ queryKey: ["readContract"] });
|
|
@@ -834,7 +828,7 @@ const useExtendOption = (marketAddr) => {
|
|
|
834
828
|
]
|
|
835
829
|
});
|
|
836
830
|
await (0, viem_actions.waitForTransactionReceipt)(client, { hash });
|
|
837
|
-
await sleep(
|
|
831
|
+
await sleep(200);
|
|
838
832
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
839
833
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
840
834
|
queryClient.invalidateQueries({ queryKey: ["readContract"] });
|
|
@@ -1094,15 +1088,14 @@ const useMintPerp = (marketAddr) => {
|
|
|
1094
1088
|
spendingApproval: maxPremium
|
|
1095
1089
|
});
|
|
1096
1090
|
await askForApproval(payoutAsset, marketAddr, maxPremium);
|
|
1097
|
-
|
|
1091
|
+
await operator.mintPerp({
|
|
1098
1092
|
marketAddr,
|
|
1099
1093
|
amount,
|
|
1100
1094
|
optionType,
|
|
1101
1095
|
duration,
|
|
1102
1096
|
strikeTick: validStrikeTick
|
|
1103
1097
|
});
|
|
1104
|
-
await (
|
|
1105
|
-
await sleep(400);
|
|
1098
|
+
await sleep(200);
|
|
1106
1099
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
1107
1100
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
1108
1101
|
queryClient.invalidateQueries({ queryKey: ["readContract"] });
|
|
@@ -1114,15 +1107,12 @@ const useMintPerp = (marketAddr) => {
|
|
|
1114
1107
|
//#region src/hooks/perps/useClosePerp.ts
|
|
1115
1108
|
const useClosePerp = () => {
|
|
1116
1109
|
const queryClient = (0, __tanstack_react_query.useQueryClient)();
|
|
1117
|
-
const client = (0, wagmi.useClient)();
|
|
1118
1110
|
const { operator, signMessage: { mutateAsync: signMessage } } = usePerpsOperator();
|
|
1119
1111
|
return (0, __tanstack_react_query.useMutation)({ mutationFn: async (body) => {
|
|
1120
1112
|
if (!operator) throw new Error("Operator not connected");
|
|
1121
|
-
if (!client) throw new Error("No RPC client");
|
|
1122
1113
|
if (!operator.auth) await signMessage();
|
|
1123
|
-
|
|
1124
|
-
await (
|
|
1125
|
-
await sleep(400);
|
|
1114
|
+
await operator.exercisePerp(body);
|
|
1115
|
+
await sleep(200);
|
|
1126
1116
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
1127
1117
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
1128
1118
|
queryClient.invalidateQueries({ queryKey: ["readContract"] });
|