An advanced Ethereum/EVM mobile wallet
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
alpha-wallet-ios/Trust/EtherClient/EtherServiceRequest.swift

33 lines
641 B

// Copyright SIX DAY LLC. All rights reserved.
7 years ago
import Foundation
import APIKit
import JSONRPCKit
struct EtherServiceRequest<Batch: JSONRPCKit.Batch>: APIKit.Request {
let batch: Batch
7 years ago
typealias Response = Batch.Responses
7 years ago
var baseURL: URL {
let config = Config()
return config.rpcURL
}
7 years ago
var method: HTTPMethod {
return .post
}
7 years ago
var path: String {
return "/"
}
7 years ago
var parameters: Any? {
return batch.requestObject
}
7 years ago
func response(from object: Any, urlResponse: HTTPURLResponse) throws -> Response {
return try batch.responses(from: object)
}
}