@@ -98,7 +98,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
98
98
let contract = self . contract
99
99
var transactionOptions = CodableTransaction . emptyTransaction
100
100
transactionOptions. callOnBlock = . latest
101
- let result = try await contract. createReadOperation ( " balanceOf " , parameters: [ account] as [ AnyObject ] , extraData: Data ( ) ) !. decodedData ( )
101
+ let result = try await contract. createReadOperation ( " balanceOf " , parameters: [ account] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
102
102
guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
103
103
return res
104
104
}
@@ -107,7 +107,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
107
107
let contract = self . contract
108
108
var transactionOptions = CodableTransaction . emptyTransaction
109
109
transactionOptions. callOnBlock = . latest
110
- let result = try await contract. createReadOperation ( " allowance " , parameters: [ originalOwner, delegate] as [ AnyObject ] , extraData: Data ( ) ) !. decodedData ( )
110
+ let result = try await contract. createReadOperation ( " allowance " , parameters: [ originalOwner, delegate] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
111
111
guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
112
112
return res
113
113
}
@@ -120,7 +120,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
120
120
basicOptions. callOnBlock = . latest
121
121
122
122
// get the decimals manually
123
- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
123
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
124
124
var decimals = BigUInt ( 0 )
125
125
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
126
126
throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -142,7 +142,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
142
142
basicOptions. callOnBlock = . latest
143
143
144
144
// get the decimals manually
145
- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
145
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
146
146
var decimals = BigUInt ( 0 )
147
147
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
148
148
throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -165,7 +165,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
165
165
basicOptions. callOnBlock = . latest
166
166
167
167
// get the decimals manually
168
- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
168
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
169
169
var decimals = BigUInt ( 0 )
170
170
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
171
171
throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -188,7 +188,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
188
188
basicOptions. callOnBlock = . latest
189
189
190
190
// get the decimals manually
191
- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
191
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
192
192
var decimals = BigUInt ( 0 )
193
193
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
194
194
throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -207,7 +207,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
207
207
let contract = self . contract
208
208
var transactionOptions = CodableTransaction . emptyTransaction
209
209
transactionOptions. callOnBlock = . latest
210
- let result = try await contract. createReadOperation ( " totalSupply " , parameters: [ AnyObject] ( ) , extraData: Data ( ) ) !. decodedData ( )
210
+ let result = try await contract. createReadOperation ( " totalSupply " , parameters: [ AnyObject] ( ) , extraData: Data ( ) ) !. callContractMethod ( )
211
211
guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
212
212
return res
213
213
}
@@ -220,7 +220,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
220
220
basicOptions. callOnBlock = . latest
221
221
222
222
// get the decimals manually
223
- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
223
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
224
224
var decimals = BigUInt ( 0 )
225
225
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
226
226
throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -246,7 +246,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
246
246
basicOptions. callOnBlock = . latest
247
247
248
248
// get the decimals manually
249
- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
249
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
250
250
var decimals = BigUInt ( 0 )
251
251
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
252
252
throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -269,7 +269,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
269
269
basicOptions. callOnBlock = . latest
270
270
271
271
// get the decimals manually
272
- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
272
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
273
273
var decimals = BigUInt ( 0 )
274
274
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
275
275
throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -298,7 +298,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
298
298
let contract = self . contract
299
299
var transactionOptions = CodableTransaction . emptyTransaction
300
300
transactionOptions. callOnBlock = . latest
301
- let result = try await contract. createReadOperation ( " spendableAllowance " , parameters: [ owner, spender] as [ AnyObject ] , extraData: Data ( ) ) !. decodedData ( )
301
+ let result = try await contract. createReadOperation ( " spendableAllowance " , parameters: [ owner, spender] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
302
302
guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
303
303
return res
304
304
}
@@ -311,7 +311,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
311
311
basicOptions. callOnBlock = . latest
312
312
313
313
// get the decimals manually
314
- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
314
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
315
315
var decimals = BigUInt ( 0 )
316
316
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
317
317
throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -333,7 +333,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
333
333
basicOptions. callOnBlock = . latest
334
334
335
335
// get the decimals manually
336
- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
336
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
337
337
var decimals = BigUInt ( 0 )
338
338
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
339
339
throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -351,7 +351,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
351
351
let contract = self . contract
352
352
var transactionOptions = CodableTransaction . emptyTransaction
353
353
transactionOptions. callOnBlock = . latest
354
- let result = try await contract. createReadOperation ( " nonceOf " , parameters: [ owner] as [ AnyObject ] , extraData: Data ( ) ) !. decodedData ( )
354
+ let result = try await contract. createReadOperation ( " nonceOf " , parameters: [ owner] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
355
355
guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
356
356
return res
357
357
}
@@ -375,7 +375,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
375
375
basicOptions. callOnBlock = . latest
376
376
377
377
// get the decimals manually
378
- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
378
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
379
379
var decimals = BigUInt ( 0 )
380
380
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
381
381
throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -396,7 +396,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
396
396
let contract = self . contract
397
397
var transactionOptions = CodableTransaction . emptyTransaction
398
398
transactionOptions. callOnBlock = . latest
399
- let result = try await contract. createReadOperation ( " directDebit " , parameters: [ debtor, receiver] as [ AnyObject ] , extraData: Data ( ) ) !. decodedData ( )
399
+ let result = try await contract. createReadOperation ( " directDebit " , parameters: [ debtor, receiver] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
400
400
guard let res = result [ " 0 " ] as? DirectDebit else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
401
401
return res
402
402
}
0 commit comments