Skip to main content
The Universal Accounts SDK supports sell/swap transactions through the 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().
The 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.
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.