@@ -98,7 +98,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
9898 let contract = self . contract
9999 var transactionOptions = CodableTransaction . emptyTransaction
100100 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 ( )
102102 guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
103103 return res
104104 }
@@ -107,7 +107,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
107107 let contract = self . contract
108108 var transactionOptions = CodableTransaction . emptyTransaction
109109 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 ( )
111111 guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
112112 return res
113113 }
@@ -120,7 +120,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
120120 basicOptions. callOnBlock = . latest
121121
122122 // get the decimals manually
123- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
123+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
124124 var decimals = BigUInt ( 0 )
125125 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
126126 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -142,7 +142,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
142142 basicOptions. callOnBlock = . latest
143143
144144 // get the decimals manually
145- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
145+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
146146 var decimals = BigUInt ( 0 )
147147 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
148148 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -165,7 +165,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
165165 basicOptions. callOnBlock = . latest
166166
167167 // get the decimals manually
168- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
168+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
169169 var decimals = BigUInt ( 0 )
170170 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
171171 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -188,7 +188,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
188188 basicOptions. callOnBlock = . latest
189189
190190 // get the decimals manually
191- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
191+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
192192 var decimals = BigUInt ( 0 )
193193 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
194194 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -207,7 +207,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
207207 let contract = self . contract
208208 var transactionOptions = CodableTransaction . emptyTransaction
209209 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 ( )
211211 guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
212212 return res
213213 }
@@ -220,7 +220,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
220220 basicOptions. callOnBlock = . latest
221221
222222 // get the decimals manually
223- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
223+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
224224 var decimals = BigUInt ( 0 )
225225 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
226226 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -246,7 +246,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
246246 basicOptions. callOnBlock = . latest
247247
248248 // get the decimals manually
249- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
249+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
250250 var decimals = BigUInt ( 0 )
251251 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
252252 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -269,7 +269,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
269269 basicOptions. callOnBlock = . latest
270270
271271 // get the decimals manually
272- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
272+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
273273 var decimals = BigUInt ( 0 )
274274 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
275275 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -298,7 +298,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
298298 let contract = self . contract
299299 var transactionOptions = CodableTransaction . emptyTransaction
300300 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 ( )
302302 guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
303303 return res
304304 }
@@ -311,7 +311,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
311311 basicOptions. callOnBlock = . latest
312312
313313 // get the decimals manually
314- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
314+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
315315 var decimals = BigUInt ( 0 )
316316 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
317317 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -333,7 +333,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
333333 basicOptions. callOnBlock = . latest
334334
335335 // get the decimals manually
336- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
336+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
337337 var decimals = BigUInt ( 0 )
338338 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
339339 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -351,7 +351,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
351351 let contract = self . contract
352352 var transactionOptions = CodableTransaction . emptyTransaction
353353 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 ( )
355355 guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
356356 return res
357357 }
@@ -375,7 +375,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
375375 basicOptions. callOnBlock = . latest
376376
377377 // get the decimals manually
378- let callResult = try await contract. createReadOperation ( " decimals " ) !. decodedData ( )
378+ let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
379379 var decimals = BigUInt ( 0 )
380380 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
381381 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -396,7 +396,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
396396 let contract = self . contract
397397 var transactionOptions = CodableTransaction . emptyTransaction
398398 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 ( )
400400 guard let res = result [ " 0 " ] as? DirectDebit else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
401401 return res
402402 }
0 commit comments