A swift utility to resolve Ethereum Domain Names.

Related tags

Blockchain ENSKit
Overview

ENSKit

A swift utility to resolve Ethereum Domain Names per EIP-137.

Examples

Initializing:

// Use default options with Cloudflare Ethereum Gateway
let enskit = ENSKit()

// Use Infura Ethereum API
let infuraURL = URL(string: "https://mainnet.infura.io/v3/<projectid>")!
let infura = ENSKit(jsonrpcClient: InfuraEthereumAPI(url: infuraURL))
// Use Infura Ethereum API with project secret
let infuraSecret = "<projectsecret>"
let infuraWithProjectSecret = ENSKit(jsonrpcClient: InfuraEthereumAPI(url: infuraURL, projectSecret: infuraSecret))
// Use Infura Ethereum API with JWT token
let infuraJWT = "<JWT>"
let infuraWithJWT = ENSKit(jsonrpcClient: InfuraEthereumAPI(url: infuraURL, jwt: infuraJWT))

Resolve IPFS/IPNS/Swarm URL:

// in async function
let vitalik = "vitalik.eth"
let vitalikURL: URL? = try await enskit.resolve(name: vitalik)

Get domain avatar as Data:

// in async function
let vitalik = "vitalik.eth"
let vitalikAvatar: Data? = try await enskit.avatar(name: vitalik)

Get domain avatar URL:

// in async function
let vitalik = "vitalik.eth"
if let avatar = try await enskit.getAvatar(name: vitalik) {
    let url: URL? = try await enskit.getAvatarImageURL(avatar: avatar)
}

Get domain email:

// in async function
let coa = "coa.eth"
let text: String? = try await enskit.text(name: coa, key: "email")

License

MIT

You might also like...
AlphaWallet - Advanced, Open Source Ethereum Mobile Wallet & dApp Browser for iOS
AlphaWallet - Advanced, Open Source Ethereum Mobile Wallet & dApp Browser for iOS

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

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

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

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

Bitcoin protocol toolkit for Swift
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

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.

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

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

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

Modern Swift implementations of BIP39, BIP32, and BIP44
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

Comments
  • Feature Request: history of contenthash

    Feature Request: history of contenthash

    It would be awesome if we could fetch the history of all contenthash an ENS has in history.

    Since every historical contenthash is a transaction like this:

    https://etherscan.io/tx/0xaf87d7a73ed79fb063ada2a36ef49e95ca773caa09d6f499345e173a31fc2c2c

    Above is vitalik.eth's latest setContentHash call.

    So if we can get a list of all setContentHash calls, we can have all historical contenthash.

    opened by livid 4
  • add contract history support

    add contract history support

    Supports public resolver histories:

    • contenthash changes
    • addr (Ethereum address only) changes

    As mentioned in #3, not all Ethereum APIs are happy with searching all the blocks for logs. I am testing and adding additional public Ethereum APIs options that fully support searching for logs. Currently, https://api.mycryptoapi.com/eth, https://rpc.flashbots.net/, https://nodes.mewapi.io/rpc/eth are verified working on my network environment.

    References for public Ethereum gateways:

    In addition, modify API to be similar to ethers.js:

    • ENSKit (main entry) provide convenience methods for quick results
    • ENSResolver for advanced usages
      • Also save a few requests when querying multiple records for the same ENS, do not need to get resolver from registry every time
    opened by stdc105 2
  • 0.3.0 release

    0.3.0 release

    • avatar() now returns Data instead of a URL.
      • It's quite difficult for application to handle an avatar stored as an IPFS link. As we already have a way to retrieve content from IPFS gateway, it's better to just use it. If the application is capable of providing an IPFS client implementation, it will be used here.
    • Handle data: URI (supported by ENS avatar spec) in avatar records correctly.
      • URLRequest can resolve data: URI just fine.
    opened by stdc105 0
  • 0.2.0 release

    0.2.0 release

    • Get avatar from ENS domain name per ENSIP-12.

      • avatar() will try to get the avatar image URL by requesting contract and dig into NFT when necessary.
      • To get the original URL stored in ENS registry, use getAvatar(); to get a URL from ENSAvatar by extracting image URL or an NFT, use getAvatarImageURL().
    • Implement a partial contenthash decoder so resolve() will now output IPFS/IPNS/Swarm URL when possible.

      • To get the original binary data stored in ENS registry, use getContentHash(); to decode a contenthash, use getContentHashURL().
    • Implement Cloudflare Ethereum gateway and Infura Ethereum API.

      • User can implement exposed JSONRPC protocol to use their own Ethereum JSONRPC client
    • Implement OpenSea API to retrieve NFT metadata

      • User can implement exposed NFTPlatform protocol to use NFT metadata from other platforms
    • Implement HTTP IPFS gateway to resolve IPFS link.

      • We are using Cloudflare IPFS Gateway as default.
      • Pass a base URL (for example, https://gateway.ipfs.io) to use other vendors.
      • User can implement exposed IPFSClient protocol to use a native IPFS client.
    • Reorganize and refactor code.

    opened by stdc105 0
Owner
null
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
A pure swift Ethereum Web3 library

⚗️ Web3 Web3.swift is a Swift library for signing transactions and interacting with Smart Contracts in the Ethereum Network. It allows you to connect

null 484 Dec 16, 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
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
Trust - Ethereum Wallet and Web3 DApp Browser for iOS

Trust - Ethereum Wallet and Web3 DApp Browser for iOS Welcome to Trust's open source iOS app! Getting Started Download the Xcode 9 release. Clone this

Trust Wallet 1.4k Dec 31, 2022
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