Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "smartcontract/nativevm/governanceContractTxBuilder"

Index

Variables

Const AUTHORIZE_INFO_POOL

AUTHORIZE_INFO_POOL: "voteInfoPool" = "voteInfoPool"

Const GLOBAL_PARAM

GLOBAL_PARAM: "globalParam" = "globalParam"

Const GOVERNANCE_CONTRACT

GOVERNANCE_CONTRACT: "0000000000000000000000000000000000000007" = "0000000000000000000000000000000000000007"

Const PEER_ATTRIBUTES

PEER_ATTRIBUTES: "peerAttributes" = "peerAttributes"

Const SPLIT_FEE_ADDRESS

SPLIT_FEE_ADDRESS: "splitFeeAddress" = "splitFeeAddress"

Const TOTAL_STAKE

TOTAL_STAKE: "totalStake" = "totalStake"

Const VBFT_CONFIG

VBFT_CONFIG: "vbftConfig" = "vbftConfig"

Const contractAddress

contractAddress: Address = new Address(GOVERNANCE_CONTRACT)

Functions

getAttributes

  • getAttributes(peerPubKey: string, url?: undefined | string): Promise<PeerAttributes>

getAuthorizeInfo

  • getAuthorizeInfo(peerPubKey: string, address: Address, url?: undefined | string): Promise<AuthorizeInfo>

getConfiguration

  • getConfiguration(url?: undefined | string): Promise<Configuration>

getGlobalParam

  • getGlobalParam(url?: undefined | string): Promise<GlobalParam>

getGovernanceView

  • getGovernanceView(url?: undefined | string): Promise<GovernanceView>

getPeerPoolMap

  • getPeerPoolMap(url?: undefined | string): Promise<any>

getPeerUnboundOng

  • getPeerUnboundOng(userAddr: Address, url?: undefined | string): Promise<number>

getSplitFeeAddress

getTotalStake

makeAddInitPosTx

  • makeAddInitPosTx(peerPubkey: string, userAddr: Address, pos: number, payer: Address, gasPrice: string, gasLimit: string): Transaction

makeApproveCandidateTx

  • makeApproveCandidateTx(peerPubKey: string, payer: Address, gasPrice: string, gasLimit: string): Transaction

makeAuthorizeForPeerTx

  • makeAuthorizeForPeerTx(userAddr: Address, peerPubKeyList: string[], posList: number[], payer: Address, gasPrice: string, gasLimit: string): Transaction

makeChangeAuthorizationTx

  • makeChangeAuthorizationTx(peerPubKey: string, userAddr: Address, maxAuthorize: number, payer: Address, gasPrice: string, gasLimit: string): Transaction

makeQuitNodeTx

makeReduceInitPosTx

  • makeReduceInitPosTx(peerPubkey: string, userAddr: Address, pos: number, payer: Address, gasPrice: string, gasLimit: string): Transaction

makeRegisterCandidateTx

  • makeRegisterCandidateTx(ontid: string, peerPubKey: string, keyNo: number, userAddr: Address, initPos: number, payer: Address, gasPrice: string, gasLimit: string): Transaction
  • Register to be candidate node. This tx needs signatures from userAddr and payer if these two address are not the same.

    Parameters

    • ontid: string

      user's ONT ID, must be assigned with the role.

    • peerPubKey: string

      public key of user's peer

    • keyNo: number

      user's pk id

    • userAddr: Address

      user's address to pledge ONT&ONG. This address must have enough ONT & ONG.

    • initPos: number

      Initial state

    • payer: Address

      Address to pay for the gas.

    • gasPrice: string

      Gas price

    • gasLimit: string

      Gas limit

    Returns Transaction

makeRejectCandidateTx

  • makeRejectCandidateTx(peerPubKey: string, payer: Address, gasPrice: string, gasLimit: string): Transaction

makeSetPeerCostTx

  • makeSetPeerCostTx(peerPubKey: string, userAddr: Address, peerCost: number, payer: Address, gasPrice: string, gasLimit: string): Transaction

makeUnauthorizeForPeerTx

  • makeUnauthorizeForPeerTx(userAddr: Address, peerPubKeyList: string[], posList: number[], payer: Address, gasPrice: string, gasLimit: string): Transaction

makeUnregisterCandidateTx

  • makeUnregisterCandidateTx(userAddr: Address, peerPubKey: string, payer: Address, gasPrice: string, gasLimit: string): Transaction

makeUnvoteForPeerTx

  • makeUnvoteForPeerTx(userAddr: Address, peerPubKeys: string[], posList: number[], payer: Address, gasPrice: string, gasLimit: string): Transaction

makeVoteForPeerTx

  • makeVoteForPeerTx(userAddr: Address, peerPubKeys: string[], posList: number[], payer: Address, gasPrice: string, gasLimit: string): Transaction
  • Creates transaction to vote for some peers. Can only vote for peers that with status 1 or 2 This tx needs signatures from userAddr and payer if these two address are not the same.

    Parameters

    • userAddr: Address

      User's address

    • peerPubKeys: string[]

      Public keys of peers that to be voted

    • posList: number[]

      Array of token that to vote

    • payer: Address

      Address to pay for transaction's gas.

    • gasPrice: string

      Gas price

    • gasLimit: string

      Gas limit

    Returns Transaction

makeWithdrawFeeTx

makeWithdrawPeerUnboundOngTx

makeWithdrawTx

  • makeWithdrawTx(userAddr: Address, peerPubKeys: string[], withdrawList: number[], payer: Address, gasPrice: string, gasLimit: string): Transaction

Generated using TypeDoc