@@ -20,34 +20,26 @@ public class Web3 {
20
20
/// Keystore manager can be bound to Web3 instance. If some manager is bound all further account related functions, such
21
21
/// as account listing, transaction signing, etc. are done locally using private keys and accounts found in a manager.
22
22
public func addKeystoreManager( _ manager: KeystoreManager ? ) {
23
- self . provider. attachedKeystoreManager = manager
23
+ provider. attachedKeystoreManager = manager
24
24
}
25
25
26
- var ethInstance : Web3 . Eth ?
26
+ var ethInstance : IEth ?
27
27
28
28
/// Public web3.eth.* namespace.
29
- public var eth : Web3 . Eth {
30
- if self . ethInstance != nil {
31
- return self . ethInstance!
29
+ public var eth : IEth {
30
+ if ethInstance != nil {
31
+ return ethInstance!
32
32
}
33
- self . ethInstance = Web3 . Eth ( provider: self . provider, web3 : self )
34
- return self . ethInstance!
33
+ ethInstance = Web3 . Eth ( provider: provider)
34
+ return ethInstance!
35
35
}
36
36
37
37
// FIXME: Rewrite this to CodableTransaction
38
38
public class Eth : IEth {
39
39
public var provider : Web3Provider
40
- // FIXME: web3 must be weak
41
- var web3 : Web3
42
40
43
- public init ( provider prov: Web3Provider , web3 web3instance : Web3 ) {
41
+ public init ( provider prov: Web3Provider ) {
44
42
provider = prov
45
- web3 = web3instance
46
- }
47
-
48
- public func callTransaction( _ transaction: CodableTransaction ) async throws -> Data {
49
- let request = APIRequest . call ( transaction, transaction. callOnBlock ?? . latest)
50
- return try await APIRequest . sendRequest ( with: provider, for: request) . result
51
43
}
52
44
}
53
45
0 commit comments