Subsidy

Represents a Subsidy relationship on chain

Hierarchy

  • Entity‹UniqueIdentifiers, HumanReadable›

    ↳ Subsidy

Index

Properties

Methods

Properties

beneficiary

• beneficiary: Account

Defined in src/api/entities/Subsidy/index.ts:51arrow-up-right

Account whose transactions are being paid for


Protected context

• context: Context

Inherited from CheckpointSchedule.context

Defined in src/api/entities/Entity.ts:48arrow-up-right


subsidizer

• subsidizer: Account

Defined in src/api/entities/Subsidy/index.ts:55arrow-up-right

Account that is paying for the transactions


uuid

• uuid: string

Inherited from CheckpointSchedule.uuid

Defined in src/api/entities/Entity.ts:46arrow-up-right

Methods

decreaseAllowance

▸ decreaseAllowance(args: Pick‹DecreaseAllowanceParamsarrow-up-right, "allowance"›, opts?: ProcedureOptsarrow-up-right): Promise‹TransactionQueue‹void››

Defined in src/api/entities/Subsidy/index.ts:176arrow-up-right

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 ProcedureMethodarrow-up-right, which means you can call decreaseAllowance.checkAuthorizationarrow-up-right on it to see whether the signing Account and Identity have the required roles and permissions to run it

Parameters:

Name
Type

Returns: Promise‹TransactionQueue‹void››


exists

▸ exists(): Promise‹boolean›

Overrides Entity.exists

Defined in src/api/entities/Subsidy/index.ts:183arrow-up-right

Determine whether this Subsidy relationship exists on chain

Returns: Promise‹boolean›


getAllowance

▸ getAllowance(): Promise‹BigNumber›

Defined in src/api/entities/Subsidy/index.ts:202arrow-up-right

Get amount of POLYX subsidized for this Subsidy relationship

throws if the Subsidy does not exist

Returns: Promise‹BigNumber›


increaseAllowance

▸ increaseAllowance(args: Pick‹IncreaseAllowanceParamsarrow-up-right, "allowance"›, opts?: ProcedureOptsarrow-up-right): Promise‹TransactionQueue‹void››

Defined in src/api/entities/Subsidy/index.ts:162arrow-up-right

Increase allowance for this Subsidy relationship

note Only the subsidizer is allowed to increase the allowance

note this method is of type ProcedureMethodarrow-up-right, which means you can call increaseAllowance.checkAuthorizationarrow-up-right on it to see whether the signing Account and Identity have the required roles and permissions to run it

Parameters:

Name
Type

Returns: Promise‹TransactionQueue‹void››


isEqual

▸ isEqual(entity: Entity‹unknown, unknown›): boolean

Inherited from CheckpointSchedule.isEqual

Defined in src/api/entities/Entity.ts:61arrow-up-right

Determine whether this Entity is the same as another one

Parameters:

Name
Type

entity

Entity‹unknown, unknown›

Returns: boolean


quit

▸ quit(opts?: ProcedureOptsarrow-up-right): Promise‹TransactionQueue‹void››

Defined in src/api/entities/Subsidy/index.ts:136arrow-up-right

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 NoArgsProcedureMethodarrow-up-right, which means you can call quit.checkAuthorizationarrow-up-right on it to see whether the signing Account and Identity have the required roles and permissions to run it

Parameters:

Returns: Promise‹TransactionQueue‹void››


setAllowance

▸ setAllowance(args: Pick‹SetAllowanceParamsarrow-up-right, "allowance"›, opts?: ProcedureOptsarrow-up-right): Promise‹TransactionQueue‹void››

Defined in src/api/entities/Subsidy/index.ts:150arrow-up-right

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 ProcedureMethodarrow-up-right, which means you can call setAllowance.checkAuthorizationarrow-up-right on it to see whether the signing Account and Identity have the required roles and permissions to run it

Parameters:

Name
Type

args

Pick‹SetAllowanceParamsarrow-up-right, "allowance"›

Returns: Promise‹TransactionQueue‹void››


toHuman

â–¸ toHuman(): HumanReadable

Overrides Entity.toHuman

Defined in src/api/entities/Subsidy/index.ts:224arrow-up-right

Return the Subsidy's static data

Returns: HumanReadable


Static generateUuid

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

Inherited from CheckpointSchedule.generateUuid

Defined in src/api/entities/Entity.ts:14arrow-up-right

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.unserialize

Defined in src/api/entities/Entity.ts:23arrow-up-right

Unserialize a UUID into its Unique Identifiers

Type parameters:

â–ª Identifiers

Parameters:

Name
Type
Description

serialized

string

UUID to unserialize

Returns: Identifiers

Last updated

Was this helpful?