Skip to content

Add 'from' parameter for w3mService.requestReadContract #143

@VladislavPastushenko

Description

@VladislavPastushenko

Is your feature request related to a problem? Please describe.
When using the requestReadContract method, it is not possible to set the from parameter for transaction (as it is possible using requestWriteContract).

I suggest to extend list of parameters for requestReadContract

final result = await _w3mService.requestReadContract(
    deployedContract: deployedContract,
    functionName: 'name',
    rpcUrl: 'https://{rpc-url}.com',
    // ...
    from: EthereumAddress.fromHex('0xaddress....') // Here is new parameter
    parameters: [
      // ...
    ],
  );

The only way for defining now from is using Web3Client(...).call. I guess this method shouldn't be used because it is a lower-level function and it's not mentioned in current docs.

This is small and easy improvement which could be useful for specific cases.

I can create PR for this improvement if you find it helpful.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions