Skip to content

Commit

Permalink
docs(chore): Update (#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
rrr523 authored Apr 21, 2024
1 parent d4e480a commit 81307b2
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions doc-site/docs/client/greenfield.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,39 @@ title: 'Greenfield Client'
sidebar_position: 1
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Create Greenfield Client

| params | description |
| -------------- | ------------------- |
| GRPC_URL | Greenfield grpc url |
| GREEN_CHAIN_ID | Greenfield chain id |

<Tabs groupId="example">
<TabItem value="Browser" label="Browser">

```js
import { Client } from '@bnb-chain/greenfield-js-sdk';

// Node.js
const client = Client.create(GRPC_URL, GREEN_CHAIN_ID);

// Browser
const client = Client.create(GRPC_URL, String(GREEN_CHAIN_ID), {
zkCryptoUrl:
'https://unpkg.com/@bnb-chain/[email protected]/dist/node/zk-crypto.wasm',
});
```

</TabItem>
<TabItem value="Nodejs" label="Nodejs">

```js
const { Client } = require('@bnb-chain/greenfield-js-sdk');
const client = Client.create(GRPC_URL, GREEN_CHAIN_ID);
```

</TabItem>
</Tabs>

:::tip

The browser needs to load wasm manually.
Expand Down

0 comments on commit 81307b2

Please sign in to comment.