Initialize the Meso on-ramp in a new window
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.
Example flow
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.
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.
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.
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.
You can open the Meso transfer in a window of your choosing. Some options include:
On your server, when receiving the URL, sign the query parameters using your secret key.
The base URL is dependent on your environment:
https://transfer.sandbox.meso.network?<params>
https://transfer.meso.network?<params>
Meso’s on-ramp is initialized using a query string to send configuration parameters. All values should be URL-encoded.
The following parameters are used to initialize the Meso on-ramp:
Parameter | Type | Description |
---|---|---|
partnerId | string | Your Meso-provided partner ID. |
walletAddress | string | The wallet address the funds will be sent to. |
sourceAsset (optional) | string | The fiat currency that will be used for the transfer. Currently, only USD is supported. |
destinationAsset | string | A code for the crypto token the user is on-ramping to. Allowed values:
|
network | string | The network to be used for the transfer. Allowed values:
|
sourceAmount | number | A stringified number (including decimals if needed) representing the source amount to be used for the transfer. Examples:
Constraints:
|
destinationAmount | number | A stringified number including decimals (if needed) representing the destination amount desired from the transfer. Examples:
If both sourceAmount and destinationAmount are specified, destinationAmount will take precedence. |
externalId (optional) | string | An 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) | string | A 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) | string | The 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. |
signature | string | A hashed (and base64 encoded) value containing the configuration parameters. |
Initialize the Meso on-ramp in a new window
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.
Example flow
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.
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.
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.
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.
You can open the Meso transfer in a window of your choosing. Some options include:
On your server, when receiving the URL, sign the query parameters using your secret key.
The base URL is dependent on your environment:
https://transfer.sandbox.meso.network?<params>
https://transfer.meso.network?<params>
Meso’s on-ramp is initialized using a query string to send configuration parameters. All values should be URL-encoded.
The following parameters are used to initialize the Meso on-ramp:
Parameter | Type | Description |
---|---|---|
partnerId | string | Your Meso-provided partner ID. |
walletAddress | string | The wallet address the funds will be sent to. |
sourceAsset (optional) | string | The fiat currency that will be used for the transfer. Currently, only USD is supported. |
destinationAsset | string | A code for the crypto token the user is on-ramping to. Allowed values:
|
network | string | The network to be used for the transfer. Allowed values:
|
sourceAmount | number | A stringified number (including decimals if needed) representing the source amount to be used for the transfer. Examples:
Constraints:
|
destinationAmount | number | A stringified number including decimals (if needed) representing the destination amount desired from the transfer. Examples:
If both sourceAmount and destinationAmount are specified, destinationAmount will take precedence. |
externalId (optional) | string | An 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) | string | A 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) | string | The 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. |
signature | string | A hashed (and base64 encoded) value containing the configuration parameters. |