# Create a Multisig Transaction

To create a multisig transaction, you can use either Adena's injection API or Gnokey CLI. Both methods generate an unsigned transaction file (.tx) that is fully compatible with each other, meaning you can create a transaction with Adena and sign it with Gnokey, or vice versa.

### Code

```typescript
adena.CreateMultisigTransaction(
  params: CreateMultisigTransactionParams,
  withSaveFile?: boolean
)
```

### Params

| Key           | Type               | Description                                                                |
| ------------- | ------------------ | -------------------------------------------------------------------------- |
| messages      | ContractMessage\[] | Array of transaction messages                                              |
| fee           | object             | Fee object containing gasFee and gasWanted                                 |
| fee.gasFee    | string             | The gas fee amount with denomination (e.g., "6113ugnot")                   |
| fee.gasWanted | string             | The maximum gas units allowed for the transaction                          |
| memo          | string             | Optional memo text for the transaction (optional)                          |
| withSaveFile  | boolean            | Flag to automatically save the transaction file (optional, default: false) |

#### ContractMessage Model

| Key   | Type   | Description                                         |
| ----- | ------ | --------------------------------------------------- |
| type  | string | Message type (e.g., "/vm.m\_call", "/bank.MsgSend") |
| value | object | Message value object containing transaction details |

### Response

| Key     | Type   | Description                              |
| ------- | ------ | ---------------------------------------- |
| code    | number | Response code (success: 0)               |
| status  | string | Returns "success" or "failure"           |
| type    | string | Response type                            |
| message | string | Descriptive message of the result        |
| data    | object | Create Multisig Transaction Result Model |

#### Create Multisig Transaction Result Model

| Key | Type  | Description                                                                |
| --- | ----- | -------------------------------------------------------------------------- |
| tx  | RawTx | The raw transaction object containing messages, fees, signatures, and memo |

### `/vm.m_call`

### Sample Request

```typescript
await adena.CreateMultisigTransaction({
  messages: [
    {
      type: "/vm.m_call",
      value: {
        caller: "g1ksdqtg675y28vkua8zrghxzlgwtpyxwklp5gpf", // Replace your multisig address
        send: "",
        pkg_path: "gno.land/r/gnoland/wugnot",
        func: "Approve",
        args: ["g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5", "100"],
      },
    },
  ],
  fee: {
    gasFee: "6113ugnot",
    gasWanted: "6112955",
  },
});
```

### Sample Response

```json
{
  "code": 0,
  "status": "success",
  "type": "CREATE_MULTISIG_TRANSACTION_SUCCESS",
  "message": "Multisig transaction has been successfully created.",
  "data": {
    "tx": {
      "msg": [
        {
          "@type": "/vm.m_call",
          "caller": "g1ksdqtg675y28vkua8zrghxzlgwtpyxwklp5gpf",
          "send": "",
          "pkg_path": "gno.land/r/gnoland/wugnot",
          "func": "Approve",
          "args": ["g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5", "100"]
        }
      ],
      "fee": {
        "gas_wanted": "6112955",
        "gas_fee": "6113ugnot"
      },
      "signatures": null,
      "memo": ""
    }
  }
}
```

### `Multi Messages(/bank.MsgSend, /vm.m_call)`

### Sample Request

```typescript
await adena.CreateMultisigTransaction({
  messages: [
    {
      type: "/bank.MsgSend",
      value: {
          from_address: "g1t6ygsc62tf0zhd4wsfzdtkwt6x9zkmumyhjpqj", // Replace your multisig address
          to_address: "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5",   // recipient's address
          amount: "1000ugnot" // sending amount. 1GNOT = 1000000ugnot
      }
    },
    {
      type: "/vm.m_call",
      value: {
        caller: "g1t6ygsc62tf0zhd4wsfzdtkwt6x9zkmumyhjpqj", // Replace your multisig address
        send: "1000ugnot",
        pkg_path: "gno.land/r/gnoland/wugnot",
        func: "Deposit",
        args: null,
      },
    },
    {
      type: "/vm.m_call",
      value: {
        caller: "g1t6ygsc62tf0zhd4wsfzdtkwt6x9zkmumyhjpqj", // Replace your multisig address
        send: "",
        pkg_path: "gno.land/r/gnoland/wugnot",
        func: "Transfer",
        args: ["g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5", "1000"],
      },
    },
  ],
  fee: {
    gasFee: "1000000ugnot",
    gasWanted: "10000000",
  },
});
```

### Sample Response

```json
{
  "code": 0,
  "status": "success",
  "type": "CREATE_MULTISIG_TRANSACTION",
  "message": "Create Multisig Document",
  "data": {
    "tx": {
      "msg": [
        {
          "@type": "/bank.MsgSend",
          "from_address": "g1t6ygsc62tf0zhd4wsfzdtkwt6x9zkmumyhjpqj",
          "to_address": "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5",
          "amount": "1000ugnot"
        },
        {
          "@type": "/vm.m_call",
          "func": "Deposit",
          "pkg_path": "gno.land/r/gnoland/wugnot",
          "args": null,
          "caller": "g1t6ygsc62tf0zhd4wsfzdtkwt6x9zkmumyhjpqj",
          "send": "1000ugnot"
        },
        {
          "@type": "/vm.m_call",
          "func": "Transfer",
          "pkg_path": "gno.land/r/gnoland/wugnot",
          "args": [
            "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5",
            "1000"
          ],
          "caller": "g1t6ygsc62tf0zhd4wsfzdtkwt6x9zkmumyhjpqj",
          "send": ""
        }
      ],
      "fee": {
        "gas_wanted": "10000000",
        "gas_fee": "1000000ugnot"
      },
      "signatures": [],
      "memo": ""
    }
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.adena.app/integrations/transactions/create-a-multisig-transaction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
