From 7e1ddb74a890db576735f0dc0e05cc3bd9a5dceb Mon Sep 17 00:00:00 2001 From: Cyrbuzz Date: Mon, 27 Nov 2023 15:42:38 +0800 Subject: [PATCH] [release] @subql/apollo-links@1.2.3, @subql/eth-provider@0.1.0, @subql/network-support@0.1.0, @subql/react-hooks@0.3.17,@subql/network-clients@0.3.20 --- packages/apollo-links/README.md | 29 +++++++++++++++------------ packages/eth-provider/README.md | 9 +++++++++ packages/network-clients/CHANGELOG.md | 5 ++++- packages/network-clients/package.json | 2 +- packages/network-config/CHANGELOG.md | 5 ++++- packages/network-config/package.json | 2 +- packages/network-support/README.md | 2 +- packages/react-hooks/CHANGELOG.md | 5 ++++- packages/react-hooks/package.json | 2 +- 9 files changed, 41 insertions(+), 20 deletions(-) diff --git a/packages/apollo-links/README.md b/packages/apollo-links/README.md index 0d31aaf6..d6f50083 100644 --- a/packages/apollo-links/README.md +++ b/packages/apollo-links/README.md @@ -25,7 +25,9 @@ npm install @subql/apollo-links @apollo/client graphql - **Caching**: Integrated caching ensures data is fetched efficiently with reduced costs. ## Usage - external authorization mode + ### What scenario work best with external authorization mode + This is the recommended way to use `@subql/apollo-links`. With an auth-server to handle cryptography stuff that consumer needed to interact with indexer. Client side doesn't need to expose anything to reveal the identity of consumer. Auth-server will also provide some extra benefits like indexer progress monitoring and filtering. @@ -47,7 +49,6 @@ import gql from 'graphql-tag'; const options = { authUrl: 'https://kepler-auth.subquery.network', deploymentId: 'your_deployment_id_here', - httpOptions: { fetchOptions: { timeout: 5000 } }, // ... other optional configurations // fallbackUrl: }; @@ -92,42 +93,44 @@ const { link, cleanup } = dictHttpLink(options); ``` ## Usage - local authorization mode + Need to put consumer controller's private key with client so it can sign and authorise every requests sent to indexer. ```ts const options = { - sk: '', - // don't put authUrl -} + sk: '', + // don't put authUrl +}; ``` ## Score Store + We have an internal store for indexer scores so bad performed, bad progressed or unreachable indexers will be punished and not getting new requests. For browser side usage, after page refresh, the score will lose though. To solve that, you can instantiate a LocalStorageStore and pass in when constructing the link object. + ```ts -const store = createLocalStorageStore({ttl: 86_400_000}); +const store = createLocalStorageStore({ ttl: 86_400_000 }); const { link, cleanup } = deploymentHttpLink({ - authUrl: 'https://kepler-auth.subquery.network', - deploymentId: 'your_deployment_id_here', - httpOptions: { fetchOptions: { timeout: 5000 } }, - scoreStore: store, + authUrl: 'https://kepler-auth.subquery.network', + deploymentId: 'your_deployment_id_here', + httpOptions: { fetchOptions: { timeout: 5000 } }, + scoreStore: store, }); - ``` ## Other options | params | usage | -|--------|------------------------------------------------------------------| +| ------ | ---------------------------------------------------------------- | | logger | apollo link will write logs to it, by default no logs will print | | | | - ## Cleanup + Because of the extra state management logic in it, call `cleanup()` to completely destroy the link and release resources. ```TS cleanup(); -``` \ No newline at end of file +``` diff --git a/packages/eth-provider/README.md b/packages/eth-provider/README.md index 4a418f4b..daab0af9 100644 --- a/packages/eth-provider/README.md +++ b/packages/eth-provider/README.md @@ -1 +1,10 @@ # eth-provider + +``` +import { SubqueryAuthedRpcProvider } from '@subql/eth-provider' + +const provider = new SubqueryAuthedRpcProvider({ + deploymentId: "RPC deployment id" + authUrl: "auth service url" +}) +``` diff --git a/packages/network-clients/CHANGELOG.md b/packages/network-clients/CHANGELOG.md index 361808f0..5bac0d5c 100644 --- a/packages/network-clients/CHANGELOG.md +++ b/packages/network-clients/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.3.20] - 2023-11-27 + ## [0.3.18] - 2023-09-28 Upgrade @subql/contracts @@ -45,7 +47,8 @@ Upgrade @subql/contracts - Release first version -[unreleased]: https://github.com/subquery/network-clients/compare/v0.3.18...HEAD +[unreleased]: https://github.com/subquery/network-clients/compare/v0.3.20...HEAD +[0.3.20]: https://github.com/subquery/network-clients/compare/v0.3.18...v0.3.20 [0.3.18]: https://github.com/subquery/network-clients/compare/v0.3.17...v0.3.18 [0.3.17]: https://github.com/subquery/network-clients/compare/v0.3.15...v0.3.17 [0.3.15]: https://github.com/subquery/network-clients/compare/v0.3.13...v0.3.15 diff --git a/packages/network-clients/package.json b/packages/network-clients/package.json index 7a9c7030..6373f649 100644 --- a/packages/network-clients/package.json +++ b/packages/network-clients/package.json @@ -1,6 +1,6 @@ { "name": "@subql/network-clients", - "version": "0.3.19-0", + "version": "0.3.20", "description": "SubQuery client sdk for network", "main": "dist/index.js", "author": "SubQuery Pte Limited", diff --git a/packages/network-config/CHANGELOG.md b/packages/network-config/CHANGELOG.md index 83e8b23d..91fb72e3 100644 --- a/packages/network-config/CHANGELOG.md +++ b/packages/network-config/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.3.18] - 2023-11-27 + ## [0.3.16] - 2023-09-28 Upgrade @subql/contracts @@ -37,7 +39,8 @@ Add `LEADERBOARD_SUBQL_ENDPOINTS` - Release first version -[unreleased]: https://github.com/subquery/network-clients/compare/v0.3.16...HEAD +[unreleased]: https://github.com/subquery/network-clients/compare/v0.3.18...HEAD +[0.3.18]: https://github.com/subquery/network-clients/compare/v0.3.16...v0.3.18 [0.3.16]: https://github.com/subquery/network-clients/compare/v0.3.14...v0.3.16 [0.3.14]: https://github.com/subquery/network-clients/compare/v0.3.13...v0.3.14 [0.3.13]: https://github.com/subquery/network-clients/compare/v0.3.11...v0.3.13 diff --git a/packages/network-config/package.json b/packages/network-config/package.json index a92677de..5ad600d7 100644 --- a/packages/network-config/package.json +++ b/packages/network-config/package.json @@ -1,6 +1,6 @@ { "name": "@subql/network-config", - "version": "0.3.17-4", + "version": "0.3.18", "main": "dist/index.js", "description": "SubQuery package containing network configuration", "author": "SubQuery Pte Limited", diff --git a/packages/network-support/README.md b/packages/network-support/README.md index 4a418f4b..fb18e686 100644 --- a/packages/network-support/README.md +++ b/packages/network-support/README.md @@ -1 +1 @@ -# eth-provider +# network-support diff --git a/packages/react-hooks/CHANGELOG.md b/packages/react-hooks/CHANGELOG.md index b223a474..b26aaa74 100644 --- a/packages/react-hooks/CHANGELOG.md +++ b/packages/react-hooks/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.3.17] - 2023-11-27 + ## [0.3.15] - 2023-07-21 ## [0.3.11] - 2023-07-04 @@ -31,7 +33,8 @@ Add `leaderboard`. - Release first version -[unreleased]: https://github.com/subquery/network-clients/compare/v0.3.15...HEAD +[unreleased]: https://github.com/subquery/network-clients/compare/v0.3.17...HEAD +[0.3.17]: https://github.com/subquery/network-clients/compare/v0.3.15...v0.3.17 [0.3.15]: https://github.com/subquery/network-clients/compare/v0.3.13...v0.3.15 [0.3.13]: https://github.com/subquery/network-clients/compare/v0.3.11...v0.3.13 [0.3.11]: https://github.com/subquery/network-clients/compare/v0.3.9...v0.3.11 diff --git a/packages/react-hooks/package.json b/packages/react-hooks/package.json index 05ace084..df7a79a7 100644 --- a/packages/react-hooks/package.json +++ b/packages/react-hooks/package.json @@ -1,6 +1,6 @@ { "name": "@subql/react-hooks", - "version": "0.3.16-26", + "version": "0.3.17", "description": "SubQuery client sdk for react hooks", "main": "dist/index.js", "author": "SubQuery Pte Limited",