-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
131 additions
and
531 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"position": 2, | ||
"label": "API", | ||
"collapsible": true, | ||
"collapsed": true, | ||
"className": "red", | ||
"link": { | ||
"type": "generated-index", | ||
"title": "API" | ||
}, | ||
"customProps": { | ||
"description": "" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
id: query-client | ||
sidebar_position: 2 | ||
--- | ||
|
||
# Query Client | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
id: tx-client | ||
sidebar_position: 1 | ||
--- | ||
|
||
# Tx Client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"position": 1, | ||
"label": "Getting Started", | ||
"collapsible": false, | ||
"collapsed": false, | ||
"className": "red", | ||
"link": { | ||
"type": "generated-index", | ||
"title": "Getting Started" | ||
}, | ||
"customProps": { | ||
"description": "" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
id: create-client | ||
sidebar_position: 2 | ||
--- | ||
|
||
# Create Greenfield Client | ||
|
||
```js | ||
import { Client } from '@bnb-chain/greenfield-js-sdk' | ||
|
||
// Node.js | ||
const client = Client.create(GRPC_URL, GREEN_CHAIN_ID); | ||
|
||
// Browser | ||
Client.create(GRPC_URL, String(GREEN_CHAIN_ID), { | ||
zkCryptoUrl: | ||
'https://unpkg.com/@bnb-chain/[email protected]/dist/node/zk-crypto.wasm', | ||
}); | ||
``` | ||
|
||
> Browser need load wasm manually. | ||
# Usage | ||
|
||
The JS SDK consists of two parts: | ||
|
||
* Chain: https://docs.bnbchain.org/greenfield-docs/docs/api/blockchain-rest | ||
* Storage Provider: https://docs.bnbchain.org/greenfield-docs/docs/api/storage-provider-rest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
id: install | ||
sidebar_position: 2 | ||
--- | ||
|
||
# Install | ||
|
||
Using npm: | ||
|
||
```bash | ||
> npm install @bnb-chain/greenfield-js-sdk | ||
``` | ||
|
||
Using yarn: | ||
|
||
```bash | ||
> yarn add @bnb-chain/greenfield-js-sdk | ||
``` | ||
|
||
Using pnpm: | ||
```bash | ||
> pnpm add @bnb-chain/greenfield-js-sdk | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
id: quick-start | ||
sidebar_position: 2 | ||
--- | ||
|
||
# Quick Start | ||
|
||
We provide templates that can run `React` (Next.js, Vite and CRA(Legacy) etc) directly. | ||
|
||
You can use [`create-gnfd-app`](https://github.com/bnb-chain/greenfield-js-sdk/tree/main/packages/create-gnfd-app) to create a app quickly: | ||
|
||
```bash | ||
> npx @bnb-chain/create-gnfd-app | ||
``` | ||
|
||
![](https://github.com/bnb-chain/greenfield-js-sdk/raw/alpha/packages/create-gnfd-app/example.gif) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.