@polymeshassociation/polymesh-sdk 27.8.0-beta.2 → 28.0.0-beta.1
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 +8 -3
- package/api/entities/Asset/Fungible/TransferRestrictions/index.d.ts +44 -13
- package/api/entities/Asset/Fungible/TransferRestrictions/index.d.ts.map +1 -1
- package/api/entities/Asset/Fungible/TransferRestrictions/index.js +60 -28
- package/api/entities/Asset/Fungible/TransferRestrictions/index.js.map +1 -1
- package/api/entities/Asset/types.d.ts +36 -1
- package/api/entities/Asset/types.d.ts.map +1 -1
- package/api/entities/Asset/types.js.map +1 -1
- package/api/entities/types.d.ts +4 -7
- package/api/entities/types.d.ts.map +1 -1
- package/api/entities/types.js +6 -1
- package/api/entities/types.js.map +1 -1
- package/api/procedures/setAssetStats.d.ts +22 -0
- package/api/procedures/setAssetStats.d.ts.map +1 -0
- package/api/procedures/setAssetStats.js +87 -0
- package/api/procedures/setAssetStats.js.map +1 -0
- package/api/procedures/setTransferRestrictionExemptions.d.ts +20 -0
- package/api/procedures/setTransferRestrictionExemptions.d.ts.map +1 -0
- package/api/procedures/setTransferRestrictionExemptions.js +102 -0
- package/api/procedures/setTransferRestrictionExemptions.js.map +1 -0
- package/api/procedures/setTransferRestrictions.d.ts +9 -34
- package/api/procedures/setTransferRestrictions.d.ts.map +1 -1
- package/api/procedures/setTransferRestrictions.js +61 -257
- package/api/procedures/setTransferRestrictions.js.map +1 -1
- package/api/procedures/types.d.ts +40 -48
- package/api/procedures/types.d.ts.map +1 -1
- package/api/procedures/types.js.map +1 -1
- package/internal.d.ts +3 -6
- package/internal.d.ts.map +1 -1
- package/internal.js +7 -11
- package/internal.js.map +1 -1
- package/npm-package/polymeshassociation-polymesh-sdk-28.0.0-beta.1.tgz +0 -0
- package/package.json +1 -1
- package/utils/conversion.d.ts +27 -18
- package/utils/conversion.d.ts.map +1 -1
- package/utils/conversion.js +162 -129
- package/utils/conversion.js.map +1 -1
- package/utils/internal.d.ts +1 -14
- package/utils/internal.d.ts.map +1 -1
- package/utils/internal.js +3 -110
- package/utils/internal.js.map +1 -1
- package/api/entities/Asset/Fungible/TransferRestrictions/ClaimCount.d.ts +0 -69
- package/api/entities/Asset/Fungible/TransferRestrictions/ClaimCount.d.ts.map +0 -1
- package/api/entities/Asset/Fungible/TransferRestrictions/ClaimCount.js +0 -16
- package/api/entities/Asset/Fungible/TransferRestrictions/ClaimCount.js.map +0 -1
- package/api/entities/Asset/Fungible/TransferRestrictions/ClaimPercentage.d.ts +0 -60
- package/api/entities/Asset/Fungible/TransferRestrictions/ClaimPercentage.d.ts.map +0 -1
- package/api/entities/Asset/Fungible/TransferRestrictions/ClaimPercentage.js +0 -16
- package/api/entities/Asset/Fungible/TransferRestrictions/ClaimPercentage.js.map +0 -1
- package/api/entities/Asset/Fungible/TransferRestrictions/Count.d.ts +0 -81
- package/api/entities/Asset/Fungible/TransferRestrictions/Count.d.ts.map +0 -1
- package/api/entities/Asset/Fungible/TransferRestrictions/Count.js +0 -20
- package/api/entities/Asset/Fungible/TransferRestrictions/Count.js.map +0 -1
- package/api/entities/Asset/Fungible/TransferRestrictions/Percentage.d.ts +0 -59
- package/api/entities/Asset/Fungible/TransferRestrictions/Percentage.d.ts.map +0 -1
- package/api/entities/Asset/Fungible/TransferRestrictions/Percentage.js +0 -16
- package/api/entities/Asset/Fungible/TransferRestrictions/Percentage.js.map +0 -1
- package/api/entities/Asset/Fungible/TransferRestrictions/TransferRestrictionBase.d.ts +0 -62
- package/api/entities/Asset/Fungible/TransferRestrictions/TransferRestrictionBase.d.ts.map +0 -1
- package/api/entities/Asset/Fungible/TransferRestrictions/TransferRestrictionBase.js +0 -189
- package/api/entities/Asset/Fungible/TransferRestrictions/TransferRestrictionBase.js.map +0 -1
- package/api/procedures/addAssetStat.d.ts +0 -16
- package/api/procedures/addAssetStat.d.ts.map +0 -1
- package/api/procedures/addAssetStat.js +0 -87
- package/api/procedures/addAssetStat.js.map +0 -1
- package/api/procedures/addTransferRestriction.d.ts +0 -23
- package/api/procedures/addTransferRestriction.d.ts.map +0 -1
- package/api/procedures/addTransferRestriction.js +0 -122
- package/api/procedures/addTransferRestriction.js.map +0 -1
- package/api/procedures/removeAssetStat.d.ts +0 -16
- package/api/procedures/removeAssetStat.d.ts.map +0 -1
- package/api/procedures/removeAssetStat.js +0 -85
- package/api/procedures/removeAssetStat.js.map +0 -1
- package/npm-package/polymeshassociation-polymesh-sdk-27.8.0-beta.2.tgz +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.setTransferRestrictionsExemptions = exports.getAuthorization = exports.prepareSetTransferRestrictionExemptions = void 0;
|
|
16
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
17
|
+
const internal_1 = require("../../internal");
|
|
18
|
+
const types_1 = require("../../types");
|
|
19
|
+
const utils_1 = require("../../types/utils");
|
|
20
|
+
const conversion_1 = require("../../utils/conversion");
|
|
21
|
+
const internal_2 = require("../../utils/internal");
|
|
22
|
+
/**
|
|
23
|
+
* @hidden
|
|
24
|
+
*/
|
|
25
|
+
function prepareSetTransferRestrictionExemptions(args) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const { context: { polymeshApi: { query, tx: { statistics }, }, }, context, } = this;
|
|
28
|
+
const { asset, type, identities: entities, claim, isExempt } = args;
|
|
29
|
+
const identities = entities.map(id => {
|
|
30
|
+
return (0, internal_2.asIdentity)(id, context);
|
|
31
|
+
});
|
|
32
|
+
const rawEntities = (0, conversion_1.identitiesToBtreeSet)(identities, context);
|
|
33
|
+
const rawIsExempt = (0, conversion_1.booleanToBool)(isExempt, context);
|
|
34
|
+
const rawAssetId = (0, conversion_1.assetToMeshAssetId)(asset, context);
|
|
35
|
+
const rawType = (0, conversion_1.statTypeToStatOpType)(type, context);
|
|
36
|
+
const exemptKey = (0, conversion_1.toExemptKey)(rawAssetId, rawType, claim);
|
|
37
|
+
// Ensure entities are not already set
|
|
38
|
+
if (isExempt) {
|
|
39
|
+
const multiParams = identities.map(({ did }) => (0, utils_1.tuple)(exemptKey, (0, conversion_1.stringToIdentityId)(did, context)));
|
|
40
|
+
const result = yield query.statistics.transferConditionExemptEntities.multi(multiParams);
|
|
41
|
+
const exemptedDids = result.reduce((ids, rawResult, index) => {
|
|
42
|
+
const isSet = (0, conversion_1.boolToBoolean)(rawResult);
|
|
43
|
+
if (isSet) {
|
|
44
|
+
ids.push(identities[index].did);
|
|
45
|
+
}
|
|
46
|
+
return ids;
|
|
47
|
+
}, []);
|
|
48
|
+
if (exemptedDids.length) {
|
|
49
|
+
throw new internal_1.PolymeshError({
|
|
50
|
+
code: types_1.ErrorCode.NoDataChange,
|
|
51
|
+
message: 'Some identities are already exempted',
|
|
52
|
+
data: { exemptedDids },
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
// Ensure entities are already set
|
|
58
|
+
const multiParams = identities.map(({ did }) => (0, utils_1.tuple)(exemptKey, (0, conversion_1.stringToIdentityId)(did, context)));
|
|
59
|
+
const result = yield query.statistics.transferConditionExemptEntities.multi(multiParams);
|
|
60
|
+
const unsetDids = result.reduce((ids, rawResult, index) => {
|
|
61
|
+
const isSet = (0, conversion_1.boolToBoolean)(rawResult);
|
|
62
|
+
if (!isSet) {
|
|
63
|
+
ids.push(identities[index].did);
|
|
64
|
+
}
|
|
65
|
+
return ids;
|
|
66
|
+
}, []);
|
|
67
|
+
if (unsetDids.length) {
|
|
68
|
+
throw new internal_1.PolymeshError({
|
|
69
|
+
code: types_1.ErrorCode.NoDataChange,
|
|
70
|
+
message: 'Some identities are not exemptions',
|
|
71
|
+
data: { isExempt, unsetDids },
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
transaction: statistics.setEntitiesExempt,
|
|
77
|
+
feeMultiplier: new bignumber_js_1.default(rawEntities.size),
|
|
78
|
+
args: [rawIsExempt, exemptKey, rawEntities],
|
|
79
|
+
resolver: undefined,
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
exports.prepareSetTransferRestrictionExemptions = prepareSetTransferRestrictionExemptions;
|
|
84
|
+
/**
|
|
85
|
+
* @hidden
|
|
86
|
+
*/
|
|
87
|
+
function getAuthorization({ asset }) {
|
|
88
|
+
return {
|
|
89
|
+
permissions: {
|
|
90
|
+
assets: [asset],
|
|
91
|
+
transactions: [types_1.TxTags.statistics.SetEntitiesExempt],
|
|
92
|
+
portfolios: [],
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
exports.getAuthorization = getAuthorization;
|
|
97
|
+
/**
|
|
98
|
+
* @hidden
|
|
99
|
+
*/
|
|
100
|
+
const setTransferRestrictionsExemptions = () => new internal_1.Procedure(prepareSetTransferRestrictionExemptions, getAuthorization);
|
|
101
|
+
exports.setTransferRestrictionsExemptions = setTransferRestrictionsExemptions;
|
|
102
|
+
//# sourceMappingURL=setTransferRestrictionExemptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setTransferRestrictionExemptions.js","sourceRoot":"","sources":["../../../src/api/procedures/setTransferRestrictionExemptions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAAqC;AAErC,6CAAqE;AACrE,uCAAgF;AAEhF,6CAAsC;AACtC,uDAQ4B;AAC5B,mDAA8C;AAO9C;;GAEG;AACH,SAAsB,uCAAuC,CAE3D,IAAY;;QAEZ,MAAM,EACJ,OAAO,EAAE,EACP,WAAW,EAAE,EACX,KAAK,EACL,EAAE,EAAE,EAAE,UAAU,EAAE,GACnB,GACF,EACD,OAAO,GACR,GAAG,IAAI,CAAC;QACT,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAEpE,MAAM,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;YACnC,OAAO,IAAA,qBAAU,EAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;QAEH,MAAM,WAAW,GAAG,IAAA,iCAAoB,EAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAC9D,MAAM,WAAW,GAAG,IAAA,0BAAa,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACrD,MAAM,UAAU,GAAG,IAAA,+BAAkB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACtD,MAAM,OAAO,GAAG,IAAA,iCAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACpD,MAAM,SAAS,GAAG,IAAA,wBAAW,EAAC,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QAE1D,sCAAsC;QACtC,IAAI,QAAQ,EAAE;YACZ,MAAM,WAAW,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAC7C,IAAA,aAAK,EAAC,SAAS,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,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;iBACjC;gBAED,OAAO,GAAG,CAAC;YACb,CAAC,EAAE,EAAc,CAAC,CAAC;YAEnB,IAAI,SAAS,CAAC,MAAM,EAAE;gBACpB,MAAM,IAAI,wBAAa,CAAC;oBACtB,IAAI,EAAE,iBAAS,CAAC,YAAY;oBAC5B,OAAO,EAAE,oCAAoC;oBAC7C,IAAI,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE;iBAC9B,CAAC,CAAC;aACJ;SACF;QAED,OAAO;YACL,WAAW,EAAE,UAAU,CAAC,iBAAiB;YACzC,aAAa,EAAE,IAAI,sBAAS,CAAC,WAAW,CAAC,IAAI,CAAC;YAC9C,IAAI,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC;YAC3C,QAAQ,EAAE,SAAS;SACpB,CAAC;IACJ,CAAC;CAAA;AAjFD,0FAiFC;AAED;;GAEG;AACH,SAAgB,gBAAgB,CAE9B,EAAE,KAAK,EAAU;IAEjB,OAAO;QACL,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,KAAK,CAAC;YACf,YAAY,EAAE,CAAC,cAAM,CAAC,UAAU,CAAC,iBAAiB,CAAC;YACnD,UAAU,EAAE,EAAE;SACf;KACF,CAAC;AACJ,CAAC;AAXD,4CAWC;AAED;;GAEG;AACI,MAAM,iCAAiC,GAAG,GAA4B,EAAE,CAC7E,IAAI,oBAAS,CAAC,uCAAuC,EAAE,gBAAgB,CAAC,CAAC;AAD9D,QAAA,iCAAiC,qCAC6B"}
|
|
@@ -1,44 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { FungibleAsset, Procedure } from "../../internal";
|
|
2
|
+
import { TransferRestrictionParams } from "../../types";
|
|
3
|
+
import { ExtrinsicParams, ProcedureAuthorization, TransactionSpec } from "../../types/internal";
|
|
4
|
+
export declare type Params = {
|
|
5
|
+
asset: FungibleAsset;
|
|
6
|
+
} & TransferRestrictionParams;
|
|
7
7
|
/**
|
|
8
8
|
* @hidden
|
|
9
9
|
*/
|
|
10
|
-
declare
|
|
11
|
-
export declare type ExemptionRecords = Record<ClaimKey, Identity[]>;
|
|
12
|
-
export declare const newExemptionRecord: () => ExemptionRecords;
|
|
10
|
+
export declare function prepareSetTransferRestrictions(this: Procedure<Params, void>, args: Params): Promise<TransactionSpec<void, ExtrinsicParams<'statistics', 'setAssetTransferCompliance'>>>;
|
|
13
11
|
/**
|
|
14
12
|
* @hidden
|
|
15
|
-
* @param toInsertId - Identity to insert into the exemption records
|
|
16
|
-
* @param exemptionRecords - records that will be mutated if the Identity should be added
|
|
17
|
-
* @param claimType - type of Claim the Identity is exempt from
|
|
18
|
-
* @param filterSet - set of Identities that should not be added into exemption records if given
|
|
19
13
|
*/
|
|
20
|
-
export declare
|
|
21
|
-
export interface Storage {
|
|
22
|
-
currentExemptions: ExemptionRecords;
|
|
23
|
-
filteredRestrictions: PolymeshPrimitivesTransferComplianceTransferCondition[];
|
|
24
|
-
currentTypeRestrictions: PolymeshPrimitivesTransferComplianceTransferCondition[];
|
|
25
|
-
occupiedSlots: BigNumber;
|
|
26
|
-
}
|
|
14
|
+
export declare function getAuthorization(this: Procedure<Params, void>, { asset }: Params): ProcedureAuthorization;
|
|
27
15
|
/**
|
|
28
16
|
* @hidden
|
|
29
17
|
*/
|
|
30
|
-
export declare
|
|
31
|
-
/**
|
|
32
|
-
* @hidden
|
|
33
|
-
*/
|
|
34
|
-
export declare function getAuthorization(this: Procedure<SetTransferRestrictionsParams, BigNumber, Storage>, { asset, restrictions }: SetTransferRestrictionsParams): ProcedureAuthorization;
|
|
35
|
-
/**
|
|
36
|
-
* @hidden
|
|
37
|
-
*/
|
|
38
|
-
export declare function prepareStorage(this: Procedure<SetTransferRestrictionsParams, BigNumber, Storage>, args: SetTransferRestrictionsParams): Promise<Storage>;
|
|
39
|
-
/**
|
|
40
|
-
* @hidden
|
|
41
|
-
*/
|
|
42
|
-
export declare const setTransferRestrictions: () => Procedure<SetTransferRestrictionsParams, BigNumber, Storage>;
|
|
43
|
-
export {};
|
|
18
|
+
export declare const setTransferRestrictions: () => Procedure<Params, void>;
|
|
44
19
|
//# sourceMappingURL=setTransferRestrictions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setTransferRestrictions.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/setTransferRestrictions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setTransferRestrictions.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/setTransferRestrictions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAiB,SAAS,EAAE,uBAAmB;AACrE,OAAO,EAOL,yBAAyB,EAG1B,oBAAgB;AACjB,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,eAAe,EAAE,6BAAyB;AAQ5F,oBAAY,MAAM,GAAG;IAAE,KAAK,EAAE,aAAa,CAAA;CAAE,GAAG,yBAAyB,CAAC;AA8C1E;;GAEG;AACH,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,EAC7B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,YAAY,EAAE,4BAA4B,CAAC,CAAC,CAAC,CA2C7F;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,EAC7B,EAAE,KAAK,EAAE,EAAE,MAAM,GAChB,sBAAsB,CAQxB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,QAAO,UAAU,MAAM,EAAE,IAAI,CACA,CAAC"}
|
|
@@ -8,215 +8,97 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.setTransferRestrictions = exports.
|
|
16
|
-
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
17
|
-
const lodash_1 = require("lodash");
|
|
12
|
+
exports.setTransferRestrictions = exports.getAuthorization = exports.prepareSetTransferRestrictions = void 0;
|
|
18
13
|
const internal_1 = require("../../internal");
|
|
19
14
|
const types_1 = require("../../types");
|
|
20
15
|
const conversion_1 = require("../../utils/conversion");
|
|
21
16
|
const internal_2 = require("../../utils/internal");
|
|
22
|
-
const newExemptionRecord = () => ({
|
|
23
|
-
Accredited: [],
|
|
24
|
-
Affiliate: [],
|
|
25
|
-
Jurisdiction: [],
|
|
26
|
-
None: [],
|
|
27
|
-
});
|
|
28
|
-
exports.newExemptionRecord = newExemptionRecord;
|
|
29
|
-
/**
|
|
30
|
-
* @hidden
|
|
31
|
-
* @param toInsertId - Identity to insert into the exemption records
|
|
32
|
-
* @param exemptionRecords - records that will be mutated if the Identity should be added
|
|
33
|
-
* @param claimType - type of Claim the Identity is exempt from
|
|
34
|
-
* @param filterSet - set of Identities that should not be added into exemption records if given
|
|
35
|
-
*/
|
|
36
|
-
const addExemptionIfNotPresent = (toInsertId, exemptionRecords, claimType, filterSet = []) => {
|
|
37
|
-
const found = filterSet.some(currentId => currentId.did === toInsertId.did);
|
|
38
|
-
if (!found) {
|
|
39
|
-
exemptionRecords[claimType].push(toInsertId);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
exports.addExemptionIfNotPresent = addExemptionIfNotPresent;
|
|
43
17
|
/**
|
|
44
18
|
* @hidden
|
|
45
19
|
* Checks if the input restrictions are valid
|
|
46
20
|
*/
|
|
47
|
-
function assertInputValid(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const seenClaimTypes = new Set();
|
|
59
|
-
inputRestrictions.forEach(restriction => {
|
|
60
|
-
var _a;
|
|
61
|
-
const { claim } = restriction;
|
|
62
|
-
if (claim.type === types_1.ClaimType.Jurisdiction) {
|
|
63
|
-
// cannot add two claims with same country code restrictions will result in internal error
|
|
64
|
-
if (seenJurisdictions.has(claim.countryCode || 'none')) {
|
|
65
|
-
throw new internal_1.PolymeshError({
|
|
66
|
-
code: types_1.ErrorCode.ValidationError,
|
|
67
|
-
message: 'Duplicate Jurisdiction CountryCode found in input',
|
|
68
|
-
data: { countryCode: claim.countryCode },
|
|
69
|
-
});
|
|
21
|
+
function assertInputValid(input) {
|
|
22
|
+
input.restrictions.forEach(restriction => {
|
|
23
|
+
const type = restriction.type;
|
|
24
|
+
if (type === types_1.TransferRestrictionType.ClaimCount) {
|
|
25
|
+
const seenJurisdictions = new Set();
|
|
26
|
+
const seenClaimTypes = new Set();
|
|
27
|
+
input.restrictions.forEach(rest => {
|
|
28
|
+
var _a;
|
|
29
|
+
const { claim } = rest;
|
|
30
|
+
if (!claim) {
|
|
31
|
+
return;
|
|
70
32
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
33
|
+
if (claim.type === types_1.ClaimType.Jurisdiction) {
|
|
34
|
+
// cannot add two claims with same country code restrictions will result in internal error
|
|
35
|
+
if (seenJurisdictions.has(claim.countryCode || 'none')) {
|
|
36
|
+
throw new internal_1.PolymeshError({
|
|
37
|
+
code: types_1.ErrorCode.ValidationError,
|
|
38
|
+
message: 'Duplicate Jurisdiction CountryCode found in input',
|
|
39
|
+
data: { countryCode: claim.countryCode },
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
seenJurisdictions.add((_a = claim.countryCode) !== null && _a !== void 0 ? _a : 'none');
|
|
81
43
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const toSetExemptions = (0, exports.newExemptionRecord)();
|
|
95
|
-
const toRemoveExemptions = (0, exports.newExemptionRecord)();
|
|
96
|
-
let needDifferentConditions = inputRestrictions.length !== currentRestrictions.length;
|
|
97
|
-
const conditions = [];
|
|
98
|
-
const inputExemptions = (0, exports.newExemptionRecord)();
|
|
99
|
-
// for each restriction check if we need to make a condition and track all exemptions
|
|
100
|
-
inputRestrictions.forEach(restriction => {
|
|
101
|
-
var _a;
|
|
102
|
-
let value;
|
|
103
|
-
let claimType;
|
|
104
|
-
if ('count' in restriction) {
|
|
105
|
-
value = restriction.count;
|
|
106
|
-
}
|
|
107
|
-
else if ('percentage' in restriction) {
|
|
108
|
-
value = restriction.percentage;
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
value = restriction;
|
|
112
|
-
claimType = restriction.claim.type;
|
|
113
|
-
}
|
|
114
|
-
const condition = { type, value };
|
|
115
|
-
const compareConditions = (transferCondition) => (0, internal_2.compareTransferRestrictionToInput)(transferCondition, condition);
|
|
116
|
-
if (!needDifferentConditions) {
|
|
117
|
-
needDifferentConditions = ![...currentRestrictions].find(compareConditions);
|
|
44
|
+
else {
|
|
45
|
+
// cannot add two ClaimType.Accredited or ClaimType.Affiliate restrictions will result in internal error
|
|
46
|
+
if (seenClaimTypes.has(claim.type)) {
|
|
47
|
+
throw new internal_1.PolymeshError({
|
|
48
|
+
code: types_1.ErrorCode.ValidationError,
|
|
49
|
+
message: 'Duplicate ClaimType found in input',
|
|
50
|
+
data: { claimType: claim.type },
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
seenClaimTypes.add(claim.type);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
118
56
|
}
|
|
119
|
-
const rawCondition = (0, conversion_1.transferRestrictionToPolymeshTransferCondition)(condition, context);
|
|
120
|
-
conditions.push(rawCondition);
|
|
121
|
-
(_a = restriction.exemptedIdentities) === null || _a === void 0 ? void 0 : _a.forEach(exemption => {
|
|
122
|
-
const key = claimType || 'None';
|
|
123
|
-
const id = (0, internal_2.asIdentity)(exemption, context);
|
|
124
|
-
(0, exports.addExemptionIfNotPresent)(id, inputExemptions, key);
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
// calculate exemptions to add — for each input exemption check if it already exists
|
|
128
|
-
(0, lodash_1.forEach)(inputExemptions, (toAddIds, cType) => {
|
|
129
|
-
const key = cType;
|
|
130
|
-
const currentIds = currentExemptions[key];
|
|
131
|
-
toAddIds.forEach(id => {
|
|
132
|
-
(0, exports.addExemptionIfNotPresent)(id, toSetExemptions, key, currentIds);
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
// calculate exemptions to remove — for each current exemption check if it was in the input
|
|
136
|
-
(0, lodash_1.forEach)(currentExemptions, (currentIds, cType) => {
|
|
137
|
-
const key = cType;
|
|
138
|
-
const given = inputExemptions[key];
|
|
139
|
-
currentIds.forEach(id => {
|
|
140
|
-
(0, exports.addExemptionIfNotPresent)(id, toRemoveExemptions, key, given);
|
|
141
|
-
});
|
|
142
57
|
});
|
|
143
|
-
const sizeOf = (obj) => (0, lodash_1.flatten)((0, lodash_1.entries)(obj).map(([, identities]) => identities)).length;
|
|
144
|
-
const needDifferentExemptions = sizeOf(toSetExemptions) > 0 || sizeOf(toRemoveExemptions) > 0;
|
|
145
|
-
if (!needDifferentConditions && !needDifferentExemptions) {
|
|
146
|
-
throw new internal_1.PolymeshError({
|
|
147
|
-
code: types_1.ErrorCode.NoDataChange,
|
|
148
|
-
message: inputRestrictions.length
|
|
149
|
-
? 'The restrictions and exemptions are already in place'
|
|
150
|
-
: 'No restrictions to remove',
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
return { conditions, toSetExemptions, toRemoveExemptions };
|
|
154
58
|
}
|
|
155
59
|
/**
|
|
156
60
|
* @hidden
|
|
157
61
|
*/
|
|
158
62
|
function prepareSetTransferRestrictions(args) {
|
|
159
63
|
return __awaiter(this, void 0, void 0, function* () {
|
|
160
|
-
const { context: { polymeshApi: { tx: { statistics },
|
|
161
|
-
const { restrictions
|
|
64
|
+
const { context: { polymeshApi: { query, tx: { statistics }, }, }, context, } = this;
|
|
65
|
+
const { restrictions, asset } = args;
|
|
162
66
|
const rawAssetId = (0, conversion_1.assetToMeshAssetId)(asset, context);
|
|
163
|
-
assertInputValid(
|
|
164
|
-
const
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
67
|
+
assertInputValid(args);
|
|
68
|
+
const currentStats = yield query.statistics.activeAssetStats(rawAssetId);
|
|
69
|
+
const conditions = restrictions.map(restriction => {
|
|
70
|
+
let value;
|
|
71
|
+
if ('count' in restriction) {
|
|
72
|
+
value = restriction.count;
|
|
73
|
+
}
|
|
74
|
+
else if ('percentage' in restriction) {
|
|
75
|
+
value = restriction.percentage;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
value = restriction;
|
|
79
|
+
}
|
|
80
|
+
const condition = { type: restriction.type, value };
|
|
81
|
+
const neededStat = (0, internal_2.neededStatTypeForRestrictionInput)(restriction, context);
|
|
82
|
+
(0, internal_2.assertStatIsSet)(currentStats, neededStat);
|
|
83
|
+
return (0, conversion_1.transferRestrictionToPolymeshTransferCondition)(condition, context);
|
|
84
|
+
});
|
|
85
|
+
const rawConditions = (0, conversion_1.complianceConditionsToBtreeSet)(conditions, context);
|
|
86
|
+
return {
|
|
179
87
|
transaction: statistics.setAssetTransferCompliance,
|
|
180
|
-
args: [
|
|
181
|
-
|
|
182
|
-
(0, conversion_1.complianceConditionsToBtreeSet)([...filteredRestrictions, ...conditions], context),
|
|
183
|
-
],
|
|
184
|
-
}));
|
|
185
|
-
const pushExemptions = (exemptions, exempt) => {
|
|
186
|
-
(0, lodash_1.forEach)(exemptions, (exempted, claimType) => {
|
|
187
|
-
if (exempted.length === 0) {
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
const rawClaimType = claimType === 'None' ? undefined : claimType;
|
|
191
|
-
const exemptKey = (0, conversion_1.toExemptKey)(rawAssetId, op, rawClaimType);
|
|
192
|
-
const exemptedBtreeSet = (0, conversion_1.identitiesToBtreeSet)(exempted, context);
|
|
193
|
-
const rawExempt = (0, conversion_1.booleanToBool)(exempt, context);
|
|
194
|
-
transactions.push((0, internal_2.checkTxType)({
|
|
195
|
-
transaction: statistics.setEntitiesExempt,
|
|
196
|
-
feeMultiplier: new bignumber_js_1.default(exemptedBtreeSet.size),
|
|
197
|
-
args: [rawExempt, exemptKey, exemptedBtreeSet],
|
|
198
|
-
}));
|
|
199
|
-
});
|
|
88
|
+
args: [rawAssetId, rawConditions],
|
|
89
|
+
resolver: undefined,
|
|
200
90
|
};
|
|
201
|
-
pushExemptions(toSetExemptions, true);
|
|
202
|
-
pushExemptions(toRemoveExemptions, false);
|
|
203
|
-
return { transactions, resolver: finalCount };
|
|
204
91
|
});
|
|
205
92
|
}
|
|
206
93
|
exports.prepareSetTransferRestrictions = prepareSetTransferRestrictions;
|
|
207
94
|
/**
|
|
208
95
|
* @hidden
|
|
209
96
|
*/
|
|
210
|
-
function getAuthorization({ asset
|
|
211
|
-
const transactions = [types_1.TxTags.statistics.SetAssetTransferCompliance];
|
|
212
|
-
const needExemptionsPermission = restrictions.some(r => { var _a; return (_a = r.exemptedIdentities) === null || _a === void 0 ? void 0 : _a.length; });
|
|
213
|
-
if (needExemptionsPermission) {
|
|
214
|
-
transactions.push(types_1.TxTags.statistics.SetEntitiesExempt);
|
|
215
|
-
}
|
|
97
|
+
function getAuthorization({ asset }) {
|
|
216
98
|
return {
|
|
217
99
|
permissions: {
|
|
218
100
|
assets: [asset],
|
|
219
|
-
transactions,
|
|
101
|
+
transactions: [types_1.TxTags.statistics.SetAssetTransferCompliance],
|
|
220
102
|
portfolios: [],
|
|
221
103
|
},
|
|
222
104
|
};
|
|
@@ -225,84 +107,6 @@ exports.getAuthorization = getAuthorization;
|
|
|
225
107
|
/**
|
|
226
108
|
* @hidden
|
|
227
109
|
*/
|
|
228
|
-
|
|
229
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
230
|
-
const { context, context: { polymeshApi: { query: { statistics }, }, }, } = this;
|
|
231
|
-
const { asset, type } = args;
|
|
232
|
-
const rawAssetId = (0, conversion_1.assetToMeshAssetId)(asset, context);
|
|
233
|
-
const [currentStats, { requirements: currentRestrictions }] = yield (0, internal_2.requestMulti)(context, [
|
|
234
|
-
[statistics.activeAssetStats, rawAssetId],
|
|
235
|
-
[statistics.assetTransferCompliances, rawAssetId],
|
|
236
|
-
]);
|
|
237
|
-
args.restrictions.forEach(restriction => {
|
|
238
|
-
let claimIssuer;
|
|
239
|
-
if (type === types_1.TransferRestrictionType.ClaimCount ||
|
|
240
|
-
type === types_1.TransferRestrictionType.ClaimPercentage) {
|
|
241
|
-
const { claim: { type: claimType }, issuer, } = restriction;
|
|
242
|
-
claimIssuer = { claimType, issuer };
|
|
243
|
-
}
|
|
244
|
-
const neededStat = (0, internal_2.neededStatTypeForRestrictionInput)({ type, claimIssuer }, context);
|
|
245
|
-
(0, internal_2.assertStatIsSet)(currentStats, neededStat);
|
|
246
|
-
});
|
|
247
|
-
const filteredRestrictions = [...currentRestrictions].filter(requirement => {
|
|
248
|
-
if (type === types_1.TransferRestrictionType.Count) {
|
|
249
|
-
return !requirement.isMaxInvestorCount;
|
|
250
|
-
}
|
|
251
|
-
else if (type === types_1.TransferRestrictionType.Percentage) {
|
|
252
|
-
return !requirement.isMaxInvestorOwnership;
|
|
253
|
-
}
|
|
254
|
-
else if (type === types_1.TransferRestrictionType.ClaimCount) {
|
|
255
|
-
return !requirement.isClaimCount;
|
|
256
|
-
}
|
|
257
|
-
else {
|
|
258
|
-
return !requirement.isClaimOwnership;
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
const currentTypeRestrictions = [...currentRestrictions].filter(requirement => {
|
|
262
|
-
if (type === types_1.TransferRestrictionType.Count) {
|
|
263
|
-
return requirement.isMaxInvestorCount;
|
|
264
|
-
}
|
|
265
|
-
else if (type === types_1.TransferRestrictionType.Percentage) {
|
|
266
|
-
return requirement.isMaxInvestorOwnership;
|
|
267
|
-
}
|
|
268
|
-
else if (type === types_1.TransferRestrictionType.ClaimCount) {
|
|
269
|
-
return requirement.isClaimCount;
|
|
270
|
-
}
|
|
271
|
-
else {
|
|
272
|
-
return requirement.isClaimOwnership;
|
|
273
|
-
}
|
|
274
|
-
});
|
|
275
|
-
const op = (0, conversion_1.transferRestrictionTypeToStatOpType)(type, context);
|
|
276
|
-
const claimTypes = type === types_1.TransferRestrictionType.Count || type === types_1.TransferRestrictionType.Percentage
|
|
277
|
-
? [undefined]
|
|
278
|
-
: [types_1.ClaimType.Accredited, types_1.ClaimType.Affiliate, types_1.ClaimType.Jurisdiction];
|
|
279
|
-
const exemptionFetchers = [];
|
|
280
|
-
claimTypes.forEach(claimType => {
|
|
281
|
-
exemptionFetchers.push(statistics.transferConditionExemptEntities.entries((0, conversion_1.toExemptKey)(rawAssetId, op, claimType)));
|
|
282
|
-
});
|
|
283
|
-
const rawCurrentExemptions = (0, lodash_1.flatten)(yield Promise.all(exemptionFetchers));
|
|
284
|
-
const currentExemptions = (0, exports.newExemptionRecord)();
|
|
285
|
-
rawCurrentExemptions.forEach(([{ args: [{ claimType: rawClaimType }, rawDid], },]) => {
|
|
286
|
-
const did = (0, conversion_1.identityIdToString)(rawDid);
|
|
287
|
-
let claimType = 'None';
|
|
288
|
-
if (rawClaimType.isSome) {
|
|
289
|
-
claimType = (0, conversion_1.meshClaimTypeToClaimType)(rawClaimType.unwrap());
|
|
290
|
-
}
|
|
291
|
-
const identity = new internal_1.Identity({ did }, context);
|
|
292
|
-
(0, exports.addExemptionIfNotPresent)(identity, currentExemptions, claimType);
|
|
293
|
-
});
|
|
294
|
-
return {
|
|
295
|
-
occupiedSlots: new bignumber_js_1.default(filteredRestrictions.length),
|
|
296
|
-
currentTypeRestrictions,
|
|
297
|
-
filteredRestrictions,
|
|
298
|
-
currentExemptions,
|
|
299
|
-
};
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
exports.prepareStorage = prepareStorage;
|
|
303
|
-
/**
|
|
304
|
-
* @hidden
|
|
305
|
-
*/
|
|
306
|
-
const setTransferRestrictions = () => new internal_1.Procedure(prepareSetTransferRestrictions, getAuthorization, prepareStorage);
|
|
110
|
+
const setTransferRestrictions = () => new internal_1.Procedure(prepareSetTransferRestrictions, getAuthorization);
|
|
307
111
|
exports.setTransferRestrictions = setTransferRestrictions;
|
|
308
112
|
//# sourceMappingURL=setTransferRestrictions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setTransferRestrictions.js","sourceRoot":"","sources":["../../../src/api/procedures/setTransferRestrictions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setTransferRestrictions.js","sourceRoot":"","sources":["../../../src/api/procedures/setTransferRestrictions.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,6CAAqE;AACrE,uCAUiB;AAEjB,uDAI4B;AAC5B,mDAAsF;AAItF;;;GAGG;AACH,SAAS,gBAAgB,CAAC,KAAgC;IACxD,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QACvC,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC;QAC9B,IAAI,IAAI,KAAK,+BAAuB,CAAC,UAAU,EAAE;YAC/C,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAU,CAAC;YAC5C,MAAM,cAAc,GAAG,I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