https://github.com/BANKEX/web3swift
Elegant Web3js functionality in Swift. Native ABI parsing and smart contract interactions on Ethereum network.
https://github.com/BANKEX/web3swift
bankex cryptocurrency cryptoswift ethereum ios json-rpc smart-contracts swift transaction wallet web3
Last synced: about 1 month ago
JSON representation
Elegant Web3js functionality in Swift. Native ABI parsing and smart contract interactions on Ethereum network.
- Host: GitHub
- URL: https://github.com/BANKEX/web3swift
- Owner: BANKEX
- License: apache-2.0
- Archived: true
- Created: 2017-12-06T00:13:10.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-02-27T08:30:35.000Z (about 5 years ago)
- Last Synced: 2025-02-16T01:15:59.630Z (about 2 months ago)
- Topics: bankex, cryptocurrency, cryptoswift, ethereum, ios, json-rpc, smart-contracts, swift, transaction, wallet, web3
- Language: Swift
- Homepage: https://bankex.github.io/web3swift/
- Size: 52.3 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-blockchain-cn - Web3Swift
- awesome-blockchain-cn - Web3Swift
- awesome-blockchain-cn - Web3Swift
README
### You can ask for help in our [Discord Channel](https://discord.gg/3ETv2ST)

# web3swift
- Swift implementation of [web3.js](https://github.com/ethereum/web3.js/) functionality :zap:
- Interaction with remote node via JSON RPC :thought_balloon:
- Smart-contract ABI parsing :book:
- Local keystore management (geth compatible)
- Private key and transaction were created directly on an iOS device and sent directly to [Infura](https://infura.io) node
- Native API
- Security (as cool as a hard wallet! Right out-of-the-box! :box: )
- No unnecessary dependencies
- Possibility to work with all existing smart contracts
- Referencing the newest features introduced in Solidity### Features
- Create Account
- Import Account
- Sign transactions
- Send transactions, call functions of smart-contracts, estimate gas costs
- Serialize and deserialize transactions and results to native Swift types
- Convenience functions for chain state: block number, gas price
- Check transaction results and get receipt
- Parse event logs for transaction
- Manage user's private keys through encrypted keystore abstractions
- Batched requests in concurrent mode, checks balances of 580 tokens (from the latest MyEtherWallet repo) over 3 seconds
- Literally following the standards:## Requirements
Web3swift requires Swift 4.2 and deploys to `macOS 10.10`, `iOS 9`, `watchOS 2` and `tvOS 9` and `linux`.Don't forget to set the iOS version in a Podfile, otherwise you get an error if the deployment target is less than the latest SDK.
## Installation
- **Swift Package Manager:**
Although the Package Manager is still in its infancy, web3swift provides full support for it.
Add this to the dependency section of your `Package.swift` manifest:```Swift
.package(url: "https://github.com/BANKEX/web3swift.git", from: "2.1.0")
```- **CocoaPods:** Put this in your `Podfile`:
```Ruby
pod 'web3swift.pod'
```- **Carthage:** Put this in your `Cartfile`:
```
github "BANKEX/web3swift" ~> 2.1
```## Documentation
> Hi. We spend a lot of time working on documentation. If you have some questions after reading it just [open an issue](https://github.com/bankex/web3swift/issues) or ask in our [discord channel](https://discord.gg/3ETv2ST). We would be happy to help you.
Most of the classes are documented and have some examples on how to use it.
### [Read documentation in using Xcode](https://bankex.github.io/web3swift/read-documentation-using-xcode.html)
### [Github Pages](https://bankex.github.io/web3swift)#### We would appreciate it if you translate our documentation into another language, and will be happy to provide you with all the necessary information on how to do this. We will compensate you for translations that will be included in the master branch.
## Design decisions
- Not every JSON RPC function is exposed yet, priority is given to the ones required for mobile devices
- Functionality was focused on serializing and signing transactions locally on the device to send raw transactions to Ethereum network
- Requirements for password input on every transaction are indeed a design decision. Interface designers can save user passwords with the user's consent
- Public function for private key export is exposed for user convenience, but marked as UNSAFE_ :) Normal workflow takes care of EIP155 compatibility and proper clearing of private key data from memory## Contribution
For the latest version, please check [develop](https://github.com/BANKEX/web3swift/tree/develop) branch.Changes made to this branch will be merged into the [master](https://github.com/BANKEX/web3swift/tree/master) branch at some point.
- If you want to contribute, submit a [pull request](https://github.com/BANKEX/web3swift/pulls) against a development `develop` branch.
- If you found a bug, [open an issue](https://github.com/BANKEX/web3swift/issues).
- If you have a feature request, [open an issue](https://github.com/BANKEX/web3swift/issues).## Special thanks to
- Gnosis team and their library [Bivrost-swift](https://github.com/gnosis/bivrost-swift) for inspiration for the ABI decoding approach
- [Trust iOS Wallet](https://github.com/TrustWallet/trust-wallet-ios) for the collaboration and discussion of the initial idea
- Official Ethereum and Solidity docs, everything was written from ground truth standards## Donate