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.
32 lines
646 B
32 lines
646 B
// 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 {
|
|
return try batch.responses(from: object)
|
|
}
|
|
}
|
|
|