update BlockchainNotification event values to match BlockchainLinkTransaction

pull/282/head
Szymon Lesisz 5 years ago
parent 7ad19dd1c0
commit 24524d7445

@ -135,66 +135,12 @@ export const onNotification = (payload: $ElementType<BlockchainNotification, 'pa
dispatch({
type: PENDING.ADD,
payload: {
type: notification.type,
address: notification.address,
...notification,
deviceState: account.deviceState,
inputs: notification.inputs,
outputs: notification.outputs,
sequence: notification.sequence,
hash: notification.hash,
network: account.network,
currency: notification.currency || account.network, // TODO: how to catch token?
amount: notification.amount,
total: notification.total,
fee: notification.fee,
},
});
// todo: replace "send success" notification with link to explorer
}
// todo: get transaction history here
// console.warn("OnBlAccount", account);
// this event can be triggered multiple times
// // 1. check if pair [txid + address] is already in reducer
// const network: string = payload.coin.shortcut.toLowerCase();
// const address: string = EthereumjsUtil.toChecksumAddress(payload.tx.address);
// const txInfo = await dispatch(Web3Actions.getPendingInfo(network, payload.tx.txid));
// // const exists = getState().pending.filter(p => p.id === payload.tx.txid && p.address === address);
// const exists = getState().pending.filter(p => p.address === address);
// if (exists.length < 1) {
// if (txInfo) {
// dispatch({
// type: PENDING.ADD,
// payload: {
// type: 'send',
// id: payload.tx.txid,
// network,
// currency: 'tETH',
// amount: txInfo.value,
// total: '0',
// tx: {},
// nonce: txInfo.nonce,
// address,
// rejected: false,
// },
// });
// } else {
// // tx info not found (yet?)
// // dispatch({
// // type: PENDING.ADD_UNKNOWN,
// // payload: {
// // network,
// // ...payload.tx,
// // }
// // });
// }
// }
};
export const onError = (network: string): PromiseAction<void> => async (dispatch: Dispatch): Promise<void> => {

@ -532,7 +532,7 @@ export const onSend = (): AsyncAction => async (dispatch: Dispatch, getState: Ge
const blockchainNotification = {
type: 'send',
status: 'pending',
date: '',
confirmations: 0,
address: account.address,
inputs: [
{
@ -554,7 +554,7 @@ export const onSend = (): AsyncAction => async (dispatch: Dispatch, getState: Ge
total: currentState.total,
sequence: nonce,
currency: isToken ? currentState.currency : null,
currency: isToken ? currentState.currency : undefined,
};
dispatch(BlockchainActions.onNotification({

@ -50,20 +50,10 @@ export const onNotification = (payload: $ElementType<BlockchainNotification, 'pa
dispatch({
type: PENDING.ADD,
payload: {
type: notification.type,
address: account.address,
...notification,
deviceState: account.deviceState,
inputs: notification.inputs,
outputs: notification.outputs,
sequence: notification.sequence,
hash: notification.hash,
network: account.network,
currency: account.network,
// amount: notification.amount,
// fee: notification.fee,
amount: toDecimalAmount(notification.amount, DECIMALS),
total: notification.type === 'send' ? toDecimalAmount(notification.total, DECIMALS) : toDecimalAmount(notification.amount, DECIMALS),
fee: toDecimalAmount(notification.fee, DECIMALS),

Loading…
Cancel
Save