Extends

ExtensionContractCaller


Constructor

constructor(extension)

Parameter

extension - ScatterExtension


Property

extension

Type: ScatterExtension
Description: Scatter wrapper instance passed by constructor.


Methods

onChainCall

async onChainCall(wrapper, method, param, amount, extra)

Description

Invoke a smart contract's method. This method may change the mart contract state.

Parameters :

wrapper - ContractWrapper:

A ContractWrapper instance returned by loadContract method.

method - String:

Which method in the contract will be called.

param - Object:

Data for the contract method's parameter.

amount - Unused:

extra - Unused:

Returns :

Promise<Result<String, Status>>:

Transaction hash will be set into the data field of Result if contract called successfully.

offChainCall

async offChainCall(wrapper, table, param)

Description

This methods will read table of the smart contract on EOS.

Parameters :

table - ContractWrapper:

A ContractWrapper instance returned by loadContract method.

table - String:

Table name of the smart contract.

param - OffChainCallParam:

Scope and limit for table query.

Returns :

Promise<Result<Any, Status>>:

Table rows of the smart contract will be set into the data field of Result if contract called successfully.