Skip to content

Commit 2e30580

Browse files
Merge pull request #210 from matter-labs/develop
2.2.1
2 parents d726437 + e94f2e1 commit 2e30580

25 files changed

+1385
-193
lines changed

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
11
# Change Log
22

3+
## [Unreleased](https://github.com/matter-labs/web3swift/tree/HEAD)
4+
5+
[Full Changelog](https://github.com/matter-labs/web3swift/compare/2.2.0...HEAD)
6+
7+
**Closed issues:**
8+
9+
- EIP67Code missing in web3swift 2.1.6 [\#176](https://github.com/matter-labs/web3swift/issues/176)
10+
- ENS initializer is inaccessible due to `internal` protection level [\#171](https://github.com/matter-labs/web3swift/issues/171)
11+
12+
**Merged pull requests:**
13+
14+
- Update ETHRegistrarController.swift [\#183](https://github.com/matter-labs/web3swift/pull/183) ([barrasso](https://github.com/barrasso))
15+
- Fix typo in Usage [\#182](https://github.com/matter-labs/web3swift/pull/182) ([sweepty](https://github.com/sweepty))
16+
- Expose errorDescription. [\#181](https://github.com/matter-labs/web3swift/pull/181) ([andresousa](https://github.com/andresousa))
17+
- Update ENS Resolver [\#180](https://github.com/matter-labs/web3swift/pull/180) ([barrasso](https://github.com/barrasso))
18+
19+
## [2.2.0](https://github.com/matter-labs/web3swift/tree/2.2.0) (2019-04-30)
20+
[Full Changelog](https://github.com/matter-labs/web3swift/compare/2.1.6...2.2.0)
21+
22+
**Closed issues:**
23+
24+
- Failed to fetch gas estimate [\#178](https://github.com/matter-labs/web3swift/issues/178)
25+
26+
**Merged pull requests:**
27+
28+
- 2.2.0 [\#179](https://github.com/matter-labs/web3swift/pull/179) ([BaldyAsh](https://github.com/BaldyAsh))
29+
30+
## [2.1.6](https://github.com/matter-labs/web3swift/tree/2.1.6) (2019-04-26)
31+
[Full Changelog](https://github.com/matter-labs/web3swift/compare/2.1.5...2.1.6)
32+
33+
**Merged pull requests:**
34+
35+
- 2.1.6 [\#175](https://github.com/matter-labs/web3swift/pull/175) ([BaldyAsh](https://github.com/BaldyAsh))
36+
- Quickfix ens [\#174](https://github.com/matter-labs/web3swift/pull/174) ([BaldyAsh](https://github.com/BaldyAsh))
37+
338
## [2.1.5](https://github.com/matter-labs/web3swift/tree/2.1.5) (2019-04-24)
439
[Full Changelog](https://github.com/matter-labs/web3swift/compare/2.1.4...2.1.5)
540

Cartfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
github "mxcl/PromiseKit" ~> 6.8.4
2-
github "attaswift/BigInt" ~> 3.1
2+
github "attaswift/BigInt" ~> 4.0
33
github "daltoniam/Starscream" ~> 3.1.0
44
github "krzyzanowskim/CryptoSwift" ~> 1.0.0

Documentation/Usage.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@
4646
- [Infura Websocket interactions](#infura-websocket-interactions)
4747
- [Connect to Infura endpoint](#connect-to-infura-endpoint)
4848
- [Connect to custom Infura-like endpoint](#connect-to-custom-infura-like-endpoint)
49-
- [Create a filter in the node to notify when something happened](#create-a-filter-in-the-node-to-notify-when-something-happened)
49+
- [Set a filter in the node to notify when something happened](#set-a-filter-in-the-node-to-notify-when-something-happened)
5050
- [Get new pending transactions](#get-new-pending-transactions)
5151
- [Create a new subscription over particular events](#create-a-new-subscription-over-particular-events)
5252
- [Subscribe on new pending transactions](#subscribe-on-new-pending-transactions)
53+
- [Subscribe on logs](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#subscribe-on-logs)
54+
- [Subscribe on new heads](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#subscribe-on-new-heads)
5355
- [ENS](#ens)
5456
- [Registry](#registry)
5557
- [Resolver](#resolver)
@@ -181,7 +183,7 @@ if wallet.isHD {
181183
```swift
182184
let password = "web3swift"
183185
let ethereumAddress = EthereumAddress(wallet.address)!
184-
let pkData = try! keysoreManager.UNSAFE_getPrivateKeyData(password: password, account: ethereumAddress).toHexString()
186+
let pkData = try! keystoreManager.UNSAFE_getPrivateKeyData(password: password, account: ethereumAddress).toHexString()
185187
```
186188

187189
## Ethereum Endpoints interaction
@@ -421,18 +423,28 @@ socketProvider = InfuraWebsocketProvider.connectToInfuraSocket(.Mainnet, delegat
421423
socketProvider = InfuraWebsocketProvider.connectToSocket("ws://your.endpoint", delegate: delegate)
422424
```
423425

424-
#### Create a filter in the node to notify when something happened
426+
#### Set a filter in the node to notify when something happened
425427

426428
To study possible filters read [Infura WSS filters documentation](https://infura.io/docs/ethereum/wss/introduction)
427429

428430
```swift
429-
try! socketProvider.filter(method: <InfuraWebsocketMethod>, params: <[Encodable]?>)
431+
// Getting logs
432+
try! socketProvider.setFilterAndGetLogs(method: <InfuraWebsocketMethod>, params: <[Encodable]?>)
433+
// Getting changes
434+
try! socketProvider.setFilterAndGetChanges(method: <InfuraWebsocketMethod>, params: <[Encodable]?>)
435+
```
436+
Or you can provide parameters in more convenient way:
437+
```swift
438+
// Getting logs
439+
try! socketProvider.setFilterAndGetLogs(method: <InfuraWebsocketMethod>, address: <EthereumAddress?>, fromBlock: <BlockNumber?>, toBlock: <BlockNumber?>, topics: <[String]?>)
440+
// Getting changes
441+
try! socketProvider.setFilterAndGetChanges(method: <InfuraWebsocketMethod>, address: <EthereumAddress?>, fromBlock: <BlockNumber?>, toBlock: <BlockNumber?>, topics: <[String]?>)
430442
```
431443

432444
#### Get new pending transactions
433445

434446
```swift
435-
try! socketProvider.filter(method: .newPendingTransactionFilter)
447+
try! socketProvider.setFilterAndGetLogs(method: .newPendingTransactionFilter)
436448
```
437449

438450
#### Create a new subscription over particular events
@@ -449,6 +461,18 @@ try! socketProvider.subscribe(params: <[Encodable]>)
449461
try! socketProvider.subscribeOnNewPendingTransactions()
450462
```
451463

464+
#### Subscribe on logs
465+
466+
```swift
467+
try! socketProvider.subscribeOnLogs(addresses: <[EthereumAddress]?>, topics: <[String]?>)
468+
```
469+
470+
#### Subscribe on new heads
471+
472+
```swift
473+
try! socketProvider.subscribeOnNewHeads()
474+
```
475+
452476
## ENS
453477

454478
You need ENS instance for future actions:

0 commit comments

Comments
 (0)