MyCrypto/common/actions/swap.js

105 lines
1.9 KiB
JavaScript
Raw Normal View History

// @flow
import {
SWAP_DESTINATION_AMOUNT,
SWAP_DESTINATION_KIND,
SWAP_ORIGIN_AMOUNT,
SWAP_ORIGIN_KIND,
SWAP_UPDATE_BITY_RATES,
2017-07-02 05:45:22 +00:00
SWAP_DESTINATION_ADDRESS,
SWAP_RESTART,
SWAP_LOAD_BITY_RATES,
SWAP_STOP_LOAD_BITY_RATES,
SWAP_STEP,
SWAP_REFERENCE_NUMBER
} from './swapConstants';
2017-06-12 01:00:28 +00:00
import * as swapTypes from './swapTypes';
export function changeStepSwap(value: number): swapTypes.ChangeStepSwapAction {
2017-06-19 05:39:07 +00:00
return {
type: SWAP_STEP,
value
2017-06-19 05:39:07 +00:00
};
}
2017-06-12 01:00:28 +00:00
export function referenceNumberSwap(
value: string
): swapTypes.ReferenceNumberSwapAction {
2017-06-19 05:39:07 +00:00
return {
type: SWAP_REFERENCE_NUMBER,
value
2017-06-19 05:39:07 +00:00
};
}
2017-06-12 01:00:28 +00:00
export const originKindSwap = (
value: string
): swapTypes.OriginKindSwapAction => {
2017-06-19 05:39:07 +00:00
return {
type: SWAP_ORIGIN_KIND,
2017-06-19 05:39:07 +00:00
value
};
2017-06-12 01:00:28 +00:00
};
export const destinationKindSwap = (
value: string
): swapTypes.DestinationKindSwapAction => {
2017-06-19 05:39:07 +00:00
return {
type: SWAP_DESTINATION_KIND,
2017-06-19 05:39:07 +00:00
value
};
2017-06-19 00:56:11 +00:00
};
2017-06-12 01:00:28 +00:00
export const originAmountSwap = (
value: ?number
): swapTypes.OriginAmountSwapAction => {
2017-06-19 05:39:07 +00:00
return {
type: SWAP_ORIGIN_AMOUNT,
2017-06-19 05:39:07 +00:00
value
};
2017-06-19 00:56:11 +00:00
};
export const destinationAmountSwap = (
value: ?number
): swapTypes.DestinationAmountSwapAction => {
return {
type: SWAP_DESTINATION_AMOUNT,
value
};
};
export const updateBityRatesSwap = (
value: swapTypes.Pairs
): swapTypes.BityRatesSwapAction => {
return {
type: SWAP_UPDATE_BITY_RATES,
value
};
};
2017-07-02 05:45:22 +00:00
export const destinationAddressSwap = (
value: ?string
): swapTypes.DestinationAddressSwapAction => {
2017-07-02 05:45:22 +00:00
return {
type: SWAP_DESTINATION_ADDRESS,
value
};
};
export const restartSwap = (): swapTypes.RestartSwapAction => {
2017-07-02 05:45:22 +00:00
return {
type: SWAP_RESTART
};
};
export const loadBityRatesSwap = (): swapTypes.LoadBityRatesSwapAction => {
return {
type: SWAP_LOAD_BITY_RATES
};
};
export const stopLoadBityRatesSwap = (): swapTypes.StopLoadBityRatesSwapAction => {
return {
type: SWAP_STOP_LOAD_BITY_RATES
};
};