2021-02-04 19:15:23 +01:00
|
|
|
import { NETWORK_TO_NAME_MAP } from '../../../../shared/constants/network';
|
2018-04-12 23:17:36 +02:00
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
export const getNetworkDisplayName = (key) => NETWORK_TO_NAME_MAP[key];
|
2018-04-12 23:17:36 +02:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
export function formatTxMetaForRpcResult(txMeta) {
|
2019-10-30 23:15:54 +01:00
|
|
|
return {
|
2020-11-03 00:41:28 +01:00
|
|
|
blockHash: txMeta.txReceipt ? txMeta.txReceipt.blockHash : null,
|
|
|
|
blockNumber: txMeta.txReceipt ? txMeta.txReceipt.blockNumber : null,
|
|
|
|
from: txMeta.txParams.from,
|
|
|
|
gas: txMeta.txParams.gas,
|
|
|
|
gasPrice: txMeta.txParams.gasPrice,
|
|
|
|
hash: txMeta.hash,
|
|
|
|
input: txMeta.txParams.data || '0x',
|
|
|
|
nonce: txMeta.txParams.nonce,
|
|
|
|
to: txMeta.txParams.to,
|
|
|
|
transactionIndex: txMeta.txReceipt
|
|
|
|
? txMeta.txReceipt.transactionIndex
|
|
|
|
: null,
|
|
|
|
value: txMeta.txParams.value || '0x0',
|
|
|
|
v: txMeta.v,
|
|
|
|
r: txMeta.r,
|
|
|
|
s: txMeta.s,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2019-10-30 23:15:54 +01:00
|
|
|
}
|