|
|
@ -72,35 +72,35 @@ export function getStakingTransactionByField(params: [number, "hash", string]) { |
|
|
|
|
|
|
|
|
|
|
|
export function getInternalTransactionsByField(params: any[], blockNumber?: string) { |
|
|
|
export function getInternalTransactionsByField(params: any[], blockNumber?: string) { |
|
|
|
// fallback to rpc as we don't keep old records older than 34000000 any more in postgres
|
|
|
|
// fallback to rpc as we don't keep old records older than 34000000 any more in postgres
|
|
|
|
if (!blockNumber || +blockNumber < 34000000) { |
|
|
|
// if (!blockNumber || +blockNumber < 34000000) {
|
|
|
|
const queryType = params[1] |
|
|
|
// const queryType = params[1]
|
|
|
|
if (queryType !== 'transaction_hash') { |
|
|
|
// if (queryType !== 'transaction_hash') {
|
|
|
|
console.error('use only transaction hash to get internal transactions') |
|
|
|
// console.error('use only transaction hash to get internal transactions')
|
|
|
|
return [] as InternalTransaction[] |
|
|
|
// return [] as InternalTransaction[]
|
|
|
|
} |
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
const txHash = params[2] |
|
|
|
// const txHash = params[2]
|
|
|
|
//
|
|
|
|
// //
|
|
|
|
console.info('internal transactions is not available to serve') |
|
|
|
// console.info('internal transactions is not available to serve')
|
|
|
|
return [] as InternalTransaction[] |
|
|
|
// return [] as InternalTransaction[]
|
|
|
|
// todo note check error field may not work properly
|
|
|
|
// // todo note check error field may not work properly
|
|
|
|
/* return eth_traceTransaction(txHash).then(txs => { |
|
|
|
// /* return eth_traceTransaction(txHash).then(txs => {
|
|
|
|
const mapTxs = txs.map((tx: any, i: number) => ({ |
|
|
|
// const mapTxs = txs.map((tx: any, i: number) => ({
|
|
|
|
type: tx.action.type || tx.type, |
|
|
|
// type: tx.action.type || tx.type,
|
|
|
|
value: tx.value, |
|
|
|
// value: tx.value,
|
|
|
|
input: tx.action.input, |
|
|
|
// input: tx.action.input,
|
|
|
|
output: tx.result.output, |
|
|
|
// output: tx.result.output,
|
|
|
|
transactionHash: tx.transactionHash, |
|
|
|
// transactionHash: tx.transactionHash,
|
|
|
|
gasUsed: tx.result.gasUsed, |
|
|
|
// gasUsed: tx.result.gasUsed,
|
|
|
|
index: i, |
|
|
|
// index: i,
|
|
|
|
to: tx.action.to, |
|
|
|
// to: tx.action.to,
|
|
|
|
from: tx.action.from, |
|
|
|
// from: tx.action.from,
|
|
|
|
error: tx.result.error, |
|
|
|
// error: tx.result.error,
|
|
|
|
gas: tx.action.gas |
|
|
|
// gas: tx.action.gas
|
|
|
|
})) |
|
|
|
// }))
|
|
|
|
return mapTxs as InternalTransaction[] |
|
|
|
// return mapTxs as InternalTransaction[]
|
|
|
|
}) */ |
|
|
|
// }) */
|
|
|
|
} |
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
return transport("getInternalTransactionsByField", params) as Promise<InternalTransaction[]>; |
|
|
|
return transport("getInternalTransactionsByField", params) as Promise<InternalTransaction[]>; |
|
|
|
} |
|
|
|
} |
|
|
|