binance_chain 0.0.6+1
binance_chain: ^0.0.6+1 copied to clipboard

Dart native
Flutter Android iOS Linux macOS Windows

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 #

  • 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', 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
2
likes
70
pub points
18%
popularity

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

Uploader

robbbbb748@gmail.com

License

BSD (LICENSE)

Dependencies

bip39, bs58check, convert, decimal, fixnum, hex, http, meta, pointycastle, protobuf, protoc_plugin, uuid, web_socket_channel

More

Packages that depend on binance_chain