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

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

    • _description: string

      description of the poll

    • _voteLength: number

      length of the voting in seconds

    • options: number[]

      available options

    Returns Promise<TransactionReceipt<any>>

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

    Parameters

    • deployOptions: DeployOptions
    • Optional account: Account

    Returns Promise<TransactionReceipt<any>>

  • deployJsonAbi(_token: string): Promise<TransactionReceipt<any>>
  • endPoll(_pollID: number): Promise<TransactionReceipt<any>>
  • getLockedAmount(_voter: string): Promise<string>
  • 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): Promise<TransactionReceipt<any>>
  • Interact with, or change a value of, a property on the contract

    Parameters

    • method: ContractSendMethod
    • Optional value: any

    Returns Promise<TransactionReceipt<any>>

  • sendUnsignedTx(method: ContractSendMethod, value?: any, __namedParameters?: Partial<Web3ConnectionOptions>): Promise<TransactionReceipt<any>>
  • stakeVotingTokens(_numTokens: number): Promise<TransactionReceipt<any>>
  • start(): Promise<void>
  • userHasVoted(_pollID: number, _user: string): Promise<boolean>
  • withdrawTokens(_numTokens: number): Promise<TransactionReceipt<any>>

Generated using TypeDoc