# Middleware

Handles all Middleware related functionality

## Hierarchy

* **Middleware**

## Index

### Methods

* [getEventByIndexedArgs](#geteventbyindexedargs)
* [getEventsByIndexedArgs](#geteventsbyindexedargs)
* [getTransactionByHash](#gettransactionbyhash)

## Methods

### getEventByIndexedArgs

▸ **getEventByIndexedArgs**(`opts`: object): _Promise‹_[_EventIdentifier_](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v11/docs/interfaces/eventidentifier.md) _| null›_

_Defined in_ [_src/Middleware.ts:34_](https://github.com/PolymathNetwork/polymesh-sdk/blob/da0f7fd7/src/Middleware.ts#L34)

Retrieve a single event by any of its indexed arguments. Can be filtered using parameters

**`note`** uses the middleware

**Parameters:**

▪ **opts**: _object_

| Name         | Type                | Description                                      |
| ------------ | ------------------- | ------------------------------------------------ |
| `eventArg0?` | undefined \| string | event parameter value to filter by in position 0 |
| `eventArg1?` | undefined \| string | event parameter value to filter by in position 1 |
| `eventArg2?` | undefined \| string | event parameter value to filter by in position 2 |
| `eventId`    | EventId             | type of the event to fetch                       |
| `moduleId`   | ModuleId            | type of the module to fetch                      |

**Returns:** _Promise‹_[_EventIdentifier_](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v11/docs/interfaces/eventidentifier.md) _| null›_

***

### getEventsByIndexedArgs

▸ **getEventsByIndexedArgs**(`opts`: object): _Promise‹_[_EventIdentifier_](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v11/docs/interfaces/eventidentifier.md)_\[] | null›_

_Defined in_ [_src/Middleware.ts:73_](https://github.com/PolymathNetwork/polymesh-sdk/blob/da0f7fd7/src/Middleware.ts#L73)

Retrieve a list of events. Can be filtered using parameters

**`note`** uses the middleware

**Parameters:**

▪ **opts**: _object_

| Name         | Type                | Description                                      |
| ------------ | ------------------- | ------------------------------------------------ |
| `eventArg0?` | undefined \| string | event parameter value to filter by in position 0 |
| `eventArg1?` | undefined \| string | event parameter value to filter by in position 1 |
| `eventArg2?` | undefined \| string | event parameter value to filter by in position 2 |
| `eventId`    | EventId             | type of the event to fetch                       |
| `moduleId`   | ModuleId            | type of the module to fetch                      |
| `size?`      | undefined \| number | page size                                        |
| `start?`     | undefined \| number | page offset                                      |

**Returns:** _Promise‹_[_EventIdentifier_](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v11/docs/interfaces/eventidentifier.md)_\[] | null›_

***

### getTransactionByHash

▸ **getTransactionByHash**(`opts`: object): _Promise‹_[_ExtrinsicData_](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v11/docs/interfaces/extrinsicdata.md) _| null›_

_Defined in_ [_src/Middleware.ts:117_](https://github.com/PolymathNetwork/polymesh-sdk/blob/da0f7fd7/src/Middleware.ts#L117)

Retrieve a transaction by hash

**`note`** uses the middleware

**Parameters:**

▪ **opts**: _object_

| Name     | Type   | Description             |
| -------- | ------ | ----------------------- |
| `txHash` | string | hash of the transaction |

**Returns:** _Promise‹_[_ExtrinsicData_](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v11/docs/interfaces/extrinsicdata.md) _| null›_
