Class: Subsidy
api/entities/Subsidy.Subsidy
Represents a Subsidy relationship on chain
Hierarchy
-
Entity
<UniqueIdentifiers
,HumanReadable
>↳
Subsidy
Properties
beneficiary
• beneficiary: Account
Account whose transactions are being paid for
Defined in
api/entities/Subsidy/index.ts:54
subsidizer
• subsidizer: Account
Account that is paying for the transactions
Defined in
api/entities/Subsidy/index.ts:58
uuid
• uuid: string
Inherited from
Defined in
Methods
decreaseAllowance
▸ decreaseAllowance(args
, opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Decrease allowance for this Subsidy relationship
Parameters
Name | Type |
---|---|
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
Defined in
api/entities/Subsidy/index.ts:179
exists
▸ exists(): Promise
<boolean
>
Determine whether this Subsidy relationship exists on chain
Returns
Promise
<boolean
>
Overrides
Defined in
api/entities/Subsidy/index.ts:186
getAllowance
▸ getAllowance(): Promise
<BigNumber
>
Get amount of POLYX subsidized for this Subsidy relationship
Returns
Promise
<BigNumber
>
Throws
if the Subsidy does not exist
Defined in
api/entities/Subsidy/index.ts:205
increaseAllowance
▸ increaseAllowance(args
, opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Increase allowance for this Subsidy relationship
Parameters
Name | Type |
---|---|
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
Defined in
api/entities/Subsidy/index.ts:165
isEqual
▸ isEqual(entity
): boolean
Determine whether this Entity is the same as another one
Parameters
Name | Type |
---|---|
entity | Entity <unknown , unknown > |
Returns
boolean
Inherited from
Defined in
quit
▸ quit(opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Terminate this Subsidy relationship. The beneficiary Account will be forced to pay for their own transactions
Parameters
Name | Type |
---|---|
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
Defined in
api/entities/Subsidy/index.ts:139
setAllowance
▸ setAllowance(args
, opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Set allowance for this Subsidy relationship
Parameters
Name | Type |
---|---|
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
Defined in
api/entities/Subsidy/index.ts:153
toHuman
▸ toHuman(): UniqueIdentifiers
Return the Subsidy's static data
Returns
Overrides
Defined in
api/entities/Subsidy/index.ts:227
generateUuid
▸ Static
generateUuid<Identifiers
>(identifiers
): string
Generate the Entity's UUID from its identifying properties
Type parameters
Name |
---|
Identifiers |
Parameters
Name | Type |
---|---|
identifiers | Identifiers |
Returns
string
Inherited from
Defined in
unserialize
▸ Static
unserialize<Identifiers
>(serialized
): Identifiers
Unserialize a UUID into its Unique Identifiers
Type parameters
Name |
---|
Identifiers |
Parameters
Name | Type | Description |
---|---|---|
serialized | string | UUID to unserialize |
Returns
Identifiers