> For the complete documentation index, see [llms.txt](https://docs.adena.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.adena.app/integrations/transactions/create-a-multisig-transaction.md).

# 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": ""
    }
  }
}
```
