{"id":21373589,"url":"https://github.com/itenfay/grab_ethtoken_info","last_synced_at":"2025-07-13T07:33:11.307Z","repository":{"id":113235666,"uuid":"185086042","full_name":"itenfay/grab_ethtoken_info","owner":"itenfay","description":"从以太坊区块链 (Ethereum Blockchain) etherscan 上抓取任意一个钱包地址的所有token信息 (Address, Name, Balance, Symbol, Value)，并编写界面进行展示。","archived":false,"fork":false,"pushed_at":"2024-05-14T12:56:04.000Z","size":205,"stargazers_count":19,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-07T05:53:36.649Z","etag":null,"topics":["balance","blockchain","blockchain-technology","contract","contracts-programming","dart","dart-etherscan","eth","ethereum","flutter","flutter-app","flutter-demo","symbol","token","wallet-address"],"latest_commit_sha":null,"homepage":"https://www.jianshu.com/p/df29789b0106","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itenfay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-05T21:53:18.000Z","updated_at":"2024-05-14T12:56:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"e71ac163-8f12-47f3-9e52-502e883d8f92","html_url":"https://github.com/itenfay/grab_ethtoken_info","commit_stats":null,"previous_names":["itenfay/grab_ethtoken_info","chenxing640/grab_ethtoken_info"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itenfay%2Fgrab_ethtoken_info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itenfay%2Fgrab_ethtoken_info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itenfay%2Fgrab_ethtoken_info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itenfay%2Fgrab_ethtoken_info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itenfay","download_url":"https://codeload.github.com/itenfay/grab_ethtoken_info/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225868059,"owners_count":17536959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["balance","blockchain","blockchain-technology","contract","contracts-programming","dart","dart-etherscan","eth","ethereum","flutter","flutter-app","flutter-demo","symbol","token","wallet-address"],"created_at":"2024-11-22T08:29:23.889Z","updated_at":"2024-11-22T08:29:24.536Z","avatar_url":"https://github.com/itenfay.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"如果能帮助到你，就请你给一颗[star](https://github.com/chenxing640/grab_ethtoken_info)，谢谢！(If this can help you, please give it a [star](https://github.com/chenxing640/grab_ethtoken_info), thanks!)\n\n[![License MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](LICENSE)\u0026nbsp;\n[![Support](https://img.shields.io/badge/support-iOS%20|%20Android-blue.svg?style=flat)](https://pub.flutter-io.cn)\u0026nbsp;\n\n## grab_ethtoken_info\n\n从以太坊区块链 (Ethereum Blockchain) etherscan 上抓取任意一个钱包地址的所有token信息 (Address, Name, Balance, Symbol, Value)，并编写界面进行展示。\n\n## Group(ID:155353383) \n\n\u003cdiv align=left\u003e\n\u0026emsp; \u003cimg src=\"https://github.com/chenxing640/grab_ethtoken_info/raw/master/images/qq155353383.jpg\" width=\"30%\" /\u003e\n\u003c/div\u003e\n\n## Recommendation\n\n* [Dart crypto](https://github.com/chenxing640/dart_crypto)\n\n## Getting Started\n\nFor help getting started with Flutter, view the online \u003cbr /\u003e\n\n* [Flutter Hub](https://github.com/chenxing640/Awesome/blob/master/Flutter.md)\n\n## Structure\n\n- Network\n  - [http_utils](https://github.com/chenxing640/grab_ethtoken_info/blob/master/lib/network/http_utils.dart) - A HTTP tool to receive data, download and upload files, etc.\n\n- DB\n  - [EthTokenholdingsProvider](https://github.com/chenxing640/grab_ethtoken_info/blob/master/lib/db/EthTokenholdingsProvider.dart)\n  - [EthTokensProvider](https://github.com/chenxing640/grab_ethtoken_info/blob/master/lib/db/EthTokensProvider.dart)\n\n- Utils\n  - [HtmlConverter](https://github.com/chenxing640/grab_ethtoken_info/blob/master/lib/eth_token_grab/HtmlConverter.dart) - Converts a paragraph of HTML text into simple standard html.\n  - [ExtendedUtility](https://github.com/chenxing640/grab_ethtoken_info/blob/master/lib/eth_token_grab/ExtendedUtility.dart) - Extended Utilities.\n\n- ETH Token\n  - [AppConfigurator](https://github.com/chenxing640/grab_ethtoken_info/blob/master/lib/eth_token_grab/AppConfigurator.dart)\n  - [EthTokensDisplay](https://github.com/chenxing640/grab_ethtoken_info/blob/master/lib/eth_token_grab/EthTokensDisplay.dart) - Display UI for tokens.\n  - [EthAddNewTokens](https://github.com/chenxing640/grab_ethtoken_info/blob/master/lib/eth_token_grab/EthAddNewTokens.dart) - Display UI for Adding new tokens.\n  - [EthTokenholdingsDataRequest](https://github.com/chenxing640/grab_ethtoken_info/blob/master/lib/eth_token_grab/EthTokenholdingsDataRequest.dart) - Get data from tokenholdings service.\n  - [EthTokenholdingsModel](https://github.com/chenxing640/grab_ethtoken_info/blob/master/lib/eth_token_grab/EthTokenholdingsModel.dart) - A model for the token holdings.\n  - [EthTokenholdingsParser](https://github.com/chenxing640/grab_ethtoken_info/blob/master/lib/eth_token_grab/EthTokenholdingsParser.dart) - Parsing data that comes from tokenholdings service.\n  - [EthTokenModel](https://github.com/chenxing640/grab_ethtoken_info/blob/master/lib/eth_token_grab/EthTokenModel.dart)\n  - [EthTokenParser](https://github.com/chenxing640/grab_ethtoken_info/blob/master/lib/eth_token_grab/EthTokenParser.dart)\n\n## Display UI\n\n- Import Dart Files.\n\n```dart\nimport './network/http_utils.dart';\nimport './eth_token_grab/EthTokensDisplay.dart';\nimport './eth_token_grab/EthTokenParser.dart';\nimport './db/EthTokensProvider.dart';\nimport './db/EthTokenholdingsProvider.dart';\nimport './eth_token_grab/EthTokenholdingsDataRequest.dart';\nimport './eth_token_grab/EthTokenholdingsParser.dart';\nimport './eth_token_grab/AppConfigurator.dart';\n```\n\n- Open Databases.\n\n```dart\nvoid openTokenholdingsDB() async { \n    EthTokenholdingsProvider.shared.open().then\u003cbool\u003e((isOpen){\n        print(\"EthTokenholdingsProvider isOpen: $isOpen\");\n    });\n}\n\nvoid openTokensDB() async {\n    EthTokensProvider.shared.open().then\u003cbool\u003e((isOpen) {\n        print(\"EthTokensProvider isOpen: $isOpen\");\n    });\n}\n\nclass MyApp extends StatelessWidget {\n    // This widget is the root of your application.\n    @override\n    Widget build(BuildContext context) {\n        openTokenholdingsDB();\n        openTokensDB();\n\n        return new MaterialApp(\n            title: 'Flutter Demo',\n            debugShowCheckedModeBanner: false,\n            theme: new ThemeData(\n                primarySwatch: Colors.blue,\n            ),\n            home: new MyHomePage(title: 'Flutter Demo Home Page'),\n        );\n    }\n}\n```\n\n- Fetcth data, Create page route and Display the information of all tokens.\n\n```dart\nclass _MyHomePageState extends State\u003cMyHomePage\u003e {\n    int _counter = 0;\n    String _data = \"\";\n    \n    // Fetch token data.\n    void _getTokenData() {\n        var baseUrl = \"https://etherscan.io\";\n        var httpUtils = new HttpUtils.config(baseUrl: baseUrl);\n        httpUtils.connectTimeout = 10;\n        httpUtils.get(\"/address/0x71c7656ec7ab88b098defb751b7401b5f6d8976f\");\n        print(\"url: ${httpUtils.url}\");\n        httpUtils.listen((Response response) {\n            String data = response.data;\n            //print(\"data: $data\");\n            setState(() {\n                _data = data;\n            });\n        }, (DioError error) {\n            print(\"e: ${error.message}\");\n        });\n    }\n\n    // Fetch token holdings data.\n    void _getTokenholdingsData() async {\n        String a = \"0x71c7656ec7ab88b098defb751b7401b5f6d8976f\";\n        String data = await EthTokenholdingsDataRequest.init(a).getData();\n        if (data != null \u0026\u0026 data.isNotEmpty) {\n            EthTokenholdingsParser.parse(data, a);\n        }\n    }\n\n    @override\n    void initState() {\n        super.initState();\n        _getTokenData();\n        _getTokenholdingsData();\n    }\n\n    void _incrementCounter() {\n        setState(() {\n           // This call to setState tells the Flutter framework that something has\n           // changed in this State, which causes it to rerun the build method below\n           // so that the display can reflect the updated values. If we changed\n           // _counter without calling setState(), then the build method would not be\n           // called again, and so nothing would appear to happen.\n           _counter++;\n        });\n        if (_data.isNotEmpty) {\n            EthTokenParser.parse(_data).then\u003cbool\u003e((finished){\n                if (finished) {\n                    Navigator.push(context, _createPushRoute());\n                }\n            });\n        } else {\n            print(\"data is empty.\");\n        }\n    }\n\n    // Create page route for displaying the information of all of tokens.\n    // This is simple demo for testing, the codes maybe include some bugs. \n    MaterialPageRoute _createPushRoute() {\n        return MaterialPageRoute(builder: (context) =\u003e \n            new EthTokensDisplayView(\"0x71c7656ec7ab88b098defb751b7401b5f6d8976f\")\n        );\n    }\n\n    @override\n    Widget build(BuildContext context) {\n        return new Scaffold(\n            appBar: new AppConfigurator('UI').createAppBar(\n                title: new Text(widget.title, style: new TextStyle(fontSize: 18.0),)\n            ),\n        \n            body: new Center(\n                // Center is a layout widget. It takes a single child and positions it\n                // in the middle of the parent.\n                child: new Column(\n                    mainAxisAlignment: MainAxisAlignment.center,\n                    children: \u003cWidget\u003e[\n                        new Text(\n                            'You have pushed the button this many times:',\n                        ),\n                        new Text(\n                            '$_counter',\n                            style: Theme.of(context).textTheme.display1,\n                        ),\n                    ],\n                ),\n            ),\n            \n            floatingActionButton: new FloatingActionButton(\n                nPressed: _incrementCounter,\n                tooltip: 'Increment',\n                child: new Icon(Icons.add),\n            ), // This trailing comma makes auto-formatting nicer for build methods.\n        );\n    }\n}\n````\n\n## Feedback is welcome\n\nIf you notice any issue, please create an issue. I will be happy to help you.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitenfay%2Fgrab_ethtoken_info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitenfay%2Fgrab_ethtoken_info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitenfay%2Fgrab_ethtoken_info/lists"}