From 7361fcc589d0fbbc7cc326b396c2e17c2521cf7c Mon Sep 17 00:00:00 2001 From: Jelle Date: Wed, 8 Jan 2020 00:27:42 +0100 Subject: [PATCH] add support for Competition Scheme --- docker-compose.yml | 6 +- docs/classes/arc.md | 159 ++-- docs/classes/competition.md | 147 ++++ docs/classes/competitionscheme.md | 460 +++++++++++ docs/classes/competitionsuggestion.md | 255 ++++++ docs/classes/competitionvote.md | 142 ++++ docs/classes/dao.md | 60 +- docs/classes/event.md | 174 ++++ docs/classes/graphnodeobserver.md | 22 +- docs/classes/member.md | 32 +- docs/classes/proposal.md | 110 ++- docs/classes/queue.md | 12 +- docs/classes/reputation.md | 26 +- docs/classes/reputationfromtokenscheme.md | 14 +- docs/classes/reward.md | 97 ++- docs/classes/scheme.md | 303 ++++++- docs/classes/schemebase.md | 390 +++++++++ docs/classes/stake.md | 46 +- docs/classes/tag.md | 157 ++++ docs/classes/token.md | 44 +- docs/classes/vote.md | 46 +- docs/enums/iexecutionstate.md | 12 +- docs/enums/iproposaloutcome.md | 6 +- docs/enums/iproposalstage.md | 12 +- docs/enums/itransactionstate.md | 6 +- docs/enums/proposalquerysortoptions.md | 4 +- docs/globals.md | 300 +++++-- docs/interfaces/iallowance.md | 10 +- docs/interfaces/iapolloqueryoptions.md | 6 +- docs/interfaces/iapproval.md | 14 +- docs/interfaces/icommonqueryoptions.md | 20 +- docs/interfaces/icompetitionproposal.md | 111 +++ docs/interfaces/icompetitionsuggestion.md | 120 +++ .../icompetitionsuggestionqueryoptions.md | 69 ++ docs/interfaces/icompetitionvote.md | 48 ++ .../icompetitionvotequeryoptions.md | 21 + docs/interfaces/icontractinfo.md | 8 +- docs/interfaces/icontributionreward.md | 24 +- docs/interfaces/icontributionrewardext.md | 120 +++ .../icontributionrewardextparams.md | 45 + docs/interfaces/icontributionrewardparams.md | 34 + docs/interfaces/idaoqueryoptions.md | 10 +- docs/interfaces/idaostate.md | 34 +- docs/interfaces/idaostaticstate.md | 16 +- docs/interfaces/ieventqueryoptions.md | 69 ++ docs/interfaces/ieventstate.md | 95 +++ docs/interfaces/ieventstaticstate.md | 81 ++ docs/interfaces/igenericscheme.md | 10 +- docs/interfaces/igenericschemeinfo.md | 6 +- docs/interfaces/igenericschemeparams.md | 45 + docs/interfaces/igenesisprotocolparams.md | 28 +- docs/interfaces/imemberqueryoptions.md | 10 +- docs/interfaces/imemberstate.md | 12 +- docs/interfaces/imemberstaticstate.md | 8 +- docs/interfaces/iobservable.md | 2 +- docs/interfaces/ioperationobservable.md | 2 +- docs/interfaces/iproposalbasecreateoptions.md | 40 +- .../iproposalcreateoptionscompetition.md | 201 +++++ ...posalcreateoptionscontributionrewardext.md | 165 ++++ docs/interfaces/iproposalcreateoptionscr.md | 24 +- docs/interfaces/iproposalcreateoptionsgs.md | 8 +- docs/interfaces/iproposalcreateoptionssr.md | 6 +- docs/interfaces/iproposalqueryoptions.md | 10 +- docs/interfaces/iproposalstate.md | 125 +-- docs/interfaces/iproposalstaticstate.md | 10 +- docs/interfaces/iqueuequeryoptions.md | 10 +- docs/interfaces/iqueuestate.md | 14 +- docs/interfaces/iqueuestaticstate.md | 6 +- docs/interfaces/ireputationqueryoptions.md | 14 +- docs/interfaces/ireputationstate.md | 8 +- docs/interfaces/irewardqueryoptions.md | 10 +- docs/interfaces/irewardstate.md | 56 +- docs/interfaces/irewardstaticstate.md | 95 +++ docs/interfaces/ischemequeryoptions.md | 20 +- docs/interfaces/ischemeregisterparams.md | 45 + docs/interfaces/ischemeregistrar.md | 16 +- docs/interfaces/ischemestate.md | 98 ++- docs/interfaces/ischemestaticstate.md | 24 +- docs/interfaces/istakequeryoptions.md | 10 +- docs/interfaces/istakestate.md | 14 +- docs/interfaces/istakestaticstate.md | 14 +- docs/interfaces/istateful.md | 14 +- docs/interfaces/itagqueryoptions.md | 69 ++ docs/interfaces/itagstate.md | 45 + docs/interfaces/itagstaticstate.md | 32 + docs/interfaces/itokenqueryoptions.md | 10 +- docs/interfaces/itokenstate.md | 12 +- docs/interfaces/itransactionupdate.md | 10 +- docs/interfaces/iugenericscheme.md | 10 +- docs/interfaces/iugenericschemeinfo.md | 6 +- docs/interfaces/ivotequeryoptions.md | 10 +- docs/interfaces/ivotestate.md | 16 +- docs/interfaces/ivotestaticstate.md | 16 +- package-lock.json | 2 +- package.json | 2 +- src/arc.ts | 2 +- src/dao.ts | 26 +- src/index.ts | 5 + src/proposal.ts | 160 ++-- src/queue.ts | 37 +- src/scheme.ts | 462 +++++------ src/schemes/base.ts | 476 +++++++++++ src/schemes/competition.ts | 774 ++++++++++++++++++ src/schemes/contributionReward.ts | 2 +- src/schemes/contributionRewardExt.ts | 71 ++ src/settings.ts | 2 +- src/types.ts | 3 +- src/utils.ts | 39 + test/cache.spec.ts | 1 + test/proposal-competition.spec.ts | 368 +++++++++ test/proposal-contributionrewardext.spec.ts | 77 ++ test/proposal-execute.spec.ts | 8 +- test/proposal.spec.ts | 12 +- test/utils.spec.ts | 21 +- test/utils.ts | 110 ++- tsconfig.json | 3 +- tslint.json | 1 + 117 files changed, 6947 insertions(+), 1130 deletions(-) create mode 100644 docs/classes/competition.md create mode 100644 docs/classes/competitionscheme.md create mode 100644 docs/classes/competitionsuggestion.md create mode 100644 docs/classes/competitionvote.md create mode 100644 docs/classes/event.md create mode 100644 docs/classes/schemebase.md create mode 100644 docs/classes/tag.md create mode 100644 docs/interfaces/icompetitionproposal.md create mode 100644 docs/interfaces/icompetitionsuggestion.md create mode 100644 docs/interfaces/icompetitionsuggestionqueryoptions.md create mode 100644 docs/interfaces/icompetitionvote.md create mode 100644 docs/interfaces/icompetitionvotequeryoptions.md create mode 100644 docs/interfaces/icontributionrewardext.md create mode 100644 docs/interfaces/icontributionrewardextparams.md create mode 100644 docs/interfaces/icontributionrewardparams.md create mode 100644 docs/interfaces/ieventqueryoptions.md create mode 100644 docs/interfaces/ieventstate.md create mode 100644 docs/interfaces/ieventstaticstate.md create mode 100644 docs/interfaces/igenericschemeparams.md create mode 100644 docs/interfaces/iproposalcreateoptionscompetition.md create mode 100644 docs/interfaces/iproposalcreateoptionscontributionrewardext.md create mode 100644 docs/interfaces/irewardstaticstate.md create mode 100644 docs/interfaces/ischemeregisterparams.md create mode 100644 docs/interfaces/itagqueryoptions.md create mode 100644 docs/interfaces/itagstate.md create mode 100644 docs/interfaces/itagstaticstate.md create mode 100644 src/schemes/base.ts create mode 100644 src/schemes/competition.ts create mode 100644 src/schemes/contributionRewardExt.ts create mode 100644 test/proposal-competition.spec.ts create mode 100644 test/proposal-contributionrewardext.spec.ts diff --git a/docker-compose.yml b/docker-compose.yml index cad5a1ff..f853ad6e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,18 +26,18 @@ services: GRAPH_GRAPHQL_MAX_FIRST: '1000' ipfs: - image: daostack/subgraph-ipfs:0.0.1-rc.36-v1-3.0.19 + image: daostack/subgraph-ipfs:0.0.1-rc.36-v1-3.0.20 ports: - 5001:5001 postgres: - image: daostack/subgraph-postgres:0.0.1-rc.36-v1-3.0.19 + image: daostack/subgraph-postgres:0.0.1-rc.36-v1-3.0.20 ports: - 9432:5432 environment: POSTGRES_PASSWORD: 'letmein' ganache: - image: daostack/test-env:0.0.1-rc.36-v1-3.0.19 + image: daostack/test-env:0.0.1-rc.36-v1-3.0.20 ports: - 8545:8545 diff --git a/docs/classes/arc.md b/docs/classes/arc.md index 560f8cd2..5f36644d 100644 --- a/docs/classes/arc.md +++ b/docs/classes/arc.md @@ -47,6 +47,7 @@ Any useage of the library typically will start with instantiating a new Arc inst * [dao](arc.md#dao) * [daos](arc.md#daos) * [ethBalance](arc.md#ethbalance) +* [events](arc.md#events) * [fetchContractInfos](arc.md#fetchcontractinfos) * [getABI](arc.md#getabi) * [getAccount](arc.md#getaccount) @@ -66,6 +67,7 @@ Any useage of the library typically will start with instantiating a new Arc inst * [sendTransaction](arc.md#sendtransaction) * [setAccount](arc.md#setaccount) * [setContractInfos](arc.md#setcontractinfos) +* [tags](arc.md#tags) ## Constructors @@ -75,7 +77,7 @@ Any useage of the library typically will start with instantiating a new Arc inst *Overrides [GraphNodeObserver](graphnodeobserver.md).[constructor](graphnodeobserver.md#constructor)* -*Defined in [arc.ts:48](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L48)* +*Defined in [arc.ts:51](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L51)* **Parameters:** @@ -102,7 +104,7 @@ Name | Type | Description | *Inherited from [GraphNodeObserver](graphnodeobserver.md).[Logger](graphnodeobserver.md#logger)* -*Defined in [graphnode.ts:101](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L101)* +*Defined in [graphnode.ts:117](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L117)* ___ @@ -112,7 +114,7 @@ ___ *Inherited from [GraphNodeObserver](graphnodeobserver.md).[apolloClient](graphnodeobserver.md#optional-apolloclient)* -*Defined in [graphnode.ts:102](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L102)* +*Defined in [graphnode.ts:118](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L118)* ___ @@ -120,7 +122,7 @@ ___ • **blockHeaderSubscription**: *Subscription | undefined* = undefined -*Defined in [arc.ts:41](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L41)* +*Defined in [arc.ts:44](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L44)* ___ @@ -128,7 +130,7 @@ ___ • **contractInfos**: *[IContractInfo](../interfaces/icontractinfo.md)[]* -*Defined in [arc.ts:36](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L36)* +*Defined in [arc.ts:39](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L39)* a mapping of contrct names to contract addresses @@ -138,7 +140,7 @@ ___ • **contracts**: *object* -*Defined in [arc.ts:37](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L37)* +*Defined in [arc.ts:40](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L40)* #### Type declaration: @@ -150,7 +152,7 @@ ___ • **contractsR**: *object* -*Defined in [arc.ts:38](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L38)* +*Defined in [arc.ts:41](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L41)* #### Type declaration: @@ -164,7 +166,7 @@ ___ *Inherited from [GraphNodeObserver](graphnodeobserver.md).[graphqlHttpProvider](graphnodeobserver.md#optional-graphqlhttpprovider)* -*Defined in [graphnode.ts:99](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L99)* +*Defined in [graphnode.ts:115](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L115)* ___ @@ -174,7 +176,7 @@ ___ *Inherited from [GraphNodeObserver](graphnodeobserver.md).[graphqlSubscribeToQueries](graphnodeobserver.md#optional-graphqlsubscribetoqueries)* -*Defined in [graphnode.ts:103](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L103)* +*Defined in [graphnode.ts:119](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L119)* ___ @@ -184,7 +186,7 @@ ___ *Inherited from [GraphNodeObserver](graphnodeobserver.md).[graphqlWsProvider](graphnodeobserver.md#optional-graphqlwsprovider)* -*Defined in [graphnode.ts:100](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L100)* +*Defined in [graphnode.ts:116](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L116)* ___ @@ -192,7 +194,7 @@ ___ • **ipfs**: *any* -*Defined in [arc.ts:30](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L30)* +*Defined in [arc.ts:33](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L33)* ___ @@ -200,7 +202,7 @@ ___ • **ipfsProvider**: *[IPFSProvider](../globals.md#ipfsprovider)* -*Defined in [arc.ts:26](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L26)* +*Defined in [arc.ts:29](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L29)* ___ @@ -208,17 +210,17 @@ ___ • **observedAccounts**: *object* -*Defined in [arc.ts:42](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L42)* +*Defined in [arc.ts:45](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L45)* #### Type declaration: * \[ **address**: *string*\]: object -* **lastBalance**? : *undefined | number* +* **lastBalance**? : *undefined | string* -* **observable**? : *Observable‹any›* +* **observable**? : *Observable‹BN›* -* **observer**? : *Observer‹any›* +* **observer**? : *Observer‹BN›* * **subscriptionsCount**: *number* @@ -228,7 +230,7 @@ ___ • **pendingOperations**: *Observable‹Array‹[Operation](../globals.md#operation)‹any›››* = of() -*Defined in [arc.ts:28](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L28)* +*Defined in [arc.ts:31](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L31)* ___ @@ -236,7 +238,7 @@ ___ • **web3**: *any* -*Defined in [arc.ts:31](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L31)* +*Defined in [arc.ts:34](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L34)* ___ @@ -244,7 +246,7 @@ ___ • **web3Provider**: *[Web3Provider](../globals.md#web3provider)* = "" -*Defined in [arc.ts:24](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L24)* +*Defined in [arc.ts:27](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L27)* ___ @@ -252,7 +254,7 @@ ___ • **web3ProviderRead**: *[Web3Provider](../globals.md#web3provider)* = "" -*Defined in [arc.ts:25](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L25)* +*Defined in [arc.ts:28](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L28)* ___ @@ -260,19 +262,19 @@ ___ • **web3Read**: *any* -*Defined in [arc.ts:32](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L32)* +*Defined in [arc.ts:35](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L35)* ## Methods ### GENToken -▸ **GENToken**(): *[Token](token.md)* +▸ **GENToken**(): *[Token](token.md)‹›* -*Defined in [arc.ts:325](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L325)* +*Defined in [arc.ts:341](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L341)* get the GEN Token -**Returns:** *[Token](token.md)* +**Returns:** *[Token](token.md)‹›* a Token instance @@ -280,9 +282,9 @@ ___ ### allowance -▸ **allowance**(`owner`: [Address](../globals.md#address), `spender`: [Address](../globals.md#address)): *Observable‹any›* +▸ **allowance**(`owner`: [Address](../globals.md#address), `spender`: [Address](../globals.md#address)): *Observable‹BN›* -*Defined in [arc.ts:386](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L386)* +*Defined in [arc.ts:402](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L402)* How much GEN spender may spend on behalve of the owner @@ -293,22 +295,22 @@ Name | Type | Description | `owner` | [Address](../globals.md#address) | Address of the owner of the tokens | `spender` | [Address](../globals.md#address) | Address of the spender | -**Returns:** *Observable‹any›* +**Returns:** *Observable‹BN›* ___ ### approveForStaking -▸ **approveForStaking**(`spender`: [Address](../globals.md#address), `amount`: any): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹any››* +▸ **approveForStaking**(`spender`: [Address](../globals.md#address), `amount`: BN): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹any››* -*Defined in [arc.ts:376](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L376)* +*Defined in [arc.ts:392](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L392)* **Parameters:** Name | Type | ------ | ------ | `spender` | [Address](../globals.md#address) | -`amount` | any | +`amount` | BN | **Returns:** *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹any››* @@ -318,7 +320,7 @@ ___ ▸ **dao**(`address`: [Address](../globals.md#address)): *[DAO](dao.md)* -*Defined in [arc.ts:131](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L131)* +*Defined in [arc.ts:134](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L134)* get a DAO instance from an address @@ -338,7 +340,7 @@ ___ ▸ **daos**(`options`: [IDAOQueryOptions](../interfaces/idaoqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[DAO](dao.md)[]›* -*Defined in [arc.ts:141](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L141)* +*Defined in [arc.ts:144](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L144)* return an observable of the list of DAOs @@ -355,9 +357,9 @@ ___ ### ethBalance -▸ **ethBalance**(`owner`: [Address](../globals.md#address)): *Observable‹any›* +▸ **ethBalance**(`owner`: [Address](../globals.md#address)): *Observable‹BN›* -*Defined in [arc.ts:167](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L167)* +*Defined in [arc.ts:180](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L180)* **Parameters:** @@ -365,7 +367,24 @@ Name | Type | ------ | ------ | `owner` | [Address](../globals.md#address) | -**Returns:** *Observable‹any›* +**Returns:** *Observable‹BN›* + +___ + +### events + +▸ **events**(`options`: [IEventQueryOptions](../interfaces/ieventqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Event](event.md)[]›* + +*Defined in [arc.ts:173](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L173)* + +**Parameters:** + +Name | Type | Default | +------ | ------ | ------ | +`options` | [IEventQueryOptions](../interfaces/ieventqueryoptions.md) | {} | +`apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | + +**Returns:** *Observable‹[Event](event.md)[]›* ___ @@ -373,7 +392,7 @@ ___ ▸ **fetchContractInfos**(`apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Promise‹[IContractInfo](../interfaces/icontractinfo.md)[]›* -*Defined in [arc.ts:110](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L110)* +*Defined in [arc.ts:113](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L113)* fetch contractInfos from the subgraph @@ -391,15 +410,15 @@ ___ ### getABI -▸ **getABI**(`address`: [Address](../globals.md#address), `abiName?`: undefined | string, `version?`: undefined | string): *any* +▸ **getABI**(`address?`: [Address](../globals.md#address), `abiName?`: undefined | string, `version?`: undefined | string): *any* -*Defined in [arc.ts:268](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L268)* +*Defined in [arc.ts:284](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L284)* **Parameters:** Name | Type | ------ | ------ | -`address` | [Address](../globals.md#address) | +`address?` | [Address](../globals.md#address) | `abiName?` | undefined | string | `version?` | undefined | string | @@ -411,7 +430,7 @@ ___ ▸ **getAccount**(): *Observable‹[Address](../globals.md#address)›* -*Defined in [arc.ts:338](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L338)* +*Defined in [arc.ts:354](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L354)* **Returns:** *Observable‹[Address](../globals.md#address)›* @@ -421,7 +440,7 @@ ___ ▸ **getContract**(`address`: [Address](../globals.md#address), `abi?`: any, `mode?`: undefined | "readonly"): *any* -*Defined in [arc.ts:297](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L297)* +*Defined in [arc.ts:313](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L313)* return a web3 Contract instance. @@ -443,7 +462,7 @@ ___ ▸ **getContractInfo**(`address`: [Address](../globals.md#address)): *[IContractInfo](../interfaces/icontractinfo.md)* -*Defined in [arc.ts:243](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L243)* +*Defined in [arc.ts:259](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L259)* return information about the contract @@ -463,7 +482,7 @@ ___ ▸ **getContractInfoByName**(`name`: string, `version`: string): *[IContractInfo](../interfaces/icontractinfo.md)* -*Defined in [arc.ts:256](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L256)* +*Defined in [arc.ts:272](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L272)* **Parameters:** @@ -482,7 +501,7 @@ ___ *Inherited from [GraphNodeObserver](graphnodeobserver.md).[getObservable](graphnodeobserver.md#getobservable)* -*Defined in [graphnode.ts:129](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L129)* +*Defined in [graphnode.ts:145](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L145)* Given a gql query, will return an observable of query results @@ -505,7 +524,7 @@ ___ *Inherited from [GraphNodeObserver](graphnodeobserver.md).[getObservableList](graphnodeobserver.md#getobservablelist)* -*Defined in [graphnode.ts:231](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L231)* +*Defined in [graphnode.ts:246](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L246)* Returns an observable that: - sends a query over http and returns the current list of results @@ -555,7 +574,7 @@ ___ *Inherited from [GraphNodeObserver](graphnodeobserver.md).[getObservableListWithFilter](graphnodeobserver.md#getobservablelistwithfilter)* -*Defined in [graphnode.ts:270](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L270)* +*Defined in [graphnode.ts:285](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L285)* Returns an observable that: - sends a query over http and returns the current list of results @@ -610,7 +629,7 @@ ___ *Inherited from [GraphNodeObserver](graphnodeobserver.md).[getObservableObject](graphnodeobserver.md#getobservableobject)* -*Defined in [graphnode.ts:287](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L287)* +*Defined in [graphnode.ts:302](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L302)* **Parameters:** @@ -636,7 +655,7 @@ ___ ▸ **proposal**(`id`: string): *[Proposal](proposal.md)* -*Defined in [arc.ts:156](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L156)* +*Defined in [arc.ts:163](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L163)* **Parameters:** @@ -652,7 +671,7 @@ ___ ▸ **proposals**(`options`: [IProposalQueryOptions](../interfaces/iproposalqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Proposal](proposal.md)[]›* -*Defined in [arc.ts:160](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L160)* +*Defined in [arc.ts:167](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L167)* **Parameters:** @@ -669,7 +688,7 @@ ___ ▸ **saveIPFSData**(`options`: object): *Promise‹string›* -*Defined in [arc.ts:410](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L410)* +*Defined in [arc.ts:426](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L426)* save data of a proposal to IPFS, return the IPFS hash @@ -681,9 +700,10 @@ an Object to save. This object must have title, url and desction defined Name | Type | ------ | ------ | -`description` | string | -`title` | string | -`url` | string | +`description?` | undefined | string | +`tags?` | string[] | +`title?` | undefined | string | +`url?` | undefined | string | **Returns:** *Promise‹string›* @@ -695,7 +715,7 @@ ___ ▸ **scheme**(`id`: string): *[Scheme](scheme.md)* -*Defined in [arc.ts:145](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L145)* +*Defined in [arc.ts:152](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L152)* **Parameters:** @@ -709,15 +729,15 @@ ___ ### schemes -▸ **schemes**(`options`: [ISchemeQueryOptions](../interfaces/ischemequeryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Scheme](scheme.md)[]›* +▸ **schemes**(`options`: ISchemeQueryOptions, `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Scheme](scheme.md)[]›* -*Defined in [arc.ts:149](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L149)* +*Defined in [arc.ts:156](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L156)* **Parameters:** Name | Type | Default | ------ | ------ | ------ | -`options` | [ISchemeQueryOptions](../interfaces/ischemequeryoptions.md) | {} | +`options` | ISchemeQueryOptions | {} | `apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | **Returns:** *Observable‹[Scheme](scheme.md)[]›* @@ -730,7 +750,7 @@ ___ *Inherited from [GraphNodeObserver](graphnodeobserver.md).[sendQuery](graphnodeobserver.md#sendquery)* -*Defined in [graphnode.ts:307](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L307)* +*Defined in [graphnode.ts:322](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L322)* **Parameters:** @@ -747,7 +767,7 @@ ___ ▸ **sendTransaction**<**T**>(`transaction`: any, `mapToObject`: function, `errorHandler`: function): *[Operation](../globals.md#operation)‹T›* -*Defined in [arc.ts:397](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L397)* +*Defined in [arc.ts:413](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L413)* send an Ethereum transaction @@ -789,7 +809,7 @@ ___ ▸ **setAccount**(`address`: [Address](../globals.md#address)): *void* -*Defined in [arc.ts:372](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L372)* +*Defined in [arc.ts:388](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L388)* **Parameters:** @@ -805,7 +825,7 @@ ___ ▸ **setContractInfos**(`contractInfos`: [IContractInfo](../interfaces/icontractinfo.md)[]): *Promise‹void›* -*Defined in [arc.ts:99](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L99)* +*Defined in [arc.ts:102](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L102)* set the contract addresses @@ -816,3 +836,20 @@ Name | Type | Description | `contractInfos` | [IContractInfo](../interfaces/icontractinfo.md)[] | a list of IContractInfo objects | **Returns:** *Promise‹void›* + +___ + +### tags + +▸ **tags**(`options`: [ITagQueryOptions](../interfaces/itagqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Tag](tag.md)[]›* + +*Defined in [arc.ts:148](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L148)* + +**Parameters:** + +Name | Type | Default | +------ | ------ | ------ | +`options` | [ITagQueryOptions](../interfaces/itagqueryoptions.md) | {} | +`apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | + +**Returns:** *Observable‹[Tag](tag.md)[]›* diff --git a/docs/classes/competition.md b/docs/classes/competition.md new file mode 100644 index 00000000..2c4f4b13 --- /dev/null +++ b/docs/classes/competition.md @@ -0,0 +1,147 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [Competition](competition.md) + +# Class: Competition + +## Hierarchy + +* **Competition** + +## Index + +### Constructors + +* [constructor](competition.md#constructor) + +### Properties + +* [context](competition.md#context) +* [id](competition.md#id) + +### Methods + +* [createSuggestion](competition.md#createsuggestion) +* [redeemSuggestion](competition.md#redeemsuggestion) +* [suggestions](competition.md#suggestions) +* [voteSuggestion](competition.md#votesuggestion) +* [search](competition.md#static-search) + +## Constructors + +### constructor + +\+ **new Competition**(`id`: string, `context`: [Arc](arc.md)): *[Competition](competition.md)* + +*Defined in [schemes/competition.ts:381](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L381)* + +**Parameters:** + +Name | Type | +------ | ------ | +`id` | string | +`context` | [Arc](arc.md) | + +**Returns:** *[Competition](competition.md)* + +## Properties + +### context + +• **context**: *[Arc](arc.md)* + +*Defined in [schemes/competition.ts:381](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L381)* + +___ + +### id + +• **id**: *string* + +*Defined in [schemes/competition.ts:380](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L380)* + +## Methods + +### createSuggestion + +▸ **createSuggestion**(`options`: object): *[Operation](../globals.md#operation)‹any›* + +*Defined in [schemes/competition.ts:389](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L389)* + +**Parameters:** + +▪ **options**: *object* + +Name | Type | +------ | ------ | +`description` | string | +`title` | string | +`url` | string | + +**Returns:** *[Operation](../globals.md#operation)‹any›* + +___ + +### redeemSuggestion + +▸ **redeemSuggestion**(`suggestionId`: number, `beneficiary`: [Address](../globals.md#address)): *[Operation](../globals.md#operation)‹boolean›* + +*Defined in [schemes/competition.ts:448](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L448)* + +**Parameters:** + +Name | Type | Default | +------ | ------ | ------ | +`suggestionId` | number | - | +`beneficiary` | [Address](../globals.md#address) | NULL_ADDRESS | + +**Returns:** *[Operation](../globals.md#operation)‹boolean›* + +___ + +### suggestions + +▸ **suggestions**(`options`: [ICompetitionSuggestionQueryOptions](../interfaces/icompetitionsuggestionqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[CompetitionSuggestion](competitionsuggestion.md)[]›* + +*Defined in [schemes/competition.ts:460](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L460)* + +**Parameters:** + +Name | Type | Default | +------ | ------ | ------ | +`options` | [ICompetitionSuggestionQueryOptions](../interfaces/icompetitionsuggestionqueryoptions.md) | {} | +`apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | + +**Returns:** *Observable‹[CompetitionSuggestion](competitionsuggestion.md)[]›* + +___ + +### voteSuggestion + +▸ **voteSuggestion**(`suggestionId`: number): *[Operation](../globals.md#operation)‹[CompetitionVote](competitionvote.md)›* + +*Defined in [schemes/competition.ts:437](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L437)* + +**Parameters:** + +Name | Type | +------ | ------ | +`suggestionId` | number | + +**Returns:** *[Operation](../globals.md#operation)‹[CompetitionVote](competitionvote.md)›* + +___ + +### `Static` search + +▸ **search**(`context`: [Arc](arc.md), `options`: [IProposalQueryOptions](../interfaces/iproposalqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Competition](competition.md)[]›* + +*Defined in [schemes/competition.ts:370](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L370)* + +**Parameters:** + +Name | Type | Default | +------ | ------ | ------ | +`context` | [Arc](arc.md) | - | +`options` | [IProposalQueryOptions](../interfaces/iproposalqueryoptions.md) | {} | +`apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | + +**Returns:** *Observable‹[Competition](competition.md)[]›* diff --git a/docs/classes/competitionscheme.md b/docs/classes/competitionscheme.md new file mode 100644 index 00000000..24c2b5db --- /dev/null +++ b/docs/classes/competitionscheme.md @@ -0,0 +1,460 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [CompetitionScheme](competitionscheme.md) + +# Class: CompetitionScheme + +## Hierarchy + +* [SchemeBase](schemebase.md) + + ↳ **CompetitionScheme** + +## Implements + +* [IStateful](../interfaces/istateful.md)‹[ISchemeState](../interfaces/ischemestate.md)› + +## Index + +### Constructors + +* [constructor](competitionscheme.md#constructor) + +### Properties + +* [ReputationFromToken](competitionscheme.md#reputationfromtoken) +* [context](competitionscheme.md#context) +* [id](competitionscheme.md#id) +* [staticState](competitionscheme.md#staticstate) + +### Methods + +* [competitions](competitionscheme.md#competitions) +* [createProposal](competitionscheme.md#createproposal) +* [createProposalErrorHandler](competitionscheme.md#createproposalerrorhandler) +* [createProposalTransaction](competitionscheme.md#createproposaltransaction) +* [createProposalTransactionMap](competitionscheme.md#createproposaltransactionmap) +* [fetchStaticState](competitionscheme.md#fetchstaticstate) +* [proposals](competitionscheme.md#proposals) +* [redeemSuggestion](competitionscheme.md#redeemsuggestion) +* [setStaticState](competitionscheme.md#setstaticstate) +* [state](competitionscheme.md#state) +* [voteSuggestion](competitionscheme.md#votesuggestion) +* [x](competitionscheme.md#x) + +### Object literals + +* [fragments](competitionscheme.md#static-fragments) + +## Constructors + +### constructor + +\+ **new CompetitionScheme**(`idOrOpts`: [Address](../globals.md#address) | [ISchemeStaticState](../interfaces/ischemestaticstate.md), `context`: [Arc](arc.md)): *[CompetitionScheme](competitionscheme.md)* + +*Inherited from [SchemeBase](schemebase.md).[constructor](schemebase.md#constructor)* + +*Defined in [schemes/base.ts:239](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L239)* + +**Parameters:** + +Name | Type | +------ | ------ | +`idOrOpts` | [Address](../globals.md#address) | [ISchemeStaticState](../interfaces/ischemestaticstate.md) | +`context` | [Arc](arc.md) | + +**Returns:** *[CompetitionScheme](competitionscheme.md)* + +## Properties + +### ReputationFromToken + +• **ReputationFromToken**: *[ReputationFromTokenScheme](reputationfromtokenscheme.md) | null* = null + +*Inherited from [SchemeBase](schemebase.md).[ReputationFromToken](schemebase.md#reputationfromtoken)* + +*Defined in [schemes/base.ts:239](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L239)* + +___ + +### context + +• **context**: *[Arc](arc.md)* + +*Inherited from [SchemeBase](schemebase.md).[context](schemebase.md#context)* + +*Defined in [schemes/base.ts:241](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L241)* + +___ + +### id + +• **id**: *[Address](../globals.md#address)* + +*Inherited from [SchemeBase](schemebase.md).[id](schemebase.md#id)* + +*Defined in [schemes/base.ts:237](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L237)* + +___ + +### staticState + +• **staticState**: *[ISchemeStaticState](../interfaces/ischemestaticstate.md) | null* = null + +*Inherited from [SchemeBase](schemebase.md).[staticState](schemebase.md#staticstate)* + +*Defined in [schemes/base.ts:238](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L238)* + +## Methods + +### competitions + +▸ **competitions**(`options`: [IProposalQueryOptions](../interfaces/iproposalqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Competition](competition.md)[]›* + +*Defined in [schemes/competition.ts:168](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L168)* + +Return a list of competitions in this scheme. + +**Parameters:** + +Name | Type | Default | Description | +------ | ------ | ------ | ------ | +`options` | [IProposalQueryOptions](../interfaces/iproposalqueryoptions.md) | {} | - | +`apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | | + +**Returns:** *Observable‹[Competition](competition.md)[]›* + +___ + +### createProposal + +▸ **createProposal**(`options`: [IProposalCreateOptionsCompetition](../interfaces/iproposalcreateoptionscompetition.md)): *[Operation](../globals.md#operation)‹[Proposal](proposal.md)›* + +*Overrides [SchemeBase](schemebase.md).[createProposal](schemebase.md#createproposal)* + +*Defined in [schemes/competition.ts:263](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L263)* + +**Parameters:** + +Name | Type | +------ | ------ | +`options` | [IProposalCreateOptionsCompetition](../interfaces/iproposalcreateoptionscompetition.md) | + +**Returns:** *[Operation](../globals.md#operation)‹[Proposal](proposal.md)›* + +___ + +### createProposalErrorHandler + +▸ **createProposalErrorHandler**(`options`: any): *function* + +*Overrides [SchemeBase](schemebase.md).[createProposalErrorHandler](schemebase.md#createproposalerrorhandler)* + +*Defined in [schemes/competition.ts:254](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L254)* + +**Parameters:** + +Name | Type | +------ | ------ | +`options` | any | + +**Returns:** *function* + +▸ (`err`: Error): *Error | Promise‹Error›* + +**Parameters:** + +Name | Type | +------ | ------ | +`err` | Error | + +___ + +### createProposalTransaction + +▸ **createProposalTransaction**(`options`: [IProposalCreateOptionsCompetition](../interfaces/iproposalcreateoptionscompetition.md)): *(Anonymous function)* + +*Overrides [SchemeBase](schemebase.md).[createProposalTransaction](schemebase.md#createproposaltransaction)* + +*Defined in [schemes/competition.ts:188](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L188)* + +**Parameters:** + +Name | Type | +------ | ------ | +`options` | [IProposalCreateOptionsCompetition](../interfaces/iproposalcreateoptionscompetition.md) | + +**Returns:** *(Anonymous function)* + +___ + +### createProposalTransactionMap + +▸ **createProposalTransactionMap**(): *txMap* + +*Overrides [SchemeBase](schemebase.md).[createProposalTransactionMap](schemebase.md#createproposaltransactionmap)* + +*Defined in [schemes/competition.ts:245](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L245)* + +**Returns:** *txMap* + +___ + +### fetchStaticState + +▸ **fetchStaticState**(): *Promise‹[ISchemeStaticState](../interfaces/ischemestaticstate.md)›* + +*Inherited from [SchemeBase](schemebase.md).[fetchStaticState](schemebase.md#fetchstaticstate)* + +*Defined in [schemes/base.ts:256](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L256)* + +fetch the static state from the subgraph + +**Returns:** *Promise‹[ISchemeStaticState](../interfaces/ischemestaticstate.md)›* + +the statatic state + +___ + +### proposals + +▸ **proposals**(`options`: [IProposalQueryOptions](../interfaces/iproposalqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Proposal](proposal.md)[]›* + +*Inherited from [SchemeBase](schemebase.md).[proposals](schemebase.md#proposals)* + +*Defined in [schemes/base.ts:467](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L467)* + +**Parameters:** + +Name | Type | Default | +------ | ------ | ------ | +`options` | [IProposalQueryOptions](../interfaces/iproposalqueryoptions.md) | {} | +`apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | + +**Returns:** *Observable‹[Proposal](proposal.md)[]›* + +___ + +### redeemSuggestion + +▸ **redeemSuggestion**(`options`: object): *[Operation](../globals.md#operation)‹boolean›* + +*Defined in [schemes/competition.ts:316](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L316)* + +**Parameters:** + +▪ **options**: *object* + +Name | Type | +------ | ------ | +`beneficiary` | [Address](../globals.md#address) | +`suggestionId` | number | + +**Returns:** *[Operation](../globals.md#operation)‹boolean›* + +___ + +### setStaticState + +▸ **setStaticState**(`opts`: [ISchemeStaticState](../interfaces/ischemestaticstate.md)): *void* + +*Inherited from [SchemeBase](schemebase.md).[setStaticState](schemebase.md#setstaticstate)* + +*Defined in [schemes/base.ts:279](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L279)* + +**Parameters:** + +Name | Type | +------ | ------ | +`opts` | [ISchemeStaticState](../interfaces/ischemestaticstate.md) | + +**Returns:** *void* + +___ + +### state + +▸ **state**(`apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[ISchemeState](../interfaces/ischemestate.md)›* + +*Overrides [SchemeBase](schemebase.md).[state](schemebase.md#abstract-state)* + +*Defined in [schemes/competition.ts:83](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L83)* + +**Parameters:** + +Name | Type | Default | +------ | ------ | ------ | +`apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | + +**Returns:** *Observable‹[ISchemeState](../interfaces/ischemestate.md)›* + +___ + +### voteSuggestion + +▸ **voteSuggestion**(`options`: object): *[Operation](../globals.md#operation)‹[CompetitionVote](competitionvote.md)›* + +*Defined in [schemes/competition.ts:267](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L267)* + +**Parameters:** + +▪ **options**: *object* + +Name | Type | +------ | ------ | +`suggestionId` | number | + +**Returns:** *[Operation](../globals.md#operation)‹[CompetitionVote](competitionvote.md)›* + +___ + +### x + +▸ **x**(): *void* + +*Inherited from [SchemeBase](schemebase.md).[x](schemebase.md#x)* + +*Defined in [schemes/base.ts:319](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L319)* + +**Returns:** *void* + +## Object literals + +### `Static` fragments + +### ▪ **fragments**: *object* + +*Inherited from [SchemeBase](schemebase.md).[fragments](schemebase.md#static-fragments)* + +*Defined in [schemes/base.ts:106](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L106)* + +### 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](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L107)* diff --git a/docs/classes/competitionsuggestion.md b/docs/classes/competitionsuggestion.md new file mode 100644 index 00000000..056ea192 --- /dev/null +++ b/docs/classes/competitionsuggestion.md @@ -0,0 +1,255 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [CompetitionSuggestion](competitionsuggestion.md) + +# Class: CompetitionSuggestion + +## Hierarchy + +* **CompetitionSuggestion** + +## Index + +### Constructors + +* [constructor](competitionsuggestion.md#constructor) + +### Properties + +* [context](competitionsuggestion.md#context) +* [id](competitionsuggestion.md#id) +* [staticState](competitionsuggestion.md#optional-staticstate) +* [suggestionId](competitionsuggestion.md#optional-suggestionid) + +### Methods + +* [fetchStaticState](competitionsuggestion.md#fetchstaticstate) +* [redeem](competitionsuggestion.md#redeem) +* [setStaticState](competitionsuggestion.md#setstaticstate) +* [state](competitionsuggestion.md#state) +* [vote](competitionsuggestion.md#vote) +* [votes](competitionsuggestion.md#votes) +* [calculateId](competitionsuggestion.md#static-calculateid) +* [mapItemToObject](competitionsuggestion.md#static-private-mapitemtoobject) +* [search](competitionsuggestion.md#static-search) + +### Object literals + +* [fragments](competitionsuggestion.md#static-fragments) + +## Constructors + +### constructor + +\+ **new CompetitionSuggestion**(`idOrOpts`: string | object | [ICompetitionSuggestion](../interfaces/icompetitionsuggestion.md), `context`: [Arc](arc.md)): *[CompetitionSuggestion](competitionsuggestion.md)* + +*Defined in [schemes/competition.ts:565](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L565)* + +**Parameters:** + +Name | Type | +------ | ------ | +`idOrOpts` | string | object | [ICompetitionSuggestion](../interfaces/icompetitionsuggestion.md) | +`context` | [Arc](arc.md) | + +**Returns:** *[CompetitionSuggestion](competitionsuggestion.md)* + +## Properties + +### context + +• **context**: *[Arc](arc.md)* + +*Defined in [schemes/competition.ts:567](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L567)* + +___ + +### id + +• **id**: *string* + +*Defined in [schemes/competition.ts:563](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L563)* + +___ + +### `Optional` staticState + +• **staticState**? : *[ICompetitionSuggestion](../interfaces/icompetitionsuggestion.md)* + +*Defined in [schemes/competition.ts:565](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L565)* + +___ + +### `Optional` suggestionId + +• **suggestionId**? : *undefined | number* + +*Defined in [schemes/competition.ts:564](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L564)* + +## Methods + +### fetchStaticState + +▸ **fetchStaticState**(): *Promise‹[ICompetitionSuggestion](../interfaces/icompetitionsuggestion.md)›* + +*Defined in [schemes/competition.ts:589](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L589)* + +**Returns:** *Promise‹[ICompetitionSuggestion](../interfaces/icompetitionsuggestion.md)›* + +___ + +### redeem + +▸ **redeem**(`beneficiary`: [Address](../globals.md#address)): *[Operation](../globals.md#operation)‹boolean›* + +*Defined in [schemes/competition.ts:627](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L627)* + +**Parameters:** + +Name | Type | Default | +------ | ------ | ------ | +`beneficiary` | [Address](../globals.md#address) | NULL_ADDRESS | + +**Returns:** *[Operation](../globals.md#operation)‹boolean›* + +___ + +### setStaticState + +▸ **setStaticState**(`opts`: [ICompetitionSuggestion](../interfaces/icompetitionsuggestion.md)): *void* + +*Defined in [schemes/competition.ts:585](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L585)* + +**Parameters:** + +Name | Type | +------ | ------ | +`opts` | [ICompetitionSuggestion](../interfaces/icompetitionsuggestion.md) | + +**Returns:** *void* + +___ + +### state + +▸ **state**(`apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[ICompetitionSuggestion](../interfaces/icompetitionsuggestion.md)›* + +*Defined in [schemes/competition.ts:593](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L593)* + +**Parameters:** + +Name | Type | Default | +------ | ------ | ------ | +`apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | + +**Returns:** *Observable‹[ICompetitionSuggestion](../interfaces/icompetitionsuggestion.md)›* + +___ + +### vote + +▸ **vote**(): *[Operation](../globals.md#operation)‹[CompetitionVote](competitionvote.md)›* + +*Defined in [schemes/competition.ts:607](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L607)* + +**Returns:** *[Operation](../globals.md#operation)‹[CompetitionVote](competitionvote.md)›* + +___ + +### votes + +▸ **votes**(`options`: [ICompetitionVoteQueryOptions](../interfaces/icompetitionvotequeryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[CompetitionVote](competitionvote.md)[]›* + +*Defined in [schemes/competition.ts:618](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L618)* + +**Parameters:** + +Name | Type | Default | +------ | ------ | ------ | +`options` | [ICompetitionVoteQueryOptions](../interfaces/icompetitionvotequeryoptions.md) | {} | +`apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | + +**Returns:** *Observable‹[CompetitionVote](competitionvote.md)[]›* + +___ + +### `Static` calculateId + +▸ **calculateId**(`opts`: object): *string* + +*Defined in [schemes/competition.ts:501](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L501)* + +**Parameters:** + +▪ **opts**: *object* + +Name | Type | +------ | ------ | +`scheme` | [Address](../globals.md#address) | +`suggestionId` | number | + +**Returns:** *string* + +___ + +### `Static` `Private` mapItemToObject + +▸ **mapItemToObject**(`item`: any, `context`: [Arc](arc.md)): *[ICompetitionSuggestion](../interfaces/icompetitionsuggestion.md) | null* + +*Defined in [schemes/competition.ts:542](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L542)* + +**Parameters:** + +Name | Type | +------ | ------ | +`item` | any | +`context` | [Arc](arc.md) | + +**Returns:** *[ICompetitionSuggestion](../interfaces/icompetitionsuggestion.md) | null* + +___ + +### `Static` search + +▸ **search**(`context`: [Arc](arc.md), `options`: [ICompetitionSuggestionQueryOptions](../interfaces/icompetitionsuggestionqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[CompetitionSuggestion](competitionsuggestion.md)[]›* + +*Defined in [schemes/competition.ts:509](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L509)* + +**Parameters:** + +Name | Type | Default | +------ | ------ | ------ | +`context` | [Arc](arc.md) | - | +`options` | [ICompetitionSuggestionQueryOptions](../interfaces/icompetitionsuggestionqueryoptions.md) | {} | +`apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | + +**Returns:** *Observable‹[CompetitionSuggestion](competitionsuggestion.md)[]›* + +## Object literals + +### `Static` fragments + +### ▪ **fragments**: *object* + +*Defined in [schemes/competition.ts:480](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L480)* + +### CompetitionSuggestionFields + +• **CompetitionSuggestionFields**: *any* = gql`fragment CompetitionSuggestionFields on CompetitionSuggestion { + id + suggestionId + proposal { + id + } + descriptionHash + title + description + url + # fulltext: [string] + suggester + # votes: [CompetitionVote!] @derivedFrom(field: "suggestion") + totalVotes + createdAt + redeemedAt + rewardPercentage + }` + +*Defined in [schemes/competition.ts:481](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L481)* diff --git a/docs/classes/competitionvote.md b/docs/classes/competitionvote.md new file mode 100644 index 00000000..1a382c3c --- /dev/null +++ b/docs/classes/competitionvote.md @@ -0,0 +1,142 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [CompetitionVote](competitionvote.md) + +# Class: CompetitionVote + +## Hierarchy + +* **CompetitionVote** + +## Index + +### Constructors + +* [constructor](competitionvote.md#constructor) + +### Properties + +* [context](competitionvote.md#context) +* [id](competitionvote.md#optional-id) +* [staticState](competitionvote.md#optional-staticstate) + +### Methods + +* [setStaticState](competitionvote.md#setstaticstate) +* [calculateId](competitionvote.md#static-calculateid) +* [search](competitionvote.md#static-search) + +### Object literals + +* [fragments](competitionvote.md#static-fragments) + +## Constructors + +### constructor + +\+ **new CompetitionVote**(`idOrOpts`: string | [ICompetitionVote](../interfaces/icompetitionvote.md), `context`: [Arc](arc.md)): *[CompetitionVote](competitionvote.md)* + +*Defined in [schemes/competition.ts:695](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L695)* + +**Parameters:** + +Name | Type | +------ | ------ | +`idOrOpts` | string | [ICompetitionVote](../interfaces/icompetitionvote.md) | +`context` | [Arc](arc.md) | + +**Returns:** *[CompetitionVote](competitionvote.md)* + +## Properties + +### context + +• **context**: *[Arc](arc.md)* + +*Defined in [schemes/competition.ts:697](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L697)* + +___ + +### `Optional` id + +• **id**? : *undefined | string* + +*Defined in [schemes/competition.ts:694](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L694)* + +___ + +### `Optional` staticState + +• **staticState**? : *[ICompetitionVote](../interfaces/icompetitionvote.md)* + +*Defined in [schemes/competition.ts:695](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L695)* + +## Methods + +### setStaticState + +▸ **setStaticState**(`opts`: [ICompetitionVote](../interfaces/icompetitionvote.md)): *void* + +*Defined in [schemes/competition.ts:707](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L707)* + +**Parameters:** + +Name | Type | +------ | ------ | +`opts` | [ICompetitionVote](../interfaces/icompetitionvote.md) | + +**Returns:** *void* + +___ + +### `Static` calculateId + +▸ **calculateId**(`opts`: object): *string* + +*Defined in [schemes/competition.ts:657](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L657)* + +**Parameters:** + +▪ **opts**: *object* + +Name | Type | +------ | ------ | +`scheme` | [Address](../globals.md#address) | +`suggestionId` | number | + +**Returns:** *string* + +___ + +### `Static` search + +▸ **search**(`context`: [Arc](arc.md), `options`: [ICompetitionVoteQueryOptions](../interfaces/icompetitionvotequeryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[CompetitionVote](competitionvote.md)[]›* + +*Defined in [schemes/competition.ts:665](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L665)* + +**Parameters:** + +Name | Type | Default | +------ | ------ | ------ | +`context` | [Arc](arc.md) | - | +`options` | [ICompetitionVoteQueryOptions](../interfaces/icompetitionvotequeryoptions.md) | {} | +`apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | + +**Returns:** *Observable‹[CompetitionVote](competitionvote.md)[]›* + +## Object literals + +### `Static` fragments + +### ▪ **fragments**: *object* + +*Defined in [schemes/competition.ts:649](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L649)* + +### CompetitionVoteFields + +• **CompetitionVoteFields**: *any* = gql`fragment CompetitionVoteFields on CompetitionVote { + id + createdAt + reputation + voter + }` + +*Defined in [schemes/competition.ts:650](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L650)* diff --git a/docs/classes/dao.md b/docs/classes/dao.md index bb458932..f9a57b20 100644 --- a/docs/classes/dao.md +++ b/docs/classes/dao.md @@ -51,7 +51,7 @@ \+ **new DAO**(`idOrOpts`: [Address](../globals.md#address) | [IDAOStaticState](../interfaces/idaostaticstate.md), `context`: [Arc](arc.md)): *[DAO](dao.md)* -*Defined in [dao.ts:134](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L134)* +*Defined in [dao.ts:136](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L136)* **Parameters:** @@ -68,7 +68,7 @@ Name | Type | • **context**: *[Arc](arc.md)* -*Defined in [dao.ts:136](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L136)* +*Defined in [dao.ts:138](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L138)* ___ @@ -76,7 +76,7 @@ ___ • **id**: *[Address](../globals.md#address)* -*Defined in [dao.ts:133](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L133)* +*Defined in [dao.ts:135](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L135)* ___ @@ -84,15 +84,15 @@ ___ • **staticState**: *[IDAOStaticState](../interfaces/idaostaticstate.md) | undefined* -*Defined in [dao.ts:134](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L134)* +*Defined in [dao.ts:136](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L136)* ## Methods ### createProposal -▸ **createProposal**(`options`: [IProposalCreateOptions](../globals.md#iproposalcreateoptions)): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹[Proposal](proposal.md)››* +▸ **createProposal**(`options`: [IProposalCreateOptions](../globals.md#iproposalcreateoptions)): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹[Proposal](proposal.md)‹›››* -*Defined in [dao.ts:268](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L268)* +*Defined in [dao.ts:270](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L270)* create a new proposal in this DAO @@ -102,7 +102,7 @@ Name | Type | ------ | ------ | `options` | [IProposalCreateOptions](../globals.md#iproposalcreateoptions) | -**Returns:** *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹[Proposal](proposal.md)››* +**Returns:** *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹[Proposal](proposal.md)‹›››* a Proposal instance @@ -110,13 +110,13 @@ ___ ### ethBalance -▸ **ethBalance**(): *Observable‹any›* +▸ **ethBalance**(): *Observable‹BN›* -*Defined in [dao.ts:320](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L320)* +*Defined in [dao.ts:343](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L343)* get (an observable of) the Ether balance of the DAO from the web3Provider -**Returns:** *Observable‹any›* +**Returns:** *Observable‹BN›* an observable stream of BN number instances @@ -126,7 +126,7 @@ ___ ▸ **fetchStaticState**(): *Promise‹[IDAOStaticState](../interfaces/idaostaticstate.md)›* -*Defined in [dao.ts:149](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L149)* +*Defined in [dao.ts:151](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L151)* **Returns:** *Promise‹[IDAOStaticState](../interfaces/idaostaticstate.md)›* @@ -136,7 +136,7 @@ ___ ▸ **member**(`address`: [Address](../globals.md#address)): *[Member](member.md)* -*Defined in [dao.ts:253](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L253)* +*Defined in [dao.ts:255](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L255)* **Parameters:** @@ -152,7 +152,7 @@ ___ ▸ **members**(`options`: [IMemberQueryOptions](../interfaces/imemberqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Member](member.md)[]›* -*Defined in [dao.ts:244](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L244)* +*Defined in [dao.ts:246](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L246)* **Parameters:** @@ -169,7 +169,7 @@ ___ ▸ **nativeReputation**(): *Observable‹[Reputation](reputation.md)›* -*Defined in [dao.ts:223](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L223)* +*Defined in [dao.ts:225](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L225)* **Returns:** *Observable‹[Reputation](reputation.md)›* @@ -179,7 +179,7 @@ ___ ▸ **proposal**(`proposalId`: string): *[Proposal](proposal.md)* -*Defined in [dao.ts:284](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L284)* +*Defined in [dao.ts:307](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L307)* **Parameters:** @@ -195,7 +195,7 @@ ___ ▸ **proposals**(`options`: [IProposalQueryOptions](../interfaces/iproposalqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Proposal](proposal.md)[]›* -*Defined in [dao.ts:273](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L273)* +*Defined in [dao.ts:296](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L296)* **Parameters:** @@ -212,7 +212,7 @@ ___ ▸ **rewards**(`options`: [IRewardQueryOptions](../interfaces/irewardqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Reward](reward.md)[]›* -*Defined in [dao.ts:288](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L288)* +*Defined in [dao.ts:311](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L311)* **Parameters:** @@ -227,15 +227,15 @@ ___ ### scheme -▸ **scheme**(`options`: [ISchemeQueryOptions](../interfaces/ischemequeryoptions.md)): *Promise‹[Scheme](scheme.md)›* +▸ **scheme**(`options`: ISchemeQueryOptions): *Promise‹[Scheme](scheme.md)›* -*Defined in [dao.ts:236](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L236)* +*Defined in [dao.ts:238](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L238)* **Parameters:** Name | Type | ------ | ------ | -`options` | [ISchemeQueryOptions](../interfaces/ischemequeryoptions.md) | +`options` | ISchemeQueryOptions | **Returns:** *Promise‹[Scheme](scheme.md)›* @@ -243,15 +243,15 @@ ___ ### schemes -▸ **schemes**(`options`: [ISchemeQueryOptions](../interfaces/ischemequeryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Scheme](scheme.md)[]›* +▸ **schemes**(`options`: ISchemeQueryOptions, `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Scheme](scheme.md)[]›* -*Defined in [dao.ts:227](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L227)* +*Defined in [dao.ts:229](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L229)* **Parameters:** Name | Type | Default | ------ | ------ | ------ | -`options` | [ISchemeQueryOptions](../interfaces/ischemequeryoptions.md) | {} | +`options` | ISchemeQueryOptions | {} | `apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | **Returns:** *Observable‹[Scheme](scheme.md)[]›* @@ -262,7 +262,7 @@ ___ ▸ **setStaticState**(`opts`: [IDAOStaticState](../interfaces/idaostaticstate.md)): *void* -*Defined in [dao.ts:145](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L145)* +*Defined in [dao.ts:147](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L147)* **Parameters:** @@ -278,7 +278,7 @@ ___ ▸ **stakes**(`options`: [IStakeQueryOptions](../interfaces/istakequeryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Stake](stake.md)[]›* -*Defined in [dao.ts:306](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L306)* +*Defined in [dao.ts:329](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L329)* **Parameters:** @@ -295,7 +295,7 @@ ___ ▸ **state**(`apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[IDAOState](../interfaces/idaostate.md)›* -*Defined in [dao.ts:173](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L173)* +*Defined in [dao.ts:175](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L175)* get the current state of the DAO @@ -315,7 +315,7 @@ ___ ▸ **votes**(`options`: [IVoteQueryOptions](../interfaces/ivotequeryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Vote](vote.md)[]›* -*Defined in [dao.ts:297](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L297)* +*Defined in [dao.ts:320](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L320)* **Parameters:** @@ -332,7 +332,7 @@ ___ ▸ **search**(`context`: [Arc](arc.md), `options`: [IDAOQueryOptions](../interfaces/idaoqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[DAO](dao.md)[]›* -*Defined in [dao.ts:69](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L69)* +*Defined in [dao.ts:71](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L71)* DAO.search(context, options) searches for DAO entities @@ -354,7 +354,7 @@ an observable of DAO objects ### ▪ **fragments**: *object* -*Defined in [dao.ts:48](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L48)* +*Defined in [dao.ts:50](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L50)* ### DAOFields @@ -371,4 +371,4 @@ an observable of DAO objects reputationHoldersCount }` -*Defined in [dao.ts:49](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L49)* +*Defined in [dao.ts:51](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L51)* diff --git a/docs/classes/event.md b/docs/classes/event.md new file mode 100644 index 00000000..e3e9dd02 --- /dev/null +++ b/docs/classes/event.md @@ -0,0 +1,174 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [Event](event.md) + +# Class: Event + +## Hierarchy + +* **Event** + +## Implements + +* [IStateful](../interfaces/istateful.md)‹[IEventState](../interfaces/ieventstate.md)› + +## Index + +### Constructors + +* [constructor](event.md#constructor) + +### Properties + +* [context](event.md#context) +* [id](event.md#id) +* [idOrOpts](event.md#idoropts) +* [staticState](event.md#staticstate) + +### Methods + +* [fetchStaticState](event.md#fetchstaticstate) +* [setStaticState](event.md#setstaticstate) +* [state](event.md#state) +* [search](event.md#static-search) + +### Object literals + +* [fragments](event.md#static-fragments) + +## Constructors + +### constructor + +\+ **new Event**(`idOrOpts`: string | [IEventStaticState](../interfaces/ieventstaticstate.md), `context`: [Arc](arc.md)): *[Event](event.md)* + +*Defined in [event.ts:90](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L90)* + +**Parameters:** + +Name | Type | +------ | ------ | +`idOrOpts` | string | [IEventStaticState](../interfaces/ieventstaticstate.md) | +`context` | [Arc](arc.md) | + +**Returns:** *[Event](event.md)* + +## Properties + +### context + +• **context**: *[Arc](arc.md)* + +*Defined in [event.ts:92](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L92)* + +___ + +### id + +• **id**: *string* + +*Defined in [event.ts:89](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L89)* + +___ + +### idOrOpts + +• **idOrOpts**: *string | [IEventStaticState](../interfaces/ieventstaticstate.md)* + +*Defined in [event.ts:92](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L92)* + +___ + +### staticState + +• **staticState**: *[IEventStaticState](../interfaces/ieventstaticstate.md) | undefined* + +*Defined in [event.ts:90](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L90)* + +## Methods + +### fetchStaticState + +▸ **fetchStaticState**(): *Promise‹[IEventStaticState](../interfaces/ieventstaticstate.md)›* + +*Defined in [event.ts:135](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L135)* + +**Returns:** *Promise‹[IEventStaticState](../interfaces/ieventstaticstate.md)›* + +___ + +### setStaticState + +▸ **setStaticState**(`opts`: [IEventStaticState](../interfaces/ieventstaticstate.md)): *void* + +*Defined in [event.ts:131](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L131)* + +**Parameters:** + +Name | Type | +------ | ------ | +`opts` | [IEventStaticState](../interfaces/ieventstaticstate.md) | + +**Returns:** *void* + +___ + +### state + +▸ **state**(`apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[IEventState](../interfaces/ieventstate.md)›* + +*Defined in [event.ts:102](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L102)* + +**Parameters:** + +Name | Type | Default | +------ | ------ | ------ | +`apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | + +**Returns:** *Observable‹[IEventState](../interfaces/ieventstate.md)›* + +___ + +### `Static` search + +▸ **search**(`context`: [Arc](arc.md), `options`: [IEventQueryOptions](../interfaces/ieventqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Event](event.md)[]›* + +*Defined in [event.ts:56](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L56)* + +Event.search(context, options) searches for reward entities + +**Parameters:** + +Name | Type | Default | Description | +------ | ------ | ------ | ------ | +`context` | [Arc](arc.md) | - | an Arc instance that provides connection information | +`options` | [IEventQueryOptions](../interfaces/ieventqueryoptions.md) | {} | the query options, cf. IEventQueryOptions | +`apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | - | + +**Returns:** *Observable‹[Event](event.md)[]›* + +an observable of Event objects + +## Object literals + +### `Static` fragments + +### ▪ **fragments**: *object* + +*Defined in [event.ts:34](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L34)* + +### EventFields + +• **EventFields**: *any* = gql`fragment EventFields on Event { + id + dao { + id + } + type + data + user + proposal { + id + } + timestamp + }` + +*Defined in [event.ts:35](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L35)* diff --git a/docs/classes/graphnodeobserver.md b/docs/classes/graphnodeobserver.md index 0285b688..2d5b9a86 100644 --- a/docs/classes/graphnodeobserver.md +++ b/docs/classes/graphnodeobserver.md @@ -40,7 +40,7 @@ handles connections with the Graph \+ **new GraphNodeObserver**(`options`: object): *[GraphNodeObserver](graphnodeobserver.md)* -*Defined in [graphnode.ts:103](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L103)* +*Defined in [graphnode.ts:119](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L119)* **Parameters:** @@ -60,7 +60,7 @@ Name | Type | • **Logger**: *GlobalLogger* = Logger -*Defined in [graphnode.ts:101](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L101)* +*Defined in [graphnode.ts:117](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L117)* ___ @@ -68,7 +68,7 @@ ___ • **apolloClient**? : *ApolloClient‹object›* -*Defined in [graphnode.ts:102](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L102)* +*Defined in [graphnode.ts:118](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L118)* ___ @@ -76,7 +76,7 @@ ___ • **graphqlHttpProvider**? : *undefined | string* -*Defined in [graphnode.ts:99](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L99)* +*Defined in [graphnode.ts:115](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L115)* ___ @@ -84,7 +84,7 @@ ___ • **graphqlSubscribeToQueries**? : *undefined | false | true* -*Defined in [graphnode.ts:103](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L103)* +*Defined in [graphnode.ts:119](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L119)* ___ @@ -92,7 +92,7 @@ ___ • **graphqlWsProvider**? : *undefined | string* -*Defined in [graphnode.ts:100](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L100)* +*Defined in [graphnode.ts:116](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L116)* ## Methods @@ -100,7 +100,7 @@ ___ ▸ **getObservable**(`query`: any, `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *any* -*Defined in [graphnode.ts:129](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L129)* +*Defined in [graphnode.ts:145](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L145)* Given a gql query, will return an observable of query results @@ -121,7 +121,7 @@ ___ ▸ **getObservableList**(`query`: any, `itemMap`: function, `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *any* -*Defined in [graphnode.ts:231](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L231)* +*Defined in [graphnode.ts:246](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L246)* Returns an observable that: - sends a query over http and returns the current list of results @@ -169,7 +169,7 @@ ___ ▸ **getObservableListWithFilter**(`query`: any, `itemMap`: function, `filterFunc`: function, `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *any* -*Defined in [graphnode.ts:270](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L270)* +*Defined in [graphnode.ts:285](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L285)* Returns an observable that: - sends a query over http and returns the current list of results @@ -222,7 +222,7 @@ ___ ▸ **getObservableObject**(`query`: any, `itemMap`: function, `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *any* -*Defined in [graphnode.ts:287](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L287)* +*Defined in [graphnode.ts:302](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L302)* **Parameters:** @@ -248,7 +248,7 @@ ___ ▸ **sendQuery**(`query`: any, `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Promise‹object›* -*Defined in [graphnode.ts:307](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L307)* +*Defined in [graphnode.ts:322](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L322)* **Parameters:** diff --git a/docs/classes/member.md b/docs/classes/member.md index 22140753..c06f5028 100644 --- a/docs/classes/member.md +++ b/docs/classes/member.md @@ -47,7 +47,7 @@ Represents an account that holds reputaion in a specific DAO \+ **new Member**(`idOrOpts`: string | [IMemberStaticState](../interfaces/imemberstaticstate.md), `context`: [Arc](arc.md)): *[Member](member.md)* -*Defined in [member.ts:107](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L107)* +*Defined in [member.ts:107](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L107)* **Parameters:** @@ -64,7 +64,7 @@ Name | Type | Description | • **context**: *[Arc](arc.md)* -*Defined in [member.ts:114](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L114)* +*Defined in [member.ts:114](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L114)* an instance of Arc @@ -74,7 +74,7 @@ ___ • **id**: *string | undefined* -*Defined in [member.ts:106](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L106)* +*Defined in [member.ts:106](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L106)* ___ @@ -82,7 +82,7 @@ ___ • **staticState**: *[IMemberStaticState](../interfaces/imemberstaticstate.md) | undefined* -*Defined in [member.ts:107](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L107)* +*Defined in [member.ts:107](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L107)* ## Methods @@ -90,7 +90,7 @@ ___ ▸ **calculateId**(`opts`: object): *string* -*Defined in [member.ts:136](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L136)* +*Defined in [member.ts:136](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L136)* **Parameters:** @@ -109,7 +109,7 @@ ___ ▸ **dao**(): *Promise‹[DAO](dao.md)›* -*Defined in [member.ts:231](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L231)* +*Defined in [member.ts:231](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L231)* **Returns:** *Promise‹[DAO](dao.md)›* @@ -119,7 +119,7 @@ ___ ▸ **fetchStaticState**(): *Promise‹[IMemberStaticState](../interfaces/imemberstaticstate.md)›* -*Defined in [member.ts:123](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L123)* +*Defined in [member.ts:123](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L123)* **Returns:** *Promise‹[IMemberStaticState](../interfaces/imemberstaticstate.md)›* @@ -129,7 +129,7 @@ ___ ▸ **proposals**(`options`: [IProposalQueryOptions](../interfaces/iproposalqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Proposal](proposal.md)[]›* -*Defined in [member.ts:240](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L240)* +*Defined in [member.ts:240](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L240)* **Parameters:** @@ -146,7 +146,7 @@ ___ ▸ **rewards**(): *Observable‹[Reward](reward.md)[]›* -*Defined in [member.ts:236](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L236)* +*Defined in [member.ts:236](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L236)* **Returns:** *Observable‹[Reward](reward.md)[]›* @@ -156,7 +156,7 @@ ___ ▸ **setStaticState**(`opts`: [IMemberStaticState](../interfaces/imemberstaticstate.md)): *[IMemberStaticState](../interfaces/imemberstaticstate.md)* -*Defined in [member.ts:143](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L143)* +*Defined in [member.ts:143](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L143)* **Parameters:** @@ -172,7 +172,7 @@ ___ ▸ **stakes**(`options`: [IStakeQueryOptions](../interfaces/istakequeryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Stake](stake.md)[]›* -*Defined in [member.ts:256](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L256)* +*Defined in [member.ts:256](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L256)* **Parameters:** @@ -189,7 +189,7 @@ ___ ▸ **state**(`apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[IMemberState](../interfaces/imemberstate.md)›* -*Defined in [member.ts:158](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L158)* +*Defined in [member.ts:158](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L158)* **Parameters:** @@ -205,7 +205,7 @@ ___ ▸ **votes**(`options`: [IVoteQueryOptions](../interfaces/ivotequeryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Vote](vote.md)[]›* -*Defined in [member.ts:269](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L269)* +*Defined in [member.ts:269](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L269)* **Parameters:** @@ -222,7 +222,7 @@ ___ ▸ **search**(`context`: [Arc](arc.md), `options`: [IMemberQueryOptions](../interfaces/imemberqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Member](member.md)[]›* -*Defined in [member.ts:64](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L64)* +*Defined in [member.ts:64](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L64)* Member.search(context, options) searches for member entities @@ -244,7 +244,7 @@ an observable of IRewardState objects ### ▪ **fragments**: *object* -*Defined in [member.ts:44](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L44)* +*Defined in [member.ts:44](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L44)* ### ReputationHolderFields @@ -260,4 +260,4 @@ an observable of IRewardState objects } ` -*Defined in [member.ts:45](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L45)* +*Defined in [member.ts:45](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L45)* diff --git a/docs/classes/proposal.md b/docs/classes/proposal.md index e2fcbac0..1665a977 100644 --- a/docs/classes/proposal.md +++ b/docs/classes/proposal.md @@ -38,7 +38,6 @@ * [vote](proposal.md#vote) * [votes](proposal.md#votes) * [votingMachine](proposal.md#votingmachine) -* [create](proposal.md#static-create) * [search](proposal.md#static-search) ### Object literals @@ -51,7 +50,7 @@ \+ **new Proposal**(`idOrOpts`: string | [IProposalStaticState](../interfaces/iproposalstaticstate.md), `context`: [Arc](arc.md)): *[Proposal](proposal.md)* -*Defined in [proposal.ts:345](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L345)* +*Defined in [proposal.ts:338](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L338)* **Parameters:** @@ -68,7 +67,7 @@ Name | Type | • **context**: *[Arc](arc.md)* -*Defined in [proposal.ts:343](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L343)* +*Defined in [proposal.ts:336](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L336)* ___ @@ -76,7 +75,7 @@ ___ • **id**: *string* -*Defined in [proposal.ts:344](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L344)* +*Defined in [proposal.ts:337](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L337)* ___ @@ -84,7 +83,7 @@ ___ • **staticState**: *[IProposalStaticState](../interfaces/iproposalstaticstate.md) | undefined* -*Defined in [proposal.ts:345](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L345)* +*Defined in [proposal.ts:338](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L338)* ## Methods @@ -92,7 +91,7 @@ ___ ▸ **claimRewards**(`beneficiary?`: [Address](../globals.md#address)): *[Operation](../globals.md#operation)‹boolean›* -*Defined in [proposal.ts:745](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L745)* +*Defined in [proposal.ts:778](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L778)* [claimRewards description] Execute the proposal and distribute the rewards to the beneficiary. @@ -114,7 +113,7 @@ ___ ▸ **execute**(): *[Operation](../globals.md#operation)‹any›* -*Defined in [proposal.ts:779](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L779)* +*Defined in [proposal.ts:822](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L822)* calll the 'execute()' function on the votingMachine. the main purpose of this function is to set the stage of the proposals @@ -130,7 +129,7 @@ ___ ▸ **fetchStaticState**(): *Promise‹[IProposalStaticState](../interfaces/iproposalstaticstate.md)›* -*Defined in [proposal.ts:363](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L363)* +*Defined in [proposal.ts:356](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L356)* **Returns:** *Promise‹[IProposalStaticState](../interfaces/iproposalstaticstate.md)›* @@ -140,7 +139,7 @@ ___ ▸ **redeemerContract**(): *any* -*Defined in [proposal.ts:578](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L578)* +*Defined in [proposal.ts:605](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L605)* [redeemerContract description] @@ -154,7 +153,7 @@ ___ ▸ **rewards**(`options`: [IRewardQueryOptions](../interfaces/irewardqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Reward](reward.md)[]›* -*Defined in [proposal.ts:728](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L728)* +*Defined in [proposal.ts:761](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L761)* **Parameters:** @@ -171,17 +170,19 @@ ___ ▸ **scheme**(): *Promise‹any›* -*Defined in [proposal.ts:562](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L562)* +*Defined in [proposal.ts:588](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L588)* **Returns:** *Promise‹any›* +the scheme Contract + ___ ### setStaticState ▸ **setStaticState**(`opts`: [IProposalStaticState](../interfaces/iproposalstaticstate.md)): *void* -*Defined in [proposal.ts:359](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L359)* +*Defined in [proposal.ts:352](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L352)* **Parameters:** @@ -195,26 +196,30 @@ ___ ### stake -▸ **stake**(`outcome`: [IProposalOutcome](../enums/iproposaloutcome.md), `amount`: any): *[Operation](../globals.md#operation)‹[Stake](stake.md)›* +▸ **stake**(`outcome`: [IProposalOutcome](../enums/iproposaloutcome.md), `amount`: BN): *[Operation](../globals.md#operation)‹[Stake](stake.md)›* + +*Defined in [proposal.ts:695](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L695)* -*Defined in [proposal.ts:662](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L662)* +Stake on this proposal **Parameters:** -Name | Type | ------- | ------ | -`outcome` | [IProposalOutcome](../enums/iproposaloutcome.md) | -`amount` | any | +Name | Type | Description | +------ | ------ | ------ | +`outcome` | [IProposalOutcome](../enums/iproposaloutcome.md) | the outcome that is staked on, of type IProposalOutcome | +`amount` | BN | the amount, in GEn, to stake | **Returns:** *[Operation](../globals.md#operation)‹[Stake](stake.md)›* +An observable that can be sent, or subscribed to + ___ ### stakes ▸ **stakes**(`options`: [IStakeQueryOptions](../interfaces/istakequeryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Stake](stake.md)[]›* -*Defined in [proposal.ts:656](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L656)* +*Defined in [proposal.ts:683](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L683)* **Parameters:** @@ -229,11 +234,11 @@ ___ ### stakingToken -▸ **stakingToken**(): *[Token](token.md)* +▸ **stakingToken**(): *[Token](token.md)‹›* -*Defined in [proposal.ts:652](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L652)* +*Defined in [proposal.ts:679](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L679)* -**Returns:** *[Token](token.md)* +**Returns:** *[Token](token.md)‹›* ___ @@ -241,7 +246,7 @@ ___ ▸ **state**(`apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[IProposalState](../interfaces/iproposalstate.md)›* -*Defined in [proposal.ts:385](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L385)* +*Defined in [proposal.ts:378](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L378)* `state` is an observable of the proposal state @@ -259,7 +264,7 @@ ___ ▸ **vote**(`outcome`: [IProposalOutcome](../enums/iproposaloutcome.md), `amount`: number): *[Operation](../globals.md#operation)‹[Vote](vote.md) | null›* -*Defined in [proposal.ts:600](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L600)* +*Defined in [proposal.ts:627](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L627)* Vote for this proposal @@ -280,7 +285,7 @@ ___ ▸ **votes**(`options`: [IVoteQueryOptions](../interfaces/ivotequeryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Vote](vote.md)[]›* -*Defined in [proposal.ts:587](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L587)* +*Defined in [proposal.ts:614](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L614)* **Parameters:** @@ -297,7 +302,7 @@ ___ ▸ **votingMachine**(): *Promise‹any›* -*Defined in [proposal.ts:570](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L570)* +*Defined in [proposal.ts:597](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L597)* [votingMachine description] @@ -307,32 +312,11 @@ a web3 Contract instance ___ -### `Static` create - -▸ **create**(`options`: [IProposalCreateOptions](../globals.md#iproposalcreateoptions), `context`: [Arc](arc.md)): *[Operation](../globals.md#operation)‹[Proposal](proposal.md)›* - -*Defined in [proposal.ts:225](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L225)* - -Proposal.create() creates a new proposal - -**Parameters:** - -Name | Type | Description | ------- | ------ | ------ | -`options` | [IProposalCreateOptions](../globals.md#iproposalcreateoptions) | cf. IProposalCreateOptions | -`context` | [Arc](arc.md) | - | - -**Returns:** *[Operation](../globals.md#operation)‹[Proposal](proposal.md)›* - -an observable that streams the various states - -___ - ### `Static` search ▸ **search**(`context`: [Arc](arc.md), `options`: [IProposalQueryOptions](../interfaces/iproposalqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Proposal](proposal.md)[]›* -*Defined in [proposal.ts:264](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L264)* +*Defined in [proposal.ts:248](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L248)* Search for proposals @@ -357,7 +341,7 @@ For example: ### ▪ **fragments**: *object* -*Defined in [proposal.ts:106](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L106)* +*Defined in [proposal.ts:111](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L111)* ### ProposalFields @@ -365,7 +349,22 @@ For example: id accountsWithUnclaimedRewards boostedAt + closingAt confidenceThreshold + competition { + id + endTime + contract + suggestionsEndTime + createdAt + numberOfVotesPerVoters + numberOfWinners + rewardSplit + snapshotBlock + startTime + votingStartTime + + } contributionReward { id beneficiary @@ -454,22 +453,21 @@ For example: schemeRemoved } stage - stakes { - id - } + # stakes { id } stakesFor stakesAgainst + tags { + id + } totalRepWhenCreated totalRepWhenExecuted title url - votes { - id - } + # votes { id } votesAgainst votesFor votingMachine winningOutcome }` -*Defined in [proposal.ts:107](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L107)* +*Defined in [proposal.ts:112](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L112)* diff --git a/docs/classes/queue.md b/docs/classes/queue.md index 63f2f839..01699a36 100644 --- a/docs/classes/queue.md +++ b/docs/classes/queue.md @@ -33,7 +33,7 @@ \+ **new Queue**(`id`: string, `dao`: [DAO](dao.md), `context`: [Arc](arc.md)): *[Queue](queue.md)* -*Defined in [queue.ts:89](https://github.com/daostack/client/blob/0eadcce/src/queue.ts#L89)* +*Defined in [queue.ts:90](https://github.com/daostack/client/blob/aa9723f/src/queue.ts#L90)* **Parameters:** @@ -51,7 +51,7 @@ Name | Type | • **context**: *[Arc](arc.md)* -*Defined in [queue.ts:94](https://github.com/daostack/client/blob/0eadcce/src/queue.ts#L94)* +*Defined in [queue.ts:95](https://github.com/daostack/client/blob/aa9723f/src/queue.ts#L95)* ___ @@ -59,7 +59,7 @@ ___ • **dao**: *[DAO](dao.md)* -*Defined in [queue.ts:93](https://github.com/daostack/client/blob/0eadcce/src/queue.ts#L93)* +*Defined in [queue.ts:94](https://github.com/daostack/client/blob/aa9723f/src/queue.ts#L94)* ___ @@ -67,7 +67,7 @@ ___ • **id**: *string* -*Defined in [queue.ts:92](https://github.com/daostack/client/blob/0eadcce/src/queue.ts#L92)* +*Defined in [queue.ts:93](https://github.com/daostack/client/blob/aa9723f/src/queue.ts#L93)* ## Methods @@ -75,7 +75,7 @@ ___ ▸ **state**(`apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[IQueueState](../interfaces/iqueuestate.md)›* -*Defined in [queue.ts:99](https://github.com/daostack/client/blob/0eadcce/src/queue.ts#L99)* +*Defined in [queue.ts:100](https://github.com/daostack/client/blob/aa9723f/src/queue.ts#L100)* **Parameters:** @@ -91,7 +91,7 @@ ___ ▸ **search**(`context`: [Arc](arc.md), `options`: [IQueueQueryOptions](../interfaces/iqueuequeryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Queue](queue.md)[]›* -*Defined in [queue.ts:38](https://github.com/daostack/client/blob/0eadcce/src/queue.ts#L38)* +*Defined in [queue.ts:39](https://github.com/daostack/client/blob/aa9723f/src/queue.ts#L39)* Queue.search(context, options) searches for queue entities diff --git a/docs/classes/reputation.md b/docs/classes/reputation.md index e100a457..961012d7 100644 --- a/docs/classes/reputation.md +++ b/docs/classes/reputation.md @@ -36,7 +36,7 @@ \+ **new Reputation**(`id`: [Address](../globals.md#address), `context`: [Arc](arc.md)): *[Reputation](reputation.md)* -*Defined in [reputation.ts:66](https://github.com/daostack/client/blob/0eadcce/src/reputation.ts#L66)* +*Defined in [reputation.ts:67](https://github.com/daostack/client/blob/aa9723f/src/reputation.ts#L67)* **Parameters:** @@ -53,7 +53,7 @@ Name | Type | • **address**: *[Address](../globals.md#address)* -*Defined in [reputation.ts:66](https://github.com/daostack/client/blob/0eadcce/src/reputation.ts#L66)* +*Defined in [reputation.ts:67](https://github.com/daostack/client/blob/aa9723f/src/reputation.ts#L67)* ___ @@ -61,7 +61,7 @@ ___ • **context**: *[Arc](arc.md)* -*Defined in [reputation.ts:67](https://github.com/daostack/client/blob/0eadcce/src/reputation.ts#L67)* +*Defined in [reputation.ts:68](https://github.com/daostack/client/blob/aa9723f/src/reputation.ts#L68)* ___ @@ -69,7 +69,7 @@ ___ • **id**: *[Address](../globals.md#address)* -*Defined in [reputation.ts:67](https://github.com/daostack/client/blob/0eadcce/src/reputation.ts#L67)* +*Defined in [reputation.ts:68](https://github.com/daostack/client/blob/aa9723f/src/reputation.ts#L68)* ## Methods @@ -77,7 +77,7 @@ ___ ▸ **contract**(): *any* -*Defined in [reputation.ts:119](https://github.com/daostack/client/blob/0eadcce/src/reputation.ts#L119)* +*Defined in [reputation.ts:120](https://github.com/daostack/client/blob/aa9723f/src/reputation.ts#L120)* **Returns:** *any* @@ -85,16 +85,16 @@ ___ ### mint -▸ **mint**(`beneficiary`: [Address](../globals.md#address), `amount`: any): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹any››* +▸ **mint**(`beneficiary`: [Address](../globals.md#address), `amount`: BN): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹any››* -*Defined in [reputation.ts:124](https://github.com/daostack/client/blob/0eadcce/src/reputation.ts#L124)* +*Defined in [reputation.ts:125](https://github.com/daostack/client/blob/aa9723f/src/reputation.ts#L125)* **Parameters:** Name | Type | ------ | ------ | `beneficiary` | [Address](../globals.md#address) | -`amount` | any | +`amount` | BN | **Returns:** *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹any››* @@ -102,9 +102,9 @@ ___ ### reputationOf -▸ **reputationOf**(`address`: [Address](../globals.md#address)): *Observable‹any›* +▸ **reputationOf**(`address`: [Address](../globals.md#address)): *Observable‹BN›* -*Defined in [reputation.ts:95](https://github.com/daostack/client/blob/0eadcce/src/reputation.ts#L95)* +*Defined in [reputation.ts:96](https://github.com/daostack/client/blob/aa9723f/src/reputation.ts#L96)* **Parameters:** @@ -112,7 +112,7 @@ Name | Type | ------ | ------ | `address` | [Address](../globals.md#address) | -**Returns:** *Observable‹any›* +**Returns:** *Observable‹BN›* ___ @@ -120,7 +120,7 @@ ___ ▸ **state**(`apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[IReputationState](../interfaces/ireputationstate.md)›* -*Defined in [reputation.ts:71](https://github.com/daostack/client/blob/0eadcce/src/reputation.ts#L71)* +*Defined in [reputation.ts:72](https://github.com/daostack/client/blob/aa9723f/src/reputation.ts#L72)* **Parameters:** @@ -136,7 +136,7 @@ ___ ▸ **search**(`context`: [Arc](arc.md), `options`: [IReputationQueryOptions](../interfaces/ireputationqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Reputation](reputation.md)[]›* -*Defined in [reputation.ts:30](https://github.com/daostack/client/blob/0eadcce/src/reputation.ts#L30)* +*Defined in [reputation.ts:31](https://github.com/daostack/client/blob/aa9723f/src/reputation.ts#L31)* Reputation.search(context, options) searches for reputation entities diff --git a/docs/classes/reputationfromtokenscheme.md b/docs/classes/reputationfromtokenscheme.md index 7d4f5b0e..b142d9a2 100644 --- a/docs/classes/reputationfromtokenscheme.md +++ b/docs/classes/reputationfromtokenscheme.md @@ -18,7 +18,7 @@ ### Methods -* [getContract](reputationfromtokenscheme.md#private-getcontract) +* [getContract](reputationfromtokenscheme.md#getcontract) * [redeem](reputationfromtokenscheme.md#redeem) * [redemptionAmount](reputationfromtokenscheme.md#redemptionamount) @@ -28,7 +28,7 @@ \+ **new ReputationFromTokenScheme**(`scheme`: [Scheme](scheme.md)): *[ReputationFromTokenScheme](reputationfromtokenscheme.md)* -*Defined in [schemes/reputationFromToken.ts:13](https://github.com/daostack/client/blob/0eadcce/src/schemes/reputationFromToken.ts#L13)* +*Defined in [schemes/reputationFromToken.ts:13](https://github.com/daostack/client/blob/aa9723f/src/schemes/reputationFromToken.ts#L13)* **Parameters:** @@ -44,15 +44,15 @@ Name | Type | • **scheme**: *[Scheme](scheme.md)* -*Defined in [schemes/reputationFromToken.ts:15](https://github.com/daostack/client/blob/0eadcce/src/schemes/reputationFromToken.ts#L15)* +*Defined in [schemes/reputationFromToken.ts:15](https://github.com/daostack/client/blob/aa9723f/src/schemes/reputationFromToken.ts#L15)* ## Methods -### `Private` getContract +### getContract ▸ **getContract**(): *Promise‹any›* -*Defined in [schemes/reputationFromToken.ts:47](https://github.com/daostack/client/blob/0eadcce/src/schemes/reputationFromToken.ts#L47)* +*Defined in [schemes/reputationFromToken.ts:47](https://github.com/daostack/client/blob/aa9723f/src/schemes/reputationFromToken.ts#L47)* **Returns:** *Promise‹any›* @@ -62,7 +62,7 @@ ___ ▸ **redeem**(`beneficiary`: [Address](../globals.md#address)): *[Operation](../globals.md#operation)‹any›* -*Defined in [schemes/reputationFromToken.ts:19](https://github.com/daostack/client/blob/0eadcce/src/schemes/reputationFromToken.ts#L19)* +*Defined in [schemes/reputationFromToken.ts:19](https://github.com/daostack/client/blob/aa9723f/src/schemes/reputationFromToken.ts#L19)* **Parameters:** @@ -78,7 +78,7 @@ ___ ▸ **redemptionAmount**(`beneficiary`: [Address](../globals.md#address)): *Promise‹number›* -*Defined in [schemes/reputationFromToken.ts:41](https://github.com/daostack/client/blob/0eadcce/src/schemes/reputationFromToken.ts#L41)* +*Defined in [schemes/reputationFromToken.ts:41](https://github.com/daostack/client/blob/aa9723f/src/schemes/reputationFromToken.ts#L41)* **Parameters:** diff --git a/docs/classes/reward.md b/docs/classes/reward.md index e9c2355f..c96f9c08 100644 --- a/docs/classes/reward.md +++ b/docs/classes/reward.md @@ -20,25 +20,33 @@ * [context](reward.md#context) * [id](reward.md#id) +* [idOrOpts](reward.md#idoropts) +* [staticState](reward.md#staticstate) ### Methods +* [fetchStaticState](reward.md#fetchstaticstate) +* [setStaticState](reward.md#setstaticstate) * [state](reward.md#state) * [search](reward.md#static-search) +### Object literals + +* [fragments](reward.md#static-fragments) + ## Constructors ### constructor -\+ **new Reward**(`id`: string, `context`: [Arc](arc.md)): *[Reward](reward.md)* +\+ **new Reward**(`idOrOpts`: string | [IRewardStaticState](../interfaces/irewardstaticstate.md), `context`: [Arc](arc.md)): *[Reward](reward.md)* -*Defined in [reward.ts:77](https://github.com/daostack/client/blob/0eadcce/src/reward.ts#L77)* +*Defined in [reward.ts:155](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L155)* **Parameters:** Name | Type | ------ | ------ | -`id` | string | +`idOrOpts` | string | [IRewardStaticState](../interfaces/irewardstaticstate.md) | `context` | [Arc](arc.md) | **Returns:** *[Reward](reward.md)* @@ -49,7 +57,7 @@ Name | Type | • **context**: *[Arc](arc.md)* -*Defined in [reward.ts:79](https://github.com/daostack/client/blob/0eadcce/src/reward.ts#L79)* +*Defined in [reward.ts:157](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L157)* ___ @@ -57,15 +65,57 @@ ___ • **id**: *string* -*Defined in [reward.ts:79](https://github.com/daostack/client/blob/0eadcce/src/reward.ts#L79)* +*Defined in [reward.ts:154](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L154)* + +___ + +### idOrOpts + +• **idOrOpts**: *string | [IRewardStaticState](../interfaces/irewardstaticstate.md)* + +*Defined in [reward.ts:157](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L157)* + +___ + +### staticState + +• **staticState**: *[IRewardStaticState](../interfaces/irewardstaticstate.md) | undefined* + +*Defined in [reward.ts:155](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L155)* ## Methods +### fetchStaticState + +▸ **fetchStaticState**(): *Promise‹[IRewardStaticState](../interfaces/irewardstaticstate.md)›* + +*Defined in [reward.ts:215](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L215)* + +**Returns:** *Promise‹[IRewardStaticState](../interfaces/irewardstaticstate.md)›* + +___ + +### setStaticState + +▸ **setStaticState**(`opts`: [IRewardStaticState](../interfaces/irewardstaticstate.md)): *void* + +*Defined in [reward.ts:211](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L211)* + +**Parameters:** + +Name | Type | +------ | ------ | +`opts` | [IRewardStaticState](../interfaces/irewardstaticstate.md) | + +**Returns:** *void* + +___ + ### state ▸ **state**(`apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[IRewardState](../interfaces/irewardstate.md)›* -*Defined in [reward.ts:84](https://github.com/daostack/client/blob/0eadcce/src/reward.ts#L84)* +*Defined in [reward.ts:167](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L167)* **Parameters:** @@ -81,7 +131,7 @@ ___ ▸ **search**(`context`: [Arc](arc.md), `options`: [IRewardQueryOptions](../interfaces/irewardqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Reward](reward.md)[]›* -*Defined in [reward.ts:44](https://github.com/daostack/client/blob/0eadcce/src/reward.ts#L44)* +*Defined in [reward.ts:71](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L71)* Reward.search(context, options) searches for reward entities @@ -96,3 +146,36 @@ Name | Type | Default | Description | **Returns:** *Observable‹[Reward](reward.md)[]›* an observable of Reward objects + +## Object literals + +### `Static` fragments + +### ▪ **fragments**: *object* + +*Defined in [reward.ts:42](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L42)* + +### RewardFields + +• **RewardFields**: *any* = gql`fragment RewardFields on GPReward { + id + createdAt + dao { + id + } + beneficiary + daoBountyForStaker + proposal { + id + } + reputationForVoter + reputationForVoterRedeemedAt + reputationForProposer + reputationForProposerRedeemedAt + tokenAddress + tokensForStaker + tokensForStakerRedeemedAt + daoBountyForStakerRedeemedAt + }` + +*Defined in [reward.ts:43](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L43)* diff --git a/docs/classes/scheme.md b/docs/classes/scheme.md index 8692ab05..2c013efa 100644 --- a/docs/classes/scheme.md +++ b/docs/classes/scheme.md @@ -6,7 +6,9 @@ A Scheme represents a scheme instance that is registered at a DAO ## Hierarchy -* **Scheme** +* [SchemeBase](schemebase.md) + + ↳ **Scheme** ## Implements @@ -28,25 +30,35 @@ A Scheme represents a scheme instance that is registered at a DAO ### Methods * [createProposal](scheme.md#createproposal) +* [createProposalErrorHandler](scheme.md#createproposalerrorhandler) +* [createProposalTransaction](scheme.md#createproposaltransaction) +* [createProposalTransactionMap](scheme.md#createproposaltransactionmap) * [fetchStaticState](scheme.md#fetchstaticstate) * [proposals](scheme.md#proposals) * [setStaticState](scheme.md#setstaticstate) * [state](scheme.md#state) +* [x](scheme.md#x) * [search](scheme.md#static-search) +### Object literals + +* [fragments](scheme.md#static-fragments) + ## Constructors ### constructor -\+ **new Scheme**(`idOrOpts`: [Address](../globals.md#address) | [ISchemeStaticState](../interfaces/ischemestaticstate.md), `context`: [Arc](arc.md)): *[Scheme](scheme.md)* +\+ **new Scheme**(`idOrOpts`: [Address](../globals.md#address) | ISchemeStaticState, `context`: [Arc](arc.md)): *[Scheme](scheme.md)* -*Defined in [scheme.ts:156](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L156)* +*Overrides [SchemeBase](schemebase.md).[constructor](schemebase.md#constructor)* + +*Defined in [scheme.ts:181](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L181)* **Parameters:** Name | Type | ------ | ------ | -`idOrOpts` | [Address](../globals.md#address) | [ISchemeStaticState](../interfaces/ischemestaticstate.md) | +`idOrOpts` | [Address](../globals.md#address) | ISchemeStaticState | `context` | [Arc](arc.md) | **Returns:** *[Scheme](scheme.md)* @@ -57,7 +69,9 @@ Name | Type | • **ReputationFromToken**: *[ReputationFromTokenScheme](reputationfromtokenscheme.md) | null* = null -*Defined in [scheme.ts:156](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L156)* +*Overrides [SchemeBase](schemebase.md).[ReputationFromToken](schemebase.md#reputationfromtoken)* + +*Defined in [scheme.ts:181](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L181)* ___ @@ -65,7 +79,9 @@ ___ • **context**: *[Arc](arc.md)* -*Defined in [scheme.ts:158](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L158)* +*Overrides [SchemeBase](schemebase.md).[context](schemebase.md#context)* + +*Defined in [scheme.ts:183](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L183)* ___ @@ -73,15 +89,19 @@ ___ • **id**: *[Address](../globals.md#address)* -*Defined in [scheme.ts:154](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L154)* +*Overrides [SchemeBase](schemebase.md).[id](schemebase.md#id)* + +*Defined in [scheme.ts:179](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L179)* ___ ### staticState -• **staticState**: *[ISchemeStaticState](../interfaces/ischemestaticstate.md) | null* = null +• **staticState**: *ISchemeStaticState | null* = null -*Defined in [scheme.ts:155](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L155)* +*Overrides [SchemeBase](schemebase.md).[staticState](schemebase.md#staticstate)* + +*Defined in [scheme.ts:180](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L180)* ## Methods @@ -89,10 +109,11 @@ ___ ▸ **createProposal**(`options`: [IProposalCreateOptions](../globals.md#iproposalcreateoptions)): *[Operation](../globals.md#operation)‹[Proposal](proposal.md)›* -*Defined in [scheme.ts:371](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L371)* +*Overrides [SchemeBase](schemebase.md).[createProposal](schemebase.md#createproposal)* -create a new proposal in this DAO -TODO: move this to the schemes - we should call proposal.scheme.createProposal +*Defined in [scheme.ts:285](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L285)* + +create a new proposal in this Scheme **Parameters:** @@ -106,11 +127,84 @@ a Proposal instance ___ +### createProposalErrorHandler + +▸ **createProposalErrorHandler**(`options?`: any): *function* + +*Inherited from [SchemeBase](schemebase.md).[createProposalErrorHandler](schemebase.md#createproposalerrorhandler)* + +*Defined in [schemes/base.ts:296](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L296)* + +**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](schemebase.md).[createProposalTransaction](schemebase.md#createproposaltransaction)* + +*Defined in [schemes/base.ts:288](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L288)* + +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](schemebase.md).[createProposalTransactionMap](schemebase.md#createproposaltransactionmap)* + +*Defined in [schemes/base.ts:292](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L292)* + +**Returns:** *function* + +▸ (`receipt`: any): *any* + +**Parameters:** + +Name | Type | +------ | ------ | +`receipt` | any | + +___ + ### fetchStaticState ▸ **fetchStaticState**(): *Promise‹[ISchemeStaticState](../interfaces/ischemestaticstate.md)›* -*Defined in [scheme.ts:177](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L177)* +*Inherited from [SchemeBase](schemebase.md).[fetchStaticState](schemebase.md#fetchstaticstate)* + +*Defined in [schemes/base.ts:256](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L256)* fetch the static state from the subgraph @@ -124,7 +218,9 @@ ___ ▸ **proposals**(`options`: [IProposalQueryOptions](../interfaces/iproposalqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Proposal](proposal.md)[]›* -*Defined in [scheme.ts:422](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L422)* +*Overrides [SchemeBase](schemebase.md).[proposals](schemebase.md#proposals)* + +*Defined in [scheme.ts:353](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L353)* **Parameters:** @@ -139,15 +235,17 @@ ___ ### setStaticState -▸ **setStaticState**(`opts`: [ISchemeStaticState](../interfaces/ischemestaticstate.md)): *void* +▸ **setStaticState**(`opts`: ISchemeStaticState): *void* + +*Overrides [SchemeBase](schemebase.md).[setStaticState](schemebase.md#setstaticstate)* -*Defined in [scheme.ts:169](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L169)* +*Defined in [scheme.ts:195](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L195)* **Parameters:** Name | Type | ------ | ------ | -`opts` | [ISchemeStaticState](../interfaces/ischemestaticstate.md) | +`opts` | ISchemeStaticState | **Returns:** *void* @@ -155,9 +253,11 @@ ___ ### state -▸ **state**(`apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[ISchemeState](../interfaces/ischemestate.md)›* +▸ **state**(`apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹ISchemeState›* -*Defined in [scheme.ts:200](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L200)* +*Overrides [SchemeBase](schemebase.md).[state](schemebase.md#abstract-state)* + +*Defined in [scheme.ts:199](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L199)* **Parameters:** @@ -165,15 +265,27 @@ Name | Type | Default | ------ | ------ | ------ | `apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | -**Returns:** *Observable‹[ISchemeState](../interfaces/ischemestate.md)›* +**Returns:** *Observable‹ISchemeState›* + +___ + +### x + +▸ **x**(): *void* + +*Inherited from [SchemeBase](schemebase.md).[x](schemebase.md#x)* + +*Defined in [schemes/base.ts:319](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L319)* + +**Returns:** *void* ___ ### `Static` search -▸ **search**(`context`: [Arc](arc.md), `options`: [ISchemeQueryOptions](../interfaces/ischemequeryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Scheme](scheme.md)[]›* +▸ **search**(`context`: [Arc](arc.md), `options`: ISchemeQueryOptions, `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹Array‹[Scheme](scheme.md) | [CompetitionScheme](competitionscheme.md)››* -*Defined in [scheme.ts:96](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L96)* +*Defined in [scheme.ts:116](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L116)* Scheme.search(context, options) searches for scheme entities @@ -182,9 +294,152 @@ Scheme.search(context, options) searches for scheme entities Name | Type | Default | Description | ------ | ------ | ------ | ------ | `context` | [Arc](arc.md) | - | an Arc instance that provides connection information | -`options` | [ISchemeQueryOptions](../interfaces/ischemequeryoptions.md) | {} | the query options, cf. ISchemeQueryOptions | +`options` | ISchemeQueryOptions | {} | the query options, cf. ISchemeQueryOptions | `apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | - | -**Returns:** *Observable‹[Scheme](scheme.md)[]›* +**Returns:** *Observable‹Array‹[Scheme](scheme.md) | [CompetitionScheme](competitionscheme.md)››* an observable of Scheme objects + +## Object literals + +### `Static` fragments + +### ▪ **fragments**: *object* + +*Inherited from [SchemeBase](schemebase.md).[fragments](schemebase.md#static-fragments)* + +*Defined in [schemes/base.ts:106](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L106)* + +### 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](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L107)* diff --git a/docs/classes/schemebase.md b/docs/classes/schemebase.md new file mode 100644 index 00000000..e839fb47 --- /dev/null +++ b/docs/classes/schemebase.md @@ -0,0 +1,390 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [SchemeBase](schemebase.md) + +# Class: SchemeBase + +A Scheme represents a scheme instance that is registered at a DAO + +## Hierarchy + +* **SchemeBase** + + ↳ [CompetitionScheme](competitionscheme.md) + + ↳ [Scheme](scheme.md) + +## Implements + +* [IStateful](../interfaces/istateful.md)‹[ISchemeState](../interfaces/ischemestate.md)› + +## Index + +### Constructors + +* [constructor](schemebase.md#constructor) + +### Properties + +* [ReputationFromToken](schemebase.md#reputationfromtoken) +* [context](schemebase.md#context) +* [id](schemebase.md#id) +* [staticState](schemebase.md#staticstate) + +### Methods + +* [createProposal](schemebase.md#createproposal) +* [createProposalErrorHandler](schemebase.md#createproposalerrorhandler) +* [createProposalTransaction](schemebase.md#createproposaltransaction) +* [createProposalTransactionMap](schemebase.md#createproposaltransactionmap) +* [fetchStaticState](schemebase.md#fetchstaticstate) +* [proposals](schemebase.md#proposals) +* [setStaticState](schemebase.md#setstaticstate) +* [state](schemebase.md#abstract-state) +* [x](schemebase.md#x) + +### Object literals + +* [fragments](schemebase.md#static-fragments) + +## Constructors + +### constructor + +\+ **new SchemeBase**(`idOrOpts`: [Address](../globals.md#address) | [ISchemeStaticState](../interfaces/ischemestaticstate.md), `context`: [Arc](arc.md)): *[SchemeBase](schemebase.md)* + +*Defined in [schemes/base.ts:239](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L239)* + +**Parameters:** + +Name | Type | +------ | ------ | +`idOrOpts` | [Address](../globals.md#address) | [ISchemeStaticState](../interfaces/ischemestaticstate.md) | +`context` | [Arc](arc.md) | + +**Returns:** *[SchemeBase](schemebase.md)* + +## Properties + +### ReputationFromToken + +• **ReputationFromToken**: *[ReputationFromTokenScheme](reputationfromtokenscheme.md) | null* = null + +*Defined in [schemes/base.ts:239](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L239)* + +___ + +### context + +• **context**: *[Arc](arc.md)* + +*Defined in [schemes/base.ts:241](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L241)* + +___ + +### id + +• **id**: *[Address](../globals.md#address)* + +*Defined in [schemes/base.ts:237](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L237)* + +___ + +### staticState + +• **staticState**: *[ISchemeStaticState](../interfaces/ischemestaticstate.md) | null* = null + +*Defined in [schemes/base.ts:238](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L238)* + +## Methods + +### createProposal + +▸ **createProposal**(`options`: [IProposalCreateOptions](../globals.md#iproposalcreateoptions)): *[Operation](../globals.md#operation)‹[Proposal](proposal.md)›* + +*Defined in [schemes/base.ts:300](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L300)* + +**Parameters:** + +Name | Type | +------ | ------ | +`options` | [IProposalCreateOptions](../globals.md#iproposalcreateoptions) | + +**Returns:** *[Operation](../globals.md#operation)‹[Proposal](proposal.md)›* + +___ + +### createProposalErrorHandler + +▸ **createProposalErrorHandler**(`options?`: any): *function* + +*Defined in [schemes/base.ts:296](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L296)* + +**Parameters:** + +Name | Type | +------ | ------ | +`options?` | any | + +**Returns:** *function* + +▸ (`err`: Error): *Error | Promise‹Error›* + +**Parameters:** + +Name | Type | +------ | ------ | +`err` | Error | + +___ + +### createProposalTransaction + +▸ **createProposalTransaction**(`options`: any): *function* + +*Defined in [schemes/base.ts:288](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L288)* + +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* + +*Defined in [schemes/base.ts:292](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L292)* + +**Returns:** *function* + +▸ (`receipt`: any): *any* + +**Parameters:** + +Name | Type | +------ | ------ | +`receipt` | any | + +___ + +### fetchStaticState + +▸ **fetchStaticState**(): *Promise‹[ISchemeStaticState](../interfaces/ischemestaticstate.md)›* + +*Defined in [schemes/base.ts:256](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L256)* + +fetch the static state from the subgraph + +**Returns:** *Promise‹[ISchemeStaticState](../interfaces/ischemestaticstate.md)›* + +the statatic state + +___ + +### proposals + +▸ **proposals**(`options`: [IProposalQueryOptions](../interfaces/iproposalqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Proposal](proposal.md)[]›* + +*Defined in [schemes/base.ts:467](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L467)* + +**Parameters:** + +Name | Type | Default | +------ | ------ | ------ | +`options` | [IProposalQueryOptions](../interfaces/iproposalqueryoptions.md) | {} | +`apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | + +**Returns:** *Observable‹[Proposal](proposal.md)[]›* + +___ + +### setStaticState + +▸ **setStaticState**(`opts`: [ISchemeStaticState](../interfaces/ischemestaticstate.md)): *void* + +*Defined in [schemes/base.ts:279](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L279)* + +**Parameters:** + +Name | Type | +------ | ------ | +`opts` | [ISchemeStaticState](../interfaces/ischemestaticstate.md) | + +**Returns:** *void* + +___ + +### `Abstract` state + +▸ **state**(`apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[ISchemeState](../interfaces/ischemestate.md)›* + +*Defined in [schemes/base.ts:317](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L317)* + +**Parameters:** + +Name | Type | +------ | ------ | +`apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | + +**Returns:** *Observable‹[ISchemeState](../interfaces/ischemestate.md)›* + +___ + +### x + +▸ **x**(): *void* + +*Defined in [schemes/base.ts:319](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L319)* + +**Returns:** *void* + +## Object literals + +### `Static` fragments + +### ▪ **fragments**: *object* + +*Defined in [schemes/base.ts:106](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L106)* + +### 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](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L107)* diff --git a/docs/classes/stake.md b/docs/classes/stake.md index 32f38fbe..d5c624a4 100644 --- a/docs/classes/stake.md +++ b/docs/classes/stake.md @@ -29,13 +29,17 @@ * [state](stake.md#state) * [search](stake.md#static-search) +### Object literals + +* [fragments](stake.md#static-fragments) + ## Constructors ### constructor \+ **new Stake**(`idOrOpts`: string | [IStakeStaticState](../interfaces/istakestaticstate.md), `context`: [Arc](arc.md)): *[Stake](stake.md)* -*Defined in [stake.ts:102](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L102)* +*Defined in [stake.ts:149](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L149)* **Parameters:** @@ -52,7 +56,7 @@ Name | Type | • **context**: *[Arc](arc.md)* -*Defined in [stake.ts:106](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L106)* +*Defined in [stake.ts:153](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L153)* ___ @@ -60,7 +64,7 @@ ___ • **id**: *string | undefined* -*Defined in [stake.ts:101](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L101)* +*Defined in [stake.ts:148](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L148)* ___ @@ -68,7 +72,7 @@ ___ • **staticState**: *[IStakeStaticState](../interfaces/istakestaticstate.md) | undefined* -*Defined in [stake.ts:102](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L102)* +*Defined in [stake.ts:149](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L149)* ## Methods @@ -76,7 +80,7 @@ ___ ▸ **fetchStaticState**(): *Promise‹[IStakeStaticState](../interfaces/istakestaticstate.md)›* -*Defined in [stake.ts:152](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L152)* +*Defined in [stake.ts:207](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L207)* **Returns:** *Promise‹[IStakeStaticState](../interfaces/istakestaticstate.md)›* @@ -86,7 +90,7 @@ ___ ▸ **setStaticState**(`opts`: [IStakeStaticState](../interfaces/istakestaticstate.md)): *void* -*Defined in [stake.ts:148](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L148)* +*Defined in [stake.ts:203](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L203)* **Parameters:** @@ -102,7 +106,7 @@ ___ ▸ **state**(`apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[IStakeState](../interfaces/istakestate.md)›* -*Defined in [stake.ts:116](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L116)* +*Defined in [stake.ts:163](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L163)* **Parameters:** @@ -118,7 +122,7 @@ ___ ▸ **search**(`context`: [Arc](arc.md), `options`: [IStakeQueryOptions](../interfaces/istakequeryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Stake](stake.md)[]›* -*Defined in [stake.ts:41](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L41)* +*Defined in [stake.ts:57](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L57)* Stake.search(context, options) searches for stake entities @@ -133,3 +137,29 @@ Name | Type | Default | Description | **Returns:** *Observable‹[Stake](stake.md)[]›* an observable of Stake objects + +## Object literals + +### `Static` fragments + +### ▪ **fragments**: *object* + +*Defined in [stake.ts:35](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L35)* + +### StakeFields + +• **StakeFields**: *any* = gql`fragment StakeFields on ProposalStake { + id + createdAt + dao { + id + } + staker + proposal { + id + } + outcome + amount + }` + +*Defined in [stake.ts:36](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L36)* diff --git a/docs/classes/tag.md b/docs/classes/tag.md new file mode 100644 index 00000000..5edd4153 --- /dev/null +++ b/docs/classes/tag.md @@ -0,0 +1,157 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [Tag](tag.md) + +# Class: Tag + +## Hierarchy + +* **Tag** + +## Implements + +* [IStateful](../interfaces/istateful.md)‹[ITagState](../interfaces/itagstate.md)› + +## Index + +### Constructors + +* [constructor](tag.md#constructor) + +### Properties + +* [context](tag.md#context) +* [id](tag.md#id) +* [staticState](tag.md#staticstate) + +### Methods + +* [fetchStaticState](tag.md#fetchstaticstate) +* [setStaticState](tag.md#setstaticstate) +* [state](tag.md#state) +* [search](tag.md#static-search) + +### Object literals + +* [fragments](tag.md#static-fragments) + +## Constructors + +### constructor + +\+ **new Tag**(`idOrOpts`: string | [ITagStaticState](../interfaces/itagstaticstate.md), `context`: [Arc](arc.md)): *[Tag](tag.md)* + +*Defined in [tag.ts:113](https://github.com/daostack/client/blob/aa9723f/src/tag.ts#L113)* + +**Parameters:** + +Name | Type | +------ | ------ | +`idOrOpts` | string | [ITagStaticState](../interfaces/itagstaticstate.md) | +`context` | [Arc](arc.md) | + +**Returns:** *[Tag](tag.md)* + +## Properties + +### context + +• **context**: *[Arc](arc.md)* + +*Defined in [tag.ts:117](https://github.com/daostack/client/blob/aa9723f/src/tag.ts#L117)* + +___ + +### id + +• **id**: *string | undefined* + +*Defined in [tag.ts:112](https://github.com/daostack/client/blob/aa9723f/src/tag.ts#L112)* + +___ + +### staticState + +• **staticState**: *[ITagStaticState](../interfaces/itagstaticstate.md) | undefined* + +*Defined in [tag.ts:113](https://github.com/daostack/client/blob/aa9723f/src/tag.ts#L113)* + +## Methods + +### fetchStaticState + +▸ **fetchStaticState**(): *Promise‹[ITagStaticState](../interfaces/itagstaticstate.md)›* + +*Defined in [tag.ts:158](https://github.com/daostack/client/blob/aa9723f/src/tag.ts#L158)* + +**Returns:** *Promise‹[ITagStaticState](../interfaces/itagstaticstate.md)›* + +___ + +### setStaticState + +▸ **setStaticState**(`opts`: [ITagStaticState](../interfaces/itagstaticstate.md)): *void* + +*Defined in [tag.ts:154](https://github.com/daostack/client/blob/aa9723f/src/tag.ts#L154)* + +**Parameters:** + +Name | Type | +------ | ------ | +`opts` | [ITagStaticState](../interfaces/itagstaticstate.md) | + +**Returns:** *void* + +___ + +### state + +▸ **state**(`apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[ITagState](../interfaces/itagstate.md)›* + +*Defined in [tag.ts:127](https://github.com/daostack/client/blob/aa9723f/src/tag.ts#L127)* + +**Parameters:** + +Name | Type | Default | +------ | ------ | ------ | +`apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | + +**Returns:** *Observable‹[ITagState](../interfaces/itagstate.md)›* + +___ + +### `Static` search + +▸ **search**(`context`: [Arc](arc.md), `options`: [ITagQueryOptions](../interfaces/itagqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Tag](tag.md)[]›* + +*Defined in [tag.ts:41](https://github.com/daostack/client/blob/aa9723f/src/tag.ts#L41)* + +Tag.search(context, options) searches for stake entities + +**Parameters:** + +Name | Type | Default | Description | +------ | ------ | ------ | ------ | +`context` | [Arc](arc.md) | - | an Arc instance that provides connection information | +`options` | [ITagQueryOptions](../interfaces/itagqueryoptions.md) | {} | the query options, cf. ITagQueryOptions | +`apolloQueryOptions` | [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md) | {} | - | + +**Returns:** *Observable‹[Tag](tag.md)[]›* + +an observable of Tag objects + +## Object literals + +### `Static` fragments + +### ▪ **fragments**: *object* + +*Defined in [tag.ts:27](https://github.com/daostack/client/blob/aa9723f/src/tag.ts#L27)* + +### TagFields + +• **TagFields**: *any* = gql`fragment TagFields on Tag { + id + numberOfProposals + proposals { id } + }` + +*Defined in [tag.ts:28](https://github.com/daostack/client/blob/aa9723f/src/tag.ts#L28)* diff --git a/docs/classes/token.md b/docs/classes/token.md index f0beaecc..7a4c2b81 100644 --- a/docs/classes/token.md +++ b/docs/classes/token.md @@ -39,7 +39,7 @@ \+ **new Token**(`id`: [Address](../globals.md#address), `context`: [Arc](arc.md)): *[Token](token.md)* -*Defined in [token.ts:87](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L87)* +*Defined in [token.ts:87](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L87)* **Parameters:** @@ -56,7 +56,7 @@ Name | Type | • **address**: *string* -*Defined in [token.ts:87](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L87)* +*Defined in [token.ts:87](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L87)* ___ @@ -64,7 +64,7 @@ ___ • **context**: *[Arc](arc.md)* -*Defined in [token.ts:89](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L89)* +*Defined in [token.ts:89](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L89)* ___ @@ -72,15 +72,15 @@ ___ • **id**: *[Address](../globals.md#address)* -*Defined in [token.ts:89](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L89)* +*Defined in [token.ts:89](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L89)* ## Methods ### allowance -▸ **allowance**(`owner`: [Address](../globals.md#address), `spender`: [Address](../globals.md#address)): *Observable‹any›* +▸ **allowance**(`owner`: [Address](../globals.md#address), `spender`: [Address](../globals.md#address)): *Observable‹BN›* -*Defined in [token.ts:180](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L180)* +*Defined in [token.ts:185](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L185)* **Parameters:** @@ -89,22 +89,22 @@ Name | Type | `owner` | [Address](../globals.md#address) | `spender` | [Address](../globals.md#address) | -**Returns:** *Observable‹any›* +**Returns:** *Observable‹BN›* ___ ### approveForStaking -▸ **approveForStaking**(`spender`: [Address](../globals.md#address), `amount`: any): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹any››* +▸ **approveForStaking**(`spender`: [Address](../globals.md#address), `amount`: BN): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹any››* -*Defined in [token.ts:221](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L221)* +*Defined in [token.ts:226](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L226)* **Parameters:** Name | Type | ------ | ------ | `spender` | [Address](../globals.md#address) | -`amount` | any | +`amount` | BN | **Returns:** *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹any››* @@ -112,9 +112,9 @@ ___ ### balanceOf -▸ **balanceOf**(`owner`: string): *Observable‹any›* +▸ **balanceOf**(`owner`: string): *Observable‹BN›* -*Defined in [token.ts:133](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L133)* +*Defined in [token.ts:133](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L133)* **Parameters:** @@ -122,7 +122,7 @@ Name | Type | ------ | ------ | `owner` | string | -**Returns:** *Observable‹any›* +**Returns:** *Observable‹BN›* ___ @@ -130,7 +130,7 @@ ___ ▸ **contract**(`mode?`: undefined | "readonly"): *any* -*Defined in [token.ts:128](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L128)* +*Defined in [token.ts:128](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L128)* **Parameters:** @@ -144,16 +144,16 @@ ___ ### mint -▸ **mint**(`beneficiary`: [Address](../globals.md#address), `amount`: any): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹any››* +▸ **mint**(`beneficiary`: [Address](../globals.md#address), `amount`: BN): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹any››* -*Defined in [token.ts:207](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L207)* +*Defined in [token.ts:212](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L212)* **Parameters:** Name | Type | ------ | ------ | `beneficiary` | [Address](../globals.md#address) | -`amount` | any | +`amount` | BN | **Returns:** *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹any››* @@ -163,7 +163,7 @@ ___ ▸ **state**(`apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[ITokenState](../interfaces/itokenstate.md)›* -*Defined in [token.ts:97](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L97)* +*Defined in [token.ts:97](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L97)* **Parameters:** @@ -177,16 +177,16 @@ ___ ### transfer -▸ **transfer**(`beneficiary`: [Address](../globals.md#address), `amount`: any): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹any››* +▸ **transfer**(`beneficiary`: [Address](../globals.md#address), `amount`: BN): *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹any››* -*Defined in [token.ts:214](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L214)* +*Defined in [token.ts:219](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L219)* **Parameters:** Name | Type | ------ | ------ | `beneficiary` | [Address](../globals.md#address) | -`amount` | any | +`amount` | BN | **Returns:** *[IOperationObservable](../interfaces/ioperationobservable.md)‹[ITransactionUpdate](../interfaces/itransactionupdate.md)‹any››* @@ -196,7 +196,7 @@ ___ ▸ **search**(`context`: [Arc](arc.md), `options`: [ITokenQueryOptions](../interfaces/itokenqueryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Token](token.md)[]›* -*Defined in [token.ts:52](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L52)* +*Defined in [token.ts:52](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L52)* Token.search(context, options) searches for token entities diff --git a/docs/classes/vote.md b/docs/classes/vote.md index deb4aca6..2df27b83 100644 --- a/docs/classes/vote.md +++ b/docs/classes/vote.md @@ -29,13 +29,17 @@ * [state](vote.md#state) * [search](vote.md#static-search) +### Object literals + +* [fragments](vote.md#static-fragments) + ## Constructors ### constructor \+ **new Vote**(`idOrOpts`: string | [IVoteStaticState](../interfaces/ivotestaticstate.md), `context`: [Arc](arc.md)): *[Vote](vote.md)* -*Defined in [vote.ts:113](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L113)* +*Defined in [vote.ts:155](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L155)* **Parameters:** @@ -52,7 +56,7 @@ Name | Type | • **context**: *[Arc](arc.md)* -*Defined in [vote.ts:115](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L115)* +*Defined in [vote.ts:157](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L157)* ___ @@ -60,7 +64,7 @@ ___ • **id**: *string | undefined* -*Defined in [vote.ts:112](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L112)* +*Defined in [vote.ts:154](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L154)* ___ @@ -68,7 +72,7 @@ ___ • **staticState**: *[IVoteStaticState](../interfaces/ivotestaticstate.md) | undefined* -*Defined in [vote.ts:113](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L113)* +*Defined in [vote.ts:155](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L155)* ## Methods @@ -76,7 +80,7 @@ ___ ▸ **fetchStaticState**(): *Promise‹[IVoteStaticState](../interfaces/ivotestaticstate.md)›* -*Defined in [vote.ts:163](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L163)* +*Defined in [vote.ts:197](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L197)* **Returns:** *Promise‹[IVoteStaticState](../interfaces/ivotestaticstate.md)›* @@ -86,7 +90,7 @@ ___ ▸ **setStaticState**(`opts`: [IVoteStaticState](../interfaces/ivotestaticstate.md)): *void* -*Defined in [vote.ts:159](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L159)* +*Defined in [vote.ts:193](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L193)* **Parameters:** @@ -102,7 +106,7 @@ ___ ▸ **state**(`apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[IVoteState](../interfaces/ivotestate.md)›* -*Defined in [vote.ts:125](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L125)* +*Defined in [vote.ts:167](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L167)* **Parameters:** @@ -118,7 +122,7 @@ ___ ▸ **search**(`context`: [Arc](arc.md), `options`: [IVoteQueryOptions](../interfaces/ivotequeryoptions.md), `apolloQueryOptions`: [IApolloQueryOptions](../interfaces/iapolloqueryoptions.md)): *Observable‹[Vote](vote.md)[]›* -*Defined in [vote.ts:42](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L42)* +*Defined in [vote.ts:58](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L58)* Vote.search(context, options) searches for vote entities @@ -133,3 +137,29 @@ Name | Type | Default | Description | **Returns:** *Observable‹[Vote](vote.md)[]›* an observable of Vote objects + +## Object literals + +### `Static` fragments + +### ▪ **fragments**: *object* + +*Defined in [vote.ts:36](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L36)* + +### VoteFields + +• **VoteFields**: *any* = gql`fragment VoteFields on ProposalVote { + id + createdAt + dao { + id + } + voter + proposal { + id + } + outcome + reputation + }` + +*Defined in [vote.ts:37](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L37)* diff --git a/docs/enums/iexecutionstate.md b/docs/enums/iexecutionstate.md index d5aab423..ae7836fe 100644 --- a/docs/enums/iexecutionstate.md +++ b/docs/enums/iexecutionstate.md @@ -19,7 +19,7 @@ • **BoostedBarCrossed**: -*Defined in [proposal.ts:56](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L56)* +*Defined in [proposal.ts:58](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L58)* ___ @@ -27,7 +27,7 @@ ___ • **BoostedTimeOut**: -*Defined in [proposal.ts:55](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L55)* +*Defined in [proposal.ts:57](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L57)* ___ @@ -35,7 +35,7 @@ ___ • **None**: -*Defined in [proposal.ts:51](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L51)* +*Defined in [proposal.ts:53](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L53)* ___ @@ -43,7 +43,7 @@ ___ • **PreBoostedBarCrossed**: -*Defined in [proposal.ts:54](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L54)* +*Defined in [proposal.ts:56](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L56)* ___ @@ -51,7 +51,7 @@ ___ • **QueueBarCrossed**: -*Defined in [proposal.ts:52](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L52)* +*Defined in [proposal.ts:54](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L54)* ___ @@ -59,4 +59,4 @@ ___ • **QueueTimeOut**: -*Defined in [proposal.ts:53](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L53)* +*Defined in [proposal.ts:55](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L55)* diff --git a/docs/enums/iproposaloutcome.md b/docs/enums/iproposaloutcome.md index 84c49e19..25098442 100644 --- a/docs/enums/iproposaloutcome.md +++ b/docs/enums/iproposaloutcome.md @@ -16,7 +16,7 @@ • **Fail**: -*Defined in [proposal.ts:38](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L38)* +*Defined in [proposal.ts:40](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L40)* ___ @@ -24,7 +24,7 @@ ___ • **None**: -*Defined in [proposal.ts:36](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L36)* +*Defined in [proposal.ts:38](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L38)* ___ @@ -32,4 +32,4 @@ ___ • **Pass**: -*Defined in [proposal.ts:37](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L37)* +*Defined in [proposal.ts:39](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L39)* diff --git a/docs/enums/iproposalstage.md b/docs/enums/iproposalstage.md index 0d3392a5..983719f9 100644 --- a/docs/enums/iproposalstage.md +++ b/docs/enums/iproposalstage.md @@ -19,7 +19,7 @@ • **Boosted**: -*Defined in [proposal.ts:46](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L46)* +*Defined in [proposal.ts:48](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L48)* ___ @@ -27,7 +27,7 @@ ___ • **Executed**: -*Defined in [proposal.ts:43](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L43)* +*Defined in [proposal.ts:45](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L45)* ___ @@ -35,7 +35,7 @@ ___ • **ExpiredInQueue**: -*Defined in [proposal.ts:42](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L42)* +*Defined in [proposal.ts:44](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L44)* ___ @@ -43,7 +43,7 @@ ___ • **PreBoosted**: -*Defined in [proposal.ts:45](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L45)* +*Defined in [proposal.ts:47](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L47)* ___ @@ -51,7 +51,7 @@ ___ • **Queued**: -*Defined in [proposal.ts:44](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L44)* +*Defined in [proposal.ts:46](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L46)* ___ @@ -59,4 +59,4 @@ ___ • **QuietEndingPeriod**: -*Defined in [proposal.ts:47](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L47)* +*Defined in [proposal.ts:49](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L49)* diff --git a/docs/enums/itransactionstate.md b/docs/enums/itransactionstate.md index 3c61e7ed..a3e7d0b9 100644 --- a/docs/enums/itransactionstate.md +++ b/docs/enums/itransactionstate.md @@ -16,7 +16,7 @@ • **Mined**: -*Defined in [operation.ts:11](https://github.com/daostack/client/blob/0eadcce/src/operation.ts#L11)* +*Defined in [operation.ts:10](https://github.com/daostack/client/blob/aa9723f/src/operation.ts#L10)* ___ @@ -24,7 +24,7 @@ ___ • **Sending**: -*Defined in [operation.ts:9](https://github.com/daostack/client/blob/0eadcce/src/operation.ts#L9)* +*Defined in [operation.ts:8](https://github.com/daostack/client/blob/aa9723f/src/operation.ts#L8)* ___ @@ -32,4 +32,4 @@ ___ • **Sent**: -*Defined in [operation.ts:10](https://github.com/daostack/client/blob/0eadcce/src/operation.ts#L10)* +*Defined in [operation.ts:9](https://github.com/daostack/client/blob/aa9723f/src/operation.ts#L9)* diff --git a/docs/enums/proposalquerysortoptions.md b/docs/enums/proposalquerysortoptions.md index e5dda0fa..9f957bc5 100644 --- a/docs/enums/proposalquerysortoptions.md +++ b/docs/enums/proposalquerysortoptions.md @@ -15,7 +15,7 @@ • **preBoostedAt**: = "preBoostedAt" -*Defined in [proposal.ts:812](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L812)* +*Defined in [proposal.ts:856](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L856)* ___ @@ -23,4 +23,4 @@ ___ • **resolvesAt**: = "resolvesAt" -*Defined in [proposal.ts:811](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L811)* +*Defined in [proposal.ts:855](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L855)* diff --git a/docs/globals.md b/docs/globals.md index a88ec3b7..85466a92 100644 --- a/docs/globals.md +++ b/docs/globals.md @@ -15,7 +15,12 @@ ### Classes * [Arc](classes/arc.md) +* [Competition](classes/competition.md) +* [CompetitionScheme](classes/competitionscheme.md) +* [CompetitionSuggestion](classes/competitionsuggestion.md) +* [CompetitionVote](classes/competitionvote.md) * [DAO](classes/dao.md) +* [Event](classes/event.md) * [GraphNodeObserver](classes/graphnodeobserver.md) * [Member](classes/member.md) * [Proposal](classes/proposal.md) @@ -24,7 +29,9 @@ * [ReputationFromTokenScheme](classes/reputationfromtokenscheme.md) * [Reward](classes/reward.md) * [Scheme](classes/scheme.md) +* [SchemeBase](classes/schemebase.md) * [Stake](classes/stake.md) +* [Tag](classes/tag.md) * [Token](classes/token.md) * [Vote](classes/vote.md) @@ -34,14 +41,26 @@ * [IApolloQueryOptions](interfaces/iapolloqueryoptions.md) * [IApproval](interfaces/iapproval.md) * [ICommonQueryOptions](interfaces/icommonqueryoptions.md) +* [ICompetitionProposal](interfaces/icompetitionproposal.md) +* [ICompetitionSuggestion](interfaces/icompetitionsuggestion.md) +* [ICompetitionSuggestionQueryOptions](interfaces/icompetitionsuggestionqueryoptions.md) +* [ICompetitionVote](interfaces/icompetitionvote.md) +* [ICompetitionVoteQueryOptions](interfaces/icompetitionvotequeryoptions.md) * [IContractAddresses](interfaces/icontractaddresses.md) * [IContractInfo](interfaces/icontractinfo.md) * [IContributionReward](interfaces/icontributionreward.md) +* [IContributionRewardExt](interfaces/icontributionrewardext.md) +* [IContributionRewardExtParams](interfaces/icontributionrewardextparams.md) +* [IContributionRewardParams](interfaces/icontributionrewardparams.md) * [IDAOQueryOptions](interfaces/idaoqueryoptions.md) * [IDAOState](interfaces/idaostate.md) * [IDAOStaticState](interfaces/idaostaticstate.md) +* [IEventQueryOptions](interfaces/ieventqueryoptions.md) +* [IEventState](interfaces/ieventstate.md) +* [IEventStaticState](interfaces/ieventstaticstate.md) * [IGenericScheme](interfaces/igenericscheme.md) * [IGenericSchemeInfo](interfaces/igenericschemeinfo.md) +* [IGenericSchemeParams](interfaces/igenericschemeparams.md) * [IGenesisProtocolParams](interfaces/igenesisprotocolparams.md) * [IMemberQueryOptions](interfaces/imemberqueryoptions.md) * [IMemberState](interfaces/imemberstate.md) @@ -50,6 +69,8 @@ * [IOperationObservable](interfaces/ioperationobservable.md) * [IProposalBaseCreateOptions](interfaces/iproposalbasecreateoptions.md) * [IProposalCreateOptionsCR](interfaces/iproposalcreateoptionscr.md) +* [IProposalCreateOptionsCompetition](interfaces/iproposalcreateoptionscompetition.md) +* [IProposalCreateOptionsContributionRewardExt](interfaces/iproposalcreateoptionscontributionrewardext.md) * [IProposalCreateOptionsGS](interfaces/iproposalcreateoptionsgs.md) * [IProposalCreateOptionsSR](interfaces/iproposalcreateoptionssr.md) * [IProposalQueryOptions](interfaces/iproposalqueryoptions.md) @@ -62,7 +83,9 @@ * [IReputationState](interfaces/ireputationstate.md) * [IRewardQueryOptions](interfaces/irewardqueryoptions.md) * [IRewardState](interfaces/irewardstate.md) +* [IRewardStaticState](interfaces/irewardstaticstate.md) * [ISchemeQueryOptions](interfaces/ischemequeryoptions.md) +* [ISchemeRegisterParams](interfaces/ischemeregisterparams.md) * [ISchemeRegistrar](interfaces/ischemeregistrar.md) * [ISchemeState](interfaces/ischemestate.md) * [ISchemeStaticState](interfaces/ischemestaticstate.md) @@ -70,6 +93,9 @@ * [IStakeState](interfaces/istakestate.md) * [IStakeStaticState](interfaces/istakestaticstate.md) * [IStateful](interfaces/istateful.md) +* [ITagQueryOptions](interfaces/itagqueryoptions.md) +* [ITagState](interfaces/itagstate.md) +* [ITagStaticState](interfaces/itagstaticstate.md) * [ITokenQueryOptions](interfaces/itokenqueryoptions.md) * [ITokenState](interfaces/itokenstate.md) * [ITransactionUpdate](interfaces/itransactionupdate.md) @@ -95,7 +121,7 @@ ### Variables -* [BN](globals.md#const-bn) +* [ABI_DIR](globals.md#const-abi_dir) * [DAOTOKEN_CONTRACT_VERSION](globals.md#const-daotoken_contract_version) * [IPFSClient](globals.md#const-ipfsclient) * [LATEST_ARC_VERSION](globals.md#const-latest_arc_version) @@ -110,15 +136,22 @@ * [concat](globals.md#concat) * [createApolloClient](globals.md#createapolloclient) * [createGraphQlQuery](globals.md#creategraphqlquery) +* [createGraphQlWhereQuery](globals.md#creategraphqlwherequery) +* [createProposal](globals.md#createproposal) * [createTransaction](globals.md#createtransaction) * [createTransactionMap](globals.md#createtransactionmap) +* [dateToSecondsSinceEpoch](globals.md#datetosecondssinceepoch) * [eventId](globals.md#eventid) * [fromWei](globals.md#fromwei) -* [getContractAddressesFromMigration](globals.md#getcontractaddressesfrommigration) +* [getBlockTime](globals.md#getblocktime) +* [getCompetitionContract](globals.md#getcompetitioncontract) +* [hasCompetitionContract](globals.md#hascompetitioncontract) * [hexStringToUint8Array](globals.md#hexstringtouint8array) * [isAddress](globals.md#isaddress) +* [isCompetitionScheme](globals.md#iscompetitionscheme) * [mapGenesisProtocolParams](globals.md#mapgenesisprotocolparams) * [realMathToNumber](globals.md#realmathtonumber) +* [secondSinceEpochToDate](globals.md#secondsinceepochtodate) * [sendTransaction](globals.md#sendtransaction) * [toIOperationObservable](globals.md#toioperationobservable) * [toWei](globals.md#towei) @@ -134,7 +167,7 @@ Ƭ **Address**: *string* -*Defined in [types.ts:3](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L3)* +*Defined in [types.ts:4](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L4)* ___ @@ -142,7 +175,7 @@ ___ Ƭ **Date**: *number* -*Defined in [types.ts:4](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L4)* +*Defined in [types.ts:5](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L5)* ___ @@ -150,7 +183,7 @@ ___ Ƭ **EthereumEvent**: *any* -*Defined in [utils.ts:60](https://github.com/daostack/client/blob/0eadcce/src/utils.ts#L60)* +*Defined in [utils.ts:59](https://github.com/daostack/client/blob/aa9723f/src/utils.ts#L59)* ___ @@ -158,7 +191,7 @@ ___ Ƭ **Hash**: *string* -*Defined in [types.ts:5](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L5)* +*Defined in [types.ts:6](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L6)* ___ @@ -166,15 +199,15 @@ ___ Ƭ **IPFSProvider**: *string | object* -*Defined in [types.ts:21](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L21)* +*Defined in [types.ts:22](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L22)* ___ ### IProposalCreateOptions -Ƭ **IProposalCreateOptions**: *[IProposalBaseCreateOptions](interfaces/iproposalbasecreateoptions.md) & [IProposalCreateOptionsGS](interfaces/iproposalcreateoptionsgs.md) | [IProposalBaseCreateOptions](interfaces/iproposalbasecreateoptions.md) & [IProposalCreateOptionsSR](interfaces/iproposalcreateoptionssr.md) | [IProposalBaseCreateOptions](interfaces/iproposalbasecreateoptions.md) & [IProposalCreateOptionsCR](interfaces/iproposalcreateoptionscr.md)* +Ƭ **IProposalCreateOptions**: *[IProposalBaseCreateOptions](interfaces/iproposalbasecreateoptions.md) & [IProposalCreateOptionsGS](interfaces/iproposalcreateoptionsgs.md) | [IProposalBaseCreateOptions](interfaces/iproposalbasecreateoptions.md) & [IProposalCreateOptionsSR](interfaces/iproposalcreateoptionssr.md) | [IProposalBaseCreateOptions](interfaces/iproposalbasecreateoptions.md) & [IProposalCreateOptionsCR](interfaces/iproposalcreateoptionscr.md) | [IProposalCreateOptionsContributionRewardExt](interfaces/iproposalcreateoptionscontributionrewardext.md) | [IProposalCreateOptionsCompetition](interfaces/iproposalcreateoptionscompetition.md)* -*Defined in [proposal.ts:848](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L848)* +*Defined in [proposal.ts:895](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L895)* ___ @@ -182,7 +215,7 @@ ___ Ƭ **IProposalType**: *[ContributionReward](globals.md#contributionreward) | [GenericScheme](globals.md#genericscheme) | [SchemeRegistrarAdd](globals.md#schemeregistraradd) | [SchemeRegistrarEdit](globals.md#schemeregistraredit) | [SchemeRegistrarRemove](globals.md#schemeregistrarremove)* -*Defined in [proposal.ts:29](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L29)* +*Defined in [proposal.ts:31](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L31)* ___ @@ -190,7 +223,7 @@ ___ Ƭ **Operation**: *[IOperationObservable](interfaces/ioperationobservable.md)‹[ITransactionUpdate](interfaces/itransactionupdate.md)‹T››* -*Defined in [operation.ts:39](https://github.com/daostack/client/blob/0eadcce/src/operation.ts#L39)* +*Defined in [operation.ts:38](https://github.com/daostack/client/blob/aa9723f/src/operation.ts#L38)* ___ @@ -198,7 +231,7 @@ ___ Ƭ **Web3Provider**: *string | object* -*Defined in [types.ts:7](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L7)* +*Defined in [types.ts:8](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L8)* ___ @@ -206,7 +239,7 @@ ___ Ƭ **Web3Receipt**: *any* -*Defined in [types.ts:6](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L6)* +*Defined in [types.ts:7](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L7)* ___ @@ -214,15 +247,15 @@ ___ Ƭ **web3receipt**: *object* -*Defined in [operation.ts:41](https://github.com/daostack/client/blob/0eadcce/src/operation.ts#L41)* +*Defined in [operation.ts:40](https://github.com/daostack/client/blob/aa9723f/src/operation.ts#L40)* ## Variables -### `Const` BN +### `Const` ABI_DIR -• **BN**: *any* = require('bn.js') +• **ABI_DIR**: *"./abis"* = "./abis" -*Defined in [utils.ts:7](https://github.com/daostack/client/blob/0eadcce/src/utils.ts#L7)* +*Defined in [settings.ts:8](https://github.com/daostack/client/blob/aa9723f/src/settings.ts#L8)* ___ @@ -230,7 +263,7 @@ ___ • **DAOTOKEN_CONTRACT_VERSION**: *"0.0.1-rc.19"* = "0.0.1-rc.19" -*Defined in [settings.ts:5](https://github.com/daostack/client/blob/0eadcce/src/settings.ts#L5)* +*Defined in [settings.ts:5](https://github.com/daostack/client/blob/aa9723f/src/settings.ts#L5)* ___ @@ -238,7 +271,7 @@ ___ • **IPFSClient**: *any* = require('ipfs-http-client') -*Defined in [arc.ts:15](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L15)* +*Defined in [arc.ts:18](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L18)* ___ @@ -246,7 +279,7 @@ ___ • **LATEST_ARC_VERSION**: *"0.0.1-rc.19"* = "0.0.1-rc.19" -*Defined in [settings.ts:6](https://github.com/daostack/client/blob/0eadcce/src/settings.ts#L6)* +*Defined in [settings.ts:6](https://github.com/daostack/client/blob/aa9723f/src/settings.ts#L6)* ___ @@ -254,15 +287,15 @@ ___ • **NULL_ADDRESS**: *"0x0000000000000000000000000000000000000000"* = "0x0000000000000000000000000000000000000000" -*Defined in [utils.ts:158](https://github.com/daostack/client/blob/0eadcce/src/utils.ts#L158)* +*Defined in [utils.ts:97](https://github.com/daostack/client/blob/aa9723f/src/utils.ts#L97)* ___ ### `Const` REDEEMER_CONTRACT_VERSION -• **REDEEMER_CONTRACT_VERSION**: *"0.0.1-rc.22"* = "0.0.1-rc.22" +• **REDEEMER_CONTRACT_VERSION**: *"0.0.1-rc.36"* = "0.0.1-rc.36" -*Defined in [settings.ts:2](https://github.com/daostack/client/blob/0eadcce/src/settings.ts#L2)* +*Defined in [settings.ts:2](https://github.com/daostack/client/blob/aa9723f/src/settings.ts#L2)* ___ @@ -270,7 +303,7 @@ ___ • **REPUTATION_CONTRACT_VERSION**: *"0.0.1-rc.19"* = "0.0.1-rc.19" -*Defined in [settings.ts:4](https://github.com/daostack/client/blob/0eadcce/src/settings.ts#L4)* +*Defined in [settings.ts:4](https://github.com/daostack/client/blob/aa9723f/src/settings.ts#L4)* ___ @@ -278,9 +311,11 @@ ___ • **Web3**: *any* = require('web3') -*Defined in [utils.ts:6](https://github.com/daostack/client/blob/0eadcce/src/utils.ts#L6)* +*Defined in [utils.ts:5](https://github.com/daostack/client/blob/aa9723f/src/utils.ts#L5)* -*Defined in [arc.ts:16](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L16)* +*Defined in [schemes/competition.ts:20](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L20)* + +*Defined in [arc.ts:19](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L19)* ## Functions @@ -288,7 +323,7 @@ ___ ▸ **checkWebsocket**(`options`: object): *void* -*Defined in [utils.ts:17](https://github.com/daostack/client/blob/0eadcce/src/utils.ts#L17)* +*Defined in [utils.ts:16](https://github.com/daostack/client/blob/aa9723f/src/utils.ts#L16)* **Parameters:** @@ -306,7 +341,7 @@ ___ ▸ **concat**(`a`: Uint8Array, `b`: Uint8Array): *Uint8Array* -*Defined in [utils.ts:48](https://github.com/daostack/client/blob/0eadcce/src/utils.ts#L48)* +*Defined in [utils.ts:47](https://github.com/daostack/client/blob/aa9723f/src/utils.ts#L47)* **Parameters:** @@ -323,7 +358,7 @@ ___ ▸ **createApolloClient**(`options`: object): *ApolloClient‹NormalizedCacheObject›* -*Defined in [graphnode.ts:26](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L26)* +*Defined in [graphnode.ts:26](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L26)* **Parameters:** @@ -343,7 +378,7 @@ ___ ▸ **createGraphQlQuery**(`options`: [ICommonQueryOptions](interfaces/icommonqueryoptions.md), `where`: string): *string* -*Defined in [utils.ts:187](https://github.com/daostack/client/blob/0eadcce/src/utils.ts#L187)* +*Defined in [utils.ts:109](https://github.com/daostack/client/blob/aa9723f/src/utils.ts#L109)* creates a string to be plugsging into a graphql query @@ -363,11 +398,44 @@ Name | Type | Default | ___ +### createGraphQlWhereQuery + +▸ **createGraphQlWhereQuery**(`where?`: undefined | object): *string* + +*Defined in [utils.ts:139](https://github.com/daostack/client/blob/aa9723f/src/utils.ts#L139)* + +**Parameters:** + +Name | Type | +------ | ------ | +`where?` | undefined | object | + +**Returns:** *string* + +___ + +### createProposal + +▸ **createProposal**(`options`: any, `context`: [Arc](classes/arc.md)): *(Anonymous function)* + +*Defined in [schemes/contributionReward.ts:37](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L37)* + +**Parameters:** + +Name | Type | Description | +------ | ------ | ------ | +`options` | any | - | +`context` | [Arc](classes/arc.md) | | + +**Returns:** *(Anonymous function)* + +___ + ### createTransaction ▸ **createTransaction**(`options`: any, `context`: [Arc](classes/arc.md)): *(Anonymous function)* -*Defined in [schemes/contributionReward.ts:37](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L37)* +*Defined in [schemes/genericScheme.ts:28](https://github.com/daostack/client/blob/aa9723f/src/schemes/genericScheme.ts#L28)* **Parameters:** @@ -384,7 +452,7 @@ ___ ▸ **createTransactionMap**(`options`: any, `context`: [Arc](classes/arc.md)): *map* -*Defined in [schemes/contributionReward.ts:61](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L61)* +*Defined in [schemes/contributionReward.ts:61](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L61)* map the transaction receipt of the createTransaction call to a nice result map the transaction receipt of the createTransaction call to a nice result @@ -401,11 +469,27 @@ Name | Type | Description | ___ +### dateToSecondsSinceEpoch + +▸ **dateToSecondsSinceEpoch**(`date`: Date): *number* + +*Defined in [utils.ts:164](https://github.com/daostack/client/blob/aa9723f/src/utils.ts#L164)* + +**Parameters:** + +Name | Type | +------ | ------ | +`date` | Date | + +**Returns:** *number* + +___ + ### eventId ▸ **eventId**(`event`: [EthereumEvent](globals.md#ethereumevent)): *string* -*Defined in [utils.ts:62](https://github.com/daostack/client/blob/0eadcce/src/utils.ts#L62)* +*Defined in [utils.ts:61](https://github.com/daostack/client/blob/aa9723f/src/utils.ts#L61)* **Parameters:** @@ -419,41 +503,82 @@ ___ ### fromWei -▸ **fromWei**(`amount`: any): *string* +▸ **fromWei**(`amount`: BN): *string* -*Defined in [utils.ts:9](https://github.com/daostack/client/blob/0eadcce/src/utils.ts#L9)* +*Defined in [utils.ts:8](https://github.com/daostack/client/blob/aa9723f/src/utils.ts#L8)* **Parameters:** Name | Type | ------ | ------ | -`amount` | any | +`amount` | BN | **Returns:** *string* ___ -### getContractAddressesFromMigration +### getBlockTime -▸ **getContractAddressesFromMigration**(`environment`: "private" | "rinkeby" | "mainnet"): *[IContractInfo](interfaces/icontractinfo.md)[]* +▸ **getBlockTime**(`web3`: any): *Promise‹any›* -*Defined in [utils.ts:160](https://github.com/daostack/client/blob/0eadcce/src/utils.ts#L160)* +*Defined in [utils.ts:184](https://github.com/daostack/client/blob/aa9723f/src/utils.ts#L184)* **Parameters:** Name | Type | ------ | ------ | -`environment` | "private" | "rinkeby" | "mainnet" | +`web3` | any | -**Returns:** *[IContractInfo](interfaces/icontractinfo.md)[]* +**Returns:** *Promise‹any›* + +___ + +### getCompetitionContract + +▸ **getCompetitionContract**(`schemeState`: [ISchemeState](interfaces/ischemestate.md), `arc`: [Arc](classes/arc.md)): *any* + +*Defined in [schemes/competition.ts:718](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L718)* + +If this scheme is a ContributionREwardExt scheme and if +its rewarder is Competition contract, return that contract + +**Parameters:** + +Name | Type | +------ | ------ | +`schemeState` | [ISchemeState](interfaces/ischemestate.md) | +`arc` | [Arc](classes/arc.md) | + +**Returns:** *any* + +A Web3 contract instance + +___ + +### hasCompetitionContract + +▸ **hasCompetitionContract**(`schemeState`: [ISchemeState](interfaces/ischemestate.md), `arc`: [Arc](classes/arc.md)): *boolean* + +*Defined in [schemes/competition.ts:746](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L746)* + +**Parameters:** + +Name | Type | +------ | ------ | +`schemeState` | [ISchemeState](interfaces/ischemestate.md) | +`arc` | [Arc](classes/arc.md) | + +**Returns:** *boolean* + +true if this is a ContributionRewardExt scheme and the rewarder of this scheme is a competition contract ___ ### hexStringToUint8Array -▸ **hexStringToUint8Array**(`hexString`: string): *Uint8Array* +▸ **hexStringToUint8Array**(`hexString`: string): *Uint8Array‹›* -*Defined in [utils.ts:39](https://github.com/daostack/client/blob/0eadcce/src/utils.ts#L39)* +*Defined in [utils.ts:38](https://github.com/daostack/client/blob/aa9723f/src/utils.ts#L38)* **Parameters:** @@ -461,7 +586,7 @@ Name | Type | ------ | ------ | `hexString` | string | -**Returns:** *Uint8Array* +**Returns:** *Uint8Array‹›* ___ @@ -469,7 +594,7 @@ ___ ▸ **isAddress**(`address`: [Address](globals.md#address)): *void* -*Defined in [utils.ts:67](https://github.com/daostack/client/blob/0eadcce/src/utils.ts#L67)* +*Defined in [utils.ts:66](https://github.com/daostack/client/blob/aa9723f/src/utils.ts#L66)* **Parameters:** @@ -481,11 +606,28 @@ Name | Type | ___ +### isCompetitionScheme + +▸ **isCompetitionScheme**(`arc`: [Arc](classes/arc.md), `item`: any): *boolean* + +*Defined in [schemes/competition.ts:734](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L734)* + +**Parameters:** + +Name | Type | +------ | ------ | +`arc` | [Arc](classes/arc.md) | +`item` | any | + +**Returns:** *boolean* + +___ + ### mapGenesisProtocolParams ▸ **mapGenesisProtocolParams**(`params`: [IGenesisProtocolParams](interfaces/igenesisprotocolparams.md)): *object* -*Defined in [genesisProtocol.ts:18](https://github.com/daostack/client/blob/0eadcce/src/genesisProtocol.ts#L18)* +*Defined in [genesisProtocol.ts:19](https://github.com/daostack/client/blob/aa9723f/src/genesisProtocol.ts#L19)* **Parameters:** @@ -503,11 +645,11 @@ Name | Type | * **limitExponentValue**: *number* = Number(params.limitExponentValue) -* **minimumDaoBounty**: *any* = new BN(params.minimumDaoBounty) +* **minimumDaoBounty**: *BN‹›* = new BN(params.minimumDaoBounty) * **preBoostedVotePeriodLimit**: *number* = Number(params.preBoostedVotePeriodLimit) -* **proposingRepReward**: *any* = new BN(params.proposingRepReward) +* **proposingRepReward**: *BN‹›* = new BN(params.proposingRepReward) * **queuedVotePeriodLimit**: *number* = Number(params.queuedVotePeriodLimit) @@ -523,9 +665,9 @@ ___ ### realMathToNumber -▸ **realMathToNumber**(`t`: any): *number* +▸ **realMathToNumber**(`t`: BN): *number* -*Defined in [utils.ts:152](https://github.com/daostack/client/blob/0eadcce/src/utils.ts#L152)* +*Defined in [utils.ts:91](https://github.com/daostack/client/blob/aa9723f/src/utils.ts#L91)* convert the number representation of RealMath.sol representations to real real numbers @@ -533,7 +675,7 @@ convert the number representation of RealMath.sol representations to real real n Name | Type | Description | ------ | ------ | ------ | -`t` | any | a BN instance of a real number in the RealMath representation | +`t` | BN | a BN instance of a real number in the RealMath representation | **Returns:** *number* @@ -541,11 +683,27 @@ a BN ___ +### secondSinceEpochToDate + +▸ **secondSinceEpochToDate**(`seconds`: number): *Date* + +*Defined in [utils.ts:172](https://github.com/daostack/client/blob/aa9723f/src/utils.ts#L172)* + +**Parameters:** + +Name | Type | +------ | ------ | +`seconds` | number | + +**Returns:** *Date* + +___ + ### sendTransaction ▸ **sendTransaction**<**T**>(`transaction`: any, `mapReceipt`: function, `errorHandler`: function, `context`: [Arc](classes/arc.md)): *[Operation](globals.md#operation)‹T›* -*Defined in [operation.ts:60](https://github.com/daostack/client/blob/0eadcce/src/operation.ts#L60)* +*Defined in [operation.ts:59](https://github.com/daostack/client/blob/aa9723f/src/operation.ts#L59)* send a transaction to the ethereumblockchain, and return a observable of ITransactionUpdatessend for example: @@ -605,7 +763,7 @@ ___ ▸ **toIOperationObservable**<**T**>(`observable`: Observable‹T›): *[IOperationObservable](interfaces/ioperationobservable.md)‹T›* -*Defined in [operation.ts:168](https://github.com/daostack/client/blob/0eadcce/src/operation.ts#L168)* +*Defined in [operation.ts:180](https://github.com/daostack/client/blob/aa9723f/src/operation.ts#L180)* **Type parameters:** @@ -623,9 +781,9 @@ ___ ### toWei -▸ **toWei**(`amount`: string | number): *any* +▸ **toWei**(`amount`: string | number): *BN* -*Defined in [utils.ts:13](https://github.com/daostack/client/blob/0eadcce/src/utils.ts#L13)* +*Defined in [utils.ts:12](https://github.com/daostack/client/blob/aa9723f/src/utils.ts#L12)* **Parameters:** @@ -633,7 +791,7 @@ Name | Type | ------ | ------ | `amount` | string | number | -**Returns:** *any* +**Returns:** *BN* ___ @@ -641,7 +799,7 @@ ___ ▸ **zenToRxjsObservable**(`zenObservable`: ZenObservable‹any›): *any* -*Defined in [utils.ts:81](https://github.com/daostack/client/blob/0eadcce/src/utils.ts#L81)* +*Defined in [utils.ts:80](https://github.com/daostack/client/blob/aa9723f/src/utils.ts#L80)* convert a ZenObservable to an rxjs.Observable @@ -661,44 +819,48 @@ an Observable instance ### ▪ **IProposalType**: *object* -*Defined in [schemes/contributionReward.ts:33](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L33)* +*Defined in [schemes/contributionReward.ts:33](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L33)* -*Defined in [schemes/genericScheme.ts:23](https://github.com/daostack/client/blob/0eadcce/src/schemes/genericScheme.ts#L23)* +*Defined in [schemes/contributionRewardExt.ts:32](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L32)* -*Defined in [schemes/schemeRegistrar.ts:22](https://github.com/daostack/client/blob/0eadcce/src/schemes/schemeRegistrar.ts#L22)* +*Defined in [schemes/genericScheme.ts:24](https://github.com/daostack/client/blob/aa9723f/src/schemes/genericScheme.ts#L24)* -*Defined in [schemes/uGenericScheme.ts:23](https://github.com/daostack/client/blob/0eadcce/src/schemes/uGenericScheme.ts#L23)* +*Defined in [schemes/schemeRegistrar.ts:22](https://github.com/daostack/client/blob/aa9723f/src/schemes/schemeRegistrar.ts#L22)* -*Defined in [proposal.ts:23](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L23)* +*Defined in [schemes/uGenericScheme.ts:23](https://github.com/daostack/client/blob/aa9723f/src/schemes/uGenericScheme.ts#L23)* + +*Defined in [proposal.ts:25](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L25)* ### ContributionReward -• **ContributionReward**: = "ContributionReward" +• **ContributionReward**: = "ContributionRewardExt" + +*Defined in [schemes/contributionReward.ts:34](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L34)* -*Defined in [schemes/contributionReward.ts:34](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L34)* +*Defined in [schemes/contributionRewardExt.ts:33](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L33)* ### GenericScheme • **GenericScheme**: = "UGenericScheme" -*Defined in [schemes/genericScheme.ts:24](https://github.com/daostack/client/blob/0eadcce/src/schemes/genericScheme.ts#L24)* +*Defined in [schemes/genericScheme.ts:25](https://github.com/daostack/client/blob/aa9723f/src/schemes/genericScheme.ts#L25)* -*Defined in [schemes/uGenericScheme.ts:24](https://github.com/daostack/client/blob/0eadcce/src/schemes/uGenericScheme.ts#L24)* +*Defined in [schemes/uGenericScheme.ts:24](https://github.com/daostack/client/blob/aa9723f/src/schemes/uGenericScheme.ts#L24)* ### SchemeRegistrarAdd • **SchemeRegistrarAdd**: = "SchemeRegistrarAdd" -*Defined in [schemes/schemeRegistrar.ts:23](https://github.com/daostack/client/blob/0eadcce/src/schemes/schemeRegistrar.ts#L23)* +*Defined in [schemes/schemeRegistrar.ts:23](https://github.com/daostack/client/blob/aa9723f/src/schemes/schemeRegistrar.ts#L23)* ### SchemeRegistrarEdit • **SchemeRegistrarEdit**: = "SchemeRegistrarEdit" -*Defined in [schemes/schemeRegistrar.ts:24](https://github.com/daostack/client/blob/0eadcce/src/schemes/schemeRegistrar.ts#L24)* +*Defined in [schemes/schemeRegistrar.ts:24](https://github.com/daostack/client/blob/aa9723f/src/schemes/schemeRegistrar.ts#L24)* ### SchemeRegistrarRemove • **SchemeRegistrarRemove**: = "SchemeRegistrarRemove" -*Defined in [schemes/schemeRegistrar.ts:25](https://github.com/daostack/client/blob/0eadcce/src/schemes/schemeRegistrar.ts#L25)* +*Defined in [schemes/schemeRegistrar.ts:25](https://github.com/daostack/client/blob/aa9723f/src/schemes/schemeRegistrar.ts#L25)* diff --git a/docs/interfaces/iallowance.md b/docs/interfaces/iallowance.md index d7424c2f..198d4763 100644 --- a/docs/interfaces/iallowance.md +++ b/docs/interfaces/iallowance.md @@ -19,9 +19,9 @@ ### amount -• **amount**: *any* +• **amount**: *BN* -*Defined in [token.ts:41](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L41)* +*Defined in [token.ts:41](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L41)* ___ @@ -29,7 +29,7 @@ ___ • **owner**: *[Address](../globals.md#address)* -*Defined in [token.ts:39](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L39)* +*Defined in [token.ts:39](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L39)* ___ @@ -37,7 +37,7 @@ ___ • **spender**: *[Address](../globals.md#address)* -*Defined in [token.ts:40](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L40)* +*Defined in [token.ts:40](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L40)* ___ @@ -45,4 +45,4 @@ ___ • **token**: *[Address](../globals.md#address)* -*Defined in [token.ts:38](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L38)* +*Defined in [token.ts:38](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L38)* diff --git a/docs/interfaces/iapolloqueryoptions.md b/docs/interfaces/iapolloqueryoptions.md index c5b1a0b1..89b4af91 100644 --- a/docs/interfaces/iapolloqueryoptions.md +++ b/docs/interfaces/iapolloqueryoptions.md @@ -20,7 +20,7 @@ • **fetchAllData**? : *true | false* -*Defined in [graphnode.ts:19](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L19)* +*Defined in [graphnode.ts:19](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L19)* ___ @@ -28,7 +28,7 @@ ___ • **fetchPolicy**? : *"cache-first" | "network-only" | "cache-only" | "no-cache" | "standby"* -*Defined in [graphnode.ts:17](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L17)* +*Defined in [graphnode.ts:17](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L17)* ___ @@ -36,4 +36,4 @@ ___ • **subscribe**? : *true | false* -*Defined in [graphnode.ts:18](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L18)* +*Defined in [graphnode.ts:18](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L18)* diff --git a/docs/interfaces/iapproval.md b/docs/interfaces/iapproval.md index edbeb374..6281d838 100644 --- a/docs/interfaces/iapproval.md +++ b/docs/interfaces/iapproval.md @@ -23,7 +23,7 @@ • **contract**: *[Address](../globals.md#address)* -*Defined in [token.ts:31](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L31)* +*Defined in [token.ts:31](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L31)* ___ @@ -31,7 +31,7 @@ ___ • **id**: *[Hash](../globals.md#hash)* -*Defined in [token.ts:29](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L29)* +*Defined in [token.ts:29](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L29)* ___ @@ -39,7 +39,7 @@ ___ • **owner**: *[Address](../globals.md#address)* -*Defined in [token.ts:32](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L32)* +*Defined in [token.ts:32](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L32)* ___ @@ -47,7 +47,7 @@ ___ • **spender**: *[Address](../globals.md#address)* -*Defined in [token.ts:33](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L33)* +*Defined in [token.ts:33](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L33)* ___ @@ -55,12 +55,12 @@ ___ • **txHash**: *[Hash](../globals.md#hash)* -*Defined in [token.ts:30](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L30)* +*Defined in [token.ts:30](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L30)* ___ ### value -• **value**: *any* +• **value**: *BN* -*Defined in [token.ts:34](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L34)* +*Defined in [token.ts:34](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L34)* diff --git a/docs/interfaces/icommonqueryoptions.md b/docs/interfaces/icommonqueryoptions.md index e7aa4327..bb09d75f 100644 --- a/docs/interfaces/icommonqueryoptions.md +++ b/docs/interfaces/icommonqueryoptions.md @@ -10,6 +10,12 @@ ↳ [ISchemeQueryOptions](ischemequeryoptions.md) + ↳ [ISchemeQueryOptions](ischemequeryoptions.md) + + ↳ [ISchemeQueryOptions](ischemequeryoptions.md) + + ↳ [ICompetitionSuggestionQueryOptions](icompetitionsuggestionqueryoptions.md) + ↳ [IQueueQueryOptions](iqueuequeryoptions.md) ↳ [IRewardQueryOptions](irewardqueryoptions.md) @@ -28,6 +34,10 @@ ↳ [IDAOQueryOptions](idaoqueryoptions.md) + ↳ [IEventQueryOptions](ieventqueryoptions.md) + + ↳ [ITagQueryOptions](itagqueryoptions.md) + ## Index ### Properties @@ -44,7 +54,7 @@ • **first**? : *undefined | number* -*Defined in [types.ts:15](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L15)* +*Defined in [types.ts:16](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L16)* ___ @@ -52,7 +62,7 @@ ___ • **orderBy**? : *undefined | string* -*Defined in [types.ts:16](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L16)* +*Defined in [types.ts:17](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L17)* ___ @@ -60,7 +70,7 @@ ___ • **orderDirection**? : *"asc" | "desc"* -*Defined in [types.ts:17](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L17)* +*Defined in [types.ts:18](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L18)* ___ @@ -68,7 +78,7 @@ ___ • **skip**? : *undefined | number* -*Defined in [types.ts:14](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L14)* +*Defined in [types.ts:15](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L15)* ___ @@ -76,4 +86,4 @@ ___ • **where**? : *any* -*Defined in [types.ts:18](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L18)* +*Defined in [types.ts:19](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L19)* diff --git a/docs/interfaces/icompetitionproposal.md b/docs/interfaces/icompetitionproposal.md new file mode 100644 index 00000000..c6fb715c --- /dev/null +++ b/docs/interfaces/icompetitionproposal.md @@ -0,0 +1,111 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [ICompetitionProposal](icompetitionproposal.md) + +# Interface: ICompetitionProposal + +## Hierarchy + +* **ICompetitionProposal** + +## Index + +### Properties + +* [contract](icompetitionproposal.md#contract) +* [createdAt](icompetitionproposal.md#createdat) +* [endTime](icompetitionproposal.md#endtime) +* [id](icompetitionproposal.md#id) +* [numberOfVotesPerVoter](icompetitionproposal.md#numberofvotespervoter) +* [numberOfWinners](icompetitionproposal.md#numberofwinners) +* [rewardSplit](icompetitionproposal.md#rewardsplit) +* [snapshotBlock](icompetitionproposal.md#snapshotblock) +* [startTime](icompetitionproposal.md#starttime) +* [suggestionsEndTime](icompetitionproposal.md#suggestionsendtime) +* [votingStartTime](icompetitionproposal.md#votingstarttime) + +## Properties + +### contract + +• **contract**: *[Address](../globals.md#address)* + +*Defined in [schemes/competition.ts:24](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L24)* + +___ + +### createdAt + +• **createdAt**: *Date* + +*Defined in [schemes/competition.ts:33](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L33)* + +___ + +### endTime + +• **endTime**: *Date* + +*Defined in [schemes/competition.ts:25](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L25)* + +___ + +### id + +• **id**: *string* + +*Defined in [schemes/competition.ts:23](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L23)* + +___ + +### numberOfVotesPerVoter + +• **numberOfVotesPerVoter**: *number* + +*Defined in [schemes/competition.ts:31](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L31)* + +___ + +### numberOfWinners + +• **numberOfWinners**: *number* + +*Defined in [schemes/competition.ts:26](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L26)* + +___ + +### rewardSplit + +• **rewardSplit**: *number[]* + +*Defined in [schemes/competition.ts:27](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L27)* + +___ + +### snapshotBlock + +• **snapshotBlock**: *number* + +*Defined in [schemes/competition.ts:32](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L32)* + +___ + +### startTime + +• **startTime**: *Date* + +*Defined in [schemes/competition.ts:28](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L28)* + +___ + +### suggestionsEndTime + +• **suggestionsEndTime**: *Date* + +*Defined in [schemes/competition.ts:30](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L30)* + +___ + +### votingStartTime + +• **votingStartTime**: *Date* + +*Defined in [schemes/competition.ts:29](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L29)* diff --git a/docs/interfaces/icompetitionsuggestion.md b/docs/interfaces/icompetitionsuggestion.md new file mode 100644 index 00000000..432faa06 --- /dev/null +++ b/docs/interfaces/icompetitionsuggestion.md @@ -0,0 +1,120 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [ICompetitionSuggestion](icompetitionsuggestion.md) + +# Interface: ICompetitionSuggestion + +## Hierarchy + +* **ICompetitionSuggestion** + +## Index + +### Properties + +* [createdAt](icompetitionsuggestion.md#createdat) +* [description](icompetitionsuggestion.md#optional-description) +* [descriptionHash](icompetitionsuggestion.md#descriptionhash) +* [id](icompetitionsuggestion.md#id) +* [proposal](icompetitionsuggestion.md#proposal) +* [redeemedAt](icompetitionsuggestion.md#redeemedat) +* [rewardPercentage](icompetitionsuggestion.md#rewardpercentage) +* [suggester](icompetitionsuggestion.md#suggester) +* [suggestionId](icompetitionsuggestion.md#suggestionid) +* [title](icompetitionsuggestion.md#optional-title) +* [totalVotes](icompetitionsuggestion.md#totalvotes) +* [url](icompetitionsuggestion.md#optional-url) + +## Properties + +### createdAt + +• **createdAt**: *Date* + +*Defined in [schemes/competition.ts:64](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L64)* + +___ + +### `Optional` description + +• **description**? : *undefined | string* + +*Defined in [schemes/competition.ts:58](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L58)* + +___ + +### descriptionHash + +• **descriptionHash**: *string* + +*Defined in [schemes/competition.ts:56](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L56)* + +___ + +### id + +• **id**: *string* + +*Defined in [schemes/competition.ts:53](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L53)* + +___ + +### proposal + +• **proposal**: *string* + +*Defined in [schemes/competition.ts:55](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L55)* + +___ + +### redeemedAt + +• **redeemedAt**: *Date* + +*Defined in [schemes/competition.ts:65](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L65)* + +___ + +### rewardPercentage + +• **rewardPercentage**: *number* + +*Defined in [schemes/competition.ts:66](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L66)* + +___ + +### suggester + +• **suggester**: *[Address](../globals.md#address)* + +*Defined in [schemes/competition.ts:61](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L61)* + +___ + +### suggestionId + +• **suggestionId**: *number* + +*Defined in [schemes/competition.ts:54](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L54)* + +___ + +### `Optional` title + +• **title**? : *undefined | string* + +*Defined in [schemes/competition.ts:57](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L57)* + +___ + +### totalVotes + +• **totalVotes**: *BN* + +*Defined in [schemes/competition.ts:63](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L63)* + +___ + +### `Optional` url + +• **url**? : *undefined | string* + +*Defined in [schemes/competition.ts:59](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L59)* diff --git a/docs/interfaces/icompetitionsuggestionqueryoptions.md b/docs/interfaces/icompetitionsuggestionqueryoptions.md new file mode 100644 index 00000000..4d43e2a9 --- /dev/null +++ b/docs/interfaces/icompetitionsuggestionqueryoptions.md @@ -0,0 +1,69 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [ICompetitionSuggestionQueryOptions](icompetitionsuggestionqueryoptions.md) + +# Interface: ICompetitionSuggestionQueryOptions + +## Hierarchy + +* [ICommonQueryOptions](icommonqueryoptions.md) + + ↳ **ICompetitionSuggestionQueryOptions** + +## Index + +### Properties + +* [first](icompetitionsuggestionqueryoptions.md#optional-first) +* [orderBy](icompetitionsuggestionqueryoptions.md#optional-orderby) +* [orderDirection](icompetitionsuggestionqueryoptions.md#optional-orderdirection) +* [skip](icompetitionsuggestionqueryoptions.md#optional-skip) +* [where](icompetitionsuggestionqueryoptions.md#optional-where) + +## Properties + +### `Optional` first + +• **first**? : *undefined | number* + +*Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[first](icommonqueryoptions.md#optional-first)* + +*Defined in [types.ts:16](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L16)* + +___ + +### `Optional` orderBy + +• **orderBy**? : *undefined | string* + +*Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderBy](icommonqueryoptions.md#optional-orderby)* + +*Defined in [types.ts:17](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L17)* + +___ + +### `Optional` orderDirection + +• **orderDirection**? : *"asc" | "desc"* + +*Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderDirection](icommonqueryoptions.md#optional-orderdirection)* + +*Defined in [types.ts:18](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L18)* + +___ + +### `Optional` skip + +• **skip**? : *undefined | number* + +*Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[skip](icommonqueryoptions.md#optional-skip)* + +*Defined in [types.ts:15](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L15)* + +___ + +### `Optional` where + +• **where**? : *undefined | object* + +*Overrides [ICommonQueryOptions](icommonqueryoptions.md).[where](icommonqueryoptions.md#optional-where)* + +*Defined in [schemes/competition.ts:471](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L471)* diff --git a/docs/interfaces/icompetitionvote.md b/docs/interfaces/icompetitionvote.md new file mode 100644 index 00000000..8da65121 --- /dev/null +++ b/docs/interfaces/icompetitionvote.md @@ -0,0 +1,48 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [ICompetitionVote](icompetitionvote.md) + +# Interface: ICompetitionVote + +## Hierarchy + +* **ICompetitionVote** + +## Index + +### Properties + +* [createdAt](icompetitionvote.md#optional-createdat) +* [id](icompetitionvote.md#optional-id) +* [reputation](icompetitionvote.md#reputation) +* [voter](icompetitionvote.md#voter) + +## Properties + +### `Optional` createdAt + +• **createdAt**? : *[Date](../globals.md#date)* + +*Defined in [schemes/competition.ts:74](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L74)* + +___ + +### `Optional` id + +• **id**? : *undefined | string* + +*Defined in [schemes/competition.ts:70](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L70)* + +___ + +### reputation + +• **reputation**: *BN* + +*Defined in [schemes/competition.ts:75](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L75)* + +___ + +### voter + +• **voter**: *[Address](../globals.md#address)* + +*Defined in [schemes/competition.ts:73](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L73)* diff --git a/docs/interfaces/icompetitionvotequeryoptions.md b/docs/interfaces/icompetitionvotequeryoptions.md new file mode 100644 index 00000000..a43ac369 --- /dev/null +++ b/docs/interfaces/icompetitionvotequeryoptions.md @@ -0,0 +1,21 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [ICompetitionVoteQueryOptions](icompetitionvotequeryoptions.md) + +# Interface: ICompetitionVoteQueryOptions + +## Hierarchy + +* **ICompetitionVoteQueryOptions** + +## Index + +### Properties + +* [where](icompetitionvotequeryoptions.md#optional-where) + +## Properties + +### `Optional` where + +• **where**? : *undefined | object* + +*Defined in [schemes/competition.ts:639](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L639)* diff --git a/docs/interfaces/icontractinfo.md b/docs/interfaces/icontractinfo.md index 06aee70d..2c983089 100644 --- a/docs/interfaces/icontractinfo.md +++ b/docs/interfaces/icontractinfo.md @@ -21,7 +21,7 @@ • **address**: *[Address](../globals.md#address)* -*Defined in [arc.ts:444](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L444)* +*Defined in [arc.ts:462](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L462)* ___ @@ -29,7 +29,7 @@ ___ • **id**: *string* -*Defined in [arc.ts:442](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L442)* +*Defined in [arc.ts:460](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L460)* ___ @@ -37,7 +37,7 @@ ___ • **name**: *string* -*Defined in [arc.ts:445](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L445)* +*Defined in [arc.ts:463](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L463)* ___ @@ -45,4 +45,4 @@ ___ • **version**: *string* -*Defined in [arc.ts:443](https://github.com/daostack/client/blob/0eadcce/src/arc.ts#L443)* +*Defined in [arc.ts:461](https://github.com/daostack/client/blob/aa9723f/src/arc.ts#L461)* diff --git a/docs/interfaces/icontributionreward.md b/docs/interfaces/icontributionreward.md index 7ba6917f..0b7d216e 100644 --- a/docs/interfaces/icontributionreward.md +++ b/docs/interfaces/icontributionreward.md @@ -29,7 +29,7 @@ • **alreadyRedeemedEthPeriods**: *number* -*Defined in [schemes/contributionReward.ts:19](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L19)* +*Defined in [schemes/contributionReward.ts:19](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L19)* ___ @@ -37,7 +37,7 @@ ___ • **alreadyRedeemedExternalTokenPeriods**: *number* -*Defined in [schemes/contributionReward.ts:18](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L18)* +*Defined in [schemes/contributionReward.ts:18](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L18)* ___ @@ -45,7 +45,7 @@ ___ • **alreadyRedeemedNativeTokenPeriods**: *number* -*Defined in [schemes/contributionReward.ts:16](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L16)* +*Defined in [schemes/contributionReward.ts:16](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L16)* ___ @@ -53,7 +53,7 @@ ___ • **alreadyRedeemedReputationPeriods**: *number* -*Defined in [schemes/contributionReward.ts:17](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L17)* +*Defined in [schemes/contributionReward.ts:17](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L17)* ___ @@ -61,7 +61,7 @@ ___ • **beneficiary**: *[Address](../globals.md#address)* -*Defined in [schemes/contributionReward.ts:8](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L8)* +*Defined in [schemes/contributionReward.ts:8](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L8)* ___ @@ -69,7 +69,7 @@ ___ • **ethReward**: *BN* -*Defined in [schemes/contributionReward.ts:11](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L11)* +*Defined in [schemes/contributionReward.ts:11](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L11)* ___ @@ -77,7 +77,7 @@ ___ • **externalToken**: *[Address](../globals.md#address)* -*Defined in [schemes/contributionReward.ts:10](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L10)* +*Defined in [schemes/contributionReward.ts:10](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L10)* ___ @@ -85,7 +85,7 @@ ___ • **externalTokenReward**: *BN* -*Defined in [schemes/contributionReward.ts:9](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L9)* +*Defined in [schemes/contributionReward.ts:9](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L9)* ___ @@ -93,7 +93,7 @@ ___ • **nativeTokenReward**: *BN* -*Defined in [schemes/contributionReward.ts:12](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L12)* +*Defined in [schemes/contributionReward.ts:12](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L12)* ___ @@ -101,7 +101,7 @@ ___ • **periodLength**: *number* -*Defined in [schemes/contributionReward.ts:14](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L14)* +*Defined in [schemes/contributionReward.ts:14](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L14)* ___ @@ -109,7 +109,7 @@ ___ • **periods**: *number* -*Defined in [schemes/contributionReward.ts:13](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L13)* +*Defined in [schemes/contributionReward.ts:13](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L13)* ___ @@ -117,4 +117,4 @@ ___ • **reputationReward**: *BN* -*Defined in [schemes/contributionReward.ts:15](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L15)* +*Defined in [schemes/contributionReward.ts:15](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L15)* diff --git a/docs/interfaces/icontributionrewardext.md b/docs/interfaces/icontributionrewardext.md new file mode 100644 index 00000000..eb2a3490 --- /dev/null +++ b/docs/interfaces/icontributionrewardext.md @@ -0,0 +1,120 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [IContributionRewardExt](icontributionrewardext.md) + +# Interface: IContributionRewardExt + +## Hierarchy + +* **IContributionRewardExt** + +## Index + +### Properties + +* [alreadyRedeemedEthPeriods](icontributionrewardext.md#alreadyredeemedethperiods) +* [alreadyRedeemedExternalTokenPeriods](icontributionrewardext.md#alreadyredeemedexternaltokenperiods) +* [alreadyRedeemedNativeTokenPeriods](icontributionrewardext.md#alreadyredeemednativetokenperiods) +* [alreadyRedeemedReputationPeriods](icontributionrewardext.md#alreadyredeemedreputationperiods) +* [beneficiary](icontributionrewardext.md#beneficiary) +* [ethReward](icontributionrewardext.md#ethreward) +* [externalToken](icontributionrewardext.md#externaltoken) +* [externalTokenReward](icontributionrewardext.md#externaltokenreward) +* [nativeTokenReward](icontributionrewardext.md#nativetokenreward) +* [periodLength](icontributionrewardext.md#periodlength) +* [periods](icontributionrewardext.md#periods) +* [reputationReward](icontributionrewardext.md#reputationreward) + +## Properties + +### alreadyRedeemedEthPeriods + +• **alreadyRedeemedEthPeriods**: *number* + +*Defined in [schemes/contributionRewardExt.ts:19](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L19)* + +___ + +### alreadyRedeemedExternalTokenPeriods + +• **alreadyRedeemedExternalTokenPeriods**: *number* + +*Defined in [schemes/contributionRewardExt.ts:18](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L18)* + +___ + +### alreadyRedeemedNativeTokenPeriods + +• **alreadyRedeemedNativeTokenPeriods**: *number* + +*Defined in [schemes/contributionRewardExt.ts:16](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L16)* + +___ + +### alreadyRedeemedReputationPeriods + +• **alreadyRedeemedReputationPeriods**: *number* + +*Defined in [schemes/contributionRewardExt.ts:17](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L17)* + +___ + +### beneficiary + +• **beneficiary**: *[Address](../globals.md#address)* + +*Defined in [schemes/contributionRewardExt.ts:8](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L8)* + +___ + +### ethReward + +• **ethReward**: *BN* + +*Defined in [schemes/contributionRewardExt.ts:11](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L11)* + +___ + +### externalToken + +• **externalToken**: *[Address](../globals.md#address)* + +*Defined in [schemes/contributionRewardExt.ts:10](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L10)* + +___ + +### externalTokenReward + +• **externalTokenReward**: *BN* + +*Defined in [schemes/contributionRewardExt.ts:9](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L9)* + +___ + +### nativeTokenReward + +• **nativeTokenReward**: *BN* + +*Defined in [schemes/contributionRewardExt.ts:12](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L12)* + +___ + +### periodLength + +• **periodLength**: *number* + +*Defined in [schemes/contributionRewardExt.ts:14](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L14)* + +___ + +### periods + +• **periods**: *number* + +*Defined in [schemes/contributionRewardExt.ts:13](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L13)* + +___ + +### reputationReward + +• **reputationReward**: *BN* + +*Defined in [schemes/contributionRewardExt.ts:15](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L15)* diff --git a/docs/interfaces/icontributionrewardextparams.md b/docs/interfaces/icontributionrewardextparams.md new file mode 100644 index 00000000..9aaec5f7 --- /dev/null +++ b/docs/interfaces/icontributionrewardextparams.md @@ -0,0 +1,45 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [IContributionRewardExtParams](icontributionrewardextparams.md) + +# Interface: IContributionRewardExtParams + +## Hierarchy + +* **IContributionRewardExtParams** + +## Index + +### Properties + +* [rewarder](icontributionrewardextparams.md#rewarder) +* [voteParams](icontributionrewardextparams.md#voteparams) +* [votingMachine](icontributionrewardextparams.md#votingmachine) + +## Properties + +### rewarder + +• **rewarder**: *[Address](../globals.md#address)* + +*Defined in [schemes/base.ts:63](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L63)* + +*Defined in [scheme.ts:66](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L66)* + +___ + +### voteParams + +• **voteParams**: *[IGenesisProtocolParams](igenesisprotocolparams.md)* + +*Defined in [schemes/base.ts:62](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L62)* + +*Defined in [scheme.ts:65](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L65)* + +___ + +### votingMachine + +• **votingMachine**: *[Address](../globals.md#address)* + +*Defined in [schemes/base.ts:61](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L61)* + +*Defined in [scheme.ts:64](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L64)* diff --git a/docs/interfaces/icontributionrewardparams.md b/docs/interfaces/icontributionrewardparams.md new file mode 100644 index 00000000..9ed3768e --- /dev/null +++ b/docs/interfaces/icontributionrewardparams.md @@ -0,0 +1,34 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [IContributionRewardParams](icontributionrewardparams.md) + +# Interface: IContributionRewardParams + +## Hierarchy + +* **IContributionRewardParams** + +## Index + +### Properties + +* [voteParams](icontributionrewardparams.md#voteparams) +* [votingMachine](icontributionrewardparams.md#votingmachine) + +## Properties + +### voteParams + +• **voteParams**: *[IGenesisProtocolParams](igenesisprotocolparams.md)* + +*Defined in [schemes/base.ts:58](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L58)* + +*Defined in [scheme.ts:61](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L61)* + +___ + +### votingMachine + +• **votingMachine**: *[Address](../globals.md#address)* + +*Defined in [schemes/base.ts:57](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L57)* + +*Defined in [scheme.ts:60](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L60)* diff --git a/docs/interfaces/idaoqueryoptions.md b/docs/interfaces/idaoqueryoptions.md index f6a34096..161bbdb0 100644 --- a/docs/interfaces/idaoqueryoptions.md +++ b/docs/interfaces/idaoqueryoptions.md @@ -26,7 +26,7 @@ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[first](icommonqueryoptions.md#optional-first)* -*Defined in [types.ts:15](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L15)* +*Defined in [types.ts:16](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L16)* ___ @@ -36,7 +36,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderBy](icommonqueryoptions.md#optional-orderby)* -*Defined in [types.ts:16](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L16)* +*Defined in [types.ts:17](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L17)* ___ @@ -46,7 +46,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderDirection](icommonqueryoptions.md#optional-orderdirection)* -*Defined in [types.ts:17](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L17)* +*Defined in [types.ts:18](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L18)* ___ @@ -56,7 +56,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[skip](icommonqueryoptions.md#optional-skip)* -*Defined in [types.ts:14](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L14)* +*Defined in [types.ts:15](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L15)* ___ @@ -66,4 +66,4 @@ ___ *Overrides [ICommonQueryOptions](icommonqueryoptions.md).[where](icommonqueryoptions.md#optional-where)* -*Defined in [dao.ts:39](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L39)* +*Defined in [dao.ts:41](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L41)* diff --git a/docs/interfaces/idaostate.md b/docs/interfaces/idaostate.md index e15423cc..541d5cce 100644 --- a/docs/interfaces/idaostate.md +++ b/docs/interfaces/idaostate.md @@ -36,7 +36,7 @@ *Inherited from [IDAOStaticState](idaostaticstate.md).[address](idaostaticstate.md#address)* -*Defined in [dao.ts:19](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L19)* +*Defined in [dao.ts:21](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L21)* ___ @@ -44,7 +44,7 @@ ___ • **dao**: *[DAO](../classes/dao.md)* -*Defined in [dao.ts:32](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L32)* +*Defined in [dao.ts:34](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L34)* ___ @@ -54,7 +54,7 @@ ___ *Inherited from [IDAOStaticState](idaostaticstate.md).[id](idaostaticstate.md#id)* -*Defined in [dao.ts:18](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L18)* +*Defined in [dao.ts:20](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L20)* ___ @@ -62,7 +62,7 @@ ___ • **memberCount**: *number* -*Defined in [dao.ts:29](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L29)* +*Defined in [dao.ts:31](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L31)* ___ @@ -72,7 +72,7 @@ ___ *Inherited from [IDAOStaticState](idaostaticstate.md).[name](idaostaticstate.md#name)* -*Defined in [dao.ts:20](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L20)* +*Defined in [dao.ts:22](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L22)* ___ @@ -80,7 +80,7 @@ ___ • **numberOfBoostedProposals**: *number* -*Defined in [dao.ts:35](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L35)* +*Defined in [dao.ts:37](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L37)* ___ @@ -88,7 +88,7 @@ ___ • **numberOfPreBoostedProposals**: *number* -*Defined in [dao.ts:34](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L34)* +*Defined in [dao.ts:36](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L36)* ___ @@ -96,7 +96,7 @@ ___ • **numberOfQueuedProposals**: *number* -*Defined in [dao.ts:33](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L33)* +*Defined in [dao.ts:35](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L35)* ___ @@ -106,7 +106,7 @@ ___ *Inherited from [IDAOStaticState](idaostaticstate.md).[register](idaostaticstate.md#register)* -*Defined in [dao.ts:21](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L21)* +*Defined in [dao.ts:23](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L23)* ___ @@ -116,15 +116,15 @@ ___ *Inherited from [IDAOStaticState](idaostaticstate.md).[reputation](idaostaticstate.md#reputation)* -*Defined in [dao.ts:22](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L22)* +*Defined in [dao.ts:24](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L24)* ___ ### reputationTotalSupply -• **reputationTotalSupply**: *any* +• **reputationTotalSupply**: *BN* -*Defined in [dao.ts:30](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L30)* +*Defined in [dao.ts:32](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L32)* ___ @@ -134,7 +134,7 @@ ___ *Inherited from [IDAOStaticState](idaostaticstate.md).[token](idaostaticstate.md#token)* -*Defined in [dao.ts:23](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L23)* +*Defined in [dao.ts:25](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L25)* ___ @@ -144,7 +144,7 @@ ___ *Inherited from [IDAOStaticState](idaostaticstate.md).[tokenName](idaostaticstate.md#tokenname)* -*Defined in [dao.ts:24](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L24)* +*Defined in [dao.ts:26](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L26)* ___ @@ -154,12 +154,12 @@ ___ *Inherited from [IDAOStaticState](idaostaticstate.md).[tokenSymbol](idaostaticstate.md#tokensymbol)* -*Defined in [dao.ts:25](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L25)* +*Defined in [dao.ts:27](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L27)* ___ ### tokenTotalSupply -• **tokenTotalSupply**: *any* +• **tokenTotalSupply**: *BN* -*Defined in [dao.ts:31](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L31)* +*Defined in [dao.ts:33](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L33)* diff --git a/docs/interfaces/idaostaticstate.md b/docs/interfaces/idaostaticstate.md index 7ac45a97..f2e1b7b5 100644 --- a/docs/interfaces/idaostaticstate.md +++ b/docs/interfaces/idaostaticstate.md @@ -27,7 +27,7 @@ • **address**: *[Address](../globals.md#address)* -*Defined in [dao.ts:19](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L19)* +*Defined in [dao.ts:21](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L21)* ___ @@ -35,7 +35,7 @@ ___ • **id**: *[Address](../globals.md#address)* -*Defined in [dao.ts:18](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L18)* +*Defined in [dao.ts:20](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L20)* ___ @@ -43,7 +43,7 @@ ___ • **name**: *string* -*Defined in [dao.ts:20](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L20)* +*Defined in [dao.ts:22](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L22)* ___ @@ -51,7 +51,7 @@ ___ • **register**: *"na" | "proposed" | "registered" | "unRegistered"* -*Defined in [dao.ts:21](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L21)* +*Defined in [dao.ts:23](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L23)* ___ @@ -59,7 +59,7 @@ ___ • **reputation**: *[Reputation](../classes/reputation.md)* -*Defined in [dao.ts:22](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L22)* +*Defined in [dao.ts:24](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L24)* ___ @@ -67,7 +67,7 @@ ___ • **token**: *[Token](../classes/token.md)* -*Defined in [dao.ts:23](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L23)* +*Defined in [dao.ts:25](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L25)* ___ @@ -75,7 +75,7 @@ ___ • **tokenName**: *string* -*Defined in [dao.ts:24](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L24)* +*Defined in [dao.ts:26](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L26)* ___ @@ -83,4 +83,4 @@ ___ • **tokenSymbol**: *string* -*Defined in [dao.ts:25](https://github.com/daostack/client/blob/0eadcce/src/dao.ts#L25)* +*Defined in [dao.ts:27](https://github.com/daostack/client/blob/aa9723f/src/dao.ts#L27)* diff --git a/docs/interfaces/ieventqueryoptions.md b/docs/interfaces/ieventqueryoptions.md new file mode 100644 index 00000000..d37ae9d0 --- /dev/null +++ b/docs/interfaces/ieventqueryoptions.md @@ -0,0 +1,69 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [IEventQueryOptions](ieventqueryoptions.md) + +# Interface: IEventQueryOptions + +## Hierarchy + +* [ICommonQueryOptions](icommonqueryoptions.md) + + ↳ **IEventQueryOptions** + +## Index + +### Properties + +* [first](ieventqueryoptions.md#optional-first) +* [orderBy](ieventqueryoptions.md#optional-orderby) +* [orderDirection](ieventqueryoptions.md#optional-orderdirection) +* [skip](ieventqueryoptions.md#optional-skip) +* [where](ieventqueryoptions.md#optional-where) + +## Properties + +### `Optional` first + +• **first**? : *undefined | number* + +*Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[first](icommonqueryoptions.md#optional-first)* + +*Defined in [types.ts:16](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L16)* + +___ + +### `Optional` orderBy + +• **orderBy**? : *undefined | string* + +*Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderBy](icommonqueryoptions.md#optional-orderby)* + +*Defined in [types.ts:17](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L17)* + +___ + +### `Optional` orderDirection + +• **orderDirection**? : *"asc" | "desc"* + +*Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderDirection](icommonqueryoptions.md#optional-orderdirection)* + +*Defined in [types.ts:18](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L18)* + +___ + +### `Optional` skip + +• **skip**? : *undefined | number* + +*Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[skip](icommonqueryoptions.md#optional-skip)* + +*Defined in [types.ts:15](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L15)* + +___ + +### `Optional` where + +• **where**? : *undefined | object* + +*Overrides [ICommonQueryOptions](icommonqueryoptions.md).[where](icommonqueryoptions.md#optional-where)* + +*Defined in [event.ts:23](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L23)* diff --git a/docs/interfaces/ieventstate.md b/docs/interfaces/ieventstate.md new file mode 100644 index 00000000..3bfde205 --- /dev/null +++ b/docs/interfaces/ieventstate.md @@ -0,0 +1,95 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [IEventState](ieventstate.md) + +# Interface: IEventState + +## Hierarchy + +* [IEventStaticState](ieventstaticstate.md) + + ↳ **IEventState** + +## Index + +### Properties + +* [dao](ieventstate.md#dao) +* [data](ieventstate.md#data) +* [id](ieventstate.md#id) +* [proposal](ieventstate.md#proposal) +* [timestamp](ieventstate.md#timestamp) +* [type](ieventstate.md#type) +* [user](ieventstate.md#user) + +## Properties + +### dao + +• **dao**: *string* + +*Inherited from [IEventStaticState](ieventstaticstate.md).[dao](ieventstaticstate.md#dao)* + +*Defined in [event.ts:10](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L10)* + +___ + +### data + +• **data**: *object* + +*Inherited from [IEventStaticState](ieventstaticstate.md).[data](ieventstaticstate.md#data)* + +*Defined in [event.ts:14](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L14)* + +#### Type declaration: + +* \[ **key**: *string*\]: any + +___ + +### id + +• **id**: *string* + +*Overrides [IEventStaticState](ieventstaticstate.md).[id](ieventstaticstate.md#id)* + +*Defined in [event.ts:19](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L19)* + +___ + +### proposal + +• **proposal**: *string* + +*Inherited from [IEventStaticState](ieventstaticstate.md).[proposal](ieventstaticstate.md#proposal)* + +*Defined in [event.ts:11](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L11)* + +___ + +### timestamp + +• **timestamp**: *string* + +*Inherited from [IEventStaticState](ieventstaticstate.md).[timestamp](ieventstaticstate.md#timestamp)* + +*Defined in [event.ts:15](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L15)* + +___ + +### type + +• **type**: *string* + +*Inherited from [IEventStaticState](ieventstaticstate.md).[type](ieventstaticstate.md#type)* + +*Defined in [event.ts:13](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L13)* + +___ + +### user + +• **user**: *string* + +*Inherited from [IEventStaticState](ieventstaticstate.md).[user](ieventstaticstate.md#user)* + +*Defined in [event.ts:12](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L12)* diff --git a/docs/interfaces/ieventstaticstate.md b/docs/interfaces/ieventstaticstate.md new file mode 100644 index 00000000..5c8e365f --- /dev/null +++ b/docs/interfaces/ieventstaticstate.md @@ -0,0 +1,81 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [IEventStaticState](ieventstaticstate.md) + +# Interface: IEventStaticState + +## Hierarchy + +* **IEventStaticState** + + ↳ [IEventState](ieventstate.md) + +## Index + +### Properties + +* [dao](ieventstaticstate.md#dao) +* [data](ieventstaticstate.md#data) +* [id](ieventstaticstate.md#id) +* [proposal](ieventstaticstate.md#proposal) +* [timestamp](ieventstaticstate.md#timestamp) +* [type](ieventstaticstate.md#type) +* [user](ieventstaticstate.md#user) + +## Properties + +### dao + +• **dao**: *string* + +*Defined in [event.ts:10](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L10)* + +___ + +### data + +• **data**: *object* + +*Defined in [event.ts:14](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L14)* + +#### Type declaration: + +* \[ **key**: *string*\]: any + +___ + +### id + +• **id**: *string* + +*Defined in [event.ts:9](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L9)* + +___ + +### proposal + +• **proposal**: *string* + +*Defined in [event.ts:11](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L11)* + +___ + +### timestamp + +• **timestamp**: *string* + +*Defined in [event.ts:15](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L15)* + +___ + +### type + +• **type**: *string* + +*Defined in [event.ts:13](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L13)* + +___ + +### user + +• **user**: *string* + +*Defined in [event.ts:12](https://github.com/daostack/client/blob/aa9723f/src/event.ts#L12)* diff --git a/docs/interfaces/igenericscheme.md b/docs/interfaces/igenericscheme.md index 7e3c9730..9f5964ab 100644 --- a/docs/interfaces/igenericscheme.md +++ b/docs/interfaces/igenericscheme.md @@ -22,7 +22,7 @@ • **callData**: *string* -*Defined in [schemes/genericScheme.ts:14](https://github.com/daostack/client/blob/0eadcce/src/schemes/genericScheme.ts#L14)* +*Defined in [schemes/genericScheme.ts:14](https://github.com/daostack/client/blob/aa9723f/src/schemes/genericScheme.ts#L14)* ___ @@ -30,7 +30,7 @@ ___ • **contractToCall**: *[Address](../globals.md#address)* -*Defined in [schemes/genericScheme.ts:13](https://github.com/daostack/client/blob/0eadcce/src/schemes/genericScheme.ts#L13)* +*Defined in [schemes/genericScheme.ts:13](https://github.com/daostack/client/blob/aa9723f/src/schemes/genericScheme.ts#L13)* ___ @@ -38,7 +38,7 @@ ___ • **executed**: *boolean* -*Defined in [schemes/genericScheme.ts:15](https://github.com/daostack/client/blob/0eadcce/src/schemes/genericScheme.ts#L15)* +*Defined in [schemes/genericScheme.ts:15](https://github.com/daostack/client/blob/aa9723f/src/schemes/genericScheme.ts#L15)* ___ @@ -46,7 +46,7 @@ ___ • **id**: *string* -*Defined in [schemes/genericScheme.ts:12](https://github.com/daostack/client/blob/0eadcce/src/schemes/genericScheme.ts#L12)* +*Defined in [schemes/genericScheme.ts:12](https://github.com/daostack/client/blob/aa9723f/src/schemes/genericScheme.ts#L12)* ___ @@ -54,4 +54,4 @@ ___ • **returnValue**: *string* -*Defined in [schemes/genericScheme.ts:16](https://github.com/daostack/client/blob/0eadcce/src/schemes/genericScheme.ts#L16)* +*Defined in [schemes/genericScheme.ts:16](https://github.com/daostack/client/blob/aa9723f/src/schemes/genericScheme.ts#L16)* diff --git a/docs/interfaces/igenericschemeinfo.md b/docs/interfaces/igenericschemeinfo.md index 0d770e27..43c6b596 100644 --- a/docs/interfaces/igenericschemeinfo.md +++ b/docs/interfaces/igenericschemeinfo.md @@ -20,7 +20,7 @@ • **contractToCall**: *[Address](../globals.md#address)* -*Defined in [schemes/genericScheme.ts:7](https://github.com/daostack/client/blob/0eadcce/src/schemes/genericScheme.ts#L7)* +*Defined in [schemes/genericScheme.ts:7](https://github.com/daostack/client/blob/aa9723f/src/schemes/genericScheme.ts#L7)* ___ @@ -28,7 +28,7 @@ ___ • **id**: *string* -*Defined in [schemes/genericScheme.ts:6](https://github.com/daostack/client/blob/0eadcce/src/schemes/genericScheme.ts#L6)* +*Defined in [schemes/genericScheme.ts:6](https://github.com/daostack/client/blob/aa9723f/src/schemes/genericScheme.ts#L6)* ___ @@ -36,4 +36,4 @@ ___ • **votingMachine**: *[Address](../globals.md#address)* -*Defined in [schemes/genericScheme.ts:8](https://github.com/daostack/client/blob/0eadcce/src/schemes/genericScheme.ts#L8)* +*Defined in [schemes/genericScheme.ts:8](https://github.com/daostack/client/blob/aa9723f/src/schemes/genericScheme.ts#L8)* diff --git a/docs/interfaces/igenericschemeparams.md b/docs/interfaces/igenericschemeparams.md new file mode 100644 index 00000000..c057b92b --- /dev/null +++ b/docs/interfaces/igenericschemeparams.md @@ -0,0 +1,45 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [IGenericSchemeParams](igenericschemeparams.md) + +# Interface: IGenericSchemeParams + +## Hierarchy + +* **IGenericSchemeParams** + +## Index + +### Properties + +* [contractToCall](igenericschemeparams.md#contracttocall) +* [voteParams](igenericschemeparams.md#voteparams) +* [votingMachine](igenericschemeparams.md#votingmachine) + +## Properties + +### contractToCall + +• **contractToCall**: *[Address](../globals.md#address)* + +*Defined in [schemes/base.ts:52](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L52)* + +*Defined in [scheme.ts:55](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L55)* + +___ + +### voteParams + +• **voteParams**: *[IGenesisProtocolParams](igenesisprotocolparams.md)* + +*Defined in [schemes/base.ts:53](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L53)* + +*Defined in [scheme.ts:56](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L56)* + +___ + +### votingMachine + +• **votingMachine**: *[Address](../globals.md#address)* + +*Defined in [schemes/base.ts:51](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L51)* + +*Defined in [scheme.ts:54](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L54)* diff --git a/docs/interfaces/igenesisprotocolparams.md b/docs/interfaces/igenesisprotocolparams.md index e26dad71..571ae791 100644 --- a/docs/interfaces/igenesisprotocolparams.md +++ b/docs/interfaces/igenesisprotocolparams.md @@ -29,7 +29,7 @@ • **activationTime**: *number* -*Defined in [genesisProtocol.ts:4](https://github.com/daostack/client/blob/0eadcce/src/genesisProtocol.ts#L4)* +*Defined in [genesisProtocol.ts:5](https://github.com/daostack/client/blob/aa9723f/src/genesisProtocol.ts#L5)* ___ @@ -37,7 +37,7 @@ ___ • **boostedVotePeriodLimit**: *number* -*Defined in [genesisProtocol.ts:5](https://github.com/daostack/client/blob/0eadcce/src/genesisProtocol.ts#L5)* +*Defined in [genesisProtocol.ts:6](https://github.com/daostack/client/blob/aa9723f/src/genesisProtocol.ts#L6)* ___ @@ -45,7 +45,7 @@ ___ • **daoBountyConst**: *number* -*Defined in [genesisProtocol.ts:6](https://github.com/daostack/client/blob/0eadcce/src/genesisProtocol.ts#L6)* +*Defined in [genesisProtocol.ts:7](https://github.com/daostack/client/blob/aa9723f/src/genesisProtocol.ts#L7)* ___ @@ -53,15 +53,15 @@ ___ • **limitExponentValue**: *number* -*Defined in [genesisProtocol.ts:7](https://github.com/daostack/client/blob/0eadcce/src/genesisProtocol.ts#L7)* +*Defined in [genesisProtocol.ts:8](https://github.com/daostack/client/blob/aa9723f/src/genesisProtocol.ts#L8)* ___ ### minimumDaoBounty -• **minimumDaoBounty**: *any* +• **minimumDaoBounty**: *BN* -*Defined in [genesisProtocol.ts:8](https://github.com/daostack/client/blob/0eadcce/src/genesisProtocol.ts#L8)* +*Defined in [genesisProtocol.ts:9](https://github.com/daostack/client/blob/aa9723f/src/genesisProtocol.ts#L9)* ___ @@ -69,15 +69,15 @@ ___ • **preBoostedVotePeriodLimit**: *number* -*Defined in [genesisProtocol.ts:9](https://github.com/daostack/client/blob/0eadcce/src/genesisProtocol.ts#L9)* +*Defined in [genesisProtocol.ts:10](https://github.com/daostack/client/blob/aa9723f/src/genesisProtocol.ts#L10)* ___ ### proposingRepReward -• **proposingRepReward**: *any* +• **proposingRepReward**: *BN* -*Defined in [genesisProtocol.ts:10](https://github.com/daostack/client/blob/0eadcce/src/genesisProtocol.ts#L10)* +*Defined in [genesisProtocol.ts:11](https://github.com/daostack/client/blob/aa9723f/src/genesisProtocol.ts#L11)* ___ @@ -85,7 +85,7 @@ ___ • **queuedVotePeriodLimit**: *number* -*Defined in [genesisProtocol.ts:12](https://github.com/daostack/client/blob/0eadcce/src/genesisProtocol.ts#L12)* +*Defined in [genesisProtocol.ts:13](https://github.com/daostack/client/blob/aa9723f/src/genesisProtocol.ts#L13)* ___ @@ -93,7 +93,7 @@ ___ • **queuedVoteRequiredPercentage**: *number* -*Defined in [genesisProtocol.ts:11](https://github.com/daostack/client/blob/0eadcce/src/genesisProtocol.ts#L11)* +*Defined in [genesisProtocol.ts:12](https://github.com/daostack/client/blob/aa9723f/src/genesisProtocol.ts#L12)* ___ @@ -101,7 +101,7 @@ ___ • **quietEndingPeriod**: *number* -*Defined in [genesisProtocol.ts:13](https://github.com/daostack/client/blob/0eadcce/src/genesisProtocol.ts#L13)* +*Defined in [genesisProtocol.ts:14](https://github.com/daostack/client/blob/aa9723f/src/genesisProtocol.ts#L14)* ___ @@ -109,7 +109,7 @@ ___ • **thresholdConst**: *number* -*Defined in [genesisProtocol.ts:14](https://github.com/daostack/client/blob/0eadcce/src/genesisProtocol.ts#L14)* +*Defined in [genesisProtocol.ts:15](https://github.com/daostack/client/blob/aa9723f/src/genesisProtocol.ts#L15)* ___ @@ -117,4 +117,4 @@ ___ • **votersReputationLossRatio**: *number* -*Defined in [genesisProtocol.ts:15](https://github.com/daostack/client/blob/0eadcce/src/genesisProtocol.ts#L15)* +*Defined in [genesisProtocol.ts:16](https://github.com/daostack/client/blob/aa9723f/src/genesisProtocol.ts#L16)* diff --git a/docs/interfaces/imemberqueryoptions.md b/docs/interfaces/imemberqueryoptions.md index 56f38eb4..e8377968 100644 --- a/docs/interfaces/imemberqueryoptions.md +++ b/docs/interfaces/imemberqueryoptions.md @@ -26,7 +26,7 @@ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[first](icommonqueryoptions.md#optional-first)* -*Defined in [types.ts:15](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L15)* +*Defined in [types.ts:16](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L16)* ___ @@ -36,7 +36,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderBy](icommonqueryoptions.md#optional-orderby)* -*Defined in [types.ts:16](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L16)* +*Defined in [types.ts:17](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L17)* ___ @@ -46,7 +46,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderDirection](icommonqueryoptions.md#optional-orderdirection)* -*Defined in [types.ts:17](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L17)* +*Defined in [types.ts:18](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L18)* ___ @@ -56,7 +56,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[skip](icommonqueryoptions.md#optional-skip)* -*Defined in [types.ts:14](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L14)* +*Defined in [types.ts:15](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L15)* ___ @@ -66,4 +66,4 @@ ___ *Overrides [ICommonQueryOptions](icommonqueryoptions.md).[where](icommonqueryoptions.md#optional-where)* -*Defined in [member.ts:31](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L31)* +*Defined in [member.ts:31](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L31)* diff --git a/docs/interfaces/imemberstate.md b/docs/interfaces/imemberstate.md index 1207f403..2cda8b10 100644 --- a/docs/interfaces/imemberstate.md +++ b/docs/interfaces/imemberstate.md @@ -26,7 +26,7 @@ *Inherited from [IMemberStaticState](imemberstaticstate.md).[address](imemberstaticstate.md#address)* -*Defined in [member.ts:20](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L20)* +*Defined in [member.ts:20](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L20)* ___ @@ -36,7 +36,7 @@ ___ *Overrides [IMemberStaticState](imemberstaticstate.md).[contract](imemberstaticstate.md#optional-contract)* -*Defined in [member.ts:25](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L25)* +*Defined in [member.ts:25](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L25)* ___ @@ -46,7 +46,7 @@ ___ *Inherited from [IMemberStaticState](imemberstaticstate.md).[dao](imemberstaticstate.md#optional-dao)* -*Defined in [member.ts:22](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L22)* +*Defined in [member.ts:22](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L22)* ___ @@ -56,12 +56,12 @@ ___ *Overrides [IMemberStaticState](imemberstaticstate.md).[id](imemberstaticstate.md#optional-id)* -*Defined in [member.ts:26](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L26)* +*Defined in [member.ts:26](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L26)* ___ ### reputation -• **reputation**: *any* +• **reputation**: *BN* -*Defined in [member.ts:27](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L27)* +*Defined in [member.ts:27](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L27)* diff --git a/docs/interfaces/imemberstaticstate.md b/docs/interfaces/imemberstaticstate.md index 91bc9c8f..30b69d33 100644 --- a/docs/interfaces/imemberstaticstate.md +++ b/docs/interfaces/imemberstaticstate.md @@ -23,7 +23,7 @@ • **address**: *[Address](../globals.md#address)* -*Defined in [member.ts:20](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L20)* +*Defined in [member.ts:20](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L20)* ___ @@ -31,7 +31,7 @@ ___ • **contract**? : *[Address](../globals.md#address)* -*Defined in [member.ts:21](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L21)* +*Defined in [member.ts:21](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L21)* ___ @@ -39,7 +39,7 @@ ___ • **dao**? : *[Address](../globals.md#address)* -*Defined in [member.ts:22](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L22)* +*Defined in [member.ts:22](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L22)* ___ @@ -47,4 +47,4 @@ ___ • **id**? : *undefined | string* -*Defined in [member.ts:19](https://github.com/daostack/client/blob/0eadcce/src/member.ts#L19)* +*Defined in [member.ts:19](https://github.com/daostack/client/blob/aa9723f/src/member.ts#L19)* diff --git a/docs/interfaces/iobservable.md b/docs/interfaces/iobservable.md index f8bdd50c..77f947f7 100644 --- a/docs/interfaces/iobservable.md +++ b/docs/interfaces/iobservable.md @@ -80,7 +80,7 @@ ___ • **first**: *function* -*Defined in [graphnode.ts:23](https://github.com/daostack/client/blob/0eadcce/src/graphnode.ts#L23)* +*Defined in [graphnode.ts:23](https://github.com/daostack/client/blob/aa9723f/src/graphnode.ts#L23)* #### Type declaration: diff --git a/docs/interfaces/ioperationobservable.md b/docs/interfaces/ioperationobservable.md index 6e2eaac2..a3428505 100644 --- a/docs/interfaces/ioperationobservable.md +++ b/docs/interfaces/ioperationobservable.md @@ -94,7 +94,7 @@ ___ • **send**: *function* -*Defined in [operation.ts:36](https://github.com/daostack/client/blob/0eadcce/src/operation.ts#L36)* +*Defined in [operation.ts:35](https://github.com/daostack/client/blob/aa9723f/src/operation.ts#L35)* #### Type declaration: diff --git a/docs/interfaces/iproposalbasecreateoptions.md b/docs/interfaces/iproposalbasecreateoptions.md index 022606e8..1c28a29f 100644 --- a/docs/interfaces/iproposalbasecreateoptions.md +++ b/docs/interfaces/iproposalbasecreateoptions.md @@ -6,6 +6,10 @@ * **IProposalBaseCreateOptions** + ↳ [IProposalCreateOptionsCompetition](iproposalcreateoptionscompetition.md) + + ↳ [IProposalCreateOptionsContributionRewardExt](iproposalcreateoptionscontributionrewardext.md) + ## Index ### Properties @@ -13,7 +17,9 @@ * [dao](iproposalbasecreateoptions.md#dao) * [description](iproposalbasecreateoptions.md#optional-description) * [descriptionHash](iproposalbasecreateoptions.md#optional-descriptionhash) -* [scheme](iproposalbasecreateoptions.md#scheme) +* [proposalType](iproposalbasecreateoptions.md#optional-proposaltype) +* [scheme](iproposalbasecreateoptions.md#optional-scheme) +* [tags](iproposalbasecreateoptions.md#optional-tags) * [title](iproposalbasecreateoptions.md#optional-title) * [url](iproposalbasecreateoptions.md#optional-url) @@ -23,7 +29,7 @@ • **dao**: *[Address](../globals.md#address)* -*Defined in [proposal.ts:840](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L840)* +*Defined in [proposal.ts:884](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L884)* ___ @@ -31,7 +37,7 @@ ___ • **description**? : *undefined | string* -*Defined in [proposal.ts:841](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L841)* +*Defined in [proposal.ts:885](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L885)* ___ @@ -39,15 +45,31 @@ ___ • **descriptionHash**? : *undefined | string* -*Defined in [proposal.ts:842](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L842)* +*Defined in [proposal.ts:886](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L886)* + +___ + +### `Optional` proposalType + +• **proposalType**? : *undefined | string* + +*Defined in [proposal.ts:892](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L892)* + +___ + +### `Optional` scheme + +• **scheme**? : *[Address](../globals.md#address)* + +*Defined in [proposal.ts:889](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L889)* ___ -### scheme +### `Optional` tags -• **scheme**: *[Address](../globals.md#address)* +• **tags**? : *string[]* -*Defined in [proposal.ts:844](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L844)* +*Defined in [proposal.ts:888](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L888)* ___ @@ -55,7 +77,7 @@ ___ • **title**? : *undefined | string* -*Defined in [proposal.ts:843](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L843)* +*Defined in [proposal.ts:887](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L887)* ___ @@ -63,4 +85,4 @@ ___ • **url**? : *undefined | string* -*Defined in [proposal.ts:845](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L845)* +*Defined in [proposal.ts:890](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L890)* diff --git a/docs/interfaces/iproposalcreateoptionscompetition.md b/docs/interfaces/iproposalcreateoptionscompetition.md new file mode 100644 index 00000000..6566bedb --- /dev/null +++ b/docs/interfaces/iproposalcreateoptionscompetition.md @@ -0,0 +1,201 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [IProposalCreateOptionsCompetition](iproposalcreateoptionscompetition.md) + +# Interface: IProposalCreateOptionsCompetition + +## Hierarchy + +* [IProposalBaseCreateOptions](iproposalbasecreateoptions.md) + + ↳ **IProposalCreateOptionsCompetition** + +## Index + +### Properties + +* [dao](iproposalcreateoptionscompetition.md#dao) +* [description](iproposalcreateoptionscompetition.md#optional-description) +* [descriptionHash](iproposalcreateoptionscompetition.md#optional-descriptionhash) +* [endTime](iproposalcreateoptionscompetition.md#endtime) +* [ethReward](iproposalcreateoptionscompetition.md#optional-ethreward) +* [externalTokenAddress](iproposalcreateoptionscompetition.md#optional-externaltokenaddress) +* [externalTokenReward](iproposalcreateoptionscompetition.md#optional-externaltokenreward) +* [nativeTokenReward](iproposalcreateoptionscompetition.md#optional-nativetokenreward) +* [numberOfVotesPerVoter](iproposalcreateoptionscompetition.md#numberofvotespervoter) +* [proposalType](iproposalcreateoptionscompetition.md#optional-proposaltype) +* [reputationReward](iproposalcreateoptionscompetition.md#optional-reputationreward) +* [rewardSplit](iproposalcreateoptionscompetition.md#rewardsplit) +* [scheme](iproposalcreateoptionscompetition.md#optional-scheme) +* [startTime](iproposalcreateoptionscompetition.md#starttime) +* [suggestionsEndTime](iproposalcreateoptionscompetition.md#suggestionsendtime) +* [tags](iproposalcreateoptionscompetition.md#optional-tags) +* [title](iproposalcreateoptionscompetition.md#optional-title) +* [url](iproposalcreateoptionscompetition.md#optional-url) +* [votingStartTime](iproposalcreateoptionscompetition.md#votingstarttime) + +## Properties + +### dao + +• **dao**: *[Address](../globals.md#address)* + +*Inherited from [IProposalBaseCreateOptions](iproposalbasecreateoptions.md).[dao](iproposalbasecreateoptions.md#dao)* + +*Defined in [proposal.ts:884](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L884)* + +___ + +### `Optional` description + +• **description**? : *undefined | string* + +*Inherited from [IProposalBaseCreateOptions](iproposalbasecreateoptions.md).[description](iproposalbasecreateoptions.md#optional-description)* + +*Defined in [proposal.ts:885](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L885)* + +___ + +### `Optional` descriptionHash + +• **descriptionHash**? : *undefined | string* + +*Inherited from [IProposalBaseCreateOptions](iproposalbasecreateoptions.md).[descriptionHash](iproposalbasecreateoptions.md#optional-descriptionhash)* + +*Defined in [proposal.ts:886](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L886)* + +___ + +### endTime + +• **endTime**: *Date* + +*Defined in [schemes/competition.ts:38](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L38)* + +___ + +### `Optional` ethReward + +• **ethReward**? : *BN* + +*Defined in [schemes/competition.ts:40](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L40)* + +___ + +### `Optional` externalTokenAddress + +• **externalTokenAddress**? : *[Address](../globals.md#address)* + +*Defined in [schemes/competition.ts:42](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L42)* + +___ + +### `Optional` externalTokenReward + +• **externalTokenReward**? : *BN* + +*Defined in [schemes/competition.ts:41](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L41)* + +___ + +### `Optional` nativeTokenReward + +• **nativeTokenReward**? : *BN* + +*Defined in [schemes/competition.ts:45](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L45)* + +___ + +### numberOfVotesPerVoter + +• **numberOfVotesPerVoter**: *number* + +*Defined in [schemes/competition.ts:46](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L46)* + +___ + +### `Optional` proposalType + +• **proposalType**? : *undefined | string* + +*Inherited from [IProposalBaseCreateOptions](iproposalbasecreateoptions.md).[proposalType](iproposalbasecreateoptions.md#optional-proposaltype)* + +*Defined in [proposal.ts:892](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L892)* + +___ + +### `Optional` reputationReward + +• **reputationReward**? : *BN* + +*Defined in [schemes/competition.ts:39](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L39)* + +___ + +### rewardSplit + +• **rewardSplit**: *number[]* + +*Defined in [schemes/competition.ts:44](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L44)* + +___ + +### `Optional` scheme + +• **scheme**? : *[Address](../globals.md#address)* + +*Inherited from [IProposalBaseCreateOptions](iproposalbasecreateoptions.md).[scheme](iproposalbasecreateoptions.md#optional-scheme)* + +*Defined in [proposal.ts:889](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L889)* + +___ + +### startTime + +• **startTime**: *Date* + +*Defined in [schemes/competition.ts:47](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L47)* + +___ + +### suggestionsEndTime + +• **suggestionsEndTime**: *Date* + +*Defined in [schemes/competition.ts:48](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L48)* + +___ + +### `Optional` tags + +• **tags**? : *string[]* + +*Inherited from [IProposalBaseCreateOptions](iproposalbasecreateoptions.md).[tags](iproposalbasecreateoptions.md#optional-tags)* + +*Defined in [proposal.ts:888](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L888)* + +___ + +### `Optional` title + +• **title**? : *undefined | string* + +*Inherited from [IProposalBaseCreateOptions](iproposalbasecreateoptions.md).[title](iproposalbasecreateoptions.md#optional-title)* + +*Defined in [proposal.ts:887](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L887)* + +___ + +### `Optional` url + +• **url**? : *undefined | string* + +*Inherited from [IProposalBaseCreateOptions](iproposalbasecreateoptions.md).[url](iproposalbasecreateoptions.md#optional-url)* + +*Defined in [proposal.ts:890](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L890)* + +___ + +### votingStartTime + +• **votingStartTime**: *Date* + +*Defined in [schemes/competition.ts:49](https://github.com/daostack/client/blob/aa9723f/src/schemes/competition.ts#L49)* diff --git a/docs/interfaces/iproposalcreateoptionscontributionrewardext.md b/docs/interfaces/iproposalcreateoptionscontributionrewardext.md new file mode 100644 index 00000000..b82f712a --- /dev/null +++ b/docs/interfaces/iproposalcreateoptionscontributionrewardext.md @@ -0,0 +1,165 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [IProposalCreateOptionsContributionRewardExt](iproposalcreateoptionscontributionrewardext.md) + +# Interface: IProposalCreateOptionsContributionRewardExt + +## Hierarchy + +* [IProposalBaseCreateOptions](iproposalbasecreateoptions.md) + + ↳ **IProposalCreateOptionsContributionRewardExt** + +## Index + +### Properties + +* [beneficiary](iproposalcreateoptionscontributionrewardext.md#beneficiary) +* [dao](iproposalcreateoptionscontributionrewardext.md#dao) +* [description](iproposalcreateoptionscontributionrewardext.md#optional-description) +* [descriptionHash](iproposalcreateoptionscontributionrewardext.md#optional-descriptionhash) +* [ethReward](iproposalcreateoptionscontributionrewardext.md#optional-ethreward) +* [externalTokenAddress](iproposalcreateoptionscontributionrewardext.md#optional-externaltokenaddress) +* [externalTokenReward](iproposalcreateoptionscontributionrewardext.md#optional-externaltokenreward) +* [nativeTokenReward](iproposalcreateoptionscontributionrewardext.md#optional-nativetokenreward) +* [proposalType](iproposalcreateoptionscontributionrewardext.md#optional-proposaltype) +* [proposer](iproposalcreateoptionscontributionrewardext.md#proposer) +* [reputationReward](iproposalcreateoptionscontributionrewardext.md#optional-reputationreward) +* [scheme](iproposalcreateoptionscontributionrewardext.md#optional-scheme) +* [tags](iproposalcreateoptionscontributionrewardext.md#optional-tags) +* [title](iproposalcreateoptionscontributionrewardext.md#optional-title) +* [url](iproposalcreateoptionscontributionrewardext.md#optional-url) + +## Properties + +### beneficiary + +• **beneficiary**: *[Address](../globals.md#address)* + +*Defined in [schemes/contributionRewardExt.ts:23](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L23)* + +___ + +### dao + +• **dao**: *[Address](../globals.md#address)* + +*Inherited from [IProposalBaseCreateOptions](iproposalbasecreateoptions.md).[dao](iproposalbasecreateoptions.md#dao)* + +*Defined in [proposal.ts:884](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L884)* + +___ + +### `Optional` description + +• **description**? : *undefined | string* + +*Inherited from [IProposalBaseCreateOptions](iproposalbasecreateoptions.md).[description](iproposalbasecreateoptions.md#optional-description)* + +*Defined in [proposal.ts:885](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L885)* + +___ + +### `Optional` descriptionHash + +• **descriptionHash**? : *undefined | string* + +*Inherited from [IProposalBaseCreateOptions](iproposalbasecreateoptions.md).[descriptionHash](iproposalbasecreateoptions.md#optional-descriptionhash)* + +*Defined in [proposal.ts:886](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L886)* + +___ + +### `Optional` ethReward + +• **ethReward**? : *BN* + +*Defined in [schemes/contributionRewardExt.ts:26](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L26)* + +___ + +### `Optional` externalTokenAddress + +• **externalTokenAddress**? : *[Address](../globals.md#address)* + +*Defined in [schemes/contributionRewardExt.ts:28](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L28)* + +___ + +### `Optional` externalTokenReward + +• **externalTokenReward**? : *BN* + +*Defined in [schemes/contributionRewardExt.ts:27](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L27)* + +___ + +### `Optional` nativeTokenReward + +• **nativeTokenReward**? : *BN* + +*Defined in [schemes/contributionRewardExt.ts:24](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L24)* + +___ + +### `Optional` proposalType + +• **proposalType**? : *undefined | string* + +*Inherited from [IProposalBaseCreateOptions](iproposalbasecreateoptions.md).[proposalType](iproposalbasecreateoptions.md#optional-proposaltype)* + +*Defined in [proposal.ts:892](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L892)* + +___ + +### proposer + +• **proposer**: *[Address](../globals.md#address)* + +*Defined in [schemes/contributionRewardExt.ts:29](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L29)* + +___ + +### `Optional` reputationReward + +• **reputationReward**? : *BN* + +*Defined in [schemes/contributionRewardExt.ts:25](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionRewardExt.ts#L25)* + +___ + +### `Optional` scheme + +• **scheme**? : *[Address](../globals.md#address)* + +*Inherited from [IProposalBaseCreateOptions](iproposalbasecreateoptions.md).[scheme](iproposalbasecreateoptions.md#optional-scheme)* + +*Defined in [proposal.ts:889](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L889)* + +___ + +### `Optional` tags + +• **tags**? : *string[]* + +*Inherited from [IProposalBaseCreateOptions](iproposalbasecreateoptions.md).[tags](iproposalbasecreateoptions.md#optional-tags)* + +*Defined in [proposal.ts:888](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L888)* + +___ + +### `Optional` title + +• **title**? : *undefined | string* + +*Inherited from [IProposalBaseCreateOptions](iproposalbasecreateoptions.md).[title](iproposalbasecreateoptions.md#optional-title)* + +*Defined in [proposal.ts:887](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L887)* + +___ + +### `Optional` url + +• **url**? : *undefined | string* + +*Inherited from [IProposalBaseCreateOptions](iproposalbasecreateoptions.md).[url](iproposalbasecreateoptions.md#optional-url)* + +*Defined in [proposal.ts:890](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L890)* diff --git a/docs/interfaces/iproposalcreateoptionscr.md b/docs/interfaces/iproposalcreateoptionscr.md index 51b33f3a..aecfba4f 100644 --- a/docs/interfaces/iproposalcreateoptionscr.md +++ b/docs/interfaces/iproposalcreateoptionscr.md @@ -25,15 +25,15 @@ • **beneficiary**: *[Address](../globals.md#address)* -*Defined in [schemes/contributionReward.ts:23](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L23)* +*Defined in [schemes/contributionReward.ts:23](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L23)* ___ ### `Optional` ethReward -• **ethReward**? : *[BN](../globals.md#const-bn)* +• **ethReward**? : *BN* -*Defined in [schemes/contributionReward.ts:26](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L26)* +*Defined in [schemes/contributionReward.ts:26](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L26)* ___ @@ -41,23 +41,23 @@ ___ • **externalTokenAddress**? : *[Address](../globals.md#address)* -*Defined in [schemes/contributionReward.ts:28](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L28)* +*Defined in [schemes/contributionReward.ts:28](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L28)* ___ ### `Optional` externalTokenReward -• **externalTokenReward**? : *[BN](../globals.md#const-bn)* +• **externalTokenReward**? : *BN* -*Defined in [schemes/contributionReward.ts:27](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L27)* +*Defined in [schemes/contributionReward.ts:27](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L27)* ___ ### `Optional` nativeTokenReward -• **nativeTokenReward**? : *[BN](../globals.md#const-bn)* +• **nativeTokenReward**? : *BN* -*Defined in [schemes/contributionReward.ts:24](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L24)* +*Defined in [schemes/contributionReward.ts:24](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L24)* ___ @@ -65,7 +65,7 @@ ___ • **periodLength**? : *undefined | number* -*Defined in [schemes/contributionReward.ts:29](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L29)* +*Defined in [schemes/contributionReward.ts:29](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L29)* ___ @@ -73,12 +73,12 @@ ___ • **periods**? : *any* -*Defined in [schemes/contributionReward.ts:30](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L30)* +*Defined in [schemes/contributionReward.ts:30](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L30)* ___ ### `Optional` reputationReward -• **reputationReward**? : *[BN](../globals.md#const-bn)* +• **reputationReward**? : *BN* -*Defined in [schemes/contributionReward.ts:25](https://github.com/daostack/client/blob/0eadcce/src/schemes/contributionReward.ts#L25)* +*Defined in [schemes/contributionReward.ts:25](https://github.com/daostack/client/blob/aa9723f/src/schemes/contributionReward.ts#L25)* diff --git a/docs/interfaces/iproposalcreateoptionsgs.md b/docs/interfaces/iproposalcreateoptionsgs.md index 4c9afb98..31f9f665 100644 --- a/docs/interfaces/iproposalcreateoptionsgs.md +++ b/docs/interfaces/iproposalcreateoptionsgs.md @@ -19,9 +19,9 @@ • **callData**? : *undefined | string* -*Defined in [schemes/genericScheme.ts:20](https://github.com/daostack/client/blob/0eadcce/src/schemes/genericScheme.ts#L20)* +*Defined in [schemes/genericScheme.ts:20](https://github.com/daostack/client/blob/aa9723f/src/schemes/genericScheme.ts#L20)* -*Defined in [schemes/uGenericScheme.ts:20](https://github.com/daostack/client/blob/0eadcce/src/schemes/uGenericScheme.ts#L20)* +*Defined in [schemes/uGenericScheme.ts:20](https://github.com/daostack/client/blob/aa9723f/src/schemes/uGenericScheme.ts#L20)* ___ @@ -29,6 +29,6 @@ ___ • **value**? : *undefined | number* -*Defined in [schemes/genericScheme.ts:21](https://github.com/daostack/client/blob/0eadcce/src/schemes/genericScheme.ts#L21)* +*Defined in [schemes/genericScheme.ts:21](https://github.com/daostack/client/blob/aa9723f/src/schemes/genericScheme.ts#L21)* -*Defined in [schemes/uGenericScheme.ts:21](https://github.com/daostack/client/blob/0eadcce/src/schemes/uGenericScheme.ts#L21)* +*Defined in [schemes/uGenericScheme.ts:21](https://github.com/daostack/client/blob/aa9723f/src/schemes/uGenericScheme.ts#L21)* diff --git a/docs/interfaces/iproposalcreateoptionssr.md b/docs/interfaces/iproposalcreateoptionssr.md index 2427ff92..f618a359 100644 --- a/docs/interfaces/iproposalcreateoptionssr.md +++ b/docs/interfaces/iproposalcreateoptionssr.md @@ -20,7 +20,7 @@ • **parametersHash**? : *undefined | string* -*Defined in [schemes/schemeRegistrar.ts:17](https://github.com/daostack/client/blob/0eadcce/src/schemes/schemeRegistrar.ts#L17)* +*Defined in [schemes/schemeRegistrar.ts:17](https://github.com/daostack/client/blob/aa9723f/src/schemes/schemeRegistrar.ts#L17)* ___ @@ -28,7 +28,7 @@ ___ • **permissions**? : *undefined | string* -*Defined in [schemes/schemeRegistrar.ts:18](https://github.com/daostack/client/blob/0eadcce/src/schemes/schemeRegistrar.ts#L18)* +*Defined in [schemes/schemeRegistrar.ts:18](https://github.com/daostack/client/blob/aa9723f/src/schemes/schemeRegistrar.ts#L18)* ___ @@ -36,4 +36,4 @@ ___ • **schemeToRegister**? : *[Address](../globals.md#address)* -*Defined in [schemes/schemeRegistrar.ts:19](https://github.com/daostack/client/blob/0eadcce/src/schemes/schemeRegistrar.ts#L19)* +*Defined in [schemes/schemeRegistrar.ts:19](https://github.com/daostack/client/blob/aa9723f/src/schemes/schemeRegistrar.ts#L19)* diff --git a/docs/interfaces/iproposalqueryoptions.md b/docs/interfaces/iproposalqueryoptions.md index 49d60285..171fd78d 100644 --- a/docs/interfaces/iproposalqueryoptions.md +++ b/docs/interfaces/iproposalqueryoptions.md @@ -26,7 +26,7 @@ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[first](icommonqueryoptions.md#optional-first)* -*Defined in [types.ts:15](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L15)* +*Defined in [types.ts:16](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L16)* ___ @@ -36,7 +36,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderBy](icommonqueryoptions.md#optional-orderby)* -*Defined in [types.ts:16](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L16)* +*Defined in [types.ts:17](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L17)* ___ @@ -46,7 +46,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderDirection](icommonqueryoptions.md#optional-orderdirection)* -*Defined in [types.ts:17](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L17)* +*Defined in [types.ts:18](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L18)* ___ @@ -56,7 +56,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[skip](icommonqueryoptions.md#optional-skip)* -*Defined in [types.ts:14](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L14)* +*Defined in [types.ts:15](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L15)* ___ @@ -66,4 +66,4 @@ ___ *Overrides [ICommonQueryOptions](icommonqueryoptions.md).[where](icommonqueryoptions.md#optional-where)* -*Defined in [proposal.ts:816](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L816)* +*Defined in [proposal.ts:860](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L860)* diff --git a/docs/interfaces/iproposalstate.md b/docs/interfaces/iproposalstate.md index 001b344b..dc210464 100644 --- a/docs/interfaces/iproposalstate.md +++ b/docs/interfaces/iproposalstate.md @@ -14,6 +14,8 @@ * [accountsWithUnclaimedRewards](iproposalstate.md#accountswithunclaimedrewards) * [boostedAt](iproposalstate.md#boostedat) +* [closingAt](iproposalstate.md#closingat) +* [competition](iproposalstate.md#competition) * [confidenceThreshold](iproposalstate.md#confidencethreshold) * [contributionReward](iproposalstate.md#contributionreward) * [createdAt](iproposalstate.md#createdat) @@ -40,6 +42,7 @@ * [stage](iproposalstate.md#stage) * [stakesAgainst](iproposalstate.md#stakesagainst) * [stakesFor](iproposalstate.md#stakesfor) +* [tags](iproposalstate.md#optional-tags) * [title](iproposalstate.md#optional-title) * [totalRepWhenCreated](iproposalstate.md#totalrepwhencreated) * [totalRepWhenExecuted](iproposalstate.md#totalrepwhenexecuted) @@ -59,7 +62,7 @@ • **accountsWithUnclaimedRewards**: *[Address](../globals.md#address)[]* -*Defined in [proposal.ts:67](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L67)* +*Defined in [proposal.ts:69](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L69)* ___ @@ -67,7 +70,23 @@ ___ • **boostedAt**: *[Date](../globals.md#date)* -*Defined in [proposal.ts:68](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L68)* +*Defined in [proposal.ts:70](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L70)* + +___ + +### closingAt + +• **closingAt**: *[Date](../globals.md#date)* + +*Defined in [proposal.ts:74](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L74)* + +___ + +### competition + +• **competition**: *[ICompetitionProposal](icompetitionproposal.md) | null* + +*Defined in [proposal.ts:72](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L72)* ___ @@ -75,7 +94,7 @@ ___ • **confidenceThreshold**: *number* -*Defined in [proposal.ts:70](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L70)* +*Defined in [proposal.ts:73](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L73)* ___ @@ -83,7 +102,7 @@ ___ • **contributionReward**: *[IContributionReward](icontributionreward.md) | null* -*Defined in [proposal.ts:69](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L69)* +*Defined in [proposal.ts:71](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L71)* ___ @@ -91,7 +110,7 @@ ___ • **createdAt**: *[Date](../globals.md#date)* -*Defined in [proposal.ts:71](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L71)* +*Defined in [proposal.ts:75](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L75)* ___ @@ -101,7 +120,7 @@ ___ *Inherited from [IProposalStaticState](iproposalstaticstate.md).[dao](iproposalstaticstate.md#dao)* -*Defined in [proposal.ts:61](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L61)* +*Defined in [proposal.ts:63](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L63)* ___ @@ -109,7 +128,7 @@ ___ • **description**? : *undefined | string* -*Defined in [proposal.ts:73](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L73)* +*Defined in [proposal.ts:77](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L77)* ___ @@ -117,15 +136,15 @@ ___ • **descriptionHash**? : *undefined | string* -*Defined in [proposal.ts:72](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L72)* +*Defined in [proposal.ts:76](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L76)* ___ ### downStakeNeededToQueue -• **downStakeNeededToQueue**: *any* +• **downStakeNeededToQueue**: *BN* -*Defined in [proposal.ts:74](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L74)* +*Defined in [proposal.ts:78](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L78)* ___ @@ -133,7 +152,7 @@ ___ • **executedAt**: *[Date](../globals.md#date)* -*Defined in [proposal.ts:75](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L75)* +*Defined in [proposal.ts:79](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L79)* ___ @@ -141,7 +160,7 @@ ___ • **executionState**: *[IExecutionState](../enums/iexecutionstate.md)* -*Defined in [proposal.ts:76](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L76)* +*Defined in [proposal.ts:80](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L80)* ___ @@ -149,7 +168,7 @@ ___ • **expiresInQueueAt**: *[Date](../globals.md#date)* -*Defined in [proposal.ts:77](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L77)* +*Defined in [proposal.ts:81](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L81)* ___ @@ -157,7 +176,7 @@ ___ • **genericScheme**: *[IGenericScheme](igenericscheme.md) | null* -*Defined in [proposal.ts:78](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L78)* +*Defined in [proposal.ts:82](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L82)* ___ @@ -165,7 +184,7 @@ ___ • **genesisProtocolParams**: *[IGenesisProtocolParams](igenesisprotocolparams.md)* -*Defined in [proposal.ts:79](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L79)* +*Defined in [proposal.ts:83](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L83)* ___ @@ -175,7 +194,7 @@ ___ *Inherited from [IProposalStaticState](iproposalstaticstate.md).[id](iproposalstaticstate.md#id)* -*Defined in [proposal.ts:60](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L60)* +*Defined in [proposal.ts:62](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L62)* ___ @@ -183,7 +202,7 @@ ___ • **organizationId**: *string* -*Defined in [proposal.ts:80](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L80)* +*Defined in [proposal.ts:84](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L84)* ___ @@ -191,7 +210,7 @@ ___ • **paramsHash**: *string* -*Defined in [proposal.ts:81](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L81)* +*Defined in [proposal.ts:85](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L85)* ___ @@ -199,7 +218,7 @@ ___ • **preBoostedAt**: *[Date](../globals.md#date)* -*Defined in [proposal.ts:82](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L82)* +*Defined in [proposal.ts:86](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L86)* ___ @@ -207,7 +226,7 @@ ___ • **proposal**: *[Proposal](../classes/proposal.md)* -*Defined in [proposal.ts:83](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L83)* +*Defined in [proposal.ts:87](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L87)* ___ @@ -215,7 +234,7 @@ ___ • **proposer**: *[Address](../globals.md#address)* -*Defined in [proposal.ts:84](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L84)* +*Defined in [proposal.ts:88](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L88)* ___ @@ -223,7 +242,7 @@ ___ • **queue**: *[IQueueState](iqueuestate.md)* -*Defined in [proposal.ts:85](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L85)* +*Defined in [proposal.ts:89](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L89)* ___ @@ -231,7 +250,7 @@ ___ • **quietEndingPeriodBeganAt**: *[Date](../globals.md#date)* -*Defined in [proposal.ts:86](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L86)* +*Defined in [proposal.ts:90](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L90)* ___ @@ -239,17 +258,17 @@ ___ • **resolvedAt**: *[Date](../globals.md#date)* -*Defined in [proposal.ts:88](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L88)* +*Defined in [proposal.ts:92](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L92)* ___ ### scheme -• **scheme**: *[ISchemeState](ischemestate.md)* +• **scheme**: *ISchemeState* *Inherited from [IProposalStaticState](iproposalstaticstate.md).[scheme](iproposalstaticstate.md#scheme)* -*Defined in [proposal.ts:62](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L62)* +*Defined in [proposal.ts:64](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L64)* ___ @@ -257,7 +276,7 @@ ___ • **schemeRegistrar**: *[ISchemeRegistrar](ischemeregistrar.md) | null* -*Defined in [proposal.ts:87](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L87)* +*Defined in [proposal.ts:91](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L91)* ___ @@ -265,23 +284,31 @@ ___ • **stage**: *[IProposalStage](../enums/iproposalstage.md)* -*Defined in [proposal.ts:89](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L89)* +*Defined in [proposal.ts:93](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L93)* ___ ### stakesAgainst -• **stakesAgainst**: *any* +• **stakesAgainst**: *BN* -*Defined in [proposal.ts:91](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L91)* +*Defined in [proposal.ts:95](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L95)* ___ ### stakesFor -• **stakesFor**: *any* +• **stakesFor**: *BN* + +*Defined in [proposal.ts:94](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L94)* + +___ + +### `Optional` tags + +• **tags**? : *string[]* -*Defined in [proposal.ts:90](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L90)* +*Defined in [proposal.ts:96](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L96)* ___ @@ -289,23 +316,23 @@ ___ • **title**? : *undefined | string* -*Defined in [proposal.ts:92](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L92)* +*Defined in [proposal.ts:97](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L97)* ___ ### totalRepWhenCreated -• **totalRepWhenCreated**: *any* +• **totalRepWhenCreated**: *BN* -*Defined in [proposal.ts:93](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L93)* +*Defined in [proposal.ts:98](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L98)* ___ ### totalRepWhenExecuted -• **totalRepWhenExecuted**: *any* +• **totalRepWhenExecuted**: *BN* -*Defined in [proposal.ts:94](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L94)* +*Defined in [proposal.ts:99](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L99)* ___ @@ -313,15 +340,15 @@ ___ • **type**: *[IProposalType](../globals.md#const-iproposaltype)* -*Defined in [proposal.ts:95](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L95)* +*Defined in [proposal.ts:100](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L100)* ___ ### upstakeNeededToPreBoost -• **upstakeNeededToPreBoost**: *any* +• **upstakeNeededToPreBoost**: *BN* -*Defined in [proposal.ts:96](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L96)* +*Defined in [proposal.ts:101](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L101)* ___ @@ -329,7 +356,7 @@ ___ • **url**? : *undefined | string* -*Defined in [proposal.ts:97](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L97)* +*Defined in [proposal.ts:102](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L102)* ___ @@ -337,15 +364,15 @@ ___ • **voteOnBehalf**: *[Address](../globals.md#address)* -*Defined in [proposal.ts:101](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L101)* +*Defined in [proposal.ts:106](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L106)* ___ ### votesAgainst -• **votesAgainst**: *any* +• **votesAgainst**: *BN* -*Defined in [proposal.ts:99](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L99)* +*Defined in [proposal.ts:104](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L104)* ___ @@ -353,15 +380,15 @@ ___ • **votesCount**: *number* -*Defined in [proposal.ts:100](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L100)* +*Defined in [proposal.ts:105](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L105)* ___ ### votesFor -• **votesFor**: *any* +• **votesFor**: *BN* -*Defined in [proposal.ts:98](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L98)* +*Defined in [proposal.ts:103](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L103)* ___ @@ -371,7 +398,7 @@ ___ *Inherited from [IProposalStaticState](iproposalstaticstate.md).[votingMachine](iproposalstaticstate.md#votingmachine)* -*Defined in [proposal.ts:63](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L63)* +*Defined in [proposal.ts:65](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L65)* ___ @@ -379,4 +406,4 @@ ___ • **winningOutcome**: *[IProposalOutcome](../enums/iproposaloutcome.md)* -*Defined in [proposal.ts:102](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L102)* +*Defined in [proposal.ts:107](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L107)* diff --git a/docs/interfaces/iproposalstaticstate.md b/docs/interfaces/iproposalstaticstate.md index e82ac799..1bb0ca2b 100644 --- a/docs/interfaces/iproposalstaticstate.md +++ b/docs/interfaces/iproposalstaticstate.md @@ -23,7 +23,7 @@ • **dao**: *[DAO](../classes/dao.md)* -*Defined in [proposal.ts:61](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L61)* +*Defined in [proposal.ts:63](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L63)* ___ @@ -31,15 +31,15 @@ ___ • **id**: *string* -*Defined in [proposal.ts:60](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L60)* +*Defined in [proposal.ts:62](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L62)* ___ ### scheme -• **scheme**: *[ISchemeState](ischemestate.md)* +• **scheme**: *ISchemeState* -*Defined in [proposal.ts:62](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L62)* +*Defined in [proposal.ts:64](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L64)* ___ @@ -47,4 +47,4 @@ ___ • **votingMachine**: *[Address](../globals.md#address)* -*Defined in [proposal.ts:63](https://github.com/daostack/client/blob/0eadcce/src/proposal.ts#L63)* +*Defined in [proposal.ts:65](https://github.com/daostack/client/blob/aa9723f/src/proposal.ts#L65)* diff --git a/docs/interfaces/iqueuequeryoptions.md b/docs/interfaces/iqueuequeryoptions.md index 6c1983ee..0d48624a 100644 --- a/docs/interfaces/iqueuequeryoptions.md +++ b/docs/interfaces/iqueuequeryoptions.md @@ -26,7 +26,7 @@ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[first](icommonqueryoptions.md#optional-first)* -*Defined in [types.ts:15](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L15)* +*Defined in [types.ts:16](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L16)* ___ @@ -36,7 +36,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderBy](icommonqueryoptions.md#optional-orderby)* -*Defined in [types.ts:16](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L16)* +*Defined in [types.ts:17](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L17)* ___ @@ -46,7 +46,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderDirection](icommonqueryoptions.md#optional-orderdirection)* -*Defined in [types.ts:17](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L17)* +*Defined in [types.ts:18](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L18)* ___ @@ -56,7 +56,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[skip](icommonqueryoptions.md#optional-skip)* -*Defined in [types.ts:14](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L14)* +*Defined in [types.ts:15](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L15)* ___ @@ -66,4 +66,4 @@ ___ *Overrides [ICommonQueryOptions](icommonqueryoptions.md).[where](icommonqueryoptions.md#optional-where)* -*Defined in [queue.ts:22](https://github.com/daostack/client/blob/0eadcce/src/queue.ts#L22)* +*Defined in [queue.ts:23](https://github.com/daostack/client/blob/aa9723f/src/queue.ts#L23)* diff --git a/docs/interfaces/iqueuestate.md b/docs/interfaces/iqueuestate.md index a1e98735..6d7e6ee5 100644 --- a/docs/interfaces/iqueuestate.md +++ b/docs/interfaces/iqueuestate.md @@ -27,7 +27,7 @@ *Inherited from [IQueueStaticState](iqueuestaticstate.md).[dao](iqueuestaticstate.md#dao)* -*Defined in [queue.ts:10](https://github.com/daostack/client/blob/0eadcce/src/queue.ts#L10)* +*Defined in [queue.ts:11](https://github.com/daostack/client/blob/aa9723f/src/queue.ts#L11)* ___ @@ -37,7 +37,7 @@ ___ *Inherited from [IQueueStaticState](iqueuestaticstate.md).[id](iqueuestaticstate.md#id)* -*Defined in [queue.ts:11](https://github.com/daostack/client/blob/0eadcce/src/queue.ts#L11)* +*Defined in [queue.ts:12](https://github.com/daostack/client/blob/aa9723f/src/queue.ts#L12)* ___ @@ -47,15 +47,15 @@ ___ *Inherited from [IQueueStaticState](iqueuestaticstate.md).[name](iqueuestaticstate.md#name)* -*Defined in [queue.ts:12](https://github.com/daostack/client/blob/0eadcce/src/queue.ts#L12)* +*Defined in [queue.ts:13](https://github.com/daostack/client/blob/aa9723f/src/queue.ts#L13)* ___ ### scheme -• **scheme**: *[ISchemeState](ischemestate.md)* +• **scheme**: *ISchemeState* -*Defined in [queue.ts:16](https://github.com/daostack/client/blob/0eadcce/src/queue.ts#L16)* +*Defined in [queue.ts:17](https://github.com/daostack/client/blob/aa9723f/src/queue.ts#L17)* ___ @@ -63,7 +63,7 @@ ___ • **threshold**: *number* -*Defined in [queue.ts:17](https://github.com/daostack/client/blob/0eadcce/src/queue.ts#L17)* +*Defined in [queue.ts:18](https://github.com/daostack/client/blob/aa9723f/src/queue.ts#L18)* ___ @@ -71,4 +71,4 @@ ___ • **votingMachine**: *[Address](../globals.md#address)* -*Defined in [queue.ts:18](https://github.com/daostack/client/blob/0eadcce/src/queue.ts#L18)* +*Defined in [queue.ts:19](https://github.com/daostack/client/blob/aa9723f/src/queue.ts#L19)* diff --git a/docs/interfaces/iqueuestaticstate.md b/docs/interfaces/iqueuestaticstate.md index 816bf21d..de017eed 100644 --- a/docs/interfaces/iqueuestaticstate.md +++ b/docs/interfaces/iqueuestaticstate.md @@ -22,7 +22,7 @@ • **dao**: *[DAO](../classes/dao.md)* -*Defined in [queue.ts:10](https://github.com/daostack/client/blob/0eadcce/src/queue.ts#L10)* +*Defined in [queue.ts:11](https://github.com/daostack/client/blob/aa9723f/src/queue.ts#L11)* ___ @@ -30,7 +30,7 @@ ___ • **id**: *string* -*Defined in [queue.ts:11](https://github.com/daostack/client/blob/0eadcce/src/queue.ts#L11)* +*Defined in [queue.ts:12](https://github.com/daostack/client/blob/aa9723f/src/queue.ts#L12)* ___ @@ -38,4 +38,4 @@ ___ • **name**: *string* -*Defined in [queue.ts:12](https://github.com/daostack/client/blob/0eadcce/src/queue.ts#L12)* +*Defined in [queue.ts:13](https://github.com/daostack/client/blob/aa9723f/src/queue.ts#L13)* diff --git a/docs/interfaces/ireputationqueryoptions.md b/docs/interfaces/ireputationqueryoptions.md index 140d6d32..05fc16fe 100644 --- a/docs/interfaces/ireputationqueryoptions.md +++ b/docs/interfaces/ireputationqueryoptions.md @@ -30,7 +30,7 @@ • **dao**? : *[Address](../globals.md#address)* -*Defined in [reputation.ts:18](https://github.com/daostack/client/blob/0eadcce/src/reputation.ts#L18)* +*Defined in [reputation.ts:19](https://github.com/daostack/client/blob/aa9723f/src/reputation.ts#L19)* ___ @@ -40,7 +40,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[first](icommonqueryoptions.md#optional-first)* -*Defined in [types.ts:15](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L15)* +*Defined in [types.ts:16](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L16)* ___ @@ -48,7 +48,7 @@ ___ • **id**? : *undefined | string* -*Defined in [reputation.ts:17](https://github.com/daostack/client/blob/0eadcce/src/reputation.ts#L17)* +*Defined in [reputation.ts:18](https://github.com/daostack/client/blob/aa9723f/src/reputation.ts#L18)* ___ @@ -58,7 +58,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderBy](icommonqueryoptions.md#optional-orderby)* -*Defined in [types.ts:16](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L16)* +*Defined in [types.ts:17](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L17)* ___ @@ -68,7 +68,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderDirection](icommonqueryoptions.md#optional-orderdirection)* -*Defined in [types.ts:17](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L17)* +*Defined in [types.ts:18](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L18)* ___ @@ -78,7 +78,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[skip](icommonqueryoptions.md#optional-skip)* -*Defined in [types.ts:14](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L14)* +*Defined in [types.ts:15](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L15)* ___ @@ -88,4 +88,4 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[where](icommonqueryoptions.md#optional-where)* -*Defined in [types.ts:18](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L18)* +*Defined in [types.ts:19](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L19)* diff --git a/docs/interfaces/ireputationstate.md b/docs/interfaces/ireputationstate.md index c5bb4fa2..ebf2ad37 100644 --- a/docs/interfaces/ireputationstate.md +++ b/docs/interfaces/ireputationstate.md @@ -20,7 +20,7 @@ • **address**: *[Address](../globals.md#address)* -*Defined in [reputation.ts:11](https://github.com/daostack/client/blob/0eadcce/src/reputation.ts#L11)* +*Defined in [reputation.ts:12](https://github.com/daostack/client/blob/aa9723f/src/reputation.ts#L12)* ___ @@ -28,12 +28,12 @@ ___ • **dao**: *[Address](../globals.md#address)* -*Defined in [reputation.ts:13](https://github.com/daostack/client/blob/0eadcce/src/reputation.ts#L13)* +*Defined in [reputation.ts:14](https://github.com/daostack/client/blob/aa9723f/src/reputation.ts#L14)* ___ ### totalSupply -• **totalSupply**: *number* +• **totalSupply**: *BN* -*Defined in [reputation.ts:12](https://github.com/daostack/client/blob/0eadcce/src/reputation.ts#L12)* +*Defined in [reputation.ts:13](https://github.com/daostack/client/blob/aa9723f/src/reputation.ts#L13)* diff --git a/docs/interfaces/irewardqueryoptions.md b/docs/interfaces/irewardqueryoptions.md index 5e303432..4c6a9b96 100644 --- a/docs/interfaces/irewardqueryoptions.md +++ b/docs/interfaces/irewardqueryoptions.md @@ -26,7 +26,7 @@ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[first](icommonqueryoptions.md#optional-first)* -*Defined in [types.ts:15](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L15)* +*Defined in [types.ts:16](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L16)* ___ @@ -36,7 +36,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderBy](icommonqueryoptions.md#optional-orderby)* -*Defined in [types.ts:16](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L16)* +*Defined in [types.ts:17](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L17)* ___ @@ -46,7 +46,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderDirection](icommonqueryoptions.md#optional-orderdirection)* -*Defined in [types.ts:17](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L17)* +*Defined in [types.ts:18](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L18)* ___ @@ -56,7 +56,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[skip](icommonqueryoptions.md#optional-skip)* -*Defined in [types.ts:14](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L14)* +*Defined in [types.ts:15](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L15)* ___ @@ -66,4 +66,4 @@ ___ *Overrides [ICommonQueryOptions](icommonqueryoptions.md).[where](icommonqueryoptions.md#optional-where)* -*Defined in [reward.ts:25](https://github.com/daostack/client/blob/0eadcce/src/reward.ts#L25)* +*Defined in [reward.ts:29](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L29)* diff --git a/docs/interfaces/irewardstate.md b/docs/interfaces/irewardstate.md index 8490cf4f..1fe6e862 100644 --- a/docs/interfaces/irewardstate.md +++ b/docs/interfaces/irewardstate.md @@ -4,7 +4,9 @@ ## Hierarchy -* **IRewardState** +* [IRewardStaticState](irewardstaticstate.md) + + ↳ **IRewardState** ## Index @@ -30,7 +32,9 @@ • **beneficiary**: *[Address](../globals.md#address)* -*Defined in [reward.ts:10](https://github.com/daostack/client/blob/0eadcce/src/reward.ts#L10)* +*Inherited from [IRewardStaticState](irewardstaticstate.md).[beneficiary](irewardstaticstate.md#beneficiary)* + +*Defined in [reward.ts:11](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L11)* ___ @@ -38,15 +42,19 @@ ___ • **createdAt**: *Date* -*Defined in [reward.ts:11](https://github.com/daostack/client/blob/0eadcce/src/reward.ts#L11)* +*Inherited from [IRewardStaticState](irewardstaticstate.md).[createdAt](irewardstaticstate.md#createdat)* + +*Defined in [reward.ts:12](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L12)* ___ ### daoBountyForStaker -• **daoBountyForStaker**: *any* +• **daoBountyForStaker**: *BN* -*Defined in [reward.ts:15](https://github.com/daostack/client/blob/0eadcce/src/reward.ts#L15)* +*Inherited from [IRewardStaticState](irewardstaticstate.md).[daoBountyForStaker](irewardstaticstate.md#daobountyforstaker)* + +*Defined in [reward.ts:16](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L16)* ___ @@ -54,7 +62,7 @@ ___ • **daoBountyForStakerRedeemedAt**: *number* -*Defined in [reward.ts:21](https://github.com/daostack/client/blob/0eadcce/src/reward.ts#L21)* +*Defined in [reward.ts:25](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L25)* ___ @@ -62,7 +70,9 @@ ___ • **id**: *string* -*Defined in [reward.ts:9](https://github.com/daostack/client/blob/0eadcce/src/reward.ts#L9)* +*Inherited from [IRewardStaticState](irewardstaticstate.md).[id](irewardstaticstate.md#id)* + +*Defined in [reward.ts:10](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L10)* ___ @@ -70,15 +80,19 @@ ___ • **proposalId**: *string* -*Defined in [reward.ts:12](https://github.com/daostack/client/blob/0eadcce/src/reward.ts#L12)* +*Inherited from [IRewardStaticState](irewardstaticstate.md).[proposalId](irewardstaticstate.md#proposalid)* + +*Defined in [reward.ts:13](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L13)* ___ ### reputationForProposer -• **reputationForProposer**: *any* +• **reputationForProposer**: *BN* + +*Inherited from [IRewardStaticState](irewardstaticstate.md).[reputationForProposer](irewardstaticstate.md#reputationforproposer)* -*Defined in [reward.ts:16](https://github.com/daostack/client/blob/0eadcce/src/reward.ts#L16)* +*Defined in [reward.ts:17](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L17)* ___ @@ -86,15 +100,17 @@ ___ • **reputationForProposerRedeemedAt**: *number* -*Defined in [reward.ts:20](https://github.com/daostack/client/blob/0eadcce/src/reward.ts#L20)* +*Defined in [reward.ts:24](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L24)* ___ ### reputationForVoter -• **reputationForVoter**: *any* +• **reputationForVoter**: *BN* + +*Inherited from [IRewardStaticState](irewardstaticstate.md).[reputationForVoter](irewardstaticstate.md#reputationforvoter)* -*Defined in [reward.ts:13](https://github.com/daostack/client/blob/0eadcce/src/reward.ts#L13)* +*Defined in [reward.ts:14](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L14)* ___ @@ -102,7 +118,7 @@ ___ • **reputationForVoterRedeemedAt**: *number* -*Defined in [reward.ts:18](https://github.com/daostack/client/blob/0eadcce/src/reward.ts#L18)* +*Defined in [reward.ts:22](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L22)* ___ @@ -110,15 +126,19 @@ ___ • **tokenAddress**: *[Address](../globals.md#address)* -*Defined in [reward.ts:17](https://github.com/daostack/client/blob/0eadcce/src/reward.ts#L17)* +*Inherited from [IRewardStaticState](irewardstaticstate.md).[tokenAddress](irewardstaticstate.md#tokenaddress)* + +*Defined in [reward.ts:18](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L18)* ___ ### tokensForStaker -• **tokensForStaker**: *any* +• **tokensForStaker**: *BN* + +*Inherited from [IRewardStaticState](irewardstaticstate.md).[tokensForStaker](irewardstaticstate.md#tokensforstaker)* -*Defined in [reward.ts:14](https://github.com/daostack/client/blob/0eadcce/src/reward.ts#L14)* +*Defined in [reward.ts:15](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L15)* ___ @@ -126,4 +146,4 @@ ___ • **tokensForStakerRedeemedAt**: *number* -*Defined in [reward.ts:19](https://github.com/daostack/client/blob/0eadcce/src/reward.ts#L19)* +*Defined in [reward.ts:23](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L23)* diff --git a/docs/interfaces/irewardstaticstate.md b/docs/interfaces/irewardstaticstate.md new file mode 100644 index 00000000..c5ad90bc --- /dev/null +++ b/docs/interfaces/irewardstaticstate.md @@ -0,0 +1,95 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [IRewardStaticState](irewardstaticstate.md) + +# Interface: IRewardStaticState + +## Hierarchy + +* **IRewardStaticState** + + ↳ [IRewardState](irewardstate.md) + +## Index + +### Properties + +* [beneficiary](irewardstaticstate.md#beneficiary) +* [createdAt](irewardstaticstate.md#createdat) +* [daoBountyForStaker](irewardstaticstate.md#daobountyforstaker) +* [id](irewardstaticstate.md#id) +* [proposalId](irewardstaticstate.md#proposalid) +* [reputationForProposer](irewardstaticstate.md#reputationforproposer) +* [reputationForVoter](irewardstaticstate.md#reputationforvoter) +* [tokenAddress](irewardstaticstate.md#tokenaddress) +* [tokensForStaker](irewardstaticstate.md#tokensforstaker) + +## Properties + +### beneficiary + +• **beneficiary**: *[Address](../globals.md#address)* + +*Defined in [reward.ts:11](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L11)* + +___ + +### createdAt + +• **createdAt**: *Date* + +*Defined in [reward.ts:12](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L12)* + +___ + +### daoBountyForStaker + +• **daoBountyForStaker**: *BN* + +*Defined in [reward.ts:16](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L16)* + +___ + +### id + +• **id**: *string* + +*Defined in [reward.ts:10](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L10)* + +___ + +### proposalId + +• **proposalId**: *string* + +*Defined in [reward.ts:13](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L13)* + +___ + +### reputationForProposer + +• **reputationForProposer**: *BN* + +*Defined in [reward.ts:17](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L17)* + +___ + +### reputationForVoter + +• **reputationForVoter**: *BN* + +*Defined in [reward.ts:14](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L14)* + +___ + +### tokenAddress + +• **tokenAddress**: *[Address](../globals.md#address)* + +*Defined in [reward.ts:18](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L18)* + +___ + +### tokensForStaker + +• **tokensForStaker**: *BN* + +*Defined in [reward.ts:15](https://github.com/daostack/client/blob/aa9723f/src/reward.ts#L15)* diff --git a/docs/interfaces/ischemequeryoptions.md b/docs/interfaces/ischemequeryoptions.md index 840b2fc5..ce9b161a 100644 --- a/docs/interfaces/ischemequeryoptions.md +++ b/docs/interfaces/ischemequeryoptions.md @@ -6,6 +6,10 @@ * [ICommonQueryOptions](icommonqueryoptions.md) +* [ICommonQueryOptions](icommonqueryoptions.md) + +* [ICommonQueryOptions](icommonqueryoptions.md) + * [ICommonQueryOptions](icommonqueryoptions.md) ↳ **ISchemeQueryOptions** @@ -30,7 +34,7 @@ *Overrides [ICommonQueryOptions](icommonqueryoptions.md).[first](icommonqueryoptions.md#optional-first)* -*Defined in [types.ts:15](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L15)* +*Defined in [types.ts:16](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L16)* ___ @@ -42,7 +46,7 @@ ___ *Overrides [ICommonQueryOptions](icommonqueryoptions.md).[orderBy](icommonqueryoptions.md#optional-orderby)* -*Defined in [types.ts:16](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L16)* +*Defined in [types.ts:17](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L17)* ___ @@ -54,7 +58,7 @@ ___ *Overrides [ICommonQueryOptions](icommonqueryoptions.md).[orderDirection](icommonqueryoptions.md#optional-orderdirection)* -*Defined in [types.ts:17](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L17)* +*Defined in [types.ts:18](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L18)* ___ @@ -66,7 +70,7 @@ ___ *Overrides [ICommonQueryOptions](icommonqueryoptions.md).[skip](icommonqueryoptions.md#optional-skip)* -*Defined in [types.ts:14](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L14)* +*Defined in [types.ts:15](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L15)* ___ @@ -76,6 +80,10 @@ ___ *Overrides [ICommonQueryOptions](icommonqueryoptions.md).[where](icommonqueryoptions.md#optional-where)* -*Defined in [scheme.ts:57](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L57)* +*Defined in [schemes/base.ts:73](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L73)* + +*Defined in [schemes/base.ts:88](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L88)* + +*Defined in [scheme.ts:76](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L76)* -*Defined in [scheme.ts:72](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L72)* +*Defined in [scheme.ts:91](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L91)* diff --git a/docs/interfaces/ischemeregisterparams.md b/docs/interfaces/ischemeregisterparams.md new file mode 100644 index 00000000..e3df9ccd --- /dev/null +++ b/docs/interfaces/ischemeregisterparams.md @@ -0,0 +1,45 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [ISchemeRegisterParams](ischemeregisterparams.md) + +# Interface: ISchemeRegisterParams + +## Hierarchy + +* **ISchemeRegisterParams** + +## Index + +### Properties + +* [contractToCall](ischemeregisterparams.md#contracttocall) +* [voteParams](ischemeregisterparams.md#voteparams) +* [votingMachine](ischemeregisterparams.md#votingmachine) + +## Properties + +### contractToCall + +• **contractToCall**: *[Address](../globals.md#address)* + +*Defined in [schemes/base.ts:68](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L68)* + +*Defined in [scheme.ts:71](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L71)* + +___ + +### voteParams + +• **voteParams**: *[IGenesisProtocolParams](igenesisprotocolparams.md)* + +*Defined in [schemes/base.ts:69](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L69)* + +*Defined in [scheme.ts:72](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L72)* + +___ + +### votingMachine + +• **votingMachine**: *[Address](../globals.md#address)* + +*Defined in [schemes/base.ts:67](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L67)* + +*Defined in [scheme.ts:70](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L70)* diff --git a/docs/interfaces/ischemeregistrar.md b/docs/interfaces/ischemeregistrar.md index fd7fdef3..4462c299 100644 --- a/docs/interfaces/ischemeregistrar.md +++ b/docs/interfaces/ischemeregistrar.md @@ -25,7 +25,7 @@ • **decision**: *number* -*Defined in [schemes/schemeRegistrar.ts:11](https://github.com/daostack/client/blob/0eadcce/src/schemes/schemeRegistrar.ts#L11)* +*Defined in [schemes/schemeRegistrar.ts:11](https://github.com/daostack/client/blob/aa9723f/src/schemes/schemeRegistrar.ts#L11)* ___ @@ -33,7 +33,7 @@ ___ • **id**: *string* -*Defined in [schemes/schemeRegistrar.ts:6](https://github.com/daostack/client/blob/0eadcce/src/schemes/schemeRegistrar.ts#L6)* +*Defined in [schemes/schemeRegistrar.ts:6](https://github.com/daostack/client/blob/aa9723f/src/schemes/schemeRegistrar.ts#L6)* ___ @@ -41,7 +41,7 @@ ___ • **schemeRegistered**: *boolean* -*Defined in [schemes/schemeRegistrar.ts:12](https://github.com/daostack/client/blob/0eadcce/src/schemes/schemeRegistrar.ts#L12)* +*Defined in [schemes/schemeRegistrar.ts:12](https://github.com/daostack/client/blob/aa9723f/src/schemes/schemeRegistrar.ts#L12)* ___ @@ -49,7 +49,7 @@ ___ • **schemeRemoved**: *boolean* -*Defined in [schemes/schemeRegistrar.ts:13](https://github.com/daostack/client/blob/0eadcce/src/schemes/schemeRegistrar.ts#L13)* +*Defined in [schemes/schemeRegistrar.ts:13](https://github.com/daostack/client/blob/aa9723f/src/schemes/schemeRegistrar.ts#L13)* ___ @@ -57,7 +57,7 @@ ___ • **schemeToRegister**: *[Address](../globals.md#address)* -*Defined in [schemes/schemeRegistrar.ts:7](https://github.com/daostack/client/blob/0eadcce/src/schemes/schemeRegistrar.ts#L7)* +*Defined in [schemes/schemeRegistrar.ts:7](https://github.com/daostack/client/blob/aa9723f/src/schemes/schemeRegistrar.ts#L7)* ___ @@ -65,7 +65,7 @@ ___ • **schemeToRegisterParamsHash**: *string* -*Defined in [schemes/schemeRegistrar.ts:8](https://github.com/daostack/client/blob/0eadcce/src/schemes/schemeRegistrar.ts#L8)* +*Defined in [schemes/schemeRegistrar.ts:8](https://github.com/daostack/client/blob/aa9723f/src/schemes/schemeRegistrar.ts#L8)* ___ @@ -73,7 +73,7 @@ ___ • **schemeToRegisterPermission**: *string* -*Defined in [schemes/schemeRegistrar.ts:9](https://github.com/daostack/client/blob/0eadcce/src/schemes/schemeRegistrar.ts#L9)* +*Defined in [schemes/schemeRegistrar.ts:9](https://github.com/daostack/client/blob/aa9723f/src/schemes/schemeRegistrar.ts#L9)* ___ @@ -81,4 +81,4 @@ ___ • **schemeToRemove**: *string* -*Defined in [schemes/schemeRegistrar.ts:10](https://github.com/daostack/client/blob/0eadcce/src/schemes/schemeRegistrar.ts#L10)* +*Defined in [schemes/schemeRegistrar.ts:10](https://github.com/daostack/client/blob/aa9723f/src/schemes/schemeRegistrar.ts#L10)* diff --git a/docs/interfaces/ischemestate.md b/docs/interfaces/ischemestate.md index 0e0bfdef..b307ee2b 100644 --- a/docs/interfaces/ischemestate.md +++ b/docs/interfaces/ischemestate.md @@ -6,6 +6,8 @@ * [ISchemeStaticState](ischemestaticstate.md) +* ISchemeStaticState + ↳ **ISchemeState** ## Index @@ -17,6 +19,7 @@ * [canManageGlobalConstraints](ischemestate.md#canmanageglobalconstraints) * [canRegisterSchemes](ischemestate.md#canregisterschemes) * [canUpgradeController](ischemestate.md#canupgradecontroller) +* [contributionRewardExtParams](ischemestate.md#optional-contributionrewardextparams) * [contributionRewardParams](ischemestate.md#optional-contributionrewardparams) * [dao](ischemestate.md#dao) * [genericSchemeParams](ischemestate.md#optional-genericschemeparams) @@ -26,6 +29,7 @@ * [numberOfPreBoostedProposals](ischemestate.md#numberofpreboostedproposals) * [numberOfQueuedProposals](ischemestate.md#numberofqueuedproposals) * [paramsHash](ischemestate.md#paramshash) +* [schemeParams](ischemestate.md#optional-schemeparams) * [schemeRegistrarParams](ischemestate.md#optional-schemeregistrarparams) * [uGenericSchemeParams](ischemestate.md#optional-ugenericschemeparams) * [version](ischemestate.md#version) @@ -38,7 +42,9 @@ *Inherited from [ISchemeStaticState](ischemestaticstate.md).[address](ischemestaticstate.md#address)* -*Defined in [scheme.ts:18](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L18)* +*Overrides void* + +*Defined in [schemes/base.ts:21](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L21)* ___ @@ -46,7 +52,9 @@ ___ • **canDelegateCall**: *boolean* -*Defined in [scheme.ts:26](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L26)* +*Defined in [schemes/base.ts:29](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L29)* + +*Defined in [scheme.ts:32](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L32)* ___ @@ -54,7 +62,9 @@ ___ • **canManageGlobalConstraints**: *boolean* -*Defined in [scheme.ts:29](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L29)* +*Defined in [schemes/base.ts:32](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L32)* + +*Defined in [scheme.ts:35](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L35)* ___ @@ -62,7 +72,9 @@ ___ • **canRegisterSchemes**: *boolean* -*Defined in [scheme.ts:27](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L27)* +*Defined in [schemes/base.ts:30](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L30)* + +*Defined in [scheme.ts:33](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L33)* ___ @@ -70,15 +82,29 @@ ___ • **canUpgradeController**: *boolean* -*Defined in [scheme.ts:28](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L28)* +*Defined in [schemes/base.ts:31](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L31)* + +*Defined in [scheme.ts:34](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L34)* + +___ + +### `Optional` contributionRewardExtParams + +• **contributionRewardExtParams**? : *[IContributionRewardExtParams](icontributionrewardextparams.md)* + +*Defined in [schemes/base.ts:36](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L36)* + +*Defined in [scheme.ts:39](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L39)* ___ ### `Optional` contributionRewardParams -• **contributionRewardParams**? : *object | null* +• **contributionRewardParams**? : *[IContributionRewardParams](icontributionrewardparams.md)* -*Defined in [scheme.ts:32](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L32)* +*Defined in [schemes/base.ts:35](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L35)* + +*Defined in [scheme.ts:38](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L38)* ___ @@ -88,15 +114,19 @@ ___ *Overrides [ISchemeStaticState](ischemestaticstate.md).[dao](ischemestaticstate.md#dao)* -*Defined in [scheme.ts:30](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L30)* +*Defined in [schemes/base.ts:33](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L33)* + +*Defined in [scheme.ts:36](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L36)* ___ ### `Optional` genericSchemeParams -• **genericSchemeParams**? : *object | null* +• **genericSchemeParams**? : *[IGenericSchemeParams](igenericschemeparams.md)* + +*Defined in [schemes/base.ts:37](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L37)* -*Defined in [scheme.ts:36](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L36)* +*Defined in [scheme.ts:40](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L40)* ___ @@ -106,7 +136,9 @@ ___ *Inherited from [ISchemeStaticState](ischemestaticstate.md).[id](ischemestaticstate.md#id)* -*Defined in [scheme.ts:17](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L17)* +*Overrides void* + +*Defined in [schemes/base.ts:20](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L20)* ___ @@ -116,7 +148,9 @@ ___ *Inherited from [ISchemeStaticState](ischemestaticstate.md).[name](ischemestaticstate.md#name)* -*Defined in [scheme.ts:20](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L20)* +*Overrides void* + +*Defined in [schemes/base.ts:23](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L23)* ___ @@ -124,7 +158,9 @@ ___ • **numberOfBoostedProposals**: *number* -*Defined in [scheme.ts:48](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L48)* +*Defined in [schemes/base.ts:45](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L45)* + +*Defined in [scheme.ts:48](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L48)* ___ @@ -132,7 +168,9 @@ ___ • **numberOfPreBoostedProposals**: *number* -*Defined in [scheme.ts:47](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L47)* +*Defined in [schemes/base.ts:44](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L44)* + +*Defined in [scheme.ts:47](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L47)* ___ @@ -140,7 +178,9 @@ ___ • **numberOfQueuedProposals**: *number* -*Defined in [scheme.ts:46](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L46)* +*Defined in [schemes/base.ts:43](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L43)* + +*Defined in [scheme.ts:46](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L46)* ___ @@ -150,7 +190,19 @@ ___ *Overrides [ISchemeStaticState](ischemestaticstate.md).[paramsHash](ischemestaticstate.md#paramshash)* -*Defined in [scheme.ts:31](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L31)* +*Defined in [schemes/base.ts:34](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L34)* + +*Defined in [scheme.ts:37](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L37)* + +___ + +### `Optional` schemeParams + +• **schemeParams**? : *IGenericSchemeParams | IContributionRewardParams | IContributionRewardExtParams | ISchemeRegisterParams* + +*Defined in [schemes/base.ts:47](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L47)* + +*Defined in [scheme.ts:50](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L50)* ___ @@ -158,15 +210,19 @@ ___ • **schemeRegistrarParams**? : *object | null* -*Defined in [scheme.ts:41](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L41)* +*Defined in [schemes/base.ts:38](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L38)* + +*Defined in [scheme.ts:41](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L41)* ___ ### `Optional` uGenericSchemeParams -• **uGenericSchemeParams**? : *object | null* +• **uGenericSchemeParams**? : *[IGenericSchemeParams](igenericschemeparams.md)* + +*Defined in [schemes/base.ts:46](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L46)* -*Defined in [scheme.ts:49](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L49)* +*Defined in [scheme.ts:49](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L49)* ___ @@ -176,4 +232,6 @@ ___ *Inherited from [ISchemeStaticState](ischemestaticstate.md).[version](ischemestaticstate.md#version)* -*Defined in [scheme.ts:22](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L22)* +*Overrides void* + +*Defined in [schemes/base.ts:25](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L25)* diff --git a/docs/interfaces/ischemestaticstate.md b/docs/interfaces/ischemestaticstate.md index 3ea6a7f8..8fae32a6 100644 --- a/docs/interfaces/ischemestaticstate.md +++ b/docs/interfaces/ischemestaticstate.md @@ -25,7 +25,9 @@ • **address**: *[Address](../globals.md#address)* -*Defined in [scheme.ts:18](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L18)* +*Defined in [schemes/base.ts:21](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L21)* + +*Defined in [scheme.ts:24](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L24)* ___ @@ -33,7 +35,9 @@ ___ • **dao**: *[Address](../globals.md#address)* -*Defined in [scheme.ts:19](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L19)* +*Defined in [schemes/base.ts:22](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L22)* + +*Defined in [scheme.ts:25](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L25)* ___ @@ -41,7 +45,9 @@ ___ • **id**: *string* -*Defined in [scheme.ts:17](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L17)* +*Defined in [schemes/base.ts:20](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L20)* + +*Defined in [scheme.ts:23](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L23)* ___ @@ -49,7 +55,9 @@ ___ • **name**: *string* -*Defined in [scheme.ts:20](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L20)* +*Defined in [schemes/base.ts:23](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L23)* + +*Defined in [scheme.ts:26](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L26)* ___ @@ -57,7 +65,9 @@ ___ • **paramsHash**: *string* -*Defined in [scheme.ts:21](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L21)* +*Defined in [schemes/base.ts:24](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L24)* + +*Defined in [scheme.ts:27](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L27)* ___ @@ -65,4 +75,6 @@ ___ • **version**: *string* -*Defined in [scheme.ts:22](https://github.com/daostack/client/blob/0eadcce/src/scheme.ts#L22)* +*Defined in [schemes/base.ts:25](https://github.com/daostack/client/blob/aa9723f/src/schemes/base.ts#L25)* + +*Defined in [scheme.ts:28](https://github.com/daostack/client/blob/aa9723f/src/scheme.ts#L28)* diff --git a/docs/interfaces/istakequeryoptions.md b/docs/interfaces/istakequeryoptions.md index cc55fdbe..77f2b2fe 100644 --- a/docs/interfaces/istakequeryoptions.md +++ b/docs/interfaces/istakequeryoptions.md @@ -26,7 +26,7 @@ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[first](icommonqueryoptions.md#optional-first)* -*Defined in [types.ts:15](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L15)* +*Defined in [types.ts:16](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L16)* ___ @@ -36,7 +36,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderBy](icommonqueryoptions.md#optional-orderby)* -*Defined in [types.ts:16](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L16)* +*Defined in [types.ts:17](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L17)* ___ @@ -46,7 +46,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderDirection](icommonqueryoptions.md#optional-orderdirection)* -*Defined in [types.ts:17](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L17)* +*Defined in [types.ts:18](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L18)* ___ @@ -56,7 +56,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[skip](icommonqueryoptions.md#optional-skip)* -*Defined in [types.ts:14](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L14)* +*Defined in [types.ts:15](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L15)* ___ @@ -66,4 +66,4 @@ ___ *Overrides [ICommonQueryOptions](icommonqueryoptions.md).[where](icommonqueryoptions.md#optional-where)* -*Defined in [stake.ts:23](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L23)* +*Defined in [stake.ts:24](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L24)* diff --git a/docs/interfaces/istakestate.md b/docs/interfaces/istakestate.md index e4593e43..41e70c1a 100644 --- a/docs/interfaces/istakestate.md +++ b/docs/interfaces/istakestate.md @@ -23,11 +23,11 @@ ### amount -• **amount**: *any* +• **amount**: *BN* *Inherited from [IStakeStaticState](istakestaticstate.md).[amount](istakestaticstate.md#amount)* -*Defined in [stake.ts:14](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L14)* +*Defined in [stake.ts:15](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L15)* ___ @@ -37,7 +37,7 @@ ___ *Inherited from [IStakeStaticState](istakestaticstate.md).[createdAt](istakestaticstate.md#createdat)* -*Defined in [stake.ts:12](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L12)* +*Defined in [stake.ts:13](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L13)* ___ @@ -47,7 +47,7 @@ ___ *Overrides [IStakeStaticState](istakestaticstate.md).[id](istakestaticstate.md#optional-id)* -*Defined in [stake.ts:19](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L19)* +*Defined in [stake.ts:20](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L20)* ___ @@ -57,7 +57,7 @@ ___ *Inherited from [IStakeStaticState](istakestaticstate.md).[outcome](istakestaticstate.md#outcome)* -*Defined in [stake.ts:13](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L13)* +*Defined in [stake.ts:14](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L14)* ___ @@ -67,7 +67,7 @@ ___ *Inherited from [IStakeStaticState](istakestaticstate.md).[proposal](istakestaticstate.md#proposal)* -*Defined in [stake.ts:15](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L15)* +*Defined in [stake.ts:16](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L16)* ___ @@ -77,4 +77,4 @@ ___ *Inherited from [IStakeStaticState](istakestaticstate.md).[staker](istakestaticstate.md#staker)* -*Defined in [stake.ts:11](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L11)* +*Defined in [stake.ts:12](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L12)* diff --git a/docs/interfaces/istakestaticstate.md b/docs/interfaces/istakestaticstate.md index f1b86eab..4ea25406 100644 --- a/docs/interfaces/istakestaticstate.md +++ b/docs/interfaces/istakestaticstate.md @@ -23,9 +23,9 @@ ### amount -• **amount**: *any* +• **amount**: *BN* -*Defined in [stake.ts:14](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L14)* +*Defined in [stake.ts:15](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L15)* ___ @@ -33,7 +33,7 @@ ___ • **createdAt**: *Date | undefined* -*Defined in [stake.ts:12](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L12)* +*Defined in [stake.ts:13](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L13)* ___ @@ -41,7 +41,7 @@ ___ • **id**? : *undefined | string* -*Defined in [stake.ts:10](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L10)* +*Defined in [stake.ts:11](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L11)* ___ @@ -49,7 +49,7 @@ ___ • **outcome**: *[IProposalOutcome](../enums/iproposaloutcome.md)* -*Defined in [stake.ts:13](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L13)* +*Defined in [stake.ts:14](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L14)* ___ @@ -57,7 +57,7 @@ ___ • **proposal**: *string* -*Defined in [stake.ts:15](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L15)* +*Defined in [stake.ts:16](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L16)* ___ @@ -65,4 +65,4 @@ ___ • **staker**: *[Address](../globals.md#address)* -*Defined in [stake.ts:11](https://github.com/daostack/client/blob/0eadcce/src/stake.ts#L11)* +*Defined in [stake.ts:12](https://github.com/daostack/client/blob/aa9723f/src/stake.ts#L12)* diff --git a/docs/interfaces/istateful.md b/docs/interfaces/istateful.md index 92198341..9be23f3d 100644 --- a/docs/interfaces/istateful.md +++ b/docs/interfaces/istateful.md @@ -12,14 +12,18 @@ ## Implemented by +* [CompetitionScheme](../classes/competitionscheme.md) * [DAO](../classes/dao.md) +* [Event](../classes/event.md) * [Member](../classes/member.md) * [Proposal](../classes/proposal.md) * [Queue](../classes/queue.md) * [Reputation](../classes/reputation.md) * [Reward](../classes/reward.md) * [Scheme](../classes/scheme.md) +* [SchemeBase](../classes/schemebase.md) * [Stake](../classes/stake.md) +* [Tag](../classes/tag.md) * [Token](../classes/token.md) * [Vote](../classes/vote.md) @@ -35,8 +39,14 @@ • **state**: *function* -*Defined in [types.ts:10](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L10)* +*Defined in [types.ts:11](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L11)* #### Type declaration: -▸ (): *Observable‹T›* +▸ (`apolloQueryOptions`: [IApolloQueryOptions](iapolloqueryoptions.md)): *Observable‹T›* + +**Parameters:** + +Name | Type | +------ | ------ | +`apolloQueryOptions` | [IApolloQueryOptions](iapolloqueryoptions.md) | diff --git a/docs/interfaces/itagqueryoptions.md b/docs/interfaces/itagqueryoptions.md new file mode 100644 index 00000000..5424a2a6 --- /dev/null +++ b/docs/interfaces/itagqueryoptions.md @@ -0,0 +1,69 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [ITagQueryOptions](itagqueryoptions.md) + +# Interface: ITagQueryOptions + +## Hierarchy + +* [ICommonQueryOptions](icommonqueryoptions.md) + + ↳ **ITagQueryOptions** + +## Index + +### Properties + +* [first](itagqueryoptions.md#optional-first) +* [orderBy](itagqueryoptions.md#optional-orderby) +* [orderDirection](itagqueryoptions.md#optional-orderdirection) +* [skip](itagqueryoptions.md#optional-skip) +* [where](itagqueryoptions.md#optional-where) + +## Properties + +### `Optional` first + +• **first**? : *undefined | number* + +*Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[first](icommonqueryoptions.md#optional-first)* + +*Defined in [types.ts:16](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L16)* + +___ + +### `Optional` orderBy + +• **orderBy**? : *undefined | string* + +*Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderBy](icommonqueryoptions.md#optional-orderby)* + +*Defined in [types.ts:17](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L17)* + +___ + +### `Optional` orderDirection + +• **orderDirection**? : *"asc" | "desc"* + +*Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderDirection](icommonqueryoptions.md#optional-orderdirection)* + +*Defined in [types.ts:18](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L18)* + +___ + +### `Optional` skip + +• **skip**? : *undefined | number* + +*Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[skip](icommonqueryoptions.md#optional-skip)* + +*Defined in [types.ts:15](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L15)* + +___ + +### `Optional` where + +• **where**? : *undefined | object* + +*Overrides [ICommonQueryOptions](icommonqueryoptions.md).[where](icommonqueryoptions.md#optional-where)* + +*Defined in [tag.ts:20](https://github.com/daostack/client/blob/aa9723f/src/tag.ts#L20)* diff --git a/docs/interfaces/itagstate.md b/docs/interfaces/itagstate.md new file mode 100644 index 00000000..6b3bb088 --- /dev/null +++ b/docs/interfaces/itagstate.md @@ -0,0 +1,45 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [ITagState](itagstate.md) + +# Interface: ITagState + +## Hierarchy + +* [ITagStaticState](itagstaticstate.md) + + ↳ **ITagState** + +## Index + +### Properties + +* [id](itagstate.md#id) +* [numberOfProposals](itagstate.md#numberofproposals) +* [proposals](itagstate.md#proposals) + +## Properties + +### id + +• **id**: *string* + +*Overrides [ITagStaticState](itagstaticstate.md).[id](itagstaticstate.md#id)* + +*Defined in [tag.ts:15](https://github.com/daostack/client/blob/aa9723f/src/tag.ts#L15)* + +___ + +### numberOfProposals + +• **numberOfProposals**: *number* + +*Inherited from [ITagStaticState](itagstaticstate.md).[numberOfProposals](itagstaticstate.md#numberofproposals)* + +*Defined in [tag.ts:11](https://github.com/daostack/client/blob/aa9723f/src/tag.ts#L11)* + +___ + +### proposals + +• **proposals**: *[Proposal](../classes/proposal.md)[]* + +*Defined in [tag.ts:16](https://github.com/daostack/client/blob/aa9723f/src/tag.ts#L16)* diff --git a/docs/interfaces/itagstaticstate.md b/docs/interfaces/itagstaticstate.md new file mode 100644 index 00000000..e9a9e774 --- /dev/null +++ b/docs/interfaces/itagstaticstate.md @@ -0,0 +1,32 @@ +[@daostack/client](../README.md) › [Globals](../globals.md) › [ITagStaticState](itagstaticstate.md) + +# Interface: ITagStaticState + +## Hierarchy + +* **ITagStaticState** + + ↳ [ITagState](itagstate.md) + +## Index + +### Properties + +* [id](itagstaticstate.md#id) +* [numberOfProposals](itagstaticstate.md#numberofproposals) + +## Properties + +### id + +• **id**: *string* + +*Defined in [tag.ts:10](https://github.com/daostack/client/blob/aa9723f/src/tag.ts#L10)* + +___ + +### numberOfProposals + +• **numberOfProposals**: *number* + +*Defined in [tag.ts:11](https://github.com/daostack/client/blob/aa9723f/src/tag.ts#L11)* diff --git a/docs/interfaces/itokenqueryoptions.md b/docs/interfaces/itokenqueryoptions.md index a8c1a4d9..27318de5 100644 --- a/docs/interfaces/itokenqueryoptions.md +++ b/docs/interfaces/itokenqueryoptions.md @@ -26,7 +26,7 @@ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[first](icommonqueryoptions.md#optional-first)* -*Defined in [types.ts:15](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L15)* +*Defined in [types.ts:16](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L16)* ___ @@ -36,7 +36,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderBy](icommonqueryoptions.md#optional-orderby)* -*Defined in [types.ts:16](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L16)* +*Defined in [types.ts:17](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L17)* ___ @@ -46,7 +46,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderDirection](icommonqueryoptions.md#optional-orderdirection)* -*Defined in [types.ts:17](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L17)* +*Defined in [types.ts:18](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L18)* ___ @@ -56,7 +56,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[skip](icommonqueryoptions.md#optional-skip)* -*Defined in [types.ts:14](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L14)* +*Defined in [types.ts:15](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L15)* ___ @@ -66,4 +66,4 @@ ___ *Overrides [ICommonQueryOptions](icommonqueryoptions.md).[where](icommonqueryoptions.md#optional-where)* -*Defined in [token.ts:19](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L19)* +*Defined in [token.ts:19](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L19)* diff --git a/docs/interfaces/itokenstate.md b/docs/interfaces/itokenstate.md index caa22cdd..a8a05189 100644 --- a/docs/interfaces/itokenstate.md +++ b/docs/interfaces/itokenstate.md @@ -22,7 +22,7 @@ • **address**: *[Address](../globals.md#address)* -*Defined in [token.ts:11](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L11)* +*Defined in [token.ts:11](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L11)* ___ @@ -30,7 +30,7 @@ ___ • **name**: *string* -*Defined in [token.ts:12](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L12)* +*Defined in [token.ts:12](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L12)* ___ @@ -38,7 +38,7 @@ ___ • **owner**: *[Address](../globals.md#address)* -*Defined in [token.ts:13](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L13)* +*Defined in [token.ts:13](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L13)* ___ @@ -46,12 +46,12 @@ ___ • **symbol**: *string* -*Defined in [token.ts:14](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L14)* +*Defined in [token.ts:14](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L14)* ___ ### totalSupply -• **totalSupply**: *any* +• **totalSupply**: *BN* -*Defined in [token.ts:15](https://github.com/daostack/client/blob/0eadcce/src/token.ts#L15)* +*Defined in [token.ts:15](https://github.com/daostack/client/blob/aa9723f/src/token.ts#L15)* diff --git a/docs/interfaces/itransactionupdate.md b/docs/interfaces/itransactionupdate.md index dd2b76e7..a086678a 100644 --- a/docs/interfaces/itransactionupdate.md +++ b/docs/interfaces/itransactionupdate.md @@ -28,7 +28,7 @@ A transaction update is a snapshot of the state of a transaction at a particular • **confirmations**? : *undefined | number* -*Defined in [operation.ts:24](https://github.com/daostack/client/blob/0eadcce/src/operation.ts#L24)* +*Defined in [operation.ts:23](https://github.com/daostack/client/blob/aa9723f/src/operation.ts#L23)* number of confirmations @@ -38,7 +38,7 @@ ___ • **receipt**? : *undefined | object* -*Defined in [operation.ts:20](https://github.com/daostack/client/blob/0eadcce/src/operation.ts#L20)* +*Defined in [operation.ts:19](https://github.com/daostack/client/blob/aa9723f/src/operation.ts#L19)* ___ @@ -46,7 +46,7 @@ ___ • **result**? : *[T](undefined)* -*Defined in [operation.ts:29](https://github.com/daostack/client/blob/0eadcce/src/operation.ts#L29)* +*Defined in [operation.ts:28](https://github.com/daostack/client/blob/aa9723f/src/operation.ts#L28)* Parsed return value from the method call or contract address in the case of contract creation tx. @@ -57,7 +57,7 @@ ___ • **state**: *[ITransactionState](../enums/itransactionstate.md)* -*Defined in [operation.ts:18](https://github.com/daostack/client/blob/0eadcce/src/operation.ts#L18)* +*Defined in [operation.ts:17](https://github.com/daostack/client/blob/aa9723f/src/operation.ts#L17)* ___ @@ -65,4 +65,4 @@ ___ • **transactionHash**? : *undefined | string* -*Defined in [operation.ts:19](https://github.com/daostack/client/blob/0eadcce/src/operation.ts#L19)* +*Defined in [operation.ts:18](https://github.com/daostack/client/blob/aa9723f/src/operation.ts#L18)* diff --git a/docs/interfaces/iugenericscheme.md b/docs/interfaces/iugenericscheme.md index 3e08e330..8e678cdd 100644 --- a/docs/interfaces/iugenericscheme.md +++ b/docs/interfaces/iugenericscheme.md @@ -22,7 +22,7 @@ • **callData**: *string* -*Defined in [schemes/uGenericScheme.ts:14](https://github.com/daostack/client/blob/0eadcce/src/schemes/uGenericScheme.ts#L14)* +*Defined in [schemes/uGenericScheme.ts:14](https://github.com/daostack/client/blob/aa9723f/src/schemes/uGenericScheme.ts#L14)* ___ @@ -30,7 +30,7 @@ ___ • **contractToCall**: *[Address](../globals.md#address)* -*Defined in [schemes/uGenericScheme.ts:13](https://github.com/daostack/client/blob/0eadcce/src/schemes/uGenericScheme.ts#L13)* +*Defined in [schemes/uGenericScheme.ts:13](https://github.com/daostack/client/blob/aa9723f/src/schemes/uGenericScheme.ts#L13)* ___ @@ -38,7 +38,7 @@ ___ • **executed**: *boolean* -*Defined in [schemes/uGenericScheme.ts:15](https://github.com/daostack/client/blob/0eadcce/src/schemes/uGenericScheme.ts#L15)* +*Defined in [schemes/uGenericScheme.ts:15](https://github.com/daostack/client/blob/aa9723f/src/schemes/uGenericScheme.ts#L15)* ___ @@ -46,7 +46,7 @@ ___ • **id**: *string* -*Defined in [schemes/uGenericScheme.ts:12](https://github.com/daostack/client/blob/0eadcce/src/schemes/uGenericScheme.ts#L12)* +*Defined in [schemes/uGenericScheme.ts:12](https://github.com/daostack/client/blob/aa9723f/src/schemes/uGenericScheme.ts#L12)* ___ @@ -54,4 +54,4 @@ ___ • **returnValue**: *string* -*Defined in [schemes/uGenericScheme.ts:16](https://github.com/daostack/client/blob/0eadcce/src/schemes/uGenericScheme.ts#L16)* +*Defined in [schemes/uGenericScheme.ts:16](https://github.com/daostack/client/blob/aa9723f/src/schemes/uGenericScheme.ts#L16)* diff --git a/docs/interfaces/iugenericschemeinfo.md b/docs/interfaces/iugenericschemeinfo.md index 554397ed..ddc1af93 100644 --- a/docs/interfaces/iugenericschemeinfo.md +++ b/docs/interfaces/iugenericschemeinfo.md @@ -20,7 +20,7 @@ • **contractToCall**: *[Address](../globals.md#address)* -*Defined in [schemes/uGenericScheme.ts:7](https://github.com/daostack/client/blob/0eadcce/src/schemes/uGenericScheme.ts#L7)* +*Defined in [schemes/uGenericScheme.ts:7](https://github.com/daostack/client/blob/aa9723f/src/schemes/uGenericScheme.ts#L7)* ___ @@ -28,7 +28,7 @@ ___ • **id**: *string* -*Defined in [schemes/uGenericScheme.ts:6](https://github.com/daostack/client/blob/0eadcce/src/schemes/uGenericScheme.ts#L6)* +*Defined in [schemes/uGenericScheme.ts:6](https://github.com/daostack/client/blob/aa9723f/src/schemes/uGenericScheme.ts#L6)* ___ @@ -36,4 +36,4 @@ ___ • **votingMachine**: *[Address](../globals.md#address)* -*Defined in [schemes/uGenericScheme.ts:8](https://github.com/daostack/client/blob/0eadcce/src/schemes/uGenericScheme.ts#L8)* +*Defined in [schemes/uGenericScheme.ts:8](https://github.com/daostack/client/blob/aa9723f/src/schemes/uGenericScheme.ts#L8)* diff --git a/docs/interfaces/ivotequeryoptions.md b/docs/interfaces/ivotequeryoptions.md index 40426b0c..84db8a98 100644 --- a/docs/interfaces/ivotequeryoptions.md +++ b/docs/interfaces/ivotequeryoptions.md @@ -26,7 +26,7 @@ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[first](icommonqueryoptions.md#optional-first)* -*Defined in [types.ts:15](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L15)* +*Defined in [types.ts:16](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L16)* ___ @@ -36,7 +36,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderBy](icommonqueryoptions.md#optional-orderby)* -*Defined in [types.ts:16](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L16)* +*Defined in [types.ts:17](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L17)* ___ @@ -46,7 +46,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[orderDirection](icommonqueryoptions.md#optional-orderdirection)* -*Defined in [types.ts:17](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L17)* +*Defined in [types.ts:18](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L18)* ___ @@ -56,7 +56,7 @@ ___ *Inherited from [ICommonQueryOptions](icommonqueryoptions.md).[skip](icommonqueryoptions.md#optional-skip)* -*Defined in [types.ts:14](https://github.com/daostack/client/blob/0eadcce/src/types.ts#L14)* +*Defined in [types.ts:15](https://github.com/daostack/client/blob/aa9723f/src/types.ts#L15)* ___ @@ -66,4 +66,4 @@ ___ *Overrides [ICommonQueryOptions](icommonqueryoptions.md).[where](icommonqueryoptions.md#optional-where)* -*Defined in [vote.ts:24](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L24)* +*Defined in [vote.ts:25](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L25)* diff --git a/docs/interfaces/ivotestate.md b/docs/interfaces/ivotestate.md index 3b515cce..20007f0a 100644 --- a/docs/interfaces/ivotestate.md +++ b/docs/interfaces/ivotestate.md @@ -24,11 +24,11 @@ ### amount -• **amount**: *any* +• **amount**: *BN* *Inherited from [IVoteStaticState](ivotestaticstate.md).[amount](ivotestaticstate.md#amount)* -*Defined in [vote.ts:14](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L14)* +*Defined in [vote.ts:15](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L15)* ___ @@ -38,7 +38,7 @@ ___ *Inherited from [IVoteStaticState](ivotestaticstate.md).[createdAt](ivotestaticstate.md#createdat)* -*Defined in [vote.ts:12](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L12)* +*Defined in [vote.ts:13](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L13)* ___ @@ -48,7 +48,7 @@ ___ *Inherited from [IVoteStaticState](ivotestaticstate.md).[dao](ivotestaticstate.md#optional-dao)* -*Defined in [vote.ts:16](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L16)* +*Defined in [vote.ts:17](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L17)* ___ @@ -58,7 +58,7 @@ ___ *Overrides [IVoteStaticState](ivotestaticstate.md).[id](ivotestaticstate.md#optional-id)* -*Defined in [vote.ts:20](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L20)* +*Defined in [vote.ts:21](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L21)* ___ @@ -68,7 +68,7 @@ ___ *Inherited from [IVoteStaticState](ivotestaticstate.md).[outcome](ivotestaticstate.md#outcome)* -*Defined in [vote.ts:13](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L13)* +*Defined in [vote.ts:14](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L14)* ___ @@ -78,7 +78,7 @@ ___ *Inherited from [IVoteStaticState](ivotestaticstate.md).[proposal](ivotestaticstate.md#proposal)* -*Defined in [vote.ts:15](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L15)* +*Defined in [vote.ts:16](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L16)* ___ @@ -88,4 +88,4 @@ ___ *Inherited from [IVoteStaticState](ivotestaticstate.md).[voter](ivotestaticstate.md#voter)* -*Defined in [vote.ts:11](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L11)* +*Defined in [vote.ts:12](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L12)* diff --git a/docs/interfaces/ivotestaticstate.md b/docs/interfaces/ivotestaticstate.md index d286e0ee..ea53921a 100644 --- a/docs/interfaces/ivotestaticstate.md +++ b/docs/interfaces/ivotestaticstate.md @@ -24,9 +24,9 @@ ### amount -• **amount**: *any* +• **amount**: *BN* -*Defined in [vote.ts:14](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L14)* +*Defined in [vote.ts:15](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L15)* ___ @@ -34,7 +34,7 @@ ___ • **createdAt**: *[Date](../globals.md#date) | undefined* -*Defined in [vote.ts:12](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L12)* +*Defined in [vote.ts:13](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L13)* ___ @@ -42,7 +42,7 @@ ___ • **dao**? : *[Address](../globals.md#address)* -*Defined in [vote.ts:16](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L16)* +*Defined in [vote.ts:17](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L17)* ___ @@ -50,7 +50,7 @@ ___ • **id**? : *undefined | string* -*Defined in [vote.ts:10](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L10)* +*Defined in [vote.ts:11](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L11)* ___ @@ -58,7 +58,7 @@ ___ • **outcome**: *[IProposalOutcome](../enums/iproposaloutcome.md)* -*Defined in [vote.ts:13](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L13)* +*Defined in [vote.ts:14](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L14)* ___ @@ -66,7 +66,7 @@ ___ • **proposal**: *string* -*Defined in [vote.ts:15](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L15)* +*Defined in [vote.ts:16](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L16)* ___ @@ -74,4 +74,4 @@ ___ • **voter**: *[Address](../globals.md#address)* -*Defined in [vote.ts:11](https://github.com/daostack/client/blob/0eadcce/src/vote.ts#L11)* +*Defined in [vote.ts:12](https://github.com/daostack/client/blob/aa9723f/src/vote.ts#L12)* diff --git a/package-lock.json b/package-lock.json index 6de01499..6b6ecc35 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@daostack/client", - "version": "0.2.37", + "version": "0.2.39", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 33c4bcdf..7a77e289 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@daostack/client", - "version": "0.2.37", + "version": "0.2.39", "description": "", "keywords": [], "main": "dist/lib/index.js", diff --git a/src/arc.ts b/src/arc.ts index cd627641..2f9efc76 100644 --- a/src/arc.ts +++ b/src/arc.ts @@ -423,7 +423,7 @@ export class Arc extends GraphNodeObserver { * @param options an Object to save. This object must have title, url and desction defined * @return a Promise that resolves in the IPFS Hash where the file is saved */ - public async saveIPFSData(options: { title: string, url: string, description: string, tags: string[]}): + public async saveIPFSData(options: { title?: string, url?: string, description?: string, tags?: string[]}): Promise { let ipfsDataToSave: object = {} if (options.title || options.url || options.description || options.tags !== undefined) { diff --git a/src/dao.ts b/src/dao.ts index ba3d30dc..9ae845d6 100644 --- a/src/dao.ts +++ b/src/dao.ts @@ -1,10 +1,11 @@ import BN = require('bn.js') import gql from 'graphql-tag' import { Observable } from 'rxjs' -import { first, map } from 'rxjs/operators' +import { concatMap, first, map } from 'rxjs/operators' import { Arc } from './arc' import { IApolloQueryOptions } from './graphnode' import { IMemberQueryOptions, Member } from './member' +import { toIOperationObservable } from './operation' import { IProposalCreateOptions, IProposalQueryOptions, Proposal } from './proposal' import { Reputation } from './reputation' import { IRewardQueryOptions, Reward } from './reward' @@ -268,7 +269,28 @@ export class DAO implements IStateful { */ public createProposal(options: IProposalCreateOptions) { options.dao = this.id - return Proposal.create(options, this.context) + + if (!options.scheme) { + throw Error(`dao.createProposal(options): options must include an address for "scheme"`) + } + + const schemesQuery = this.schemes( + { where: { + address: options.scheme, + dao: options.dao + }} + ) + const observable = schemesQuery.pipe( + first(), + concatMap((schemes) => { + if (schemes && schemes.length > 0) { + return schemes[0].createProposal(options) + } else { + throw Error(`No scheme with address ${options.scheme} is registered with dao ${options.dao}`) + } + } + )) + return toIOperationObservable(observable) } public proposals( diff --git a/src/index.ts b/src/index.ts index c144f259..90225f47 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,12 +13,17 @@ export { Reward, IRewardState, IRewardStaticState, IRewardQueryOptions } from '. export { Scheme, ISchemeState, ISchemeStaticState, ISchemeQueryOptions } from './scheme' export { ReputationFromTokenScheme } from './schemes/reputationFromToken' export { IContributionReward} from './schemes/contributionReward' +export { hasCompetitionContract, IProposalCreateOptionsCompetition, Competition, CompetitionScheme, + CompetitionSuggestion, CompetitionVote, + ICompetitionProposal, ICompetitionVote, ICompetitionSuggestion } from './schemes/competition' +export { IContributionRewardExt, IProposalCreateOptionsContributionRewardExt } from './schemes/contributionRewardExt' export { IGenericScheme } from './schemes/genericScheme' export { IUGenericScheme } from './schemes/uGenericScheme' export { ISchemeRegistrar } from './schemes/schemeRegistrar' export { Token, ITokenState, ITokenQueryOptions } from './token' export { Stake, IStakeState, IStakeStaticState, IStakeQueryOptions } from './stake' export { Tag } from './tag' +export { Logger } from './logger' export { Vote, IVoteState, IVoteStaticState, IVoteQueryOptions } from './vote' export { Address } from './types' import { Arc } from './arc' diff --git a/src/proposal.ts b/src/proposal.ts index ed8bf5df..bc17b9e1 100644 --- a/src/proposal.ts +++ b/src/proposal.ts @@ -9,17 +9,17 @@ import { IObservable } from './graphnode' import { Operation, toIOperationObservable } from './operation' import { IQueueState } from './queue' import { IRewardQueryOptions, Reward } from './reward' -import { Scheme } from './scheme' -import { ISchemeState } from './scheme' +import { ISchemeState, Scheme } from './scheme' +import { ICompetitionProposal, IProposalCreateOptionsCompetition } from './schemes/competition' import * as ContributionReward from './schemes/contributionReward' +import * as ContributionRewardExt from './schemes/contributionRewardExt' import * as GenericScheme from './schemes/genericScheme' import * as SchemeRegistrar from './schemes/schemeRegistrar' -// import * as Competition from './schemes/competition' import { LATEST_ARC_VERSION, REDEEMER_CONTRACT_VERSION } from './settings' import { IStakeQueryOptions, Stake } from './stake' import { Address, Date, ICommonQueryOptions, IStateful } from './types' -import { isAddress } from './utils' -import { createGraphQlQuery, NULL_ADDRESS, realMathToNumber } from './utils' +import { createGraphQlQuery, isAddress, NULL_ADDRESS, realMathToNumber, + secondSinceEpochToDate } from './utils' import { IVoteQueryOptions, Vote } from './vote' export const IProposalType = { @@ -69,7 +69,7 @@ export interface IProposalState extends IProposalStaticState { accountsWithUnclaimedRewards: Address[], boostedAt: Date contributionReward: ContributionReward.IContributionReward|null - // competition: Competition.ICompetitionProposal|null + competition: ICompetitionProposal|null confidenceThreshold: number closingAt: Date createdAt: Date @@ -115,6 +115,20 @@ export class Proposal implements IStateful { boostedAt closingAt confidenceThreshold + competition { + id + endTime + contract + suggestionsEndTime + createdAt + numberOfVotesPerVoters + numberOfWinners + rewardSplit + snapshotBlock + startTime + votingStartTime + + } contributionReward { id beneficiary @@ -169,19 +183,7 @@ export class Proposal implements IStateful { id } scheme { - id - paramsHash - name - address - canDelegateCall - canManageGlobalConstraints - canRegisterSchemes - canUpgradeController - name - numberOfQueuedProposals - numberOfPreBoostedProposals - numberOfBoostedProposals - version + ...SchemeFields } gpQueue { id @@ -221,41 +223,6 @@ export class Proposal implements IStateful { }` } - /** - * Proposal.create() creates a new proposal - * @param options cf. IProposalCreateOptions - * @param context [description] - * @return an observable that streams the various states - */ - public static create(options: IProposalCreateOptions, context: Arc): Operation { - - if (!options.dao) { - throw Error(`Proposal.create(options): options must include an address for "dao"`) - } - if (!options.scheme) { - throw Error(`Proposal.create(options): options must include an address for "scheme"`) - } - - const schemesQuery = Scheme.search( - context, - { where: { - address: options.scheme, - dao: options.dao - }} - ) - const observable = schemesQuery.pipe( - first(), - concatMap((schemes) => { - if (schemes && schemes.length > 0) { - return schemes[0].createProposal(options) - } else { - throw Error(`No scheme with address ${options.scheme} is registered with dao ${options.dao}`) - } - } - )) - return toIOperationObservable(observable) - } - /** * Search for proposals * @param options Search options, must implemeent IProposalQueryOptions @@ -324,6 +291,7 @@ export class Proposal implements IStateful { } } ${Proposal.fragments.ProposalFields} + ${Scheme.fragments.SchemeFields} ` return context.getObservableList( query, @@ -410,19 +378,26 @@ export class Proposal implements IStateful { } } ${Proposal.fragments.ProposalFields} + ${Scheme.fragments.SchemeFields} + ` const itemMap = (item: any): IProposalState|null => { if (item === null || item === undefined) { // no proposal was found - we return null + // throw Error(`No proposal with id ${this.id} could be found`) return null } let contributionReward: ContributionReward.IContributionReward|null = null + let competition: ICompetitionProposal|null = null let type: IProposalType let genericScheme: GenericScheme.IGenericScheme|null = null let schemeRegistrar: SchemeRegistrar.ISchemeRegistrar|null = null - if (item.contributionReward) { + if (!!item.competition && !item.contributionReward) { + throw Error(`Unexpected proposal state: competition is set, but contributionReward is not`) + } + if (!!item.contributionReward) { type = IProposalType.ContributionReward contributionReward = { alreadyRedeemedEthPeriods: Number(item.contributionReward.alreadyRedeemedEthPeriods), @@ -438,6 +413,22 @@ export class Proposal implements IStateful { periods: Number(item.contributionReward.periods), reputationReward: new BN(item.contributionReward.reputationReward) } + if (!!item.competition) { + competition = { + contract: item.competition.contract, + createdAt: secondSinceEpochToDate(item.competition.createdAt), + endTime: secondSinceEpochToDate(item.competition.endTime), + id: item.competition.id, + numberOfVotesPerVoter: Number(item.competition.numberOfVotesPerVoters), + numberOfWinners: Number(item.competition.numberOfWinners), + rewardSplit: item.competition.rewardSplit.map((perc: string) => Number(perc)), + snapshotBlock: item.competition.snapshotBlock, + startTime: secondSinceEpochToDate(item.competition.startTime), + suggestionsEndTime: secondSinceEpochToDate(item.competition.suggestionsEndTime), + votingStartTime: secondSinceEpochToDate(item.competition.votingStartTime) + } + + } } else if (item.genericScheme) { type = IProposalType.GenericScheme genericScheme = { @@ -504,28 +495,13 @@ export class Proposal implements IStateful { .sub(stakesAgainst) } const scheme = item.scheme - const schemeName = scheme.name || this.context.getContractInfo(scheme.address).name const gpQueue = item.gpQueue - const schemeState: ISchemeState = { - address: scheme.address, - canDelegateCall: scheme.canDelegateCall, - canManageGlobalConstraints: scheme.canManageGlobalConstraints, - canRegisterSchemes: scheme.canRegisterSchemes, - canUpgradeController: scheme.canUpgradeController, - dao: item.dao.id, - id: scheme.id, - name: schemeName, - numberOfBoostedProposals: Number(scheme.numberOfBoostedProposals), - numberOfPreBoostedProposals: Number(scheme.numberOfPreBoostedProposals), - numberOfQueuedProposals: Number(scheme.numberOfQueuedProposals), - paramsHash: scheme.paramsHash, - version: scheme.version - } + const schemeState = Scheme.itemMap(scheme, this.context) as ISchemeState const queueState: IQueueState = { dao: item.dao.id, id: gpQueue.id, - name: schemeName, + name: schemeState.name, scheme: schemeState, threshold, votingMachine: gpQueue.votingMachine @@ -535,6 +511,7 @@ export class Proposal implements IStateful { accountsWithUnclaimedRewards: item.accountsWithUnclaimedRewards, boostedAt: Number(item.boostedAt), closingAt: Number(item.closingAt), + competition, confidenceThreshold: Number(item.confidenceThreshold), contributionReward, createdAt: Number(item.createdAt), @@ -581,10 +558,14 @@ export class Proposal implements IStateful { return result } + /** + * @return the scheme Contract + */ public async scheme() { const schemeAddress = (await this.state().pipe(filter((o) => !!o), first()).toPromise()).scheme.address return this.context.getContract(schemeAddress) } + /** * [votingMachine description] * @return a web3 Contract instance @@ -785,13 +766,23 @@ export class Proposal implements IStateful { // we use a dummy contributionreward, as a workaround for https://github.com/daostack/arc/issues/655 schemeAddress = this.context.getContractInfoByName('ContributionReward', LATEST_ARC_VERSION).address } - const transaction = this.redeemerContract().methods.redeem( - schemeAddress, // contributionreward address - state.votingMachine, // genesisProtocol address - this.id, - state.dao.id, - beneficiary - ) + let transaction + if (state.scheme.name === 'ContributionRewardExt') { + transaction = this.redeemerContract().methods.redeemFromCRExt( + schemeAddress, // contributionreward address + state.votingMachine, // genesisProtocol address + this.id, + beneficiary + ) + } else { + transaction = this.redeemerContract().methods.redeem( + schemeAddress, // contributionreward address + state.votingMachine, // genesisProtocol address + this.id, + state.dao.id, + beneficiary + ) + } return this.context.sendTransaction(transaction, () => true) }) ) @@ -833,6 +824,7 @@ export class Proposal implements IStateful { ) return toIOperationObservable(observable) } + } enum ProposalQuerySortOptions { @@ -864,18 +856,22 @@ export interface IProposalQueryOptions extends ICommonQueryOptions { } } -interface IProposalBaseCreateOptions { +export interface IProposalBaseCreateOptions { dao: Address description?: string descriptionHash?: string title?: string tags?: string[] - scheme: Address + scheme?: Address url?: string + // proposalType?: 'competition' // if the scheme allows for different proposals... + proposalType?: string } export type IProposalCreateOptions = ( (IProposalBaseCreateOptions & GenericScheme.IProposalCreateOptionsGS ) | (IProposalBaseCreateOptions & SchemeRegistrar.IProposalCreateOptionsSR) | - (IProposalBaseCreateOptions & ContributionReward.IProposalCreateOptionsCR) + (IProposalBaseCreateOptions & ContributionReward.IProposalCreateOptionsCR) | + (ContributionRewardExt.IProposalCreateOptionsContributionRewardExt) | + (IProposalCreateOptionsCompetition) ) diff --git a/src/queue.ts b/src/queue.ts index c5e504da..7f803197 100644 --- a/src/queue.ts +++ b/src/queue.ts @@ -3,7 +3,7 @@ import gql from 'graphql-tag' import { Observable } from 'rxjs' import { Arc, IApolloQueryOptions } from './arc' import { DAO } from './dao' -import { ISchemeState } from './scheme' +import { ISchemeState, Scheme } from './scheme' import { Address, ICommonQueryOptions, IStateful } from './types' import { createGraphQlQuery, isAddress, realMathToNumber } from './utils' @@ -107,24 +107,13 @@ export class Queue implements IStateful { id } scheme { - id - address - name - dao { id } - canDelegateCall - canRegisterSchemes - canUpgradeController - canManageGlobalConstraints - paramsHash - numberOfBoostedProposals - numberOfPreBoostedProposals - numberOfQueuedProposals - version + ...SchemeFields } votingMachine threshold } } + ${Scheme.fragments.SchemeFields} ` const itemMap = (item: any): IQueueState => { @@ -132,26 +121,12 @@ export class Queue implements IStateful { throw Error(`No gpQueue with id ${this.id} was found`) } const threshold = realMathToNumber(new BN(item.threshold)) - const schemeName = item.scheme.name || this.context.getContractInfo(item.scheme.address).name + const scheme = Scheme.itemMap(item.scheme, this.context) as ISchemeState return { dao: item.dao.id, id: item.id, - name: schemeName, - scheme: { - address: item.scheme.address, - canDelegateCall: item.scheme.canDelegateCall, - canManageGlobalConstraints: item.scheme.canManageGlobalConstraints, - canRegisterSchemes: item.scheme.canRegisterSchemes, - canUpgradeController: item.scheme.canUpgradeController, - dao: item.dao.id, - id: item.scheme.id, - name: schemeName, - numberOfBoostedProposals: Number(item.scheme.numberOfBoostedProposals), - numberOfPreBoostedProposals: Number(item.scheme.numberOfPreBoostedProposals), - numberOfQueuedProposals: Number(item.scheme.numberOfQueuedProposals), - paramsHash: item.scheme.paramsHash, - version: item.scheme.version - }, + name: scheme.name, + scheme, threshold, votingMachine: item.votingMachine } diff --git a/src/scheme.ts b/src/scheme.ts index 267aee68..c19675c6 100644 --- a/src/scheme.ts +++ b/src/scheme.ts @@ -1,16 +1,22 @@ import gql from 'graphql-tag' import { Observable } from 'rxjs' -import { first } from 'rxjs/operators' +// import { first } from 'rxjs/operators' import { Arc, IApolloQueryOptions } from './arc' import { IGenesisProtocolParams, mapGenesisProtocolParams } from './genesisProtocol' import { Operation, toIOperationObservable } from './operation' import { IProposalCreateOptions, IProposalQueryOptions, Proposal } from './proposal' +import { SchemeBase } from './schemes/base' +import { CompetitionScheme, isCompetitionScheme } from './schemes/competition' +import * as Competition from './schemes/competition' import * as ContributionReward from './schemes/contributionReward' +import * as ContributionRewardExt from './schemes/contributionRewardExt' import * as GenericScheme from './schemes/genericScheme' import { ReputationFromTokenScheme } from './schemes/reputationFromToken' import * as SchemeRegistrar from './schemes/schemeRegistrar' import * as UGenericScheme from './schemes/uGenericScheme' -import { Address, ICommonQueryOptions, IStateful } from './types' +// import { DAO } from './dao' +// import { IStateful } from './types' +import { Address, ICommonQueryOptions } from './types' import { createGraphQlQuery } from './utils' export interface ISchemeStaticState { @@ -30,6 +36,7 @@ export interface ISchemeState extends ISchemeStaticState { dao: Address paramsHash: string contributionRewardParams?: IContributionRewardParams + contributionRewardExtParams?: IContributionRewardExtParams genericSchemeParams?: IGenericSchemeParams schemeRegistrarParams?: { votingMachine: Address @@ -40,7 +47,7 @@ export interface ISchemeState extends ISchemeStaticState { numberOfPreBoostedProposals: number numberOfBoostedProposals: number uGenericSchemeParams?: IGenericSchemeParams - schemeParams?: IGenericSchemeParams | IContributionRewardParams | ISchemeRegisterParams + schemeParams?: IGenericSchemeParams | IContributionRewardParams | IContributionRewardExtParams | ISchemeRegisterParams } export interface IGenericSchemeParams { @@ -53,6 +60,11 @@ export interface IContributionRewardParams { votingMachine: Address voteParams: IGenesisProtocolParams } +export interface IContributionRewardExtParams { + votingMachine: Address + voteParams: IGenesisProtocolParams + rewarder: Address +} export interface ISchemeRegisterParams { votingMachine: Address @@ -93,114 +105,8 @@ export interface ISchemeQueryOptions extends ICommonQueryOptions { /** * A Scheme represents a scheme instance that is registered at a DAO */ -export class Scheme implements IStateful { - public static fragments = { - SchemeFields: gql` - fragment SchemeFields on ControllerScheme { - id - address - name - dao { id } - canDelegateCall - canRegisterSchemes - canUpgradeController - canManageGlobalConstraints - paramsHash - contributionRewardParams { - votingMachine - voteParams { - queuedVoteRequiredPercentage - queuedVotePeriodLimit - boostedVotePeriodLimit - preBoostedVotePeriodLimit - thresholdConst - limitExponentValue - quietEndingPeriod - proposingRepReward - votersReputationLossRatio - minimumDaoBounty - daoBountyConst - activationTime - voteOnBehalf - } - } - 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 - }` - } +export class Scheme extends SchemeBase { + /** * Scheme.search(context, options) searches for scheme entities * @param context an Arc instance that provides connection information @@ -211,7 +117,7 @@ export class Scheme implements IStateful { context: Arc, options: ISchemeQueryOptions = {}, apolloQueryOptions: IApolloQueryOptions = {} - ): Observable { + ): Observable> { let query if (apolloQueryOptions.fetchAllData === true) { query = gql`query SchemeSearchAllData { @@ -220,7 +126,7 @@ export class Scheme implements IStateful { ...SchemeFields } } - ${Scheme.fragments.SchemeFields}` + ${SchemeBase.fragments.SchemeFields}` } else { query = gql`query SchemeSearch { controllerSchemes ${createGraphQlQuery(options)} @@ -231,22 +137,36 @@ export class Scheme implements IStateful { dao { id } paramsHash version + contributionRewardExtParams { + id + rewarder + } } }` } const itemMap = (item: any): Scheme|null => { if (!options.where) { options.where = {}} - - const scheme = new Scheme({ - address: item.address, - dao: item.dao.id, - id: item.id, - name: item.name, - paramsHash: item.paramsHash, - version: item.version - }, context) - return scheme + if (isCompetitionScheme(context, item)) { + return new Competition.CompetitionScheme({ + address: item.address, + dao: item.dao.id, + id: item.id, + name: item.name, + paramsHash: item.paramsHash, + version: item.version + }, context) + } else { + const scheme = new Scheme({ + address: item.address, + dao: item.dao.id, + id: item.id, + name: item.name, + paramsHash: item.paramsHash, + version: item.version + }, context) + return scheme + } } return context.getObservableList( @@ -256,11 +176,90 @@ export class Scheme implements IStateful { ) as Observable } + /** + * map an apollo query result to ISchemeState + * + * @static + * @param {*} item + * @param {Arc} arc + * @returns {(ISchemeState|null)} + * @memberof Scheme + */ + public static itemMap(item: any, arc: Arc): ISchemeState|null { + if (!item) { + return null + } + + let name = item.name + if (!name) { + + try { + name = arc.getContractInfo(item.address).name + } catch (err) { + if (err.message.match(/no contract/ig)) { + // continue + } else { + throw err + } + } + } + const uGenericSchemeParams = item.uGenericSchemeParams && { + contractToCall: item.uGenericSchemeParams.contractToCall, + voteParams: mapGenesisProtocolParams(item.uGenericSchemeParams.voteParams), + votingMachine: item.uGenericSchemeParams.votingMachine + } + const contributionRewardParams = item.contributionRewardParams && { + voteParams: mapGenesisProtocolParams(item.contributionRewardParams.voteParams), + votingMachine: item.contributionRewardParams.votingMachine + } + const contributionRewardExtParams = item.contributionRewardExtParams && { + rewarder: item.contributionRewardExtParams.rewarder, + voteParams: mapGenesisProtocolParams(item.contributionRewardExtParams.voteParams), + votingMachine: item.contributionRewardExtParams.votingMachine + } + const schemeRegistrarParams = item.schemeRegistrarParams && { + voteRegisterParams: mapGenesisProtocolParams(item.schemeRegistrarParams.voteRegisterParams), + voteRemoveParams: mapGenesisProtocolParams(item.schemeRegistrarParams.voteRemoveParams), + votingMachine: item.schemeRegistrarParams.votingMachine + } + const genericSchemeParams = item.genericSchemeParams && { + contractToCall: item.genericSchemeParams.contractToCall, + voteParams: mapGenesisProtocolParams(item.genericSchemeParams.voteParams), + votingMachine: item.genericSchemeParams.votingMachine + } + const schemeParams = ( + uGenericSchemeParams || contributionRewardParams || + schemeRegistrarParams || genericSchemeParams || contributionRewardExtParams + ) + return { + address: item.address, + canDelegateCall: item.canDelegateCall, + canManageGlobalConstraints: item.canManageGlobalConstraints, + canRegisterSchemes: item.canRegisterSchemes, + canUpgradeController: item.canUpgradeController, + contributionRewardExtParams, + contributionRewardParams, + dao: item.dao.id, + genericSchemeParams, + id: item.id, + name, + numberOfBoostedProposals: Number(item.numberOfBoostedProposals), + numberOfPreBoostedProposals: Number(item.numberOfPreBoostedProposals), + numberOfQueuedProposals: Number(item.numberOfQueuedProposals), + paramsHash: item.paramsHash, + schemeParams, + schemeRegistrarParams, + uGenericSchemeParams, + version: item.version + } + } + public id: Address public staticState: ISchemeStaticState | null = null public ReputationFromToken: ReputationFromTokenScheme | null = null constructor(idOrOpts: Address | ISchemeStaticState, public context: Arc) { + super(idOrOpts, context) this.context = context if (typeof idOrOpts === 'string') { this.id = idOrOpts as string @@ -275,33 +274,6 @@ export class Scheme implements IStateful { this.staticState = opts } - /** - * fetch the static state from the subgraph - * @return the statatic state - */ - public async fetchStaticState(): Promise < ISchemeStaticState > { - if (!!this.staticState) { - return this.staticState - } else { - const state = await this.state({ subscribe: false}).pipe(first()).toPromise() - if (state === null) { - throw Error(`No scheme with id ${this.id} was found in the subgraph`) - } - this.staticState = { - address: state.address, - dao: state.dao, - id: this.id, - name: state.name, - paramsHash: state.paramsHash, - version: state.version - } - if (this.staticState.name === 'ReputationFromToken') { - this.ReputationFromToken = new ReputationFromTokenScheme(this) - } - return state - } - } - public state(apolloQueryOptions: IApolloQueryOptions = {}): Observable { const query = gql`query SchemeState { @@ -309,137 +281,91 @@ export class Scheme implements IStateful { ...SchemeFields } } - ${Scheme.fragments.SchemeFields} + ${SchemeBase.fragments.SchemeFields} ` + const itemMap = (item: any) => Scheme.itemMap(item, this.context) + return this.context.getObservableObject(query, itemMap, apolloQueryOptions) as Observable + } - const itemMap = (item: any): ISchemeState|null => { - if (!item) { - return null - } - - let name = item.name - if (!name) { + /** + * create a new proposal in this Scheme + * @param options [description ] + * @return a Proposal instance + */ + public createProposal(options: IProposalCreateOptions): Operation { + const observable = Observable.create(async (observer: any) => { + let msg: string + const context = this.context + let createTransaction: () => any = () => null + let map: any + const errHandler = (err: Error) => err + const state = await this.fetchStaticState() - try { - name = this.context.getContractInfo(item.address).name - } catch (err) { - if (err.message.match(/no contract/ig)) { - // continue + switch (state.name) { + case 'ContributionReward': + createTransaction = ContributionReward.createProposal(options, this.context) + map = ContributionReward.createTransactionMap(options, this.context) + break + case 'ContributionRewardExt': + // TODO: ContributionRewardExt can also be used to create a Competition proposal + // For now, we explicitly pass this in the options, but in reality (once 36-4 is released) we + // should be able to sniff this: if the rewarder of the scheme is a Contribution.sol instance.... + if (options.proposalType === 'competition') { + const competitionScheme = new CompetitionScheme(this.id, this.context) + return competitionScheme.createProposal(options as Competition.IProposalCreateOptionsCompetition) + // createTransaction = competitionScheme.createProposal(options, this.context) + // map = Competition.createTransactionMap(options, this.context), + // errHandler = Competition.createProposalErrorHandler } else { - throw err + createTransaction = ContributionRewardExt.createProposal(options, this.context) + map = ContributionRewardExt.createTransactionMap(options, this.context) } - } - } - const uGenericSchemeParams = item.uGenericSchemeParams && { - contractToCall: item.uGenericSchemeParams.contractToCall, - voteParams: mapGenesisProtocolParams(item.uGenericSchemeParams.voteParams), - votingMachine: item.uGenericSchemeParams.votingMachine - } - const contributionRewardParams = item.contributionRewardParams && { - voteParams: mapGenesisProtocolParams(item.contributionRewardParams.voteParams), - votingMachine: item.contributionRewardParams.votingMachine - } - const schemeRegistrarParams = item.schemeRegistrarParams && { - voteRegisterParams: mapGenesisProtocolParams(item.schemeRegistrarParams.voteRegisterParams), - voteRemoveParams: mapGenesisProtocolParams(item.schemeRegistrarParams.voteRemoveParams), - votingMachine: item.schemeRegistrarParams.votingMachine - } - const genericSchemeParams = item.genericSchemeParams && { - contractToCall: item.genericSchemeParams.contractToCall, - voteParams: mapGenesisProtocolParams(item.genericSchemeParams.voteParams), - votingMachine: item.genericSchemeParams.votingMachine - } - const schemeParams = ( - uGenericSchemeParams || contributionRewardParams || schemeRegistrarParams || genericSchemeParams - ) - return { - address: item.address, - canDelegateCall: item.canDelegateCall, - canManageGlobalConstraints: item.canManageGlobalConstraints, - canRegisterSchemes: item.canRegisterSchemes, - canUpgradeController: item.canUpgradeController, - contributionRewardParams, - dao: item.dao.id, - genericSchemeParams, - id: item.id, - name, - numberOfBoostedProposals: Number(item.numberOfBoostedProposals), - numberOfPreBoostedProposals: Number(item.numberOfPreBoostedProposals), - numberOfQueuedProposals: Number(item.numberOfQueuedProposals), - paramsHash: item.paramsHash, - schemeParams, - schemeRegistrarParams, - uGenericSchemeParams, - version: item.version - } - } - return this.context.getObservableObject(query, itemMap, apolloQueryOptions) as Observable - } - - /** - * create a new proposal in this DAO - * TODO: move this to the schemes - we should call proposal.scheme.createProposal - * @param options [description ] - * @return a Proposal instance - */ - public createProposal(options: IProposalCreateOptions): Operation { - const observable = Observable.create(async (observer: any) => { - let msg: string - const context = this.context - let createTransaction: () => any = () => null - let map: any - const state = await this.fetchStaticState() + break - switch (state.name) { - case 'ContributionReward': - createTransaction = ContributionReward.createTransaction(options, this.context) - map = ContributionReward.createTransactionMap(options, this.context) + case 'UGenericScheme': + createTransaction = UGenericScheme.createTransaction(options, this.context) + map = UGenericScheme.createTransactionMap(options, this.context) break - case 'UGenericScheme': - createTransaction = UGenericScheme.createTransaction(options, this.context) - map = UGenericScheme.createTransactionMap(options, this.context) - break - - case 'GenericScheme': - const versionNumber = Number(state.version.split('rc.')[1]) - if (versionNumber < 23) { - // the pre-24 " GenericScheme" contracts have beeen renamed to UGenericScheme - createTransaction = UGenericScheme.createTransaction(options, this.context) - map = UGenericScheme.createTransactionMap(options, this.context) - break - } else { - createTransaction = GenericScheme.createTransaction(options, this.context) - map = GenericScheme.createTransactionMap(options, this.context) - break - } - - case 'SchemeRegistrar': - createTransaction = SchemeRegistrar.createTransaction(options, this.context) - map = SchemeRegistrar.createTransactionMap(options, this.context) + case 'GenericScheme': + const versionNumber = Number(state.version.split('rc.')[1]) + if (versionNumber < 23) { + // the pre-24 " GenericScheme" contracts have beeen renamed to UGenericScheme + createTransaction = UGenericScheme.createTransaction(options, this.context) + map = UGenericScheme.createTransactionMap(options, this.context) + break + } else { + createTransaction = GenericScheme.createTransaction(options, this.context) + map = GenericScheme.createTransactionMap(options, this.context) break + } - default: - msg = `Unknown proposal scheme: '${state.name}'` - throw Error(msg) - } + case 'SchemeRegistrar': + createTransaction = SchemeRegistrar.createTransaction(options, this.context) + map = SchemeRegistrar.createTransactionMap(options, this.context) + break - const sendTransactionObservable = context.sendTransaction(createTransaction, map) - const sub = sendTransactionObservable.subscribe(observer) + default: + msg = `Unknown proposal scheme: '${state.name}'` + msg = `${state.name} ${state.name === 'ContributionRewardExt'}` + throw Error(msg) + } - return () => sub.unsubscribe() - }) + const sendTransactionObservable = context.sendTransaction(createTransaction, map, errHandler) + const sub = sendTransactionObservable.subscribe(observer) - return toIOperationObservable(observable) - } + return () => sub.unsubscribe() + }) - public proposals( - options: IProposalQueryOptions = {}, - apolloQueryOptions: IApolloQueryOptions = {} - ): Observable { - if (!options.where) { options.where = {}} - options.where.scheme = this.id - return Proposal.search(this.context, options, apolloQueryOptions) - } + return toIOperationObservable(observable) + } + public proposals( + options: IProposalQueryOptions = {}, + apolloQueryOptions: IApolloQueryOptions = {} + ): Observable { + if (!options.where) { options.where = {}} + options.where.scheme = this.id + return Proposal.search(this.context, options, apolloQueryOptions) + } } diff --git a/src/schemes/base.ts b/src/schemes/base.ts new file mode 100644 index 00000000..cd5f539d --- /dev/null +++ b/src/schemes/base.ts @@ -0,0 +1,476 @@ +import gql from 'graphql-tag' +import { Observable } from 'rxjs' +import { first } from 'rxjs/operators' +import { Arc, IApolloQueryOptions } from '../arc' +// import { DAO } from './dao' +import { IGenesisProtocolParams } from '../genesisProtocol' +import { Operation, toIOperationObservable } from '../operation' +import { + IProposalCreateOptions, + IProposalQueryOptions, Proposal } from '../proposal' +import { Address, ICommonQueryOptions, IStateful } from '../types' +// import * as ContributionReward from './contributionReward' +// import * as ContributionRewardExt from './schemes/contributionRewardExt' +// import * as GenericScheme from './genericScheme' +import { ReputationFromTokenScheme } from './reputationFromToken' +// import * as SchemeRegistrar from './schemeRegistrar' +// import * as UGenericScheme from './uGenericScheme' + +export interface ISchemeStaticState { + id: string + address: Address + dao: Address + name: string + paramsHash: string + version: string +} + +export interface ISchemeState extends ISchemeStaticState { + canDelegateCall: boolean + canRegisterSchemes: boolean + canUpgradeController: boolean + canManageGlobalConstraints: boolean + dao: Address + paramsHash: string + contributionRewardParams?: IContributionRewardParams + contributionRewardExtParams?: IContributionRewardExtParams + genericSchemeParams?: IGenericSchemeParams + schemeRegistrarParams?: { + votingMachine: Address + voteRemoveParams: IGenesisProtocolParams + voteRegisterParams: IGenesisProtocolParams + } | null + numberOfQueuedProposals: number + numberOfPreBoostedProposals: number + numberOfBoostedProposals: number + uGenericSchemeParams?: IGenericSchemeParams + schemeParams?: IGenericSchemeParams | IContributionRewardParams | IContributionRewardExtParams | ISchemeRegisterParams +} + +export interface IGenericSchemeParams { + votingMachine: Address + contractToCall: Address + voteParams: IGenesisProtocolParams +} + +export interface IContributionRewardParams { + votingMachine: Address + voteParams: IGenesisProtocolParams +} +export interface IContributionRewardExtParams { + votingMachine: Address + voteParams: IGenesisProtocolParams + rewarder: Address +} + +export interface ISchemeRegisterParams { + votingMachine: Address + contractToCall: Address + voteParams: IGenesisProtocolParams +} + +export interface ISchemeQueryOptions extends ICommonQueryOptions { + where?: { + address?: Address + canDelegateCall?: boolean + canRegisterSchemes?: boolean + canUpgradeController?: boolean + canManageGlobalConstraints?: boolean + dao?: Address + id?: string + name?: string + paramsHash?: string + [key: string]: any + } +} + +export interface ISchemeQueryOptions extends ICommonQueryOptions { + where?: { + address?: Address + canDelegateCall?: boolean + canRegisterSchemes?: boolean + canUpgradeController?: boolean + canManageGlobalConstraints?: boolean + dao?: Address + id?: string + name?: string + paramsHash?: string + [key: string]: any + } +} + +/** + * A Scheme represents a scheme instance that is registered at a DAO + */ +export abstract class SchemeBase implements IStateful { + public static fragments = { + SchemeFields: 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 + }` + } + + public id: Address + public staticState: ISchemeStaticState | null = null + public ReputationFromToken: ReputationFromTokenScheme | null = null + + constructor(idOrOpts: Address | ISchemeStaticState, public context: Arc) { + this.context = context + if (typeof idOrOpts === 'string') { + this.id = idOrOpts as string + this.id = this.id.toLowerCase() + } else { + this.setStaticState(idOrOpts) + this.id = (this.staticState as ISchemeStaticState).id + } + } + + /** + * fetch the static state from the subgraph + * @return the statatic state + */ + public async fetchStaticState(): Promise < ISchemeStaticState > { + if (!!this.staticState) { + return this.staticState + } else { + const state = await this.state({ subscribe: false}).pipe(first()).toPromise() + if (state === null) { + throw Error(`No scheme with id ${this.id} was found in the subgraph`) + } + this.staticState = { + address: state.address, + dao: state.dao, + id: this.id, + name: state.name, + paramsHash: state.paramsHash, + version: state.version + } + if (this.staticState.name === 'ReputationFromToken') { + this.ReputationFromToken = new ReputationFromTokenScheme(this) + } + return state + } + } + + public setStaticState(opts: ISchemeStaticState) { + this.staticState = opts + } + /** + * create a new proposal in this scheme + * TODO: move this to the schemes - we should call proposal.scheme.createProposal + * @param options [description ] + * @return a Proposal instance + */ + public createProposalTransaction(options: any): () => Promise { + return async () => null + } + + public createProposalTransactionMap(): (receipt: any) => any { + + return (receipt) => receipt.result + } + public createProposalErrorHandler(options?: any): (err: Error) => Error|Promise { + return (err) => err + } + + public createProposal(options: IProposalCreateOptions): Operation { + const observable = Observable.create(async (observer: any) => { + // let msg: string + const context = this.context + + const createTransaction = this.createProposalTransaction(options) + const map = this.createProposalTransactionMap() + const errHandler = this.createProposalErrorHandler(options) + const sendTransactionObservable = context.sendTransaction(createTransaction, map, errHandler) + const sub = sendTransactionObservable.subscribe(observer) + + return () => sub.unsubscribe() + }) + + return toIOperationObservable(observable) + } + + public abstract state(apolloQueryOptions: IApolloQueryOptions): Observable < ISchemeState > + + public x() { + + // const query = gql`query SchemeState + // { + // controllerScheme (id: "${this.id}") { + // ...SchemeFields + // } + // } + // ${SchemeBase.fragments.SchemeFields} + // ` + + // const itemMap = (item: any): ISchemeState|null => { + // if (!item) { + // return null + // } + + // let name = item.name + // if (!name) { + + // try { + // name = this.context.getContractInfo(item.address).name + // } catch (err) { + // if (err.message.match(/no contract/ig)) { + // // continue + // } else { + // throw err + // } + // } + // } + // const uGenericSchemeParams = item.uGenericSchemeParams && { + // contractToCall: item.uGenericSchemeParams.contractToCall, + // voteParams: mapGenesisProtocolParams(item.uGenericSchemeParams.voteParams), + // votingMachine: item.uGenericSchemeParams.votingMachine + // } + // const contributionRewardParams = item.contributionRewardParams && { + // voteParams: mapGenesisProtocolParams(item.contributionRewardParams.voteParams), + // votingMachine: item.contributionRewardParams.votingMachine + // } + // const contributionRewardExtParams = item.contributionRewardExtParams && { + // rewarder: item.contributionRewardExtParams.rewarder, + // voteParams: mapGenesisProtocolParams(item.contributionRewardExtParams.voteParams), + // votingMachine: item.contributionRewardExtParams.votingMachine + // } + // const schemeRegistrarParams = item.schemeRegistrarParams && { + // voteRegisterParams: mapGenesisProtocolParams(item.schemeRegistrarParams.voteRegisterParams), + // voteRemoveParams: mapGenesisProtocolParams(item.schemeRegistrarParams.voteRemoveParams), + // votingMachine: item.schemeRegistrarParams.votingMachine + // } + // const genericSchemeParams = item.genericSchemeParams && { + // contractToCall: item.genericSchemeParams.contractToCall, + // voteParams: mapGenesisProtocolParams(item.genericSchemeParams.voteParams), + // votingMachine: item.genericSchemeParams.votingMachine + // } + // const schemeParams = ( + // uGenericSchemeParams || contributionRewardParams || + // schemeRegistrarParams || genericSchemeParams || contributionRewardExtParams + // ) + // return { + // address: item.address, + // canDelegateCall: item.canDelegateCall, + // canManageGlobalConstraints: item.canManageGlobalConstraints, + // canRegisterSchemes: item.canRegisterSchemes, + // canUpgradeController: item.canUpgradeController, + // contributionRewardExtParams, + // contributionRewardParams, + // dao: item.dao.id, + // genericSchemeParams, + // id: item.id, + // name, + // numberOfBoostedProposals: Number(item.numberOfBoostedProposals), + // numberOfPreBoostedProposals: Number(item.numberOfPreBoostedProposals), + // numberOfQueuedProposals: Number(item.numberOfQueuedProposals), + // paramsHash: item.paramsHash, + // schemeParams, + // schemeRegistrarParams, + // uGenericSchemeParams, + // version: item.version + // } + // } + // return this.context.getObservableObject(query, itemMap, apolloQueryOptions) as Observable + } + + // public xxcreateProposal(options: IProposalCreateOptions): Operation { + // const observable = Observable.create(async (observer: any) => { + // let msg: string + // const context = this.context + // let createTransaction: () => any = () => null + // let map: any + // const errHandler = (err: Error) => err + // const state = await this.fetchStaticState() + + // switch (state.name) { + // case 'ContributionReward': + // createTransaction = ContributionReward.createProposal(options, this.context) + // map = ContributionReward.createTransactionMap(options, this.context) + // break + // case 'ContributionRewardExt': + // // TODO: ContributionRewardExt can also be used to create a Competition proposal + // // For now, we explicitly pass this in the options, but in reality (once 36-4 is released) we + // // should be able to sniff this: if the rewarder of the scheme is a Contribution.sol instance.... + // // if (options.proposalType === 'competition') { + // // createTransaction = Competition.createProposal(options, this.context) + // // map = Competition.createTransactionMap(options, this.context), + // // errHandler = Competition.createProposalErrorHandler + // // } else { + // // createTransaction = ContributionRewardExt.createProposal(options, this.context) + // // map = ContributionRewardExt.createTransactionMap(options, this.context) + // // } + // // break + + // case 'UGenericScheme': + // createTransaction = UGenericScheme.createTransaction(options, this.context) + // map = UGenericScheme.createTransactionMap(options, this.context) + // break + + // case 'GenericScheme': + // const versionNumber = Number(state.version.split('rc.')[1]) + // if (versionNumber < 23) { + // // the pre-24 " GenericScheme" contracts have beeen renamed to UGenericScheme + // createTransaction = UGenericScheme.createTransaction(options, this.context) + // map = UGenericScheme.createTransactionMap(options, this.context) + // break + // } else { + // createTransaction = GenericScheme.createTransaction(options, this.context) + // map = GenericScheme.createTransactionMap(options, this.context) + // break + // } + + // case 'SchemeRegistrar': + // createTransaction = SchemeRegistrar.createTransaction(options, this.context) + // map = SchemeRegistrar.createTransactionMap(options, this.context) + // break + + // default: + // msg = `Unknown proposal scheme: '${state.name}'` + // msg = `${state.name} ${state.name === 'ContributionRewardExt'}` + // throw Error(msg) + // } + + // const sendTransactionObservable = context.sendTransaction(createTransaction, map, errHandler) + // const sub = sendTransactionObservable.subscribe(observer) + + // return () => sub.unsubscribe() + // }) + + // return toIOperationObservable(observable) + // } + + public proposals( + options: IProposalQueryOptions = {}, + apolloQueryOptions: IApolloQueryOptions = {} + ): Observable < Proposal[] > { + if (!options.where) { options.where = {}} + options.where.scheme = this.id + return Proposal.search(this.context, options, apolloQueryOptions) + } + +} diff --git a/src/schemes/competition.ts b/src/schemes/competition.ts new file mode 100644 index 00000000..e7a5db39 --- /dev/null +++ b/src/schemes/competition.ts @@ -0,0 +1,774 @@ +import BN = require('bn.js') +import gql from 'graphql-tag' +import { Observable } from 'rxjs' +import { concatMap, first, map } from 'rxjs/operators' +import { Arc } from '../arc' +import { DAO } from '../dao' +import { mapGenesisProtocolParams } from '../genesisProtocol' +import { IApolloQueryOptions } from '../graphnode' +import { Operation, toIOperationObservable } from '../operation' +import { IProposalBaseCreateOptions, IProposalQueryOptions, Proposal } from '../proposal' +import { Address, ICommonQueryOptions } from '../types' +import { concat, + createGraphQlQuery, dateToSecondsSinceEpoch, getBlockTime, + hexStringToUint8Array, + NULL_ADDRESS, + secondSinceEpochToDate +} from '../utils' +import { ISchemeState, SchemeBase } from './base' + +const Web3 = require('web3') + +export interface ICompetitionProposal { + id: string + contract: Address + endTime: Date + numberOfWinners: number + rewardSplit: number[] + startTime: Date + votingStartTime: Date + suggestionsEndTime: Date + numberOfVotesPerVoter: number + snapshotBlock: number + createdAt: Date, + } + +export interface IProposalCreateOptionsCompetition extends IProposalBaseCreateOptions { + // beneficiary: Address + endTime: Date, + reputationReward ?: BN + ethReward ?: BN + externalTokenReward ?: BN + externalTokenAddress ?: Address + // proposer: Address, + rewardSplit: number[] + nativeTokenReward ?: BN + numberOfVotesPerVoter: number + startTime: Date|null, + suggestionsEndTime: Date, + votingStartTime: Date, +} + +export interface ICompetitionSuggestion { + id: string + suggestionId: number + proposal: string + descriptionHash: string + title?: string + description?: string + url?: string + // fulltext: [string] + suggester: Address + // votes: [CompetitionVote!] @derivedFrom(field: "suggestion") + totalVotes: BN + createdAt: Date + redeemedAt: Date|null + rewardPercentage: number +} + +export interface ICompetitionVote { + id?: string + // proposal: CompetitionProposal! + // suggestion: CompetitionSuggestion! + voter: Address + createdAt?: Date + reputation: BN +} + +// export enum IProposalType { +// ContributionReward = 'ContributionRewardExt' // propose a contributionReward +// } + +export class CompetitionScheme extends SchemeBase { + public state(apolloQueryOptions: IApolloQueryOptions = {}): Observable { + const query = gql`query SchemeState + { + controllerScheme (id: "${this.id}") { + ...SchemeFields + } + } + ${SchemeBase.fragments.SchemeFields} + ` + + const itemMap = (item: any): ISchemeState|null => { + if (!item) { + return null + } + + let name = item.name + if (!name) { + + try { + name = this.context.getContractInfo(item.address).name + } catch (err) { + if (err.message.match(/no contract/ig)) { + // continue + } else { + throw err + } + } + } + const uGenericSchemeParams = item.uGenericSchemeParams && { + contractToCall: item.uGenericSchemeParams.contractToCall, + voteParams: mapGenesisProtocolParams(item.uGenericSchemeParams.voteParams), + votingMachine: item.uGenericSchemeParams.votingMachine + } + const contributionRewardParams = item.contributionRewardParams && { + voteParams: mapGenesisProtocolParams(item.contributionRewardParams.voteParams), + votingMachine: item.contributionRewardParams.votingMachine + } + const contributionRewardExtParams = item.contributionRewardExtParams && { + rewarder: item.contributionRewardExtParams.rewarder, + voteParams: mapGenesisProtocolParams(item.contributionRewardExtParams.voteParams), + votingMachine: item.contributionRewardExtParams.votingMachine + } + const schemeRegistrarParams = item.schemeRegistrarParams && { + voteRegisterParams: mapGenesisProtocolParams(item.schemeRegistrarParams.voteRegisterParams), + voteRemoveParams: mapGenesisProtocolParams(item.schemeRegistrarParams.voteRemoveParams), + votingMachine: item.schemeRegistrarParams.votingMachine + } + const genericSchemeParams = item.genericSchemeParams && { + contractToCall: item.genericSchemeParams.contractToCall, + voteParams: mapGenesisProtocolParams(item.genericSchemeParams.voteParams), + votingMachine: item.genericSchemeParams.votingMachine + } + const schemeParams = ( + uGenericSchemeParams || contributionRewardParams || + schemeRegistrarParams || genericSchemeParams || contributionRewardExtParams + ) + return { + address: item.address, + canDelegateCall: item.canDelegateCall, + canManageGlobalConstraints: item.canManageGlobalConstraints, + canRegisterSchemes: item.canRegisterSchemes, + canUpgradeController: item.canUpgradeController, + contributionRewardExtParams, + contributionRewardParams, + dao: item.dao.id, + genericSchemeParams, + id: item.id, + name, + numberOfBoostedProposals: Number(item.numberOfBoostedProposals), + numberOfPreBoostedProposals: Number(item.numberOfPreBoostedProposals), + numberOfQueuedProposals: Number(item.numberOfQueuedProposals), + paramsHash: item.paramsHash, + schemeParams, + schemeRegistrarParams, + uGenericSchemeParams, + version: item.version + } + } + return this.context.getObservableObject(query, itemMap, apolloQueryOptions) as Observable + } + /** + * Return a list of competitions in this scheme. + * @param options + * @param apolloQueryOptions + */ + public competitions( + options: IProposalQueryOptions = {}, + apolloQueryOptions: IApolloQueryOptions = {} + ): Observable { + // TODO: This function will error if the current scheme is not a competiion scheme + // const staticState = await this.fetchStaticState() + // if (staticState.name !== `ContributionRewardExt`) { + // // TODO: we should also check if the calling + // throw Error(`This scheme is not a competition scheme - so no competitions can be found`) + // } + if (!options.where) { options.where = {}} + options.where = { ...options.where, competition_not: null} + return Competition.search(this.context, options, apolloQueryOptions) + } + + /** + * + * @param options + * @param context + */ + public createProposalTransaction(options: IProposalCreateOptionsCompetition) { + // we assume this function is called with the correct scheme options.. + return async () => { + const context = this.context + const schemeState = await this.state().pipe(first()).toPromise() + if (!schemeState) { + throw Error(`No scheme was found with this id: ${this.id}`) + } + const contract = getCompetitionContract(schemeState, this.context) + + // check sanity -- is the competition contract actually c + const contributionRewardExtAddress = await contract.methods.contributionRewardExt().call() + if (contributionRewardExtAddress.toLowerCase() !== schemeState.address) { + throw Error(`This ContributionRewardExt/Competition combo is malconfigured: expected ${contributionRewardExtAddress.toLowerCase()} to equal ${schemeState.address}`) + } + + options.descriptionHash = await context.saveIPFSData(options) + if (!options.rewardSplit) { + throw Error(`Rewardsplit was not given..`) + } else { + if (options.rewardSplit.reduce((a: number, b: number) => a + b) !== 100) { + throw Error(`Rewardsplit must sum 100 (they sum to ${options.rewardSplit.reduce((a: number, b: number) => a + b) })`) + } + } + // * @param _rewardSplit an array of precentages which specify how to split the rewards + // * between the winning suggestions + // * @param _competitionParams competition parameters : + // * _competitionParams[0] - competition startTime + // * _competitionParams[1] - _votingStartTime competition voting start time + // * _competitionParams[2] - _endTime competition end time + // * _competitionParams[3] - _maxNumberOfVotesPerVoter on how many suggestions a voter can vote + // * _competitionParams[4] - _suggestionsEndTime suggestion submition end time + // * _competitionParams[4] - _suggestionsEndTime suggestion submition end time + + const competitionParams = [ + options.startTime && dateToSecondsSinceEpoch(options.startTime) || '0', + dateToSecondsSinceEpoch(options.votingStartTime) || 0, + dateToSecondsSinceEpoch(options.endTime) || 0, + options.numberOfVotesPerVoter.toString() || 0, + dateToSecondsSinceEpoch(options.suggestionsEndTime) || 0 + ] + + const transaction = contract.methods.proposeCompetition( + options.descriptionHash || '', + options.reputationReward && options.reputationReward.toString() || 0, + [ + options.nativeTokenReward && options.nativeTokenReward.toString() || 0, + options.ethReward && options.ethReward.toString() || 0, + options.externalTokenReward && options.externalTokenReward.toString() || 0 + ], + options.externalTokenAddress || NULL_ADDRESS, + options.rewardSplit, + competitionParams + ) + return transaction + } + } + public createProposalTransactionMap() { + const eventName = 'NewCompetitionProposal' + const txMap = (receipt: any) => { + const proposalId = receipt.events[eventName].returnValues._proposalId + return new Proposal(proposalId, this.context) + } + return txMap + } + + public createProposalErrorHandler(options: any): (err: Error) => Error|Promise { + return async (err) => { + const tx = await this.createProposalTransaction(options)() + try { + await tx.call() + } catch (err) { + if (err.message.match(/startTime should be greater than proposing time/ig)) { + return Error(`${err.message} - startTime is ${options.startTime}, current block time is ${await getBlockTime(this.context.web3)}`) + } else { + return err + } + } + const msg = `Error creating proposal with options ${options}: ${err.message}` + return Error(msg) + } + } + + public createProposal(options: IProposalCreateOptionsCompetition): Operation { + return SchemeBase.prototype.createProposal.call(this, options) + } + + public voteSuggestion(options: { + suggestionId: number // this is the suggestion COUNTER + }): Operation { + const createTransaction = async () => { + const schemeState = await this.state().pipe(first()).toPromise() + const contract = getCompetitionContract(schemeState, this.context) + const transaction = contract.methods.vote(options.suggestionId) + return transaction + } + + const mapReceipt = (receipt: any) => { + if (Object.keys(receipt.events).length === 0) { + // this does not mean that anything failed + return receipt + } else { + const eventName = 'NewVote' + // emit NewVote(proposalId, _suggestionId, msg.sender, reputation); + // const suggestionId = receipt.events[eventName].returnValues._suggestionId + const voter = receipt.events[eventName].returnValues._voter + const reputation = receipt.events[eventName].returnValues._reputation + return new CompetitionVote({ + reputation, + voter + }, this.context) + } + } + const errorHandler = async (err: Error) => { + const schemeState = await this.state().pipe(first()).toPromise() + const contract = getCompetitionContract(schemeState, this.context) + // see if the suggestionId does exist in the contract + const suggestion = await contract.methods.suggestions(options.suggestionId).call() + if (suggestion.proposalId === '0x0000000000000000000000000000000000000000000000000000000000000000') { + throw Error(`A suggestion with suggestionId ${options.suggestionId} does not exist`) + } + + // check if the sender has reputation in the DAO + const state = await this.state().pipe(first()).toPromise() + const dao = new DAO(state.dao, this.context) + const reputation = await dao.nativeReputation().pipe(first()).toPromise() + const sender = await this.context.getAccount().pipe(first()).toPromise() + const reputationOfUser = await reputation.reputationOf(sender).pipe(first()).toPromise() + if (reputationOfUser.isZero()) { + throw Error(`Cannot vote because the user ${sender} does not have any reputation in the DAO at ${dao.id}`) + } + return err + } + const observable = this.context.sendTransaction(createTransaction, mapReceipt, errorHandler) + return toIOperationObservable(observable) + } + public redeemSuggestion(options: { + suggestionId: number, // this is the suggestion COUNTER + beneficiary: Address + }): Operation { + if (!options.beneficiary) { + options.beneficiary = NULL_ADDRESS + } + const createTransaction = async () => { + const schemeState = await this.state().pipe(first()).toPromise() + const contract = getCompetitionContract(schemeState, this.context) + const transaction = contract.methods.redeem(options.suggestionId, options.beneficiary) + return transaction + } + + const mapReceipt = (receipt: any) => { + if (Object.keys(receipt.events).length === 0) { + return receipt + } else { + // const eventName = 'Redeem' + // const proposalId = receipt.events[eventName].returnValues._proposalId + // const suggestionId = receipt.events[eventName].returnValues._suggestionId + // const rewardPercentage = receipt.events[eventName].returnValues._rewardPercentage + return true + } + } + const errorHandler = async (err: Error) => { + const schemeState = await this.state().pipe(first()).toPromise() + const contract = getCompetitionContract(schemeState, this.context) + // see if the suggestionId does exist in the contract + const suggestion = await contract.methods.suggestions(options.suggestionId).call() + if (suggestion.proposalId === '0x0000000000000000000000000000000000000000000000000000000000000000') { + throw Error(`A suggestion with suggestionId ${options.suggestionId} does not exist`) + } + const tx = await createTransaction() + try { + // call the transaction to get the solidity-defined errors + await tx.call() + } catch (err) { + throw err + } + // const proposal = await contract.methods.proposals(suggestion.proposalId).call() + // const proposalEndTime = new Date(proposal.endTime * 1000) + // const currentTime = await getBlockTime(this.context.web3) + // const msg = `Redeem failed because the proposals endTime ${proposalEndTime} + // is later then current block time ${currentTime}` + // if (proposalEndTime > currentTime) { + // throw Error(msg) + // } + return err + } + const observable = this.context.sendTransaction(createTransaction, mapReceipt, errorHandler) + return toIOperationObservable(observable) + } + +} + +// export function createProposalErrorHandler(err: Error) { +// return err +// } + +export class Competition { // extends Proposal { + public static search( + context: Arc, + options: IProposalQueryOptions = {}, + apolloQueryOptions: IApolloQueryOptions = {} + ): Observable { + return Proposal.search(context, options, apolloQueryOptions).pipe( + map((proposals: Proposal[]) => proposals.map((p: Proposal) => new Competition(p.id, context))) + ) + } + + public id: string + public context: Arc + + constructor(id: string, context: Arc) { + // super(id, context) + this.id = id + this.context = context + } + + public createSuggestion(options: { + title: string, + description: string, + // tags: string[], + url: string + }): Operation { + let schemeState: ISchemeState + const createTransaction = async () => { + const proposalState = await (new Proposal(this.id, this.context)).state().pipe(first()).toPromise() + schemeState = await (new CompetitionScheme(proposalState.scheme.id, this.context)) + .state().pipe(first()).toPromise() + const contract = getCompetitionContract(schemeState, this.context) + const descriptionHash = await this.context.saveIPFSData(options) + const transaction = contract.methods.suggest(this.id, descriptionHash) + return transaction + } + + const mapReceipt = (receipt: any) => { + if (Object.keys(receipt.events).length === 0) { + // this does not mean that anything failed + return receipt + } else { + const eventName = 'NewSuggestion' + const suggestionId = receipt.events[eventName].returnValues._suggestionId + // const competitionSuggestionId = CompetitionSuggestion.calculateId({ + // scheme: this.id, + // suggestionId + // }) + return new CompetitionSuggestion({scheme: (schemeState as ISchemeState).id, suggestionId}, this.context) + } + } + const errorHandler = async (err: Error) => { + // we got an error + // see if the proposalId does exist in the contract + // const proposalState = await this.state().pipe(first()).toPromise() + // const schemeState = await (new Scheme(proposalState.scheme.address, this.context)) + // .state().pipe(first()).toPromise() + const contract = getCompetitionContract(schemeState, this.context) + const proposal = await contract.methods.proposals(this.id).call() + if (!proposal) { + throw Error(`A proposal with id ${this.id} does not exist`) + } + return err + } + const observable = this.context.sendTransaction(createTransaction, mapReceipt, errorHandler) + return toIOperationObservable(observable) + } + + public voteSuggestion(suggestionId: number): Operation { + const proposal = new Proposal(this.id, this.context) + const observable = proposal.state().pipe( + first(), + concatMap((competitionState) => { + const scheme = new CompetitionScheme(competitionState.scheme, this.context) + return scheme.voteSuggestion({suggestionId}) + }) + ) + return toIOperationObservable(observable) + } + public redeemSuggestion(suggestionId: number, beneficiary: Address = NULL_ADDRESS): Operation { + const proposal = new Proposal(this.id, this.context) + const observable = proposal.state().pipe( + first(), + concatMap((competitionState) => { + const scheme = new CompetitionScheme(competitionState.scheme, this.context) + return scheme.redeemSuggestion({suggestionId, beneficiary}) + }) + ) + return toIOperationObservable(observable) + } + + public suggestions( + options: ICompetitionSuggestionQueryOptions = {}, + apolloQueryOptions: IApolloQueryOptions = {} + ): Observable { + if (!options.where) { options.where = {}} + options.where.proposal = this.id + return CompetitionSuggestion.search(this.context, options, apolloQueryOptions) + } +} + +export interface ICompetitionSuggestionQueryOptions extends ICommonQueryOptions { + where?: { + id?: string, // id of the competition + proposal?: string, // id of the proposal + suggestionId?: string // the "suggestionId" is a counter that is unique to the scheme + // - and is not to be confused with suggestion.id + } +} +export class CompetitionSuggestion { + + public static fragments = { + CompetitionSuggestionFields: gql`fragment CompetitionSuggestionFields on CompetitionSuggestion { + id + suggestionId + proposal { + id + } + descriptionHash + title + description + url + # fulltext: [string] + suggester + # votes: [CompetitionVote!] @derivedFrom(field: "suggestion") + totalVotes + createdAt + redeemedAt + rewardPercentage + }` + } + + public static calculateId(opts: { scheme: Address, suggestionId: number}): string { + const seed = concat( + hexStringToUint8Array(opts.scheme.toLowerCase()), + hexStringToUint8Array(Number(opts.suggestionId).toString(16)) + ) + return Web3.utils.keccak256(seed) + } + + public static search( + context: Arc, + options: ICompetitionSuggestionQueryOptions = {}, + apolloQueryOptions: IApolloQueryOptions = {} + ): Observable { + let where = '' + if (!options.where) { options.where = {}} + + for (const key of Object.keys(options.where)) { + if (options.where[key] === undefined) { + continue + } + where += `${key}: "${options.where[key] as string}"\n` + } + + const itemMap = (item: any) => this.mapItemToObject(item, context) + + const query = gql`query CompetitionSuggestionSearch + { + competitionSuggestions ${createGraphQlQuery(options, where)} { + ...CompetitionSuggestionFields + } + } + ${CompetitionSuggestion.fragments.CompetitionSuggestionFields} + ` + + return context.getObservableList( + query, + itemMap, + apolloQueryOptions + ) as Observable + } + + private static mapItemToObject(item: any, context: Arc): ICompetitionSuggestion|null { + if (item === null) { + return null + } + + let redeemedAt = null + if (item.redeemedAt !== null) { + redeemedAt = secondSinceEpochToDate(item.redeemedAt) + } + return { + createdAt: secondSinceEpochToDate(item.createdAt), + description: item.description, + descriptionHash: item.descriptionHash, + id: item.id, + proposal: item.proposal.id, + redeemedAt, + rewardPercentage: Number(item.rewardPercentage), + suggester: item.suggester, + suggestionId: item.suggestionId, + title: item.title, + totalVotes: new BN(item.totalVotes), + url: item.url + } + + } + + public id: string + public suggestionId?: number + public staticState?: ICompetitionSuggestion + + constructor(idOrOpts: string|{ suggestionId: number, scheme: string}|ICompetitionSuggestion, public context: Arc) { + if (typeof idOrOpts === 'string') { + this.id = idOrOpts + } else { + if ( + Object.keys(idOrOpts).includes('scheme') && + Object.keys(idOrOpts).includes('suggestionId') + ) { + this.id = CompetitionSuggestion.calculateId(idOrOpts as { suggestionId: number, scheme: string}) + this.suggestionId = idOrOpts.suggestionId + } else { + const opts = idOrOpts as ICompetitionSuggestion + this.id = opts.id + this.setStaticState(opts) + } + } + } + + public setStaticState(opts: ICompetitionSuggestion) { + this.staticState = opts + } + + public async fetchStaticState(): Promise { + return this.state({ fetchPolicy: 'cache-first'}).pipe(first()).toPromise() + } + + public state(apolloQueryOptions: IApolloQueryOptions = {}): Observable { + const query = gql`query SchemeState + { + competitionSuggestion (id: "${this.id}") { + ...CompetitionSuggestionFields + } + } + ${CompetitionSuggestion.fragments.CompetitionSuggestionFields} + ` + + const itemMap = (item: any) => CompetitionSuggestion.mapItemToObject(item, this.context) + return this.context.getObservableObject(query, itemMap, apolloQueryOptions) + } + + public vote(): Operation { + const observable = this.state().pipe( + first(), + concatMap((suggestionState) => { + const competition = new Competition(suggestionState.proposal, this.context) + return competition.voteSuggestion(suggestionState.suggestionId) + }) + ) + return toIOperationObservable(observable) + } + + public votes( + options: ICompetitionVoteQueryOptions = {}, + apolloQueryOptions: IApolloQueryOptions = {} + ): Observable { + if (!options.where) { options.where = {}} + options.where = { ...options.where, suggestion: this.id} + return CompetitionVote.search(this.context, options, apolloQueryOptions) + } + + public redeem(beneficiary: Address = NULL_ADDRESS): Operation { + const observable = this.state().pipe( + first(), + concatMap((suggestionState) => { + const competition = new Competition(suggestionState.proposal, this.context) + return competition.redeemSuggestion(suggestionState.suggestionId, beneficiary) + }) + ) + return toIOperationObservable(observable) + } +} +export interface ICompetitionVoteQueryOptions { + where?: { + suggestion?: string + voter?: Address + competition?: string + competition_not?: string|null + } +} + +export class CompetitionVote { + + public static fragments = { + CompetitionVoteFields: gql`fragment CompetitionVoteFields on CompetitionVote { + id + createdAt + reputation + voter + }` + } + public static calculateId(opts: { scheme: Address, suggestionId: number}): string { + const seed = concat( + hexStringToUint8Array(opts.scheme.toLowerCase()), + hexStringToUint8Array(Number(opts.suggestionId).toString(16)) + ) + return Web3.utils.keccak256(seed) + } + + public static search( + context: Arc, + options: ICompetitionVoteQueryOptions = {}, + apolloQueryOptions: IApolloQueryOptions = {} + ): Observable { + if (!options.where) { options.where = {}} + + const itemMap = (item: any) => new CompetitionVote({ + createdAt: secondSinceEpochToDate(item.createdAt), + id: item.id, + reputation: item.reputation, + voter: item.voter + }, context) + + const query = gql`query CompetitionSuggestionSearch + { + competitionVotes ${createGraphQlQuery(options)} { + ...CompetitionVoteFields + } + } + ${CompetitionVote.fragments.CompetitionVoteFields} + ` + + return context.getObservableList( + query, + itemMap, + apolloQueryOptions + ) as Observable + } + public id?: string + public staticState?: ICompetitionVote + + constructor(idOrOpts: string|ICompetitionVote, public context: Arc) { + if (typeof idOrOpts === 'string') { + this.id = idOrOpts + } else { + const opts = idOrOpts as ICompetitionVote + // this.id = opts.id + this.setStaticState(opts) + } + } + + public setStaticState(opts: ICompetitionVote) { + this.staticState = opts + } +} + +/** + * If this scheme is a ContributionREwardExt scheme and if + * its rewarder is Competition contract, return that contract + * @param schemeState + * @returns A Web3 contract instance + */ +export function getCompetitionContract(schemeState: ISchemeState, arc: Arc) { + if (schemeState === null) { + throw Error(`No scheme was provided`) + } + const rewarder = schemeState.contributionRewardExtParams && schemeState.contributionRewardExtParams.rewarder + if (!rewarder) { + throw Error(`This scheme's rewarder is not set, and so no compeittion contract could be found`) + } + + if (!isCompetitionScheme(arc, schemeState)) { + throw Error(`We did not find a Competition contract at the rewarder address ${rewarder}`) + } + const contract = arc.getContract(rewarder as Address) + return contract +} + +export function isCompetitionScheme(arc: Arc, item: any) { + if (item.contributionRewardExtParams) { + const contractInfo = arc.getContractInfo(item.contributionRewardExtParams.rewarder) + return contractInfo.name === 'Competition' + } else { + return false + } +} + +/** + * @returns true if this is a ContributionRewardExt scheme and the rewarder of this scheme is a competition contract + */ +export function hasCompetitionContract(schemeState: ISchemeState, arc: Arc) { + let contract + try { + contract = getCompetitionContract(schemeState, arc) + } catch (err) { + // pass + } + return !!contract +} diff --git a/src/schemes/contributionReward.ts b/src/schemes/contributionReward.ts index 31314970..978cd0de 100644 --- a/src/schemes/contributionReward.ts +++ b/src/schemes/contributionReward.ts @@ -34,7 +34,7 @@ export enum IProposalType { ContributionReward = 'ContributionReward' // propose a contributionReward } -export function createTransaction(options: any, context: Arc) { +export function createProposal(options: any, context: Arc) { const contributionReward = context.getContract(options.scheme) return async () => { diff --git a/src/schemes/contributionRewardExt.ts b/src/schemes/contributionRewardExt.ts new file mode 100644 index 00000000..5fc0c5d2 --- /dev/null +++ b/src/schemes/contributionRewardExt.ts @@ -0,0 +1,71 @@ +import BN = require('bn.js') +import { Arc } from '../arc' +import { IProposalBaseCreateOptions, Proposal } from '../proposal' +import { Address } from '../types' +import { NULL_ADDRESS } from '../utils' + +export interface IContributionRewardExt { + beneficiary: Address + externalTokenReward: BN + externalToken: Address + ethReward: BN + nativeTokenReward: BN + periods: number + periodLength: number + reputationReward: BN + alreadyRedeemedNativeTokenPeriods: number + alreadyRedeemedReputationPeriods: number + alreadyRedeemedExternalTokenPeriods: number + alreadyRedeemedEthPeriods: number +} + +export interface IProposalCreateOptionsContributionRewardExt extends IProposalBaseCreateOptions { + beneficiary: Address + nativeTokenReward?: BN + reputationReward?: BN + ethReward?: BN + externalTokenReward?: BN + externalTokenAddress?: Address + proposer: Address +} + +export enum IProposalType { + ContributionReward = 'ContributionRewardExt' // propose a contributionReward +} + +/** + * + * @param options + * @param context + */ +export function createProposal(options: any, context: Arc) { + const contract = context.getContract(options.scheme) + if (!options.proposer) { + options.proposer = NULL_ADDRESS + } + return async () => { + options.descriptionHash = await context.saveIPFSData(options) + const transaction = contract.methods.proposeContributionReward( + options.descriptionHash || '', + options.reputationReward && options.reputationReward.toString() || 0, + [ + options.nativeTokenReward && options.nativeTokenReward.toString() || 0, + options.ethReward && options.ethReward.toString() || 0, + options.externalTokenReward && options.externalTokenReward.toString() || 0 + ], + options.externalTokenAddress || NULL_ADDRESS, + options.beneficiary, + options.proposer + ) + return transaction + } +} + +export function createTransactionMap(options: any, context: Arc) { + const eventName = 'NewContributionProposal' + const map = (receipt: any) => { + const proposalId = receipt.events[eventName].returnValues._proposalId + return new Proposal(proposalId, context) + } + return map +} diff --git a/src/settings.ts b/src/settings.ts index bb72c661..e031d0a8 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -1,5 +1,5 @@ // the versino of the redeemer contract to use -export const REDEEMER_CONTRACT_VERSION = '0.0.1-rc.22' +export const REDEEMER_CONTRACT_VERSION = '0.0.1-rc.36' // the versino of the Reputation contract instances export const REPUTATION_CONTRACT_VERSION = '0.0.1-rc.19' export const DAOTOKEN_CONTRACT_VERSION = '0.0.1-rc.19' diff --git a/src/types.ts b/src/types.ts index 779b6900..223907a2 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,5 @@ import { Observable } from 'rxjs' +import { IApolloQueryOptions } from './graphnode' export type Address = string export type Date = number @@ -7,7 +8,7 @@ export type Web3Receipt = any export type Web3Provider = string | object export interface IStateful { - state: () => Observable + state: (apolloQueryOptions: IApolloQueryOptions) => Observable } export interface ICommonQueryOptions { diff --git a/src/utils.ts b/src/utils.ts index 522dc66b..54432620 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -160,3 +160,42 @@ export function createGraphQlWhereQuery(where?: {[key: string]: string|string[]| } return result } + +export function dateToSecondsSinceEpoch(date: Date) { + if (!(date instanceof Date)) { + throw Error(`Input should be a Date instance, got ${date} instead`) + } + + return Math.floor(date.getTime() / 1000) +} + +export function secondSinceEpochToDate(seconds: number): Date { + try { + seconds = Number(seconds) + } catch (e) { + throw e + // throw Error(`argument "seconds" must be a number, got ${seconds} instead`) + } + const d = new Date() + d.setTime(seconds * 1000) + return d +} + +/** + * get the latest block time, or the current time, whichver is later + * + * @export + * @param {*} web3 + * @returns + */ +export async function getBlockTime(web3: any) { + const block = await web3.eth.getBlock('latest') + const blockTime = new Date(block.timestamp * 1000) + const now = new Date() + now.setMilliseconds(0) + if (now < blockTime) { + return blockTime + } else { + return now + } +} diff --git a/test/cache.spec.ts b/test/cache.spec.ts index bceab664..ce379bbd 100644 --- a/test/cache.spec.ts +++ b/test/cache.spec.ts @@ -99,6 +99,7 @@ describe('apolloClient caching checks', () => { ${Proposal.fragments.ProposalFields} ${Vote.fragments.VoteFields} ${Stake.fragments.StakeFields} + ${Scheme.fragments.SchemeFields} ` let subscribed = false const results: any[] = [] diff --git a/test/proposal-competition.spec.ts b/test/proposal-competition.spec.ts new file mode 100644 index 00000000..7df64d59 --- /dev/null +++ b/test/proposal-competition.spec.ts @@ -0,0 +1,368 @@ +import BN = require('bn.js') +import { first } from 'rxjs/operators' +import { + Arc, + Competition, + CompetitionScheme, + CompetitionSuggestion, + CompetitionVote, + DAO, + ICompetitionProposal, + IProposalStage, + IProposalState, + ISchemeState, + Proposal + } from '../src' +import { getBlockTime } from '../src/utils' +import { + advanceTimeAndBlock, + newArc, + // revertToSnapShot, + // takeSnapshot, + toWei, + voteToPassProposal, + waitUntilTrue + } from './utils' + +jest.setTimeout(60000) + +describe('Competition Proposal', () => { + let arc: Arc + let dao: DAO + let contributionRewardExt: CompetitionScheme + let contributionRewardExtState: ISchemeState + // let snapshotId: any + + function addSeconds(date: Date, seconds: number) { + if (!(date instanceof Date)) { + throw Error(`Input should be a Date instance, got ${date} instead`) + } + const result = new Date() + result.setTime(date.getTime() + (seconds * 1000)) + return result + } + + beforeEach(async () => { + // @ts-ignore + // snapshotId = (await takeSnapshot()).result + }) + + beforeAll(async () => { + arc = await newArc() + // we'll get a `ContributionRewardExt` contract + // find the corresponding scheme object + // TODO: next lines will not work because of https://github.com/daostack/migration/issues/254 + // const ARC_VERSION = '0.0.1-rc.36' + // const contributionRewardExtContract = arc.getContractInfoByName(`ContributionRewardExt`, ARC_VERSION) + // const contributionRewardExtAddres = contributionRewardExtContract.address + const contributionRewardExtAddres = '0x68c29524E583380aF7896f7e63463740225Ac026'.toLowerCase() + const contributionRewardExts = await arc + .schemes({where: {address: contributionRewardExtAddres }}).pipe(first()).toPromise() + + contributionRewardExt = contributionRewardExts[0] as CompetitionScheme + contributionRewardExtState = await contributionRewardExt.state().pipe(first()).toPromise() + dao = new DAO(contributionRewardExtState.dao, arc) + }) + + afterEach(async () => { + // await revertToSnapShot(snapshotId) + }) + + it('CompetitionSuggestion.calculateId works', async () => { + function calc(scheme: string, suggestionId: number) { + return CompetitionSuggestion.calculateId({scheme, suggestionId}) + + } + expect(calc('0xefc4d4e4ff5970c02572d90f8d580f534508f3377a17880e95c2ba9a6d670622', + 8)) + .toEqual('0x1c5a3d7aa889aff71dc8f5de18956b7b1e821c823f3f358d9eb74d18f135fa13') + expect(calc('0xefc4d4e4ff5970c02572d90f8d580f534508f3377a17880e95c2ba9a6d670622', + 8)) + .toEqual('0x1c5a3d7aa889aff71dc8f5de18956b7b1e821c823f3f358d9eb74d18f135fa13') + + expect(calc('0xefc4d4e4ff5970c02572d90f8d580f534508f3377a17880e95c2ba9a6d670622', + 14)) + .toEqual('0x137446f8b5c791e505e6e8228801ed78555a4e35957fd0b026b70fc3f262b629') + + }) + + it('create a competition proposal with starttime set to null', async () => { + const scheme = new CompetitionScheme(contributionRewardExt.id, arc) + // TODO: test error handling for all these params + // - all args are present + // - order of times + const now = await getBlockTime(arc.web3) + const startTime = addSeconds(now, 2) + const proposalOptions = { + dao: dao.id, + endTime: addSeconds(startTime, 2000), + ethReward: toWei('300'), + externalTokenAddress: undefined, + externalTokenReward: toWei('0'), + nativeTokenReward: toWei('1'), + numberOfVotesPerVoter: 3, + proposalType: 'competition', + reputationReward: toWei('10'), + rewardSplit: [1, 2, 97], + startTime: null, + suggestionsEndTime: addSeconds(startTime, 1000), + value: 0, + votingStartTime: addSeconds(startTime, 200) + } + + // CREATE PROPOSAL + const tx = await scheme.createProposal(proposalOptions).send() + const proposal = tx.result + expect(proposal).toBeInstanceOf(Proposal) + + const states: IProposalState[] = [] + const lastState = (): IProposalState => states[states.length - 1] + proposal.state().subscribe((pState: IProposalState) => { + states.push(pState) + }) + await waitUntilTrue(() => !!lastState()) + + expect(lastState()).toMatchObject({ + stage: IProposalStage.Queued + }) + expect((lastState().competition as ICompetitionProposal).startTime).toBeDefined() + }) + + it('Create a competition proposal, compete, win the competition..', async () => { + // const scheme = new CompetitionScheme(contributionRewardExtState.id, arc) + expect(contributionRewardExt).toBeInstanceOf(CompetitionScheme) + const scheme = new CompetitionScheme(contributionRewardExt.id, arc) + + const ethReward = new BN(1000) + // make sure that the DAO has enough Ether to pay forthe reward + await arc.web3.eth.sendTransaction({ + gas: 4000000, + gasPrice: 100000000000, + to: dao.id, + value: ethReward + }) + const reputationReward = new BN(10101010) + const externalTokenReward = new BN(0) + const nativeTokenReward = new BN(0) + + // TODO: test error handling for all these params + // - all args are present + // - order of times + const now = await getBlockTime(arc.web3) + const startTime = addSeconds(now, 2) + const proposalOptions = { + dao: dao.id, + endTime: addSeconds(startTime, 200), + ethReward, + externalTokenAddress: undefined, + externalTokenReward, + nativeTokenReward, + numberOfVotesPerVoter: 3, + proposalType: 'competition', + reputationReward, + rewardSplit: [1, 2, 97], + startTime, + suggestionsEndTime: addSeconds(startTime, 100), + value: 0, + votingStartTime: addSeconds(startTime, 0) + } + + const schemeState = await scheme.state().pipe(first()).toPromise() + + // CREATE PROPOSAL + const tx = await scheme.createProposal(proposalOptions).send() + const proposal = tx.result + expect(proposal).toBeInstanceOf(Proposal) + + const states: IProposalState[] = [] + const lastState = (): IProposalState => states[states.length - 1] + proposal.state().subscribe((pState: IProposalState) => { + states.push(pState) + }) + await waitUntilTrue(() => !!lastState()) + + expect(lastState()).toMatchObject({ + stage: IProposalStage.Queued + }) + expect(lastState().contributionReward).toMatchObject({ + alreadyRedeemedEthPeriods: 0, + ethReward, + nativeTokenReward, + reputationReward + }) + expect(lastState().competition).toMatchObject({ + endTime: proposalOptions.endTime, + numberOfVotesPerVoter: proposalOptions.numberOfVotesPerVoter, + numberOfWinners: 3, + rewardSplit: [1, 2, 97], + snapshotBlock: null, + startTime: proposalOptions.startTime, + suggestionsEndTime: proposalOptions.suggestionsEndTime, + votingStartTime: proposalOptions.votingStartTime + }) + expect(lastState().scheme).toMatchObject({ + // TODO: this should be 'Competition' + name: 'ContributionRewardExt' + // name: 'Competition' + }) + + // accept the proposal by voting for et + await voteToPassProposal(proposal) + + await waitUntilTrue(() => (lastState().stage === IProposalStage.Executed)) + expect(lastState()).toMatchObject({ + stage: IProposalStage.Executed + }) + + // check sanity for scheme + expect(schemeState.address).toEqual(lastState().scheme.address) + + // redeem the proposal + await proposal.claimRewards().send() + + // find the competition + const competitions = await scheme.competitions({ where: {id: proposal.id}}).pipe(first()).toPromise() + expect(competitions.length).toEqual(1) + const competition = competitions[0] + expect(competition).toBeInstanceOf(Competition) + expect(competition.id).toEqual(proposal.id) + + // lets create some suggestions + const suggestion1Options = { + description: 'descxription', + proposal: proposal.id, + // tags: ['tag1', 'tag2'], + title: 'title', + url: 'https://somewhere.some.place' + } + + const address0 = arc.web3.eth.accounts.wallet[0].address.toLowerCase() + const address1 = arc.web3.eth.accounts.wallet[1].address.toLowerCase() + // submit a suggestion by address1 + arc.setAccount(address1) + const receipt1 = await competition.createSuggestion(suggestion1Options).send() + arc.setAccount(address0) + const suggestion1 = receipt1.result + expect(suggestion1).toBeDefined() + expect(suggestion1).toBeInstanceOf(CompetitionSuggestion) + expect(suggestion1.id).toBeDefined() + const suggestion2Options = { ...suggestion1Options, title: 'suggestion nr 2'} + const receipt2 = await competition.createSuggestion(suggestion2Options).send() + const suggestion2 = receipt2.result + + // we now should find 2 suggestions + let suggestionIds: string[] = [] + competition.suggestions() + .subscribe((ls: CompetitionSuggestion[]) => { + suggestionIds = ls.map((x: CompetitionSuggestion) => x.id) + }) + + await waitUntilTrue(() => suggestionIds.indexOf(suggestion2.id) > -1) + + const suggestion1State = await suggestion1.state().pipe(first()).toPromise() + expect(suggestion1State).toMatchObject({ + ...suggestion1Options, + id: suggestion1.id, + redeemedAt: null, + rewardPercentage: 0, + suggester: address1, + title: 'title', + totalVotes: new BN(0) + }) + + expect(suggestion1State).toEqual(await suggestion1.fetchStaticState()) + + // filter suggestions by id, suggestionId, and proposal.id works + expect( + (await competition.suggestions({where: { proposal: competition.id}}).pipe(first()).toPromise()).length) + .toEqual(2) + + expect( + (await competition.suggestions({where: { id: suggestion2.id}}).pipe(first()).toPromise()).length) + .toEqual(1) + + expect( + (await competition.suggestions({where: { suggestionId: suggestion1State.suggestionId}}) + .pipe(first()).toPromise()).length) + .toEqual(1) + + // // and lets vote for the first suggestion + const voteReceipt = await scheme.voteSuggestion({ suggestionId: suggestion2.suggestionId}).send() + const vote = voteReceipt.result + // // the vote should be counted + expect(vote).toBeInstanceOf(CompetitionVote) + + // we can also vote from the suggestion itself + const vote1receipt = await suggestion1.vote().send() + const vote1 = vote1receipt.result + expect(vote1).toBeInstanceOf(CompetitionVote) + + let competitionVotes: CompetitionVote[] = [] + CompetitionVote.search(arc, {where: { suggestion: suggestion2.id}}).subscribe( + (votes) => { competitionVotes = votes} + ) + await waitUntilTrue(() => competitionVotes.length > 0) + expect(competitionVotes.length).toEqual(1) + + // we can also find the votes on the suggestion + const votesFromSuggestion: CompetitionVote[] = await suggestion2.votes().pipe(first()).toPromise() + expect(votesFromSuggestion.map((r) => r.id)).toEqual(competitionVotes.map((r) => r.id)) + + // if we claim our reward now, it should fail because the competion has not ended yet + await expect(suggestion1.redeem().send()).rejects.toThrow( + /competition is still on/i + ) + await advanceTimeAndBlock(2000) + + // get the current balance of addres1 (who submitted suggestion1) before redeeming the suggestion + const balanceBefore = new BN(await arc.web3.eth.getBalance(address1)) + await suggestion1.redeem().send() + const balanceAfter = new BN(await arc.web3.eth.getBalance(address1)) + const balanceDelta = balanceAfter.sub(balanceBefore) + expect(balanceDelta.toString()).not.toEqual('0') + // TODO: write some tests for winners and their balances + // console.log(balanceDelta.toString()) + // console.log(ethReward.toString()) + // expect(balanceDelta).toEqual(ethReward.muln(97).divn(100)) + }) + + it('CompetionScheme is recognized', async () => { + // we'll get a `ContributionRewardExt` contract that has a Compietion contract as a rewarder + const ARC_VERSION = '0.0.1-rc.36' + const contributionRewardExtContract = arc.getContractInfoByName(`ContributionRewardExt`, ARC_VERSION) + // find the corresponding scheme object + const contributionRewardExts = await arc + .schemes({where: {address: contributionRewardExtContract.address}}).pipe(first()).toPromise() + expect(contributionRewardExts.length).toEqual(1) + const scheme = contributionRewardExts[0] + expect(scheme).toBeInstanceOf(CompetitionScheme) + }) + + it('Can create a propsal using dao.createProposal', async () => { + const now = await getBlockTime(arc.web3) + const startTime = addSeconds(now, 2) + const proposalOptions = { + beneficiary: '0xffcf8fdee72ac11b5c542428b35eef5769c409f0', + dao: dao.id, + endTime: addSeconds(startTime, 3000), + ethReward: toWei('300'), + externalTokenAddress: undefined, + externalTokenReward: toWei('0'), + nativeTokenReward: toWei('1'), + numberOfVotesPerVoter: 3, + proposalType: 'competition', + reputationReward: toWei('10'), + rewardSplit: [10, 10, 80], + scheme: contributionRewardExtState.address, + startTime, + suggestionsEndTime: addSeconds(startTime, 100), + value: 0, + votingStartTime: addSeconds(startTime, 0) + } + + const tx = await dao.createProposal(proposalOptions).send() + const proposal = tx.result + expect(proposal).toBeInstanceOf(Proposal) + + }) +}) diff --git a/test/proposal-contributionrewardext.spec.ts b/test/proposal-contributionrewardext.spec.ts new file mode 100644 index 00000000..1a47abb7 --- /dev/null +++ b/test/proposal-contributionrewardext.spec.ts @@ -0,0 +1,77 @@ +import { first } from 'rxjs/operators' +import { + Arc, + DAO, + IProposalStage, + IProposalState, + Proposal + } from '../src' +import { newArc, toWei, voteToPassProposal, waitUntilTrue } from './utils' + +jest.setTimeout(60000) + +/** + * Proposal test + */ +describe('ContributionReward Ext', () => { + let arc: Arc + + beforeAll(async () => { + arc = await newArc() + }) + + it.skip('Create a proposal, accept it, execute it', async () => { + // TODO: we are skipping this test, because we do not ahve at this point a contributionrewardext + // contract in our test environment that is not a Competition scheme.. + + // we'll get a `ContributionRewardExt` contract + const ARC_VERSION = '0.0.1-rc.36' + const contributionRewardExtContract = arc.getContractInfoByName(`ContributionRewardExt`, ARC_VERSION) + // find the corresponding scheme object + const contributionRewardExts = await arc + .schemes({where: {address: contributionRewardExtContract.address}}).pipe(first()).toPromise() + + const contributionRewardExt = contributionRewardExts[0] + const contributionRewardExtState = await contributionRewardExt.state().pipe(first()).toPromise() + const dao = new DAO(contributionRewardExtState.dao, arc) + + const tx = await dao.createProposal({ + beneficiary: '0xffcf8fdee72ac11b5c542428b35eef5769c409f0', + dao: dao.id, + ethReward: toWei('300'), + externalTokenAddress: undefined, + externalTokenReward: toWei('0'), + nativeTokenReward: toWei('1'), + reputationReward: toWei('10'), + scheme: contributionRewardExtState.address, + value: 0 + }).send() + const proposal = tx.result + expect(proposal).toBeInstanceOf(Proposal) + + const states: IProposalState[] = [] + const lastState = (): IProposalState => states[states.length - 1] + proposal.state().subscribe((pState: IProposalState) => { + states.push(pState) + }) + await waitUntilTrue(() => !!lastState()) + + expect(lastState()).toMatchObject({ + stage: IProposalStage.Queued + }) + expect(lastState().contributionReward).toMatchObject({ + alreadyRedeemedEthPeriods: 0, + ethReward: toWei('300'), + nativeTokenReward: toWei('1'), + reputationReward: toWei('10') + }) + + // accept the proposal by voting the hell out of it + await voteToPassProposal(proposal) + + await waitUntilTrue(() => (lastState().stage === IProposalStage.Executed)) + expect(lastState()).toMatchObject({ + stage: IProposalStage.Executed + }) + }) +}) diff --git a/test/proposal-execute.spec.ts b/test/proposal-execute.spec.ts index cb3ab14f..dc67a788 100644 --- a/test/proposal-execute.spec.ts +++ b/test/proposal-execute.spec.ts @@ -1,10 +1,10 @@ +import BN = require('bn.js') import { first } from 'rxjs/operators' import { Arc } from '../src/arc' import { DAO } from '../src/dao' import { IProposalOutcome, IProposalStage, IProposalState, Proposal } from '../src/proposal' -import BN = require('bn.js') -import { createAProposal, fromWei, getTestAddresses, getTestDAO, ITestAddresses, - newArc, timeTravel, toWei, +import { advanceTime, createAProposal, fromWei, getTestAddresses, getTestDAO, + ITestAddresses, newArc, toWei, voteToPassProposal, waitUntilTrue } from './utils' jest.setTimeout(40000) @@ -87,7 +87,7 @@ describe('Proposal execute()', () => { expect(proposalState.stage).toEqual(IProposalStage.PreBoosted) // TODO: find out why the state is not updated to Boosted akreadt at this point - await timeTravel(60000 * 60, arc.web3) // 30 minutes + await advanceTime(60000 * 60) // 30 minutes proposal.context.web3.eth.accounts.defaultAccount = accounts[2] await proposal.vote(IProposalOutcome.Pass).send() proposal.context.web3.eth.accounts.defaultAccount = accounts[0] diff --git a/test/proposal.spec.ts b/test/proposal.spec.ts index f9603f9d..eeab160d 100644 --- a/test/proposal.spec.ts +++ b/test/proposal.spec.ts @@ -9,6 +9,7 @@ import { IExecutionState, IProposalType, Proposal } from '../src/proposal' import { IContributionReward } from '../src/schemes/contributionReward' + import BN = require('bn.js') import { createAProposal, fromWei, @@ -154,7 +155,6 @@ describe('Proposal', () => { expect(shouldBeJustThisExecutedProposal.map((p: Proposal) => p.id)).toEqual([proposal.id]) }) - // skipping this test, bc we chaned the implementation and it is unclear why this feature (?) was needed it('state should be available before the data is indexed', async () => { const options = { beneficiary: '0xffcf8fdee72ac11b5c542428b35eef5769c409f0', @@ -226,7 +226,15 @@ describe('Proposal', () => { periodLength: 0, periods: 1 }) - + expect(pState.scheme).toMatchObject({ + canDelegateCall: false, + canManageGlobalConstraints: false, + canRegisterSchemes: false, + dao: dao.id, + name: 'ContributionReward' + }) + expect(pState.scheme.contributionRewardParams).toBeTruthy() + expect(pState.scheme.contributionRewardExtParams).toBeFalsy() expect(pState.queue.threshold).toBeGreaterThan(0) // check if the upstakeNeededToPreBoost value is correct // (S+/S-) > AlphaConstant^NumberOfBoostedProposal. diff --git a/test/utils.spec.ts b/test/utils.spec.ts index 071377f4..e8d2d8d9 100644 --- a/test/utils.spec.ts +++ b/test/utils.spec.ts @@ -1,7 +1,7 @@ -import { IContractInfo } from '../src/arc' -import { realMathToNumber } from '../src/utils' -import { getContractAddressesFromMigration } from './utils' import BN = require('bn.js') +import { IContractInfo } from '../src/arc' +import { realMathToNumber } from '../src/utils' +import { advanceTimeAndBlock, getContractAddressesFromMigration, newArc } from './utils' /** * Token test @@ -24,4 +24,19 @@ describe('Utils', () => { expect(addresses.length).toBeGreaterThan(0) }) + it('advanceTime works', async () => { + const arc = await newArc() + const web3 = arc.web3 + async function getBlockTime() { + const block = await web3.eth.getBlock('latest') + return block.timestamp + } + const blockTimeBefore = await getBlockTime() + const timeDelta = 900000 + await advanceTimeAndBlock(timeDelta) + const blockTimeAfter = await getBlockTime() + // we expect the block times not to be perfectly alinged, but nearly so + expect(Math.round((blockTimeAfter - blockTimeBefore) / 100)).toEqual(Math.round(timeDelta / 100)) + }) + }) diff --git a/test/utils.ts b/test/utils.ts index 6f91d584..7eb399d6 100644 --- a/test/utils.ts +++ b/test/utils.ts @@ -1,11 +1,12 @@ +import BN = require('bn.js') import { Observable } from 'rxjs' import { first } from 'rxjs/operators' +import { IContractInfo, IProposalCreateOptions, Proposal } from '../src' +import { Arc } from '../src/arc' import { DAO } from '../src/dao' -import Arc from '../src/index' -import { IContractInfo, IProposalCreateOptions, IProposalOutcome, Proposal } from '../src' +import { IProposalOutcome} from '../src/proposal' import { Reputation } from '../src/reputation' import { Address } from '../src/types' -import BN = require('bn.js') const Web3 = require('web3') const path = require('path') @@ -231,31 +232,96 @@ export async function voteToPassProposal(proposal: Proposal) { return } -export async function timeTravel(seconds: number, web3: any) { - const jsonrpc = '2.0' - const id = 1 - web3 = new Web3('http://localhost:8545') - web3.providers.HttpProvider.prototype.sendAsync = web3.providers.HttpProvider.prototype.send +// export async function timeTravel(seconds: number, web3: any) { +// const jsonrpc = '2.0' +// // web3 = new Web3('http://localhost:8545') +// // web3.providers.HttpProvider.prototype.sendAsync = web3.providers.HttpProvider.prototype.send +// return new Promise((resolve, reject) => { +// web3.currentProvider.send({ +// id: new Date().getTime(), +// jsonrpc, +// method: 'evm_increaseTime', +// // method: 'evm_mine', +// params: [seconds] +// }, (err1: Error) => { +// if (err1) { return reject(err1) } +// // resolve(res) + +// web3.currentProvider.send({ +// id: new Date().getTime(), +// jsonrpc, +// method: 'evm_mine' +// }, (err2: Error, res: any) => { +// return err2 ? reject(err2) : resolve(res) +// }) +// }) +// }) +// } + +const web3 = new Web3('http://127.0.0.1:8545') + +export const advanceTime = (time: number) => { return new Promise((resolve, reject) => { - web3.currentProvider.sendAsync({ - id, - jsonrpc, + web3.currentProvider.send({ + jsonrpc: '2.0', method: 'evm_increaseTime', - params: [seconds] - }, (err1: Error) => { - if (err1) { return reject(err1) } - - web3.currentProvider.sendAsync({ - id: id + 1, - jsonrpc, - method: 'evm_mine' - }, (err2: Error, res: any) => { - return err2 ? reject(err2) : resolve(res) - }) + params: [time], + id: new Date().getTime() + }, (err: Error, result: any) => { + if (err) { return reject(err) } + return resolve(result) + }) + }) +} + +export const advanceBlock = () => { + return new Promise((resolve, reject) => { + web3.currentProvider.send({ + jsonrpc: '2.0', + method: 'evm_mine', + id: new Date().getTime() + }, (err: Error, result: any) => { + if (err) { return reject(err) } + const newBlockHash = web3.eth.getBlock('latest').hash + + return resolve(newBlockHash) }) }) } +export const takeSnapshot = () => { + return new Promise((resolve, reject) => { + web3.currentProvider.send({ + jsonrpc: '2.0', + method: 'evm_snapshot', + id: new Date().getTime() + }, (err: Error, snapshotId: string) => { + if (err) { return reject(err) } + return resolve(snapshotId) + }) + }) +} + +export const revertToSnapShot = (id: string) => { + return new Promise((resolve, reject) => { + web3.currentProvider.send({ + id: new Date().getTime(), + jsonrpc: '2.0', + method: 'evm_revert', + params: [id] + }, (err: Error, result: any) => { + if (err) { return reject(err) } + return resolve(result) + }) + }) +} + +export const advanceTimeAndBlock = async (time: number) => { + await advanceTime(time) + await advanceBlock() + return Promise.resolve(web3.eth.getBlock('latest')) +} + export async function firstResult(observable: Observable) { return observable.pipe(first()).toPromise() } diff --git a/tsconfig.json b/tsconfig.json index 9fe9dc15..ae108961 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,8 +17,7 @@ "target": "es5", "typeRoots": [ "node_modules/@types" - ], - "resolveJsonModule": true + ] }, "include": [ "src", diff --git a/tslint.json b/tslint.json index c5396839..8631c23a 100644 --- a/tslint.json +++ b/tslint.json @@ -4,6 +4,7 @@ ], "rules": { "indent": [true, "spaces", 2], + "max-classes-per-file": false, "no-console": false, "no-var-requires": false, "semicolon": [true, "never"],