GovBlocks Master

Functions

getdAppInstance

1
gbmaster.getdAppInstance(dAppName,callback)
Copied!
Get the instance of dApp
For accessing dApp specific smart contract calls user needs to create an instance of dApp modules, It is a JSON of dApp modules. Governance : Consists of decision making process and locking related function calls. MemberData : Consists of all functions related to member roles and member specific data. ProposalData : Consists of functions required to fetch Proposal and Solution data. CategoryData : Consists of all functions related to category and sub category data.
Arguments:
1
dAppName : Name of the dApp
Copied!
Returns:
1
{
2
dAppName : Name of the dApp
3
governance : Govenance modules instance
4
memberData : Member Data Instance
5
proposalData : Proposal Data Instance
6
categoryData : Category Data Instance
7
}
Copied!

dApp Details

getdAppMasterAddress

1
getdAppMasterAddress(dAppName,callback)
Copied!
Get the master contract address of dApp
Arguments:
1
dAppName
Copied!
Returns:
1
Master contract address
Copied!

getdAppDetails

1
gbmaster.getdAppDetails(dAppName,callback)
Copied!
Gets all dApp details in an array
Arguments:
1
dAppName
Copied!
Returns:
1
dAppName
2
masterAddress
3
tokenAddress
4
byteCode hash
5
abi hash
6
versionLength
7
description hash
Copied!

getdAppDetailsByAddress

1
gbmaster.getdAppDetailsByAddress(address,callback)
Copied!
Get the dApp details by passing its master contract address or token address
Arguments:
1
address
Copied!
Returns:
1
dAppName
2
masterAddress
3
tokenAddress
Copied!

getdAppContractAddresses

1
gbmaster.getdAppContractAddresses(dAppName,callback)
Copied!
Get the latest version smart contract addresses of the dApp
Arguments:
1
dAppName
Copied!
Returns:
1
Array of smart contract addresses
Copied!

isdAppValid

1
gbmaster.isdAppValid(dAppName,callback)
Copied!
Checks if dApp has valid contract addresses
Arguments:
1
dAppName
Copied!
Returns:
1
Whether dApp has valid contract addresses
Copied!

isContractActive

1
gbmaster.isContractActive(dAppName,contractAddress,callback)
Copied!
Checks if contract address is active
Arguments:
1
dAppName
2
contractAddress
Copied!
Returns:
1
Whether contract address is active
Copied!

activateDapp

1
gbmaster.activateDapp(dAppName,contractAddresses,callback)
Copied!
Activate dApp master by providing an array of contract addresses
Arguments:
1
dAppName
2
contractAddresses array :[GovernanceData,MemberRoles,ProposalCategory,SimpleVoting,Governance,Pool]
Copied!
Returns:
1
Resulting transaction hash
Copied!

isMemberAuthorized

1
gbmaster.isMemberAuthorized(dAppName,memberAddress,callback)
Copied!
Check if member belongs to any role in dApp
Arguments:
1
dAppName
2
memberAddress
Copied!
Returns:
1
Whether member belongs to any role in dApp
Copied!

getGBmemberDetails

1
gbmaster.getGBmemberDetails(memberAddress,dAppName,callback)
Copied!
Get basic details of member in dApp
Arguments:
1
memberAddress
2
dAppName
Copied!
Returns:
1
[
2
memberReputation,
3
totalProposal,
4
proposalStake,
5
totalOption,
6
optionStake,
7
totalVotes
8
]
Copied!

Token Data

getdAppTokenDetails

1
gbmaster.getdAppTokenDetails(tokenAddress,callback)
Copied!
Get basic details of a token like name,price,symbol,decimals
Arguments:
1
tokenAddress
Copied!
Returns:
1
Array of Token Details
Copied!

getGBTaddress

1
gbmaster.getGBTaddress(callback)
Copied!
Method to fetch GovBlocks Standard Token
Returns:
1
GovBlocks Standard Token Address
Copied!

getdAppTokenAddress

1
getdAppTokenAddress(dAppName,callback)
Copied!
Get the token address of dApp
Arguments:
1
dAppName
Copied!
Returns:
1
Token Address
Copied!
If dApp doesn't have token address or its token doesn't supports locking, GovBlocks allows to create lockable token.

generateTokenAddress

1
gbmaster.generateTokenAddress(dAppName,tokenName,callback)
Copied!
Generate a lockable token for dApp
Arguments:
1
dAppName
2
tokenName
Copied!
Returns:
1
Resulting transaction hash
Copied!
If dApp has token that doesn't support locking ,newly created lockable token will be added as proxy to the existing token address

generateProxyToken

1
gbmaster.generateProxyToken(dAppName,dAppTokenAddress,callback)
Copied!
Generates a proxy for existing dApp token address
Arguments:
1
dAppName
2
dAppTokenAddress
Copied!
Returns:
1
Resultin transaction hash
Copied!

getdAppProxyToken

1
gbmaster.getdAppProxyToken(dAppName,callback)
Copied!
Get the proxy token added for dApp
Arguments:
1
dAppName
Copied!
Returns:
1
dApp Proxy token address
Copied!

getLockableTokenAddress

1
gbmaster.getLockableTokenAddress(dAppName,callback)
Copied!
Gets the address of lockable token created for the dApp
Arguments:
1
dAppName
Copied!
Returns:
1
Lockable token address
Copied!

getdAppTokenName

1
gbmaster.getdAppTokenName(dAppName,callback)
Copied!
Get the name of dApp token
Arguments:
1
dAppName
Copied!
Returns:
1
Token Name
Copied!

getTokenName

1
gbmaster.getTokenName(tokenAddress,callback)
Copied!
Get the name of token
Arguments:
1
tokenAddress
Copied!
Returns:
1
Token Name
Copied!

getGBTokenPrice

1
gbmaster.getGBTokenPrice(callback)
Copied!
Get current price of GovBlocks Token
Returns:
1
GovBlocks Token Price
Copied!

Balances

getGBTBalance_user

1
gbmaster.getGBTBalance_user(memberAddress,callback)
Copied!
Get GBT balance of an address
Arguments:
1
memberAddress
Copied!
Returns:
1
GBT balance
Copied!

getBalance_user

1
gbmaster.getBalance_user(memberAddress,dAppName,callback)
Copied!
Get dApp Token balance of member (assuming dApp is registered in GovBlocks)
Arguments:
1
memberAddress
2
dAppName
Copied!
Returns:
1
dApp Token Balance of member
Copied!

getBalance_pool

1
gbmaster.getBalance_pool(dAppName,callback)
Copied!
Get amount of GBT held by dApp pool
Arguments:
1
Arguments
Copied!
Returns:
1
Return parameters
Copied!

buyPoolGBT

1
gbmaster.buyPoolGBT(dAppName,amount,callback)
Copied!
Buy GBT for pool, for incentive distribution
Arguments:
1
dAppName
2
amount
Copied!
Returns:
1
Resulting transaction hash
Copied!

getBalance

1
gbmaster.getBalance(address,callback)
Copied!
Get ETH balance if any valid ethereum address (
Arguments:
1
address
Copied!
Returns:
1
ETH balance of address
Copied!

getPoolBalanceinETH

1
gbmaster.getPoolBalanceinETH(dAppName,callback)
Copied!
Get ETH balance of dApp pool
Arguments:
1
dAppName
Copied!
Returns:
1
ETH balance of dApp pool
Copied!

createHash

1
gbmaster.createHash(data,callback)
Copied!
Create IPFS hash of any data in text format
Arguments:
1
Data
Copied!
Returns:
1
IPFS hash
Copied!

hex_to_ascii

1
gbmaster.hex_to_ascii(hexCode)
Copied!
Basic function for converting hex code to proper ASCII value
Arguments:
1
HEX code
Copied!
Returns:
1
ASCII format of input HEX data
Copied!
Last modified 3yr ago