1 | import { BigNumber } from 'bignumber.js';
|
2 | export declare type JSONRPCErrorCallback = (err: Error | null, result?: JSONRPCResponsePayload) => void;
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | export declare type SupportedProvider = Web3JsProvider | GanacheProvider | EIP1193Provider | ZeroExProvider;
|
8 | export declare type Web3JsProvider = Web3JsV1Provider | Web3JsV2Provider | Web3JsV3Provider;
|
9 | export interface GanacheProvider {
|
10 | sendAsync(payload: JSONRPCRequestPayload, callback: JSONRPCErrorCallback): void;
|
11 | }
|
12 | export interface Provider {
|
13 | sendAsync(payload: JSONRPCRequestPayload, callback: JSONRPCErrorCallback): void;
|
14 | }
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | export interface ZeroExProvider {
|
21 | isZeroExProvider?: boolean;
|
22 | isMetaMask?: boolean;
|
23 | isParity?: boolean;
|
24 | stop?(): void;
|
25 | enable?(): Promise<void>;
|
26 | sendAsync(payload: JSONRPCRequestPayload, callback: JSONRPCErrorCallback): void;
|
27 | }
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | export interface Web3JsV1Provider {
|
34 | sendAsync(payload: JSONRPCRequestPayload, callback: JSONRPCErrorCallback): void;
|
35 | send(payload: JSONRPCRequestPayload): JSONRPCResponsePayload;
|
36 | }
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | export interface Web3JsV2Provider {
|
43 | send(payload: JSONRPCRequestPayload, callback: JSONRPCErrorCallback): void;
|
44 | }
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 | export interface Web3JsV3Provider {
|
51 | send(method: string, params?: any[]): Promise<any>;
|
52 | }
|
53 |
|
54 |
|
55 |
|
56 |
|
57 | export declare type EIP1193Event = 'accountsChanged' | 'networkChanged' | 'close' | 'connect' | 'notification';
|
58 | export interface EIP1193Provider {
|
59 | isEIP1193: boolean;
|
60 | send(method: string, params?: any[]): Promise<any>;
|
61 | on(event: EIP1193Event, listener: (result: any) => void): this;
|
62 | }
|
63 | export declare type ContractAbi = AbiDefinition[];
|
64 | export declare type AbiDefinition = FunctionAbi | EventAbi | RevertErrorAbi;
|
65 | export declare type FunctionAbi = MethodAbi | ConstructorAbi | FallbackAbi;
|
66 | export declare type ConstructorStateMutability = 'nonpayable' | 'payable';
|
67 | export declare type StateMutability = 'pure' | 'view' | ConstructorStateMutability;
|
68 | export interface MethodAbi {
|
69 | type: string;
|
70 | name: string;
|
71 | inputs: DataItem[];
|
72 | outputs: DataItem[];
|
73 | constant?: boolean;
|
74 | stateMutability: StateMutability;
|
75 | payable?: boolean;
|
76 | }
|
77 | export interface ConstructorAbi {
|
78 | type: string;
|
79 | inputs: DataItem[];
|
80 | payable?: boolean;
|
81 | stateMutability: ConstructorStateMutability;
|
82 | }
|
83 | export interface FallbackAbi {
|
84 | type: string;
|
85 | payable: boolean;
|
86 | }
|
87 | export interface EventParameter extends DataItem {
|
88 | indexed: boolean;
|
89 | }
|
90 | export interface RevertErrorAbi {
|
91 | type: 'error';
|
92 | name: string;
|
93 | arguments?: DataItem[];
|
94 | }
|
95 | export interface EventAbi {
|
96 | type: string;
|
97 | name: string;
|
98 | inputs: EventParameter[];
|
99 | anonymous: boolean;
|
100 | }
|
101 | export interface DataItem {
|
102 | name: string;
|
103 | type: string;
|
104 | internalType?: string;
|
105 | components?: DataItem[];
|
106 | }
|
107 | export interface TupleDataItem extends DataItem {
|
108 | components: DataItem[];
|
109 | }
|
110 | export declare enum OpCode {
|
111 | Stop = "STOP",
|
112 | Add = "ADD",
|
113 | Mul = "MUL",
|
114 | Sub = "SUB",
|
115 | Div = "DIV",
|
116 | SDiv = "SDIV",
|
117 | Mod = "MOD",
|
118 | SMod = "SMOD",
|
119 | AddMod = "ADDMOD",
|
120 | MulMod = "MULMOD",
|
121 | Exp = "EXP",
|
122 | SignExtend = "SIGNEXTEND",
|
123 | Lt = "LT",
|
124 | Gt = "GT",
|
125 | SLt = "SLT",
|
126 | SGt = "SGT",
|
127 | Eq = "EQ",
|
128 | IsZero = "ISZERO",
|
129 | And = "AND",
|
130 | Or = "OR",
|
131 | Xor = "XOR",
|
132 | Not = "NOT",
|
133 | Byte = "BYTE",
|
134 | Sha3 = "SHA3",
|
135 | Address = "ADDRESS",
|
136 | Balance = "BALANCE",
|
137 | Origin = "ORIGIN",
|
138 | Caller = "CALLER",
|
139 | CallValue = "CALLVALUE",
|
140 | CallDataLoad = "CALLDATALOAD",
|
141 | CallDataSize = "CALLDATASIZE",
|
142 | CallDataCopy = "CALLDATACOPY",
|
143 | CodeSize = "CODESIZE",
|
144 | CodeCopy = "CODECOPY",
|
145 | GasPrice = "GASPRICE",
|
146 | ExtCodeSize = "EXTCODESIZE",
|
147 | ExtCodeCopy = "EXTCODECOPY",
|
148 | ReturnDataSize = "RETURNDATASIZE",
|
149 | ReturnDataCopy = "RETURNDATACOPY",
|
150 | BlockHash = "BLOCKHASH",
|
151 | Coinbase = "COINBASE",
|
152 | TimeStamp = "TimeStamp",
|
153 | Number = "NUMBER",
|
154 | Difficulty = "DIFFICULTY",
|
155 | Gaslimit = "GASLIMIT",
|
156 | Pop = "POP",
|
157 | MLoad = "MLOAD",
|
158 | MStore = "MSTORE",
|
159 | MStore8 = "MSTORE8",
|
160 | SLoad = "SLOAD",
|
161 | SStore = "SSTORE",
|
162 | Jump = "JUMP",
|
163 | Jumpi = "JUMPI",
|
164 | Pc = "PC",
|
165 | MSize = "MSIZE",
|
166 | Gas = "GAS",
|
167 | JumpDest = "JUMPDEST",
|
168 | Push1 = "PUSH1",
|
169 | Push2 = "PUSH2",
|
170 | Push3 = "PUSH3",
|
171 | Push4 = "PUSH4",
|
172 | Push5 = "PUSH5",
|
173 | Push6 = "PUSH6",
|
174 | Push7 = "PUSH7",
|
175 | Push8 = "PUSH8",
|
176 | Push9 = "PUSH9",
|
177 | Push10 = "PUSH10",
|
178 | Push11 = "PUSH11",
|
179 | Push12 = "PUSH12",
|
180 | Push13 = "PUSH13",
|
181 | Push14 = "PUSH14",
|
182 | Push15 = "PUSH15",
|
183 | Push16 = "PUSH16",
|
184 | Push17 = "PUSH17",
|
185 | Push18 = "PUSH18",
|
186 | Push19 = "PUSH19",
|
187 | Push20 = "PUSH20",
|
188 | Push21 = "PUSH21",
|
189 | Push22 = "PUSH22",
|
190 | Push23 = "PUSH23",
|
191 | Push24 = "PUSH24",
|
192 | Push25 = "PUSH25",
|
193 | Push26 = "PUSH26",
|
194 | Push27 = "PUSH27",
|
195 | Push28 = "PUSH28",
|
196 | Push29 = "PUSH29",
|
197 | Push30 = "PUSH30",
|
198 | Push31 = "PUSH31",
|
199 | Push32 = "PUSH32",
|
200 | Dup1 = "DUP1",
|
201 | Dup2 = "DUP2",
|
202 | Dup3 = "DUP3",
|
203 | Dup4 = "DUP4",
|
204 | Dup5 = "DUP5",
|
205 | Dup6 = "DUP6",
|
206 | Dup7 = "DUP7",
|
207 | Dup8 = "DUP8",
|
208 | Dup9 = "DUP9",
|
209 | Dup10 = "DUP10",
|
210 | Dup11 = "DUP11",
|
211 | Dup12 = "DUP12",
|
212 | Dup13 = "DUP13",
|
213 | Dup14 = "DUP14",
|
214 | Dup15 = "DUP15",
|
215 | Dup16 = "DUP16",
|
216 | Swap1 = "SWAP1",
|
217 | Swap2 = "SWAP2",
|
218 | Swap3 = "SWAP3",
|
219 | Swap4 = "SWAP4",
|
220 | Swap5 = "SWAP5",
|
221 | Swap6 = "SWAP6",
|
222 | Swap7 = "SWAP7",
|
223 | Swap8 = "SWAP8",
|
224 | Swap9 = "SWAP9",
|
225 | Swap10 = "SWAP10",
|
226 | Swap11 = "SWAP11",
|
227 | Swap12 = "SWAP12",
|
228 | Swap13 = "SWAP13",
|
229 | Swap14 = "SWAP14",
|
230 | Swap15 = "SWAP15",
|
231 | Swap16 = "SWAP16",
|
232 | Log1 = "LOG1",
|
233 | Log2 = "LOG2",
|
234 | Log3 = "LOG3",
|
235 | Log4 = "LOG4",
|
236 | Create = "CREATE",
|
237 | Call = "CALL",
|
238 | CallCode = "CALLCODE",
|
239 | Return = "RETURN",
|
240 | DelegateCall = "DELEGATECALL",
|
241 | StaticCall = "STATICCALL",
|
242 | Revert = "REVERT",
|
243 | Invalid = "INVALID",
|
244 | SelfDestruct = "SELFDESTRUCT"
|
245 | }
|
246 | export interface StructLog {
|
247 | depth: number;
|
248 | error: string;
|
249 | gas: number;
|
250 | gasCost: number;
|
251 | memory: string[];
|
252 | op: OpCode;
|
253 | pc: number;
|
254 | stack: string[];
|
255 | storage: {
|
256 | [location: string]: string;
|
257 | };
|
258 | }
|
259 | export interface TransactionTrace {
|
260 | gas: number;
|
261 | returnValue: any;
|
262 | structLogs: StructLog[];
|
263 | }
|
264 | export declare type Unit = 'kwei' | 'ada' | 'mwei' | 'babbage' | 'gwei' | 'shannon' | 'szabo' | 'finney' | 'ether' | 'kether' | 'grand' | 'einstein' | 'mether' | 'gether' | 'tether';
|
265 | export interface JSONRPCRequestPayload {
|
266 | params: any[];
|
267 | method: string;
|
268 | id: number;
|
269 | jsonrpc: string;
|
270 | }
|
271 | export interface JSONRPCResponseError {
|
272 | message: string;
|
273 | code: number;
|
274 | }
|
275 | export interface JSONRPCResponsePayload {
|
276 | result: any;
|
277 | id: number;
|
278 | jsonrpc: string;
|
279 | error?: JSONRPCResponseError;
|
280 | }
|
281 | export interface AbstractBlock {
|
282 | number: number | null;
|
283 | hash: string | null;
|
284 | parentHash: string;
|
285 | nonce: string | null;
|
286 | sha3Uncles: string;
|
287 | logsBloom: string | null;
|
288 | transactionsRoot: string;
|
289 | stateRoot: string;
|
290 | miner: string;
|
291 | difficulty: BigNumber;
|
292 | totalDifficulty: BigNumber;
|
293 | extraData: string;
|
294 | size: number;
|
295 | gasLimit: number;
|
296 | gasUsed: number;
|
297 | timestamp: number;
|
298 | uncles: string[];
|
299 | }
|
300 | export interface BlockWithoutTransactionData extends AbstractBlock {
|
301 | transactions: string[];
|
302 | }
|
303 | export interface BlockWithTransactionData extends AbstractBlock {
|
304 | transactions: Transaction[];
|
305 | }
|
306 | export interface Transaction {
|
307 | hash: string;
|
308 | nonce: number;
|
309 | blockHash: string | null;
|
310 | blockNumber: number | null;
|
311 | transactionIndex: number | null;
|
312 | from: string;
|
313 | to: string | null;
|
314 | value: BigNumber;
|
315 | gasPrice?: BigNumber;
|
316 | maxFeePerGas?: BigNumber;
|
317 | maxPriorityFeePerGas?: BigNumber;
|
318 | gas: number;
|
319 | input: string;
|
320 | }
|
321 | export interface CallTxDataBase {
|
322 | to?: string;
|
323 | value?: number | string | BigNumber;
|
324 | gas?: number | string | BigNumber;
|
325 | gasPrice?: number | string | BigNumber;
|
326 | maxFeePerGas?: number | string | BigNumber;
|
327 | maxPriorityFeePerGas?: number | string | BigNumber;
|
328 | data?: string;
|
329 | nonce?: number;
|
330 | accessList?: TxAccessList;
|
331 | }
|
332 | export interface TxData extends CallTxDataBase {
|
333 | from: string;
|
334 | }
|
335 | export interface TxAccessList {
|
336 | [address: string]: string[];
|
337 | }
|
338 | export interface TxAccessListWithGas {
|
339 | accessList: TxAccessList;
|
340 | gasUsed: number;
|
341 | }
|
342 | export interface GethCallOverrides {
|
343 | [address: string]: {
|
344 | code?: string;
|
345 | nonce?: number;
|
346 | balance?: number | string | BigNumber;
|
347 | };
|
348 | }
|
349 | export interface CallData extends CallTxDataBase {
|
350 | from?: string;
|
351 | overrides?: GethCallOverrides;
|
352 | }
|
353 | export interface FilterObject {
|
354 | fromBlock?: number | string;
|
355 | toBlock?: number | string;
|
356 | blockHash?: string;
|
357 | address?: string;
|
358 | topics?: LogTopic[];
|
359 | }
|
360 | export declare type LogTopic = null | string | string[];
|
361 | export interface DecodedLogEntry<A> extends LogEntry {
|
362 | event: string;
|
363 | args: A;
|
364 | }
|
365 | export interface DecodedLogEntryEvent<A> extends DecodedLogEntry<A> {
|
366 | removed: boolean;
|
367 | }
|
368 | export interface LogEntryEvent extends LogEntry {
|
369 | removed: boolean;
|
370 | }
|
371 | export interface LogEntry {
|
372 | logIndex: number | null;
|
373 | transactionIndex: number | null;
|
374 | transactionHash: string;
|
375 | blockHash: string | null;
|
376 | blockNumber: number | null;
|
377 | address: string;
|
378 | data: string;
|
379 | topics: string[];
|
380 | }
|
381 | export declare type DecodedLogs = Array<LogWithDecodedArgs<DecodedLogArgs>>;
|
382 | export interface TxDataPayable extends TxData {
|
383 | value?: BigNumber;
|
384 | }
|
385 | export declare type TransactionReceiptStatus = null | string | 0 | 1;
|
386 | export interface TransactionReceipt {
|
387 | blockHash: string;
|
388 | blockNumber: number;
|
389 | transactionHash: string;
|
390 | transactionIndex: number;
|
391 | from: string;
|
392 | to: string;
|
393 | status: TransactionReceiptStatus;
|
394 | cumulativeGasUsed: number;
|
395 | gasUsed: number;
|
396 | contractAddress: string | null;
|
397 | logs: LogEntry[];
|
398 | }
|
399 | export declare enum AbiType {
|
400 | Function = "function",
|
401 | Constructor = "constructor",
|
402 | Event = "event",
|
403 | Fallback = "fallback"
|
404 | }
|
405 | export declare type ContractEventArg = any;
|
406 | export interface DecodedLogArgs {
|
407 | [argName: string]: ContractEventArg;
|
408 | }
|
409 | export interface LogWithDecodedArgs<ArgsType extends DecodedLogArgs> extends DecodedLogEntry<ArgsType> {
|
410 | }
|
411 | export declare type RawLog = LogEntry;
|
412 | export declare enum BlockParamLiteral {
|
413 | Earliest = "earliest",
|
414 | Latest = "latest",
|
415 | Pending = "pending"
|
416 | }
|
417 | export declare type BlockParam = BlockParamLiteral | number;
|
418 | export interface RawLogEntry {
|
419 | logIndex: string | null;
|
420 | transactionIndex: string | null;
|
421 | transactionHash: string;
|
422 | blockHash: string | null;
|
423 | blockNumber: string | null;
|
424 | address: string;
|
425 | data: string;
|
426 | topics: string[];
|
427 | }
|
428 | export declare enum SolidityTypes {
|
429 | Address = "address",
|
430 | Bool = "bool",
|
431 | Bytes = "bytes",
|
432 | Int = "int",
|
433 | String = "string",
|
434 | Tuple = "tuple",
|
435 | Uint256 = "uint256",
|
436 | Uint8 = "uint8",
|
437 | Uint = "uint"
|
438 | }
|
439 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 | export interface TransactionReceiptWithDecodedLogs extends TransactionReceipt {
|
445 | logs: Array<LogWithDecodedArgs<DecodedLogArgs> | LogEntry>;
|
446 | }
|
447 | export interface TraceParams {
|
448 | disableMemory?: boolean;
|
449 | disableStack?: boolean;
|
450 | disableStorage?: boolean;
|
451 | tracer?: string;
|
452 | timeout?: string;
|
453 | }
|
454 | export declare type OutputField = '*' | 'ast' | 'legacyAST' | 'abi' | 'devdoc' | 'userdoc' | 'metadata' | 'ir' | 'evm.assembly' | 'evm.legacyAssembly' | 'evm.bytecode.object' | 'evm.bytecode.opcodes' | 'evm.bytecode.sourceMap' | 'evm.bytecode.linkReferences' | 'evm.deployedBytecode.object' | 'evm.deployedBytecode.opcodes' | 'evm.deployedBytecode.sourceMap' | 'evm.deployedBytecode.linkReferences' | 'evm.methodIdentifiers' | 'evm.gasEstimates' | 'ewasm.wast' | 'ewasm.wasm';
|
455 | export interface ContractChains {
|
456 | [chainId: number]: ContractChainData;
|
457 | }
|
458 | export interface ContractChainData {
|
459 | address: string;
|
460 | links: {
|
461 | [linkName: string]: string;
|
462 | };
|
463 | constructorArgs: string;
|
464 | }
|
465 | export declare type ParamDescription = string;
|
466 | export interface StandardContractOutput {
|
467 | abi: ContractAbi;
|
468 | evm: EvmOutput;
|
469 | devdoc?: DevdocOutput;
|
470 | }
|
471 | export interface StandardOutput {
|
472 | errors: SolcError[];
|
473 | sources: {
|
474 | [fileName: string]: {
|
475 | id: number;
|
476 | ast?: object;
|
477 | legacyAST?: object;
|
478 | };
|
479 | };
|
480 | contracts: {
|
481 | [fileName: string]: {
|
482 | [contractName: string]: StandardContractOutput;
|
483 | };
|
484 | };
|
485 | }
|
486 | export declare type ErrorType = 'JSONError' | 'IOError' | 'ParserError' | 'DocstringParsingError' | 'SyntaxError' | 'DeclarationError' | 'TypeError' | 'UnimplementedFeatureError' | 'InternalCompilerError' | 'Exception' | 'CompilerError' | 'FatalError' | 'Warning';
|
487 | export declare type ErrorSeverity = 'error' | 'warning';
|
488 | export interface SolcError {
|
489 | sourceLocation?: SourceLocation;
|
490 | type: ErrorType;
|
491 | component: 'general' | 'ewasm';
|
492 | severity: ErrorSeverity;
|
493 | message: string;
|
494 | formattedMessage?: string;
|
495 | }
|
496 | export interface SourceLocation {
|
497 | file: string;
|
498 | start: number;
|
499 | end: number;
|
500 | }
|
501 | export interface EvmOutput {
|
502 | bytecode: EvmBytecodeOutput;
|
503 | deployedBytecode: EvmBytecodeOutput;
|
504 | }
|
505 | export interface EvmBytecodeOutput {
|
506 | linkReferences?: EvmBytecodeOutputLinkReferences;
|
507 | object: string;
|
508 | sourceMap: string;
|
509 | }
|
510 | export interface EvmBytecodeOutputLinkReferences {
|
511 | [sourceFile: string]: {
|
512 | [libraryName: string]: Array<{
|
513 | start: number;
|
514 | length: number;
|
515 | }>;
|
516 | };
|
517 | }
|
518 | export interface DevdocOutput {
|
519 | title?: string;
|
520 | author?: string;
|
521 | methods: {
|
522 | [signature: string]: {
|
523 | details?: string;
|
524 | params?: {
|
525 | [name: string]: ParamDescription;
|
526 | };
|
527 | return?: string;
|
528 | };
|
529 | };
|
530 | }
|
531 | export interface ContractVersionData {
|
532 | compiler: CompilerOpts;
|
533 | sources: {
|
534 | [sourceName: string]: {
|
535 | id: number;
|
536 | };
|
537 | };
|
538 | sourceCodes: {
|
539 | [sourceName: string]: string;
|
540 | };
|
541 | sourceTreeHashHex: string;
|
542 | compilerOutput: StandardContractOutput;
|
543 | }
|
544 | export interface CompilerOpts {
|
545 | name: 'solc';
|
546 | version: string;
|
547 | settings: CompilerSettings;
|
548 | }
|
549 |
|
550 |
|
551 |
|
552 |
|
553 |
|
554 |
|
555 |
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 | export interface ContractArtifact extends ContractVersionData {
|
563 | schemaVersion: string;
|
564 | contractName: string;
|
565 | chains: ContractChains;
|
566 | }
|
567 | export interface GeneratedCompilerOptions {
|
568 | name: 'solc';
|
569 | version: string;
|
570 | settings: CompilerSettings;
|
571 | }
|
572 | export interface CompilerSettings {
|
573 | remappings?: string[];
|
574 | optimizer?: OptimizerSettings;
|
575 | evmVersion?: 'homestead' | 'tangerineWhistle' | 'spuriousDragon' | 'byzantium' | 'constantinople';
|
576 | metadata?: CompilerSettingsMetadata;
|
577 | libraries?: {
|
578 | [fileName: string]: {
|
579 | [libName: string]: string;
|
580 | };
|
581 | };
|
582 | outputSelection: {
|
583 | [fileName: string]: {
|
584 | [contractName: string]: OutputField[];
|
585 | };
|
586 | };
|
587 | }
|
588 | export interface CompilerSettingsMetadata {
|
589 | useLiteralContent: true;
|
590 | }
|
591 | export interface OptimizerSettings {
|
592 | enabled: boolean;
|
593 | runs?: number;
|
594 | }
|
595 | export interface Source {
|
596 | id: number;
|
597 | }
|
598 |
|
599 |
|
600 |
|
601 |
|
602 |
|
603 |
|
604 |
|
605 |
|
606 |
|
607 |
|
608 |
|
609 |
|
610 |
|
611 |
|
612 | export interface CompilerOptions {
|
613 | contractsDir?: string;
|
614 | artifactsDir?: string;
|
615 | compilerSettings?: CompilerSettings;
|
616 | contracts?: string[] | '*';
|
617 | useDockerisedSolc?: boolean;
|
618 | isOfflineMode?: boolean;
|
619 | solcVersion?: string;
|
620 | shouldSaveStandardInput?: boolean;
|
621 | shouldCompileIndependently?: boolean;
|
622 | }
|
623 | export interface BlockRange {
|
624 | fromBlock: BlockParam;
|
625 | toBlock: BlockParam;
|
626 | }
|
627 |
|
\ | No newline at end of file |