> For the complete documentation index, see [llms.txt](https://developers.polymath.network/classic-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.polymath.network/classic-sdk/beta/external-modules/_entities_polytransaction_.polytransaction.md).

# PolyTransaction

Wrapper class for a Polymath Transaction

## Type parameters

▪ **Args**

▪ **Values**: *any\[]*

## Hierarchy

* [Entity](broken://pages/-M-tw-_WeBJcuS0_s0nR)‹void›

  ↳ **PolyTransaction**

## Index

### Constructors

* [constructor](broken://pages/-M-tw-_Zu-SuwEUJmlzy#constructor)

### Properties

* [args](broken://pages/-M-tw-_Zu-SuwEUJmlzy#args)
* [error](broken://pages/-M-tw-_Zu-SuwEUJmlzy#optional-error)
* [promise](broken://pages/-M-tw-_Zu-SuwEUJmlzy#promise)
* [receipt](broken://pages/-M-tw-_Zu-SuwEUJmlzy#optional-receipt)
* [status](broken://pages/-M-tw-_Zu-SuwEUJmlzy#status)
* [tag](broken://pages/-M-tw-_Zu-SuwEUJmlzy#tag)
* [transactionQueue](broken://pages/-M-tw-_Zu-SuwEUJmlzy#transactionqueue)
* [txHash](broken://pages/-M-tw-_Zu-SuwEUJmlzy#optional-txhash)
* [uid](broken://pages/-M-tw-_Zu-SuwEUJmlzy#uid)

### Methods

* [\_refresh](broken://pages/-M-tw-_Zu-SuwEUJmlzy#_refresh)
* [onStatusChange](broken://pages/-M-tw-_Zu-SuwEUJmlzy#onstatuschange)
* [run](broken://pages/-M-tw-_Zu-SuwEUJmlzy#run)
* [toPojo](broken://pages/-M-tw-_Zu-SuwEUJmlzy#topojo)
* [generateId](broken://pages/-M-tw-_Zu-SuwEUJmlzy#static-generateid)

## Constructors

### constructor

\+ **new PolyTransaction**(`transaction`: [TransactionSpec](broken://pages/-M-tw-d2sxRCDJJsD8Q5)‹Args, Values, TransactionReceiptWithDecodedLogs | string›, `transactionQueue`: [TransactionQueue](broken://pages/-M-tw-_ttRjEt_eA5M8H)‹any, any›): [*PolyTransaction*](broken://pages/-M-tw-_Zu-SuwEUJmlzy)

*Defined in* [*src/entities/PolyTransaction.ts:114*](https://github.com/PolymathNetwork/polymath-sdk/blob/550676f/src/entities/PolyTransaction.ts#L114)

Creates a poly transaction

**Parameters:**

| Name               | Type                                                                                                              |
| ------------------ | ----------------------------------------------------------------------------------------------------------------- |
| `transaction`      | [TransactionSpec](broken://pages/-M-tw-d2sxRCDJJsD8Q5)‹Args, Values, TransactionReceiptWithDecodedLogs \| string› |
| `transactionQueue` | [TransactionQueue](broken://pages/-M-tw-_ttRjEt_eA5M8H)‹any, any›                                                 |

**Returns:** [*PolyTransaction*](broken://pages/-M-tw-_Zu-SuwEUJmlzy)

## Properties

### args

• **args**: *TransactionSpec\["args"]*

*Defined in* [*src/entities/PolyTransaction.ts:89*](https://github.com/PolymathNetwork/polymath-sdk/blob/550676f/src/entities/PolyTransaction.ts#L89)

arguments with which the transaction will be called

### `Optional` error

• **error**? : [*PolymathError*](broken://pages/-M-tw-_TDPVhHNsUafkc)

*Defined in* [*src/entities/PolyTransaction.ts:69*](https://github.com/PolymathNetwork/polymath-sdk/blob/550676f/src/entities/PolyTransaction.ts#L69)

stores errors thrown while running the transaction (if any)

### promise

• **promise**: *Promise‹any›*

*Defined in* [*src/entities/PolyTransaction.ts:64*](https://github.com/PolymathNetwork/polymath-sdk/blob/550676f/src/entities/PolyTransaction.ts#L64)

internal promise that resolves when the transaction has finished running

### `Optional` receipt

• **receipt**? : *TransactionReceiptWithDecodedLogs | string*

*Defined in* [*src/entities/PolyTransaction.ts:74*](https://github.com/PolymathNetwork/polymath-sdk/blob/550676f/src/entities/PolyTransaction.ts#L74)

stores the transaction receipt (if successful)

### status

• **status**: [*TransactionStatus*](broken://pages/-M-tw-b0gvaEI37CNiK2) = TransactionStatus.Idle

*Defined in* [*src/entities/PolyTransaction.ts:54*](https://github.com/PolymathNetwork/polymath-sdk/blob/550676f/src/entities/PolyTransaction.ts#L54)

current status of the transaction

### tag

• **tag**: [*PolyTransactionTag*](broken://pages/-M-tw-avmNLFQXnbxhC_)

*Defined in* [*src/entities/PolyTransaction.ts:79*](https://github.com/PolymathNetwork/polymath-sdk/blob/550676f/src/entities/PolyTransaction.ts#L79)

type of transaction represented by this instance for display purposes

### transactionQueue

• **transactionQueue**: [*TransactionQueue*](broken://pages/-M-tw-_ttRjEt_eA5M8H)

*Defined in* [*src/entities/PolyTransaction.ts:59*](https://github.com/PolymathNetwork/polymath-sdk/blob/550676f/src/entities/PolyTransaction.ts#L59)

transaction queue to which this transaction belongs

### `Optional` txHash

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

*Defined in* [*src/entities/PolyTransaction.ts:84*](https://github.com/PolymathNetwork/polymath-sdk/blob/550676f/src/entities/PolyTransaction.ts#L84)

transaction hash (available after running)

### uid

• **uid**: *string*

*Overrides* [*Entity*](broken://pages/-M-tw-_WeBJcuS0_s0nR)*.*[*uid*](broken://pages/-M-tw-_WeBJcuS0_s0nR#abstract-uid)

*Defined in* [*src/entities/PolyTransaction.ts:49*](https://github.com/PolymathNetwork/polymath-sdk/blob/550676f/src/entities/PolyTransaction.ts#L49)

unique generated identifier of the poly transaction

## Methods

### \_refresh

▸ **\_refresh**(): *void*

*Overrides* [*Entity*](broken://pages/-M-tw-_WeBJcuS0_s0nR)*.*[*\_refresh*](broken://pages/-M-tw-_WeBJcuS0_s0nR#abstract-_refresh)

*Defined in* [*src/entities/PolyTransaction.ts:330*](https://github.com/PolymathNetwork/polymath-sdk/blob/550676f/src/entities/PolyTransaction.ts#L330)

Hydrate the entity

**Returns:** *void*

### onStatusChange

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

*Defined in* [*src/entities/PolyTransaction.ts:203*](https://github.com/PolymathNetwork/polymath-sdk/blob/550676f/src/entities/PolyTransaction.ts#L203)

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:** *(Anonymous function)*

unsubscribe function

### run

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

*Defined in* [*src/entities/PolyTransaction.ts:171*](https://github.com/PolymathNetwork/polymath-sdk/blob/550676f/src/entities/PolyTransaction.ts#L171)

Run the poly transaction and update the transaction status

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

### toPojo

▸ **toPojo**(): *object*

*Overrides* [*Entity*](broken://pages/-M-tw-_WeBJcuS0_s0nR)*.*[*toPojo*](broken://pages/-M-tw-_WeBJcuS0_s0nR#abstract-topojo)

*Defined in* [*src/entities/PolyTransaction.ts:144*](https://github.com/PolymathNetwork/polymath-sdk/blob/550676f/src/entities/PolyTransaction.ts#L144)

Convert entity to a POJO (Plain Old Javascript Object)

**Returns:** *object*

* **args**: *any* = filteredArgs as any
* **error**: *undefined |* [*PolymathError*](broken://pages/-M-tw-_TDPVhHNsUafkc)
* **receipt**: *undefined | string | TransactionReceiptWithDecodedLogs*
* **status**: [*TransactionStatus*](broken://pages/-M-tw-b0gvaEI37CNiK2)
* **tag**: [*PolyTransactionTag*](broken://pages/-M-tw-avmNLFQXnbxhC_)
* **transactionQueueUid**: *string*
* **txHash**: *undefined | string*
* **uid**: *string*

### `Static` generateId

▸ **generateId**(): *string*

*Defined in* [*src/entities/PolyTransaction.ts:40*](https://github.com/PolymathNetwork/polymath-sdk/blob/550676f/src/entities/PolyTransaction.ts#L40)

Generate the Poly Transaction's UUID from its identifying properties

**Returns:** *string*
