mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-02-17 05:26:36 +00:00
Redux: Add SWAP_RECEIVING_ADDRESS action creators/reducers.
This commit is contained in:
parent
cb36331c2d
commit
bc9765d99b
@ -4,7 +4,8 @@ import {
|
||||
SWAP_ORIGIN_AMOUNT,
|
||||
SWAP_ORIGIN_KIND,
|
||||
SWAP_UPDATE_BITY_RATES,
|
||||
SWAP_PART_ONE_COMPLETE
|
||||
SWAP_PART_ONE_COMPLETE,
|
||||
SWAP_RECEIVING_ADDRESS
|
||||
} from './swapConstants';
|
||||
|
||||
export const originKindSwap = value => {
|
||||
@ -48,3 +49,10 @@ export const partOneCompleteSwap = (value: boolean) => {
|
||||
value
|
||||
};
|
||||
};
|
||||
|
||||
export const receivingAddressSwap = value => {
|
||||
return {
|
||||
type: SWAP_RECEIVING_ADDRESS,
|
||||
value
|
||||
};
|
||||
};
|
||||
|
@ -4,3 +4,4 @@ export const SWAP_ORIGIN_AMOUNT = 'SWAP_ORIGIN_AMOUNT';
|
||||
export const SWAP_DESTINATION_AMOUNT = 'SWAP_DESTINATION_AMOUNT';
|
||||
export const SWAP_UPDATE_BITY_RATES = 'SWAP_UPDATE_BITY_RATES';
|
||||
export const SWAP_PART_ONE_COMPLETE = 'SWAP_PART_ONE_COMPLETE';
|
||||
export const SWAP_RECEIVING_ADDRESS = 'SWAP_RECEIVING_ADDRESS';
|
||||
|
@ -4,7 +4,8 @@ import {
|
||||
SWAP_ORIGIN_AMOUNT,
|
||||
SWAP_ORIGIN_KIND,
|
||||
SWAP_UPDATE_BITY_RATES,
|
||||
SWAP_PART_ONE_COMPLETE
|
||||
SWAP_PART_ONE_COMPLETE,
|
||||
SWAP_RECEIVING_ADDRESS
|
||||
} from 'actions/swapConstants';
|
||||
import { combineAndUpper } from 'api/bity';
|
||||
|
||||
@ -22,7 +23,8 @@ const initialState = {
|
||||
element => element !== 'REP'
|
||||
),
|
||||
partOneComplete: false,
|
||||
bityRates: {}
|
||||
bityRates: {},
|
||||
receivingAddress: ''
|
||||
};
|
||||
|
||||
const buildDestinationAmount = (
|
||||
@ -101,6 +103,11 @@ export function swap(state = initialState, action) {
|
||||
...state,
|
||||
partOneComplete: action.value
|
||||
};
|
||||
case SWAP_RECEIVING_ADDRESS:
|
||||
return {
|
||||
...state,
|
||||
receivingAddress: action.value
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user