@@ -2,10 +2,10 @@ import gql from 'graphql-tag'
22import { Observable } from 'rxjs'
33import { first } from 'rxjs/operators'
44import { Arc , IApolloQueryOptions } from './arc'
5- import { IGenesisProtocolParams , mapGenesisProtocolParams } from './genesisProtocol'
5+ import { mapGenesisProtocolParams } from './genesisProtocol'
66import { Operation , toIOperationObservable } from './operation'
77import { IProposalCreateOptions , IProposalQueryOptions , Proposal } from './proposal'
8- import { SchemeBase } from './schemes/base'
8+ import { ISchemeQueryOptions , ISchemeState , ISchemeStaticState , SchemeBase } from './schemes/base'
99import { CompetitionScheme , isCompetitionScheme } from './schemes/competition'
1010import * as Competition from './schemes/competition'
1111import * as ContributionReward from './schemes/contributionReward'
@@ -14,93 +14,10 @@ import * as GenericScheme from './schemes/genericScheme'
1414import { ReputationFromTokenScheme } from './schemes/reputationFromToken'
1515import * as SchemeRegistrar from './schemes/schemeRegistrar'
1616import * as UGenericScheme from './schemes/uGenericScheme'
17- // import { DAO } from './dao'
18- // import { IStateful } from './types'
19- import { Address , ICommonQueryOptions } from './types'
17+ import { Address } from './types'
2018import { createGraphQlQuery } from './utils'
2119
22- export interface ISchemeStaticState {
23- id : string
24- address : Address
25- dao : Address
26- name : string
27- paramsHash : string
28- version : string
29- }
30-
31- export interface ISchemeState extends ISchemeStaticState {
32- canDelegateCall : boolean
33- canRegisterSchemes : boolean
34- canUpgradeController : boolean
35- canManageGlobalConstraints : boolean
36- dao : Address
37- paramsHash : string
38- contributionRewardParams ?: IContributionRewardParams
39- contributionRewardExtParams ?: IContributionRewardExtParams
40- genericSchemeParams ?: IGenericSchemeParams
41- schemeRegistrarParams ?: {
42- votingMachine : Address
43- voteRemoveParams : IGenesisProtocolParams
44- voteRegisterParams : IGenesisProtocolParams
45- } | null
46- numberOfQueuedProposals : number
47- numberOfPreBoostedProposals : number
48- numberOfBoostedProposals : number
49- uGenericSchemeParams ?: IGenericSchemeParams
50- schemeParams ?: IGenericSchemeParams | IContributionRewardParams | IContributionRewardExtParams | ISchemeRegisterParams
51- }
52-
53- export interface IGenericSchemeParams {
54- votingMachine : Address
55- contractToCall : Address
56- voteParams : IGenesisProtocolParams
57- }
58-
59- export interface IContributionRewardParams {
60- votingMachine : Address
61- voteParams : IGenesisProtocolParams
62- }
63- export interface IContributionRewardExtParams {
64- votingMachine : Address
65- voteParams : IGenesisProtocolParams
66- rewarder : Address
67- }
68-
69- export interface ISchemeRegisterParams {
70- votingMachine : Address
71- contractToCall : Address
72- voteParams : IGenesisProtocolParams
73- }
74-
75- export interface ISchemeQueryOptions extends ICommonQueryOptions {
76- where ?: {
77- address ?: Address
78- canDelegateCall ?: boolean
79- canRegisterSchemes ?: boolean
80- canUpgradeController ?: boolean
81- canManageGlobalConstraints ?: boolean
82- dao ?: Address
83- id ?: string
84- name ?: string
85- paramsHash ?: string
86- [ key : string ] : any
87- }
88- }
89-
90- export interface ISchemeQueryOptions extends ICommonQueryOptions {
91- where ?: {
92- address ?: Address
93- canDelegateCall ?: boolean
94- canRegisterSchemes ?: boolean
95- canUpgradeController ?: boolean
96- canManageGlobalConstraints ?: boolean
97- dao ?: Address
98- id ?: string
99- name ?: string
100- paramsHash ?: string
101- [ key : string ] : any
102- }
103- }
20+ export { ISchemeQueryOptions , ISchemeState , ISchemeStaticState } from './schemes/base'
10421
10522/**
10623 * A Scheme represents a scheme instance that is registered at a DAO
@@ -242,6 +159,7 @@ export class Scheme extends SchemeBase {
242159 dao : item . dao . id ,
243160 genericSchemeParams,
244161 id : item . id ,
162+ isRegistered : item . isRegistered ,
245163 name,
246164 numberOfBoostedProposals : Number ( item . numberOfBoostedProposals ) ,
247165 numberOfPreBoostedProposals : Number ( item . numberOfPreBoostedProposals ) ,
0 commit comments