binance_chain 1.0.1+1 copy "binance_chain: ^1.0.1+1" to clipboard
binance_chain: ^1.0.1+1 copied to clipboard

Binance Chain Dart SDK. Get Binance DEX info, send tokens, place orders, keep account balance using HTTP or WebSocket!

binance_chain_dart #

This is unofficial Dart wrapper for the Binance Chain API. Inspired by python-binance-chain and Binance Chain Java SDK

Features #

  • Support for all languages of BIP39 spec
  • HTTP API in async implementation (100% coverage)
  • Mini (BEP8) tokens support
  • Create, sign and broadcast messages (transactions)
  • Multisend and multitoken transactions
  • Websocket API with automatic "keep alive" messages and reconnecting.
  • Wallet creation from private key or mnemonic phrase
  • Wallet handling account sequence for transactions
  • Helper classes for handling responses from Binance API. Data models are presented as classes that parse the JSON from responses
  • Using the "Decimal" library for a more accurate representation of amounts when sending transactions.
  • 100% Flutter compatibility
  • 100% Dart native

HOW TO USE: SEE WIKI #

Usage #

A simple usage example:

import 'package:binance_chain/binance_chain.dart';

main() async {
  //
  var testnetEnv = BinanceEnvironment.getTestnetEnv();
  var httpClient = HttpApiClient(env: testnetEnv);
  
  // create wallet from mnemonic phrase
  var wallet = Wallet.fromMnemonicPhrase('mnemonic phrase 12-24 words', bip39.Language.english, testnetEnv)
  // or from private key
  var wallet = Wallet('private key in hexadecimal', testnetEnv)
  
  // get account info
  var account = httpClient.getAccount('tbnb1v8603f3ene9zd2y44s6czhhjw7sd8gs9v4est4');
  
  // get open orders of account
  var openOrders = httpClient.getOpenOrders('tbnb1v8603f3ene9zd2y44s6czhhjw7sd8gs9v4est4');
  
  // get order from order id
  var order = httpClient.getOrder('9D0537108883C68B8F43811B780327CE97D8E01D-2');
  
  // get transactions
  var transactions = httpClient.getTransacions('tbnb1v8603f3ene9zd2y44s6czhhjw7sd8gs9v4est4');
  
}

TODO: #

✓ Support for WIF and .keystore

  • Tests
  • More docs and samples
  • Maybe JSON-RPC
13
likes
100
pub points
9%
popularity

Publisher

unverified uploader

Binance Chain Dart SDK. Get Binance DEX info, send tokens, place orders, keep account balance using HTTP or WebSocket!

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

bip39_mnemonic, bs58check, collection, convert, decimal, fixnum, hex, http, pointycastle, protobuf, uuid, web_socket_channel

More

Packages that depend on binance_chain