2017-09-25 02:06:28 +00:00
|
|
|
import * as interfaces from './actionTypes';
|
|
|
|
import { TypeKeys } from './constants';
|
|
|
|
|
|
|
|
export type TChangeStepSwap = typeof changeStepSwap;
|
2017-12-11 17:44:53 +00:00
|
|
|
export function changeStepSwap(payload: number): interfaces.ChangeStepSwapAction {
|
2017-09-25 02:06:28 +00:00
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_STEP,
|
|
|
|
payload
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-12-11 17:44:53 +00:00
|
|
|
export type TInitSwap = typeof initSwap;
|
|
|
|
export function initSwap(payload: interfaces.SwapInputs): interfaces.InitSwap {
|
2017-09-25 02:06:28 +00:00
|
|
|
return {
|
2017-12-11 17:44:53 +00:00
|
|
|
type: TypeKeys.SWAP_INIT,
|
2017-09-25 02:06:28 +00:00
|
|
|
payload
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export type TLoadBityRatesSucceededSwap = typeof loadBityRatesSucceededSwap;
|
|
|
|
export function loadBityRatesSucceededSwap(
|
2017-12-11 17:44:53 +00:00
|
|
|
payload: interfaces.ApiResponse
|
2017-09-25 02:06:28 +00:00
|
|
|
): interfaces.LoadBityRatesSucceededSwapAction {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_LOAD_BITY_RATES_SUCCEEDED,
|
|
|
|
payload
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-02-25 01:29:34 +00:00
|
|
|
export type TLoadShapeshiftRatesSucceededSwap = typeof loadShapeshiftRatesSucceededSwap;
|
2018-01-02 18:04:50 +00:00
|
|
|
export function loadShapeshiftRatesSucceededSwap(
|
2018-03-07 23:36:05 +00:00
|
|
|
payload: interfaces.LoadShapeshiftRatesSucceededSwapAction['payload']
|
2018-02-25 01:29:34 +00:00
|
|
|
): interfaces.LoadShapeshiftRatesSucceededSwapAction {
|
2018-01-02 18:04:50 +00:00
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_LOAD_SHAPESHIFT_RATES_SUCCEEDED,
|
|
|
|
payload
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
export type TDestinationAddressSwap = typeof destinationAddressSwap;
|
2017-12-11 17:44:53 +00:00
|
|
|
export function destinationAddressSwap(payload?: string): interfaces.DestinationAddressSwapAction {
|
2017-09-25 02:06:28 +00:00
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_DESTINATION_ADDRESS,
|
|
|
|
payload
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export type TRestartSwap = typeof restartSwap;
|
|
|
|
export function restartSwap(): interfaces.RestartSwapAction {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_RESTART
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export type TLoadBityRatesRequestedSwap = typeof loadBityRatesRequestedSwap;
|
|
|
|
export function loadBityRatesRequestedSwap(): interfaces.LoadBityRatesRequestedSwapAction {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_LOAD_BITY_RATES_REQUESTED
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-02-25 01:29:34 +00:00
|
|
|
export type TLoadShapeshiftRatesRequestedSwap = typeof loadShapeshiftRatesRequestedSwap;
|
|
|
|
export function loadShapeshiftRatesRequestedSwap(): interfaces.LoadShapeshiftRatesRequestedSwapAction {
|
2018-01-02 18:04:50 +00:00
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_LOAD_SHAPESHIFT_RATES_REQUESTED
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-02-25 01:29:34 +00:00
|
|
|
export type TLoadBityRatesFailedSwap = typeof loadBityRatesFailedSwap;
|
|
|
|
export function loadBityRatesFailedSwap(): interfaces.LoadBityRatesFailedSwapAction {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_LOAD_BITY_RATES_FAILED
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export type TLoadShapeshiftFailedSwap = typeof loadShapeshiftRatesFailedSwap;
|
|
|
|
export function loadShapeshiftRatesFailedSwap(): interfaces.LoadShapeshiftRatesFailedSwapAction {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_LOAD_SHAPESHIFT_RATES_FAILED
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
export type TStopLoadBityRatesSwap = typeof stopLoadBityRatesSwap;
|
|
|
|
export function stopLoadBityRatesSwap(): interfaces.StopLoadBityRatesSwapAction {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_STOP_LOAD_BITY_RATES
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-01-02 18:04:50 +00:00
|
|
|
export type TStopLoadShapeshiftRatesSwap = typeof stopLoadShapeshiftRatesSwap;
|
|
|
|
export function stopLoadShapeshiftRatesSwap(): interfaces.StopLoadShapeshiftRatesSwapAction {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_STOP_LOAD_SHAPESHIFT_RATES
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
export type TOrderTimeSwap = typeof orderTimeSwap;
|
2017-12-11 17:44:53 +00:00
|
|
|
export function orderTimeSwap(payload: number): interfaces.OrderSwapTimeSwapAction {
|
2017-09-25 02:06:28 +00:00
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_ORDER_TIME,
|
|
|
|
payload
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export type TBityOrderCreateSucceededSwap = typeof bityOrderCreateSucceededSwap;
|
|
|
|
export function bityOrderCreateSucceededSwap(
|
|
|
|
payload: interfaces.BityOrderPostResponse
|
|
|
|
): interfaces.BityOrderCreateSucceededSwapAction {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_BITY_ORDER_CREATE_SUCCEEDED,
|
|
|
|
payload
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-01-02 18:04:50 +00:00
|
|
|
export type TShapeshiftOrderCreateSucceededSwap = typeof shapeshiftOrderCreateSucceededSwap;
|
|
|
|
export function shapeshiftOrderCreateSucceededSwap(
|
|
|
|
payload: interfaces.ShapeshiftOrderResponse
|
|
|
|
): interfaces.ShapeshiftOrderCreateSucceededSwapAction {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_SHAPESHIFT_ORDER_CREATE_SUCCEEDED,
|
|
|
|
payload
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
export type TBityOrderCreateRequestedSwap = typeof bityOrderCreateRequestedSwap;
|
|
|
|
export function bityOrderCreateRequestedSwap(
|
|
|
|
amount: number,
|
|
|
|
destinationAddress: string,
|
|
|
|
pair: string,
|
|
|
|
mode: number = 0
|
|
|
|
): interfaces.BityOrderCreateRequestedSwapAction {
|
|
|
|
return {
|
2018-01-02 18:04:50 +00:00
|
|
|
type: TypeKeys.SWAP_BITY_ORDER_CREATE_REQUESTED,
|
2017-09-25 02:06:28 +00:00
|
|
|
payload: {
|
|
|
|
amount,
|
|
|
|
destinationAddress,
|
|
|
|
pair,
|
|
|
|
mode
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-01-02 18:04:50 +00:00
|
|
|
export type TShapeshiftOrderCreateRequestedSwap = typeof shapeshiftOrderCreateRequestedSwap;
|
|
|
|
export function shapeshiftOrderCreateRequestedSwap(
|
|
|
|
withdrawal: string,
|
|
|
|
originKind: string,
|
|
|
|
destinationKind: string,
|
|
|
|
destinationAmount: number
|
|
|
|
): interfaces.ShapeshiftOrderCreateRequestedSwapAction {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_SHAPESHIFT_ORDER_CREATE_REQUESTED,
|
|
|
|
payload: {
|
|
|
|
withdrawal,
|
|
|
|
originKind,
|
|
|
|
destinationKind,
|
|
|
|
destinationAmount
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
export function bityOrderCreateFailedSwap(): interfaces.BityOrderCreateFailedSwapAction {
|
|
|
|
return {
|
2018-01-02 18:04:50 +00:00
|
|
|
type: TypeKeys.SWAP_BITY_ORDER_CREATE_FAILED
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function shapeshiftOrderCreateFailedSwap(): interfaces.ShapeshiftOrderCreateFailedSwapAction {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_SHAPESHIFT_ORDER_CREATE_FAILED
|
2017-09-25 02:06:28 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-01-02 18:04:50 +00:00
|
|
|
export type TBityOrderStatusSucceededSwap = typeof bityOrderStatusSucceededSwap;
|
|
|
|
export function bityOrderStatusSucceededSwap(
|
2017-09-25 02:06:28 +00:00
|
|
|
payload: interfaces.BityOrderResponse
|
2018-01-02 18:04:50 +00:00
|
|
|
): interfaces.BityOrderStatusSucceededSwapAction {
|
2017-09-25 02:06:28 +00:00
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_BITY_ORDER_STATUS_SUCCEEDED,
|
|
|
|
payload
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-01-02 18:04:50 +00:00
|
|
|
export type TShapeshiftOrderStatusSucceededSwap = typeof shapeshiftOrderStatusSucceededSwap;
|
|
|
|
export function shapeshiftOrderStatusSucceededSwap(
|
|
|
|
payload: interfaces.ShapeshiftStatusResponse
|
|
|
|
): interfaces.ShapeshiftOrderStatusSucceededSwapAction {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_SHAPESHIFT_ORDER_STATUS_SUCCEEDED,
|
|
|
|
payload
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export type TBityOrderStatusRequestedSwap = typeof bityOrderStatusRequested;
|
|
|
|
export function bityOrderStatusRequested(): interfaces.BityOrderStatusRequestedSwapAction {
|
2017-09-25 02:06:28 +00:00
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_BITY_ORDER_STATUS_REQUESTED
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-01-02 18:04:50 +00:00
|
|
|
export type TShapeshiftOrderStatusRequestedSwap = typeof shapeshiftOrderStatusRequested;
|
|
|
|
export function shapeshiftOrderStatusRequested(): interfaces.ShapeshiftOrderStatusRequestedSwapAction {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_SHAPESHIFT_ORDER_STATUS_REQUESTED
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
export type TStartOrderTimerSwap = typeof startOrderTimerSwap;
|
|
|
|
export function startOrderTimerSwap(): interfaces.StartOrderTimerSwapAction {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_ORDER_START_TIMER
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export type TStopOrderTimerSwap = typeof stopOrderTimerSwap;
|
|
|
|
export function stopOrderTimerSwap(): interfaces.StopOrderTimerSwapAction {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_ORDER_STOP_TIMER
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export type TStartPollBityOrderStatus = typeof startPollBityOrderStatus;
|
|
|
|
export function startPollBityOrderStatus(): interfaces.StartPollBityOrderStatusAction {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_START_POLL_BITY_ORDER_STATUS
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-01-02 18:04:50 +00:00
|
|
|
export type TStartPollShapeshiftOrderStatus = typeof startPollShapeshiftOrderStatus;
|
|
|
|
export function startPollShapeshiftOrderStatus(): interfaces.StartPollShapeshiftOrderStatusAction {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_START_POLL_SHAPESHIFT_ORDER_STATUS
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
export type TStopPollBityOrderStatus = typeof stopPollBityOrderStatus;
|
|
|
|
export function stopPollBityOrderStatus(): interfaces.StopPollBityOrderStatusAction {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_STOP_POLL_BITY_ORDER_STATUS
|
|
|
|
};
|
|
|
|
}
|
2018-01-02 18:04:50 +00:00
|
|
|
|
|
|
|
export type TStopPollShapeshiftOrderStatus = typeof stopPollShapeshiftOrderStatus;
|
|
|
|
export function stopPollShapeshiftOrderStatus(): interfaces.StopPollShapeshiftOrderStatusAction {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_STOP_POLL_SHAPESHIFT_ORDER_STATUS
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export type TConfigureLiteSend = typeof configureLiteSend;
|
|
|
|
export function configureLiteSend(): interfaces.ConfigureLiteSendAction {
|
|
|
|
return { type: TypeKeys.SWAP_CONFIGURE_LITE_SEND };
|
|
|
|
}
|
|
|
|
|
|
|
|
export type TShowLiteSend = typeof showLiteSend;
|
|
|
|
export function showLiteSend(
|
|
|
|
payload: interfaces.ShowLiteSendAction['payload']
|
|
|
|
): interfaces.ShowLiteSendAction {
|
|
|
|
return { type: TypeKeys.SWAP_SHOW_LITE_SEND, payload };
|
|
|
|
}
|
|
|
|
|
|
|
|
export type TChangeSwapProvider = typeof changeSwapProvider;
|
|
|
|
export function changeSwapProvider(
|
|
|
|
payload: interfaces.ProviderName
|
|
|
|
): interfaces.ChangeProviderSwapAcion {
|
|
|
|
return {
|
|
|
|
type: TypeKeys.SWAP_CHANGE_PROVIDER,
|
|
|
|
payload
|
|
|
|
};
|
|
|
|
}
|