Skip to content

Commit

Permalink
docs: fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
danijelTxFusion committed May 9, 2024
1 parent 4160ec7 commit f15417f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 42 deletions.
29 changes: 14 additions & 15 deletions src/signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export class Signer extends AdapterL2(ethers.JsonRpcSigner) {
* );
*
* const tokenL2 = "0x6a4Fb925583F7D4dF82de62d98107468aE846FD1";
* const tx = await signer.withdraw({
* const withdrawTx = await signer.withdraw({
* token: utils.ETH_ADDRESS,
* amount: 10_000_000n,
* });
Expand All @@ -317,7 +317,7 @@ export class Signer extends AdapterL2(ethers.JsonRpcSigner) {
* Provider.getDefaultProvider(types.Network.Sepolia)
* );
*
* const tx = await signer.withdraw({
* const withdrawTx = await signer.withdraw({
* token: utils.ETH_ADDRESS,
* amount: 10_000_000n,
* paymasterParams: utils.getPaymasterParams(paymaster, {
Expand All @@ -341,7 +341,7 @@ export class Signer extends AdapterL2(ethers.JsonRpcSigner) {
* );
*
* const tokenL2 = "0x6a4Fb925583F7D4dF82de62d98107468aE846FD1";
* const tx = await signer.withdraw({
* const withdrawTx = await signer.withdraw({
* token: tokenL2,
* amount: 10_000_000n,
* });
Expand All @@ -361,7 +361,7 @@ export class Signer extends AdapterL2(ethers.JsonRpcSigner) {
* );
*
* const tokenL2 = "0x6a4Fb925583F7D4dF82de62d98107468aE846FD1";
* const tx = await signer.withdraw({
* const withdrawTx = await signer.withdraw({
* token: tokenL2,
* amount: 10_000_000n,
* paymasterParams: utils.getPaymasterParams(paymaster, {
Expand Down Expand Up @@ -398,13 +398,12 @@ export class Signer extends AdapterL2(ethers.JsonRpcSigner) {
* Provider.getDefaultProvider(types.Network.Sepolia)
* );
*
* const tokenL2 = "0x6a4Fb925583F7D4dF82de62d98107468aE846FD1";
* const tx = await signer.transfer({
* const transferTx = await signer.transfer({
* to: Wallet.createRandom().address,
* amount: ethers.parseEther("0.01"),
* });
*
* const receipt = await tx.wait();
* const receipt = await transferTx.wait();
*
* console.log(`The sum of ${receipt.value} ETH was transferred to ${receipt.to}`);
*
Expand All @@ -423,7 +422,7 @@ export class Signer extends AdapterL2(ethers.JsonRpcSigner) {
* Provider.getDefaultProvider(types.Network.Sepolia)
* );
*
* const tx = signer.transfer({
* const transferTx = signer.transfer({
* to: Wallet.createRandom().address,
* amount: ethers.parseEther("0.01"),
* paymasterParams: utils.getPaymasterParams(paymaster, {
Expand All @@ -434,7 +433,7 @@ export class Signer extends AdapterL2(ethers.JsonRpcSigner) {
* }),
* });
*
* const receipt = await tx.wait();
* const receipt = await transferTx.wait();
*
* console.log(`The sum of ${receipt.value} ETH was transferred to ${receipt.to}`);
*
Expand All @@ -451,15 +450,15 @@ export class Signer extends AdapterL2(ethers.JsonRpcSigner) {
* );
*
* const tokenL2 = "0x6a4Fb925583F7D4dF82de62d98107468aE846FD1";
* const tx = await signer.transfer({
* const transferTx = await signer.transfer({
* token: tokenL2,
* to: Wallet.createRandom().address,
* amount: ethers.parseEther("0.01"),
* });
*
* const receipt = await tx.wait();
* const receipt = await transferTx.wait();
*
* console.log(`The sum of ${receipt.value} ETH was transferred to ${receipt.to}`);
* console.log(`The sum of ${receipt.value} token was transferred to ${receipt.to}`);
*
* @example Transfer token using paymaster to facilitate fee payment with an ERC20 token.
*
Expand All @@ -477,7 +476,7 @@ export class Signer extends AdapterL2(ethers.JsonRpcSigner) {
* );
*
* const tokenL2 = "0x6a4Fb925583F7D4dF82de62d98107468aE846FD1";
* const tx = signer.transfer({
* const transferTx = signer.transfer({
* token: tokenL2,
* to: Wallet.createRandom().address,
* amount: ethers.parseEther("0.01"),
Expand All @@ -489,9 +488,9 @@ export class Signer extends AdapterL2(ethers.JsonRpcSigner) {
* }),
* });
*
* const receipt = await tx.wait();
* const receipt = await transferTx.wait();
*
* console.log(`The sum of ${receipt.value} ETH was transferred to ${receipt.to}`);
* console.log(`The sum of ${receipt.value} token was transferred to ${receipt.to}`);
*/
override async transfer(transaction: {
to: Address;
Expand Down
12 changes: 6 additions & 6 deletions src/smart-account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ export class SmartAccount extends AbstractSigner {
* provider
* );
*
* const tokenWithdrawTx = await account.withdraw({
* const withdrawTx = await account.withdraw({
* token: utils.ETH_ADDRESS,
* amount: 10_000_000n,
* });
Expand All @@ -471,7 +471,7 @@ export class SmartAccount extends AbstractSigner {
* provider
* );
*
* const tokenWithdrawTx = await account.withdraw({
* const withdrawTx = await account.withdraw({
* token: utils.ETH_ADDRESS,
* amount: 10_000_000n,
* paymasterParams: utils.getPaymasterParams(paymaster, {
Expand Down Expand Up @@ -531,9 +531,9 @@ export class SmartAccount extends AbstractSigner {
* amount: ethers.parseEther("0.01"),
* });
*
* const tx = await transferTx.wait();
* const receipt = await transferTx.wait();
*
* console.log(`The sum of ${tx.value} ETH was transferred to ${tx.to}`);
* console.log(`The sum of ${receipt.value} ETH was transferred to ${receipt.to}`);
*
* @example Transfer ETH using paymaster to facilitate fee payment with an ERC20 token.
*
Expand Down Expand Up @@ -563,9 +563,9 @@ export class SmartAccount extends AbstractSigner {
* }),
* });
*
* const tx = await transferTx.wait();
* const receipt = await transferTx.wait();
*
* console.log(`The sum of ${tx.value} ETH was transferred to ${tx.to}`);
* console.log(`The sum of ${receipt.value} ETH was transferred to ${receipt.to}`);
*/
async transfer(transaction: {
to: Address;
Expand Down
41 changes: 20 additions & 21 deletions src/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,14 @@ export class Wallet extends AdapterL2(AdapterL1(ethers.Wallet)) {
* const ethProvider = ethers.getDefaultProvider("sepolia");
* const wallet = new Wallet(PRIVATE_KEY, provider, ethProvider);
*
* const tx = await wallet.deposit({
* const depositTx = await wallet.deposit({
* token: utils.ETH_ADDRESS,
* amount: 10_000_000n,
* });
* // Note that we wait not only for the L1 transaction to complete but also for it to be
* // processed by zkSync. If we want to wait only for the transaction to be processed on L1,
* // we can use `await tx.waitL1Commit()`
* await tx.wait();
* // we can use `await depositTx.waitL1Commit()`
* await depositTx.wait();
*
* @example Deposit token.
*
Expand All @@ -256,15 +256,15 @@ export class Wallet extends AdapterL2(AdapterL1(ethers.Wallet)) {
* const wallet = new Wallet(PRIVATE_KEY, provider, ethProvider);
*
* const tokenL1 = "0x56E69Fa1BB0d1402c89E3A4E3417882DeA6B14Be";
* const tx = await wallet.deposit({
* const depositTx = await wallet.deposit({
* token: tokenL1,
* amount: 10_000_000n,
* approveERC20: true,
* });
* // Note that we wait not only for the L1 transaction to complete but also for it to be
* // processed by zkSync. If we want to wait only for the transaction to be processed on L1,
* // we can use `await tx.waitL1Commit()`
* await tx.wait();
* // we can use `await depositTx.waitL1Commit()`
* await depositTx.wait();
*/
override async deposit(transaction: {
token: Address;
Expand Down Expand Up @@ -703,8 +703,7 @@ export class Wallet extends AdapterL2(AdapterL1(ethers.Wallet)) {
* const provider = Provider.getDefaultProvider(types.Network.Sepolia);
* const wallet = new Wallet(PRIVATE_KEY, provider);
*
* const tokenL2 = "0x6a4Fb925583F7D4dF82de62d98107468aE846FD1";
* const tx = await wallet.withdraw({
* const withdrawTx = await wallet.withdraw({
* token: utils.ETH_ADDRESS,
* amount: 10_000_000n,
* });
Expand All @@ -720,7 +719,7 @@ export class Wallet extends AdapterL2(AdapterL1(ethers.Wallet)) {
* const provider = Provider.getDefaultProvider(types.Network.Sepolia);
* const wallet = new Wallet(PRIVATE_KEY, provider);
*
* const tx = await wallet.withdraw({
* const withdrawTx = await wallet.withdraw({
* token: utils.ETH_ADDRESS,
* amount: 10_000_000n,
* paymasterParams: utils.getPaymasterParams(paymaster, {
Expand All @@ -741,7 +740,7 @@ export class Wallet extends AdapterL2(AdapterL1(ethers.Wallet)) {
* const wallet = new Wallet(PRIVATE_KEY, provider);
*
* const tokenL2 = "0x6a4Fb925583F7D4dF82de62d98107468aE846FD1";
* const tx = await wallet.withdraw({
* const withdrawTx = await wallet.withdraw({
* token: tokenL2,
* amount: 10_000_000,
* });
Expand All @@ -758,7 +757,7 @@ export class Wallet extends AdapterL2(AdapterL1(ethers.Wallet)) {
* const wallet = new Wallet(PRIVATE_KEY, provider);
*
* const tokenL2 = "0x6a4Fb925583F7D4dF82de62d98107468aE846FD1";
* const tx = await wallet.withdraw({
* const withdrawTx = await wallet.withdraw({
* token: tokenL2,
* amount: 10_000_000n,
* paymasterParams: utils.getPaymasterParams(paymaster, {
Expand Down Expand Up @@ -792,12 +791,12 @@ export class Wallet extends AdapterL2(AdapterL1(ethers.Wallet)) {
* const provider = Provider.getDefaultProvider(types.Network.Sepolia);
* const wallet = new Wallet(PRIVATE_KEY, provider);
*
* const tx = await wallet.transfer({
* const transferTx = await wallet.transfer({
* to: Wallet.createRandom().address,
* amount: ethers.parseEther("0.01"),
* });
*
* const receipt = await tx.wait();
* const receipt = await transferTx.wait();
*
* console.log(`The sum of ${receipt.value} ETH was transferred to ${receipt.to}`);
*
Expand All @@ -813,7 +812,7 @@ export class Wallet extends AdapterL2(AdapterL1(ethers.Wallet)) {
* const provider = Provider.getDefaultProvider(types.Network.Sepolia);
* const wallet = new Wallet(PRIVATE_KEY, provider);
*
* const tx = await wallet.transfer({
* const transferTx = await wallet.transfer({
* to: Wallet.createRandom().address,
* amount: ethers.parseEther("0.01"),
* paymasterParams: utils.getPaymasterParams(paymaster, {
Expand All @@ -824,7 +823,7 @@ export class Wallet extends AdapterL2(AdapterL1(ethers.Wallet)) {
* }),
* });
*
* const receipt = await tx.wait();
* const receipt = await transferTx.wait();
*
* console.log(`The sum of ${receipt.value} ETH was transferred to ${receipt.to}`);
*
Expand All @@ -839,15 +838,15 @@ export class Wallet extends AdapterL2(AdapterL1(ethers.Wallet)) {
* const wallet = new Wallet(PRIVATE_KEY, provider);
*
* const tokenL2 = "0x6a4Fb925583F7D4dF82de62d98107468aE846FD1";
* const tx = await wallet.transfer({
* const transferTx = await wallet.transfer({
* token: tokenL2,
* to: Wallet.createRandom().address,
* amount: ethers.parseEther("0.01"),
* });
*
* const receipt = await tx.wait();
* const receipt = await transferTx.wait();
*
* console.log(`The sum of ${receipt.value} ETH was transferred to ${receipt.to}`);
* console.log(`The sum of ${receipt.value} token was transferred to ${receipt.to}`);
*
* @example Transfer token using paymaster to facilitate fee payment with an ERC20 token.
*
Expand All @@ -862,7 +861,7 @@ export class Wallet extends AdapterL2(AdapterL1(ethers.Wallet)) {
* const wallet = new Wallet(PRIVATE_KEY, provider);
*
* const tokenL2 = "0x6a4Fb925583F7D4dF82de62d98107468aE846FD1";
* const tx = await wallet.transfer({
* const transferTx = await wallet.transfer({
* token: tokenL2,
* to: Wallet.createRandom().address,
* amount: ethers.parseEther("0.01"),
Expand All @@ -874,9 +873,9 @@ export class Wallet extends AdapterL2(AdapterL1(ethers.Wallet)) {
* }),
* });
*
* const receipt = await tx.wait();
* const receipt = await transferTx.wait();
*
* console.log(`The sum of ${receipt.value} ETH was transferred to ${receipt.to}`);
* console.log(`The sum of ${receipt.value} token was transferred to ${receipt.to}`);
*/
override async transfer(transaction: {
to: Address;
Expand Down

0 comments on commit f15417f

Please sign in to comment.