Skip to content

Commit

Permalink
docs: remove goerli refs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeday committed Dec 23, 2024
1 parent 1f263bf commit 790e634
Show file tree
Hide file tree
Showing 12 changed files with 79 additions and 82 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,15 @@ Before using the SDK, you need to create an instance of the LidoSDK class:
// Pass your own viem PublicClient

import { createPublicClient, http } from 'viem';
import { goerli } from 'viem/chains';
import { holesky } from 'viem/chains';

const rpcProvider = createPublicClient({
chain: goerli,
chain: holesky,
transport: http(),
});

const sdk = new LidoSDK({
chainId: 5,
chainId: 17000,
rpcProvider,
web3Provider: provider, // optional
});
Expand All @@ -74,22 +75,22 @@ const sdk = new LidoSDK({
```ts
// Or just rpc urls so it can be created under the hood
const sdk = new LidoSDK({
chainId: 5,
rpcUrls: ['https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}'],
chainId: 17000,
rpcUrls: ['<RPC_URL>'],
web3Provider: provider, // optional
});
```

Replace "https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}" with the address of your Ethereum provider.
Replace `<RPC_URL>` with the url of your Ethereum RPC provider.

## Examples

All examples and usage instructions can be found in the [Docs SDK package](https://lidofinance.github.io/lido-ethereum-sdk/).

```ts
const lidoSDK = new LidoSDK({
chainId: 5,
rpcUrls: ['https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}'],
chainId: 17000,
rpcUrls: ['<RPC_URL>'],
web3Provider: provider,
});

Expand Down
18 changes: 9 additions & 9 deletions docs/sdk/get-started/basic-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ sidebar_position: 2

```ts
const lidoSDK = new LidoSDK({
chainId: 5,
rpcUrls: ['https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}'],
chainId: 17000,
rpcUrls: ['<RPC_URL>'],
});

// Views
Expand All @@ -22,8 +22,8 @@ console.log(balanceETH.toString(), 'ETH balance');

```ts
const lidoSDK = new LidoSDK({
chainId: 5,
rpcUrls: ['https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}'],
chainId: 17000,
rpcUrls: ['<RPC_URL>'],
web3provider: LidoSDKCore.createWeb3Provider(5, window.ethereum),
});

Expand All @@ -47,9 +47,9 @@ console.log(stakeTx, 'stake tx result');

```ts
const lidoSDK = new LidoSDK({
chainId: 5,
rpcUrls: ['https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}'],
web3provider: LidoSDKCore.createWeb3Provider(5, window.ethereum),
chainId: 17000,
rpcUrls: ['<RPC_URL>'],
web3provider: LidoSDKCore.createWeb3Provider(17000, window.ethereum),
});

// Contracts
Expand All @@ -74,8 +74,8 @@ console.log(requestTx.result.requests, 'array of created requests');

```ts
const lidoSDK = new LidoSDK({
chainId: 5,
rpcUrls: ['https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}'],
chainId: 17000,
rpcUrls: ['<RPC_URL>'],
web3provider: LidoSDKCore.createWeb3Provider(5, window.ethereum),
});

Expand Down
26 changes: 13 additions & 13 deletions docs/sdk/get-started/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ Pass your own viem PublicClient:
```ts
import { LidoSDK } from '@lidofinance/lido-ethereum-sdk';
import { createPublicClient, http } from 'viem';
import { goerli } from 'viem/chains';
import { holesky } from 'viem/chains';

const rpcProvider = createPublicClient({
chain: goerli,
chain: holesky,
transport: http(),
});
const sdk = new LidoSDK({
chainId: 5,
chainId: 17000,
rpcProvider,
web3Provider: provider, // optional
});
Expand All @@ -61,13 +61,13 @@ Or just rpc urls so it can be created under the hood:

```ts
const sdk = new LidoSDK({
chainId: 5,
rpcUrls: ['https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}'],
chainId: 17000,
rpcUrls: ['<RPC_URL>'],
web3Provider: provider, // optional
});
```

Replace "https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}" with the address of your Ethereum provider.
Replace `<RPC_URL>` with the address of your Ethereum provider.

## With web3Provider

Expand All @@ -79,19 +79,19 @@ Some functions don't usually require web3provider to be present like `simulate..
```ts
import { LidoSDK, LidoSDKCore } from '@lidofinance/lido-ethereum-sdk';
import { createWalletClient, custom } from 'viem';
import { goerli } from 'viem/chains';
import { holesky } from 'viem/chains';

let web3Provider = createWalletClient({
chain: goerli,
chain: holesky,
transport: custom(window.ethereum),
});

// or use our helper to pass any eip-1193 provider
let web3Provider = LidoSDKCore.createWeb3Provider(5, window.ethereum);
let web3Provider = LidoSDKCore.createWeb3Provider(17000, window.ethereum);

const sdk = new LidoSDK({
chainId: 5,
rpcUrls: ['https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}'],
chainId: 17000,
rpcUrls: ['<RPC_URL>'],
web3Provider,
});
```
Expand All @@ -106,8 +106,8 @@ import { LidoSDKWrap } from '@lidofinance/lido-ethereum-sdk/stake';
import { LidoSDKCore } from '@lidofinance/lido-ethereum-sdk/core';

const params = {
chainId: 5,
rpcUrls: ['https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}'],
chainId: 1700,
rpcUrls: ['<RPC_URL>'],
};
// core is created under the hood
const stake = new LidoSDKStake(params);
Expand Down
22 changes: 9 additions & 13 deletions docs/sdk/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ For changes between versions see [Changelog](./changelog.mdx)

## Migration

For migration guide between major versions see [Migration](./migration.mdx)
For migration guide between major versions see [Migration Guide](./migration.mdx)

## Installation

Expand Down Expand Up @@ -47,14 +47,14 @@ Before using the SDK, you need to create an instance of the LidoSDK class:
// Pass your own viem PublicClient

import { createPublicClient, http } from 'viem';
import { goerli } from 'viem/chains';
import { holesky } from 'viem/chains';

const rpcProvider = createPublicClient({
chain: goerli,
chain: holesky,
transport: http(),
});
const sdk = new LidoSDK({
chainId: 5,
chainId: 17000,
rpcProvider,
web3Provider: provider, // optional
});
Expand All @@ -63,22 +63,22 @@ const sdk = new LidoSDK({
```ts
// Or just rpc urls so it can be created under the hood
const sdk = new LidoSDK({
chainId: 5,
rpcUrls: ['https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}'],
chainId: 17000,
rpcUrls: ['<RPC_URL>'],
web3Provider: provider, // optional
});
```

Replace "https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}" with the address of your Ethereum provider.
Replace `<RPC_URL>` with the URL of your Ethereum RPC provider.

## Example

Basic examples and usage instructions can be found in [here](/category/get-started).

```ts
const lidoSDK = new LidoSDK({
chainId: 5,
rpcUrls: ['https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}'],
chainId: 17000,
rpcUrls: ['<RPC_URL>'],
web3Provider: provider,
});

Expand All @@ -99,10 +99,6 @@ const { stethReceived, sharesReceived } = stakeTx.result;
console.log(balanceETH.toString(), 'ETH balance');
```

## Migration

For breaking changes between versions see [MIGRATION.md](https://github.com/lidofinance/lido-ethereum-sdk/blob/main/packages/sdk/MIGRATION.md)

## Documentation

For additional information about available methods and functionality, refer to the [the documentation for the Lido Ethereum SDK](/category/modules).
Expand Down
4 changes: 2 additions & 2 deletions docs/sdk/modules/lido-statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ sidebar_position: 11
import { LidoSDK } from '@lidofinance/lido-ethereum-sdk';

const lidoSDK = new LidoSDK({
rpcUrls: ['https://rpc-url'],
chainId: 5,
rpcUrls: ['<RPC_URL>'],
chainId: 17000,
});

const lastApr = await lidoSDK.statistics.apr.getLastApr();
Expand Down
8 changes: 4 additions & 4 deletions docs/sdk/modules/rewards.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ This method heavily utilizes RPC fetching chain event logs. It's better suited f

```ts
const lidoSDK = new LidoSDK({
chainId: 5,
rpcUrls: ['https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}'],
chainId: 17000,
rpcUrls: ['<RPC_URL>'],
});

const rewardsQuery = await lidoSDK.rewards.getRewardsFromChain({
Expand All @@ -78,8 +78,8 @@ This method requires you to provide API URL to send subgraph requests to. It's b

```ts
const lidoSDK = new LidoSDK({
chainId: 5,
rpcUrls: ['https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}'],
chainId: 1,
rpcUrls: ['<RPC_URL>'],
});

const rewardsQuery = await lidoSDK.rewards.getRewardsFromSubgraph({
Expand Down
6 changes: 3 additions & 3 deletions docs/sdk/modules/shares.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ This module exposes methods of Lido(stETH) contract that allow interaction with
import { LidoSDK } from '@lidofinance/lido-ethereum-sdk';

const lidoSDK = new LidoSDK({
rpcUrls: ['https://rpc-url'],
chainId: 5,
web3Provider: LidoSDKCore.createWeb3Provider(5, window.ethereum),
rpcUrls: ['<RPC_URL>'],
chainId: 17000,
web3Provider: LidoSDKCore.createWeb3Provider(17000, window.ethereum),
});

const balanceShares = await lidoSDK.shares.balance(address);
Expand Down
14 changes: 7 additions & 7 deletions docs/sdk/modules/stake.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ import {
} from '@lidofinance/lido-ethereum-sdk';

const lidoSDK = new LidoSDK({
rpcUrls: ['https://rpc-url'],
chainId: 5,
web3Provider: LidoSDKCore.createWeb3Provider(5, window.ethereum),
rpcUrls: ['<RPC_URL>'],
chainId: 17000,
web3Provider: LidoSDKCore.createWeb3Provider(1700, window.ethereum),
});

const callback: StakeStageCallback = ({ stage, payload }) => {
Expand Down Expand Up @@ -86,8 +86,8 @@ try {
import { LidoSDK } from '@lidofinance/lido-ethereum-sdk';

const lidoSDK = new LidoSDK({
rpcUrls: ['https://rpc-url'],
chainId: 5,
rpcUrls: ['<RPC_URL>'],
chainId: 17000,
});

const populateResult = await lidoSDK.stake.stakeEthPopulateTx({
Expand All @@ -106,8 +106,8 @@ console.log(populateResult, 'to, from, value, data');
import { LidoSDK } from '@lidofinance/lido-ethereum-sdk';

const lidoSDK = new LidoSDK({
rpcUrls: ['https://rpc-url'],
chainId: 5,
rpcUrls: ['<RPC_URL>'],
chainId: 17000,
});

const simulateResult = await lidoSDK.staking.stakeEthSimulateTx({
Expand Down
4 changes: 2 additions & 2 deletions docs/sdk/modules/unsteth-nft.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ This modules exposes NFT functionality of Lido Withdrawal Request NFT.

```ts
const lidoSDK = new LidoSDK({
chainId: 5,
rpcUrls: ['https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}'],
chainId: 17000,
rpcUrls: ['<RPC_URL>'],
});

// Contracts
Expand Down
6 changes: 3 additions & 3 deletions docs/sdk/modules/w-steth.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ stETH and wstETH tokens functionality is presented trough modules with same ERC2

```ts
const lidoSDK = new LidoSDK({
chainId: 5,
rpcUrls: ['https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}'],
web3Provider: LidoSDKCore.createWeb3Provider(5, window.ethereum),
chainId: 17000,
rpcUrls: ['<RPC_URL>'],
web3Provider: LidoSDKCore.createWeb3Provider(17000, window.ethereum),
});

// Views
Expand Down
24 changes: 12 additions & 12 deletions docs/sdk/modules/withdraw.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import {
} from '@lidofinance/lido-ethereum-sdk';

const lidoSDK = new LidoSDK({
rpcUrls: ['https://rpc-url'],
chainId: 5,
web3Provider: LidoSDKCore.createWeb3Provider(5, window.ethereum),
rpcUrls: ['<RPC_URL>'],
chainId: 17000,
web3Provider: LidoSDKCore.createWeb3Provider(17000, window.ethereum),
});

const callback: TransactionCallback = ({ stage, payload }) => {
Expand Down Expand Up @@ -112,9 +112,9 @@ import {
} from '@lidofinance/lido-ethereum-sdk';

const lidoSDK = new LidoSDK({
rpcUrls: ['https://rpc-url'],
chainId: 5,
web3Provider: LidoSDKCore.createWeb3Provider(5, window.ethereum),
rpcUrls: ['<RPC_URL>'],
chainId: 17000,
web3Provider: LidoSDKCore.createWeb3Provider(17000, window.ethereum),
});

const callback: TransactionCallback = ({ stage, payload }) => {
Expand Down Expand Up @@ -184,9 +184,9 @@ import {
} from '@lidofinance/lido-ethereum-sdk';

const lidoSDK = new LidoSDK({
rpcUrls: ['https://rpc-url'],
chainId: 5,
web3Provider: LidoSDKCore.createWeb3Provider(5, window.ethereum),
rpcUrls: ['<RPC_URL>'],
chainId: 17000,
web3Provider: LidoSDKCore.createWeb3Provider(17000, window.ethereum),
});

const callback: TransactionCallback = ({ stage, payload }) => {
Expand Down Expand Up @@ -253,9 +253,9 @@ import {
} from '@lidofinance/lido-ethereum-sdk';

const lidoSDK = new LidoSDK({
rpcUrls: ['https://rpc-url'],
chainId: 5,
web3Provider: LidoSDKCore.createWeb3Provider(5, window.ethereum),
rpcUrls: ['<RPC_URL>'],
chainId: 17000,
web3Provider: LidoSDKCore.createWeb3Provider(17000, window.ethereum),
});

const callback: ApproveStageCallback = ({ stage, payload }) => {
Expand Down
Loading

0 comments on commit 790e634

Please sign in to comment.