@eosdt/eosdt-js
v1.3.6
Published
JS library to execute EOSDT contracts methods
Downloads
48
Readme
EOSDT JS
A JavaScript library to execute EOSDT contracts methods.
Usage
Install the module using NPM:
$ npm install @eosdt/eosdt-js
Use service module Connector
to initiate one of functional modules. Connector
uses EOS node address and an array of private keys. Transactions would be signed with given keys and sent to blockchain through given node.
const { EosdtConnector } = require("@eosdt/eosdt-js")
const nodeAddress = "http://node-address.example.com:80"
const connector = new EosdtConnector(nodeAddress, ["private-key-1", "private-key-2"])
const eosPositions = connector.getPositions()
const eosLiquidator = connector.getLiquidator()
const pbtcPositions = connector.getBasicPositions("PBTC")
const pbtcLiquidator = connector.getLiquidator("PBTC")
const pethPositions = connector.getBasicPositions("PETH")
const pethLiquidator = connector.getLiquidator("PETH")
const governance = connector.getGovernance()
const balances = connector.getBalances()
const savings = connector.getSavingsRate()
Fore more code examples, checkout examples
folder.
Modules documentation
ITrxParamsArgument
| Property | Type | Description | | --------------- | ------------------- | ----------------------------------------------------------------- | | [permission] | string | Name of permission, active is used by default | | [blocksBehind] | number | Default value is 3 | | [expireSeconds] | number | Default value is 60 |
Classes
ArmContract
Kind: global class
armContract.armEos(accountName, amount, arm, [transactionParams]) ⇒ Promise
Kind: instance method of ArmContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------ | | accountName | string | name of account that sends EOS and receives position | | amount | number | string | transferred amount of EOS | | arm | number | arm value. With arm = 2.1 and 100 EOS user will receive position with 210 EOS | | [transactionParams] | object | see ITrxParamsArgument |
armContract.armExistingEosPosition(owner, positionId, arm, [transactionParams]) ⇒ Promise
Kind: instance method of ArmContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------- | ------------------------------------------------------------------------------------ | | owner | string | name of position maker account | | positionId | number | | | arm | number | arm value. With arm = 2.1 and 100 EOS user will receive position with 210 EOS | | [transactionParams] | object | see ITrxParamsArgument |
armContract.dearmEosPosition(owner, positionId, debtTarget, [transactionParams]) ⇒ Promise
Kind: instance method of ArmContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------- | ---------------------------------------------------------------------------- | | owner | string | name of maker account | | positionId | number | | | debtTarget | number | approximate desired debt amount | | [transactionParams] | object | see ITrxParamsArgument |
armContract.getSettings() ⇒ Promise.<object>
Kind: instance method of ArmContract
Returns: Promise.<object> - Positions contract settings
BalanceGetter
Kind: global class
- BalanceGetter
- new BalanceGetter(connector)
- .getEos(account) ⇒ Promise.<number>
- .getEosdt(account) ⇒ Promise.<number>
- .getNut(account) ⇒ Promise.<number>
- .getPbtc(account) ⇒ Promise.<number>
- .getPeth(account) ⇒ Promise.<number>
new BalanceGetter(connector)
| Param | Description | | --------- | -------------------------------------------------------------------------- | | connector | EosdtConnector (see README section Usage) |
balanceGetter.getEos(account) ⇒ Promise.<number>
Kind: instance method of BalanceGetter
Returns: Promise.<number> - EOS balance of account
| Param | Type | Description | | ------- | ------------------- | ------------------- | | account | string | Account name |
balanceGetter.getEosdt(account) ⇒ Promise.<number>
Kind: instance method of BalanceGetter
Returns: Promise.<number> - EOSDT balance of account
| Param | Type | Description | | ------- | ------------------- | ------------------- | | account | string | Account name |
balanceGetter.getNut(account) ⇒ Promise.<number>
Kind: instance method of BalanceGetter
Returns: Promise.<number> - NUT balance of account
| Param | Type | Description | | ------- | ------------------- | ------------------- | | account | string | Account name |
balanceGetter.getPbtc(account) ⇒ Promise.<number>
Kind: instance method of BalanceGetter
Returns: Promise.<number> - PBTC balance of account
| Param | Type | Description | | ------- | ------------------- | ------------------- | | account | string | Account name |
balanceGetter.getPeth(account) ⇒ Promise.<number>
Kind: instance method of BalanceGetter
Returns: Promise.<number> - PETH balance of account
| Param | Type | Description | | ------- | ------------------- | ------------------- | | account | string | Account name |
BasicPositionsContract
Kind: global class
- BasicPositionsContract
- new BasicPositionsContract(connector, tokenSymbol)
- .newPosition(accountName, collatAmount, eosdtAmount, [transactionParams]) ⇒ Promise
- .newEmptyPosition(maker, [transactionParams])
- .give(giverAccount, receiver, positionId, [transactionParams]) ⇒ Promise
- .addCollateral(senderName, amount, positionId, [transactionParams]) ⇒ Promise
- .deleteCollateral(senderName, amount, positionId, [transactionParams]) ⇒ Promise
- .generateDebt(senderName, amount, positionId, [transactionParams]) ⇒ Promise
- .burnbackDebt(senderName, amount, positionId, [transactionParams]) ⇒ Promise
- .addCollatAndDebt(senderName, addedCollatAmount, generatedDebtAmount, positionId, [transactionParams]) ⇒ Promise
- .pbtcDelCollatAndRedeem(senderName, amount, positionId, btcAddress, [transactionParams]) ⇒ Promise
- .marginCall(senderName, positionId, [transactionParams]) ⇒ Promise
- .del(creator, positionId, [transactionParams]) ⇒ Promise
- .paybackAndDelete(maker, debtAmount, positionId, [transactionParams]) ⇒ Promise
- .close(senderAccount, positionId, [transactionParams]) ⇒ Promise
- .getContractTokenBalance() ⇒ Promise.<number>
- .getRates() ⇒ Promise.<Array.<object>>
- .getRatesNew() ⇒ Promise.<Array.<object>>
- .getLtvRatiosTable() ⇒ Promise.<Array.<object>>
- .getPositionLtvRatio(id) ⇒ Promise.<(object|undefined)>
- .getPositionById(id) ⇒ Promise.<(object|undefined)>
- .getPositionByMaker(maker) ⇒ Promise.<(object|undefined)>
- .getAllUserPositions(maker) ⇒ Promise.<Array.<object>>
- .getAllPositions() ⇒ Promise.<Array.<object>>
- .getLatestUserPosition(accountName) ⇒ Promise.<(object|undefined)>
- .getParameters() ⇒ Promise.<object>
- .getSettings() ⇒ Promise.<object>
new BasicPositionsContract(connector, tokenSymbol)
| Param | Type | Description | | ----------- | ------------------- | -------------------------------------------------------------------------- | | connector | | EosdtConnector (see README section Usage) | | tokenSymbol | string | "PBTC" or "PETH" |
basicPositionsContract.newPosition(accountName, collatAmount, eosdtAmount, [transactionParams]) ⇒ Promise
Kind: instance method of BasicPositionsContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------------------------------ | ---------------------------------------------------------------------------- | | accountName | string | Creator's account name | | collatAmount | string | number | Amount of collateral tokens to transfer to position | | eosdtAmount | string | number | EOSDT amount to issue | | [transactionParams] | object | see ITrxParamsArgument |
basicPositionsContract.newEmptyPosition(maker, [transactionParams])
Kind: instance method of BasicPositionsContract
| Param | Type | Description | | ------------------- | ------------------- | ---------------------------------------------------------------------------- | | maker | string | Account to create position for | | [transactionParams] | object | see ITrxParamsArgument |
basicPositionsContract.give(giverAccount, receiver, positionId, [transactionParams]) ⇒ Promise
Kind: instance method of BasicPositionsContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------- | ---------------------------------------------------------------------------- | | giverAccount | string | Account name | | receiver | string | Account name | | positionId | number | | | [transactionParams] | object | see ITrxParamsArgument |
basicPositionsContract.addCollateral(senderName, amount, positionId, [transactionParams]) ⇒ Promise
Kind: instance method of BasicPositionsContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------------------------------ | ---------------------------------------------------------------------------- | | senderName | string | Account name | | amount | string | number | Amount of added collateral | | positionId | number | | | [transactionParams] | object | see ITrxParamsArgument |
basicPositionsContract.deleteCollateral(senderName, amount, positionId, [transactionParams]) ⇒ Promise
Kind: instance method of BasicPositionsContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------------------------------ | ---------------------------------------------------------------------------- | | senderName | string | Account name | | amount | string | number | | | positionId | number | | | [transactionParams] | object | see ITrxParamsArgument |
basicPositionsContract.generateDebt(senderName, amount, positionId, [transactionParams]) ⇒ Promise
Kind: instance method of BasicPositionsContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------------------------------ | ---------------------------------------------------------------------------- | | senderName | string | Account name | | amount | string | number | Not more than 4 significant decimals | | positionId | number | | | [transactionParams] | object | see ITrxParamsArgument |
basicPositionsContract.burnbackDebt(senderName, amount, positionId, [transactionParams]) ⇒ Promise
Kind: instance method of BasicPositionsContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------------------------------ | ---------------------------------------------------------------------------- | | senderName | string | Account name | | amount | string | number | Not more than 4 significant decimals | | positionId | number | | | [transactionParams] | object | see ITrxParamsArgument |
basicPositionsContract.addCollatAndDebt(senderName, addedCollatAmount, generatedDebtAmount, positionId, [transactionParams]) ⇒ Promise
Kind: instance method of BasicPositionsContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------------------------------ | ---------------------------------------------------------------------------- | | senderName | string | Account name | | addedCollatAmount | string | number | | | generatedDebtAmount | string | number | | | positionId | number | | | [transactionParams] | object | see ITrxParamsArgument |
basicPositionsContract.pbtcDelCollatAndRedeem(senderName, amount, positionId, btcAddress, [transactionParams]) ⇒ Promise
Kind: instance method of BasicPositionsContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------------------------------ | ---------------------------------------------------------------------------- | | senderName | string | Account name | | amount | string | number | | | positionId | number | | | btcAddress | string | | | [transactionParams] | object | see ITrxParamsArgument |
basicPositionsContract.marginCall(senderName, positionId, [transactionParams]) ⇒ Promise
Kind: instance method of BasicPositionsContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------- | ---------------------------------------------------------------------------- | | senderName | string | Account name | | positionId | number | | | [transactionParams] | object | see ITrxParamsArgument |
basicPositionsContract.del(creator, positionId, [transactionParams]) ⇒ Promise
Kind: instance method of BasicPositionsContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------- | ---------------------------------------------------------------------------- | | creator | string | Account name | | positionId | number | | | [transactionParams] | object | see ITrxParamsArgument |
basicPositionsContract.paybackAndDelete(maker, debtAmount, positionId, [transactionParams]) ⇒ Promise
Kind: instance method of BasicPositionsContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------------------------------ | ---------------------------------------------------------------------------- | | maker | string | Account name | | debtAmount | string | number | Must be > than position debt | | positionId | number | | | [transactionParams] | object | see ITrxParamsArgument |
basicPositionsContract.close(senderAccount, positionId, [transactionParams]) ⇒ Promise
Kind: instance method of BasicPositionsContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------- | ---------------------------------------------------------------------------- | | senderAccount | string | Account name | | positionId | number | | | [transactionParams] | object | see ITrxParamsArgument |
basicPositionsContract.getContractTokenBalance() ⇒ Promise.<number>
Kind: instance method of BasicPositionsContract
Returns: Promise.<number> - Contract's collateral asset balance.
basicPositionsContract.getRates() ⇒ Promise.<Array.<object>>
Kind: instance method of BasicPositionsContract
Returns: Promise.<Array.<object>> - Table of current system token prices (contract
'pricefeed.eq' - table 'oraclerates'). These are valid rates, except fields
'backend_price' and 'backend_update' are missing
basicPositionsContract.getRatesNew() ⇒ Promise.<Array.<object>>
Kind: instance method of BasicPositionsContract
Returns: Promise.<Array.<object>> - Table of current system token prices (contract
'pricefeed.eq' - table 'newrates'). These are valid rates including all rates data
basicPositionsContract.getLtvRatiosTable() ⇒ Promise.<Array.<object>>
Kind: instance method of BasicPositionsContract
Returns: Promise.<Array.<object>> - Table of current LTV ratios for all positions.
basicPositionsContract.getPositionLtvRatio(id) ⇒ Promise.<(object|undefined)>
Kind: instance method of BasicPositionsContract
Returns: Promise.<(object|undefined)> - Current LTV ratio for position by id
| Param | Type | Description | | ----- | ------------------- | ------------------ | | id | number | Position id |
basicPositionsContract.getPositionById(id) ⇒ Promise.<(object|undefined)>
Kind: instance method of BasicPositionsContract
Returns: Promise.<(object|undefined)> - A position object
| Param | Type | Description | | ----- | ------------------- | ------------------ | | id | number | Position id |
basicPositionsContract.getPositionByMaker(maker) ⇒ Promise.<(object|undefined)>
Kind: instance method of BasicPositionsContract
Returns: Promise.<(object|undefined)> - Position object - first position that belongs to
maker account
| Param | Type | Description | | ----- | ------------------- | ------------------- | | maker | string | Account name |
basicPositionsContract.getAllUserPositions(maker) ⇒ Promise.<Array.<object>>
Kind: instance method of BasicPositionsContract
Returns: Promise.<Array.<object>> - Array of all positions objects, created by the maker
| Param | Type | Description | | ----- | ------------------- | ------------------- | | maker | string | Account name |
basicPositionsContract.getAllPositions() ⇒ Promise.<Array.<object>>
Kind: instance method of BasicPositionsContract
Returns: Promise.<Array.<object>> - An array of all positions created on this contract
basicPositionsContract.getLatestUserPosition(accountName) ⇒ Promise.<(object|undefined)>
Kind: instance method of BasicPositionsContract
Returns: Promise.<(object|undefined)> - Position object - position of the account with
maximum id value
| Param | Type | | ----------- | ------------------- | | accountName | string |
basicPositionsContract.getParameters() ⇒ Promise.<object>
Kind: instance method of BasicPositionsContract
Returns: Promise.<object> - Positions contract parameters
basicPositionsContract.getSettings() ⇒ Promise.<object>
Kind: instance method of BasicPositionsContract
Returns: Promise.<object> - Positions contract settings
BpManager
Kind: global class
- BpManager
- new BpManager(connector)
- .getAllBpPositions() ⇒ Promise.<Array.<object>>
- .getBpPosition() ⇒ Promise.<(object|undefined)>
- .registerBlockProducer(bpName, depositedAmount, [transactionParams]) ⇒ Promise
- .changeBlockProducerReward(bpName, rewardAmount, [transactionParams]) ⇒ Promise
- .unregisterBlockProducer(bpName, [transactionParams]) ⇒ Promise
- .depositEos(fromAccount, bpName, eosAmount, [transactionParams]) ⇒ Promise
new BpManager(connector)
| Param | Description | | --------- | -------------------------------------------------------------------------- | | connector | EosdtConnector (see README section Usage) |
bpManager.getAllBpPositions() ⇒ Promise.<Array.<object>>
Kind: instance method of BpManager
Returns: Promise.<Array.<object>> - An array of objects, that contain information about
registered block producers
bpManager.getBpPosition() ⇒ Promise.<(object|undefined)>
Kind: instance method of BpManager
Returns: Promise.<(object|undefined)> - Object with information about a registered block
producer
bpManager.registerBlockProducer(bpName, depositedAmount, [transactionParams]) ⇒ Promise
Kind: instance method of BpManager
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------- | ---------------------------------------------------------------------------- | | bpName | string | Account name | | depositedAmount | number | EOS amount to transfer | | [transactionParams] | object | see ITrxParamsArgument |
bpManager.changeBlockProducerReward(bpName, rewardAmount, [transactionParams]) ⇒ Promise
Kind: instance method of BpManager
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------- | ---------------------------------------------------------------------------- | | bpName | string | Account name | | rewardAmount | number | | | [transactionParams] | object | see ITrxParamsArgument |
bpManager.unregisterBlockProducer(bpName, [transactionParams]) ⇒ Promise
Kind: instance method of BpManager
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------- | ---------------------------------------------------------------------------- | | bpName | string | Account name | | [transactionParams] | object | see ITrxParamsArgument |
bpManager.depositEos(fromAccount, bpName, eosAmount, [transactionParams]) ⇒ Promise
Kind: instance method of BpManager
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------------------------------ | ---------------------------------------------------------------------------- | | fromAccount | string | Paying account name | | bpName | string | | | eosAmount | number | string | | | [transactionParams] | object | see ITrxParamsArgument |
EosdtConnector
Kind: global class
new EosdtConnector(nodeAddress, privateKeys)
| Param | Type | Description | | ----------- | --------------------------------- | -------------------------------------------------------- | | nodeAddress | string | URL of blockchain node, used to send transactions | | privateKeys | Array.<string> | Array of private keys used to sign transactions |
eosdtConnector.getBasicPositions(collateralToken) ⇒
Kind: instance method of EosdtConnector
Returns: Instance of BasicPositionsContract
| Param | Type | Description | | --------------- | ------------------- | ------------------------------------------- | | collateralToken | string | "PBTC" or "PETH" |
eosdtConnector.getPositions()
Kind: instance method of EosdtConnector
eosdtConnector.getLiquidator([collateralToken]) ⇒
Kind: instance method of EosdtConnector
Returns: Instance of LiquidatorContract
| Param | Type | Default | Description | | ----------------- | ------------------- | ---------------------------- | ------------------------------------------------------------ | | [collateralToken] | string | "EOS" | "EOS", "PBTC" or "PETH" |
eosdtConnector.getSavingsRateCont() ⇒
Kind: instance method of EosdtConnector
Returns: Instance of SavingsRateContract
eosdtConnector.getArmContract() ⇒
Kind: instance method of EosdtConnector
Returns: Instance of ArmContract
eosdtConnector.getTokenSwapContract() ⇒
Kind: instance method of EosdtConnector
Returns: Instance of TokenSwapContract
eosdtConnector.getGovernance() ⇒
Kind: instance method of EosdtConnector
Returns: Instance of GovernanceContract
eosdtConnector.getBalances() ⇒
Kind: instance method of EosdtConnector
Returns: Instance of BalanceGetter
GovernanceContract
Kind: global class
- GovernanceContract
- new GovernanceContract(connector)
- .propose(proposal, senderName, [transactionParams]) ⇒ Promise
- .expire(proposalName, senderName, [transactionParams]) ⇒ Promise
- .applyChanges(proposalName, senderName, [transactionParams]) ⇒ Promise
- .cleanProposal(proposalName, deletedVotes, senderName, [transactionParams]) ⇒ Promise
- .stake(senderName, nutsAmount, [trxMemo], [transactionParams]) ⇒ Promise
- .unstake(nutAmount, voterName, [transactionParams]) ⇒ Promise
- .vote(proposalName, vote, voterName, voteJson, [transactionParams]) ⇒ Promise
- .unvote(proposalName, voterName, [transactionParams]) ⇒ Promise
- .voteForBlockProducers(voterName, producers, [transactionParams]) ⇒ Promise
- .stakeAndVoteForBlockProducers(voterName, nutAmount, producers, [transactionParams]) ⇒ Promise
- .getVoterInfo() ⇒ Promise.<(object|undefined)>
- .getVoterInfosTable() ⇒ Promise.<Array.<object>>
- .getVotes() ⇒ Promise.<Array.<object>>
- .getVotesForAccount() ⇒ Promise.<Array.<object>>
- .getProposals() ⇒ Promise.<Array.<object>>
- .getBpVotes() ⇒ Promise.<Array.<object>>
- .getProxyInfo() ⇒ Promise.<(object|undefined)>
- .getSettings() ⇒ Promise.<object>
- .getParameters() ⇒ Promise.<object>
new GovernanceContract(connector)
| Param | Description | | --------- | -------------------------------------------------------------------------- | | connector | EosdtConnector (see README section Usage) |
governanceContract.propose(proposal, senderName, [transactionParams]) ⇒ Promise
Kind: instance method of GovernanceContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------- | ---------------------------------------------------------------------------- | | proposal | object | | | proposal.proposer | string | | | proposal.name | string | | | proposal.title | string | | | proposal.json | string | | | proposal.expiresAt | Date | | | proposal.type | number | | | senderName | string | | | [transactionParams] | object | see ITrxParamsArgument |
governanceContract.expire(proposalName, senderName, [transactionParams]) ⇒ Promise
Kind: instance method of GovernanceContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------- | ---------------------------------------------------------------------------- | | proposalName | string | | | senderName | string | | | [transactionParams] | object | see ITrxParamsArgument |
governanceContract.applyChanges(proposalName, senderName, [transactionParams]) ⇒ Promise
Kind: instance method of GovernanceContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------- | ---------------------------------------------------------------------------- | | proposalName | string | | | senderName | string | | | [transactionParams] | object | see ITrxParamsArgument |
governanceContract.cleanProposal(proposalName, deletedVotes, senderName, [transactionParams]) ⇒ Promise
Kind: instance method of GovernanceContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------- | ---------------------------------------------------------------------------- | | proposalName | string | | | deletedVotes | number | | | senderName | string | | | [transactionParams] | object | see ITrxParamsArgument |
governanceContract.stake(senderName, nutsAmount, [trxMemo], [transactionParams]) ⇒ Promise
Kind: instance method of GovernanceContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------------------------------ | ---------------------------------------------------------------------------- | | senderName | string | | | nutsAmount | string | number | | | [trxMemo] | string | | | [transactionParams] | object | see ITrxParamsArgument |
governanceContract.unstake(nutAmount, voterName, [transactionParams]) ⇒ Promise
Kind: instance method of GovernanceContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------------------------------ | ---------------------------------------------------------------------------- | | nutAmount | string | number | | | voterName | string | | | [transactionParams] | object | see ITrxParamsArgument |
governanceContract.vote(proposalName, vote, voterName, voteJson, [transactionParams]) ⇒ Promise
Kind: instance method of GovernanceContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------- | --------------------------------------------------------------------------------------------------- | | proposalName | string | | | vote | number | Vote 1 as "yes", 0 or any other number as "no" | | voterName | string | | | voteJson | string | | | [transactionParams] | object | see ITrxParamsArgument |
governanceContract.unvote(proposalName, voterName, [transactionParams]) ⇒ Promise
Kind: instance method of GovernanceContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------- | ---------------------------------------------------------------------------- | | proposalName | string | | | voterName | string | | | [transactionParams] | object | see ITrxParamsArgument |
governanceContract.voteForBlockProducers(voterName, producers, [transactionParams]) ⇒ Promise
Kind: instance method of GovernanceContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | --------------------------------- | ---------------------------------------------------------------------------- | | voterName | string | | | producers | Array.<string> | | | [transactionParams] | object | see ITrxParamsArgument |
governanceContract.stakeAndVoteForBlockProducers(voterName, nutAmount, producers, [transactionParams]) ⇒ Promise
Kind: instance method of GovernanceContract
Returns: Promise - Promise of transaction receipt
| Param | Type | Description | | ------------------- | ------------------------------------------ | ---------------------------------------------------------------------------- | | voterName | string | | | nutAmount | string | number | | | producers | Array.<string> | | | [transactionParams] | object | see ITrxParamsArgument |
governanceContract.getVoterInfo() ⇒ Promise.<(object|undefined)>
Kind: instance method of GovernanceContract
Returns: Promise.<(object|undefined)> - Amount of NUTs staked by account in Governance
contract and their unstake date
governanceContract.getVoterInfosTable() ⇒ Promise.<Array.<object>>
Kind: instance method of GovernanceContract
Returns: Promise.<Array.<object>> - Table of information on accounts that staked NUT
governanceContract.getVotes() ⇒ Promise.<Array.<object>>
Kind: instance method of GovernanceContract
Returns: Promise.<Array.<object>> - An array with all Governance contract votes (up to 10000)
governanceContract.getVotesForAccount() ⇒ Promise.<Array.<object>>
Kind: instance method of GovernanceContract
Returns: Promise.<Array.<object>> - All account votes
governanceContract.getProposals() ⇒ Promise.<Array.<object>>
Kind: instance method of GovernanceContract
Returns: Promise.<Array.<object>> - An array with all Governance contract proposals (up to 10000)
governanceContract.getBpVotes() ⇒ Promise.<Array.<object>>
Kind: instance method of GovernanceContract
Returns: Promise.<Array.<object>> - Array of objects, containing block producers names and
amount of NUT votes for them
governanceContract.getProxyInfo() ⇒ Promise.<(object|undefined)>
Kind: instance method of GovernanceContract
Returns: Promise.<(object|undefined)> - Voter info for eosdtbpproxy
governanceContract.getSettings() ⇒ Promise.<object>
Kind: instance method of GovernanceContract
Returns: Promise.<object> - Governance contract settings
<a name="GovernanceContract+getParameters"