Skip to content

Add new endpoint for sending pre signed transactions for a ramp#715

Merged
ebma merged 24 commits into
stagingfrom
714-add-new-endpoint-for-sending-pre-signed-transactions-for-a-ramp
Jun 16, 2025
Merged

Add new endpoint for sending pre signed transactions for a ramp#715
ebma merged 24 commits into
stagingfrom
714-add-new-endpoint-for-sending-pre-signed-transactions-for-a-ramp

Conversation

@ebma
Copy link
Copy Markdown
Member

@ebma ebma commented Jun 12, 2025

This pull request introduces significant updates to the ramping process in the API and frontend, including the addition of an updateRamp method 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 updateRamp method:

Ramp service enhancements:

  • apps/api/src/api/services/ramp/ramp.service.ts: Added the updateRamp method to handle presigned transactions and merge additional data into ramp states. Updated the startRamp method to validate presigned transactions and require prior calls to updateRamp. Improved ramp state handling in getRampHistory. [1] [2] [3] [4] [5]

Database schema updates:

Frontend Changes

Service updates:

Hook modifications:

Model and Metadata Updates

Ramp state model:

State metadata:

@ebma ebma linked an issue Jun 12, 2025 that may be closed by this pull request
@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 12, 2025

Deploy Preview for pendulum-pay ready!

Name Link
🔨 Latest commit 2906f03
🔍 Latest deploy log https://app.netlify.com/projects/pendulum-pay/deploys/684fdb8d3e2ac100089e25ac
😎 Deploy Preview https://deploy-preview-715--pendulum-pay.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ebma ebma requested a review from a team June 12, 2025 17:19

// 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))) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this error will require certain manual action from us, what if we send it to the failed state here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point 👍

}

brCode = await this.validateBrlaOnrampRequest(additionalData.taxId, quote, quote.inputAmount);
logger.info(`BR Code for onramp: ${brCode}`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we keep this for debug?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry, will remove


if (!isOnramp && (toToken as FiatTokenDetails).type !== 'moonbeam' && anchorUrl) {
window.open(anchorUrl, '_blank');
// If signing was rejected, we do not open the anchor URL again
Copy link
Copy Markdown
Contributor

@gianfra-t gianfra-t Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay makes sense now! Thanks. It's hard to follow sometimes what the effects of the hooks are.

@ebma ebma merged commit 237ce7c into staging Jun 16, 2025
3 of 5 checks passed
@ebma ebma deleted the 714-add-new-endpoint-for-sending-pre-signed-transactions-for-a-ramp branch June 16, 2025 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add new endpoint for sending pre-signed transactions for a ramp

2 participants