Skip to content

Commit 9cfebd9

Browse files
committed
add: solana raw transaction details to API Reference section
1 parent 2f45e71 commit 9cfebd9

1 file changed

Lines changed: 94 additions & 26 deletions

File tree

content/docs/openapi/(Intents)/intents.mdx

Lines changed: 94 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ full: false
66

77
import FeatureCard from "app/components/mdx/FeatureCard";
88
import ExternalLink from "app/components/mdx/ExternalLink";
9+
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
910
import { IoPersonOutline, IoFlashOutline, IoShieldCheckmarkOutline } from 'react-icons/io5';
1011

1112
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
237238
|---|---|---|
238239
| **EVM Chains** | `to`, `value`, `data`, `from` | Recipient address, native token amount (wei), encoded function call, sender wallet |
239240
| **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. |
241242

242243
**API Endpoints:**
243244
- **Estimate:** [`/api/oc/v1/estimate`](/docs/openapi/raw-transaction-estimate)
244245
- **Execute:** [`/api/oc/v1/execute`](/docs/openapi/raw-transaction-execute)
245246

246247
The payload requires a `transactions` array, where each object represents a single contract call.
247248

248-
Example payload for an EVM chain:
249+
<Tabs items={["EVM", "Aptos", "Solana"]}>
250+
<Tab value="EVM">
249251

250-
```json
251-
{
252-
"type": "RAW_TRANSACTION",
253-
"jobId": "<unique-uuid-v4>",
254-
"details": {
255-
"caip2Id": "eip155:84532",
256-
"transactions": [
257-
{
258-
"to": "0x363653DE3f920Ec8710b1Fc01e24Df96Bf7fb15E",
259-
"from": "0xA8c1021b6322e5fF8e059295fa027A1380789037",
260-
"value": "0x0",
261-
"data": "0x6057361d0000000000000000000000000000000000000000000000000000000000000005"
262-
}
263-
]
264-
},
265-
// Other fields like gasDetails, paymasterData
266-
}
267-
```
268-
**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-
<Callout type="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.
252+
#### Example payload for EVM Chains
253+
```json
254+
{
255+
"type": "RAW_TRANSACTION",
256+
"jobId": "<unique-uuid-v4>",
257+
"details": {
258+
"caip2Id": "eip155:84532", // BASE_TESTNET
259+
"transactions": [
260+
{
261+
"to": "0x363653DE3f920Ec8710b1Fc01e24Df96Bf7fb15E",
262+
"from": "0xA8c1021b6322e5fF8e059295fa027A1380789037",
263+
"value": "0x0",
264+
"data": "0x6057361d0000000000000000000000000000000000000000000000000000000000000005"
265+
}
266+
]
267+
},
268+
// Other fields like gasDetails, paymasterData
269+
}
270+
```
271+
**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+
<Callout type="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.
277+
278+
</Tab>
279+
<Tab value="Aptos">
280+
281+
#### Example payload for Aptos Chain
282+
```json
283+
{
284+
"type": "RAW_TRANSACTION",
285+
"jobId": "<unique-uuid-v4>",
286+
"details": {
287+
"caip2Id": "aptos:testnet", // APTOS_TESTNET
288+
"transaction": {
289+
"function": "0x1::aptos_account::transfer",
290+
"typeArguments": [],
291+
"functionArguments": [
292+
"0x9ed7f8c95c5e2c3cb06dfbb48681b87401fabeb88b7d710db3720f7a2ca3fffc",
293+
"10000"
294+
]
295+
}
296+
},
297+
// Other fields like gasDetails, paymasterData
298+
}
299+
```
300+
**Key `transactions` Object Fields for Aptos Chain:**
301+
- `function`: The identifier of the Move function to invoke on-chain.
302+
- `typeArguments`: An array of type arguments to pass to the function, if applicable.
303+
- `functionArguments`: An array of arguments to pass to the Move function.
304+
305+
</Tab>
306+
<Tab value="Solana">
307+
#### Example payload for Solana Chain
308+
```json
309+
{
310+
"type": "RAW_TRANSACTION",
311+
"jobId": "<unique-uuid-v4>",
312+
"details": {
313+
"caip2Id": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1", // SOLANA_DEVNET
314+
"transaction": {
315+
"instructions": [
316+
{
317+
"keys": [
318+
{
319+
"pubkey": "CEGakCfWiBEUsh1vENRjZz26SiiVCu88ySjSPbRN7rsh",
320+
"isSigner": true,
321+
"isWritable": true
322+
}
323+
],
324+
"programId": "BTSdutYFqgaecPtnEcEefPUBsLUu6i2o1xsLrdfqKV4T",
325+
"data": [102, 232, 96, 233, 198, 89, 95, 116]
326+
}
327+
],
328+
"signer": "CEGakCfWiBEUsh1vENRjZz26SiiVCu88ySjSPbRN7rsh"
329+
}
330+
},
331+
// Other fields like gasDetails, paymasterData
332+
}
333+
```
334+
**Key `transactions` Object Fields for Solana Chain:**
335+
- `instructions`: An array of Solana instructions containing:
336+
- `keys`: Account metas involved in the instruction, specifying `pubkey`, `isSigner`, and `isWritable`.
337+
- `programId`: The program you are calling on-chain.
338+
- `data`: An array of bytes representing the instruction data.
339+
- `signer`: The user's smart wallet address on Solana, which will sign the transaction.
340+
</Tab>
341+
</Tabs>
274342

275343
---

0 commit comments

Comments
 (0)