# PolymeshTransaction

Wrapper class for a Polymesh Transaction

## Type parameters

▪ **Args**: *unknown\[]*

▪ **Values**: *unknown\[]*

## Hierarchy

* [PolymeshTransactionBase](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/classes/polymeshtransactionbase)‹Args, Values›

  ↳ **PolymeshTransaction**

## Index

### Properties

* [blockHash](#optional-blockhash)
* [context](#protected-context)
* [error](#optional-error)
* [inputArgs](#inputargs)
* [isCritical](#iscritical)
* [receipt](#optional-receipt)
* [status](#status)
* [tag](#tag)
* [txHash](#optional-txhash)

### Accessors

* [args](#args)

### Methods

* [getFees](#getfees)
* [getPayingAccount](#getpayingaccount)
* [onStatusChange](#onstatuschange)
* [run](#run)

## Properties

### `Optional` blockHash

• **blockHash**? : *undefined | string*

*Inherited from* [*PolymeshTransactionBase*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/classes/polymeshtransactionbase)*.*[*blockHash*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/polymeshtransactionbase#optional-blockhash)

*Defined in* [*src/base/PolymeshTransactionBase.ts:50*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/src/base/PolymeshTransactionBase.ts#L50)

hash of the block where this transaction resides (status: `Succeeded`, `Failed`)

***

### `Protected` context

• **context**: [*Context*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/classes/context)

*Inherited from* [*PolymeshTransactionBase*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/classes/polymeshtransactionbase)*.*[*context*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/polymeshtransactionbase#protected-context)

*Defined in* [*src/base/PolymeshTransactionBase.ts:113*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/src/base/PolymeshTransactionBase.ts#L113)

***

### `Optional` error

• **error**? : [*PolymeshError*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/classes/polymesherror)

*Inherited from* [*PolymeshTransactionBase*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/classes/polymeshtransactionbase)*.*[*error*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/polymeshtransactionbase#optional-error)

*Defined in* [*src/base/PolymeshTransactionBase.ts:35*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/src/base/PolymeshTransactionBase.ts#L35)

stores errors thrown while running the transaction (status: `Failed`, `Aborted`)

***

### inputArgs

• **inputArgs**: *MapMaybePostTransactionValue‹Args›*

*Defined in* [*src/base/PolymeshTransaction.ts:26*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/src/base/PolymeshTransaction.ts#L26)

arguments for the transaction. Available after the transaction starts running (may be Post Transaction Values from a previous transaction in the queue that haven't resolved yet)

***

### isCritical

• **isCritical**: *boolean*

*Inherited from* [*PolymeshTransactionBase*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/classes/polymeshtransactionbase)*.*[*isCritical*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/polymeshtransactionbase#iscritical)

*Defined in* [*src/base/PolymeshTransactionBase.ts:55*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/src/base/PolymeshTransactionBase.ts#L55)

whether this transaction failing makes the entire transaction queue fail or not

***

### `Optional` receipt

• **receipt**? : *ISubmittableResult*

*Inherited from* [*PolymeshTransactionBase*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/classes/polymeshtransactionbase)*.*[*receipt*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/polymeshtransactionbase#optional-receipt)

*Defined in* [*src/base/PolymeshTransactionBase.ts:40*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/src/base/PolymeshTransactionBase.ts#L40)

stores the transaction receipt (if successful)

***

### status

• **status**: [*TransactionStatus*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/enums/transactionstatus.md) = TransactionStatus.Idle

*Inherited from* [*PolymeshTransactionBase*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/classes/polymeshtransactionbase)*.*[*status*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/polymeshtransactionbase#status)

*Defined in* [*src/base/PolymeshTransactionBase.ts:30*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/src/base/PolymeshTransactionBase.ts#L30)

current status of the transaction

***

### tag

• **tag**: *TxTag*

*Inherited from* [*PolymeshTransactionBase*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/classes/polymeshtransactionbase)*.*[*tag*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/polymeshtransactionbase#tag)

*Defined in* [*src/base/PolymeshTransactionBase.ts:60*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/src/base/PolymeshTransactionBase.ts#L60)

type of transaction represented by this instance (mostly for display purposes)

***

### `Optional` txHash

• **txHash**? : *undefined | string*

*Inherited from* [*PolymeshTransactionBase*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/classes/polymeshtransactionbase)*.*[*txHash*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/polymeshtransactionbase#optional-txhash)

*Defined in* [*src/base/PolymeshTransactionBase.ts:45*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/src/base/PolymeshTransactionBase.ts#L45)

transaction hash (status: `Running`, `Succeeded`, `Failed`)

## Accessors

### args

• **get args**(): *Args*

*Defined in* [*src/base/PolymeshTransaction.ts:43*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/src/base/PolymeshTransaction.ts#L43)

Arguments for the transaction

**Returns:** *Args*

## Methods

### getFees

▸ **getFees**(): *Promise‹*[*Fees*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/fees.md) *| null›*

*Inherited from* [*PolymeshTransactionBase*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/classes/polymeshtransactionbase)*.*[*getFees*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/polymeshtransactionbase#getfees)

*Defined in* [*src/base/PolymeshTransactionBase.ts:306*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/src/base/PolymeshTransactionBase.ts#L306)

Get all (protocol and gas) fees associated with this transaction. Returns null if the transaction is not ready yet (this can happen if it depends on the execution of a previous transaction in the queue)

**`note`** this value might change if the transaction is run at a later time. This can be due to a governance vote

**Returns:** *Promise‹*[*Fees*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/fees.md) *| null›*

***

### getPayingAccount

▸ **getPayingAccount**(): *Promise‹object | null›*

*Inherited from* [*PolymeshTransactionBase*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/classes/polymeshtransactionbase)*.*[*getPayingAccount*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/polymeshtransactionbase#getpayingaccount)

*Defined in* [*src/base/PolymeshTransactionBase.ts:269*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/src/base/PolymeshTransactionBase.ts#L269)

Retrieve the Account that would pay for the transaction fees if it was run at this moment, as well as the maximum amount that can be charged to it. A null allowance means that there is no limit to that amount

A null return value signifies that the current Account will pay for the fees

**`note`** this value might change if, before running the transaction, the current Account enters (or leaves) a subsidizer relationship

**Returns:** *Promise‹object | null›*

***

### onStatusChange

▸ **onStatusChange**(`listener`: function): *function*

*Inherited from* [*PolymeshTransactionBase*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/classes/polymeshtransactionbase)*.*[*onStatusChange*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/polymeshtransactionbase#onstatuschange)

*Defined in* [*src/base/PolymeshTransactionBase.ts:252*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/src/base/PolymeshTransactionBase.ts#L252)

Subscribe to status changes

**Parameters:**

▪ **listener**: *function*

callback function that will be called whenever the status changes

▸ (`transaction`: this): *void*

**Parameters:**

| Name          | Type |
| ------------- | ---- |
| `transaction` | this |

**Returns:** *function*

unsubscribe function

▸ (): *void*

***

### run

▸ **run**(): *Promise‹void›*

*Inherited from* [*PolymeshTransactionBase*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/classes/polymeshtransactionbase)*.*[*run*](https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/polymeshtransactionbase#run)

*Defined in* [*src/base/PolymeshTransactionBase.ts:139*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/src/base/PolymeshTransactionBase.ts#L139)

Run the transaction and update its status

**Returns:** *Promise‹void›*
