timelock-sdk 0.0.133 → 0.0.135
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-QYPs5kB7.d.cts → client-BQGLnbLD.d.ts} +210 -189
- package/dist/{client-BuKYj0pW.d.ts → client-DXq_0YH-.d.cts} +210 -189
- package/dist/client.cjs +46 -5
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +46 -6
- package/dist/client.js.map +1 -1
- package/dist/package.d.cts +1 -1
- package/dist/package.d.ts +1 -1
- package/package.json +1 -1
package/dist/client.cjs
CHANGED
|
@@ -100,8 +100,6 @@ const GetMarketDataDocument = graphql_tag.default`
|
|
|
100
100
|
TimelockMarket(where: {address: {_eq: $marketAddr}}, limit: 1) {
|
|
101
101
|
id
|
|
102
102
|
address
|
|
103
|
-
optionsCount
|
|
104
|
-
tradersCount
|
|
105
103
|
vault
|
|
106
104
|
pool
|
|
107
105
|
tickSpacing
|
|
@@ -117,6 +115,17 @@ const GetMarketDataDocument = graphql_tag.default`
|
|
|
117
115
|
}
|
|
118
116
|
}
|
|
119
117
|
`;
|
|
118
|
+
const GetMarketVolumeDocument = graphql_tag.default`
|
|
119
|
+
query GetMarketVolume($marketAddr: String!) {
|
|
120
|
+
TimelockMarket(where: {address: {_eq: $marketAddr}}, limit: 1) {
|
|
121
|
+
id
|
|
122
|
+
address
|
|
123
|
+
optionsCount
|
|
124
|
+
tradersCount
|
|
125
|
+
volume
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
`;
|
|
120
129
|
const GetUserMarketOperatorsDocument = graphql_tag.default`
|
|
121
130
|
query GetUserMarketOperators($userAddr: String!, $marketAddr: String!) {
|
|
122
131
|
UserMarketOperator(
|
|
@@ -256,6 +265,17 @@ function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
256
265
|
signal
|
|
257
266
|
}), "GetMarketData", "query", variables);
|
|
258
267
|
},
|
|
268
|
+
GetMarketVolume(variables, requestHeaders, signal) {
|
|
269
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
270
|
+
document: GetMarketVolumeDocument,
|
|
271
|
+
variables,
|
|
272
|
+
requestHeaders: {
|
|
273
|
+
...requestHeaders,
|
|
274
|
+
...wrappedRequestHeaders
|
|
275
|
+
},
|
|
276
|
+
signal
|
|
277
|
+
}), "GetMarketVolume", "query", variables);
|
|
278
|
+
},
|
|
259
279
|
GetUserMarketOperators(variables, requestHeaders, signal) {
|
|
260
280
|
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
261
281
|
document: GetUserMarketOperatorsDocument,
|
|
@@ -441,12 +461,11 @@ const useMarketData = (marketAddr) => {
|
|
|
441
461
|
const result = await graphqlClient.GetMarketData({ marketAddr: marketAddr.toLowerCase() });
|
|
442
462
|
return {
|
|
443
463
|
...result.TimelockMarket[0],
|
|
464
|
+
address: result.TimelockMarket[0].address,
|
|
444
465
|
pool: result.TimelockMarket[0].pool,
|
|
445
466
|
vault: result.TimelockMarket[0].vault,
|
|
446
467
|
optionAsset: result.TimelockMarket[0].optionAsset,
|
|
447
|
-
payoutAsset: result.TimelockMarket[0].payoutAsset
|
|
448
|
-
optionsCount: BigInt(result.TimelockMarket[0].optionsCount),
|
|
449
|
-
tradersCount: BigInt(result.TimelockMarket[0].tradersCount)
|
|
468
|
+
payoutAsset: result.TimelockMarket[0].payoutAsset
|
|
450
469
|
};
|
|
451
470
|
},
|
|
452
471
|
enabled: !!marketAddr && !!graphqlClient
|
|
@@ -526,6 +545,27 @@ const useExerciseOption = (marketAddr) => {
|
|
|
526
545
|
return (0, __tanstack_react_query.useMutation)({ mutationFn: exerciseOption });
|
|
527
546
|
};
|
|
528
547
|
|
|
548
|
+
//#endregion
|
|
549
|
+
//#region src/hooks/options/useMarketVolume.ts
|
|
550
|
+
const useMarketVolume = (marketAddr) => {
|
|
551
|
+
const { graphqlClient } = useTimelockConfig();
|
|
552
|
+
const { data } = (0, __tanstack_react_query.useQuery)({
|
|
553
|
+
queryKey: ["marketVolume", (marketAddr === null || marketAddr === void 0 ? void 0 : marketAddr.toLowerCase()) || "--"],
|
|
554
|
+
queryFn: async () => {
|
|
555
|
+
const result = await graphqlClient.GetMarketVolume({ marketAddr: marketAddr.toLowerCase() });
|
|
556
|
+
return {
|
|
557
|
+
...result.TimelockMarket[0],
|
|
558
|
+
address: result.TimelockMarket[0].address,
|
|
559
|
+
volume: BigInt(result.TimelockMarket[0].volume),
|
|
560
|
+
optionsCount: BigInt(result.TimelockMarket[0].optionsCount),
|
|
561
|
+
tradersCount: BigInt(result.TimelockMarket[0].tradersCount)
|
|
562
|
+
};
|
|
563
|
+
},
|
|
564
|
+
enabled: !!marketAddr && !!graphqlClient
|
|
565
|
+
});
|
|
566
|
+
return data || {};
|
|
567
|
+
};
|
|
568
|
+
|
|
529
569
|
//#endregion
|
|
530
570
|
//#region src/hooks/options/useMaxPositionSize.ts
|
|
531
571
|
const useMaxPositionSize = (marketAddr, maxBorrowableRange = 100) => {
|
|
@@ -1445,6 +1485,7 @@ exports.useLens = useLens;
|
|
|
1445
1485
|
exports.useLiquidityBlocks = useLiquidityBlocks;
|
|
1446
1486
|
exports.useMarketData = useMarketData;
|
|
1447
1487
|
exports.useMarketPriceHistory = useMarketPriceHistory;
|
|
1488
|
+
exports.useMarketVolume = useMarketVolume;
|
|
1448
1489
|
exports.useMaxPositionSize = useMaxPositionSize;
|
|
1449
1490
|
exports.useMintLiquidity = useMintLiquidity;
|
|
1450
1491
|
exports.useMintOption = useMintOption;
|