From 8abe1680228cbcff6e79cdd93fca001909a0ce74 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Jun 2023 07:44:04 +0000 Subject: [PATCH 1/3] chore(deps): bump trim-off-newlines from 1.0.1 to 1.0.3 Bumps [trim-off-newlines](https://github.com/stevemao/trim-off-newlines) from 1.0.1 to 1.0.3. - [Commits](https://github.com/stevemao/trim-off-newlines/compare/v1.0.1...v1.0.3) --- updated-dependencies: - dependency-name: trim-off-newlines dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index aab582a..b86295d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12997,9 +12997,9 @@ resolve@^2.0.0-next.3: linkType: hard "trim-off-newlines@npm:^1.0.0": - version: 1.0.1 - resolution: "trim-off-newlines@npm:1.0.1" - checksum: ca644908cace3d91b4c5b0fee0224640fed34a4503583e542db3f2dbec95246f2dc0f1bdfc5169e95f244f2613c0256ccc0c594ebe678fd9afdd9c5cf424562f + version: 1.0.3 + resolution: "trim-off-newlines@npm:1.0.3" + checksum: faf042bb7dd4cb097ab6d358cd51012a9ff5e06f7f2c6570da2ef6f01da9da3ff22ab01080866815e3927ffbf367d57c6aab4c275c67662676b60c563142a558 languageName: node linkType: hard From 1a811918890e9603b4f4b07c95deb1087d29d6e7 Mon Sep 17 00:00:00 2001 From: Evgeny Taktarov Date: Wed, 5 Jul 2023 20:32:25 +0700 Subject: [PATCH 2/3] chore: update readmes --- packages/constants/README.md | 15 +++++++++++++++ packages/contracts/README.md | 8 ++++++-- packages/react/README.md | 13 +++++++++++-- packages/web3-react/README.md | 4 ++++ 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/packages/constants/README.md b/packages/constants/README.md index 20cbb44..e285ad6 100644 --- a/packages/constants/README.md +++ b/packages/constants/README.md @@ -13,6 +13,8 @@ Part of [Lido JS SDK](https://github.com/lidofinance/lido-js-sdk/#readme) - [getTokenAddress](#gettokenaddress) - [Aggregator](#aggregator) - [getAggregatorAddress](#getaggregatoraddress) +- [WithdrawalQueue](#withdrawalqueue) + - [getWithdrawalQueueAddress](#getWithdrawalQueueAddress) ## Install @@ -91,3 +93,16 @@ import { CHAINS, getAggregatorAddress } from '@lido-sdk/constants'; const aggregatorAddress = getAggregatorAddress(CHAINS.Mainnet); console.log(aggregatorAddress); // 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419 ``` + +## WithdrawalQueue + +WithdrawalQueue contract for LIDO protocol + +### getWithdrawalQueueAddress + +```ts +import { CHAINS, getWithdrawalQueueAddress } from '@lido-sdk/constants'; + +const withdrawalQueueAddress = getWithdrawalQueueAddress(CHAINS.Mainnet); +console.log(withdrawalQueueAddress); // 0x889edC2eDab5f40e902b864aD4d7AdE8E412F9B1 +``` diff --git a/packages/contracts/README.md b/packages/contracts/README.md index 128264d..a84ad43 100644 --- a/packages/contracts/README.md +++ b/packages/contracts/README.md @@ -55,9 +55,13 @@ Returns an instance of `Contract` based on wstETH contract [ABI](https://docs.et Returns an instance of `Contract` based on stETH contract [ABI](https://docs.ethers.io/v5/api/utils/abi/). Available contract methods and detailed documentation can be found here: https://docs.lido.fi/contracts/lido -### getLDOContract +### getWithdrawalQueueContract -Returns an instance of `Contract` based on LDO token [ABI](https://docs.ethers.io/v5/api/utils/abi/). LDO Token docs can be found here: https://docs.lido.fi/lido-dao/#ldo-token +Returns an instance of `Contract` based on WithdrawalQueue contract [ABI](https://docs.ethers.io/v5/api/utils/abi/). Contract docs here: https://docs.lido.fi/contracts/withdrawal-queue-erc721 + +### getAggregatorContract + +Returns an instance of `Contract` based on ChainLink USD/ETH price oracle [ABI](https://docs.ethers.io/v5/api/utils/abi/). EACAggregatorProxy https://etherscan.io/address/0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419 ## Cache diff --git a/packages/react/README.md b/packages/react/README.md index 57927fa..fc39472 100644 --- a/packages/react/README.md +++ b/packages/react/README.md @@ -61,7 +61,7 @@ const { useContractRPC, useContractWeb3 } = contractHooksFactory( ); ``` -Package `@lido-sdk/react` exports hooks for `WSTETH`, `STETH` and `LDO` contracts: +Package `@lido-sdk/react` exports hooks for `WSTETH`, `STETH`, `LDO` and `WithdrawalQueue` contracts: ```ts useWSTETHContractRPC(); @@ -78,6 +78,11 @@ useLDOContractRPC(); useLDOContractWeb3(); ``` +```ts +useWithdrawalQueueContractRPC(); +useWithdrawalQueueContractWeb3(); +``` + ### ERC20 hooks factory [Source](src/factories/tokens.ts) @@ -165,6 +170,10 @@ const App = ({ children }) => { }; ``` +### Hooks + +All request hooks accept SWR config as optional last argument. + ### useTotalSupply ```tsx @@ -172,7 +181,7 @@ import { useTotalSupply } from '@lido-sdk/react'; const Component = () => { const token = 'token address'; - const { data, loading } = useTotalSupply(token); + const { data, loading } = useTotalSupply(token, { isPaused: !token }); const totalSupply = data?.toString(); return
{loading ? 'loading...' : totalSupply}
; diff --git a/packages/web3-react/README.md b/packages/web3-react/README.md index 6c108c6..98beaf6 100644 --- a/packages/web3-react/README.md +++ b/packages/web3-react/README.md @@ -1,3 +1,7 @@ +# ⚠️ Important Notice ⚠️ + +📦 Package Deprecation: This package has been marked as deprecated and will be maintained as part of [reef-knot library](https://github.com/lidofinance/reef-knot/tree/main/packages/web3-react). + # Web3 react helpers Web3 react helpers for Lido Finance projects. From 70fef6f45945e10272e1f1c3b6cea4da66d9ac3e Mon Sep 17 00:00:00 2001 From: Evgeny Taktarov Date: Wed, 5 Jul 2023 20:54:03 +0700 Subject: [PATCH 3/3] fix: readme --- packages/contracts/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/contracts/README.md b/packages/contracts/README.md index a84ad43..e40284f 100644 --- a/packages/contracts/README.md +++ b/packages/contracts/README.md @@ -13,6 +13,8 @@ It uses [TypeChain](https://github.com/ethereum-ts/TypeChain) under the hood to - [getWSTETHContract](#getwstethcontract) - [getSTETHContract](#getstethcontract) - [getLDOContract](#getldocontract) + - [getWithdrawalQueueContract](#getwithdrawalqueuecontract) + - [getAggregatorContract](#getaggregatorcontract) - [Cache](#cache) ## Install @@ -55,6 +57,10 @@ Returns an instance of `Contract` based on wstETH contract [ABI](https://docs.et Returns an instance of `Contract` based on stETH contract [ABI](https://docs.ethers.io/v5/api/utils/abi/). Available contract methods and detailed documentation can be found here: https://docs.lido.fi/contracts/lido +### getLDOContract + +Returns an instance of `Contract` based on LDO token [ABI](https://docs.ethers.io/v5/api/utils/abi/). LDO Token docs can be found here: https://docs.lido.fi/lido-dao/#ldo-token + ### getWithdrawalQueueContract Returns an instance of `Contract` based on WithdrawalQueue contract [ABI](https://docs.ethers.io/v5/api/utils/abi/). Contract docs here: https://docs.lido.fi/contracts/withdrawal-queue-erc721