timelock-sdk 0.0.75 → 0.0.77
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.cjs +72 -6
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +43 -440
- package/dist/client.d.ts +109 -506
- package/dist/client.js +72 -6
- package/dist/client.js.map +1 -1
- package/dist/{index-CdkTrz02.d.ts → index-BdBPLPWm.d.ts} +92 -92
- package/dist/package.d.ts +1 -1
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -23,12 +23,6 @@ const UserOptionFieldsFragmentDoc = gql`
|
|
|
23
23
|
market {
|
|
24
24
|
address
|
|
25
25
|
}
|
|
26
|
-
exerciseEvents {
|
|
27
|
-
transactionHash
|
|
28
|
-
}
|
|
29
|
-
mintEvent {
|
|
30
|
-
transactionHash
|
|
31
|
-
}
|
|
32
26
|
optionType
|
|
33
27
|
strikeTick
|
|
34
28
|
entryTick
|
|
@@ -142,6 +136,66 @@ const GetUserMarketOperatorsDocument = gql`
|
|
|
142
136
|
}
|
|
143
137
|
}
|
|
144
138
|
`;
|
|
139
|
+
const GetOptionEventsDocument = gql`
|
|
140
|
+
query GetOptionEvents($marketAddr: String!, $optionId: numeric!) {
|
|
141
|
+
MintOptionEvent(
|
|
142
|
+
where: {
|
|
143
|
+
option: {
|
|
144
|
+
optionId: {_eq: $optionId}
|
|
145
|
+
market: {address: {_eq: $marketAddr}}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
limit: 1000
|
|
149
|
+
) {
|
|
150
|
+
id
|
|
151
|
+
optionType
|
|
152
|
+
strikeTick
|
|
153
|
+
currentTick
|
|
154
|
+
expiresAt
|
|
155
|
+
premium
|
|
156
|
+
protocolFee
|
|
157
|
+
liquidities
|
|
158
|
+
timestamp
|
|
159
|
+
blockNumber
|
|
160
|
+
transactionHash
|
|
161
|
+
}
|
|
162
|
+
ExerciseOptionEvent(
|
|
163
|
+
where: {
|
|
164
|
+
option: {
|
|
165
|
+
market: {address: {_eq: $marketAddr}}
|
|
166
|
+
optionId: {_eq: $optionId}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
limit: 1000
|
|
170
|
+
) {
|
|
171
|
+
id
|
|
172
|
+
liquidities
|
|
173
|
+
currentTick
|
|
174
|
+
payout
|
|
175
|
+
timestamp
|
|
176
|
+
blockNumber
|
|
177
|
+
transactionHash
|
|
178
|
+
}
|
|
179
|
+
ExtendOptionEvent(
|
|
180
|
+
where: {
|
|
181
|
+
option: {
|
|
182
|
+
market: {address: {_eq: $marketAddr}}
|
|
183
|
+
optionId: {_eq: $optionId}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
limit: 1000
|
|
187
|
+
) {
|
|
188
|
+
id
|
|
189
|
+
premium
|
|
190
|
+
protocolFee
|
|
191
|
+
currentTick
|
|
192
|
+
addedDuration
|
|
193
|
+
timestamp
|
|
194
|
+
blockNumber
|
|
195
|
+
transactionHash
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
`;
|
|
145
199
|
const defaultWrapper = (action, _operationName, _operationType, _variables) => action();
|
|
146
200
|
function getSdk(client, withWrapper = defaultWrapper) {
|
|
147
201
|
return {
|
|
@@ -210,6 +264,17 @@ function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
210
264
|
},
|
|
211
265
|
signal
|
|
212
266
|
}), "GetUserMarketOperators", "query", variables);
|
|
267
|
+
},
|
|
268
|
+
GetOptionEvents(variables, requestHeaders, signal) {
|
|
269
|
+
return withWrapper((wrappedRequestHeaders) => client.request({
|
|
270
|
+
document: GetOptionEventsDocument,
|
|
271
|
+
variables,
|
|
272
|
+
requestHeaders: {
|
|
273
|
+
...requestHeaders,
|
|
274
|
+
...wrappedRequestHeaders
|
|
275
|
+
},
|
|
276
|
+
signal
|
|
277
|
+
}), "GetOptionEvents", "query", variables);
|
|
213
278
|
}
|
|
214
279
|
};
|
|
215
280
|
}
|
|
@@ -565,6 +630,7 @@ const useOptionPremium = (marketAddr, optionType, optionAmount, addedDuration, r
|
|
|
565
630
|
const useUserOptions = (userAddr, marketAddr, active = false) => {
|
|
566
631
|
const { graphqlClient } = useTimelockConfig();
|
|
567
632
|
userAddr = userAddr === null || userAddr === void 0 ? void 0 : userAddr.toLowerCase();
|
|
633
|
+
marketAddr = marketAddr === null || marketAddr === void 0 ? void 0 : marketAddr.toLowerCase();
|
|
568
634
|
const { data,...rest } = useQuery({
|
|
569
635
|
queryKey: [
|
|
570
636
|
"userOptions",
|