File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ public protocol EventParserProtocol {
47
47
48
48
/// Enum for the most-used Ethereum networks. Network ID is crucial for EIP155 support
49
49
public enum Networks {
50
+ case Goerli
50
51
case Rinkeby
51
52
case Mainnet
52
53
case Ropsten
@@ -55,6 +56,7 @@ public enum Networks {
55
56
56
57
public var name : String {
57
58
switch self {
59
+ case . Goerli: return " goerli "
58
60
case . Rinkeby: return " rinkeby "
59
61
case . Ropsten: return " ropsten "
60
62
case . Mainnet: return " mainnet "
@@ -69,6 +71,7 @@ public enum Networks {
69
71
case . Mainnet: return BigUInt ( 1 )
70
72
case . Ropsten: return BigUInt ( 3 )
71
73
case . Rinkeby: return BigUInt ( 4 )
74
+ case . Goerli: return BigUInt ( 5 )
72
75
case . Kovan: return BigUInt ( 42 )
73
76
}
74
77
}
@@ -83,6 +86,8 @@ public enum Networks {
83
86
return Networks . Ropsten
84
87
case 4 :
85
88
return Networks . Rinkeby
89
+ case 5 :
90
+ return Networks . Goerli
86
91
case 42 :
87
92
return Networks . Kovan
88
93
default :
Original file line number Diff line number Diff line change @@ -25,6 +25,12 @@ public struct Web3 {
25
25
let infura = await InfuraProvider ( Networks . Mainnet, accessToken: accessToken) !
26
26
return web3 ( provider: infura)
27
27
}
28
+
29
+ /// Initialized Web3 instance bound to Infura's goerli provider.
30
+ public static func InfuraGoerliWeb3( accessToken: String ? = nil ) async -> web3 {
31
+ let infura = await InfuraProvider ( Networks . Goerli, accessToken: accessToken) !
32
+ return web3 ( provider: infura)
33
+ }
28
34
29
35
/// Initialized Web3 instance bound to Infura's rinkeby provider.
30
36
public static func InfuraRinkebyWeb3( accessToken: String ? = nil ) async -> web3 {
You can’t perform that action at this time.
0 commit comments