@polygonlabs/staking-api-client 0.0.1
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/LICENSE +201 -0
- package/MIGRATION.md +7 -0
- package/README.md +43 -0
- package/dist/generated/@tanstack/react-query.gen.d.ts +1602 -0
- package/dist/generated/@tanstack/react-query.gen.d.ts.map +1 -0
- package/dist/generated/@tanstack/react-query.gen.js +707 -0
- package/dist/generated/@tanstack/react-query.gen.js.map +1 -0
- package/dist/generated/client/client.gen.d.ts +3 -0
- package/dist/generated/client/client.gen.d.ts.map +1 -0
- package/dist/generated/client/client.gen.js +236 -0
- package/dist/generated/client/client.gen.js.map +1 -0
- package/dist/generated/client/index.d.ts +9 -0
- package/dist/generated/client/index.d.ts.map +1 -0
- package/dist/generated/client/index.js +7 -0
- package/dist/generated/client/index.js.map +1 -0
- package/dist/generated/client/types.gen.d.ts +118 -0
- package/dist/generated/client/types.gen.d.ts.map +1 -0
- package/dist/generated/client/types.gen.js +3 -0
- package/dist/generated/client/types.gen.js.map +1 -0
- package/dist/generated/client/utils.gen.d.ts +34 -0
- package/dist/generated/client/utils.gen.d.ts.map +1 -0
- package/dist/generated/client/utils.gen.js +229 -0
- package/dist/generated/client/utils.gen.js.map +1 -0
- package/dist/generated/client.gen.d.ts +13 -0
- package/dist/generated/client.gen.d.ts.map +1 -0
- package/dist/generated/client.gen.js +4 -0
- package/dist/generated/client.gen.js.map +1 -0
- package/dist/generated/core/auth.gen.d.ts +19 -0
- package/dist/generated/core/auth.gen.d.ts.map +1 -0
- package/dist/generated/core/auth.gen.js +15 -0
- package/dist/generated/core/auth.gen.js.map +1 -0
- package/dist/generated/core/bodySerializer.gen.d.ts +26 -0
- package/dist/generated/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/generated/core/bodySerializer.gen.js +58 -0
- package/dist/generated/core/bodySerializer.gen.js.map +1 -0
- package/dist/generated/core/params.gen.d.ts +44 -0
- package/dist/generated/core/params.gen.d.ts.map +1 -0
- package/dist/generated/core/params.gen.js +101 -0
- package/dist/generated/core/params.gen.js.map +1 -0
- package/dist/generated/core/pathSerializer.gen.d.ts +34 -0
- package/dist/generated/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/generated/core/pathSerializer.gen.js +107 -0
- package/dist/generated/core/pathSerializer.gen.js.map +1 -0
- package/dist/generated/core/queryKeySerializer.gen.d.ts +19 -0
- package/dist/generated/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/generated/core/queryKeySerializer.gen.js +93 -0
- package/dist/generated/core/queryKeySerializer.gen.js.map +1 -0
- package/dist/generated/core/serverSentEvents.gen.d.ts +72 -0
- package/dist/generated/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/generated/core/serverSentEvents.gen.js +134 -0
- package/dist/generated/core/serverSentEvents.gen.js.map +1 -0
- package/dist/generated/core/types.gen.d.ts +79 -0
- package/dist/generated/core/types.gen.d.ts.map +1 -0
- package/dist/generated/core/types.gen.js +3 -0
- package/dist/generated/core/types.gen.js.map +1 -0
- package/dist/generated/core/utils.gen.d.ts +20 -0
- package/dist/generated/core/utils.gen.d.ts.map +1 -0
- package/dist/generated/core/utils.gen.js +88 -0
- package/dist/generated/core/utils.gen.js.map +1 -0
- package/dist/generated/index.d.ts +4 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +5 -0
- package/dist/generated/index.js.map +1 -0
- package/dist/generated/registry-validator.gen.d.ts +781 -0
- package/dist/generated/registry-validator.gen.d.ts.map +1 -0
- package/dist/generated/registry-validator.gen.js +1296 -0
- package/dist/generated/registry-validator.gen.js.map +1 -0
- package/dist/generated/sdk.gen.d.ts +151 -0
- package/dist/generated/sdk.gen.d.ts.map +1 -0
- package/dist/generated/sdk.gen.js +281 -0
- package/dist/generated/sdk.gen.js.map +1 -0
- package/dist/generated/types.gen.d.ts +994 -0
- package/dist/generated/types.gen.d.ts.map +1 -0
- package/dist/generated/types.gen.js +3 -0
- package/dist/generated/types.gen.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/react.d.ts +2 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +6 -0
- package/dist/react.js.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,707 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
import { infiniteQueryOptions, queryOptions } from '@tanstack/react-query';
|
|
3
|
+
import { client } from '../client.gen.js';
|
|
4
|
+
import { addValidatorV2, adminUpsertValidatorProfile, getAllDelegatorsV2, getAllDelegatorsV3, getCheckpointIntervalV2, getCheckpointsSignedByValidatorV2, getCheckpointsSignedByValidatorV3, getCommissionedRewardV2, getCurrentAprV2, getDelegationsByUserV2, getDelegationsByUserV3, getDelegatorUnbondsV2, getDelegatorUnbondsV3, getMissedCheckpointsByAllValidatorsV2, getPerformanceBenchmarkV2, getRewardsSummaryV2, getSignerAddressListForCheckpointNumberV2, getSignerAddressListForLatestCheckpointV2, getSignerEthBalancesV2, getSummaryV3, getTotalStakedV2, getUserLoginV3, getValidatorByAddressV2, getValidatorDelegatorsV2, getValidatorDelegatorsV3, getValidatorV2, getValidatorV3, updateValidatorV2 } from '../sdk.gen.js';
|
|
5
|
+
/**
|
|
6
|
+
* Upsert a validator profile on an owner’s behalf (admin backstop)
|
|
7
|
+
*
|
|
8
|
+
* Support path for validators whose owner wallet cannot produce a verifiable signature (e.g. non-ERC-1271 contract owners), so they cannot self-serve via the signature-gated v2 add/update. Authenticated by the AdminApiKey shared secret; every use is audit-logged.
|
|
9
|
+
*/
|
|
10
|
+
export const adminUpsertValidatorProfileMutation = (options) => {
|
|
11
|
+
const mutationOptions = {
|
|
12
|
+
mutationFn: async (fnOptions) => {
|
|
13
|
+
const { data } = await adminUpsertValidatorProfile({
|
|
14
|
+
...options,
|
|
15
|
+
...fnOptions,
|
|
16
|
+
throwOnError: true
|
|
17
|
+
});
|
|
18
|
+
return data;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
return mutationOptions;
|
|
22
|
+
};
|
|
23
|
+
const createQueryKey = (id, options, infinite, tags) => {
|
|
24
|
+
const params = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl };
|
|
25
|
+
if (infinite) {
|
|
26
|
+
params._infinite = infinite;
|
|
27
|
+
}
|
|
28
|
+
if (tags) {
|
|
29
|
+
params.tags = tags;
|
|
30
|
+
}
|
|
31
|
+
if (options?.body) {
|
|
32
|
+
params.body = options.body;
|
|
33
|
+
}
|
|
34
|
+
if (options?.headers) {
|
|
35
|
+
params.headers = options.headers;
|
|
36
|
+
}
|
|
37
|
+
if (options?.path) {
|
|
38
|
+
params.path = options.path;
|
|
39
|
+
}
|
|
40
|
+
if (options?.query) {
|
|
41
|
+
params.query = options.query;
|
|
42
|
+
}
|
|
43
|
+
return [params];
|
|
44
|
+
};
|
|
45
|
+
export const getValidatorV3QueryKey = (options) => createQueryKey('getValidatorV3', options);
|
|
46
|
+
/**
|
|
47
|
+
* Get a validator by id (v3)
|
|
48
|
+
*/
|
|
49
|
+
export const getValidatorV3Options = (options) => queryOptions({
|
|
50
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
51
|
+
const { data } = await getValidatorV3({
|
|
52
|
+
...options,
|
|
53
|
+
...queryKey[0],
|
|
54
|
+
signal,
|
|
55
|
+
throwOnError: true
|
|
56
|
+
});
|
|
57
|
+
return data;
|
|
58
|
+
},
|
|
59
|
+
queryKey: getValidatorV3QueryKey(options)
|
|
60
|
+
});
|
|
61
|
+
export const getCheckpointsSignedByValidatorV3QueryKey = (options) => createQueryKey('getCheckpointsSignedByValidatorV3', options);
|
|
62
|
+
/**
|
|
63
|
+
* Checkpoints signed by a validator (v3)
|
|
64
|
+
*/
|
|
65
|
+
export const getCheckpointsSignedByValidatorV3Options = (options) => queryOptions({
|
|
66
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
67
|
+
const { data } = await getCheckpointsSignedByValidatorV3({
|
|
68
|
+
...options,
|
|
69
|
+
...queryKey[0],
|
|
70
|
+
signal,
|
|
71
|
+
throwOnError: true
|
|
72
|
+
});
|
|
73
|
+
return data;
|
|
74
|
+
},
|
|
75
|
+
queryKey: getCheckpointsSignedByValidatorV3QueryKey(options)
|
|
76
|
+
});
|
|
77
|
+
const createInfiniteParams = (queryKey, page) => {
|
|
78
|
+
const params = { ...queryKey[0] };
|
|
79
|
+
if (page.body) {
|
|
80
|
+
params.body = {
|
|
81
|
+
...queryKey[0].body,
|
|
82
|
+
...page.body
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
if (page.headers) {
|
|
86
|
+
params.headers = {
|
|
87
|
+
...queryKey[0].headers,
|
|
88
|
+
...page.headers
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
if (page.path) {
|
|
92
|
+
params.path = {
|
|
93
|
+
...queryKey[0].path,
|
|
94
|
+
...page.path
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
if (page.query) {
|
|
98
|
+
params.query = {
|
|
99
|
+
...queryKey[0].query,
|
|
100
|
+
...page.query
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
return params;
|
|
104
|
+
};
|
|
105
|
+
export const getCheckpointsSignedByValidatorV3InfiniteQueryKey = (options) => createQueryKey('getCheckpointsSignedByValidatorV3', options, true);
|
|
106
|
+
/**
|
|
107
|
+
* Checkpoints signed by a validator (v3)
|
|
108
|
+
*/
|
|
109
|
+
export const getCheckpointsSignedByValidatorV3InfiniteOptions = (options) => infiniteQueryOptions(
|
|
110
|
+
// @ts-ignore
|
|
111
|
+
{
|
|
112
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
113
|
+
// @ts-ignore
|
|
114
|
+
const page = typeof pageParam === 'object' ? pageParam : {
|
|
115
|
+
query: {
|
|
116
|
+
offset: pageParam
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
const params = createInfiniteParams(queryKey, page);
|
|
120
|
+
const { data } = await getCheckpointsSignedByValidatorV3({
|
|
121
|
+
...options,
|
|
122
|
+
...params,
|
|
123
|
+
signal,
|
|
124
|
+
throwOnError: true
|
|
125
|
+
});
|
|
126
|
+
return data;
|
|
127
|
+
},
|
|
128
|
+
queryKey: getCheckpointsSignedByValidatorV3InfiniteQueryKey(options)
|
|
129
|
+
});
|
|
130
|
+
export const getAllDelegatorsV3QueryKey = (options) => createQueryKey('getAllDelegatorsV3', options);
|
|
131
|
+
/**
|
|
132
|
+
* List delegators (v3)
|
|
133
|
+
*/
|
|
134
|
+
export const getAllDelegatorsV3Options = (options) => queryOptions({
|
|
135
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
136
|
+
const { data } = await getAllDelegatorsV3({
|
|
137
|
+
...options,
|
|
138
|
+
...queryKey[0],
|
|
139
|
+
signal,
|
|
140
|
+
throwOnError: true
|
|
141
|
+
});
|
|
142
|
+
return data;
|
|
143
|
+
},
|
|
144
|
+
queryKey: getAllDelegatorsV3QueryKey(options)
|
|
145
|
+
});
|
|
146
|
+
export const getAllDelegatorsV3InfiniteQueryKey = (options) => createQueryKey('getAllDelegatorsV3', options, true);
|
|
147
|
+
/**
|
|
148
|
+
* List delegators (v3)
|
|
149
|
+
*/
|
|
150
|
+
export const getAllDelegatorsV3InfiniteOptions = (options) => infiniteQueryOptions(
|
|
151
|
+
// @ts-ignore
|
|
152
|
+
{
|
|
153
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
154
|
+
// @ts-ignore
|
|
155
|
+
const page = typeof pageParam === 'object' ? pageParam : {
|
|
156
|
+
query: {
|
|
157
|
+
offset: pageParam
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
const params = createInfiniteParams(queryKey, page);
|
|
161
|
+
const { data } = await getAllDelegatorsV3({
|
|
162
|
+
...options,
|
|
163
|
+
...params,
|
|
164
|
+
signal,
|
|
165
|
+
throwOnError: true
|
|
166
|
+
});
|
|
167
|
+
return data;
|
|
168
|
+
},
|
|
169
|
+
queryKey: getAllDelegatorsV3InfiniteQueryKey(options)
|
|
170
|
+
});
|
|
171
|
+
export const getDelegationsByUserV3QueryKey = (options) => createQueryKey('getDelegationsByUserV3', options);
|
|
172
|
+
/**
|
|
173
|
+
* Delegations for an address (v3)
|
|
174
|
+
*/
|
|
175
|
+
export const getDelegationsByUserV3Options = (options) => queryOptions({
|
|
176
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
177
|
+
const { data } = await getDelegationsByUserV3({
|
|
178
|
+
...options,
|
|
179
|
+
...queryKey[0],
|
|
180
|
+
signal,
|
|
181
|
+
throwOnError: true
|
|
182
|
+
});
|
|
183
|
+
return data;
|
|
184
|
+
},
|
|
185
|
+
queryKey: getDelegationsByUserV3QueryKey(options)
|
|
186
|
+
});
|
|
187
|
+
export const getDelegationsByUserV3InfiniteQueryKey = (options) => createQueryKey('getDelegationsByUserV3', options, true);
|
|
188
|
+
/**
|
|
189
|
+
* Delegations for an address (v3)
|
|
190
|
+
*/
|
|
191
|
+
export const getDelegationsByUserV3InfiniteOptions = (options) => infiniteQueryOptions(
|
|
192
|
+
// @ts-ignore
|
|
193
|
+
{
|
|
194
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
195
|
+
// @ts-ignore
|
|
196
|
+
const page = typeof pageParam === 'object' ? pageParam : {
|
|
197
|
+
query: {
|
|
198
|
+
offset: pageParam
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
const params = createInfiniteParams(queryKey, page);
|
|
202
|
+
const { data } = await getDelegationsByUserV3({
|
|
203
|
+
...options,
|
|
204
|
+
...params,
|
|
205
|
+
signal,
|
|
206
|
+
throwOnError: true
|
|
207
|
+
});
|
|
208
|
+
return data;
|
|
209
|
+
},
|
|
210
|
+
queryKey: getDelegationsByUserV3InfiniteQueryKey(options)
|
|
211
|
+
});
|
|
212
|
+
export const getDelegatorUnbondsV3QueryKey = (options) => createQueryKey('getDelegatorUnbondsV3', options);
|
|
213
|
+
/**
|
|
214
|
+
* Unbonds for an address (v3)
|
|
215
|
+
*/
|
|
216
|
+
export const getDelegatorUnbondsV3Options = (options) => queryOptions({
|
|
217
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
218
|
+
const { data } = await getDelegatorUnbondsV3({
|
|
219
|
+
...options,
|
|
220
|
+
...queryKey[0],
|
|
221
|
+
signal,
|
|
222
|
+
throwOnError: true
|
|
223
|
+
});
|
|
224
|
+
return data;
|
|
225
|
+
},
|
|
226
|
+
queryKey: getDelegatorUnbondsV3QueryKey(options)
|
|
227
|
+
});
|
|
228
|
+
export const getValidatorDelegatorsV3QueryKey = (options) => createQueryKey('getValidatorDelegatorsV3', options);
|
|
229
|
+
/**
|
|
230
|
+
* Delegators of a validator (v3)
|
|
231
|
+
*/
|
|
232
|
+
export const getValidatorDelegatorsV3Options = (options) => queryOptions({
|
|
233
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
234
|
+
const { data } = await getValidatorDelegatorsV3({
|
|
235
|
+
...options,
|
|
236
|
+
...queryKey[0],
|
|
237
|
+
signal,
|
|
238
|
+
throwOnError: true
|
|
239
|
+
});
|
|
240
|
+
return data;
|
|
241
|
+
},
|
|
242
|
+
queryKey: getValidatorDelegatorsV3QueryKey(options)
|
|
243
|
+
});
|
|
244
|
+
export const getValidatorDelegatorsV3InfiniteQueryKey = (options) => createQueryKey('getValidatorDelegatorsV3', options, true);
|
|
245
|
+
/**
|
|
246
|
+
* Delegators of a validator (v3)
|
|
247
|
+
*/
|
|
248
|
+
export const getValidatorDelegatorsV3InfiniteOptions = (options) => infiniteQueryOptions(
|
|
249
|
+
// @ts-ignore
|
|
250
|
+
{
|
|
251
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
252
|
+
// @ts-ignore
|
|
253
|
+
const page = typeof pageParam === 'object' ? pageParam : {
|
|
254
|
+
query: {
|
|
255
|
+
offset: pageParam
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
const params = createInfiniteParams(queryKey, page);
|
|
259
|
+
const { data } = await getValidatorDelegatorsV3({
|
|
260
|
+
...options,
|
|
261
|
+
...params,
|
|
262
|
+
signal,
|
|
263
|
+
throwOnError: true
|
|
264
|
+
});
|
|
265
|
+
return data;
|
|
266
|
+
},
|
|
267
|
+
queryKey: getValidatorDelegatorsV3InfiniteQueryKey(options)
|
|
268
|
+
});
|
|
269
|
+
export const getSummaryV3QueryKey = (options) => createQueryKey('getSummaryV3', options);
|
|
270
|
+
/**
|
|
271
|
+
* Network summary (v3)
|
|
272
|
+
*/
|
|
273
|
+
export const getSummaryV3Options = (options) => queryOptions({
|
|
274
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
275
|
+
const { data } = await getSummaryV3({
|
|
276
|
+
...options,
|
|
277
|
+
...queryKey[0],
|
|
278
|
+
signal,
|
|
279
|
+
throwOnError: true
|
|
280
|
+
});
|
|
281
|
+
return data;
|
|
282
|
+
},
|
|
283
|
+
queryKey: getSummaryV3QueryKey(options)
|
|
284
|
+
});
|
|
285
|
+
export const getUserLoginV3QueryKey = (options) => createQueryKey('getUserLoginV3', options);
|
|
286
|
+
/**
|
|
287
|
+
* User login details by address (v3)
|
|
288
|
+
*/
|
|
289
|
+
export const getUserLoginV3Options = (options) => queryOptions({
|
|
290
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
291
|
+
const { data } = await getUserLoginV3({
|
|
292
|
+
...options,
|
|
293
|
+
...queryKey[0],
|
|
294
|
+
signal,
|
|
295
|
+
throwOnError: true
|
|
296
|
+
});
|
|
297
|
+
return data;
|
|
298
|
+
},
|
|
299
|
+
queryKey: getUserLoginV3QueryKey(options)
|
|
300
|
+
});
|
|
301
|
+
export const getTotalStakedV2QueryKey = (options) => createQueryKey('getTotalStakedV2', options);
|
|
302
|
+
/**
|
|
303
|
+
* Total stake across validators (v2)
|
|
304
|
+
*/
|
|
305
|
+
export const getTotalStakedV2Options = (options) => queryOptions({
|
|
306
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
307
|
+
const { data } = await getTotalStakedV2({
|
|
308
|
+
...options,
|
|
309
|
+
...queryKey[0],
|
|
310
|
+
signal,
|
|
311
|
+
throwOnError: true
|
|
312
|
+
});
|
|
313
|
+
return data;
|
|
314
|
+
},
|
|
315
|
+
queryKey: getTotalStakedV2QueryKey(options)
|
|
316
|
+
});
|
|
317
|
+
export const getValidatorByAddressV2QueryKey = (options) => createQueryKey('getValidatorByAddressV2', options);
|
|
318
|
+
/**
|
|
319
|
+
* Validator by owner address (v2)
|
|
320
|
+
*/
|
|
321
|
+
export const getValidatorByAddressV2Options = (options) => queryOptions({
|
|
322
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
323
|
+
const { data } = await getValidatorByAddressV2({
|
|
324
|
+
...options,
|
|
325
|
+
...queryKey[0],
|
|
326
|
+
signal,
|
|
327
|
+
throwOnError: true
|
|
328
|
+
});
|
|
329
|
+
return data;
|
|
330
|
+
},
|
|
331
|
+
queryKey: getValidatorByAddressV2QueryKey(options)
|
|
332
|
+
});
|
|
333
|
+
export const getCheckpointsSignedByValidatorV2QueryKey = (options) => createQueryKey('getCheckpointsSignedByValidatorV2', options);
|
|
334
|
+
/**
|
|
335
|
+
* Checkpoints signed by a validator (v2)
|
|
336
|
+
*/
|
|
337
|
+
export const getCheckpointsSignedByValidatorV2Options = (options) => queryOptions({
|
|
338
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
339
|
+
const { data } = await getCheckpointsSignedByValidatorV2({
|
|
340
|
+
...options,
|
|
341
|
+
...queryKey[0],
|
|
342
|
+
signal,
|
|
343
|
+
throwOnError: true
|
|
344
|
+
});
|
|
345
|
+
return data;
|
|
346
|
+
},
|
|
347
|
+
queryKey: getCheckpointsSignedByValidatorV2QueryKey(options)
|
|
348
|
+
});
|
|
349
|
+
export const getCheckpointsSignedByValidatorV2InfiniteQueryKey = (options) => createQueryKey('getCheckpointsSignedByValidatorV2', options, true);
|
|
350
|
+
/**
|
|
351
|
+
* Checkpoints signed by a validator (v2)
|
|
352
|
+
*/
|
|
353
|
+
export const getCheckpointsSignedByValidatorV2InfiniteOptions = (options) => infiniteQueryOptions(
|
|
354
|
+
// @ts-ignore
|
|
355
|
+
{
|
|
356
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
357
|
+
// @ts-ignore
|
|
358
|
+
const page = typeof pageParam === 'object' ? pageParam : {
|
|
359
|
+
query: {
|
|
360
|
+
offset: pageParam
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
const params = createInfiniteParams(queryKey, page);
|
|
364
|
+
const { data } = await getCheckpointsSignedByValidatorV2({
|
|
365
|
+
...options,
|
|
366
|
+
...params,
|
|
367
|
+
signal,
|
|
368
|
+
throwOnError: true
|
|
369
|
+
});
|
|
370
|
+
return data;
|
|
371
|
+
},
|
|
372
|
+
queryKey: getCheckpointsSignedByValidatorV2InfiniteQueryKey(options)
|
|
373
|
+
});
|
|
374
|
+
export const getCommissionedRewardV2QueryKey = (options) => createQueryKey('getCommissionedRewardV2', options);
|
|
375
|
+
/**
|
|
376
|
+
* Commissioned rewards for a validator (v2)
|
|
377
|
+
*/
|
|
378
|
+
export const getCommissionedRewardV2Options = (options) => queryOptions({
|
|
379
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
380
|
+
const { data } = await getCommissionedRewardV2({
|
|
381
|
+
...options,
|
|
382
|
+
...queryKey[0],
|
|
383
|
+
signal,
|
|
384
|
+
throwOnError: true
|
|
385
|
+
});
|
|
386
|
+
return data;
|
|
387
|
+
},
|
|
388
|
+
queryKey: getCommissionedRewardV2QueryKey(options)
|
|
389
|
+
});
|
|
390
|
+
export const getValidatorV2QueryKey = (options) => createQueryKey('getValidatorV2', options);
|
|
391
|
+
/**
|
|
392
|
+
* Validator by id (v2)
|
|
393
|
+
*/
|
|
394
|
+
export const getValidatorV2Options = (options) => queryOptions({
|
|
395
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
396
|
+
const { data } = await getValidatorV2({
|
|
397
|
+
...options,
|
|
398
|
+
...queryKey[0],
|
|
399
|
+
signal,
|
|
400
|
+
throwOnError: true
|
|
401
|
+
});
|
|
402
|
+
return data;
|
|
403
|
+
},
|
|
404
|
+
queryKey: getValidatorV2QueryKey(options)
|
|
405
|
+
});
|
|
406
|
+
/**
|
|
407
|
+
* Add/upsert validator profile (v2, signature-gated)
|
|
408
|
+
*
|
|
409
|
+
* The WalletOwnerSignature auth verifies the owner-wallet signature over the profile fields before the handler runs; a signature that does not verify is rejected with a 401 {error:true,message}.
|
|
410
|
+
*/
|
|
411
|
+
export const addValidatorV2Mutation = (options) => {
|
|
412
|
+
const mutationOptions = {
|
|
413
|
+
mutationFn: async (fnOptions) => {
|
|
414
|
+
const { data } = await addValidatorV2({
|
|
415
|
+
...options,
|
|
416
|
+
...fnOptions,
|
|
417
|
+
throwOnError: true
|
|
418
|
+
});
|
|
419
|
+
return data;
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
return mutationOptions;
|
|
423
|
+
};
|
|
424
|
+
/**
|
|
425
|
+
* Update validator profile (v2, signature-gated)
|
|
426
|
+
*/
|
|
427
|
+
export const updateValidatorV2Mutation = (options) => {
|
|
428
|
+
const mutationOptions = {
|
|
429
|
+
mutationFn: async (fnOptions) => {
|
|
430
|
+
const { data } = await updateValidatorV2({
|
|
431
|
+
...options,
|
|
432
|
+
...fnOptions,
|
|
433
|
+
throwOnError: true
|
|
434
|
+
});
|
|
435
|
+
return data;
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
return mutationOptions;
|
|
439
|
+
};
|
|
440
|
+
export const getAllDelegatorsV2QueryKey = (options) => createQueryKey('getAllDelegatorsV2', options);
|
|
441
|
+
/**
|
|
442
|
+
* List delegators (v2)
|
|
443
|
+
*/
|
|
444
|
+
export const getAllDelegatorsV2Options = (options) => queryOptions({
|
|
445
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
446
|
+
const { data } = await getAllDelegatorsV2({
|
|
447
|
+
...options,
|
|
448
|
+
...queryKey[0],
|
|
449
|
+
signal,
|
|
450
|
+
throwOnError: true
|
|
451
|
+
});
|
|
452
|
+
return data;
|
|
453
|
+
},
|
|
454
|
+
queryKey: getAllDelegatorsV2QueryKey(options)
|
|
455
|
+
});
|
|
456
|
+
export const getAllDelegatorsV2InfiniteQueryKey = (options) => createQueryKey('getAllDelegatorsV2', options, true);
|
|
457
|
+
/**
|
|
458
|
+
* List delegators (v2)
|
|
459
|
+
*/
|
|
460
|
+
export const getAllDelegatorsV2InfiniteOptions = (options) => infiniteQueryOptions(
|
|
461
|
+
// @ts-ignore
|
|
462
|
+
{
|
|
463
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
464
|
+
// @ts-ignore
|
|
465
|
+
const page = typeof pageParam === 'object' ? pageParam : {
|
|
466
|
+
query: {
|
|
467
|
+
offset: pageParam
|
|
468
|
+
}
|
|
469
|
+
};
|
|
470
|
+
const params = createInfiniteParams(queryKey, page);
|
|
471
|
+
const { data } = await getAllDelegatorsV2({
|
|
472
|
+
...options,
|
|
473
|
+
...params,
|
|
474
|
+
signal,
|
|
475
|
+
throwOnError: true
|
|
476
|
+
});
|
|
477
|
+
return data;
|
|
478
|
+
},
|
|
479
|
+
queryKey: getAllDelegatorsV2InfiniteQueryKey(options)
|
|
480
|
+
});
|
|
481
|
+
export const getDelegationsByUserV2QueryKey = (options) => createQueryKey('getDelegationsByUserV2', options);
|
|
482
|
+
/**
|
|
483
|
+
* Delegations for an address (v2)
|
|
484
|
+
*/
|
|
485
|
+
export const getDelegationsByUserV2Options = (options) => queryOptions({
|
|
486
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
487
|
+
const { data } = await getDelegationsByUserV2({
|
|
488
|
+
...options,
|
|
489
|
+
...queryKey[0],
|
|
490
|
+
signal,
|
|
491
|
+
throwOnError: true
|
|
492
|
+
});
|
|
493
|
+
return data;
|
|
494
|
+
},
|
|
495
|
+
queryKey: getDelegationsByUserV2QueryKey(options)
|
|
496
|
+
});
|
|
497
|
+
export const getDelegationsByUserV2InfiniteQueryKey = (options) => createQueryKey('getDelegationsByUserV2', options, true);
|
|
498
|
+
/**
|
|
499
|
+
* Delegations for an address (v2)
|
|
500
|
+
*/
|
|
501
|
+
export const getDelegationsByUserV2InfiniteOptions = (options) => infiniteQueryOptions(
|
|
502
|
+
// @ts-ignore
|
|
503
|
+
{
|
|
504
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
505
|
+
// @ts-ignore
|
|
506
|
+
const page = typeof pageParam === 'object' ? pageParam : {
|
|
507
|
+
query: {
|
|
508
|
+
offset: pageParam
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
const params = createInfiniteParams(queryKey, page);
|
|
512
|
+
const { data } = await getDelegationsByUserV2({
|
|
513
|
+
...options,
|
|
514
|
+
...params,
|
|
515
|
+
signal,
|
|
516
|
+
throwOnError: true
|
|
517
|
+
});
|
|
518
|
+
return data;
|
|
519
|
+
},
|
|
520
|
+
queryKey: getDelegationsByUserV2InfiniteQueryKey(options)
|
|
521
|
+
});
|
|
522
|
+
export const getDelegatorUnbondsV2QueryKey = (options) => createQueryKey('getDelegatorUnbondsV2', options);
|
|
523
|
+
/**
|
|
524
|
+
* Unbonds for an address (v2)
|
|
525
|
+
*/
|
|
526
|
+
export const getDelegatorUnbondsV2Options = (options) => queryOptions({
|
|
527
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
528
|
+
const { data } = await getDelegatorUnbondsV2({
|
|
529
|
+
...options,
|
|
530
|
+
...queryKey[0],
|
|
531
|
+
signal,
|
|
532
|
+
throwOnError: true
|
|
533
|
+
});
|
|
534
|
+
return data;
|
|
535
|
+
},
|
|
536
|
+
queryKey: getDelegatorUnbondsV2QueryKey(options)
|
|
537
|
+
});
|
|
538
|
+
export const getValidatorDelegatorsV2QueryKey = (options) => createQueryKey('getValidatorDelegatorsV2', options);
|
|
539
|
+
/**
|
|
540
|
+
* Delegators of a validator (v2)
|
|
541
|
+
*/
|
|
542
|
+
export const getValidatorDelegatorsV2Options = (options) => queryOptions({
|
|
543
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
544
|
+
const { data } = await getValidatorDelegatorsV2({
|
|
545
|
+
...options,
|
|
546
|
+
...queryKey[0],
|
|
547
|
+
signal,
|
|
548
|
+
throwOnError: true
|
|
549
|
+
});
|
|
550
|
+
return data;
|
|
551
|
+
},
|
|
552
|
+
queryKey: getValidatorDelegatorsV2QueryKey(options)
|
|
553
|
+
});
|
|
554
|
+
export const getValidatorDelegatorsV2InfiniteQueryKey = (options) => createQueryKey('getValidatorDelegatorsV2', options, true);
|
|
555
|
+
/**
|
|
556
|
+
* Delegators of a validator (v2)
|
|
557
|
+
*/
|
|
558
|
+
export const getValidatorDelegatorsV2InfiniteOptions = (options) => infiniteQueryOptions(
|
|
559
|
+
// @ts-ignore
|
|
560
|
+
{
|
|
561
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
562
|
+
// @ts-ignore
|
|
563
|
+
const page = typeof pageParam === 'object' ? pageParam : {
|
|
564
|
+
query: {
|
|
565
|
+
offset: pageParam
|
|
566
|
+
}
|
|
567
|
+
};
|
|
568
|
+
const params = createInfiniteParams(queryKey, page);
|
|
569
|
+
const { data } = await getValidatorDelegatorsV2({
|
|
570
|
+
...options,
|
|
571
|
+
...params,
|
|
572
|
+
signal,
|
|
573
|
+
throwOnError: true
|
|
574
|
+
});
|
|
575
|
+
return data;
|
|
576
|
+
},
|
|
577
|
+
queryKey: getValidatorDelegatorsV2InfiniteQueryKey(options)
|
|
578
|
+
});
|
|
579
|
+
export const getSignerAddressListForLatestCheckpointV2QueryKey = (options) => createQueryKey('getSignerAddressListForLatestCheckpointV2', options);
|
|
580
|
+
/**
|
|
581
|
+
* Signer list for the latest checkpoint (v2)
|
|
582
|
+
*/
|
|
583
|
+
export const getSignerAddressListForLatestCheckpointV2Options = (options) => queryOptions({
|
|
584
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
585
|
+
const { data } = await getSignerAddressListForLatestCheckpointV2({
|
|
586
|
+
...options,
|
|
587
|
+
...queryKey[0],
|
|
588
|
+
signal,
|
|
589
|
+
throwOnError: true
|
|
590
|
+
});
|
|
591
|
+
return data;
|
|
592
|
+
},
|
|
593
|
+
queryKey: getSignerAddressListForLatestCheckpointV2QueryKey(options)
|
|
594
|
+
});
|
|
595
|
+
export const getMissedCheckpointsByAllValidatorsV2QueryKey = (options) => createQueryKey('getMissedCheckpointsByAllValidatorsV2', options);
|
|
596
|
+
/**
|
|
597
|
+
* Missed checkpoints across validators (v2)
|
|
598
|
+
*/
|
|
599
|
+
export const getMissedCheckpointsByAllValidatorsV2Options = (options) => queryOptions({
|
|
600
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
601
|
+
const { data } = await getMissedCheckpointsByAllValidatorsV2({
|
|
602
|
+
...options,
|
|
603
|
+
...queryKey[0],
|
|
604
|
+
signal,
|
|
605
|
+
throwOnError: true
|
|
606
|
+
});
|
|
607
|
+
return data;
|
|
608
|
+
},
|
|
609
|
+
queryKey: getMissedCheckpointsByAllValidatorsV2QueryKey(options)
|
|
610
|
+
});
|
|
611
|
+
export const getSignerAddressListForCheckpointNumberV2QueryKey = (options) => createQueryKey('getSignerAddressListForCheckpointNumberV2', options);
|
|
612
|
+
/**
|
|
613
|
+
* Active-only signer list for a checkpoint (v2)
|
|
614
|
+
*/
|
|
615
|
+
export const getSignerAddressListForCheckpointNumberV2Options = (options) => queryOptions({
|
|
616
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
617
|
+
const { data } = await getSignerAddressListForCheckpointNumberV2({
|
|
618
|
+
...options,
|
|
619
|
+
...queryKey[0],
|
|
620
|
+
signal,
|
|
621
|
+
throwOnError: true
|
|
622
|
+
});
|
|
623
|
+
return data;
|
|
624
|
+
},
|
|
625
|
+
queryKey: getSignerAddressListForCheckpointNumberV2QueryKey(options)
|
|
626
|
+
});
|
|
627
|
+
export const getCheckpointIntervalV2QueryKey = (options) => createQueryKey('getCheckpointIntervalV2', options);
|
|
628
|
+
/**
|
|
629
|
+
* Average checkpoint interval (v2)
|
|
630
|
+
*/
|
|
631
|
+
export const getCheckpointIntervalV2Options = (options) => queryOptions({
|
|
632
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
633
|
+
const { data } = await getCheckpointIntervalV2({
|
|
634
|
+
...options,
|
|
635
|
+
...queryKey[0],
|
|
636
|
+
signal,
|
|
637
|
+
throwOnError: true
|
|
638
|
+
});
|
|
639
|
+
return data;
|
|
640
|
+
},
|
|
641
|
+
queryKey: getCheckpointIntervalV2QueryKey(options)
|
|
642
|
+
});
|
|
643
|
+
export const getSignerEthBalancesV2QueryKey = (options) => createQueryKey('getSignerEthBalancesV2', options);
|
|
644
|
+
/**
|
|
645
|
+
* Signer ETH balances (v2)
|
|
646
|
+
*/
|
|
647
|
+
export const getSignerEthBalancesV2Options = (options) => queryOptions({
|
|
648
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
649
|
+
const { data } = await getSignerEthBalancesV2({
|
|
650
|
+
...options,
|
|
651
|
+
...queryKey[0],
|
|
652
|
+
signal,
|
|
653
|
+
throwOnError: true
|
|
654
|
+
});
|
|
655
|
+
return data;
|
|
656
|
+
},
|
|
657
|
+
queryKey: getSignerEthBalancesV2QueryKey(options)
|
|
658
|
+
});
|
|
659
|
+
export const getPerformanceBenchmarkV2QueryKey = (options) => createQueryKey('getPerformanceBenchmarkV2', options);
|
|
660
|
+
/**
|
|
661
|
+
* Performance benchmark (v2)
|
|
662
|
+
*/
|
|
663
|
+
export const getPerformanceBenchmarkV2Options = (options) => queryOptions({
|
|
664
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
665
|
+
const { data } = await getPerformanceBenchmarkV2({
|
|
666
|
+
...options,
|
|
667
|
+
...queryKey[0],
|
|
668
|
+
signal,
|
|
669
|
+
throwOnError: true
|
|
670
|
+
});
|
|
671
|
+
return data;
|
|
672
|
+
},
|
|
673
|
+
queryKey: getPerformanceBenchmarkV2QueryKey(options)
|
|
674
|
+
});
|
|
675
|
+
export const getRewardsSummaryV2QueryKey = (options) => createQueryKey('getRewardsSummaryV2', options);
|
|
676
|
+
/**
|
|
677
|
+
* Rewards summary (v2)
|
|
678
|
+
*/
|
|
679
|
+
export const getRewardsSummaryV2Options = (options) => queryOptions({
|
|
680
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
681
|
+
const { data } = await getRewardsSummaryV2({
|
|
682
|
+
...options,
|
|
683
|
+
...queryKey[0],
|
|
684
|
+
signal,
|
|
685
|
+
throwOnError: true
|
|
686
|
+
});
|
|
687
|
+
return data;
|
|
688
|
+
},
|
|
689
|
+
queryKey: getRewardsSummaryV2QueryKey(options)
|
|
690
|
+
});
|
|
691
|
+
export const getCurrentAprV2QueryKey = (options) => createQueryKey('getCurrentAprV2', options);
|
|
692
|
+
/**
|
|
693
|
+
* Current APR (v2)
|
|
694
|
+
*/
|
|
695
|
+
export const getCurrentAprV2Options = (options) => queryOptions({
|
|
696
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
697
|
+
const { data } = await getCurrentAprV2({
|
|
698
|
+
...options,
|
|
699
|
+
...queryKey[0],
|
|
700
|
+
signal,
|
|
701
|
+
throwOnError: true
|
|
702
|
+
});
|
|
703
|
+
return data;
|
|
704
|
+
},
|
|
705
|
+
queryKey: getCurrentAprV2QueryKey(options)
|
|
706
|
+
});
|
|
707
|
+
//# sourceMappingURL=react-query.gen.js.map
|