@@ -89,13 +89,13 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
89
89
}
90
90
91
91
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 ( )
93
93
guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
94
94
return res
95
95
}
96
96
97
97
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 ( )
99
99
guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
100
100
return res
101
101
}
@@ -104,7 +104,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
104
104
transaction. callOnBlock = . latest
105
105
updateTransactionAndContract ( from: from)
106
106
// get the decimals manually
107
- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
107
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
108
108
var decimals = BigUInt ( 0 )
109
109
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
110
110
throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -122,7 +122,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
122
122
transaction. callOnBlock = . latest
123
123
updateTransactionAndContract ( from: from)
124
124
// get the decimals manually
125
- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
125
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
126
126
var decimals = BigUInt ( 0 )
127
127
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
128
128
throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -141,7 +141,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
141
141
transaction. callOnBlock = . latest
142
142
updateTransactionAndContract ( from: from)
143
143
// get the decimals manually
144
- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
144
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
145
145
var decimals = BigUInt ( 0 )
146
146
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
147
147
throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -160,7 +160,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
160
160
transaction. callOnBlock = . latest
161
161
updateTransactionAndContract ( from: from)
162
162
// get the decimals manually
163
- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
163
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
164
164
var decimals = BigUInt ( 0 )
165
165
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
166
166
throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -176,7 +176,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
176
176
}
177
177
178
178
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 ( )
180
180
guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
181
181
return res
182
182
}
@@ -185,7 +185,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
185
185
transaction. callOnBlock = . latest
186
186
updateTransactionAndContract ( from: from)
187
187
// get the decimals manually
188
- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
188
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
189
189
var decimals = BigUInt ( 0 )
190
190
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
191
191
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
transaction. callOnBlock = . latest
208
208
updateTransactionAndContract ( from: from)
209
209
// get the decimals manually
210
- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
210
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
211
211
var decimals = BigUInt ( 0 )
212
212
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
213
213
throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -226,7 +226,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
226
226
transaction. callOnBlock = . latest
227
227
updateTransactionAndContract ( from: from)
228
228
// get the decimals manually
229
- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
229
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
230
230
var decimals = BigUInt ( 0 )
231
231
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
232
232
throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -249,7 +249,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
249
249
250
250
func spendableAllowance( owner: EthereumAddress , spender: EthereumAddress ) async throws -> BigUInt {
251
251
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 ( )
253
253
guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
254
254
return res
255
255
}
@@ -258,7 +258,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
258
258
transaction. callOnBlock = . latest
259
259
updateTransactionAndContract ( from: from)
260
260
// get the decimals manually
261
- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
261
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
262
262
var decimals = BigUInt ( 0 )
263
263
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
264
264
throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -276,7 +276,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
276
276
transaction. callOnBlock = . latest
277
277
updateTransactionAndContract ( from: from)
278
278
// get the decimals manually
279
- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
279
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
280
280
var decimals = BigUInt ( 0 )
281
281
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
282
282
throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -291,7 +291,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
291
291
}
292
292
293
293
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 ( )
295
295
guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
296
296
return res
297
297
}
@@ -307,7 +307,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
307
307
transaction. callOnBlock = . latest
308
308
updateTransactionAndContract ( from: from)
309
309
// get the decimals manually
310
- let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
310
+ let callResult = try await contract. createReadOperation ( " decimals " ) !. call ( )
311
311
var decimals = BigUInt ( 0 )
312
312
guard let dec = callResult [ " 0 " ] , let decTyped = dec as? BigUInt else {
313
313
throw Web3Error . inputError ( desc: " Contract may be not ERC20 compatible, can not get decimals " ) }
@@ -325,7 +325,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
325
325
}
326
326
327
327
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 ( )
329
329
guard let res = result [ " 0 " ] as? DirectDebit else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
330
330
return res
331
331
}
0 commit comments