From e90ce936cfa8a2037147cb62146ff16af4482bbb Mon Sep 17 00:00:00 2001 From: ponyjackal Date: Fri, 26 Jan 2024 03:56:41 -0800 Subject: [PATCH] feat: update transactionParties --- package-lock.json | 74 ++++++++++++++++ package.json | 1 + src/helpers/utils.ts | 11 +++ src/transformers/_common/blockGasUsage.ts | 11 +-- src/transformers/_common/contractABI.ts | 31 ++++++- .../_common/transactionNetAssetTransfers.ts | 86 ++++++++++++------- .../_common/transactionParties.ts | 62 +++++++++---- .../_common/transactionProxyUpgrades.ts | 8 +- .../_common/transactionSigHash.ts | 6 +- .../_common/transactionTimestamp.ts | 2 +- src/types/assetTransfer.ts | 78 +++++++++++++++-- src/types/block.ts | 2 + src/types/contract.ts | 4 +- src/types/log.ts | 6 +- src/types/shared.ts | 50 ++++++++++- src/types/transaction.ts | 8 +- 16 files changed, 358 insertions(+), 82 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5f511b2..2f2e15d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.1", "license": "MIT", "dependencies": { + "@shazow/whatsabi": "^0.11.0", "commander": "^11.1.0", "dotenv": "^16.3.1", "handlebars": "^4.7.8", @@ -1373,6 +1374,17 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/@shazow/whatsabi": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@shazow/whatsabi/-/whatsabi-0.11.0.tgz", + "integrity": "sha512-dIjhgynJeqPLwSI179E37yFElq+IDyy6xBk9fthkhZp/NO6o2AvtJUq9hWotCBNX/ZQzh6ak7CmdHevwralW8w==", + "dependencies": { + "ethers": "^6.10.0" + }, + "peerDependencies": { + "@noble/hashes": "^1" + } + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -1764,6 +1776,11 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/aes-js": { + "version": "4.0.0-beta.5", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", + "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==" + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -2715,6 +2732,63 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/ethers": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.10.0.tgz", + "integrity": "sha512-nMNwYHzs6V1FR3Y4cdfxSQmNgZsRj1RiTU25JwvnJLmyzw9z3SKxNc2XKDuiXXo/v9ds5Mp9m6HBabgYQQ26tA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/ethers-io/" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@adraffy/ens-normalize": "1.10.0", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.2", + "@types/node": "18.15.13", + "aes-js": "4.0.0-beta.5", + "tslib": "2.4.0", + "ws": "8.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/ethers/node_modules/@types/node": { + "version": "18.15.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", + "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==" + }, + "node_modules/ethers/node_modules/tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + }, + "node_modules/ethers/node_modules/ws": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", + "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", diff --git a/package.json b/package.json index 7fe5c5f..1ee73c5 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "testEnvironment": "node" }, "dependencies": { + "@shazow/whatsabi": "^0.11.0", "commander": "^11.1.0", "dotenv": "^16.3.1", "handlebars": "^4.7.8", diff --git a/src/helpers/utils.ts b/src/helpers/utils.ts index 27750f7..e76ea03 100644 --- a/src/helpers/utils.ts +++ b/src/helpers/utils.ts @@ -160,3 +160,14 @@ export const getTokenDecimals = async (token): Promise => { return 18; } }; + +export function decodeEVMAddress(addressString: string): string { + if (!addressString) return ''; + + const buf = Buffer.from(addressString.replace(/^0x/, ''), 'hex'); + if (!buf.slice(0, 12).equals(Buffer.alloc(12, 0))) { + return ''; + } + const address = '0x' + buf.toString('hex', 12, 32); // grab the last 20 bytes + return address.toLocaleLowerCase(); +} diff --git a/src/transformers/_common/blockGasUsage.ts b/src/transformers/_common/blockGasUsage.ts index e22a9f6..5fe0406 100644 --- a/src/transformers/_common/blockGasUsage.ts +++ b/src/transformers/_common/blockGasUsage.ts @@ -1,14 +1,11 @@ -import { toBigNumber } from '../helpers/utils'; -import type { RawBlock } from '../types'; +import type { RawBlock } from '../../types'; export function transform(block: RawBlock) { - const gasUsedPercentage = toBigNumber(block.gasUsed) - .multipliedBy(100) - .dividedBy(toBigNumber(block.gasLimit)) - .toString(); + const gasUsedPercentage = + (BigInt(block.gasUsed) * BigInt(100)) / BigInt(block.gasLimit); return { number: block.number, - gasUsedPercentage, + gasUsedPercentage: gasUsedPercentage.toString(), }; } diff --git a/src/transformers/_common/contractABI.ts b/src/transformers/_common/contractABI.ts index cddb9ee..2ece9c7 100644 --- a/src/transformers/_common/contractABI.ts +++ b/src/transformers/_common/contractABI.ts @@ -1,5 +1,5 @@ import { whatsabi } from '@shazow/whatsabi'; -import type { Contract, RawBlock, TransactionContract } from '../types'; +import type { Contract, RawBlock, TransactionContract } from '../../types'; export function transform(block: RawBlock): TransactionContract[] { const results: { hash: string; contracts: Contract[] }[] = []; @@ -12,14 +12,37 @@ export function transform(block: RawBlock): TransactionContract[] { const contracts = tx.contracts .map((txContract) => { try { + if (!txContract.metadata) { + txContract.metadata = { + isUniswapV3: false, + isUniswapV2: false, + isUniswapV1: false, + uniswapPairs: [], + isPropHouseToken: false, + isPropHouseMetadata: false, + isPropHouseAuction: false, + isPropHouseTreasury: false, + isPropHouseGovernor: false, + isGenericGovernance: false, + isGnosisSafe: false, + whatsAbiSelectors: [], + isProxy: false, + whatsAbiAbi: { + type: 'constructor', + }, + }; + } // Get just the callable selectors - txContract.metadata.whatsAbiSelectors = whatsabi.selectorsFromBytecode(txContract.bytecode); + txContract.metadata.whatsAbiSelectors = + whatsabi.selectorsFromBytecode(txContract.bytecode); // Get an ABI-like list of interfaces - txContract.metadata.whatsAbiAbi = whatsabi.abiFromBytecode(txContract.bytecode); + txContract.metadata.whatsAbiAbi = whatsabi.abiFromBytecode( + txContract.bytecode, + ); return txContract; } catch (e) { - return null; + return txContract; } }) .filter((v) => v); diff --git a/src/transformers/_common/transactionNetAssetTransfers.ts b/src/transformers/_common/transactionNetAssetTransfers.ts index 21fc77e..fc44ff7 100644 --- a/src/transformers/_common/transactionNetAssetTransfers.ts +++ b/src/transformers/_common/transactionNetAssetTransfers.ts @@ -1,6 +1,8 @@ -import BigNumber from 'bignumber.js'; -import type { RawBlock, NetAssetTransfer, NetAssetTransfers } from '../types'; -import { toBigNumber } from '../helpers/utils'; +import type { + RawBlock, + NetAssetTransfer, + NetAssetTransfers, +} from '../../types'; export function transform(block: RawBlock) { const results: { hash: string; netAssetTransfers: NetAssetTransfers }[] = []; @@ -12,7 +14,7 @@ export function transform(block: RawBlock) { } const assetsById: Record = {}; - const netAssetsByAddress: Record> = {}; + const netAssetsByAddress: Record> = {}; for (const txfer of assetTransfers) { if (txfer.from === txfer.to || !txfer.from || !txfer.to) { @@ -20,29 +22,41 @@ export function transform(block: RawBlock) { } let asset: NetAssetTransfer; - if (txfer.type === 'erc721' || txfer.type === 'erc1155') { - asset = { - asset: txfer.asset, - id: `${txfer.asset}-${txfer.tokenId}`, - tokenId: txfer.tokenId, - type: txfer.type, - value: txfer.value || '1', - }; - } else if (txfer.type === 'erc20') { - asset = { - asset: txfer.asset, - id: txfer.asset, - tokenId: txfer.tokenId, - type: txfer.type, - value: txfer.value, - }; - } else if (txfer.type === 'eth') { - asset = { - asset: 'eth', - id: 'eth', - type: txfer.type, - value: txfer.value, - }; + switch (txfer.type) { + case 'erc721': + asset = { + asset: txfer.asset, + id: `${txfer.asset}-${txfer.tokenId}`, + tokenId: txfer.tokenId, + type: txfer.type, + value: '1', + }; + break; + case 'erc1155': + asset = { + asset: txfer.asset, + id: `${txfer.asset}-${txfer.tokenId}`, + tokenId: txfer.tokenId, + type: txfer.type, + value: txfer.value, + }; + break; + case 'erc20': + asset = { + asset: txfer.asset, + id: `${txfer.asset}`, + type: txfer.type, + value: txfer.value, + }; + break; + case 'eth': + asset = { + asset: 'eth', + id: 'eth', + type: txfer.type, + value: txfer.value, + }; + break; } if (!asset.id || !asset.value || asset.value === '0') { @@ -63,8 +77,12 @@ export function transform(block: RawBlock) { } assetsById[asset.id] = asset; - netAssetsByAddress[txfer.from][asset.id] = netAssetsByAddress[txfer.from][asset.id].minus(asset.value); - netAssetsByAddress[txfer.to][asset.id] = netAssetsByAddress[txfer.to][asset.id].plus(asset.value); + netAssetsByAddress[txfer.from][asset.id] = netAssetsByAddress[txfer.from][ + asset.id + ].minus(asset.value); + netAssetsByAddress[txfer.to][asset.id] = netAssetsByAddress[txfer.to][ + asset.id + ].plus(asset.value); } const netAssetTransfers: NetAssetTransfers = {}; @@ -77,9 +95,15 @@ export function transform(block: RawBlock) { netAssetTransfers[address] = { received: [], sent: [] }; } if (value.lt(0)) { - netAssetTransfers[address].sent.push({ ...assetsById[id], value: value.multipliedBy(-1).toString() }); + netAssetTransfers[address].sent.push({ + ...assetsById[id], + value: value.multipliedBy(-1).toString(), + }); } else { - netAssetTransfers[address].received.push({ ...assetsById[id], value: value.toString() }); + netAssetTransfers[address].received.push({ + ...assetsById[id], + value: value.toString(), + }); } } } diff --git a/src/transformers/_common/transactionParties.ts b/src/transformers/_common/transactionParties.ts index 3be2d53..ea2541b 100644 --- a/src/transformers/_common/transactionParties.ts +++ b/src/transformers/_common/transactionParties.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-unsafe-call */ -import type { RawBlock } from '../types'; +import type { RawBlock } from '../../types'; type TransactionWithParties = { hash: string; @@ -16,9 +16,15 @@ export function transform(block: RawBlock): TransactionWithParties[] { parties = [...parties, tx.to.toLowerCase()]; } // address from input data - const inputAddresses = tx.decode?.fragment.inputs - .map((param, index) => (param.type === 'address' ? tx.decode?.args[index].toLowerCase() : '')) - .filter((address) => address !== ''); + const inputAddresses: string[] = tx.decode + ? tx.decode.fragment.inputs + .map((param, index) => + param.type === 'address' && tx.decode + ? tx.decode.args[index].toLowerCase() + : '', + ) + .filter((address) => address !== '') + : []; // addresses from traces const traceParties = tx.traces.map((trace) => { let result: string[] = []; @@ -29,14 +35,21 @@ export function transform(block: RawBlock): TransactionWithParties[] { result = [...result, trace.action.to.toLowerCase()]; } if (trace.type === 'suicide') { - result = [...result, trace.action.address.toLowerCase(), trace.action.refundAddress.toLowerCase()]; + result = [...result, trace.action.address.toLowerCase()]; + if (trace.action.refundAddress) { + result = [...result, trace.action.refundAddress.toLowerCase()]; + } } // grab event inputs params from decoded trace - const partiesFromTrace: string[] = trace.decode?.fragment.inputs - .map((param, index) => (param.type === 'address' ? trace.decode.args[index].toLowerCase() : '')) + const partiesFromTrace = trace.decode?.fragment.inputs + .map((param, index) => + param.type === 'address' && trace.decode + ? trace.decode.args[index].toLowerCase() + : '', + ) .filter((address) => address !== ''); - if (partiesFromTrace?.length > 0) { + if (partiesFromTrace && partiesFromTrace.length > 0) { result = [...result, ...partiesFromTrace]; } return result; @@ -45,11 +58,15 @@ export function transform(block: RawBlock): TransactionWithParties[] { const logParties = tx.receipt.logs.map((log) => { let result = [log.address.toLowerCase()]; // grab event inputs params from decoded log - const partiesFromLog: string[] = log.decode?.fragment.inputs - .map((param, index) => (param.type === 'address' ? log.decode.args[index].toLowerCase() : '')) + const partiesFromLog = log.decode?.fragment.inputs + .map((param, index) => + param.type === 'address' && log.decode + ? log.decode.args[index].toLowerCase() + : '', + ) .filter((address) => address !== ''); - if (partiesFromLog?.length > 0) { + if (partiesFromLog && partiesFromLog.length > 0) { result = [...result, ...partiesFromLog]; } return result; @@ -58,21 +75,30 @@ export function transform(block: RawBlock): TransactionWithParties[] { const nfts = tx.receipt.logs .filter( (log) => - (log.decode?.name === 'Transfer' || log.decode?.name === 'Approval') && - log.decode?.fragment.inputs[2]?.type === 'uint256' + (log.decode?.name === 'Transfer' || + log.decode?.name === 'Approval') && + log.decode?.fragment.inputs[2]?.type === 'uint256', ) .map((log) => `${log.address.toLowerCase()}-${log.decode?.args[2]}`); // contracts created - const contractsCreated: string[] = tx.contracts?.map((contract) => contract.address); - parties = [...parties, ...traceParties.flat(), ...logParties.flat(), ...nfts.flat()]; - if (inputAddresses?.length > 0) { + const contractsCreated = tx.contracts?.map((contract) => contract.address); + parties = [ + ...parties, + ...traceParties.flat(), + ...logParties.flat(), + ...nfts.flat(), + ]; + if (inputAddresses && inputAddresses.length > 0) { parties = [...parties, ...inputAddresses]; } - if (contractsCreated?.length > 0) { + if (contractsCreated && contractsCreated.length > 0) { parties = [...parties, ...contractsCreated]; } - return { hash: tx.hash, parties: [...new Set(parties)].filter((party) => party) }; + return { + hash: tx.hash, + parties: [...new Set(parties)].filter((party) => party), + }; }); return result; diff --git a/src/transformers/_common/transactionProxyUpgrades.ts b/src/transformers/_common/transactionProxyUpgrades.ts index 59e8bfa..2f2e6f6 100644 --- a/src/transformers/_common/transactionProxyUpgrades.ts +++ b/src/transformers/_common/transactionProxyUpgrades.ts @@ -1,6 +1,6 @@ -import type { RawBlock, RawTransaction } from '../types'; +import type { RawBlock, RawTransaction } from '../../types'; import { TRANSPARENT_UPGRADEABLE_PROXY_EVENTS } from '../../helpers/constants'; -import { decodeEVMAddress } from '../helpers/utils'; +import { decodeEVMAddress } from '../../helpers/utils'; type ProxyUpgrade = { hash: string; address: string; upgradedAddress: string }; @@ -9,7 +9,9 @@ function getProxyUpgrades(tx: RawTransaction): ProxyUpgrade[] { for (const log of tx.receipt.logs) { const [signature] = log.topics; // detect upgrade event - if (signature === TRANSPARENT_UPGRADEABLE_PROXY_EVENTS['Upgraded(address)']) { + if ( + signature === TRANSPARENT_UPGRADEABLE_PROXY_EVENTS['Upgraded(address)'] + ) { // store proxy upgrades const address = log.address.toLowerCase(); let upgradedAddress = ''; diff --git a/src/transformers/_common/transactionSigHash.ts b/src/transformers/_common/transactionSigHash.ts index ba7b6ad..1028eca 100644 --- a/src/transformers/_common/transactionSigHash.ts +++ b/src/transformers/_common/transactionSigHash.ts @@ -1,4 +1,8 @@ -import type { RawBlock, TransactionWithHash, InternalHashType } from '../types'; +import type { + RawBlock, + TransactionWithHash, + InternalHashType, +} from '../../types'; export function transform(block: RawBlock): TransactionWithHash[] { const result: TransactionWithHash[] = block.transactions.map((tx) => { diff --git a/src/transformers/_common/transactionTimestamp.ts b/src/transformers/_common/transactionTimestamp.ts index 11bfd90..93206bf 100644 --- a/src/transformers/_common/transactionTimestamp.ts +++ b/src/transformers/_common/transactionTimestamp.ts @@ -1,4 +1,4 @@ -import type { RawBlock } from '../types'; +import type { RawBlock } from '../../types'; export function transform(block: RawBlock) { const isoTimestamp = new Date(block.timestamp * 1000).toISOString(); diff --git a/src/types/assetTransfer.ts b/src/types/assetTransfer.ts index effdecd..8c5ae33 100644 --- a/src/types/assetTransfer.ts +++ b/src/types/assetTransfer.ts @@ -1,12 +1,76 @@ import { AssetType } from './shared'; -export type AssetTransfer = { - asset?: string; // === 'contractAddress' - burn?: boolean; +export type ETHAsset = { + id: string; + type: AssetType.ETH; + value: string; +}; + +export interface ERC20Asset { + id: string; + asset: string; + type: AssetType.ERC20; + value: string; +} + +export interface ERC721Asset { + asset: string; + id: string; + type: AssetType.ERC721; + tokenId: string; +} + +export interface ERC1155Asset { + asset: string; + id: string; + type: AssetType.ERC1155; + value: string; + tokenId: string; +} + +export type Asset = ETHAsset | ERC20Asset | ERC721Asset | ERC1155Asset; + +export interface NetAssetTransfers { + [address: string]: { + received: Asset[]; + sent: Asset[]; + }; +} + +export type ETHAssetTransfer = { + type: AssetType.ETH; + value: string; from: string; - mint?: boolean; to: string; - tokenId?: string; - value?: string; - type: AssetType; }; + +export interface ERC20AssetTransfer { + asset: string; + type: AssetType.ERC20; + value: string; + from: string; + to: string; +} + +export interface ERC721AssetTransfer { + asset: string; + type: AssetType.ERC721; + tokenId: string; + from: string; + to: string; +} + +export interface ERC1155AssetTransfer { + asset: string; + type: AssetType.ERC1155; + value: string; + tokenId: string; + from: string; + to: string; +} + +export type AssetTransfer = + | ETHAssetTransfer + | ERC20AssetTransfer + | ERC721AssetTransfer + | ERC1155AssetTransfer; diff --git a/src/types/block.ts b/src/types/block.ts index b108353..63fbbd3 100644 --- a/src/types/block.ts +++ b/src/types/block.ts @@ -6,4 +6,6 @@ export type RawBlock = StdObj & { number: number; timestamp: number; transactions: RawTransaction[]; + gasUsed: string; + gasLimit: string; }; diff --git a/src/types/contract.ts b/src/types/contract.ts index e416708..3f0dd18 100644 --- a/src/types/contract.ts +++ b/src/types/contract.ts @@ -1,4 +1,4 @@ -import { StdObj } from './shared'; +import { StdObj, AbiItem } from './shared'; export type Contract = { chainId?: number; @@ -43,7 +43,7 @@ export type ContractMetadata = { simplehash?: StdObj; tally?: TallyMetadata; whatsAbiSelectors: string[]; - // whatsAbiAbi: ethers.InterfaceAbi; + whatsAbiAbi: AbiItem; isProxy: boolean; implementationAddress?: string; tokenMetadata?: TokenMetadata; diff --git a/src/types/log.ts b/src/types/log.ts index 563d3dd..2639949 100644 --- a/src/types/log.ts +++ b/src/types/log.ts @@ -1,10 +1,10 @@ -import { StdObj } from './shared'; +import { StdObj, FragmentType, ParamType } from './shared'; export type LogDescription = { fragment: { name: string; - // type: ethers.FragmentType; - // inputs: ReadonlyArray; + type: FragmentType; + inputs: ReadonlyArray; anonymous: boolean; }; name: string; diff --git a/src/types/shared.ts b/src/types/shared.ts index 7270bd7..4cfd56e 100644 --- a/src/types/shared.ts +++ b/src/types/shared.ts @@ -1,6 +1,14 @@ +import { Contract } from './contract'; +import { AssetTransfer } from './assetTransfer'; + export type StdObj = Record; -export type AssetType = 'erc20' | 'erc721' | 'erc1155' | 'eth'; +export enum AssetType { + ETH = 'eth', + ERC20 = 'erc20', + ERC721 = 'erc721', + ERC1155 = 'erc1155', +} /** ABI */ export type AbiType = @@ -37,3 +45,43 @@ export interface AbiOutput { components?: AbiOutput[]; internalType?: string; } + +export type TransactionContract = { + hash: string; + contracts: Contract[]; +}; + +export type transactionAssetTransfers = { + hash: string; + assetTransfers: AssetTransfer[]; +}; + +export type InternalHashType = { + sigHash: string; + from: string; + to?: string; +}; + +export type TransactionWithHash = { + hash: string; + sigHash: string; + internalSigHashes: InternalHashType[]; +}; + +export type FragmentType = + | 'constructor' + | 'error' + | 'event' + | 'fallback' + | 'function' + | 'struct'; + +export type ParamType = { + name: string; + type: string; + baseType: string; + indexed: null | boolean; + components: null | ReadonlyArray; + arrayLength: null | number; + arrayChildren: null | ParamType; +}; diff --git a/src/types/transaction.ts b/src/types/transaction.ts index 41ca3f5..9f252db 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -1,4 +1,4 @@ -import { StdObj } from './shared'; +import { StdObj, FragmentType, ParamType } from './shared'; import { AssetTransfer } from './assetTransfer'; import { NetAssetTransfers } from './netAssetTransfer'; import { RawReceipt } from './log'; @@ -59,9 +59,9 @@ export type RawTrace = StdObj & { export type TransactionDescription = { fragment: { name: string; - // type: ethers.FragmentType; - // inputs: ReadonlyArray; - // outputs: ReadonlyArray; + type: FragmentType; + inputs: ReadonlyArray; + outputs: ReadonlyArray; constant: boolean; stateMutability: 'payable' | 'nonpayable' | 'view' | 'pure'; payable: boolean;