# Subsidy

Represents a Subsidy relationship on chain

## Hierarchy

* [Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/entity)‹UniqueIdentifiers, HumanReadable›

  ↳ **Subsidy**

## Index

### Properties

* [beneficiary](#beneficiary)
* [context](#protected-context)
* [subsidizer](#subsidizer)
* [uuid](#uuid)

### Methods

* [decreaseAllowance](#decreaseallowance)
* [exists](#exists)
* [getAllowance](#getallowance)
* [increaseAllowance](#increaseallowance)
* [isEqual](#isequal)
* [quit](#quit)
* [setAllowance](#setallowance)
* [toHuman](#tohuman)
* [generateUuid](#static-generateuuid)
* [unserialize](#static-unserialize)

## Properties

### beneficiary

• **beneficiary**: [*Account*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/account)

*Defined in* [*src/api/entities/Subsidy/index.ts:51*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Subsidy/index.ts#L51)

Account whose transactions are being paid for

***

### `Protected` context

• **context**: *Context*

*Inherited from* [*CheckpointSchedule*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/checkpointschedule)*.*[*context*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/checkpointschedule#protected-context)

*Defined in* [*src/api/entities/Entity.ts:48*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Entity.ts#L48)

***

### subsidizer

• **subsidizer**: [*Account*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/account)

*Defined in* [*src/api/entities/Subsidy/index.ts:55*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Subsidy/index.ts#L55)

Account that is paying for the transactions

***

### uuid

• **uuid**: *string*

*Inherited from* [*CheckpointSchedule*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/checkpointschedule)*.*[*uuid*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/checkpointschedule#uuid)

*Defined in* [*src/api/entities/Entity.ts:46*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Entity.ts#L46)

## Methods

### decreaseAllowance

▸ **decreaseAllowance**(`args`: Pick‹[DecreaseAllowanceParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/decreaseallowanceparams.md), "allowance"›, `opts?`: [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue)*‹void››*

*Defined in* [*src/api/entities/Subsidy/index.ts:176*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Subsidy/index.ts#L176)

Decrease allowance for this Subsidy relationship

**`note`** Only the subsidizer is allowed to decrease the allowance

**`throws`** if the amount to decrease by is more than the existing allowance

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md), which means you can call [decreaseAllowance.checkAuthorization](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters:**

| Name    | Type                                                                                                                                                    |
| ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `args`  | Pick‹[DecreaseAllowanceParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/decreaseallowanceparams.md), "allowance"› |
| `opts?` | [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)                                        |

**Returns:** *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue)*‹void››*

***

### exists

▸ **exists**(): *Promise‹boolean›*

*Overrides* [*Entity*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/entity)*.*[*exists*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/entity#abstract-exists)

*Defined in* [*src/api/entities/Subsidy/index.ts:183*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Subsidy/index.ts#L183)

Determine whether this Subsidy relationship exists on chain

**Returns:** *Promise‹boolean›*

***

### getAllowance

▸ **getAllowance**(): *Promise‹BigNumber›*

*Defined in* [*src/api/entities/Subsidy/index.ts:202*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Subsidy/index.ts#L202)

Get amount of POLYX subsidized for this Subsidy relationship

**`throws`** if the Subsidy does not exist

**Returns:** *Promise‹BigNumber›*

***

### increaseAllowance

▸ **increaseAllowance**(`args`: Pick‹[IncreaseAllowanceParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/increaseallowanceparams.md), "allowance"›, `opts?`: [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue)*‹void››*

*Defined in* [*src/api/entities/Subsidy/index.ts:162*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Subsidy/index.ts#L162)

Increase allowance for this Subsidy relationship

**`note`** Only the subsidizer is allowed to increase the allowance

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md), which means you can call [increaseAllowance.checkAuthorization](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters:**

| Name    | Type                                                                                                                                                    |
| ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `args`  | Pick‹[IncreaseAllowanceParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/increaseallowanceparams.md), "allowance"› |
| `opts?` | [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)                                        |

**Returns:** *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue)*‹void››*

***

### isEqual

▸ **isEqual**(`entity`: [Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/entity)‹unknown, unknown›): *boolean*

*Inherited from* [*CheckpointSchedule*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/checkpointschedule)*.*[*isEqual*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/checkpointschedule#isequal)

*Defined in* [*src/api/entities/Entity.ts:61*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Entity.ts#L61)

Determine whether this Entity is the same as another one

**Parameters:**

| Name     | Type                                                                                                                |
| -------- | ------------------------------------------------------------------------------------------------------------------- |
| `entity` | [Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/entity)‹unknown, unknown› |

**Returns:** *boolean*

***

### quit

▸ **quit**(`opts?`: [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue)*‹void››*

*Defined in* [*src/api/entities/Subsidy/index.ts:136*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Subsidy/index.ts#L136)

Terminate this Subsidy relationship. The beneficiary Account will be forced to pay for their own transactions

**`note`** both the beneficiary and the subsidizer are allowed to unilaterally quit the Subsidy

**`note`** this method is of type [NoArgsProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/noargsproceduremethod.md), which means you can call [quit.checkAuthorization](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/noargsproceduremethod.md#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters:**

| Name    | Type                                                                                                             |
| ------- | ---------------------------------------------------------------------------------------------------------------- |
| `opts?` | [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md) |

**Returns:** *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue)*‹void››*

***

### setAllowance

▸ **setAllowance**(`args`: Pick‹[SetAllowanceParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/setallowanceparams.md), "allowance"›, `opts?`: [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue)*‹void››*

*Defined in* [*src/api/entities/Subsidy/index.ts:150*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Subsidy/index.ts#L150)

Set allowance for this Subsidy relationship

**`note`** Only the subsidizer is allowed to set the allowance

**`throws`** if the allowance to set is equal to the current allowance

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md), which means you can call [setAllowance.checkAuthorization](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters:**

| Name    | Type                                                                                                                                          |
| ------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `args`  | Pick‹[SetAllowanceParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/setallowanceparams.md), "allowance"› |
| `opts?` | [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)                              |

**Returns:** *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue)*‹void››*

***

### toHuman

▸ **toHuman**(): *HumanReadable*

*Overrides* [*Entity*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/entity)*.*[*toHuman*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/entity#abstract-tohuman)

*Defined in* [*src/api/entities/Subsidy/index.ts:224*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Subsidy/index.ts#L224)

Return the Subsidy's static data

**Returns:** *HumanReadable*

***

### `Static` generateUuid

▸ **generateUuid**‹**Identifiers**›(`identifiers`: Identifiers): *string*

*Inherited from* [*CheckpointSchedule*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/checkpointschedule)*.*[*generateUuid*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/checkpointschedule#static-generateuuid)

*Defined in* [*src/api/entities/Entity.ts:14*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Entity.ts#L14)

Generate the Entity's UUID from its identifying properties

**Type parameters:**

▪ **Identifiers**

**Parameters:**

| Name          | Type        | Description |
| ------------- | ----------- | ----------- |
| `identifiers` | Identifiers |             |

**Returns:** *string*

***

### `Static` unserialize

▸ **unserialize**‹**Identifiers**›(`serialized`: string): *Identifiers*

*Inherited from* [*CheckpointSchedule*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/checkpointschedule)*.*[*unserialize*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/checkpointschedule#static-unserialize)

*Defined in* [*src/api/entities/Entity.ts:23*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Entity.ts#L23)

Unserialize a UUID into its Unique Identifiers

**Type parameters:**

▪ **Identifiers**

**Parameters:**

| Name         | Type   | Description         |
| ------------ | ------ | ------------------- |
| `serialized` | string | UUID to unserialize |

**Returns:** *Identifiers*
