You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Intents are high-level abstractions for on-chain actions. Instead of constructing and managing low-level blockchain transactions, you describe what you want to achieve—the intent—and Okto handles all the technical complexity behind the scenes.
@@ -237,39 +238,106 @@ The essential parameters you provide within the `transactions` array vary by blo
|**Aptos**|`function`, `type_arguments`, `arguments`| Function identifier, type parameters, function arguments |
240
-
|**Solana**|Coming soon|Instruction-based format|
241
+
|**Solana**|`instructions`, `signer`|List of instructions (accounts, program ID, encoded data) and the signer's public key for transaction authorization.|
**Key `transactions` Object Fields for EVM Chains:**
269
-
-`to`: The target smart contract address you want to interact with.
270
-
-`from`: The user's smart wallet address on the specified chain.
271
-
<Callouttype="warn"title="Important">The `from` address **must** be the user's smart wallet address for that network. You can retrieve this address using the [Get Account](/docs/openapi/explorer/get-wallets) endpoint.</Callout>
272
-
-`value`: The amount of native currency (in hex format) to send with the transaction (e.g., `"0x0"` for no value).
273
-
-`data`: The ABI-encoded function call, including the function signature and parameters. You can use tools like `viem` or the [ABI Encoder](https://docs.okto.tech/tools) to generate this.
**Key `transactions` Object Fields for EVM Chains:**
272
+
- `to`: The target smart contract address you want to interact with.
273
+
- `from`: The user's smart wallet address on the specified chain.
274
+
<Callouttype="warn"title="Important">The `from` address **must** be the user's smart wallet address for that network. You can retrieve this address using the [Get Account](/docs/openapi/explorer/get-wallets) endpoint.</Callout>
275
+
- `value`: The amount of native currency (in hex format) to send with the transaction (e.g., `"0x0"` for no value).
276
+
- `data`: The ABI-encoded function call, including the function signature and parameters. You can use tools like `viem` or the [ABI Encoder](https://docs.okto.tech/tools) to generate this.
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
20
-
14
+
{/* x-description-md-start */}
21
15
Find the most optimal route for swapping tokens across chains. This API determines the best path based on source/destination tokens, chains, amount, and user wallet addresses. Check out the [`getBestRoute`](https://github.com/okto-hq/okto-sdkv2-trade-service-template-app/tree/main/src/api) API template script for implementation details.
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
22
-
14
+
{/* x-description-md-start */}
23
15
Generate the complete calldata required to execute a token swap transaction on-chain. This API prepares the encoded calldata based on the selected route, amount, tokens, slippage, and fee configurations. It supports both same-chain and cross-chain swaps and includes optional permit data for approvals. Check out the [`getCallData`](https://github.com/okto-hq/okto-sdkv2-trade-service-template-app/tree/main/src/api) API template script for implementation details.
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
19
-
14
+
{/* x-description-md-start */}
20
15
Fetch a real-time quote for swapping a specified token amount from one chain to another. Check out the [`getQuote`](https://github.com/okto-hq/okto-sdkv2-trade-service-template-app/tree/main/src/api) API template script for implementation details.
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
22
-
14
+
{/* x-description-md-start */}
23
15
Fetch detailed information about a previously registered swap intent using the order ID. This API returns the status, route, fee, swapper inputs/outputs, and execution steps associated with the order. It is typically used to track the progress or outcome of a swap intent. Check out the [`orderDetails`](https://github.com/okto-hq/okto-sdkv2-trade-service-template-app/tree/main/src/api) API template script for implementation details.
24
16
17
+
**Understanding Order Status**
18
+
19
+
The `orderData.status` field in the response indicates your order’s current state:
20
+
21
+
| Status Code | Description |
22
+
|-------------|-------------|
23
+
|`-1`| Order expired. The order did not register on-chain. Terminal state. |
24
+
|`0`| Order received by the backend but not yet registered on-chain. |
25
+
|`1`| Order registered on-chain but not yet filled. |
26
+
|`2`| Order settled successfully. Terminal state. |
27
+
|`3`| Order in dispute. The order was filled but not yet settled. |
28
+
|`4`| Order refunded. The order was not filled, and user was refunded. Terminal state. |
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
21
-
14
+
{/* x-description-md-start */}
22
15
Registers a swap intent on the system using a signed order. This API call is typically made after generating a quote and selecting a route, and before executing the actual swap. It ensures the swap details are securely logged and authorized for processing. Check out the [`registerIntent`](https://github.com/okto-hq/okto-sdkv2-trade-service-template-app/tree/main/src/api) API template script for implementation details.
Copy file name to clipboardExpand all lines: public/openapi/openapi-trade-service.json
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@
32
32
"post": {
33
33
"tags": ["Usage"],
34
34
"summary": "Get Quote",
35
-
"description": "Fetch a real-time quote for swapping a specified token amount from one chain to another. Check out the [`getQuote`](https://github.com/okto-hq/okto-sdkv2-trade-service-template-app/tree/main/src/api) API template script for implementation details.",
35
+
"x-description-md": "Fetch a real-time quote for swapping a specified token amount from one chain to another. Check out the [`getQuote`](https://github.com/okto-hq/okto-sdkv2-trade-service-template-app/tree/main/src/api) API template script for implementation details.",
36
36
"operationId": "getQuote",
37
37
"requestBody": {
38
38
"required": true,
@@ -175,7 +175,7 @@
175
175
"post": {
176
176
"tags": ["Usage"],
177
177
"summary": "Get Best Route",
178
-
"description": "Find the most optimal route for swapping tokens across chains. This API determines the best path based on source/destination tokens, chains, amount, and user wallet addresses. Check out the [`getBestRoute`](https://github.com/okto-hq/okto-sdkv2-trade-service-template-app/tree/main/src/api) API template script for implementation details.",
178
+
"x-description-md": "Find the most optimal route for swapping tokens across chains. This API determines the best path based on source/destination tokens, chains, amount, and user wallet addresses. Check out the [`getBestRoute`](https://github.com/okto-hq/okto-sdkv2-trade-service-template-app/tree/main/src/api) API template script for implementation details.",
179
179
"operationId": "getBestRoute",
180
180
"requestBody": {
181
181
"required": true,
@@ -424,7 +424,7 @@
424
424
"post": {
425
425
"tags": ["Usage"],
426
426
"summary": "Register Intent",
427
-
"description": "Registers a swap intent on the system using a signed order. This API call is typically made after generating a quote and selecting a route, and before executing the actual swap. It ensures the swap details are securely logged and authorized for processing. Check out the [`registerIntent`](https://github.com/okto-hq/okto-sdkv2-trade-service-template-app/tree/main/src/api) API template script for implementation details.",
427
+
"x-description-md": "Registers a swap intent on the system using a signed order. This API call is typically made after generating a quote and selecting a route, and before executing the actual swap. It ensures the swap details are securely logged and authorized for processing. Check out the [`registerIntent`](https://github.com/okto-hq/okto-sdkv2-trade-service-template-app/tree/main/src/api) API template script for implementation details.",
428
428
"operationId": "registerIntent",
429
429
"requestBody": {
430
430
"required": true,
@@ -514,7 +514,7 @@
514
514
"post": {
515
515
"tags": ["Usage"],
516
516
"summary": "Get Order Details",
517
-
"description": "Fetch detailed information about a previously registered swap intent using the order ID. This API returns the status, route, fee, swapper inputs/outputs, and execution steps associated with the order. It is typically used to track the progress or outcome of a swap intent. Check out the [`orderDetails`](https://github.com/okto-hq/okto-sdkv2-trade-service-template-app/tree/main/src/api) API template script for implementation details.",
517
+
"x-description-md": "Fetch detailed information about a previously registered swap intent using the order ID. This API returns the status, route, fee, swapper inputs/outputs, and execution steps associated with the order. It is typically used to track the progress or outcome of a swap intent. Check out the [`orderDetails`](https://github.com/okto-hq/okto-sdkv2-trade-service-template-app/tree/main/src/api) API template script for implementation details.\n\n**Understanding Order Status**\n\nThe `orderData.status` field in the response indicates your order’s current state:\n\n| Status Code | Description |\n|-------------|-------------|\n| `-1` | Order expired. The order did not register on-chain. Terminal state. |\n| `0` | Order received by the backend but not yet registered on-chain. |\n| `1` | Order registered on-chain but not yet filled. |\n| `2` | Order settled successfully. Terminal state. |\n| `3` | Order in dispute. The order was filled but not yet settled. |\n| `4` | Order refunded. The order was not filled, and user was refunded. Terminal state. |",
518
518
"operationId": "orderDetails",
519
519
"requestBody": {
520
520
"required": true,
@@ -691,7 +691,7 @@
691
691
"post": {
692
692
"tags": ["Usage"],
693
693
"summary": "Get Call Data",
694
-
"description": "Generate the complete calldata required to execute a token swap transaction on-chain. This API prepares the encoded calldata based on the selected route, amount, tokens, slippage, and fee configurations. It supports both same-chain and cross-chain swaps and includes optional permit data for approvals. Check out the [`getCallData`](https://github.com/okto-hq/okto-sdkv2-trade-service-template-app/tree/main/src/api) API template script for implementation details.",
694
+
"x-description-md": "Generate the complete calldata required to execute a token swap transaction on-chain. This API prepares the encoded calldata based on the selected route, amount, tokens, slippage, and fee configurations. It supports both same-chain and cross-chain swaps and includes optional permit data for approvals. Check out the [`getCallData`](https://github.com/okto-hq/okto-sdkv2-trade-service-template-app/tree/main/src/api) API template script for implementation details.",
0 commit comments