@@ -86,14 +86,12 @@ public class ERC1400: IERC1400, ERC20BaseProperties {
8686 }
8787
8888 public func getBalance( account: EthereumAddress ) async throws -> BigUInt {
89- transaction. callOnBlock = . latest
9089 let result = try await contract. createReadOperation ( " balanceOf " , parameters: [ account] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
9190 guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
9291 return res
9392 }
9493
9594 public func getAllowance( originalOwner: EthereumAddress , delegate: EthereumAddress ) async throws -> BigUInt {
96- transaction. callOnBlock = . latest
9795 let result = try await contract. createReadOperation ( " allowance " , parameters: [ originalOwner, delegate] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
9896 guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
9997 return res
@@ -156,7 +154,6 @@ public class ERC1400: IERC1400, ERC20BaseProperties {
156154 }
157155
158156 public func totalSupply( ) async throws -> BigUInt {
159- transaction. callOnBlock = . latest
160157 let result = try await contract. createReadOperation ( " totalSupply " , parameters: [ AnyObject] ( ) , extraData: Data ( ) ) !. callContractMethod ( )
161158 guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
162159 return res
@@ -183,7 +180,6 @@ public class ERC1400: IERC1400, ERC20BaseProperties {
183180
184181 // ERC1400 methods
185182 public func getDocument( name: Data ) async throws -> ( String , Data ) {
186- transaction. callOnBlock = . latest
187183 let result = try await contract. createReadOperation ( " getDocument " , parameters: [ name] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
188184 guard let res = result [ " 0 " ] as? ( String , Data ) else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
189185 return res
@@ -196,14 +192,12 @@ public class ERC1400: IERC1400, ERC20BaseProperties {
196192 }
197193
198194 public func balanceOfByPartition( partition: Data , tokenHolder: EthereumAddress ) async throws -> BigUInt {
199- transaction. callOnBlock = . latest
200195 let result = try await contract. createReadOperation ( " balanceOfByPartition " , parameters: [ partition, tokenHolder] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
201196 guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
202197 return res
203198 }
204199
205200 public func partitionsOf( tokenHolder: EthereumAddress ) async throws -> [ Data ] {
206- transaction. callOnBlock = . latest
207201 let result = try await contract. createReadOperation ( " partitionsOf " , parameters: [ tokenHolder] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
208202 guard let res = result [ " 0 " ] as? [ Data ] else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
209203 return res
@@ -286,7 +280,6 @@ public class ERC1400: IERC1400, ERC20BaseProperties {
286280 }
287281
288282 public func isControllable( ) async throws -> Bool {
289- transaction. callOnBlock = . latest
290283 let result = try await contract. createReadOperation ( " isControllable " , parameters: [ AnyObject] ( ) , extraData: Data ( ) ) !. callContractMethod ( )
291284 guard let res = result [ " 0 " ] as? Bool else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
292285 return res
@@ -355,21 +348,18 @@ public class ERC1400: IERC1400, ERC20BaseProperties {
355348 }
356349
357350 public func isOperator( operator user: EthereumAddress , tokenHolder: EthereumAddress ) async throws -> Bool {
358- transaction. callOnBlock = . latest
359351 let result = try await contract. createReadOperation ( " isOperator " , parameters: [ user, tokenHolder] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
360352 guard let res = result [ " 0 " ] as? Bool else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
361353 return res
362354 }
363355
364356 public func isOperatorForPartition( partition: Data , operator user: EthereumAddress , tokenHolder: EthereumAddress ) async throws -> Bool {
365- transaction. callOnBlock = . latest
366357 let result = try await contract. createReadOperation ( " isOperatorForPartition " , parameters: [ partition, user, tokenHolder] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
367358 guard let res = result [ " 0 " ] as? Bool else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
368359 return res
369360 }
370361
371362 public func isIssuable( ) async throws -> Bool {
372- transaction. callOnBlock = . latest
373363 let result = try await contract. createReadOperation ( " isIssuable " , parameters: [ AnyObject] ( ) , extraData: Data ( ) ) !. callContractMethod ( )
374364 guard let res = result [ " 0 " ] as? Bool else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
375365 return res
@@ -490,8 +480,6 @@ public class ERC1400: IERC1400, ERC20BaseProperties {
490480 }
491481
492482 public func canTransfer( to: EthereumAddress , amount: String , data: [ UInt8 ] ) async throws -> ( [ UInt8 ] , Data ) {
493- transaction. callOnBlock = . latest
494-
495483 // get the decimals manually
496484 let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
497485 var decimals = BigUInt ( 0 )
@@ -510,8 +498,6 @@ public class ERC1400: IERC1400, ERC20BaseProperties {
510498 }
511499
512500 public func canTransferFrom( originalOwner: EthereumAddress , to: EthereumAddress , amount: String , data: [ UInt8 ] ) async throws -> ( [ UInt8 ] , Data ) {
513- transaction. callOnBlock = . latest
514-
515501 // get the decimals manually
516502 let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
517503 var decimals = BigUInt ( 0 )
@@ -530,8 +516,6 @@ public class ERC1400: IERC1400, ERC20BaseProperties {
530516 }
531517
532518 public func canTransferByPartition( originalOwner: EthereumAddress , to: EthereumAddress , partition: Data , amount: String , data: [ UInt8 ] ) async throws -> ( [ UInt8 ] , Data , Data ) {
533- transaction. callOnBlock = . latest
534-
535519 // get the decimals manually
536520 let callResult = try await contract. createReadOperation ( " decimals " ) !. callContractMethod ( )
537521 var decimals = BigUInt ( 0 )
@@ -552,14 +536,12 @@ public class ERC1400: IERC1400, ERC20BaseProperties {
552536
553537extension ERC1400 : IERC777 {
554538 public func canImplementInterfaceForAddress( interfaceHash: Data , addr: EthereumAddress ) async throws -> Data {
555- transaction. callOnBlock = . latest
556539 let result = try await contract. createReadOperation ( " canImplementInterfaceForAddress " , parameters: [ interfaceHash, addr] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
557540 guard let res = result [ " 0 " ] as? Data else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
558541 return res
559542 }
560543
561544 public func getInterfaceImplementer( addr: EthereumAddress , interfaceHash: Data ) async throws -> EthereumAddress {
562- transaction. callOnBlock = . latest
563545 let result = try await contract. createReadOperation ( " getInterfaceImplementer " , parameters: [ addr, interfaceHash] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
564546 guard let res = result [ " 0 " ] as? EthereumAddress else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
565547 return res
@@ -578,7 +560,6 @@ extension ERC1400: IERC777 {
578560 }
579561
580562 public func interfaceHash( interfaceName: String ) async throws -> Data {
581- transaction. callOnBlock = . latest
582563 let result = try await contract. createReadOperation ( " interfaceHash " , parameters: [ interfaceName] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
583564 guard let res = result [ " 0 " ] as? Data else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
584565 return res
@@ -591,21 +572,18 @@ extension ERC1400: IERC777 {
591572 }
592573
593574 public func supportsInterface( interfaceID: String ) async throws -> Bool {
594- transaction. callOnBlock = . latest
595575 let result = try await contract. createReadOperation ( " supportsInterface " , parameters: [ interfaceID] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
596576 guard let res = result [ " 0 " ] as? Bool else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
597577 return res
598578 }
599579
600580 public func getGranularity( ) async throws -> BigUInt {
601- transaction. callOnBlock = . latest
602581 let result = try await contract. createReadOperation ( " granularity " , parameters: [ ] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
603582 guard let res = result [ " 0 " ] as? BigUInt else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
604583 return res
605584 }
606585
607586 public func getDefaultOperators( ) async throws -> [ EthereumAddress ] {
608- transaction. callOnBlock = . latest
609587 let result = try await contract. createReadOperation ( " defaultOperators " , parameters: [ ] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
610588 guard let res = result [ " 0 " ] as? [ EthereumAddress ] else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
611589 return res
@@ -626,7 +604,6 @@ extension ERC1400: IERC777 {
626604 }
627605
628606 public func isOperatorFor( operator user: EthereumAddress , tokenHolder: EthereumAddress ) async throws -> Bool {
629- transaction. callOnBlock = . latest
630607 let result = try await contract. createReadOperation ( " isOperatorFor " , parameters: [ user, tokenHolder] as [ AnyObject ] , extraData: Data ( ) ) !. callContractMethod ( )
631608 guard let res = result [ " 0 " ] as? Bool else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
632609 return res
0 commit comments