@@ -65,15 +65,15 @@ public class ERC1410: IERC1410, ERC20BaseProperties {
65
65
66
66
public func getBalance( account: EthereumAddress ) async throws -> BigUInt {
67
67
let contract = self . contract
68
- self . transaction. callOnBlock = . latest
68
+ transaction. callOnBlock = . latest
69
69
let result = try await contract. createReadOperation ( " balanceOf " , parameters: [ account] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
70
70
guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
71
71
return res
72
72
}
73
73
74
74
public func getAllowance( originalOwner: EthereumAddress , delegate: EthereumAddress ) async throws -> BigUInt {
75
75
let contract = self . contract
76
- self . transaction. callOnBlock = . latest
76
+ transaction. callOnBlock = . latest
77
77
let result = try await contract. createReadOperation ( " allowance " , parameters: [ originalOwner, delegate] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
78
78
guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
79
79
return res
@@ -84,7 +84,7 @@ public class ERC1410: IERC1410, ERC20BaseProperties {
84
84
85
85
self . transaction. from = from
86
86
self . transaction. to = self . address
87
- self . transaction. callOnBlock = . latest
87
+ transaction. callOnBlock = . latest
88
88
89
89
// get the decimals manually
90
90
let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
@@ -106,7 +106,7 @@ public class ERC1410: IERC1410, ERC20BaseProperties {
106
106
107
107
self . transaction. from = from
108
108
self . transaction. to = self . address
109
- self . transaction. callOnBlock = . latest
109
+ transaction. callOnBlock = . latest
110
110
111
111
// get the decimals manually
112
112
let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
@@ -129,7 +129,7 @@ public class ERC1410: IERC1410, ERC20BaseProperties {
129
129
130
130
self . transaction. from = from
131
131
self . transaction. to = self . address
132
- self . transaction. callOnBlock = . latest
132
+ transaction. callOnBlock = . latest
133
133
134
134
// get the decimals manually
135
135
let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
@@ -150,7 +150,7 @@ public class ERC1410: IERC1410, ERC20BaseProperties {
150
150
public func totalSupply( ) async throws -> BigUInt {
151
151
let contract = self . contract
152
152
153
- self . transaction. callOnBlock = . latest
153
+ transaction. callOnBlock = . latest
154
154
let result = try await contract. createReadOperation ( " totalSupply " , parameters: [ AnyObject] ( ) , extraData: Data ( ) ) !. callContractMethod ( )
155
155
guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
156
156
return res
@@ -161,7 +161,7 @@ public class ERC1410: IERC1410, ERC20BaseProperties {
161
161
162
162
self . transaction. from = from
163
163
self . transaction. to = self . address
164
- self . transaction. callOnBlock = . latest
164
+ transaction. callOnBlock = . latest
165
165
166
166
// get the decimals manually
167
167
let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
@@ -183,15 +183,15 @@ public class ERC1410: IERC1410, ERC20BaseProperties {
183
183
public func balanceOfByPartition( partition: Data , tokenHolder: EthereumAddress ) async throws -> BigUInt {
184
184
let contract = self . contract
185
185
186
- self . transaction. callOnBlock = . latest
186
+ transaction. callOnBlock = . latest
187
187
let result = try await contract. createReadOperation ( " balanceOfByPartition " , parameters: [ partition, tokenHolder] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
188
188
guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
189
189
return res
190
190
}
191
191
192
192
public func partitionsOf( tokenHolder: EthereumAddress ) async throws -> [ Data ] {
193
193
let contract = self . contract
194
- self . transaction. callOnBlock = . latest
194
+ transaction. callOnBlock = . latest
195
195
let result = try await contract. createReadOperation ( " partitionsOf " , parameters: [ tokenHolder] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
196
196
guard let res = result [ " 0 " ] as? [ Data ] else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
197
197
return res
@@ -202,7 +202,7 @@ public class ERC1410: IERC1410, ERC20BaseProperties {
202
202
203
203
self . transaction. from = from
204
204
self . transaction. to = self . address
205
- self . transaction. callOnBlock = . latest
205
+ transaction. callOnBlock = . latest
206
206
207
207
// get the decimals manually
208
208
let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
@@ -225,7 +225,7 @@ public class ERC1410: IERC1410, ERC20BaseProperties {
225
225
226
226
self . transaction. from = from
227
227
self . transaction. to = self . address
228
- self . transaction. callOnBlock = . latest
228
+ transaction. callOnBlock = . latest
229
229
230
230
// get the decimals manually
231
231
let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
@@ -245,7 +245,7 @@ public class ERC1410: IERC1410, ERC20BaseProperties {
245
245
246
246
public func canTransferByPartition( originalOwner: EthereumAddress , to: EthereumAddress , partition: Data , amount: String , data: [ UInt8 ] ) async throws -> ( [ UInt8 ] , Data , Data ) {
247
247
let contract = self . contract
248
- self . transaction. callOnBlock = . latest
248
+ transaction. callOnBlock = . latest
249
249
250
250
// get the decimals manually
251
251
let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
@@ -266,15 +266,15 @@ public class ERC1410: IERC1410, ERC20BaseProperties {
266
266
267
267
public func isOperator( operator user: EthereumAddress , tokenHolder: EthereumAddress ) async throws -> Bool {
268
268
let contract = self . contract
269
- self . transaction. callOnBlock = . latest
269
+ transaction. callOnBlock = . latest
270
270
let result = try await contract. createReadOperation ( " isOperator " , parameters: [ user, tokenHolder] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
271
271
guard let res = result [ " 0 " ] as? Bool else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
272
272
return res
273
273
}
274
274
275
275
public func isOperatorForPartition( partition: Data , operator user: EthereumAddress , tokenHolder: EthereumAddress ) async throws -> Bool {
276
276
let contract = self . contract
277
- self . transaction. callOnBlock = . latest
277
+ transaction. callOnBlock = . latest
278
278
let result = try await contract. createReadOperation ( " isOperatorForPartition " , parameters: [ partition, user, tokenHolder] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
279
279
guard let res = result [ " 0 " ] as? Bool else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
280
280
return res
@@ -325,7 +325,7 @@ public class ERC1410: IERC1410, ERC20BaseProperties {
325
325
326
326
self . transaction. from = from
327
327
self . transaction. to = self . address
328
- self . transaction. callOnBlock = . latest
328
+ transaction. callOnBlock = . latest
329
329
330
330
// get the decimals manually
331
331
let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
@@ -348,7 +348,7 @@ public class ERC1410: IERC1410, ERC20BaseProperties {
348
348
349
349
self . transaction. from = from
350
350
self . transaction. to = self . address
351
- self . transaction. callOnBlock = . latest
351
+ transaction. callOnBlock = . latest
352
352
353
353
// get the decimals manually
354
354
let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
@@ -371,7 +371,7 @@ public class ERC1410: IERC1410, ERC20BaseProperties {
371
371
372
372
self . transaction. from = from
373
373
self . transaction. to = self . address
374
- self . transaction. callOnBlock = . latest
374
+ transaction. callOnBlock = . latest
375
375
376
376
// get the decimals manually
377
377
let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
@@ -393,15 +393,15 @@ public class ERC1410: IERC1410, ERC20BaseProperties {
393
393
extension ERC1410 : IERC777 {
394
394
public func canImplementInterfaceForAddress( interfaceHash: Data , addr: EthereumAddress ) async throws -> Data {
395
395
let contract = self . contract
396
- self . transaction. callOnBlock = . latest
396
+ transaction. callOnBlock = . latest
397
397
let result = try await contract. createReadOperation ( " canImplementInterfaceForAddress " , parameters: [ interfaceHash, addr] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
398
398
guard let res = result [ " 0 " ] as? Data else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
399
399
return res
400
400
}
401
401
402
402
public func getInterfaceImplementer( addr: EthereumAddress , interfaceHash: Data ) async throws -> EthereumAddress {
403
403
let contract = self . contract
404
- self . transaction. callOnBlock = . latest
404
+ transaction. callOnBlock = . latest
405
405
let result = try await contract. createReadOperation ( " getInterfaceImplementer " , parameters: [ addr, interfaceHash] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
406
406
guard let res = result [ " 0 " ] as? EthereumAddress else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
407
407
return res
@@ -427,7 +427,7 @@ extension ERC1410: IERC777 {
427
427
428
428
public func interfaceHash( interfaceName: String ) async throws -> Data {
429
429
let contract = self . contract
430
- self . transaction. callOnBlock = . latest
430
+ transaction. callOnBlock = . latest
431
431
let result = try await contract. createReadOperation ( " interfaceHash " , parameters: [ interfaceName] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
432
432
guard let res = result [ " 0 " ] as? Data else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
433
433
return res
@@ -444,7 +444,7 @@ extension ERC1410: IERC777 {
444
444
445
445
public func supportsInterface( interfaceID: String ) async throws -> Bool {
446
446
let contract = self . contract
447
- self . transaction. callOnBlock = . latest
447
+ transaction. callOnBlock = . latest
448
448
let result = try await contract. createReadOperation ( " supportsInterface " , parameters: [ interfaceID] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
449
449
guard let res = result [ " 0 " ] as? Bool else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
450
450
return res
@@ -454,7 +454,7 @@ extension ERC1410: IERC777 {
454
454
let contract = self . contract
455
455
456
456
self . transaction. from = from
457
- self . transaction. callOnBlock = . latest
457
+ transaction. callOnBlock = . latest
458
458
459
459
let tx = contract. createWriteOperation ( " authorizeOperator " , parameters: [ user] as [ AnyObject ] ) !
460
460
return tx
@@ -464,15 +464,15 @@ extension ERC1410: IERC777 {
464
464
let contract = self . contract
465
465
466
466
self . transaction. from = from
467
- self . transaction. callOnBlock = . latest
467
+ transaction. callOnBlock = . latest
468
468
469
469
let tx = contract. createWriteOperation ( " revokeOperator " , parameters: [ user] as [ AnyObject ] ) !
470
470
return tx
471
471
}
472
472
473
473
public func isOperatorFor( operator user: EthereumAddress , tokenHolder: EthereumAddress ) async throws -> Bool {
474
474
let contract = self . contract
475
- self . transaction. callOnBlock = . latest
475
+ transaction. callOnBlock = . latest
476
476
let result = try await contract. createReadOperation ( " isOperatorFor " , parameters: [ user, tokenHolder] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
477
477
guard let res = result [ " 0 " ] as? Bool else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
478
478
return res
@@ -483,7 +483,7 @@ extension ERC1410: IERC777 {
483
483
484
484
self . transaction. from = from
485
485
self . transaction. to = self . address
486
- self . transaction. callOnBlock = . latest
486
+ transaction. callOnBlock = . latest
487
487
488
488
// get the decimals manually
489
489
let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
@@ -505,7 +505,7 @@ extension ERC1410: IERC777 {
505
505
506
506
self . transaction. from = from
507
507
self . transaction. to = self . address
508
- self . transaction. callOnBlock = . latest
508
+ transaction. callOnBlock = . latest
509
509
510
510
// get the decimals manually
511
511
let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
@@ -527,7 +527,7 @@ extension ERC1410: IERC777 {
527
527
528
528
self . transaction. from = from
529
529
self . transaction. to = self . address
530
- self . transaction. callOnBlock = . latest
530
+ transaction. callOnBlock = . latest
531
531
532
532
// get the decimals manually
533
533
let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
@@ -549,7 +549,7 @@ extension ERC1410: IERC777 {
549
549
550
550
self . transaction. from = from
551
551
self . transaction. to = self . address
552
- self . transaction. callOnBlock = . latest
552
+ transaction. callOnBlock = . latest
553
553
554
554
// get the decimals manually
555
555
let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
@@ -568,15 +568,15 @@ extension ERC1410: IERC777 {
568
568
569
569
public func getGranularity( ) async throws -> BigUInt {
570
570
let contract = self . contract
571
- self . transaction. callOnBlock = . latest
571
+ transaction. callOnBlock = . latest
572
572
let result = try await contract. createReadOperation ( " granularity " , parameters: [ ] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
573
573
guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
574
574
return res
575
575
}
576
576
577
577
public func getDefaultOperators( ) async throws -> [ EthereumAddress ] {
578
578
let contract = self . contract
579
- self . transaction. callOnBlock = . latest
579
+ transaction. callOnBlock = . latest
580
580
let result = try await contract. createReadOperation ( " defaultOperators " , parameters: [ ] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
581
581
guard let res = result [ " 0 " ] as? [ EthereumAddress ] else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
582
582
return res
0 commit comments