You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -70,37 +70,139 @@ You can try it by yourself by running the example project:
70
70
- run `pod install` from the `Example/web3swiftExample` directory.
71
71
-`open ./web3swiftExample.xcworkspace`
72
72
73
-
###Requirements
73
+
## Requirements
74
74
75
75
Web3swift requires Swift 4.1 and iOS 9.0 or macOS 10.13 although we recommend to use the latest iOS and MacOS versions for your own safety. Don't forget to set iOS version in a Podfile, otherwise you get an error if deployment target is less than the latest SDK.
76
76
77
-
### Installation
77
+
##Communication
78
78
79
-
web3swift is available through [CocoaPods](http://cocoapods.org). To install
80
-
it, simply add the following line to your Podfile:
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/BANKEX/web3swift/issues).
82
+
- If you **have a feature request**, [open an issue](https://github.com/BANKEX/web3swift/issues).
83
+
- If you **want to contribute**, [submit a pull request](https://github.com/BANKEX/web3swift/pulls).
84
+
85
+
## Installation
86
+
87
+
### CocoaPods
88
+
89
+
[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:
90
+
91
+
```bash
92
+
$ sudo gem install cocoapods
93
+
```
94
+
95
+
96
+
To integrate web3swift into your Xcode project using CocoaPods, specify it in your `Podfile`:
81
97
82
98
```ruby
83
-
pod 'web3swift', git:'https://github.com/BANKEX/web3swift.git'
99
+
source 'https://github.com/CocoaPods/Specs.git'
100
+
platform :ios, '9.0'
101
+
102
+
target '<Your Target Name>'do
103
+
use_frameworks!
104
+
pod 'web3swift', :git => 'https://github.com/BANKEX/web3swift.git'
105
+
end
106
+
```
107
+
108
+
Then, run the following command:
109
+
110
+
```bash
111
+
$ pod install
112
+
```
113
+
## Features
114
+
115
+
-[x] Create Account
116
+
-[x] Import Account
117
+
-[x] Sign transictions
118
+
-[x] Send transactions, call functions of smart-contracts, estimate gas costs
119
+
-[x] Serialize and deserialize transactions and results to native Swift types
120
+
-[x] Convenience functions for chain state: block number, gas price
121
+
-[x] Check transaction results and get receipt
122
+
-[x] Parse event logs for transaction
123
+
-[x] Manage user's private keys through encrypted keystore abstractions
124
+
-[x] Batched requests in concurrent mode, checks balances of 580 tokens (from the latest MyEtherWallet repo) over 3 seconds
125
+
126
+
## Usage
127
+
128
+
Here you can see a few examples of use of our library
129
+
### Initializing Ethereum address
130
+
```bash
131
+
let coldWalletAddress = EthereumAddress("0x6394b37Cf80A7358b38068f0CA4760ad49983a1B")!
132
+
let constractAddress = EthereumAddress("0x45245bc59219eeaaf6cd3f382e078a461ff9de7b")!
84
133
```
85
-
### Current functionality
86
134
87
-
- Send transactions, call functions of smart-contracts, estimate gas costs
88
-
- Serialize and deserialize transactions and results to native Swift types
89
-
- Convenience functions for chain state: block number, gas price
90
-
- Check transaction results and get receipt
91
-
- Parse event logs for transaction
92
-
- Manage user's private keys through encrypted keystore abstractions
93
-
- Batched requests in concurrent mode, checks balances of 580 tokens (from the latest MyEtherWallet repo) over 3 seconds
135
+
### Getting gas price
136
+
```bash
137
+
let web3Main = Web3.InfuraMainnetWeb3()
138
+
let gasPriceResult = web3Main.eth.getGasPrice()
139
+
guard case .success(let gasPrice) = gasPriceResult else {return}
let convenienceTransferResult = convenienceTokenTransfer!.send(password: "BANKEXFOUNDATION", options: convenienceTransferOptions)
181
+
switch convenienceTransferResult {
182
+
case .success(let res):
183
+
print("Token transfer successful")
184
+
print(res)
185
+
case .failure(let error):
186
+
print(error)
187
+
}
188
+
```
189
+
190
+
## Global plans
96
191
- Full reference `web3js` functionality
97
192
- Light Ethereum subprotocol (LES) integration
98
193
194
+
## [Apps using this library](https://github.com/BANKEX/web3swift/wiki/Apps-using-web3swift)
195
+
196
+
If you've used this project in a live app, please let us know!
197
+
198
+
*If you are using `web3swift` in your app or know of an app that uses it, please add it to [this] (https://github.com/BANKEX/web3swift/wiki/Apps-using-web3swift) list.*
199
+
99
200
## Special thanks to
100
201
101
202
- Gnosis team and their library [Bivrost-swift](https://github.com/gnosis/bivrost-swift) for inspiration for the ABI decoding approach
102
203
- [Trust iOS Wallet](https://github.com/TrustWallet/trust-wallet-ios) for collaboration and discussion for initial idea
103
204
- Official Ethereum and Solidity docs, everything was written from ground truth standards
205
+
104
206
## Contribution
105
207
106
208
For the latest version, please check [develop](https://github.com/BANKEX/web3swift/tree/develop) branch.
0 commit comments