Consensys / starknet-snap

The MetaMask Snap for Starknet
https://snaps.consensys.net/starknet
Apache License 2.0
77 stars 27 forks source link

feat: Add tx v3 Support in StarkNet Snap to allow user to pay fees in STRK or ETH #274

Closed khanti42 closed 5 days ago

khanti42 commented 3 months ago

Issue: Add tx v3 Support in StarkNet Snap

Description

This issue aims to add comprehensive support for tx v3 (transaction version 3) across various functionalities in the StarkNet Snap. The primary goal is to ensure that tx v3 is fully integrated and operational within the starkNet_sendTransaction, estimateFee, estimateFeeBulk, and starkNet_createAccount functions, enhancing the overall capabilities of the StarkNet Snap.

The following pull requests (PRs) contribute to this objective:

PRs Overview

  1. #262

    • Description: This PR introduces support for tx v3 in the estimateFee and estimateFeeBulk functions. These updates ensure that fee estimation processes are compatible with the new transaction version, providing accurate and reliable fee calculations.
    • Key Changes:
      • Updated estimateFee to handle tx v3.
      • Updated estimateFeeBulk to handle tx v3.
  2. #263

    • Description: This PR focuses on updating the user interface (UI) to support tx v3 in the estimateFee function. It ensures that the UI components correctly reflect the changes and provide a seamless user experience when estimating fees with tx v3.
    • Key Changes:
      • UI adjustments to accommodate tx v3 in estimateFee.
  3. #271

    • Description: This PR adds support for tx v3 within the starkNet_sendTransaction function. It includes necessary updates to ensure that transactions sent via the Snap adhere to the tx v3 specifications, enhancing transaction handling and compatibility.
    • Key Changes:
      • Modified starkNet_sendTransaction to support tx v3.
      • UI updates for transaction sending process with tx v3.
  4. #273

    • Description: This PR introduces support for tx v3 in the starkNet_createAccount function. It ensures that account creation processes within the Snap are compatible with tx v3, facilitating seamless account management.
    • Key Changes:
      • Updated starkNet_createAccount to handle tx v3.

Implementation Steps

  1. Merge PR #262:
  2. Merge PR #263:
  3. Merge PR #271:
  4. Merge PR #273:

Conclusion

By merging these PRs, we will achieve early support for tx v3 in the StarkNet Snap allowing users to pay fees in both ETH and STRK, enhancing its functionality and ensuring compatibility with the latest transaction standards.