@polymeshassociation/polymesh-sdk 29.1.0-beta.9 → 30.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.releaserc.js +46 -0
- package/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +4 -2
- package/README.md +1 -1
- package/api/client/AccountManagement.d.ts +29 -1
- package/api/client/AccountManagement.d.ts.map +1 -1
- package/api/client/AccountManagement.js +5 -2
- package/api/client/AccountManagement.js.map +1 -1
- package/api/client/Assets.d.ts +9 -1
- package/api/client/Assets.d.ts.map +1 -1
- package/api/client/Assets.js +3 -0
- package/api/client/Assets.js.map +1 -1
- package/api/client/Claims.d.ts +2 -0
- package/api/client/Claims.d.ts.map +1 -1
- package/api/client/Claims.js +21 -9
- package/api/client/Claims.js.map +1 -1
- package/api/client/Identities.d.ts +16 -4
- package/api/client/Identities.d.ts.map +1 -1
- package/api/client/Identities.js +5 -1
- package/api/client/Identities.js.map +1 -1
- package/api/client/Polymesh.d.ts.map +1 -1
- package/api/client/Polymesh.js +3 -1
- package/api/client/Polymesh.js.map +1 -1
- package/api/client/Staking.d.ts +1 -0
- package/api/client/Staking.d.ts.map +1 -1
- package/api/client/Staking.js.map +1 -1
- package/api/client/types.d.ts +5 -1
- package/api/client/types.d.ts.map +1 -1
- package/api/client/types.js +4 -0
- package/api/client/types.js.map +1 -1
- package/api/entities/Account/Staking/index.d.ts.map +1 -1
- package/api/entities/Account/Staking/index.js +11 -3
- package/api/entities/Account/Staking/index.js.map +1 -1
- package/api/entities/Account/index.d.ts +18 -2
- package/api/entities/Account/index.d.ts.map +1 -1
- package/api/entities/Account/index.js +119 -2
- package/api/entities/Account/index.js.map +1 -1
- package/api/entities/Asset/Base/Settlements/index.d.ts +15 -15
- package/api/entities/Asset/Base/Settlements/index.d.ts.map +1 -1
- package/api/entities/Asset/Base/Settlements/index.js +33 -16
- package/api/entities/Asset/Base/Settlements/index.js.map +1 -1
- package/api/entities/Asset/Fungible/Checkpoints/Schedules.js.map +1 -1
- package/api/entities/Asset/Fungible/TransferRestrictions/index.d.ts +15 -0
- package/api/entities/Asset/Fungible/TransferRestrictions/index.d.ts.map +1 -1
- package/api/entities/Asset/Fungible/TransferRestrictions/index.js +75 -11
- package/api/entities/Asset/Fungible/TransferRestrictions/index.js.map +1 -1
- package/api/entities/Asset/Fungible/index.d.ts +18 -2
- package/api/entities/Asset/Fungible/index.d.ts.map +1 -1
- package/api/entities/Asset/Fungible/index.js +23 -2
- package/api/entities/Asset/Fungible/index.js.map +1 -1
- package/api/entities/Asset/NonFungible/AssetHolders/index.js.map +1 -1
- package/api/entities/Asset/NonFungible/Nft.d.ts +2 -2
- package/api/entities/Asset/NonFungible/Nft.d.ts.map +1 -1
- package/api/entities/Asset/NonFungible/Nft.js +21 -6
- package/api/entities/Asset/NonFungible/Nft.js.map +1 -1
- package/api/entities/Asset/NonFungible/NftCollection.d.ts.map +1 -1
- package/api/entities/Asset/NonFungible/NftCollection.js +6 -2
- package/api/entities/Asset/NonFungible/NftCollection.js.map +1 -1
- package/api/entities/Asset/types.d.ts +15 -2
- package/api/entities/Asset/types.d.ts.map +1 -1
- package/api/entities/Asset/types.js +7 -1
- package/api/entities/Asset/types.js.map +1 -1
- package/api/entities/Identity/ChildIdentity.d.ts +8 -0
- package/api/entities/Identity/ChildIdentity.d.ts.map +1 -1
- package/api/entities/Identity/ChildIdentity.js +14 -0
- package/api/entities/Identity/ChildIdentity.js.map +1 -1
- package/api/entities/Identity/index.d.ts +21 -2
- package/api/entities/Identity/index.d.ts.map +1 -1
- package/api/entities/Identity/index.js +76 -18
- package/api/entities/Identity/index.js.map +1 -1
- package/api/entities/Instruction/index.d.ts +6 -1
- package/api/entities/Instruction/index.d.ts.map +1 -1
- package/api/entities/Instruction/index.js +72 -31
- package/api/entities/Instruction/index.js.map +1 -1
- package/api/entities/Instruction/types.d.ts +11 -6
- package/api/entities/Instruction/types.d.ts.map +1 -1
- package/api/entities/Instruction/types.js +6 -1
- package/api/entities/Instruction/types.js.map +1 -1
- package/api/entities/Portfolio/index.d.ts.map +1 -1
- package/api/entities/Portfolio/index.js +33 -37
- package/api/entities/Portfolio/index.js.map +1 -1
- package/api/entities/Subsidies.d.ts +6 -0
- package/api/entities/Subsidies.d.ts.map +1 -1
- package/api/entities/Subsidies.js +16 -0
- package/api/entities/Subsidies.js.map +1 -1
- package/api/entities/common/namespaces/Authorizations.d.ts.map +1 -1
- package/api/entities/common/namespaces/Authorizations.js +8 -0
- package/api/entities/common/namespaces/Authorizations.js.map +1 -1
- package/api/entities/types.d.ts +54 -14
- package/api/entities/types.d.ts.map +1 -1
- package/api/entities/types.js +11 -7
- package/api/entities/types.js.map +1 -1
- package/api/procedures/acceptPrimaryKeyRotation.d.ts.map +1 -1
- package/api/procedures/acceptPrimaryKeyRotation.js +19 -4
- package/api/procedures/acceptPrimaryKeyRotation.js.map +1 -1
- package/api/procedures/acceptSubsidy.d.ts +12 -0
- package/api/procedures/acceptSubsidy.d.ts.map +1 -0
- package/api/procedures/acceptSubsidy.js +61 -0
- package/api/procedures/acceptSubsidy.js.map +1 -0
- package/api/procedures/addInstruction.d.ts +12 -3
- package/api/procedures/addInstruction.d.ts.map +1 -1
- package/api/procedures/addInstruction.js +122 -70
- package/api/procedures/addInstruction.js.map +1 -1
- package/api/procedures/approveAllowance.d.ts +22 -0
- package/api/procedures/approveAllowance.d.ts.map +1 -0
- package/api/procedures/approveAllowance.js +51 -0
- package/api/procedures/approveAllowance.js.map +1 -0
- package/api/procedures/bondPolyx.d.ts.map +1 -1
- package/api/procedures/bondPolyx.js +17 -6
- package/api/procedures/bondPolyx.js.map +1 -1
- package/api/procedures/consumeAddRelayerPayingKeyAuthorization.d.ts +1 -1
- package/api/procedures/consumeAddRelayerPayingKeyAuthorization.d.ts.map +1 -1
- package/api/procedures/consumeAddRelayerPayingKeyAuthorization.js +11 -1
- package/api/procedures/consumeAddRelayerPayingKeyAuthorization.js.map +1 -1
- package/api/procedures/consumeJoinOrRotateAuthorization.d.ts.map +1 -1
- package/api/procedures/consumeJoinOrRotateAuthorization.js +10 -1
- package/api/procedures/consumeJoinOrRotateAuthorization.js.map +1 -1
- package/api/procedures/controllerTransfer.d.ts +3 -2
- package/api/procedures/controllerTransfer.d.ts.map +1 -1
- package/api/procedures/controllerTransfer.js +21 -7
- package/api/procedures/controllerTransfer.js.map +1 -1
- package/api/procedures/createAsset.js +2 -2
- package/api/procedures/createAsset.js.map +1 -1
- package/api/procedures/createChildIdentities.d.ts +5 -2
- package/api/procedures/createChildIdentities.d.ts.map +1 -1
- package/api/procedures/createChildIdentities.js +14 -2
- package/api/procedures/createChildIdentities.js.map +1 -1
- package/api/procedures/createChildIdentity.d.ts +9 -4
- package/api/procedures/createChildIdentity.d.ts.map +1 -1
- package/api/procedures/createChildIdentity.js +12 -3
- package/api/procedures/createChildIdentity.js.map +1 -1
- package/api/procedures/createVenue.d.ts.map +1 -1
- package/api/procedures/createVenue.js +7 -2
- package/api/procedures/createVenue.js.map +1 -1
- package/api/procedures/executeManualInstruction.d.ts +4 -3
- package/api/procedures/executeManualInstruction.d.ts.map +1 -1
- package/api/procedures/executeManualInstruction.js +41 -20
- package/api/procedures/executeManualInstruction.js.map +1 -1
- package/api/procedures/initiateCorporateAction.d.ts.map +1 -1
- package/api/procedures/initiateCorporateAction.js +10 -0
- package/api/procedures/initiateCorporateAction.js.map +1 -1
- package/api/procedures/issueNft.d.ts.map +1 -1
- package/api/procedures/issueNft.js +10 -3
- package/api/procedures/issueNft.js.map +1 -1
- package/api/procedures/issueTokens.d.ts.map +1 -1
- package/api/procedures/issueTokens.js +25 -6
- package/api/procedures/issueTokens.js.map +1 -1
- package/api/procedures/modifyInstructionAffirmation.d.ts +6 -6
- package/api/procedures/modifyInstructionAffirmation.d.ts.map +1 -1
- package/api/procedures/modifyInstructionAffirmation.js +112 -67
- package/api/procedures/modifyInstructionAffirmation.js.map +1 -1
- package/api/procedures/modifySignerPermissions.js +1 -1
- package/api/procedures/modifySignerPermissions.js.map +1 -1
- package/api/procedures/moveFunds.js.map +1 -1
- package/api/procedures/nftControllerTransfer.d.ts +5 -4
- package/api/procedures/nftControllerTransfer.d.ts.map +1 -1
- package/api/procedures/nftControllerTransfer.js +33 -22
- package/api/procedures/nftControllerTransfer.js.map +1 -1
- package/api/procedures/payDividends.d.ts +1 -1
- package/api/procedures/payDividends.d.ts.map +1 -1
- package/api/procedures/payDividends.js +2 -2
- package/api/procedures/payDividends.js.map +1 -1
- package/api/procedures/quitSubsidy.d.ts +1 -1
- package/api/procedures/quitSubsidy.d.ts.map +1 -1
- package/api/procedures/quitSubsidy.js +9 -1
- package/api/procedures/quitSubsidy.js.map +1 -1
- package/api/procedures/redeemNft.d.ts +4 -4
- package/api/procedures/redeemNft.d.ts.map +1 -1
- package/api/procedures/redeemNft.js +32 -13
- package/api/procedures/redeemNft.js.map +1 -1
- package/api/procedures/redeemTokens.d.ts +5 -5
- package/api/procedures/redeemTokens.d.ts.map +1 -1
- package/api/procedures/redeemTokens.js +24 -14
- package/api/procedures/redeemTokens.js.map +1 -1
- package/api/procedures/revokeSubsidy.d.ts +12 -0
- package/api/procedures/revokeSubsidy.d.ts.map +1 -0
- package/api/procedures/revokeSubsidy.js +61 -0
- package/api/procedures/revokeSubsidy.js.map +1 -0
- package/api/procedures/selfRegisterDid.d.ts +20 -0
- package/api/procedures/selfRegisterDid.d.ts.map +1 -0
- package/api/procedures/selfRegisterDid.js +68 -0
- package/api/procedures/selfRegisterDid.js.map +1 -0
- package/api/procedures/setAssetStats.d.ts +15 -3
- package/api/procedures/setAssetStats.d.ts.map +1 -1
- package/api/procedures/setAssetStats.js +98 -30
- package/api/procedures/setAssetStats.js.map +1 -1
- package/api/procedures/setMandatoryReceiverAffirmation.d.ts +33 -0
- package/api/procedures/setMandatoryReceiverAffirmation.d.ts.map +1 -0
- package/api/procedures/setMandatoryReceiverAffirmation.js +87 -0
- package/api/procedures/setMandatoryReceiverAffirmation.js.map +1 -0
- package/api/procedures/setStakingController.d.ts.map +1 -1
- package/api/procedures/setStakingController.js +17 -5
- package/api/procedures/setStakingController.js.map +1 -1
- package/api/procedures/setTransferRestrictions.d.ts.map +1 -1
- package/api/procedures/setTransferRestrictions.js +20 -19
- package/api/procedures/setTransferRestrictions.js.map +1 -1
- package/api/procedures/subsidizeAccount.d.ts +6 -3
- package/api/procedures/subsidizeAccount.d.ts.map +1 -1
- package/api/procedures/subsidizeAccount.js +55 -25
- package/api/procedures/subsidizeAccount.js.map +1 -1
- package/api/procedures/transferFunds.d.ts +31 -0
- package/api/procedures/transferFunds.d.ts.map +1 -0
- package/api/procedures/transferFunds.js +165 -0
- package/api/procedures/transferFunds.js.map +1 -0
- package/api/procedures/transferPolyx.d.ts +1 -1
- package/api/procedures/transferPolyx.d.ts.map +1 -1
- package/api/procedures/transferPolyx.js +25 -8
- package/api/procedures/transferPolyx.js.map +1 -1
- package/api/procedures/types.d.ts +149 -21
- package/api/procedures/types.d.ts.map +1 -1
- package/api/procedures/types.js +10 -0
- package/api/procedures/types.js.map +1 -1
- package/api/procedures/unlinkChildIdentity.d.ts +1 -1
- package/api/procedures/unlinkChildIdentity.d.ts.map +1 -1
- package/api/procedures/unlinkChildIdentity.js +10 -1
- package/api/procedures/unlinkChildIdentity.js.map +1 -1
- package/api/procedures/updateVenueSigners.d.ts.map +1 -1
- package/api/procedures/updateVenueSigners.js +6 -5
- package/api/procedures/updateVenueSigners.js.map +1 -1
- package/api/procedures/utils.d.ts +10 -2
- package/api/procedures/utils.d.ts.map +1 -1
- package/api/procedures/utils.js +35 -4
- package/api/procedures/utils.js.map +1 -1
- package/base/Context.d.ts +10 -0
- package/base/Context.d.ts.map +1 -1
- package/base/Context.js +72 -1
- package/base/Context.js.map +1 -1
- package/base/PolymeshTransaction.d.ts +1 -0
- package/base/PolymeshTransaction.d.ts.map +1 -1
- package/base/PolymeshTransaction.js +6 -2
- package/base/PolymeshTransaction.js.map +1 -1
- package/base/PolymeshTransactionBase.d.ts +27 -2
- package/base/PolymeshTransactionBase.d.ts.map +1 -1
- package/base/PolymeshTransactionBase.js +55 -15
- package/base/PolymeshTransactionBase.js.map +1 -1
- package/base/PolymeshTransactionBatch.d.ts +1 -0
- package/base/PolymeshTransactionBatch.d.ts.map +1 -1
- package/base/PolymeshTransactionBatch.js +6 -2
- package/base/PolymeshTransactionBatch.js.map +1 -1
- package/base/types.d.ts +2 -1
- package/base/types.d.ts.map +1 -1
- package/internal.d.ts +7 -1
- package/internal.d.ts.map +1 -1
- package/internal.js +16 -3
- package/internal.js.map +1 -1
- package/middleware/queries/assets.d.ts.map +1 -1
- package/middleware/queries/assets.js +4 -0
- package/middleware/queries/assets.js.map +1 -1
- package/middleware/queries/claims.d.ts.map +1 -1
- package/middleware/queries/claims.js +2 -3
- package/middleware/queries/claims.js.map +1 -1
- package/middleware/queries/portfolios.d.ts.map +1 -1
- package/middleware/queries/portfolios.js +2 -0
- package/middleware/queries/portfolios.js.map +1 -1
- package/middleware/queries/settlements.d.ts.map +1 -1
- package/middleware/queries/settlements.js +4 -0
- package/middleware/queries/settlements.js.map +1 -1
- package/middleware/types.d.ts +273 -11
- package/middleware/types.d.ts.map +1 -1
- package/middleware/types.js +146 -1
- package/middleware/types.js.map +1 -1
- package/npm-package/polymeshassociation-polymesh-sdk-30.0.0-beta.2.tgz +0 -0
- package/package.json +53 -68
- package/utils/constants.d.ts +2 -2
- package/utils/constants.d.ts.map +1 -1
- package/utils/constants.js +2 -2
- package/utils/constants.js.map +1 -1
- package/utils/conversion.d.ts +81 -13
- package/utils/conversion.d.ts.map +1 -1
- package/utils/conversion.js +368 -33
- package/utils/conversion.js.map +1 -1
- package/utils/internal.d.ts +4 -0
- package/utils/internal.d.ts.map +1 -1
- package/utils/internal.js +145 -68
- package/utils/internal.js.map +1 -1
- package/utils/typeguards.d.ts +9 -1
- package/utils/typeguards.d.ts.map +1 -1
- package/utils/typeguards.js +15 -1
- package/utils/typeguards.js.map +1 -1
- package/npm-package/polymeshassociation-polymesh-sdk-29.1.0-beta.9.tgz +0 -0
|
@@ -20,16 +20,17 @@ const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
|
20
20
|
const internal_1 = require("../../internal");
|
|
21
21
|
const types_1 = require("../../types");
|
|
22
22
|
const conversion_1 = require("../../utils/conversion");
|
|
23
|
+
const internal_2 = require("../../utils/internal");
|
|
23
24
|
/**
|
|
24
25
|
* @hidden
|
|
25
26
|
*/
|
|
26
27
|
function prepareRedeemTokens(args) {
|
|
27
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
const { context, context: { polymeshApi: { tx }, }, storage: {
|
|
29
|
+
const { context, context: { polymeshApi: { tx }, }, storage: { fromAssetHolder }, } = this;
|
|
29
30
|
const { asset, amount } = args;
|
|
30
31
|
const rawAssetId = (0, conversion_1.assetToMeshAssetId)(asset, context);
|
|
31
32
|
const [[portfolioBalance], { isDivisible }] = yield Promise.all([
|
|
32
|
-
|
|
33
|
+
fromAssetHolder.getAssetBalances({ assets: [asset.id] }),
|
|
33
34
|
asset.details(),
|
|
34
35
|
]);
|
|
35
36
|
if (!portfolioBalance || portfolioBalance.free.lt(amount)) {
|
|
@@ -44,7 +45,7 @@ function prepareRedeemTokens(args) {
|
|
|
44
45
|
const rawAmount = (0, conversion_1.bigNumberToBalance)(amount, context, isDivisible);
|
|
45
46
|
return {
|
|
46
47
|
transaction: tx.asset.redeem,
|
|
47
|
-
args: [rawAssetId, rawAmount, (0, conversion_1.
|
|
48
|
+
args: [rawAssetId, rawAmount, (0, conversion_1.assetHolderToAssetHolderKind)(fromAssetHolder, context)],
|
|
48
49
|
resolver: undefined,
|
|
49
50
|
};
|
|
50
51
|
});
|
|
@@ -52,13 +53,13 @@ function prepareRedeemTokens(args) {
|
|
|
52
53
|
/**
|
|
53
54
|
* @hidden
|
|
54
55
|
*/
|
|
55
|
-
function getAuthorization({ asset
|
|
56
|
-
const { storage: {
|
|
56
|
+
function getAuthorization({ asset }) {
|
|
57
|
+
const { storage: { fromAssetHolder }, } = this;
|
|
57
58
|
return {
|
|
58
59
|
permissions: {
|
|
59
|
-
transactions: [
|
|
60
|
+
transactions: [types_1.TxTags.asset.Redeem],
|
|
60
61
|
assets: [asset],
|
|
61
|
-
portfolios: [
|
|
62
|
+
portfolios: fromAssetHolder instanceof internal_1.Account ? [] : [fromAssetHolder],
|
|
62
63
|
},
|
|
63
64
|
};
|
|
64
65
|
}
|
|
@@ -66,21 +67,30 @@ function getAuthorization({ asset, from }) {
|
|
|
66
67
|
* @hidden
|
|
67
68
|
*/
|
|
68
69
|
function prepareStorage(_a) {
|
|
69
|
-
return __awaiter(this, arguments, void 0, function* ({ from }) {
|
|
70
|
+
return __awaiter(this, arguments, void 0, function* ({ from, fromAccount }) {
|
|
70
71
|
const { context } = this;
|
|
71
72
|
const { did } = yield context.getSigningIdentity();
|
|
72
|
-
let
|
|
73
|
-
if (
|
|
74
|
-
|
|
73
|
+
let fromAssetHolder;
|
|
74
|
+
if (from && fromAccount) {
|
|
75
|
+
throw new internal_1.PolymeshError({
|
|
76
|
+
code: types_1.ErrorCode.ValidationError,
|
|
77
|
+
message: 'Only one of `from` or `fromAccount` can be provided to redeem',
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
if (fromAccount) {
|
|
81
|
+
fromAssetHolder = (0, internal_2.asAccount)(fromAccount, context);
|
|
82
|
+
}
|
|
83
|
+
else if (!from) {
|
|
84
|
+
fromAssetHolder = new internal_1.DefaultPortfolio({ did }, context);
|
|
75
85
|
}
|
|
76
86
|
else if (from instanceof bignumber_js_1.default) {
|
|
77
|
-
|
|
87
|
+
fromAssetHolder = new internal_1.NumberedPortfolio({ did, id: from }, context);
|
|
78
88
|
}
|
|
79
89
|
else {
|
|
80
|
-
|
|
90
|
+
fromAssetHolder = from;
|
|
81
91
|
}
|
|
82
92
|
return {
|
|
83
|
-
|
|
93
|
+
fromAssetHolder,
|
|
84
94
|
};
|
|
85
95
|
});
|
|
86
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redeemTokens.js","sourceRoot":"","sources":["../../../src/api/procedures/redeemTokens.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"redeemTokens.js","sourceRoot":"","sources":["../../../src/api/procedures/redeemTokens.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AA+BA,kDAsCC;AAKD,4CAeC;AAKD,wCA8BC;AA5HD,gEAAqC;AAErC,yCAOoB;AACpB,mCAA6E;AAE7E,mDAI4B;AAC5B,+CAA6C;AAW7C;;GAEG;AACH,SAAsB,mBAAmB,CAEvC,IAAY;;QAEZ,MAAM,EACJ,OAAO,EACP,OAAO,EAAE,EACP,WAAW,EAAE,EAAE,EAAE,EAAE,GACpB,EACD,OAAO,EAAE,EAAE,eAAe,EAAE,GAC7B,GAAG,IAAI,CAAC;QAET,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAE/B,MAAM,UAAU,GAAG,IAAA,+BAAkB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAEtD,MAAM,CAAC,CAAC,gBAAgB,CAAC,EAAE,EAAE,WAAW,EAAE,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAC9D,eAAe,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;YACxD,KAAK,CAAC,OAAO,EAAE;SAChB,CAAC,CAAC;QAEH,IAAI,CAAC,gBAAgB,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1D,MAAM,IAAI,wBAAa,CAAC;gBACtB,IAAI,EAAE,iBAAS,CAAC,mBAAmB;gBACnC,OAAO,EAAE,2BAA2B;gBACpC,IAAI,EAAE;oBACJ,gBAAgB;iBACjB;aACF,CAAC,CAAC;QACL,CAAC;QAED,MAAM,SAAS,GAAG,IAAA,+BAAkB,EAAC,MAAM,E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,CAAC,CAAC;QAC3D,CAAC;aAAM,IAAI,IAAI,YAAY,sBAAS,EAAE,CAAC;YACrC,eAAe,GAAG,IAAI,4BAAiB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;QACtE,CAAC;aAAM,CAAC;YACN,eAAe,GAAG,IAAI,CAAC;QACzB,CAAC;QAED,OAAO;YACL,eAAe;SAChB,CAAC;IACJ,CAAC;CAAA;AAED;;GAEG;AACI,MAAM,YAAY,GAAG,GAAqC,EAAE,CACjE,IAAI,oBAAS,CAAC,mBAAmB,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAD1D,QAAA,YAAY,gBAC8C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Procedure } from '../../internal';
|
|
2
|
+
import { RevokeSubsidyParams } from '../../types';
|
|
3
|
+
import { ExtrinsicParams, TransactionSpec } from '../../types/internal';
|
|
4
|
+
/**
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
7
|
+
export declare function prepareRevokeSubsidy(this: Procedure<RevokeSubsidyParams, void>, args: RevokeSubsidyParams): Promise<TransactionSpec<void, ExtrinsicParams<'relayer', 'revokeSubsidy'>>>;
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export declare const revokeSubsidy: () => Procedure<RevokeSubsidyParams, void>;
|
|
12
|
+
//# sourceMappingURL=revokeSubsidy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revokeSubsidy.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/revokeSubsidy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAa,mBAAmB,EAAU,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAIpE;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,SAAS,CAAC,mBAAmB,EAAE,IAAI,CAAC,EAC1C,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC,CAsC7E;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,QAAO,SAAS,CAAC,mBAAmB,EAAE,IAAI,CAQhE,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
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.revokeSubsidy = void 0;
|
|
13
|
+
exports.prepareRevokeSubsidy = prepareRevokeSubsidy;
|
|
14
|
+
const internal_1 = require("../../internal");
|
|
15
|
+
const types_1 = require("../../types");
|
|
16
|
+
const conversion_1 = require("../../utils/conversion");
|
|
17
|
+
const internal_2 = require("../../utils/internal");
|
|
18
|
+
/**
|
|
19
|
+
* @hidden
|
|
20
|
+
*/
|
|
21
|
+
function prepareRevokeSubsidy(args) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const { context: { polymeshApi: { tx }, }, context, } = this;
|
|
24
|
+
const { beneficiary } = args;
|
|
25
|
+
if (context.isV7) {
|
|
26
|
+
throw new internal_1.PolymeshError({
|
|
27
|
+
code: types_1.ErrorCode.NotSupported,
|
|
28
|
+
message: 'This method is not supported for chain 7.x.',
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const beneficiaryAccount = (0, internal_2.asAccount)(beneficiary, context);
|
|
32
|
+
const { address: beneficiaryAddress } = beneficiaryAccount;
|
|
33
|
+
const actingAccount = yield context.getActingAccount();
|
|
34
|
+
const [pendingSubsidy] = yield context.getPendingSubsidies(beneficiaryAccount, [actingAccount]);
|
|
35
|
+
if (!pendingSubsidy) {
|
|
36
|
+
throw new internal_1.PolymeshError({
|
|
37
|
+
code: types_1.ErrorCode.DataUnavailable,
|
|
38
|
+
message: 'There is no pending subsidy to revoke',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const rawBeneficiary = (0, conversion_1.stringToAccountId)(beneficiaryAddress, context);
|
|
42
|
+
return {
|
|
43
|
+
transaction: tx.relayer.revokeSubsidy,
|
|
44
|
+
args: [rawBeneficiary],
|
|
45
|
+
resolver: undefined,
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
const revokeSubsidy = () => new internal_1.Procedure(prepareRevokeSubsidy, {
|
|
53
|
+
roles: [],
|
|
54
|
+
permissions: {
|
|
55
|
+
assets: [],
|
|
56
|
+
portfolios: [],
|
|
57
|
+
transactions: [types_1.TxTags.relayer.RevokeSubsidy],
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
exports.revokeSubsidy = revokeSubsidy;
|
|
61
|
+
//# sourceMappingURL=revokeSubsidy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revokeSubsidy.js","sourceRoot":"","sources":["../../../src/api/procedures/revokeSubsidy.ts"],"names":[],"mappings":";;;;;;;;;;;;AASA,oDAyCC;AAlDD,yCAAsD;AACtD,mCAAiE;AAEjE,mDAAuD;AACvD,+CAA6C;AAE7C;;GAEG;AACH,SA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AAE;QACd,YAAY,EAAE,CAAC,cAAM,CAAC,OAAO,CAAC,aAAa,CAAC;KAC7C;CACF,CAAC,CAAC;AARQ,QAAA,aAAa,iBAQrB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ISubmittableResult } from '@polkadot/types/types';
|
|
2
|
+
import { Context, Identity, Procedure } from '../../internal';
|
|
3
|
+
import { ExtrinsicParams, ProcedureAuthorization, TransactionSpec } from '../../types/internal';
|
|
4
|
+
/**
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
7
|
+
export declare const createSelfRegisterDidResolver: (context: Context) => (receipt: ISubmittableResult) => Identity;
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export declare function prepareSelfRegisterDid(this: Procedure<void, Identity>): Promise<TransactionSpec<Identity, ExtrinsicParams<'identity', 'selfRegisterDid'>>>;
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
export declare function getAuthorization(): ProcedureAuthorization;
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
export declare const selfRegisterDid: () => Procedure<void, Identity>;
|
|
20
|
+
//# sourceMappingURL=selfRegisterDid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selfRegisterDid.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/selfRegisterDid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAiB,SAAS,EAAE,MAAM,YAAY,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAI5F;;GAEG;AACH,eAAO,MAAM,6BAA6B,GACvC,SAAS,OAAO,MAChB,SAAS,kBAAkB,KAAG,QAQ9B,CAAC;AAEJ;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,GAC9B,OAAO,CAAC,eAAe,CAAC,QAAQ,EAAE,eAAe,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC,CA8BpF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,sBAAsB,CAIzD;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,QAAO,SAAS,CAAC,IAAI,EAAE,QAAQ,CACF,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
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.selfRegisterDid = exports.createSelfRegisterDidResolver = void 0;
|
|
13
|
+
exports.prepareSelfRegisterDid = prepareSelfRegisterDid;
|
|
14
|
+
exports.getAuthorization = getAuthorization;
|
|
15
|
+
const internal_1 = require("../../internal");
|
|
16
|
+
const types_1 = require("../../types");
|
|
17
|
+
const conversion_1 = require("../../utils/conversion");
|
|
18
|
+
const internal_2 = require("../../utils/internal");
|
|
19
|
+
/**
|
|
20
|
+
* @hidden
|
|
21
|
+
*/
|
|
22
|
+
const createSelfRegisterDidResolver = (context) => (receipt) => {
|
|
23
|
+
const [record] = (0, internal_2.filterEventRecords)(receipt, 'identity', 'DidCreated');
|
|
24
|
+
const { data } = record;
|
|
25
|
+
const did = (0, conversion_1.identityIdToString)(data[0]);
|
|
26
|
+
return new internal_1.Identity({ did }, context);
|
|
27
|
+
};
|
|
28
|
+
exports.createSelfRegisterDidResolver = createSelfRegisterDidResolver;
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
function prepareSelfRegisterDid() {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
const { context: { polymeshApi: { tx }, }, context, } = this;
|
|
35
|
+
if (context.isV7) {
|
|
36
|
+
throw new internal_1.PolymeshError({
|
|
37
|
+
code: types_1.ErrorCode.NotSupported,
|
|
38
|
+
message: 'selfRegisterDid is only supported in chain v8',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const actingAccount = yield context.getActingAccount();
|
|
42
|
+
const identityExists = yield actingAccount.getIdentity();
|
|
43
|
+
if (identityExists) {
|
|
44
|
+
throw new internal_1.PolymeshError({
|
|
45
|
+
code: types_1.ErrorCode.NoDataChange,
|
|
46
|
+
message: 'The signing Account already has an Identity',
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
transaction: tx.identity.selfRegisterDid,
|
|
51
|
+
resolver: (0, exports.createSelfRegisterDidResolver)(context),
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @hidden
|
|
57
|
+
*/
|
|
58
|
+
function getAuthorization() {
|
|
59
|
+
return {
|
|
60
|
+
signerPermissions: true,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* @hidden
|
|
65
|
+
*/
|
|
66
|
+
const selfRegisterDid = () => new internal_1.Procedure(prepareSelfRegisterDid, getAuthorization);
|
|
67
|
+
exports.selfRegisterDid = selfRegisterDid;
|
|
68
|
+
//# sourceMappingURL=selfRegisterDid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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L,WAAW,EAAE,EAAE,CAAC,QAAQ,CAAC,eAAe;YACxC,QAAQ,EAAE,IAAA,qCAA6B,EAAC,OAAO,CAAC;SACjD,CAAC;IACJ,CAAC;CAAA;AAED;;GAEG;AACH,SAAgB,gBAAgB;IAC9B,OAAO;QACL,iBAAiB,EAAE,IAAI;KACxB,CAAC;AACJ,CAAC;AAED;;GAEG;AACI,MAAM,eAAe,GAAG,GAA8B,EAAE,CAC7D,IAAI,oBAAS,CAAC,sBAAsB,EAAE,gBAAgB,CAAC,CAAC;AAD7C,QAAA,eAAe,mBAC8B"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PolymeshPrimitivesStatisticsStatType } from '../../../node_modules/@polymeshassociation/polymesh-types/polkadot/types-lookup';
|
|
2
|
+
import { BTreeSet } from '@polkadot/types-codec';
|
|
1
3
|
import { Procedure } from '../../internal';
|
|
2
4
|
import { FungibleAsset, SetTransferRestrictionStatParams } from '../../types';
|
|
3
5
|
import { BatchTransactionSpec, ProcedureAuthorization } from '../../types/internal';
|
|
@@ -10,13 +12,23 @@ export type SetAssetStatParams = {
|
|
|
10
12
|
/**
|
|
11
13
|
* @hidden
|
|
12
14
|
*/
|
|
13
|
-
export
|
|
15
|
+
export interface SetAssetStatsStorage {
|
|
16
|
+
currentStats: BTreeSet<PolymeshPrimitivesStatisticsStatType>;
|
|
17
|
+
}
|
|
14
18
|
/**
|
|
15
19
|
* @hidden
|
|
16
20
|
*/
|
|
17
|
-
export declare function
|
|
21
|
+
export declare function prepareSetAssetStats(this: Procedure<SetAssetStatParams, void, SetAssetStatsStorage>, args: SetAssetStatParams): Promise<BatchTransactionSpec<void, unknown[][]>>;
|
|
18
22
|
/**
|
|
19
23
|
* @hidden
|
|
20
24
|
*/
|
|
21
|
-
export declare
|
|
25
|
+
export declare function prepareStorage(this: Procedure<SetAssetStatParams, void, SetAssetStatsStorage>, { asset }: SetAssetStatParams): Promise<SetAssetStatsStorage>;
|
|
26
|
+
/**
|
|
27
|
+
* @hidden
|
|
28
|
+
*/
|
|
29
|
+
export declare function getAuthorization(this: Procedure<SetAssetStatParams, void, SetAssetStatsStorage>, { asset, stats }: SetAssetStatParams): ProcedureAuthorization;
|
|
30
|
+
/**
|
|
31
|
+
* @hidden
|
|
32
|
+
*/
|
|
33
|
+
export declare const setAssetStats: () => Procedure<SetAssetStatParams, void, SetAssetStatsStorage>;
|
|
22
34
|
//# sourceMappingURL=setAssetStats.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setAssetStats.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/setAssetStats.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setAssetStats.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/setAssetStats.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oCAAoC,EAErC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAA0B,SAAS,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAML,aAAa,EACb,gCAAgC,EAIjC,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAgBhF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAAE,KAAK,EAAE,aAAa,CAAA;CAAE,GAAG,gCAAgC,CAAC;AAE7F;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,QAAQ,CAAC,oCAAoC,CAAC,CAAC;CAC9D;AAmCD;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,SAAS,CAAC,kBAAkB,EAAE,IAAI,EAAE,oBAAoB,CAAC,EAC/D,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,CAgElD;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,SAAS,CAAC,kBAAkB,EAAE,IAAI,EAAE,oBAAoB,CAAC,EAC/D,EAAE,KAAK,EAAE,EAAE,kBAAkB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CAgB/B;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,SAAS,CAAC,kBAAkB,EAAE,IAAI,EAAE,oBAAoB,CAAC,EAC/D,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,kBAAkB,GACnC,sBAAsB,CA2CxB;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,QAAO,SAAS,CAAC,kBAAkB,EAAE,IAAI,EAAE,oBAAoB,CAClB,CAAC"}
|
|
@@ -1,63 +1,131 @@
|
|
|
1
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
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.setAssetStats = void 0;
|
|
4
13
|
exports.prepareSetAssetStats = prepareSetAssetStats;
|
|
14
|
+
exports.prepareStorage = prepareStorage;
|
|
5
15
|
exports.getAuthorization = getAuthorization;
|
|
6
16
|
const internal_1 = require("../../internal");
|
|
7
17
|
const types_1 = require("../../types");
|
|
8
18
|
const conversion_1 = require("../../utils/conversion");
|
|
9
19
|
const internal_2 = require("../../utils/internal");
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
function statToStatUpdates(stat, context) {
|
|
24
|
+
const { type } = stat;
|
|
25
|
+
if (type === types_1.StatType.Count && stat.count !== undefined) {
|
|
26
|
+
return (0, conversion_1.countStatInputToStatUpdates)(stat, context);
|
|
27
|
+
}
|
|
28
|
+
if (type === types_1.StatType.ScopedCount && stat.value !== undefined) {
|
|
29
|
+
return (0, conversion_1.claimCountStatInputToStatUpdates)(stat, context);
|
|
30
|
+
}
|
|
31
|
+
if (type === types_1.StatType.Balance && stat.balance !== undefined) {
|
|
32
|
+
return (0, conversion_1.balanceStatInputToStatUpdates)(stat, context);
|
|
33
|
+
}
|
|
34
|
+
if (type === types_1.StatType.ScopedBalance && stat.value !== undefined) {
|
|
35
|
+
return (0, conversion_1.claimBalanceStatInputToStatUpdates)(stat, context);
|
|
36
|
+
}
|
|
37
|
+
// Return empty BTreeSet when no value is provided
|
|
38
|
+
return (0, conversion_1.statUpdatesToBtreeStatUpdate)([], context);
|
|
39
|
+
}
|
|
10
40
|
/**
|
|
11
41
|
* @hidden
|
|
12
42
|
*/
|
|
13
43
|
function prepareSetAssetStats(args) {
|
|
14
|
-
const { context: { polymeshApi: { tx: { statistics }, }, }, context, } = this;
|
|
44
|
+
const { context: { polymeshApi: { tx: { statistics }, }, }, context, storage: { currentStats }, } = this;
|
|
15
45
|
const { asset, stats } = args;
|
|
16
46
|
const rawAssetId = (0, conversion_1.assetToMeshAssetId)(asset, context);
|
|
17
|
-
const newStats = [];
|
|
18
47
|
const transactions = [];
|
|
19
|
-
|
|
20
|
-
stats.
|
|
48
|
+
// Build new stats list and compare with current stats
|
|
49
|
+
const rawStats = stats.map(stat => (0, conversion_1.statParamsToMeshStatType)(stat, context));
|
|
50
|
+
const rawNewStats = (0, conversion_1.statisticStatTypesToBtreeStatType)(rawStats, context);
|
|
51
|
+
// If the new stats set differs from the current one, create a setActiveAssetStats transaction
|
|
52
|
+
if (!rawNewStats.hash.eq(currentStats.hash)) {
|
|
53
|
+
transactions.push((0, internal_2.checkTxType)({
|
|
54
|
+
transaction: statistics.setActiveAssetStats,
|
|
55
|
+
args: [rawAssetId, rawNewStats],
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
// Create a separate batchUpdateAssetStats transaction for each stat that has a value
|
|
59
|
+
for (const stat of stats) {
|
|
21
60
|
const type = stat.type;
|
|
22
61
|
const operationType = (0, conversion_1.statTypeToStatOpType)(type, context);
|
|
23
62
|
let rawClaimIssuer;
|
|
24
63
|
if (type === types_1.StatType.ScopedCount || type === types_1.StatType.ScopedBalance) {
|
|
25
64
|
rawClaimIssuer = (0, conversion_1.claimIssuerToMeshClaimIssuer)(stat, context);
|
|
26
65
|
}
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (type === types_1.StatType.Count) {
|
|
32
|
-
const statValue = (0, conversion_1.countStatInputToStatUpdates)(stat, context);
|
|
33
|
-
updateTransactions.push((0, internal_2.checkTxType)({
|
|
34
|
-
transaction: statistics.batchUpdateAssetStats,
|
|
35
|
-
args: [rawAssetId, newStat, statValue],
|
|
36
|
-
}));
|
|
37
|
-
}
|
|
38
|
-
else if (type === types_1.StatType.ScopedCount) {
|
|
39
|
-
const statValue = (0, conversion_1.claimCountStatInputToStatUpdates)(stat, context);
|
|
40
|
-
updateTransactions.push((0, internal_2.checkTxType)({
|
|
66
|
+
const statType = (0, conversion_1.statisticsOpTypeToStatType)({ operationType, claimIssuer: rawClaimIssuer }, context);
|
|
67
|
+
const rawUpdates = statToStatUpdates(stat, context);
|
|
68
|
+
if (!rawUpdates.isEmpty) {
|
|
69
|
+
transactions.push((0, internal_2.checkTxType)({
|
|
41
70
|
transaction: statistics.batchUpdateAssetStats,
|
|
42
|
-
args: [rawAssetId,
|
|
71
|
+
args: [rawAssetId, statType, rawUpdates],
|
|
43
72
|
}));
|
|
44
73
|
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
74
|
+
}
|
|
75
|
+
if (transactions.length === 0) {
|
|
76
|
+
throw new internal_1.PolymeshError({
|
|
77
|
+
code: types_1.ErrorCode.NoDataChange,
|
|
78
|
+
message: 'The supplied stat types are already set and no new values were provided',
|
|
79
|
+
});
|
|
80
|
+
}
|
|
52
81
|
return Promise.resolve({ transactions, resolver: undefined });
|
|
53
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* @hidden
|
|
85
|
+
*/
|
|
86
|
+
function prepareStorage(_a) {
|
|
87
|
+
return __awaiter(this, arguments, void 0, function* ({ asset }) {
|
|
88
|
+
const { context: { polymeshApi: { query: { statistics }, }, }, context, } = this;
|
|
89
|
+
const rawAssetId = (0, conversion_1.assetToMeshAssetId)(asset, context);
|
|
90
|
+
const currentStats = yield statistics.activeAssetStats(rawAssetId);
|
|
91
|
+
return {
|
|
92
|
+
currentStats,
|
|
93
|
+
};
|
|
94
|
+
});
|
|
95
|
+
}
|
|
54
96
|
/**
|
|
55
97
|
* @hidden
|
|
56
98
|
*/
|
|
57
99
|
function getAuthorization({ asset, stats }) {
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
|
|
100
|
+
const { storage: { currentStats }, context, } = this;
|
|
101
|
+
const hasValues = stats.some(stat => {
|
|
102
|
+
const { type } = stat;
|
|
103
|
+
if (type === types_1.StatType.Count) {
|
|
104
|
+
return stat.count !== undefined;
|
|
105
|
+
}
|
|
106
|
+
else if (type === types_1.StatType.ScopedCount) {
|
|
107
|
+
return stat.value !== undefined;
|
|
108
|
+
}
|
|
109
|
+
else if (type === types_1.StatType.Balance) {
|
|
110
|
+
return stat.balance !== undefined;
|
|
111
|
+
}
|
|
112
|
+
else if (type === types_1.StatType.ScopedBalance) {
|
|
113
|
+
return stat.value !== undefined;
|
|
114
|
+
}
|
|
115
|
+
throw new internal_1.PolymeshError({
|
|
116
|
+
code: types_1.ErrorCode.UnexpectedError,
|
|
117
|
+
message: `Unsupported stat type: ${type}. Please report this to the Polymesh team`,
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
// Build new stats list and compare with current stats
|
|
121
|
+
const rawStats = stats.map(stat => (0, conversion_1.statParamsToMeshStatType)(stat, context));
|
|
122
|
+
const rawNewStats = (0, conversion_1.statisticStatTypesToBtreeStatType)(rawStats, context);
|
|
123
|
+
const transactions = [];
|
|
124
|
+
// If the new stats set differs from the current one, push a setActiveAssetStats transaction
|
|
125
|
+
if (!rawNewStats.hash.eq(currentStats.hash)) {
|
|
126
|
+
transactions.push(types_1.TxTags.statistics.SetActiveAssetStats);
|
|
127
|
+
}
|
|
128
|
+
if (hasValues) {
|
|
61
129
|
transactions.push(types_1.TxTags.statistics.BatchUpdateAssetStats);
|
|
62
130
|
}
|
|
63
131
|
return {
|
|
@@ -71,6 +139,6 @@ function getAuthorization({ asset, stats }) {
|
|
|
71
139
|
/**
|
|
72
140
|
* @hidden
|
|
73
141
|
*/
|
|
74
|
-
const setAssetStats = () => new internal_1.Procedure(prepareSetAssetStats, getAuthorization);
|
|
142
|
+
const setAssetStats = () => new internal_1.Procedure(prepareSetAssetStats, getAuthorization, prepareStorage);
|
|
75
143
|
exports.setAssetStats = setAssetStats;
|
|
76
144
|
//# sourceMappingURL=setAssetStats.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setAssetStats.js","sourceRoot":"","sources":["../../../src/api/procedures/setAssetStats.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setAssetStats.js","sourceRoot":"","sources":["../../../src/api/procedures/setAssetStats.ts"],"names":[],"mappings":";;;;;;;;;;;;AAmFA,oDAmEC;AAKD,wCAmBC;AAKD,4CA8CC;AA3ND,yCAA+D;AAC/D,mCAWiB;AAEjB,mDAY4B;AAC5B,+CAA+C;AAc/C;;GAEG;AACH,SAAS,iBAAiB,CACxB,IAI6B,EAC7B,OAAgB;IAEhB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IAEtB,IAAI,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from '../../types';
|
|
3
|
+
import { ExtrinsicParams, ProcedureAuthorization, TransactionSpec } from '../../types/internal';
|
|
4
|
+
/**
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
7
|
+
export interface Params {
|
|
8
|
+
did: string;
|
|
9
|
+
requirement: ReceiverAffirmationRequirement;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @hidden
|
|
13
|
+
*/
|
|
14
|
+
export interface Storage {
|
|
15
|
+
identity: Identity;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
export declare function prepareSetMandatoryReceiverAffirmation(this: Procedure<Params, void, Storage>, args: Params): Promise<TransactionSpec<void, ExtrinsicParams<'settlement', 'setMandatoryReceiverAffirmation'>>>;
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
export declare function getAuthorization(this: Procedure<Params, void, Storage>, { did }: Params): ProcedureAuthorization;
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
export declare function prepareStorage(this: Procedure<Params, void, Storage>): Promise<Storage>;
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
export declare const setMandatoryReceiverAffirmation: () => Procedure<Params, void, Storage>;
|
|
33
|
+
//# sourceMappingURL=setMandatoryReceiverAffirmation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setMandatoryReceiverAffirmation.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/setMandatoryReceiverAffirmation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAa,QAAQ,EAAE,8BAA8B,EAAU,MAAM,SAAS,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAG5F;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,8BAA8B,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;GAEG;AACH,wBAAsB,sCAAsC,CAC1D,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,EACtC,IAAI,EAAE,MAAM,GACX,OAAO,CACR,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,YAAY,EAAE,iCAAiC,CAAC,CAAC,CACxF,CAyCA;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,EACtC,EAAE,GAAG,EAAE,EAAE,MAAM,GACd,sBAAsB,CAmBxB;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAM7F;AAED;;GAEG;AACH,eAAO,MAAM,+BAA+B,QAAO,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CACO,CAAC"}
|