@@ -89,13 +89,13 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
8989 }
9090
9191 public func getBalance( account: EthereumAddress ) async throws -> BigUInt {
92- let result = try await contract. createReadOperation ( " balanceOf " , parameters: [ account] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
92+ let result = try await contract. createReadOperation ( " balanceOf " , parameters: [ account] as [ AnyObject ] , extraData: Data ( ) ) !. call ( )
9393 guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
9494 return res
9595 }
9696
9797 public func getAllowance( originalOwner: EthereumAddress , delegate: EthereumAddress ) async throws -> BigUInt {
98- let result = try await contract. createReadOperation ( " allowance " , parameters: [ originalOwner, delegate] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
98+ let result = try await contract. createReadOperation ( " allowance " , parameters: [ originalOwner, delegate] as [ AnyObject ] , extraData: Data ( ) ) !. call ( )
9999 guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
100100 return res
101101 }
@@ -104,7 +104,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
104104 transaction. callOnBlock = . latest
105105 updateTransactionAndContract ( from: from)
106106 // get the decimals manually
107- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
107+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
108108 var decimals = BigUInt ( 0 )
109109 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
110110 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -122,7 +122,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
122122 transaction. callOnBlock = . latest
123123 updateTransactionAndContract ( from: from)
124124 // get the decimals manually
125- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
125+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
126126 var decimals = BigUInt ( 0 )
127127 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
128128 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -141,7 +141,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
141141 transaction. callOnBlock = . latest
142142 updateTransactionAndContract ( from: from)
143143 // get the decimals manually
144- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
144+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
145145 var decimals = BigUInt ( 0 )
146146 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
147147 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -160,7 +160,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
160160 transaction. callOnBlock = . latest
161161 updateTransactionAndContract ( from: from)
162162 // get the decimals manually
163- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
163+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
164164 var decimals = BigUInt ( 0 )
165165 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
166166 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -176,7 +176,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
176176 }
177177
178178 public func totalSupply( ) async throws -> BigUInt {
179- let result = try await contract. createReadOperation ( " totalSupply " , parameters: [ AnyObject] ( ) , extraData: Data ( ) ) !. callContractMethod ( )
179+ let result = try await contract. createReadOperation ( " totalSupply " , parameters: [ AnyObject] ( ) , extraData: Data ( ) ) !. call ( )
180180 guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
181181 return res
182182 }
@@ -185,7 +185,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
185185 transaction. callOnBlock = . latest
186186 updateTransactionAndContract ( from: from)
187187 // get the decimals manually
188- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
188+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
189189 var decimals = BigUInt ( 0 )
190190 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
191191 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -207,7 +207,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
207207 transaction. callOnBlock = . latest
208208 updateTransactionAndContract ( from: from)
209209 // get the decimals manually
210- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
210+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
211211 var decimals = BigUInt ( 0 )
212212 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
213213 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -226,7 +226,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
226226 transaction. callOnBlock = . latest
227227 updateTransactionAndContract ( from: from)
228228 // get the decimals manually
229- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
229+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
230230 var decimals = BigUInt ( 0 )
231231 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
232232 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -249,7 +249,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
249249
250250 func spendableAllowance( owner: EthereumAddress , spender: EthereumAddress ) async throws -> BigUInt {
251251 transaction. callOnBlock = . latest
252- let result = try await contract. createReadOperation ( " spendableAllowance " , parameters: [ owner, spender] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
252+ let result = try await contract. createReadOperation ( " spendableAllowance " , parameters: [ owner, spender] as [ AnyObject ] , extraData: Data ( ) ) !. call ( )
253253 guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
254254 return res
255255 }
@@ -258,7 +258,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
258258 transaction. callOnBlock = . latest
259259 updateTransactionAndContract ( from: from)
260260 // get the decimals manually
261- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
261+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
262262 var decimals = BigUInt ( 0 )
263263 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
264264 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -276,7 +276,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
276276 transaction. callOnBlock = . latest
277277 updateTransactionAndContract ( from: from)
278278 // get the decimals manually
279- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
279+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
280280 var decimals = BigUInt ( 0 )
281281 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
282282 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -291,7 +291,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
291291 }
292292
293293 func nonceOf( owner: EthereumAddress ) async throws -> BigUInt {
294- let result = try await contract. createReadOperation ( " nonceOf " , parameters: [ owner] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
294+ let result = try await contract. createReadOperation ( " nonceOf " , parameters: [ owner] as [ AnyObject ] , extraData: Data ( ) ) !. call ( )
295295 guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
296296 return res
297297 }
@@ -307,7 +307,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
307307 transaction. callOnBlock = . latest
308308 updateTransactionAndContract ( from: from)
309309 // get the decimals manually
310- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
310+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
311311 var decimals = BigUInt ( 0 )
312312 guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
313313 throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -325,7 +325,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
325325 }
326326
327327 func directDebit( debtor: EthereumAddress , receiver: EthereumAddress ) async throws -> DirectDebit {
328- let result = try await contract. createReadOperation ( " directDebit " , parameters: [ debtor, receiver] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
328+ let result = try await contract. createReadOperation ( " directDebit " , parameters: [ debtor, receiver] as [ AnyObject ] , extraData: Data ( ) ) !. call ( )
329329 guard let res = result [ " 0 " ] as? DirectDebit else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
330330 return res
331331 }
0 commit comments