archway-network / archway-network/arch3.js
Add a calculateGasFee method for Archway on CosmJS
- Dominant language
- TypeScript
- Stars
- 10
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
**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](https://github.com/cosmos/cosmjs/blob/main/packages/stargate/CUSTOM_PROTOBUF_CODECS.md).
**Benefits**
- Enhanced developer experience by aligning with the CosmJS flow.
- Reduced overhead for multi-chain protocols.
**References**
[CosmJS Repository](https://github.com/cosmos/cosmjs)
[Stargate Custom Protobuf Codecs Documentation](https://github.com/cosmos/cosmjs/blob/main/packages/stargate/CUSTOM_PROTOBUF_CODECS.md)
[Archway's minimum consensus fees](https://docs.archway.io/developers/rewards/consensus-fee)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the stargate custom protobuf codecs documentation and Archway’s minimum consensus fee documentation linked in the issue. Then inspect the CosmJS client configuration and stargate parser to determine the API and integration points; done means CosmJS can calculate Archway fees through its normal flow without requiring arch3js exclusively for fee handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, typescript
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100