import { EthApi } from "@joincivil/ethapi"; import { EthAddress, ListingWrapper, BigNumber, UserChallengeData, WrappedChallengeData, WrappedAppealChallengeID, WrappedChallengeID } from "@joincivil/typescript-types"; import { Observable } from "rxjs/Observable"; import { ContentProvider } from "../../content/contentprovider"; import { TwoStepEthTransaction } from "../../types"; import { BaseWrapper } from "../basewrapper"; import { CivilTCRContract } from "../generated/wrappers/civil_t_c_r"; import { MultisigProxyTransaction } from "../multisig/basemultisigproxy"; import { Council } from "./council"; import { CVLToken } from "./cvltoken"; import { Government } from "./government"; import { Listing } from "./listing"; import { Parameterizer } from "./parameterizer"; import { Voting } from "./voting"; import { TransactionConfig } from "web3-core"; /** * The CivilTCR tracks the status of addresses that have been applied and allows * users to make transactions that modify the state of the TCR. * * Users can get stream of currently approved addresses, as well as specific information * about individual listings (may or may not be approved) * * Users can also apply to the registry, challenge applications or listings, as well * as collect winnings related to challenges, or withdraw/deposit tokens from listings. * * NOTE: If instantiated with a multisig wallet, *all* transactions are proxied through multisig. */ export declare class CivilTCR extends BaseWrapper { static singleton(ethApi: EthApi, contentProvider: ContentProvider): Promise; static singletonMultisigProxy(ethApi: EthApi, contentProvider: ContentProvider, multisigAddress?: EthAddress): Promise; private contentProvider; private voting; /** If instantiated with `multisigAddress` undefined, proxy will send transactions directly to the contract instance. */ private multisigProxy; private constructor(); /** * Get address for voting contract used with this TCR */ getVotingAddress(): Promise; /** * Get Voting instance used with this TCR */ getVoting(): Voting; /** * Returns Parameterizer instance associated with this TCR */ getParameterizer(): Promise; getGovernment(): Promise; getCouncil(): Promise; /** * Get address for token used with this TCR */ getTokenAddress(): Promise; getGovernmentAddress(): Promise; /** * Get Token instance used with this TCR */ getToken(): Promise; /** * Get address for parameterizer contract used with this TCR */ getParameterizerAddress(): Promise; /** * An unending stream of all events that change the state of a listing * @param fromBlock Starting block in history for events concerning whitelisted addresses. * Set to "latest" for only new events * @returns currently listings as new events get triggered */ allEventsExceptWhitelistFromBlock(fromBlock?: number, toBlock?: number): Observable; /** * An unending stream of all events that change the state of a listing * @param fromBlock Starting block in history for events concerning whitelisted addresses. * Set to "latest" for only new events * @returns currently listings as new events get triggered */ allEventsFromBlock(fromBlock?: number, toBlock?: number): Observable; /** * An unending stream of all addresses that have been whitelisted * @param fromBlock Starting block in history for events concerning whitelisted addresses. * Set to "latest" for only new events * @returns currently whitelisted addresses */ whitelistedListings(fromBlock?: number, toBlock?: number): Observable; /** * An unending stream of all addresses that have applied * @param fromBlock Starting block in history for events concerning applied addresses. * Set to "latest" for only new events * @returns listings currently in application stage */ listingsInApplicationStage(fromBlock?: number, toBlock?: number): Observable; /** * An unending stream of all addresses currently able to be whitelisted * @param fromBlock Starting block in history for events concerning ready to whitelist addresses. * Set to "latest" for only new events * @returns addresses ready to be whitelisted */ readyToBeWhitelistedListings(fromBlock?: number, toBlock?: number): Observable; /** * An unending stream of all addresses currently challenged in commit vote phase * @param fromBlock Starting block in history for events concerning challenged addresses in commit vote phase. * Set to "latest" for only new events * @returns currently challenged addresses in commit vote phase */ currentChallengedCommitVotePhaseListings(fromBlock?: number, toBlock?: number): Observable; /** * An unending stream of all addresses currently challenged in reveal vote phase * @param fromBlock Starting block in history for events concerning challenged addresses in reveal vote phase. * Set to "latest" for only new events * @returns currently challenged addresses in reveal vote phase */ currentChallengedRevealVotePhaseListings(fromBlock?: number, toBlock?: number): Observable; /** * An unending stream of all addresses currently challenged in request appeal phase * @param fromBlock Starting block in history for events concerning challenged addresses in request appeal phase. * Set to "latest" for only new events * @returns currently challenged addresses in request appeal phase */ listingsAwaitingAppealRequest(fromBlock?: number, toBlock?: number): Observable; listingsWithChallengeToResolve(fromBlock?: number, toBlock?: number): Observable; /** * An unending stream of all addresses currently challenged in appeal phase * @param fromBlock Starting block in history for events concerning challenged addresses in appeal phase. * Set to "latest" for only new events * @returns currently challenged addresses in appeal phase */ listingsAwaitingAppealJudgment(fromBlock?: number, toBlock?: number): Observable; /** * An unending stream of all addresses currently challenged in appeal phase * @param fromBlock Starting block in history for events concerning challenged addresses in appeal phase. * Set to "latest" for only new events * @returns currently challenged addresses in appeal phase */ listingsAwaitingAppealChallenge(fromBlock?: number, toBlock?: number): Observable; /** * An unending stream of all addresses currently challenged in appeal phase * @param fromBlock Starting block in history for events concerning challenged addresses in appeal phase. * Set to "latest" for only new events * @returns currently challenged addresses in appeal phase */ listingsInAppealChallengeCommitPhase(fromBlock?: number, toBlock?: number): Observable; /** * An unending stream of all addresses currently challenged in appeal phase * @param fromBlock Starting block in history for events concerning challenged addresses in appeal phase. * Set to "latest" for only new events * @returns currently challenged addresses in appeal phase */ listingsInAppealChallengeRevealPhase(fromBlock?: number, toBlock?: number): Observable; /** * An unending stream of all addresses currently challenged in appeal phase * @param fromBlock Starting block in history for events concerning challenged addresses in appeal phase. * Set to "latest" for only new events * @returns currently challenged addresses in appeal phase */ listingsWithAppealToResolve(fromBlock?: number, toBlock?: number): Observable; /** * An unending stream of all addresses currently challenged in appeal phase * @param fromBlock Starting block in history for events concerning challenged addresses in appeal phase. * Set to "latest" for only new events * @returns currently challenged addresses in appeal phase */ rejectedListings(fromBlock?: number, toBlock?: number): Observable; allApplicationsEver(): Observable; allChallengeIDsEver(): Observable; allAppealChallengeIDsEver(): Observable; challengesStartedByUser(user: EthAddress): Observable; /** * An unending stream of all pollIDs of polls the user has collected rewards on * @param fromBlock Starting block in history for events concerning new polls * Set to "latest" for only new events * @param user the user to check */ rewardsCollected(fromBlock?: number, user?: EthAddress, toBlock?: number): Observable; getListing(listingAddress: EthAddress): Listing; getRawGrantAppealTxData(listingAddress: EthAddress): Promise; getChallengeIDForPollID(pollID: BigNumber): Promise; getChallengeData(challengeID: BigNumber, listingAddr?: string): Promise; getUserAppealChallengeData(appealChallengeID: BigNumber, user: EthAddress): Promise; getUserChallengeData(challengeID: BigNumber, user: EthAddress): Promise; getRewardClaimed(challengeID: BigNumber, user: EthAddress): Promise; /** * Contract Getters */ /** * Gets reward for voter * @param challengeID ID of challenge to check * @param salt Salt of vote associated with voter for specified challenge * @param voter Voter of which to check reward */ voterReward(challengeID: BigNumber, salt: BigNumber, voter?: EthAddress): Promise; /** * Determines number of tokens to award winning party in challenge * @param address ID of challenge to determine reward for */ determineReward(challengeID: BigNumber): Promise; /** * Gets whether or not specified user has a token claim for specified challenge * @param challengeID ID of challenge to check * @param address Address of voter to check */ hasClaimedTokens(challengeID: BigNumber, voter?: EthAddress): Promise; /** * Contract Transactions */ /** * Starts an application for a listing * @param address Address of new listing * @param deposit How many tokens to deposit to start application * @param applicationContent Content associated with application */ apply(listingAddress: EthAddress, deposit: BigNumber, applicationContent: string): Promise; /** * Starts an application for a listing * @param address Address of new listing * @param deposit How many tokens to deposit to start application * @param applicationContentURI (URI that points to data object) */ applyWithURI(listingAddress: EthAddress, deposit: BigNumber, applicationContentURI: string): Promise; /** * Deposits more tokens into a listing * @param address Address of listing to deposit to * @param depositAmount How many tokens to deposit */ deposit(listingAddress: EthAddress, depositAmount: BigNumber): Promise; /** * Withdraw tokens from a listing * @param address Address of listing to withdraw from * @param withdrawalAmount How many tokens to withdraw */ withdraw(listingAddress: EthAddress, withdrawalAmount: BigNumber): Promise; /** * Exits a listing, returning deposited tokens * @param address Address of listing to exit */ exitListing(listingAddress: EthAddress): Promise; /** * Challenges an application or whitelisted listing * @param listingAddress Address of listing to challenge * @param data Data associated with challenge */ challenge(listingAddress: EthAddress, data?: string): Promise; requestAppeal(listingAddress: EthAddress, data?: string): Promise; grantAppeal(listingAddress: EthAddress, data?: string): Promise; challengeGrantedAppeal(listingAddress: EthAddress, data?: string): Promise; challengeGrantedAppealWithURI(listingAddress: EthAddress, uri?: string): Promise; /** * This is a low-level call and assumes you stored your content on your own * Challenges an application or whitelisted listing * @param address Address of listing to challenge * @param data Data associated with challenge (URI that points to data object) */ challengeWithURI(listingAddress: EthAddress, data?: string): Promise; /** * This is a low-level call and assumes you stored your content on your own * Requests an appeal on a challenged application * @param address Address of listing to request appeal * @param data Data associated with requested appeal (URI that points to data object) */ requestAppealWithURI(listingAddress: EthAddress, data?: string): Promise; /** * Updates status of a listing * @param address Address of new listing */ updateStatus(listingAddress: EthAddress): Promise; /** * Claims reward associated with challenge * @param challengeID ID of challenge to claim reward of * @param salt Salt for user's vote on specified challenge */ claimReward(challengeID: BigNumber, salt: BigNumber): Promise; /** * Claims multiple rewards associated with challenges * @param challengeIDs IDs of challenges to claim rewards of * @param salts Salts for user's votes on specified challenges */ multiClaimReward(challengeIDs: BigNumber[], salts: BigNumber[]): Promise; }