fix(checkout-widgets): resolve checkout stuck in Crunching Numbers when paying with IMX (Issue 3)#2803
Open
rodrigo-fournier-immutable wants to merge 1 commit intomainfrom
Open
fix(checkout-widgets): resolve checkout stuck in Crunching Numbers when paying with IMX (Issue 3)#2803rodrigo-fournier-immutable wants to merge 1 commit intomainfrom
rodrigo-fournier-immutable wants to merge 1 commit intomainfrom
Conversation
…en paying with IMX (Issue 3) When fetching funding balances for native tokens (e.g. tIMX on zkEVM), the primary-sales API returns zero address. The code used ERC20ItemRequirement which calls getTokenContract().decimals() and fails for non-contract addresses, causing CheckoutError and leaving the widget stuck in loading. Use NativeItemRequirement for native tokens instead of ERC20ItemRequirement.
|
View your CI Pipeline Execution ↗ for commit 488dceb
☁️ Nx Cloud last updated this comment at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Checkout stuck in Crunching Numbers (SDK 2.12.7)
Summary
This PR addresses Issue 3 reported after upgrading to
@imtbl/sdk ^2.12.7in the Treeverse integration. Seedocs/TREEVERSE_ISSUES_ANALYSIS.mdfor the full analysis.Issue 3: Checkout widget stuck in "Crunching Numbers" when paying with IMX on testnet
Expected: Checkout flow should complete or show an error, not hang indefinitely.
Fix: When fetching funding balances for native tokens (e.g. tIMX on zkEVM), the primary-sales API returns a zero address. The code was using
ERC20ItemRequirement, which callsgetTokenContract().decimals()and fails for non-contract addresses, causingCheckoutErrorand leaving the widget stuck in loading. Now usesNativeItemRequirementfor native tokens instead ofERC20ItemRequirement.Packages: checkout-widgets
How to test locally
Setup:
Test flow:
Expected (fixed): The flow should complete normally or show an error/funding options screen, instead of hanging indefinitely on "Crunching Numbers".
Optional — simulate the bug (without fix):
treeverse-issues-reproductionbranch?simulateIssue3=1to the URL)Optional — bypass primary-sales API (mock):
?mockPrimarySales=1to the URL to use mock quote data (triggers the native token flow with tIMX zero address)