archethic_lib_dart 0.0.10+10 icon indicating copy to clipboard operation
archethic_lib_dart: ^0.0.10+10 copied to clipboard

[pending analysis]

ArchEthic dart library for Flutter based on Official ArchEthic Javascript library for Node and Browser

example/example.dart

import 'package:archethic_lib_dart/crypto.dart' as crypto;
import 'package:archethic_lib_dart/model/key_pair.dart';
import 'package:archethic_lib_dart/transaction_builder.dart';
  
void main(List<String> args) {
  // It creates a new keypair into hexadecimal format
  KeyPair keypair = crypto.deriveKeyPair("mysuperpassphraseorseed", 0);
  
  // Generate `address`, `timestamp`, `previousPublicKey`, `previousSignature`, `originSignature` of the transaction and 
  // serialize it using a custom binary protocol.
  var transaction = new TransactionBuilder("transfer")
    .addUCOTransfer("00b1d3750edb9381c96b1a975a55b5b4e4fb37bfab104c10b0b6c9a00433ec4646", 0.420) 
    .build("mysuperpassphraseorseed", 0, 'P256');

  // Sign the transaction with an origin device private key
  final KeyPair originKeypair = crypto.deriveKeyPair('origin_seed', 0);
  var transaction2 = new TransactionBuilder("transfer")
    .addUCOTransfer("00b1d3750edb9381c96b1a975a55b5b4e4fb37bfab104c10b0b6c9a00433ec4646", 0.420) 
    .build("mysuperpassphraseorseed", 0, 'P256') 
    .originSign(originKeypair.privateKey);

  // Export the transaction generated into JSON
  var transaction3 = new TransactionBuilder("transfer")
    .addUCOTransfer("00b1d3750edb9381c96b1a975a55b5b4e4fb37bfab104c10b0b6c9a00433ec4646", 0.420) 
    .build("mysuperpassphraseorseed", 0, 'P256') 
    .toJSON();
}
3
likes
--
pub points
--%
popularity

Publisher

unverified uploader

ArchEthic dart library for Flutter based on Official ArchEthic Javascript library for Node and Browser

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

asn1lib, convert, crypto, ecdsa, elliptic, flutter, http, pinenacl, pointycastle, secp256k1

More

Packages that depend on archethic_lib_dart