Skip to content

Commit

Permalink
docs: Update
Browse files Browse the repository at this point in the history
  • Loading branch information
rrr523 committed Sep 22, 2023
1 parent 545b74a commit 310d5e6
Show file tree
Hide file tree
Showing 27 changed files with 131 additions and 531 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You can find some package documentation below:

| Package | Description | Version |
| --- | --- | --- |
| [@bnb-chain/greenfield-js-sdk](./packages/chain-sdk/README.md) | A client library for Greenfield Chain | [![npm](https://img.shields.io/npm/v/%40bnb-chain%2Fgreenfield-js-sdk?color=blue)](https://www.npmjs.com/package/@bnb-chain/greenfield-js-sdk) |
| [@bnb-chain/greenfield-js-sdk](./packages/js-sdk/README.md) | A client library for Greenfield Chain | [![npm](https://img.shields.io/npm/v/%40bnb-chain%2Fgreenfield-js-sdk?color=blue)](https://www.npmjs.com/package/@bnb-chain/greenfield-js-sdk) |
| [@bnb-chain/greenfiled-file-handle](./packages/file-handle/README.md) | WASM module that handle file, such as `checksums` | [![npm](https://img.shields.io/npm/v/%40bnb-chain%2Fgreenfiled-file-handle?color=blue)](https://www.npmjs.com/package/@bnb-chain/greenfiled-file-handle) |
| [@bnb-chain/greenfield-zk-crypto](./packages/zk-crypto/README.md) | WASM module about sign crypto | [![npm](https://img.shields.io/npm/v/%40bnb-chain%2Fgreenfield-zk-crypto?color=blue)](https://www.npmjs.com/package/@bnb-chain/greenfield-zk-crypto) |
| [@bnb-chain/create-gnfd-app](./packages/create-gnfd-app/README.md) | Create Greenfield App Quickly | [![npm](https://img.shields.io/npm/v/%40bnb-chain%2Fcreate-gnfd-app?color=blue)](https://www.npmjs.com/package/@bnb-chain/create-gnfd-app) |
Expand Down
14 changes: 14 additions & 0 deletions doc-site/docs/api/_category_.json
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": ""
}
}
9 changes: 0 additions & 9 deletions doc-site/docs/api/index.md

This file was deleted.

8 changes: 8 additions & 0 deletions doc-site/docs/api/query-client.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
id: query-client
sidebar_position: 2
---

# Query Client


6 changes: 6 additions & 0 deletions doc-site/docs/api/tx-client.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: tx-client
sidebar_position: 1
---

# Tx Client
14 changes: 14 additions & 0 deletions doc-site/docs/getting-started/_category_.json
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": ""
}
}
28 changes: 28 additions & 0 deletions doc-site/docs/getting-started/client.md
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
24 changes: 24 additions & 0 deletions doc-site/docs/getting-started/install.md
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
```

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
id: overview
sidebar_position: 1
slug: /
---

# Overview
Expand All @@ -8,7 +10,7 @@ You can find some package documentation below:

| Package | Description | Version |
| --- | --- | --- |
| [@bnb-chain/greenfield-js-sdk](https://github.com/bnb-chain/greenfield-js-sdk/tree/main/packages/chain-sdk/README.md) | A client library for Greenfield Chain | [![npm](https://img.shields.io/npm/v/%40bnb-chain%2Fgreenfield-js-sdk?color=blue)](https://www.npmjs.com/package/@bnb-chain/greenfield-js-sdk) |
| [@bnb-chain/greenfield-js-sdk](https://github.com/bnb-chain/greenfield-js-sdk/tree/main/packages/js-sdk/README.md) | A client library for Greenfield Chain | [![npm](https://img.shields.io/npm/v/%40bnb-chain%2Fgreenfield-js-sdk?color=blue)](https://www.npmjs.com/package/@bnb-chain/greenfield-js-sdk) |
| [@bnb-chain/greenfiled-file-handle](https://github.com/bnb-chain/greenfield-js-sdk/tree/main/packages/file-handle/README.md) | WASM module that handle file, such as `checksums` | [![npm](https://img.shields.io/npm/v/%40bnb-chain%2Fgreenfiled-file-handle?color=blue)](https://www.npmjs.com/package/@bnb-chain/greenfiled-file-handle) |
| [@bnb-chain/greenfield-zk-crypto](https://github.com/bnb-chain/greenfield-js-sdk/tree/main/packages/zk-crypto/README.md) | WASM module about sign crypto | [![npm](https://img.shields.io/npm/v/%40bnb-chain%2Fgreenfield-zk-crypto?color=blue)](https://www.npmjs.com/package/@bnb-chain/greenfield-zk-crypto) |
| [@bnb-chain/create-gnfd-app](https://github.com/bnb-chain/greenfield-js-sdk/tree/main/packages/create-gnfd-app/README.md) | Create Greenfield App Quickly | [![npm](https://img.shields.io/npm/v/%40bnb-chain%2Fcreate-gnfd-app?color=blue)](https://www.npmjs.com/package/@bnb-chain/create-gnfd-app) |
Expand All @@ -19,16 +21,6 @@ You can find some package documentation below:
* [Create React App](https://codesandbox.io/p/github/rrr523/greenfield-cra-template/main)
* [Vite](https://codesandbox.io/p/github/rrr523/greenfield-vite-template/main)

## Quick Start

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)

## Supported JS environments

1. Modern browsers (Chromium, Firefox, Safari)
Expand Down
16 changes: 16 additions & 0 deletions doc-site/docs/getting-started/quick-start.md
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)
8 changes: 0 additions & 8 deletions doc-site/docs/tutorial-basics/_category_.json

This file was deleted.

23 changes: 0 additions & 23 deletions doc-site/docs/tutorial-basics/congratulations.md

This file was deleted.

34 changes: 0 additions & 34 deletions doc-site/docs/tutorial-basics/create-a-blog-post.md

This file was deleted.

57 changes: 0 additions & 57 deletions doc-site/docs/tutorial-basics/create-a-document.md

This file was deleted.

43 changes: 0 additions & 43 deletions doc-site/docs/tutorial-basics/create-a-page.md

This file was deleted.

31 changes: 0 additions & 31 deletions doc-site/docs/tutorial-basics/deploy-your-site.md

This file was deleted.

Loading

0 comments on commit 310d5e6

Please sign in to comment.