1 |
|
2 |
|
3 |
|
4 |
|
5 | import { Abi, PushTransactionArgs, ProcessedAction } from './eosjs-rpc-interfaces';
|
6 | import { Anyvar, Authorization, Action, SerializedAction } from './eosjs-serialize';
|
7 |
|
8 | export interface AuthorityProviderArgs {
|
9 |
|
10 | transaction: any;
|
11 |
|
12 | availableKeys: string[];
|
13 | }
|
14 |
|
15 | export interface AuthorityProvider {
|
16 |
|
17 | getRequiredKeys: (args: AuthorityProviderArgs) => Promise<string[]>;
|
18 | }
|
19 |
|
20 | export interface AbiProvider {
|
21 |
|
22 | getRawAbi: (accountName: string) => Promise<BinaryAbi>;
|
23 | }
|
24 |
|
25 | export interface BinaryAbi {
|
26 |
|
27 | accountName: string;
|
28 |
|
29 | abi: Uint8Array;
|
30 | }
|
31 |
|
32 | export interface CachedAbi {
|
33 |
|
34 | rawAbi: Uint8Array;
|
35 |
|
36 | abi: Abi;
|
37 | }
|
38 |
|
39 | export interface SignatureProviderArgs {
|
40 |
|
41 | chainId: string;
|
42 |
|
43 | requiredKeys: string[];
|
44 |
|
45 | serializedTransaction: Uint8Array;
|
46 |
|
47 | serializedContextFreeData?: Uint8Array;
|
48 |
|
49 | abis: BinaryAbi[];
|
50 | }
|
51 |
|
52 | export interface SignatureProvider {
|
53 |
|
54 | getAvailableKeys: () => Promise<string[]>;
|
55 |
|
56 | sign: (args: SignatureProviderArgs) => Promise<PushTransactionArgs>;
|
57 | }
|
58 | export interface ResourcePayer {
|
59 | payer: string;
|
60 | max_net_bytes: number;
|
61 | max_cpu_us: number;
|
62 | max_memory_bytes: number;
|
63 | }
|
64 | export interface Transaction {
|
65 | expiration?: string;
|
66 | ref_block_num?: number;
|
67 | ref_block_prefix?: number;
|
68 | max_net_usage_words?: number;
|
69 | max_cpu_usage_ms?: number;
|
70 | delay_sec?: number;
|
71 | context_free_actions?: Action[];
|
72 | context_free_data?: Uint8Array[];
|
73 | actions: Action[];
|
74 | transaction_extensions?: [number, string][];
|
75 | resource_payer?: ResourcePayer;
|
76 | }
|
77 |
|
78 | export interface TransactConfig {
|
79 | broadcast?: boolean;
|
80 | sign?: boolean;
|
81 | readOnlyTrx?: boolean;
|
82 | returnFailureTraces?: boolean;
|
83 | requiredKeys?: string[];
|
84 | compression?: boolean;
|
85 | blocksBehind?: number;
|
86 | useLastIrreversible?: boolean;
|
87 | expireSeconds?: number;
|
88 | }
|
89 | export interface TransactionHeader {
|
90 | expiration: string;
|
91 | ref_block_num: number;
|
92 | ref_block_prefix: number;
|
93 | }
|
94 | export interface AccountDelta {
|
95 | account: string;
|
96 | delta: number;
|
97 | }
|
98 | export interface AuthSequence {
|
99 | account: string;
|
100 | sequence: number;
|
101 | }
|
102 | export interface ActionReceipt {
|
103 | receiver: string;
|
104 | act_digest: string;
|
105 | global_sequence: number;
|
106 | recv_sequence: number;
|
107 | auth_sequence: [string, number][];
|
108 | code_sequence: number;
|
109 | abi_sequence: number;
|
110 | }
|
111 | export interface ActionTrace {
|
112 | action_ordinal: number;
|
113 | creator_action_ordinal: number;
|
114 | closest_unnotified_ancestor_action_ordinal: number;
|
115 | receipt: ActionReceipt;
|
116 | receiver: string;
|
117 | act: ProcessedAction;
|
118 | context_free: boolean;
|
119 | elapsed: number;
|
120 | console: string;
|
121 | trx_id: string;
|
122 | block_num: number;
|
123 | block_time: string;
|
124 | producer_block_id: string | null;
|
125 | account_ram_deltas: AccountDelta[];
|
126 | account_disk_deltas: AccountDelta[];
|
127 | except: any;
|
128 | error_code: number | null;
|
129 | return_value?: any;
|
130 | return_value_hex_data?: string;
|
131 | return_value_data?: any;
|
132 | inline_traces?: ActionTrace[];
|
133 | }
|
134 | export interface TransactionReceiptHeader {
|
135 | status: string;
|
136 | cpu_usage_us: number;
|
137 | net_usage_words: number;
|
138 | }
|
139 | export interface TransactionTrace {
|
140 | id: string;
|
141 | block_num: number;
|
142 | block_time: string;
|
143 | producer_block_id: string | null;
|
144 | receipt: TransactionReceiptHeader | null;
|
145 | elapsed: number;
|
146 | net_usage: number;
|
147 | scheduled: boolean;
|
148 | action_traces: ActionTrace[];
|
149 | account_ram_delta: AccountDelta | null;
|
150 | except: string | null;
|
151 | error_code: number | null;
|
152 | bill_to_accounts: string[];
|
153 | }
|
154 | export interface TransactResult {
|
155 | transaction_id: string;
|
156 | processed: TransactionTrace;
|
157 | }
|
158 |
|
159 | export interface QueryConfig {
|
160 | sign?: boolean;
|
161 | requiredKeys?: string[];
|
162 | authorization?: Authorization[];
|
163 | }
|
164 |
|
165 |
|
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 | export declare type Query = string | [string, Query[]] | [string, Anyvar, Query[]] | {
|
172 | method: string;
|
173 | arg?: Anyvar;
|
174 | filter?: Query[];
|
175 | };
|
176 | export declare type ContextFreeGroupCallback = (index: {
|
177 | cfa: number;
|
178 | cfd: number;
|
179 | }) => {
|
180 | action?: SerializedAction;
|
181 | contextFreeAction?: SerializedAction;
|
182 | contextFreeData?: Uint8Array;
|
183 | };
|
184 | export interface ActionSerializerType {
|
185 | [actionName: string]: any;
|
186 | }
|