archethic-foundation / wagmi_flutter_web

Wagmi SDK wrapper for Flutter Web
GNU Affero General Public License v3.0
8 stars 3 forks source link

Improve Dart API - use named parameters instead of `XXXParameters` objects #35

Open Chralu opened 1 month ago

Chralu commented 1 month ago

Describe the problem you discovered

I think the action parameters are heavy to use.

For example, I suggest doing :

final getBlockNumberReturnType = await wagmi.Core.getBlockNumber(
  chainId: account!.chain!.id,
  cacheTime: 4000,
);

instead of :

final getBlockNumberReturnType = await wagmi.Core.getBlockNumber(
  wagmi.GetBlockNumberParameters(
    chainId: account!.chain!.id,
    cacheTime: 4000,
  ),
);
Chralu commented 1 month ago

@redDwarf03 @kaumudpa ok with that ?

kaumudpa commented 1 month ago

@Chralu Our current approach is more defined as per the specific params required by different actions. Current approach seems to be ok. The conversion types between different actions also differs at times.

JS VM will use exactly same resources so there is no need to worry abt named parameters being heavy to use.