@@ -56,15 +56,15 @@ public class ERC1594: IERC1594, ERC20BaseProperties {
56
56
public func getBalance( account: EthereumAddress ) async throws -> BigUInt {
57
57
let contract = self . contract
58
58
self . transaction. callOnBlock = . latest
59
- let result = try await contract. createReadOperation ( " balanceOf " , parameters: [ account] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
59
+ let result = try await contract. createReadOperation ( " balanceOf " , parameters: [ account] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
60
60
guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
61
61
return res
62
62
}
63
63
64
64
public func getAllowance( originalOwner: EthereumAddress , delegate: EthereumAddress ) async throws -> BigUInt {
65
65
let contract = self . contract
66
66
self . transaction. callOnBlock = . latest
67
- let result = try await contract. createReadOperation ( " allowance " , parameters: [ originalOwner, delegate] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
67
+ let result = try await contract. createReadOperation ( " allowance " , parameters: [ originalOwner, delegate] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
68
68
guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
69
69
return res
70
70
}
@@ -87,7 +87,7 @@ public class ERC1594: IERC1594, ERC20BaseProperties {
87
87
guard let value = Utilities . parseToBigUInt ( amount, decimals: intDecimals) else {
88
88
throw Web3Error . inputError ( desc: " Can not parse inputted amount " )
89
89
}
90
- let tx = contract. createWriteOperation ( " transfer " , parameters: [ to, value] as [ AnyObject ] ) !
90
+ let tx = contract. createWriteOperation ( " transfer " , parameters: [ to, value] as [ AnyObject ] ) !
91
91
return tx
92
92
}
93
93
@@ -110,7 +110,7 @@ public class ERC1594: IERC1594, ERC20BaseProperties {
110
110
throw Web3Error . inputError ( desc: " Can not parse inputted amount " )
111
111
}
112
112
113
- let tx = contract. createWriteOperation ( " transferFrom " , parameters: [ originalOwner, to, value] as [ AnyObject ] ) !
113
+ let tx = contract. createWriteOperation ( " transferFrom " , parameters: [ originalOwner, to, value] as [ AnyObject ] ) !
114
114
return tx
115
115
}
116
116
@@ -133,15 +133,15 @@ public class ERC1594: IERC1594, ERC20BaseProperties {
133
133
throw Web3Error . inputError ( desc: " Can not parse inputted amount " )
134
134
}
135
135
136
- let tx = contract. createWriteOperation ( " setAllowance " , parameters: [ to, value] as [ AnyObject ] ) !
136
+ let tx = contract. createWriteOperation ( " setAllowance " , parameters: [ to, value] as [ AnyObject ] ) !
137
137
return tx
138
138
}
139
139
140
140
public func totalSupply( ) async throws -> BigUInt {
141
141
let contract = self . contract
142
142
143
143
self . transaction. callOnBlock = . latest
144
- let result = try await contract. createReadOperation ( " totalSupply " , parameters: [ AnyObject] ( ) , extraData: Data ( ) ) !. callContractMethod ( )
144
+ let result = try await contract. createReadOperation ( " totalSupply " , parameters: [ AnyObject] ( ) , extraData: Data ( ) ) !. callContractMethod ( )
145
145
guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
146
146
return res
147
147
}
@@ -165,7 +165,7 @@ public class ERC1594: IERC1594, ERC20BaseProperties {
165
165
throw Web3Error . inputError ( desc: " Can not parse inputted amount " )
166
166
}
167
167
168
- let tx = contract. createWriteOperation ( " approve " , parameters: [ spender, value] as [ AnyObject ] ) !
168
+ let tx = contract. createWriteOperation ( " approve " , parameters: [ spender, value] as [ AnyObject ] ) !
169
169
return tx
170
170
}
171
171
@@ -189,7 +189,7 @@ public class ERC1594: IERC1594, ERC20BaseProperties {
189
189
throw Web3Error . inputError ( desc: " Can not parse inputted amount " )
190
190
}
191
191
192
- let tx = contract. createWriteOperation ( " transferWithData " , parameters: [ to, value, data] as [ AnyObject ] ) !
192
+ let tx = contract. createWriteOperation ( " transferWithData " , parameters: [ to, value, data] as [ AnyObject ] ) !
193
193
return tx
194
194
}
195
195
@@ -212,14 +212,14 @@ public class ERC1594: IERC1594, ERC20BaseProperties {
212
212
throw Web3Error . inputError ( desc: " Can not parse inputted amount " )
213
213
}
214
214
215
- let tx = contract. createWriteOperation ( " transferFromWithData " , parameters: [ originalOwner, to, value, data] as [ AnyObject ] ) !
215
+ let tx = contract. createWriteOperation ( " transferFromWithData " , parameters: [ originalOwner, to, value, data] as [ AnyObject ] ) !
216
216
return tx
217
217
}
218
218
219
219
public func isIssuable( ) async throws -> Bool {
220
220
let contract = self . contract
221
221
self . transaction. callOnBlock = . latest
222
- let result = try await contract. createReadOperation ( " isIssuable " , parameters: [ AnyObject] ( ) , extraData: Data ( ) ) !. callContractMethod ( )
222
+ let result = try await contract. createReadOperation ( " isIssuable " , parameters: [ AnyObject] ( ) , extraData: Data ( ) ) !. callContractMethod ( )
223
223
guard let res = result [ " 0 " ] as? Bool else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
224
224
return res
225
225
}
@@ -243,7 +243,7 @@ public class ERC1594: IERC1594, ERC20BaseProperties {
243
243
throw Web3Error . inputError ( desc: " Can not parse inputted amount " )
244
244
}
245
245
246
- let tx = contract. createWriteOperation ( " issue " , parameters: [ tokenHolder, value, data] as [ AnyObject ] ) !
246
+ let tx = contract. createWriteOperation ( " issue " , parameters: [ tokenHolder, value, data] as [ AnyObject ] ) !
247
247
return tx
248
248
}
249
249
@@ -266,7 +266,7 @@ public class ERC1594: IERC1594, ERC20BaseProperties {
266
266
throw Web3Error . inputError ( desc: " Can not parse inputted amount " )
267
267
}
268
268
269
- let tx = contract. createWriteOperation ( " redeem " , parameters: [ value, data] as [ AnyObject ] ) !
269
+ let tx = contract. createWriteOperation ( " redeem " , parameters: [ value, data] as [ AnyObject ] ) !
270
270
return tx
271
271
}
272
272
@@ -289,7 +289,7 @@ public class ERC1594: IERC1594, ERC20BaseProperties {
289
289
throw Web3Error . inputError ( desc: " Can not parse inputted amount " )
290
290
}
291
291
292
- let tx = contract. createWriteOperation ( " redeemFrom " , parameters: [ tokenHolder, value, data] as [ AnyObject ] ) !
292
+ let tx = contract. createWriteOperation ( " redeemFrom " , parameters: [ tokenHolder, value, data] as [ AnyObject ] ) !
293
293
return tx
294
294
}
295
295
@@ -309,7 +309,7 @@ public class ERC1594: IERC1594, ERC20BaseProperties {
309
309
throw Web3Error . inputError ( desc: " Can not parse inputted amount " )
310
310
}
311
311
312
- let result = try await contract. createReadOperation ( " canTransfer " , parameters: [ to, value, data] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
312
+ let result = try await contract. createReadOperation ( " canTransfer " , parameters: [ to, value, data] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
313
313
guard let res = result [ " 0 " ] as? ( [ UInt8 ] , Data ) else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
314
314
return res
315
315
}
@@ -330,7 +330,7 @@ public class ERC1594: IERC1594, ERC20BaseProperties {
330
330
throw Web3Error . inputError ( desc: " Can not parse inputted amount " )
331
331
}
332
332
333
- let result = try await contract. createReadOperation ( " canTransfer " , parameters: [ originalOwner, to, value, data] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
333
+ let result = try await contract. createReadOperation ( " canTransfer " , parameters: [ originalOwner, to, value, data] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
334
334
guard let res = result [ " 0 " ] as? ( [ UInt8 ] , Data ) else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
335
335
return res
336
336
}
0 commit comments