Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make transaction request parameters less rigid #6390

Merged
merged 2 commits into from
Jan 24, 2025
Merged

Conversation

walmat
Copy link
Contributor

@walmat walmat commented Jan 9, 2025

Fixes APP-2248

What changed (plus any additional context for devs)

1. Transaction Message Card Component Update

Type Definition Changes

  • Removed dependency on RPCMethod from walletConnect types
  • Changed method prop type from RPCMethod to string for better flexibility

2. New Build Transaction Helper

New File Creation

  • Added new file src/helpers/buildTransaction.ts
  • Implements two main functions:
    • getGasLimitForSuggestedGas
    • buildTransaction

Gas Estimation Logic

  • Moved gas estimation logic from SignTransactionSheet to dedicated helper
  • Implements padding and validation for gas estimates
  • Handles fallback scenarios for gas limit calculations

Transaction Building

  • Centralizes transaction building logic in one location
  • Handles gas parameters, nonce management, and transaction type conversion
  • Provides a cleaner interface for creating transaction objects

3. Sign Transaction Sheet Refactor

Code Cleanup

  • Removed duplicated gas estimation logic
  • Simplified transaction payload handling
  • Improved error handling and logging

Integration Changes

  • Now uses the new buildTransaction helper
  • Streamlined transaction submission flow
  • Better separation of concerns between transaction building and signing

This PR represents a significant improvement in the transaction handling architecture, moving complex transaction building logic into a dedicated helper while simplifying the transaction message card component. The changes promote better code organization and maintainability.

Screen recordings / screenshots

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-01-09.at.11.52.55.mp4

What to test

sends, sign, txns from MWP, Dapp Browser, WC

Copy link

linear bot commented Jan 9, 2025

@brunobar79
Copy link
Member

Launch in simulator or device for 11f6f17

@walmat walmat requested review from derHowie and maxbbb January 10, 2025 15:47
Copy link
Member

@derHowie derHowie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

legibility 📈

@brunobar79 brunobar79 added the release for release blockers and release candidate branches label Jan 23, 2025
@walmat walmat merged commit 5abef8a into develop Jan 24, 2025
8 checks passed
@walmat walmat deleted the @matthew/APP-2248 branch January 24, 2025 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release for release blockers and release candidate branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants