diff --git a/docs/docs/getting-started.mdx b/docs/docs/getting-started.mdx index 5ba1e84..668b6b9 100644 --- a/docs/docs/getting-started.mdx +++ b/docs/docs/getting-started.mdx @@ -75,11 +75,13 @@ const [walletAddress] = await pufferClient.requestAddresses(); ### 3. Interact with the Contract +Mint pufETH to your `walletAddress` or set a target recipient: + ```ts const { transact, estimate } = pufferClient.depositETH(walletAddress); // Returns gas estimate of the transaction. const gasEstimate = await estimate(); // Execute the transaction for depositing ETH. -const address = await transact(new BigInt(1)); +const txHash = await transact(new BigInt(1e18)); ``` diff --git a/docs/docs/guides/depositing-eth.md b/docs/docs/guides/depositing-eth.md index 8ca09aa..d37edd2 100644 --- a/docs/docs/guides/depositing-eth.md +++ b/docs/docs/guides/depositing-eth.md @@ -4,7 +4,7 @@ sidebar_position: 1 # Depositing ETH -Using the Puffer SDK to deposit ETH is simple. First, setup the `PufferClient`. +Using the Puffer SDK to mint pufETH is simple. First, setup the `PufferClient`. ```ts import { @@ -20,21 +20,35 @@ const walletClient = PufferClientHelpers.createWalletClient({ const pufferClient = new PufferClient(Chain.Holesky, walletClient); ``` -Then connect to the wallet or use an existing wallet address. +Then connect to the wallet to fetch your address. ```ts const [walletAddress] = await pufferClient.requestAddresses(); ``` -With the wallet address at hand, make the transacation. +With your address at hand, make the transaction to deposit ETH to mint pufETH. ```ts const { transact, estimate } = pufferClient.depositETH(walletAddress); -const ethValue = new BigInt(1); +const weiAmount = new BigInt(1e18); // Returns gas estimate of the transaction. const gasEstimate = await estimate(); // Execute the transaction for depositing ETH. -const address = await transact(ethValue); +const txHash = await transact(weiAmount); +``` + + +Alternatively, you can set the pufETH recipient to a different address. + +```ts +const { transact, estimate } = pufferClient.depositETH(recipientAddress); + +const weiAmount = new BigInt(1e18); + +// Returns gas estimate of the transaction. +const gasEstimate = await estimate(); +// Execute the transaction for depositing ETH. +const txHash = await transact(weiAmount); ```