Bitski
public class Bitski : NSObject, BitskiAuthDelegate
An instance of the Bitski SDK
-
Notification triggered when the user logs in
Declaration
Swift
public static let LoggedInNotification: NSNotification.Name
-
Notification triggered when the user logs out
Declaration
Swift
public static let LoggedOutNotification: NSNotification.Name
-
Shared instance of
Bitski
Declaration
Swift
public static var shared: Bitski?
-
Whether or not the current user is logged in
Declaration
Swift
public var isLoggedIn: Bool { get }
-
Initialize an instance of
Bitski
Declaration
Swift
public init(clientID: String, redirectURL: URL)
Parameters
clientID
Your client ID. From https://developer.bitski.com
redirectURL
URI for redirects back to the app. This must be a URI your app can handle (ie. myapp://application/callback).
-
Sign in to the Bitski instance
Declaration
Swift
public func signIn(completion: @escaping ((Error?) -> Void))
Parameters
viewController
viewController to present web interface from
completion
A closure called after sign in that includes an optional error
-
Clear out the current authorization state
Declaration
Swift
public func signOut()
-
Get a
BitskiHTTPProvider
for the requested networkDeclaration
Swift
public func getProvider(network: Network = .mainnet) -> Web3Provider
Parameters
network
Ethereum network to use. Currently .development, .kovan, and .rinkeby are the only accepted values.
Return Value
Web3Provider instance configured for Bitski.
-
Returns a
Web3
instance configured for BitskiDeclaration
Swift
public func getWeb3(network: Network = .mainnet) -> Web3
Parameters
network
Ethereum network to use. Currently only
kovan
andrinkeby
are accepted values.Return Value
Web3
object ready to use.