Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xclud/dart_erc20
Interface of the ERC20 standard as defined in the EIP-20 Token Standard.
https://github.com/xclud/dart_erc20
dart erc20 ethereum flutter smart-contracts web3 web3dart
Last synced: 8 days ago
JSON representation
Interface of the ERC20 standard as defined in the EIP-20 Token Standard.
- Host: GitHub
- URL: https://github.com/xclud/dart_erc20
- Owner: xclud
- License: mit
- Created: 2022-02-19T15:36:00.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-13T03:38:02.000Z (almost 2 years ago)
- Last Synced: 2023-08-20T21:53:32.731Z (about 1 year ago)
- Topics: dart, erc20, ethereum, flutter, smart-contracts, web3, web3dart
- Language: Dart
- Homepage: https://pub.dev/packages/erc20/
- Size: 8.79 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Interface of the ERC20 standard as defined in the EIP-20 Token Standard.
[![pub package](https://img.shields.io/pub/v/erc20.svg)](https://pub.dev/packages/erc20)
## Features
- `allowance` function.
- `approve` function.
- `balanceOf` function.
- `decimals` function.
- `name` function.
- `symbol` function.
- `totalSupply` function.
- `transfer` function.
- `transferFrom` function.
- `approvalEvents` event.
- `transferEvents` event.## Getting started
In your `pubspec.yaml` file add:
```dart
dependencies:
erc20: any
```## Usage
```dart
import 'package:erc20/erc20.dart';
``````dart
const infuraId = '';
final client = Web3Client('https://mainnet.infura.io/v3/$infuraId', Client());
final shibaInu = ERC20(
address: EthereumAddress.fromHex(
'0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce'),
client: client,
);final symbol = await shibaInu.symbol();
final name = await shibaInu.name();
final decimals = await shibaInu.decimals();print(symbol); //SHIB
print(name); // SHIBA INU
print(decimals) // 18;
```