Skip to content

Commit

Permalink
Merge pull request #5 from portto/feat/support-custom-network
Browse files Browse the repository at this point in the history
Feature support custom network.
  • Loading branch information
andrew54068 authored Jun 5, 2023
2 parents 5244823 + 014fab4 commit f10bfdc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/FlowSDK/Network.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@

import Foundation

public enum Network: String {
public enum Network {
case mainnet
case testnet
case canarynet
case sandboxnet
case emulator
case custom(host: String, port: Int)

var endpoint: Endpoint {
switch self {
Expand All @@ -26,6 +27,8 @@ public enum Network: String {
return Endpoint(host: "access.sandboxnet.nodes.onflow.org", port: 9000)
case .emulator:
return Endpoint(host: "127.0.0.1", port: 3569)
case let .custom(host, port):
return Endpoint(host: host, port: port)
}
}
}
Expand Down

0 comments on commit f10bfdc

Please sign in to comment.