Composes a Safe transaction on the MPC ring and answers its EIP-712 hash…
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
| 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 | — | ChainID is the EVM chain the Safe transaction is bound to. |
data | body | string | — | Data is the call data, hex-encoded. |
nonce | body | integer | — | 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 | safeProposal | ok |
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.
Examples
hanzo wallets transactions <id>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>" });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>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.WalletAPI.PostWalletByIdTransactions(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::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?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.WalletApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new WalletApi(client).postWalletByIdTransactions();The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
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>"
}'The door reaches wallet through the wallets tool, which names its 7 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
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"
}
}
}'How is this guide?