Skip to content

Commit

Permalink
chore: remove the appendix for toJSON function (#65)
Browse files Browse the repository at this point in the history
* chore: remove the appedix for toJSON function

* chore: update utils

* chore: update utils

* chore: update utils.toJSON
  • Loading branch information
Ngozi-Txfusion authored and petarTxFusion committed Jul 8, 2024
1 parent 6c95468 commit 2880be3
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 234 deletions.
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

0 comments on commit 2880be3

Please sign in to comment.