@polymeshassociation/polymesh-sdk 27.8.0-beta.2 → 28.0.0-beta.2

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.
Files changed (77) hide show
  1. package/CHANGELOG.md +8 -2
  2. package/api/entities/Asset/Fungible/TransferRestrictions/index.d.ts +47 -11
  3. package/api/entities/Asset/Fungible/TransferRestrictions/index.d.ts.map +1 -1
  4. package/api/entities/Asset/Fungible/TransferRestrictions/index.js +214 -21
  5. package/api/entities/Asset/Fungible/TransferRestrictions/index.js.map +1 -1
  6. package/api/entities/Asset/types.d.ts +86 -5
  7. package/api/entities/Asset/types.d.ts.map +1 -1
  8. package/api/entities/Asset/types.js.map +1 -1
  9. package/api/entities/DefaultTrustedClaimIssuer.d.ts +2 -2
  10. package/api/entities/DefaultTrustedClaimIssuer.d.ts.map +1 -1
  11. package/api/entities/DefaultTrustedClaimIssuer.js.map +1 -1
  12. package/api/entities/types.d.ts +11 -9
  13. package/api/entities/types.d.ts.map +1 -1
  14. package/api/entities/types.js +6 -1
  15. package/api/entities/types.js.map +1 -1
  16. package/api/procedures/setAssetStats.d.ts +22 -0
  17. package/api/procedures/setAssetStats.d.ts.map +1 -0
  18. package/api/procedures/setAssetStats.js +87 -0
  19. package/api/procedures/setAssetStats.js.map +1 -0
  20. package/api/procedures/setTransferRestrictionExemptions.d.ts +20 -0
  21. package/api/procedures/setTransferRestrictionExemptions.d.ts.map +1 -0
  22. package/api/procedures/setTransferRestrictionExemptions.js +102 -0
  23. package/api/procedures/setTransferRestrictionExemptions.js.map +1 -0
  24. package/api/procedures/setTransferRestrictions.d.ts +9 -34
  25. package/api/procedures/setTransferRestrictions.d.ts.map +1 -1
  26. package/api/procedures/setTransferRestrictions.js +61 -257
  27. package/api/procedures/setTransferRestrictions.js.map +1 -1
  28. package/api/procedures/types.d.ts +40 -48
  29. package/api/procedures/types.d.ts.map +1 -1
  30. package/api/procedures/types.js.map +1 -1
  31. package/internal.d.ts +3 -6
  32. package/internal.d.ts.map +1 -1
  33. package/internal.js +7 -11
  34. package/internal.js.map +1 -1
  35. package/npm-package/polymeshassociation-polymesh-sdk-28.0.0-beta.2.tgz +0 -0
  36. package/package.json +1 -1
  37. package/utils/conversion.d.ts +31 -22
  38. package/utils/conversion.d.ts.map +1 -1
  39. package/utils/conversion.js +181 -164
  40. package/utils/conversion.js.map +1 -1
  41. package/utils/internal.d.ts +1 -14
  42. package/utils/internal.d.ts.map +1 -1
  43. package/utils/internal.js +3 -110
  44. package/utils/internal.js.map +1 -1
  45. package/api/entities/Asset/Fungible/TransferRestrictions/ClaimCount.d.ts +0 -69
  46. package/api/entities/Asset/Fungible/TransferRestrictions/ClaimCount.d.ts.map +0 -1
  47. package/api/entities/Asset/Fungible/TransferRestrictions/ClaimCount.js +0 -16
  48. package/api/entities/Asset/Fungible/TransferRestrictions/ClaimCount.js.map +0 -1
  49. package/api/entities/Asset/Fungible/TransferRestrictions/ClaimPercentage.d.ts +0 -60
  50. package/api/entities/Asset/Fungible/TransferRestrictions/ClaimPercentage.d.ts.map +0 -1
  51. package/api/entities/Asset/Fungible/TransferRestrictions/ClaimPercentage.js +0 -16
  52. package/api/entities/Asset/Fungible/TransferRestrictions/ClaimPercentage.js.map +0 -1
  53. package/api/entities/Asset/Fungible/TransferRestrictions/Count.d.ts +0 -81
  54. package/api/entities/Asset/Fungible/TransferRestrictions/Count.d.ts.map +0 -1
  55. package/api/entities/Asset/Fungible/TransferRestrictions/Count.js +0 -20
  56. package/api/entities/Asset/Fungible/TransferRestrictions/Count.js.map +0 -1
  57. package/api/entities/Asset/Fungible/TransferRestrictions/Percentage.d.ts +0 -59
  58. package/api/entities/Asset/Fungible/TransferRestrictions/Percentage.d.ts.map +0 -1
  59. package/api/entities/Asset/Fungible/TransferRestrictions/Percentage.js +0 -16
  60. package/api/entities/Asset/Fungible/TransferRestrictions/Percentage.js.map +0 -1
  61. package/api/entities/Asset/Fungible/TransferRestrictions/TransferRestrictionBase.d.ts +0 -62
  62. package/api/entities/Asset/Fungible/TransferRestrictions/TransferRestrictionBase.d.ts.map +0 -1
  63. package/api/entities/Asset/Fungible/TransferRestrictions/TransferRestrictionBase.js +0 -189
  64. package/api/entities/Asset/Fungible/TransferRestrictions/TransferRestrictionBase.js.map +0 -1
  65. package/api/procedures/addAssetStat.d.ts +0 -16
  66. package/api/procedures/addAssetStat.d.ts.map +0 -1
  67. package/api/procedures/addAssetStat.js +0 -87
  68. package/api/procedures/addAssetStat.js.map +0 -1
  69. package/api/procedures/addTransferRestriction.d.ts +0 -23
  70. package/api/procedures/addTransferRestriction.d.ts.map +0 -1
  71. package/api/procedures/addTransferRestriction.js +0 -122
  72. package/api/procedures/addTransferRestriction.js.map +0 -1
  73. package/api/procedures/removeAssetStat.d.ts +0 -16
  74. package/api/procedures/removeAssetStat.d.ts.map +0 -1
  75. package/api/procedures/removeAssetStat.js +0 -85
  76. package/api/procedures/removeAssetStat.js.map +0 -1
  77. package/npm-package/polymeshassociation-polymesh-sdk-27.8.0-beta.2.tgz +0 -0
@@ -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.prepareStorage = exports.getAuthorization = exports.prepareSetTransferRestrictions = exports.addExemptionIfNotPresent = exports.newExemptionRecord = void 0;
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(inputRestrictions, type) {
48
- if ([types_1.TransferRestrictionType.Percentage, types_1.TransferRestrictionType.Count].includes(type) &&
49
- inputRestrictions.length > 1) {
50
- throw new internal_1.PolymeshError({
51
- code: types_1.ErrorCode.ValidationError,
52
- message: 'Only one of provided Transfer Type Restriction can be set at a time',
53
- data: { type },
54
- });
55
- }
56
- if (type === types_1.TransferRestrictionType.ClaimCount) {
57
- const seenJurisdictions = new Set();
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
- seenJurisdictions.add((_a = claim.countryCode) !== null && _a !== void 0 ? _a : 'none');
72
- }
73
- else {
74
- // cannot add two ClaimType.Accredited or ClaimType.Affiliate restrictions will result in internal error
75
- if (seenClaimTypes.has(claim.type)) {
76
- throw new internal_1.PolymeshError({
77
- code: types_1.ErrorCode.ValidationError,
78
- message: 'Duplicate ClaimType found in input',
79
- data: { claimType: claim.type },
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
- seenClaimTypes.add(claim.type);
83
- }
84
- });
85
- }
86
- }
87
- /**
88
- * @hidden
89
- *
90
- * Calculates the smallest change needed to get to the requested state from the current state.
91
- * While clearing and building the restrictions would be simpler, it would be inefficient use of gas fees
92
- */
93
- function transformInput(inputRestrictions, currentRestrictions, currentExemptions, type, context) {
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 }, consts, }, }, storage: { occupiedSlots, currentExemptions, filteredRestrictions, currentTypeRestrictions }, context, } = this;
161
- const { restrictions: { length: newRestrictionAmount }, restrictions, type, asset, } = args;
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(restrictions, type);
164
- const { conditions, toSetExemptions, toRemoveExemptions } = transformInput(restrictions, currentTypeRestrictions, currentExemptions, type, context);
165
- const maxTransferConditions = (0, conversion_1.u32ToBigNumber)(consts.statistics.maxTransferConditionsPerAsset);
166
- const finalCount = occupiedSlots.plus(newRestrictionAmount);
167
- if (finalCount.isGreaterThan(maxTransferConditions)) {
168
- throw new internal_1.PolymeshError({
169
- code: types_1.ErrorCode.LimitExceeded,
170
- message: 'Cannot set more Transfer Restrictions than there are slots available',
171
- data: {
172
- availableSlots: maxTransferConditions.minus(occupiedSlots),
173
- },
174
- });
175
- }
176
- const transactions = [];
177
- const op = (0, conversion_1.transferRestrictionTypeToStatOpType)(type, context);
178
- transactions.push((0, internal_2.checkTxType)({
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
- rawAssetId,
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, restrictions }) {
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
- function prepareStorage(args) {
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":";;;;;;;;;;;;;;;AAMA,gEAAqC;AACrC,mCAAmD;AAGnD,6CAAyE;AACzE,uCAeiB;AAEjB,uDAW4B;AAC5B,mDAO0B;AAOnB,MAAM,kBAAkB,G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C;QACnE,CAAC,CACF,CAAC;QAEF,OAAO;YACL,aAAa,EAAE,IAAI,sBAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC;YACzD,uBAAuB;YACvB,oBAAoB;YACpB,iBAAiB;SAClB,CAAC;IACJ,CAAC;CAAA;AA9GD,wCA8GC;AAED;;GAEG;AACI,MAAM,uBAAuB,GAAG,GAIrC,EAAE,CAAC,IAAI,oBAAS,CAAC,8BAA8B,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAJxE,QAAA,uBAAuB,2BAIiD"}
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,IAAI,GAAG,EAAU,CAAC;YAEzC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;;gBAChC,MAAM,EAAE,KAAK,EAAE,GAAG,IAA0C,CAAC;gBAE7D,IAAI,CAAC,KAAK,EAAE;oBACV,OAAO;iBACR;gBAED,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAS,CAAC,YAAY,EAAE;oBACzC,0FAA0F;oBAC1F,IAAI,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,IAAI,MAAM,CAAC,EAAE;wBACtD,MAAM,IAAI,wBAAa,CAAC;4BACtB,IAAI,EAAE,iBAAS,CAAC,eAAe;4BAC/B,OAAO,EAAE,m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YAAY,IAAI,WAAW,EAAE;gBACtC,KAAK,GAAG,WAAW,CAAC,UAAU,CAAC;aAChC;iBAAM;gBACL,KAAK,GAAG,WAAW,CAAC;aACrB;YAED,MAAM,SAAS,GAAG,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,KAAK,EAAyB,CAAC;YAE3E,MAAM,UAAU,GAAG,IAAA,4CAAiC,EAAC,WAAW,EAAE,OAAO,CAAC,CAAC;YAE3E,IAAA,0BAAe,EAAC,YAAY,EAAE,UAAU,CAAC,CAAC;YAE1C,OAAO,IAAA,2DAA8C,EAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC5E,CAAC,CAAC,CAAC;QAEH,MAAM,aAAa,GAAG,IAAA,2CAA8B,EAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAE1E,OAAO;YACL,WAAW,EAAE,UAAU,CAAC,0BAA0B;YAClD,IAAI,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC;YACjC,QAAQ,EAAE,SAAS;SACpB,CAAC;IACJ,CAAC;CAAA;AA9CD,wEA8CC;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,0BAA0B,CAAC;YAC5D,UAAU,EAAE,EAAE;SACf;KACF,CAAC;AACJ,CAAC;AAXD,4CAWC;AAED;;GAEG;AACI,MAAM,uBAAuB,GAAG,GAA4B,EAAE,CACnE,IAAI,oBAAS,CAAC,8BAA8B,EAAE,gBAAgB,CAAC,CAAC;AADrD,QAAA,uBAAuB,2BAC8B"}
@@ -1,7 +1,7 @@
1
1
  import BigNumber from 'bignumber.js';
2
2
  import { BallotMeta, BallotVote } from "../entities/CorporateBallot/types";
3
3
  import { Account, AuthorizationRequest, CheckpointSchedule, ChildIdentity, CorporateActionBase, CorporateBallot, CustomPermissionGroup, DefaultPortfolio, FungibleAsset, Identity, KnownPermissionGroup, MultiSig, Nft, NumberedPortfolio, PolymeshTransaction, PolymeshTransactionBatch, Venue } from "../../internal";
4
- import { ActiveTransferRestrictions, AddCountStatInput, AssetDocument, CheckPermissionsResult, CheckRolesResult, ClaimCountStatInput, ClaimCountTransferRestriction, ClaimPercentageTransferRestriction, ClaimTarget, CorporateActionKind, CorporateActionTargets, CountTransferRestriction, InputCaCheckpoint, InputCondition, InputStatClaim, InputStatType, InputTargets, InputTaxWithholding, InputTrustedClaimIssuer, KnownAssetType, KnownNftType, MetadataSpec, MetadataType, MetadataValueDetails, NftCollection, OfferingTier, PercentageTransferRestriction, PermissionedAccount, PermissionsLike, PortfolioLike, PortfolioMovement, Requirement, Scope, SecurityIdentifier, Signer, SignerType, StatClaimIssuer, StatType, TaxWithholding, TransactionPermissions, TxTag, VenueType } from "../../types";
4
+ import { AddCountStatInput, AssetDocument, CheckPermissionsResult, CheckRolesResult, ClaimCountStatInput, ClaimTarget, ClaimType, CorporateActionKind, CorporateActionTargets, InputCaCheckpoint, InputCondition, InputStatClaim, InputStatType, InputTargets, InputTaxWithholding, InputTrustedClaimIssuer, KnownAssetType, KnownNftType, MetadataSpec, MetadataType, MetadataValueDetails, NftCollection, OfferingTier, PermissionedAccount, PermissionsLike, PortfolioLike, PortfolioMovement, Requirement, Scope, SecurityIdentifier, Signer, SignerType, StatClaimIssuer, StatType, TaxWithholding, TransactionPermissions, TxTag, VenueType } from "../../types";
5
5
  import { Modify } from "../../types/utils";
6
6
  export interface ProcedureAuthorizationStatus {
7
7
  /**
@@ -268,12 +268,7 @@ export declare enum TxGroup {
268
268
  */
269
269
  StoManagement = "StoManagement"
270
270
  }
271
- export declare type AddRestrictionParams<T> = Omit<T extends TransferRestrictionType.Count ? AddCountTransferRestrictionParams : T extends TransferRestrictionType.Percentage ? AddPercentageTransferRestrictionParams : T extends TransferRestrictionType.ClaimCount ? AddClaimCountTransferRestrictionParams : AddClaimPercentageTransferRestrictionParams, 'type'>;
272
- export declare type SetRestrictionsParams<T> = Omit<T extends TransferRestrictionType.Count ? SetCountTransferRestrictionsParams : T extends TransferRestrictionType.Percentage ? SetPercentageTransferRestrictionsParams : T extends TransferRestrictionType.ClaimCount ? SetClaimCountTransferRestrictionsParams : SetClaimPercentageTransferRestrictionsParams, 'type'>;
273
- export declare type GetTransferRestrictionReturnType<T> = ActiveTransferRestrictions<T extends TransferRestrictionType.Count ? CountTransferRestriction : T extends TransferRestrictionType.Percentage ? PercentageTransferRestriction : T extends TransferRestrictionType.ClaimCount ? ClaimCountTransferRestriction : ClaimPercentageTransferRestriction>;
274
- export declare type RemoveAssetStatParams = {
275
- asset: FungibleAsset;
276
- } & (RemoveCountStatParams | RemoveBalanceStatParams | RemoveScopedCountParams | RemoveScopedBalanceParams);
271
+ export declare type SetTransferRestrictionParams = CountTransferRestrictionInput | PercentageTransferRestrictionInput | ClaimCountTransferRestrictionInput | ClaimPercentageTransferRestrictionInput;
277
272
  export declare type AddCountStatParams = AddCountStatInput & {
278
273
  type: StatType.Count;
279
274
  };
@@ -289,19 +284,9 @@ export declare type AddClaimPercentageStatParams = StatClaimIssuer & {
289
284
  export declare type AddAssetStatParams = {
290
285
  asset: FungibleAsset;
291
286
  } & (AddCountStatParams | AddPercentageStatParams | AddClaimCountStatParams | AddClaimPercentageStatParams);
292
- export declare type RemoveCountStatParams = {
293
- type: StatType.Count;
294
- };
295
- export declare type RemoveBalanceStatParams = {
296
- type: StatType.Balance;
297
- };
298
- export declare type RemoveScopedCountParams = StatClaimIssuer & {
299
- type: StatType.ScopedCount;
287
+ export declare type SetTransferRestrictionStatParams = {
288
+ stats: (AddCountStatParams | AddPercentageStatParams | AddClaimCountStatParams | AddClaimPercentageStatParams)[];
300
289
  };
301
- export declare type RemoveScopedBalanceParams = StatClaimIssuer & {
302
- type: StatType.ScopedBalance;
303
- };
304
- export declare type SetAssetStatParams<T> = Omit<T extends TransferRestrictionType.Count ? AddCountStatParams : T extends TransferRestrictionType.Percentage ? AddPercentageStatParams : T extends TransferRestrictionType.ClaimCount ? AddClaimCountStatParams : AddClaimPercentageStatParams, 'type'>;
305
290
  export declare enum TransferRestrictionType {
306
291
  Count = "Count",
307
292
  Percentage = "Percentage",
@@ -333,51 +318,66 @@ export declare type TransferRestriction = {
333
318
  type: TransferRestrictionType.ClaimPercentage;
334
319
  value: ClaimPercentageRestrictionValue;
335
320
  };
336
- interface TransferRestrictionInputBase {
337
- /**
338
- * array of Identities (or DIDs) that are exempted from the Restriction
339
- */
340
- exemptedIdentities?: (Identity | string)[];
341
- /**
342
- * (optional) Set to `true` to skip stat is enabled check, useful for batch transactions
343
- */
344
- skipStatIsEnabledCheck?: boolean;
321
+ export interface TransferRestrictionInputCount {
322
+ count: BigNumber;
323
+ type: TransferRestrictionType.Count;
345
324
  }
346
- export interface CountTransferRestrictionInput extends TransferRestrictionInputBase {
325
+ export interface CountTransferRestrictionInput {
347
326
  /**
348
327
  * limit on the amount of different (unique) investors that can hold the Asset at once
349
328
  */
350
329
  count: BigNumber;
330
+ type: TransferRestrictionType.Count;
351
331
  }
352
- export interface PercentageTransferRestrictionInput extends TransferRestrictionInputBase {
332
+ export interface PercentageTransferRestrictionInput {
353
333
  /**
354
334
  * maximum percentage (0-100) of the total supply of the Asset that can be held by a single investor at once
355
335
  */
356
336
  percentage: BigNumber;
337
+ type: TransferRestrictionType.Percentage;
357
338
  }
358
- export interface ClaimCountTransferRestrictionInput extends TransferRestrictionInputBase {
339
+ export interface ClaimCountTransferRestrictionInput {
359
340
  min: BigNumber;
360
341
  max?: BigNumber;
361
342
  issuer: Identity;
362
343
  claim: InputStatClaim;
344
+ type: TransferRestrictionType.ClaimCount;
363
345
  }
364
- export interface ClaimPercentageTransferRestrictionInput extends TransferRestrictionInputBase {
346
+ export interface ClaimPercentageTransferRestrictionInput {
365
347
  min: BigNumber;
366
348
  max: BigNumber;
367
349
  issuer: Identity;
368
350
  claim: InputStatClaim;
351
+ type: TransferRestrictionType.ClaimPercentage;
369
352
  }
370
- export declare type AddCountTransferRestrictionParams = CountTransferRestrictionInput & {
371
- type: TransferRestrictionType.Count;
372
- };
373
- export declare type AddPercentageTransferRestrictionParams = PercentageTransferRestrictionInput & {
353
+ export interface TransferRestrictionInputPercentage {
354
+ percentage: BigNumber;
374
355
  type: TransferRestrictionType.Percentage;
375
- };
376
- export declare type AddClaimCountTransferRestrictionParams = ClaimCountTransferRestrictionInput & {
356
+ }
357
+ export interface TransferRestrictionClaimCountInput {
358
+ min: BigNumber;
359
+ max?: BigNumber;
360
+ issuer: Identity;
361
+ claim: InputStatClaim;
377
362
  type: TransferRestrictionType.ClaimCount;
378
- };
379
- export declare type AddClaimPercentageTransferRestrictionParams = ClaimPercentageTransferRestrictionInput & {
363
+ }
364
+ export interface TransferRestrictionInputClaimPercentage {
365
+ min: BigNumber;
366
+ max: BigNumber;
367
+ issuer: Identity;
368
+ claim: InputStatClaim;
380
369
  type: TransferRestrictionType.ClaimPercentage;
370
+ }
371
+ export declare type TransferRestrictionParams = {
372
+ restrictions: (TransferRestrictionInputCount | TransferRestrictionInputPercentage | TransferRestrictionClaimCountInput | TransferRestrictionInputClaimPercentage)[];
373
+ };
374
+ export declare type AddCountTransferRestrictionParams = CountTransferRestrictionInput & {
375
+ type: TransferRestrictionType.Count;
376
+ };
377
+ export declare type TransferRestrictionExemptionParams = {
378
+ type: StatType;
379
+ identities: (Identity | string)[];
380
+ claim?: ClaimType;
381
381
  };
382
382
  export interface SetCountTransferRestrictionsParams {
383
383
  /**
@@ -386,13 +386,6 @@ export interface SetCountTransferRestrictionsParams {
386
386
  restrictions: CountTransferRestrictionInput[];
387
387
  type: TransferRestrictionType.Count;
388
388
  }
389
- export interface SetPercentageTransferRestrictionsParams {
390
- /**
391
- * array of Percentage Transfer Restrictions with their corresponding exemptions (if applicable)
392
- */
393
- restrictions: PercentageTransferRestrictionInput[];
394
- type: TransferRestrictionType.Percentage;
395
- }
396
389
  export interface SetClaimCountTransferRestrictionsParams {
397
390
  restrictions: ClaimCountTransferRestrictionInput[];
398
391
  type: TransferRestrictionType.ClaimCount;
@@ -1565,5 +1558,4 @@ export declare type InitiateCorporateActionParams = {
1565
1558
  */
1566
1559
  defaultTaxWithholding: BigNumber | null;
1567
1560
  };
1568
- export {};
1569
1561
  //# sourceMappingURL=types.d.ts.map