Add new endpoint for sending pre signed transactions for a ramp#715
Merged
ebma merged 24 commits intoJun 16, 2025
Merged
Conversation
✅ Deploy Preview for pendulum-pay ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
gianfra-t
reviewed
Jun 12, 2025
|
|
||
| // Check if Stellar target account exists on the network and has the respective trustline. | ||
| // Otherwise, the redeem will end up with a 'claimable-payment' operation on Stellar that we cannot claim. | ||
| if (!(await isStellarEphemeralFunded(stellarEphemeralAccountId, stellarTarget.stellarTokenDetails))) { |
Contributor
There was a problem hiding this comment.
Since this error will require certain manual action from us, what if we send it to the failed state here?
gianfra-t
reviewed
Jun 12, 2025
| } | ||
|
|
||
| brCode = await this.validateBrlaOnrampRequest(additionalData.taxId, quote, quote.inputAmount); | ||
| logger.info(`BR Code for onramp: ${brCode}`); |
Contributor
There was a problem hiding this comment.
Do we keep this for debug?
gianfra-t
reviewed
Jun 12, 2025
|
|
||
| if (!isOnramp && (toToken as FiatTokenDetails).type !== 'moonbeam' && anchorUrl) { | ||
| window.open(anchorUrl, '_blank'); | ||
| // If signing was rejected, we do not open the anchor URL again |
Contributor
There was a problem hiding this comment.
Why is this guard needed now? The signatures are always prompted after coming back from the anchor.
Is this to ensure that the user doesn't go a second time by mistake?
Member
Author
There was a problem hiding this comment.
I noticed the following:
- Do the EUR flow up until you are requested to sign requests
- This means you filled in all the data on Mykobo's partner page, otherwise Vortex wouldn't ask you to sign something
- Reject the signing
- The 'Try again' button is shown in the summary
- Clicking on 'Try again' will open the anchor page again and at the same time ask you to sign transactions. This is weird. You don't need to go through the steps on the anchor page again since you completed it for that amount already. It should only ask you to sign the transaction again that you rejected previously. This check is needed for that behaviour.
Contributor
There was a problem hiding this comment.
Okay makes sense now! Thanks. It's hard to follow sometimes what the effects of the hooks are.
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.
This pull request introduces significant updates to the ramping process in the API and frontend, including the addition of an
updateRampmethod to handle presigned transactions and additional data. It also includes database schema changes to support these updates and modifications to the frontend services and hooks to integrate the new functionality.API Changes
New
updateRampmethod:apps/api/src/api/controllers/ramp.controller.ts: Replaced thestartRampmethod withupdateRampfor updating ramping processes with presigned transactions and additional data. Added validation for required fields and error handling for ramp states. [1] [2]apps/api/src/api/routes/v1/ramp.route.ts: Added a new route for updating ramping processes (POST /v1/ramp/:rampId/update) with detailed API documentation.Ramp service enhancements:
apps/api/src/api/services/ramp/ramp.service.ts: Added theupdateRampmethod to handle presigned transactions and merge additional data into ramp states. Updated thestartRampmethod to validate presigned transactions and require prior calls toupdateRamp. Improved ramp state handling ingetRampHistory. [1] [2] [3] [4] [5]Database schema updates:
apps/api/src/database/migrations/007-add-additional-data-to-ramp-states.ts: Added a newadditional_datacolumn to theramp_statestable to store additional information related to ramping processes.Frontend Changes
Service updates:
apps/frontend/src/services/api/ramp.service.ts: Introduced theupdateRampmethod in the frontend RampService to interact with the new API endpoint. Adjusted thestartRampmethod to reflect backend changes.Hook modifications:
apps/frontend/src/hooks/offramp/useRampService/useRegisterRamp.ts: Integrated theupdateRampmethod into the ramp registration process to handle signed transactions and additional data. Updated state management to reflect changes in ramp processes. [1] [2]Model and Metadata Updates
Ramp state model:
apps/api/src/models/rampState.model.ts: Added theadditionalDatafield to theRampStatemodel and updated initialization logic to include this new field. [1] [2] [3]State metadata:
apps/api/src/api/services/phases/meta-state-types.ts: Enhanced theStateMetadatainterface with new fields (inputAmount,outputAmount,inputCurrency,outputCurrency,walletAddress) for better tracking of ramping process details. [1] [2]