# Create transactions

URL: https://docs.hanzo.ai/docs/openapi/wallet/post-wallet-by-id-transactions

> Composes a Safe transaction on the MPC ring and answers its EIP-712 hash together with the owner approval the ring's threshold signature produced.

`POST /v1/wallet/{id}/transactions`

> [Wallet →](https://docs.hanzo.ai/docs/openapi/wallet) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                                    |
| ------------- | -------------------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/wallet/{id}/transactions` |
| **Method**    | `POST`                                             |
| **Operation** | `post_wallet_by_id_transactions`                   |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`             |

Composes a Safe transaction on the MPC ring and answers its
EIP-712 hash together with the owner approval the ring's threshold signature
produced. Only a wallet whose custody is "safe" can do this — any other custody
is a 400, because the backend itself is asked whether it can propose rather
than the kind being switched on. The ring computes the Safe-tx hash bound to
the Safe contract and the chain id, so the hash a caller gets back is the one
the Safe will verify. This PROPOSES: it does not execute the transaction.

## Request

6 fields, body `application/json` (required).

| Field     | In   | Type            | Required | Description                                                           |
| --------- | ---- | --------------- | -------- | --------------------------------------------------------------------- |
| `id`      | path | string          | yes      |                                                                       |
| `chainId` | body | integer (int64) | —        | ChainID is the EVM chain the Safe transaction is bound to.            |
| `data`    | body | string          | —        | Data is the call data, hex-encoded.                                   |
| `nonce`   | body | integer (int64) | —        | Nonce is the Safe's transaction nonce.                                |
| `to`      | body | string          | —        | To is the transaction's target address.                               |
| `value`   | body | string          | —        | Value is the native-token amount to send, as a decimal string in wei. |

## Response

| Status    | Body                | Meaning |
| --------- | ------------------- | ------- |
| `200`     | wallet.safeProposal | ok      |
| `default` | problem-details     | refused |

`200` body — 5 fields.

| Field         | In   | Type   | Always | Description                                                                                                                        |
| ------------- | ---- | ------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------- |
| `r`           | body | string | —      | R is the r component of the MPC threshold signature over the Safe-tx hash.                                                         |
| `s`           | body | string | —      | S is the s component of that signature.                                                                                            |
| `safeAddress` | body | string | —      | SafeAddress is the Safe contract this transaction is for.                                                                          |
| `safeTxHash`  | body | string | —      | SafeTxHash is the EIP-712 Safe transaction hash, bound to the Safe contract and the chain id — the value the owner approval signs. |
| `walletId`    | body | string | —      | WalletID is the wallet whose Safe this is.                                                                                         |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo wallet transactions <id>
```

**SDK**

**.ts**

```ts
import { Configuration, WalletApi } from 'hanzoai';

const api = new WalletApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postWalletByIdTransactions({ id: 'id', chainId: 0, data: "<data>" });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import WalletApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = WalletApi(client).post_wallet_by_id_transactions(id='id', chain_id=0, data="<data>")
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.WalletAPI.PostWalletByIdTransactions(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, wallet_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = wallet_api::post_wallet_by_id_transactions(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.WalletApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new WalletApi(client).postWalletByIdTransactions();
```

**HTTP**

```bash
curl -X POST https://api.hanzo.ai/v1/wallet/<id>/transactions \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "chainId": 0,
       "data": "<data>"
     }'
```

**MCP**

MCP reaches **wallet** through the `wallet` tool, which names its 7 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_wallets"
         }
       }
     }'
```

---

[Wallet API](https://docs.hanzo.ai/docs/openapi/wallet) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
