Actions12
Overview
This node integrates with Soroswap, a decentralized exchange (DEX) on the Stellar network. It enables users to interact programmatically with Soroswap's trading and liquidity features, such as obtaining trading quotes, building transactions for token swaps, managing liquidity pools, and sending signed transactions.
The Build Transaction operation specifically takes a previously obtained quote and constructs a transaction that can be signed and submitted to the Stellar network. This is useful in workflows where you want to automate token swaps or liquidity operations by preparing the exact transaction data needed for execution.
Practical examples:
- Automating token swaps by first getting a quote and then building the corresponding transaction.
- Preparing transactions for liquidity provision or removal based on dynamic market conditions.
- Integrating Soroswap trading capabilities into larger Stellar-based automation pipelines.
Properties
| Name | Meaning |
|---|---|
| Network | The Stellar network to use: either Mainnet or Testnet. |
| Quote | JSON object containing the quote response from a previous quote operation. Required. |
| From Address | Source wallet address initiating the transaction. |
| To Address | Destination wallet address receiving the tokens or liquidity. |
Output
The node outputs a JSON object representing the built transaction details. This typically includes the transaction envelope or XDR string and any metadata necessary to sign or submit the transaction on the Stellar network.
No binary data output is produced by this operation.
Dependencies
- Requires an API key credential for Soroswap's SDK service.
- Uses the Soroswap SDK (
@soroswap/sdk) to interact with the Soroswap API. - Needs network selection between Mainnet and Testnet to target the correct blockchain environment.
Troubleshooting
- Error: Unknown operation — This occurs if an unsupported operation name is provided. Ensure the operation parameter is set to "build" for this functionality.
- Invalid quote JSON — The quote input must be a valid JSON object returned from a prior quote operation; malformed or incomplete quotes will cause errors.
- Missing addresses — If the "From Address" or "To Address" fields are empty or invalid, the transaction build may fail or produce incorrect results.
- API key issues — Authentication failures due to missing or invalid API keys will prevent communication with Soroswap services.
- Network mismatch — Using the wrong network setting (e.g., Mainnet vs Testnet) can cause transaction submission failures or invalid transaction builds.
To resolve these, verify all inputs carefully, ensure credentials are correctly configured, and confirm network settings match your intended environment.
Links and References
- Soroswap Official Website
- Stellar Network Documentation
- Soroswap SDK GitHub Repository (for detailed SDK usage and API references)