---
id: execution-outcome
sidebar_position: 6
sidebar_label: ExecutionOutcome
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# `ExecutionOutcome` Structure

## Definition

ExecutionOutcome is the result of execution of [Transaction](transaction.mdx) or [Receipt](receipt.mdx)

:::info Transaction's ExecutionOutcome

In the result of the Transaction execution will always be a Receipt.

:::

## `ExecutionOutcomeWithIdView`

<Tabs>
  <TabItem value="rust" label="Rust">

```rust links=1
pub struct ExecutionOutcomeWithIdView {
    pub proof: MerklePath,
    pub block_hash: CryptoHash,
    pub id: CryptoHash,
    pub outcome: ExecutionOutcomeView,
}
```

  </TabItem>
  <TabItem value="typescript" label="TypeScript">

```ts links=1
export type ExecutionOutcomeWithReceipt = {
  executionOutcome: {
    blockHash: string;
    id: string;
    outcome: {
      executorId: string,
      gasBurnt: number,
      logs: string[],
      metadata: {
        gasProfile: string | null;
        version: number;
      };
      receiptIds: string[],
      status: ExecutionStatus,
      tokensBurnt: string
    };
    proof: ExecutionProof[];
  };
  receipt: Receipt | null;
};
```

  </TabItem>
</Tabs>

## `ExecutionOutcomeView`

<Tabs>
  <TabItem value="rust" label="Rust">

```rust links=1
pub struct ExecutionOutcomeView {
    /// Logs from this transaction or receipt.
    pub logs: Vec<String>,
    /// Receipt IDs generated by this transaction or receipt.
    pub receipt_ids: Vec<CryptoHash>,
    /// The amount of the gas burnt by the given transaction or receipt.
    pub gas_burnt: Gas,
    /// The amount of tokens burnt corresponding to the burnt gas amount.
    /// This value doesn't always equal to the `gas_burnt` multiplied by the gas price, because
    /// the prepaid gas price might be lower than the actual gas price and it creates a deficit.
    #[serde(with = "u128_dec_format")]
    pub tokens_burnt: Balance,
    /// The id of the account on which the execution happens. For transaction this is signer_id,
    /// for receipt this is receiver_id.
    pub executor_id: AccountId,
    /// Execution status. Contains the result in case of successful execution.
    pub status: ExecutionStatusView,
    /// Execution metadata, versioned
    #[serde(default)]
    pub metadata: ExecutionMetadataView,
}
```

  </TabItem>
  <TabItem value="typescript" label="TypeScript">

  [ExecutionOutcomeWithIdView TypeScript](#executionoutcomewithidview) defines this structure already an nested

  </TabItem>
</Tabs>


## `ExecutionStatusView`

<Tabs>
  <TabItem value="rust" label="Rust">

```rust links=1
pub enum ExecutionStatusView {
    /// The execution is pending or unknown.
    Unknown,
    /// The execution has failed.
    Failure(TxExecutionError),
    /// The final action succeeded and returned some value or an empty vec encoded in base64.
    SuccessValue(String),
    /// The final action of the receipt returned a promise or the signed transaction was converted
    /// to a receipt. Contains the receipt_id of the generated receipt.
    SuccessReceiptId(CryptoHash),
}
```

  </TabItem>
  <TabItem value="typescript" label="TypeScript">

```ts links=1
export type ExecutionStatus =
  | { Unknown: unknown }
  | { Failure: unknown }
  | { SuccessValue: string }
  | { SuccessReceiptId: string };
```

  </TabItem>
</Tabs>