Skip to content

Commit 5edac19

Browse files
committed
Merge branch 'develop' of https://github.com/matterinc/web3swift into develop
2 parents ae0330c + 96996a1 commit 5edac19

File tree

1 file changed

+100
-84
lines changed

1 file changed

+100
-84
lines changed

README.md

Lines changed: 100 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -9,80 +9,92 @@ The work for 2.0 release is about to start. Ideas for new more Swift idiomatic A
99
[![Platform](https://img.shields.io/cocoapods/p/web3swift.svg?style=flat)](http://cocoapods.org/pods/web3swift)
1010
[![support](https://brianmacdonald.github.io/Ethonate/svg/eth-support-blue.svg)](https://brianmacdonald.github.io/Ethonate/address#0x6394b37Cf80A7358b38068f0CA4760ad49983a1B)
1111

12+
**web3swift** is your toolbelt for any kind interactions with Ethereum network.
13+
14+
15+
- [web3swift](#web3swift)
16+
+ [Features:](#features-)
17+
* [Design decisions](#design-decisions)
18+
* [Example](#example)
19+
* [Installation](#installation)
20+
+ [Requirements](#requirements)
21+
+ [CocoaPods](#cocoapods)
22+
* [Getting started](#getting-started)
23+
+ [Create Account](#create-account)
24+
+ [Save keystore to the memory](#save-keystore-to-the-memory)
25+
+ [Initializing Ethereum address](#initializing-ethereum-address)
26+
+ [Setting options](#setting-options)
27+
+ [Encoding Transaction](#encoding-transaction)
28+
+ [Signing Transaction](#signing-transaction)
29+
+ [Getting ETH balance](#getting-eth-balance)
30+
+ [Getting gas price](#getting-gas-price)
31+
+ [Sending ETH](#sending-eth)
32+
+ [ERC20 Iteraction:](#erc20-iteraction-)
33+
- [Getting ERC20 token balance](#getting-erc20-token-balance)
34+
- [Sending ERC20](#sending-erc20)
35+
* [Apps using this library](#apps-using-this-library)
36+
* [Future plans](#future-plans)
37+
+ [Extra features:](#extra-features-)
38+
* [Stay in touch](#stay-in-touch)
39+
+ [Contribution](#contribution)
40+
+ [Communication](#communication)
41+
+ [Special thanks to](#special-thanks-to)
42+
* [Authors](#authors)
43+
* [License](#license)
44+
45+
46+
### Features:
47+
1248
- Swift implementation of [web3.js](https://github.com/ethereum/web3.js/) functionality :zap:
1349
- Interaction with remote node via JSON RPC :thought_balloon:
1450
- Smart-contract ABI parsing :book:
15-
- ABI deconding (V2 is supported with return of structures from public functions. Part of 0.4.22 Solidity compiler)
16-
- RLP encoding
51+
- ABI deconding (V2 is supported with return of structures from public functions. Part of 0.4.22 Solidity compiler)
52+
- RLP encoding
1753
- Interactions (read/write to Smart contracts) :arrows_counterclockwise:
18-
- Local keystore management (geth compatible)
54+
- Local keystore management (`geth` compatible)
1955
- Literally following the standards:
20-
- [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) HD Wallets: Deterministic Wallet
21-
- [BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) (Seed phrases)
22-
- [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) (Key generation prefixes)
23-
- [EIP-155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md) (Replay attacks protection) *enforced!*
56+
- [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) HD Wallets: Deterministic Wallet
57+
- [BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) (Seed phrases)
58+
- [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) (Key generation prefixes)
59+
- [EIP-155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md) (Replay attacks protection) *enforced!*
2460

61+
**Account Managment:**
62+
- [x] Create Account
63+
- [x] Import Account
64+
- [x] Manage user's private keys through encrypted keystore abstractions
2565

26-
## Check this out
66+
**Transactions operations:**
67+
- [x] Sign transactions
68+
- [x] Send transactions, call functions of smart-contracts, estimate gas costs
69+
- [x] Serialize and deserialize transactions and results to native Swift types
70+
- [x] Check transaction results and get the receipt
71+
- [x] Parse event logs for the transaction
72+
- [x] Convenience functions for chain state: block number, gas price
73+
- [x] Batched requests in concurrent mode, check balances of 580 tokens (from the latest MyEtherWallet repo) over 3 seconds
2774

28-
- Private key and transaction were created directly on an iOS device and sent directly to [Infura](https://infura.io) node
29-
- Native API
30-
- Security (as cool as a hard wallet! Right out-of-the-box! :box: )
31-
- No unnecessary dependencies
32-
- Possibility to work with all existing smart contracts
33-
- Referencing the newest features introduced in Solidity
3475

3576
## Design decisions
3677

37-
- Not every JSON RPC function is exposed yet, priority is given to the ones required for mobile devices
78+
- Not every JSON RPC function is exposed yet, and priority is given to the ones required for mobile devices
3879
- Functionality was focused on serializing and signing transactions locally on the device to send raw transactions to Ethereum network
3980
- Requirements for password input on every transaction are indeed a design decision. Interface designers can save user passwords with the user's consent
40-
- 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
41-
42-
### Here it is
43-
[https://rinkeby.etherscan.io/tx/0xc6eca60ecac004a1501a4323a10edb7fa4cd1a0896675f6b51704c84dedad056](https://rinkeby.etherscan.io/tx/0xc6eca60ecac004a1501a4323a10edb7fa4cd1a0896675f6b51704c84dedad056)
44-
45-
```
46-
Transaction
47-
Nonce: 35
48-
Gas price: 5000000000
49-
Gas limit: 21000
50-
To: 0x6394b37Cf80A7358b38068f0CA4760ad49983a1B
51-
Value: 1000000000000000
52-
Data: 0x
53-
v: 43
54-
r: 73059897783840535708732471549376620878882680550447969052675399628060606060727
55-
s: 12280625377431973240236065453692843538037349746280474092545114784968542260859
56-
Intrinsic chainID: Optional(4)
57-
Infered chainID: Optional(4)
58-
sender: Optional(web3swift.EthereumAddress(_address: "0x855adf524273c14b7260a188af0ae30e82e91959"))
59-
60-
["id": 1514485925, "result": 0xc6eca60ecac004a1501a4323a10edb7fa4cd1a0896675f6b51704c84dedad056, "jsonrpc": 2.0]
61-
On Rinkeby TXid = 0xc6eca60ecac004a1501a4323a10edb7fa4cd1a0896675f6b51704c84dedad056
62-
```
81+
- 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
6382

6483
## Example
6584

6685
You can try it yourself by running the example project:
6786

68-
- Clone the repo
69-
- `cd Example/web3swiftExample`
70-
- run `pod install` from the `Example/web3swiftExample` directory.
71-
- `open ./web3swiftExample.xcworkspace`
87+
- Clone the repo: `git clone https://github.com/matterinc/web3swift.git`
88+
- Move to the repo: `cd web3swift/Example/web3swiftExample`
89+
- Install Dependencies: `pod install`
90+
- Open: `open ./web3swiftExample.xcworkspace`
7291

73-
## Requirements
7492

75-
Web3swift requires Swift 4.1 and iOS 9.0 or macOS 10.11 although we recommend to use the latest iOS and MacOS versions for your own safety. 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.
93+
## Installation
7694

77-
## Communication
95+
### Requirements
7896

79-
- if you **need help**, use [Stack Overflow](https://stackoverflow.com/questions/tagged/web3swift) (tag 'web3swift')
80-
- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/web3swift).
81-
- If you **found a bug**, [open an issue](https://github.com/matterinc/web3swift/issues).
82-
- If you **have a feature request**, [open an issue](https://github.com/matterinc/web3swift/issues).
83-
- If you **want to contribute**, [submit a pull request](https://github.com/matterinc/web3swift/pulls).
84-
85-
## Installation
97+
Web3swift requires `Swift 4.1` and `iOS 9.0` or `macOS 10.11` although we recommend using the latest iOS and MacOS versions for your safety. 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.
8698

8799
### CocoaPods
88100

@@ -92,17 +104,15 @@ Web3swift requires Swift 4.1 and iOS 9.0 or macOS 10.11 although we recommend to
92104
$ sudo gem install cocoapods
93105
```
94106

95-
96107
To integrate web3swift into your Xcode project using CocoaPods, specify it in your `Podfile`:
97108

98-
99109
```ruby
100110
source 'https://github.com/CocoaPods/Specs.git'
101111
platform :ios, '9.0'
102112

103113
target '<Your Target Name>' do
104114
use_frameworks!
105-
pod 'web3swift', '~> 1.1.5'
115+
pod 'web3swift'
106116
end
107117
```
108118

@@ -111,22 +121,10 @@ Then, run the following command:
111121
```bash
112122
$ pod install
113123
```
114-
## Features
115-
116-
- [x] Create Account
117-
- [x] Import Account
118-
- [x] Sign transactions
119-
- [x] Send transactions, call functions of smart-contracts, estimate gas costs
120-
- [x] Serialize and deserialize transactions and results to native Swift types
121-
- [x] Convenience functions for chain state: block number, gas price
122-
- [x] Check transaction results and get receipt
123-
- [x] Parse event logs for transaction
124-
- [x] Manage user's private keys through encrypted keystore abstractions
125-
- [x] Batched requests in concurrent mode, checks balances of 580 tokens (from the latest MyEtherWallet repo) over 3 seconds
126124

127125
## Getting started
128126

129-
Here's a few use cases:
127+
Here are a few use cases:
130128

131129
### Create Account
132130

@@ -152,7 +150,7 @@ else {
152150
fatalError("Couldn't create a KeystoreManager.")
153151
}
154152

155-
//Next you create the a new Keystore:
153+
//Next you create a new Keystore:
156154

157155
let newKeystore = try? EthereumKeystoreV3(password: "YOUR_PASSWORD")
158156

@@ -253,52 +251,70 @@ switch convenienceTransferResult {
253251
}
254252
```
255253

256-
## [Apps using this library](https://github.com/matterinc/web3swift/wiki/Apps-using-web3swift)
254+
## Apps using this library
255+
256+
If you are using `web3swift` in your app or know of an app that uses it, please add it to this list: [Apps using this library](https://github.com/matterinc/web3swift/wiki/Apps-using-web3swift)
257+
It would be much appreciated! 👍
257258

258-
If you are using `web3swift` in your app or know of an app that uses it, please add it to this list. It would be much appreciated! 👍
259+
Here is some examples:
259260

260261
* [MEWconnect-iOS](https://github.com/MyEtherWallet/MEWconnect-iOS)
261262
* [Peepeth iOS client](https://github.com/matterinc/PeepethClient)
262263
* [Ethereum & ERC20Tokens Wallet](https://itunes.apple.com/us/app/ethereum-erc20tokens-wallet/id1386738877?ls=1&mt=8)
263264
* [BankexWallet](https://github.com/BANKEX/Pay-iOS)
264265
* [GeoChain](https://github.com/awallish/GeoChain)
265-
* [YOUR APP CAN BE THERE (click me)](https://github.com/matterinc/web3swift/issues) :wink:
266+
* [TRX-Wallet](https://github.com/NewHorizonLabs/TRX-Wallet)
267+
* [YOUR APP CAN BE THERE (click me)](https://github.com/matterinc/web3swift/wiki/Apps-using-web3swift/_edit) :wink:
266268

267269
If you've used this project in a live app, please let us know!
268270

269271
*If you are using `web3swift` in your app or know of an app that uses it, please add it to [this](https://github.com/matterinc/web3swift/wiki/Apps-using-web3swift) list.*
270272

271273

272274

273-
## Future plans
275+
## Plans
274276

275277
- Full reference `web3js` functionality
276278
- Light Ethereum subprotocol (LES) integration
277279

278280

279-
## Special thanks to
280-
281-
- Gnosis team and their library [Bivrost-swift](https://github.com/gnosis/bivrost-swift) for inspiration for the ABI decoding approach
282-
- [Trust iOS Wallet](https://github.com/TrustWallet/trust-wallet-ios) for the collaboration and discussion of the initial idea
283-
- Official Ethereum and Solidity docs, everything was written from ground truth standards
284-
285-
## Contribution
281+
### Extra features:
286282

287283
For the latest version, please check [develop](https://github.com/matterinc/web3swift/tree/develop) branch.
288284
Changes made to this branch will be merged into the [master](https://github.com/matterinc/web3swift/tree/master) branch at some point.
289285

290-
- If you want to contribute, submit a [pull request](https://github.com/matterinc/web3swift/pulls) against a development `develop` branch.
291-
- If you found a bug, [open an issue](https://github.com/matterinc/web3swift/issues).
292-
- If you have a feature request, [open an issue](https://github.com/matterinc/web3swift/issues).
286+
---
293287

294288

295-
## Appreciation
289+
## Stay in touch
296290

297291
When using this pod, please make references to this repo and give your start! :)
298292
*Nothing makes developers happier than seeing someone else use our work and go wild with it.*
299293

294+
300295
If you are using web3swift in your app or know of an app that uses it, please add it to [this list](https://github.com/matterinc/web3swift/wiki/Apps-using-web3swift).
301296

297+
298+
### Contribution
299+
300+
301+
- If you **have a feature request**, [open an issue](https://github.com/matterinc/web3swift/issues).
302+
- If you **want to contribute**, [submit a pull request](https://github.com/matterinc/web3swift/pulls).
303+
304+
305+
### Communication
306+
307+
- if you **need help**, use [Stack Overflow](https://stackoverflow.com/questions/tagged/web3swift) (tag 'web3swift')
308+
- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/web3swift).
309+
- If you **found a bug**, [open an issue](https://github.com/matterinc/web3swift/issues).
310+
311+
312+
### Special thanks to
313+
314+
- Gnosis team and their library [Bivrost-swift](https://github.com/gnosis/bivrost-swift) for inspiration for the ABI decoding approach
315+
- [Trust iOS Wallet](https://github.com/TrustWallet/trust-wallet-ios) for the collaboration and discussion of the initial idea
316+
- Official Ethereum and Solidity docs, everything was written from ground truth standards
317+
-
302318
## Authors
303319

304320
Alex Vlasov, [@shamatar](https://github.com/shamatar), [email protected]

0 commit comments

Comments
 (0)