To get started with the Meso standalone integration, you will need a Meso Partner ID and secret key which you can request here.

If you do not want to embed the Meso transfer widget into your application, you can instead allow users to on-ramp in a standalone window. Simply generate a URL and then open the window. Once the user completes onboarding, they can close the window and return to your application.

Requirements

You will need a Meso partner ID and secret key. Both of these will be provided to you when you set up your Meso partner account.

Partner ID

The Meso partner ID is used to identify your integration. This value can be exposed in your client and is used as your partnerId in the parameters.

Secret Key

This value should be treated as a sensitive secret and not exposed to your client.

This is the Meso-provided key you will use to sign your query params and generate an HMAC SHA-256 encoded signed message.

Client-side

On the client, collect on-ramp input values such as the selected token and dollar amount. These values will be sent to your backend for signing.

example-client.ts
// Prepare Meso's configuration options and encode as search params
const mesoConfiguration = new URLSearchParams({
  partnerId: "YOUR_PARTNER_ID",
  walletAddress: "HN7cABqLq46Es1jh92dQQisAq662SmxELLLsHHe4YWrH",
  network: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
  destinationAsset: "SOL",
  sourceAmount: "50",
});

// Use `https://transfer.sandbox.meso.network` in Sandbox
const urlToSign = `https://transfer.meso.network?${mesoConfiguration.toString()}`;

// Send the full URL to your backend for signing. How you send this is up to you.
const signedUrlResponse = await fetch("/backend", {
  method: "POST",
  body: JSON.stringify({ urlToSign }),
});

const { signature } = await signedUrlResponse.json(); // { signature: "cGhhbnRvbQ==" }

// Add the `signature` param to the full URL
const mesoUrl = `${urlToSign}&signature=${encodeURIComponent(signature)}`;

// You can initialize the Meso window however you choose
window.open(mesoUrl);

Opening a Window

You can open the Meso transfer in a window of your choosing. Some options include:

  • Open a new window in a browser via window.open
  • Open the URL in a WebView in a native mobile application

Server-side

On your server, when receiving the URL, sign the query parameters using your secret key.

server-side-example.ts
import crypto from "crypto";

// The URL sent to your backend for signing
// Should be `https://transfer.sandbox.meso.network` for Sandbox
const urlToSign = "https://transfer.meso.network?apiKey=...";

const signature = crypto
  .createHmac("sha256", "YOUR_SECRET_KEY")
  .update(new URL(urlToSign).search)
  .digest("base64");

// Return the signature to the client
return { signature };

Reference

Base URLs

The base URL is dependent on your environment:

  • Sandbox: https://transfer.sandbox.meso.network?<params>
  • Production: https://transfer.meso.network?<params>

Configuration Options

Meso’s on-ramp is initialized using a query string to send configuration parameters. All values should be URL-encoded.

Parameters

The following parameters are used to initialize the Meso on-ramp:

ParameterTypeDescription
partnerIdstringYour Meso-provided partner ID.
walletAddressstringThe wallet address the funds will be sent to.
sourceAsset (optional)stringThe fiat currency that will be used for the transfer.

Currently, only USD is supported.
destinationAssetstringA code for the crypto token the user is on-ramping to.

Allowed values:
  • ETH
  • SOL
  • USDC
  • POL
networkstringThe network to be used for the transfer.

Allowed values:
  • Ethereum: eip155:1
  • Solana: solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
  • Polygon: eip155:137
  • Optimism: eip155:10
  • Arbitrum: eip155:42161
  • Base: eip155:8453
sourceAmountnumberA stringified number (including decimals if needed) representing the source amount to be used for the transfer.

Examples:
  • $50 → 50
  • $50.25 → 50.25
  • $100 → 100
  • $1,000 → 1000
  • $1,000.66 → 1000.66

Constraints:
  • Minimum: $25
  • Maximum: $10,000 (this value depends on the user’s Meso limits, see support article)
destinationAmountnumberA stringified number including decimals (if needed) representing the destination amount desired from the transfer.

Examples:
  • 0.05 → 0.05
  • 50.25157 → 50.25157
  • 1 → 1
  • 1,000 → 1000

If both sourceAmount and destinationAmount are specified, destinationAmount will take precedence.
externalId (optional)stringAn identifier you want to associate with the user’s transaction(s). This identifier will be included in all transaction data we provide to you.
redirectUrl (optional)stringA URL encoded string representing where the user will be redirected after a successful transfer. In the case of a failed transfer, a redirect will not be performed.

Users will initiate the redirect by clicking button presented by Meso at the end of the flow.

This button will not be present if the redirectUrl parameter is not provided.
returnButtonContent (optional)stringThe contents of the button presented to users to navigate to the provided redirectUrl. By default, this button will read Back to {partner name}. This value is only used if redirectUrl is set.
signaturestringA hashed (and base64 encoded) value containing the configuration parameters.