@sravankumar02/sdk-core 1.0.0 → 2.0.0
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/out/abi/codec/binary.js.map +1 -1
- package/out/abi/codec/managedDecimal.js +17 -5
- package/out/abi/codec/managedDecimal.js.map +1 -1
- package/out/abi/codec/managedDecimalSigned.js +17 -5
- package/out/abi/codec/managedDecimalSigned.js.map +1 -1
- package/out/abi/index.d.ts +0 -3
- package/out/abi/index.js +0 -3
- package/out/abi/index.js.map +1 -1
- package/out/abi/nativeSerializer.js +1 -1
- package/out/abi/nativeSerializer.js.map +1 -1
- package/out/abi/typesystem/typeMapper.js +2 -0
- package/out/abi/typesystem/typeMapper.js.map +1 -1
- package/out/accountManagement/accountController.d.ts +2 -1
- package/out/accountManagement/accountController.js +11 -20
- package/out/accountManagement/accountController.js.map +1 -1
- package/out/accountManagement/accountTransactionsFactory.d.ts +10 -5
- package/out/accountManagement/accountTransactionsFactory.js +45 -34
- package/out/accountManagement/accountTransactionsFactory.js.map +1 -1
- package/out/core/address.d.ts +1 -25
- package/out/core/address.js +3 -41
- package/out/core/address.js.map +1 -1
- package/out/core/baseController.d.ts +9 -3
- package/out/core/baseController.js +24 -10
- package/out/core/baseController.js.map +1 -1
- package/out/core/baseFactory.d.ts +25 -0
- package/out/core/baseFactory.js +40 -0
- package/out/core/baseFactory.js.map +1 -0
- package/out/core/codeMetadata.d.ts +0 -10
- package/out/core/codeMetadata.js +0 -27
- package/out/core/codeMetadata.js.map +1 -1
- package/out/core/constants.d.ts +1 -0
- package/out/core/constants.js +2 -1
- package/out/core/constants.js.map +1 -1
- package/out/core/errors.d.ts +9 -0
- package/out/core/errors.js +17 -2
- package/out/core/errors.js.map +1 -1
- package/out/core/index.d.ts +2 -0
- package/out/core/index.js +2 -0
- package/out/core/index.js.map +1 -1
- package/out/core/interfaces.d.ts +5 -0
- package/out/core/tokens.d.ts +1 -77
- package/out/core/tokens.js +2 -144
- package/out/core/tokens.js.map +1 -1
- package/out/core/transaction.d.ts +1 -144
- package/out/core/transaction.js +0 -209
- package/out/core/transaction.js.map +1 -1
- package/out/core/transactionStatus.d.ts +0 -5
- package/out/core/transactionStatus.js +0 -7
- package/out/core/transactionStatus.js.map +1 -1
- package/out/core/transactionsFactoryConfig.d.ts +16 -0
- package/out/core/transactionsFactoryConfig.js +17 -0
- package/out/core/transactionsFactoryConfig.js.map +1 -1
- package/out/delegation/delegationController.d.ts +2 -1
- package/out/delegation/delegationController.js +39 -134
- package/out/delegation/delegationController.js.map +1 -1
- package/out/delegation/delegationTransactionsFactory.d.ts +23 -20
- package/out/delegation/delegationTransactionsFactory.js +183 -159
- package/out/delegation/delegationTransactionsFactory.js.map +1 -1
- package/out/entrypoints/entrypoints.d.ts +36 -3
- package/out/entrypoints/entrypoints.js +102 -27
- package/out/entrypoints/entrypoints.js.map +1 -1
- package/out/gasEstimator/gasLimitEstimator.d.ts +19 -0
- package/out/gasEstimator/gasLimitEstimator.js +22 -0
- package/out/gasEstimator/gasLimitEstimator.js.map +1 -0
- package/out/gasEstimator/index.d.ts +1 -0
- package/out/gasEstimator/index.js +6 -0
- package/out/gasEstimator/index.js.map +1 -0
- package/out/governance/governanceController.d.ts +2 -1
- package/out/governance/governanceController.js +13 -43
- package/out/governance/governanceController.js.map +1 -1
- package/out/governance/governanceTransactionsFactory.d.ts +10 -8
- package/out/governance/governanceTransactionsFactory.js +60 -52
- package/out/governance/governanceTransactionsFactory.js.map +1 -1
- package/out/index.d.ts +1 -0
- package/out/index.js +1 -0
- package/out/index.js.map +1 -1
- package/out/multisig/index.d.ts +2 -0
- package/out/multisig/index.js +2 -0
- package/out/multisig/index.js.map +1 -1
- package/out/multisig/multisigController.d.ts +2 -1
- package/out/multisig/multisigController.js +61 -117
- package/out/multisig/multisigController.js.map +1 -1
- package/out/multisig/multisigTransactionsFactory.d.ts +26 -24
- package/out/multisig/multisigTransactionsFactory.js +57 -54
- package/out/multisig/multisigTransactionsFactory.js.map +1 -1
- package/out/multisig/proposeTransferExecuteContractInput.d.ts +2 -2
- package/out/multisig/proposeTransferExecuteContractInput.js +4 -4
- package/out/multisig/proposeTransferExecuteContractInput.js.map +1 -1
- package/out/multisig/resources.d.ts +2 -2
- package/out/networkProviders/apiNetworkProvider.js +1 -3
- package/out/networkProviders/apiNetworkProvider.js.map +1 -1
- package/out/networkProviders/proxyNetworkProvider.js +20 -1
- package/out/networkProviders/proxyNetworkProvider.js.map +1 -1
- package/out/networkProviders/tokens.d.ts +0 -1
- package/out/smartContracts/resources.d.ts +6 -2
- package/out/smartContracts/smartContractController.d.ts +2 -1
- package/out/smartContracts/smartContractController.js +10 -22
- package/out/smartContracts/smartContractController.js.map +1 -1
- package/out/smartContracts/smartContractTransactionsFactory.d.ts +12 -7
- package/out/smartContracts/smartContractTransactionsFactory.js +62 -44
- package/out/smartContracts/smartContractTransactionsFactory.js.map +1 -1
- package/out/tokenManagement/tokenManagementController.d.ts +2 -1
- package/out/tokenManagement/tokenManagementController.js +71 -246
- package/out/tokenManagement/tokenManagementController.js.map +1 -1
- package/out/tokenManagement/tokenManagementTransactionsFactory.d.ts +39 -36
- package/out/tokenManagement/tokenManagementTransactionsFactory.js +310 -275
- package/out/tokenManagement/tokenManagementTransactionsFactory.js.map +1 -1
- package/out/transfers/transferTransactionsFactory.d.ts +10 -8
- package/out/transfers/transferTransactionsFactory.js +28 -26
- package/out/transfers/transferTransactionsFactory.js.map +1 -1
- package/out/transfers/transfersControllers.d.ts +2 -1
- package/out/transfers/transfersControllers.js +10 -23
- package/out/transfers/transfersControllers.js.map +1 -1
- package/out/validators/index.d.ts +2 -0
- package/out/validators/index.js +15 -0
- package/out/validators/index.js.map +1 -0
- package/out/validators/resources.d.ts +40 -0
- package/out/validators/resources.js +3 -0
- package/out/validators/resources.js.map +1 -0
- package/out/validators/validatorsController.d.ts +27 -0
- package/out/validators/validatorsController.js +95 -0
- package/out/validators/validatorsController.js.map +1 -0
- package/out/validators/validatorsSigner.d.ts +9 -0
- package/out/validators/validatorsSigner.js +25 -0
- package/out/validators/validatorsSigner.js.map +1 -0
- package/out/validators/validatorsTransactionsFactory.d.ts +33 -0
- package/out/validators/validatorsTransactionsFactory.js +269 -0
- package/out/validators/validatorsTransactionsFactory.js.map +1 -0
- package/out/wallet/index.d.ts +1 -0
- package/out/wallet/index.js +1 -0
- package/out/wallet/index.js.map +1 -1
- package/out/wallet/userWallet.d.ts +1 -1
- package/out/wallet/userWallet.js +1 -1
- package/out/wallet/validatorPem.d.ts +12 -0
- package/out/wallet/validatorPem.js +45 -0
- package/out/wallet/validatorPem.js.map +1 -0
- package/out/wallet/validatorSigner.d.ts +9 -1
- package/out/wallet/validatorSigner.js +24 -1
- package/out/wallet/validatorSigner.js.map +1 -1
- package/package.json +5 -5
- package/out/abi/code.d.ts +0 -23
- package/out/abi/code.js +0 -41
- package/out/abi/code.js.map +0 -1
- package/out/abi/interaction.d.ts +0 -67
- package/out/abi/interaction.js +0 -146
- package/out/abi/interaction.js.map +0 -1
- package/out/abi/smartContract.d.ts +0 -74
- package/out/abi/smartContract.js +0 -208
- package/out/abi/smartContract.js.map +0 -1
- package/out/core/transactionBuilder.d.ts +0 -32
- package/out/core/transactionBuilder.js +0 -45
- package/out/core/transactionBuilder.js.map +0 -1
|
@@ -3,22 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TokenManagementTransactionsFactory = void 0;
|
|
4
4
|
const abi_1 = require("../abi");
|
|
5
5
|
const address_1 = require("../core/address");
|
|
6
|
+
const baseFactory_1 = require("../core/baseFactory");
|
|
6
7
|
const constants_1 = require("../core/constants");
|
|
7
8
|
const errors_1 = require("../core/errors");
|
|
8
9
|
const logger_1 = require("../core/logger");
|
|
9
|
-
const
|
|
10
|
+
const transaction_1 = require("../core/transaction");
|
|
10
11
|
/**
|
|
11
12
|
* Use this class to create token management transactions like issuing DCDTs, creating NFTs, setting roles, etc.
|
|
12
13
|
*/
|
|
13
|
-
class TokenManagementTransactionsFactory {
|
|
14
|
+
class TokenManagementTransactionsFactory extends baseFactory_1.BaseFactory {
|
|
14
15
|
constructor(options) {
|
|
16
|
+
super({ config: options.config, gasLimitEstimator: options.gasLimitEstimator });
|
|
15
17
|
this.config = options.config;
|
|
16
18
|
this.argSerializer = new abi_1.ArgSerializer();
|
|
17
19
|
this.trueAsString = "true";
|
|
18
20
|
this.falseAsString = "false";
|
|
19
21
|
this.dcdtContractAddress = address_1.Address.newFromHex(constants_1.DCDT_CONTRACT_ADDRESS_HEX, this.config.addressHrp);
|
|
20
22
|
}
|
|
21
|
-
createTransactionForIssuingFungible(sender, options) {
|
|
23
|
+
async createTransactionForIssuingFungible(sender, options) {
|
|
22
24
|
this.notifyAboutUnsettingBurnRoleGlobally();
|
|
23
25
|
const args = [
|
|
24
26
|
new abi_1.StringValue(options.tokenName),
|
|
@@ -39,17 +41,18 @@ class TokenManagementTransactionsFactory {
|
|
|
39
41
|
new abi_1.StringValue(this.boolToString(options.canAddSpecialRoles)),
|
|
40
42
|
];
|
|
41
43
|
const dataParts = ["issue", ...this.argSerializer.valuesToStrings(args)];
|
|
42
|
-
|
|
43
|
-
config: this.config,
|
|
44
|
+
const transaction = new transaction_1.Transaction({
|
|
44
45
|
sender: sender,
|
|
45
46
|
receiver: this.dcdtContractAddress,
|
|
46
|
-
|
|
47
|
-
gasLimit:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
chainID: this.config.chainID,
|
|
48
|
+
gasLimit: 0n,
|
|
49
|
+
value: this.config.issueCost,
|
|
50
|
+
});
|
|
51
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
52
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitIssue);
|
|
53
|
+
return transaction;
|
|
54
|
+
}
|
|
55
|
+
async createTransactionForIssuingSemiFungible(sender, options) {
|
|
53
56
|
this.notifyAboutUnsettingBurnRoleGlobally();
|
|
54
57
|
const args = [
|
|
55
58
|
new abi_1.StringValue(options.tokenName),
|
|
@@ -70,17 +73,18 @@ class TokenManagementTransactionsFactory {
|
|
|
70
73
|
new abi_1.StringValue(this.boolToString(options.canAddSpecialRoles)),
|
|
71
74
|
];
|
|
72
75
|
const dataParts = ["issueSemiFungible", ...this.argSerializer.valuesToStrings(args)];
|
|
73
|
-
|
|
74
|
-
config: this.config,
|
|
76
|
+
const transaction = new transaction_1.Transaction({
|
|
75
77
|
sender: sender,
|
|
76
78
|
receiver: this.dcdtContractAddress,
|
|
77
|
-
|
|
78
|
-
gasLimit:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
chainID: this.config.chainID,
|
|
80
|
+
gasLimit: 0n,
|
|
81
|
+
value: this.config.issueCost,
|
|
82
|
+
});
|
|
83
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
84
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitIssue);
|
|
85
|
+
return transaction;
|
|
86
|
+
}
|
|
87
|
+
async createTransactionForIssuingNonFungible(sender, options) {
|
|
84
88
|
this.notifyAboutUnsettingBurnRoleGlobally();
|
|
85
89
|
const args = [
|
|
86
90
|
new abi_1.StringValue(options.tokenName),
|
|
@@ -101,17 +105,18 @@ class TokenManagementTransactionsFactory {
|
|
|
101
105
|
new abi_1.StringValue(this.boolToString(options.canAddSpecialRoles)),
|
|
102
106
|
];
|
|
103
107
|
const dataParts = ["issueNonFungible", ...this.argSerializer.valuesToStrings(args)];
|
|
104
|
-
|
|
105
|
-
config: this.config,
|
|
108
|
+
const transaction = new transaction_1.Transaction({
|
|
106
109
|
sender: sender,
|
|
107
110
|
receiver: this.dcdtContractAddress,
|
|
108
|
-
|
|
109
|
-
gasLimit:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
chainID: this.config.chainID,
|
|
112
|
+
gasLimit: 0n,
|
|
113
|
+
value: this.config.issueCost,
|
|
114
|
+
});
|
|
115
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
116
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitIssue);
|
|
117
|
+
return transaction;
|
|
118
|
+
}
|
|
119
|
+
async createTransactionForRegisteringMetaDCDT(sender, options) {
|
|
115
120
|
this.notifyAboutUnsettingBurnRoleGlobally();
|
|
116
121
|
const args = [
|
|
117
122
|
new abi_1.StringValue(options.tokenName),
|
|
@@ -133,17 +138,18 @@ class TokenManagementTransactionsFactory {
|
|
|
133
138
|
new abi_1.StringValue(this.boolToString(options.canAddSpecialRoles)),
|
|
134
139
|
];
|
|
135
140
|
const dataParts = ["registerMetaDCDT", ...this.argSerializer.valuesToStrings(args)];
|
|
136
|
-
|
|
137
|
-
config: this.config,
|
|
141
|
+
const transaction = new transaction_1.Transaction({
|
|
138
142
|
sender: sender,
|
|
139
143
|
receiver: this.dcdtContractAddress,
|
|
140
|
-
|
|
141
|
-
gasLimit:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
chainID: this.config.chainID,
|
|
145
|
+
gasLimit: 0n,
|
|
146
|
+
value: this.config.issueCost,
|
|
147
|
+
});
|
|
148
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
149
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitIssue);
|
|
150
|
+
return transaction;
|
|
151
|
+
}
|
|
152
|
+
async createTransactionForRegisteringAndSettingRoles(sender, options) {
|
|
147
153
|
this.notifyAboutUnsettingBurnRoleGlobally();
|
|
148
154
|
const dataParts = [
|
|
149
155
|
"registerAndSetAllRoles",
|
|
@@ -154,75 +160,80 @@ class TokenManagementTransactionsFactory {
|
|
|
154
160
|
new abi_1.BigUIntValue(options.numDecimals),
|
|
155
161
|
]),
|
|
156
162
|
];
|
|
157
|
-
|
|
158
|
-
config: this.config,
|
|
163
|
+
const transaction = new transaction_1.Transaction({
|
|
159
164
|
sender: sender,
|
|
160
165
|
receiver: this.dcdtContractAddress,
|
|
161
|
-
|
|
162
|
-
gasLimit:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
chainID: this.config.chainID,
|
|
167
|
+
gasLimit: 0n,
|
|
168
|
+
value: this.config.issueCost,
|
|
169
|
+
});
|
|
170
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
171
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitIssue);
|
|
172
|
+
return transaction;
|
|
173
|
+
}
|
|
174
|
+
async createTransactionForSettingBurnRoleGlobally(sender, options) {
|
|
168
175
|
const dataParts = [
|
|
169
176
|
"setBurnRoleGlobally",
|
|
170
177
|
...this.argSerializer.valuesToStrings([new abi_1.StringValue(options.tokenIdentifier)]),
|
|
171
178
|
];
|
|
172
|
-
|
|
173
|
-
config: this.config,
|
|
179
|
+
const transaction = new transaction_1.Transaction({
|
|
174
180
|
sender: sender,
|
|
175
181
|
receiver: this.dcdtContractAddress,
|
|
176
|
-
|
|
177
|
-
gasLimit:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
+
chainID: this.config.chainID,
|
|
183
|
+
gasLimit: 0n,
|
|
184
|
+
});
|
|
185
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
186
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitToggleBurnRoleGlobally);
|
|
187
|
+
return transaction;
|
|
188
|
+
}
|
|
189
|
+
async createTransactionForUnsettingBurnRoleGlobally(sender, options) {
|
|
182
190
|
const dataParts = [
|
|
183
191
|
"unsetBurnRoleGlobally",
|
|
184
192
|
...this.argSerializer.valuesToStrings([new abi_1.StringValue(options.tokenIdentifier)]),
|
|
185
193
|
];
|
|
186
|
-
|
|
187
|
-
config: this.config,
|
|
194
|
+
const transaction = new transaction_1.Transaction({
|
|
188
195
|
sender: sender,
|
|
189
196
|
receiver: this.dcdtContractAddress,
|
|
190
|
-
|
|
191
|
-
gasLimit:
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
197
|
+
chainID: this.config.chainID,
|
|
198
|
+
gasLimit: 0n,
|
|
199
|
+
});
|
|
200
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
201
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitToggleBurnRoleGlobally);
|
|
202
|
+
return transaction;
|
|
203
|
+
}
|
|
204
|
+
async createTransactionForSettingSpecialRoleOnFungibleToken(sender, options) {
|
|
196
205
|
const args = [new abi_1.StringValue(options.tokenIdentifier), new abi_1.AddressValue(options.user)];
|
|
197
206
|
options.addRoleLocalMint ? args.push(new abi_1.StringValue("DCDTRoleLocalMint")) : 0;
|
|
198
207
|
options.addRoleLocalBurn ? args.push(new abi_1.StringValue("DCDTRoleLocalBurn")) : 0;
|
|
199
208
|
options.addRoleDCDTTransferRole ? args.push(new abi_1.StringValue("DCDTTransferRole")) : 0;
|
|
200
209
|
const dataParts = ["setSpecialRole", ...this.argSerializer.valuesToStrings(args)];
|
|
201
|
-
|
|
202
|
-
config: this.config,
|
|
210
|
+
const transaction = new transaction_1.Transaction({
|
|
203
211
|
sender: sender,
|
|
204
212
|
receiver: this.dcdtContractAddress,
|
|
205
|
-
|
|
206
|
-
gasLimit:
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
213
|
+
chainID: this.config.chainID,
|
|
214
|
+
gasLimit: 0n,
|
|
215
|
+
});
|
|
216
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
217
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitSetSpecialRole);
|
|
218
|
+
return transaction;
|
|
219
|
+
}
|
|
220
|
+
async createTransactionForUnsettingSpecialRoleOnFungibleToken(sender, options) {
|
|
211
221
|
const args = [new abi_1.StringValue(options.tokenIdentifier), new abi_1.AddressValue(options.user)];
|
|
212
222
|
options.removeRoleLocalMint ? args.push(new abi_1.StringValue("DCDTRoleLocalMint")) : 0;
|
|
213
223
|
options.removeRoleDCDTTransferRole ? args.push(new abi_1.StringValue("DCDTRoleLocalBurn")) : 0;
|
|
214
224
|
options.removeRoleDCDTTransferRole ? args.push(new abi_1.StringValue("DCDTTransferRole")) : 0;
|
|
215
225
|
const dataParts = ["unSetSpecialRole", ...this.argSerializer.valuesToStrings(args)];
|
|
216
|
-
|
|
217
|
-
config: this.config,
|
|
226
|
+
const transaction = new transaction_1.Transaction({
|
|
218
227
|
sender: sender,
|
|
219
228
|
receiver: this.dcdtContractAddress,
|
|
220
|
-
|
|
221
|
-
gasLimit:
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
229
|
+
chainID: this.config.chainID,
|
|
230
|
+
gasLimit: 0n,
|
|
231
|
+
});
|
|
232
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
233
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitSetSpecialRole);
|
|
234
|
+
return transaction;
|
|
235
|
+
}
|
|
236
|
+
async createTransactionForSettingSpecialRoleOnSemiFungibleToken(sender, options) {
|
|
226
237
|
const args = [new abi_1.StringValue(options.tokenIdentifier), new abi_1.AddressValue(options.user)];
|
|
227
238
|
options.addRoleNFTCreate ? args.push(new abi_1.StringValue("DCDTRoleNFTCreate")) : 0;
|
|
228
239
|
options.addRoleNFTBurn ? args.push(new abi_1.StringValue("DCDTRoleNFTBurn")) : 0;
|
|
@@ -234,16 +245,17 @@ class TokenManagementTransactionsFactory {
|
|
|
234
245
|
options.addRoleDCDTModifyCreator ? args.push(new abi_1.StringValue("DCDTRoleModifyCreator")) : 0;
|
|
235
246
|
options.addRoleNFTRecreate ? args.push(new abi_1.StringValue("DCDTRoleNFTRecreate")) : 0;
|
|
236
247
|
const dataParts = ["setSpecialRole", ...this.argSerializer.valuesToStrings(args)];
|
|
237
|
-
|
|
238
|
-
config: this.config,
|
|
248
|
+
const transaction = new transaction_1.Transaction({
|
|
239
249
|
sender: sender,
|
|
240
250
|
receiver: this.dcdtContractAddress,
|
|
241
|
-
|
|
242
|
-
gasLimit:
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
251
|
+
chainID: this.config.chainID,
|
|
252
|
+
gasLimit: 0n,
|
|
253
|
+
});
|
|
254
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
255
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitSetSpecialRole);
|
|
256
|
+
return transaction;
|
|
257
|
+
}
|
|
258
|
+
async createTransactionForUnsettingSpecialRoleOnSemiFungibleToken(sender, options) {
|
|
247
259
|
const args = [new abi_1.StringValue(options.tokenIdentifier), new abi_1.AddressValue(options.user)];
|
|
248
260
|
options.removeRoleNFTBurn ? args.push(new abi_1.StringValue("DCDTRoleNFTBurn")) : 0;
|
|
249
261
|
options.removeRoleNFTAddQuantity ? args.push(new abi_1.StringValue("DCDTRoleNFTAddQuantity")) : 0;
|
|
@@ -254,22 +266,23 @@ class TokenManagementTransactionsFactory {
|
|
|
254
266
|
options.removeRoleDCDTModifyCreator ? args.push(new abi_1.StringValue("DCDTRoleModifyCreator")) : 0;
|
|
255
267
|
options.removeRoleNFTRecreate ? args.push(new abi_1.StringValue("DCDTRoleNFTRecreate")) : 0;
|
|
256
268
|
const dataParts = ["unSetSpecialRole", ...this.argSerializer.valuesToStrings(args)];
|
|
257
|
-
|
|
258
|
-
config: this.config,
|
|
269
|
+
const transaction = new transaction_1.Transaction({
|
|
259
270
|
sender: sender,
|
|
260
271
|
receiver: this.dcdtContractAddress,
|
|
261
|
-
|
|
262
|
-
gasLimit:
|
|
263
|
-
|
|
264
|
-
|
|
272
|
+
chainID: this.config.chainID,
|
|
273
|
+
gasLimit: 0n,
|
|
274
|
+
});
|
|
275
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
276
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitSetSpecialRole);
|
|
277
|
+
return transaction;
|
|
265
278
|
}
|
|
266
|
-
createTransactionForSettingSpecialRoleOnMetaDCDT(sender, options) {
|
|
267
|
-
return this.createTransactionForSettingSpecialRoleOnSemiFungibleToken(sender, options);
|
|
279
|
+
async createTransactionForSettingSpecialRoleOnMetaDCDT(sender, options) {
|
|
280
|
+
return await this.createTransactionForSettingSpecialRoleOnSemiFungibleToken(sender, options);
|
|
268
281
|
}
|
|
269
|
-
createTransactionForUnsettingSpecialRoleOnMetaDCDT(sender, options) {
|
|
270
|
-
return this.createTransactionForUnsettingSpecialRoleOnSemiFungibleToken(sender, options);
|
|
282
|
+
async createTransactionForUnsettingSpecialRoleOnMetaDCDT(sender, options) {
|
|
283
|
+
return await this.createTransactionForUnsettingSpecialRoleOnSemiFungibleToken(sender, options);
|
|
271
284
|
}
|
|
272
|
-
createTransactionForSettingSpecialRoleOnNonFungibleToken(sender, options) {
|
|
285
|
+
async createTransactionForSettingSpecialRoleOnNonFungibleToken(sender, options) {
|
|
273
286
|
const args = [new abi_1.StringValue(options.tokenIdentifier), new abi_1.AddressValue(options.user)];
|
|
274
287
|
options.addRoleNFTCreate ? args.push(new abi_1.StringValue("DCDTRoleNFTCreate")) : 0;
|
|
275
288
|
options.addRoleNFTBurn ? args.push(new abi_1.StringValue("DCDTRoleNFTBurn")) : 0;
|
|
@@ -281,16 +294,17 @@ class TokenManagementTransactionsFactory {
|
|
|
281
294
|
options.addRoleDCDTSetNewURI ? args.push(new abi_1.StringValue("DCDTRoleSetNewURI")) : 0;
|
|
282
295
|
options.addRoleDCDTModifyRoyalties ? args.push(new abi_1.StringValue("DCDTRoleModifyRoyalties")) : 0;
|
|
283
296
|
const dataParts = ["setSpecialRole", ...this.argSerializer.valuesToStrings(args)];
|
|
284
|
-
|
|
285
|
-
config: this.config,
|
|
297
|
+
const transaction = new transaction_1.Transaction({
|
|
286
298
|
sender: sender,
|
|
287
299
|
receiver: this.dcdtContractAddress,
|
|
288
|
-
|
|
289
|
-
gasLimit:
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
300
|
+
chainID: this.config.chainID,
|
|
301
|
+
gasLimit: 0n,
|
|
302
|
+
});
|
|
303
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
304
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitSetSpecialRole);
|
|
305
|
+
return transaction;
|
|
306
|
+
}
|
|
307
|
+
async createTransactionForUnsettingSpecialRoleOnNonFungibleToken(sender, options) {
|
|
294
308
|
const args = [new abi_1.StringValue(options.tokenIdentifier), new abi_1.AddressValue(options.user)];
|
|
295
309
|
options.removeRoleNFTBurn ? args.push(new abi_1.StringValue("DCDTRoleNFTBurn")) : 0;
|
|
296
310
|
options.removeRoleNFTUpdateAttributes ? args.push(new abi_1.StringValue("DCDTRoleNFTUpdateAttributes")) : 0;
|
|
@@ -301,16 +315,17 @@ class TokenManagementTransactionsFactory {
|
|
|
301
315
|
options.removeRoleDCDTSetNewURI ? args.push(new abi_1.StringValue("DCDTRoleSetNewURI")) : 0;
|
|
302
316
|
options.removeRoleDCDTModifyRoyalties ? args.push(new abi_1.StringValue("DCDTRoleModifyRoyalties")) : 0;
|
|
303
317
|
const dataParts = ["unSetSpecialRole", ...this.argSerializer.valuesToStrings(args)];
|
|
304
|
-
|
|
305
|
-
config: this.config,
|
|
318
|
+
const transaction = new transaction_1.Transaction({
|
|
306
319
|
sender: sender,
|
|
307
320
|
receiver: this.dcdtContractAddress,
|
|
308
|
-
|
|
309
|
-
gasLimit:
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
321
|
+
chainID: this.config.chainID,
|
|
322
|
+
gasLimit: 0n,
|
|
323
|
+
});
|
|
324
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
325
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitSetSpecialRole);
|
|
326
|
+
return transaction;
|
|
327
|
+
}
|
|
328
|
+
async createTransactionForCreatingNFT(sender, options) {
|
|
314
329
|
const dataParts = [
|
|
315
330
|
"DCDTNFTCreate",
|
|
316
331
|
...this.argSerializer.valuesToStrings([
|
|
@@ -326,41 +341,44 @@ class TokenManagementTransactionsFactory {
|
|
|
326
341
|
// Note that the following is an approximation (a reasonable one):
|
|
327
342
|
const nftData = options.name + options.hash + options.attributes + options.uris.join("");
|
|
328
343
|
const storageGasLimit = this.config.gasLimitStorePerByte + BigInt(nftData.length);
|
|
329
|
-
|
|
330
|
-
config: this.config,
|
|
344
|
+
const transaction = new transaction_1.Transaction({
|
|
331
345
|
sender: sender,
|
|
332
346
|
receiver: sender,
|
|
333
|
-
|
|
334
|
-
gasLimit:
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
347
|
+
chainID: this.config.chainID,
|
|
348
|
+
gasLimit: 0n,
|
|
349
|
+
});
|
|
350
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
351
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitDcdtNftCreate + storageGasLimit);
|
|
352
|
+
return transaction;
|
|
353
|
+
}
|
|
354
|
+
async createTransactionForPausing(sender, options) {
|
|
339
355
|
const dataParts = ["pause", ...this.argSerializer.valuesToStrings([new abi_1.StringValue(options.tokenIdentifier)])];
|
|
340
|
-
|
|
341
|
-
config: this.config,
|
|
356
|
+
const transaction = new transaction_1.Transaction({
|
|
342
357
|
sender: sender,
|
|
343
358
|
receiver: sender,
|
|
344
|
-
|
|
345
|
-
gasLimit:
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
359
|
+
chainID: this.config.chainID,
|
|
360
|
+
gasLimit: 0n,
|
|
361
|
+
});
|
|
362
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
363
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitPausing);
|
|
364
|
+
return transaction;
|
|
365
|
+
}
|
|
366
|
+
async createTransactionForUnpausing(sender, options) {
|
|
350
367
|
const dataParts = [
|
|
351
368
|
"unPause",
|
|
352
369
|
...this.argSerializer.valuesToStrings([new abi_1.StringValue(options.tokenIdentifier)]),
|
|
353
370
|
];
|
|
354
|
-
|
|
355
|
-
config: this.config,
|
|
371
|
+
const transaction = new transaction_1.Transaction({
|
|
356
372
|
sender: sender,
|
|
357
373
|
receiver: sender,
|
|
358
|
-
|
|
359
|
-
gasLimit:
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
374
|
+
chainID: this.config.chainID,
|
|
375
|
+
gasLimit: 0n,
|
|
376
|
+
});
|
|
377
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
378
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitPausing);
|
|
379
|
+
return transaction;
|
|
380
|
+
}
|
|
381
|
+
async createTransactionForFreezing(sender, options) {
|
|
364
382
|
const dataParts = [
|
|
365
383
|
"freeze",
|
|
366
384
|
...this.argSerializer.valuesToStrings([
|
|
@@ -368,16 +386,17 @@ class TokenManagementTransactionsFactory {
|
|
|
368
386
|
new abi_1.AddressValue(options.user),
|
|
369
387
|
]),
|
|
370
388
|
];
|
|
371
|
-
|
|
372
|
-
config: this.config,
|
|
389
|
+
const transaction = new transaction_1.Transaction({
|
|
373
390
|
sender: sender,
|
|
374
391
|
receiver: sender,
|
|
375
|
-
|
|
376
|
-
gasLimit:
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
392
|
+
chainID: this.config.chainID,
|
|
393
|
+
gasLimit: 0n,
|
|
394
|
+
});
|
|
395
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
396
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitFreezing);
|
|
397
|
+
return transaction;
|
|
398
|
+
}
|
|
399
|
+
async createTransactionForUnfreezing(sender, options) {
|
|
381
400
|
const dataParts = [
|
|
382
401
|
"UnFreeze",
|
|
383
402
|
...this.argSerializer.valuesToStrings([
|
|
@@ -385,16 +404,17 @@ class TokenManagementTransactionsFactory {
|
|
|
385
404
|
new abi_1.AddressValue(options.user),
|
|
386
405
|
]),
|
|
387
406
|
];
|
|
388
|
-
|
|
389
|
-
config: this.config,
|
|
407
|
+
const transaction = new transaction_1.Transaction({
|
|
390
408
|
sender: sender,
|
|
391
409
|
receiver: sender,
|
|
392
|
-
|
|
393
|
-
gasLimit:
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
410
|
+
chainID: this.config.chainID,
|
|
411
|
+
gasLimit: 0n,
|
|
412
|
+
});
|
|
413
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
414
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitFreezing);
|
|
415
|
+
return transaction;
|
|
416
|
+
}
|
|
417
|
+
async createTransactionForWiping(sender, options) {
|
|
398
418
|
const dataParts = [
|
|
399
419
|
"wipe",
|
|
400
420
|
...this.argSerializer.valuesToStrings([
|
|
@@ -402,16 +422,17 @@ class TokenManagementTransactionsFactory {
|
|
|
402
422
|
new abi_1.AddressValue(options.user),
|
|
403
423
|
]),
|
|
404
424
|
];
|
|
405
|
-
|
|
406
|
-
config: this.config,
|
|
425
|
+
const transaction = new transaction_1.Transaction({
|
|
407
426
|
sender: sender,
|
|
408
427
|
receiver: sender,
|
|
409
|
-
|
|
410
|
-
gasLimit:
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
428
|
+
chainID: this.config.chainID,
|
|
429
|
+
gasLimit: 0n,
|
|
430
|
+
});
|
|
431
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
432
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitWiping);
|
|
433
|
+
return transaction;
|
|
434
|
+
}
|
|
435
|
+
async createTransactionForLocalMint(sender, options) {
|
|
415
436
|
const dataParts = [
|
|
416
437
|
"DCDTLocalMint",
|
|
417
438
|
...this.argSerializer.valuesToStrings([
|
|
@@ -419,16 +440,17 @@ class TokenManagementTransactionsFactory {
|
|
|
419
440
|
new abi_1.BigUIntValue(options.supplyToMint),
|
|
420
441
|
]),
|
|
421
442
|
];
|
|
422
|
-
|
|
423
|
-
config: this.config,
|
|
443
|
+
const transaction = new transaction_1.Transaction({
|
|
424
444
|
sender: sender,
|
|
425
445
|
receiver: sender,
|
|
426
|
-
|
|
427
|
-
gasLimit:
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
446
|
+
chainID: this.config.chainID,
|
|
447
|
+
gasLimit: 0n,
|
|
448
|
+
});
|
|
449
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
450
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitDcdtLocalMint);
|
|
451
|
+
return transaction;
|
|
452
|
+
}
|
|
453
|
+
async createTransactionForLocalBurning(sender, options) {
|
|
432
454
|
const dataParts = [
|
|
433
455
|
"DCDTLocalBurn",
|
|
434
456
|
...this.argSerializer.valuesToStrings([
|
|
@@ -436,16 +458,17 @@ class TokenManagementTransactionsFactory {
|
|
|
436
458
|
new abi_1.BigUIntValue(options.supplyToBurn),
|
|
437
459
|
]),
|
|
438
460
|
];
|
|
439
|
-
|
|
440
|
-
config: this.config,
|
|
461
|
+
const transaction = new transaction_1.Transaction({
|
|
441
462
|
sender: sender,
|
|
442
463
|
receiver: sender,
|
|
443
|
-
|
|
444
|
-
gasLimit:
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
464
|
+
chainID: this.config.chainID,
|
|
465
|
+
gasLimit: 0n,
|
|
466
|
+
});
|
|
467
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
468
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitDcdtLocalBurn);
|
|
469
|
+
return transaction;
|
|
470
|
+
}
|
|
471
|
+
async createTransactionForUpdatingAttributes(sender, options) {
|
|
449
472
|
const dataParts = [
|
|
450
473
|
"DCDTNFTUpdateAttributes",
|
|
451
474
|
...this.argSerializer.valuesToStrings([
|
|
@@ -454,16 +477,17 @@ class TokenManagementTransactionsFactory {
|
|
|
454
477
|
new abi_1.BytesValue(Buffer.from(options.attributes)),
|
|
455
478
|
]),
|
|
456
479
|
];
|
|
457
|
-
|
|
458
|
-
config: this.config,
|
|
480
|
+
const transaction = new transaction_1.Transaction({
|
|
459
481
|
sender: sender,
|
|
460
482
|
receiver: sender,
|
|
461
|
-
|
|
462
|
-
gasLimit:
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
483
|
+
chainID: this.config.chainID,
|
|
484
|
+
gasLimit: 0n,
|
|
485
|
+
});
|
|
486
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
487
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitDcdtNftUpdateAttributes);
|
|
488
|
+
return transaction;
|
|
489
|
+
}
|
|
490
|
+
async createTransactionForAddingQuantity(sender, options) {
|
|
467
491
|
const dataParts = [
|
|
468
492
|
"DCDTNFTAddQuantity",
|
|
469
493
|
...this.argSerializer.valuesToStrings([
|
|
@@ -472,16 +496,17 @@ class TokenManagementTransactionsFactory {
|
|
|
472
496
|
new abi_1.BigUIntValue(options.quantity),
|
|
473
497
|
]),
|
|
474
498
|
];
|
|
475
|
-
|
|
476
|
-
config: this.config,
|
|
499
|
+
const transaction = new transaction_1.Transaction({
|
|
477
500
|
sender: sender,
|
|
478
501
|
receiver: sender,
|
|
479
|
-
|
|
480
|
-
gasLimit:
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
502
|
+
chainID: this.config.chainID,
|
|
503
|
+
gasLimit: 0n,
|
|
504
|
+
});
|
|
505
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
506
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitDcdtNftAddQuantity);
|
|
507
|
+
return transaction;
|
|
508
|
+
}
|
|
509
|
+
async createTransactionForBurningQuantity(sender, options) {
|
|
485
510
|
const dataParts = [
|
|
486
511
|
"DCDTNFTBurn",
|
|
487
512
|
...this.argSerializer.valuesToStrings([
|
|
@@ -490,16 +515,17 @@ class TokenManagementTransactionsFactory {
|
|
|
490
515
|
new abi_1.BigUIntValue(options.quantity),
|
|
491
516
|
]),
|
|
492
517
|
];
|
|
493
|
-
|
|
494
|
-
config: this.config,
|
|
518
|
+
const transaction = new transaction_1.Transaction({
|
|
495
519
|
sender: sender,
|
|
496
520
|
receiver: sender,
|
|
497
|
-
|
|
498
|
-
gasLimit:
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
521
|
+
chainID: this.config.chainID,
|
|
522
|
+
gasLimit: 0n,
|
|
523
|
+
});
|
|
524
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
525
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitDcdtNftBurn);
|
|
526
|
+
return transaction;
|
|
527
|
+
}
|
|
528
|
+
async createTransactionForModifyingRoyalties(sender, options) {
|
|
503
529
|
const dataParts = [
|
|
504
530
|
"DCDTModifyRoyalties",
|
|
505
531
|
...this.argSerializer.valuesToStrings([
|
|
@@ -508,16 +534,17 @@ class TokenManagementTransactionsFactory {
|
|
|
508
534
|
new abi_1.BigUIntValue(options.newRoyalties),
|
|
509
535
|
]),
|
|
510
536
|
];
|
|
511
|
-
|
|
512
|
-
config: this.config,
|
|
537
|
+
const transaction = new transaction_1.Transaction({
|
|
513
538
|
sender: sender,
|
|
514
539
|
receiver: sender,
|
|
515
|
-
|
|
516
|
-
gasLimit:
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
540
|
+
chainID: this.config.chainID,
|
|
541
|
+
gasLimit: 0n,
|
|
542
|
+
});
|
|
543
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
544
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitDcdtModifyRoyalties);
|
|
545
|
+
return transaction;
|
|
546
|
+
}
|
|
547
|
+
async createTransactionForSettingNewUris(sender, options) {
|
|
521
548
|
if (!options.newUris.length) {
|
|
522
549
|
throw new errors_1.ErrBadUsage("No URIs provided");
|
|
523
550
|
}
|
|
@@ -529,16 +556,17 @@ class TokenManagementTransactionsFactory {
|
|
|
529
556
|
...options.newUris.map((uri) => new abi_1.StringValue(uri)),
|
|
530
557
|
]),
|
|
531
558
|
];
|
|
532
|
-
|
|
533
|
-
config: this.config,
|
|
559
|
+
const transaction = new transaction_1.Transaction({
|
|
534
560
|
sender: sender,
|
|
535
561
|
receiver: sender,
|
|
536
|
-
|
|
537
|
-
gasLimit:
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
562
|
+
chainID: this.config.chainID,
|
|
563
|
+
gasLimit: 0n,
|
|
564
|
+
});
|
|
565
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
566
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitSetNewUris);
|
|
567
|
+
return transaction;
|
|
568
|
+
}
|
|
569
|
+
async createTransactionForModifyingCreator(sender, options) {
|
|
542
570
|
const dataParts = [
|
|
543
571
|
"DCDTModifyCreator",
|
|
544
572
|
...this.argSerializer.valuesToStrings([
|
|
@@ -546,16 +574,17 @@ class TokenManagementTransactionsFactory {
|
|
|
546
574
|
new abi_1.BigUIntValue(options.tokenNonce),
|
|
547
575
|
]),
|
|
548
576
|
];
|
|
549
|
-
|
|
550
|
-
config: this.config,
|
|
577
|
+
const transaction = new transaction_1.Transaction({
|
|
551
578
|
sender: sender,
|
|
552
579
|
receiver: sender,
|
|
553
|
-
|
|
554
|
-
gasLimit:
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
580
|
+
chainID: this.config.chainID,
|
|
581
|
+
gasLimit: 0n,
|
|
582
|
+
});
|
|
583
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
584
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitDcdtModifyCreator);
|
|
585
|
+
return transaction;
|
|
586
|
+
}
|
|
587
|
+
async createTransactionForUpdatingMetadata(sender, options) {
|
|
559
588
|
const dataParts = [
|
|
560
589
|
"DCDTMetaDataUpdate",
|
|
561
590
|
...this.argSerializer.valuesToStrings([
|
|
@@ -568,16 +597,17 @@ class TokenManagementTransactionsFactory {
|
|
|
568
597
|
...(options.newUris ? options.newUris.map((uri) => new abi_1.StringValue(uri)) : []),
|
|
569
598
|
]),
|
|
570
599
|
];
|
|
571
|
-
|
|
572
|
-
config: this.config,
|
|
600
|
+
const transaction = new transaction_1.Transaction({
|
|
573
601
|
sender: sender,
|
|
574
602
|
receiver: sender,
|
|
575
|
-
|
|
576
|
-
gasLimit:
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
603
|
+
chainID: this.config.chainID,
|
|
604
|
+
gasLimit: 0n,
|
|
605
|
+
});
|
|
606
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
607
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitDcdtMetadataUpdate);
|
|
608
|
+
return transaction;
|
|
609
|
+
}
|
|
610
|
+
async createTransactionForMetadataRecreate(sender, options) {
|
|
581
611
|
const dataParts = [
|
|
582
612
|
"DCDTMetaDataRecreate",
|
|
583
613
|
...this.argSerializer.valuesToStrings([
|
|
@@ -590,44 +620,47 @@ class TokenManagementTransactionsFactory {
|
|
|
590
620
|
...(options.newUris ? options.newUris.map((uri) => new abi_1.StringValue(uri)) : []),
|
|
591
621
|
]),
|
|
592
622
|
];
|
|
593
|
-
|
|
594
|
-
config: this.config,
|
|
623
|
+
const transaction = new transaction_1.Transaction({
|
|
595
624
|
sender: sender,
|
|
596
625
|
receiver: sender,
|
|
597
|
-
|
|
598
|
-
gasLimit:
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
626
|
+
chainID: this.config.chainID,
|
|
627
|
+
gasLimit: 0n,
|
|
628
|
+
});
|
|
629
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
630
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitNftMetadataRecreate);
|
|
631
|
+
return transaction;
|
|
632
|
+
}
|
|
633
|
+
async createTransactionForChangingTokenToDynamic(sender, options) {
|
|
603
634
|
const dataParts = [
|
|
604
635
|
"changeToDynamic",
|
|
605
636
|
...this.argSerializer.valuesToStrings([new abi_1.StringValue(options.tokenIdentifier)]),
|
|
606
637
|
];
|
|
607
|
-
|
|
608
|
-
config: this.config,
|
|
638
|
+
const transaction = new transaction_1.Transaction({
|
|
609
639
|
sender: sender,
|
|
610
640
|
receiver: this.dcdtContractAddress,
|
|
611
|
-
|
|
612
|
-
gasLimit:
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
641
|
+
chainID: this.config.chainID,
|
|
642
|
+
gasLimit: 0n,
|
|
643
|
+
});
|
|
644
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
645
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitNftChangeToDynamic);
|
|
646
|
+
return transaction;
|
|
647
|
+
}
|
|
648
|
+
async createTransactionForUpdatingTokenId(sender, options) {
|
|
617
649
|
const dataParts = [
|
|
618
650
|
"updateTokenID",
|
|
619
651
|
...this.argSerializer.valuesToStrings([new abi_1.StringValue(options.tokenIdentifier)]),
|
|
620
652
|
];
|
|
621
|
-
|
|
622
|
-
config: this.config,
|
|
653
|
+
const transaction = new transaction_1.Transaction({
|
|
623
654
|
sender: sender,
|
|
624
655
|
receiver: this.dcdtContractAddress,
|
|
625
|
-
|
|
626
|
-
gasLimit:
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
656
|
+
chainID: this.config.chainID,
|
|
657
|
+
gasLimit: 0n,
|
|
658
|
+
});
|
|
659
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
660
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitUpdateTokenId);
|
|
661
|
+
return transaction;
|
|
662
|
+
}
|
|
663
|
+
async createTransactionForRegisteringDynamicToken(sender, options) {
|
|
631
664
|
const dataParts = [
|
|
632
665
|
"registerDynamic",
|
|
633
666
|
...this.argSerializer.valuesToStrings([
|
|
@@ -636,17 +669,18 @@ class TokenManagementTransactionsFactory {
|
|
|
636
669
|
new abi_1.StringValue(options.tokenType),
|
|
637
670
|
]),
|
|
638
671
|
];
|
|
639
|
-
|
|
640
|
-
config: this.config,
|
|
672
|
+
const transaction = new transaction_1.Transaction({
|
|
641
673
|
sender: sender,
|
|
642
674
|
receiver: this.dcdtContractAddress,
|
|
643
|
-
|
|
644
|
-
gasLimit:
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
675
|
+
chainID: this.config.chainID,
|
|
676
|
+
gasLimit: 0n,
|
|
677
|
+
value: this.config.issueCost,
|
|
678
|
+
});
|
|
679
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
680
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitRegisterDynamic);
|
|
681
|
+
return transaction;
|
|
682
|
+
}
|
|
683
|
+
async createTransactionForRegisteringDynamicAndSettingRoles(sender, options) {
|
|
650
684
|
const dataParts = [
|
|
651
685
|
"registerAndSetAllRolesDynamic",
|
|
652
686
|
...this.argSerializer.valuesToStrings([
|
|
@@ -655,15 +689,16 @@ class TokenManagementTransactionsFactory {
|
|
|
655
689
|
new abi_1.StringValue(options.tokenType),
|
|
656
690
|
]),
|
|
657
691
|
];
|
|
658
|
-
|
|
659
|
-
config: this.config,
|
|
692
|
+
const transaction = new transaction_1.Transaction({
|
|
660
693
|
sender: sender,
|
|
661
694
|
receiver: this.dcdtContractAddress,
|
|
662
|
-
|
|
663
|
-
gasLimit:
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
695
|
+
chainID: this.config.chainID,
|
|
696
|
+
gasLimit: 0n,
|
|
697
|
+
value: this.config.issueCost,
|
|
698
|
+
});
|
|
699
|
+
this.setTransactionPayload(transaction, dataParts);
|
|
700
|
+
await this.setGasLimit(transaction, undefined, this.config.gasLimitRegisterDynamic);
|
|
701
|
+
return transaction;
|
|
667
702
|
}
|
|
668
703
|
notifyAboutUnsettingBurnRoleGlobally() {
|
|
669
704
|
logger_1.Logger.info(`
|