Skip to content

Instantly share code, notes, and snippets.

@adrake33
Last active April 2, 2019 20:03
Show Gist options
  • Save adrake33/c94b01f1b049ef6eeae96d00e6aef09b to your computer and use it in GitHub Desktop.
Save adrake33/c94b01f1b049ef6eeae96d00e6aef09b to your computer and use it in GitHub Desktop.
// Will require data from multiple event types. Should log `crowdsourcerId` for initial reporters.
export interface UIReport<BigNumberType> {
creationBlockNumber: number;
creationTime: number;
logIndex: number;
transactionHash: Bytes32;
blockHash: Bytes32;
marketId: Address; // InitialReportSubmitted.market or DisputeCrowdsourcerContribution.market
feeWindow: Address; // DisputeWindowCreated.disputeWindow in v2
payoutNumerators: Array<BigNumberType|null>; // InitialReportSubmitted.payoutNumerators or DisputeCrowdsourcerCreated.payoutNumerators
amountStaked: BigNumberType; // InitialReportSubmitted.amountStaked or DisputeCrowdsourcerContribution.amountStaked
crowdsourcerId: Address; // DisputeCrowdsourcerContribution.amountStaked. Needs logging for initial reporters
isCategorical: boolean; // MarketCreated.marketType
isScalar: boolean; // MarketCreated.marketType
isInvalid: boolean; // InitialReportSubmitted.payoutNumerators or DisputeCrowdsourcerContribution.payoutNumerators
isSubmitted: boolean; // Vestigial value - always set to true
}
export interface UIReports<BigNumberType> {
[universe: string]: {
[marketId: string]: {
crowdsourcers: Array<UIReport<BigNumberType>>;
initialReporter: UIReport<BigNumberType>|null;
},
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment