Class: Scheme
January 17, 2020 · View on GitHub
@daostack/client › Globals › Scheme
Class: Scheme
A Scheme represents a scheme instance that is registered at a DAO
Hierarchy
-
↳ Scheme
Implements
Index
Constructors
Properties
Methods
- createProposal
- createProposalErrorHandler
- createProposalTransaction
- createProposalTransactionMap
- fetchStaticState
- proposals
- setStaticState
- state
- x
- itemMap
- search
Object literals
Constructors
constructor
+ new Scheme(idOrOpts: Address | ISchemeStaticState, context: Arc): Scheme
Overrides SchemeBase.constructor
Defined in scheme.ts:259
Parameters:
| Name | Type |
|---|---|
idOrOpts | Address | ISchemeStaticState |
context | Arc |
Returns: Scheme
Properties
ReputationFromToken
• ReputationFromToken: ReputationFromTokenScheme | null = null
Overrides SchemeBase.ReputationFromToken
Defined in scheme.ts:259
context
• context: Arc
Overrides SchemeBase.context
Defined in scheme.ts:261
id
• id: Address
Overrides SchemeBase.id
Defined in scheme.ts:257
staticState
• staticState: ISchemeStaticState | null = null
Overrides SchemeBase.staticState
Defined in scheme.ts:258
Methods
createProposal
▸ createProposal(options: IProposalCreateOptions): Operation‹Proposal›
Overrides SchemeBase.createProposal
Defined in scheme.ts:323
create a new proposal in this Scheme
Parameters:
| Name | Type |
|---|---|
options | IProposalCreateOptions |
a Proposal instance
createProposalErrorHandler
▸ createProposalErrorHandler(options?: any): function
Inherited from SchemeBase.createProposalErrorHandler
Defined in schemes/base.ts:296
Parameters:
| Name | Type |
|---|---|
options? | any |
Returns: function
▸ (err: Error): Error | Promise‹Error›
Parameters:
| Name | Type |
|---|---|
err | Error |
createProposalTransaction
▸ createProposalTransaction(options: any): function
Inherited from SchemeBase.createProposalTransaction
Defined in schemes/base.ts:288
create a new proposal in this scheme TODO: move this to the schemes - we should call proposal.scheme.createProposal
Parameters:
| Name | Type |
|---|---|
options | any |
Returns: function
a Proposal instance
▸ (): Promise‹any›
createProposalTransactionMap
▸ createProposalTransactionMap(): function
Inherited from SchemeBase.createProposalTransactionMap
Defined in schemes/base.ts:292
Returns: function
▸ (receipt: any): any
Parameters:
| Name | Type |
|---|---|
receipt | any |
fetchStaticState
▸ fetchStaticState(): Promise‹ISchemeStaticState›
Overrides SchemeBase.fetchStaticState
Defined in scheme.ts:284
fetch the static state from the subgraph
Returns: Promise‹ISchemeStaticState›
the statatic state
proposals
▸ proposals(options: IProposalQueryOptions, apolloQueryOptions: IApolloQueryOptions): Observable‹Proposal[]›
Overrides SchemeBase.proposals
Defined in scheme.ts:390
Parameters:
| Name | Type | Default |
|---|---|---|
options | IProposalQueryOptions | {} |
apolloQueryOptions | IApolloQueryOptions | {} |
Returns: Observable‹Proposal[]›
setStaticState
▸ setStaticState(opts: ISchemeStaticState): void
Overrides SchemeBase.setStaticState
Defined in scheme.ts:273
Parameters:
| Name | Type |
|---|---|
opts | ISchemeStaticState |
Returns: void
state
▸ state(apolloQueryOptions: IApolloQueryOptions): Observable‹ISchemeState›
Overrides SchemeBase.state
Defined in scheme.ts:305
Parameters:
| Name | Type | Default |
|---|---|---|
apolloQueryOptions | IApolloQueryOptions | {} |
Returns: Observable‹ISchemeState›
x
▸ x(): void
Inherited from SchemeBase.x
Defined in schemes/base.ts:319
Returns: void
Static itemMap
▸ itemMap(item: any, arc: Arc): ISchemeState | null
Defined in scheme.ts:188
map an apollo query result to ISchemeState
static
memberof Scheme
Parameters:
| Name | Type |
|---|---|
item | any |
arc | Arc |
Returns: ISchemeState | null
Static search
▸ search(context: Arc, options: ISchemeQueryOptions, apolloQueryOptions: IApolloQueryOptions): Observable‹Array‹Scheme | CompetitionScheme››
Defined in scheme.ts:116
Scheme.search(context, options) searches for scheme entities
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
context | Arc | - | an Arc instance that provides connection information |
options | ISchemeQueryOptions | {} | the query options, cf. ISchemeQueryOptions |
apolloQueryOptions | IApolloQueryOptions | {} | - |
Returns: Observable‹Array‹Scheme | CompetitionScheme››
an observable of Scheme objects
Object literals
Static fragments
▪ fragments: object
Inherited from SchemeBase.fragments
Defined in schemes/base.ts:106
SchemeFields
• SchemeFields: any = gql fragment SchemeFields on ControllerScheme { id address name dao { id } canDelegateCall canRegisterSchemes canUpgradeController canManageGlobalConstraints paramsHash contributionRewardParams { id votingMachine voteParams { id queuedVoteRequiredPercentage queuedVotePeriodLimit boostedVotePeriodLimit preBoostedVotePeriodLimit thresholdConst limitExponentValue quietEndingPeriod proposingRepReward votersReputationLossRatio minimumDaoBounty daoBountyConst activationTime voteOnBehalf } } contributionRewardExtParams { id votingMachine voteParams { id queuedVoteRequiredPercentage queuedVotePeriodLimit boostedVotePeriodLimit preBoostedVotePeriodLimit thresholdConst limitExponentValue quietEndingPeriod proposingRepReward votersReputationLossRatio minimumDaoBounty daoBountyConst activationTime voteOnBehalf } rewarder } genericSchemeParams { votingMachine contractToCall voteParams { queuedVoteRequiredPercentage queuedVotePeriodLimit boostedVotePeriodLimit preBoostedVotePeriodLimit thresholdConst limitExponentValue quietEndingPeriod proposingRepReward votersReputationLossRatio minimumDaoBounty daoBountyConst activationTime voteOnBehalf } } schemeRegistrarParams { votingMachine voteRemoveParams { queuedVoteRequiredPercentage queuedVotePeriodLimit boostedVotePeriodLimit preBoostedVotePeriodLimit thresholdConst limitExponentValue quietEndingPeriod proposingRepReward votersReputationLossRatio minimumDaoBounty daoBountyConst activationTime voteOnBehalf } voteRegisterParams { queuedVoteRequiredPercentage queuedVotePeriodLimit boostedVotePeriodLimit preBoostedVotePeriodLimit thresholdConst limitExponentValue quietEndingPeriod proposingRepReward votersReputationLossRatio minimumDaoBounty daoBountyConst activationTime voteOnBehalf } } numberOfQueuedProposals numberOfPreBoostedProposals numberOfBoostedProposals uGenericSchemeParams { votingMachine contractToCall voteParams { queuedVoteRequiredPercentage queuedVotePeriodLimit boostedVotePeriodLimit preBoostedVotePeriodLimit thresholdConst limitExponentValue quietEndingPeriod proposingRepReward votersReputationLossRatio minimumDaoBounty daoBountyConst activationTime voteOnBehalf } } version }
Defined in schemes/base.ts:107