Skip to content

Commit

Permalink
feat: complete interface
Browse files Browse the repository at this point in the history
  • Loading branch information
janek26 committed Apr 1, 2022
1 parent 7a641b5 commit 39d2f05
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/contract/interface.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { AccountInterface } from '../account';
import { ProviderInterface } from '../provider';
import { BlockIdentifier } from '../provider/utils';
import {
Abi,
AddTransactionResponse,
AsyncContractFunction,
ContractFunction,
Invocation,
Overrides,
Result,
} from '../types';

Expand Down Expand Up @@ -57,7 +59,13 @@ export abstract class ContractInterface {
* @param args Array of the arguments for the call
* @returns Result of the call as an array with key value pars
*/
public abstract call(method: string, args?: Array<any>): Promise<Result>;
public abstract call(
method: string,
args?: Array<any>,
options?: {
blockIdentifier?: BlockIdentifier;
}
): Promise<Result>;

/**
* Invokes a method on a contract
Expand All @@ -66,15 +74,25 @@ export abstract class ContractInterface {
* @param args Array of the arguments for the invoke
* @returns Add Transaction Response
*/
public abstract invoke(method: string, args?: Array<any>): Promise<AddTransactionResponse>;
public abstract invoke(
method: string,
args?: Array<any>,
options?: Overrides
): Promise<AddTransactionResponse>;

/**
* Calls a method on a contract
*
* @param method name of the method
* @param args Array of the arguments for the call
*/
public abstract estimate(method: string, args?: Array<any>): Promise<any>;
public abstract estimate(
method: string,
args?: Array<any>,
options?: {
blockIdentifier?: BlockIdentifier;
}
): Promise<any>;

/**
* Calls a method on a contract
Expand Down

0 comments on commit 39d2f05

Please sign in to comment.