MyCrypto/common/actions/contracts.js
William O'Beirne e3505fd958 Contracts Tab Scaffolding (#70)
* Empty component, routes setup.

* Shared components for all Contracts inputs. Dont do anything yet.

* Check in reducer work so far. Still WIP.

* Header styling

* Check in input work so far, splitting to new branch.

* Strip down contracts inputs. Split out into form and explorer

* Contract selector

* Constantized config actions to use in contract saga.

* Interact explorer UI, no functionality

* Convert to constants, hook up errors

* Deploy and style cleanup.

* Remove unnecessary class.

* Fix flow errors with css modules

* Attempt at fixing all newly introduced flow errors in the contracts branch.

* Removed unused validator.

* Remove action constants, fix flow specificity in reducers

* Fix unit tests

* Move network contracts out of redux / sagas, and read directly from state with a selector in mapStateToProps.

* Fix initialState -> INITIAL_STATE rename

* foreach push -> concat
2017-07-27 19:31:59 -05:00

48 lines
868 B
JavaScript

// @flow
/***** Access Contract *****/
export type AccessContractAction = {
type: 'ACCESS_CONTRACT',
address: string,
abiJson: string
};
export function accessContract(
address: string,
abiJson: string
): AccessContractAction {
return {
type: 'ACCESS_CONTRACT',
address,
abiJson
};
}
/***** Set Interactive Contract *****/
export type ABIFunctionField = {
name: string,
type: string
};
export type ABIFunction = {
name: string,
type: string,
constant: boolean,
inputs: Array<ABIFunctionField>,
outputs: Array<ABIFunctionField>
};
export type SetInteractiveContractAction = {
type: 'SET_INTERACTIVE_CONTRACT',
functions: Array<ABIFunction>
};
export function setInteractiveContract(
functions: Array<ABIFunction>
): SetInteractiveContractAction {
return {
type: 'SET_INTERACTIVE_CONTRACT',
functions
};
}