Skip to content

Add a calculateGasFee method for Archway on CosmJS #101

@lufa23

Description

@lufa23

Background
Currently, Archway differentiates itself from other Cosmos SDK chains by employing a distinct approach to calculate gas fees. To address this unique calculation, the arch3js library has extended CosmJS functionality. While this custom solution streamlines usage and enhances maintainability, it also has introduces some overhead for multi-chain dapps, especially the ones that need to ru multiple clients for non-Cosmos SDK chains.

Problem
While CosmJS is widely adopted, arch3js is used within the Archway ecosystem due to its specific calculation of gas fees. Several dapps use arch3js exclusively for handling these gas fees. However, this situation may introduce unnecessary overhead for specific dapps.

Proposal
Based on the received feedback to streamline the usage of CosmJS for Archway, a method named calculateGasFee can be added into the CosmJS library to calculate Archway's fees. This method would be the most critical one, as it is the one that disrupts CosmJS' flow.

Implementation
The suggested enhancement would involve extending the CosmJS client configuration to allow for a customized approach to gas fee calculation for Archway. Leveraging the parser in the stargate library can facilitate this process. More information about integrating custom protobuf codecs can be found in the stargate library documentation.

Benefits

  • Enhanced developer experience by aligning with the CosmJS flow.
  • Reduced overhead for multi-chain protocols.

References

CosmJS Repository
Stargate Custom Protobuf Codecs Documentation
Archway's minimum consensus fees

Metadata

Metadata

Assignees

No one assigned

    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