Giter VIP home page Giter VIP logo

dart-stellar-sdk's People

Contributors

jspschool avatar sonicseeker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dart-stellar-sdk's Issues

How to get accountid from mnemonic

According SEP-0005,
I want to get accountid from mnemonic,but it's wrong, codes like

  final mnemonic = "illness spike retreat truth genius clock brain pass fit cave bargain toe";
  final seed = bip39.mnemonicToSeed(mnemonic);
  print(HEX.encode(seed));//correct
  final root = bip32.BIP32.fromSeed(seed);
  final path = root.derivePath("m/44'/148'/0'");
  KeyPair kp = KeyPair.fromSecretSeedList(path.privateKey);
  print(kp.accountId);//not GDRXE2BQUC3AZNPVFSCEZ76NJ3WWL25FYFK6RGZGIEKWE4SOOHSUJUJ6 
  print(kp.secretSeed);

source codes

Environment:
flutter: 1.0.0
stellar: 0.3.2
bip39: 1.0.3
bip32: 1.0.5

Thx.

creating trustline

Hi, well first amazing work. I just wanted to ask you how can you create a trustline with an asset. I've been trying but no luck

I have the following but it says
value of type transactionbuilder cant be assigned to a variable of type transaction

server.accounts.account(source).then((sourceAccount) {

  Transaction transaction = new TransactionBuilder(sourceAccount).
  addOperation(new AllowTrustOperation(trustor, assetCode, authorize).
  build());
  transaction.sign(source);



  server.submitTransaction(transaction).then((response) {
    print("Success!");
    print(response);
  }).catchError((error) {
    print("Something went wrong!");
  });

});

Second KeyPair created from secretSeed override secretSeed of the first one

As I noticed in KeyPair class _mPrivateKey_seed is a static member. So when I'm creating two KeyPair variables the second one override the first one.

KeyPair pair1 = stellar.KeyPair.random();
KeyPair pair2 = stellar.KeyPair.fromSecretSeed('**********************************************');
print(pair1.secretSeed) //!!!! print the secret seed of the pair2

Is that expected behavior?

Trade operation

Thank you for library,
Could you provide, please, with example of trade operation?
Thank you in advance

Get all payments

What is the correct way to pull all payments for an account?
I use this code to get payments:

return server.payments
        .forAccount(keyPair)
        .execute()
        .then((Page<OperationResponse> response) {
      List<PaymentOperationResponse> payments = [];
      for (OperationResponse response in response.records) {
        String jsonResponse = json.encode(response);
        Map map = json.decode(jsonResponse);
        if (map['type'] == 'payment') {
          payments.add(PaymentOperationResponse.fromJson(map));
        }
      }
      print('payments: $payments');
      return payments;
    });

But there is still an issue with payment parsing. It works only if replace
..id = int.parse(json['id'] as String)
with
..id = int.parse(json['id'].toString())

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.