web3swift is an iOS toolbelt for interaction with the Ethereum network.
- Core features
- Installation
- Documentation
- Projects that are using web3swift
- Support
- Contribute
- Credits
- Security Disclosure
- License
-
Swift implementation of web3.js functionality โก
-
Interaction with remote node via JSON RPC ๐ญ
-
Local keystore management (
geth
compatible) -
Smart-contract ABI parsing ๐
-
ABI deconding (V2 is supported with return of structures from public functions. Part of 0.4.22 Solidity compiler)
-
Ethereum Name Service (ENS) support - a secure & decentralised way to address resources both on and off the blockchain using simple, human-readable names
-
Smart contracts interactions (read/write) ๐
-
Complete Infura support, patial Websockets API support
-
Parsing TxPool content into native values (ethereum addresses and transactions) - easy to get pending transactions
-
Event loops functionality
-
Supports Web3View functionality (WKWebView with injected "web3" provider)
-
Possibility to add or remove "middleware" that intercepts, modifies and even cancel transaction workflow on stages "before assembly", "after assembly"and "before submission"
-
Literally following the standards (BIP, EIP, etc):
-
EIP-20 (Standart interface for tokens - ERC-20), EIP-67 (Standard URI scheme), EIP-155 (Replay attacks protection)
- **And many others ** (For more details about this EIP's look at Documentation page): EIP-681, EIP-721, EIP-165, EIP-777, EIP-820, EIP-888, EIP-1400, EIP-1410, EIP-1594, EIP-1643, EIP-1644, EIP-1633, EIP-721, EIP-1155, EIP-1376, ST-20
-
Batched requests in concurrent mode
-
RLP encoding
-
Base58 encoding scheme
-
Formatting to and from Ethereum Units
-
Comprehensive Unit and Integration Test Coverage
- CocoaPods
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ sudo gem install cocoapods
To integrate web3swift into your Xcode project using CocoaPods, specify it in your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target '<Your Target Name>' do
use_frameworks!
pod 'web3swift'
end
Then, run the following command:
$ pod install
- Carthage
Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with Homebrew using the following command:
$ brew update
$ brew install carthage
To integrate web3swift into your Xcode project using Carthage, specify it in your Cartfile
.
Create an empty Cartfile with the touch command and open it:
$ touch Cartfile
$ open -a Xcode Cartfile
Add the following line to the Cartfile and save it:
github "matter-labs/web3swift" "master"
Run carthage update
to build the framework. By default, Carthage performs checkouts and creates a new directory 'Carthage' in the same location as your Cartfile. Open this directory, go to 'Build' directory, choose iOS or macOS directory, and use the selected directory framework in your Xcode project.
Web3View example:
You can see how to our demo project: WKWebView with injected "web3" provider:
git clone https://github.com/matter-labs/web3swift.git
cd web3swift/Example/web3swiftBrowser
pod install
open ./web3swiftBrowser.xcworkspace
- iOS 9.0+ / macOS 10.11+
- Xcode 10.2+
- Swift 5.0+
For full documentation details and FAQ, please look at Documentation
If you need to find or understand an API, check Usage.md.
FAQ moved Documentation Page
Here are quick references for essential features:
- Preffered models
- Account Management (create, import, private keys managments, etc.)
- Ethereum Endpoints interaction (web3, balance, tx's operations, chain state)
- Websockets
- ENS
If you are using this library in your project, please add a link to this repo.
- MyEtherWallet/MEWconnect-iOS
- Peepeth iOS client
- Ethereum & ERC20Tokens Wallet
- Pay-iOS
- GeoChain
- NewHorizonLabs/TRX-Wallet
- SteadyAction/EtherWalletKit
- UP Wallet/loopr-ios
- MyENS Wallet
- LoanStar
- AlphaWallet
- Follow_iOS
- Biomedical Data Sharing dApp - Geolocation
- Alice Wallet
- web3-react-native
- YOUR APP CAN BE THERE (click me) ๐
Nothing makes developers happier than seeing someone else use our work and go wild with it.
- If you need help, open an issue.
- If you'd like to see web3swift best practices, check Projects that using web3swift.
- If you found a bug, open an issue.
Want to improve? It's awesome:
Then good news for you: We are ready to pay for your contribution via @gitcoin bot!
-
If you have a feature request, open an issue.
-
If you want to contribute, read contribution policy & submit a pull request.
If you use any of our libraries for work, see if your employers would be interested in donating. Any amount you can donate today to help us reach our goal would be much appreciated.
Matter Labs are charged with open-sourัe and do not require money for using their web3swift lib. We want to continue to do everything we can to move the needle forward.
- Support us via @gitcoin Grant program
- Ether wallet address:
0xe22b8979739d724343bd002f9f432f5990879901
You are more than welcome to participate! Your contribution will be paid via @gitcoin Grant program.
-
Objective-C - a proxy bridge to build your DApp on Objective-C using web3swift (help needed)
-
Support IPFS via Infura public IPFS gateway
-
L2 support (such as ZkSync)
-
Modularity with the basic Web3 subspec/SPM (the most basic functions like transaction signing and interacting with an http rpc server) and other modules with additional functionality
-
Complete Documentation (https://web3swift.github.io/web3swift)
-
Performance Improvements
-
Convenient methods for namespaces
- Alex Vlasov, @shamatar
- Petr Korolev, @skywinder
- Anton Grigorev, @baldyash
If you believe you have identified a security vulnerability with web3swift, you should report it as soon as possible via email to [email protected]. Please do not post it to a public issue tracker.
web3swift is available under the Apache License 2.0 license. See the LICENSE for details.