Skip to content

bnb-chain/greenfield-js-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f41d8c4 · Sep 1, 2023
Aug 31, 2023
Jun 25, 2023
Jul 7, 2023
Mar 28, 2023
Aug 31, 2023
Aug 31, 2023
Mar 28, 2023
Mar 28, 2023
Mar 28, 2023
Jun 29, 2023
Jul 7, 2023
Mar 28, 2023
Jun 25, 2023
Mar 28, 2023
Mar 28, 2023
Apr 11, 2023
Mar 28, 2023
Mar 30, 2023
Aug 25, 2023
Jun 25, 2023
Aug 29, 2023
Mar 28, 2023

Repository files navigation

GreenField JS SDK

A Greenfield JS SDK is an easy-to-use tool designed to help developers build decentralized applications (DApps) on the Greenfield blockchain using JavaScript. It provides a simple and straightforward starting point for developers to create DApps with the latest technology and best practices, making Dapp development more efficient. This SDK includes features and tools to make interacting with the Greenfield blockchain easy, such as libraries for common functionality, testing tools, and documentation. With a Greenfield JS SDK, developers can create scalable, maintainable, and efficient DApps for a variety of use cases.

Documentation

You can find some package documentation below:

Package Description
@bnb-chain/greenfield-js-sdk A client library for Greenfield Chain
@bnb-chain/greenfiled-file-handle WASM module that handle file, such as checksums
@bnb-chain/greenfield-zk-crypto WASM module about sign crypto

Document

Document

Examples

There are runnable examples included in the examples folder

Try in Stackblitz

You can try out some examples directly in your browser through Stackblitz:

Running Examples Locally

Clone the project and install dependencies:

> git clone [email protected]:bnb-chain/greenfield-js-sdk.git
> cd greenfield-js-sdk
> pnpm install

and build package:

> pnpm run -r build

and then copy env template file:

> cp .env.simple .env

and then enter your own configuration. Take testnet, for example:

NEXT_PUBLIC_GRPC_URL=https://gnfd-testnet-fullnode-tendermint-us.bnbchain.org
NEXT_PUBLIC_GREENFIELD_RPC_URL=https://gnfd-testnet-fullnode-tendermint-us.bnbchain.org
NEXT_PUBLIC_GREEN_CHAIN_ID=5600
NEXT_PUBLIC_BSC_RPC_URL=https://gnfd-bsc-testnet-dataseed1.bnbchain.org
NEXT_PUBLIC_BSC_CHAIN_ID=97

# refer to https://docs.bnbchain.org/greenfield-docs/docs/guide/dapp/contract-list
NEXT_PUBLIC_TOKEN_HUB_CONTRACT_ADDRESS=
NEXT_PUBLIC_CROSS_CHAIN_CONTRACT_ADDRESS=

The contract address may be outdated due to Greenfield reset, refer to https://docs.bnbchain.org/greenfield-docs/docs/guide/dapp/contract-list get the latest contract address.

abd then run example:

> npx next dev

Supported JS environments

  1. Modern browsers (Chromium, Firefox, Safari)
  2. Browser extensions (Chromium, Firefox)
  3. Nodejs

Contribution

Look over CONTRIBUTING

Disclaimer

Look over DISCLAIMER

License

The library is licensed under the GNU Lesser General Public License v3.0, also included in our repository in the LICENSE file.