Integration Guide
Integrating with Pluton enables wallets, dApps, and services to offer seamless cross-chain swaps and bridges to their users.
A typical integration involves:
Defining an intent (e.g., swap 100 USDT on Arbitrum to TON on Ton).
Sending the intent to Pluton via our SDK or API.
Receiving a quote and transaction details.
Executing the transaction and receiving confirmation.
See our Terminology Page for definitions of key concepts such as intent, solver, quote, affiliate, and more. For developers looking to integrate Pluton into their projects, the following endpoints and workflows are essential.
1. Prerequisites
API Key: Request an API key from the Pluton team for authenticated endpoints.
Base URL: All endpoints are relative to your Pluton backend deployment (e.g.,
https://api.pluton.exchange).
2. Network & Token Discovery
Get Supported Networks and Tokens
GET
/networkReturns all supported networks and their tokens.Response Example:
{ "res": [ { "chainId": 42161, "tokens": [ { "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7", "symbol": "USDT", ... } ] } ], "count": 1 }GET
/network/tokens/?page=1&offset=10Paginated list of networks and tokens.GET
/network/allReturns all networks and tokens (non-paginated).
Get Token List
GET
/token/list?page=1&offset=10Paginated list of tokens.GET
/token/syncManually trigger token sync (admin/integrator use).
Get Token USD Price
GET
/price/usd-price?address=<tokenAddress>&chainId=<chainId>Returns the USD price for a given token.
3. Quote & Intent Flow
1. Request a Quote
POST
/quote/selectRequest a quote for a user intent.Request Body Example:
{ "fromChainId": 42161, "fromToken": "0xdAC17F958D2ee523a2206206994597C13D831ec7", "fromAmount": "100000000", "toChainId": 101, "toToken": "So11111111111111111111111111111111111111112", "toAddress": "DestinationWalletAddress", "slippage": 0.005, "affiliate": "optionalAffiliateId", "referrer": "optionalReferrerId" }Response Example:
{ "quoteId": "uuid", "solverId": "uuid", "fromAmount": "100000000", "toAmount": "50000000", "fee": "1000000", "rate": "0.5", "estimatedDuration": 45, "executionPlan": [ ... ] }
2. Track Intent Status
GET
/quote/intent/:idGet the status and details of a specific quote intent by ID.
3. Refunds
POST
/quote/refund/requestRequest a refund signature for an unsolved quote.POST
/quote/refundGet the user refund signature to claim back funds from the contract.
4. Affiliate/Referral Claims
GET
/quote/affiliate/requestRequest a signature to claim affiliate assets.POST
/quote/affiliateGet the affiliate claim signature to claim funds from the contract.
4. Solver Claim Flow
For solvers who have executed an intent and want to claim their reward:
POST
/solver/claimRequest a signature and transaction details for a claim.Request Body Example:
{ "claimerAddress": "0x1234567890abcdef1234567890abcdef12345678", "chainId": 42161, "coinType": 60, "tokenAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7" }Response Example:
{ "signature": "0xabcdef...", "lastClaimedAmount": "1000000", "claimerAddress": "0x1234567890abcdef1234567890abcdef12345678", "amountToClaim": "500000", "transaction": { "hash": "0xabc123...", "status": 1 } }
5. Error Handling
All endpoints return errors in a standardized format:
{
"error": {
"code": "ERR_CODE",
"message": "Description of the error."
}
}Common Error Codes:
ERR_NO_SOLVERERR_INVALID_QUOTEERR_EXECUTION_FAILEDERR_VERIFICATION_FAILEDERR_UNAUTHORIZED
6. Integration Checklist
7. Example Flow
User Action: User initiates a cross-chain swap in your dApp.
Quote Request: Your backend sends a POST to
/quote/select.Quote Selection: Receive and display the quote to the user.
Execution: User confirms; transaction is executed.
Status Tracking: Poll
/quote/intent/:idfor updates.Completion: User is notified of success, or error handling is triggered.
Last updated