jspschool / dart-stellar-sdk Goto Github PK
View Code? Open in Web Editor NEWStellar client library for the Dart language.
License: MIT License
Stellar client library for the Dart language.
License: MIT License
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);
Environment:
flutter: 1.0.0
stellar: 0.3.2
bip39: 1.0.3
bip32: 1.0.5
Thx.
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!");
});
});
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?
Thank you for library,
Could you provide, please, with example of trade operation?
Thank you in advance
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())
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.