@polygonlabs/staking-api-client 1.9.1 → 2.0.0
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/CHANGELOG.md +58 -0
- package/MIGRATION.md +48 -7
- package/README.md +2 -2
- package/dist/generated/@tanstack/react-query.gen.d.ts +26 -926
- package/dist/generated/@tanstack/react-query.gen.d.ts.map +1 -1
- package/dist/generated/@tanstack/react-query.gen.js +1 -295
- package/dist/generated/@tanstack/react-query.gen.js.map +1 -1
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +2 -2
- package/dist/generated/index.js.map +1 -1
- package/dist/generated/registry-validator.gen.d.ts +14 -202
- package/dist/generated/registry-validator.gen.d.ts.map +1 -1
- package/dist/generated/registry-validator.gen.js +2 -314
- package/dist/generated/registry-validator.gen.js.map +1 -1
- package/dist/generated/sdk.gen.d.ts +10 -74
- package/dist/generated/sdk.gen.d.ts.map +1 -1
- package/dist/generated/sdk.gen.js +9 -105
- package/dist/generated/sdk.gen.js.map +1 -1
- package/dist/generated/types.gen.d.ts +18 -288
- package/dist/generated/types.gen.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,63 @@
|
|
|
1
1
|
# @polygonlabs/staking-api-client
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#375](https://github.com/0xPolygon/staking-api/pull/375) [`506cc1a`](https://github.com/0xPolygon/staking-api/commit/506cc1af65bf315293729dd8c019a149a90dd423) Thanks [@shan8851](https://github.com/shan8851)! - Remove the eight deprecated offset-paginated list operations; use the cursor `/page` operations instead
|
|
8
|
+
|
|
9
|
+
The API no longer serves these routes: `GET` and `HEAD` requests to them answer `410 Gone` with a
|
|
10
|
+
`application/problem+json` body and a `Link` header naming the replacement, and the schemas and client no longer
|
|
11
|
+
include their operations, types or TanStack Query helpers:
|
|
12
|
+
|
|
13
|
+
| Removed route | Use instead |
|
|
14
|
+
| --------------------------------------------------------- | -------------------------------------------------------------- |
|
|
15
|
+
| `GET /api/v2/validators/{validatorId}/checkpoints-signed` | `GET /api/v2/validators/{validatorId}/checkpoints-signed/page` |
|
|
16
|
+
| `GET /api/v3/validators/{validatorId}/checkpoints-signed` | `GET /api/v3/validators/{validatorId}/checkpoints-signed/page` |
|
|
17
|
+
| `GET /api/v2/delegators` | `GET /api/v2/delegators/page` |
|
|
18
|
+
| `GET /api/v3/delegators` | `GET /api/v3/delegators/page` |
|
|
19
|
+
| `GET /api/v2/validators/{validatorId}/delegators` | `GET /api/v2/validators/{validatorId}/delegators/page` |
|
|
20
|
+
| `GET /api/v3/validators/{validatorId}/delegators` | `GET /api/v3/validators/{validatorId}/delegators/page` |
|
|
21
|
+
| `GET /api/v2/notification/all` | `GET /api/v2/notification/all/page` |
|
|
22
|
+
| `GET /api/v3/notification/all` | `GET /api/v3/notification/all/page` |
|
|
23
|
+
|
|
24
|
+
Notification search (`searchString`) is no longer available: the notification `/page` operations
|
|
25
|
+
support `filterBy` but not `searchString`, and they omit the offset feed's static `filter` list.
|
|
26
|
+
|
|
27
|
+
The `Deprecation`, `Sunset` and `Link` headers that announced the removal are gone with the routes.
|
|
28
|
+
The schemas package no longer exports `GetAllNotificationsQuery`, `NotificationArrayResponse`,
|
|
29
|
+
`V2DelegatorArrayResponse`, `CheckpointsSignedV3Response` or `DelegatorsListV3Response`. See
|
|
30
|
+
`MIGRATION.md` in the client package for the paging changes.
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- Updated dependencies [[`506cc1a`](https://github.com/0xPolygon/staking-api/commit/506cc1af65bf315293729dd8c019a149a90dd423)]:
|
|
35
|
+
- @polygonlabs/staking-api-schemas@2.0.0
|
|
36
|
+
|
|
37
|
+
## 1.10.0
|
|
38
|
+
|
|
39
|
+
### Minor Changes
|
|
40
|
+
|
|
41
|
+
- [#368](https://github.com/0xPolygon/staking-api/pull/368) [`e48fb5d`](https://github.com/0xPolygon/staking-api/commit/e48fb5d5f1a72bafa47fb1e0c79e2d00d637c91a) Thanks [@shan8851](https://github.com/shan8851)! - Validator profile writes now require an EIP-712 typed-data signature
|
|
42
|
+
|
|
43
|
+
`POST /api/v2/validators/add` and `PUT /api/v2/validators/update` accept only an EIP-712
|
|
44
|
+
`ValidatorProfile` signature (domain `Polygon Staking API`, version `1`, the L1 chain id). It
|
|
45
|
+
covers every profile field written (`name`, `description`, `url`, `logoUrl`), plus `owner`,
|
|
46
|
+
`validatorId`, a fixed action string and an `expiry` at most 10 minutes ahead. The old
|
|
47
|
+
`personal_sign` text signature is rejected with a 401.
|
|
48
|
+
|
|
49
|
+
- The request body now requires `validatorId`, `expiry`, `name`, `description`, `logoUrl` and the
|
|
50
|
+
url field. A signature over a different `validatorId` than the one the owner holds is rejected
|
|
51
|
+
with a 403.
|
|
52
|
+
- `name` is limited to 32 characters of letters, digits, emoji, spaces and `. _ - % | ( ) [ ] & ' , !`,
|
|
53
|
+
and must not contain a URL. The admin profile upsert applies the same rule. Existing stored names
|
|
54
|
+
are unchanged.
|
|
55
|
+
|
|
56
|
+
### Patch Changes
|
|
57
|
+
|
|
58
|
+
- Updated dependencies [[`e48fb5d`](https://github.com/0xPolygon/staking-api/commit/e48fb5d5f1a72bafa47fb1e0c79e2d00d637c91a)]:
|
|
59
|
+
- @polygonlabs/staking-api-schemas@1.10.0
|
|
60
|
+
|
|
3
61
|
## 1.9.1
|
|
4
62
|
|
|
5
63
|
### Patch Changes
|
package/MIGRATION.md
CHANGED
|
@@ -5,16 +5,53 @@ Breaking changes, and deprecations that will become breaking changes, most-recen
|
|
|
5
5
|
If you are migrating from hand-rolled response types over raw `fetch`/`axios`
|
|
6
6
|
calls, see the README for the equivalent generated operations.
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## `addValidatorV2` / `updateValidatorV2` require an EIP-712 signature (1.10.0)
|
|
9
9
|
|
|
10
|
-
The
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
The server no longer accepts the `personal_sign` profile text. Sign the `ValidatorProfile`
|
|
11
|
+
typed data with `eth_signTypedData_v4` and send the new required body fields:
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
const typedData = {
|
|
15
|
+
domain: { name: 'Polygon Staking API', version: '1', chainId }, // L1: 1 mainnet, 11155111 Amoy
|
|
16
|
+
types: {
|
|
17
|
+
ValidatorProfile: [
|
|
18
|
+
{ name: 'action', type: 'string' },
|
|
19
|
+
{ name: 'owner', type: 'address' },
|
|
20
|
+
{ name: 'validatorId', type: 'uint256' },
|
|
21
|
+
{ name: 'name', type: 'string' },
|
|
22
|
+
{ name: 'description', type: 'string' },
|
|
23
|
+
{ name: 'url', type: 'string' },
|
|
24
|
+
{ name: 'logoUrl', type: 'string' },
|
|
25
|
+
{ name: 'expiry', type: 'uint256' }
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
primaryType: 'ValidatorProfile',
|
|
29
|
+
message: {
|
|
30
|
+
action: 'Update Polygon staking validator profile',
|
|
31
|
+
owner,
|
|
32
|
+
validatorId,
|
|
33
|
+
name,
|
|
34
|
+
description,
|
|
35
|
+
url,
|
|
36
|
+
logoUrl,
|
|
37
|
+
expiry
|
|
38
|
+
} // expiry: unix seconds, at most 10 minutes ahead
|
|
39
|
+
};
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The body carries `validatorId`, `expiry`, `name`, `description`, `logoUrl` and `url` (add) or
|
|
43
|
+
`validatorUrl` (update), all required, with exactly the values signed.
|
|
44
|
+
|
|
45
|
+
## Offset-paginated list operations removed → cursor pages (deprecated in 1.9.0, removed in 2.0.0)
|
|
46
|
+
|
|
47
|
+
The offset-paginated list operations were deprecated in 1.9.0 and are removed from the client in
|
|
48
|
+
2.0.0 and from the API (they now answer `410 Gone`, with a `Link: rel="successor-version"` header and a problem
|
|
49
|
+
body pointing at the replacement) after the **2026-11-20** sunset.
|
|
13
50
|
|
|
14
51
|
Offset paging costs more the deeper the page; a cursor page costs the same at any depth. Each
|
|
15
|
-
|
|
52
|
+
removed operation has a cursor-paginated successor on the same path plus `/page`:
|
|
16
53
|
|
|
17
|
-
|
|
|
54
|
+
| Removed operation | Successor |
|
|
18
55
|
| ----------------------------------- | ------------------------------ |
|
|
19
56
|
| `getCheckpointsSignedByValidatorV2` | `getCheckpointsSignedPageV2` |
|
|
20
57
|
| `getCheckpointsSignedByValidatorV3` | `getCheckpointsSignedPageV3` |
|
|
@@ -39,6 +76,10 @@ What changes when you switch:
|
|
|
39
76
|
available (checkpoints-signed, notifications), it and the signed/missed counters are on the
|
|
40
77
|
first page only; cursor pages carry `pagination: { limit, nextCursor }` and the rows. The
|
|
41
78
|
delegator pages carry no `total`.
|
|
79
|
+
- **Notification search and filter list are not carried over.** The notification `/page`
|
|
80
|
+
operations take `filterBy` but not `searchString`, so free-text search over notifications is no
|
|
81
|
+
longer available. They also omit the offset feed's static `filter` list of filter types and the
|
|
82
|
+
`filterBy` echo in `pagination`; `filterBy` itself still works.
|
|
42
83
|
- **Errors** on the cursor operations are HTTP errors (4xx/5xx) rather than a
|
|
43
84
|
`{ success: false }` body at 200.
|
|
44
85
|
|
|
@@ -46,5 +87,5 @@ The README's cursor-paging section has a complete page loop and a TanStack Query
|
|
|
46
87
|
`useInfiniteQuery` example.
|
|
47
88
|
|
|
48
89
|
`getAllValidatorsV2`/`V3` and `getDelegationsByUserV2`/`V3` also take `offset` but are not
|
|
49
|
-
|
|
90
|
+
removed. For the whole validator set in one call, `getValidatorSetV3` is cheaper than paging
|
|
50
91
|
`getAllValidatorsV3`.
|
package/README.md
CHANGED
|
@@ -35,8 +35,8 @@ const { data } = await getAllValidatorsV3();
|
|
|
35
35
|
## Paging through lists
|
|
36
36
|
|
|
37
37
|
Use the cursor operations (`*PageV2` / `*PageV3`, served on the `/page`
|
|
38
|
-
routes) for every paged list. The offset operations
|
|
39
|
-
|
|
38
|
+
routes) for every paged list. The offset list operations were removed
|
|
39
|
+
in 2.0.0 (see `MIGRATION.md`): a deep offset makes the server walk and bill every
|
|
40
40
|
skipped row, while a cursor page is a single index seek, and its fixed URL
|
|
41
41
|
lets the Cloudflare edge serve it once for every client.
|
|
42
42
|
|