-
Notifications
You must be signed in to change notification settings - Fork 11
api.entities.Asset.Fungible.TransferRestrictions.Count.Count
api/entities/Asset/Fungible/TransferRestrictions/Count.Count
Handles all Count Transfer Restriction related functionality
-
TransferRestrictionBase
<Count
>↳
Count
• addRestriction: ProcedureMethod
<Omit
<AddCountTransferRestrictionParams
, "type"
>, BigNumber
, BigNumber
>
Add a Count Transfer Restriction to this Asset. This limits to total number of individual investors that may hold the Asset. In some jurisdictions once a threshold of investors is passed, different regulations may apply. Count Transfer Restriction can ensure such limits are not exceeded
Throws
if a count statistic is not enabled for the Asset. Count.enableStat should be called before this method
TransferRestrictionBase.addRestriction
api/entities/Asset/Fungible/TransferRestrictions/Count.ts:39
• disableStat: NoArgsProcedureMethod
<void
, void
>
Disables the investor count statistic for the Asset. Since statistics introduce slight overhead to each transaction involving the Asset, disabling unused stats will reduce gas fees for investors when they transact with the Asset
Throws
if the stat is being used by a restriction or is not set
TransferRestrictionBase.disableStat
api/entities/Asset/Fungible/TransferRestrictions/Count.ts:83
• enableStat: ProcedureMethod
<Pick
<AddCountStatParams
, "count"
>, void
, void
>
Enables an investor count statistic for the Asset, which is required before creating restrictions
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 Count.investorCount
Note
Currently there is a potential race condition if passing in counts values when the Asset is being traded. It is recommended to call this method during the initial configuration of the Asset, before people are trading it. Otherwise the Asset should be frozen, or the stat checked after being set to ensure the correct value is used. Future versions of the chain may expose a new extrinsic to avoid this issue
TransferRestrictionBase.enableStat
api/entities/Asset/Fungible/TransferRestrictions/Count.ts:75
• get: () => Promise
<ActiveTransferRestrictions
<CountTransferRestriction
>>
▸ (): Promise
<ActiveTransferRestrictions
<CountTransferRestriction
>>
/**
- Retrieve all active Count Transfer Restrictions
Promise
<ActiveTransferRestrictions
<CountTransferRestriction
>>
Note
there is a maximum number of restrictions allowed across all types.
- The
availableSlots
property of the result represents how many more restrictions can be added - before reaching that limit
api/entities/Asset/Fungible/TransferRestrictions/Count.ts:94
• getStat: () => Promise
<ActiveStats
>
▸ (): Promise
<ActiveStats
>
Retrieve current Count Transfer Restriction investor balance statistic for the Asset
Promise
<ActiveStats
>
TransferRestrictionBase.getStat
api/entities/Asset/Fungible/TransferRestrictions/Count.ts:109
• investorCount: () => Promise
<BigNumber
>
▸ (): Promise
<BigNumber
>
Returns the count of individual holders of the Asset
Promise
<BigNumber
>
Note
This value can be used to initialize enableStat
. If used for this purpose there is a potential race condition
if Asset transfers happen between the time of check and time of use. Either pause Asset transfers, or check after stat
creation and try again if a race occurred. Future versions of the chain should introduce an extrinsic to avoid this issue
api/entities/Asset/Fungible/TransferRestrictions/Count.ts:103
• removeRestrictions: NoArgsProcedureMethod
<BigNumber
, BigNumber
>
Removes all Count Transfer Restrictions from this Asset
Note
the result is the total amount of restrictions after the procedure has run
TransferRestrictionBase.removeRestrictions
api/entities/Asset/Fungible/TransferRestrictions/Count.ts:62
• setRestrictions: ProcedureMethod
<Omit
<SetCountTransferRestrictionsParams
, "type"
>, BigNumber
, BigNumber
>
Sets all Count Transfer Restrictions on this Asset
Note
this method sets exempted Identities for restrictions as well. If an Identity is currently exempted from a Count Transfer Restriction but not passed into this call then it will be removed
Note
the result is the total amount of restrictions after the procedure has run
TransferRestrictionBase.setRestrictions
api/entities/Asset/Fungible/TransferRestrictions/Count.ts:52
Entities
- Account
- Asset
- Authorization Request
- Checkpoint
- Checkpoint Schedule
- Corporate Action
- Corporate Action Base
- Custom Permission Group
- Default Portfolio
- Default Trusted Claim Issuer
- Dividend Distribution
- Entity
- Identity
- Instruction
- Known Permission Group
- Metadata Entry
- Multi Sig Proposal
- Numbered Portfolio
- Offering
- Permission Group
- Portfolio
- Subsidies
- Subsidy
- Ticker Reservation
- Venue
- Authorizations
- Types