@polymeshassociation/polymesh-sdk 29.1.0-beta.4 → 29.1.0-beta.6
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/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +3 -2
- package/api/entities/CustomPermissionGroup.d.ts.map +1 -1
- package/api/entities/CustomPermissionGroup.js +3 -1
- package/api/entities/CustomPermissionGroup.js.map +1 -1
- package/api/entities/KnownPermissionGroup.d.ts.map +1 -1
- package/api/entities/KnownPermissionGroup.js +3 -1
- package/api/entities/KnownPermissionGroup.js.map +1 -1
- package/api/procedures/createTransactionBatch.d.ts +3 -0
- package/api/procedures/createTransactionBatch.d.ts.map +1 -1
- package/api/procedures/createTransactionBatch.js +26 -8
- package/api/procedures/createTransactionBatch.js.map +1 -1
- package/api/procedures/transferPolyx.d.ts.map +1 -1
- package/api/procedures/transferPolyx.js +30 -17
- package/api/procedures/transferPolyx.js.map +1 -1
- package/api/procedures/types.d.ts +113 -64
- package/api/procedures/types.d.ts.map +1 -1
- package/api/procedures/types.js +98 -57
- package/api/procedures/types.js.map +1 -1
- package/base/PolymeshTransactionBase.d.ts +8 -0
- package/base/PolymeshTransactionBase.d.ts.map +1 -1
- package/base/PolymeshTransactionBase.js +10 -2
- package/base/PolymeshTransactionBase.js.map +1 -1
- package/npm-package/{polymeshassociation-polymesh-sdk-29.1.0-beta.4.tgz → polymeshassociation-polymesh-sdk-29.1.0-beta.6.tgz} +0 -0
- package/package.json +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/index.js +1 -0
- package/types/index.js.map +1 -1
- package/types/internal.d.ts +8 -0
- package/types/internal.d.ts.map +1 -1
- package/types/internal.js.map +1 -1
- package/types/txGroupConstants.d.ts +318 -0
- package/types/txGroupConstants.d.ts.map +1 -0
- package/types/txGroupConstants.js +506 -0
- package/types/txGroupConstants.js.map +1 -0
- package/utils/conversion.d.ts.map +1 -1
- package/utils/conversion.js +1 -87
- package/utils/conversion.js.map +1 -1
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
# [29.1.0-beta.
|
|
1
|
+
# [29.1.0-beta.6](https://github.com/PolymeshAssociation/polymesh-sdk/compare/v29.1.0-beta.5...v29.1.0-beta.6) (2025-10-09)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Features
|
|
5
5
|
|
|
6
|
-
* 🎸
|
|
6
|
+
* 🎸 add preRunValidation function for transaction procedures ([8a82490](https://github.com/PolymeshAssociation/polymesh-sdk/commit/8a824907cdffed27d6029360514a56c928778f24))
|
|
7
|
+
* 🎸 implement preRunValidation handling in createTransactionBatch procedure ([e612113](https://github.com/PolymeshAssociation/polymesh-sdk/commit/e612113c59c0475b5f47f624909719e3bc50a8ca))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomPermissionGroup.d.ts","sourceRoot":"","sources":["../../../src/api/entities/CustomPermissionGroup.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAuB,MAAM,YAAY,CAAC;AAC3E,OAAO,
|
|
1
|
+
{"version":3,"file":"CustomPermissionGroup.d.ts","sourceRoot":"","sources":["../../../src/api/entities/CustomPermissionGroup.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAuB,MAAM,YAAY,CAAC;AAC3E,OAAO,EAGL,gBAAgB,EAChB,eAAe,EACf,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AAUjB,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,SAAS,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,eAAe;IACxD;;;OAGG;WACoB,mBAAmB,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,IAAI,iBAAiB;IAMzF,EAAE,EAAE,SAAS,CAAC;IAErB;;OAEG;gBACgB,WAAW,EAAE,iBAAiB,EAAE,OAAO,EAAE,OAAO;IAanE;;OAEG;IACI,cAAc,EAAE,eAAe,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAC;IAExE;;OAEG;IACU,cAAc,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAiCxD;;OAEG;IACU,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAWvC;;OAEG;IACI,OAAO,IAAI,aAAa;CAShC"}
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.CustomPermissionGroup = void 0;
|
|
16
16
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
17
17
|
const internal_1 = require("../../internal");
|
|
18
|
+
const types_1 = require("../../types");
|
|
18
19
|
const conversion_1 = require("../../utils/conversion");
|
|
19
20
|
const internal_2 = require("../../utils/internal");
|
|
20
21
|
/**
|
|
@@ -48,7 +49,8 @@ class CustomPermissionGroup extends internal_1.PermissionGroup {
|
|
|
48
49
|
const rawAgId = (0, conversion_1.bigNumberToU32)(id, context);
|
|
49
50
|
const rawGroupPermissions = yield externalAgents.groupPermissions(rawAssetId, rawAgId);
|
|
50
51
|
const { permissions } = (0, conversion_1.extrinsicPermissionsToTransactionPermissions)(rawGroupPermissions.unwrap());
|
|
51
|
-
const
|
|
52
|
+
const allTransactionGroups = (0, conversion_1.transactionPermissionsToTxGroups)(permissions);
|
|
53
|
+
const transactionGroups = allTransactionGroups.filter(group => types_1.AGENT_TX_GROUP_VALUES.includes(group));
|
|
52
54
|
return {
|
|
53
55
|
transactions: permissions,
|
|
54
56
|
transactionGroups,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomPermissionGroup.js","sourceRoot":"","sources":["../../../src/api/entities/CustomPermissionGroup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAAqC;AAErC,yCAA2E;
|
|
1
|
+
{"version":3,"file":"CustomPermissionGroup.js","sourceRoot":"","sources":["../../../src/api/entities/CustomPermissionGroup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAAqC;AAErC,yCAA2E;AAC3E,mCAMiB;AACjB,mDAM4B;AAC5B,+CAA0E;AAY1E;;GAEG;AACH,MAAa,qBAAsB,SAAQ,0BAAe;IACxD;;;OAGG;IACI,MAAM,CAAU,mBAAmB,CAAC,UAAmB;QAC5D,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,UAA+B,CAAC;QAExD,OAAO,EAAE,YAAY,sBAAS,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC;IAChE,CAAC;IAID;;OAEG;IACH,YAAmB,WAA8B,EAAE,OAAgB;QACjE,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAE5B,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW,CAAC;QAE3B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,IAAI,CAAC,cAAc,GAAG,IAAA,gCAAqB,EACzC,EAAE,mBAAmB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,8BAAmB,kBAAI,KAAK,EAAE,IAAI,IAAK,IAAI,EAAG,EAAE,EAChF,OAAO,CACR,CAAC;IACJ,CAAC;IAOD;;OAEG;IACU,cAAc;;YACzB,MAAM,EACJ,OAAO,EAAE,EACP,WAAW,EAAE,EACX,KAAK,EAAE,EAAE,cAAc,EAAE,GAC1B,GACF,EACD,OAAO,EACP,KAAK,EACL,EAAE,GACH,GAAG,IAAI,CAAC;YAET,MAAM,UAAU,GAAG,IAAA,+BAAkB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAEtD,MAAM,OAAO,GAAG,IAAA,2BAAc,EAAC,E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sources":["../../../src/api/entities/KnownPermissionGroup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,
|
|
1
|
+
{"version":3,"file":"KnownPermissionGroup.d.ts","sourceRoot":"","sources":["../../../src/api/entities/KnownPermissionGroup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAGL,gBAAgB,EAEhB,mBAAmB,EAGpB,MAAM,SAAS,CAAC;AAIjB,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,eAAe;IACvD;;;OAGG;WACoB,mBAAmB,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,IAAI,iBAAiB;IAMzF,IAAI,EAAE,mBAAmB,CAAC;IAEjC;;OAEG;gBACgB,WAAW,EAAE,iBAAiB,EAAE,OAAO,EAAE,OAAO;IAQnE;;OAEG;IACI,cAAc,IAAI,OAAO,CAAC,gBAAgB,CAAC;IA8ClD;;OAEG;IACI,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAIjC;;OAEG;IACI,OAAO,IAAI,aAAa;CAQhC"}
|
|
@@ -61,9 +61,11 @@ class KnownPermissionGroup extends internal_1.PermissionGroup {
|
|
|
61
61
|
transactions = null;
|
|
62
62
|
break;
|
|
63
63
|
}
|
|
64
|
+
const allTransactionGroups = transactions ? (0, conversion_1.transactionPermissionsToTxGroups)(transactions) : [];
|
|
65
|
+
const transactionGroups = allTransactionGroups.filter(group => types_1.AGENT_TX_GROUP_VALUES.includes(group));
|
|
64
66
|
return Promise.resolve({
|
|
65
67
|
transactions,
|
|
66
|
-
transactionGroups
|
|
68
|
+
transactionGroups,
|
|
67
69
|
});
|
|
68
70
|
}
|
|
69
71
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KnownPermissionGroup.js","sourceRoot":"","sources":["../../../src/api/entities/KnownPermissionGroup.ts"],"names":[],"mappings":";;;AAAA,yCAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"KnownPermissionGroup.js","sourceRoot":"","sources":["../../../src/api/entities/KnownPermissionGroup.ts"],"names":[],"mappings":";;;AAAA,yCAAsD;AACtD,mCAQiB;AACjB,mDAAsE;AACtE,+CAAmD;AAYnD;;GAEG;AACH,MAAa,oBAAqB,SAAQ,0BAAe;IACvD;;;OAGG;IACI,MAAM,CAAU,mBAAmB,CAAC,UAAmB;QAC5D,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,UAA+B,CAAC;QAE1D,OAAO,IAAI,IAAI,2BAAmB,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC;IACpE,CAAC;IAID;;OAEG;IACH,YAAmB,WAA8B,EAAE,OAAgB;QACjE,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAE5B,MAAM,EAAE,IAAI,EAAE,GAAG,WAAW,CAAC;QAE7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED;;OAEG;IACI,cAAc;QACnB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;QACtB,IAAI,YAAY,CAAC;QAEjB,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,2BAAmB,CAAC,UAAU;gBACjC,YAAY,GAAG,EAAE,MAAM,EAAE,CAAC,kBAAU,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,sBAAc,CAAC,OAAO,EAAE,CAAC;gBACrF,MAAM;YACR,KAAK,2BAAmB,CAAC,aAAa;gBACpC,YAAY,GAAG;oBACb,MAAM,EAAE;wBACN,kBAAU,CAAC,mBAAmB;wBAC9B,kBAAU,CAAC,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ch.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiD,SAAS,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EAAE,4BAA4B,EAAE,KAAK,EAAU,MAAM,SAAS,CAAC;AACtE,OAAO,EACL,oBAAoB,EAEpB,sBAAsB,EACtB,gBAAgB,EAEhB,UAAU,EACX,MAAM,kBAAkB,CAAC;AAK1B,MAAM,WAAW,OAAO;IACtB,qBAAqB,EAAE,UAAU,EAAE,CAAC;IACpC,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,SAAS,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"createTransactionBatch.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/createTransactionBatch.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiD,SAAS,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EAAE,4BAA4B,EAAE,KAAK,EAAU,MAAM,SAAS,CAAC;AACtE,OAAO,EACL,oBAAoB,EAEpB,sBAAsB,EACtB,gBAAgB,EAEhB,UAAU,EACX,MAAM,kBAAkB,CAAC;AAK1B,MAAM,WAAW,OAAO;IACtB,qBAAqB,EAAE,UAAU,EAAE,CAAC;IACpC,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,SAAS,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC;IACvC,iBAAiB,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE;QAAE,UAAU,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC;CACvF;AAED;;GAEG;AACH,wBAAsB,6BAA6B,CAAC,YAAY,SAAS,OAAO,EAAE,EAChF,IAAI,EAAE,SAAS,CAAC,4BAA4B,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,GACjF,OAAO,CAAC,oBAAoB,CAAC,YAAY,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,CAuB1D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,SAAS,OAAO,EAAE,EAC7D,IAAI,EAAE,SAAS,CAAC,4BAA4B,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,GACjF,sBAAsB,CAUxB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,YAAY,SAAS,OAAO,EAAE,EAC3D,IAAI,EAAE,SAAS,CAAC,4BAA4B,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,EAClF,IAAI,EAAE,4BAA4B,CAAC,YAAY,CAAC,GAC/C,OAAO,CAuHT;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAAI,YAAY,SAAS,OAAO,EAAE,OAAK,SAAS,CACjF,4BAA4B,CAAC,YAAY,CAAC,EAC1C,YAAY,EACZ,OAAO,CAMN,CAAC"}
|
|
@@ -25,10 +25,22 @@ const internal_3 = require("../../utils/internal");
|
|
|
25
25
|
*/
|
|
26
26
|
function prepareCreateTransactionBatch() {
|
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
const { processedTransactions: transactions, resolvers } = this.storage;
|
|
28
|
+
const { processedTransactions: transactions, resolvers, preRunValidations } = this.storage;
|
|
29
|
+
// Combine all preRunValidation functions into one
|
|
30
|
+
const combinedPreRunValidation = preRunValidations.some(v => v !== undefined)
|
|
31
|
+
? (args) => __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
yield Promise.all(preRunValidations.map(validation => {
|
|
33
|
+
if (validation) {
|
|
34
|
+
return validation(args);
|
|
35
|
+
}
|
|
36
|
+
return Promise.resolve();
|
|
37
|
+
}));
|
|
38
|
+
})
|
|
39
|
+
: undefined;
|
|
29
40
|
return {
|
|
30
41
|
transactions,
|
|
31
42
|
resolver: receipt => Promise.all(resolvers.map(resolver => resolver(receipt))),
|
|
43
|
+
preRunValidation: combinedPreRunValidation,
|
|
32
44
|
};
|
|
33
45
|
});
|
|
34
46
|
}
|
|
@@ -51,6 +63,7 @@ function prepareStorage(args) {
|
|
|
51
63
|
const resolvers = [];
|
|
52
64
|
const transactions = [];
|
|
53
65
|
const tags = [];
|
|
66
|
+
const preRunValidations = [];
|
|
54
67
|
/*
|
|
55
68
|
* We extract each transaction spec and build an array of all transactions (with args and fees), resolvers and transformers,
|
|
56
69
|
* to create a new batch spec that contains everything. We use the resolvers and transformers to
|
|
@@ -63,7 +76,7 @@ function prepareStorage(args) {
|
|
|
63
76
|
const [firstTx] = inputTransactions;
|
|
64
77
|
if (inputTransactions.length === 1 && (0, utils_1.isPolymeshTransaction)(firstTx)) {
|
|
65
78
|
const spec = internal_1.PolymeshTransaction.toTransactionSpec(firstTx);
|
|
66
|
-
const { transaction: tx, args: txArgs, fee, feeMultiplier } = spec;
|
|
79
|
+
const { transaction: tx, args: txArgs, fee, feeMultiplier, preRunValidation } = spec;
|
|
67
80
|
transactions.push({
|
|
68
81
|
transaction: tx,
|
|
69
82
|
args: txArgs,
|
|
@@ -71,6 +84,7 @@ function prepareStorage(args) {
|
|
|
71
84
|
feeMultiplier,
|
|
72
85
|
});
|
|
73
86
|
tags.push((0, conversion_1.transactionToTxTag)(tx));
|
|
87
|
+
preRunValidations.push(preRunValidation);
|
|
74
88
|
const { transformer = lodash_1.identity, resolver } = spec;
|
|
75
89
|
resolvers.push((receipt) => __awaiter(this, void 0, void 0, function* () {
|
|
76
90
|
let value;
|
|
@@ -86,14 +100,15 @@ function prepareStorage(args) {
|
|
|
86
100
|
processedTransactions: transactions,
|
|
87
101
|
resolvers,
|
|
88
102
|
tags,
|
|
103
|
+
preRunValidations,
|
|
89
104
|
};
|
|
90
105
|
}
|
|
91
|
-
|
|
106
|
+
for (const transaction of inputTransactions) {
|
|
92
107
|
let spec;
|
|
93
108
|
const startIndex = transactions.length;
|
|
94
109
|
if ((0, utils_1.isPolymeshTransaction)(transaction)) {
|
|
95
110
|
spec = internal_1.PolymeshTransaction.toTransactionSpec(transaction);
|
|
96
|
-
const { transaction: tx, args: txArgs, fee, feeMultiplier } = spec;
|
|
111
|
+
const { transaction: tx, args: txArgs, fee, feeMultiplier, preRunValidation } = spec;
|
|
97
112
|
transactions.push({
|
|
98
113
|
transaction: tx,
|
|
99
114
|
args: txArgs,
|
|
@@ -101,11 +116,12 @@ function prepareStorage(args) {
|
|
|
101
116
|
feeMultiplier,
|
|
102
117
|
});
|
|
103
118
|
tags.push((0, conversion_1.transactionToTxTag)(tx));
|
|
119
|
+
preRunValidations.push(preRunValidation);
|
|
104
120
|
}
|
|
105
121
|
else {
|
|
106
122
|
spec = internal_1.PolymeshTransactionBatch.toTransactionSpec(transaction);
|
|
107
|
-
const { transactions: batchTransactions } = spec;
|
|
108
|
-
|
|
123
|
+
const { transactions: batchTransactions, preRunValidation } = spec;
|
|
124
|
+
for (const { transaction: tx, args: txArgs, fee, feeMultiplier } of batchTransactions) {
|
|
109
125
|
transactions.push({
|
|
110
126
|
transaction: tx,
|
|
111
127
|
args: txArgs,
|
|
@@ -113,7 +129,8 @@ function prepareStorage(args) {
|
|
|
113
129
|
feeMultiplier,
|
|
114
130
|
});
|
|
115
131
|
tags.push((0, conversion_1.transactionToTxTag)(tx));
|
|
116
|
-
}
|
|
132
|
+
}
|
|
133
|
+
preRunValidations.push(preRunValidation);
|
|
117
134
|
}
|
|
118
135
|
const { transformer = lodash_1.identity, resolver } = spec;
|
|
119
136
|
const endIndex = transactions.length;
|
|
@@ -131,11 +148,12 @@ function prepareStorage(args) {
|
|
|
131
148
|
}
|
|
132
149
|
return transformer(value);
|
|
133
150
|
}));
|
|
134
|
-
}
|
|
151
|
+
}
|
|
135
152
|
return {
|
|
136
153
|
processedTransactions: transactions,
|
|
137
154
|
resolvers,
|
|
138
155
|
tags,
|
|
156
|
+
preRunValidations,
|
|
139
157
|
};
|
|
140
158
|
}
|
|
141
159
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTransactionBatch.js","sourceRoot":"","sources":["../../../src/api/procedures/createTransactionBatch.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"createTransactionBatch.js","sourceRoot":"","sources":["../../../src/api/procedures/createTransactionBatch.ts"],"names":[],"mappings":";;;;;;;;;;;;AA4BA,sEAyBC;AAKD,4CAYC;AAKD,wCA0HC;AAnMD,mCAAkC;AAElC,yCAAsF;AACtF,mCAAsE;AACtE,+CAO0B;AAC1B,mCAAgD;AAChD,mDAAwD;AACxD,+CAAqD;AASrD;;GAEG;AACH,SAAsB,6BAA6B;;QAGjD,MAAM,EAAE,qBAAqB,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QAE3F,kDAAkD;QAClD,MAAM,wBAAwB,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC;YAC3E,CAAC,CAAC,CAAO,IAA6B,EAAiB,EAAE;gBACrD,MAAM,OAAO,CAAC,GAAG,CACf,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;oBACjC,IAAI,UAAU,EAAE,CAAC;wBACf,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;oBAC1B,CAAC;oBACD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;gBAC3B,CAAC,CAAC,CACH,CAAC;YACJ,CAAC,CAAA;YACH,CAAC,CAAC,SAAS,CAAC;QAEd,OAAO;YACL,YAAY;YACZ,QAAQ,EAAE,OAAO,CAAC,EAAE,CAClB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAA0B;YACpF,gBAAgB,EAAE,wBAAwB;SAC3C,CAAC;IACJ,CAAC;CAAA;AAED;;GAEG;AACH,SAAgB,gBAAgB;IAG9B,MAAM,EACJ,OAAO,EAAE,EAAE,IAAI,EAAE,GAClB,GAAG,IAAI,CAAC;IAET,OAAO;Q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oBACf,IAAI,EAAE,MAAM;oBACZ,GAAG;oBACH,aAAa;iBACd,CAAC,CAAC;gBAEH,IAAI,CAAC,IAAI,CAAC,IAAA,+BAAkB,EAAC,EAAE,CAAC,CAAC,CAAC;YACpC,CAAC;YAED,iBAAiB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC3C,CAAC;QAED,MAAM,EAAE,WAAW,GAAG,iBAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAElD,MAAM,QAAQ,GAAG,YAAY,CAAC,MAAM,CAAC;QAErC;;;WAGG;QACH,SAAS,CAAC,IAAI,CAAC,CAAO,OAA2B,EAAE,EAAE;YACnD,IAAI,KAAK,CAAC;YAEV,IAAI,IAAA,6BAAkB,EAAC,QAAQ,CAAC,EAAE,CAAC;gBACjC,KAAK,GAAG,QAAQ,CAAC,IAAA,4BAAiB,EAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;YACrE,CAAC;iBAAM,CAAC;gBACN,KAAK,GAAG,QAAQ,CAAC;YACnB,CAAC;YAED,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,qBAAqB,EAAE,YAAY;QACnC,SAAS;QACT,IAAI;QACJ,iBAAiB;KAClB,CAAC;AACJ,CAAC;AAED;;GAEG;AACI,MAAM,sBAAsB,GAAG,GAIpC,EAAE,CACF,IAAI,oBAAS,CACX,6BAA6B,EAC7B,gBAAgB,EAChB,cAAc,CACf,CAAC;AATS,QAAA,sBAAsB,0BAS/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transferPolyx.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/transferPolyx.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"transferPolyx.d.ts","sourceRoot":"","sources":["../../../src/api/procedures/transferPolyx.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,SAAS,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAa,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAQ5F;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,SAAS,CAAC,mBAAmB,CAAC,EACpC,IAAI,EAAE,mBAAmB,GACxB,OAAO,CACN,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,GAC9D,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC,CACzE,CAsDA;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,sBAAsB,CAIzD;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,QAAO,SAAS,CAAC,mBAAmB,CACP,CAAC"}
|
|
@@ -19,33 +19,46 @@ const conversion_1 = require("../../utils/conversion");
|
|
|
19
19
|
* @hidden
|
|
20
20
|
*/
|
|
21
21
|
function prepareTransferPolyx(args) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
const { context: { polymeshApi: { tx }, }, context, } = this;
|
|
23
|
+
const { to, amount, memo } = args;
|
|
24
|
+
const rawAccountId = (0, conversion_1.stringToAccountId)((0, conversion_1.signerToString)(to), context);
|
|
25
|
+
const rawAmount = (0, conversion_1.bigNumberToBalance)(amount, context);
|
|
26
|
+
const preRunValidation = (_a) => __awaiter(this, [_a], void 0, function* ({ asProposal }) {
|
|
27
|
+
const signingAccount = context.getSigningAccount();
|
|
28
|
+
let fromAccount;
|
|
29
|
+
if (asProposal) {
|
|
30
|
+
// Running as proposal - use MultiSig account balance
|
|
31
|
+
fromAccount = yield context.getActingAccount();
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
// Running directly - use signing account balance
|
|
35
|
+
fromAccount = signingAccount;
|
|
36
|
+
}
|
|
37
|
+
const { free: freeBalance } = yield fromAccount.getBalance();
|
|
27
38
|
if (amount.isGreaterThan(freeBalance)) {
|
|
28
39
|
throw new internal_1.PolymeshError({
|
|
29
40
|
code: types_1.ErrorCode.InsufficientBalance,
|
|
30
41
|
message: 'Insufficient free balance',
|
|
31
42
|
data: {
|
|
32
43
|
freeBalance,
|
|
44
|
+
fromAccount: fromAccount.address,
|
|
33
45
|
},
|
|
34
46
|
});
|
|
35
47
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
resolver: undefined,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
transaction: tx.balances.transfer,
|
|
46
|
-
args: [rawAccountId, rawAmount],
|
|
48
|
+
});
|
|
49
|
+
if (memo) {
|
|
50
|
+
return Promise.resolve({
|
|
51
|
+
transaction: tx.balances.transferWithMemo,
|
|
52
|
+
args: [rawAccountId, rawAmount, (0, conversion_1.stringToMemo)(memo, context)],
|
|
47
53
|
resolver: undefined,
|
|
48
|
-
|
|
54
|
+
preRunValidation,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return Promise.resolve({
|
|
58
|
+
transaction: tx.balances.transfer,
|
|
59
|
+
args: [rawAccountId, rawAmount],
|
|
60
|
+
resolver: undefined,
|
|
61
|
+
preRunValidation,
|
|
49
62
|
});
|
|
50
63
|
}
|
|
51
64
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transferPolyx.js","sourceRoot":"","sources":["../../../src/api/procedures/transferPolyx.ts"],"names":[],"mappings":";;;;;;;;;;;;AAaA,
|
|
1
|
+
{"version":3,"file":"transferPolyx.js","sourceRoot":"","sources":["../../../src/api/procedures/transferPolyx.ts"],"names":[],"mappings":";;;;;;;;;;;;AAaA,oDA4DC;AAKD,4CAIC;AAlFD,yCAA+D;AAC/D,mCAAyD;AAEzD,mDAK4B;AAE5B;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AC,YAAY,EAAE,SAAS,EAAE,IAAA,yBAAY,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC5D,QAAQ,EAAE,SAAS;YACnB,gBAAgB;SACjB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC,OAAO,CAAC;QACrB,WAAW,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ;QACjC,IAAI,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC;QAC/B,QAAQ,EAAE,SAAS;QACnB,gBAAgB;KACjB,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,SAAgB,gBAAgB;IAC9B,OAAO;QACL,iBAAiB,EAAE,IAAI;KACxB,CAAC;AACJ,CAAC;AAED;;GAEG;AACI,MAAM,aAAa,GAAG,GAAmC,EAAE,CAChE,IAAI,oBAAS,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,CAAC;AAD3C,QAAA,aAAa,iBAC8B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
2
|
import { BallotMeta, BallotVote } from '../../api/entities/CorporateBallot/types';
|
|
3
3
|
import { Account, AuthorizationRequest, CheckpointSchedule, ChildIdentity, CorporateActionBase, CorporateBallot, CustomPermissionGroup, DefaultPortfolio, FungibleAsset, Identity, KnownPermissionGroup, MultiSig, Nft, NumberedPortfolio, PolymeshTransaction, PolymeshTransactionBatch, Venue } from '../../internal';
|
|
4
|
-
import { AddCountStatInput, AssetDocument, CheckPermissionsResult, CheckRolesResult, ClaimCountStatInput, ClaimTarget, ClaimType, CorporateActionKind, CorporateActionTargets, InputCaCheckpoint, InputCondition, InputStatClaim, InputStatType, InputTargets, InputTaxWithholding, InputTrustedClaimIssuer, KnownAssetType, KnownNftType, MetadataSpec, MetadataType, MetadataValueDetails, NftCollection, OffChainFundingReceipt, OfferingTier, PermissionedAccount, PermissionsLike, PortfolioLike, PortfolioMovement, Requirement, Scope, SecurityIdentifier, Signer, SignerType, StatClaimIssuer, StatType, TaxWithholding, TransactionPermissions, TxTag, VenueType } from '../../types';
|
|
4
|
+
import { AddCountStatInput, AGENT_TX_GROUP_VALUES, AssetDocument, CheckPermissionsResult, CheckRolesResult, ClaimCountStatInput, ClaimTarget, ClaimType, CorporateActionKind, CorporateActionTargets, InputCaCheckpoint, InputCondition, InputStatClaim, InputStatType, InputTargets, InputTaxWithholding, InputTrustedClaimIssuer, KnownAssetType, KnownNftType, MetadataSpec, MetadataType, MetadataValueDetails, NftCollection, OffChainFundingReceipt, OfferingTier, PermissionedAccount, PermissionsLike, PortfolioLike, PortfolioMovement, Requirement, Scope, SecurityIdentifier, Signer, SignerType, StatClaimIssuer, StatType, TaxWithholding, TransactionPermissions, TxTag, VenueType } from '../../types';
|
|
5
5
|
import { Modify } from '../../types/utils';
|
|
6
6
|
export interface ProcedureAuthorizationStatus {
|
|
7
7
|
/**
|
|
@@ -184,90 +184,139 @@ export interface IdentityRole {
|
|
|
184
184
|
}
|
|
185
185
|
export type Role = TickerOwnerRole | CddProviderRole | VenueOwnerRole | PortfolioCustodianRole | IdentityRole;
|
|
186
186
|
/**
|
|
187
|
-
* Transaction Groups (for permissions purposes)
|
|
187
|
+
* Transaction Groups (for secondary key permissions purposes)
|
|
188
|
+
* Includes all transactions that agents can perform plus secondary key specific transactions
|
|
188
189
|
*/
|
|
189
190
|
export declare enum TxGroup {
|
|
190
191
|
/**
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
* - TxTags.settlement.AddInstruction
|
|
194
|
-
* - TxTags.settlement.AddInstructionWithMemo
|
|
195
|
-
* - TxTags.settlement.AddAndAffirmInstruction
|
|
196
|
-
* - TxTags.settlement.AddAndAffirmInstructionWithMemo
|
|
197
|
-
* - TxTags.settlement.AffirmInstruction
|
|
198
|
-
* - TxTags.settlement.RejectInstruction
|
|
199
|
-
* - TxTags.settlement.CreateVenue
|
|
192
|
+
* Advanced Asset Management operations
|
|
193
|
+
* @see {@link types/txGroupConstants!ADVANCED_ASSET_MANAGEMENT_TX_TAGS} for the complete list of transactions
|
|
200
194
|
*/
|
|
201
|
-
|
|
195
|
+
AdvancedAssetManagement = "AdvancedAssetManagement",
|
|
202
196
|
/**
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
* - TxTags.asset.SetFundingRound
|
|
206
|
-
* - TxTags.asset.AddDocuments
|
|
207
|
-
* - TxTags.asset.RemoveDocuments
|
|
197
|
+
* Asset management operations
|
|
198
|
+
* @see {@link types/txGroupConstants!ASSET_MANAGEMENT_TX_TAGS} for the complete list of transactions
|
|
208
199
|
*/
|
|
209
200
|
AssetManagement = "AssetManagement",
|
|
210
201
|
/**
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
* - TxTags.identity.AddAuthorization
|
|
214
|
-
* - TxTags.identity.RemoveAuthorization
|
|
202
|
+
* Asset Document Management operations
|
|
203
|
+
* @see {@link types/txGroupConstants!ASSET_DOCUMENT_MANAGEMENT_TX_TAGS} for the complete list of transactions
|
|
215
204
|
*/
|
|
216
|
-
|
|
205
|
+
AssetDocumentManagement = "AssetDocumentManagement",
|
|
217
206
|
/**
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
* - TxTags.settlement.AddInstruction
|
|
221
|
-
* - TxTags.settlement.AddInstructionWithMemo
|
|
222
|
-
* - TxTags.settlement.AddAndAffirmInstruction
|
|
223
|
-
* - TxTags.settlement.AddAndAffirmInstructionWithMemo
|
|
207
|
+
* Asset Metadata Management operations
|
|
208
|
+
* @see {@link types/txGroupConstants!ASSET_METADATA_MANAGEMENT_TX_TAGS} for the complete list of transactions
|
|
224
209
|
*/
|
|
225
|
-
|
|
210
|
+
AssetMetadataManagement = "AssetMetadataManagement",
|
|
226
211
|
/**
|
|
227
|
-
*
|
|
212
|
+
* Asset Registration operations
|
|
213
|
+
* @see {@link types/txGroupConstants!ASSET_REGISTRATION_TX_TAGS} for the complete list of transactions
|
|
228
214
|
*/
|
|
229
|
-
|
|
215
|
+
AssetRegistration = "AssetRegistration",
|
|
216
|
+
/**
|
|
217
|
+
* Authorization Management operations
|
|
218
|
+
* @see {@link types/txGroupConstants!AUTHORIZATION_MANAGEMENT_TX_TAGS} for the complete list of transactions
|
|
219
|
+
*/
|
|
220
|
+
AuthorizationManagement = "AuthorizationManagement",
|
|
221
|
+
/**
|
|
222
|
+
* Capital distribution management
|
|
223
|
+
* @see {@link types/txGroupConstants!CAPITAL_DISTRIBUTION_TX_TAGS} for the complete list of transactions
|
|
224
|
+
*/
|
|
225
|
+
CapitalDistribution = "CapitalDistribution",
|
|
226
|
+
/**
|
|
227
|
+
* CDD Registration operations
|
|
228
|
+
* @see {@link types/txGroupConstants!CDD_REGISTRATION_TX_TAGS} for the complete list of transactions
|
|
229
|
+
*/
|
|
230
|
+
CddRegistration = "CddRegistration",
|
|
230
231
|
/**
|
|
231
|
-
*
|
|
232
|
-
*
|
|
232
|
+
* Checkpoint management
|
|
233
|
+
* @see {@link types/txGroupConstants!CHECKPOINT_MANAGEMENT_TX_TAGS} for the complete list of transactions
|
|
233
234
|
*/
|
|
234
|
-
|
|
235
|
+
CheckpointManagement = "CheckpointManagement",
|
|
235
236
|
/**
|
|
236
|
-
*
|
|
237
|
-
*
|
|
237
|
+
* Claims Management operations
|
|
238
|
+
* @see {@link types/txGroupConstants!CLAIMS_MANAGEMENT_TX_TAGS} for the complete list of transactions
|
|
238
239
|
*/
|
|
239
240
|
ClaimsManagement = "ClaimsManagement",
|
|
240
241
|
/**
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
* - TxTags.complianceManager.PauseAssetCompliance
|
|
244
|
-
* - TxTags.complianceManager.ResumeAssetCompliance
|
|
245
|
-
* - TxTags.complianceManager.ResetAssetCompliance
|
|
242
|
+
* Compliance management operations
|
|
243
|
+
* @see {@link types/txGroupConstants!COMPLIANCE_MANAGEMENT_TX_TAGS} for the complete list of transactions
|
|
246
244
|
*/
|
|
247
|
-
|
|
245
|
+
ComplianceManagement = "ComplianceManagement",
|
|
248
246
|
/**
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
* - TxTags.checkpoint.CreateCheckpoint,
|
|
252
|
-
* - TxTags.corporateAction.InitiateCorporateAction,
|
|
253
|
-
* - TxTags.capitalDistribution.Distribute,
|
|
254
|
-
* - TxTags.capitalDistribution.Claim,
|
|
255
|
-
* - TxTags.identity.AddInvestorUniquenessClaim,
|
|
247
|
+
* Corporate actions management
|
|
248
|
+
* @see {@link types/txGroupConstants!CORPORATE_ACTIONS_MANAGEMENT_TX_TAGS} for the complete list of transactions
|
|
256
249
|
*/
|
|
257
250
|
CorporateActionsManagement = "CorporateActionsManagement",
|
|
258
251
|
/**
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
|
|
267
|
-
|
|
252
|
+
* Corporate ballot management
|
|
253
|
+
* @see {@link types/txGroupConstants!CORPORATE_BALLOT_MANAGEMENT_TX_TAGS} for the complete list of transactions
|
|
254
|
+
*/
|
|
255
|
+
CorporateBallotManagement = "CorporateBallotManagement",
|
|
256
|
+
/**
|
|
257
|
+
* Corporate voting operations
|
|
258
|
+
* @see {@link types/txGroupConstants!CORPORATE_VOTING_TX_TAGS} for the complete list of transactions
|
|
259
|
+
*/
|
|
260
|
+
CorporateVoting = "CorporateVoting",
|
|
261
|
+
/**
|
|
262
|
+
* External Agent Management operations
|
|
263
|
+
* @see {@link types/txGroupConstants!EXTERNAL_AGENT_MANAGEMENT_TX_TAGS} for the complete list of transactions
|
|
264
|
+
*/
|
|
265
|
+
ExternalAgentManagement = "ExternalAgentManagement",
|
|
266
|
+
/**
|
|
267
|
+
* External Agent Participation operations
|
|
268
|
+
* @see {@link types/txGroupConstants!EXTERNAL_AGENT_PARTICIPATION_TX_TAGS} for the complete list of transactions
|
|
269
|
+
*/
|
|
270
|
+
ExternalAgentParticipation = "ExternalAgentParticipation",
|
|
271
|
+
/**
|
|
272
|
+
* Issuance operations
|
|
273
|
+
* @see {@link types/txGroupConstants!ISSUANCE_TX_TAGS} for the complete list of transactions
|
|
268
274
|
*/
|
|
269
|
-
|
|
275
|
+
Issuance = "Issuance",
|
|
276
|
+
/**
|
|
277
|
+
* MultiSig account management
|
|
278
|
+
* @see {@link types/txGroupConstants!MULTISIG_MANAGEMENT_TX_TAGS} for the complete list of transactions
|
|
279
|
+
*/
|
|
280
|
+
MultiSigManagement = "MultiSigManagement",
|
|
281
|
+
/**
|
|
282
|
+
* Portfolio management operations
|
|
283
|
+
* @see {@link types/txGroupConstants!PORTFOLIO_MANAGEMENT_TX_TAGS} for the complete list of transactions
|
|
284
|
+
*/
|
|
285
|
+
PortfolioManagement = "PortfolioManagement",
|
|
286
|
+
/**
|
|
287
|
+
* Relayer Management operations
|
|
288
|
+
* @see {@link types/txGroupConstants!RELAYER_MANAGEMENT_TX_TAGS} for the complete list of transactions
|
|
289
|
+
*/
|
|
290
|
+
RelayerManagement = "RelayerManagement",
|
|
291
|
+
/**
|
|
292
|
+
* Redemption operations
|
|
293
|
+
* @see {@link types/txGroupConstants!REDEMPTION_TX_TAGS} for the complete list of transactions
|
|
294
|
+
*/
|
|
295
|
+
Redemption = "Redemption",
|
|
296
|
+
/**
|
|
297
|
+
* Settlement Management operations
|
|
298
|
+
* @see {@link types/txGroupConstants!SETTLEMENT_MANAGEMENT_TX_TAGS} for the complete list of transactions
|
|
299
|
+
*/
|
|
300
|
+
SettlementManagement = "SettlementManagement",
|
|
301
|
+
/**
|
|
302
|
+
* STO Management operations
|
|
303
|
+
* @see {@link types/txGroupConstants!STO_MANAGEMENT_TX_TAGS} for the complete list of transactions
|
|
304
|
+
*/
|
|
305
|
+
StoManagement = "StoManagement",
|
|
306
|
+
/**
|
|
307
|
+
* Trusted Claim Issuers Management operations
|
|
308
|
+
* @see {@link types/txGroupConstants!TRUSTED_CLAIM_ISSUERS_MANAGEMENT_TX_TAGS} for the complete list of transactions
|
|
309
|
+
*/
|
|
310
|
+
TrustedClaimIssuersManagement = "TrustedClaimIssuersManagement"
|
|
270
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* Type-level union of the `TxGroup` values that External Agents can use.
|
|
314
|
+
*
|
|
315
|
+
* - Derived from {@link types/txGroupConstants!AGENT_TX_GROUP_VALUES}
|
|
316
|
+
* - For iteration or runtime checks, prefer the {@link types/txGroupConstants!AGENT_TX_GROUP_VALUES} constant.
|
|
317
|
+
* - All transactions in these groups are available to both Agents and Secondary Keys.
|
|
318
|
+
*/
|
|
319
|
+
export type AgentTxGroup = (typeof AGENT_TX_GROUP_VALUES)[number];
|
|
271
320
|
export type SetTransferRestrictionParams = CountTransferRestrictionInput | PercentageTransferRestrictionInput | ClaimCountTransferRestrictionInput | ClaimPercentageTransferRestrictionInput;
|
|
272
321
|
export type AddCountStatParams = AddCountStatInput & {
|
|
273
322
|
type: StatType.Count;
|
|
@@ -1167,7 +1216,7 @@ export interface CreateGroupParams {
|
|
|
1167
1216
|
permissions: {
|
|
1168
1217
|
transactions: TransactionPermissions;
|
|
1169
1218
|
} | {
|
|
1170
|
-
transactionGroups:
|
|
1219
|
+
transactionGroups: AgentTxGroup[];
|
|
1171
1220
|
};
|
|
1172
1221
|
}
|
|
1173
1222
|
export interface InviteExternalAgentParams {
|
|
@@ -1175,7 +1224,7 @@ export interface InviteExternalAgentParams {
|
|
|
1175
1224
|
permissions: KnownPermissionGroup | CustomPermissionGroup | {
|
|
1176
1225
|
transactions: TransactionPermissions | null;
|
|
1177
1226
|
} | {
|
|
1178
|
-
transactionGroups:
|
|
1227
|
+
transactionGroups: AgentTxGroup[];
|
|
1179
1228
|
};
|
|
1180
1229
|
/**
|
|
1181
1230
|
* date at which the authorization request for invitation expires (optional)
|
|
@@ -1207,7 +1256,7 @@ export interface SetGroupPermissionsParams {
|
|
|
1207
1256
|
permissions: {
|
|
1208
1257
|
transactions: TransactionPermissions;
|
|
1209
1258
|
} | {
|
|
1210
|
-
transactionGroups:
|
|
1259
|
+
transactionGroups: AgentTxGroup[];
|
|
1211
1260
|
};
|
|
1212
1261
|
}
|
|
1213
1262
|
export type ModifyVenueParams = {
|
|
@@ -1318,7 +1367,7 @@ export interface TransactionsParams extends AssetBase {
|
|
|
1318
1367
|
transactions: TransactionPermissions | null;
|
|
1319
1368
|
}
|
|
1320
1369
|
export interface TxGroupParams extends AssetBase {
|
|
1321
|
-
transactionGroups:
|
|
1370
|
+
transactionGroups: AgentTxGroup[];
|
|
1322
1371
|
}
|
|
1323
1372
|
/**
|
|
1324
1373
|
* This procedure can be called with:
|
|
@@ -1326,7 +1375,7 @@ export interface TxGroupParams extends AssetBase {
|
|
|
1326
1375
|
* - A Known Permission Group and an Asset. The Identity will be assigned as an Agent of that Group for that Asset
|
|
1327
1376
|
* - A set of Transaction Permissions and an Asset. If there is no Custom Permission Group with those permissions, a Custom Permission Group will be created for that Asset with those permissions, and
|
|
1328
1377
|
* the Identity will be assigned as an Agent of that Group for that Asset. Otherwise, the existing Group will be used
|
|
1329
|
-
* - An array of {@link
|
|
1378
|
+
* - An array of {@link AgentTxGroup | Agent Transaction Groups} that represent a set of permissions. If there is no Custom Permission Group with those permissions, a Custom Permission Group will be created with those permissions, and
|
|
1330
1379
|
* the Identity will be assigned as an Agent of that Group for that Asset. Otherwise, the existing Group will be used
|
|
1331
1380
|
*/
|
|
1332
1381
|
export interface SetPermissionGroupParams {
|