A pure swift Ethereum Web3 library

Overview

CI Status Code Coverage Telegram

⚗️ Web3

Web3.swift is a Swift library for signing transactions and interacting with Smart Contracts in the Ethereum Network.

It allows you to connect to a geth or parity Ethereum node (like Infura) to send transactions and read values from Smart Contracts without the need of writing your own implementations of the protocols.

Web3.swift supports iOS, macOS, tvOS, watchOS and Linux with Swift Package Manager.

Example

Check the usage below or look through the repositories tests.

Why?

There are already some Web3 library out there written in Swift. We know their strengths and weaknesses and for our use case they just didn't work.

Web3.swift was built with modularity, portability, speed and efficiency in mind.

Ok, thank you for the buzzwords. But what does this actually mean?

💾 Modularity

Web3.swift was built to be modular. If you install/use the basic Web3 SPM product, you get access to the most basic functions like transaction signing and interacting with an http rpc server.
If you want to add support for IPC rpc or something else, you can simple create a library which depends on Web3 and implements this exact functionality. More about that later.
If you want to use PromiseKit extensions for the web3 calls, you can either use the provided PromiseKit SPM product or create your own.
If you want to conveniently parse JSON ABIs for Ethereum Smart Contracts, you can use the provided ABI Parsing SPM product.

Finally, if you want to add functionality to Web3.swift which is not provided yet, you don't have to wait until it gets merged and released in a version bump. You can simple extend/update functionality within you own app as our APIs are made to be very open for changes.
For example, if you want to add a web3 method which is not provided yet by Web3.swift (we will only support Infura supported methods), you only have to add some 3 lines of code (depending on the input and output parameters of the method). Adding IPC rpc support would be only implementing a protocol and answering requests.

Like you can see, everything is possible with Web3.swift.

💻 Portability

One of the main reasons we started working on this project is because we wanted to use it with Swift Package Manager on different platforms.
Because of that, Web3.swift is available through Swift Package Manager on iOS, macOS, tvOS, watchOS and Linux.

Note: For SPM we are only testing iOS, macOS and officially supported Linux distributions (currently Ubuntu 16.04 and 20.04) but it should be compatible with all little endian systems which are able to compile the Swift Compiler, Foundation and Glibc.

Speed and Efficiency

We try to make this library as fast as possible while trying to provide an API which increases your development workflow such that you can focus on building great DAPPS instead of worrying about implementation details.

All our APIs are thread safe and designed to be used in highly concurrent applications.

Installation

Swift Package Manager

Web3 is compatible with Swift Package Manager v5 (Swift 5 and above). Simply add it to the dependencies in your Package.swift.

dependencies: [
    .package(url: "https://github.com/Boilertalk/Web3.swift.git", from: "0.5.0")
]

And then add it to your target dependencies:

targets: [
    .target(
        name: "MyProject",
        dependencies: [
            .product(name: "Web3", package: "Web3"),
            .product(name: "Web3PromiseKit", package: "Web3"),
            .product(name: "Web3ContractABI", package: "Web3"),
        ]
    ),
    .testTarget(
        name: "MyProjectTests",
        dependencies: ["MyProject"])
]

Note: Web3PromiseKit and Web3ContractABI are optional and you only have to put them into your target dependencies (and later import them) if you want to use them.

After the installation you can import Web3 in your .swift files.

import Web3

// Optional
import Web3PromiseKit
import Web3ContractABI

CocoaPods and Carthage

Because of an internal decision, we stopped supporting any Package Managers other than SPM starting with version 0.5.0.

To elaborate a little on this decision: With XCode 11 and Swift 5.1 we reached a point with Swift Package Manager where it slowly started making other package managers irrelevant. You could already load all your dependencies in the XCode project with Swift Package Manager.
With more updates it became even more prelevant. Cocoapods and Carthage maintainers lost interest into their project and stopped maintaining it. There are many unresolved issues, many problems especially for library developers with Cocoapods.

So much hassle for no real gain. Users can already put dependencies which support SPM into their XCode project. So why bother?

The answer is simple. Some still use XCode < 11 and some library developers depend on Web3 in their own Pods/Carthages.

The decision was hard and took some time. But after seeing that the last version was very stable and used in many production apps already, we decided to start with this move now.
XCode 10 is already more than 2 years old. Most projects already upgraded, the ones which didn't have a much bigger problem than Web3.swift not making Updates for Cocoapods...
Library owners depending on Web3.swift are encouraged to drop Cocoapods and Carthage Support as well.

SPM is the Future. For all Cocoapods and Carthage Users who use it because many libraries did not switch to SPM yet: You can still add Web3.swift as a SPM product into your .xcworkspace or .xcodeproj and keep all your other dependencies inside Cocoapods/Carthage. But still. We encourage you to switch with as many dependencies as possible to SPM. Better sooner than later. See the next section on how to do this.

XCode

Using XCode 11 or later (for iOS, macOS or other Apple platforms) you can add SPM packages very easy.

In Xcode, select your project, from the Dropdown select the project, not a single Target, in the Tabs select Swift Packages.
Then you can click the + icon and put in the URL to this repository (https://github.com/Boilertalk/Web3.swift).
Now you can select all products and just click Next until the dependency was added.

That's it. If you push your changes even your CI will not make any problems. No hassles with outdated spec repositories, no problems with some weird linker errors which only occur sometimes/with some dependencies.

If you need further guidance, join our Telegram group and we will help you. https://t.me/web3_swift

Usage

Interaction with an Ethereum node

With Web3.swift you can use an Ethereum node on a server to communicate with Ethereum.
You can send signed transactions, read contract data, call contract functions and much more.

The base class for all available methods is Web3. You can, for example, instantiate it with an http provider:

let web3 = Web3(rpcURL: "https://mainnet.infura.io/<your_infura_id>")

All web3_ methods are available directly from the Web3 struct. The net_ methods are available under the net struct in the web3 struct. The eth_ methods are available under the eth struct in the web3 struct.

Please see the examples below

Note: For the examples to work you need to import Web3 and PromiseKit first

Request web3_clientVersion

Returns the current client version.

Parameters

none

Returns

String - The current client version

firstly {
    web3.clientVersion()
}.done { version in
    print(version)
}.catch { error in
    print("Error")
}

Request net_version

Returns the current network id.

Parameters

none

Returns

String - The current network id

firstly {
    web3.net.version()
}.done { version in
    print(version)
}.catch { error in
    print("Error")
}

Request net_PeerCount

Returns number of peers currently connected to the client.

Parameters

none

Returns

EthereumQuantity - BigInt of the number of connected peers.

firstly {
    web3.net.peerCount()
}.done { ethereumQuantity in
    print(ethereumQuantity.quantity)
}.catch { error in
    print("Error")
}

Send raw transaction

Creates new message call transaction or a contract creation for signed transactions.

Parameters

  1. EthereumTransaction: The signed transaction

Returns

EthereumData, 32 Bytes - The transaction hash, or the zero hash if the transaction is not yet available

To send some ETH you first need to get the current transaction count of the sender (nonce), create the transaction, sign it and then send it.

let privateKey = try! EthereumPrivateKey(hexPrivateKey: "0xa26da69ed1df3ba4bb2a231d506b711eace012f1bd2571dfbfff9650b03375af")
firstly {
    web3.eth.getTransactionCount(address: privateKey.address, block: .latest)
}.then { nonce in
    let tx = try EthereumTransaction(
        nonce: nonce,
        gasPrice: EthereumQuantity(quantity: 21.gwei),
        gas: 21000,
        to: EthereumAddress(hex: "0xC0866A1a0ed41e1aa75c932cA3c55fad847fd90D", eip55: true),
        value: EthereumQuantity(quantity: 1.eth)
    )
    return try tx.sign(with: privateKey, chainId: 1).promise
}.then { tx in
    web3.eth.sendRawTransaction(transaction: tx)
}.done { hash in
    print(hash)
}.catch { error in
    print(error)
}

Request block transaction count by block number

firstly {
    web3.eth.getBlockTransactionCountByNumber(block: .block(5397389))
}.done { count in
    print(count) // 88
}.catch { error in
    print(error)
}

More examples

For more examples either read through our test cases, the Web3 struct or the official Ethereum JSON RPC documentation.

Contract ABI interaction

We are providing an optional module for interaction with smart contracts. To use it you have to add Web3ContractABI to your target dependencies in your Podfile (for SPM). Make sure you check out the installation instructions first.

We are providing two different options to create contract abi interfaces in Swift. Either you define your functions and events manually (or use one of our provided interfaces like ERC20 or ERC721). Or you parse them from the JSON ABI representation just like in web3.js.

Static Contracts

Static contracts are classes implementing StaticContract. They provide a set of functions and events they want to use from the original smart contract. Check out our provided static contracts as a starting point (ERC20 or ERC721).

Our static ERC20 interface is called GenericERC20Contract, the ERC721 contract is called GenericERC721Contract. Both can be subclassed to add more functions for custom contracts.

With those StaticContract types you can create and use your contract like in the following example (We are using PromiseKit again in our examples).

let web3 = Web3(rpcURL: "https://mainnet.infura.io/<your_infura_id>")

let contractAddress = try EthereumAddress(hex: "0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0", eip55: true)
let contract = web3.eth.Contract(type: GenericERC20Contract.self, address: contractAddress)

// Get balance of some address
firstly {
    try contract.balanceOf(address: EthereumAddress(hex: "0x3edB3b95DDe29580FFC04b46A68a31dD46106a4a", eip55: true)).call()
}.done { outputs in
    print(outputs["_balance"] as? BigUInt)
}.catch { error in
    print(error)
}

// Send some tokens to another address (locally signing the transaction)
let myPrivateKey = try EthereumPrivateKey(hexPrivateKey: "...")
firstly {
    web3.eth.getTransactionCount(address: myPrivateKey.address, block: .latest)
}.then { nonce in
    try contract.transfer(to: EthereumAddress(hex: "0x3edB3b95DDe29580FFC04b46A68a31dD46106a4a", eip55: true), value: 100000).createTransaction(
        nonce: nonce,
        from: myPrivateKey.address,
        value: 0,
        gas: 100000,
        gasPrice: EthereumQuantity(quantity: 21.gwei)
    )!.sign(with: myPrivateKey).promise
}.then { tx in
    web3.eth.sendRawTransaction(transaction: tx)
}.done { txHash in
    print(txHash)
}.catch { error in
    print(error)
}

// Send some tokens to another address (signing will be done by the node)
let myAddress = try EthereumAddress(hex: "0x1f04ef7263804fafb839f0d04e2b5a6a1a57dc60", eip55: true)
firstly {
    web3.eth.getTransactionCount(address: myAddress, block: .latest)
}.then { nonce in
    try contract.transfer(to: EthereumAddress(hex: "0x3edB3b95DDe29580FFC04b46A68a31dD46106a4a", eip55: true), value: 100000).send(
        nonce: nonce,
        from: myAddress,
        value: 0,
        gas: 150000,
        gasPrice: EthereumQuantity(quantity: 21.gwei)
    )
}.done { txHash in
    print(txHash)
}.catch { error in
    print(error)
}

By creating your own interfaces, you can interact with any smart contract!

Dynamic Contracts

If you only have access to the JSON ABI of a smart contract or you don't want to create a static template, you can use our dynamic contract api to parse the json string into a usable contract during runtime. See the example below.

let web3 = Web3(rpcURL: "https://mainnet.infura.io/<your_infura_id>")

let contractAddress = try EthereumAddress(hex: "0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0", eip55: true)
let contractJsonABI = "<your contract ABI as a JSON string>".data(using: .utf8)!
// You can optionally pass an abiKey param if the actual abi is nested and not the top level element of the json
let contract = try web3.eth.Contract(json: contractJsonABI, abiKey: nil, address: contractAddress)

print(contract.methods.count)

// Get balance of some address
firstly {
    try contract["balanceOf"]!(EthereumAddress(hex: "0x3edB3b95DDe29580FFC04b46A68a31dD46106a4a", eip55: true)).call()
}.done { outputs in
    print(outputs["_balance"] as? BigUInt)
}.catch { error in
    print(error)
}

// Send some tokens to another address (locally signing the transaction)
let myPrivateKey = try EthereumPrivateKey(hexPrivateKey: "...")
guard let transaction = contract["transfer"]?(EthereumAddress.testAddress, BigUInt(100000)).createTransaction(nonce: 0, from: myPrivateKey.address, value: 0, gas: 150000, gasPrice: EthereumQuantity(quantity: 21.gwei)) else {
    return
}
let signedTx = try transaction.sign(with: myPrivateKey)

firstly {
    web3.eth.sendRawTransaction(transaction: signedTx)
}.done { txHash in
    print(txHash)
}.catch { error in
    print(error)
}

Using this API you can interact with any smart contract in the Ethereum Network!

For more examples, including contract creation (constructor calling) check out our tests.

Common errors

Couldn't parse ABI Object

If you are getting this error when parsing your ABI from a json, it may be because your contract has a fallback function. To solve it, remove the fragment of your ABI that has the information about the fallback function. The part you should remove might look like this:

{
    "payable": false,
    "stateMutability": "nonpayable",
    "type": "fallback"
},

Disclaimer

Until we reach version 1.0.0 our API is subject to breaking changes between minor version jumps. This is to make sure we can focus on providing the best implementation while we are in heavy development instead of trying to maintain something which is deprecated.

That being said, we will try to minimize breaking changes. Most certainly there won't be many.

Author

The awesome guys at Boilertalk ⚗️
...and even more awesome members from the community 💜

Check out the contributors list for a complete list.

License

Web3 is available under the MIT license. See the LICENSE file for more info.

Comments
  • Fix conversion of odd length hex strings to bytes

    Fix conversion of odd length hex strings to bytes

    Previously 0xF would fail while 0x0F would succeed. This PR essentially just appends a leading zero to normalize the string when necessary. Also adds some unit tests to verify it works in all the scenarios.

    opened by pixelmatrix 9
  • Swift 5. Updated pods. Moved sign functions to Keychain

    Swift 5. Updated pods. Moved sign functions to Keychain

    Updated PR with compatibility with Swift 5 only.

    Also moved EthereumPrivateKey and EthereumPublicKey to own package. For someone who wants to use the library with own signature/key management parts. Enabled by default for CocoaPods.

    opened by ypopovych 7
  • Added more methods. Cleaned Xcode 10.2 warnings. Implemented filters

    Added more methods. Cleaned Xcode 10.2 warnings. Implemented filters

    Changes In this PR:

    1. Swift 4.2
    2. No warnings in Xcode 10.2
    3. More Web3 methods (personal, signTypedData)
    4. Typed Data (EIP-712)
    5. Filters via polling (for Infura)
    opened by ypopovych 7
  • Missing Web3+HTTPInitializer.swift

    Missing Web3+HTTPInitializer.swift

    I install via cocoapods and pod directory seem missing Web3+HTTPInitializer.swift and Web3HttpProvider.swift so that Web3(rpcURL: "https://mainnet.infura.io/<your_infura_id>") does not work

    opened by iBinh 7
  • Add ABI and Contract modules to Web3.swift

    Add ABI and Contract modules to Web3.swift

    An interface for interacting with Solidity contracts similar to web3.js

    Features

    • [x] Import Solidity contracts from JSON
    • [x] Call constant contract methods
    • [x] Transact with payable and nonpayable contract methods
    • [x] Encode Solidity values
    • [x] Decode Solidity values
    • [x] Decode Events from EthereumLogObjects
    • [x] Estimate gas for a given method
    • [ ] getPastLogs from a contract instance
    • [ ] watch for events
    • [ ] Filter events by indexed properties
    opened by pixelmatrix 7
  • EthereumTransactionReceiptObject cannot always be decoded

    EthereumTransactionReceiptObject cannot always be decoded

    I'm doing a transaction and then calling web3.eth.getTransactionReceipt(hash) and I found a couple of issues.

    1. It seems that most of the time the EthereumTransactionReceiptObject can't be decoded because it's assuming EthereumLogObject always has the removed property. I'm not sure why, but i'm not seeing that value coming back in the logs. Changing that property to an optional value causes it to work for me.

    2. The Promise extension for this method uses seal.resolve(rpc.result, rpc.error). When the rpc response includes a null result, it ends up calling 1seal.resolve(nil, nil)`, which PromiseKit views as an error since it can't infer if it was fulfilled or rejected. As a workaround for now, i'm just allowing that to return the PMKError, and catching on that, but it's not actually an error. Not a huge issue, but just thought i'd highlight that strange behavior.

    bug 
    opened by pixelmatrix 7
  • Contract ABI fallback functions

    Contract ABI fallback functions

    The ABIObject always expect inputs, which is not correct if the contract contains a fallback function, a possible fix would be changing the parameters to be optional

    bug 
    opened by Nixsm 5
  • String.hexBytes() suggestion

    String.hexBytes() suggestion

    I've encountered a few instances where string.hexBytes() threw an error because the value was not divisible by 2. It looks like the root of the issue is that hex can actually be represented with or without a leading zero, and String.init(_:, radix:) returns the most compact format.

    A quick example using the Swift console:

     > String(4095, radix: 16)
    $R19: String = "fff"
     > 0xfff
    $R20: Int = 4095
    > 0x0fff
    $R21: Int = 4095
    

    Since you're iterating over the string in 2 character increments it makes sense that the string should be divisible by 2. My suggestion would be to append a zero if it's not already divisible by two instead of throwing an error so that it is more flexible.

    bug 
    opened by pixelmatrix 5
  • Improve Web3Response API

    Improve Web3Response API

    Updates Web3Response to better expose underlying errors and simplify handling of the response. The primary goal was to provide a way to extract more useful errors from the response.

    Prior to these changes, the only errors available were errors returned from the actual Ethereum node via a valid response, when in reality there are a lot of other errors that could occur (for instance in the network layer).

    This PR attempts to keep the simplicity of the API, while adding additional information. Now a Web3Response can be initialized with either an Error, or a Result. There are shortcuts for responding with the RPCResponse and Web3Response.Error (which includes a number of sensible defaults). Getting to the actual result is now much simpler:

    web3.eth.accounts() { response in
         if let result = response.result {
              // We have a result!
         } else if let error = error {
              // We have an error!
         }
    }
    

    or with a switch statement:

    web3.eth.accounts() { response in
        switch response.status {
         case .success(let result):
              // handle success
         case .failure(let error):
              // handle error
         }
    }
    

    This is a breaking change to the standard closure API, but the Promise extensions are not impacted.

    opened by pixelmatrix 5
  • How to get Error Code or Message?

    How to get Error Code or Message?

    Hi, I have been searching for a way to extract the code and message out from the error.

    For example:- Error: Error(code: -32000, message: "insufficient funds for gas * price + value")

    How can I get the Code and the Message?

    opened by voyage11 4
  • Error: Ambiguous reference to member 'firstly(execute:)'

    Error: Ambiguous reference to member 'firstly(execute:)'

    Hi, I am trying to test the "Send raw transaction" example Link Unfortunately I always get an error: "Ambiguous reference to member 'firstly(execute:)'".

        class func transaction(privateKey: String, to: String) {
            let web3 = Web3(rpcURL: "http://XXXX:XXXX")
            let privateKeyTwo = try! EthereumPrivateKey(hexPrivateKey: privateKey)
            firstly {
                web3.eth.getTransactionCount(address: getPrivateKey(privateKey: privateKey), block: .latest)
                } .then { nonce in
                    let tx = createTx(nonce: nonce, to: to)
                    return try tx.sign(with: privateKeyTwo, chainId: 1).promise
                } .then { tx in
                    web3.eth.sendRawTransaction(transaction: tx)
                } .done { hash in
                    print(hash)
                } .catch {error in
                    print("error: \(error)")
                }
        }
    
    opened by mscilab 4
  • Handle case of single parameter outputs returning empty string

    Handle case of single parameter outputs returning empty string

    In cases where a ingle output function (such as function name() returns (string) returns an empty result, ABIDecoding now fails in https://github.com/Boilertalk/Web3.swift/blob/master/Sources/ContractABI/ABI/ABIDecoder.swift#L96, as the output is empty

    This seems like a regression/fix introduced in https://github.com/Boilertalk/Web3.swift/pull/135/files

    The proposed 'fix' here is to treat single output tuples as just single outputs, not sure if that is always accurate though.

    Please feel free to comment if you have alternate suggestions. This 'fix' does seem to work in my app

    opened by kohlivarun5 0
  • sendRawTransaction   Send a transaction error

    sendRawTransaction Send a transaction error

    couldn't retrieve sender address ('') from the ethereum transaction: invalid chain id for signer: tx intended signer does not match the given signer: tx intended signer does not match the given signer

    opened by dengbangquan 3
  • Can signtypeddata be supported?eip712 signatures problem

    Can signtypeddata be supported?eip712 signatures problem

    Signtypeddata doesn't have this method. Can it be implemented like web3.js? Can eip712 signatures be like Web3.js? Is there a demo for eip712 signature ?thank you

    opened by xhzth70911 1
  • Dynamic array's encode/decode issue

    Dynamic array's encode/decode issue

    now the dynamic array's encoding logic is to encode every item, then concat the hex string follow the length encoded hex.:

    public func abiEncodeDynamic() -> String? {
        // get values
        let values = self.compactMap { value -> String? in
            return value.abiEncode(dynamic: true)
        }
        // number of elements in the array, padded left
        let length = String(values.count, radix: 16).paddingLeft(toLength: 64, withPad: "0")
        // values, joined with no separator
        return length + values.joined()
    }
    

    but follw the document: https://docs.soliditylang.org/en/v0.8.13/abi-spec.html#formal-specification-of-the-encoding it seems that the dynamic array's encoded data should have extra bytes between length hex and item's hex, to represent the dynamic item's data location.

    for example: I want to encode a dynamic array of 4 datas:

    let testArr = [
        Data.init(hex: "0x01"),
        Data.init(hex: "0x02"),
        Data.init(hex: "0x03"),
        Data.init(hex: "0x04")
    ]
    
    let testData = testArr.abiEncode(dynamic: true)
    

    the testData now is this:

    0000000000000000000000000000000000000000000000000000000000000004
    
    0000000000000000000000000000000000000000000000000000000000000001
    0100000000000000000000000000000000000000000000000000000000000000
    
    0000000000000000000000000000000000000000000000000000000000000001
    0200000000000000000000000000000000000000000000000000000000000000
    
    0000000000000000000000000000000000000000000000000000000000000001
    0300000000000000000000000000000000000000000000000000000000000000
    
    0000000000000000000000000000000000000000000000000000000000000001
    0400000000000000000000000000000000000000000000000000000000000000
    

    it seems should add the extra bytes like this:

    0000000000000000000000000000000000000000000000000000000000000004
    
    0000000000000000000000000000000000000000000000000000000000000080
    00000000000000000000000000000000000000000000000000000000000000c0
    0000000000000000000000000000000000000000000000000000000000000100
    0000000000000000000000000000000000000000000000000000000000000140
    
    0000000000000000000000000000000000000000000000000000000000000001
    0100000000000000000000000000000000000000000000000000000000000000
    
    0000000000000000000000000000000000000000000000000000000000000001
    0200000000000000000000000000000000000000000000000000000000000000
    
    0000000000000000000000000000000000000000000000000000000000000001
    0300000000000000000000000000000000000000000000000000000000000000
    
    0000000000000000000000000000000000000000000000000000000000000001
    0400000000000000000000000000000000000000000000000000000000000000
    

    I was trying to send a eth_call with dynamic array's encoded data but got error. after add the extra bytes. the call is success.

    is there any wrong usage of me or any missunderstanding?

    opened by Crypto-Doby 2
Releases(0.8.0)
  • 0.8.0(Nov 17, 2022)

  • 0.7.4(Nov 2, 2022)

  • 0.7.3(Nov 1, 2022)

    • Fixed an issue where the WebSocket provider went into a pseudo deadlock state and took 4-5 seconds to process one request when used in highly concurrent applications (~100-200 req or more at the same time).
    Source code(tar.gz)
    Source code(zip)
  • 0.7.2(Oct 31, 2022)

    • Fixed a WebSocket bug for concurrent requests
    • Switched from DispatchGroup to DispatchSemaphore for WebSocket waits for more robust and performant concurrent behaviour
    Source code(tar.gz)
    Source code(zip)
  • 0.7.1(Oct 30, 2022)

  • 0.7.0(Oct 29, 2022)

    Features

    • Added Bidirectional Providers
      • Added WebSocket Provider
    • Added Subscriptions to common events (available for bidirectional providers)

    Bug Fixes

    • Removed indirect dependency from Web3ContractABI to Web3PromiseKit
    Source code(tar.gz)
    Source code(zip)
  • 0.6.1(Oct 12, 2022)

  • 0.6.0(Oct 5, 2022)

    This version upgrades our dependencies, removes warnings and includes support of EIP1559 transactions.

    There is one minor breaking change in EthereumTransaction and its initializer. We renamed gas to gasLimit to be in line with naming conventions throughout the library and throughout the Web3 ecosystem.

    Source code(tar.gz)
    Source code(zip)
  • 0.5.0(Oct 1, 2020)

    This Version adds support for the newest SPM version as well as some Bug fixes and minor tweaks.

    From now on we only officially support Swift Package Manager (though for all platforms where Swift is available). More on that decision in the README.

    Source code(tar.gz)
    Source code(zip)
  • 0.4.2(Oct 1, 2020)

  • 0.4.1(Jul 7, 2019)

  • 0.4.0(Jul 7, 2019)

    This version adds support for Swift 5 and fixes warnings generated from the Swift 5 compiler.

    Versions below Swift 5 are officially not supported after this release.

    • Removed BytesInitializable initializer parameter label so it matches the Swift stdlib
    Source code(tar.gz)
    Source code(zip)
  • 0.3.1(Sep 1, 2018)

    This version is a bug fix only release and contains the following fixes:

    • Fixed an error where the decoder crashed on some wrong inputs instead of throwing an error (#44, #45)
    • Make JSON-RPC error fields accessible (#47)
    • Add an overloaded method to deploy a contract using an array of ABIEncodable (#49)
    • Fixed an error with parsing contract ABI fallback functions (#48, #50)
    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(Jun 24, 2018)

    This version contains the following changes:

    • Native static and dynamic Contract ABI parsing

    • Interaction with smart contracts, the easy way

    • Static ERC20 and ERC721 contract interfaces out of the box

    • Syntactic sugar for all PromiseKit extensions

    • Bug fixes...

    Source code(tar.gz)
    Source code(zip)
  • 0.2.1(Jun 12, 2018)

  • 0.2.0(Jun 11, 2018)

    This version contains the following changes:

    • Bug fix for enum equatables which led to crashes sometimes
    • Split EthereumTransaction and EthereumSignedTransaction
    • Improve API for Web3Response, conform to major standards (Result?, Error?)
    • Make hex string to bytes decoding less restrictive (allow odd number of digits, assume leading zero)
    Source code(tar.gz)
    Source code(zip)
  • 0.1.1(Jun 9, 2018)

  • 0.1.0(Apr 17, 2018)

    This release includes the following features:

    • Sign/verify transactions
    • Communicate with an Ethereum node like INFURA
    • Interact with Smart Contracts
    • One implementation for different platforms
    • Optional PromiseKit extensions
    Source code(tar.gz)
    Source code(zip)
Owner
null
Ethereum Wallet Toolkit for iOS - You can implement an Ethereum wallet without a server and blockchain knowledge.

Introduction EtherWalletKit is an Ethereum Wallet Toolkit for iOS. I hope cryptocurrency and decentralized token economy become more widely adapted. H

Sung Woo Chang 136 Dec 25, 2022
Ethereum-wallet: 100% native ethereum wallet, created with iOS version of Geth client

Ethereum-wallet: 100% native ethereum wallet, created with iOS version of Geth client

DE MINING 4 Dec 11, 2022
Elegant Web3js functionality in Swift. Native ABI parsing and smart contract interactions on Ethereum network.

You can ask for help in our Discord Channel web3swift Swift implementation of web3.js functionality ⚡ Interaction with remote node via JSON RPC ?? Sma

BANKEX - Proof-of-Asset Protocol 487 Mar 25, 2022
EthereumKit is a free, open-source Swift framework for easily interacting with the Ethereum.

EthereumKit is a Swift framework that enables you to create Ethereum wallet and use it in your app. // BIP39: Generate seed and mnemonic sentence. le

Ryo Fukuda 458 Dec 31, 2022
Web3keystore - Ethereum keystore logic, in Swift

web3keystore A module for creating and interacting with Ethereum keystores. Hand

Brian Wagner 0 Feb 12, 2022
A swift utility to resolve Ethereum Domain Names.

ENSKit A swift utility to resolve Ethereum Domain Names per EIP-137. Examples Initializing: // Use default options with Cloudflare Ethereum Gateway le

null 16 Nov 25, 2022
Wei Wallet - Ethereum wallet app for iOS

Wei Wallet - Ethereum wallet app for iOS Getting Started Download the latest Xcode Clone this repository Install Carthage, Cocoapods Run make bootstra

Popshoot, Inc. 277 Nov 17, 2022
Multi-wallet for Bitcoin, Ethereum, Binance Smart Chain and other emerging blockchains

Multi-wallet for Bitcoin, Ethereum, Binance Smart Chain and other emerging blockchains. Non-custodial storage, decentralized exchange, and extensive analytics for thousands of tokens and NFTs. Implemented on Swift.

Horizontal Systems 446 Jan 3, 2023
Rainbow - 🌈the Ethereum wallet that lives in your pocket

??️ the Ethereum wallet that lives in your pocket! ??️ Available on the iOS App Store. ?? Android Beta available on Google Play Store ??️ Foll

Rainbow 3.2k Jan 3, 2023
An open-source Ethereum wallet built with SwiftUI

lil wallet welcome to lil wallet. it's an open-source Ethereum wallet built with SwiftUI there are two main views - coins and objects. coins are your

Jordan Singer 140 Jan 3, 2023
AlphaWallet - Advanced, Open Source Ethereum Mobile Wallet & dApp Browser for iOS

AlphaWallet - Advanced, Open Source Ethereum Mobile Wallet & dApp Browser for iOS

AlphaWallet 475 Jan 5, 2023
Kukai Crypto Swift is a native Swift library for creating regular or HD wallets for the Tezos blockchain

Kukai Crypto Swift Kukai Crypto Swift is a native Swift library for creating regular and HD key pairs for the Tezos blockchain. Supporting both TZ1 (E

Kukai Wallet 2 Aug 18, 2022
This library provides convenient way to use Coinpaprika.com API in Swift.

Coinpaprika API Swift Client Documentation | Repository | Installation Usage This library provides convenient way to use Coinpaprika.com API in Swift.

Coinpaprika 30 Dec 21, 2021
Full Bitcoin library for iOS, implemented on Swift. SPV wallet implementation for Bitcoin, Bitcoin Cash and Dash blockchains.

BitcoinKit-iOS Bitcoin, BitcoinCash(ABC) and Dash wallet toolkit for Swift. This is a full implementation of SPV node including wallet creation/restor

Horizontal Systems 231 Dec 2, 2022
CryptoSwift - Crypto related functions and helpers for Swift implemented in Swift

CryptoSwift Crypto related functions and helpers for Swift implemented in Swift.

Kushal Shingote 2 Feb 6, 2022
Bitcoin protocol toolkit for Swift

Welcome to BitcoinKit The BitcoinKit library is a Swift implementation of the Bitcoin protocol which support both BCH and BTC. Improving the mobile ec

Yenom - The simplest Bitcoin wallet - 786 Dec 25, 2022
A simple Proof-of-Work Blockchain built in Swift

Blockchain in Swift A simple Proof-of-Work Blockchain built in Swift. Requirements Xcode 13.0 Swift 5.2 Vapor 4.49 Swift NIO 2.33.0 Getting started Cl

Felipe Ricieri 5 Sep 25, 2022
IOTA wallet.rs Swift binding

IOTA wallet.rs Swift Binding Swift binding for the official wallet.rs Rust library for IOTA Ledger. The Swift binding links and communicates with the

Pasquale Ambrosini 5 Jun 13, 2022
Modern Swift implementations of BIP39, BIP32, and BIP44

PLEASE NOTE! This is fork from KevinVitale/WalletKit Due to SPM (Swift package manager) and github restrictions it's impossible to add original KevinV

Alexey Strokin 3 Aug 18, 2022