@sravankumar02/sdk-core 1.0.0 → 2.0.1

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.
Files changed (154) hide show
  1. package/out/abi/codec/binary.js.map +1 -1
  2. package/out/abi/codec/managedDecimal.js +17 -5
  3. package/out/abi/codec/managedDecimal.js.map +1 -1
  4. package/out/abi/codec/managedDecimalSigned.js +17 -5
  5. package/out/abi/codec/managedDecimalSigned.js.map +1 -1
  6. package/out/abi/index.d.ts +0 -3
  7. package/out/abi/index.js +0 -3
  8. package/out/abi/index.js.map +1 -1
  9. package/out/abi/nativeSerializer.js +1 -1
  10. package/out/abi/nativeSerializer.js.map +1 -1
  11. package/out/abi/typesystem/typeMapper.js +2 -0
  12. package/out/abi/typesystem/typeMapper.js.map +1 -1
  13. package/out/accountManagement/accountController.d.ts +2 -1
  14. package/out/accountManagement/accountController.js +11 -20
  15. package/out/accountManagement/accountController.js.map +1 -1
  16. package/out/accountManagement/accountTransactionsFactory.d.ts +10 -5
  17. package/out/accountManagement/accountTransactionsFactory.js +45 -34
  18. package/out/accountManagement/accountTransactionsFactory.js.map +1 -1
  19. package/out/core/address.d.ts +1 -25
  20. package/out/core/address.js +3 -41
  21. package/out/core/address.js.map +1 -1
  22. package/out/core/baseController.d.ts +9 -3
  23. package/out/core/baseController.js +24 -10
  24. package/out/core/baseController.js.map +1 -1
  25. package/out/core/baseFactory.d.ts +25 -0
  26. package/out/core/baseFactory.js +40 -0
  27. package/out/core/baseFactory.js.map +1 -0
  28. package/out/core/codeMetadata.d.ts +0 -10
  29. package/out/core/codeMetadata.js +0 -27
  30. package/out/core/codeMetadata.js.map +1 -1
  31. package/out/core/constants.d.ts +1 -0
  32. package/out/core/constants.js +2 -1
  33. package/out/core/constants.js.map +1 -1
  34. package/out/core/errors.d.ts +9 -0
  35. package/out/core/errors.js +17 -2
  36. package/out/core/errors.js.map +1 -1
  37. package/out/core/index.d.ts +2 -0
  38. package/out/core/index.js +2 -0
  39. package/out/core/index.js.map +1 -1
  40. package/out/core/interfaces.d.ts +5 -0
  41. package/out/core/tokens.d.ts +1 -77
  42. package/out/core/tokens.js +2 -144
  43. package/out/core/tokens.js.map +1 -1
  44. package/out/core/transaction.d.ts +1 -144
  45. package/out/core/transaction.js +0 -209
  46. package/out/core/transaction.js.map +1 -1
  47. package/out/core/transactionStatus.d.ts +0 -5
  48. package/out/core/transactionStatus.js +0 -7
  49. package/out/core/transactionStatus.js.map +1 -1
  50. package/out/core/transactionsFactoryConfig.d.ts +16 -0
  51. package/out/core/transactionsFactoryConfig.js +17 -0
  52. package/out/core/transactionsFactoryConfig.js.map +1 -1
  53. package/out/delegation/delegationController.d.ts +2 -1
  54. package/out/delegation/delegationController.js +39 -134
  55. package/out/delegation/delegationController.js.map +1 -1
  56. package/out/delegation/delegationTransactionsFactory.d.ts +23 -20
  57. package/out/delegation/delegationTransactionsFactory.js +183 -159
  58. package/out/delegation/delegationTransactionsFactory.js.map +1 -1
  59. package/out/entrypoints/entrypoints.d.ts +36 -3
  60. package/out/entrypoints/entrypoints.js +102 -27
  61. package/out/entrypoints/entrypoints.js.map +1 -1
  62. package/out/gasEstimator/gasLimitEstimator.d.ts +19 -0
  63. package/out/gasEstimator/gasLimitEstimator.js +22 -0
  64. package/out/gasEstimator/gasLimitEstimator.js.map +1 -0
  65. package/out/gasEstimator/index.d.ts +1 -0
  66. package/out/gasEstimator/index.js +6 -0
  67. package/out/gasEstimator/index.js.map +1 -0
  68. package/out/governance/governanceController.d.ts +2 -1
  69. package/out/governance/governanceController.js +13 -43
  70. package/out/governance/governanceController.js.map +1 -1
  71. package/out/governance/governanceTransactionsFactory.d.ts +10 -8
  72. package/out/governance/governanceTransactionsFactory.js +60 -52
  73. package/out/governance/governanceTransactionsFactory.js.map +1 -1
  74. package/out/index.d.ts +1 -0
  75. package/out/index.js +1 -0
  76. package/out/index.js.map +1 -1
  77. package/out/multisig/index.d.ts +2 -0
  78. package/out/multisig/index.js +2 -0
  79. package/out/multisig/index.js.map +1 -1
  80. package/out/multisig/multisigController.d.ts +2 -1
  81. package/out/multisig/multisigController.js +61 -117
  82. package/out/multisig/multisigController.js.map +1 -1
  83. package/out/multisig/multisigTransactionsFactory.d.ts +26 -24
  84. package/out/multisig/multisigTransactionsFactory.js +57 -54
  85. package/out/multisig/multisigTransactionsFactory.js.map +1 -1
  86. package/out/multisig/proposeTransferExecuteContractInput.d.ts +2 -2
  87. package/out/multisig/proposeTransferExecuteContractInput.js +4 -4
  88. package/out/multisig/proposeTransferExecuteContractInput.js.map +1 -1
  89. package/out/multisig/resources.d.ts +2 -2
  90. package/out/networkProviders/apiNetworkProvider.js +1 -3
  91. package/out/networkProviders/apiNetworkProvider.js.map +1 -1
  92. package/out/networkProviders/proxyNetworkProvider.js +20 -1
  93. package/out/networkProviders/proxyNetworkProvider.js.map +1 -1
  94. package/out/networkProviders/tokens.d.ts +1 -1
  95. package/out/networkProviders/tokens.js +14 -11
  96. package/out/networkProviders/tokens.js.map +1 -1
  97. package/out/smartContracts/resources.d.ts +6 -2
  98. package/out/smartContracts/smartContractController.d.ts +2 -1
  99. package/out/smartContracts/smartContractController.js +10 -22
  100. package/out/smartContracts/smartContractController.js.map +1 -1
  101. package/out/smartContracts/smartContractTransactionsFactory.d.ts +12 -7
  102. package/out/smartContracts/smartContractTransactionsFactory.js +62 -44
  103. package/out/smartContracts/smartContractTransactionsFactory.js.map +1 -1
  104. package/out/tokenManagement/tokenManagementController.d.ts +2 -1
  105. package/out/tokenManagement/tokenManagementController.js +71 -246
  106. package/out/tokenManagement/tokenManagementController.js.map +1 -1
  107. package/out/tokenManagement/tokenManagementTransactionsFactory.d.ts +39 -36
  108. package/out/tokenManagement/tokenManagementTransactionsFactory.js +310 -275
  109. package/out/tokenManagement/tokenManagementTransactionsFactory.js.map +1 -1
  110. package/out/transfers/transferTransactionsFactory.d.ts +10 -8
  111. package/out/transfers/transferTransactionsFactory.js +28 -26
  112. package/out/transfers/transferTransactionsFactory.js.map +1 -1
  113. package/out/transfers/transfersControllers.d.ts +2 -1
  114. package/out/transfers/transfersControllers.js +10 -23
  115. package/out/transfers/transfersControllers.js.map +1 -1
  116. package/out/validators/index.d.ts +2 -0
  117. package/out/validators/index.js +15 -0
  118. package/out/validators/index.js.map +1 -0
  119. package/out/validators/resources.d.ts +40 -0
  120. package/out/validators/resources.js +3 -0
  121. package/out/validators/resources.js.map +1 -0
  122. package/out/validators/validatorsController.d.ts +27 -0
  123. package/out/validators/validatorsController.js +95 -0
  124. package/out/validators/validatorsController.js.map +1 -0
  125. package/out/validators/validatorsSigner.d.ts +9 -0
  126. package/out/validators/validatorsSigner.js +25 -0
  127. package/out/validators/validatorsSigner.js.map +1 -0
  128. package/out/validators/validatorsTransactionsFactory.d.ts +33 -0
  129. package/out/validators/validatorsTransactionsFactory.js +269 -0
  130. package/out/validators/validatorsTransactionsFactory.js.map +1 -0
  131. package/out/wallet/index.d.ts +1 -0
  132. package/out/wallet/index.js +1 -0
  133. package/out/wallet/index.js.map +1 -1
  134. package/out/wallet/userWallet.d.ts +1 -1
  135. package/out/wallet/userWallet.js +1 -1
  136. package/out/wallet/validatorPem.d.ts +12 -0
  137. package/out/wallet/validatorPem.js +45 -0
  138. package/out/wallet/validatorPem.js.map +1 -0
  139. package/out/wallet/validatorSigner.d.ts +9 -1
  140. package/out/wallet/validatorSigner.js +24 -1
  141. package/out/wallet/validatorSigner.js.map +1 -1
  142. package/package.json +6 -5
  143. package/out/abi/code.d.ts +0 -23
  144. package/out/abi/code.js +0 -41
  145. package/out/abi/code.js.map +0 -1
  146. package/out/abi/interaction.d.ts +0 -67
  147. package/out/abi/interaction.js +0 -146
  148. package/out/abi/interaction.js.map +0 -1
  149. package/out/abi/smartContract.d.ts +0 -74
  150. package/out/abi/smartContract.js +0 -208
  151. package/out/abi/smartContract.js.map +0 -1
  152. package/out/core/transactionBuilder.d.ts +0 -32
  153. package/out/core/transactionBuilder.js +0 -45
  154. 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 transactionBuilder_1 = require("../core/transactionBuilder");
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
- return new transactionBuilder_1.TransactionBuilder({
43
- config: this.config,
44
+ const transaction = new transaction_1.Transaction({
44
45
  sender: sender,
45
46
  receiver: this.dcdtContractAddress,
46
- dataParts: dataParts,
47
- gasLimit: this.config.gasLimitIssue,
48
- addDataMovementGas: true,
49
- amount: this.config.issueCost,
50
- }).build();
51
- }
52
- createTransactionForIssuingSemiFungible(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
74
- config: this.config,
76
+ const transaction = new transaction_1.Transaction({
75
77
  sender: sender,
76
78
  receiver: this.dcdtContractAddress,
77
- dataParts: dataParts,
78
- gasLimit: this.config.gasLimitIssue,
79
- addDataMovementGas: true,
80
- amount: this.config.issueCost,
81
- }).build();
82
- }
83
- createTransactionForIssuingNonFungible(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
105
- config: this.config,
108
+ const transaction = new transaction_1.Transaction({
106
109
  sender: sender,
107
110
  receiver: this.dcdtContractAddress,
108
- dataParts: dataParts,
109
- gasLimit: this.config.gasLimitIssue,
110
- addDataMovementGas: true,
111
- amount: this.config.issueCost,
112
- }).build();
113
- }
114
- createTransactionForRegisteringMetaDCDT(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
137
- config: this.config,
141
+ const transaction = new transaction_1.Transaction({
138
142
  sender: sender,
139
143
  receiver: this.dcdtContractAddress,
140
- dataParts: dataParts,
141
- gasLimit: this.config.gasLimitIssue,
142
- addDataMovementGas: true,
143
- amount: this.config.issueCost,
144
- }).build();
145
- }
146
- createTransactionForRegisteringAndSettingRoles(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
158
- config: this.config,
163
+ const transaction = new transaction_1.Transaction({
159
164
  sender: sender,
160
165
  receiver: this.dcdtContractAddress,
161
- dataParts: dataParts,
162
- gasLimit: this.config.gasLimitIssue,
163
- addDataMovementGas: true,
164
- amount: this.config.issueCost,
165
- }).build();
166
- }
167
- createTransactionForSettingBurnRoleGlobally(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
173
- config: this.config,
179
+ const transaction = new transaction_1.Transaction({
174
180
  sender: sender,
175
181
  receiver: this.dcdtContractAddress,
176
- dataParts: dataParts,
177
- gasLimit: this.config.gasLimitToggleBurnRoleGlobally,
178
- addDataMovementGas: true,
179
- }).build();
180
- }
181
- createTransactionForUnsettingBurnRoleGlobally(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
187
- config: this.config,
194
+ const transaction = new transaction_1.Transaction({
188
195
  sender: sender,
189
196
  receiver: this.dcdtContractAddress,
190
- dataParts: dataParts,
191
- gasLimit: this.config.gasLimitToggleBurnRoleGlobally,
192
- addDataMovementGas: true,
193
- }).build();
194
- }
195
- createTransactionForSettingSpecialRoleOnFungibleToken(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
202
- config: this.config,
210
+ const transaction = new transaction_1.Transaction({
203
211
  sender: sender,
204
212
  receiver: this.dcdtContractAddress,
205
- dataParts: dataParts,
206
- gasLimit: this.config.gasLimitSetSpecialRole,
207
- addDataMovementGas: true,
208
- }).build();
209
- }
210
- createTransactionForUnsettingSpecialRoleOnFungibleToken(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
217
- config: this.config,
226
+ const transaction = new transaction_1.Transaction({
218
227
  sender: sender,
219
228
  receiver: this.dcdtContractAddress,
220
- dataParts: dataParts,
221
- gasLimit: this.config.gasLimitSetSpecialRole,
222
- addDataMovementGas: true,
223
- }).build();
224
- }
225
- createTransactionForSettingSpecialRoleOnSemiFungibleToken(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
238
- config: this.config,
248
+ const transaction = new transaction_1.Transaction({
239
249
  sender: sender,
240
250
  receiver: this.dcdtContractAddress,
241
- dataParts: dataParts,
242
- gasLimit: this.config.gasLimitSetSpecialRole,
243
- addDataMovementGas: true,
244
- }).build();
245
- }
246
- createTransactionForUnsettingSpecialRoleOnSemiFungibleToken(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
258
- config: this.config,
269
+ const transaction = new transaction_1.Transaction({
259
270
  sender: sender,
260
271
  receiver: this.dcdtContractAddress,
261
- dataParts: dataParts,
262
- gasLimit: this.config.gasLimitSetSpecialRole,
263
- addDataMovementGas: true,
264
- }).build();
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
- return new transactionBuilder_1.TransactionBuilder({
285
- config: this.config,
297
+ const transaction = new transaction_1.Transaction({
286
298
  sender: sender,
287
299
  receiver: this.dcdtContractAddress,
288
- dataParts: dataParts,
289
- gasLimit: this.config.gasLimitSetSpecialRole,
290
- addDataMovementGas: true,
291
- }).build();
292
- }
293
- createTransactionForUnsettingSpecialRoleOnNonFungibleToken(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
305
- config: this.config,
318
+ const transaction = new transaction_1.Transaction({
306
319
  sender: sender,
307
320
  receiver: this.dcdtContractAddress,
308
- dataParts: dataParts,
309
- gasLimit: this.config.gasLimitSetSpecialRole,
310
- addDataMovementGas: true,
311
- }).build();
312
- }
313
- createTransactionForCreatingNFT(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
330
- config: this.config,
344
+ const transaction = new transaction_1.Transaction({
331
345
  sender: sender,
332
346
  receiver: sender,
333
- dataParts: dataParts,
334
- gasLimit: this.config.gasLimitDcdtNftCreate + storageGasLimit,
335
- addDataMovementGas: true,
336
- }).build();
337
- }
338
- createTransactionForPausing(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
341
- config: this.config,
356
+ const transaction = new transaction_1.Transaction({
342
357
  sender: sender,
343
358
  receiver: sender,
344
- dataParts: dataParts,
345
- gasLimit: this.config.gasLimitPausing,
346
- addDataMovementGas: true,
347
- }).build();
348
- }
349
- createTransactionForUnpausing(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
355
- config: this.config,
371
+ const transaction = new transaction_1.Transaction({
356
372
  sender: sender,
357
373
  receiver: sender,
358
- dataParts: dataParts,
359
- gasLimit: this.config.gasLimitPausing,
360
- addDataMovementGas: true,
361
- }).build();
362
- }
363
- createTransactionForFreezing(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
372
- config: this.config,
389
+ const transaction = new transaction_1.Transaction({
373
390
  sender: sender,
374
391
  receiver: sender,
375
- dataParts: dataParts,
376
- gasLimit: this.config.gasLimitFreezing,
377
- addDataMovementGas: true,
378
- }).build();
379
- }
380
- createTransactionForUnfreezing(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
389
- config: this.config,
407
+ const transaction = new transaction_1.Transaction({
390
408
  sender: sender,
391
409
  receiver: sender,
392
- dataParts: dataParts,
393
- gasLimit: this.config.gasLimitFreezing,
394
- addDataMovementGas: true,
395
- }).build();
396
- }
397
- createTransactionForWiping(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
406
- config: this.config,
425
+ const transaction = new transaction_1.Transaction({
407
426
  sender: sender,
408
427
  receiver: sender,
409
- dataParts: dataParts,
410
- gasLimit: this.config.gasLimitWiping,
411
- addDataMovementGas: true,
412
- }).build();
413
- }
414
- createTransactionForLocalMint(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
423
- config: this.config,
443
+ const transaction = new transaction_1.Transaction({
424
444
  sender: sender,
425
445
  receiver: sender,
426
- dataParts: dataParts,
427
- gasLimit: this.config.gasLimitDcdtLocalMint,
428
- addDataMovementGas: true,
429
- }).build();
430
- }
431
- createTransactionForLocalBurning(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
440
- config: this.config,
461
+ const transaction = new transaction_1.Transaction({
441
462
  sender: sender,
442
463
  receiver: sender,
443
- dataParts: dataParts,
444
- gasLimit: this.config.gasLimitDcdtLocalBurn,
445
- addDataMovementGas: true,
446
- }).build();
447
- }
448
- createTransactionForUpdatingAttributes(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
458
- config: this.config,
480
+ const transaction = new transaction_1.Transaction({
459
481
  sender: sender,
460
482
  receiver: sender,
461
- dataParts: dataParts,
462
- gasLimit: this.config.gasLimitDcdtNftUpdateAttributes,
463
- addDataMovementGas: true,
464
- }).build();
465
- }
466
- createTransactionForAddingQuantity(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
476
- config: this.config,
499
+ const transaction = new transaction_1.Transaction({
477
500
  sender: sender,
478
501
  receiver: sender,
479
- dataParts: dataParts,
480
- gasLimit: this.config.gasLimitDcdtNftAddQuantity,
481
- addDataMovementGas: true,
482
- }).build();
483
- }
484
- createTransactionForBurningQuantity(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
494
- config: this.config,
518
+ const transaction = new transaction_1.Transaction({
495
519
  sender: sender,
496
520
  receiver: sender,
497
- dataParts: dataParts,
498
- gasLimit: this.config.gasLimitDcdtNftBurn,
499
- addDataMovementGas: true,
500
- }).build();
501
- }
502
- createTransactionForModifyingRoyalties(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
512
- config: this.config,
537
+ const transaction = new transaction_1.Transaction({
513
538
  sender: sender,
514
539
  receiver: sender,
515
- dataParts: dataParts,
516
- gasLimit: this.config.gasLimitDcdtModifyRoyalties,
517
- addDataMovementGas: true,
518
- }).build();
519
- }
520
- createTransactionForSettingNewUris(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
533
- config: this.config,
559
+ const transaction = new transaction_1.Transaction({
534
560
  sender: sender,
535
561
  receiver: sender,
536
- dataParts: dataParts,
537
- gasLimit: this.config.gasLimitSetNewUris,
538
- addDataMovementGas: true,
539
- }).build();
540
- }
541
- createTransactionForModifyingCreator(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
550
- config: this.config,
577
+ const transaction = new transaction_1.Transaction({
551
578
  sender: sender,
552
579
  receiver: sender,
553
- dataParts: dataParts,
554
- gasLimit: this.config.gasLimitDcdtModifyCreator,
555
- addDataMovementGas: true,
556
- }).build();
557
- }
558
- createTransactionForUpdatingMetadata(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
572
- config: this.config,
600
+ const transaction = new transaction_1.Transaction({
573
601
  sender: sender,
574
602
  receiver: sender,
575
- dataParts: dataParts,
576
- gasLimit: this.config.gasLimitDcdtMetadataUpdate,
577
- addDataMovementGas: true,
578
- }).build();
579
- }
580
- createTransactionForMetadataRecreate(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
594
- config: this.config,
623
+ const transaction = new transaction_1.Transaction({
595
624
  sender: sender,
596
625
  receiver: sender,
597
- dataParts: dataParts,
598
- gasLimit: this.config.gasLimitNftMetadataRecreate,
599
- addDataMovementGas: true,
600
- }).build();
601
- }
602
- createTransactionForChangingTokenToDynamic(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
608
- config: this.config,
638
+ const transaction = new transaction_1.Transaction({
609
639
  sender: sender,
610
640
  receiver: this.dcdtContractAddress,
611
- dataParts: dataParts,
612
- gasLimit: this.config.gasLimitNftChangeToDynamic,
613
- addDataMovementGas: true,
614
- }).build();
615
- }
616
- createTransactionForUpdatingTokenId(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
622
- config: this.config,
653
+ const transaction = new transaction_1.Transaction({
623
654
  sender: sender,
624
655
  receiver: this.dcdtContractAddress,
625
- dataParts: dataParts,
626
- gasLimit: this.config.gasLimitUpdateTokenId,
627
- addDataMovementGas: true,
628
- }).build();
629
- }
630
- createTransactionForRegisteringDynamicToken(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
640
- config: this.config,
672
+ const transaction = new transaction_1.Transaction({
641
673
  sender: sender,
642
674
  receiver: this.dcdtContractAddress,
643
- dataParts: dataParts,
644
- gasLimit: this.config.gasLimitRegisterDynamic,
645
- addDataMovementGas: true,
646
- amount: this.config.issueCost,
647
- }).build();
648
- }
649
- createTransactionForRegisteringDynamicAndSettingRoles(sender, options) {
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
- return new transactionBuilder_1.TransactionBuilder({
659
- config: this.config,
692
+ const transaction = new transaction_1.Transaction({
660
693
  sender: sender,
661
694
  receiver: this.dcdtContractAddress,
662
- dataParts: dataParts,
663
- gasLimit: this.config.gasLimitRegisterDynamic,
664
- addDataMovementGas: true,
665
- amount: this.config.issueCost,
666
- }).build();
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(`