Repository navigation
Expand file tree
/
Copy pathtokenTransfer.ts
More file actions
73 lines (63 loc) · 1.54 KB
/
Copy pathtokenTransfer.ts
File metadata and controls
73 lines (63 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import type { AddressParam } from './addressParams';
import type { TokenInfo, TokenType } from './token';
export type Erc20TotalPayload = {
decimals: string | null;
value: string;
};
export type Erc721TotalPayload = {
token_id: string | null;
};
export type Erc1155TotalPayload = {
decimals: string | null;
value: string;
token_id: string | null;
};
export type Erc404TotalPayload = {
decimals: string;
value: string;
token_id: null;
} | {
token_id: string;
};
export type TokenTransfer = (
{
token: TokenInfo<'ERC-20'> | null;
total: Erc20TotalPayload | null;
} |
{
token: TokenInfo<'ERC-721'> | null;
total: Erc721TotalPayload | null;
} |
{
token: TokenInfo<'ERC-1155'> | null;
total: Erc1155TotalPayload | null;
} |
{
token: TokenInfo<'ERC-404'> | null;
total: Erc404TotalPayload | null;
}
) & TokenTransferBase;
export type TokenTotal = Erc20TotalPayload | Erc721TotalPayload | Erc1155TotalPayload;
interface TokenTransferBase {
type: 'token_transfer' | 'token_burning' | 'token_spawning' | 'token_minting';
transaction_hash: string;
from: AddressParam;
to: AddressParam;
timestamp: string;
block_number: string;
block_hash: string;
log_index: string;
method?: string;
}
export type TokenTransferPagination = {
block_number: number;
index: number;
items_count: number;
};
export interface TokenTransferResponse {
items: Array<TokenTransfer>;
next_page_params: TokenTransferPagination | null;
}
export interface TokenTransferFilters {
type: Array<TokenType>;
}