Conversation
… order getBufferedFastTransferFee read feePayload[0], assuming the fast finality tier is always first in the /v2/burn/USDC/fees response. That ordering is undocumented; if the standard tier (minimumFee 0) comes first a fast transfer would burn with maxFee 0 and revert on-chain. Model finalityThreshold on the response type and pick the tier that matches the burn (FAST_FINALITY_THRESHOLD), falling back to feePayload[0]. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
What
getBufferedFastTransferFeeinsrc/hooks/use-cross-chain-transfer.tsreads the fee from the first element of the response:The
/v2/burn/USDC/fees/{src}/{dst}endpoint returns one entry per finality tier, e.g.:[{ "finalityThreshold": 1000, "minimumFee": 1 }, { "finalityThreshold": 2000, "minimumFee": 0 }]getBufferedFastTransferFeeis only called for fast transfers, which burn withminFinalityThreshold = FAST_FINALITY_THRESHOLD(1000). Taking[0]assumes the fast tier is always first. It currently is, but that ordering is not documented. If the standard tier (minimumFee: 0) is returned first, a fast transfer computesmaxFee = 0and the on-chaindepositForBurnreverts, because a fast transfer'smaxFeemust cover the tier's minimum fee.FastTransferFeeResponsealso does not modelfinalityThreshold, so there is nothing to select on today.Fix
finalityThresholdtoFastTransferFeeResponse.finalityThreshold <= FAST_FINALITY_THRESHOLD), falling back tofeePayload[0]so behaviour is unchanged when nothing matches.interface FastTransferFeeResponse { + finalityThreshold: number; minimumFee: number | string; }One file. No dependency, ABI, or API changes.
🤖 Generated with Claude Code