Ethereum Wallet Toolkit for iOS - You can implement an Ethereum wallet without a server and blockchain knowledge.

Overview

EtherWalletKit

Swift Xcode License: MIT iOS

Introduction

EtherWalletKit is an Ethereum Wallet Toolkit for iOS.

I hope cryptocurrency and decentralized token economy become more widely adapted. However, some developers hesitate to add a crypto wallet on apps since blockchain and cryptocurrency are complex and require many new knowledge.

Don't worry.
With EtherWalletKit, you can implement an Ethereum wallet without a server and blockchain knowledge.

Features

Released Features

  • Creating/Importing an account(address and private key)
  • Checking Ether and tokens balance
  • Sending Ether and tokens to other addresses
  • Browsing token information
  • Testnet(Rinkeby & Ropsten) support
  • BIP39 Mnemonics

Planned Features

  • Browsing transaction history
  • Keystore import / export
  • Custom configuration / advanced transactions
  • Multiple accounts
  • Third party APIs
  • ERC-721 supports

Installation

CocoaPods

To integrate EtherWalletKit into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'EtherWalletKit'

Quick Start

0. Don't forget to import it

import EtherWalletKit

1. Create an Ethereum Wallet

// Generate a new account with its new password.
try? EtherWallet.account.generateAccount(password: "ABCDEFG")

// Import an existing account from its private key and set its new password.
try? EtherWallet.account.importAccount(privateKey: "1dcbc1d6e0a4587a3a9095984cf051a1bc6ed975f15380a0ac97f01c0c045062, password: "ABCDEFG")

Note: password will be encrypted and saved to the device and it will be required to access the wallet.

2. Get balance

// Get balance of Ether
EtherWallet.balance.etherBalance { balance in
    print(balance)
}

// Get balance of a token
EtherWallet.balance.tokenBalance(contractAddress: "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07") { balance in
    print(balance)
}

3. Send

// send Ether to an address.
EtherWallet.transaction.sendEther(to: "0x7777787C97a35d37Db8E5afb0C92BCfd4F6480bE", amount: "1.5", password: "ABCDEFG") { txHash in
    print(txHash)
}

// send a token to an address.
EtherWallet.transaction.sendToken(to: "0x7777787C97a35d37Db8E5afb0C92BCfd4F6480bE", contractAddress: "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07", amount: "20", password: "ABCDEFG", decimal: 18) { txHash in
    print(txHash)
}

Note: password should be eqaul to the password of wallet created. Also you can put gasPrice as an extra parameter to set gas price for the transcation.

For full documentation, please see THIS.

Notes

  • Nothing will be sent to a server. Everything will be worked on the local device and Ethereum Blockchain.
  • You dont need to download and sync the nodes because Infura is doing it for you.
  • password for wallet is equal to the password for the keystore file. Always make sure a password is long enough for security.

Contribution

  • Make sure you have a GitHub account
  • Create a GitHub pull request for your contribution
    • Clearly describe the issue or feature.
  • Fork the repository on GitHub
  • Create a topic branch from where you want to base your work. (Gitflow is welcome)
    • Please avoid working directly on the master branch.
  • Make sure you have added the necessary tests for your changes and make sure all tests pass.

Donation

Only accept cryptocurrency 😂

ETH: 0x7777787C97a35d37Db8E5afb0C92BCfd4F6480bE

License

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

You might also like...
Fearless Wallet - a mobile wallet designed for the decentralized future on the Kusama and Polkadot networks
Fearless Wallet - a mobile wallet designed for the decentralized future on the Kusama and Polkadot networks

Fearless Wallet is a mobile wallet designed for the decentralized future on the Kusama and Polkadot network, with support on iOS and Android platforms. The best user experience, fast performance, and secure storage for your accounts. Development of Fearless Wallet is supported by Kusama Treasury grant.

Bitcoin protocol toolkit for Swift
Bitcoin protocol toolkit for Swift

Welcome to BitcoinKit The BitcoinKit library is a Swift implementation of the Bitcoin protocol which support both BCH and BTC. Improving the mobile ec

Elegant Web3js functionality in Swift. Native ABI parsing and smart contract interactions on Ethereum network.
Elegant Web3js functionality in Swift. Native ABI parsing and smart contract interactions on Ethereum network.

You can ask for help in our Discord Channel web3swift Swift implementation of web3.js functionality ⚡ Interaction with remote node via JSON RPC 💭 Sma

A pure swift Ethereum Web3 library

⚗️ Web3 Web3.swift is a Swift library for signing transactions and interacting with Smart Contracts in the Ethereum Network. It allows you to connect

EthereumKit is a free, open-source Swift framework for easily interacting with the Ethereum.
EthereumKit is a free, open-source Swift framework for easily interacting with the Ethereum.

EthereumKit is a Swift framework that enables you to create Ethereum wallet and use it in your app. // BIP39: Generate seed and mnemonic sentence. le

Web3keystore - Ethereum keystore logic, in Swift

web3keystore A module for creating and interacting with Ethereum keystores. Hand

A swift utility to resolve Ethereum Domain Names.

ENSKit A swift utility to resolve Ethereum Domain Names per EIP-137. Examples Initializing: // Use default options with Cloudflare Ethereum Gateway le

Full Bitcoin library for iOS, implemented on Swift. SPV wallet implementation for Bitcoin, Bitcoin Cash and Dash blockchains.

BitcoinKit-iOS Bitcoin, BitcoinCash(ABC) and Dash wallet toolkit for Swift. This is a full implementation of SPV node including wallet creation/restor

A highly experimental, self-custody Lightning wallet built to work for iOS and macOS.

Surge Surge is a highly experimental, self-custody Lightning wallet built to work for iOS and macOS. Motivation Tools and infrastructure for running a

Comments
  • 如何使用助记词

    如何使用助记词

    在web3swift中可以使用

    let keystore = try! BIP32Keystore(seed: seed, password: "")
    

    我不知道在EtherWalletKit中该如何使用助记词进行创建 是否需要在EtherWallet+Account.swift添加

       public func generateMmemonics(mmemonics: String, password: String) throws {
            
            guard let seed = BIP39.seedFromMmemonics(mmemonics, password: password) else {
                throw WalletError.toSeedFailure
            }
            let keystore = try BIP32Keystore(seed: seed)
            let keystoreManager = KeystoreManager([keystore!])
            guard let keystoreV3 = keystoreManager.keystores.first else {
                throw WalletError.malformedKeystore
            }
            try saveKeystore(keystoreV3)
        }
    
    opened by fengmingdev 4
  • Error

    Error "Cannot load module 'web3swift' as 'Web3swift'"

    I am having this error on Xcode 13.0 in EtherWallet.swift and the 'EtherWalletKit' pod version is 0.1.4

    Screenshot 2022-03-14 at 12 43 46 PM

    Screenshot 2022-03-14 at 12 42 35 PM

    When I updated web3swift instead of Web3swift then got another issue is "No such module 'EthereumAddress'".

    Screenshot 2022-03-14 at 12 43 24 PM

    Please give me suggestions regarding this issue.

    opened by priyankgandhi0 1
  • Support Infura V3

    Support Infura V3

    Great repo !

    Infura no longer supports the old API, now we have to access through https://mainnet.infura.io/v3/<PROJECT_ID>

    I updated the project accordingly with the following pieces of code and my Project ID obtained through Infura dashboard:

    EtherWallet.swift private let web3Main = Web3.InfuraMainnetWeb3("<PROJECT ID>")

    Web3.swift (unchanged)

    public static func InfuraMainnetWeb3(accessToken: String? = nil) -> web3 {
            let infura = InfuraProvider(Networks.Mainnet, accessToken: accessToken)!
            return web3(provider: infura)
        }
    

    Web3+Infura.swift

    public class InfuraProvider: Web3HttpProvider {
        public init?(_ net:Networks, accessToken token: String? = nil, keystoreManager manager: KeystoreManager? = nil) {
            var requestURLstring = "https://" + net.name + ".infura.io/v3/"
            if token != nil {
                requestURLstring = requestURLstring + token!
            }
            let providerURL = URL(string: requestURLstring)
            super.init(providerURL!, network: net, keystoreManager: manager)
        }
    ...
    }
    

    Requesting the balance with EtherWallet.balance throws the following error.

    EtherWalletTest[3957:62791] CredStore - performQuery - Error copying matching creds.  Error=-25300, query={
        class = inet;
        "m_Limit" = "m_LimitAll";
        ptcl = htps;
        "r_Attributes" = 1;
        sdmn = "Project ID is required in the URL";
        srvr = "mainnet.infura.io";
        sync = syna;
    }
    

    It seems that the project ID is missing in the call, but printing requestURLstring shows the correct URL with the access token.

    opened by romain64 0
Owner
Sung Woo Chang
iOS Engineer @DoorDash
Sung Woo Chang
Wei Wallet - Ethereum wallet app for iOS

Wei Wallet - Ethereum wallet app for iOS Getting Started Download the latest Xcode Clone this repository Install Carthage, Cocoapods Run make bootstra

Popshoot, Inc. 277 Nov 17, 2022
Encryptr is a zero-knowledge, cloud-based e-wallet / password manager powered by Crypton

Encryptr is a zero-knowledge, cloud-based e-wallet / password manager powered by Crypton

SpiderOak, Inc. 1.6k Jan 4, 2023
BitcoinCore for Bitcoin, BitcoinCash(ABC), Litecoin and Dash wallet toolkit for Swift.

BitcoinCore for Bitcoin, BitcoinCash(ABC), Litecoin and Dash wallet toolkit for Swift. This is a full implementation of SPV node including wallet creation/restore, synchronization with network, send/receive transactions, and more.

Horizontal Systems 4 Nov 23, 2022
A simple Proof-of-Work Blockchain built in Swift

Blockchain in Swift A simple Proof-of-Work Blockchain built in Swift. Requirements Xcode 13.0 Swift 5.2 Vapor 4.49 Swift NIO 2.33.0 Getting started Cl

Felipe Ricieri 5 Sep 25, 2022
Kukai Crypto Swift is a native Swift library for creating regular or HD wallets for the Tezos blockchain

Kukai Crypto Swift Kukai Crypto Swift is a native Swift library for creating regular and HD key pairs for the Tezos blockchain. Supporting both TZ1 (E

Kukai Wallet 2 Aug 18, 2022
Trust - Ethereum Wallet and Web3 DApp Browser for iOS

Trust - Ethereum Wallet and Web3 DApp Browser for iOS Welcome to Trust's open source iOS app! Getting Started Download the Xcode 9 release. Clone this

Trust Wallet 1.4k Dec 31, 2022
Multi-wallet for Bitcoin, Ethereum, Binance Smart Chain and other emerging blockchains

Multi-wallet for Bitcoin, Ethereum, Binance Smart Chain and other emerging blockchains. Non-custodial storage, decentralized exchange, and extensive analytics for thousands of tokens and NFTs. Implemented on Swift.

Horizontal Systems 446 Jan 3, 2023
AlphaWallet - Advanced, Open Source Ethereum Mobile Wallet & dApp Browser for iOS

AlphaWallet - Advanced, Open Source Ethereum Mobile Wallet & dApp Browser for iOS

AlphaWallet 475 Jan 5, 2023
Rainbow - 🌈the Ethereum wallet that lives in your pocket

??️ the Ethereum wallet that lives in your pocket! ??️ Available on the iOS App Store. ?? Android Beta available on Google Play Store ??️ Foll

Rainbow 3.2k Jan 3, 2023
An open-source Ethereum wallet built with SwiftUI

lil wallet welcome to lil wallet. it's an open-source Ethereum wallet built with SwiftUI there are two main views - coins and objects. coins are your

Jordan Singer 140 Jan 3, 2023