@zoharvo97/bap-challenge
v6.2.1
Published
##GET STARTED
Downloads
2
Readme
#BAP CHALLENGE PRODUCT
##GET STARTED
###With challenge In order to use this package, first of all, you need to install
npm i bap-challenge
Create instance from bap-challenge , for example :
const BAP = require('bap-challenge')
First, you need to have instance of ChallengeService class,using https://rinkeby.infura.io/ for web3 provider:
let service = new BAP.ChallengeService(provider,contractAddress1)
let serviceChallengeWithToken = new BAP.ChallengeWithTokenService(provider,contractAddress2)
let serviceToken = new BAP.TanimotoTokenService(provider,contractAddress3)
Get challenge info :
await service.getChallengeInfo();
Ex result : { challengeCleared: '2', challengeClearedRatio: '8', daysRemained: '23', isFinished: false }
Get challenge state info :
await service.getChallengeStateInfo();
Ex result : 4
Get token name :
await serviceToken.getTokenName();
Ex result : Tanimoto Token