Transaction · Acts onchain
Compiles a draft action sequence into coil options, output manifests, and simulated slot values without persisting anything. This is the preview step the composer runs on every edit. It is not bound to a wallet, it never submits, and nothing it computes outlives the response: it exists so a draft can be checked against the compiler that will eventually execute it, every keystroke, for free. Reach for it to validate a sequence as it is being written, to learn what each step will output before anything is signed, or to build composer-grade tooling of your own on the same contract the app uses.
Send a request
Response
{links: {self: stringprev: string | undefinednext: string | undefined} | undefinedheaders: unknown | undefineddata: {options: (Record<string, ({name: stringtype: stringref: string})[]>)[] | nulloutputs: any[] | nullparameters: ({step: numbername: stringtype: string})[] | nullgraph: {nodes: ({step: numberprotocol: stringaction: stringoutputs: any[] | nullir: ({index: numberkind: stringlabel: string | nulldead: boolean | nullreads: number[] | nullwrites: number[] | null})[] | null})[]edges: ({kind: stringsource: numbersource_slot: numbersource_name: string | nullsource_tags: any | nullfields: number[] | nulltarget: numbertarget_input: stringref: string})[]} | nullsimulation: {verdict: string | nullreason: string | nullfailing_step: number | nullgas_used: number | nullblock_number: number | nulloutputs: ({action_index: numberaction: stringassumed: boolean | nullslots: ({name: stringtype: anyslot: numberpath: stringtags: ({kind: stringvalue: string | undefinedqualifiers: string[] | undefineddynamic: boolean | undefinedreference: number | undefined})[] | nullvalue: string | null})[]})[] | nullexclusions: ({step: numbercause: string})[] | null} | nullcalls: ({to: stringvalue: stringdata: string})[] | nullprogram: {socket: stringsalt: stringdeadline: numbertyped_data: {types: Record<string, ({name: stringtype: string})[]>primaryType: stringdomain: Record<string, any>message: Record<string, any>}} | null} | null}
Code samples
Language
Prompt
Call the Plug API endpoint "Compile transaction".## EndpointPUT /transaction/Base URL: https://api.plug.to## DescriptionCompiles a draft action sequence into coil options, output manifests, and simulated slot values without persisting anything.This is the preview step the composer runs on every edit. It is not bound to a wallet, it never submits, and nothing it computes outlives the response: it exists so a draft can be checked against the compiler that will eventually execute it, every keystroke, for free.Reach for it to validate a sequence as it is being written, to learn what each step will output before anything is signed, or to build composer-grade tooling of your own on the same contract the app uses.## Query Parameters- input[chain_id] (integer, required) — The chain to compile the transaction for.- input[owner] (string, optional) — The simulation subject: drafts compile and simulate at this address's counterfactual socket, so user-specific reads observe its real chain state. Absent, drafts simulate on the synthetic account.- input[steps] (string, required) — The steps/actions to compile.- input[overrides] (string, optional) — Debugger hypotheses: step.path keys naming read outputs, 0x-hex raw slot values. The program re-executes with each read pinned to its stated value; a draft carrying overrides projects fully and is never signable.- input[signature] (string, optional) — The owner's EIP-712 signature over the lowered program. Present on the second lowering pass: with it the response carries the complete wallet_sendCalls batch including the factory createAndExecute call, simulated as the exact batch that will execute. Without it the response carries the typed data to sign.- input[deadline] (integer, optional) — Unix seconds for the program deadline. The deadline is part of the signed typed data, so a signed re-simulation must echo the value that was signed; a different deadline is a different program. Absent or zero, the server stamps its default TTL.## Headers- Accept (string, required) — For a typical single-time JSON response, set this to application/json. To receive realtime updates through a stream, set this to text/event-stream. (default: application/json) [application/json, text/event-stream]Current value: application/json## Response Schema- links (object, optional)- self (string, required)- prev (string, optional)- next (string, optional)- headers (unknown, optional)- data (object, optional)- options (array of Record<string, array>, optional)- outputs (array of any, optional)- parameters (array- step (integer, required)- name (string, required)- type (string, required), optional) — Inputs the draft leaves unbound for execution time.- graph (object, optional)- nodes (array- step (integer, required)- protocol (string, required)- action (string, required)- outputs (array of any, optional)- ir (array- index (integer, required)- kind (string, required)- label (string, optional)- dead (boolean, optional)- reads (array of integer, optional)- writes (array of integer, optional), optional), required)- edges (array- kind (string, required)- source (integer, required)- source_slot (integer, required)- source_name (string, optional)- source_tags (any, optional)- fields (array of integer, optional)- target (integer, required)- target_input (string, required)- ref (string, required), required)- simulation (object, optional)- verdict (string, optional)- reason (string, optional)- failing_step (integer, optional)- gas_used (integer, optional)- block_number (integer, optional)- outputs (array- action_index (integer, required)- action (string, required)- assumed (boolean, optional)- slots (array- name (string, required)- type (any, required)- slot (integer, required)- path (string, required)- tags (array- kind (string, required)- value (string, optional)- qualifiers (array of string, optional)- dynamic (boolean, optional)- reference (integer, optional), optional)- value (string, optional), required), optional)- exclusions (array- step (integer, required)- cause (string, required), optional)- calls (array- to (string, required)- value (string, required)- data (string, required), optional) — The executable wallet_sendCalls batch. Present only when the request carried the owner's signature and the simulation verdict is executable.- program (object, optional) — The typed data to sign and the account it executes on. Present when the draft is complete and an owner was given; absent once a signature is supplied.- socket (string, required)- salt (string, required)- deadline (integer, required)- typed_data (object, required)- types (Record<string, array>, required)- primaryType (string, required)- domain (Record<string, any>, required)- message (Record<string, any>, required)## Example RequestPUT https://api.plug.to/transaction/