Skip to main content
Version: 29.0.x

Class: Subsidy

Defined in: src/api/entities/Subsidy/index.ts:39

Represents a Subsidy relationship on chain

Extends

Properties

beneficiary

beneficiary: Account

Defined in: src/api/entities/Subsidy/index.ts:53

Account whose transactions are being paid for


subsidizer

subsidizer: Account

Defined in: src/api/entities/Subsidy/index.ts:57

Account that is paying for the transactions


uuid

uuid: string

Defined in: src/api/entities/Entity.ts:46

Inherited from

Entity.uuid

Methods

decreaseAllowance()

decreaseAllowance(args: Pick<DecreaseAllowanceParams, "allowance">, opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/entities/Subsidy/index.ts:160

Decrease allowance for this Subsidy relationship

Parameters

ParameterType

args

Pick<DecreaseAllowanceParams, "allowance">

opts?

ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<void, void>>

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


exists()

exists(): Promise<boolean>

Defined in: src/api/entities/Subsidy/index.ts:165

Determine whether this Subsidy relationship exists on chain

Returns

Promise<boolean>

Overrides

Entity.exists


getAllowance()

getAllowance(): Promise<BigNumber>

Defined in: src/api/entities/Subsidy/index.ts:184

Get amount of POLYX subsidized for this Subsidy relationship

Returns

Promise<BigNumber>

Throws

if the Subsidy does not exist


increaseAllowance()

increaseAllowance(args: Pick<IncreaseAllowanceParams, "allowance">, opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/entities/Subsidy/index.ts:151

Increase allowance for this Subsidy relationship

Parameters

ParameterType

args

Pick<IncreaseAllowanceParams, "allowance">

opts?

ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<void, void>>

Note

Only the subsidizer is allowed to increase the allowance

Note

this method is of type ProcedureMethod, which means you can call increaseAllowance.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it


isEqual()

isEqual(entity: Entity<unknown, unknown>): boolean

Defined in: src/api/entities/Entity.ts:61

Determine whether this Entity is the same as another one

Parameters

ParameterType

entity

Entity<unknown, unknown>

Returns

boolean

Inherited from

Entity.isEqual


quit()

quit(opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/entities/Subsidy/index.ts:135

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

Parameters

ParameterType

opts?

ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<void, void>>

Note

both the beneficiary and the subsidizer are allowed to unilaterally quit the Subsidy

Note

this method is of type NoArgsProcedureMethod, which means you can call quit.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it


setAllowance()

setAllowance(args: Pick<SetAllowanceParams, "allowance">, opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/entities/Subsidy/index.ts:144

Set allowance for this Subsidy relationship

Parameters

ParameterType

args

Pick<SetAllowanceParams, "allowance">

opts?

ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<void, void>>

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


toHuman()

toHuman(): UniqueIdentifiers

Defined in: src/api/entities/Subsidy/index.ts:206

Return the Subsidy's static data

Returns

UniqueIdentifiers

Overrides

Entity.toHuman


generateUuid()

static generateUuid<Identifiers>(identifiers: Identifiers): string

Defined in: src/api/entities/Entity.ts:14

Generate the Entity's UUID from its identifying properties

Type Parameters

Type Parameter

Identifiers

Parameters

ParameterTypeDescription

identifiers

Identifiers

Returns

string

Inherited from

Entity.generateUuid


unserialize()

static unserialize<Identifiers>(serialized: string): Identifiers

Defined in: src/api/entities/Entity.ts:23

Unserialize a UUID into its Unique Identifiers

Type Parameters

Type Parameter

Identifiers

Parameters

ParameterTypeDescription

serialized

string

UUID to unserialize

Returns

Identifiers

Inherited from

Entity.unserialize