RampManager splits this into two halves: an off-chain provider (quotes, session creation, and status polling against a real payment processor or a dev-mode stub) and an optional on-chain settlement contract (RampSettlement) that holds off-ramp custody and writes a permanent record of on-ramp mints. You can use either half on its own, or combine them for a fully verifiable ramp flow.
Ramp providers
ARampProvider is a pluggable interface — swap implementations without changing any calling code. The SDK ships two built-in providers; you can also write your own against the RampProvider interface, or use createRampProvider() to select one from a config object.
ManualRampProvider (dev / testing)
ManualRampProvider uses in-memory sessions and configurable exchange rates — no real network calls, no API keys. It is the right default for local development and tests.
provider.markSettled(sessionId) or provider.markFailed(sessionId) to simulate payment outcomes without any real fiat movement.
StellarAnchorProvider (SEP-24)
StellarAnchorProvider connects to any Stellar-compatible anchor (Cowrie, MoneyGram, Bitso) purely by home domain. It handles SEP-10 authentication, SEP-24 interactive deposit/withdrawal, and optional SEP-38 quotes transparently.
StellarAnchorProvider makes real HTTP calls to the anchor on every method. Verify your chosen anchor’s SEP-24 implementation on testnet before going live.MoonPay
To use MoonPay, pass aRampProviderSelection with provider: "moonpay" to createRampProvider(). createRampProvider lives in the @ankarachain/sdk/server entry point — it keeps Node.js-only signing code out of browser bundles. Only call this server-side or in a backend service:
Custom provider
Implement theRampProvider interface to connect any payment processor — Yellow Card, Flutterwave, Transak, or your own API:
createRampProvider()
UsecreateRampProvider() for declarative provider selection from a config object — useful for reading provider settings from environment variables without importing provider classes directly. It is exported from @ankarachain/sdk/server (a server-only entry point) because the moonpay selection links in Node.js signing code:
For Stellar anchors, use
RampManager.connectAnchor() instead of createRampProvider() — the stellar-anchor selection requires a StellarExternalSigner that connectAnchor wires in for you.Using separate providers per direction
If your on-ramp and off-ramp go through different processors — for example MoonPay in, a Stellar anchor out — useRampManager.withProviders():
Getting a quote
Callramp.getQuote() before initiating a session to show the user what they’ll pay or receive. Provide either fiatAmount or tokenAmount — not both:
RampQuote shape:
Initiating an on-ramp
An on-ramp session creates a payment URL where the user completes fiat payment. After they pay, the provider triggers a webhook (or you pollgetStatus) and you mint the corresponding tokens.
Initiating an off-ramp
An off-ramp session accepts aRampPayoutAccount that describes the user’s bank or mobile-money account:
On-chain settlement (optional)
TheRampSettlement contract provides a custody layer and an on-chain audit trail. Deploy one per platform (not per user):
RampManager:
depositOffRamp
After the user initiates an off-ramp session, they deposit their tokens into the settlement contract. On EVM, approve the contract first:confirmOffRampSettlement
Once the provider confirms the fiat payout succeeded, release the custodied tokens to the treasury:recordOnRampSettlement
Record an attestation that an on-ramp mint happened. This does not move funds — call it after you have already minted the tokens:CLI ramp commands
Supported fiat currencies
Additional currencies can be supported by configuring custom exchange rates in
ManualRampProvider, or by connecting an anchor / payment processor that covers those markets.