# wrappers/MetaTransactionWallet

## Index

### Classes

* [MetaTransactionWalletWrapper](https://josh-8.gitbook.io/celo-docs/developer-guide/summary/external-modules/broken-reference)

### Interfaces

* [RawTransaction](https://josh-8.gitbook.io/celo-docs/developer-guide/summary/external-modules/broken-reference)
* [TransactionObjectWithValue](https://josh-8.gitbook.io/celo-docs/developer-guide/summary/external-modules/broken-reference)

### Type aliases

* [TransactionInput](#transactioninput)

### Functions

* [buildMetaTxTypedData](#const-buildmetatxtypeddata)
* [toRawTransaction](#const-torawtransaction)
* [toTransactionBatch](#const-totransactionbatch)

## Type aliases

### TransactionInput

Ƭ **TransactionInput**: *TransactionObject‹T› |* [*TransactionObjectWithValue*](https://josh-8.gitbook.io/celo-docs/developer-guide/summary/external-modules/broken-reference)*‹T› |* [*RawTransaction*](https://josh-8.gitbook.io/celo-docs/developer-guide/summary/external-modules/broken-reference)

*Defined in* [*packages/contractkit/src/wrappers/MetaTransactionWallet.ts:30*](https://github.com/celo-org/celo-monorepo/blob/master/packages/contractkit/src/wrappers/MetaTransactionWallet.ts#L30)

## Functions

### `Const` buildMetaTxTypedData

▸ **buildMetaTxTypedData**(`walletAddress`: [Address](https://josh-8.gitbook.io/celo-docs/developer-guide/summary/_base_#address), `tx`: [RawTransaction](https://josh-8.gitbook.io/celo-docs/developer-guide/summary/external-modules/broken-reference), `nonce`: number, `chainId`: number): *EIP712TypedData*

*Defined in* [*packages/contractkit/src/wrappers/MetaTransactionWallet.ts:265*](https://github.com/celo-org/celo-monorepo/blob/master/packages/contractkit/src/wrappers/MetaTransactionWallet.ts#L265)

**Parameters:**

| Name            | Type                                                                                                            |
| --------------- | --------------------------------------------------------------------------------------------------------------- |
| `walletAddress` | [Address](https://josh-8.gitbook.io/celo-docs/developer-guide/summary/_base_#address)                           |
| `tx`            | [RawTransaction](https://josh-8.gitbook.io/celo-docs/developer-guide/summary/external-modules/broken-reference) |
| `nonce`         | number                                                                                                          |
| `chainId`       | number                                                                                                          |

**Returns:** *EIP712TypedData*

### `Const` toRawTransaction

▸ **toRawTransaction**(`tx`: [TransactionInput](#transactioninput)‹any›): [*RawTransaction*](https://josh-8.gitbook.io/celo-docs/developer-guide/summary/external-modules/broken-reference)

*Defined in* [*packages/contractkit/src/wrappers/MetaTransactionWallet.ts:220*](https://github.com/celo-org/celo-monorepo/blob/master/packages/contractkit/src/wrappers/MetaTransactionWallet.ts#L220)

Turns any possible way to pass in a transaction into the raw values that are actually required. This is used both internally to normalize ways in which transactions are passed in but also public in order for one instance of ContractKit to serialize a meta transaction to send over the wire and be consumed somewhere else.

**Parameters:**

| Name | Type                                       | Description                                                   |
| ---- | ------------------------------------------ | ------------------------------------------------------------- |
| `tx` | [TransactionInput](#transactioninput)‹any› | TransactionInput union of all the ways we expect transactions |

**Returns:** [*RawTransaction*](https://josh-8.gitbook.io/celo-docs/developer-guide/summary/external-modules/broken-reference)

a RawTransactions that's serializable

### `Const` toTransactionBatch

▸ **toTransactionBatch**(`txs`: Array‹[TransactionInput](#transactioninput)‹any››): *object*

*Defined in* [*packages/contractkit/src/wrappers/MetaTransactionWallet.ts:248*](https://github.com/celo-org/celo-monorepo/blob/master/packages/contractkit/src/wrappers/MetaTransactionWallet.ts#L248)

Turns an array of transaction inputs into the argument that need to be passed to the executeTransactions call. Main transformation is that all the `data` parts of each transaction in the batch are concatenated and an array of lengths is constructed. This is a gas optimisation on the contract.

**Parameters:**

| Name  | Type                                              | Description         |
| ----- | ------------------------------------------------- | ------------------- |
| `txs` | Array‹[TransactionInput](#transactioninput)‹any›› | Array> array of txs |

**Returns:** *object*

Params for the executeTransactions method call

* **callData**: *string*
* **callDataLengths**: *number\[]*
* **destinations**: *string\[]*
* **values**: *string\[]*
