> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brickken.com/llms.txt
> Use this file to discover all available pages before exploring further.

# tx

> API-key or x402 prepare, sign, send, and status flows for Brickken Dapp and Agentic API methods.

`brickken tx` exposes the raw [API transaction flow](https://docs.brickken.com/api-reference/introduction.md#api-flow) for Dapp and Agentic API methods. Use it when you want full control over the payload, need to call a specific backend method directly, or want to inspect the unsigned transaction before broadcasting. Dapp API methods use the configured API key; client-controlled Agentic and RAMS methods use the key when configured and otherwise use x402.

| Subcommand | Purpose |
| - | - |
| `brickken tx prepare` | Prepare a raw transaction payload (optionally `--execute`) |
| `brickken tx sign` | Sign a prepared transaction locally |
| `brickken tx send` | Send signed transaction payloads |
| `brickken tx status` | Look up a broadcast transaction by hash |

## tx prepare

Prepare a raw transaction for any method. Dapp API methods use the configured API key and consume the method's credits; eligible Agentic and RAMS methods use the key when configured and otherwise use x402. Relayed preparation is free. With `--execute`, the CLI also sends to `/send-transactions`; API-key-authenticated Dapp sends use the key, while x402 sends pay the operation charge. The `--execution-mode brickken-relayed` mode lets Brickken's relayer sign and broadcast (omit `--signer-address`) and always uses x402; the default `client-signed` mode signs locally with the configured private key first.

| Flag | Type | Required | Description |
| - | - | - | - |
| `--method <method>` | string | Yes | Brickken transaction method |
| `--chain <chain>` | string | No | Chain identifier (`8453` Base, `84532` Base Sepolia, `11155111` Ethereum Sepolia) |
| `--execution-mode <mode>` | string | No | `client-signed` (default) or `brickken-relayed` (recommended) |
| `--signer-address <address>` | string | No | Signer wallet address (required for `client-signed`) |
| `-f, --file <path>` | string | No | JSON/YAML input file (merged with CLI flags) |
| `--execute` | flag | No | Send and pay the x402 charge (otherwise prepare-only) |

Supported Dapp transaction methods include `newTokenization`, `newSto`, `newInvest`, `claimTokens`, `closeOffer`, `mintToken`, `whitelist`, `burnToken`, `transferFrom`, `transferTo`, `approve`, and `dividendDistribution`. Agentic token methods include `agentCreateToken`, `agentMintToken`, `agentBurnToken`, `agentTransferToken`, `agentTransferFromToken`, and `agentApproveToken` (and the `agentApprove` alias, normalized to `agentApproveToken`). Agent identity, reputation, and RAMS methods are also accepted. You can also set `executionMode` directly in the `--file` body. See the [Dapp API reference](https://docs.brickken.com/api-reference/introduction.md) and [Agentic Methods with x402](https://docs.brickken.com/api-reference/endpoint/agentic-methods-x402.md) for each method's fields.

One-shot execution from a file:

```bash theme={null}
brickken tx prepare \
  --method agentCreateToken \
  --file token.json \
  --execute \
  --json
```

Prepare-only (inspect before signing):

```bash theme={null}
brickken tx prepare \
  --method agentRegister \
  --file agent-register.json \
  --json | tee prepared.json
```

> [!TIP]
>
> Prefer `--file` for nested JSON, long text, or values assembled by shell scripts. A file avoids the quoting pitfalls of inline JSON. The file's keys use the backend field names (e.g. `chainId`, `signerAddress`, `metadataValue`).

Example Dapp API tokenization file:

```json theme={null}
{
  "chainId": "11155111",
  "tokenizerEmail": "issuer@example.com",
  "signerAddress": "0xYourWhitelistedWallet",
  "name": "Example Asset",
  "tokenSymbol": "EXMPL",
  "tokenType": "RWA_TOKEN",
  "supplyCap": "1000000",
  "url": "https://example.com/token-docs"
}
```

Prepare it with the API key that pays for the Dapp API operation:

```bash theme={null}
export BRICKKEN_API_KEY=...
brickken tx prepare --method newTokenization --file new-tokenization.json --json
```

Example metadata file:

```json theme={null}
{
  "chainId": "84532",
  "executionMode": "brickken-relayed",
  "agentUuid": "00000000-0000-0000-0000-000000000000",
  "metadataKey": "capabilities",
  "metadataValue": "{\"tasks\":[\"research\",\"summarization\"]}",
  "metadataEncoding": "json"
}
```

## tx sign

Sign a prepared transaction locally with the configured private key. This step applies to `client-signed` execution only; in `brickken-relayed` mode Brickken signs the operation, so you skip signing and send the prepared `transactions` directly.

| Flag | Type | Required | Description |
| - | - | - | - |
| `-f, --file <path>` | string | No | File containing the prepared transaction |

```bash theme={null}
brickken tx sign --file prepared.json --json | tee signed.json
```

## tx send

Send signed transactions. `--tx-id` and `--signed-tx` are repeatable for batched sends.

| Flag | Type | Required | Description |
| - | - | - | - |
| `--tx-id <value>` | string | Yes¹ | Prepared transaction ID (repeatable) |
| `--signed-tx <value>` | string | Yes¹ | Signed transaction hex (repeatable) |
| `-f, --file <path>` | string | No | File containing `txId` / `signedTransactions` |

¹ Supply via flags or a `--file`.

```bash theme={null}
brickken tx send \
  --tx-id "$(jq -r '.prepared.txId' prepared.json)" \
  --signed-tx "$(jq -r '.signedTransaction' signed.json)" \
  --json
```

> [!NOTE]
>
> API-key-authenticated Dapp sends use the API key's credits and do not need an x402 payment header. Relayed Agentic/RAMS sends still use x402, and x402 send batches must contain only x402-eligible prepared transactions on the same chain.

## tx status

Look up a broadcast transaction by its on-chain hash. Either `--hash` or `--tx-hash` is required.

| Flag | Type | Required | Description |
| - | - | - | - |
| `--hash <hash>` | string | Yes¹ | Actual blockchain transaction hash |
| `--tx-hash <hash>` | string | Yes¹ | Alias for `--hash` |

¹ Provide one of the two.

```bash theme={null}
brickken tx status --hash 0xBlockchainTxHash --json
```

This maps to [`GET /get-transaction-status`](https://docs.brickken.com/api-reference/endpoint/get-transaction-status).

## Manual three-step flow

When you want full control over each step:

```bash theme={null}
brickken tx prepare --method agentRegister --file agent-register.json --json
brickken tx sign --file prepared.json --json
brickken tx send --tx-id 0xPreparedTxId --signed-tx 0xSignedRawTx --json
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.