@daostack/client › Globals › Scheme
A Scheme represents a scheme instance that is registered at a DAO
-
↳ Scheme
- createProposal
- createProposalErrorHandler
- createProposalTransaction
- createProposalTransactionMap
- fetchStaticState
- proposals
- setStaticState
- state
- x
- itemMap
- search
+ 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
• ReputationFromToken: ReputationFromTokenScheme | null = null
Overrides SchemeBase.ReputationFromToken
Defined in scheme.ts:259
• context: Arc
Overrides SchemeBase.context
Defined in scheme.ts:261
• id: Address
Overrides SchemeBase.id
Defined in scheme.ts:257
• staticState: ISchemeStaticState | null = null
Overrides SchemeBase.staticState
Defined in scheme.ts:258
▸ 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(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(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(): function
Inherited from SchemeBase.createProposalTransactionMap
Defined in schemes/base.ts:292
Returns: function
▸ (receipt
: any): any
Parameters:
Name | Type |
---|---|
receipt |
any |
▸ 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(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(opts
: ISchemeStaticState): void
Overrides SchemeBase.setStaticState
Defined in scheme.ts:273
Parameters:
Name | Type |
---|---|
opts |
ISchemeStaticState |
Returns: void
▸ state(apolloQueryOptions
: IApolloQueryOptions): Observable‹ISchemeState›
Overrides SchemeBase.state
Defined in scheme.ts:305
Parameters:
Name | Type | Default |
---|---|---|
apolloQueryOptions |
IApolloQueryOptions | {} |
Returns: Observable‹ISchemeState›
▸ x(): void
Inherited from SchemeBase.x
Defined in schemes/base.ts:319
Returns: void
▸ 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
▸ 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
Inherited from SchemeBase.fragments
Defined in schemes/base.ts:106
• 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