Skip to content

The repository contains a comprehensive documentation of the bepro.network ecosystem as a javascript framework. If you are new to BEPRO, you might want to check out the Website Overview or our public "Start Building" Page.

Notifications You must be signed in to change notification settings

laurensiamelinda/bepro-js

 
 

Repository files navigation

alt tag

Python Build Status Dependencies GitHub issues Contributions welcome License

Introductions

Build the future of DeFi Gaming

Installation

bepro-js is available as npm package.

// with npm
$ npm i bepro-js

Before try to install, make sure your working directory has Python 2 and the recommended NVM version setted on. To do, so:

  1. Setting of Python 2:
// Install it via bash terminal globally
$ sudo apt install python2

// Check the installed version.
// Must shown Python 2.7.18rc1 on terminal to the install be OK
$ python2 --version

// Verify Python 2.7 path
$ ls /usr/bin/python*

// Set Python 2 as alternative 1
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1

// Confirm Python 2 as alternative priority 1
$ sudo update-alternatives --config python

// Confirm the procedure.
// Must shown Python 2.7.18rc1 on terminal to the install be OK
$ python --version

// On the working directory, run the cmd below to set Python locally
$ npm config set python python
  1. Setting of Node:
// Install NVM recommended version for bepro-js
$ nvm install 8.12.0

// Set it on the working directory
$ nvm alias default v8.12.0

// Use the settled as default
$ nvm use default

Now, your work directory is able to install and run bepro-js.

Usage

https://bepronetwork.github.io/bepro-js/

/* Note :  WEB3_LINK should be get from Infura/Quicknode or any other Web3 Provider - ETH, BSC, Moonbeam and others are supported */

import moment from 'moment';
import { Application } from 'bepro-js';

/* 1 - Instantiate the App with the Infura/Web3 Connection */
let app = new Application({opt : {web3Connection : 'WEB3_LINK'}});

/* 2 - Connect the App to the Metamask Web3 Injected wallet*/
await app.login();
/* or instantiate with the provided web3Connection */
await app.start()

/* 3 - Generate a Object (Staking, ERC20 etc..) */
let staking = app.getStakingContract({contractAddress : /* Contract Address (optional) */});

/* 4 - Assert all object data */
await staking.__assert();
/* or deploy the contract*/
await staking.deploy();

/* 5 - Access other Methods */
await staking.availableTokens();

Contribution

Contributions are welcomed but we ask to red existing code guidelines, specially the code format. Please review Contributor guidelines

License

MIT

Notes

The usage of ETH in all methods or params means using the native currency of that blockchain, example BSC in Binance Chain would still be nominated as ETH

About

The repository contains a comprehensive documentation of the bepro.network ecosystem as a javascript framework. If you are new to BEPRO, you might want to check out the Website Overview or our public "Start Building" Page.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 67.9%
  • Solidity 16.5%
  • CSS 10.0%
  • HTML 5.6%