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