Class: TransferRestrictions
api/entities/Asset/Fungible/TransferRestrictions.TransferRestrictions
Handles all Transfer Restriction related functionality.
Hierarchy
-
Namespace
<FungibleAsset
>↳
TransferRestrictions
Methods
addExemptions
▸ addExemptions(args
, opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Exempt identities from Transfer Restrictions. These identities will not be subject to Transfer Restriction rules.
Parameters
Name | Type |
---|---|
args | TransferRestrictionExemptionParams |
opts? | ProcedureOpts |
Returns
Promise
<GenericPolymeshTransaction
<void
, void
>>
Note
this method is of type ProcedureMethod, which means you can call addExemptions.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
Defined in
api/entities/Asset/Fungible/TransferRestrictions/index.ts:446
getExemptions
▸ getExemptions(): Promise
<TransferRestrictionExemption
[]>
Return identities with exemptions.
Returns
Promise
<TransferRestrictionExemption
[]>
Defined in
api/entities/Asset/Fungible/TransferRestrictions/index.ts:376
getRestrictions
▸ getRestrictions(): Promise
<ActiveTransferRestrictions
>
Get all current restrictions for this asset.
Returns
Promise
<ActiveTransferRestrictions
>
Defined in
api/entities/Asset/Fungible/TransferRestrictions/index.ts:129
getStats
▸ getStats(): Promise
<AssetStat
[]>
Return active asset stats.
Returns
Promise
<AssetStat
[]>
Defined in
api/entities/Asset/Fungible/TransferRestrictions/index.ts:149
getValues
▸ getValues(): Promise
<TransferRestrictionStatValues
[]>
Get the values of all active transfer restrictions for this Asset.
Returns
Promise
<TransferRestrictionStatValues
[]>
an array of objects containing the values of all active transfer restrictions for this Asset.
Defined in
api/entities/Asset/Fungible/TransferRestrictions/index.ts:172
removeExemptions
▸ removeExemptions(args
, opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Remove identities from Transfer Restriction exemptions.
The given identities will no longer be exempt from Transfer Restrictions.
Parameters
Name | Type |
---|---|
args | TransferRestrictionExemptionParams |
opts? | ProcedureOpts |
Returns
Promise
<GenericPolymeshTransaction
<void
, void
>>
Note
this method is of type ProcedureMethod, which means you can call removeExemptions.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
Defined in
api/entities/Asset/Fungible/TransferRestrictions/index.ts:458
setRestrictions
▸ setRestrictions(args
, opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Set all Transfer Restrictions on this Asset.
Transfer Restrictions control ownership requirements based on investor statistics. For example, TransferRestrictionType.Count can limit the number of investors. TransferRestrictionType.Percentage can limit the maximum percentage an individual investor may hold.
Parameters
Name | Type |
---|---|
args | TransferRestrictionParams |
opts? | ProcedureOpts |
Returns
Promise
<GenericPolymeshTransaction
<void
, void
>>
Note
The relevant stat must be enabled by including it in setStats before the restriction can be created.
Note
this method is of type ProcedureMethod, which means you can call setRestrictions.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
Defined in
api/entities/Asset/Fungible/TransferRestrictions/index.ts:416
setStats
▸ setStats(args
, opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Set the enabled statistics for an Asset.
Transfer Restrictions require the relevant stat to be enabled before they can be set. Calling this method will override the currently enabled stats with the provided set, which means it can also be used to remove previously enabled stats.
Parameters
Name | Type |
---|---|
args | SetTransferRestrictionStatParams |
opts? | ProcedureOpts |
Returns
Promise
<GenericPolymeshTransaction
<void
, void
>>
Note
If you attempt to remove a stat that is currently required by an active transfer restriction, the chain will throw an error.
Note
Count-based stats must be given an initial value. The counter is only updated automatically with each transfer of tokens after the stat has been enabled. As such, the initial value for the stat should be passed in, which can be fetched with FungibleAsset.investorCount.
Note
this method is of type ProcedureMethod, which means you can call setStats.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
Defined in
api/entities/Asset/Fungible/TransferRestrictions/index.ts:436