@polymeshassociation/polymesh-sdk 15.0.0-beta.4 → 15.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -9
- package/api/entities/Asset/TransferRestrictions/ClaimCount.d.ts +61 -0
- package/api/entities/Asset/TransferRestrictions/ClaimCount.d.ts.map +1 -0
- package/api/entities/Asset/TransferRestrictions/ClaimCount.js +16 -0
- package/api/entities/Asset/TransferRestrictions/ClaimCount.js.map +1 -0
- package/api/entities/Asset/TransferRestrictions/ClaimPercentage.d.ts +52 -0
- package/api/entities/Asset/TransferRestrictions/ClaimPercentage.d.ts.map +1 -0
- package/api/entities/Asset/TransferRestrictions/ClaimPercentage.js +16 -0
- package/api/entities/Asset/TransferRestrictions/ClaimPercentage.js.map +1 -0
- package/api/entities/Asset/TransferRestrictions/Count.d.ts +41 -4
- package/api/entities/Asset/TransferRestrictions/Count.d.ts.map +1 -1
- package/api/entities/Asset/TransferRestrictions/Count.js +6 -2
- package/api/entities/Asset/TransferRestrictions/Count.js.map +1 -1
- package/api/entities/Asset/TransferRestrictions/Percentage.d.ts +17 -2
- package/api/entities/Asset/TransferRestrictions/Percentage.d.ts.map +1 -1
- package/api/entities/Asset/TransferRestrictions/Percentage.js.map +1 -1
- package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.d.ts +15 -1
- package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.d.ts.map +1 -1
- package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.js +39 -4
- package/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.js.map +1 -1
- package/api/entities/Asset/TransferRestrictions/index.d.ts +4 -0
- package/api/entities/Asset/TransferRestrictions/index.d.ts.map +1 -1
- package/api/entities/Asset/TransferRestrictions/index.js +4 -0
- package/api/entities/Asset/TransferRestrictions/index.js.map +1 -1
- package/api/procedures/addAssetStat.d.ts +16 -0
- package/api/procedures/addAssetStat.d.ts.map +1 -0
- package/api/procedures/addAssetStat.js +91 -0
- package/api/procedures/addAssetStat.js.map +1 -0
- package/api/procedures/addTransferRestriction.d.ts +5 -16
- package/api/procedures/addTransferRestriction.d.ts.map +1 -1
- package/api/procedures/addTransferRestriction.js +42 -69
- package/api/procedures/addTransferRestriction.js.map +1 -1
- package/api/procedures/createAsset.d.ts +1 -1
- package/api/procedures/createAsset.d.ts.map +1 -1
- package/api/procedures/createAsset.js +56 -31
- package/api/procedures/createAsset.js.map +1 -1
- package/api/procedures/removeAssetStat.d.ts +16 -0
- package/api/procedures/removeAssetStat.d.ts.map +1 -0
- package/api/procedures/removeAssetStat.js +88 -0
- package/api/procedures/removeAssetStat.js.map +1 -0
- package/api/procedures/setTransferRestrictions.d.ts +1 -8
- package/api/procedures/setTransferRestrictions.d.ts.map +1 -1
- package/api/procedures/setTransferRestrictions.js +52 -62
- package/api/procedures/setTransferRestrictions.js.map +1 -1
- package/api/procedures/types.d.ts +98 -5
- package/api/procedures/types.d.ts.map +1 -1
- package/api/procedures/types.js +25 -1
- package/api/procedures/types.js.map +1 -1
- package/base/Context.js +1 -1
- package/base/Procedure.js +1 -1
- package/generated/utils.js +1 -1
- package/generated/utils.js.map +1 -1
- package/internal.d.ts +5 -2
- package/internal.d.ts.map +1 -1
- package/internal.js +5 -1
- package/internal.js.map +1 -1
- package/npm-package/polymeshassociation-polymesh-sdk-15.0.0-beta.5.tgz +0 -0
- package/package.json +1 -1
- package/types/index.d.ts +114 -3
- package/types/index.d.ts.map +1 -1
- package/types/index.js +10 -3
- package/types/index.js.map +1 -1
- package/types/internal.d.ts +9 -2
- package/types/internal.d.ts.map +1 -1
- package/types/internal.js +2 -0
- package/types/internal.js.map +1 -1
- package/utils/conversion.d.ts +66 -10
- package/utils/conversion.d.ts.map +1 -1
- package/utils/conversion.js +323 -19
- package/utils/conversion.js.map +1 -1
- package/utils/internal.d.ts +35 -5
- package/utils/internal.d.ts.map +1 -1
- package/utils/internal.js +189 -6
- package/utils/internal.js.map +1 -1
- package/npm-package/polymeshassociation-polymesh-sdk-15.0.0-beta.4.tgz +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
# [15.0.0-beta.
|
|
1
|
+
# [15.0.0-beta.5](https://github.com/PolymathNetwork/polymesh-sdk/compare/v15.0.0-beta.4...v15.0.0-beta.5) (2022-08-02)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Features
|
|
5
5
|
|
|
6
|
-
* 🎸
|
|
7
|
-
* 🎸 add pagination for getSecondaryAccounts ([7d37e02](https://github.com/PolymathNetwork/polymesh-sdk/commit/7d37e026511af9481dd6131f0f45fc127327e38a))
|
|
8
|
-
* 🎸 move getSecondaryAccountPermissions into internal tool ([d547463](https://github.com/PolymathNetwork/polymesh-sdk/commit/d5474634564142f99683af8b85dcc28d45173d0e))
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
### BREAKING CHANGES
|
|
12
|
-
|
|
13
|
-
* 🧨 getSecondaryAccounts is now paginated
|
|
6
|
+
* 🎸 Add enableStat to transferRestriction namespace ([#782](https://github.com/PolymathNetwork/polymesh-sdk/issues/782)) ([c862841](https://github.com/PolymathNetwork/polymesh-sdk/commit/c862841b0bec896e3a040085890d7a5cbd365c19))
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { TransferRestrictionBase } from "../../../../internal";
|
|
3
|
+
import { ActiveTransferRestrictions, AddClaimCountStatParams, AddClaimCountTransferRestrictionParams, ClaimCountTransferRestriction, NoArgsProcedureMethod, ProcedureMethod, RemoveScopedCountParams, SetClaimCountTransferRestrictionsParams, TransferRestrictionType } from "../../../../types";
|
|
4
|
+
/**
|
|
5
|
+
* Handles all Claim Count Transfer Restriction related functionality
|
|
6
|
+
*/
|
|
7
|
+
export declare class ClaimCount extends TransferRestrictionBase<TransferRestrictionType.ClaimCount> {
|
|
8
|
+
protected type: TransferRestrictionType.ClaimCount;
|
|
9
|
+
/**
|
|
10
|
+
* Add a ClaimCount Transfer Restriction to this Asset. This limits to total number of individual
|
|
11
|
+
* investors that may hold the Asset scoped by some Claim. This can limit the number of holders that
|
|
12
|
+
* are non accredited, or ensure all holders are of a certain nationality
|
|
13
|
+
*
|
|
14
|
+
* @note the result is the total amount of restrictions after the procedure has run
|
|
15
|
+
*
|
|
16
|
+
* @throws if the appropriate count statistic (matching ClaimType and issuer) is not enabled for the Asset. {@link ClaimCount.enableStat} should be called with appropriate arguments before this method
|
|
17
|
+
*/
|
|
18
|
+
addRestriction: ProcedureMethod<Omit<AddClaimCountTransferRestrictionParams, 'type'>, BigNumber>;
|
|
19
|
+
/**
|
|
20
|
+
* Sets all Claim Count Transfer Restrictions on this Asset
|
|
21
|
+
*
|
|
22
|
+
* @note the result is the total amount of restrictions after the procedure has run
|
|
23
|
+
*/
|
|
24
|
+
setRestrictions: ProcedureMethod<Omit<SetClaimCountTransferRestrictionsParams, 'type'>, BigNumber>;
|
|
25
|
+
/**
|
|
26
|
+
* Removes all Claim Count Transfer Restrictions from this Asset
|
|
27
|
+
*
|
|
28
|
+
* @note the result is the total amount of restrictions after the procedure has run
|
|
29
|
+
*/
|
|
30
|
+
removeRestrictions: NoArgsProcedureMethod<BigNumber>;
|
|
31
|
+
/**
|
|
32
|
+
* Enables an investor count statistic for the Asset to be scoped by a claim, which is required before creating restrictions
|
|
33
|
+
*
|
|
34
|
+
* The counter is only updated automatically with each transfer of tokens after the stat has been enabled.
|
|
35
|
+
* As such the initial values for the stat should be passed in.
|
|
36
|
+
* For `Affiliate` and `Accredited` scoped stats the both the number of investors who have the Claim and who do not have the claim
|
|
37
|
+
* should be given. For `Jurisdiction` scoped stats the amount of holders for each CountryCode need to be given.
|
|
38
|
+
*
|
|
39
|
+
* @note Currently there is a potential race condition if passing in counts values when the Asset is being traded.
|
|
40
|
+
* It is recommended to call this method during the initial configuration of the Asset, before people are trading it.
|
|
41
|
+
* Otherwise the Asset should be frozen, or the stat checked after being set to ensure the correct value is used. Future
|
|
42
|
+
* versions of the chain may expose a new extrinsic to avoid this issue
|
|
43
|
+
*/
|
|
44
|
+
enableStat: ProcedureMethod<Omit<AddClaimCountStatParams, 'type'>, void>;
|
|
45
|
+
/**
|
|
46
|
+
* Disables a claim count statistic for the Asset. Since statistics introduce slight overhead to each transaction
|
|
47
|
+
* involving the Asset, disabling unused stats will reduce gas fees for investors
|
|
48
|
+
*
|
|
49
|
+
* @throws if the stat is being used by a restriction or is not set
|
|
50
|
+
*/
|
|
51
|
+
disableStat: ProcedureMethod<Omit<RemoveScopedCountParams, 'type'>, void>;
|
|
52
|
+
/**
|
|
53
|
+
* Retrieve all active Claim Count Transfer Restrictions
|
|
54
|
+
*
|
|
55
|
+
* @note there is a maximum number of restrictions allowed across all types.
|
|
56
|
+
* The `availableSlots` property of the result represents how many more restrictions can be added
|
|
57
|
+
* before reaching that limit
|
|
58
|
+
*/
|
|
59
|
+
get: () => Promise<ActiveTransferRestrictions<ClaimCountTransferRestriction>>;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=ClaimCount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClaimCount.d.ts","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/ClaimCount.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,uBAAuB,EAAE,6BAAmB;AACrD,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,sCAAsC,EACtC,6BAA6B,EAC7B,qBAAqB,EACrB,eAAe,EACf,uBAAuB,EACvB,uCAAuC,EACvC,uBAAuB,EACxB,0BAAgB;AAEjB;;GAEG;AACH,qBAAa,UAAW,SAAQ,uBAAuB,CAAC,uBAAuB,CAAC,UAAU,CAAC;IACzF,SAAS,CAAC,IAAI,qCAA+C;IAE7D;;;;;;;;OAQG;IACY,cAAc,EAAE,eAAe,CAC5C,IAAI,CAAC,sCAAsC,EAAE,MAAM,CAAC,EACpD,SAAS,CACV,CAAC;IAEF;;;;OAIG;IACY,eAAe,EAAE,eAAe,CAC7C,IAAI,CAAC,uCAAuC,EAAE,MAAM,CAAC,EACrD,SAAS,CACV,CAAC;IAEF;;;;OAIG;IACY,kBAAkB,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAEpE;;;;;;;;;;;;OAYG;IACY,UAAU,EAAE,eAAe,CAAC,IAAI,CAAC,uBAAuB,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;IAExF;;;;;OAKG;IACY,WAAW,EAAE,eAAe,CAAC,IAAI,CAAC,uBAAuB,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;IAEzF;;;;;;OAMG;IACY,GAAG,EAAE,MAAM,OAAO,CAAC,0BAA0B,CAAC,6BAA6B,CAAC,CAAC,CAAC;CAC9F"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClaimCount = void 0;
|
|
4
|
+
const internal_1 = require("../../../../internal");
|
|
5
|
+
const types_1 = require("../../../../types");
|
|
6
|
+
/**
|
|
7
|
+
* Handles all Claim Count Transfer Restriction related functionality
|
|
8
|
+
*/
|
|
9
|
+
class ClaimCount extends internal_1.TransferRestrictionBase {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.type = types_1.TransferRestrictionType.ClaimCount;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.ClaimCount = ClaimCount;
|
|
16
|
+
//# sourceMappingURL=ClaimCount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClaimCount.js","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/ClaimCount.ts"],"names":[],"mappings":";;;AAEA,mDAAqD;AACrD,6CAUiB;AAEjB;;GAEG;AACH,MAAa,UAAW,SAAQ,kCAA2D;IAA3F;;QACY,SAAI,GAAG,+BAAuB,CAAC,UAAmB,CAAC;IAgE/D,CAAC;CAAA;AAjED,gCAiEC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { TransferRestrictionBase } from "../../../../internal";
|
|
3
|
+
import { ActiveTransferRestrictions, AddClaimPercentageStatParams, AddClaimPercentageTransferRestrictionParams, ClaimPercentageTransferRestriction, NoArgsProcedureMethod, ProcedureMethod, RemoveScopedBalanceParams, SetClaimPercentageTransferRestrictionsParams, TransferRestrictionType } from "../../../../types";
|
|
4
|
+
/**
|
|
5
|
+
* Handles all Claim Percentage Transfer Restriction related functionality
|
|
6
|
+
*/
|
|
7
|
+
export declare class ClaimPercentage extends TransferRestrictionBase<TransferRestrictionType.ClaimPercentage> {
|
|
8
|
+
protected type: TransferRestrictionType.ClaimPercentage;
|
|
9
|
+
/**
|
|
10
|
+
* Add a Percentage Transfer Restriction to this Asset. This can be used to limit the total amount of supply
|
|
11
|
+
* investors who share a ClaimType may hold. For example a restriction can be made so Canadian investors must hold
|
|
12
|
+
* at least 50% of the supply.
|
|
13
|
+
*
|
|
14
|
+
* @returns the total amount of restrictions after the procedure has run
|
|
15
|
+
*
|
|
16
|
+
* @throws if the appropriately scoped Balance statistic (by ClaimType and issuer) is not enabled for this Asset. {@link ClaimPercentage.enableStat} with appropriate arguments should be called before this method
|
|
17
|
+
*/
|
|
18
|
+
addRestriction: ProcedureMethod<Omit<AddClaimPercentageTransferRestrictionParams, 'type'>, BigNumber>;
|
|
19
|
+
/**
|
|
20
|
+
* Sets all Claim Percentage Transfer Restrictions on this Asset
|
|
21
|
+
*
|
|
22
|
+
* @note the result is the total amount of restrictions after the procedure has run
|
|
23
|
+
*/
|
|
24
|
+
setRestrictions: ProcedureMethod<Omit<SetClaimPercentageTransferRestrictionsParams, 'type'>, BigNumber>;
|
|
25
|
+
/**
|
|
26
|
+
* Removes all Claim Percentage Transfer Restrictions from this Asset
|
|
27
|
+
*
|
|
28
|
+
* @note the result is the total amount of restrictions after the procedure has run
|
|
29
|
+
*/
|
|
30
|
+
removeRestrictions: NoArgsProcedureMethod<BigNumber>;
|
|
31
|
+
/**
|
|
32
|
+
* Enables investor balance statistic for the Asset, which is required before creating restrictions
|
|
33
|
+
* that limit the total ownership the Asset's supply
|
|
34
|
+
*/
|
|
35
|
+
enableStat: ProcedureMethod<Omit<AddClaimPercentageStatParams, 'type'>, void>;
|
|
36
|
+
/**
|
|
37
|
+
* Disables an investor balance statistic for the Asset. Since statistics introduce slight overhead to each transaction
|
|
38
|
+
* involving the Asset, disabling unused stats will reduce gas fees for investors
|
|
39
|
+
*
|
|
40
|
+
* @throws if the stat is being used by a restriction or is not set
|
|
41
|
+
*/
|
|
42
|
+
disableStat: ProcedureMethod<Omit<RemoveScopedBalanceParams, 'type'>, void>;
|
|
43
|
+
/**
|
|
44
|
+
* Retrieve all active Claim Percentage Transfer Restrictions
|
|
45
|
+
*
|
|
46
|
+
* @note there is a maximum number of restrictions allowed across all types.
|
|
47
|
+
* The `availableSlots` property of the result represents how many more restrictions can be added
|
|
48
|
+
* before reaching that limit
|
|
49
|
+
*/
|
|
50
|
+
get: () => Promise<ActiveTransferRestrictions<ClaimPercentageTransferRestriction>>;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=ClaimPercentage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClaimPercentage.d.ts","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/ClaimPercentage.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,uBAAuB,EAAE,6BAAmB;AACrD,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,EAC5B,2CAA2C,EAC3C,kCAAkC,EAClC,qBAAqB,EACrB,eAAe,EACf,yBAAyB,EACzB,4CAA4C,EAC5C,uBAAuB,EACxB,0BAAgB;AAEjB;;GAEG;AACH,qBAAa,eAAgB,SAAQ,uBAAuB,CAAC,uBAAuB,CAAC,eAAe,CAAC;IACnG,SAAS,CAAC,IAAI,0CAAoD;IAElE;;;;;;;;OAQG;IACY,cAAc,EAAE,eAAe,CAC5C,IAAI,CAAC,2CAA2C,EAAE,MAAM,CAAC,EACzD,SAAS,CACV,CAAC;IAEF;;;;OAIG;IACY,eAAe,EAAE,eAAe,CAC7C,IAAI,CAAC,4CAA4C,EAAE,MAAM,CAAC,EAC1D,SAAS,CACV,CAAC;IAEF;;;;OAIG;IACY,kBAAkB,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAEpE;;;OAGG;IACY,UAAU,EAAE,eAAe,CAAC,IAAI,CAAC,4BAA4B,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;IAE7F;;;;;OAKG;IACY,WAAW,EAAE,eAAe,CAAC,IAAI,CAAC,yBAAyB,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;IAE3F;;;;;;OAMG;IACY,GAAG,EAAE,MAAM,OAAO,CAAC,0BAA0B,CAAC,kCAAkC,CAAC,CAAC,CAAC;CACnG"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClaimPercentage = void 0;
|
|
4
|
+
const internal_1 = require("../../../../internal");
|
|
5
|
+
const types_1 = require("../../../../types");
|
|
6
|
+
/**
|
|
7
|
+
* Handles all Claim Percentage Transfer Restriction related functionality
|
|
8
|
+
*/
|
|
9
|
+
class ClaimPercentage extends internal_1.TransferRestrictionBase {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.type = types_1.TransferRestrictionType.ClaimPercentage;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.ClaimPercentage = ClaimPercentage;
|
|
16
|
+
//# sourceMappingURL=ClaimPercentage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClaimPercentage.js","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/ClaimPercentage.ts"],"names":[],"mappings":";;;AAEA,mDAAqD;AACrD,6CAUiB;AAEjB;;GAEG;AACH,MAAa,eAAgB,SAAQ,kCAAgE;IAArG;;QACY,SAAI,GAAG,+BAAuB,CAAC,eAAwB,CAAC;IAuDpE,CAAC;CAAA;AAxDD,0CAwDC"}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
|
-
import { TransferRestrictionBase } from "../../../../internal";
|
|
3
|
-
import { ActiveTransferRestrictions, AddCountTransferRestrictionParams, CountTransferRestriction, NoArgsProcedureMethod, ProcedureMethod, SetCountTransferRestrictionsParams, TransferRestrictionType } from "../../../../types";
|
|
2
|
+
import { Asset, Context, TransferRestrictionBase } from "../../../../internal";
|
|
3
|
+
import { ActiveTransferRestrictions, AddCountStatParams, AddCountTransferRestrictionParams, CountTransferRestriction, NoArgsProcedureMethod, ProcedureMethod, SetCountTransferRestrictionsParams, TransferRestrictionType } from "../../../../types";
|
|
4
4
|
/**
|
|
5
5
|
* Handles all Count Transfer Restriction related functionality
|
|
6
6
|
*/
|
|
7
7
|
export declare class Count extends TransferRestrictionBase<TransferRestrictionType.Count> {
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
constructor(parent: Asset, context: Context);
|
|
8
12
|
protected type: TransferRestrictionType.Count;
|
|
9
13
|
/**
|
|
10
|
-
* Add a Count Transfer Restriction to this Asset
|
|
14
|
+
* Add a Count Transfer Restriction to this Asset. This limits to total number of individual
|
|
15
|
+
* investors that may hold the Asset. In some jurisdictions once a threshold of investors is
|
|
16
|
+
* passed, different regulations may apply. Count Transfer Restriction can ensure such limits are not exceeded
|
|
11
17
|
*
|
|
12
|
-
* @
|
|
18
|
+
* @returns the total amount of restrictions after the procedure has run
|
|
19
|
+
*
|
|
20
|
+
* @throws if a count statistic is not enabled for the Asset. {@link api/entities/Asset/TransferRestrictions/Count!Count.enableStat | Count.enableStat } should be called before this method
|
|
13
21
|
*/
|
|
14
22
|
addRestriction: ProcedureMethod<Omit<AddCountTransferRestrictionParams, 'type'>, BigNumber>;
|
|
15
23
|
/**
|
|
@@ -24,6 +32,27 @@ export declare class Count extends TransferRestrictionBase<TransferRestrictionTy
|
|
|
24
32
|
* @note the result is the total amount of restrictions after the procedure has run
|
|
25
33
|
*/
|
|
26
34
|
removeRestrictions: NoArgsProcedureMethod<BigNumber>;
|
|
35
|
+
/**
|
|
36
|
+
* Enables an investor count statistic for the Asset, which is required before creating restrictions
|
|
37
|
+
*
|
|
38
|
+
* The counter is only updated automatically with each transfer of tokens after the stat has been enabled.
|
|
39
|
+
* As such the initial value for the stat should be passed in, which can be fetched with {@link api/entities/Asset/TransferRestrictions/Count!Count.investorCount | Count.investorCount }
|
|
40
|
+
*
|
|
41
|
+
* @note Currently there is a potential race condition if passing in counts values when the Asset is being traded.
|
|
42
|
+
* It is recommended to call this method during the initial configuration of the Asset, before people are trading it.
|
|
43
|
+
* Otherwise the Asset should be frozen, or the stat checked after being set to ensure the correct value is used. Future
|
|
44
|
+
* versions of the chain may expose a new extrinsic to avoid this issue
|
|
45
|
+
*/
|
|
46
|
+
enableStat: ProcedureMethod<Pick<AddCountStatParams, 'count'>, void>;
|
|
47
|
+
/**
|
|
48
|
+
* Disables the investor count statistic for the Asset. Since statistics introduce slight overhead to each transaction
|
|
49
|
+
* involving the Asset, disabling unused stats will reduce gas fees for investors when they transact with the Asset
|
|
50
|
+
*
|
|
51
|
+
* @throws if the stat is being used by a restriction or is not set
|
|
52
|
+
*/
|
|
53
|
+
disableStat: NoArgsProcedureMethod<void>;
|
|
54
|
+
/**
|
|
55
|
+
|
|
27
56
|
/**
|
|
28
57
|
* Retrieve all active Count Transfer Restrictions
|
|
29
58
|
*
|
|
@@ -32,5 +61,13 @@ export declare class Count extends TransferRestrictionBase<TransferRestrictionTy
|
|
|
32
61
|
* before reaching that limit
|
|
33
62
|
*/
|
|
34
63
|
get: () => Promise<ActiveTransferRestrictions<CountTransferRestriction>>;
|
|
64
|
+
/**
|
|
65
|
+
* Returns the count of individual holders of the Asset
|
|
66
|
+
*
|
|
67
|
+
* @note This value can be used to initialize `enableStat`. If used for this purpose there is a potential race condition
|
|
68
|
+
* if Asset transfers happen between the time of check and time of use. Either pause Asset transfers, or check after stat
|
|
69
|
+
* creation and try again if a race occurred. Future versions of the chain should introduce an extrinsic to avoid this issue
|
|
70
|
+
*/
|
|
71
|
+
investorCount: () => Promise<BigNumber>;
|
|
35
72
|
}
|
|
36
73
|
//# sourceMappingURL=Count.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Count.d.ts","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/Count.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,uBAAuB,EAAE,6BAAmB;
|
|
1
|
+
{"version":3,"file":"Count.d.ts","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/Count.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,uBAAuB,EAAE,6BAAmB;AACrE,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,iCAAiC,EACjC,wBAAwB,EACxB,qBAAqB,EACrB,eAAe,EACf,kCAAkC,EAClC,uBAAuB,EACxB,0BAAgB;AAEjB;;GAEG;AACH,qBAAa,KAAM,SAAQ,uBAAuB,CAAC,uBAAuB,CAAC,KAAK,CAAC;IAC/E;;OAEG;gBACS,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO;IAK3C,SAAS,CAAC,IAAI,gCAA0C;IAExD;;;;;;;;OAQG;IACY,cAAc,EAAE,eAAe,CAC5C,IAAI,CAAC,iCAAiC,EAAE,MAAM,CAAC,EAC/C,SAAS,CACV,CAAC;IAEF;;;;OAIG;IACY,eAAe,EAAE,eAAe,CAC7C,IAAI,CAAC,kCAAkC,EAAE,MAAM,CAAC,EAChD,SAAS,CACV,CAAC;IAEF;;;;OAIG;IACY,kBAAkB,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAEpE;;;;;;;;;;OAUG;IACY,UAAU,EAAE,eAAe,CAAC,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;IAEpF;;;;;OAKG;IACY,WAAW,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAExD;;;;;;;;OAQG;IACY,GAAG,EAAE,MAAM,OAAO,CAAC,0BAA0B,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAExF;;;;;;OAMG;IACI,aAAa,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,CAAC;CAChD"}
|
|
@@ -7,9 +7,13 @@ const types_1 = require("../../../../types");
|
|
|
7
7
|
* Handles all Count Transfer Restriction related functionality
|
|
8
8
|
*/
|
|
9
9
|
class Count extends internal_1.TransferRestrictionBase {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
constructor(parent, context) {
|
|
14
|
+
super(parent, context);
|
|
12
15
|
this.type = types_1.TransferRestrictionType.Count;
|
|
16
|
+
this.investorCount = parent.investorCount.bind(parent);
|
|
13
17
|
}
|
|
14
18
|
}
|
|
15
19
|
exports.Count = Count;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Count.js","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/Count.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"Count.js","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/Count.ts"],"names":[],"mappings":";;;AAEA,mDAAqE;AACrE,6CASiB;AAEjB;;GAEG;AACH,MAAa,KAAM,SAAQ,kCAAsD;IAC/E;;OAEG;IACH,YAAY,MAAa,EAAE,OAAgB;QACzC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAIf,SAAI,GAAG,+BAAuB,CAAC,KAAc,CAAC;QAHtD,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC;CA2EF;AAlFD,sBAkFC"}
|
|
@@ -7,9 +7,12 @@ import { ActiveTransferRestrictions, AddPercentageTransferRestrictionParams, NoA
|
|
|
7
7
|
export declare class Percentage extends TransferRestrictionBase<TransferRestrictionType.Percentage> {
|
|
8
8
|
protected type: TransferRestrictionType.Percentage;
|
|
9
9
|
/**
|
|
10
|
-
* Add a Percentage Transfer Restriction to this Asset
|
|
10
|
+
* Add a Percentage Transfer Restriction to this Asset. This limits the total percentage of the supply
|
|
11
|
+
* a single investor can acquire without an exemption
|
|
11
12
|
*
|
|
12
|
-
* @
|
|
13
|
+
* @returns the total amount of restrictions after the procedure has run
|
|
14
|
+
*
|
|
15
|
+
* @throws if the Balance statistic is not enabled for this Asset. {@link Percentage.enableStat} should be called before this method
|
|
13
16
|
*/
|
|
14
17
|
addRestriction: ProcedureMethod<Omit<AddPercentageTransferRestrictionParams, 'type'>, BigNumber>;
|
|
15
18
|
/**
|
|
@@ -24,6 +27,18 @@ export declare class Percentage extends TransferRestrictionBase<TransferRestrict
|
|
|
24
27
|
* @note the result is the total amount of restrictions after the procedure has run
|
|
25
28
|
*/
|
|
26
29
|
removeRestrictions: NoArgsProcedureMethod<BigNumber>;
|
|
30
|
+
/**
|
|
31
|
+
* Enables investor balance statistic for the Asset, which is required before creating restrictions
|
|
32
|
+
* that limit the total ownership of the Assets' supply
|
|
33
|
+
*/
|
|
34
|
+
enableStat: NoArgsProcedureMethod<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Disables the investor balance statistic for the Asset. Since statistics introduce slight overhead to each transaction
|
|
37
|
+
* involving the Asset, disabling unused stats will reduce gas fees for investors when they transact with the Asset
|
|
38
|
+
*
|
|
39
|
+
* @throws if the stat is being used by a restriction or is not set
|
|
40
|
+
*/
|
|
41
|
+
disableStat: NoArgsProcedureMethod<void>;
|
|
27
42
|
/**
|
|
28
43
|
* Retrieve all active Percentage Transfer Restrictions
|
|
29
44
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Percentage.d.ts","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/Percentage.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,uBAAuB,EAAE,6BAAmB;AACrD,OAAO,EACL,0BAA0B,EAC1B,sCAAsC,EACtC,qBAAqB,EACrB,6BAA6B,EAC7B,eAAe,EACf,uCAAuC,EACvC,uBAAuB,EACxB,0BAAgB;AAEjB;;GAEG;AACH,qBAAa,UAAW,SAAQ,uBAAuB,CAAC,uBAAuB,CAAC,UAAU,CAAC;IACzF,SAAS,CAAC,IAAI,qCAA+C;IAE7D
|
|
1
|
+
{"version":3,"file":"Percentage.d.ts","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/Percentage.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,uBAAuB,EAAE,6BAAmB;AACrD,OAAO,EACL,0BAA0B,EAC1B,sCAAsC,EACtC,qBAAqB,EACrB,6BAA6B,EAC7B,eAAe,EACf,uCAAuC,EACvC,uBAAuB,EACxB,0BAAgB;AAEjB;;GAEG;AACH,qBAAa,UAAW,SAAQ,uBAAuB,CAAC,uBAAuB,CAAC,UAAU,CAAC;IACzF,SAAS,CAAC,IAAI,qCAA+C;IAE7D;;;;;;;OAOG;IACY,cAAc,EAAE,eAAe,CAC5C,IAAI,CAAC,sCAAsC,EAAE,MAAM,CAAC,EACpD,SAAS,CACV,CAAC;IAEF;;;;OAIG;IACY,eAAe,EAAE,eAAe,CAC7C,IAAI,CAAC,uCAAuC,EAAE,MAAM,CAAC,EACrD,SAAS,CACV,CAAC;IAEF;;;;OAIG;IACY,kBAAkB,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAEpE;;;OAGG;IACY,UAAU,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAEvD;;;;;OAKG;IACY,WAAW,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAExD;;;;;;OAMG;IACY,GAAG,EAAE,MAAM,OAAO,CAAC,0BAA0B,CAAC,6BAA6B,CAAC,CAAC,CAAC;CAC9F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Percentage.js","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/Percentage.ts"],"names":[],"mappings":";;;AAEA,mDAAqD;AACrD,6CAQiB;AAEjB;;GAEG;AACH,MAAa,UAAW,SAAQ,kCAA2D;IAA3F;;QACY,SAAI,GAAG,+BAAuB,CAAC,UAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"Percentage.js","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/Percentage.ts"],"names":[],"mappings":";;;AAEA,mDAAqD;AACrD,6CAQiB;AAEjB;;GAEG;AACH,MAAa,UAAW,SAAQ,kCAA2D;IAA3F;;QACY,SAAI,GAAG,+BAAuB,CAAC,UAAmB,CAAC;IAsD/D,CAAC;CAAA;AAvDD,gCAuDC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
2
|
import { Asset, Context, Namespace } from "../../../../internal";
|
|
3
|
-
import { AddRestrictionParams, GetTransferRestrictionReturnType, NoArgsProcedureMethod, ProcedureMethod, SetRestrictionsParams, TransferRestrictionType } from "../../../../types";
|
|
3
|
+
import { AddRestrictionParams, GetTransferRestrictionReturnType, NoArgsProcedureMethod, ProcedureMethod, RemoveBalanceStatParams, RemoveCountStatParams, RemoveScopedBalanceParams, RemoveScopedCountParams, SetAssetStatParams, SetClaimCountTransferRestrictionsParams, SetClaimPercentageTransferRestrictionsParams, SetCountTransferRestrictionsParams, SetPercentageTransferRestrictionsParams, SetRestrictionsParams, TransferRestrictionType } from "../../../../types";
|
|
4
|
+
export declare type SetTransferRestrictionsParams = {
|
|
5
|
+
ticker: string;
|
|
6
|
+
} & (SetCountTransferRestrictionsParams | SetPercentageTransferRestrictionsParams | SetClaimCountTransferRestrictionsParams | SetClaimPercentageTransferRestrictionsParams);
|
|
7
|
+
export declare type RemoveAssetStatParamsBase<T> = Omit<T extends TransferRestrictionType.Count ? RemoveCountStatParams : T extends TransferRestrictionType.Percentage ? RemoveBalanceStatParams : T extends TransferRestrictionType.ClaimCount ? RemoveScopedCountParams : RemoveScopedBalanceParams, 'type'>;
|
|
4
8
|
/**
|
|
5
9
|
* Base class for managing Transfer Restrictions
|
|
6
10
|
*/
|
|
@@ -28,6 +32,16 @@ export declare abstract class TransferRestrictionBase<T extends TransferRestrict
|
|
|
28
32
|
* @note the result is the total amount of restrictions after the procedure has run
|
|
29
33
|
*/
|
|
30
34
|
removeRestrictions: NoArgsProcedureMethod<BigNumber>;
|
|
35
|
+
/**
|
|
36
|
+
* Enables statistic of the corresponding type for this Asset, which are required for restrictions to be created
|
|
37
|
+
*/
|
|
38
|
+
enableStat: ProcedureMethod<SetAssetStatParams<T>, void>;
|
|
39
|
+
/**
|
|
40
|
+
* Removes an Asset statistic
|
|
41
|
+
*
|
|
42
|
+
* @throws if the statistic is being used or is not set
|
|
43
|
+
*/
|
|
44
|
+
disableStat: ProcedureMethod<RemoveAssetStatParamsBase<T>, void>;
|
|
31
45
|
/**
|
|
32
46
|
* Retrieve all active Transfer Restrictions of the corresponding type
|
|
33
47
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransferRestrictionBase.d.ts","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAIL,KAAK,EACL,OAAO,EACP,SAAS,EAIV,6BAAmB;AACpB,OAAO,
|
|
1
|
+
{"version":3,"file":"TransferRestrictionBase.d.ts","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAIL,KAAK,EACL,OAAO,EACP,SAAS,EAIV,6BAAmB;AACpB,OAAO,EAEL,oBAAoB,EAEpB,gCAAgC,EAChC,qBAAqB,EACrB,eAAe,EAEf,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB,uCAAuC,EACvC,4CAA4C,EAC5C,kCAAkC,EAClC,uCAAuC,EACvC,qBAAqB,EAErB,uBAAuB,EACxB,0BAAgB;AASjB,oBAAY,6BAA6B,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,CAC7D,kCAAkC,GAClC,uCAAuC,GACvC,uCAAuC,GACvC,4CAA4C,CAC/C,CAAC;AAEF,oBAAY,yBAAyB,CAAC,CAAC,IAAI,IAAI,CAC7C,CAAC,SAAS,uBAAuB,CAAC,KAAK,GACnC,qBAAqB,GACrB,CAAC,SAAS,uBAAuB,CAAC,UAAU,GAC5C,uBAAuB,GACvB,CAAC,SAAS,uBAAuB,CAAC,UAAU,GAC5C,uBAAuB,GACvB,yBAAyB,EAC7B,MAAM,CACP,CAAC;AASF;;GAEG;AACH,8BAAsB,uBAAuB,CAC3C,CAAC,SAAS,uBAAuB,CACjC,SAAQ,SAAS,CAAC,KAAK,CAAC;IACxB,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IAE3B;;OAEG;gBACS,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO;IAsF3C;;;;OAIG;IACI,cAAc,EAAE,eAAe,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAE3E;;;;OAIG;IACI,eAAe,EAAE,eAAe,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAE7E;;;;OAIG;IACI,kBAAkB,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAE5D;;OAEG;IACI,UAAU,EAAE,eAAe,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAEhE;;;;OAIG;IACI,WAAW,EAAE,eAAe,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAExE;;;;;;OAMG;IACU,GAAG,IAAI,OAAO,CAAC,gCAAgC,CAAC,CAAC,CAAC,CAAC;CA+EjE"}
|
|
@@ -14,6 +14,12 @@ const internal_1 = require("../../../../internal");
|
|
|
14
14
|
const types_1 = require("../../../../types");
|
|
15
15
|
const conversion_1 = require("../../../../utils/conversion");
|
|
16
16
|
const internal_2 = require("../../../../utils/internal");
|
|
17
|
+
const restrictionTypeToStatType = {
|
|
18
|
+
[types_1.TransferRestrictionType.Count]: types_1.StatType.Count,
|
|
19
|
+
[types_1.TransferRestrictionType.Percentage]: types_1.StatType.Percentage,
|
|
20
|
+
[types_1.TransferRestrictionType.ClaimCount]: types_1.StatType.ScopedCount,
|
|
21
|
+
[types_1.TransferRestrictionType.ClaimPercentage]: types_1.StatType.ScopedPercentage,
|
|
22
|
+
};
|
|
17
23
|
/**
|
|
18
24
|
* Base class for managing Transfer Restrictions
|
|
19
25
|
*/
|
|
@@ -47,6 +53,18 @@ class TransferRestrictionBase extends internal_1.Namespace {
|
|
|
47
53
|
],
|
|
48
54
|
voidArgs: true,
|
|
49
55
|
}, context);
|
|
56
|
+
this.enableStat = (0, internal_2.createProcedureMethod)({
|
|
57
|
+
getProcedureAndArgs: args => [
|
|
58
|
+
internal_1.addAssetStat,
|
|
59
|
+
Object.assign(Object.assign({}, args), { type: restrictionTypeToStatType[this.type], ticker }),
|
|
60
|
+
],
|
|
61
|
+
}, context);
|
|
62
|
+
this.disableStat = (0, internal_2.createProcedureMethod)({
|
|
63
|
+
getProcedureAndArgs: args => [
|
|
64
|
+
internal_1.removeAssetStat,
|
|
65
|
+
Object.assign(Object.assign({}, args), { type: restrictionTypeToStatType[this.type], ticker }),
|
|
66
|
+
],
|
|
67
|
+
}, context);
|
|
50
68
|
}
|
|
51
69
|
/**
|
|
52
70
|
* Retrieve all active Transfer Restrictions of the corresponding type
|
|
@@ -64,24 +82,41 @@ class TransferRestrictionBase extends internal_1.Namespace {
|
|
|
64
82
|
if (type === types_1.TransferRestrictionType.Count) {
|
|
65
83
|
return requirement.isMaxInvestorCount;
|
|
66
84
|
}
|
|
67
|
-
|
|
85
|
+
else if (type === types_1.TransferRestrictionType.Percentage) {
|
|
86
|
+
return requirement.isMaxInvestorOwnership;
|
|
87
|
+
}
|
|
88
|
+
else if (type === types_1.TransferRestrictionType.ClaimCount) {
|
|
89
|
+
return requirement.isClaimCount;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
return requirement.isClaimOwnership;
|
|
93
|
+
}
|
|
68
94
|
});
|
|
69
95
|
const rawExemptedLists = yield Promise.all(filteredRequirements.map(() => statistics.transferConditionExemptEntities.entries({ asset: tickerKey })));
|
|
70
96
|
const restrictions = rawExemptedLists.map((list, index) => {
|
|
71
97
|
const exemptedIds = list.map(([{ args: [, scopeId], },]) => (0, conversion_1.scopeIdToString)(scopeId) // `ScopeId` and `IdentityId` are the same type, so this is fine
|
|
72
98
|
);
|
|
73
|
-
const { value } = (0, conversion_1.transferConditionToTransferRestriction)(filteredRequirements[index]);
|
|
99
|
+
const { value } = (0, conversion_1.transferConditionToTransferRestriction)(filteredRequirements[index], context);
|
|
74
100
|
let restriction;
|
|
75
101
|
if (type === types_1.TransferRestrictionType.Count) {
|
|
76
102
|
restriction = {
|
|
77
103
|
count: value,
|
|
78
104
|
};
|
|
79
105
|
}
|
|
80
|
-
else {
|
|
106
|
+
else if (type === types_1.TransferRestrictionType.Percentage) {
|
|
81
107
|
restriction = {
|
|
82
108
|
percentage: value,
|
|
83
109
|
};
|
|
84
110
|
}
|
|
111
|
+
else {
|
|
112
|
+
const { min, max, claim, issuer } = value;
|
|
113
|
+
restriction = {
|
|
114
|
+
min,
|
|
115
|
+
max,
|
|
116
|
+
claim,
|
|
117
|
+
issuer,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
85
120
|
if (exemptedIds.length) {
|
|
86
121
|
return Object.assign(Object.assign({}, restriction), { exemptedIds });
|
|
87
122
|
}
|
|
@@ -89,7 +124,7 @@ class TransferRestrictionBase extends internal_1.Namespace {
|
|
|
89
124
|
});
|
|
90
125
|
const maxTransferConditions = (0, conversion_1.u32ToBigNumber)(consts.statistics.maxTransferConditionsPerAsset);
|
|
91
126
|
return {
|
|
92
|
-
restrictions
|
|
127
|
+
restrictions,
|
|
93
128
|
availableSlots: maxTransferConditions.minus(restrictions.length),
|
|
94
129
|
};
|
|
95
130
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransferRestrictionBase.js","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,mDAUoB;AACpB,
|
|
1
|
+
{"version":3,"file":"TransferRestrictionBase.js","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/TransferRestrictionBase.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,mDAUoB;AACpB,6CAoBiB;AACjB,6DAK4B;AAC5B,yDAAyD;AAoBzD,MAAM,yBAAyB,GAAG;IAChC,CAAC,+BAAuB,CAAC,KAAK,CAAC,EAAE,gBAAQ,CAAC,KAAK;IAC/C,CAAC,+BAAuB,CAAC,UAAU,CAAC,EAAE,gBAAQ,CAAC,UAAU;IACzD,CAAC,+BAAuB,CAAC,UAAU,CAAC,EAAE,gBAAQ,CAAC,WAAW;IAC1D,CAAC,+BAA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from "../../../../internal";
|
|
2
|
+
import { ClaimCount } from './ClaimCount';
|
|
3
|
+
import { ClaimPercentage } from './ClaimPercentage';
|
|
2
4
|
import { Count } from './Count';
|
|
3
5
|
import { Percentage } from './Percentage';
|
|
4
6
|
/**
|
|
@@ -7,6 +9,8 @@ import { Percentage } from './Percentage';
|
|
|
7
9
|
export declare class TransferRestrictions extends Namespace<Asset> {
|
|
8
10
|
count: Count;
|
|
9
11
|
percentage: Percentage;
|
|
12
|
+
claimCount: ClaimCount;
|
|
13
|
+
claimPercentage: ClaimPercentage;
|
|
10
14
|
/**
|
|
11
15
|
* @hidden
|
|
12
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,6BAAmB;AAEvD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,SAAS,CAAC,KAAK,CAAC;IACjD,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,EAAE,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,6BAAmB;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,SAAS,CAAC,KAAK,CAAC;IACjD,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB,eAAe,EAAE,eAAe,CAAC;IAExC;;OAEG;gBACS,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO;CAQ5C"}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TransferRestrictions = void 0;
|
|
4
4
|
const internal_1 = require("../../../../internal");
|
|
5
|
+
const ClaimCount_1 = require("./ClaimCount");
|
|
6
|
+
const ClaimPercentage_1 = require("./ClaimPercentage");
|
|
5
7
|
const Count_1 = require("./Count");
|
|
6
8
|
const Percentage_1 = require("./Percentage");
|
|
7
9
|
/**
|
|
@@ -15,6 +17,8 @@ class TransferRestrictions extends internal_1.Namespace {
|
|
|
15
17
|
super(parent, context);
|
|
16
18
|
this.count = new Count_1.Count(parent, context);
|
|
17
19
|
this.percentage = new Percentage_1.Percentage(parent, context);
|
|
20
|
+
this.claimCount = new ClaimCount_1.ClaimCount(parent, context);
|
|
21
|
+
this.claimPercentage = new ClaimPercentage_1.ClaimPercentage(parent, context);
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
24
|
exports.TransferRestrictions = TransferRestrictions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/index.ts"],"names":[],"mappings":";;;AAAA,mDAAuD;AAEvD,mCAAgC;AAChC,6CAA0C;AAE1C;;GAEG;AACH,MAAa,oBAAqB,SAAQ,oBAAgB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/entities/Asset/TransferRestrictions/index.ts"],"names":[],"mappings":";;;AAAA,mDAAuD;AAEvD,6CAA0C;AAC1C,uDAAoD;AACpD,mCAAgC;AAChC,6CAA0C;AAE1C;;GAEG;AACH,MAAa,oBAAqB,SAAQ,oBAAgB;IAMxD;;OAEG;IACH,YAAY,MAAa,EAAE,OAAgB;QACzC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAEvB,IAAI,CAAC,KAAK,GAAG,IAAI,aAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACxC,IAAI,CAAC,UAAU,GAAG,IAAI,uBAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,UAAU,GAAG,IAAI,uBAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,eAAe,GAAG,IAAI,iCAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF;AAjBD,oDAiBC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Procedure } from "../../internal";
|
|
2
|
+
import { AddAssetStatParams } from "../../types";
|
|
3
|
+
import { ProcedureAuthorization } from "../../types/internal";
|
|
4
|
+
/**
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
7
|
+
export declare function prepareAddAssetStat(this: Procedure<AddAssetStatParams, void>, args: AddAssetStatParams): Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export declare function getAuthorization(this: Procedure<AddAssetStatParams, void>, { type, ticker }: AddAssetStatParams): ProcedureAuthorization;
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
export declare const addAssetStat: () => Procedure<AddAssetStatParams, void>;
|
|
16
|
+
//# sourceMappingURL=addAssetStat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addAssetStat.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/addAssetStat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,SAAS,EAAE,uBAAmB;AAC7D,OAAO,EAAE,kBAAkB,EAA+B,oBAAgB;AAC1E,OAAO,EAAE,sBAAsB,EAAoB,6BAAyB;AAY5E;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,SAAS,CAAC,kBAAkB,EAAE,IAAI,CAAC,EACzC,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,IAAI,CAAC,CAgEf;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,SAAS,CAAC,kBAAkB,EAAE,IAAI,CAAC,EACzC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,kBAAkB,GACnC,sBAAsB,CAaxB;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,QAAO,UAAU,kBAAkB,EAAE,IAAI,CACZ,CAAC"}
|