Repository navigation
Drop the SDK's Pix key pre-check before BRL offramp registration - #1478
Merged
Merged
Conversation
registerBrlOfframp called GET /v1/brla/validatePixKey before registering. Registration validates the same key server-side, and also checks that its owner matches the receiver's tax ID, so the pre-check doubled the provider lookups per offramp. It also reported any 4xx from the check, including a rate limit, as InvalidPixKeyError. A bad key now surfaces from registration as the same InvalidPixKeyError.
The integration skill told agents to validate Pix keys through GET /v1/brla/validatePixKey before registering and after an InvalidPixKeyError. Registration is the check, so the guidance now says what InvalidPixKeyError means and to correct the key.
✅ Deploy Preview for vrtx-dashboard canceled.
|
✅ Deploy Preview for vortex-sandbox ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for vortexfi canceled.
|
The integration skill said MissingBrlOfframpParametersError never fires for a missing pixDestination, but parseAPIError maps that message to it. It also quoted a walletAddress message that EVM offramps don't send.
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.
Summary
BrlHandler.registerBrlOfframpcalledGET /v1/brla/validatePixKeybefore every BRL offramp registration (assertValidPixKey). That check is redundant:validateAveniaOfframpRecipient(apps/api/src/api/services/phases/blocks/core/avenia-registration.ts) resolves the Pix key with Avenia and also checks that its owner matches the receiver's tax ID. It rejects a bad key with400 "Invalid pixKey or receiverTaxId.", whichparseAPIErroralready maps toInvalidPixKeyError.InvalidPixKeyError.This PR removes the automatic pre-check.
ApiService.validateBrlPixKeyand the/v1/brla/validatePixKeyroute stay, for anyone who calls them directly, so this is the only SDK request that changes. Thevortex-integrationskill no longer tells integrators to validate keys through that route; it now explains whatInvalidPixKeyErrormeans. Its note on the missing-parameter errors is corrected too, and the route's comment says only older SDK versions pre-check the key.Merge order
Merge after #1477. Until that lands, registration also answers a lookup outage with
400 "Invalid pixKey or receiverTaxId.", which the removed check reported as a provider failure.Behavior change
InvalidPixKeyError. It now comes fromregisterRamp, after the BRL limit pre-check, rather than first.AmountExceedsLimitErrorfirst.registerRampsucceeds), so a rejected key leaves nothing behind.Testing
handlers.flow.test.ts:validateBrlPixKey, even when that call would fail with 429.400 "Invalid pixKey or receiverTaxId."surfaces asInvalidPixKeyError, with nothing stored after it.vortexSdk.lazyNetworks.test.ts: a BRL offramp registers without requesting the route.bun testsuite (190 tests, plus the build and dist smoke-load), ESLint, typecheck andwire-contract:check.test:stocks,test:goldandtest:consumer-kit.stocks-app.e2eandbrl-offramp.scenariotests (69 pass).