wallet_core_bindings
Dart bindings for Trust Wallet Core, used in Flutter and Dart.
Packages
Package | Pub |
---|---|
wallet_core_bindings | |
wallet_core_bindings_native | |
wallet_core_bindings_wasm | |
wallet_core_bindings_libs | |
wallet_core_bindings_wasm_assets |
Features
- TrustWalletCore include files and Protobuf file bindings.
- Provides Native and WebAssembly System Interface, supporting all platforms.
- APIs are repackaged for easier use.
- Combined with Dart GC, there is no need to control memory.
- Update the TrustWalletCore version synchronously and keep the APIs consistent.
Getting Started
There are two ways to use wallet_core_bindings, Native and Web Assembly. Please follow the instructions below to make your choice.
Platform | Native | Web Assembly | wallet_core_bindings_libs |
---|---|---|---|
Android | ✔️ | ✔️ | ✔️ |
iOS | ✔️ | ✔️ | ✔️ |
macOS | ✔️ | ✔️ | ✔️ |
Linux | ✔️ | ✔️ | ✔️ |
Windows | ❌️ | ✔️ | ❌️ |
Web | ❌️ | ✔️ | ❌️ |
Native
The native features of the platform rely on the dynamic library compiled by Wallet Core, Binding with dart:ffi.
- wallet_core_bindings_libs contains native dynamic libraries. Windows is not supported at present.
- For more information, see wallet_core_bindings_libs.
dependencies:
wallet_core_bindings: version
wallet_core_bindings_native: version
wallet_core_bindings_libs: version
import 'package:wallet_core_bindings/wallet_core_bindings.dart';
import 'package:wallet_core_bindings_native/wallet_core_bindings_native.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await WalletCoreBindingsNativeImpl().initialize();
runApp(const MyApp());
}
Web Assembly
Build WalletCore for WASM,Binding with WASI wasi_snapshot_preview1 and wasm_run.
- It is suitable for use on platforms that do not support native, such as Web and Windows. However, wasm itself has strong cross-platform features and is not limited to these two platforms.
dependencies:
wasm_run_flutter: version
wallet_core_bindings: version
wallet_core_bindings_wasm: version
wallet_core_bindings_wasm_assets: version
import 'package:wallet_core_bindings/wallet_core_bindings.dart';
import 'package:wallet_core_bindings_wasm/wallet_core_bindings_wasm.dart';
import 'package:wasm_run_flutter/wasm_run_flutter.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await WasmRunLibrary.setUp(override: false);
await WalletCoreBindingsWasmImpl().initialize();
runApp(const MyApp());
}
Usage
wallet_core_bindings provides the complete test cases, you can find usage here. See tests.
Generate
Protobuf
Refer to the TrustWalletCore build documentation and complete the steps to generate files. Extract proto files in src/proto and use protoc_plugin to compile them into Dart code.
cd ../proto/TrustWalletCore/
protoc --dart_out=../../wallet_core_bindings/lib/proto/ ./*
License
Commercial license
If you want to use wallet_core_bindings in your commercial app, website or plugin, you need to obtain a commercial license from the author. Please contact xuelongqy@qq.com for more information.Once you obtain the license, your authorization information will appear in the AUTHORIZED.md.
Open-source license
Libraries
- ffi/finalizable
- proto/Aeternity.pb
- proto/Aeternity.pbenum
- proto/Aeternity.pbjson
- proto/Aeternity.pbserver
- proto/Aion.pb
- proto/Aion.pbenum
- proto/Aion.pbjson
- proto/Aion.pbserver
- proto/Algorand.pb
- proto/Algorand.pbenum
- proto/Algorand.pbjson
- proto/Algorand.pbserver
- proto/Aptos.pb
- proto/Aptos.pbenum
- proto/Aptos.pbjson
- proto/Aptos.pbserver
- proto/BabylonStaking.pb
- proto/BabylonStaking.pbenum
- proto/BabylonStaking.pbjson
- proto/BabylonStaking.pbserver
- proto/Barz.pb
- proto/Barz.pbenum
- proto/Barz.pbjson
- proto/Barz.pbserver
- proto/Binance.pb
- proto/Binance.pbenum
- proto/Binance.pbjson
- proto/Binance.pbserver
- proto/Bitcoin.pb
- proto/Bitcoin.pbenum
- proto/Bitcoin.pbjson
- proto/Bitcoin.pbserver
- proto/BitcoinV2.pb
- proto/BitcoinV2.pbenum
- proto/BitcoinV2.pbjson
- proto/BitcoinV2.pbserver
- proto/Cardano.pb
- proto/Cardano.pbenum
- proto/Cardano.pbjson
- proto/Cardano.pbserver
- proto/Common.pb
- proto/Common.pbenum
- proto/Common.pbjson
- proto/Common.pbserver
- proto/Cosmos.pb
- proto/Cosmos.pbenum
- proto/Cosmos.pbjson
- proto/Cosmos.pbserver
- proto/Decred.pb
- proto/Decred.pbenum
- proto/Decred.pbjson
- proto/Decred.pbserver
- proto/DecredV2.pb
- proto/DecredV2.pbenum
- proto/DecredV2.pbjson
- proto/DecredV2.pbserver
- proto/EOS.pb
- proto/EOS.pbenum
- proto/EOS.pbjson
- proto/EOS.pbserver
- proto/Ethereum.pb
- proto/Ethereum.pbenum
- proto/Ethereum.pbjson
- proto/Ethereum.pbserver
- proto/EthereumAbi.pb
- proto/EthereumAbi.pbenum
- proto/EthereumAbi.pbjson
- proto/EthereumAbi.pbserver
- proto/EthereumRlp.pb
- proto/EthereumRlp.pbenum
- proto/EthereumRlp.pbjson
- proto/EthereumRlp.pbserver
- proto/Everscale.pb
- proto/Everscale.pbenum
- proto/Everscale.pbjson
- proto/Everscale.pbserver
- proto/Filecoin.pb
- proto/Filecoin.pbenum
- proto/Filecoin.pbjson
- proto/Filecoin.pbserver
- proto/FIO.pb
- proto/FIO.pbenum
- proto/FIO.pbjson
- proto/FIO.pbserver
- proto/Greenfield.pb
- proto/Greenfield.pbenum
- proto/Greenfield.pbjson
- proto/Greenfield.pbserver
- proto/Harmony.pb
- proto/Harmony.pbenum
- proto/Harmony.pbjson
- proto/Harmony.pbserver
- proto/Hedera.pb
- proto/Hedera.pbenum
- proto/Hedera.pbjson
- proto/Hedera.pbserver
- proto/Icon.pb
- proto/Icon.pbenum
- proto/Icon.pbjson
- proto/Icon.pbserver
- proto/InternetComputer.pb
- proto/InternetComputer.pbenum
- proto/InternetComputer.pbjson
- proto/InternetComputer.pbserver
- proto/IOST.pb
- proto/IOST.pbenum
- proto/IOST.pbjson
- proto/IOST.pbserver
- proto/IoTeX.pb
- proto/IoTeX.pbenum
- proto/IoTeX.pbjson
- proto/IoTeX.pbserver
- proto/LiquidStaking.pb
- proto/LiquidStaking.pbenum
- proto/LiquidStaking.pbjson
- proto/LiquidStaking.pbserver
- proto/MultiversX.pb
- proto/MultiversX.pbenum
- proto/MultiversX.pbjson
- proto/MultiversX.pbserver
- proto/Nano.pb
- proto/Nano.pbenum
- proto/Nano.pbjson
- proto/Nano.pbserver
- proto/NEAR.pb
- proto/NEAR.pbenum
- proto/NEAR.pbjson
- proto/NEAR.pbserver
- proto/Nebulas.pb
- proto/Nebulas.pbenum
- proto/Nebulas.pbjson
- proto/Nebulas.pbserver
- proto/NEO.pb
- proto/NEO.pbenum
- proto/NEO.pbjson
- proto/NEO.pbserver
- proto/Nervos.pb
- proto/Nervos.pbenum
- proto/Nervos.pbjson
- proto/Nervos.pbserver
- proto/Nimiq.pb
- proto/Nimiq.pbenum
- proto/Nimiq.pbjson
- proto/Nimiq.pbserver
- proto/NULS.pb
- proto/NULS.pbenum
- proto/NULS.pbjson
- proto/NULS.pbserver
- proto/Oasis.pb
- proto/Oasis.pbenum
- proto/Oasis.pbjson
- proto/Oasis.pbserver
- proto/Ontology.pb
- proto/Ontology.pbenum
- proto/Ontology.pbjson
- proto/Ontology.pbserver
- proto/Pactus.pb
- proto/Pactus.pbenum
- proto/Pactus.pbjson
- proto/Pactus.pbserver
- proto/Polkadot.pb
- proto/Polkadot.pbenum
- proto/Polkadot.pbjson
- proto/Polkadot.pbserver
- proto/Polymesh.pb
- proto/Polymesh.pbenum
- proto/Polymesh.pbjson
- proto/Polymesh.pbserver
- proto/Ripple.pb
- proto/Ripple.pbenum
- proto/Ripple.pbjson
- proto/Ripple.pbserver
- proto/Solana.pb
- proto/Solana.pbenum
- proto/Solana.pbjson
- proto/Solana.pbserver
- proto/Stellar.pb
- proto/Stellar.pbenum
- proto/Stellar.pbjson
- proto/Stellar.pbserver
- proto/Sui.pb
- proto/Sui.pbenum
- proto/Sui.pbjson
- proto/Sui.pbserver
- proto/Tezos.pb
- proto/Tezos.pbenum
- proto/Tezos.pbjson
- proto/Tezos.pbserver
- proto/TheOpenNetwork.pb
- proto/TheOpenNetwork.pbenum
- proto/TheOpenNetwork.pbjson
- proto/TheOpenNetwork.pbserver
- proto/Theta.pb
- proto/Theta.pbenum
- proto/Theta.pbjson
- proto/Theta.pbserver
- proto/THORChainSwap.pb
- proto/THORChainSwap.pbenum
- proto/THORChainSwap.pbjson
- proto/THORChainSwap.pbserver
- proto/TransactionCompiler.pb
- proto/TransactionCompiler.pbenum
- proto/TransactionCompiler.pbjson
- proto/TransactionCompiler.pbserver
- proto/Tron.pb
- proto/Tron.pbenum
- proto/Tron.pbjson
- proto/Tron.pbserver
- proto/Utxo.pb
- proto/Utxo.pbenum
- proto/Utxo.pbjson
- proto/Utxo.pbserver
- proto/VeChain.pb
- proto/VeChain.pbenum
- proto/VeChain.pbjson
- proto/VeChain.pbserver
- proto/WalletConnect.pb
- proto/WalletConnect.pbenum
- proto/WalletConnect.pbjson
- proto/WalletConnect.pbserver
- proto/Waves.pb
- proto/Waves.pbenum
- proto/Waves.pbjson
- proto/Waves.pbserver
- proto/Zcash.pb
- proto/Zcash.pbenum
- proto/Zcash.pbjson
- proto/Zcash.pbserver
- proto/Zilliqa.pb
- proto/Zilliqa.pbenum
- proto/Zilliqa.pbjson
- proto/Zilliqa.pbserver
- wallet_core_bindings