Class: Vortex
Type parameters
T : State
Hierarchy
Vortex
Index
Constructors
Accessors
Methods
- addContract
- addNetwork
- addReducer
- loadContract
- loadWeb3
- networksOf
- run
- setCustomState
- subscribeAccount
- factory
- get
Constructors
constructor
⊕ new Vortex(contracts: TruffleContracts |EmbarkContracts, loader: Promise
<any
>, config?: GeneratorConfig<T
>): Vortex
Defined in vortex.ts:29
Instantiate a new Vorte instance. Accessing VortexInstance will give access to the last instanciated Vortex.
Parameters:
Param | Type | Default value | Description |
---|---|---|---|
contracts | TruffleContracts | ||
EmbarkContracts | |||
- | Truffle or Embark Contracts configuration. | ||
loader | Promise <any > |
- | Promise that returns a web3 instance ready to be used. |
Default value config |
GeneratorConfig<T > |
undefined | Configuration arguments for the store generator. |
Returns: Vortex
Accessors
Contracts
getContracts(): EmbarkContracts |TruffleContracts
Defined in vortex.ts:163
Contracts getter
Returns: EmbarkContracts | TruffleContracts
Array of loaded artifacts.
Networks
getNetworks(): number
[]
Defined in vortex.ts:183
Network Id Whitelist getter.
Returns: number
[]
List of whitelisted network ids.
Store
getStore(): Store
<T
>
Defined in vortex.ts:172
Store getter
Returns: Store
<T
>
Instance of Store
Methods
addContract
▸ addContract(contract: any
): void
Defined in vortex.ts:73
Add a new contract in contract list.
Parameters:
Param | Type | Description |
---|---|---|
contract | any |
Contract to add. |
Returns: void
addNetwork
▸ addNetwork(network_id: number
): void
Defined in vortex.ts:94
Adds a network id to whitelist.
Parameters:
Param | Type | Description |
---|---|---|
network_id | number |
Network Id to add. |
Returns: void
addReducer
▸ addReducer(field: string
, reducer: Reducer
<any
, any
>): void
Defined in vortex.ts:114
Add a new reducer in the Reducer Map.
Parameters:
Param | Type | Description |
---|---|---|
field | string |
Field Name associated with reducer. |
reducer | Reducer <any , any > |
Reducer |
Returns: void
loadContract
▸ loadContract(contractName: string
, contractAddress: string
): void
Defined in vortex.ts:137
Load a new instance of a Smart Contract. Expect a new Feed element and the contracts section to get updated.
Parameters:
Param | Type | Description |
---|---|---|
contractName | string |
- |
contractAddress | string |
Returns: void
loadWeb3
▸ loadWeb3(): void
Defined in vortex.ts:60
Load Web3 instance from given source.
Returns: void
networksOf
▸ networksOf(contract: ContractArtifact
): void
Defined in vortex.ts:104
Takes a Truffle Contract Artifact and extracts all network ids where Contract has instances, adds them to whitelist If you are using Embark, Network checks will be done depending on your chains.json.
Parameters:
Param | Type | Description |
---|---|---|
contract | ContractArtifact |
A Truffle Contract Artifact |
Returns: void
run
▸ run(): void
Defined in vortex.ts:48
Run the Vortex Redux Store.
Returns: void
setCustomState
▸ setCustomState(customState: DeepPartial
<T
>): void
Defined in vortex.ts:126
Custom Initial State, useful when adding custom properties.
Parameters:
Param | Type | Description |
---|---|---|
customState | DeepPartial <T > |
Returns: void
subscribeAccount
▸ subscribeAccount(address: string
): void
Defined in vortex.ts:150
Add a new contract to fetch pool.
Parameters:
Param | Type | Description |
---|---|---|
address | string |
Address to fetch |
Returns: void
<Static>
factory
▸ factoryU(contracts: TruffleContracts |EmbarkContracts, loader: Promise
<any
>, config?: GeneratorConfig<U
>): Vortex<U
>
Defined in vortex.ts:23
Type parameters:
U : State
Parameters:
Param | Type | Default value |
---|---|---|
contracts | TruffleContracts | |
EmbarkContracts | ||
- | ||
loader | Promise <any > |
- |
Default value config |
GeneratorConfig<U > |
undefined |
Returns: Vortex<U
>
<Static>
get
▸ getU(): Vortex<U
>
Defined in vortex.ts:27
Type parameters:
U : State
Returns: Vortex<U
>