2021-08-08 22:49:45 +00:00
|
|
|
import { BigNumber } from "@ethersproject/bignumber";
|
|
|
|
import { Log } from "@ethersproject/providers";
|
2021-07-01 18:21:40 +00:00
|
|
|
|
2021-07-12 20:10:16 +00:00
|
|
|
export enum ConnectionStatus {
|
|
|
|
CONNECTING,
|
|
|
|
NOT_ETH_NODE,
|
|
|
|
NOT_ERIGON,
|
|
|
|
NOT_OTTERSCAN_PATCHED,
|
|
|
|
CONNECTED,
|
|
|
|
}
|
|
|
|
|
2021-07-01 18:21:40 +00:00
|
|
|
export type ProcessedTransaction = {
|
|
|
|
blockNumber: number;
|
|
|
|
timestamp: number;
|
2021-07-05 03:03:01 +00:00
|
|
|
miner?: string;
|
2021-07-01 18:21:40 +00:00
|
|
|
idx: number;
|
|
|
|
hash: string;
|
|
|
|
from?: string;
|
|
|
|
to?: string;
|
2021-07-21 04:42:49 +00:00
|
|
|
createdContractAddress?: string;
|
2021-07-05 03:34:40 +00:00
|
|
|
internalMinerInteraction?: boolean;
|
2021-07-01 18:21:40 +00:00
|
|
|
value: BigNumber;
|
|
|
|
fee: BigNumber;
|
|
|
|
gasPrice: BigNumber;
|
|
|
|
data: string;
|
|
|
|
status: number;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type TransactionChunk = {
|
|
|
|
txs: ProcessedTransaction[];
|
|
|
|
firstPage: boolean;
|
|
|
|
lastPage: boolean;
|
|
|
|
};
|
2021-07-03 00:40:02 +00:00
|
|
|
|
|
|
|
export type ENSReverseCache = {
|
|
|
|
[address: string]: string;
|
|
|
|
};
|
2021-07-05 03:03:01 +00:00
|
|
|
|
|
|
|
export type TransactionData = {
|
|
|
|
transactionHash: string;
|
|
|
|
from: string;
|
2021-09-04 06:19:42 +00:00
|
|
|
to?: string;
|
2021-07-05 03:03:01 +00:00
|
|
|
value: BigNumber;
|
|
|
|
tokenTransfers: TokenTransfer[];
|
|
|
|
tokenMetas: TokenMetas;
|
2021-07-26 23:47:25 +00:00
|
|
|
type: number;
|
|
|
|
maxFeePerGas?: BigNumber | undefined;
|
|
|
|
maxPriorityFeePerGas?: BigNumber | undefined;
|
2021-07-05 03:03:01 +00:00
|
|
|
gasPrice: BigNumber;
|
2021-07-28 07:53:55 +00:00
|
|
|
gasLimit: BigNumber;
|
2021-07-05 03:03:01 +00:00
|
|
|
nonce: number;
|
|
|
|
data: string;
|
2021-09-04 06:19:42 +00:00
|
|
|
confirmedData?: ConfirmedTransactionData | undefined;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type ConfirmedTransactionData = {
|
|
|
|
status: boolean;
|
|
|
|
blockNumber: number;
|
|
|
|
transactionIndex: number;
|
|
|
|
blockBaseFeePerGas?: BigNumber | undefined | null;
|
|
|
|
blockTransactionCount: number;
|
|
|
|
confirmations: number;
|
|
|
|
timestamp: number;
|
|
|
|
miner: string;
|
|
|
|
createdContractAddress?: string;
|
|
|
|
fee: BigNumber;
|
|
|
|
gasUsed: BigNumber;
|
2021-08-08 22:49:45 +00:00
|
|
|
logs: Log[];
|
2021-07-05 03:03:01 +00:00
|
|
|
};
|
|
|
|
|
2021-07-19 03:38:38 +00:00
|
|
|
// The VOID...
|
|
|
|
export const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
|
|
|
|
|
|
export enum AddressContext {
|
|
|
|
FROM,
|
|
|
|
TO,
|
|
|
|
}
|
|
|
|
|
2021-07-05 03:03:01 +00:00
|
|
|
export type From = {
|
|
|
|
current: string;
|
|
|
|
depth: number;
|
|
|
|
};
|
|
|
|
|
2021-07-21 19:06:51 +00:00
|
|
|
export enum OperationType {
|
2021-07-19 23:49:54 +00:00
|
|
|
TRANSFER = 0,
|
|
|
|
SELF_DESTRUCT = 1,
|
2021-07-21 18:13:18 +00:00
|
|
|
CREATE = 2,
|
|
|
|
CREATE2 = 3,
|
2021-07-19 23:49:54 +00:00
|
|
|
}
|
|
|
|
|
2021-07-21 19:06:51 +00:00
|
|
|
export type InternalOperation = {
|
|
|
|
type: OperationType;
|
2021-07-05 03:03:01 +00:00
|
|
|
from: string;
|
|
|
|
to: string;
|
|
|
|
value: BigNumber;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type TokenTransfer = {
|
|
|
|
token: string;
|
|
|
|
from: string;
|
|
|
|
to: string;
|
|
|
|
value: BigNumber;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type TokenMeta = {
|
|
|
|
name: string;
|
|
|
|
symbol: string;
|
|
|
|
decimals: number;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type TokenMetas = {
|
|
|
|
[tokenAddress: string]: TokenMeta;
|
|
|
|
};
|