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 {
4747
4848/// Enum for the most-used Ethereum networks. Network ID is crucial for EIP155 support
4949public enum Networks {
50+ case Goerli
5051 case Rinkeby
5152 case Mainnet
5253 case Ropsten
@@ -55,6 +56,7 @@ public enum Networks {
5556
5657 public var name : String {
5758 switch self {
59+ case . Goerli: return " goerli "
5860 case . Rinkeby: return " rinkeby "
5961 case . Ropsten: return " ropsten "
6062 case . Mainnet: return " mainnet "
@@ -69,6 +71,7 @@ public enum Networks {
6971 case . Mainnet: return BigUInt ( 1 )
7072 case . Ropsten: return BigUInt ( 3 )
7173 case . Rinkeby: return BigUInt ( 4 )
74+ case . Goerli: return BigUInt ( 5 )
7275 case . Kovan: return BigUInt ( 42 )
7376 }
7477 }
@@ -83,6 +86,8 @@ public enum Networks {
8386 return Networks . Ropsten
8487 case 4 :
8588 return Networks . Rinkeby
89+ case 5 :
90+ return Networks . Goerli
8691 case 42 :
8792 return Networks . Kovan
8893 default :
Original file line number Diff line number Diff line change @@ -25,6 +25,12 @@ public struct Web3 {
2525 let infura = await InfuraProvider ( Networks . Mainnet, accessToken: accessToken) !
2626 return web3 ( provider: infura)
2727 }
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+ }
2834
2935 /// Initialized Web3 instance bound to Infura's rinkeby provider.
3036 public static func InfuraRinkebyWeb3( accessToken: String ? = nil ) async -> web3 {
You can’t perform that action at this time.
0 commit comments