1 |
|
2 | import EventEmitter from 'events';
|
3 | import { Client } from './client';
|
4 | import { Address } from './address';
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | export declare class EvmContract extends EventEmitter {
|
16 | static readonly EVENT: string;
|
17 | private _client;
|
18 | address: Address;
|
19 | caller: Address;
|
20 | |
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | constructor(params: {
|
28 | contractAddr: Address;
|
29 | callerAddr: Address;
|
30 | client: Client;
|
31 | });
|
32 | /**
|
33 | * Calls a contract method that mutates state.
|
34 | * The call into the contract is accomplished by committing a tx to the DAppChain.
|
35 | * @param args ABI encoded function signature and input paramters.
|
36 | * @returns A promise that will be resolved with return value (if any) of the contract method.
|
37 | */
|
38 | callAsync(args: number[], output?: Uint8Array): Promise<Uint8Array | void>;
|
39 | /**
|
40 | * Calls a method of a contract running on an EVM that doesn't mutate state.
|
41 | * This method is usually used to query the current contract state, it doesn't commit any txs.
|
42 | * @param args ABI encoded function signature and input paramters.
|
43 | * @returns A promise that will be resolved with the return value of the contract method.
|
44 | */
|
45 | staticCallAsync(args: number[], output?: Uint8Array): Promise<Uint8Array | void>;
|
46 | private _emitContractEvent;
|
47 | }
|