From 81307b2a4d60b2a7e1d65d75cc3227d323fa9c41 Mon Sep 17 00:00:00 2001 From: rk <59029880+rrr523@users.noreply.github.com> Date: Mon, 22 Apr 2024 01:16:20 +0800 Subject: [PATCH] docs(chore): Update (#526) --- doc-site/docs/client/greenfield.mdx | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/doc-site/docs/client/greenfield.mdx b/doc-site/docs/client/greenfield.mdx index 3ff0c924..25aab4e4 100644 --- a/doc-site/docs/client/greenfield.mdx +++ b/doc-site/docs/client/greenfield.mdx @@ -4,6 +4,9 @@ title: 'Greenfield Client' sidebar_position: 1 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Create Greenfield Client | params | description | @@ -11,19 +14,29 @@ sidebar_position: 1 | GRPC_URL | Greenfield grpc url | | GREEN_CHAIN_ID | Greenfield chain id | + + + ```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/greenfield-zk-crypto@0.0.3/dist/node/zk-crypto.wasm', }); ``` + + + +```js +const { Client } = require('@bnb-chain/greenfield-js-sdk'); +const client = Client.create(GRPC_URL, GREEN_CHAIN_ID); +``` + + + + :::tip The browser needs to load wasm manually.