@daostack/client › Globals › CompetitionSuggestion
- CompetitionSuggestion
- fetchStaticState
- getPosition
- isWinner
- redeem
- setStaticState
- state
- vote
- votes
- calculateId
- mapItemToObject
- search
+ new CompetitionSuggestion(idOrOpts
: string | object | ICompetitionSuggestionState, context
: Arc): CompetitionSuggestion
Defined in schemes/competition.ts:616
Parameters:
Name | Type |
---|---|
idOrOpts |
string | object | ICompetitionSuggestionState |
context |
Arc |
Returns: CompetitionSuggestion
• context: Arc
Defined in schemes/competition.ts:620
• id: string
Defined in schemes/competition.ts:614
• staticState? : ICompetitionSuggestionState
Defined in schemes/competition.ts:616
• suggestionId? : undefined | number
Defined in schemes/competition.ts:615
▸ fetchStaticState(): Promise‹ICompetitionSuggestionState›
Defined in schemes/competition.ts:643
Returns: Promise‹ICompetitionSuggestionState›
▸ getPosition(): Promise‹null | number›
Defined in schemes/competition.ts:681
Returns: Promise‹null | number›
▸ isWinner(): Promise‹boolean›
Defined in schemes/competition.ts:687
Returns: Promise‹boolean›
▸ redeem(beneficiary
: Address): Operation‹boolean›
Defined in schemes/competition.ts:693
Parameters:
Name | Type | Default |
---|---|---|
beneficiary |
Address | NULL_ADDRESS |
Returns: Operation‹boolean›
▸ setStaticState(opts
: ICompetitionSuggestionState): void
Defined in schemes/competition.ts:639
Parameters:
Name | Type |
---|---|
opts |
ICompetitionSuggestionState |
Returns: void
▸ state(apolloQueryOptions
: IApolloQueryOptions): Observable‹ICompetitionSuggestionState›
Defined in schemes/competition.ts:647
Parameters:
Name | Type | Default |
---|---|---|
apolloQueryOptions |
IApolloQueryOptions | {} |
Returns: Observable‹ICompetitionSuggestionState›
▸ vote(): Operation‹CompetitionVote›
Defined in schemes/competition.ts:661
Returns: Operation‹CompetitionVote›
▸ votes(options
: ICompetitionVoteQueryOptions, apolloQueryOptions
: IApolloQueryOptions): Observable‹CompetitionVote[]›
Defined in schemes/competition.ts:672
Parameters:
Name | Type | Default |
---|---|---|
options |
ICompetitionVoteQueryOptions | {} |
apolloQueryOptions |
IApolloQueryOptions | {} |
Returns: Observable‹CompetitionVote[]›
▸ calculateId(opts
: object): string
Defined in schemes/competition.ts:547
Parameters:
▪ opts: object
Name | Type |
---|---|
scheme |
Address |
suggestionId |
number |
Returns: string
▸ mapItemToObject(item
: any, context
: Arc): ICompetitionSuggestionState | null
Defined in schemes/competition.ts:581
Parameters:
Name | Type |
---|---|
item |
any |
context |
Arc |
Returns: ICompetitionSuggestionState | null
▸ search(context
: Arc, options
: ICompetitionSuggestionQueryOptions, apolloQueryOptions
: IApolloQueryOptions): Observable‹CompetitionSuggestion[]›
Defined in schemes/competition.ts:555
Parameters:
Name | Type | Default |
---|---|---|
context |
Arc | - |
options |
ICompetitionSuggestionQueryOptions | {} |
apolloQueryOptions |
IApolloQueryOptions | {} |
Returns: Observable‹CompetitionSuggestion[]›
Defined in schemes/competition.ts:522
• CompetitionSuggestionFields: any = gqlfragment CompetitionSuggestionFields on CompetitionSuggestion { id suggestionId proposal { id } descriptionHash title description url tags { id } # fulltext: [string] suggester # votes: [CompetitionVote!] @derivedFrom(field: "suggestion") totalVotes createdAt redeemedAt rewardPercentage positionInWinnerList }
Defined in schemes/competition.ts:523