Commit cf99a3d8 authored by tom's avatar tom

api types for transactions

parent c6a2101b
export interface AddressParam {
hash: string;
implementation_name: string;
name: string;
is_contract: boolean;
}
export interface DecodedInput {
method_call: string;
method_id: string;
parameters: Array<DecodedInputParams>;
}
export interface DecodedInputParams {
name: string;
type: string;
value: string;
}
export interface Fee {
type: string;
value: string;
}
import type { AddressParam } from './addressParams';
export interface InternalTransaction {
error?: string;
success: boolean;
type: string;
transaction_hash: string;
from: AddressParam;
to: AddressParam;
created_contract: AddressParam;
value: number;
index: number;
block: number;
timestamp: string;
}
export interface InternalTransactionsResponse {
items: Array<InternalTransaction>;
next_page_params: {
block_number: number;
index: number;
items_count: number;
transaction_hash: string;
transaction_index: number;
};
}
import type { AddressParam } from './addressParams';
import type { DecodedInput } from './decodedInput';
export interface Log {
address: AddressParam;
topics: Array<string>;
data: string;
index: number;
decoded?: DecodedInput;
}
export interface LogsResponse {
items: Array<Log>;
next_page_params: {
index: number;
items_count: number;
transaction_hash: string;
};
}
export interface RawTrace {
action: {
callType: string;
from: string;
gas: string;
input: string;
to: string;
value: string;
};
result: {
gasUsed: string;
output: string;
};
error?: string;
subtraces: number;
traceAddress: Array<number>;
type: string;
}
export type RawTracesResponse = Array<RawTrace>;
import type { AddressParam } from './addressParams';
export interface TokenTransfer {
type: string;
txHash: string;
from: AddressParam;
to: AddressParam;
token_address: string;
token_symbol: string;
token_type: string;
total: {
value: string;
};
exchangeRate: number;
}
import type { AddressParam } from './addressParams';
import type { DecodedInput } from './decodedInput';
import type { Fee } from './fee';
import type { TokenTransfer } from './tokenTransfer';
export interface Transaction {
hash: string;
result: string;
confirmations: number;
status: string;
block: number;
timestamp: string;
confirmation_duration: Array<number>;
from: AddressParam;
to: AddressParam;
created_contract: AddressParam;
value: number;
fee: Fee;
gas_price: number;
type: number;
gas_used: number;
gas_limit: number;
max_fee_per_gas?: number;
max_priority_fee_per_gas?: number;
priority_fee?: number;
base_fee_per_gas?: number;
tx_burnt_fee?: number;
nonce: number;
position: number;
revert_reason?: {
raw: string;
decoded: string;
};
raw_input: string;
decoded_input?: DecodedInput;
token_transfers?: Array<TokenTransfer>;
token_transfers_overflow: boolean;
exchange_rate: number;
}
export interface TransactionsResponse {
items: Array<Transaction>;
next_page_params: {
block_number: number;
index: number;
items_count: number;
};
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment