@polymeshassociation/polymesh-sdk 20.1.0 → 20.2.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 +2 -10
- package/api/procedures/setTransferRestrictions.d.ts +10 -1
- package/api/procedures/setTransferRestrictions.d.ts.map +1 -1
- package/api/procedures/setTransferRestrictions.js +11 -9
- package/api/procedures/setTransferRestrictions.js.map +1 -1
- package/base/Context.d.ts.map +1 -1
- package/base/Context.js +38 -108
- package/base/Context.js.map +1 -1
- package/base/utils.d.ts +4 -0
- package/base/utils.d.ts.map +1 -0
- package/base/utils.js +85 -0
- package/base/utils.js.map +1 -0
- package/internal.d.ts.map +1 -1
- package/internal.js +1 -0
- package/internal.js.map +1 -1
- package/middleware/enumsV2.d.ts.map +1 -1
- package/middleware/enumsV2.js +1 -0
- package/middleware/enumsV2.js.map +1 -1
- package/npm-package/polymeshassociation-polymesh-sdk-20.2.0-beta.1.tgz +0 -0
- package/package.json +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/index.js.map +1 -1
- package/utils/conversion.d.ts.map +1 -1
- package/utils/conversion.js +8 -6
- package/utils/conversion.js.map +1 -1
- package/npm-package/polymeshassociation-polymesh-sdk-20.1.0.tgz +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
# [20.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
### Bug Fixes
|
|
5
|
-
|
|
6
|
-
* 🐛 `next` field for ResultSet when size is not provided ([#962](https://github.com/PolymeshAssociation/polymesh-sdk/issues/962)) ([917fdf2](https://github.com/PolymeshAssociation/polymesh-sdk/commit/917fdf2772c22a58bc22434d575798d75ba8cb41))
|
|
7
|
-
* 🐛 Allows to affirm or reject failed instructions ([f18a8b6](https://github.com/PolymeshAssociation/polymesh-sdk/commit/f18a8b60492e42e40bdab6861e0540c1e01f956f))
|
|
8
|
-
* 🐛 multisig.getIdentity to return associated Identity ([#963](https://github.com/PolymeshAssociation/polymesh-sdk/issues/963)) ([584c2ba](https://github.com/PolymeshAssociation/polymesh-sdk/commit/584c2ba89a98cfd12620dcf271574c78f54a6161))
|
|
9
|
-
* 🐛 Ordering of data returned by Middleware V2 ([a18b893](https://github.com/PolymeshAssociation/polymesh-sdk/commit/a18b8936437cfc77db724544ac191564b3f5f6b5))
|
|
1
|
+
# [20.2.0-beta.1](https://github.com/PolymeshAssociation/polymesh-sdk/compare/v20.1.0...v20.2.0-beta.1) (2023-05-14)
|
|
10
2
|
|
|
11
3
|
|
|
12
4
|
### Features
|
|
13
5
|
|
|
14
|
-
* 🎸
|
|
6
|
+
* 🎸 Add `lastUpdatedAt` attribute to `ClaimData` ([102e23b](https://github.com/PolymeshAssociation/polymesh-sdk/commit/102e23b4a85949437f50fbab142982ca9e3ecba5))
|
|
@@ -8,7 +8,16 @@ import { BatchTransactionSpec, ProcedureAuthorization } from "../../types/intern
|
|
|
8
8
|
* @hidden
|
|
9
9
|
*/
|
|
10
10
|
declare type ClaimKey = StatClaimType | 'None';
|
|
11
|
-
declare type ExemptionRecords = Record<ClaimKey, Identity[]>;
|
|
11
|
+
export declare type ExemptionRecords = Record<ClaimKey, Identity[]>;
|
|
12
|
+
export declare const newExemptionRecord: () => ExemptionRecords;
|
|
13
|
+
/**
|
|
14
|
+
* @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
|
+
*/
|
|
20
|
+
export declare const addExemptionIfNotPresent: (toInsertId: Identity, exemptionRecords: ExemptionRecords, claimType: ClaimKey, filterSet?: Identity[]) => void;
|
|
12
21
|
export interface Storage {
|
|
13
22
|
currentRestrictions: PolymeshPrimitivesTransferComplianceTransferCondition[];
|
|
14
23
|
currentExemptions: ExemptionRecords;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setTransferRestrictions.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/setTransferRestrictions.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,qDAAqD,EAEtD,uCAA+B;AAChC,OAAO,SAAS,MAAM,cAAc,CAAC;AAGrC,OAAO,EAAE,6BAA6B,EAAE,uEAA0E;AAClH,OAAO,EAAkB,QAAQ,EAAiB,SAAS,EAAE,uBAAmB;AAChF,OAAO,EAUL,aAAa,EAKd,oBAAgB;AACjB,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,6BAAyB;AAqBhF;;GAEG;AAEH,aAAK,QAAQ,GAAG,aAAa,GAAG,MAAM,CAAC;AACvC,
|
|
1
|
+
{"version":3,"file":"setTransferRestrictions.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/setTransferRestrictions.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,qDAAqD,EAEtD,uCAA+B;AAChC,OAAO,SAAS,MAAM,cAAc,CAAC;AAGrC,OAAO,EAAE,6BAA6B,EAAE,uEAA0E;AAClH,OAAO,EAAkB,QAAQ,EAAiB,SAAS,EAAE,uBAAmB;AAChF,OAAO,EAUL,aAAa,EAKd,oBAAgB;AACjB,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,6BAAyB;AAqBhF;;GAEG;AAEH,aAAK,QAAQ,GAAG,aAAa,GAAG,MAAM,CAAC;AACvC,oBAAY,gBAAgB,GAAG,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC5D,eAAO,MAAM,kBAAkB,QAAO,gBAKpC,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,eACvB,QAAQ,oBACF,gBAAgB,aACvB,QAAQ,cACR,QAAQ,EAAE,KACpB,IAKF,CAAC;AAEF,MAAM,WAAW,OAAO;IACtB,mBAAmB,EAAE,qDAAqD,EAAE,CAAC;IAC7E,iBAAiB,EAAE,gBAAgB,CAAC;IACpC,aAAa,EAAE,SAAS,CAAC;CAC1B;AA4FD;;GAEG;AACH,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,SAAS,CAAC,6BAA6B,EAAE,SAAS,EAAE,OAAO,CAAC,EAClE,IAAI,EAAE,6BAA6B,GAClC,OAAO,CAAC,oBAAoB,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,CAwEvD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,SAAS,CAAC,6BAA6B,EAAE,SAAS,EAAE,OAAO,CAAC,EAClE,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,6BAA6B,GACtD,sBAAsB,CAexB;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,SAAS,CAAC,6BAA6B,EAAE,SAAS,EAAE,OAAO,CAAC,EAClE,IAAI,EAAE,6BAA6B,GAClC,OAAO,CAAC,OAAO,CAAC,CA0IlB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,QAAO,UACzC,6BAA6B,EAC7B,SAAS,EACT,OAAO,CAC2E,CAAC"}
|
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.setTransferRestrictions = exports.prepareStorage = exports.getAuthorization = exports.prepareSetTransferRestrictions = void 0;
|
|
15
|
+
exports.setTransferRestrictions = exports.prepareStorage = exports.getAuthorization = exports.prepareSetTransferRestrictions = exports.addExemptionIfNotPresent = exports.newExemptionRecord = void 0;
|
|
16
16
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
17
17
|
const lodash_1 = require("lodash");
|
|
18
18
|
const internal_1 = require("../../internal");
|
|
@@ -25,6 +25,7 @@ const newExemptionRecord = () => ({
|
|
|
25
25
|
Jurisdiction: [],
|
|
26
26
|
None: [],
|
|
27
27
|
});
|
|
28
|
+
exports.newExemptionRecord = newExemptionRecord;
|
|
28
29
|
/**
|
|
29
30
|
* @hidden
|
|
30
31
|
* @param toInsertId - Identity to insert into the exemption records
|
|
@@ -38,6 +39,7 @@ const addExemptionIfNotPresent = (toInsertId, exemptionRecords, claimType, filte
|
|
|
38
39
|
exemptionRecords[claimType].push(toInsertId);
|
|
39
40
|
}
|
|
40
41
|
};
|
|
42
|
+
exports.addExemptionIfNotPresent = addExemptionIfNotPresent;
|
|
41
43
|
/**
|
|
42
44
|
* @hidden
|
|
43
45
|
*
|
|
@@ -45,11 +47,11 @@ const addExemptionIfNotPresent = (toInsertId, exemptionRecords, claimType, filte
|
|
|
45
47
|
* While clearing and building the restrictions would be simpler, it would be inefficient use of gas fees
|
|
46
48
|
*/
|
|
47
49
|
function transformInput(inputRestrictions, currentRestrictions, currentExemptions, type, context) {
|
|
48
|
-
const toSetExemptions = newExemptionRecord();
|
|
49
|
-
const toRemoveExemptions = newExemptionRecord();
|
|
50
|
+
const toSetExemptions = (0, exports.newExemptionRecord)();
|
|
51
|
+
const toRemoveExemptions = (0, exports.newExemptionRecord)();
|
|
50
52
|
let needDifferentConditions = inputRestrictions.length !== currentRestrictions.length;
|
|
51
53
|
const conditions = [];
|
|
52
|
-
const inputExemptions = newExemptionRecord();
|
|
54
|
+
const inputExemptions = (0, exports.newExemptionRecord)();
|
|
53
55
|
// for each restriction check if we need to make a condition and track all exemptions
|
|
54
56
|
inputRestrictions.forEach(restriction => {
|
|
55
57
|
var _a;
|
|
@@ -75,7 +77,7 @@ function transformInput(inputRestrictions, currentRestrictions, currentExemption
|
|
|
75
77
|
(_a = restriction.exemptedIdentities) === null || _a === void 0 ? void 0 : _a.forEach(exemption => {
|
|
76
78
|
const key = claimType || 'None';
|
|
77
79
|
const id = (0, internal_2.asIdentity)(exemption, context);
|
|
78
|
-
addExemptionIfNotPresent(id, inputExemptions, key);
|
|
80
|
+
(0, exports.addExemptionIfNotPresent)(id, inputExemptions, key);
|
|
79
81
|
});
|
|
80
82
|
});
|
|
81
83
|
// calculate exemptions to add — for each input exemption check if it already exists
|
|
@@ -83,7 +85,7 @@ function transformInput(inputRestrictions, currentRestrictions, currentExemption
|
|
|
83
85
|
const key = cType;
|
|
84
86
|
const currentIds = currentExemptions[key];
|
|
85
87
|
toAddIds.forEach(id => {
|
|
86
|
-
addExemptionIfNotPresent(id, toSetExemptions, key, currentIds);
|
|
88
|
+
(0, exports.addExemptionIfNotPresent)(id, toSetExemptions, key, currentIds);
|
|
87
89
|
});
|
|
88
90
|
});
|
|
89
91
|
// calculate exemptions to remove — for each current exemption check if it was in the input
|
|
@@ -91,7 +93,7 @@ function transformInput(inputRestrictions, currentRestrictions, currentExemption
|
|
|
91
93
|
const key = cType;
|
|
92
94
|
const given = inputExemptions[key];
|
|
93
95
|
currentIds.forEach(id => {
|
|
94
|
-
addExemptionIfNotPresent(id, toRemoveExemptions, key, given);
|
|
96
|
+
(0, exports.addExemptionIfNotPresent)(id, toRemoveExemptions, key, given);
|
|
95
97
|
});
|
|
96
98
|
});
|
|
97
99
|
const sizeOf = (obj) => (0, lodash_1.flatten)((0, lodash_1.entries)(obj).map(([, identities]) => identities)).length;
|
|
@@ -245,7 +247,7 @@ function prepareStorage(args) {
|
|
|
245
247
|
}));
|
|
246
248
|
});
|
|
247
249
|
const rawCurrentExemptions = (0, lodash_1.flatten)(yield Promise.all(exemptionFetchers));
|
|
248
|
-
const currentExemptions = newExemptionRecord();
|
|
250
|
+
const currentExemptions = (0, exports.newExemptionRecord)();
|
|
249
251
|
rawCurrentExemptions.forEach(([{ args: [{ claimType: rawClaimType }, rawDid], },]) => {
|
|
250
252
|
const did = (0, conversion_1.identityIdToString)(rawDid);
|
|
251
253
|
let claimType = 'None';
|
|
@@ -253,7 +255,7 @@ function prepareStorage(args) {
|
|
|
253
255
|
claimType = (0, conversion_1.meshClaimTypeToClaimType)(rawClaimType.unwrap());
|
|
254
256
|
}
|
|
255
257
|
const identity = new internal_1.Identity({ did }, context);
|
|
256
|
-
addExemptionIfNotPresent(identity, currentExemptions, claimType);
|
|
258
|
+
(0, exports.addExemptionIfNotPresent)(identity, currentExemptions, claimType);
|
|
257
259
|
});
|
|
258
260
|
const transformRestriction = (restriction) => {
|
|
259
261
|
return (0, conversion_1.transferRestrictionToPolymeshTransferCondition)(restriction, context);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setTransferRestrictions.js","sourceRoot":"","sources":["../../../src/api/procedures/setTransferRestrictions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAMA,gEAAqC;AACrC,mCAAmD;AAGnD,6CAAgF;AAChF,uCAeiB;AAEjB,uDAW4B;AAC5B,mDAM0B;
|
|
1
|
+
{"version":3,"file":"setTransferRestrictions.js","sourceRoot":"","sources":["../../../src/api/procedures/setTransferRestrictions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAMA,gEAAqC;AACrC,mCAAmD;AAGnD,6CAAgF;AAChF,uCAeiB;AAEjB,uDAW4B;AAC5B,mDAM0B;AAQnB,MAAM,kBAAkB,GAAG,GAAqB,EAAE,CAAC,CAAC;IACzD,UAAU,EAAE,EAAE;IACd,SAAS,EAAE,EAAE;IACb,YAAY,EAAE,EAAE;IAChB,IAAI,EAAE,EAAE;CACT,CAAC,CAAC;AALU,QAAA,kBAAkB,sBAK5B;AAEH;;;;;;GAMG;AACI,MAAM,wBAAwB,GAAG,CACtC,UAAoB,EACpB,gBAAkC,EAClC,SAAmB,EACnB,YAAwB,EAAE,EACpB,EAAE;IACR,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,KAAK,UAAU,CAAC,GAAG,CAAC,CAAC;IAC5E,IAAI,CAAC,KAAK,EAAE;QACV,gBAAgB,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KAC9C;AACH,CAAC,CAAC;AAVW,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ACH,MAAM,GAAG,GAAG,IAAA,+BAAkB,EAAC,MAAM,CAAC,CAAC;YACvC,IAAI,SAAS,GAAa,MAAM,CAAC;YACjC,IAAI,YAAY,CAAC,MAAM,EAAE;gBACvB,SAAS,GAAG,IAAA,qCAAwB,EAAC,YAAY,CAAC,MAAM,EAAE,CAAa,CAAC;aACzE;YACD,MAAM,QAAQ,GAAG,IAAI,mBAAQ,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC;YAChD,IAAA,gCAAwB,EAAC,QAAQ,EAAE,iBAAiB,EAAE,SAAS,CAAC,CAAC;QACnE,CAAC,CACF,CAAC;QAEF,MAAM,oBAAoB,GAAG,CAC3B,WAAgC,EACuB,EAAE;YACzD,OAAO,IAAA,2DAA8C,EAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC9E,CAAC,CAAC;QAEF,OAAO;YACL,aAAa,EAAE,IAAI,sBAAS,CAAC,aAAa,CAAC;YAC3C,mBAAmB,EAAE,mBAAmB,CAAC,GAAG,CAAC,oBAAoB,CAAC;YAClE,iBAAiB;SAClB,CAAC;IACJ,CAAC;CAAA;AA7ID,wCA6IC;AAED;;GAEG;AACI,MAAM,uBAAuB,GAAG,GAIrC,EAAE,CAAC,IAAI,oBAAS,CAAC,8BAA8B,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAJxE,QAAA,uBAAuB,2BAIiD"}
|
package/base/Context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../src/base/Context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAS3C,OAAO,
|
|
1
|
+
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../src/base/Context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAS3C,OAAO,EAAgB,KAAK,EAAE,WAAW,EAAE,MAAM,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AAM,GAAG,MAAM,EAClE,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,OAAO,GACd,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC;IAYpB;;;;OAIG;IACI,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI;IAIxC;;;;OAIG;IACI,QAAQ,IAAI,SAAS;CAK7B"}
|
package/base/Context.js
CHANGED
|
@@ -14,20 +14,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.Context = void 0;
|
|
16
16
|
const types_1 = require("@polkadot/types");
|
|
17
|
-
const types_2 = require("@polkadot/types/types");
|
|
18
17
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
19
18
|
const bluebird_1 = __importDefault(require("bluebird"));
|
|
20
19
|
const lodash_1 = require("lodash");
|
|
21
|
-
const definitions_1 = require("../polkadot/definitions");
|
|
22
20
|
const internal_1 = require("../internal");
|
|
23
21
|
const enumsV2_1 = require("../middleware/enumsV2");
|
|
24
22
|
const queries_1 = require("../middleware/queries");
|
|
25
23
|
const queriesV2_1 = require("../middleware/queriesV2");
|
|
26
|
-
const
|
|
27
|
-
const
|
|
24
|
+
const types_2 = require("../middleware/types");
|
|
25
|
+
const types_3 = require("../types");
|
|
28
26
|
const constants_1 = require("../utils/constants");
|
|
29
27
|
const conversion_1 = require("../utils/conversion");
|
|
30
28
|
const internal_2 = require("../utils/internal");
|
|
29
|
+
const utils_1 = require("./utils");
|
|
31
30
|
/**
|
|
32
31
|
* @hidden
|
|
33
32
|
*
|
|
@@ -80,7 +79,7 @@ class Context {
|
|
|
80
79
|
get: (target, prop) => {
|
|
81
80
|
if (target.isDisconnected) {
|
|
82
81
|
throw new internal_1.PolymeshError({
|
|
83
|
-
code:
|
|
82
|
+
code: types_3.ErrorCode.FatalError,
|
|
84
83
|
message: 'Client disconnected. Please create a new instance via "Polymesh.connect()"',
|
|
85
84
|
});
|
|
86
85
|
}
|
|
@@ -134,7 +133,7 @@ class Context {
|
|
|
134
133
|
const { _signingManager: manager } = this;
|
|
135
134
|
if (!manager) {
|
|
136
135
|
throw new internal_1.PolymeshError({
|
|
137
|
-
code:
|
|
136
|
+
code: types_3.ErrorCode.General,
|
|
138
137
|
message: 'There is no Signing Manager attached to the SDK',
|
|
139
138
|
});
|
|
140
139
|
}
|
|
@@ -170,7 +169,7 @@ class Context {
|
|
|
170
169
|
});
|
|
171
170
|
if (!newSigningAddress) {
|
|
172
171
|
throw new internal_1.PolymeshError({
|
|
173
|
-
code:
|
|
172
|
+
code: types_3.ErrorCode.General,
|
|
174
173
|
message: 'The Account is not part of the Signing Manager attached to the SDK',
|
|
175
174
|
});
|
|
176
175
|
}
|
|
@@ -271,7 +270,7 @@ class Context {
|
|
|
271
270
|
const identity = yield account.getIdentity();
|
|
272
271
|
if (identity === null) {
|
|
273
272
|
throw new internal_1.PolymeshError({
|
|
274
|
-
code:
|
|
273
|
+
code: types_3.ErrorCode.DataUnavailable,
|
|
275
274
|
message: 'The signing Account does not have an associated Identity',
|
|
276
275
|
});
|
|
277
276
|
}
|
|
@@ -297,7 +296,7 @@ class Context {
|
|
|
297
296
|
const { signingAddress } = this;
|
|
298
297
|
if (!signingAddress) {
|
|
299
298
|
throw new internal_1.PolymeshError({
|
|
300
|
-
code:
|
|
299
|
+
code: types_3.ErrorCode.General,
|
|
301
300
|
message: 'There is no signing Account associated with the SDK instance',
|
|
302
301
|
});
|
|
303
302
|
}
|
|
@@ -348,7 +347,7 @@ class Context {
|
|
|
348
347
|
const exists = yield id.exists();
|
|
349
348
|
if (!exists) {
|
|
350
349
|
throw new internal_1.PolymeshError({
|
|
351
|
-
code:
|
|
350
|
+
code: types_3.ErrorCode.DataUnavailable,
|
|
352
351
|
message: 'The passed DID does not correspond to an on-chain user Identity. It may correspond to an Asset Identity',
|
|
353
352
|
});
|
|
354
353
|
}
|
|
@@ -417,15 +416,15 @@ class Context {
|
|
|
417
416
|
supportsSubsidy({ tag }) {
|
|
418
417
|
const moduleName = tag.split('.')[0];
|
|
419
418
|
return [
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
419
|
+
types_3.ModuleName.Asset,
|
|
420
|
+
types_3.ModuleName.ComplianceManager,
|
|
421
|
+
types_3.ModuleName.CorporateAction,
|
|
422
|
+
types_3.ModuleName.ExternalAgents,
|
|
423
|
+
types_3.ModuleName.Portfolio,
|
|
424
|
+
types_3.ModuleName.Settlement,
|
|
425
|
+
types_3.ModuleName.Statistics,
|
|
426
|
+
types_3.ModuleName.Sto,
|
|
427
|
+
types_3.ModuleName.Relayer,
|
|
429
428
|
].includes(moduleName);
|
|
430
429
|
}
|
|
431
430
|
/**
|
|
@@ -440,87 +439,12 @@ class Context {
|
|
|
440
439
|
* have a signer Account for this method
|
|
441
440
|
*/
|
|
442
441
|
_polymeshApi: { tx }, } = this;
|
|
443
|
-
const { types } = definitions_1.polymesh;
|
|
444
442
|
const [section, method] = tag.split('.');
|
|
445
|
-
const getRootType = (type) => {
|
|
446
|
-
const rootType = constants_1.ROOT_TYPES[type];
|
|
447
|
-
if (rootType) {
|
|
448
|
-
return {
|
|
449
|
-
type: rootType,
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
if (type === 'Null') {
|
|
453
|
-
return {
|
|
454
|
-
type: types_4.TransactionArgumentType.Null,
|
|
455
|
-
};
|
|
456
|
-
}
|
|
457
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
458
|
-
const definition = types[type];
|
|
459
|
-
if (!definition) {
|
|
460
|
-
return {
|
|
461
|
-
type: types_4.TransactionArgumentType.Unknown,
|
|
462
|
-
};
|
|
463
|
-
}
|
|
464
|
-
const typeDef = (0, types_1.getTypeDef)(JSON.stringify(definition));
|
|
465
|
-
if (typeDef.info === types_2.TypeDefInfo.Plain) {
|
|
466
|
-
return getRootType(definition);
|
|
467
|
-
}
|
|
468
|
-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
469
|
-
return processType(typeDef, '');
|
|
470
|
-
};
|
|
471
|
-
const processType = (rawType, name) => {
|
|
472
|
-
const { type, info, sub } = rawType;
|
|
473
|
-
const arg = {
|
|
474
|
-
name,
|
|
475
|
-
optional: false,
|
|
476
|
-
_rawType: rawType,
|
|
477
|
-
};
|
|
478
|
-
switch (info) {
|
|
479
|
-
case types_2.TypeDefInfo.Plain: {
|
|
480
|
-
return Object.assign(Object.assign({}, getRootType(type)), arg);
|
|
481
|
-
}
|
|
482
|
-
case types_2.TypeDefInfo.Compact: {
|
|
483
|
-
return Object.assign(Object.assign({}, processType(sub, name)), arg);
|
|
484
|
-
}
|
|
485
|
-
case types_2.TypeDefInfo.Option: {
|
|
486
|
-
return Object.assign(Object.assign(Object.assign({}, processType(sub, name)), arg), { optional: true });
|
|
487
|
-
}
|
|
488
|
-
case types_2.TypeDefInfo.Tuple: {
|
|
489
|
-
return Object.assign(Object.assign({ type: types_4.TransactionArgumentType.Tuple }, arg), { internal: sub.map((def, index) => processType(def, `${index}`)) });
|
|
490
|
-
}
|
|
491
|
-
case types_2.TypeDefInfo.Vec: {
|
|
492
|
-
return Object.assign(Object.assign({ type: types_4.TransactionArgumentType.Array }, arg), { internal: processType(sub, '') });
|
|
493
|
-
}
|
|
494
|
-
case types_2.TypeDefInfo.VecFixed: {
|
|
495
|
-
return Object.assign({ type: types_4.TransactionArgumentType.Text }, arg);
|
|
496
|
-
}
|
|
497
|
-
case types_2.TypeDefInfo.Enum: {
|
|
498
|
-
const subTypes = sub;
|
|
499
|
-
const isSimple = subTypes.every(({ type: subType }) => subType === 'Null');
|
|
500
|
-
if (isSimple) {
|
|
501
|
-
return Object.assign(Object.assign({ type: types_4.TransactionArgumentType.SimpleEnum }, arg), {
|
|
502
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
503
|
-
internal: subTypes.map(({ name: subName }) => subName) });
|
|
504
|
-
}
|
|
505
|
-
return Object.assign(Object.assign({ type: types_4.TransactionArgumentType.RichEnum }, arg), {
|
|
506
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
507
|
-
internal: subTypes.map(def => processType(def, def.name)) });
|
|
508
|
-
}
|
|
509
|
-
case types_2.TypeDefInfo.Struct: {
|
|
510
|
-
return Object.assign(Object.assign({ type: types_4.TransactionArgumentType.Object }, arg), {
|
|
511
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
512
|
-
internal: sub.map(def => processType(def, def.name)) });
|
|
513
|
-
}
|
|
514
|
-
default: {
|
|
515
|
-
return Object.assign({ type: types_4.TransactionArgumentType.Unknown }, arg);
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
};
|
|
519
443
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
520
444
|
return tx[section][method].meta.args.map(({ name, type }) => {
|
|
521
445
|
const typeDef = (0, types_1.getTypeDef)(type.toString());
|
|
522
446
|
const argName = (0, conversion_1.textToString)(name);
|
|
523
|
-
return processType(typeDef, argName);
|
|
447
|
+
return (0, utils_1.processType)(typeDef, argName);
|
|
524
448
|
});
|
|
525
449
|
}
|
|
526
450
|
/**
|
|
@@ -593,7 +517,7 @@ class Context {
|
|
|
593
517
|
getIdentityClaimsFromChain(args) {
|
|
594
518
|
return __awaiter(this, void 0, void 0, function* () {
|
|
595
519
|
const { polymeshApi: { query: { identity }, }, } = this;
|
|
596
|
-
const { targets, claimTypes = Object.values(
|
|
520
|
+
const { targets, claimTypes = Object.values(types_3.ClaimType), trustedClaimIssuers, includeExpired, } = args;
|
|
597
521
|
const claim1stKeys = (0, lodash_1.flatMap)(targets, target => claimTypes.map(claimType => {
|
|
598
522
|
return {
|
|
599
523
|
target: (0, conversion_1.signerToString)(target),
|
|
@@ -605,7 +529,7 @@ class Context {
|
|
|
605
529
|
const claimData = yield bluebird_1.default.map(claim1stKeys, (claim1stKey) => __awaiter(this, void 0, void 0, function* () {
|
|
606
530
|
const entries = yield identity.claims.entries(claim1stKey);
|
|
607
531
|
const data = [];
|
|
608
|
-
entries.forEach(([key, { claimIssuer, issuanceDate, expiry: rawExpiry, claim }]) => {
|
|
532
|
+
entries.forEach(([key, { claimIssuer, issuanceDate, lastUpdateDate, expiry: rawExpiry, claim }]) => {
|
|
609
533
|
const { target } = key.args[0];
|
|
610
534
|
const expiry = !rawExpiry.isEmpty ? (0, conversion_1.momentToDate)(rawExpiry.unwrap()) : null;
|
|
611
535
|
if ((!includeExpired && (expiry === null || expiry > new Date())) || includeExpired) {
|
|
@@ -613,6 +537,7 @@ class Context {
|
|
|
613
537
|
target: new internal_1.Identity({ did: (0, conversion_1.identityIdToString)(target) }, this),
|
|
614
538
|
issuer: new internal_1.Identity({ did: (0, conversion_1.identityIdToString)(claimIssuer) }, this),
|
|
615
539
|
issuedAt: (0, conversion_1.momentToDate)(issuanceDate),
|
|
540
|
+
lastUpdatedAt: (0, conversion_1.momentToDate)(lastUpdateDate),
|
|
616
541
|
expiry,
|
|
617
542
|
claim: (0, conversion_1.meshClaimToClaim)(claim),
|
|
618
543
|
});
|
|
@@ -633,7 +558,7 @@ class Context {
|
|
|
633
558
|
const result = yield this.queryMiddleware((0, queries_1.didsWithClaims)({
|
|
634
559
|
dids: targets === null || targets === void 0 ? void 0 : targets.map(target => (0, conversion_1.signerToString)(target)),
|
|
635
560
|
trustedClaimIssuers: trustedClaimIssuers === null || trustedClaimIssuers === void 0 ? void 0 : trustedClaimIssuers.map(trustedClaimIssuer => (0, conversion_1.signerToString)(trustedClaimIssuer)),
|
|
636
|
-
claimTypes: claimTypes === null || claimTypes === void 0 ? void 0 : claimTypes.map(ct =>
|
|
561
|
+
claimTypes: claimTypes === null || claimTypes === void 0 ? void 0 : claimTypes.map(ct => types_2.ClaimTypeEnum[ct]),
|
|
637
562
|
includeExpired,
|
|
638
563
|
count: size === null || size === void 0 ? void 0 : size.toNumber(),
|
|
639
564
|
skip: start === null || start === void 0 ? void 0 : start.toNumber(),
|
|
@@ -641,11 +566,12 @@ class Context {
|
|
|
641
566
|
const { data: { didsWithClaims: { items: didsWithClaimsList, totalCount }, }, } = result;
|
|
642
567
|
const count = new bignumber_js_1.default(totalCount);
|
|
643
568
|
didsWithClaimsList.forEach(({ claims }) => {
|
|
644
|
-
claims.forEach(({ targetDID: target, issuer, issuance_date: issuanceDate, expiry, type, jurisdiction, scope, cdd_id: cddId, }) => {
|
|
569
|
+
claims.forEach(({ targetDID: target, issuer, issuance_date: issuanceDate, last_update_date: lastUpdateDate, expiry, type, jurisdiction, scope, cdd_id: cddId, }) => {
|
|
645
570
|
data.push({
|
|
646
571
|
target: new internal_1.Identity({ did: target }, this),
|
|
647
572
|
issuer: new internal_1.Identity({ did: issuer }, this),
|
|
648
573
|
issuedAt: new Date(issuanceDate),
|
|
574
|
+
lastUpdatedAt: new Date(lastUpdateDate),
|
|
649
575
|
expiry: expiry ? new Date(expiry) : null,
|
|
650
576
|
claim: (0, internal_2.createClaim)(type, jurisdiction, scope, cddId, undefined),
|
|
651
577
|
});
|
|
@@ -711,7 +637,7 @@ class Context {
|
|
|
711
637
|
}
|
|
712
638
|
if (!targets) {
|
|
713
639
|
throw new internal_1.PolymeshError({
|
|
714
|
-
code:
|
|
640
|
+
code: types_3.ErrorCode.MiddlewareError,
|
|
715
641
|
message: 'Cannot perform this action without an active middleware connection',
|
|
716
642
|
});
|
|
717
643
|
}
|
|
@@ -758,7 +684,7 @@ class Context {
|
|
|
758
684
|
}
|
|
759
685
|
if (!targets) {
|
|
760
686
|
throw new internal_1.PolymeshError({
|
|
761
|
-
code:
|
|
687
|
+
code: types_3.ErrorCode.MiddlewareError,
|
|
762
688
|
message: 'Cannot perform this action without an active middleware V2 connection',
|
|
763
689
|
});
|
|
764
690
|
}
|
|
@@ -786,7 +712,7 @@ class Context {
|
|
|
786
712
|
const { _middlewareApi: api } = this;
|
|
787
713
|
if (!api) {
|
|
788
714
|
throw new internal_1.PolymeshError({
|
|
789
|
-
code:
|
|
715
|
+
code: types_3.ErrorCode.MiddlewareError,
|
|
790
716
|
message: 'Cannot perform this action without an active middleware connection',
|
|
791
717
|
});
|
|
792
718
|
}
|
|
@@ -801,7 +727,7 @@ class Context {
|
|
|
801
727
|
const { _middlewareApiV2: api } = this;
|
|
802
728
|
if (!api) {
|
|
803
729
|
throw new internal_1.PolymeshError({
|
|
804
|
-
code:
|
|
730
|
+
code: types_3.ErrorCode.MiddlewareError,
|
|
805
731
|
message: 'Cannot perform this action without an active middleware v2 connection',
|
|
806
732
|
});
|
|
807
733
|
}
|
|
@@ -824,7 +750,7 @@ class Context {
|
|
|
824
750
|
const { message: errorMessage } = err;
|
|
825
751
|
const message = resultMessage !== null && resultMessage !== void 0 ? resultMessage : errorMessage;
|
|
826
752
|
throw new internal_1.PolymeshError({
|
|
827
|
-
code:
|
|
753
|
+
code: types_3.ErrorCode.MiddlewareError,
|
|
828
754
|
message: `Error in middleware query: ${message}`,
|
|
829
755
|
});
|
|
830
756
|
}
|
|
@@ -848,7 +774,7 @@ class Context {
|
|
|
848
774
|
const { message: errorMessage } = err;
|
|
849
775
|
const message = resultMessage !== null && resultMessage !== void 0 ? resultMessage : errorMessage;
|
|
850
776
|
throw new internal_1.PolymeshError({
|
|
851
|
-
code:
|
|
777
|
+
code: types_3.ErrorCode.MiddlewareError,
|
|
852
778
|
message: `Error in middleware V2 query: ${message}`,
|
|
853
779
|
});
|
|
854
780
|
}
|
|
@@ -968,8 +894,12 @@ class Context {
|
|
|
968
894
|
({ middlewareApiV2 } = this);
|
|
969
895
|
}
|
|
970
896
|
this.isDisconnected = true;
|
|
971
|
-
|
|
972
|
-
|
|
897
|
+
if (middlewareApi) {
|
|
898
|
+
middlewareApi.stop();
|
|
899
|
+
}
|
|
900
|
+
if (middlewareApiV2) {
|
|
901
|
+
middlewareApiV2.stop();
|
|
902
|
+
}
|
|
973
903
|
yield (0, internal_2.delay)(500); // allow pending requests to complete
|
|
974
904
|
return polymeshApi.disconnect();
|
|
975
905
|
});
|
|
@@ -995,7 +925,7 @@ class Context {
|
|
|
995
925
|
}
|
|
996
926
|
catch (error) {
|
|
997
927
|
throw new internal_1.PolymeshError({
|
|
998
|
-
code:
|
|
928
|
+
code: types_3.ErrorCode.UnexpectedError,
|
|
999
929
|
message: `Could not create internal Polymesh type: "${type}". Please report this error to the Polymesh team`,
|
|
1000
930
|
data: { type, params, error },
|
|
1001
931
|
});
|