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