diff --git a/README.md b/README.md index 90d1bbe..5b8a988 100644 --- a/README.md +++ b/README.md @@ -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 }); @@ -74,13 +75,13 @@ 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: [''], web3Provider: provider, // optional }); ``` -Replace "https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}" with the address of your Ethereum provider. +Replace `` with the url of your Ethereum RPC provider. ## Examples @@ -88,8 +89,8 @@ All examples and usage instructions can be found in the [Docs SDK package](https ```ts const lidoSDK = new LidoSDK({ - chainId: 5, - rpcUrls: ['https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}'], + chainId: 17000, + rpcUrls: [''], web3Provider: provider, }); diff --git a/docs/sdk/get-started/basic-examples.md b/docs/sdk/get-started/basic-examples.md index 55f9f12..bebd379 100644 --- a/docs/sdk/get-started/basic-examples.md +++ b/docs/sdk/get-started/basic-examples.md @@ -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: [''], }); // Views @@ -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: [''], web3provider: LidoSDKCore.createWeb3Provider(5, window.ethereum), }); @@ -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: [''], + web3provider: LidoSDKCore.createWeb3Provider(17000, window.ethereum), }); // Contracts @@ -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: [''], web3provider: LidoSDKCore.createWeb3Provider(5, window.ethereum), }); diff --git a/docs/sdk/get-started/usage.md b/docs/sdk/get-started/usage.md index a6436aa..44e97fe 100644 --- a/docs/sdk/get-started/usage.md +++ b/docs/sdk/get-started/usage.md @@ -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 }); @@ -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: [''], web3Provider: provider, // optional }); ``` -Replace "https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}" with the address of your Ethereum provider. +Replace `` with the address of your Ethereum provider. ## With web3Provider @@ -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: [''], web3Provider, }); ``` @@ -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: [''], }; // core is created under the hood const stake = new LidoSDKStake(params); diff --git a/docs/sdk/intro.md b/docs/sdk/intro.md index 57d83b8..213b545 100644 --- a/docs/sdk/intro.md +++ b/docs/sdk/intro.md @@ -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 @@ -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 }); @@ -63,13 +63,13 @@ 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: [''], web3Provider: provider, // optional }); ``` -Replace "https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}" with the address of your Ethereum provider. +Replace `` with the URL of your Ethereum RPC provider. ## Example @@ -77,8 +77,8 @@ Basic examples and usage instructions can be found in [here](/category/get-start ```ts const lidoSDK = new LidoSDK({ - chainId: 5, - rpcUrls: ['https://eth-goerli.alchemyapi.io/v2/{ALCHEMY_API_KEY}'], + chainId: 17000, + rpcUrls: [''], web3Provider: provider, }); @@ -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). diff --git a/docs/sdk/modules/lido-statistics.md b/docs/sdk/modules/lido-statistics.md index 6fae30a..728fc0b 100644 --- a/docs/sdk/modules/lido-statistics.md +++ b/docs/sdk/modules/lido-statistics.md @@ -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: [''], + chainId: 17000, }); const lastApr = await lidoSDK.statistics.apr.getLastApr(); diff --git a/docs/sdk/modules/rewards.md b/docs/sdk/modules/rewards.md index f083089..5889f07 100644 --- a/docs/sdk/modules/rewards.md +++ b/docs/sdk/modules/rewards.md @@ -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: [''], }); const rewardsQuery = await lidoSDK.rewards.getRewardsFromChain({ @@ -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: [''], }); const rewardsQuery = await lidoSDK.rewards.getRewardsFromSubgraph({ diff --git a/docs/sdk/modules/shares.md b/docs/sdk/modules/shares.md index c3c1587..51cb8d9 100644 --- a/docs/sdk/modules/shares.md +++ b/docs/sdk/modules/shares.md @@ -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: [''], + chainId: 17000, + web3Provider: LidoSDKCore.createWeb3Provider(17000, window.ethereum), }); const balanceShares = await lidoSDK.shares.balance(address); diff --git a/docs/sdk/modules/stake.md b/docs/sdk/modules/stake.md index 722e432..3ac0edb 100644 --- a/docs/sdk/modules/stake.md +++ b/docs/sdk/modules/stake.md @@ -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: [''], + chainId: 17000, + web3Provider: LidoSDKCore.createWeb3Provider(1700, window.ethereum), }); const callback: StakeStageCallback = ({ stage, payload }) => { @@ -86,8 +86,8 @@ try { import { LidoSDK } from '@lidofinance/lido-ethereum-sdk'; const lidoSDK = new LidoSDK({ - rpcUrls: ['https://rpc-url'], - chainId: 5, + rpcUrls: [''], + chainId: 17000, }); const populateResult = await lidoSDK.stake.stakeEthPopulateTx({ @@ -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: [''], + chainId: 17000, }); const simulateResult = await lidoSDK.staking.stakeEthSimulateTx({ diff --git a/docs/sdk/modules/unsteth-nft.md b/docs/sdk/modules/unsteth-nft.md index 7a372f2..4db2a13 100644 --- a/docs/sdk/modules/unsteth-nft.md +++ b/docs/sdk/modules/unsteth-nft.md @@ -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: [''], }); // Contracts diff --git a/docs/sdk/modules/w-steth.md b/docs/sdk/modules/w-steth.md index 4266bf7..d3e5e29 100644 --- a/docs/sdk/modules/w-steth.md +++ b/docs/sdk/modules/w-steth.md @@ -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: [''], + web3Provider: LidoSDKCore.createWeb3Provider(17000, window.ethereum), }); // Views diff --git a/docs/sdk/modules/withdraw.md b/docs/sdk/modules/withdraw.md index a1f0577..0d26cea 100644 --- a/docs/sdk/modules/withdraw.md +++ b/docs/sdk/modules/withdraw.md @@ -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: [''], + chainId: 17000, + web3Provider: LidoSDKCore.createWeb3Provider(17000, window.ethereum), }); const callback: TransactionCallback = ({ stage, payload }) => { @@ -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: [''], + chainId: 17000, + web3Provider: LidoSDKCore.createWeb3Provider(17000, window.ethereum), }); const callback: TransactionCallback = ({ stage, payload }) => { @@ -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: [''], + chainId: 17000, + web3Provider: LidoSDKCore.createWeb3Provider(17000, window.ethereum), }); const callback: TransactionCallback = ({ stage, payload }) => { @@ -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: [''], + chainId: 17000, + web3Provider: LidoSDKCore.createWeb3Provider(17000, window.ethereum), }); const callback: ApproveStageCallback = ({ stage, payload }) => { diff --git a/docs/sdk/modules/wrap.md b/docs/sdk/modules/wrap.md index 4dffd44..cdab416 100644 --- a/docs/sdk/modules/wrap.md +++ b/docs/sdk/modules/wrap.md @@ -22,9 +22,9 @@ import { } from '@lidofinance/lido-ethereum-sdk'; const lidoSDK = new LidoSDK({ - rpcUrls: ['https://rpc-url'], - chainId: 5, - web3Provider: LidoSDKCore.createWeb3Provider(5, window.ethereum), + rpcUrls: [''], + chainId: 17000, + web3Provider: LidoSDKCore.createWeb3Provider(17000, window.ethereum), }); const callback: TransactionCallback = ({ stage, payload }) => { @@ -83,9 +83,9 @@ import { } from '@lidofinance/lido-ethereum-sdk'; const lidoSDK = new LidoSDK({ - rpcUrls: ['https://rpc-url'], - chainId: 5, - web3Provider: LidoSDKCore.createWeb3Provider(5, window.ethereum), + rpcUrls: [''], + chainId: 17000, + web3Provider: LidoSDKCore.createWeb3Provider(17000, window.ethereum), }); // get existing allowance