Options
All
  • Public
  • Public/Protected
  • All
Menu

Module common/contract

Index

Functions

buy

  • buy(contractAddress: string, web3: Web3ReactContextInterface, vote: Vote, price: BN): Promise<void>
  • Purchase shares

    Parameters

    • contractAddress: string

      Address of the contract

    • web3: Web3ReactContextInterface

      Web3 instance

    • vote: Vote

      Yes or No

    • price: BN

      Total price of shares to buy

    Returns Promise<void>

getAllContractInfo

  • getAllContractInfo(contractAddresses: string[]): Promise<ContractI[]>
  • Obtains information on all contracts with an address in contractAddress

    Parameters

    • contractAddresses: string[]

      Addresses of all the contracts

    Returns Promise<ContractI[]>

    Promise of all contract information

getContractInfo

  • getContractInfo(contractAddress: string): Promise<ContractI>
  • Obtains information on the contract with address contractAddress

    Parameters

    • contractAddress: string

      Address of contract

    Returns Promise<ContractI>

    Promise of information on the contract

getCurrentVotes

  • getCurrentVotes(contractAddress: string, web3: Web3ReactContextInterface): Promise<VotesPerPerson>
  • Obtains number of votes for Yes and No

    Parameters

    • contractAddress: string

      Address of the contract

    • web3: Web3ReactContextInterface

      Web3 instance

    Returns Promise<VotesPerPerson>

    Number of Yes and No votes

getHoldings

  • getHoldings(contractAddresses: string[], web3: Web3ReactContextInterface): Promise<MarketRecord[]>
  • Retrieves information for the markets

    Parameters

    • contractAddresses: string[]

      The contract address

    • web3: Web3ReactContextInterface

      Web3 instance

    Returns Promise<MarketRecord[]>

    Promise of all information for many markets

withdraw

  • withdraw(contractAddress: string, web3: Web3ReactContextInterface): Promise<void>
  • Withdraw winning shares

    Parameters

    • contractAddress: string

      Address of the contract

    • web3: Web3ReactContextInterface

      Web3 instance

    Returns Promise<void>

Generated using TypeDoc