Response from a session actions submission.

Includes both success and error fields for accurate success checking. A reverted tx can still have a txId — check .success to distinguish.

const response = await client.createOrder("fFUEL/fUSDC", "buy", "0.02", "100");
if (response.success) {
console.log(`TX: ${response.txId}`);
console.log(`Orders: ${response.orders?.length}`);
} else {
console.log(`Failed: ${response.reason ?? response.message}`);
}

Constructors

  • Parameters

    • txId: null | TxId
    • orders: null | Order[]
    • reason: null | string
    • receipts: null | unknown[]
    • code: null | number
    • message: null | string

    Returns SessionActionsResponse

Properties

code: null | number

Error code (present for pre-flight validation errors).

message: null | string

Error message.

orders: null | Order[]

Created/updated orders (if collect_orders was true).

reason: null | string

On-chain revert reason (e.g., "NotEnoughBalance").

receipts: null | unknown[]

Transaction receipts from on-chain reverts.

txId: null | TxId

On-chain transaction ID, or null if preflight error.

Accessors

  • get isOnChainRevert(): boolean

    true if the transaction was submitted but reverted on-chain.

    Returns boolean

  • get isPreflightError(): boolean

    true if this is a pre-flight validation error.

    Returns boolean

  • get success(): boolean

    true if the transaction succeeded without reverts or errors.

    Returns boolean

Methods