Skip to content

Commit 55760e4

Browse files
Merge pull request #124 from matter-labs/develop
2.1.0
2 parents e86c10b + 8ae8d6d commit 55760e4

38 files changed

+281
-1731
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
# web3swift
44

5-
[![Version](https://img.shields.io/cocoapods/v/web3swift.svg?style=flat)](http://cocoapods.org/pods/web3swift)
6-
[![License](https://img.shields.io/cocoapods/l/web3swift.svg?style=flat)](http://cocoapods.org/pods/web3swift)
7-
[![Platform](https://img.shields.io/cocoapods/p/web3swift.svg?style=flat)](http://cocoapods.org/pods/web3swift)
5+
[![Build Status](https://travis-ci.com/matter-labs/web3swift.svg?branch=develop)](https://travis-ci.com/matter-labs/web3swift)
86
[![Swift](https://img.shields.io/badge/Swift-4.0-orange.svg?style=flat)](https://developer.apple.com/swift/)
7+
[![Platform](https://img.shields.io/cocoapods/p/web3swift.svg?style=flat)](http://cocoapods.org/pods/web3swift)
8+
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/web3swift.svg?style=flat)](http://cocoapods.org/pods/web3swift)
9+
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
10+
[![License](https://img.shields.io/cocoapods/l/web3swift.svg?style=flat)](http://cocoapods.org/pods/web3swift)
911
[![support](https://brianmacdonald.github.io/Ethonate/svg/eth-support-blue.svg)](https://brianmacdonald.github.io/Ethonate/address#0xe22b8979739d724343bd002f9f432f5990879901)
10-
[![Build Status](https://travis-ci.com/matterinc/web3swift.svg?branch=develop)](https://travis-ci.com/matterinc/web3swift)
1112
[![Stackoverflow](https://img.shields.io/badge/stackoverflow-ask-blue.svg)](https://stackoverflow.com/questions/tagged/web3swift)
1213

1314
**web3swift** is your toolbelt for any kind interactions with Ethereum network.

web3swift.xcodeproj/project.pbxproj

Lines changed: 30 additions & 232 deletions
Large diffs are not rendered by default.

web3swift/Contract/Classes/EthereumContract.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import EthereumAddress
99
import EthereumABI
1010

1111
public struct EthereumContract:ContractProtocol {
12-
public var options: Web3Options? = Web3Options.defaultOptions()
1312
public var transactionOptions: TransactionOptions? = TransactionOptions.defaultOptions
1413
public var address: EthereumAddress? = nil
1514

web3swift/HookedFunctions/Classes/Web3+BrowserFunctions.swift

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,7 @@ extension web3.BrowserFunctions {
6868

6969
public func sendTransaction(_ transactionJSON: [String: Any], password: String = "web3swift") -> [String:Any]? {
7070
guard let transaction = EthereumTransaction.fromJSON(transactionJSON) else {return nil}
71-
guard let options = Web3Options.fromJSON(transactionJSON) else {return nil}
72-
var transactionOptions = TransactionOptions()
73-
transactionOptions.from = options.from
74-
transactionOptions.to = options.to
75-
transactionOptions.value = options.value
76-
transactionOptions.gasLimit = options.gasLimit != nil ? .limited(options.gasLimit!) : .automatic
77-
transactionOptions.gasPrice = options.gasPrice != nil ? .manual(options.gasPrice!) : .automatic
71+
guard let transactionOptions = TransactionOptions.fromJSON(transactionJSON) else {return nil}
7872
return self.sendTransaction(transaction, transactionOptions: transactionOptions, password: password)
7973
}
8074

@@ -89,13 +83,7 @@ extension web3.BrowserFunctions {
8983

9084
public func estimateGas(_ transactionJSON: [String: Any]) -> BigUInt? {
9185
guard let transaction = EthereumTransaction.fromJSON(transactionJSON) else {return nil}
92-
guard let options = Web3Options.fromJSON(transactionJSON) else {return nil}
93-
var transactionOptions = TransactionOptions()
94-
transactionOptions.from = options.from
95-
transactionOptions.to = options.to
96-
transactionOptions.value = options.value
97-
transactionOptions.gasLimit = .automatic
98-
transactionOptions.gasPrice = options.gasPrice != nil ? .manual(options.gasPrice!) : .automatic
86+
guard let transactionOptions = TransactionOptions.fromJSON(transactionJSON) else {return nil}
9987
return self.estimateGas(transaction, transactionOptions: transactionOptions)
10088
}
10189

@@ -134,13 +122,7 @@ extension web3.BrowserFunctions {
134122

135123
public func signTransaction(_ transactionJSON: [String: Any], password: String = "web3swift") -> String? {
136124
guard let transaction = EthereumTransaction.fromJSON(transactionJSON) else {return nil}
137-
guard let options = Web3Options.fromJSON(transactionJSON) else {return nil}
138-
var transactionOptions = TransactionOptions()
139-
transactionOptions.from = options.from
140-
transactionOptions.to = options.to
141-
transactionOptions.value = options.value
142-
transactionOptions.gasLimit = options.gasLimit != nil ? .limited(options.gasLimit!) : .automatic
143-
transactionOptions.gasPrice = options.gasPrice != nil ? .manual(options.gasPrice!) : .automatic
125+
guard var transactionOptions = TransactionOptions.fromJSON(transactionJSON) else {return nil}
144126
if let nonceString = transactionJSON["nonce"] as? String, let nonce = BigUInt(nonceString.stripHexPrefix(), radix: 16) {
145127
transactionOptions.nonce = .manual(nonce)
146128
} else {

web3swift/PrecompiledContracts/ERC1155/Web3+ERC1155.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ protocol IERC1155Metadata {
3232

3333
public class ERC1155: IERC1155 {
3434

35-
@available(*, deprecated, renamed: "transactionOptions")
36-
public var options: Web3Options = .init()
37-
3835
private var _tokenId: BigUInt? = nil
3936
private var _hasReadProperties: Bool = false
4037

web3swift/PrecompiledContracts/ERC1376/Web3+ERC1376.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ protocol IERC1376: IERC20 {
6969

7070
public class ERC1376: IERC1376 {
7171

72-
@available(*, deprecated, renamed: "transactionOptions")
73-
public var options: Web3Options = .init()
74-
7572
private var _name: String? = nil
7673
private var _symbol: String? = nil
7774
private var _decimals: UInt8? = nil

web3swift/PrecompiledContracts/ERC1400/Web3+ERC1400.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ protocol IERC1400: IERC20 {
6666
// can be imperatively read and saved
6767
public class ERC1400: IERC1400 {
6868

69-
@available(*, deprecated, renamed: "transactionOptions")
70-
public var options: Web3Options = .init()
71-
7269
private var _name: String? = nil
7370
private var _symbol: String? = nil
7471
private var _decimals: UInt8? = nil

web3swift/PrecompiledContracts/ERC1410/Web3+ERC1410.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ protocol IERC1410: IERC20 {
4444

4545
public class ERC1410: IERC1410 {
4646

47-
@available(*, deprecated, renamed: "transactionOptions")
48-
public var options: Web3Options = .init()
49-
5047
private var _name: String? = nil
5148
private var _symbol: String? = nil
5249
private var _decimals: UInt8? = nil

web3swift/PrecompiledContracts/ERC1594/Web3+ERC1594.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ protocol IERC1594: IERC20 {
3434

3535
public class ERC1594: IERC1594 {
3636

37-
@available(*, deprecated, renamed: "transactionOptions")
38-
public var options: Web3Options = .init()
39-
4037
private var _name: String? = nil
4138
private var _symbol: String? = nil
4239
private var _decimals: UInt8? = nil

web3swift/PrecompiledContracts/ERC1633/Web3+ERC1633.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ protocol IERC1633: IERC20, IERC165 {
2121

2222
public class ERC1633: IERC1633 {
2323

24-
@available(*, deprecated, renamed: "transactionOptions")
25-
public var options: Web3Options = .init()
26-
2724
private var _name: String? = nil
2825
private var _symbol: String? = nil
2926
private var _decimals: UInt8? = nil

0 commit comments

Comments
 (0)