Skip to main content

Stablecoin to SphereNet (Crypto On-Ramp)

The example below shows how to transfer USDC from Solana to SphereNet. We will handle all the necessary conversions but require the user to initiate the transfer to our deposit address first.

Example Request

POST v1/transactions
curl https://api.sphere.net/v1/transactions \
-H 'Authorization: Bearer <API_KEY>' \
-H 'Idempotency-Key: <Unique Idempotency Key>' \
-d '{
"amount": "1000.00",
"customer": "cust_alice",
"source": {
"paymentRail": "solana",
"currency": "usdc",
"fromAddress": "5KL6MAQ4i8ht4PR8uHE4CQrxRMXHNX9Jv9dUBgH7jj3j"
},
"destination": {
"paymentRail": "spherenet",
"currency": "usd",
"account": "sphere1abc..."
}
}'

Response

{
"ok": true,
"object": "object",
"statusCode": 200,
"error": null,
"message": "success",
"data": {
"id": "txn_123",
"state": "processing",
"customer": "cust_alice",
"amount": "1000.00",
"source": {
"paymentRail": "solana",
"currency": "usdc",
"fromAddress": "5KL6MAQ4i8ht4PR8uHE4CQrxRMXHNX9Jv9dUBgH7jj3j"
},
"destination": {
"paymentRail": "spherenet",
"currency": "usd",
"account": "sphere1abc..."
},
"networkData": {
"signature": "2id3YC2jK9G5Wo2phDx4gJVAew8DcY5NAojnVuao8aCxBwKE7k4PoHiH1ViQX8KgB9CKBY2RcKF8PSbBqhqFQXXX",
"slot": 430,
"confirmations": 1,
"commitment": "processed",
"error": null
},
"sourceDepositInstructions": {
"paymentRail": "solana",
"amount": "1000.00",
"currency": "usdc",
"fromAddress": "5KL6MAQ4i8ht4PR8uHE4CQrxRMXHNX9Jv9dUBgH7jj3j",
"toAddress": "8JFTv1FHAqEgupBxHmkzDwtRGtPojCQ4KyxE3HXGVN2i"
},
"createdAt": "2024-01-20T19:39:14.316Z",
"updatedAt": "2024-01-20T19:39:14.316Z"
},
"ts": "2024-08-22T16:15:42.707Z",
"request": "request_cdde26b2c0534183a1aaba6baebaec1f"
}