From 014fab42c5a96f47309d6930559d561e4182dc0b Mon Sep 17 00:00:00 2001 From: andrew54068 Date: Mon, 5 Jun 2023 14:12:31 +0800 Subject: [PATCH] feat: support custom network. --- Sources/FlowSDK/Network.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sources/FlowSDK/Network.swift b/Sources/FlowSDK/Network.swift index 4534f2e..4c4fd84 100644 --- a/Sources/FlowSDK/Network.swift +++ b/Sources/FlowSDK/Network.swift @@ -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 { @@ -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) } } }