Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove the appendix for toJSON function #65

Merged
merged 4 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 56 additions & 98 deletions content/sdk/10.js/00.ethers/05.api/10.v5/00.providers/01.provider.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -839,20 +839,3 @@ const message = "Hello, ZKsync!";
const signature = await signer.signMessage(message);
console.log(`Signature: ${signature}`);
```

## Appendix

### toJSON

Helper function to convert objects to JSON string with BigInt support.

```ts
function toJSON(object: any): string {
return JSON.stringify(object, (key, value) => {
if (typeof value === "bigint") {
return value.toString(); // Convert BigInt to string
}
return value;
});
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -1919,8 +1919,6 @@ async getPriorityOpConfirmation(txHash: string, index: number = 0): Promise<{

#### Example

Helper function: [toJSON](/sdk/js/ethers/api/v5/providers/web3provider#tojson).

```ts
import { Wallet, Provider, types, utils } from "zksync-ethers";
import { ethers } from "ethers";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This class extends `ethers.providers.JsonRpcSigner` and so supports all the meth
The easiest way to construct it is from an `Web3Provider` object.

```ts
import { Provider, L1Signer, types } from "zksync-ethers";
import { Provider, L1Signer, types, utils } from "zksync-ethers";
import { ethers } from "ethers";

const provider = new ethers.providers.Web3Provider(window.ethereum);
Expand Down Expand Up @@ -1073,8 +1073,6 @@ async getPriorityOpConfirmation(txHash: string, index: number = 0): Promise<{

#### Example

Helper function: [toJSON](/sdk/js/ethers/api/v5/providers/web3provider#tojson).

```ts
import { Provider, L1Signer, types } from "zksync-ethers";
import { ethers } from "ethers";
Expand Down
Loading
Loading