Wrap SOL
Wrap native SOL into canonical WSOL in the workflow wallet's Associated Token Account. Creates the ATA when absent, transfers the exact requested lamports, and runs SyncNative. Use before Solana protocols that require WSOL; this is not a Jupiter swap.
Catalog action Solana Onchain wallet Gas swap
Wrap native SOL into canonical WSOL in the workflow wallet's Associated Token Account. Creates the ATA when absent, transfers the exact requested lamports, and runs SyncNative. Use before Solana protocols that require WSOL; this is not a Jupiter swap.
This action can require a wallet connector, gas, token movement, or an external side effect. Test with simulation or a controlled amount before using it in a live workflow.
At a Glance
| Field | Value |
|---|---|
| Action ID | wrap-sol |
| Category | Solana Onchain |
| Connector | wallet |
| Requires gas | Yes |
| Funds movement | swap |
| Tags | blockchain, solana, sol, wrap, token, write |
Payload Schema
| Field | Type | Required | Description |
|---|---|---|---|
chainId | number | Yes | Solana Mainnet chain ID. |
amount | string | Yes | Exact positive amount of native SOL to wrap, in human-readable SOL units (for example, "0.1"). Supports up to 9 decimal places. |
Result Schema
| Field | Type | Required | Description |
|---|---|---|---|
status | string | Yes | - |
signature | string | Yes | Solana transaction signature. |
transactionHash | string | Yes | Solana transaction signature for workflow audit trails. |
txStatus | string | No | - |
chainId | number | Yes | - |
owner | string | Yes | - |
wsolAta | string | Yes | - |
wsolMint | string | Yes | - |
rawSolSpent | string | Yes | Native SOL lamports transferred into the canonical WSOL ATA. |
formattedSolSpent | string | Yes | - |
rawWsolReceived | string | Yes | Raw WSOL credited from the requested SOL transfer. |
formattedWsolReceived | string | Yes | - |
rawRequestedWsolReceived | string | No | Raw WSOL credited from the user's exact transfer, excluding pre-existing lamports SyncNative may also credit. |
formattedRequestedWsolReceived | string | No | - |
rawAdditionalWsolSynced | string | No | Preflight-projected extra WSOL from observed unsynced native-token lamports or above-rent prefunded ATA lamports. |
formattedAdditionalWsolSynced | string | No | - |
decimals | number | No | - |
ataCreated | boolean | Yes | - |
ataRentLamports | string | No | Rent deposited when the canonical WSOL ATA was created in this transaction. |
formattedAtaRentLamports | string | No | - |
prefundedAtaLamports | string | No | Observed lamports already present in a zero-data System-owned canonical ATA before creation. |
formattedPrefundedAtaLamports | string | No | - |
prefundedAdditionalWsolLamports | string | No | Preflight-projected portion of prefunded ATA lamports above rent that SyncNative will credit as WSOL. |
formattedPrefundedAdditionalWsol | string | No | - |
modeledFeeLamports | string | No | Modeled network fee bound used before wallet signing. |
formattedModeledFee | string | No | - |
projectedSolDeltaLamports | string | No | - |
projectedWsolDeltaLamports | string | No | - |
actualSolDeltaLamports | string | No | - |
actualWsolDeltaLamports | string | No | - |
preSolLamports | string | No | Observed native SOL balance before signing. |
postSolLamports | string | No | Observed native SOL balance after confirmation. |
preWsolRaw | string | No | Observed canonical WSOL ATA token balance before signing. |
preWsolUnsyncedLamports | string | No | Pre-existing lamports in the canonical WSOL ATA not yet reflected in its SPL Token amount. |
postWsolRaw | string | No | Observed canonical WSOL ATA token balance after confirmation. |
computeUnitLimit | number | No | - |
unitsConsumed | number | No | - |
priorityFeeMicroLamports | number | No | - |
slot | number | No | - |
confirmationSlot | number | No | - |
simulationState | string | Yes | - |
simulationLogs | array | No | - |
simulated | boolean | Yes | - |
observationStatus | string | No | - |
observationError | string | No | - |
Examples
json{ "type": "wrap-sol", "payload": { "chainId": 7565164, "amount": "0.1" }, "children": [], "connector": { "type": "wallet", "id": "conn_wallet" }}
bashcurl -X POST "https://api.b3os.org/v1/actions/wrap-sol/test" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "inputs": { "chainId": 7565164, "amount": "0.1" }}'
Payload fields can use workflow expressions such as {{$trigger.body.amount}}, {{$nodes.fetch.result.price}}, and {{$props.asset}} when the value should come from a trigger, prior node, or reusable workflow prop.
