# new Network(options)
Network Object
Parameters:
Name | Type | Description |
---|---|---|
options |
Network~Options
|
Methods
# __assert() → {Promise.<void>}
Asserts the 2 ERC20Contract on the current address
Contract is not deployed, first deploy it and provide a contract address
Error
Promise.<void>
# changeCouncilAmount(params) → {Promise.<TransactionObject>}
Change amount needed for Council
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
value |
number
|
Promise.<TransactionObject>
# closeIssue(params) → {Promise.<TransactionObject>}
close Issue
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
issueID |
number
|
|
mergeID |
number
|
Promise.<TransactionObject>
# delegateOracles(params) → {Promise.<TransactionObject>}
Delegated Oracles to others
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
tokenAmount |
number
|
|
delegatedTo |
Address
|
Promise.<TransactionObject>
# deploy(params, options) → {Promise.<(*|undefined)>}
Deploys current contract and awaits for TokensNetwork#__assert
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
settlerTokenAddress |
string
|
|
transactionTokenAddress |
string
|
|
governanceAddress |
string
|
|
options |
IContract~TxOptions
|
Promise.<(*|undefined)>
# disputeMerge(params) → {Promise.<TransactionObject>}
Dispute Merge
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
issueID |
number
|
|
mergeID |
number
|
Promise.<TransactionObject>
# async getAmountOfDisputers() → {Promise.<number>}
Get Amount of Disputers (people who locked BEPRO) in the network
Promise.<number>
# async getAmountofIssuesClosed() → {Promise.<number>}
Get Amount of Issues Closed in the network
Promise.<number>
# async getAmountofIssuesOpened() → {Promise.<number>}
Get Amount of Issues Opened in the network
Promise.<number>
# async getBEPROStaked() → {Promise.<number>}
Get Total Amount of BEPRO Staked for Oracles
Promise.<number>
# async getIssueByCID(params) → {Promise.<TokensNetwork~Issue>}
Get Issue By Id
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
issueCID |
String
|
Promise.<TokensNetwork~Issue>
# async getIssueById(params) → {Promise.<TokensNetwork~Issue>}
Get Issue By Id
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
issueId |
Integer
|
Promise.<TokensNetwork~Issue>
# async getIssuesByAddress(address) → {Array.<number>}
Get Open Issues Available
Parameters:
Name | Type | Description |
---|---|---|
address |
Address
|
Array.<number>
# async getMergeById(params) → {Promise.<TokensNetwork~MergedIssue>}
Get votes, address and amounts for issue
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
issue_id |
number
|
|
merge_id |
number
|
Promise.<TokensNetwork~MergedIssue>
# async getOraclesByAddress(params) → {Promise.<number>}
Get Issue Id Info
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
address |
Address
|
Number of votes
Promise.<number>
# async getOraclesSummary(params) → {Integer|Array|Integer|Array|Address|Integer}
Get Oralces By Address
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
address |
Address
|
oraclesDelegatedByOthers
Integer
amounts
Array
|
Integer
addresses
Array
|
Address
tokensLocked
Integer
# async getTokensStaked() → {Promise.<number>}
Get Total Amount of Tokens Staked for Bounties in the Network
Promise.<number>
# getTransactionTokenAddress() → {Promise.<address>}
Get Transaction Token Address
Promise.<address>
# isApprovedSettlerToken(params) → {Promise.<number>}
Verify if Approved
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
amount |
number
|
|
address |
Address
|
Promise.<number>
# isApprovedTransactionalToken(params) → {Promise.<number>}
Verify if Approved
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
amount |
number
|
|
address |
Address
|
Promise.<number>
# async isCouncil(params) → {Promise.<address>}
Verify if Address is Council
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
address |
number
|
Promise.<address>
# isIssueInDraft(params) → {Promise.<boolean>}
Verify if Issue is still in Draft Mode (Available to use the redeemIssue Action)
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
issueId |
number
|
Promise.<boolean>
# isMergeDisputed(params) → {Promise.<boolean>}
Verify if Merge is disputed (i.e. was rejected by the network holders)
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
issueId |
number
|
|
mergeId |
number
|
Promise.<boolean>
# lock(params) → {Promise.<TransactionObject>}
lock tokens for oracles
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
Tokens Amount has to be higher than 0
Error
Tokens not approve for tx, first use 'approveERC20'
Error
Promise.<TransactionObject>
# openIssue(params) → {Promise.<TransactionObject>}
open Issue
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
tokenAmount |
number
|
|
cid |
String
|
Tokens Amount has to be higher than 0
Error
Tokens not approve for tx, first use 'approveERC20'
Error
Promise.<TransactionObject>
# async percentageNeededForApprove() → {Promise.<number>}
Get Amount of Needed for Approve
Promise.<number>
# async percentageNeededForDispute() → {Promise.<number>}
Get Amount of % Needed for Dispute
Promise.<number>
# async percentageNeededForMerge() → {Promise.<number>}
Get Amount of Needed for Merge
Promise.<number>
# proposeIssueMerge(params) → {Promise.<TransactionObject>}
Propose Merge of Issue
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
issueID |
number
|
|
prAddresses |
Array.<Address>
|
|
prAmounts |
Array.<number>
|
Promise.<TransactionObject>
# recognizeAsFinished(params) → {Promise.<TransactionObject>}
Recognize Issue as Resolved
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
issueId |
Number
|
Promise.<TransactionObject>
# redeemIssue(params) → {Promise.<TransactionObject>}
redeem Issue
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
issueId |
number
|
Promise.<TransactionObject>
# unlock(params) → {Promise.<TransactionObject>}
Unlock Tokens for oracles
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
Tokens Amount has to be higher than 0
Error
Promise.<TransactionObject>
# updateIssue(params) → {Promise.<TransactionObject>}
open Issue
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
|
issueID |
number
|
|
tokenAmount |
number
|
|
address |
address
|
Promise.<TransactionObject>
# async votesStaked() → {Promise.<number>}
Get Total Amount of Tokens Staked in the network
Promise.<number>
Type Definitions
Object
# Options
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
test |
Boolean
|
|||
localtest |
Boolean
|
ganache local blockchain |
||
web3Connection |
Web3Connection
|
<optional> |
Web3Connection | created from params: 'test', 'localtest' and optional 'web3Connection' string and 'privateKey' |
contractAddress |
string
|
<optional> |