eosdart 0.3.3

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new65

eosdart #

Build Status

A library for EOS Node API

It talks to the EOS nodes by the given endpoint and API method.

Sample #

Sample Flutter application uses eosdart to fetch EOS account info:

https://github.com/primes-network/sample_flutter_eosdart

Usage #

A simple usage example:

import 'package:eosdart/eosdart.dart';

main() async {
  EOSClient client = EOSClient('https://eos.greymass.com', 'v1');

  // Get EOS Node Info
  client.getInfo().then((NodeInfo nodeInfo) {
    print(nodeInfo);
  });

  // Get EOS Abi
  client.getAbi('eosio.token').then((Abi abi) {
    print(abi);
  });

  // Get EOS Raw Abi
  client.getRawAbi('eosio.token').then((Abi abi) {
    print(abi);
  });

  // Get EOS Raw code and Abi
  client.getRawCodeAndAbi('eosio.token').then((Abi abi) {
    print(abi);
  });

  // Get EOS Block Info
  client.getBlock('351').then((Block block) {
    print(block);
  });

  // Get Account Info
  client.getAccount('eosio.stake').then((Account account) {
    print(account);
  });

  // Get Account Actions
  client.getActions('eosio.stake', pos: -1, offset: -1).then((Actions actions) {
    print(actions);
  });

  // Get Transaction
  client
      .getTransaction(
          '83875faeb054ba20b20f392418e3a0002c4bb1c36cc4e3fde15cbd0963da8a15')
      .then((Transaction transaction) {
    print(transaction);
  });

  // Get Accounts from public key
  client
      .getKeyAccounts('EOS8RWQpzzMi5uFXXXAChi4dHnyxMYKKdAQ3Y3pHQTrvhzGk95LbT')
      .then((AccountNames accountNames) {
    print(accountNames);
  });

  // Get currency balance
  client
      .getCurrencyBalance('parslseed123', 'newdexpocket')
      .then((List<Holding> balance) {
    print(balance);
  });
}

Installing #

https://pub.dartlang.org/packages/eosdart#-installing-tab-

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0.3.3 #

  • Update README.md

0.3.2 #

  • Correct the async operation
  • Better error handling

0.3.1 #

Fix: Class name conflict with flutter - https://github.com/primes-network/eosdart/issues/12

0.3.0 #

Supports the following APIs:

  • /v1/chain/get_info
  • /v1/chain/get_block
  • /v1/chain/get_block_header_state
  • /v1/chain/get_account
  • /v1/chain/get_abi
  • /v1/chain/get_raw_abi
  • /v1/chain/get_raw_code_and_abi
  • /v1/chain/get_currency_balance
  • /v1/history/get_actions
  • /v1/history/get_transaction
  • /v1/history/get_key_accounts

0.0.1 #

  • Initial version, created by Stagehand

example/eosdart_example.dart

import 'package:eosdart/eosdart.dart';

main() async {
  EOSClient client = EOSClient('https://eos.greymass.com', 'v1');

  // Get EOS Node Info
  client.getInfo().then((NodeInfo nodeInfo) {
    print(nodeInfo);
  });

  // Get EOS Abi
  client.getAbi('eosio.token').then((Abi abi) {
    print(abi);
  });

  // Get EOS Raw Abi
  client.getRawAbi('eosio.token').then((Abi abi) {
    print(abi);
  });

  // Get EOS Raw code and Abi
  client.getRawCodeAndAbi('eosio.token').then((Abi abi) {
    print(abi);
  });

  // Get EOS Block Info
  client.getBlock('351').then((Block block) {
    print(block);
  });

  // Get Account Info
  client.getAccount('eosio.stake').then((Account account) {
    print(account);
  });

  // Get Account Actions
  client.getActions('eosio.stake', pos: -1, offset: -1).then((Actions actions) {
    print(actions);
  });

  // Get Transaction
  client
      .getTransaction(
          '83875faeb054ba20b20f392418e3a0002c4bb1c36cc4e3fde15cbd0963da8a15')
      .then((Transaction transaction) {
    print(transaction);
  });

  // Get Accounts from public key
  client
      .getKeyAccounts('EOS8RWQpzzMi5uFXXXAChi4dHnyxMYKKdAQ3Y3pHQTrvhzGk95LbT')
      .then((AccountNames accountNames) {
    print(accountNames);
  });

  // Get currency balance
  client
      .getCurrencyBalance('parslseed123', 'newdexpocket')
      .then((List<Holding> balance) {
    print(balance);
  });
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  eosdart: ^0.3.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:eosdart/eosdart.dart';
  
Version Uploaded Documentation Archive
0.3.3 Mar 2, 2019 Go to the documentation of eosdart 0.3.3 Download eosdart 0.3.3 archive
0.3.2 Mar 2, 2019 Go to the documentation of eosdart 0.3.2 Download eosdart 0.3.2 archive
0.3.1 Mar 1, 2019 Go to the documentation of eosdart 0.3.1 Download eosdart 0.3.1 archive
0.3.0 Feb 27, 2019 Go to the documentation of eosdart 0.3.0 Download eosdart 0.3.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
32
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
94
Overall:
Weighted score of the above. [more]
65
Learn more about scoring.

We analyzed this package on Mar 6, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:eosdart/eosdart.dart.

Health suggestions

Fix lib/src/eosdart_base.dart. (-0.50 points)

Analysis of lib/src/eosdart_base.dart reported 1 hint:

line 24 col 5: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

Maintenance suggestions

The package description is too short. (-6 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
http ^0.12.0+1 0.12.0+1
json_annotation ^2.0.0 2.0.0
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
meta 1.1.7
path 1.6.2
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
build_runner ^1.0.0
json_serializable ^2.0.0
test ^1.0.0