new Contract(provider, address, abi)
- Source:
Contract constructor.
Parameters:
Name | Type | Description |
---|---|---|
provider |
string | Ecoweb3Provider | Either URL string to create HttpProvider or a Ecoweb3 compatible provider. |
address |
string | Address of the contract. |
abi |
array | ABI of the contract. |
Methods
(async) call(methodName, params) → {Promise}
- Source:
Executes a callcontract on a view/pure method.
Parameters:
Name | Type | Description |
---|---|---|
methodName |
string | Name of contract method |
params |
object | Parameters of contract method |
Returns:
Call result.
- Type
- Promise
(async) send(methodName, params) → {Promise}
- Source:
Executes a sendtocontract transaction.
Parameters:
Name | Type | Description |
---|---|---|
methodName |
string | Method name to call. |
params |
object | Parameters of the contract method. |
Returns:
Transaction ID of the sendtocontract.
- Type
- Promise