Skip to main content
This page is optional developer tooling. Read Embedded Wallets first for the concepts and the detail of each step.
Embedded wallets run on Stellar. Quoting and ordering follow the standard procedure, so this page links to Onramps and Offramps for the details.
Sandbox API keys only. Run this script server-side. Never put a production API key in client-side code.

Minimal sandbox onramp

The script generates a P-256 signer key, registers the embedded wallet, quotes MXN into a Stellar asset, creates the order, simulates the fiat deposit, and waits for the order. When the order becomes claimable, it builds the claim transaction, signs the order’s authorization, submits the approval, and waits for completed.
The script generates the signer key in memory so it runs on its own. In a real integration, the key holder generates the key once and keeps the private key. Only the public key reaches us.
The script needs Node.js 20 or later for the global fetch and WebCrypto. Set these environment variables:
Each commented api() call links to the API reference:
The order becomes claimable only when the wallet has no trustline for the asset yet, which is the case for a wallet’s first onramp of that asset. Later onramps of the same asset go straight to completed.

Embedded Wallets

Stellar

Onramps

Offramps