@daostack/client › Globals › Proposal
Class: Proposal
Hierarchy
- Proposal
Implements
Index
Constructors
Properties
Methods
- claimRewards
- execute
- fetchStaticState
- redeemerContract
- rewards
- scheme
- setStaticState
- stake
- stakes
- stakingToken
- state
- vote
- votes
- votingMachine
- search
Object literals
Constructors
constructor
+ new Proposal(idOrOpts : string |
IProposalStaticState, context : Arc): Proposal |
Defined in proposal.ts:328
Parameters:
Name | Type |
---|---|
idOrOpts |
string | IProposalStaticState |
context |
Arc |
Returns: Proposal
Properties
context
• context: Arc
Defined in proposal.ts:326
id
• id: string
Defined in proposal.ts:327
staticState
• staticState: *IProposalStaticState | undefined* |
Defined in proposal.ts:328
Methods
claimRewards
▸ claimRewards(beneficiary?
: Address): Operation‹boolean›
Defined in proposal.ts:764
[claimRewards description] Execute the proposal and distribute the rewards to the beneficiary. This uses the Redeemer.sol helper contract
Parameters:
Name | Type | Description |
---|---|---|
beneficiary? |
Address | Addresss of the beneficiary, optional, if undefined will only redeem the ContributionReward rewards |
Returns: Operation‹boolean›
an Operation
execute
▸ execute(): Operation‹any›
Defined in proposal.ts:808
calll the ‘execute()’ function on the votingMachine. the main purpose of this function is to set the stage of the proposals this call may (or may not) “execute” the proposal itself (i.e. do what the proposal proposes)
Returns: Operation‹any›
an Operation that, when sucessful, will contain the receipt of the transaction
fetchStaticState
▸ fetchStaticState(): Promise‹IProposalStaticState›
Defined in proposal.ts:346
Returns: Promise‹IProposalStaticState›
redeemerContract
▸ redeemerContract(): any
Defined in proposal.ts:582
[redeemerContract description]
Returns: any
a web3 Contract instance
rewards
▸ rewards(options
: IRewardQueryOptions, apolloQueryOptions
: IApolloQueryOptions): Observable‹Reward[]›
Defined in proposal.ts:747
Parameters:
Name | Type | Default |
---|---|---|
options |
IRewardQueryOptions | {} |
apolloQueryOptions |
IApolloQueryOptions | {} |
Returns: Observable‹Reward[]›
scheme
▸ scheme(): Promise‹any›
Defined in proposal.ts:565
Returns: Promise‹any›
the scheme Contract
setStaticState
▸ setStaticState(opts
: IProposalStaticState): void
Defined in proposal.ts:342
Parameters:
Name | Type |
---|---|
opts |
IProposalStaticState |
Returns: void
stake
▸ stake(outcome
: IProposalOutcome, amount
: BN): Operation‹Stake›
Defined in proposal.ts:674
Stake on this proposal
Parameters:
Name | Type | Description |
---|---|---|
outcome |
IProposalOutcome | the outcome that is staked on, of type IProposalOutcome |
amount |
BN | the amount, in GEN, to stake |
An observable that can be sent, or subscribed to
stakes
▸ stakes(options
: IStakeQueryOptions, apolloQueryOptions
: IApolloQueryOptions): Observable‹Stake[]›
Defined in proposal.ts:662
Parameters:
Name | Type | Default |
---|---|---|
options |
IStakeQueryOptions | {} |
apolloQueryOptions |
IApolloQueryOptions | {} |
Returns: Observable‹Stake[]›
stakingToken
▸ stakingToken(): Token‹›
Defined in proposal.ts:658
Returns: Token‹›
state
▸ state(apolloQueryOptions
: IApolloQueryOptions): Observable‹IProposalState›
Defined in proposal.ts:368
state
is an observable of the proposal state
Parameters:
Name | Type | Default |
---|---|---|
apolloQueryOptions |
IApolloQueryOptions | {} |
Returns: Observable‹IProposalState›
vote
▸ vote(outcome : IProposalOutcome, amount : number): *Operation‹Vote |
null›* |
Defined in proposal.ts:604
Vote for this proposal
Parameters:
Name | Type | Default | Description |
---|---|---|---|
outcome |
IProposalOutcome | - | one of IProposalOutcome.Pass (0) or IProposalOutcome.FAIL (1) |
amount |
number | 0 | the amount of reputation to vote with. Defaults to 0 - in that case, all the sender’s rep will be used |
Returns: *Operation‹Vote | null›* |
an observable Operation
votes
▸ votes(options
: IVoteQueryOptions, apolloQueryOptions
: IApolloQueryOptions): Observable‹Vote[]›
Defined in proposal.ts:591
Parameters:
Name | Type | Default |
---|---|---|
options |
IVoteQueryOptions | {} |
apolloQueryOptions |
IApolloQueryOptions | {} |
Returns: Observable‹Vote[]›
votingMachine
▸ votingMachine(): Promise‹any›
Defined in proposal.ts:574
[votingMachine description]
Returns: Promise‹any›
a web3 Contract instance
Static
search
▸ search(context
: Arc, options
: IProposalQueryOptions, apolloQueryOptions
: IApolloQueryOptions): Observable‹Proposal[]›
Defined in proposal.ts:237
Search for proposals
Parameters:
Name | Type | Default | Description |
---|---|---|---|
context |
Arc | - | An instance of Arc |
options |
IProposalQueryOptions | {} | Search options, must implemeent IProposalQueryOptions |
apolloQueryOptions |
IApolloQueryOptions | {} | - |
Returns: Observable‹Proposal[]›
An observable of lists of results
For example: Proposal.search({ stage: IProposalStage.Queued})
Object literals
Static
fragments
▪ fragments: object
Defined in proposal.ts:111
ProposalFields
• ProposalFields: any = gql`fragment ProposalFields on Proposal { id accountsWithUnclaimedRewards boostedAt closingAt confidenceThreshold competition { id endTime contract suggestionsEndTime createdAt numberOfVotesPerVoters numberOfWinners rewardSplit snapshotBlock startTime votingStartTime
}
contributionReward {
id
beneficiary
ethReward
externalToken
externalTokenReward
externalToken
nativeTokenReward
periods
periodLength
reputationReward
alreadyRedeemedReputationPeriods
alreadyRedeemedExternalTokenPeriods
alreadyRedeemedNativeTokenPeriods
alreadyRedeemedEthPeriods
}
createdAt
dao {
id
schemes {
id
address
}
}
description
descriptionHash
executedAt
executionState
expiresInQueueAt
genericScheme {
id
contractToCall
callData
executed
returnValue
}
genesisProtocolParams {
id
activationTime
boostedVotePeriodLimit
daoBountyConst
limitExponentValue
minimumDaoBounty
preBoostedVotePeriodLimit
proposingRepReward
queuedVotePeriodLimit
queuedVoteRequiredPercentage
quietEndingPeriod
thresholdConst
votersReputationLossRatio
}
gpRewards {
id
}
scheme {
...SchemeFields
}
gpQueue {
id
threshold
votingMachine
}
organizationId
preBoostedAt
proposer
quietEndingPeriodBeganAt
schemeRegistrar {
id
schemeToRegister
schemeToRegisterParamsHash
schemeToRegisterPermission
schemeToRemove
decision
schemeRegistered
schemeRemoved
}
stage
# stakes { id }
stakesFor
stakesAgainst
tags {
id
}
totalRepWhenCreated
totalRepWhenExecuted
title
url
# votes { id }
votesAgainst
votesFor
votingMachine
winningOutcome
}`
Defined in proposal.ts:112