APIClient
public struct APIClient
Client to send requests to a Lisk node
-
Mutable. Default client for all services
Declaration
Swift
public static var shared = APIClient()
-
Client that connects to Mainnet
Declaration
Swift
public static let mainnet = APIClient()
-
Client that connects to Testnet
Declaration
Swift
public static let testnet = APIClient(options: .init(testnet: true))
-
Undocumented
Declaration
Swift
public init(options: APIOptions = .init())
-
Perform GET request
Declaration
Swift
public func get<R>(path: String, options: RequestOptions? = nil, completionHandler: @escaping (Response<R>) -> Void) -> (URLRequest, URLSessionDataTask)
-
Perform POST request
Declaration
Swift
public func post<R>(path: String, options: RequestOptions? = nil, completionHandler: @escaping (Response<R>) -> Void) -> (URLRequest, URLSessionDataTask)
-
Perform PUT request
Declaration
Swift
public func put<R>(path: String, options: RequestOptions? = nil, completionHandler: @escaping (Response<R>) -> Void) -> (URLRequest, URLSessionDataTask)
-
Perform POST request
Declaration
Swift
public func delete<R>(path: String, options: RequestOptions? = nil, completionHandler: @escaping (Response<R>) -> Void) -> (URLRequest, URLSessionDataTask)
-
Perform request
Declaration
Swift
public func request<R>(_ httpMethod: HTTPMethod, path: String, options: RequestOptions?, completionHandler: @escaping (Response<R>) -> Void) -> (URLRequest, URLSessionDataTask)