@polymeshassociation/polymesh-sdk 24.0.0-alpha.2 → 24.0.0-alpha.21
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 -4
- package/README.md +8 -12
- package/api/client/Claims.js +1 -1
- package/api/client/Claims.js.map +1 -1
- 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.21.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
|
@@ -20,73 +20,149 @@ const internal_1 = require("../../internal");
|
|
|
20
20
|
const types_1 = require("../../types");
|
|
21
21
|
const utils_2 = require("../../types/utils");
|
|
22
22
|
const conversion_1 = require("../../utils/conversion");
|
|
23
|
+
const internal_2 = require("../../utils/internal");
|
|
24
|
+
/**
|
|
25
|
+
* @hidden
|
|
26
|
+
*/
|
|
27
|
+
const getAssetCount = (rawId, context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
+
const { polymeshApi: { rpc }, } = context;
|
|
29
|
+
const { fungibleTokens: fungible, nonFungibleTokens: nonFungible, offChainAssets: offChain, } = yield rpc.settlement.getExecuteInstructionInfo(rawId);
|
|
30
|
+
return (0, conversion_1.assetCountToRaw)({ fungible, nonFungible, offChain }, context);
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* @hidden
|
|
34
|
+
*/
|
|
35
|
+
const assertPortfoliosValid = (portfolioParams, portfolios, operation) => {
|
|
36
|
+
if (operation === types_1.InstructionAffirmationOperation.AffirmAsMediator ||
|
|
37
|
+
operation === types_1.InstructionAffirmationOperation.RejectAsMediator ||
|
|
38
|
+
operation === types_1.InstructionAffirmationOperation.WithdrawAsMediator) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (portfolioParams.length && portfolioParams.length !== portfolios.length) {
|
|
42
|
+
throw new internal_1.PolymeshError({
|
|
43
|
+
code: types_1.ErrorCode.UnmetPrerequisite,
|
|
44
|
+
message: 'Some of the portfolios are not a involved in this instruction',
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (!portfolios.length) {
|
|
48
|
+
throw new internal_1.PolymeshError({
|
|
49
|
+
code: types_1.ErrorCode.UnmetPrerequisite,
|
|
50
|
+
message: 'The signing Identity is not involved in this Instruction',
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
};
|
|
23
54
|
/**
|
|
24
55
|
* @hidden
|
|
25
56
|
*/
|
|
26
57
|
function prepareModifyInstructionAffirmation(args) {
|
|
27
58
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
const { context: { polymeshApi: { tx: { settlement: settlementTx }, query: { settlement }, }, }, context, storage: { portfolios, portfolioParams, senderLegAmount, totalLegAmount }, } = this;
|
|
59
|
+
const { context: { polymeshApi: { tx: { settlement: settlementTx }, query: { settlement }, rpc, }, }, context, storage: { portfolios, portfolioParams, senderLegAmount, totalLegAmount, signer }, } = this;
|
|
29
60
|
const { operation, id } = args;
|
|
30
61
|
const instruction = new internal_1.Instruction({ id }, context);
|
|
31
|
-
yield (0, utils_1.assertInstructionValid)(instruction, context);
|
|
32
|
-
|
|
33
|
-
throw new internal_1.PolymeshError({
|
|
34
|
-
code: types_1.ErrorCode.UnmetPrerequisite,
|
|
35
|
-
message: 'Some of the portfolios are not a involved in this instruction',
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
if (!portfolios.length) {
|
|
39
|
-
throw new internal_1.PolymeshError({
|
|
40
|
-
code: types_1.ErrorCode.UnmetPrerequisite,
|
|
41
|
-
message: 'The signing Identity is not involved in this Instruction',
|
|
42
|
-
});
|
|
43
|
-
}
|
|
62
|
+
yield Promise.all([(0, utils_1.assertInstructionValid)(instruction, context)]);
|
|
63
|
+
assertPortfoliosValid(portfolioParams, portfolios, operation);
|
|
44
64
|
const rawInstructionId = (0, conversion_1.bigNumberToU64)(id, context);
|
|
45
65
|
const rawPortfolioIds = portfolios.map(portfolio => (0, conversion_1.portfolioIdToMeshPortfolioId)((0, conversion_1.portfolioLikeToPortfolioId)(portfolio), context));
|
|
66
|
+
const rawDid = (0, conversion_1.stringToIdentityId)(signer.did, context);
|
|
67
|
+
const multiArgs = rawPortfolioIds.map(portfolioId => (0, utils_2.tuple)(portfolioId, rawInstructionId));
|
|
68
|
+
const [rawAffirmationStatuses, rawMediatorAffirmation] = yield Promise.all([
|
|
69
|
+
settlement.userAffirmations.multi(multiArgs),
|
|
70
|
+
settlement.instructionMediatorsAffirmations(rawInstructionId, rawDid),
|
|
71
|
+
]);
|
|
72
|
+
const affirmationStatuses = rawAffirmationStatuses.map(conversion_1.meshAffirmationStatusToAffirmationStatus);
|
|
73
|
+
const { status: mediatorStatus, expiry } = (0, conversion_1.mediatorAffirmationStatusToStatus)(rawMediatorAffirmation);
|
|
46
74
|
const excludeCriteria = [];
|
|
47
75
|
let errorMessage;
|
|
48
76
|
let transaction = null;
|
|
49
77
|
switch (operation) {
|
|
78
|
+
case types_1.InstructionAffirmationOperation.AffirmAsMediator: {
|
|
79
|
+
if (mediatorStatus === types_1.AffirmationStatus.Unknown) {
|
|
80
|
+
throw new internal_1.PolymeshError({
|
|
81
|
+
code: types_1.ErrorCode.ValidationError,
|
|
82
|
+
message: 'The signer is not a mediator',
|
|
83
|
+
data: { signer: signer.did, instructionId: id.toString() },
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
const givenExpiry = args.expiry;
|
|
87
|
+
const now = new Date();
|
|
88
|
+
if (givenExpiry && givenExpiry < now) {
|
|
89
|
+
throw new internal_1.PolymeshError({
|
|
90
|
+
code: types_1.ErrorCode.ValidationError,
|
|
91
|
+
message: 'The expiry must be in the future',
|
|
92
|
+
data: { expiry, now },
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
const rawExpiry = (0, internal_2.optionize)(conversion_1.dateToMoment)(givenExpiry, context);
|
|
96
|
+
return {
|
|
97
|
+
transaction: settlementTx.affirmInstructionAsMediator,
|
|
98
|
+
resolver: instruction,
|
|
99
|
+
args: [rawInstructionId, rawExpiry],
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
case types_1.InstructionAffirmationOperation.WithdrawAsMediator: {
|
|
103
|
+
if (mediatorStatus !== types_1.AffirmationStatus.Affirmed) {
|
|
104
|
+
throw new internal_1.PolymeshError({
|
|
105
|
+
code: types_1.ErrorCode.ValidationError,
|
|
106
|
+
message: 'The signer is not a mediator that has already affirmed the instruction',
|
|
107
|
+
data: { signer: signer.did, instructionId: id.toString() },
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
transaction: settlementTx.withdrawAffirmationAsMediator,
|
|
112
|
+
resolver: instruction,
|
|
113
|
+
args: [rawInstructionId],
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
case types_1.InstructionAffirmationOperation.RejectAsMediator: {
|
|
117
|
+
if (mediatorStatus === types_1.AffirmationStatus.Unknown) {
|
|
118
|
+
throw new internal_1.PolymeshError({
|
|
119
|
+
code: types_1.ErrorCode.ValidationError,
|
|
120
|
+
message: 'The signer is not a mediator for the instruction',
|
|
121
|
+
data: { did: signer.did, instructionId: id.toString() },
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
const rawAssetCount = yield getAssetCount(rawInstructionId, context);
|
|
125
|
+
return {
|
|
126
|
+
transaction: settlementTx.rejectInstructionAsMediator,
|
|
127
|
+
resolver: instruction,
|
|
128
|
+
args: [rawInstructionId, rawAssetCount],
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
case types_1.InstructionAffirmationOperation.Reject: {
|
|
132
|
+
const rawAssetCount = yield getAssetCount(rawInstructionId, context);
|
|
133
|
+
return {
|
|
134
|
+
transaction: settlementTx.rejectInstructionWithCount,
|
|
135
|
+
resolver: instruction,
|
|
136
|
+
feeMultiplier: totalLegAmount,
|
|
137
|
+
args: [rawInstructionId, rawPortfolioIds[0], rawAssetCount],
|
|
138
|
+
};
|
|
139
|
+
}
|
|
50
140
|
case types_1.InstructionAffirmationOperation.Affirm: {
|
|
51
141
|
excludeCriteria.push(types_1.AffirmationStatus.Affirmed);
|
|
52
142
|
errorMessage = 'The Instruction is already affirmed';
|
|
53
|
-
transaction = settlementTx.
|
|
143
|
+
transaction = settlementTx.affirmInstructionWithCount;
|
|
54
144
|
break;
|
|
55
145
|
}
|
|
56
146
|
case types_1.InstructionAffirmationOperation.Withdraw: {
|
|
57
147
|
excludeCriteria.push(types_1.AffirmationStatus.Pending);
|
|
58
148
|
errorMessage = 'The instruction is not affirmed';
|
|
59
|
-
transaction = settlementTx.
|
|
149
|
+
transaction = settlementTx.withdrawAffirmationWithCount;
|
|
60
150
|
break;
|
|
61
151
|
}
|
|
62
152
|
}
|
|
63
|
-
const multiArgs = rawPortfolioIds.map(portfolioId => (0, utils_2.tuple)(portfolioId, rawInstructionId));
|
|
64
|
-
const rawAffirmationStatuses = yield settlement.userAffirmations.multi(multiArgs);
|
|
65
|
-
const affirmationStatuses = rawAffirmationStatuses.map(conversion_1.meshAffirmationStatusToAffirmationStatus);
|
|
66
153
|
const validPortfolioIds = rawPortfolioIds.filter((_, index) => !excludeCriteria.includes(affirmationStatuses[index]));
|
|
67
154
|
if (!validPortfolioIds.length) {
|
|
68
155
|
throw new internal_1.PolymeshError({
|
|
69
156
|
code: types_1.ErrorCode.NoDataChange,
|
|
70
|
-
// As InstructionAffirmationOperation.Reject has no excludeCriteria, if this error is thrown
|
|
71
|
-
// it means that the operation had to be either affirm or withdraw, and so the errorMessage was set
|
|
72
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
73
157
|
message: errorMessage,
|
|
74
158
|
});
|
|
75
159
|
}
|
|
76
|
-
|
|
77
|
-
if (transaction) {
|
|
78
|
-
return {
|
|
79
|
-
transaction,
|
|
80
|
-
resolver: instruction,
|
|
81
|
-
feeMultiplier: senderLegAmount,
|
|
82
|
-
args: [rawInstructionId, validPortfolioIds],
|
|
83
|
-
};
|
|
84
|
-
}
|
|
160
|
+
const rawAffirmCount = yield rpc.settlement.getAffirmationCount(rawInstructionId, rawPortfolioIds);
|
|
85
161
|
return {
|
|
86
|
-
transaction
|
|
162
|
+
transaction,
|
|
87
163
|
resolver: instruction,
|
|
88
|
-
feeMultiplier:
|
|
89
|
-
args: [rawInstructionId, validPortfolioIds
|
|
164
|
+
feeMultiplier: senderLegAmount,
|
|
165
|
+
args: [rawInstructionId, validPortfolioIds, rawAffirmCount],
|
|
90
166
|
};
|
|
91
167
|
});
|
|
92
168
|
}
|
|
@@ -111,6 +187,18 @@ function getAuthorization({ operation }) {
|
|
|
111
187
|
transactions = [types_1.TxTags.settlement.RejectInstruction];
|
|
112
188
|
break;
|
|
113
189
|
}
|
|
190
|
+
case types_1.InstructionAffirmationOperation.AffirmAsMediator: {
|
|
191
|
+
transactions = [types_1.TxTags.settlement.AffirmInstructionAsMediator];
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
case types_1.InstructionAffirmationOperation.WithdrawAsMediator: {
|
|
195
|
+
transactions = [types_1.TxTags.settlement.WithdrawAffirmationAsMediator];
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
case types_1.InstructionAffirmationOperation.RejectAsMediator: {
|
|
199
|
+
transactions = [types_1.TxTags.settlement.RejectInstructionAsMediator];
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
114
202
|
}
|
|
115
203
|
return {
|
|
116
204
|
permissions: {
|
|
@@ -134,7 +222,8 @@ function extractPortfolioParams(params) {
|
|
|
134
222
|
portfolioParams.push(portfolio);
|
|
135
223
|
}
|
|
136
224
|
}
|
|
137
|
-
else
|
|
225
|
+
else if (operation === types_1.InstructionAffirmationOperation.Affirm ||
|
|
226
|
+
operation === types_1.InstructionAffirmationOperation.Withdraw) {
|
|
138
227
|
const { portfolios } = params;
|
|
139
228
|
if (portfolios) {
|
|
140
229
|
portfolioParams = [...portfolioParams, ...portfolios];
|
|
@@ -188,21 +277,24 @@ const assemblePortfolios = (result, from, to, signingDid, portfolioIdParams) =>
|
|
|
188
277
|
*/
|
|
189
278
|
function prepareStorage(params) {
|
|
190
279
|
return __awaiter(this, void 0, void 0, function* () {
|
|
191
|
-
const { context } = this;
|
|
280
|
+
const { context, context: { polymeshApi }, } = this;
|
|
192
281
|
const { id } = params;
|
|
282
|
+
const rawId = (0, conversion_1.bigNumberToU64)(id, context);
|
|
193
283
|
const portfolioParams = extractPortfolioParams(params);
|
|
194
284
|
const portfolioIdParams = portfolioParams.map(conversion_1.portfolioLikeToPortfolioId);
|
|
195
285
|
const instruction = new internal_1.Instruction({ id }, context);
|
|
196
|
-
const [{ data: legs },
|
|
286
|
+
const [{ data: legs }, signer] = yield Promise.all([
|
|
197
287
|
instruction.getLegs(),
|
|
198
288
|
context.getSigningIdentity(),
|
|
289
|
+
polymeshApi.rpc.settlement.getExecuteInstructionInfo(rawId),
|
|
199
290
|
]);
|
|
200
|
-
const [portfolios, senderLegAmount] = yield bluebird_1.default.reduce(legs, (result, { from, to }) => __awaiter(this, void 0, void 0, function* () { return assemblePortfolios(result, from, to,
|
|
291
|
+
const [portfolios, senderLegAmount] = yield bluebird_1.default.reduce(legs, (result, { from, to }) => __awaiter(this, void 0, void 0, function* () { return assemblePortfolios(result, from, to, signer.did, portfolioIdParams); }), [[], new bignumber_js_1.default(0)]);
|
|
201
292
|
return {
|
|
202
293
|
portfolios,
|
|
203
294
|
portfolioParams,
|
|
204
295
|
senderLegAmount,
|
|
205
296
|
totalLegAmount: new bignumber_js_1.default(legs.length),
|
|
297
|
+
signer,
|
|
206
298
|
};
|
|
207
299
|
});
|
|
208
300
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modifyInstructionAffirmation.js","sourceRoot":"","sources":["../../../src/api/procedures/modifyInstructionAffirmation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"modifyInstructionAffirmation.js","sourceRoot":"","sources":["../../../src/api/procedures/modifyInstructionAffirmation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAMA,gEAAqC;AACrC,wDAAyB;AAEzB,mCAAgE;AAChE,6CAA4E;AAE5E,uCAaiB;AAOjB,6CAAsC;AACtC,uDAS4B;AAC5B,mDAA6C;AAE7C;;GAEG;AACH,MAAM,aAAa,GAAG,CACpB,KAAU,EACV,OAAgB,EACiC,EAAE;IACn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
1
|
+
{"version":3,"file":"registerIdentity.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/registerIdentity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAW,OAAO,EAAE,QAAQ,EAAiB,SAAS,EAAE,uBAAmB;AAClF,OAAO,EAAa,sBAAsB,EAAoB,oBAAgB;AAC9E,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,6BAAyB;AAWpE;;GAEG;AACH,eAAO,MAAM,8BAA8B,YAC/B,OAAO,eACP,kBAAkB,KAAG,QAK9B,CAAC;AAEJ;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,SAAS,CAAC,sBAAsB,EAAE,QAAQ,CAAC,EACjD,IAAI,EAAE,sBAAsB,GAC3B,OAAO,CACN,eAAe,CAAC,QAAQ,EAAE,eAAe,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC,GACxE,eAAe,CAAC,QAAQ,EAAE,eAAe,CAAC,UAAU,EAAE,uBAAuB,CAAC,CAAC,CAClF,CAmDA;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAO,UAAU,sBAAsB,EAAE,QAAQ,CAQ1E,CAAC"}
|
|
@@ -41,6 +41,14 @@ function prepareRegisterIdentity(args) {
|
|
|
41
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
42
|
const { context: { polymeshApi: { tx: { identity }, }, }, context, } = this;
|
|
43
43
|
const { targetAccount, secondaryAccounts = [], createCdd = false, expiry } = args;
|
|
44
|
+
const account = new internal_1.Account({ address: targetAccount.toString() }, context);
|
|
45
|
+
const identityExists = yield account.getIdentity();
|
|
46
|
+
if (identityExists) {
|
|
47
|
+
throw new internal_1.PolymeshError({
|
|
48
|
+
code: types_1.ErrorCode.NoDataChange,
|
|
49
|
+
message: 'The target account already has an identity',
|
|
50
|
+
});
|
|
51
|
+
}
|
|
44
52
|
const rawTargetAccount = (0, conversion_1.stringToAccountId)((0, conversion_1.signerToString)(targetAccount), context);
|
|
45
53
|
const rawSecondaryKeys = secondaryAccounts.map((_a) => {
|
|
46
54
|
var { permissions } = _a, rest = __rest(_a, ["permissions"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerIdentity.js","sourceRoot":"","sources":["../../../src/api/procedures/registerIdentity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA,
|
|
1
|
+
{"version":3,"file":"registerIdentity.js","sourceRoot":"","sources":["../../../src/api/procedures/registerIdentity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA,6CAAkF;AAClF,uCAA8E;AAE9E,uDAO4B;AAC5B,mDAAiE;AAEjE;;GAEG;AACI,MAAM,8BAA8B,GACzC,CAAC,OAAgB,EAAE,EAAE,CACrB,CAAC,OAA2B,EAAY,EAAE;IACxC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAA,6BAAkB,EAAC,OAAO,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;IACzE,MAAM,GAAG,GAAG,IAAA,+BAAkB,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAExC,OAAO,IAAI,mBAAQ,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC,CAAC;AAPS,QAAA,8BAA8B,kCAOvC;AAEJ;;GAEG;AACH,SAAsB,uBAAuB,CAE3C,IAA4B;;QAK5B,MAAM,EACJ,OAAO,EAAE,EACP,WAAW,EAAE,EACX,EAAE,EAAE,EAAE,QAAQ,EAAE,GACjB,GACF,EACD,OAAO,GACR,GAAG,IAAI,CAAC;QACT,MAAM,EAAE,aAAa,EAAE,iBAAiB,GAAG,EAAE,EAAE,SAAS,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAElF,MAAM,OAAO,GAAG,IAAI,kBAAO,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,QAAQ,EAA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,CAAC;aAClD,CAAC;SACH;IACH,CAAC;CAAA;AAzDD,0DAyDC;AAED;;GAEG;AACI,MAAM,gBAAgB,GAAG,GAAgD,EAAE,CAChF,IAAI,oBAAS,CAAC,uBAAuB,EAAE;IACrC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,gBAAQ,CAAC,WAAW,EAAE,CAAC;IACvC,WAAW,EAAE;QACX,MAAM,EAAE,EAAE;QACV,UAAU,EAAE,EAAE;QACd,YAAY,EAAE,CAAC,cAAM,CAAC,QAAQ,CAAC,cAAc,CAAC;KAC/C;CACF,CAAC,CAAC;AARQ,QAAA,gBAAgB,oBAQxB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseAsset, Procedure } from "../../internal";
|
|
2
|
+
import { AssetMediatorParams } from "../../types";
|
|
3
|
+
import { ExtrinsicParams, ProcedureAuthorization, TransactionSpec } from "../../types/internal";
|
|
4
|
+
/**
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
7
|
+
export declare type Params = {
|
|
8
|
+
asset: BaseAsset;
|
|
9
|
+
} & AssetMediatorParams;
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
export declare function prepareRemoveAssetMediators(this: Procedure<Params>, args: Params): Promise<TransactionSpec<void, ExtrinsicParams<'asset', 'removeMandatoryMediators'>>>;
|
|
14
|
+
/**
|
|
15
|
+
* @hidden
|
|
16
|
+
*/
|
|
17
|
+
export declare function getAuthorization(this: Procedure<Params>, args: Params): ProcedureAuthorization;
|
|
18
|
+
/**
|
|
19
|
+
* @hidden
|
|
20
|
+
*/
|
|
21
|
+
export declare const removeAssetMediators: () => Procedure<Params>;
|
|
22
|
+
//# sourceMappingURL=removeAssetMediators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeAssetMediators.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/removeAssetMediators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAiB,SAAS,EAAE,uBAAmB;AACjE,OAAO,EAAE,mBAAmB,EAAqB,oBAAgB;AACjE,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,eAAe,EAAE,6BAAyB;AAG5F;;GAEG;AACH,oBAAY,MAAM,GAAG;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,GAAG,mBAAmB,CAAC;AAEhE;;GAEG;AACH,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EACvB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,CAsCtF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,sBAAsB,CAQ9F;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,QAAO,UAAU,MAAM,CACM,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
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.removeAssetMediators = exports.getAuthorization = exports.prepareRemoveAssetMediators = 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 prepareRemoveAssetMediators(args) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const { context: { polymeshApi: { tx }, }, context, } = this;
|
|
23
|
+
const { asset, asset: { ticker }, mediators: mediatorInput, } = args;
|
|
24
|
+
const currentMediators = yield asset.getRequiredMediators();
|
|
25
|
+
const removeMediators = mediatorInput.map(mediator => (0, internal_2.asIdentity)(mediator, context));
|
|
26
|
+
removeMediators.forEach(({ did: removeDid }) => {
|
|
27
|
+
const alreadySetDid = currentMediators.find(({ did: currentDid }) => currentDid === removeDid);
|
|
28
|
+
if (!alreadySetDid) {
|
|
29
|
+
throw new internal_1.PolymeshError({
|
|
30
|
+
code: types_1.ErrorCode.ValidationError,
|
|
31
|
+
message: 'One of the specified mediators to remove is not set',
|
|
32
|
+
data: { ticker, removeDid },
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const rawNewMediators = (0, conversion_1.identitiesToBtreeSet)(removeMediators, context);
|
|
37
|
+
const rawTicker = (0, conversion_1.stringToTicker)(ticker, context);
|
|
38
|
+
return {
|
|
39
|
+
transaction: tx.asset.removeMandatoryMediators,
|
|
40
|
+
args: [rawTicker, rawNewMediators],
|
|
41
|
+
resolver: undefined,
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
exports.prepareRemoveAssetMediators = prepareRemoveAssetMediators;
|
|
46
|
+
/**
|
|
47
|
+
* @hidden
|
|
48
|
+
*/
|
|
49
|
+
function getAuthorization(args) {
|
|
50
|
+
return {
|
|
51
|
+
permissions: {
|
|
52
|
+
transactions: [types_1.TxTags.asset.RemoveMandatoryMediators],
|
|
53
|
+
portfolios: [],
|
|
54
|
+
assets: [args.asset],
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
exports.getAuthorization = getAuthorization;
|
|
59
|
+
/**
|
|
60
|
+
* @hidden
|
|
61
|
+
*/
|
|
62
|
+
const removeAssetMediators = () => new internal_1.Procedure(prepareRemoveAssetMediators, getAuthorization);
|
|
63
|
+
exports.removeAssetMediators = removeAssetMediators;
|
|
64
|
+
//# sourceMappingURL=removeAssetMediators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeAssetMediators.js","sourceRoot":"","sources":["../../../src/api/procedures/removeAssetMediators.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAiE;AACjE,uCAAiE;AAEjE,uDAA0E;AAC1E,mDAA8C;AAM9C;;GAEG;AACH,SAAsB,2BAA2B,CAE/C,IAAY;;QAEZ,MAAM,EACJ,OAAO,EAAE,EACP,WAAW,EAAE,EAAE,EAAE,EAAE,GACpB,EACD,OAAO,GACR,GAAG,IAAI,CAAC;QAET,MAAM,EACJ,KAAK,EACL,KAAK,EAAE,EAAE,MAAM,EAAE,EACjB,SAAS,EAAE,aAAa,GACzB,GAAG,IAAI,CAAC;QAET,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAE5D,MAAM,eAAe,GAAG,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAA,qBAAU,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;QAErF,eAAe,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE;YAC7C,MAAM,aAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC;YAE/F,IAAI,CAAC,aAAa,EAAE;gBAClB,MAAM,IAAI,wBAAa,CAAC;oBACtB,IAAI,EAAE,iBAAS,CAAC,eAAe;oBAC/B,OAAO,EAAE,qDAAqD;oBAC9D,IAAI,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;iBAC5B,CAAC,CAAC;aACJ;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,eAAe,GAAG,IAAA,iCAAoB,EAAC,eAAe,EAAE,OAAO,CAAC,CAAC;QACvE,MAAM,SAAS,GAAG,IAAA,2BAAc,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAElD,OAAO;YACL,WAAW,EAAE,EAAE,CAAC,KAAK,CAAC,wBAAwB;YAC9C,IAAI,EAAE,CAAC,SAAS,EAAE,eAAe,CAAC;YAClC,QAAQ,EAAE,SAAS;SACpB,CAAC;IACJ,CAAC;CAAA;AAzCD,kEAyCC;AAED;;GAEG;AACH,SAAgB,gBAAgB,CAA0B,IAAY;IACpE,OAAO;QACL,WAAW,EAAE;YACX,YAAY,EAAE,CAAC,cAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC;YACrD,UAAU,EAAE,EAAE;YACd,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;SACrB;KACF,CAAC;AACJ,CAAC;AARD,4CAQC;AAED;;GAEG;AACI,MAAM,oBAAoB,GAAG,GAAsB,EAAE,CAC1D,IAAI,oBAAS,CAAC,2BAA2B,EAAE,gBAAgB,CAAC,CAAC;AADlD,QAAA,oBAAoB,wBAC8B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Procedure } from "../../internal";
|
|
2
|
+
import { Identity } from "../../types";
|
|
3
|
+
import { ExtrinsicParams, TransactionSpec } from "../../types/internal";
|
|
4
|
+
/**
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
7
|
+
export declare type RevokeIdentityToCreatePortfoliosParams = {
|
|
8
|
+
did: Identity | string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
export declare function prepareRevokeIdentityToCreatePortfolios(this: Procedure<RevokeIdentityToCreatePortfoliosParams, void>, args: RevokeIdentityToCreatePortfoliosParams): Promise<TransactionSpec<void, ExtrinsicParams<'portfolio', 'allowIdentityToCreatePortfolios'>>>;
|
|
14
|
+
/**
|
|
15
|
+
* @hidden
|
|
16
|
+
*/
|
|
17
|
+
export declare const revokeIdentityToCreatePortfolios: () => Procedure<RevokeIdentityToCreatePortfoliosParams, void>;
|
|
18
|
+
//# sourceMappingURL=revokeIdentityToCreatePortfolios.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revokeIdentityToCreatePortfolios.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/revokeIdentityToCreatePortfolios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAE,uBAAmB;AACtD,OAAO,EAAa,QAAQ,EAAE,oBAAgB;AAC9C,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,6BAAyB;AAIpE;;GAEG;AACH,oBAAY,sCAAsC,GAAG;IACnD,GAAG,EAAE,QAAQ,GAAG,MAAM,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,wBAAsB,uCAAuC,CAC3D,IAAI,EAAE,SAAS,CAAC,sCAAsC,EAAE,IAAI,CAAC,EAC7D,IAAI,EAAE,sCAAsC,GAC3C,OAAO,CAAC,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,WAAW,EAAE,iCAAiC,CAAC,CAAC,CAAC,CAuCjG;AAED;;GAEG;AACH,eAAO,MAAM,gCAAgC,QAAO,UAClD,sCAAsC,EACtC,IAAI,CAQF,CAAC"}
|
|
@@ -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.revokeIdentityToCreatePortfolios = exports.prepareRevokeIdentityToCreatePortfolios = 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 prepareRevokeIdentityToCreatePortfolios(args) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const { context: { polymeshApi: { tx: { portfolio: { revokeCreatePortfoliosPermission }, }, 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 rawDidToRevoke = (0, conversion_1.stringToIdentityId)(identity.did, context);
|
|
27
|
+
const signingIdentity = yield this.context.getSigningIdentity();
|
|
28
|
+
const isInAllowedCustodians = yield query.portfolio.allowedCustodians(signingIdentity.did, identity.did);
|
|
29
|
+
if (isInAllowedCustodians.isFalse) {
|
|
30
|
+
throw new internal_1.PolymeshError({
|
|
31
|
+
code: types_1.ErrorCode.NoDataChange,
|
|
32
|
+
message: 'The provided Identity is not in the list of allowed custodians',
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
transaction: revokeCreatePortfoliosPermission,
|
|
37
|
+
args: [rawDidToRevoke],
|
|
38
|
+
resolver: undefined,
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
exports.prepareRevokeIdentityToCreatePortfolios = prepareRevokeIdentityToCreatePortfolios;
|
|
43
|
+
/**
|
|
44
|
+
* @hidden
|
|
45
|
+
*/
|
|
46
|
+
const revokeIdentityToCreatePortfolios = () => new internal_1.Procedure(prepareRevokeIdentityToCreatePortfolios, {
|
|
47
|
+
permissions: {
|
|
48
|
+
assets: [],
|
|
49
|
+
portfolios: [],
|
|
50
|
+
transactions: [],
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
exports.revokeIdentityToCreatePortfolios = revokeIdentityToCreatePortfolios;
|
|
54
|
+
//# sourceMappingURL=revokeIdentityToCreatePortfolios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revokeIdentityToCreatePortfolios.js","sourceRoot":"","sources":["../../../src/api/procedures/revokeIdentityToCreatePortfolios.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAsD;AACtD,uCAA8C;AAE9C,uDAAwD;AACxD,mDAAoE;AASpE;;GAEG;AACH,SAAsB,uCAAuC,CAE3D,IAA4C;;QAE5C,MAAM,EACJ,OAAO,EAAE,EACP,WAAW,EAAE,EACX,EAAE,EAAE,EACF,SAAS,EAAE,EAAE,gCAAgC,EAAE,GAChD,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,cAAc,GAAG,IAAA,+BAAkB,EAAC,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAEjE,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,OAAO,EAAE;YACjC,MAAM,IAAI,wBAAa,CAAC;gBACtB,IAAI,EAAE,iBAAS,CAAC,YAAY;gBAC5B,OAAO,EAAE,gEAAgE;aAC1E,CAAC,CAAC;SACJ;QAED,OAAO;YACL,WAAW,EAAE,gCAAgC;YAC7C,IAAI,EAAE,CAAC,cAAc,CAAC;YACtB,QAAQ,EAAE,SAAS;SACpB,CAAC;IACJ,CAAC;CAAA;AA1CD,0FA0CC;AAED;;GAEG;AACI,MAAM,gCAAgC,GAAG,GAG9C,EAAE,CACF,IAAI,oBAAS,CAAC,uCAAuC,EAAE;IACrD,WAAW,EAAE;QACX,MAAM,EAAE,EAAE;QACV,UAAU,EAAE,EAAE;QACd,YAAY,EAAE,EAAE;KACjB;CACF,CAAC,CAAC;AAVQ,QAAA,gCAAgC,oCAUxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setCustodian.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/setCustodian.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AAGrC,OAAO,
|
|
1
|
+
{"version":3,"file":"setCustodian.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/setCustodian.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AAGrC,OAAO,EAAE,oBAAoB,EAAY,SAAS,EAAE,uBAAmB;AACvE,OAAO,EAKL,kBAAkB,EAEnB,oBAAgB;AACjB,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,eAAe,EAAE,6BAAyB;AAW5F;;GAEG;AACH,oBAAY,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,kBAAkB,CAAC;AAE1E;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,oBAAoB,CAAC,EAC7C,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,eAAe,CAAC,oBAAoB,EAAE,eAAe,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAsDjG;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,oBAAoB,CAAC,EAC7C,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,MAAM,GAClB,sBAAsB,CAWxB;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,QAAO,UAAU,MAAM,EAAE,oBAAoB,CAChB,CAAC"}
|
|
@@ -33,27 +33,22 @@ function prepareSetCustodian(args) {
|
|
|
33
33
|
}),
|
|
34
34
|
context.getSigningIdentity(),
|
|
35
35
|
]);
|
|
36
|
-
const
|
|
37
|
-
const { issuer, data } = authorizationRequest;
|
|
38
|
-
const authorizationData = data;
|
|
39
|
-
return signingIdentity.isEqual(issuer) && authorizationData.value.isEqual(portfolio);
|
|
40
|
-
});
|
|
41
|
-
if (hasPendingAuth) {
|
|
42
|
-
throw new internal_1.PolymeshError({
|
|
43
|
-
code: types_1.ErrorCode.NoDataChange,
|
|
44
|
-
message: "The target Identity already has a pending invitation to be the Portfolio's custodian",
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
const rawSignatory = (0, conversion_1.signerValueToSignatory)((0, conversion_1.signerToSignerValue)(target), context);
|
|
48
|
-
const authRequest = {
|
|
36
|
+
const authorization = {
|
|
49
37
|
type: types_1.AuthorizationType.PortfolioCustody,
|
|
50
38
|
value: portfolio,
|
|
51
39
|
};
|
|
52
|
-
|
|
40
|
+
(0, internal_2.assertNoPendingAuthorizationExists)({
|
|
41
|
+
authorizationRequests,
|
|
42
|
+
issuer: signingIdentity,
|
|
43
|
+
message: "The target Identity already has a pending invitation to be the Portfolio's custodian",
|
|
44
|
+
authorization,
|
|
45
|
+
});
|
|
46
|
+
const rawSignatory = (0, conversion_1.signerValueToSignatory)((0, conversion_1.signerToSignerValue)(target), context);
|
|
47
|
+
const rawAuthorizationData = (0, conversion_1.authorizationToAuthorizationData)(authorization, context);
|
|
53
48
|
const rawExpiry = (0, internal_2.optionize)(conversion_1.dateToMoment)(expiry, context);
|
|
54
49
|
return {
|
|
55
50
|
transaction: identity.addAuthorization,
|
|
56
|
-
resolver: (0, utils_1.createAuthorizationResolver)(
|
|
51
|
+
resolver: (0, utils_1.createAuthorizationResolver)(authorization, issuerIdentity, target, expiry || null, context),
|
|
57
52
|
args: [rawSignatory, rawAuthorizationData, rawExpiry],
|
|
58
53
|
};
|
|
59
54
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setCustodian.js","sourceRoot":"","sources":["../../../src/api/procedures/setCustodian.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,mCAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"setCustodian.js","sourceRoot":"","sources":["../../../src/api/procedures/setCustodian.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,mCAAqE;AACrE,6CAAuE;AACvE,uCAOiB;AAEjB,uDAO4B;AAC5B,mDAAiF;AAOjF;;GAEG;AACH,SAAsB,mBAAmB,CAEvC,IAAY;;QAEZ,MAAM,EACJ,OAAO,EAAE,EACP,WAAW,EAAE,EACX,EAAE,EAAE,EAAE,QAAQ,EAAE,GACjB,GACF,EACD,OAAO,GACR,GAAG,IAAI,CAAC;QAET,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC;QACjD,MAAM,SAAS,GAAG,IAAA,mCAAsB,EAAC,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;QACvE,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAE1D,MAAM,SAAS,GAAG,IAAA,2BAAc,EAAC,cAAc,CAAC,CAAC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;IACzB,MAAM,WAAW,GAAgB,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IACrD,OAAO;QACL,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,gBAAQ,CAAC,kBAAkB,EAAE,WAAW,EAAE,CAAC;QAC3D,WAAW,EAAE;YACX,YAAY,EAAE,CAAC,cAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC;YAChD,UAAU,EAAE,CAAC,IAAA,mCAAsB,EAAC,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;YAClE,MAAM,EAAE,EAAE;SACX;KACF,CAAC;AACJ,CAAC;AAdD,4CAcC;AAED;;GAEG;AACI,MAAM,YAAY,GAAG,GAA4C,EAAE,CACxE,IAAI,oBAAS,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAC;AAD1C,QAAA,YAAY,gBAC8B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Procedure } from "../../internal";
|
|
2
|
+
import { ExtrinsicParams, ProcedureAuthorization, TransactionSpec } from "../../types/internal";
|
|
3
|
+
/**
|
|
4
|
+
* @hidden
|
|
5
|
+
*/
|
|
6
|
+
export interface Params {
|
|
7
|
+
ticker: string;
|
|
8
|
+
preApprove: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
export declare function prepareToggleTickerPreApproval(this: Procedure<Params, void>, args: Params): Promise<TransactionSpec<void, ExtrinsicParams<'assets', 'preApprove'>>>;
|
|
14
|
+
/**
|
|
15
|
+
* @hidden
|
|
16
|
+
*/
|
|
17
|
+
export declare function getAuthorization(this: Procedure<Params, void>, { ticker, preApprove }: Params): ProcedureAuthorization;
|
|
18
|
+
/**
|
|
19
|
+
* @hidden
|
|
20
|
+
*/
|
|
21
|
+
export declare const toggleTickerPreApproval: () => Procedure<Params, void>;
|
|
22
|
+
//# sourceMappingURL=toggleTickerPreApproval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggleTickerPreApproval.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/toggleTickerPreApproval.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,SAAS,EAAE,uBAAmB;AAEjE,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,eAAe,EAAE,6BAAyB;AAG5F;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,EAC7B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,CAgCzE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,EAC7B,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,MAAM,GAC7B,sBAAsB,CAWxB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,QAAO,UAAU,MAAM,EAAE,IAAI,CACA,CAAC"}
|