-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: wip merkl report type #274
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import { BigNumber } from 'ethers'; | ||
import { Int256 } from 'src/lib'; | ||
|
||
import { AggregatedRewardsType, MerklSupportedChainIdsType } from '.'; | ||
|
||
export type OnChainParamsType = { | ||
disputeToken: string; | ||
disputeAmount: BigNumber; | ||
disputePeriod: number; | ||
endOfDisputePeriod: number; | ||
disputer: string; | ||
endRoot: string; | ||
startRoot: string; | ||
currentRoot: string; | ||
}; | ||
|
||
export type DistributionChangeType = { | ||
epoch: number; | ||
pool: string; | ||
poolName: string; | ||
ratePerEpoch: number; | ||
numRecipients: number; | ||
rewardSymbol: string; | ||
diff: number; | ||
}; | ||
|
||
// export type HolderDetailsType = { | ||
// [rewardId: string]: { | ||
// poolName: string; | ||
// rewardDecimals?: number; | ||
// rewardSymbol: string; | ||
// rewardTokenAddress?: string; | ||
|
||
// holderDiff: number; | ||
// diffAverageBoost?: number; | ||
// issueSpotted?: boolean; | ||
// percent?: number; | ||
// }; | ||
// }; | ||
|
||
// export type HolderClaims = { [address: string]: { [symbol: string]: string } }; | ||
|
||
export type HoldersReportType = { | ||
[holder: string]: { | ||
[poolAddress: string]: { | ||
details: { | ||
[rewardId: string]: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I liked the sub types too, because sometimes you only work with the sub object and you don't want to retype it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought that for a start, it helps to have an overview of the type |
||
poolName: string; | ||
rewardDecimals?: number; | ||
rewardSymbol: string; | ||
rewardTokenAddress?: string; | ||
|
||
holderDiff: number; | ||
diffAverageBoost?: number; | ||
issueSpotted?: boolean; | ||
percent?: number; | ||
}; | ||
}; | ||
// aggregated | ||
unclaimed: { [rewardSymbol: string]: Int256 }; // FIXME | ||
negativeDiffs: { [rewardSymbol: string]: number }; | ||
overclaimed?: { [rewardSymbol: string]: number }; | ||
}; | ||
}; | ||
}; | ||
|
||
export type MerklReportType = Partial<{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's this one corresponding too? I don't see the same params as in merkl-dispute There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it was inspired from |
||
chainId: MerklSupportedChainIdsType; | ||
startTime: number; | ||
startEpoch: number; | ||
endEpoch: number; | ||
blockNumber: number; | ||
|
||
params: OnChainParamsType; | ||
startRoot: string; | ||
startAggregatedRewards: AggregatedRewardsType; | ||
endRoot: string; | ||
endAggregatedRewards: AggregatedRewardsType; | ||
|
||
poolsReport: { [poolAddress: string]: { [rewardId: string]: DistributionChangeType } }; | ||
holdersReport: HoldersReportType; | ||
}>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a convention to add Type at the end of the name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it's a convention for clarity and readability