Skip to content

Commit

Permalink
Merge pull request #103 from lidofinance/feature/ethui-574-update-readme
Browse files Browse the repository at this point in the history
chore: update readmes
  • Loading branch information
Jeday authored Jul 14, 2023
2 parents 6c5d182 + 70fef6f commit 70256d5
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
15 changes: 15 additions & 0 deletions packages/constants/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
```
10 changes: 10 additions & 0 deletions packages/contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -59,6 +61,14 @@ Returns an instance of `Contract` based on stETH contract [ABI](https://docs.eth

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

### 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

To get another contract instance, getters have a third optional parameter `cacheSeed`.
Expand Down
13 changes: 11 additions & 2 deletions packages/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -78,6 +78,11 @@ useLDOContractRPC();
useLDOContractWeb3();
```

```ts
useWithdrawalQueueContractRPC();
useWithdrawalQueueContractWeb3();
```

### ERC20 hooks factory

[Source](src/factories/tokens.ts)
Expand Down Expand Up @@ -165,14 +170,18 @@ const App = ({ children }) => {
};
```

### Hooks

All request hooks accept SWR config as optional last argument.

### useTotalSupply

```tsx
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 <div>{loading ? 'loading...' : totalSupply}</div>;
Expand Down
4 changes: 4 additions & 0 deletions packages/web3-react/README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 70256d5

Please sign in to comment.