Ensdart - A dart library that wraps the Ethereum Name Service

Related tags

Templates ens_dart
Overview

⚡️ ENS Dart

A dart library that wraps the Ethereum Name Service.

The Ethereum Name Service is analogous to the Domain Name Service. It enables users and developers to use human-friendly names in place of error-prone hexadecimal addresses, content hashes, and more.

  • Interop with web3dart package
  • Get ENS name from ETH address
  • Get address from ENS name
  • Get contentHash
  • Get textRecord
  • Call functions on ENS smart contracts and listen for contract events

Usage

Get ENS name and address

ENS Dart provides an interface to look up an address from a name, the reverse, and more.

Future<void> main() async {
  env.load('../.env');
  final infuraKey = env.env['INFURA_KEY'];

  final rpcUrl = 'https://mainnet.infura.io/v3/$infuraKey';
  final wsUrl = 'wss://mainnet.infura.io/ws/v3/$infuraKey';

  final client = Web3Client(rpcUrl, Client(), socketConnector: () {
    return IOWebSocketChannel.connect(wsUrl).cast<String>();
  });

  /// ENS client
  final ens = Ens(client: client);

  /// Get name from address
  final name = await ens
      .withAddress('0x1a5cdcFBA600e0c669795e0B65c344D5A37a4d5A')
      .getName();

  /// Get address from name
  final addr = await ens.withName('brantly.eth').getAddress();

  /// Get text record
  final textRecord = await ens.getTextRecord();

  print('name: $name'); // addr: 0x324f9307b6d26881822c7c8692eeac39791a9756
  print('addr: $addr'); // name: sea.eth
  print(
      'textRecord: $textRecord');  /* EnsTextRecord {
      email: [email protected],
      url: http://brantly.xyz/,
      avatar: eip155:1/erc721:0xb7F7F6C52F2e2fdb1963Eab30438024864c313F6/2430,
      description: "If anyone would come after me, let him deny himself and take up his cross daily and follow me. For whoever would save his life will lose it, but whoever loses his life for my sake will save it. For what does it profit a man if he gains the whole world and loses or forfeits himself?" - Jesus, Luke 9.23-25,
      notice: Not for sale,
      keywords: ,
      com.discord: brantly.eth#9803,
      com.github: brantlymillegan,
      com.reddit: brantlymillegan,
      com.twitter: brantlymillegan,
      org.telegram: brantlymillegan,
      eth.ens.delegate: https://discuss.ens.domains/t/ens-dao-delegate-applications/815/697?u=brantlymillegan
    } 
}
You might also like...

Imgix package for Dart. Imgix is a CDN service with support for realtime image processing and optimization.

Imgix package for Dart. Imgix is a CDN service with support for realtime image processing and optimization.

Jan 24, 2022

A simple, private tool to help pick a baby name.

A simple, private tool to help pick a baby name.

Nom de Bébé A simple, private tool to help pick a baby name. https://nomdebebe.app/ Motivation I need to choose a name. There's lots of tools and apps

Nov 23, 2022

Change App Package Name for Flutter

Change App Package Name for Flutter Change App Package Name with single command. It makes the process very easy and fast. What It does? Update Android

Dec 13, 2021

Note the place to remember it's name and descriptions along with google map location.

Note the place to remember it's name and descriptions along with google map location.

Note the Place Note the place to remember it's name and descriptions along with map location. View in Web Click here for web view Note: for bettter lo

May 5, 2022

Music-App-Flutter - This is a flutter app which has some songs displayed in the form of a list and user can play any of them by clicking on the name of the song.

Music-App-Flutter - This is a flutter app which has some songs displayed in the form of a list and user can play any of them by clicking on the name of the song.

music_player_app A music player app made by me in flutter About the App This is a music player which i made to play audio files which we have passed i

Apr 1, 2021

Peek & Pop implementation for Flutter based on the iOS functionality of the same name.

peek_and_pop Peek & Pop implementation for Flutter based on the iOS functionality of the same name. Finally, the v1.0.0 release! More fluent, more opt

Dec 17, 2022

Flutter user list calendar - A flutter app that displays registered users on a calendar/list and allows to search for users using the full name

Flutter User Calendar A flutter app that displays registered users on a calendar

Jan 20, 2022

My-First-Flutter-App - Startup Name Generator App with favorites option

My-First-Flutter-App - Startup Name Generator App with favorites option

Startup Name Generator App with 'favorites' option.. This is my first Flutter ap

Jan 21, 2022

It is a Flutter mobile and web application that allows you to search for universities worldwide by name and country.

It is a Flutter mobile and web application that allows you to search for universities worldwide by name and country.

Search Universities App It is a Flutter mobile and web application that allows you to search for universities worldwide by name and country. Data sour

Feb 4, 2022
Comments
  • error when call getName();

    error when call getName();

    Hello,

    I try to call this code await ens.withAddress(_address).getName();

    I get this error Unhandled Exception: RangeError: Value not in range: 32

    I used rpcUrl eth Mainnet..

    opened by hm86z 3
  • RangeError: Value not in range: 32

    RangeError: Value not in range: 32

    Hi

    with call this code (await ens.withName(name).getAddress()).toString(); I get this error _ Unhandled Exception: RangeError: Value not in range: 32_

    opened by HosseinAsadi 3
Owner
Chiziaruhoma Ogbonda
✨Mobile Developer. ✨UI/UX designer. ✨UI Developer. 🚀I build ideas to software. 👨🏾‍💻 I live Flutter.
Chiziaruhoma Ogbonda
Dart web3 - A dart library that connects and interacts with the Ethereum blockchain

dart_web3 A dart library that connects and interact with the Ethereum blockchain

p2bh 9 Sep 13, 2022
Automatically generate profile picture with random first name and background color. But you can still provide pictures if you have them. As the default color, based on the name of the first letter. :fire: :fire: :fire:

FLUTTER PROFILE PICTURE Automatically generate profile picture with random first name and background color. But you can still provide pictures if you

Aditya Dharmawan Saputra 10 Dec 20, 2022
Startup-Name-Generator-App-in-Flutter - Business Startup Name Generator App in Flutter

Business Startup Name Generator App #About APP: A simple mobile app that generat

AHSAN SIDDZ 0 Jan 30, 2022
Home-Service-App - Home Service App Built With Flutter

Home-Service-App Home Service App Sample Images

Justin Roy 2 Sep 4, 2022
Our application, MyArmyPal serves to be an all in one service for our service men.

Our application, MyArmyPal serves to be an all in one service for our service men. It seeks to provide convenience and useful features just one tap away. Its main features include an IPPT Calculator, reservist checklist, customized IPPT training plan according to the user's current fitness level and a canteen order pick up service in all army camps. We are also implementing an anytime Eliss system using computer vision for users to check on their push up form easily.

Poh Wei Pin 3 Jun 17, 2022
Dart API Client which wraps the QvaPay API

qvapay_api_client Dart API Client which wraps the QvaPay API The client needs Dio to perform the requests, you must inject an instance in the construc

QvaPay 7 Nov 2, 2022
Dart package that conveniently wraps an isolate, ports and state for easy isolates.

Isolate Agents Description Isolate Agents adds a new class, Agent, which is a proper implementation of the Actor model for Dart. Where Isolates have n

null 65 Jan 2, 2023
An unofficial Flutter plugin that wraps pusher-websocket-java on Android and pusher-websocket-swift on iOS

Pusher Flutter Client An unofficial Flutter plugin that wraps pusher-websocket-java on Android and pusher-websocket-swift on iOS. Get it from pub. How

HomeX 31 Oct 21, 2022
This Country Selector UI Library written by Dart and Fluter and supports three locales with country's name, achieves lazy loading, and country card animation on listview

Country Selector Widget This Country Selector Widget UI Library written by Dart and Fluter and supports three locales with country's name, achieves la

Klaus 6 Nov 15, 2022
A token auction website made by Flutter thats interacts with Ethereum web3 through flutter_web3 package.

flutter_web3_auction A token auction website made by Flutter thats interacts with Ethereum web3 through flutter_web3 package. This flutter web package

yoisha 26 Dec 26, 2022