Skip to content

Commit cc076ee

Browse files
Merge branch 'develop'
2 parents edfe624 + 70202c1 commit cc076ee

File tree

89 files changed

+1425
-1633
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+1425
-1633
lines changed

.github/workflows/macOS-12.yml renamed to .github/workflows/macOS-tests.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
- master
77
- develop
88
- hotfix
9-
- unstable
109
paths:
1110
- Packag*.swift
1211
- web3swift.podspec
@@ -20,6 +19,8 @@ on:
2019
- master
2120
- develop
2221
- unstable
22+
# Temporary develop-X.Y.Z branches may be added and removed from here as we release new versions
23+
- develop-4.0
2324

2425
env:
2526
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
@@ -32,7 +33,12 @@ jobs:
3233
group: spm-${{ github.run_id }}
3334
cancel-in-progress: false
3435
steps:
35-
- uses: actions/checkout@v2
36+
- uses: actions/checkout@v3
37+
- name: Discover typos
38+
run: |
39+
pip3 install --upgrade pip
40+
pip3 install codespell
41+
codespell --count --ignore-words-list=ans,deriver,inout,packag --skip="*.js,*WordLists.swift"
3642
- name: Resolve dependencies
3743
run: swift package resolve
3844
- name: Build

CHANGELOG.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
- `subscribeOnLogs` method with specific contract address is not working!!!! [\#366](https://github.com/skywinder/web3swift/issues/366)
8484
- EthereumContract with Custom ABI returns nil [\#342](https://github.com/skywinder/web3swift/issues/342)
8585
- Error on running tests [\#290](https://github.com/skywinder/web3swift/issues/290)
86-
- Serialisation of BIP32 misplaced address postition [\#257](https://github.com/skywinder/web3swift/issues/257)
86+
- Serialisation of BIP32 misplaced address position [\#257](https://github.com/skywinder/web3swift/issues/257)
8787
- Xcode 10.2.1 carthage update hangs while building web3swift.xcodeproj [\#197](https://github.com/skywinder/web3swift/issues/197)
8888

8989
**Closed issues:**
@@ -118,15 +118,15 @@
118118
- @ravi-ranjan-oodles thanks for the update. [\#329](https://github.com/skywinder/web3swift/issues/329)
119119
- Issue in Uploading to Test Flight [\#328](https://github.com/skywinder/web3swift/issues/328)
120120
- Update CryptoSwift podspec [\#322](https://github.com/skywinder/web3swift/issues/322)
121-
- cann't open DApp, such as "https://uniswap.tokenpocket.pro/\#/swap" [\#321](https://github.com/skywinder/web3swift/issues/321)
121+
- can't open DApp, such as "https://uniswap.tokenpocket.pro/\#/swap" [\#321](https://github.com/skywinder/web3swift/issues/321)
122122
- CryptoSwift version is too low to work properly in Xcode12.5 [\#318](https://github.com/skywinder/web3swift/issues/318)
123123
- web3swift.Web3Error.processingError\(desc: "Failed to fetch gas estimate"\)(BSC Chain) [\#317](https://github.com/skywinder/web3swift/issues/317)
124124
- Quick simple steps for minting ERC20 or ERC721 tokens [\#314](https://github.com/skywinder/web3swift/issues/314)
125125
- Generate Contract Bytecode / Address [\#313](https://github.com/skywinder/web3swift/issues/313)
126126
- I can't find func 'Web3.InfuraKovanWeb3\(\)' [\#311](https://github.com/skywinder/web3swift/issues/311)
127127
- web3 instance error: Variable used within its own initial value [\#310](https://github.com/skywinder/web3swift/issues/310)
128128
- Failed to fetch gas estimate when sending erc20 [\#307](https://github.com/skywinder/web3swift/issues/307)
129-
- DApp browser cann't open Uniswap in a right way [\#304](https://github.com/skywinder/web3swift/issues/304)
129+
- DApp browser can't open Uniswap in a right way [\#304](https://github.com/skywinder/web3swift/issues/304)
130130
- Update cocoapods bigint to 5.0 [\#288](https://github.com/skywinder/web3swift/issues/288)
131131
- When I use getBlockByNumber , hash Unable to check [\#287](https://github.com/skywinder/web3swift/issues/287)
132132
- How to parse the return value of read transaction [\#284](https://github.com/skywinder/web3swift/issues/284)
@@ -231,7 +231,7 @@
231231
- policy [\#247](https://github.com/skywinder/web3swift/pull/247) ([BaldyAsh](https://github.com/BaldyAsh))
232232
- Fix dependencies, build [\#245](https://github.com/skywinder/web3swift/pull/245) ([BaldyAsh](https://github.com/BaldyAsh))
233233
- chore: update ENS Registry migration [\#243](https://github.com/skywinder/web3swift/pull/243) ([aranhaagency](https://github.com/aranhaagency))
234-
- improtant notice update [\#232](https://github.com/skywinder/web3swift/pull/232) ([skywinder](https://github.com/skywinder))
234+
- important notice update [\#232](https://github.com/skywinder/web3swift/pull/232) ([skywinder](https://github.com/skywinder))
235235
- Add Alice Wallet to project list [\#230](https://github.com/skywinder/web3swift/pull/230) ([lmcmz](https://github.com/lmcmz))
236236
- Update Extensions.swift [\#225](https://github.com/skywinder/web3swift/pull/225) ([kocherovets](https://github.com/kocherovets))
237237
- correct gasLimit [\#222](https://github.com/skywinder/web3swift/pull/222) ([luqz](https://github.com/luqz))
@@ -249,10 +249,10 @@
249249
**Closed issues:**
250250

251251
- BigInt 3.1 [\#207](https://github.com/skywinder/web3swift/issues/207)
252-
- recevied transaction id from geth node server but not able to see that transaction id at etherscan.io [\#200](https://github.com/skywinder/web3swift/issues/200)
252+
- received transaction id from geth node server but not able to see that transaction id at etherscan.io [\#200](https://github.com/skywinder/web3swift/issues/200)
253253
- How do I fetch information such as balance, decimal,symbol and name of ERC20token ? [\#199](https://github.com/skywinder/web3swift/issues/199)
254254
- Starscream 3.1.0 not compatible with Swift 5.0 [\#195](https://github.com/skywinder/web3swift/issues/195)
255-
- How to Connect infuraWebsocket and subsribe perticular event in swift? [\#193](https://github.com/skywinder/web3swift/issues/193)
255+
- How to Connect infuraWebsocket and subsribe particular event in swift? [\#193](https://github.com/skywinder/web3swift/issues/193)
256256
- Use of unresolved identifier 'Wallet' [\#192](https://github.com/skywinder/web3swift/issues/192)
257257
- V in Signed Message Hash not being calculated properly [\#191](https://github.com/skywinder/web3swift/issues/191)
258258
- Not possible to calculate fast, normal and cheap transaction fee ? [\#190](https://github.com/skywinder/web3swift/issues/190)

Example/myWeb3Wallet/myWeb3Wallet/ViewControllers/WalletController/WalletViewController.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ class WalletViewController: UIViewController {
8989
let manager = KeystoreManager([myWeb3KeyStore])
9090
let address = keystore?.addresses?.first
9191
#if DEBUG
92-
print("Address :::>>>>> ", address as Any)
93-
print("Address :::>>>>> ", manager.addresses as Any)
92+
print("Address :::>>>>> ", address)
93+
print("Address :::>>>>> ", manager.addresses)
9494
#endif
9595
let walletAddress = manager.addresses?.first?.address
9696
self.walletAddressLabel.text = walletAddress ?? "0x"
9797

98-
print(walletAddress as Any)
98+
print(walletAddress)
9999
} else {
100100
print("error")
101101
}
@@ -115,7 +115,7 @@ class WalletViewController: UIViewController {
115115
}
116116
func importWalletWith(mnemonics: String) {
117117
let walletAddress = try? BIP32Keystore(mnemonics: mnemonics , prefixPath: "m/44'/77777'/0'/0")
118-
print(walletAddress?.addresses as Any)
118+
print(walletAddress?.addresses)
119119
self.walletAddressLabel.text = "\(walletAddress?.addresses?.first?.address ?? "0x")"
120120

121121
}
@@ -137,15 +137,15 @@ extension WalletViewController {
137137
self._mnemonics = tMnemonics
138138
print(_mnemonics)
139139
let tempWalletAddress = try? BIP32Keystore(mnemonics: self._mnemonics , prefixPath: "m/44'/77777'/0'/0")
140-
print(tempWalletAddress?.addresses?.first?.address as Any)
140+
print(tempWalletAddress?.addresses?.first?.address)
141141
guard let walletAddress = tempWalletAddress?.addresses?.first else {
142142
self.showAlertMessage(title: "", message: "We are unable to create wallet", actionName: "Ok")
143143
return
144144
}
145145
self._walletAddress = walletAddress.address
146146
let privateKey = try tempWalletAddress?.UNSAFE_getPrivateKeyData(password: "", account: walletAddress)
147147
#if DEBUG
148-
print(privateKey as Any, "Is the private key")
148+
print(privateKey, "Is the private key")
149149
#endif
150150
let keyData = try? JSONEncoder().encode(tempWalletAddress?.keystoreParams)
151151
FileManager.default.createFile(atPath: userDir + "/keystore"+"/key.json", contents: keyData, attributes: nil)

README.md

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# web3swift
22
**web3swift** is an iOS toolbelt for interaction with the Ethereum network.
33

4-
## Social medias
4+
## Social media
55
[Join our discord](https://discord.gg/8bHCNmhS7x) or [Telegram](https://t.me/web3swift) if you need support or want to contribute to web3swift development!
66

77
![matter-github-swift](https://github.com/web3swift-team/web3swift/blob/develop/web3swift-logo.png)
@@ -19,8 +19,8 @@
1919

2020
- [Core features](#core-features)
2121
- [Installation](#installation)
22-
- [CocoaPods](#cocoapods)
2322
- [Swift Package](#swift-package)
23+
- [CocoaPods](#cocoapods)
2424
- [Example usage](#example-usage)
2525
- [Send Ether](#send-ether)
2626
- [Contract read method](#contract-read-method)
@@ -57,7 +57,7 @@
5757
- [x] 🕵️‍♂️ Possibility to **add or remove "middleware" that intercepts**, modifies and even **cancel transaction** workflow on stages "before assembly", "after assembly" and "before submission"
5858
- [x]**Literally following the standards** (BIP, EIP, etc):
5959
- [x] **[BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) (HD Wallets), [BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) (Seed phrases), [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) (Key generation prefixes)**
60-
- [x] **[EIP-20](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md)** (Standart interface for tokens - ERC-20), **[EIP-67](https://github.com/ethereum/EIPs/issues/67)** (Standard URI scheme), **[EIP-155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md)** (Replay attacks protection), **[EIP-2718](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2718.md)** (Typed Transaction Envelope), **[EIP-1559](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md)** (Gas Fee market change)
60+
- [x] **[EIP-20](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md)** (Standard interface for tokens - ERC-20), **[EIP-67](https://github.com/ethereum/EIPs/issues/67)** (Standard URI scheme), **[EIP-155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md)** (Replay attacks protection), **[EIP-2718](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2718.md)** (Typed Transaction Envelope), **[EIP-1559](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md)** (Gas Fee market change)
6161
- [x] **And many others** *(For details about this EIP's look at [Documentation page](https://github.com/web3swift-team/web3swift/blob/master/Documentation/))*: EIP-681, EIP-721, EIP-165, EIP-777, EIP-820, EIP-888, EIP-1400, EIP-1410, EIP-1594, EIP-1643, EIP-1644, EIP-1633, EIP-721, EIP-1155, EIP-1376, ST-20
6262
- [x] **RLP encoding**
6363
- [x] Base58 encoding scheme
@@ -66,6 +66,27 @@
6666

6767
## Installation
6868

69+
### Swift Package (Recommended)
70+
The [Swift Package Manager](https://swift.org/package-manager/ "") is a tool for automating the distribution of Swift code that is well integrated with Swift build system.
71+
72+
Once you have your Swift package set up, adding `web3swift` as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.
73+
```swift
74+
dependencies: [
75+
.package(url: "https://github.com/web3swift-team/web3swift.git", .upToNextMajor(from: "3.0.0"))
76+
]
77+
```
78+
79+
Or if your project is not a package follow these guidelines on [how to add a Swift Package to your Xcode project](https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app).
80+
81+
82+
## Example usage
83+
In the imports section:
84+
85+
```swift
86+
import web3swift
87+
import Web3Core
88+
```
89+
6990
### CocoaPods
7091

7192
[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:
@@ -91,23 +112,7 @@ Then, run the following command:
91112
$ pod install
92113
```
93114

94-
### Swift Package
95-
The [Swift Package Manager](https://swift.org/package-manager/ "") is a tool for automating the distribution of Swift code and is integrated into the swift compiler.
96-
97-
Once you have your Swift package set up, adding Alamofire as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.
98-
```swift
99-
dependencies: [
100-
.package(url: "https://github.com/web3swift-team/web3swift.git", .upToNextMajor(from: "3.0.0"))
101-
]
102-
```
103-
104-
## Example usage
105-
In the imports section:
106-
107-
```swift
108-
import web3swift
109-
import Web3Core
110-
```
115+
> **WARNING**: CocoaPods is a powerful tool for managing dependencies in iOS development, but it also has some limitations that preventing us of providing first class support there. We highly recommend using SPM first as using CocoaPods will delay new updates and bug fixes being delivered to you.
111116
112117
### Send Ether
113118
```swift
@@ -132,7 +137,7 @@ let response = try await readTX.callContractMethod()
132137
let abiString = "[]" // some ABI string
133138
let bytecode = Data.fromHex("") // some ABI bite sequence
134139
let contract = web3.contract(abiString, at: nil, abiVersion: 2)!
135-
let parameters = [...] as [AnyObject]
140+
let parameters: [Any] = [...]
136141
let deployOp = contract.prepareDeploy(bytecode: bytecode, constructor: contract.contract.constructor, parameters: parameters)!
137142
deployOp.transaction.from = "" // your address
138143
deployOp.transaction.gasLimitPolicy = .manual(3000000)

0 commit comments

Comments
 (0)