dart_esr 0.0.1

Dart native
Flutter Android iOS

Dart package to encode/decode EOSIO Signing Request

dart-esr #

dart-esr is a dart package used to generate an EOSIO signing request (ESR) to be passed to a wallet to be sign

ESR protocol documentation -> https://github.com/eosio-eps/EEPs/blob/master/EEPS/eep-7.md#ESR---The--EOSIO-Signing-Request--protocol

dart-esr is based on javascript library eosio-signing-request -> https://github.com/greymass/eosio-signing-request

Request format -> https://github.com/eosio-eps/EEPs/blob/master/EEPS/eep-7.md#payload

Examples #

https://github.com/EOS-Nation/dart-esr/tree/feature/eosio-signing-request/example

Usage #

####Import

import 'package:dart_esr/dart_esr.dart';

####Create Signing request object with a eos node url, version and ChainName


var esr = EOSIOSigningrequest('https://jungle2.cryptolions.io', 'v1',
    chainName: ChainName.EOS_JUNGLE2);

####Encode a transaction

var auth = <Authorization>[
    Authorization()
      ..actor = 'testName1111'
      ..permission = 'active'
  ];

  var data = <String, String>{'name': 'data'};

  var actions = <Action>[
    Action()
      ..account = 'eosnpingpong'
      ..name = 'ping'
      ..authorization = auth
      ..data = data,
  ];

  var transaction = Transaction()..actions = actions;

  var encoded = await esr.encodeTransaction(transaction);

####Encode an action

var auth = <Authorization>[
    Authorization.fromJson(ESRConstants.PlaceholderAuth)
  ];

  var data = <String, String>{'name': 'data'};

  var action = Action()
    ..account = 'eosnpingpong'
    ..name = 'ping'
    ..authorization = auth
    ..data = data;

  var encoded = await esr.encodeAction(action);

####Encode a list of actions

var auth = <Authorization>[
    Authorization.fromJson(ESRConstants.PlaceholderAuth)
  ];

  var data1 = <String, String>{'name': 'data1'};

  var action1 = Action()
    ..account = 'eosnpingpong'
    ..name = 'ping'
    ..authorization = auth
    ..data = data1;

  var data2 = <String, String>{'name': 'data2'};

  var action2 = Action()
    ..account = 'eosnpingpong'
    ..name = 'ping'
    ..authorization = auth
    ..data = data2;

  var actions = <Action>[action1, action2];

  var encoded = await esr.encodeActions(actions);

####Encode an identity request

  var permission = IdentityPermission()
    ..actor = 'testname1111'
    ..permission = 'active';

  var identity = Identity()..identityPermission = permission;
  String callback = "https://cNallback.com";

  var encoded = await esr.encodeIdentity(identity, callback);

Installing #

TODO when added to pub.dev

Features and bugs #

Please file feature requests and bugs at the issue tracker.

2
likes
60
pub points
21%
popularity

Dart package to encode/decode EOSIO Signing Request

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

picard.charlesantoine@gmail.com

License

MIT (LICENSE)

Dependencies

http, json_annotation, pointycastle

More

Packages that depend on dart_esr