xrpl.dart

xrpl.dart is a Dart package that provides bindings to the xrpl.js library, allowing developers to interact with the XRP Ledger in Dart applications.

Features

This package is a work in progress, and so does not fully replicate the functionality of xrpl.js.

Getting started

To use xrpl.dart in your Dart project, please follow these steps:

  1. Add the following snippet to the bottom of the body of your web/index.html:
  <script src="https://unpkg.com/[email protected]/build/xrpl-latest-min.js"></script>
  1. Add it as a dependency in your pubspec.yaml file:
dependencies:
  xrpl: ^0.0.9
  1. Finally, run dart pub get to download the package.

Usage

To use xrpl.dart, first import it into your code:

import 'package:xrpl/xrpl.dart';

You can then use the functionality provided by xrpl.js through the xrpl.dart bindings:

   var walletFromMneomicOptions = WalletFromMnemonicOptions(
      mnemonicEncoding: "bip39",
    );

    var wallet = Wallet.fromMnemonic(seed, walletFromMneomicOptions);

    Client client = Client("wss://s.altnet.rippletest.net:51233");

    client.connect().then((_) {
      client.fundWallet(wallet);

      String address = wallet!.address;
      client.getXrpBalance(address).then((balanceString) {
        print("Wallet balance: ${balanceString.toString()}");
      });
    });

Please do not use this example for production code!

Contributing

Contributions to xrpl.dart are welcome! To contribute, please fork the repository and submit a pull request. Before submitting a pull request, please make sure that your code follows the Dart Style Guide.

license

xrpl.dart is licensed under the BSD-3-Clause License. See the LICENSE file for more information.

Libraries

xrpl