diff --git a/src/contract/Contract.ts b/src/contract/Contract.ts index 9ab27a5..af9170f 100644 --- a/src/contract/Contract.ts +++ b/src/contract/Contract.ts @@ -129,12 +129,14 @@ export interface Contract { * @param input - the input to the contract - eg. function name and parameters * @param tags - a set of tags that can be added to the interaction transaction * @param transfer - additional {@link ArTransfer} data that can be attached to the interaction + * @param caller - caller of the view state operation * transaction */ viewState( input: Input, tags?: Tags, - transfer?: ArTransfer + transfer?: ArTransfer, + caller?: string ): Promise>; /** diff --git a/src/contract/HandlerBasedContract.ts b/src/contract/HandlerBasedContract.ts index eb56036..e8c8017 100644 --- a/src/contract/HandlerBasedContract.ts +++ b/src/contract/HandlerBasedContract.ts @@ -209,10 +209,11 @@ export class HandlerBasedContract implements Contract { async viewState( input: Input, tags: Tags = [], - transfer: ArTransfer = emptyTransfer + transfer: ArTransfer = emptyTransfer, + caller?: string ): Promise> { this.logger.info('View state for', this._contractTxId); - return await this.callContract(input, 'view', undefined, undefined, tags, transfer); + return await this.callContract(input, 'view', caller, undefined, tags, transfer); } async viewStateForTx(