All Projects → BitskiCo → bitski-ios

BitskiCo / bitski-ios

Licence: MIT license
Bitski iOS SDK

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to bitski-ios

simple-mpesa
A simple example of how MPESA works. Works with all 3 types of customers i.e. Agents, Merchants and Subscribers. Allows you to configure a tariff and apply it to transactions. The project follows DDD principles.
Stars: ✭ 31 (+72.22%)
Mutual labels:  transaction, wallet-service
mongodb-replica-set
Run MongoDB Atlas locally for testing
Stars: ✭ 42 (+133.33%)
Mutual labels:  transaction
Certainly
🎓 Handy simple tool for common certificate-related operations. Has a known issue in latest, see release notes. ONLY USE AND INSTALL 1.6.2. See link =>
Stars: ✭ 36 (+100%)
Mutual labels:  signing
Reactnativeauth
Mobile user authentication flow with React Native, Expo, and AWS Amplify: Sign In, Sign Up, Confirm Sign Up, Forget Password, Reset Password.
Stars: ✭ 108 (+500%)
Mutual labels:  signing
Unipdf
Golang PDF library for creating and processing PDF files (pure go)
Stars: ✭ 1,171 (+6405.56%)
Mutual labels:  signing
Go Jose
An implementation of JOSE standards (JWE, JWS, JWT) in Go
Stars: ✭ 1,849 (+10172.22%)
Mutual labels:  signing
Jose
JSON Object Signing and Encryption for Node.js and the browser
Stars: ✭ 25 (+38.89%)
Mutual labels:  signing
WeCross
WeCross跨链路由
Stars: ✭ 183 (+916.67%)
Mutual labels:  transaction
Apkmod
Apkmod can decompile, recompile, sign APK, and bind the payload with any legit APP
Stars: ✭ 235 (+1205.56%)
Mutual labels:  signing
Portablesigner2
PortableSigner - A Commandline and GUI Tool to digital sign PDF files with X.509 certificates
Stars: ✭ 92 (+411.11%)
Mutual labels:  signing
Go Alone
A simple to use, high-performance, Go (golang) MAC signer.
Stars: ✭ 82 (+355.56%)
Mutual labels:  signing
Nethereum
Ethereum .Net cross platform integration library
Stars: ✭ 1,191 (+6516.67%)
Mutual labels:  signing
Ios Signer Service
✒ A self-hosted, cross-platform service to sign and install iOS apps, all without a computer
Stars: ✭ 200 (+1011.11%)
Mutual labels:  signing
Node Rsa
Node.js RSA library
Stars: ✭ 1,120 (+6122.22%)
Mutual labels:  signing
AuthorizeCIM
Authorize.net CIM, AIM, and ARB Functions for Go Language
Stars: ✭ 36 (+100%)
Mutual labels:  transaction
Pki.js
PKI.js is a pure JavaScript library implementing the formats that are used in PKI applications (signing, encryption, certificate requests, OCSP and TSP requests/responses). It is built on WebCrypto (Web Cryptography API) and requires no plug-ins.
Stars: ✭ 960 (+5233.33%)
Mutual labels:  signing
Webcrypto
W3C Web Cryptography API for Node.js
Stars: ✭ 79 (+338.89%)
Mutual labels:  signing
Joseswift
A framework for the JOSE standards JWS, JWE, and JWK written in Swift.
Stars: ✭ 114 (+533.33%)
Mutual labels:  signing
simpledbm
SimpleDBM is an Open Source Multi-Threaded Embeddable Transactional Database Engine in Java.
Stars: ✭ 51 (+183.33%)
Mutual labels:  transaction
datalogger
DataLogger foi projetado para ser uma biblioteca simples de log com suporte a vários providers.
Stars: ✭ 46 (+155.56%)
Mutual labels:  transaction

Bitski iOS SDK

CocoaPods CocoaPods CocoaPods Documentation Codecov

The official Bitski SDK for iOS. Build decentralized iOS apps with Ethereum with OAuth-based cross-platform wallet.

Example

To run the example project, clone the repo, and run pod install from the Example directory first. You'll need to add your client id and redirect url to AppDelegate.

Requirements

  • Currently only supports iOS 11 and above

Installation

Bitski is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Bitski'

Usage

Initialization

First, get a client ID by creating an app here. Make sure you select 'Native App' for App Type.

You'll also need to add the redirectURL you use in the app under Redirect URLs in the developer portal. This ensures that only urls that you trust can be used with your client id.

In your app, you'll initialize an instance of Bitski:

// Replace redirect URL with an url scheme that will hit your native app
Bitski.shared = Bitski(clientID: "<YOUR CLIENT ID>", redirectURL: URL(string: "exampleapp://application/callback")!)

We provide a convenient static place to initialize your instance in Bitski.shared, but if you want to avoid using a singleton you can store your instance however works best for you.

Authentication

Once you have an instance of Bitski configured, you can check the signed in status. The user will need to be logged in before making any Web3 calls.

if Bitski.shared?.isLoggedIn == true {
    self.web3 = Bitski.shared?.getWeb3()
    // show logged in state
} else {
    // show logged out state
}

To sign in, simply call signIn() (this will open a browser window):

Bitski.shared?.signIn() { error in
    // Once signed in, get an instance of Web3
    self.web3 = Bitski.shared?.getWeb3()
    // or, specify a network with getWeb3(network:)
}

A user will remain signed in indefinitely, unless the access token is revoked. To explicitly sign out:

Bitski.shared?.signOut()

Local Dev

If you're developing locally (like with truffle develop or ganache), you can use the development network instead.

let network: Bitski.Network = .development(url: "http://localhost:9545", chainId: 0) //or use your local IP if building for a device.
let web3 = Bitski.getWeb3(network: network)

Handling Implicit Logouts

Notifications will be posted when the user is signed in and signed out (Bitski.LoggedInNotification and Bitski.LoggedOutNotification) respectively. A user can be signed out either explicitly, or implicitly if the access token is revoked. Therefore, it's a good practice to respond to these notifications.

NotificationCenter.default.addObserver(self, selector: #selector(userDidLogout), name: Bitski.LoggedOutNotification, object: nil)

Using Web3

Once you have an instance of Web3 intialized, you can use it to make Ethereum calls and transactions. We provide full access to the Ethereum network through our API.

// Example: Make a simple transfer transaction
firstly {
    web3.eth.accounts().firstValue
}.then { account in
    let to = try? EthereumAddress(hex: "SOME ADDRESS", eip55: false)
    let transaction = EthereumTransaction(nonce: nil, gasPrice: EthereumQuantity(quantity: 1.gwei), gas: EthereumQuantity(quantity: 21.gwei), from: account, to: to, value: EthereumQuantity(quantity: 1.eth))
    return web3.eth.sendTransaction(transaction: transaction)
}.then { transactionHash in
    web3.eth.getTransactionReceipt(transactionHash)
}.done { receipt in
    let watcher = TransactionWatcher(hash: transactionHash, web3: web3)
    watcher.expectedConfirmations = 3
    watcher.delegate = self
    self.transactionWatcher = watcher
}

For more about what you can do in Web3, see Web3.swift.

Authorization

Our Web3 provider lets you send transactions to be signed, but the user must explictly approve them. For security, this authorization happens in our web UI and will display as a browser modal above your application. Once the transaction has been approved or rejected, the modal will dismiss. For the best experience we recommend limiting the amount of transactions you send.

Report Vulnerabilities

Bitski provides a “bug bounty” to engage with the security researchers in the community. If you have found a vulnerability in our product or service, please submit a vulnerability report to the Bitski security team.

License

Bitski is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].