BitskiHTTPProvider

public class BitskiHTTPProvider : Web3Provider

A custom Web3 HttpProvider that is specifically configured for use with Bitski. You shouldn’t create one yourself, but instead create one using Bitski.getWeb3(network:) or Bitski.getProvider(network:)

  • Various errors that may occur while processing Web3 requests

    See more

    Declaration

    Swift

    public enum Error : Swift.Error
  • HTTP headers to add to all requests

    Declaration

    Swift

    public var headers: [String : String]
  • Initializes a BitskiProvider for use with Web3

    Declaration

    Swift

    required public init(rpcURL: URL, apiBaseURL: URL, webBaseURL: URL, network: Bitski.Network, redirectURL: URL, session: URLSession = URLSession(configuration: .default))

    Parameters

    rpcURL

    The URL to send JSON-RPC requests to

    webBaseURL

    The base URL for all web UI requests

    redirectURL

    The URL to redirect back to after authorization requests

    session

    URLSession to use. Defaults to a new default URLSession

  • Sends an RPCRequest and parses the result

    Declaration

    Swift

    public func send<Params, Result>(request: RPCRequest<Params>, response: @escaping Web3ResponseCompletion<Result>)

    Parameters

    request

    RPCRequest to send

    response

    A completion handler for the response. Includes either the result or an error.