<!-- Generated from the function registry (sdk/src/functions) by `cd sdk && npm run gen`. Do not edit. -->

# Transactions

> **Status:** Current (generated)

Prepare (unsigned, for a wallet), estimate, submit signed bytes, and read receipts.

| Function | Kind | Description |
|---|---|---|
| [`tx.transfer`](#txtransfer) | write | Prepare a native MUR transfer for the sender's wallet to sign: an unsigned transaction and a summary |
| [`tx.submit`](#txsubmit) | write | Submit one signed transaction (MXE bytes, hex) |
| [`tx.submit_batch`](#txsubmit_batch) | write | Submit several signed transactions at once (at most 100 through the gateway): a hash or an error for each, in order |
| [`tx.receipt`](#txreceipt) | read | A transaction's receipt (status, compute, fee, output, events), or null if not executed yet |
| [`tx.estimate`](#txestimate) | read | Dry-run a signed transaction against the latest state: status, compute used, fee and refund |
| [`tx.decode`](#txdecode) | read | Decode signed transaction bytes: every field, the payload, the signers and the hash |

## tx.transfer

Prepare a native MUR transfer for the sender's wallet to sign: an unsigned transaction and a summary.

- **Kind:** write: returns an unsigned transaction and a summary; a wallet signs it
- **Runs:** SDK (`@mox/sdk/functions`), MCP and `mox fn`: built from other calls

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `from` | hex32 |  | Sender: the account that will sign (default: the configured account). Its sequence number and the snapshot are read now: 32 bytes, 0x hex |
| `to` | hex32 | yes | Recipient: 32 bytes, 0x hex |
| `amount` | string | yes | MUR as decimal text, e.g. 2.5 |

**Output**

An object: An unsigned prepared transaction.

| Field | Type | Required | Description |
|---|---|---|---|
| `summary` | string |  | What the transaction does, for the person approving it |
| `from` | hex32 |  | Sender: 32 bytes, 0x hex |
| `unsigned` | object |  | The transaction as mox-client describes it (crates/mox-client/src/tx.rs), unsigned: chain_id, seq, snapshot, class, domain, limits, payload, value, fee |
| `request` | object or null |  |  |
| `max_fee` | decimal string |  | The most it can cost at current prices (its declared limits); unused fees are refunded |
| `next` | string |  | How to finish: sign, then tx.submit |

**Example**

```json
{
  "name": "tx.transfer",
  "input": {
    "from": "0x8c1f6a3e5b2d4c7f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f",
    "to": "0x3b7d0f5c9e2a4b6c8d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e",
    "amount": "2.5"
  }
}
```

## tx.submit

Submit one signed transaction (MXE bytes, hex). Returns its hash; the receipt follows once a commit executes it.

- **Kind:** write: acts at once (no wallet signature)
- **Runs:** JSON-RPC `mox_submit` (`POST /`) on the gateway

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `tx` | hex | yes | Signed transaction: 0x hex |

**Output**

An object.

| Field | Type | Required | Description |
|---|---|---|---|
| `hash` | hex |  | Transaction hash: 0x hex |

## tx.submit_batch

Submit several signed transactions at once (at most 100 through the gateway): a hash or an error for each, in order.

- **Kind:** write: acts at once (no wallet signature)
- **Runs:** JSON-RPC `mox_submitBatch` (`POST /`) on the gateway

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `txs` | array of hex | yes |  |

**Output**

An array of objects.

| Field | Type | Required | Description |
|---|---|---|---|
| `hash` | hex |  | Hash: 0x hex |
| `error` | string |  | Why it was refused |

## tx.receipt

A transaction's receipt (status, compute, fee, output, events), or null if not executed yet. With wait_ms, waits for it.

- **Kind:** read
- **Runs:** JSON-RPC `mox_receipt` (`POST /`) on the gateway

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `hash` | hex32 | yes | Transaction hash: 32 bytes, 0x hex |
| `wait_ms` | integer |  | Wait up to this long for it (≤ 10000) |

**Output**

An object (or null): A transaction receipt.

| Field | Type | Required | Description |
|---|---|---|---|
| `tx_hash` | hex |  | Transaction hash: 0x hex |
| `commit` | integer |  | The commit that executed it |
| `status` | integer |  | 0: success; >0: the contract's error code; <0: a system status |
| `status_name` | string |  | Readable status |
| `compute_used` | integer |  | Compute units used |
| `fee` | decimal string |  | Fee charged (MUR base units) |
| `refund` | decimal string |  | Deposit refunded (MUR base units) |
| `output` | hex |  | Raw output (a deploy's is the new contract's address): 0x hex |
| `events` | array of object |  |  |
| `result` | any |  | Any JSON value |
| `error` | string |  | Readable error, for failed contract calls |

**Example**

```json
{
  "name": "tx.receipt",
  "input": {
    "hash": "0x3b7d0f5c9e2a4b6c8d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e",
    "wait_ms": 5000
  }
}
```

## tx.estimate

Dry-run a signed transaction against the latest state: status, compute used, fee and refund. Nothing is kept.

- **Kind:** read
- **Runs:** JSON-RPC `mox_estimate` (`POST /`) on the gateway

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `tx` | hex | yes | Signed transaction: 0x hex |

**Output**

An object.

| Field | Type | Required | Description |
|---|---|---|---|
| `status` | integer |  |  |
| `status_name` | string |  | Status |
| `compute_used` | integer |  | Compute |
| `fee` | decimal string |  | Fee |
| `refund` | decimal string |  | Refund |

## tx.decode

Decode signed transaction bytes: every field, the payload, the signers and the hash. What a confirmation screen shows.

- **Kind:** read
- **Runs:** SDK (`@mox/sdk/functions`), MCP and `mox fn`: built from other calls

**Input**

| Field | Type | Required | Description |
|---|---|---|---|
| `tx` | hex | yes | Signed transaction: 0x hex |

**Output**

object: The transaction as JSON.
