Aus öffentlichen Paketdaten erstellte Orientierung.
Flutterchain ist eine Multi-Chain-Bibliothek, die nahtlose Kommunikation mit Blockchain-Systemen in Flutter-Anwendungen ermöglicht. Auf WalletCore aufgebaut, unterstützt sie die Interoperabilität über mehrere Blockchains hinweg und bietet Entwicklern eine einheitliche Schnittstelle für Wallet-Management, Transaktionssignierung und Blockchain-Interaktionen. Die Bibliothek ist für Android, iOS und Web optimiert und eignet sich daher ideal für plattformübergreifende Web3-Anwendungen. Mit robusten Sicherheitsfunktionen und niedrigstufigem Zugriff auf Blockchain-Protokolle vereinfacht Flutterchain die Integration kryptobasierter Funktionen in mobile und Web-Anwendungen.
Anwendungsfälle
Kreieren von plattformübergreifenden Kryptowallets
Blockchain-Transaktionen in Flutter-Anwendungen aktivieren
Integration von Multi-Chain-Unterstützung
Entwicklung von DeFi-Anwendungen
Erstellen von NFT-Märkten
Die Wallet-Verbindung über QR oder Links erleichtern
Hauptmerkmale
Multi-Ketten-Kompatibilität
WalletCore-basierte Architektur
Unterstützung für Android, iOS und Web
sichere Transaktionssignierung
Low-Level-Zugriff auf Blockchain-Protokolle
Plattformübergreifende Konsistenz
Geeignet für
Web3-App-Entwickler
Krypto-Wallet-Ersteller
DeFi-Plattform-Bauer
NFT-Anwendungsteams
Blockchain-Integrator
Hinweise
Grundkenntnisse über Blockchain erforderlich
Abhängig von der Stabilität von WalletCore
Kann zusätzliche Einrichtung für benutzerdefinierte Ketten erfordern
Beschränkte Dokumentation über die grundlegende Verwendung hinaus
Nicht geeignet für Nicht-Web3-Projekte
Original-README
Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.
FlutterChain is a library that provides developers with a simple API to communicate with different blockchains. It allows developers to easily integrate popular cryptocurrencies into their web 3.0 projects without needing to have an in-depth understanding of the underlying blockchain technology. With FlutterChain, developers can easily interact with smart contracts, send transfers, and perform various transaction types. It's an easy-to-use and flexible solution for developers looking to build blockchain-based applications.
Installing
Add This code to the index.html For Web project
<head><!-- other head elements --><scripttype="application/javascript"src="flutter.js"defer></script><scripttype="application/javascript"src="/assets/packages/flutter_inappwebview_web/assets/web/web_support.js"defer></script><scripttype="module"src="/assets/packages/flutterchain/assets/crypto-lib/dist/bundle.js"></script><scripttype="application/javascript"src="/assets/packages/flutterchain/assets/crypto-lib/dist/dop_bundle.js"></script><linkrel="modulepreload"crossoriginhref="/assets/packages/flutterchain/assets/crypto-lib/dist/bundle2.js"></head><body><script>window.addEventListener("load", asyncfunction (ev) {
{{flutter_js}}
{{flutter_build_config}}
_flutter.loader.load({
serviceWorkerSettings: {
serviceWorkerVersion: {{flutter_service_worker_version}},
},
});
});
</script></body>
Set Android: minSdkVersion >= 19, compileSdk >= 34, AGP version >= 7.3.0 in the android/app/build.gradle file and add to the AndroidManifest.xml usesCleartextTraffic param and Internet permission:
This library provides interfaces to interact with various blockchains. You can achieve this by using an implementation of BlockChainService or BlockchainServiceWithSmartContractCallSupport for your selected blockchain. For example:
final service = NearBlockChainService.defaultInstance(); // NearBlockChainService implements BlockchainServiceWithSmartContractCallSupportfinal amount = await service
.getWalletBalance(NearAccountInfoRequest(accountId: "test.near"));
The library also includes its own wallet controller (FlutterChainLibrary), allowing you to create wallets for different blockchains simultaneously, securely store them and manage, and execute standardized operations like transferring coins or interacting with smart contracts (where supported by the blockchain). It also provides access to the blockchain specific methods interface. For example:
final flutterChainLibrary = FlutterChainLibrary.defaultInstance();
final wallet = await flutterChainLibrary.createWalletWithGeneratedMnemonic(
walletName: "my wallet");
final derivationPathData =
wallet.blockchainsData?[BlockChains.near]?.first.derivationPath;
// call from FlutterChainLibraryfinal response = await flutterChainLibrary.sendTransferNativeCoin(
blockchainType: BlockChains.near,
derivationPathData: derivationPathData!,
walletId: wallet.id,
toAddress: "someAddress",
transferAmount: "1000",
);
//call from blockchainService interfacefinalNearBlockChainService nearBlockChainService = flutterChainLibrary
.blockchainService
.blockchainServices[BlockChains.near] asNearBlockChainService;
// final NearBlockChainData blockChainData = wallet.blockchainsData![BlockChains.near]?.first as NearBlockChainData;finalNearBlockChainData blockChainData = await nearBlockChainService
.getBlockChainData(mnemonic: wallet.mnemonic) asNearBlockChainData;
final response2 = await nearBlockChainService.sendTransferNativeCoin(
NearTransferRequest(
publicKey: blockChainData.publicKey,
privateKey: blockChainData.privateKey,
toAddress: "someAddress",
transferAmount: "1000",
),
);
await flutterChainLibrary.deleteAllWallets();
Important Notes and Tips
FlutterChainLibrary and BlockchainServiceWithSmartContractCallSupport/BlockchainService implementations aren't singletons. Each time a new instance is created, a jsVMService (a service that handles blockchain operations behind the scenes) is also instantiated. For optimal performance, it is recommended to reuse the same instance of the blockchain service throughout your app. This can be easily managed by using dependency injection libraries like flutter_modular or get_it.
For more detailed information, refer to the documentation and tests. You'll find guidance on how to use FlutterChainLibrary or various BlockchainServices. Additionally, you can explore different use cases through the examples provided: