@polymeshassociation/polymesh-sdk 24.0.0-alpha.2 → 24.0.0-alpha.20
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 +3 -3
- package/README.md +8 -12
- package/api/client/Identities.d.ts +27 -1
- package/api/client/Identities.d.ts.map +1 -1
- package/api/client/Identities.js +34 -2
- package/api/client/Identities.js.map +1 -1
- package/api/client/Network.d.ts +2 -2
- package/api/client/Network.d.ts.map +1 -1
- package/api/client/Network.js +6 -4
- package/api/client/Network.js.map +1 -1
- package/api/entities/Asset/Base/BaseAsset.d.ts +22 -2
- package/api/entities/Asset/Base/BaseAsset.d.ts.map +1 -1
- package/api/entities/Asset/Base/BaseAsset.js +41 -0
- package/api/entities/Asset/Base/BaseAsset.js.map +1 -1
- package/api/entities/Asset/Base/Settlements/index.d.ts +14 -2
- package/api/entities/Asset/Base/Settlements/index.d.ts.map +1 -1
- package/api/entities/Asset/Base/Settlements/index.js +22 -0
- package/api/entities/Asset/Base/Settlements/index.js.map +1 -1
- package/api/entities/Asset/Fungible/index.d.ts +1 -5
- package/api/entities/Asset/Fungible/index.d.ts.map +1 -1
- package/api/entities/Asset/Fungible/index.js +0 -1
- package/api/entities/Asset/Fungible/index.js.map +1 -1
- package/api/entities/Asset/NonFungible/Nft.d.ts +13 -3
- package/api/entities/Asset/NonFungible/Nft.d.ts.map +1 -1
- package/api/entities/Asset/NonFungible/Nft.js +42 -9
- package/api/entities/Asset/NonFungible/Nft.js.map +1 -1
- package/api/entities/Asset/types.d.ts +11 -1
- package/api/entities/Asset/types.d.ts.map +1 -1
- package/api/entities/Asset/types.js.map +1 -1
- package/api/entities/Identity/Portfolios.d.ts +13 -1
- package/api/entities/Identity/Portfolios.d.ts.map +1 -1
- package/api/entities/Identity/Portfolios.js +31 -0
- package/api/entities/Identity/Portfolios.js.map +1 -1
- package/api/entities/Identity/index.d.ts +9 -1
- package/api/entities/Identity/index.d.ts.map +1 -1
- package/api/entities/Identity/index.js +32 -0
- package/api/entities/Identity/index.js.map +1 -1
- package/api/entities/Instruction/index.d.ts +22 -2
- package/api/entities/Instruction/index.d.ts.map +1 -1
- package/api/entities/Instruction/index.js +38 -0
- package/api/entities/Instruction/index.js.map +1 -1
- package/api/entities/Instruction/types.d.ts +8 -0
- package/api/entities/Instruction/types.d.ts.map +1 -1
- package/api/entities/Portfolio/index.d.ts.map +1 -1
- package/api/entities/Portfolio/index.js +6 -55
- package/api/entities/Portfolio/index.js.map +1 -1
- package/api/procedures/addAssetMediators.d.ts +22 -0
- package/api/procedures/addAssetMediators.d.ts.map +1 -0
- package/api/procedures/addAssetMediators.js +75 -0
- package/api/procedures/addAssetMediators.js.map +1 -0
- package/api/procedures/addInstruction.d.ts +4 -0
- package/api/procedures/addInstruction.d.ts.map +1 -1
- package/api/procedures/addInstruction.js +78 -15
- package/api/procedures/addInstruction.js.map +1 -1
- package/api/procedures/allowIdentityToCreatePortfolios.d.ts +18 -0
- package/api/procedures/allowIdentityToCreatePortfolios.d.ts.map +1 -0
- package/api/procedures/allowIdentityToCreatePortfolios.js +54 -0
- package/api/procedures/allowIdentityToCreatePortfolios.js.map +1 -0
- package/api/procedures/attestPrimaryKeyRotation.d.ts.map +1 -1
- package/api/procedures/attestPrimaryKeyRotation.js +9 -17
- package/api/procedures/attestPrimaryKeyRotation.js.map +1 -1
- package/api/procedures/createPortfolios.d.ts +12 -3
- package/api/procedures/createPortfolios.d.ts.map +1 -1
- package/api/procedures/createPortfolios.js +60 -21
- package/api/procedures/createPortfolios.js.map +1 -1
- package/api/procedures/executeManualInstruction.d.ts +11 -4
- package/api/procedures/executeManualInstruction.d.ts.map +1 -1
- package/api/procedures/executeManualInstruction.js +1 -1
- package/api/procedures/executeManualInstruction.js.map +1 -1
- package/api/procedures/inviteAccount.d.ts.map +1 -1
- package/api/procedures/inviteAccount.js +5 -11
- package/api/procedures/inviteAccount.js.map +1 -1
- package/api/procedures/modifyInstructionAffirmation.d.ts +3 -2
- package/api/procedures/modifyInstructionAffirmation.d.ts.map +1 -1
- package/api/procedures/modifyInstructionAffirmation.js +130 -38
- package/api/procedures/modifyInstructionAffirmation.js.map +1 -1
- package/api/procedures/registerIdentity.d.ts.map +1 -1
- package/api/procedures/registerIdentity.js +8 -0
- package/api/procedures/registerIdentity.js.map +1 -1
- package/api/procedures/removeAssetMediators.d.ts +22 -0
- package/api/procedures/removeAssetMediators.d.ts.map +1 -0
- package/api/procedures/removeAssetMediators.js +64 -0
- package/api/procedures/removeAssetMediators.js.map +1 -0
- package/api/procedures/revokeIdentityToCreatePortfolios.d.ts +18 -0
- package/api/procedures/revokeIdentityToCreatePortfolios.d.ts.map +1 -0
- package/api/procedures/revokeIdentityToCreatePortfolios.js +54 -0
- package/api/procedures/revokeIdentityToCreatePortfolios.js.map +1 -0
- package/api/procedures/setCustodian.d.ts.map +1 -1
- package/api/procedures/setCustodian.js +10 -15
- package/api/procedures/setCustodian.js.map +1 -1
- package/api/procedures/toggleTickerPreApproval.d.ts +22 -0
- package/api/procedures/toggleTickerPreApproval.d.ts.map +1 -0
- package/api/procedures/toggleTickerPreApproval.js +66 -0
- package/api/procedures/toggleTickerPreApproval.js.map +1 -0
- package/api/procedures/transferAssetOwnership.d.ts.map +1 -1
- package/api/procedures/transferAssetOwnership.js +14 -4
- package/api/procedures/transferAssetOwnership.js.map +1 -1
- package/api/procedures/transferTickerOwnership.d.ts.map +1 -1
- package/api/procedures/transferTickerOwnership.js +17 -7
- package/api/procedures/transferTickerOwnership.js.map +1 -1
- package/api/procedures/types.d.ts +22 -5
- package/api/procedures/types.d.ts.map +1 -1
- package/api/procedures/types.js +3 -0
- package/api/procedures/types.js.map +1 -1
- package/base/Procedure.d.ts.map +1 -1
- package/base/Procedure.js +2 -1
- package/base/Procedure.js.map +1 -1
- package/generated/types.d.ts +11 -3
- package/generated/types.d.ts.map +1 -1
- package/generated/types.js +8 -0
- package/generated/types.js.map +1 -1
- package/internal.d.ts +5 -0
- package/internal.d.ts.map +1 -1
- package/internal.js +11 -1
- package/internal.js.map +1 -1
- package/middleware/queries.d.ts +12 -0
- package/middleware/queries.d.ts.map +1 -1
- package/middleware/queries.js +125 -81
- package/middleware/queries.js.map +1 -1
- package/npm-package/polymeshassociation-polymesh-sdk-24.0.0-alpha.20.tgz +0 -0
- package/package.json +5 -5
- package/polkadot/augment-api-errors.d.ts +28 -0
- package/polkadot/augment-api-errors.d.ts.map +1 -1
- package/polkadot/augment-api-events.d.ts +38 -1
- package/polkadot/augment-api-events.d.ts.map +1 -1
- package/polkadot/augment-api-query.d.ts +22 -2
- package/polkadot/augment-api-query.d.ts.map +1 -1
- package/polkadot/augment-api-tx.d.ts +168 -18
- package/polkadot/augment-api-tx.d.ts.map +1 -1
- package/polkadot/lookup.d.ts +344 -285
- package/polkadot/lookup.d.ts.map +1 -1
- package/polkadot/lookup.js +357 -286
- package/polkadot/lookup.js.map +1 -1
- package/polkadot/polymesh/definitions.d.ts +3 -3
- package/polkadot/polymesh/definitions.js +3 -3
- package/polkadot/polymesh/definitions.js.map +1 -1
- package/polkadot/polymesh/types.d.ts +3 -3
- package/polkadot/polymesh/types.d.ts.map +1 -1
- package/polkadot/registry.d.ts +2 -1
- package/polkadot/registry.d.ts.map +1 -1
- package/polkadot/schema.d.ts +3 -3
- package/polkadot/schema.js +3 -3
- package/polkadot/schema.js.map +1 -1
- package/polkadot/types-lookup.d.ts +383 -294
- package/polkadot/types-lookup.d.ts.map +1 -1
- package/types/index.d.ts +5 -0
- package/types/index.d.ts.map +1 -1
- package/types/index.js.map +1 -1
- package/utils/constants.d.ts +6 -2
- package/utils/constants.d.ts.map +1 -1
- package/utils/constants.js +7 -3
- package/utils/constants.js.map +1 -1
- package/utils/conversion.d.ts +25 -3
- package/utils/conversion.d.ts.map +1 -1
- package/utils/conversion.js +103 -4
- package/utils/conversion.js.map +1 -1
- package/utils/internal.d.ts +15 -1
- package/utils/internal.d.ts.map +1 -1
- package/utils/internal.js +66 -1
- package/utils/internal.js.map +1 -1
- package/npm-package/polymeshassociation-polymesh-sdk-24.0.0-alpha.2.tgz +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.allowIdentityToCreatePortfolios = exports.prepareAllowIdentityToCreatePortfolios = void 0;
|
|
13
|
+
const internal_1 = require("../../internal");
|
|
14
|
+
const types_1 = require("../../types");
|
|
15
|
+
const conversion_1 = require("../../utils/conversion");
|
|
16
|
+
const internal_2 = require("../../utils/internal");
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
function prepareAllowIdentityToCreatePortfolios(args) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const { context: { polymeshApi: { tx: { portfolio: { allowIdentityToCreatePortfolios }, }, query, }, }, context, } = this;
|
|
23
|
+
const { did } = args;
|
|
24
|
+
const identity = (0, internal_2.asIdentity)(did, this.context);
|
|
25
|
+
yield (0, internal_2.assertIdentityExists)(identity);
|
|
26
|
+
const signingIdentity = yield this.context.getSigningIdentity();
|
|
27
|
+
const isInAllowedCustodians = yield query.portfolio.allowedCustodians(signingIdentity.did, identity.did);
|
|
28
|
+
if (isInAllowedCustodians.isTrue) {
|
|
29
|
+
throw new internal_1.PolymeshError({
|
|
30
|
+
code: types_1.ErrorCode.NoDataChange,
|
|
31
|
+
message: 'The provided Identity is already in the list of allowed custodians',
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const rawTrustedDid = (0, conversion_1.stringToIdentityId)(identity.did, context);
|
|
35
|
+
return {
|
|
36
|
+
transaction: allowIdentityToCreatePortfolios,
|
|
37
|
+
args: [rawTrustedDid],
|
|
38
|
+
resolver: undefined,
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
exports.prepareAllowIdentityToCreatePortfolios = prepareAllowIdentityToCreatePortfolios;
|
|
43
|
+
/**
|
|
44
|
+
* @hidden
|
|
45
|
+
*/
|
|
46
|
+
const allowIdentityToCreatePortfolios = () => new internal_1.Procedure(prepareAllowIdentityToCreatePortfolios, {
|
|
47
|
+
permissions: {
|
|
48
|
+
assets: [],
|
|
49
|
+
portfolios: [],
|
|
50
|
+
transactions: [types_1.TxTags.portfolio.AllowIdentityToCreatePortfolios],
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
exports.allowIdentityToCreatePortfolios = allowIdentityToCreatePortfolios;
|
|
54
|
+
//# sourceMappingURL=allowIdentityToCreatePortfolios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allowIdentityToCreatePortfolios.js","sourceRoot":"","sources":["../../../src/api/procedures/allowIdentityToCreatePortfolios.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAsD;AACtD,uCAAsD;AAEtD,uDAAwD;AACxD,mDAAoE;AASpE;;GAEG;AACH,SAAsB,sCAAsC,CAE1D,IAA2C;;QAE3C,MAAM,EACJ,OAAO,EAAE,EACP,WAAW,EAAE,EACX,EAAE,EAAE,EACF,SAAS,EAAE,EAAE,+BAA+B,EAAE,GAC/C,EACD,KAAK,GACN,GACF,EACD,OAAO,GACR,GAAG,IAAI,CAAC;QACT,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QAErB,MAAM,QAAQ,GAAG,IAAA,qBAAU,EAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAE/C,MAAM,IAAA,+BAAoB,EAAC,QAAQ,CAAC,CAAC;QAErC,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAEhE,MAAM,qBAAqB,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC,iBAAiB,CACnE,eAAe,CAAC,GAAG,EACnB,QAAQ,CAAC,GAAG,CACb,CAAC;QAEF,IAAI,qBAAqB,CAAC,MAAM,EAAE;YAChC,MAAM,IAAI,wBAAa,CAAC;gBACtB,IAAI,EAAE,iBAAS,CAAC,YAAY;gBAC5B,OAAO,EAAE,oEAAoE;aAC9E,CAAC,CAAC;SACJ;QAED,MAAM,aAAa,GAAG,IAAA,+BAAkB,EAAC,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAEhE,OAAO;YACL,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,CAAC,aAAa,CAAC;YACrB,QAAQ,EAAE,SAAS;SACpB,CAAC;IACJ,CAAC;CAAA;AA1CD,wFA0CC;AAED;;GAEG;AACI,MAAM,+BAA+B,GAAG,GAG7C,EAAE,CACF,IAAI,oBAAS,CAAC,sCAAsC,EAAE;IACpD,WAAW,EAAE;QACX,MAAM,EAAE,EAAE;QACV,UAAU,EAAE,EAAE;QACd,YAAY,EAAE,CAAC,cAAM,CAAC,SAAS,CAAC,+BAA+B,CAAC;KACjE;CACF,CAAC,CAAC;AAVQ,QAAA,+BAA+B,mCAUvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attestPrimaryKeyRotation.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/attestPrimaryKeyRotation.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"attestPrimaryKeyRotation.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/attestPrimaryKeyRotation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,uBAAmB;AACvC,OAAO,EACL,8BAA8B,EAE9B,oBAAoB,EAIrB,oBAAgB;AACjB,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,6BAAyB;AAQpE;;GAEG;AACH,wBAAsB,+BAA+B,CACnD,IAAI,EAAE,SAAS,CAAC,8BAA8B,EAAE,oBAAoB,CAAC,EACrE,IAAI,EAAE,8BAA8B,GACnC,OAAO,CAAC,eAAe,CAAC,oBAAoB,EAAE,eAAe,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAoDjG;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,QAAO,UAC1C,8BAA8B,EAC9B,oBAAoB,CASlB,CAAC"}
|
|
@@ -29,30 +29,22 @@ function prepareAttestPrimaryKeyRotation(args) {
|
|
|
29
29
|
type: types_1.AuthorizationType.AttestPrimaryKeyRotation,
|
|
30
30
|
includeExpired: false,
|
|
31
31
|
});
|
|
32
|
-
const
|
|
33
|
-
const { value } = authorizationRequest.data;
|
|
34
|
-
return value.did === targetIdentity.did;
|
|
35
|
-
});
|
|
36
|
-
if (pendingAuthorization) {
|
|
37
|
-
throw new internal_1.PolymeshError({
|
|
38
|
-
code: types_1.ErrorCode.NoDataChange,
|
|
39
|
-
message: 'The target Account already has a pending attestation to become the primary key of the target Identity',
|
|
40
|
-
data: {
|
|
41
|
-
pendingAuthorization,
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
const rawSignatory = (0, conversion_1.signerToSignatory)(target, context);
|
|
46
|
-
const authRequest = {
|
|
32
|
+
const authorization = {
|
|
47
33
|
type: types_1.AuthorizationType.AttestPrimaryKeyRotation,
|
|
48
34
|
value: targetIdentity,
|
|
49
35
|
};
|
|
50
|
-
|
|
36
|
+
(0, internal_2.assertNoPendingAuthorizationExists)({
|
|
37
|
+
authorizationRequests,
|
|
38
|
+
message: 'The target Account already has a pending attestation to become the primary key of the target Identity',
|
|
39
|
+
authorization,
|
|
40
|
+
});
|
|
41
|
+
const rawSignatory = (0, conversion_1.signerToSignatory)(target, context);
|
|
42
|
+
const rawAuthorizationData = (0, conversion_1.authorizationToAuthorizationData)(authorization, context);
|
|
51
43
|
const rawExpiry = (0, conversion_1.expiryToMoment)(expiry, context);
|
|
52
44
|
return {
|
|
53
45
|
transaction: addAuthorization,
|
|
54
46
|
args: [rawSignatory, rawAuthorizationData, rawExpiry],
|
|
55
|
-
resolver: (0, utils_1.createAuthorizationResolver)(
|
|
47
|
+
resolver: (0, utils_1.createAuthorizationResolver)(authorization, issuerIdentity, target, expiry !== null && expiry !== void 0 ? expiry : null, context),
|
|
56
48
|
};
|
|
57
49
|
});
|
|
58
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attestPrimaryKeyRotation.js","sourceRoot":"","sources":["../../../src/api/procedures/attestPrimaryKeyRotation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"attestPrimaryKeyRotation.js","sourceRoot":"","sources":["../../../src/api/procedures/attestPrimaryKeyRotation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAqE;AACrE,6CAAuC;AACvC,uCAOiB;AAEjB,uDAI4B;AAC5B,mDAA6F;AAE7F;;GAEG;AACH,SAAsB,+BAA+B,CAEnD,IAAoC;;QAEpC,MAAM,EACJ,OAAO,EAAE,EACP,WAAW,EAAE,EACX,EAAE,EAAE,EACF,QAAQ,EAAE,EAAE,gBAAgB,EAAE,GAC/B,GACF,GACF,EACD,OAAO,GACR,GAAG,IAAI,CAAC;QACT,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAEjD,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAE1D,MAAM,MAAM,GAAG,IAAA,oBAAS,EAAC,aAAa,EAA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AAC;KACjD;CACF,CAAC,CAAC;AAXQ,QAAA,wBAAwB,4BAWhC"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { ISubmittableResult } from '@polkadot/types/types';
|
|
2
2
|
import { Context, NumberedPortfolio, Procedure } from "../../internal";
|
|
3
|
-
import { BatchTransactionSpec,
|
|
3
|
+
import { BatchTransactionSpec, ProcedureAuthorization } from "../../types/internal";
|
|
4
|
+
declare type PortfolioParams = {
|
|
5
|
+
name: string;
|
|
6
|
+
ownerDid?: string;
|
|
7
|
+
};
|
|
4
8
|
/**
|
|
5
9
|
* @hidden
|
|
6
10
|
*/
|
|
7
11
|
export interface Params {
|
|
8
|
-
|
|
12
|
+
portfolios: PortfolioParams[];
|
|
9
13
|
}
|
|
10
14
|
/**
|
|
11
15
|
* @hidden
|
|
@@ -14,9 +18,14 @@ export declare const createPortfoliosResolver: (context: Context) => (receipt: I
|
|
|
14
18
|
/**
|
|
15
19
|
* @hidden
|
|
16
20
|
*/
|
|
17
|
-
export declare function prepareCreatePortfolios(this: Procedure<Params, NumberedPortfolio[]>, args: Params): Promise<BatchTransactionSpec<NumberedPortfolio[],
|
|
21
|
+
export declare function prepareCreatePortfolios(this: Procedure<Params, NumberedPortfolio[]>, args: Params): Promise<BatchTransactionSpec<NumberedPortfolio[], unknown[][]>>;
|
|
22
|
+
/**
|
|
23
|
+
* @hidden
|
|
24
|
+
*/
|
|
25
|
+
export declare function getAuthorization(this: Procedure<Params, NumberedPortfolio[]>, { portfolios }: Params): ProcedureAuthorization;
|
|
18
26
|
/**
|
|
19
27
|
* @hidden
|
|
20
28
|
*/
|
|
21
29
|
export declare const createPortfolios: () => Procedure<Params, NumberedPortfolio[]>;
|
|
30
|
+
export {};
|
|
22
31
|
//# sourceMappingURL=createPortfolios.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPortfolios.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/createPortfolios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAiB,SAAS,EAAE,uBAAmB;AAElF,OAAO,EAAE,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"createPortfolios.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/createPortfolios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAiB,SAAS,EAAE,uBAAmB;AAElF,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,6BAAyB;AAShF,aAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,UAAU,EAAE,eAAe,EAAE,CAAC;CAC/B;AACD;;GAEG;AACH,eAAO,MAAM,wBAAwB,YACzB,OAAO,eACP,kBAAkB,KAAG,iBAAiB,EAO/C,CAAC;AACJ;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,EAC5C,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,oBAAoB,CAAC,iBAAiB,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,CAuEjE;AACD;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,EAC5C,EAAE,UAAU,EAAE,EAAE,MAAM,GACrB,sBAAsB,CAexB;AACD;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAO,UAAU,MAAM,EAAE,iBAAiB,EAAE,CACf,CAAC"}
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.createPortfolios = exports.prepareCreatePortfolios = exports.createPortfoliosResolver = void 0;
|
|
12
|
+
exports.createPortfolios = exports.getAuthorization = exports.prepareCreatePortfolios = exports.createPortfoliosResolver = void 0;
|
|
13
13
|
const internal_1 = require("../../internal");
|
|
14
14
|
const types_1 = require("../../types");
|
|
15
15
|
const conversion_1 = require("../../utils/conversion");
|
|
@@ -32,16 +32,30 @@ exports.createPortfoliosResolver = createPortfoliosResolver;
|
|
|
32
32
|
function prepareCreatePortfolios(args) {
|
|
33
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
34
|
const { context: { polymeshApi: { tx }, }, context, } = this;
|
|
35
|
-
const {
|
|
35
|
+
const { portfolios: portfoliosToCreate } = args;
|
|
36
36
|
const { did } = yield context.getSigningIdentity();
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
portfolioIds.forEach((id, index) => {
|
|
42
|
-
if (id) {
|
|
43
|
-
existingNames.push(portfolioNames[index]);
|
|
37
|
+
const groupedPortfolioNamesByIdentity = portfoliosToCreate.reduce((acc, { name, ownerDid }) => {
|
|
38
|
+
const owner = ownerDid !== null && ownerDid !== void 0 ? ownerDid : did;
|
|
39
|
+
if (!acc[owner]) {
|
|
40
|
+
acc[owner] = [];
|
|
44
41
|
}
|
|
42
|
+
acc[owner].push(name);
|
|
43
|
+
return acc;
|
|
44
|
+
}, {});
|
|
45
|
+
const dids = Object.keys(groupedPortfolioNamesByIdentity);
|
|
46
|
+
const portfolioIdCalls = dids.map(identityId => {
|
|
47
|
+
const rawNames = groupedPortfolioNamesByIdentity[identityId].map(name => (0, conversion_1.stringToBytes)(name, context));
|
|
48
|
+
const rawIdentityId = (0, conversion_1.stringToIdentityId)(identityId, context);
|
|
49
|
+
return (0, internal_2.getPortfolioIdsByName)(rawIdentityId, rawNames, context);
|
|
50
|
+
});
|
|
51
|
+
const foundPortfoliosByDid = yield Promise.all(portfolioIdCalls);
|
|
52
|
+
const existingNames = [];
|
|
53
|
+
foundPortfoliosByDid.forEach((portfolios, index) => {
|
|
54
|
+
portfolios.forEach(id => {
|
|
55
|
+
if (id) {
|
|
56
|
+
existingNames.push(groupedPortfolioNamesByIdentity[dids[index]][id.toNumber()]);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
45
59
|
});
|
|
46
60
|
if (existingNames.length) {
|
|
47
61
|
throw new internal_1.PolymeshError({
|
|
@@ -52,12 +66,23 @@ function prepareCreatePortfolios(args) {
|
|
|
52
66
|
},
|
|
53
67
|
});
|
|
54
68
|
}
|
|
55
|
-
const
|
|
69
|
+
const transactions = [];
|
|
70
|
+
portfoliosToCreate.forEach(({ name, ownerDid }) => {
|
|
71
|
+
if (ownerDid) {
|
|
72
|
+
transactions.push((0, internal_2.checkTxType)({
|
|
73
|
+
transaction: tx.portfolio.createCustodyPortfolio,
|
|
74
|
+
args: [(0, conversion_1.stringToIdentityId)(ownerDid, context), (0, conversion_1.stringToBytes)(name, context)],
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
transactions.push((0, internal_2.checkTxType)({
|
|
79
|
+
transaction: tx.portfolio.createPortfolio,
|
|
80
|
+
args: [(0, conversion_1.stringToBytes)(name, context)],
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
});
|
|
56
84
|
return {
|
|
57
|
-
transactions
|
|
58
|
-
transaction,
|
|
59
|
-
args: [name],
|
|
60
|
-
})),
|
|
85
|
+
transactions,
|
|
61
86
|
resolver: (0, exports.createPortfoliosResolver)(context),
|
|
62
87
|
};
|
|
63
88
|
});
|
|
@@ -66,12 +91,26 @@ exports.prepareCreatePortfolios = prepareCreatePortfolios;
|
|
|
66
91
|
/**
|
|
67
92
|
* @hidden
|
|
68
93
|
*/
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
94
|
+
function getAuthorization({ portfolios }) {
|
|
95
|
+
const transactions = [];
|
|
96
|
+
if (portfolios.some(({ ownerDid }) => ownerDid)) {
|
|
97
|
+
transactions.push(types_1.TxTags.portfolio.CreateCustodyPortfolio);
|
|
98
|
+
}
|
|
99
|
+
if (portfolios.some(({ ownerDid }) => !ownerDid)) {
|
|
100
|
+
transactions.push(types_1.TxTags.portfolio.CreatePortfolio);
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
permissions: {
|
|
104
|
+
transactions,
|
|
105
|
+
assets: [],
|
|
106
|
+
portfolios: [],
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
exports.getAuthorization = getAuthorization;
|
|
111
|
+
/**
|
|
112
|
+
* @hidden
|
|
113
|
+
*/
|
|
114
|
+
const createPortfolios = () => new internal_1.Procedure(prepareCreatePortfolios, getAuthorization);
|
|
76
115
|
exports.createPortfolios = createPortfolios;
|
|
77
116
|
//# sourceMappingURL=createPortfolios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPortfolios.js","sourceRoot":"","sources":["../../../src/api/procedures/createPortfolios.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,6CAAkF;AAClF,uCAA4C;AAE5C,uDAK4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"createPortfolios.js","sourceRoot":"","sources":["../../../src/api/procedures/createPortfolios.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,6CAAkF;AAClF,uCAA4C;AAE5C,uDAK4B;AAC5B,mDAA0F;AAa1F;;GAEG;AACI,MAAM,wBAAwB,GACnC,CAAC,OAAgB,EAAE,EAAE,CACrB,CAAC,OAA2B,EAAuB,EAAE;IACnD,MAAM,OAAO,GAAG,IAAA,6BAAkB,EAAC,OAAO,EAAE,WAAW,EAAE,kBAAkB,CAAC,CAAC;IAC7E,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,E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ure } from "../../internal";
|
|
2
3
|
import { DefaultPortfolio, ExecuteManualInstructionParams, InstructionDetails, NumberedPortfolio } from "../../types";
|
|
3
4
|
import { ExtrinsicParams, ProcedureAuthorization, TransactionSpec } from "../../types/internal";
|
|
@@ -9,17 +10,23 @@ export interface Storage {
|
|
|
9
10
|
/**
|
|
10
11
|
* @hidden
|
|
11
12
|
*/
|
|
12
|
-
export declare
|
|
13
|
+
export declare type Params = ExecuteManualInstructionParams & {
|
|
14
|
+
id: BigNumber;
|
|
15
|
+
};
|
|
13
16
|
/**
|
|
14
17
|
* @hidden
|
|
15
18
|
*/
|
|
16
|
-
export declare function
|
|
19
|
+
export declare function prepareExecuteManualInstruction(this: Procedure<Params, Instruction, Storage>, args: Params): Promise<TransactionSpec<Instruction, ExtrinsicParams<'settlementTx', 'executeManualInstruction'>>>;
|
|
17
20
|
/**
|
|
18
21
|
* @hidden
|
|
19
22
|
*/
|
|
20
|
-
export declare function
|
|
23
|
+
export declare function getAuthorization(this: Procedure<Params, Instruction, Storage>): Promise<ProcedureAuthorization>;
|
|
21
24
|
/**
|
|
22
25
|
* @hidden
|
|
23
26
|
*/
|
|
24
|
-
export declare
|
|
27
|
+
export declare function prepareStorage(this: Procedure<Params, Instruction, Storage>, { id }: Params): Promise<Storage>;
|
|
28
|
+
/**
|
|
29
|
+
* @hidden
|
|
30
|
+
*/
|
|
31
|
+
export declare const executeManualInstruction: () => Procedure<Params, Instruction, Storage>;
|
|
25
32
|
//# sourceMappingURL=executeManualInstruction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeManualInstruction.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/executeManualInstruction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"executeManualInstruction.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/executeManualInstruction.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,cAAc,CAAC;AAIrC,OAAO,EAAE,WAAW,EAAiB,SAAS,EAAE,uBAAmB;AACnE,OAAO,EACL,gBAAgB,EAEhB,8BAA8B,EAC9B,kBAAkB,EAElB,iBAAiB,EAElB,oBAAgB;AACjB,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,eAAe,EAAE,6BAAyB;AAQ5F,MAAM,WAAW,OAAO;IACtB,UAAU,EAAE,CAAC,gBAAgB,GAAG,iBAAiB,CAAC,EAAE,CAAC;IACrD,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,oBAAY,MAAM,GAAG,8BAA8B,GAAG;IACpD,EAAE,EAAE,SAAS,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,wBAAsB,+BAA+B,CACnD,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,EAC7C,IAAI,EAAE,MAAM,GACX,OAAO,CACR,eAAe,CAAC,WAAW,EAAE,eAAe,CAAC,cAAc,EAAE,0BAA0B,CAAC,CAAC,CAC1F,CAiEA;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,GAC5C,OAAO,CAAC,sBAAsB,CAAC,CAYjC;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,EAC7C,EAAE,EAAE,EAAE,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,CAAC,CAuClB;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,QAAO,UAAU,MAAM,EAAE,WAAW,EAAE,OAAO,CACA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeManualInstruction.js","sourceRoot":"","sources":["../../../src/api/procedures/executeManualInstruction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"executeManualInstruction.js","sourceRoot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BAC8C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inviteAccount.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/inviteAccount.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAiB,SAAS,EAAE,uBAAmB;AAC5E,OAAO,EAIL,mBAAmB,EAKpB,oBAAgB;AACjB,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,6BAAyB;AAUpE;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,SAAS,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,EAC1D,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,eAAe,CAAC,oBAAoB,EAAE,eAAe,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"inviteAccount.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/inviteAccount.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAiB,SAAS,EAAE,uBAAmB;AAC5E,OAAO,EAIL,mBAAmB,EAKpB,oBAAgB;AACjB,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,6BAAyB;AAUpE;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,SAAS,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,EAC1D,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,eAAe,CAAC,oBAAoB,EAAE,eAAe,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC,CAAC,CA+DjG;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,QAAO,UAAU,mBAAmB,EAAE,oBAAoB,CAOhF,CAAC"}
|
|
@@ -35,18 +35,12 @@ function prepareInviteAccount(args) {
|
|
|
35
35
|
message: 'The target Account is already part of an Identity',
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
(0, internal_2.assertNoPendingAuthorizationExists)({
|
|
39
|
+
authorizationRequests: authorizationRequests.data,
|
|
40
|
+
target: address,
|
|
41
|
+
message: 'The target Account already has a pending invitation to join this Identity',
|
|
42
|
+
authorization: { type: types_1.AuthorizationType.JoinIdentity },
|
|
43
43
|
});
|
|
44
|
-
if (hasPendingAuth) {
|
|
45
|
-
throw new internal_1.PolymeshError({
|
|
46
|
-
code: types_1.ErrorCode.NoDataChange,
|
|
47
|
-
message: 'The target Account already has a pending invitation to join this Identity',
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
44
|
const rawSignatory = (0, conversion_1.signerValueToSignatory)({ type: types_1.SignerType.Account, value: address }, context);
|
|
51
45
|
let authorizationValue = {
|
|
52
46
|
assets: { type: types_1.PermissionType.Include, values: [] },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inviteAccount.js","sourceRoot":"","sources":["../../../src/api/procedures/inviteAccount.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAqE;AACrE,6CAA4E;AAC5E,uCASiB;AAEjB,uDAM4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"inviteAccount.js","sourceRoot":"","sources":["../../../src/api/procedures/inviteAccount.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAqE;AACrE,6CAA4E;AAC5E,uCASiB;AAEjB,uDAM4B;AAC5B,mDAA4F;AAE5F;;GAEG;AACH,SAAsB,oBAAoB,CAExC,IAAyB;;QAEzB,MAAM,EACJ,OAAO,EAAE,EACP,WAAW,EAAE,EAAE,EAAE,EAAE,GACpB,EACD,OAAO,GACR,GAAG,IAAI,CAAC;QAET,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;QAE5E,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAEpD,MAAM,OAAO,GAAG,IAAA,2BAAc,EAAC,aAAa,CAAC,CAAC;QA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AAE,kBAAkB;SAC1B,CAAC;QACF,MAAM,oBAAoB,GAAG,IAAA,6CAAgC,EAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QACpF,MAAM,SAAS,GAAG,IAAA,oBAAS,EAAC,yBAAY,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAE3D,OAAO;YACL,WAAW,EAAE,EAAE,CAAC,QAAQ,CAAC,gBAAgB;YACzC,IAAI,EAAE,CAAC,YAAY,EAAE,oBAAoB,EAAE,SAAS,CAAC;YACrD,QAAQ,EAAE,IAAA,mCAA2B,EAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC;SACvF,CAAC;IACJ,CAAC;CAAA;AAlED,oDAkEC;AAED;;GAEG;AACI,MAAM,aAAa,GAAG,GAAyD,EAAE,CACtF,IAAI,oBAAS,CAAC,oBAAoB,EAAE;IAClC,WAAW,EAAE;QACX,YAAY,EAAE,CAAC,cAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QAChD,MAAM,EAAE,EAAE;QACV,UAAU,EAAE,EAAE;KACf;CACF,CAAC,CAAC;AAPQ,QAAA,aAAa,iBAOrB"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
2
|
import { Instruction, Procedure } from "../../internal";
|
|
3
|
-
import { DefaultPortfolio, ModifyInstructionAffirmationParams, NumberedPortfolio, PortfolioLike } from "../../types";
|
|
3
|
+
import { DefaultPortfolio, Identity, ModifyInstructionAffirmationParams, NumberedPortfolio, PortfolioLike } from "../../types";
|
|
4
4
|
import { ExtrinsicParams, ProcedureAuthorization, TransactionSpec } from "../../types/internal";
|
|
5
5
|
export interface Storage {
|
|
6
6
|
portfolios: (DefaultPortfolio | NumberedPortfolio)[];
|
|
7
7
|
portfolioParams: PortfolioLike[];
|
|
8
8
|
senderLegAmount: BigNumber;
|
|
9
9
|
totalLegAmount: BigNumber;
|
|
10
|
+
signer: Identity;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
13
|
* @hidden
|
|
13
14
|
*/
|
|
14
|
-
export declare function prepareModifyInstructionAffirmation(this: Procedure<ModifyInstructionAffirmationParams, Instruction, Storage>, args: ModifyInstructionAffirmationParams): Promise<TransactionSpec<Instruction, ExtrinsicParams<'settlementTx', '
|
|
15
|
+
export declare function prepareModifyInstructionAffirmation(this: Procedure<ModifyInstructionAffirmationParams, Instruction, Storage>, args: ModifyInstructionAffirmationParams): Promise<TransactionSpec<Instruction, ExtrinsicParams<'settlementTx', 'affirmInstructionWithCount'>> | TransactionSpec<Instruction, ExtrinsicParams<'settlementTx', 'withdrawAffirmationWithCount'>> | TransactionSpec<Instruction, ExtrinsicParams<'settlementTx', 'rejectInstructionWithCount'>> | TransactionSpec<Instruction, ExtrinsicParams<'settlementTx', 'affirmInstructionAsMediator'>> | TransactionSpec<Instruction, ExtrinsicParams<'settlementTx', 'withdrawAffirmationAsMediator'>> | TransactionSpec<Instruction, ExtrinsicParams<'settlementTx', 'rejectInstructionAsMediator'>>>;
|
|
15
16
|
/**
|
|
16
17
|
* @hidden
|
|
17
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modifyInstructionAffirmation.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/modifyInstructionAffirmation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"modifyInstructionAffirmation.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/modifyInstructionAffirmation.ts"],"names":[],"mappings":"AAMA,OAAO,SAAS,MAAM,cAAc,CAAC;AAIrC,OAAO,EAAW,WAAW,EAAiB,SAAS,EAAE,uBAAmB;AAE5E,OAAO,EAEL,gBAAgB,EAEhB,QAAQ,EAGR,kCAAkC,EAClC,iBAAiB,EAEjB,aAAa,EAGd,oBAAgB;AACjB,OAAO,EACL,eAAe,EAEf,sBAAsB,EACtB,eAAe,EAChB,6BAAyB;AAkC1B,MAAM,WAAW,OAAO;IACtB,UA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