Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Implements

Index

Constructors

Properties

_contract: Web3Contract<VotableMethods, any>
_erc20: ERC20
abi: AbiItem[]
contractAddress?: string
erc20TokenAddress?: string

Accessors

  • get account(): Account
  • Returns the Account associated with this connection

    Returns Account

  • get web3(): default
  • Returns the Web3 class assigned to this connection

    Returns default

Methods

  • callTx<ReturnData>(method: ContractCallMethod<ReturnData>, value?: any): Promise<ReturnData>
  • castVote(_pollID: number, _voteId: number): Promise<TransactionReceipt>
  • connect(): Promise<boolean>
  • createPoll(_description: string, _voteLength: number, options: number[]): Promise<TransactionReceipt>
  • Parameters

    • _description: string

      description of the poll

    • _voteLength: number

      length of the voting in seconds

    • options: number[]

      available options

    Returns Promise<TransactionReceipt>

  • deploy(deployOptions: DeployOptions, account?: Account): Promise<TransactionReceipt>
  • Deploy the loaded abi contract

    Parameters

    • deployOptions: DeployOptions
    • Optional account: Account

    Returns Promise<TransactionReceipt>

  • deployJsonAbi(_token: string): Promise<TransactionReceipt>
  • endPoll(_pollID: number): Promise<TransactionReceipt>
  • getLockedAmount(_voter: string): Promise<number>
  • getPollHistory(_voter: string): Promise<number[]>
  • getPollInfoForVoter(_pollID: number, _voter: string): Promise<VoterInfo>
  • getPollOptionById(_pollID: number, id: number): Promise<number>
  • getPoolInformation(_pollID: number): Promise<{ _id: number; creator: string; description: string; expirationTime: number; optionsSize: number; status: undefined; voters: string[] }>
  • Parameters

    • _pollID: number

    Returns Promise<{ _id: number; creator: string; description: string; expirationTime: number; optionsSize: number; status: undefined; voters: string[] }>

  • getPoolWinner(_pollID: number): Promise<{ optionId: number; winnerId: number }>
  • getTokenStake(_voter: string): Promise<number>
  • loadAbi(): void
  • loadContract(): Promise<void>
  • pollCount(): Promise<number>
  • polls(v1: number): Promise<{ 0: string; 1: undefined; 2: number; 3: string; 4: number; 5: number }>
  • Parameters

    • v1: number

    Returns Promise<{ 0: string; 1: undefined; 2: number; 3: string; 4: number; 5: number }>

  • sendTx(method: ContractSendMethod, value?: any, debug?: undefined | boolean): Promise<TransactionReceipt>
  • Interact with, or change a value of, a property on the contract

    Parameters

    • method: ContractSendMethod
    • Optional value: any
    • debug: undefined | boolean = ...

    Returns Promise<TransactionReceipt>

  • sendUnsignedTx(method: ContractSendMethod, value?: any, debug?: boolean): Promise<TransactionReceipt>
  • Send unsigned transaction

    Parameters

    • method: ContractSendMethod
    • Optional value: any
    • Optional debug: boolean

    Returns Promise<TransactionReceipt>

  • stakeVotingTokens(_numTokens: number): Promise<TransactionReceipt>
  • start(): Promise<void>
  • userHasVoted(_pollID: number, _user: string): Promise<boolean>
  • withdrawTokens(_numTokens: number): Promise<TransactionReceipt>

Generated using TypeDoc