createAction and executeAction.
For trading actions, the Trading pages document the convenience wrappers (placeOrder, cancelOrders, etc.) that handle createAction, agent-signing, and executeAction automatically. Those wrappers are the supported public surface for trade dispatch — createAction/executeAction are documented here for completeness and for action types that don’t have a dedicated wrapper. Withdrawals and account setup use the same authorization model, but the SDK exposes higher-level helpers (withdraw, checkSetup / executeProviderSetupAction) that should be preferred. Session-only actions execute directly through the provider plugin and intentionally skip executeAction.
Pattern
- Create — call
createAction()with the action type and params. Returns one or moreActionSteppayloads. Each step’s shape depends on the action’ssigningMethod: EIP-712 typed data, a WASM-signer blob, an EVM transaction, an HMAC request, a SIWE challenge, or a client-only session marker. - Authorize — let the provider plugin sign or execute each step according to
ProviderAction.signersandsigningMethod.USERmeans a user-owned authorization path (usually the wallet, or a client-held provider session forsessionsteps);SDKmeans the provider plugin completes the step internally. UseexecuteProviderSetupActionfor setup steps instead of embedding scheme-specific logic. - Execute — call
executeAction()with signed EIP-712, WASM, EVM, HMAC, or SIWE payloads. Asessionstep is completed client-side by the plugin and produces no signed step to submit.
createAction
Build action payloads for signing.Parameters
Returns
CreateActionResponse — { actions: ActionStep[] }.
ActionStep is a discriminated union by structural shape — the SDK dispatches to the correct signer based on which key is present. The variant that comes back is determined by the action’s signingMethod on the provider descriptor (see SigningMethod).
Eip712ActionStep — EIP-712 typed-data flow (Hyperliquid; most actions):
WasmBlobActionStep — WASM signer flow (Lighter):
EvmTxActionStep — on-chain EVM transaction (e.g. Lighter deposit):
HmacActionStep — provider request signed SDK-side with a client-held API key:
SiweActionStep — ERC-4361 login challenge:
SessionActionStep — provider-session marker completed client-side, not sent to executeAction. Ondo’s createDepositAddress carries a public { network: 'ethereum', symbol: 'USDC', depositDestination: { wallet: 'margin' } } policy marker; acceptProviderTerms and registerApiKey use an empty marker (session: {}). A session-signed action can also be wire-shaped as a request-bearing step instead of a marker — Ondo’s setReferrer carries a real { method, path, body } request that the SDK submits directly with the session credential rather than HMAC-signing it.
A single
createAction call may return multiple actions. For example, placeOrder with a leverage param different from the current setting returns both an updateLeverage and a placeOrder step.EvmCall
ThetxParams on the EVM-transaction step variants is an EvmCall:
executeAction
Submit signed action payloads.Parameters
SignedActionStep is a discriminated union that mirrors ActionStep — each variant carries the original payload plus its signed artefact.
Eip712SignedActionStep:
WasmBlobSignedActionStep:
EvmTxSignedActionStep:
Returns
ExecuteActionResponse — { results: ActionResult[] }:
Each ActionResult:
Action Types
All action types from the provider’ssetup, options, and actions arrays can be used with createAction/executeAction:
|
metaAcceptTerms | Meta | Accept the current app-wide LI.FI terms of service. Provider-independent (see App-level onboarding). |
| metaOnboard | Meta | Accept the current app-wide terms and, optionally, attach an internal referral code, in one signature. Provider-independent (see App-level onboarding). |
| metaCreateReferralCode | Meta | Reserve the shareable internal referral code an address owns. Provider-independent (see App-level onboarding). |
For parameter schemas per action type, see Actions API. For the high-level convenience wrappers that handle agent signing automatically, see SDK / Trading.
API Reference: POST /createAction, POST /executeAction
App-level onboarding
The threeMeta actions above are provider-independent: the SDK sends them with the META_PROVIDER ('meta') sentinel instead of a real provider key, so the backend dispatches them without resolving a venue plugin. They carry no ProviderAction descriptor and are always signed as EIP-712 typed data with the end-user’s wallet — never with a provider’s agent, native key, or session credential.
PerpsClient exposes three matching methods:
PerpsError when no user wallet is configured, when the backend returns more than one step or a non-EIP-712 step, or when the submitted step reports a failed result; a wallet signature refusal propagates as the wallet’s own error.
Use getTermsAcceptance to check the current terms version and whether an address has already accepted it before calling submitOnboarding.