The Universal Accounts SDK supports sell/swap transactions through theDocumentation Index
Fetch the complete documentation index at: https://developers.particle.network/llms.txt
Use this file to discover all available pages before exploring further.
createSellTransaction() method. This allows you to programmatically sell a token (e.g., ARB on Arbitrum) into a target primary asset, with the transaction routed through Particle’s Chain Abstraction layer.
Once the transaction is created, it returns a rootHash payload that needs to be signed. You then use your signer (e.g., Particle Auth) to sign and pass it into sendTransaction() to broadcast.
The amount you specify is the raw token amount to be sold (no decimals adjustment needed). Ensure the Universal Account has a sufficient balance of the token before calling
createSellTransaction().sendTransaction() method returns a TransactionResult object with the transaction ID and other metadata.
Specifying the Output Token Type
By default,createSellTransaction() accepts an optional second argument, tradeConfig, which lets you control what token you receive as proceeds from the sell.
The preferTokenType field inside tradeConfig accepts either a numeric literal or the named PREFER_TOKEN_TYPE enum member — both are equivalent since PREFER_TOKEN_TYPE is a numeric TypeScript enum.
| Value | Enum | Meaning |
|---|---|---|
0 | PREFER_TOKEN_TYPE.USD | Receive a USD-pegged stablecoin (USDC) |
1 | PREFER_TOKEN_TYPE.NATIVE | Receive the chain’s native token (e.g. ETH, BNB) |
If
tradeConfig is omitted entirely, the SDK uses its own default output token.Next steps
Conversion Transaction
createConvertTransaction() — convert between primary assets.sendTransaction() Response
Full breakdown of the
TransactionResult object.