Skip to content

Commit 097adaf

Browse files
chore: removing cocoapods support (#840)
* chore: removed CocoaPods * chore: removing cocoapods support * chore: fixed linked to workflow file Signed-off-by: Jenea Vranceanu <[email protected]> * chore: swift badge colour change Signed-off-by: Jenea Vranceanu <[email protected]> * chore: added more examples to README.md Signed-off-by: Jenea Vranceanu <[email protected]> * chore: rephrasing, fixed typos README.md Signed-off-by: Jenea Vranceanu <[email protected]> * chore: Update README.md Signed-off-by: Jenea Vranceanu <[email protected]> * chore: hiding support badge in README.md Signed-off-by: Jenea Vranceanu <[email protected]> --------- Signed-off-by: Jenea Vranceanu <[email protected]>
1 parent f730f02 commit 097adaf

File tree

7 files changed

+53
-89
lines changed

7 files changed

+53
-89
lines changed

.github/workflows/macOS-tests.yml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
- hotfix
99
paths:
1010
- Packag*.swift
11-
- web3swift.podspec
1211
- Cartfile
1312
- Sources/**
1413
- 'Tests/**'

.gitignore

+5-7
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,11 @@ Package.pins
4343
*/.swiftpm/**
4444
Package.resolved
4545

46-
# CocoaPods
47-
#
48-
# We recommend against adding the Pods directory to your .gitignore. However
49-
# you should judge for yourself, the pros and cons are mentioned at:
50-
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
51-
#
52-
Example/**/Pods
46+
# Pods
47+
Pods/
48+
Podfile
49+
Podfile.lock
50+
*.podspec
5351

5452
# Carthage
5553
#

CONTRIBUTION.md

-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ In ci/cd we’re using Xcode test plans feature to spread tests to local and rem
3535
Please add any files unused due build process to `excludeFiles` array in `Package.swift`.
3636
### Carthage
3737
Please do not forget to add & remove all new or dropped files and dependencies in carthage `.xcodeproj` file if you’re working with project anywhere but carthage project.
38-
### Cocoapods
39-
Please do not forget to add & remove all dependencies within `web3swift.podspec` file.
4038
### GitHub actions
4139
You’re able to use our github actions checks in your fork without needing to make PR to this repo. To get that just add your branch name to the branch list in file on path `.github/actions/ci.yml` to let the magic happening like follow:
4240

README.md

+48-32
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
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)
8-
[![Web3swift CI](https://github.com/web3swift-team/web3swift/actions/workflows/macOS-12.yml/badge.svg)](https://github.com/web3swift-team/web3swift/actions/workflows/macOS-12.yml)
9-
[![Swift](https://img.shields.io/badge/Swift-5.4-orange.svg?style=flat)](https://developer.apple.com/swift/)
10-
[![Platform](https://img.shields.io/cocoapods/p/web3swift?style=flat)](http://cocoapods.org/pods/web3swift)
11-
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/web3swift?style=flat)](http://cocoapods.org/pods/web3swift)
8+
[![Web3swift CI](https://github.com/web3swift-team/web3swift/actions/workflows/macOS-tests.yml/badge.svg)](https://github.com/web3swift-team/web3swift/actions/workflows/macOS-tests.yml)
9+
[![Swift](https://img.shields.io/badge/Swift-5.5-f26118.svg?style=flat)](https://developer.apple.com/swift/)
1210
[![License](https://img.shields.io/cocoapods/l/web3swift.svg?style=flat)](https://github.com/web3swift-team/web3swift/blob/master/LICENSE.md)
13-
[![support](https://brianmacdonald.github.io/Ethonate/svg/eth-support-blue.svg)](https://brianmacdonald.github.io/Ethonate/address#0xe22b8979739d724343bd002f9f432f5990879901)
1411
[![Stackoverflow](https://img.shields.io/badge/stackoverflow-ask-blue.svg)](https://stackoverflow.com/questions/tagged/web3swift)
12+
<!-- [![support](https://brianmacdonald.github.io/Ethonate/svg/eth-support-blue.svg)](https://brianmacdonald.github.io/Ethonate/address#0xe22b8979739d724343bd002f9f432f5990879901) -->
1513

1614
---
1715

1816
<!-- MarkdownTOC -->
1917

20-
- [Core features](#core-features)
18+
- [Core Features](#core-features)
2119
- [Installation](#installation)
2220
- [Swift Package](#swift-package)
2321
- [CocoaPods](#cocoapods)
2422
- [Example usage](#example-usage)
23+
- [Create Web3 Provider](#create-web3-provider)
24+
- [Create Web3 Object](#create-web3-object)
2525
- [Send Ether](#send-ether)
2626
- [Contract read method](#contract-read-method)
2727
- [Write Transaction and call smart contract method](#write-transaction-and-call-smart-contract-method)
@@ -48,11 +48,11 @@
4848
- [x] :thought_balloon: Interaction with remote node via **JSON RPC**
4949
- [x] 🔐 Local **keystore management** (`geth` compatible)
5050
- [x] 🤖 Smart-contract **ABI parsing**
51-
- [x] 🔓**ABI decoding** (V2 is supported with return of structures from public functions. Part of 0.4.22 Solidity compiler)
51+
- [x] 🔓**ABI decoding** (V2 is supported with a return of structures from public functions. Part of 0.4.22 Solidity compiler)
5252
- [x] 🕸Ethereum Name Service **(ENS) support** - a secure & decentralised way to address resources both on and off the blockchain using simple, human-readable names
5353
- [x] :arrows_counterclockwise: **Smart contracts interactions** (read/write)
5454
- [x]**Infura support**
55-
- [x]**Parsing TxPool** content into native values (ethereum addresses and transactions) - easy to get pending transactions
55+
- [x]**Parsing TxPool** content into native values (Ethereum addresses and transactions) - easy to get pending transactions
5656
- [x] 🖇 **Event loops** functionality
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):
@@ -66,7 +66,7 @@
6666

6767
## Installation
6868

69-
### Swift Package (Recommended)
69+
### Swift Package
7070
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.
7171

7272
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`.
@@ -89,30 +89,45 @@ import Web3Core
8989

9090
### CocoaPods
9191

92-
[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:
92+
CocoaPods is not supported.
9393

94-
```bash
95-
$ sudo gem install cocoapods
94+
### Create Web3 Provider
95+
Currently, web3swift supports only HTTP providers. WebSocket provider support was removed and is planned to be rebuilt from scratch.
96+
To create a Web3HttpProvider you only need an RPC URL:
97+
```swift
98+
try await Web3HttpProvider(url: rpcUrl)
9699
```
97100

98-
To integrate web3swift into your Xcode project using CocoaPods, specify it in your `Podfile`:
101+
But if you know chain ID upfront it's better to specify one as well as with chain ID, the initializer won't have to ask the RPC for it and thus you guarantee that the initializer completes successfully without any asynchronous calls, considering your URL using `http/s` scheme:
102+
```swift
103+
let optionalChainId: Networks = .Custom(networkID: 42)
104+
try await Web3HttpProvider(url: rpcUrl, network: optionalChainId)
105+
```
99106

100-
```ruby
101-
source 'https://github.com/CocoaPods/Specs.git'
102-
platform :ios, '13.0'
107+
Specify a keystore manager for the Web3HttpProvider if you want `web3.personal` namespace to work as it relies on use of the keystore:
108+
```swift
109+
try await Web3HttpProvider(url: rpcUrl, network: optionalChainId, keystoreManager: optionalKeystoreManager)
110+
```
103111

104-
target '<Your Target Name>' do
105-
use_frameworks!
106-
pod 'web3swift'
107-
end
112+
### Create Web3 Object
113+
Creating a Web3 object is quite simple once you have a Web3 HTTP provider:
114+
```swift
115+
Web3(provider: provider)
108116
```
109117

110-
Then, run the following command:
111-
```bash
112-
$ pod install
118+
Or if you are a user of Infura:
119+
```swift
120+
try await Web3.InfuraMainnetWeb3(accessToken: optionalInfuraToken)
121+
try await Web3.InfuraGoerliWeb3(accessToken: optionalInfuraToken)
113122
```
114123

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.
124+
If you have a URL or you are using Infura you can use the following:
125+
```swift
126+
try await Web3.new(url, network: chainIdHere)
127+
// or
128+
let web3 = try await Web3.InfuraMainnetWeb3(accessToken: optionalInfuraToken)
129+
let web3 = try await Web3.InfuraGoerliWeb3(accessToken: optionalGoerliToken)
130+
```
116131

117132
### Send Ether
118133
```swift
@@ -152,6 +167,7 @@ func feeHistory(blockCount: UInt, block: BlockNumber, percentiles:[Double]) asyn
152167
return response.result
153168
}
154169
```
170+
155171
## Build from source
156172
### SPM
157173
```bash
@@ -166,7 +182,7 @@ swift build
166182
- Swift 5.5
167183

168184
## Documentation
169-
Documentation is under construction👷🏻👷🏼‍♀️. We’re trying our best to comment all public API as detailed as we can, but the end it still far to come. But in one of the nearest minor updates we’ll bring DocC support of already done amount of docs. And your PR in such are more than welcome.
185+
Documentation is under construction👷🏻👷🏼‍♀️. We’re trying our best to comment on all public APIs as detailed as possible, but the end is still far to come. But in one of the nearest minor updates we’ll bring DocC support of already done amount of docs. And your PR in such are more than welcome.
170186

171187
## Projects that are using web3swift
172188
Please take a look at [Our customers](https://github.com/web3swift-team/web3swift/wiki/Our-Customers) wiki page.
@@ -180,7 +196,7 @@ Please take a look at [Our customers](https://github.com/web3swift-team/web3swif
180196
- If you **found a bug**, [open an issue](https://github.com/web3swift-team/web3swift/issues).
181197

182198
## Development
183-
To do local development and run the local tests, we recommend to use [ganache](https://github.com/trufflesuite/ganache) which is also used by CI when running github actions.
199+
To do local development and run the local tests, we recommend using [ganache](https://github.com/trufflesuite/ganache) which is also used by CI when running GitHub actions.
184200

185201
```cli
186202
// To install
@@ -195,24 +211,24 @@ Make sure that `ganache` is running on its default port `8546`. To change the po
195211

196212
### Before you commit
197213

198-
We are using [pre-commit](https://pre-commit.com) to run validations locally before a commit is created. Please, install pre-commit and run `pre-commit install` from project's root directory. After that before every commit git hook will run and execute `codespell`, `swiftlint` and other checks.
214+
We are using [pre-commit](https://pre-commit.com) to run validations locally before a commit is created. Please, install pre-commit and run `pre-commit install` from the project's root directory. After that before every commit git hook will run and execute `codespell`, `swiftlint` and other checks.
199215

200216
## Contribute
201217
Want to improve? It's awesome:
202-
Then good news for you: **We are ready to pay for your contribution via [@gitcoin bot](https://gitcoin.co/grants/358/web3swift)!**
218+
The good news for you: **We are ready to pay for your contribution via [@gitcoin bot](https://gitcoin.co/grants/358/web3swift)!**
203219

204220
- If you **have a feature request**, [open an issue](https://github.com/web3swift-team/web3swift/issues).
205221
- If you **want to contribute**, [submit a pull request](https://github.com/web3swift-team/web3swift/pulls).
206222

207223
### Contribution
208-
1. You are more than welcome to participate and get bounty by contributing! **Your contribution will be paid via [@gitcoin Grant program](https://gitcoin.co/grants/358/web3swift).**
224+
1. You are more than welcome to participate and get a bounty by contributing! **Your contribution will be paid via [@gitcoin Grant program](https://gitcoin.co/grants/358/web3swift).**
209225
2. Find or create an [issue](https://github.com/web3swift-team/web3swift/issues)
210226
3. You can find open bounties in [Gitcoin Bounties](https://gitcoin.co/explorer?applicants=ALL&keywords=web3swift&order_by=-web3_created) list
211-
4. Commita fix or a new feature in branch, push your changes
227+
4. Commita fix or a new feature in a branch, push your changes
212228
5. [Submit a pull request to **develop** branch](https://github.com/web3swift-team/web3swift/pulls)
213-
1. Please, provide detailed description to it to help us proceed it faster.
229+
1. Please, provide a detailed description of it to help us proceed faster.
214230

215-
[@skywinder](https://github.com/skywinder) are charged with open-sourсe and do not require money for using web3swift library.
231+
[@skywinder](https://github.com/skywinder) are charged with open-sourсe and do not require money to use the web3swift library.
216232
We want to continue to do everything we can to move the needle forward.
217233

218234
- **Support us** via [@gitcoin Grant program](https://gitcoin.co/grants/358/web3swift)

Sources/Web3Core/Utility/BigUInt+Extension.swift

-6
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,3 @@ public extension BigUInt {
1313
self = value
1414
}
1515
}
16-
17-
#if COCOAPODS
18-
extension BigUInt {
19-
var isZero: Bool { self == 0 }
20-
}
21-
#endif

Web3Core.podspec

-19
This file was deleted.

web3swift.podspec

-22
This file was deleted.

0 commit comments

Comments
 (0)