Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 1.95 KB

README.md

File metadata and controls

51 lines (36 loc) · 1.95 KB

Balanced Examples

This repo is a collection of code samples to showcase how to execute different operations on Balanced.

Prerequisites

To be able to run the code samples, first clone the repo and then install the required dependencies:

git clone https://github.com/balancednetwork/balanced-examples.git
cd balanced-examples
npm install

The sample scripts can run in both testnet and mainnet environments. To switch between the two, set the NETWORK environment variable to either testnet or mainnet (default is testnet).

For this create a .env file in the root of the project and add the following line:

NETWORK=testnet

Also setup a PRIVATE_KEY environment variable in the .env file with the private key of the account you want to use to sign transactions.

NETWORK=testnet
PRIVATE_KEY=0x...

If no private key is provided, the scripts that require signing transactions will fail.

Scripts

The following scripts are available:

References