Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: init Web3HttpProvider without chain id #813

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation

extension APIRequest {
var method: REST {
public var method: REST {
.POST
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public struct APIResponse<Result>: Decodable where Result: APIResultType {
public var result: Result
}

enum REST: String {
public enum REST: String {
case POST
case GET
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/web3swift/Web3/Web3+HttpProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class Web3HttpProvider: Web3Provider {
var urlRequest = URLRequest(url: url, cachePolicy: .reloadIgnoringCacheData)
urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type")
urlRequest.setValue("application/json", forHTTPHeaderField: "Accept")
urlRequest.httpMethod = APIRequest.getNetwork.call
urlRequest.httpMethod = APIRequest.getNetwork.method.rawValue
urlRequest.httpBody = APIRequest.getNetwork.encodedBody
let response: APIResponse<UInt> = try await APIRequest.send(uRLRequest: urlRequest, with: session)
self.network = Networks.fromInt(response.result)
Expand Down