Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
yaroslavyaroslav committed Feb 9, 2023
2 parents edfe624 + 70202c1 commit cc076ee
Show file tree
Hide file tree
Showing 89 changed files with 1,425 additions and 1,633 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- master
- develop
- hotfix
- unstable
paths:
- Packag*.swift
- web3swift.podspec
Expand All @@ -20,6 +19,8 @@ on:
- master
- develop
- unstable
# Temporary develop-X.Y.Z branches may be added and removed from here as we release new versions
- develop-4.0

env:
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
Expand All @@ -32,7 +33,12 @@ jobs:
group: spm-${{ github.run_id }}
cancel-in-progress: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Discover typos
run: |
pip3 install --upgrade pip
pip3 install codespell
codespell --count --ignore-words-list=ans,deriver,inout,packag --skip="*.js,*WordLists.swift"
- name: Resolve dependencies
run: swift package resolve
- name: Build
Expand Down
12 changes: 6 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
- `subscribeOnLogs` method with specific contract address is not working!!!! [\#366](https://github.com/skywinder/web3swift/issues/366)
- EthereumContract with Custom ABI returns nil [\#342](https://github.com/skywinder/web3swift/issues/342)
- Error on running tests [\#290](https://github.com/skywinder/web3swift/issues/290)
- Serialisation of BIP32 misplaced address postition [\#257](https://github.com/skywinder/web3swift/issues/257)
- Serialisation of BIP32 misplaced address position [\#257](https://github.com/skywinder/web3swift/issues/257)
- Xcode 10.2.1 carthage update hangs while building web3swift.xcodeproj [\#197](https://github.com/skywinder/web3swift/issues/197)

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

- BigInt 3.1 [\#207](https://github.com/skywinder/web3swift/issues/207)
- 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)
- 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)
- How do I fetch information such as balance, decimal,symbol and name of ERC20token ? [\#199](https://github.com/skywinder/web3swift/issues/199)
- Starscream 3.1.0 not compatible with Swift 5.0 [\#195](https://github.com/skywinder/web3swift/issues/195)
- How to Connect infuraWebsocket and subsribe perticular event in swift? [\#193](https://github.com/skywinder/web3swift/issues/193)
- How to Connect infuraWebsocket and subsribe particular event in swift? [\#193](https://github.com/skywinder/web3swift/issues/193)
- Use of unresolved identifier 'Wallet' [\#192](https://github.com/skywinder/web3swift/issues/192)
- V in Signed Message Hash not being calculated properly [\#191](https://github.com/skywinder/web3swift/issues/191)
- Not possible to calculate fast, normal and cheap transaction fee ? [\#190](https://github.com/skywinder/web3swift/issues/190)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ class WalletViewController: UIViewController {
let manager = KeystoreManager([myWeb3KeyStore])
let address = keystore?.addresses?.first
#if DEBUG
print("Address :::>>>>> ", address as Any)
print("Address :::>>>>> ", manager.addresses as Any)
print("Address :::>>>>> ", address)
print("Address :::>>>>> ", manager.addresses)
#endif
let walletAddress = manager.addresses?.first?.address
self.walletAddressLabel.text = walletAddress ?? "0x"

print(walletAddress as Any)
print(walletAddress)
} else {
print("error")
}
Expand All @@ -115,7 +115,7 @@ class WalletViewController: UIViewController {
}
func importWalletWith(mnemonics: String) {
let walletAddress = try? BIP32Keystore(mnemonics: mnemonics , prefixPath: "m/44'/77777'/0'/0")
print(walletAddress?.addresses as Any)
print(walletAddress?.addresses)
self.walletAddressLabel.text = "\(walletAddress?.addresses?.first?.address ?? "0x")"

}
Expand All @@ -137,15 +137,15 @@ extension WalletViewController {
self._mnemonics = tMnemonics
print(_mnemonics)
let tempWalletAddress = try? BIP32Keystore(mnemonics: self._mnemonics , prefixPath: "m/44'/77777'/0'/0")
print(tempWalletAddress?.addresses?.first?.address as Any)
print(tempWalletAddress?.addresses?.first?.address)
guard let walletAddress = tempWalletAddress?.addresses?.first else {
self.showAlertMessage(title: "", message: "We are unable to create wallet", actionName: "Ok")
return
}
self._walletAddress = walletAddress.address
let privateKey = try tempWalletAddress?.UNSAFE_getPrivateKeyData(password: "", account: walletAddress)
#if DEBUG
print(privateKey as Any, "Is the private key")
print(privateKey, "Is the private key")
#endif
let keyData = try? JSONEncoder().encode(tempWalletAddress?.keystoreParams)
FileManager.default.createFile(atPath: userDir + "/keystore"+"/key.json", contents: keyData, attributes: nil)
Expand Down
47 changes: 26 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# web3swift
**web3swift** is an iOS toolbelt for interaction with the Ethereum network.

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

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

- [Core features](#core-features)
- [Installation](#installation)
- [CocoaPods](#cocoapods)
- [Swift Package](#swift-package)
- [CocoaPods](#cocoapods)
- [Example usage](#example-usage)
- [Send Ether](#send-ether)
- [Contract read method](#contract-read-method)
Expand Down Expand Up @@ -57,7 +57,7 @@
- [x] 🕵️‍♂️ Possibility to **add or remove "middleware" that intercepts**, modifies and even **cancel transaction** workflow on stages "before assembly", "after assembly" and "before submission"
- [x]**Literally following the standards** (BIP, EIP, etc):
- [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)**
- [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)
- [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)
- [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
- [x] **RLP encoding**
- [x] Base58 encoding scheme
Expand All @@ -66,6 +66,27 @@

## Installation

### Swift Package (Recommended)
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.

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`.
```swift
dependencies: [
.package(url: "https://github.com/web3swift-team/web3swift.git", .upToNextMajor(from: "3.0.0"))
]
```

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).


## Example usage
In the imports section:

```swift
import web3swift
import Web3Core
```

### CocoaPods

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

### Swift Package
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.

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`.
```swift
dependencies: [
.package(url: "https://github.com/web3swift-team/web3swift.git", .upToNextMajor(from: "3.0.0"))
]
```

## Example usage
In the imports section:

```swift
import web3swift
import Web3Core
```
> **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.
### Send Ether
```swift
Expand All @@ -132,7 +137,7 @@ let response = try await readTX.callContractMethod()
let abiString = "[]" // some ABI string
let bytecode = Data.fromHex("") // some ABI bite sequence
let contract = web3.contract(abiString, at: nil, abiVersion: 2)!
let parameters = [...] as [AnyObject]
let parameters: [Any] = [...]
let deployOp = contract.prepareDeploy(bytecode: bytecode, constructor: contract.contract.constructor, parameters: parameters)!
deployOp.transaction.from = "" // your address
deployOp.transaction.gasLimitPolicy = .manual(3000000)
Expand Down
Loading

0 comments on commit cc076ee

Please sign in to comment.