@daostack/clientGlobals

@daostack/client

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

Address

Ƭ Address: string

Defined in types.ts:4


Date

Ƭ Date: number

Defined in types.ts:5


EthereumEvent

Ƭ EthereumEvent: any

Defined in utils.ts:59


Hash

Ƭ Hash: string

Defined in types.ts:6


IPFSProvider

Ƭ IPFSProvider: *string object*

Defined in types.ts:22


IProposalCreateOptions

Ƭ IProposalCreateOptions: *IProposalBaseCreateOptions & IProposalCreateOptionsGS IProposalBaseCreateOptions & IProposalCreateOptionsSR IProposalBaseCreateOptions & IProposalCreateOptionsCR IProposalCreateOptionsContributionRewardExt IProposalCreateOptionsCompetition*

Defined in proposal.ts:882


IProposalType

Ƭ IProposalType: *ContributionReward GenericScheme SchemeRegistrarAdd SchemeRegistrarEdit SchemeRegistrarRemove*

Defined in proposal.ts:31


Operation

Ƭ Operation: IOperationObservableITransactionUpdate‹T››

Defined in operation.ts:38


Web3Provider

Ƭ Web3Provider: *string object*

Defined in types.ts:8


Web3Receipt

Ƭ Web3Receipt: any

Defined in types.ts:7


web3receipt

Ƭ web3receipt: object

Defined in operation.ts:40

Variables

Const ABI_DIR

ABI_DIR: ”./abis” = “./abis”

Defined in settings.ts:8


Const DAOTOKEN_CONTRACT_VERSION

DAOTOKEN_CONTRACT_VERSION: “0.0.1-rc.19” = “0.0.1-rc.19”

Defined in settings.ts:5


Const IPFSClient

IPFSClient: any = require(‘ipfs-http-client’)

Defined in arc.ts:18


Const LATEST_ARC_VERSION

LATEST_ARC_VERSION: “0.0.1-rc.19” = “0.0.1-rc.19”

Defined in settings.ts:6


Const NULL_ADDRESS

NULL_ADDRESS: “0x0000000000000000000000000000000000000000” = “0x0000000000000000000000000000000000000000”

Defined in utils.ts:97


Const REDEEMER_CONTRACT_VERSION

REDEEMER_CONTRACT_VERSION: “0.0.1-rc.36” = “0.0.1-rc.36”

Defined in settings.ts:2


Const REPUTATION_CONTRACT_VERSION

REPUTATION_CONTRACT_VERSION: “0.0.1-rc.19” = “0.0.1-rc.19”

Defined in settings.ts:4


Const Web3

Web3: any = require(‘web3’)

Defined in utils.ts:5

Defined in schemes/competition.ts:20

Defined in arc.ts:19

Functions

checkWebsocket

checkWebsocket(options: object): void

Defined in utils.ts:16

Parameters:

options: object

Name Type
url string

Returns: void


concat

concat(a: Uint8Array, b: Uint8Array): Uint8Array

Defined in utils.ts:47

Parameters:

Name Type
a Uint8Array
b Uint8Array

Returns: Uint8Array


createApolloClient

createApolloClient(options: object): ApolloClient‹NormalizedCacheObject›

Defined in graphnode.ts:26

Parameters:

options: object

Name Type
graphqlHttpProvider string
graphqlPrefetchHook? any
graphqlWsProvider string

Returns: ApolloClient‹NormalizedCacheObject›


createGraphQlQuery

createGraphQlQuery(options: ICommonQueryOptions, where: string): string

Defined in utils.ts:109

creates a string to be plugsging into a graphql query

example { proposals ${createGraphQlQuery({ skip: 2}, 'id: "2"')} { id } }

Parameters:

Name Type Default
options ICommonQueryOptions -
where string ””

Returns: string


createGraphQlWhereQuery

createGraphQlWhereQuery(where?: undefined object): string

Defined in utils.ts:139

Parameters:

Name Type
where? undefined | object

Returns: string


createProposal

createProposal(options: any, context: Arc): (Anonymous function)

Defined in schemes/contributionReward.ts:37

Parameters:

Name Type Description
options any -
context Arc  

Returns: (Anonymous function)


createTransaction

createTransaction(options: any, context: Arc): (Anonymous function)

Defined in schemes/genericScheme.ts:28

Parameters:

Name Type
options any
context Arc

Returns: (Anonymous function)


createTransactionMap

createTransactionMap(options: any, context: Arc): map

Defined in schemes/contributionReward.ts:61

map the transaction receipt of the createTransaction call to a nice result map the transaction receipt of the createTransaction call to a nice result map the transaction receipt of the createTransaction call to a nice result

Parameters:

Name Type Description
options any the options passed to the createProposal call
context Arc an Arc instance

Returns: map


dateToSecondsSinceEpoch

dateToSecondsSinceEpoch(date: Date): number

Defined in utils.ts:164

Parameters:

Name Type
date Date

Returns: number


eventId

eventId(event: EthereumEvent): string

Defined in utils.ts:61

Parameters:

Name Type
event EthereumEvent

Returns: string


fromWei

fromWei(amount: BN): string

Defined in utils.ts:8

Parameters:

Name Type
amount BN

Returns: string


getBlockTime

getBlockTime(web3: any): Promise‹Date›

Defined in utils.ts:191

get the latest block time, or the current time, whichver is later

export

Parameters:

Name Type
web3 any

Returns: Promise‹Date›


getCompetitionContract

getCompetitionContract(schemeState: ISchemeState, arc: Arc): any

Defined in schemes/competition.ts:780

If this scheme is a ContributionREwardExt scheme and if its rewarder is Competition contract, return that contract

Parameters:

Name Type
schemeState ISchemeState
arc Arc

Returns: any

A Web3 contract instance


hasCompetitionContract

hasCompetitionContract(schemeState: ISchemeState, arc: Arc): boolean

Defined in schemes/competition.ts:808

Parameters:

Name Type
schemeState ISchemeState
arc Arc

Returns: boolean

true if this is a ContributionRewardExt scheme and the rewarder of this scheme is a competition contract


hexStringToUint8Array

hexStringToUint8Array(hexString: string): Uint8Array‹›

Defined in utils.ts:38

Parameters:

Name Type
hexString string

Returns: Uint8Array‹›


isAddress

isAddress(address: Address): void

Defined in utils.ts:66

Parameters:

Name Type
address Address

Returns: void


isCompetitionScheme

isCompetitionScheme(arc: Arc, item: any): boolean

Defined in schemes/competition.ts:796

Parameters:

Name Type
arc Arc
item any

Returns: boolean


mapGenesisProtocolParams

mapGenesisProtocolParams(params: IGenesisProtocolParams): object

Defined in genesisProtocol.ts:19

Parameters:

Name Type
params IGenesisProtocolParams

Returns: object


realMathToNumber

realMathToNumber(t: BN): number

Defined in utils.ts:91

convert the number representation of RealMath.sol representations to real real numbers

Parameters:

Name Type Description
t BN a BN instance of a real number in the RealMath representation

Returns: number

a BN


secondSinceEpochToDate

secondSinceEpochToDate(seconds: number): Date

Defined in utils.ts:172

Parameters:

Name Type
seconds number

Returns: Date


sendTransaction

sendTransaction<T>(context: Arc, transaction: any, mapReceipt: function, errorHandler?: undefined function): Operation‹T›

Defined in operation.ts:74

export

template T

Type parameters:

T

Parameters:

context: Arc

An instance of Arc

transaction: any

A Web3 transaction object to send

mapReceipt: function

A function that takes the receipt of the transaction and returns an object

▸ (receipt: web3receipt): *T Promise‹T›*

Parameters:

Name Type
receipt web3receipt
Optional errorHandler: *undefined function*

Returns: Operation‹T›


toIOperationObservable

toIOperationObservable<T>(observable: Observable‹T›): IOperationObservable‹T›

Defined in operation.ts:211

Type parameters:

T

Parameters:

Name Type
observable Observable‹T›

Returns: IOperationObservable‹T›


toWei

toWei(amount: string number): BN

Defined in utils.ts:12

Parameters:

Name Type
amount string | number

Returns: BN


zenToRxjsObservable

zenToRxjsObservable(zenObservable: ZenObservable‹any›): any

Defined in utils.ts:80

convert a ZenObservable to an rxjs.Observable

Parameters:

Name Type
zenObservable ZenObservable‹any›

Returns: any

an Observable instance

Object literals

Const IProposalType

IProposalType: object

Defined in schemes/contributionReward.ts:33

Defined in schemes/contributionRewardExt.ts:32

Defined in schemes/genericScheme.ts:24

Defined in schemes/schemeRegistrar.ts:22

Defined in schemes/uGenericScheme.ts:23

Defined in proposal.ts:25

ContributionReward

ContributionReward: = “ContributionRewardExt”

Defined in schemes/contributionReward.ts:34

Defined in schemes/contributionRewardExt.ts:33

GenericScheme

GenericScheme: = “UGenericScheme”

Defined in schemes/genericScheme.ts:25

Defined in schemes/uGenericScheme.ts:24

SchemeRegistrarAdd

SchemeRegistrarAdd: = “SchemeRegistrarAdd”

Defined in schemes/schemeRegistrar.ts:23

SchemeRegistrarEdit

SchemeRegistrarEdit: = “SchemeRegistrarEdit”

Defined in schemes/schemeRegistrar.ts:24

SchemeRegistrarRemove

SchemeRegistrarRemove: = “SchemeRegistrarRemove”

Defined in schemes/schemeRegistrar.ts:25