├── .gitattributes
├── .github
└── workflows
│ └── dart.yml
├── .gitignore
├── .metadata
├── CHANGELOG.md
├── LICENSE
├── README.md
├── analysis_options.yaml
├── example
├── .gitignore
├── .metadata
├── README.md
├── analysis_options.yaml
├── android
│ ├── .gitignore
│ ├── app
│ │ ├── build.gradle
│ │ └── src
│ │ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── example
│ │ │ │ │ └── example
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── res
│ │ │ │ ├── drawable-v21
│ │ │ │ └── launch_background.xml
│ │ │ │ ├── drawable
│ │ │ │ └── launch_background.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── values-night
│ │ │ │ └── styles.xml
│ │ │ │ └── values
│ │ │ │ └── styles.xml
│ │ │ └── profile
│ │ │ └── AndroidManifest.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ └── settings.gradle
├── ios
│ ├── .gitignore
│ ├── Flutter
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ └── Release.xcconfig
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ └── WorkspaceSettings.xcsettings
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ ├── Runner
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ │ ├── Icon-App-20x20@1x.png
│ │ │ │ ├── Icon-App-20x20@2x.png
│ │ │ │ ├── Icon-App-20x20@3x.png
│ │ │ │ ├── Icon-App-29x29@1x.png
│ │ │ │ ├── Icon-App-29x29@2x.png
│ │ │ │ ├── Icon-App-29x29@3x.png
│ │ │ │ ├── Icon-App-40x40@1x.png
│ │ │ │ ├── Icon-App-40x40@2x.png
│ │ │ │ ├── Icon-App-40x40@3x.png
│ │ │ │ ├── Icon-App-60x60@2x.png
│ │ │ │ ├── Icon-App-60x60@3x.png
│ │ │ │ ├── Icon-App-76x76@1x.png
│ │ │ │ ├── Icon-App-76x76@2x.png
│ │ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ │ └── LaunchImage.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── LaunchImage.png
│ │ │ │ ├── LaunchImage@2x.png
│ │ │ │ ├── LaunchImage@3x.png
│ │ │ │ └── README.md
│ │ ├── Base.lproj
│ │ │ ├── LaunchScreen.storyboard
│ │ │ └── Main.storyboard
│ │ ├── Info.plist
│ │ └── Runner-Bridging-Header.h
│ └── RunnerTests
│ │ └── RunnerTests.swift
├── lib
│ └── main.dart
├── linux
│ ├── .gitignore
│ ├── CMakeLists.txt
│ ├── flutter
│ │ ├── CMakeLists.txt
│ │ ├── generated_plugin_registrant.cc
│ │ ├── generated_plugin_registrant.h
│ │ └── generated_plugins.cmake
│ ├── main.cc
│ ├── my_application.cc
│ └── my_application.h
├── macos
│ ├── .gitignore
│ ├── Flutter
│ │ ├── Flutter-Debug.xcconfig
│ │ ├── Flutter-Release.xcconfig
│ │ └── GeneratedPluginRegistrant.swift
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ └── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ ├── Runner
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets
│ │ │ └── AppIcon.appiconset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── app_icon_1024.png
│ │ │ │ ├── app_icon_128.png
│ │ │ │ ├── app_icon_16.png
│ │ │ │ ├── app_icon_256.png
│ │ │ │ ├── app_icon_32.png
│ │ │ │ ├── app_icon_512.png
│ │ │ │ └── app_icon_64.png
│ │ ├── Base.lproj
│ │ │ └── MainMenu.xib
│ │ ├── Configs
│ │ │ ├── AppInfo.xcconfig
│ │ │ ├── Debug.xcconfig
│ │ │ ├── Release.xcconfig
│ │ │ └── Warnings.xcconfig
│ │ ├── DebugProfile.entitlements
│ │ ├── Info.plist
│ │ ├── MainFlutterWindow.swift
│ │ └── Release.entitlements
│ └── RunnerTests
│ │ └── RunnerTests.swift
├── pubspec.lock
├── pubspec.yaml
├── web
│ ├── favicon.png
│ ├── icons
│ │ ├── Icon-192.png
│ │ ├── Icon-512.png
│ │ ├── Icon-maskable-192.png
│ │ └── Icon-maskable-512.png
│ ├── index.html
│ └── manifest.json
└── windows
│ ├── .gitignore
│ ├── CMakeLists.txt
│ ├── flutter
│ ├── CMakeLists.txt
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugin_registrant.h
│ └── generated_plugins.cmake
│ └── runner
│ ├── CMakeLists.txt
│ ├── Runner.rc
│ ├── flutter_window.cpp
│ ├── flutter_window.h
│ ├── main.cpp
│ ├── resource.h
│ ├── resources
│ └── app_icon.ico
│ ├── runner.exe.manifest
│ ├── utils.cpp
│ ├── utils.h
│ ├── win32_window.cpp
│ └── win32_window.h
├── lib
├── base32
│ └── base32.dart
├── base58
│ ├── base58.dart
│ ├── base58_base.dart
│ ├── base58_ex.dart
│ └── base58_xmr.dart
├── bech32
│ ├── bch_bech32.dart
│ ├── bech32.dart
│ ├── bech32_base.dart
│ ├── bech32_ex.dart
│ ├── bech32_utils.dart
│ └── segwit_bech32.dart
├── bip
│ ├── address
│ │ ├── ada
│ │ │ ├── ada.dart
│ │ │ ├── ada_addres_type.dart
│ │ │ ├── ada_byron_addr.dart
│ │ │ ├── ada_shelley_addr.dart
│ │ │ ├── gneric_addr_decoder.dart
│ │ │ └── network.dart
│ │ ├── addr_dec_utils.dart
│ │ ├── addr_key_validator.dart
│ │ ├── algo_addr.dart
│ │ ├── aptos_addr.dart
│ │ ├── atom_addr.dart
│ │ ├── avax_addr.dart
│ │ ├── bch_addr_converter.dart
│ │ ├── decoder.dart
│ │ ├── decoders.dart
│ │ ├── egld_addr.dart
│ │ ├── encoder.dart
│ │ ├── encoders.dart
│ │ ├── eos_addr.dart
│ │ ├── ergo.dart
│ │ ├── eth_addr.dart
│ │ ├── exception
│ │ │ └── exception.dart
│ │ ├── fil_addr.dart
│ │ ├── icx_addr.dart
│ │ ├── inj_addr.dart
│ │ ├── nano_addr.dart
│ │ ├── near_addr.dart
│ │ ├── neo_addr.dart
│ │ ├── okex_addr.dart
│ │ ├── one_addr.dart
│ │ ├── p2pkh_addr.dart
│ │ ├── p2sh_addr.dart
│ │ ├── p2tr_addr.dart
│ │ ├── p2wpkh_addr.dart
│ │ ├── sol_addr.dart
│ │ ├── substrate_addr.dart
│ │ ├── sui.dart
│ │ ├── ton_addr.dart
│ │ ├── trx_addr.dart
│ │ ├── xlm_addr.dart
│ │ ├── xmr_addr.dart
│ │ ├── xrp_addr.dart
│ │ ├── xtz_addr.dart
│ │ └── zil_addr.dart
│ ├── algorand
│ │ ├── algorand.dart
│ │ └── mnemonic
│ │ │ ├── algorand_entropy_generator.dart
│ │ │ ├── algorand_mnemonic.dart
│ │ │ ├── algorand_mnemonic_decoder.dart
│ │ │ ├── algorand_mnemonic_encoder.dart
│ │ │ ├── algorand_mnemonic_generator.dart
│ │ │ ├── algorand_mnemonic_utils.dart
│ │ │ ├── algorand_mnemonic_validator.dart
│ │ │ └── algorand_seed_generator.dart
│ ├── bip.dart
│ ├── bip
│ │ ├── bip.dart
│ │ ├── bip32
│ │ │ ├── base
│ │ │ │ ├── bip32_base.dart
│ │ │ │ ├── ibip32_key_derivator.dart
│ │ │ │ └── ibip32_mst_key_generator.dart
│ │ │ ├── bip32.dart
│ │ │ ├── bip32_const.dart
│ │ │ ├── bip32_ex.dart
│ │ │ ├── bip32_key_data.dart
│ │ │ ├── bip32_key_net_ver.dart
│ │ │ ├── bip32_key_ser.dart
│ │ │ ├── bip32_keys.dart
│ │ │ ├── bip32_path.dart
│ │ │ ├── khalow
│ │ │ │ ├── bip32_kholaw_ed25519.dart
│ │ │ │ ├── bip32_kholaw_ed25519_key_derivator.dart
│ │ │ │ ├── bip32_kholaw_key_derivator_base.dart
│ │ │ │ └── bip32_kholaw_mst_key_generator.dart
│ │ │ └── slip10
│ │ │ │ ├── bip32_slip10_ed25519.dart
│ │ │ │ ├── bip32_slip10_ed25519_blake2b.dart
│ │ │ │ ├── bip32_slip10_key_derivator.dart
│ │ │ │ ├── bip32_slip10_mst_key_generator.dart
│ │ │ │ ├── bip32_slip10_nist256p1.dart
│ │ │ │ ├── bip32_slip10_nist256p1_hybrid.dart
│ │ │ │ └── bip32_slip10_secp256k1.dart
│ │ ├── bip38
│ │ │ ├── bip38.dart
│ │ │ ├── bip38_addr.dart
│ │ │ ├── bip38_base.dart
│ │ │ ├── bip38_ec.dart
│ │ │ └── bip38_no_ec.dart
│ │ ├── bip39
│ │ │ ├── bip39.dart
│ │ │ ├── bip39_entropy_generator.dart
│ │ │ ├── bip39_mnemonic.dart
│ │ │ ├── bip39_mnemonic_decoder.dart
│ │ │ ├── bip39_mnemonic_encoder.dart
│ │ │ ├── bip39_mnemonic_generator.dart
│ │ │ ├── bip39_mnemonic_utils.dart
│ │ │ ├── bip39_mnemonic_validator.dart
│ │ │ ├── bip39_seed_generator.dart
│ │ │ └── word_list
│ │ │ │ ├── chinese_simplified.dart
│ │ │ │ ├── chinese_traditional.dart
│ │ │ │ ├── czech.dart
│ │ │ │ ├── english.dart
│ │ │ │ ├── french.dart
│ │ │ │ ├── italian.dart
│ │ │ │ ├── japanese.dart
│ │ │ │ ├── korean.dart
│ │ │ │ ├── languages.dart
│ │ │ │ ├── portuguese.dart
│ │ │ │ └── spanish.dart
│ │ ├── bip44
│ │ │ ├── base
│ │ │ │ ├── bip44_base.dart
│ │ │ │ ├── bip44_base_ex.dart
│ │ │ │ └── bip44_keys.dart
│ │ │ ├── bip44.dart
│ │ │ └── bip44_base.dart
│ │ ├── bip49
│ │ │ ├── bip49.dart
│ │ │ └── bip49_base.dart
│ │ ├── bip84
│ │ │ ├── bip84.dart
│ │ │ └── bip84_base.dart
│ │ ├── bip86
│ │ │ ├── bip86.dart
│ │ │ └── bip86_base.dart
│ │ ├── conf
│ │ │ ├── bip
│ │ │ │ └── bip_coins.dart
│ │ │ ├── bip44
│ │ │ │ ├── bip44_coins.dart
│ │ │ │ └── bip44_conf.dart
│ │ │ ├── bip49
│ │ │ │ ├── bip49_coins.dart
│ │ │ │ └── bip49_conf.dart
│ │ │ ├── bip84
│ │ │ │ ├── bip84_coins.dart
│ │ │ │ └── bip84_conf.dart
│ │ │ ├── bip86
│ │ │ │ ├── bip86_coins.dart
│ │ │ │ └── bip86_conf.dart
│ │ │ ├── bip_config.dart
│ │ │ ├── config
│ │ │ │ ├── bip_bitcoin_cash_conf.dart
│ │ │ │ ├── bip_coin_conf.dart
│ │ │ │ └── bip_litecoin_conf.dart
│ │ │ ├── const
│ │ │ │ └── bip_conf_const.dart
│ │ │ └── core
│ │ │ │ ├── coin_conf.dart
│ │ │ │ └── coins.dart
│ │ └── types
│ │ │ └── types.dart
│ ├── cardano
│ │ ├── bip32
│ │ │ ├── cardano_byron_legacy_bip32.dart
│ │ │ ├── cardano_byron_legacy_key_derivator.dart
│ │ │ ├── cardano_byron_legacy_mst_key_generator.dart
│ │ │ ├── cardano_icarus_bip32.dart
│ │ │ └── cardano_icarus_mst_key_generator.dart
│ │ ├── byron
│ │ │ └── cardano_byron_legacy.dart
│ │ ├── cardano.dart
│ │ ├── cip1852
│ │ │ ├── cip1852.dart
│ │ │ └── conf
│ │ │ │ ├── cip1852_coins.dart
│ │ │ │ └── cip1852_conf.dart
│ │ ├── mnemonic
│ │ │ ├── cardano_byron_legacy_seed_generator.dart
│ │ │ └── cardano_icarus_seed_generator.dart
│ │ └── shelley
│ │ │ ├── cardano_shelley.dart
│ │ │ └── cardano_shelley_keys.dart
│ ├── coin_conf
│ │ ├── config.dart
│ │ ├── constant
│ │ │ └── coins_conf.dart
│ │ └── models
│ │ │ ├── coin_conf.dart
│ │ │ └── coins_name.dart
│ ├── ecc
│ │ ├── bip_ecc.dart
│ │ ├── curve
│ │ │ ├── elliptic_curve_getter.dart
│ │ │ └── elliptic_curve_types.dart
│ │ └── keys
│ │ │ ├── ecdsa_keys.dart
│ │ │ ├── ed25519_blake2b_keys.dart
│ │ │ ├── ed25519_keys.dart
│ │ │ ├── ed25519_kholaw_keys.dart
│ │ │ ├── ed25519_monero_keys.dart
│ │ │ ├── i_keys.dart
│ │ │ ├── nist256p1_keys.dart
│ │ │ ├── nist256p1_keys_hybrid.dart
│ │ │ ├── secp256k1_keys_ecdsa.dart
│ │ │ └── sr25519_keys.dart
│ ├── electrum
│ │ ├── electrum.dart
│ │ ├── electrum_v1.dart
│ │ ├── electrum_v2.dart
│ │ ├── mnemonic_v1
│ │ │ ├── electrum_v1_entropy_generator.dart
│ │ │ ├── electrum_v1_mnemonic.dart
│ │ │ ├── electrum_v1_mnemonic_decoder.dart
│ │ │ ├── electrum_v1_mnemonic_encoder.dart
│ │ │ ├── electrum_v1_mnemonic_generator.dart
│ │ │ ├── electrum_v1_mnemonic_utils.dart
│ │ │ ├── electrum_v1_mnemonic_validator.dart
│ │ │ ├── electrum_v1_seed_generator.dart
│ │ │ └── wrodlist
│ │ │ │ ├── english.dart
│ │ │ │ └── languages.dart
│ │ └── mnemonic_v2
│ │ │ ├── electrum_v2_entropy_generator.dart
│ │ │ ├── electrum_v2_mnemonic.dart
│ │ │ ├── electrum_v2_mnemonic_decoder.dart
│ │ │ ├── electrum_v2_mnemonic_encoder.dart
│ │ │ ├── electrum_v2_mnemonic_generator.dart
│ │ │ ├── electrum_v2_mnemonic_utils.dart
│ │ │ ├── electrum_v2_mnemonic_validator.dart
│ │ │ └── electrum_v2_seed_generator.dart
│ ├── mnemonic
│ │ ├── entropy_generator.dart
│ │ ├── mnemonic.dart
│ │ ├── mnemonic_decoder_base.dart
│ │ ├── mnemonic_encoder_base.dart
│ │ ├── mnemonic_ex.dart
│ │ ├── mnemonic_utils.dart
│ │ └── mnemonic_validator.dart
│ ├── monero
│ │ ├── conf
│ │ │ ├── monero_coin_conf.dart
│ │ │ ├── monero_coins.dart
│ │ │ └── monero_conf.dart
│ │ ├── mnemonic
│ │ │ ├── monero_entropy_generator.dart
│ │ │ ├── monero_mnemonic.dart
│ │ │ ├── monero_mnemonic_decoder.dart
│ │ │ ├── monero_mnemonic_encoder.dart
│ │ │ ├── monero_mnemonic_generator.dart
│ │ │ ├── monero_mnemonic_utils.dart
│ │ │ ├── monero_mnemonic_validator.dart
│ │ │ ├── monero_seed_generator.dart
│ │ │ └── words_list
│ │ │ │ ├── chinese_simplified.dart
│ │ │ │ ├── dutch.dart
│ │ │ │ ├── english.dart
│ │ │ │ ├── french.dart
│ │ │ │ ├── german.dart
│ │ │ │ ├── italian.dart
│ │ │ │ ├── japanese.dart
│ │ │ │ ├── languages.dart
│ │ │ │ ├── portuguese.dart
│ │ │ │ ├── russian.dart
│ │ │ │ └── spanish.dart
│ │ ├── monero.dart
│ │ ├── monero_base.dart
│ │ ├── monero_exc.dart
│ │ └── monero_subaddr.dart
│ ├── slip
│ │ ├── slip.dart
│ │ ├── slip173
│ │ │ └── slip173.dart
│ │ ├── slip32
│ │ │ ├── slip32.dart
│ │ │ └── slip32_key_net_ver.dart
│ │ └── slip44
│ │ │ └── slip44.dart
│ ├── substrate
│ │ ├── conf
│ │ │ ├── substrate_coin_conf.dart
│ │ │ ├── substrate_coins.dart
│ │ │ └── substrate_conf.dart
│ │ ├── core
│ │ │ └── substrate_base.dart
│ │ ├── exception
│ │ │ └── substrate_ex.dart
│ │ ├── keys
│ │ │ └── substrate_keys.dart
│ │ ├── path
│ │ │ └── substrate_path.dart
│ │ ├── scale
│ │ │ ├── substrate_scale_enc_base.dart
│ │ │ ├── substrate_scale_enc_bytes.dart
│ │ │ ├── substrate_scale_enc_cuint.dart
│ │ │ └── substrate_scale_enc_uint.dart
│ │ └── substrate.dart
│ ├── ton
│ │ ├── mnemonic
│ │ │ ├── ton_entropy_generator.dart
│ │ │ ├── ton_mnemonic_encoder.dart
│ │ │ ├── ton_mnemonic_generator.dart
│ │ │ ├── ton_mnemonic_language.dart
│ │ │ ├── ton_mnemonic_validator.dart
│ │ │ └── ton_seed_generator.dart
│ │ └── ton.dart
│ └── wif
│ │ └── wif.dart
├── blockchain_utils.dart
├── cbor
│ ├── cbor.dart
│ ├── core
│ │ ├── cbor.dart
│ │ └── tags.dart
│ ├── exception
│ │ └── exception.dart
│ ├── extention
│ │ └── extenton.dart
│ ├── types
│ │ ├── base.dart
│ │ ├── bigfloat.dart
│ │ ├── bigint.dart
│ │ ├── boolean.dart
│ │ ├── bytes.dart
│ │ ├── cbor_tag.dart
│ │ ├── datetime.dart
│ │ ├── decimal.dart
│ │ ├── double.dart
│ │ ├── int.dart
│ │ ├── int64.dart
│ │ ├── list.dart
│ │ ├── map.dart
│ │ ├── mime.dart
│ │ ├── null.dart
│ │ ├── regex.dart
│ │ ├── set.dart
│ │ ├── string.dart
│ │ ├── types.dart
│ │ └── url.dart
│ └── utils
│ │ ├── cbor_utils.dart
│ │ ├── dynamic_bytes.dart
│ │ ├── extentions.dart
│ │ └── float_utils.dart
├── crypto
│ ├── crypto
│ │ ├── aead
│ │ │ └── aead.dart
│ │ ├── aes
│ │ │ ├── aes.dart
│ │ │ ├── aes_lib.dart
│ │ │ └── padding.dart
│ │ ├── blockcipher
│ │ │ └── blockcipher.dart
│ │ ├── cdsa
│ │ │ ├── cdsa.dart
│ │ │ ├── crypto_ops
│ │ │ │ ├── const
│ │ │ │ │ └── const.dart
│ │ │ │ ├── crypto_ops.dart
│ │ │ │ ├── exception
│ │ │ │ │ └── exception.dart
│ │ │ │ ├── models
│ │ │ │ │ └── models.dart
│ │ │ │ └── operations
│ │ │ │ │ └── ops.dart
│ │ │ ├── curve
│ │ │ │ ├── curve.dart
│ │ │ │ └── curves.dart
│ │ │ ├── ecdsa
│ │ │ │ ├── private_key.dart
│ │ │ │ ├── public_key.dart
│ │ │ │ └── signature.dart
│ │ │ ├── eddsa
│ │ │ │ ├── keys.dart
│ │ │ │ └── keys
│ │ │ │ │ ├── privatekey.dart
│ │ │ │ │ └── publickey.dart
│ │ │ ├── musig2
│ │ │ │ ├── constants
│ │ │ │ │ └── const.dart
│ │ │ │ ├── exception
│ │ │ │ │ └── exception.dart
│ │ │ │ ├── musig2.dart
│ │ │ │ ├── musig2
│ │ │ │ │ └── musig2.dart
│ │ │ │ ├── types
│ │ │ │ │ └── types.dart
│ │ │ │ └── utils
│ │ │ │ │ └── utils.dart
│ │ │ ├── point
│ │ │ │ ├── base.dart
│ │ │ │ ├── ec_projective_point.dart
│ │ │ │ ├── edwards.dart
│ │ │ │ ├── point.dart
│ │ │ │ └── ristretto_point.dart
│ │ │ ├── rfc6979
│ │ │ │ └── rfc6979.dart
│ │ │ ├── secp256k1
│ │ │ │ ├── constants
│ │ │ │ │ ├── constants.dart
│ │ │ │ │ └── tables.dart
│ │ │ │ ├── impl
│ │ │ │ │ └── secp256k1.dart
│ │ │ │ ├── secp256k1.dart
│ │ │ │ └── types
│ │ │ │ │ └── types.dart
│ │ │ └── utils
│ │ │ │ ├── ed25519.dart
│ │ │ │ ├── ristretto.dart
│ │ │ │ ├── secp256k1.dart
│ │ │ │ └── utils.dart
│ │ ├── chacha
│ │ │ └── chacha.dart
│ │ ├── chacha20poly1305
│ │ │ └── chacha20poly1305.dart
│ │ ├── crc16
│ │ │ └── crc16.dart
│ │ ├── crc32
│ │ │ └── crc32.dart
│ │ ├── crypto.dart
│ │ ├── ctr
│ │ │ └── ctr.dart
│ │ ├── ecb
│ │ │ └── ecb.dart
│ │ ├── exception
│ │ │ └── exception.dart
│ │ ├── gcm
│ │ │ └── gcm.dart
│ │ ├── hash
│ │ │ ├── black2b
│ │ │ │ └── black2b.dart
│ │ │ ├── hash.dart
│ │ │ ├── keccack
│ │ │ │ └── sha3.dart
│ │ │ ├── md4
│ │ │ │ └── md4.dart
│ │ │ ├── md5
│ │ │ │ └── md5.dart
│ │ │ ├── ridemp
│ │ │ │ └── ridemp.dart
│ │ │ ├── sha1
│ │ │ │ └── sha1.dart
│ │ │ ├── sha224
│ │ │ │ └── sha224.dart
│ │ │ ├── sha256
│ │ │ │ └── sha256.dart
│ │ │ ├── sha384
│ │ │ │ └── sha384.dart
│ │ │ ├── sha512
│ │ │ │ └── sha512.dart
│ │ │ ├── sha512_256
│ │ │ │ └── sh512256.dart
│ │ │ └── xxhash64
│ │ │ │ └── xxhash64.dart
│ │ ├── hmac
│ │ │ └── hmac.dart
│ │ ├── pbkdf2
│ │ │ └── pbkdf2.dart
│ │ ├── poly1305
│ │ │ └── poly1305.dart
│ │ ├── prng
│ │ │ ├── fortuna.dart
│ │ │ └── gamma.dart
│ │ ├── schnorrkel
│ │ │ ├── keys
│ │ │ │ └── keys.dart
│ │ │ ├── merlin
│ │ │ │ └── transcript.dart
│ │ │ ├── shnorrkel.dart
│ │ │ └── strobe
│ │ │ │ └── strobe.dart
│ │ ├── scrypt
│ │ │ └── scrypt.dart
│ │ └── x_modem_crc
│ │ │ └── x_modem_crc.dart
│ └── quick_crypto.dart
├── double
│ ├── codec
│ │ ├── double_utils.dart
│ │ └── float_utils.dart
│ └── double_codec.dart
├── exception
│ ├── const
│ │ └── const.dart
│ ├── exception
│ │ ├── exception.dart
│ │ └── rpc_error.dart
│ └── exceptions.dart
├── helper
│ ├── extensions
│ │ └── extensions.dart
│ └── helper.dart
├── hex
│ └── hex.dart
├── layout
│ ├── byte
│ │ ├── byte_handler.dart
│ │ ├── reader.dart
│ │ └── writer.dart
│ ├── constant
│ │ └── constant.dart
│ ├── core
│ │ ├── core.dart
│ │ ├── core
│ │ │ └── core.dart
│ │ └── types
│ │ │ ├── array.dart
│ │ │ ├── bit_sequence.dart
│ │ │ ├── compact.dart
│ │ │ ├── compact_bytes.dart
│ │ │ ├── compact_layout.dart
│ │ │ ├── constant.dart
│ │ │ ├── coption_layout.dart
│ │ │ ├── custom_layout.dart
│ │ │ ├── lazy_struct.dart
│ │ │ ├── lazy_union.dart
│ │ │ ├── leb128.dart
│ │ │ ├── leb128_offset.dart
│ │ │ ├── map.dart
│ │ │ ├── none.dart
│ │ │ ├── numeric.dart
│ │ │ ├── optional_layout.dart
│ │ │ ├── padding_layout.dart
│ │ │ ├── raw.dart
│ │ │ ├── struct.dart
│ │ │ ├── tuple_layout.dart
│ │ │ ├── union.dart
│ │ │ └── xdr_bytes.dart
│ ├── exception
│ │ └── exception.dart
│ ├── layout.dart
│ └── utils
│ │ └── utils.dart
├── secret_wallet
│ ├── exception.dart
│ └── web3_storage_defination.dart
├── service
│ ├── const
│ │ └── constant.dart
│ ├── models
│ │ └── params.dart
│ ├── service.dart
│ └── utils
│ │ └── utils.dart
├── signer
│ ├── bitcoin
│ │ ├── bitcoin_key_signer.dart
│ │ └── bitcoin_signer.dart
│ ├── cardano
│ │ └── cardano_signer.dart
│ ├── const
│ │ └── constants.dart
│ ├── ed25519
│ │ └── ed25519.dart
│ ├── eth
│ │ └── eth_signer.dart
│ ├── exception
│ │ └── signing_exception.dart
│ ├── secp256k1
│ │ └── secp256k1_signer.dart
│ ├── secp256r1
│ │ └── secp256r1_signer.dart
│ ├── signer.dart
│ ├── signing_key
│ │ └── ecdsa_signing_key.dart
│ ├── substrate
│ │ ├── core
│ │ │ ├── signer.dart
│ │ │ └── verifier.dart
│ │ ├── signers
│ │ │ ├── substrate_ecdsa.dart
│ │ │ ├── substrate_eddsa.dart
│ │ │ └── substrate_sr25519.dart
│ │ └── substrate.dart
│ ├── tron
│ │ └── tron_signer.dart
│ ├── types
│ │ ├── eth_signature.dart
│ │ └── types.dart
│ ├── utils
│ │ └── utils.dart
│ └── xrp
│ │ └── xrp_signer.dart
├── ss58
│ ├── ss58.dart
│ ├── ss58_base.dart
│ └── ss58_ex.dart
├── utils
│ ├── binary
│ │ ├── binary_operation.dart
│ │ ├── bit_utils.dart
│ │ ├── bytes_tracker.dart
│ │ └── utils.dart
│ ├── compare
│ │ ├── compare.dart
│ │ └── hash_code.dart
│ ├── equatable
│ │ └── equatable.dart
│ ├── numbers
│ │ ├── numbers.dart
│ │ ├── rational
│ │ │ └── big_rational.dart
│ │ └── utils
│ │ │ ├── bigint_utils.dart
│ │ │ └── int_utils.dart
│ ├── string
│ │ └── string.dart
│ ├── tuple
│ │ └── tuple.dart
│ └── utils.dart
└── uuid
│ └── uuid.dart
├── pubspec.yaml
└── test
├── address
├── ada_byron
│ ├── byron_test.dart
│ ├── byron_test_vector.dart
│ └── lagacy_test_vector.dart
├── ada_shelly
│ ├── ada_shelly_test.dart
│ ├── stacking_test_vector.dart
│ └── test_vector.dart
├── algo
│ ├── algo_test.dart
│ └── test_vector.dart
├── aptos
│ ├── aptos_test.dart
│ └── test_vector.dart
├── atom
│ ├── atom_test.dart
│ └── test_vector.dart
├── avax
│ ├── avax_test.dart
│ ├── test_p_vector.dart
│ └── test_x_vector.dart
├── bch_p2pkh
│ ├── bch_p2pkh_test.dart
│ └── test_vector.dart
├── bch_p2sh
│ ├── bch_p2sh_test.dart
│ └── test_vector.dart
├── egld
│ ├── egld_test.dart
│ └── test_vector.dart
├── eos
│ ├── eos_test.dart
│ └── test_vector.dart
├── ergo
│ ├── ergo_test.dart
│ └── test_vector.dart
├── eth
│ ├── eth_test.dart
│ └── test_vector.dart
├── fil
│ ├── fil_test.dart
│ └── test_vector.dart
├── icx
│ ├── icx_test.dart
│ └── test_vector.dart
├── inj
│ ├── inj_test.dart
│ └── test_vector.dart
├── nano
│ ├── nano_test.dart
│ └── test_vector.dart
├── near
│ ├── near_test.dart
│ └── test_vector.dart
├── neo
│ ├── neo_test.dart
│ └── test_vector.dart
├── okex
│ ├── okex_test.dart
│ └── test_vector.dart
├── one
│ ├── one_test.dart
│ └── test_vector.dart
├── p2pkh
│ ├── comperesed_test_vector.dart
│ ├── p2pkh_test.dart
│ └── uncompresed_test_vector.dart
├── p2sh
│ ├── p2sh_test.dart
│ └── test_vector.dart
├── p2tr
│ ├── p2tr_test.dart
│ └── test_vector.dart
├── p2wpkh
│ ├── p2wpkh_test.dart
│ └── test_vector.dart
├── sol
│ ├── sol_test.dart
│ └── test_vector.dart
├── substrate
│ ├── substrate_test.dart
│ └── test_vector.dart
├── sui
│ ├── sui_test.dart
│ └── test_vector.dart
├── ton
│ ├── address_test.dart
│ └── test_vector.dart
├── trx
│ ├── test_vector.dart
│ └── trx_test.dart
├── xlm
│ ├── test_vector.dart
│ └── xml_test.dart
├── xmr
│ ├── test_vector.dart
│ ├── test_vector_integrate.dart
│ └── xmr_test.dart
├── xrp
│ ├── test_vector.dart
│ └── xrp_test.dart
├── xtz
│ ├── test_vector.dart
│ └── xtz_test.dart
└── zil
│ ├── test_vector.dart
│ └── zil_test.dart
├── algorand
├── mnemonic_test.dart
└── test_vector.dart
├── base58
├── base58_test.dart
└── base58_xmr_test.dart
├── bech32
├── bch_bech32_test.dart
├── bech32_test.dart
└── segwit_bech32_test.dart
├── bip
├── bip32
│ ├── ed25519
│ │ ├── ed25519_test.dart
│ │ └── test_vector.dart
│ ├── ed25519_blake2b
│ │ ├── ed25519_blake2b_test.dart
│ │ └── test_vector.dart
│ ├── ed25519_khalow
│ │ ├── ed25519_khalow_test.dart
│ │ └── test_vector.dart
│ ├── nist256p1
│ │ ├── nist256p1_test.dart
│ │ └── test_vector.dart
│ └── secp256k1
│ │ ├── secp256k1_test.dart
│ │ └── test_vector.dart
├── bip38
│ ├── bip38_addr_test.dart
│ ├── bip38_ec_test.dart
│ └── bip38_no_ec_test.dart
├── bip39
│ ├── bip39_test.dart
│ └── test_vector.dart
├── bip44
│ ├── bip44_test.dart
│ └── test_vector.dart
├── bip49
│ ├── bip49_test.dart
│ └── test_vector.dart
├── bip84
│ ├── bip84_test.dart
│ └── test_vector.dart
└── bip86
│ ├── bip86_test.dart
│ └── test_vector.dart
├── cardano
├── bip32
│ ├── icarus_test.dart
│ ├── icarus_test_vector.dart
│ ├── legacy_test.dart
│ └── test_vector.dart
├── byron
│ ├── byron_lagacy_test.dart
│ └── test_vector.dart
├── cip1852
│ ├── cip1852_test.dart
│ └── test_vector.dart
├── mnemonic
│ ├── mnemonic_test.dart
│ └── test_vector.dart
└── shelly
│ ├── shelly_test.dart
│ └── test_vector.dart
├── cbor_test.dart
├── crypto
├── aes
│ ├── aes_ctr_test.dart
│ └── test_vector.dart
├── blake2b
│ ├── blake2b_test.dart
│ └── test_vector.dart
├── chacha20_poly1305
│ ├── chacha20_poly1305_test.dart
│ └── test_vector.dart
├── crc32
│ ├── crc32_test.dart
│ └── test_vector.dart
├── hmac
│ ├── hmac_test.dart
│ └── test_vector.dart
├── keccack
│ ├── keccack_test.dart
│ └── test_vector.dart
├── md4
│ ├── md4_test.dart
│ └── test_vector.dart
├── md5
│ ├── md5_test.dart
│ └── test_vector.dart
├── pbkdf2
│ ├── pbkdf2_test.dart
│ └── test_vector.dart
├── ripemd
│ ├── ripemd_test.dart
│ └── test_vector.dart
├── scrypt
│ ├── scrypt_test.dart
│ └── test_vector.dart
├── sha1
│ ├── sha1_test.dart
│ └── test_vector.dart
├── sha256
│ ├── sha256_test.dart
│ └── test_vector.dart
├── sha3
│ ├── sha3_test.dart
│ └── test_vector.dart
├── sha512
│ ├── sha512_test.dart
│ └── test_vector.dart
├── sha512_256
│ ├── sha512_256_test.dart
│ └── test_vector.dart
├── shake
│ ├── shake_test.dart
│ ├── test_vector_128.dart
│ └── test_vector_256.dart
├── x_modem_crc
│ ├── test_vector.dart
│ └── x_modem_crc_test.dart
└── xxhash64
│ ├── test_vector.dart
│ └── xxhash64_test.dart
├── ecdsa
├── ed_test.dart
└── projective_test.dart
├── elctrum
├── mnemonic
│ ├── mnemonic_test.dart
│ ├── test_vector_v1.dart
│ └── test_vector_v2.dart
├── v1
│ ├── test_vectors.dart
│ └── v1_test.dart
└── v2
│ ├── segwit_test_vector.dart
│ ├── test_vector.dart
│ └── v2_test.dart
├── monero
├── mnemonic
│ ├── monero_mnemonic_test.dart
│ └── test_vector.dart
├── monero_test.dart
└── test_vector.dart
├── musig2
├── det_sign_vector.dart
├── det_sign_verify_test.dart
├── geneare_nonce_test.dart
├── generate_key_agg_test.dart
├── nonce_agg_test.dart
├── nonce_agg_test_vector.dart
├── nonce_vector.dart
├── sig_agg_test.dart
├── sig_agg_vector.dart
├── sign_verify_test.dart
├── sign_verify_vector.dart
└── test_vector.dart
├── quick_hex.dart
├── schnorrkel
├── derive_public_vector.dart
├── derive_test.dart
├── derive_test_vector.dart
├── key_test_vector.dart
├── schnorrkel_key_test.dart
├── sign_test.dart
├── sign_test_vector.dart
├── vrf2_test.dart
└── vrf_test_vector.dart
├── secp256k1
├── field_test.dart
├── group_test.dart
├── inv_test.dart
├── mult_test.dart
├── scalar_test.dart
├── test_constants.dart
└── tools.dart
├── secure_storage_test.dart
├── signer
├── bitcoin_test.dart
├── ed25519_test.dart
├── ethereum_test.dart
├── tron_test.dart
└── xrp_test.dart
├── ss58
└── ss58_test.dart
├── substrate
├── scale_test.dart
├── substrate_test.dart
└── test_vector.dart
├── ton
└── mnemonic_test.dart
├── uuid_test.dart
└── wif
└── wif_test.dart
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
26 | /pubspec.lock
27 | **/doc/api/
28 | .dart_tool/
29 | .packages
30 | build/
31 | lib.zip
32 | *.zip
33 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: "2524052335ec76bb03e04ede244b071f1b86d190"
8 | channel: "stable"
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at https://dart.dev/tools/linter-rules.
17 | #
18 | # Instead of disabling a lint rule for the entire project in the
19 | # section below, it can also be suppressed for a single line of code
20 | # or a specific dart file by using the `// ignore: name_of_lint` and
21 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
22 | # producing the lint.
23 | rules:
24 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
25 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
26 |
27 | # Additional information about this file can be found at
28 | # https://dart.dev/tools/analysis
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .packages
31 | .pub-cache/
32 | .pub/
33 | /build/
34 |
35 | # Symbolication related
36 | app.*.symbols
37 |
38 | # Obfuscation related
39 | app.*.map.json
40 |
41 | # Android Studio will place build artifacts here
42 | /android/app/debug
43 | /android/app/profile
44 | /android/app/release
45 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # example
2 |
3 | A new Flutter project.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
13 |
14 | For help getting started with Flutter development, view the
15 | [online documentation](https://docs.flutter.dev/), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/example/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at https://dart.dev/lints.
17 | #
18 | # Instead of disabling a lint rule for the entire project in the
19 | # section below, it can also be suppressed for a single line of code
20 | # or a specific dart file by using the `// ignore: name_of_lint` and
21 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
22 | # producing the lint.
23 | rules:
24 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
25 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
26 |
27 | # Additional information about this file can be found at
28 | # https://dart.dev/guides/language/analysis-options
29 |
--------------------------------------------------------------------------------
/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.example
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.7.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:7.3.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | mavenCentral()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | tasks.register("clean", Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
6 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | def flutterSdkPath = {
3 | def properties = new Properties()
4 | file("local.properties").withInputStream { properties.load(it) }
5 | def flutterSdkPath = properties.getProperty("flutter.sdk")
6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7 | return flutterSdkPath
8 | }
9 | settings.ext.flutterSdkPath = flutterSdkPath()
10 |
11 | includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
12 |
13 | plugins {
14 | id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
15 | }
16 | }
17 |
18 | include ":app"
19 |
20 | apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle"
21 |
--------------------------------------------------------------------------------
/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 11.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/example/ios/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/example/linux/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral
2 |
--------------------------------------------------------------------------------
/example/linux/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 |
10 | void fl_register_plugins(FlPluginRegistry* registry) {
11 | }
12 |
--------------------------------------------------------------------------------
/example/linux/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void fl_register_plugins(FlPluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/example/linux/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | )
7 |
8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
9 | )
10 |
11 | set(PLUGIN_BUNDLED_LIBRARIES)
12 |
13 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
18 | endforeach(plugin)
19 |
20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
23 | endforeach(ffi_plugin)
24 |
--------------------------------------------------------------------------------
/example/linux/main.cc:
--------------------------------------------------------------------------------
1 | #include "my_application.h"
2 |
3 | int main(int argc, char** argv) {
4 | g_autoptr(MyApplication) app = my_application_new();
5 | return g_application_run(G_APPLICATION(app), argc, argv);
6 | }
7 |
--------------------------------------------------------------------------------
/example/linux/my_application.h:
--------------------------------------------------------------------------------
1 | #ifndef FLUTTER_MY_APPLICATION_H_
2 | #define FLUTTER_MY_APPLICATION_H_
3 |
4 | #include
5 |
6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
7 | GtkApplication)
8 |
9 | /**
10 | * my_application_new:
11 | *
12 | * Creates a new Flutter-based application.
13 | *
14 | * Returns: a new #MyApplication.
15 | */
16 | MyApplication* my_application_new();
17 |
18 | #endif // FLUTTER_MY_APPLICATION_H_
19 |
--------------------------------------------------------------------------------
/example/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/dgph
7 | **/xcuserdata/
8 |
--------------------------------------------------------------------------------
/example/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 |
9 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
10 | }
11 |
--------------------------------------------------------------------------------
/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/macos/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | @NSApplicationMain
5 | class AppDelegate: FlutterAppDelegate {
6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
7 | return true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/example/macos/Runner/Configs/AppInfo.xcconfig:
--------------------------------------------------------------------------------
1 | // Application-level settings for the Runner target.
2 | //
3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
4 | // future. If not, the values below would default to using the project name when this becomes a
5 | // 'flutter create' template.
6 |
7 | // The application's name. By default this is also the title of the Flutter window.
8 | PRODUCT_NAME = example
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved.
15 |
--------------------------------------------------------------------------------
/example/macos/Runner/Configs/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Debug.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/macos/Runner/Configs/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Release.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/macos/Runner/Configs/Warnings.xcconfig:
--------------------------------------------------------------------------------
1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
2 | GCC_WARN_UNDECLARED_SELECTOR = YES
3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
6 | CLANG_WARN_PRAGMA_PACK = YES
7 | CLANG_WARN_STRICT_PROTOTYPES = YES
8 | CLANG_WARN_COMMA = YES
9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES
10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
12 | GCC_WARN_SHADOW = YES
13 | CLANG_WARN_UNREACHABLE_CODE = YES
14 |
--------------------------------------------------------------------------------
/example/macos/Runner/DebugProfile.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.cs.allow-jit
8 |
9 | com.apple.security.network.server
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/example/macos/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | $(PRODUCT_COPYRIGHT)
27 | NSMainNibFile
28 | MainMenu
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/example/macos/Runner/MainFlutterWindow.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | class MainFlutterWindow: NSWindow {
5 | override func awakeFromNib() {
6 | let flutterViewController = FlutterViewController()
7 | let windowFrame = self.frame
8 | self.contentViewController = flutterViewController
9 | self.setFrame(windowFrame, display: true)
10 |
11 | RegisterGeneratedPlugins(registry: flutterViewController)
12 |
13 | super.awakeFromNib()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/example/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/macos/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import FlutterMacOS
2 | import Cocoa
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/example/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/web/favicon.png
--------------------------------------------------------------------------------
/example/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/example/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/example/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/example/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/example/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example",
3 | "short_name": "example",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/example/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
--------------------------------------------------------------------------------
/example/windows/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 |
10 | void RegisterPlugins(flutter::PluginRegistry* registry) {
11 | }
12 |
--------------------------------------------------------------------------------
/example/windows/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void RegisterPlugins(flutter::PluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/example/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | )
7 |
8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
9 | )
10 |
11 | set(PLUGIN_BUNDLED_LIBRARIES)
12 |
13 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
18 | endforeach(plugin)
19 |
20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
23 | endforeach(ffi_plugin)
24 |
--------------------------------------------------------------------------------
/example/windows/runner/flutter_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_FLUTTER_WINDOW_H_
2 | #define RUNNER_FLUTTER_WINDOW_H_
3 |
4 | #include
5 | #include
6 |
7 | #include
8 |
9 | #include "win32_window.h"
10 |
11 | // A window that does nothing but host a Flutter view.
12 | class FlutterWindow : public Win32Window {
13 | public:
14 | // Creates a new FlutterWindow hosting a Flutter view running |project|.
15 | explicit FlutterWindow(const flutter::DartProject& project);
16 | virtual ~FlutterWindow();
17 |
18 | protected:
19 | // Win32Window:
20 | bool OnCreate() override;
21 | void OnDestroy() override;
22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,
23 | LPARAM const lparam) noexcept override;
24 |
25 | private:
26 | // The project to run.
27 | flutter::DartProject project_;
28 |
29 | // The Flutter instance hosted by this window.
30 | std::unique_ptr flutter_controller_;
31 | };
32 |
33 | #endif // RUNNER_FLUTTER_WINDOW_H_
34 |
--------------------------------------------------------------------------------
/example/windows/runner/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include "flutter_window.h"
6 | #include "utils.h"
7 |
8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
9 | _In_ wchar_t *command_line, _In_ int show_command) {
10 | // Attach to console when present (e.g., 'flutter run') or create a
11 | // new console when running with a debugger.
12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
13 | CreateAndAttachConsole();
14 | }
15 |
16 | // Initialize COM, so that it is available for use in the library and/or
17 | // plugins.
18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
19 |
20 | flutter::DartProject project(L"data");
21 |
22 | std::vector command_line_arguments =
23 | GetCommandLineArguments();
24 |
25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
26 |
27 | FlutterWindow window(project);
28 | Win32Window::Point origin(10, 10);
29 | Win32Window::Size size(1280, 720);
30 | if (!window.Create(L"example", origin, size)) {
31 | return EXIT_FAILURE;
32 | }
33 | window.SetQuitOnClose(true);
34 |
35 | ::MSG msg;
36 | while (::GetMessage(&msg, nullptr, 0, 0)) {
37 | ::TranslateMessage(&msg);
38 | ::DispatchMessage(&msg);
39 | }
40 |
41 | ::CoUninitialize();
42 | return EXIT_SUCCESS;
43 | }
44 |
--------------------------------------------------------------------------------
/example/windows/runner/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by Runner.rc
4 | //
5 | #define IDI_APP_ICON 101
6 |
7 | // Next default values for new objects
8 | //
9 | #ifdef APSTUDIO_INVOKED
10 | #ifndef APSTUDIO_READONLY_SYMBOLS
11 | #define _APS_NEXT_RESOURCE_VALUE 102
12 | #define _APS_NEXT_COMMAND_VALUE 40001
13 | #define _APS_NEXT_CONTROL_VALUE 1001
14 | #define _APS_NEXT_SYMED_VALUE 101
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/example/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mrtnetwork/blockchain_utils/9b93cad983328a88b62824448e019d6f044696a2/example/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/example/windows/runner/runner.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PerMonitorV2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/example/windows/runner/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_UTILS_H_
2 | #define RUNNER_UTILS_H_
3 |
4 | #include
5 | #include
6 |
7 | // Creates a console for the process, and redirects stdout and stderr to
8 | // it for both the runner and the Flutter library.
9 | void CreateAndAttachConsole();
10 |
11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string
12 | // encoded in UTF-8. Returns an empty std::string on failure.
13 | std::string Utf8FromUtf16(const wchar_t* utf16_string);
14 |
15 | // Gets the command line arguments passed in as a std::vector,
16 | // encoded in UTF-8. Returns an empty std::vector on failure.
17 | std::vector GetCommandLineArguments();
18 |
19 | #endif // RUNNER_UTILS_H_
20 |
--------------------------------------------------------------------------------
/lib/base58/base58.dart:
--------------------------------------------------------------------------------
1 | /// Library for working with Base58 encoding.
2 | library;
3 |
4 | /// Export statement for the core functionality of Base58 encoding.
5 | export 'base58_base.dart';
6 |
7 | /// Export statement for Base58 encoding with Monero (XMR) support.
8 | export 'base58_xmr.dart';
9 |
--------------------------------------------------------------------------------
/lib/base58/base58_ex.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/exception/exceptions.dart';
2 |
3 | /// An exception class representing an error related to Base58 checksum validation.
4 | class Base58ChecksumError extends BlockchainUtilsException {
5 | /// Constructor for creating a Base58ChecksumError with an optional error message.
6 | const Base58ChecksumError(super.message, {super.details});
7 | }
8 |
--------------------------------------------------------------------------------
/lib/bech32/bech32.dart:
--------------------------------------------------------------------------------
1 | /// Library for working with Bech32 encoding.
2 | library;
3 |
4 | /// Export statement for the core Bech32 functionality.
5 | export 'bech32_base.dart';
6 |
7 | /// Export statement for Bech32 utility functions.
8 | export 'bech32_utils.dart';
9 |
10 | /// Export statement for Bech32 encoding specific to Bitcoin Cash (BCH).
11 | export 'bch_bech32.dart';
12 |
13 | /// Export statement for Segregated Witness (SegWit) Bech32 encoding.
14 | export 'segwit_bech32.dart';
15 |
--------------------------------------------------------------------------------
/lib/bech32/bech32_ex.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/exception/exceptions.dart';
2 |
3 | /// An exception class representing errors related to Bech32 checksum validation.
4 | class Bech32ChecksumError extends BlockchainUtilsException {
5 | /// The error message associated with this checksum error.
6 | const Bech32ChecksumError(super.message, {super.details});
7 | }
8 |
--------------------------------------------------------------------------------
/lib/bip/address/ada/ada.dart:
--------------------------------------------------------------------------------
1 | export 'ada_addres_type.dart';
2 | export 'ada_byron_addr.dart';
3 | export 'ada_shelley_addr.dart';
4 | export 'gneric_addr_decoder.dart';
5 | export 'network.dart';
6 |
--------------------------------------------------------------------------------
/lib/bip/address/bch_addr_converter.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/bech32/bch_bech32.dart';
2 |
3 | /// Bitcoin Cash address converter class.
4 | /// It allows to convert a Bitcoin Cash address by changing its HRP and net version.
5 | class BchAddrConverter {
6 | /// Convert a Bitcoin Cash address by changing its HRP and net version.
7 | static String convert(String address, String hrp, List? netVer) {
8 | // Decode address
9 | final decode = BchBech32Decoder.decode(
10 | address.substring(0, address.indexOf(":")), address);
11 | final currNetVer = decode.item1;
12 | final data = decode.item2;
13 | // Encode again with new HRP and net version
14 | return BchBech32Encoder.encode(hrp, netVer ?? currNetVer, data);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/bip/address/decoder.dart:
--------------------------------------------------------------------------------
1 | /// An abstract class for decoding blockchain addresses.
2 | abstract class BlockchainAddressDecoder {
3 | /// Decodes a given blockchain address string.
4 | ///
5 | /// This method takes an address string and optional keyword arguments (kwargs)
6 | /// and decodes it into a List representing the decoded address.
7 | ///
8 | /// - [addr]: The blockchain address string to be decoded.
9 | /// - [kwargs]: Optional keyword arguments that can be used for configuration.
10 | ///
11 | /// Returns a List containing the decoded blockchain address.
12 | List decodeAddr(String addr, [Map kwargs = const {}]);
13 | }
14 |
--------------------------------------------------------------------------------
/lib/bip/address/encoder.dart:
--------------------------------------------------------------------------------
1 | /// An abstract class for encoding blockchain addresses.
2 | ///
3 | /// This abstract class defines a common interface for encoding blockchain addresses.
4 | /// Subclasses of this class will implement specific encoding algorithms for different
5 | /// blockchain networks.
6 | abstract class BlockchainAddressEncoder {
7 | /// Encodes a public key into a blockchain address.
8 | ///
9 | /// This method takes a public key in the form of a List and optional keyword
10 | /// arguments (kwargs) for additional configuration if required. It encodes the
11 | /// public key into a blockchain-specific address.
12 | ///
13 | /// - [pubKey]: The public key to be encoded as a blockchain address.
14 | /// - [kwargs]: Optional keyword arguments for encoder-specific options.
15 | ///
16 | /// Returns the blockchain address string representing the encoded public key.
17 | String encodeKey(List pubKey, [Map kwargs = const {}]);
18 | }
19 |
--------------------------------------------------------------------------------
/lib/bip/address/exception/exception.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/exception/exceptions.dart';
2 |
3 | class AddressConverterException extends BlockchainUtilsException {
4 | const AddressConverterException(super.message, {super.details});
5 | }
6 |
--------------------------------------------------------------------------------
/lib/bip/algorand/algorand.dart:
--------------------------------------------------------------------------------
1 | // This library, 'algorand_mnemonic', provides a comprehensive set of tools
2 | // for working with Algorand mnemonics, a critical component in the Algorand
3 | // blockchain ecosystem.
4 |
5 | library;
6 |
7 | // Export statement for the entropy generator module.
8 | export 'mnemonic/algorand_entropy_generator.dart';
9 |
10 | // Export statement for the Algorand mnemonic class.
11 | export 'mnemonic/algorand_mnemonic.dart';
12 |
13 | // Export statement for the mnemonic decoder module.
14 | export 'mnemonic/algorand_mnemonic_decoder.dart';
15 |
16 | // Export statement for the mnemonic encoder module.
17 | export 'mnemonic/algorand_mnemonic_encoder.dart';
18 |
19 | // Export statement for the mnemonic generator module.
20 | export 'mnemonic/algorand_mnemonic_generator.dart';
21 |
22 | // Export statement for the mnemonic utility functions module.
23 | export 'mnemonic/algorand_mnemonic_utils.dart';
24 |
25 | // Export statement for the seed generator module.
26 | export 'mnemonic/algorand_seed_generator.dart';
27 |
28 | // Export statement for the mnemonic validator module.
29 | export 'mnemonic/algorand_mnemonic_validator.dart';
30 |
--------------------------------------------------------------------------------
/lib/bip/algorand/mnemonic/algorand_mnemonic_validator.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/bip/algorand/mnemonic/algorand_mnemonic.dart';
2 | import 'package:blockchain_utils/bip/algorand/mnemonic/algorand_mnemonic_decoder.dart';
3 | import 'package:blockchain_utils/bip/mnemonic/mnemonic_validator.dart';
4 |
5 | /// A validator for Algorand mnemonic phrases.
6 | class AlgorandMnemonicValidator extends MnemonicValidator {
7 | /// The [AlgorandMnemonicValidator] class is used to validate Algorand
8 | /// mnemonic phrases. It utilizes the [AlgorandMnemonicDecoder] to decode the
9 | /// mnemonic and verify its integrity.
10 | ///
11 | /// Example usage:
12 | ///
13 | /// ```dart
14 | /// final validator = AlgorandMnemonicValidator(AlgorandLanguages.english);
15 | /// final isValid = validator.isValidMnemonic("your mnemonic phrase here");
16 | /// ```
17 | ///
18 | /// The [isValid] method can be used to check the validity of a given
19 | /// mnemonic phrase.
20 | AlgorandMnemonicValidator(
21 | [AlgorandLanguages? language = AlgorandLanguages.english])
22 | : super(AlgorandMnemonicDecoder(language));
23 | }
24 |
--------------------------------------------------------------------------------
/lib/bip/bip.dart:
--------------------------------------------------------------------------------
1 | library;
2 |
3 | /// Export for cryptocurrency address encoding utilities.
4 | export 'address/encoders.dart';
5 |
6 | /// Export for cryptocurrency address decoding utilities.
7 | export 'address/decoders.dart';
8 |
9 | /// Export for Algorand blockchain-specific utilities.
10 | export 'algorand/algorand.dart';
11 |
12 | /// Export for BIP (Bitcoin Improvement Proposals) utilities.
13 | export 'bip/bip.dart';
14 |
15 | /// Export for Cardano blockchain-specific utilities.
16 | export 'cardano/cardano.dart';
17 |
18 | /// Export for Electrum wallet and mnemonic utilities.
19 | export 'electrum/electrum.dart';
20 |
21 | /// Export for Monero-specific utilities, including mnemonics.
22 | export 'monero/monero.dart';
23 |
24 | /// Export for Substrate blockchain-specific utilities.
25 | export 'substrate/substrate.dart';
26 |
27 | /// Export for Wallet Import Format (WIF) encoding and decoding utilities.
28 | export 'wif/wif.dart';
29 |
30 | /// Exports modules related to ECC (Elliptic Curve Cryptography) in the context of BIP.
31 | export 'ecc/bip_ecc.dart';
32 |
33 | /// Exports utility functions related to TON mnemonic.
34 | export 'ton/ton.dart';
35 |
36 | /// Exports utility functions related to mnemonic.
37 | export 'mnemonic/mnemonic.dart';
38 |
39 | /// config of every bip coin
40 | export 'coin_conf/config.dart';
41 |
42 | export 'slip/slip.dart';
43 |
--------------------------------------------------------------------------------
/lib/bip/bip/bip32/base/ibip32_key_derivator.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/bip/bip/bip32/bip32_key_data.dart';
2 | import 'package:blockchain_utils/bip/bip/bip32/bip32_keys.dart';
3 | import 'package:blockchain_utils/bip/ecc/curve/elliptic_curve_types.dart';
4 | import 'package:blockchain_utils/utils/utils.dart';
5 |
6 | /// An abstract class that defines methods for BIP-32 key derivation.
7 | ///
8 | /// This class outlines key derivation methods for both public and private keys
9 | /// in the context of BIP-32 hierarchical deterministic keys.
10 | abstract class IBip32KeyDerivator {
11 | /// Checks if public key derivation is supported.
12 | bool isPublicDerivationSupported();
13 |
14 | /// Derives a child private key from the given private and public keys.
15 | ///
16 | /// The [privKey] parameter represents the parent private key, [pubKey] is the
17 | /// parent public key, [index] specifies the child key index, and [type] is the
18 | /// elliptic curve type.Tuple
19 | Tuple, List> ckdPriv(Bip32PrivateKey privKey,
20 | Bip32PublicKey pubKey, Bip32KeyIndex index, EllipticCurveTypes type);
21 |
22 | /// Derives a child public key from the given public key.
23 | ///
24 | /// The [pubKey] parameter represents the parent public key, [index] specifies
25 | /// the child key index, and [type] is the elliptic curve type.
26 | Tuple, List> ckdPub(
27 | Bip32PublicKey pubKey, Bip32KeyIndex index, EllipticCurveTypes type);
28 | }
29 |
--------------------------------------------------------------------------------
/lib/bip/bip/bip32/base/ibip32_mst_key_generator.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/utils/utils.dart';
2 |
3 | /// An abstract class that defines a method for generating master keys from a seed.
4 | ///
5 | /// This class outlines a method for generating BIP-32 master keys from seed bytes.
6 | abstract class IBip32MstKeyGenerator {
7 | /// Generates master keys from the given [seedBytes].
8 | ///
9 | /// The [seedBytes] parameter represents the seed data from which master keys are derived.
10 | /// The method returns a pair of [List] objects containing the private and public keys.
11 | Tuple, List> generateFromSeed(List seedBytes);
12 | }
13 |
--------------------------------------------------------------------------------
/lib/bip/bip/bip32/bip32_const.dart:
--------------------------------------------------------------------------------
1 | import 'bip32_key_net_ver.dart';
2 |
3 | /// The `Bip32Const` class defines constants for different Bip32KeyNetVersions.
4 | class Bip32Const {
5 | /// mainnet key net version
6 | static final Bip32KeyNetVersions mainNetKeyNetVersions = Bip32KeyNetVersions(
7 | List.from([0x04, 0x88, 0xb2, 0x1e]),
8 | List.from([0x04, 0x88, 0xad, 0xe4]));
9 |
10 | /// testnet key network version
11 | static final Bip32KeyNetVersions testNetKeyNetVersions = Bip32KeyNetVersions(
12 | List.from([0x04, 0x35, 0x87, 0xcf]),
13 | List.from([0x04, 0x35, 0x83, 0x94]));
14 |
15 | /// kholaw key net version
16 | static Bip32KeyNetVersions kholawKeyNetVersions = Bip32KeyNetVersions(
17 | List.from([0x04, 0x88, 0xb2, 0x1e]),
18 | List.from([0x0f, 0x43, 0x31, 0xd4]));
19 | }
20 |
--------------------------------------------------------------------------------
/lib/bip/bip/bip32/bip32_ex.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/exception/exceptions.dart';
2 |
3 | /// The `Bip32KeyError` class represents an exception that can be thrown in case
4 | /// of a key-related error during Bip32 key operations. It allows you to provide
5 | /// an optional error message to describe the specific issue. When caught, you
6 | /// can access the error message using the `toString()` method or the `message`
7 | /// property, if provided.
8 | class Bip32KeyError extends BlockchainUtilsException {
9 | const Bip32KeyError(super.message, {super.details});
10 | }
11 |
12 | /// The `Bip32PathError` class represents an exception that can be thrown in case
13 | /// of a path-related error during Bip32 operations. It is designed to handle
14 | /// errors associated with hierarchical deterministic paths. You can include
15 | /// an optional error message to describe the specific issue. To access the error
16 | /// message, use the `toString()` method or the `message` property, if provided.
17 | class Bip32PathError extends BlockchainUtilsException {
18 | const Bip32PathError(super.message, {super.details});
19 | }
20 |
--------------------------------------------------------------------------------
/lib/bip/bip/bip32/bip32_key_net_ver.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/exception/exceptions.dart';
2 | import 'package:blockchain_utils/helper/helper.dart';
3 |
4 | /// Contains constants related to BIP32 key network versions.
5 | class Bip32KeyNetVersionsConst {
6 | /// The byte length of a BIP32 key network version.
7 | static const int keyNetVersionByteLen = 4;
8 | }
9 |
10 | class Bip32KeyNetVersions {
11 | late final List _pubNetVer;
12 | late final List _privNetVer;
13 | Bip32KeyNetVersions._(this._pubNetVer, this._privNetVer);
14 |
15 | /// constractur for Bip32KeyNetVersions
16 | factory Bip32KeyNetVersions(List pubNetVer, List privNetVer) {
17 | if (pubNetVer.length != length || privNetVer.length != length) {
18 | throw const ArgumentException("Invalid key net version length");
19 | }
20 | return Bip32KeyNetVersions._(
21 | pubNetVer.asImmutableBytes, privNetVer.asImmutableBytes);
22 | }
23 |
24 | /// Get the key net version length.
25 | static int get length {
26 | return Bip32KeyNetVersionsConst.keyNetVersionByteLen;
27 | }
28 |
29 | /// Get public net version.
30 | List get public {
31 | return List.from(_pubNetVer);
32 | }
33 |
34 | /// Get private net version.
35 | List get private {
36 | return List.from(_privNetVer);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/lib/bip/bip/bip38/bip38.dart:
--------------------------------------------------------------------------------
1 | /// The 'bip38' library provides tools for working with BIP-38, a standard for
2 | /// encrypting and decrypting private keys in a human-readable format.
3 | library;
4 |
5 | /// Export statement for BIP-38 address-related functions and utilities.
6 | export 'bip38_addr.dart';
7 |
8 | /// Export statement for the BIP-38 base implementation.
9 | export 'bip38_base.dart';
10 |
11 | /// Export statement for BIP-38 functions related to elliptic curve cryptography.
12 | export 'bip38_ec.dart';
13 |
14 | /// Export statement for BIP-38 functions when no elliptic curve cryptography is used.
15 | export 'bip38_no_ec.dart';
16 |
--------------------------------------------------------------------------------
/lib/bip/bip/bip39/bip39_mnemonic_validator.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/bip/bip/bip39/bip39_mnemonic.dart';
2 | import 'package:blockchain_utils/bip/bip/bip39/bip39_mnemonic_decoder.dart';
3 | import 'package:blockchain_utils/bip/mnemonic/mnemonic.dart';
4 | import 'package:blockchain_utils/bip/mnemonic/mnemonic_validator.dart';
5 |
6 | /// Validates BIP39 mnemonics based on a specified language.
7 | ///
8 | /// The `Bip39MnemonicValidator` class is responsible for validating BIP39 mnemonics
9 | /// by using the `Bip39MnemonicDecoder` for decoding and checking the correctness of
10 | /// the mnemonic phrase. It ensures that the provided mnemonic follows the specified
11 | /// language's word list and can be successfully decoded.
12 | /// The [isValid] method can be used to check the validity of a given
13 | /// mnemonic phrase.
14 | class Bip39MnemonicValidator extends MnemonicValidator {
15 | /// Creates a new instance of the Bip39MnemonicValidator.
16 | ///
17 | /// The [language] parameter specifies the language used for the word list.
18 | Bip39MnemonicValidator([Bip39Languages? language])
19 | : super(Bip39MnemonicDecoder(language));
20 |
21 | bool validateWords(String mnemonic) {
22 | try {
23 | final mn = Mnemonic.fromString(mnemonic);
24 | final language = decoder.findLanguage(mn).item1;
25 | decoder.mnemonicToBinaryStr(mn, language);
26 | return true;
27 | } catch (e) {
28 | return false;
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/lib/bip/bip/bip44/base/bip44_base_ex.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/exception/exceptions.dart';
2 |
3 | /// Custom exception for errors related to BIP-44 depth.
4 | ///
5 | /// This class, `Bip44DepthError`, represents a custom exception for handling
6 | /// errors related to the BIP-44 hierarchical deterministic wallet structure's
7 | /// depth. It can be thrown to indicate issues with depth levels in BIP-44 paths.
8 | class Bip44DepthError extends BlockchainUtilsException {
9 | const Bip44DepthError(super.message, {super.details});
10 | }
11 |
--------------------------------------------------------------------------------
/lib/bip/bip/bip44/bip44.dart:
--------------------------------------------------------------------------------
1 | /// The 'bip44' library provides tools for working with BIP-44, a standard for
2 | /// hierarchical deterministic wallets and key derivation in cryptocurrencies.
3 | library;
4 |
5 | /// Export statement for the base BIP-44 implementation and key-related functions.
6 | export 'base/bip44_base.dart';
7 |
8 | /// Export statement for BIP-44 key-related functions and structures.
9 | export 'base/bip44_keys.dart';
10 |
11 | export 'base/bip44_base_ex.dart';
12 |
13 | /// Export statement for the BIP-44 base implementation, which includes key
14 | /// derivation and wallet management functions.
15 | export 'bip44_base.dart';
16 |
--------------------------------------------------------------------------------
/lib/bip/bip/bip49/bip49.dart:
--------------------------------------------------------------------------------
1 | /// The 'bip49' library provides tools for working with BIP-49, a standard for
2 | /// hierarchical deterministic wallets and key derivation in cryptocurrencies.
3 |
4 | /// Export statement for the BIP-49 base implementation, which includes key
5 | /// derivation and wallet management functions.
6 | library;
7 |
8 | export 'bip49_base.dart';
9 |
--------------------------------------------------------------------------------
/lib/bip/bip/bip84/bip84.dart:
--------------------------------------------------------------------------------
1 | /// The 'bip84' library provides tools for working with BIP-84, a standard for
2 | /// hierarchical deterministic wallets and key derivation in cryptocurrencies.
3 | library;
4 |
5 | /// Export statement for the BIP-84 base implementation, which includes key
6 | /// derivation and wallet management functions.
7 | export 'bip84_base.dart';
8 |
--------------------------------------------------------------------------------
/lib/bip/bip/bip86/bip86.dart:
--------------------------------------------------------------------------------
1 | /// The 'bip86' library provides tools for working with BIP-86, a standard for
2 | /// hierarchical deterministic wallets and key derivation in cryptocurrencies.
3 | library;
4 |
5 | /// Export statement for the BIP-86 base implementation, which includes key
6 | /// derivation and wallet management functions.
7 | export 'bip86_base.dart';
8 |
--------------------------------------------------------------------------------
/lib/bip/bip/conf/bip_config.dart:
--------------------------------------------------------------------------------
1 | /// The 'bip_config' library provides configuration files and information related to
2 | /// various BIP (Bitcoin Improvement Proposal) standards, including BIP-44, BIP-49, BIP-84,
3 | /// and BIP-86. It defines coin names, parameters, and coin configuration data for
4 | /// hierarchical deterministic wallets in cryptocurrencies, facilitating wallet development
5 | /// and key derivation for a variety of blockchain networks.
6 | library;
7 |
8 | export 'bip/bip_coins.dart';
9 |
10 | /// bip44
11 | export 'bip44/bip44_coins.dart';
12 | export 'bip44/bip44_conf.dart';
13 |
14 | /// bip49
15 | export 'bip49/bip49_coins.dart';
16 | export 'bip49/bip49_conf.dart';
17 |
18 | /// bip84
19 | export 'bip84/bip84_coins.dart';
20 | export 'bip84/bip84_conf.dart';
21 |
22 | /// bip86
23 | export 'bip86/bip86_coins.dart';
24 | export 'bip86/bip86_conf.dart';
25 |
26 | /// coin configs
27 | export 'config/bip_bitcoin_cash_conf.dart';
28 | export 'config/bip_coin_conf.dart';
29 | export 'config/bip_litecoin_conf.dart';
30 |
31 | /// coin constants
32 | export 'const/bip_conf_const.dart';
33 |
34 | /// crypto coin base class
35 | export 'core/coins.dart';
36 | export 'core/coin_conf.dart';
37 |
--------------------------------------------------------------------------------
/lib/bip/bip/types/types.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/exception/const/const.dart';
2 |
3 | /// Enumeration representing different modes for public keys used in P2PKH addresses.
4 | ///
5 | /// This enum defines different modes for public keys that can be used in P2PKH (Pay-to-Public-Key-Hash)
6 | /// addresses. These modes may include compressed and uncompressed public keys, among others.
7 | enum PubKeyModes {
8 | compressed(0),
9 | uncompressed(1);
10 |
11 | const PubKeyModes(this.value);
12 | final int value;
13 |
14 | bool get isCompressed => this == compressed;
15 |
16 | static PubKeyModes fromValue(int? value, {PubKeyModes? defaultValue}) {
17 | return values.firstWhere((e) => e.value == value, orElse: () {
18 | if (defaultValue != null && value == null) return defaultValue;
19 | throw ExceptionConst.itemNotFound(item: 'public format');
20 | });
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/lib/bip/cardano/mnemonic/cardano_icarus_seed_generator.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/bip/bip/bip39/bip39_mnemonic.dart';
2 | import 'package:blockchain_utils/bip/bip/bip39/bip39_mnemonic_decoder.dart';
3 |
4 | /// A class responsible for generating Cardano Icarus seeds from mnemonics.
5 | class CardanoIcarusSeedGenerator {
6 | final List _entropyBytes;
7 |
8 | /// Constructor to create a seed generator for Cardano Icarus wallets.
9 | ///
10 | /// It takes a mnemonic string as input, decodes it into entropy bytes.
11 | ///
12 | /// Parameters:
13 | /// - `mnemonic`: The mnemonic string used to generate the seed.
14 | /// - `language`: An optional parameter to specify the language used in the mnemonic.
15 | CardanoIcarusSeedGenerator(
16 | String mnemonic, {
17 | Bip39Languages? language,
18 | }) : _entropyBytes = Bip39MnemonicDecoder(language).decode(mnemonic);
19 |
20 | /// Generates and returns the Cardano Icarus seed as a `List`.
21 | List generate() {
22 | return List.from(_entropyBytes);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/lib/bip/coin_conf/config.dart:
--------------------------------------------------------------------------------
1 | export 'constant/coins_conf.dart';
2 | export 'models/coin_conf.dart';
3 | export 'models/coins_name.dart';
4 |
--------------------------------------------------------------------------------
/lib/bip/coin_conf/models/coins_name.dart:
--------------------------------------------------------------------------------
1 | /// A class that represents the names and abbreviations of a cryptocurrency coin.
2 | ///
3 | /// It stores the full name and its abbreviation, making it easy to access and display.
4 | class CoinNames {
5 | /// The full name of the cryptocurrency.
6 | final String name;
7 |
8 | /// The abbreviation or ticker symbol of the cryptocurrency.
9 | final String abbreviation;
10 |
11 | const CoinNames(this.name, this.abbreviation);
12 |
13 | @override
14 | String toString() {
15 | return name;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/lib/bip/ecc/bip_ecc.dart:
--------------------------------------------------------------------------------
1 | export 'curve/elliptic_curve_types.dart';
2 | export 'curve/elliptic_curve_getter.dart';
3 | export 'keys/ecdsa_keys.dart';
4 | export 'keys/ed25519_blake2b_keys.dart';
5 | export 'keys/ed25519_keys.dart';
6 | export 'keys/ed25519_kholaw_keys.dart';
7 | export 'keys/ed25519_monero_keys.dart';
8 | export 'keys/i_keys.dart';
9 | export 'keys/nist256p1_keys.dart';
10 | export 'keys/secp256k1_keys_ecdsa.dart';
11 | export 'keys/sr25519_keys.dart';
12 | export 'keys/nist256p1_keys_hybrid.dart';
13 |
--------------------------------------------------------------------------------
/lib/bip/ecc/curve/elliptic_curve_getter.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/bip/ecc/curve/elliptic_curve_types.dart';
2 | import 'package:blockchain_utils/crypto/crypto/cdsa/curve/curves.dart';
3 | import 'package:blockchain_utils/crypto/crypto/cdsa/point/base.dart';
4 |
5 | /// A utility class for obtaining elliptic curve generators based on curve types.
6 | class EllipticCurveGetter {
7 | /// Retrieves the elliptic curve generator based on the specified curve type.
8 | ///
9 | /// Parameters:
10 | /// - `type`: The type of elliptic curve.
11 | ///
12 | /// Returns an abstract elliptic curve point generator.
13 | static AbstractPoint generatorFromType(EllipticCurveTypes type) {
14 | switch (type) {
15 | case EllipticCurveTypes.secp256k1:
16 | return Curves.generatorSecp256k1;
17 | case EllipticCurveTypes.nist256p1:
18 | case EllipticCurveTypes.nist256p1Hybrid:
19 | return Curves.generator256;
20 | case EllipticCurveTypes.ed25519:
21 | case EllipticCurveTypes.ed25519Kholaw:
22 | return Curves.generatorED25519;
23 | default:
24 | throw UnimplementedError("generatorFromType does not provide curve.");
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lib/bip/ecc/curve/elliptic_curve_types.dart:
--------------------------------------------------------------------------------
1 | /// An enumeration of common elliptic curve types used in cryptographic operations.
2 | enum EllipticCurveTypes {
3 | /// Edwards-curve Digital Signature Algorithm (EdDSA) using ed25519 curve
4 | ed25519,
5 |
6 | /// EdDSA with Blake2b hash
7 | ed25519Blake2b,
8 |
9 | /// EdDSA with Kholaw's 25519 curve
10 | ed25519Kholaw,
11 |
12 | /// EdDSA curve used in Monero
13 | ed25519Monero,
14 |
15 | /// NIST P-256 elliptic curve
16 | nist256p1,
17 |
18 | /// Hybrid derivation using NIST P-256 elliptic curve
19 | nist256p1Hybrid,
20 |
21 | /// SECG secp256k1 elliptic curve
22 | secp256k1,
23 |
24 | /// Schnorr over Ristretto255 curve
25 | sr25519;
26 |
27 | /// Retrieves the [EllipticCurveTypes] from its string [name]
28 | static EllipticCurveTypes fromName(String name) {
29 | return EllipticCurveTypes.values.firstWhere(
30 | (element) => element.name == name,
31 | orElse: () => throw ArgumentError('Invalid curve type name: $name'),
32 | );
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/lib/bip/ecc/keys/ecdsa_keys.dart:
--------------------------------------------------------------------------------
1 | /// Constants related to ECDSA (Elliptic Curve Digital Signature Algorithm) keys.
2 | class EcdsaKeysConst {
3 | /// AffinePointt coordinate length in bytes
4 | static const int pointCoordByteLen = 32;
5 |
6 | /// Private key length in bytes
7 | static const int privKeyByteLen = 32;
8 |
9 | /// Uncompressed public key prefix
10 | static const List pubKeyUncompressedPrefix = [0x04];
11 |
12 | /// Compressed public key length in bytes
13 | static const int pubKeyCompressedByteLen = 33;
14 |
15 | /// Uncompressed public key length in bytes
16 | static const int pubKeyUncompressedByteLen = 65;
17 | }
18 |
--------------------------------------------------------------------------------
/lib/bip/electrum/electrum.dart:
--------------------------------------------------------------------------------
1 | /// The 'electrum' library provides tools for working with Electrum-style mnemonic phrases
2 | /// and address keys, including version 1 (v1) and version 2 (v2) of Electrum standards.
3 | library;
4 |
5 | /// Export statements for Electrum-style mnemonic version 1 (v1) components.
6 | export 'mnemonic_v1/electrum_v1_entropy_generator.dart';
7 | export 'mnemonic_v1/electrum_v1_mnemonic.dart';
8 | export 'mnemonic_v1/electrum_v1_mnemonic_decoder.dart';
9 | export 'mnemonic_v1/electrum_v1_mnemonic_encoder.dart';
10 | export 'mnemonic_v1/electrum_v1_mnemonic_generator.dart';
11 | export 'mnemonic_v1/electrum_v1_mnemonic_utils.dart';
12 | export 'mnemonic_v1/electrum_v1_mnemonic_validator.dart';
13 | export 'mnemonic_v1/electrum_v1_seed_generator.dart';
14 |
15 | /// Export statements for Electrum-style mnemonic version 2 (v2) components.
16 | export 'mnemonic_v2/electrum_v2_entropy_generator.dart';
17 | export 'mnemonic_v2/electrum_v2_mnemonic.dart';
18 | export 'mnemonic_v2/electrum_v2_mnemonic_decoder.dart';
19 | export 'mnemonic_v2/electrum_v2_mnemonic_encoder.dart';
20 | export 'mnemonic_v2/electrum_v2_mnemonic_generator.dart';
21 | export 'mnemonic_v2/electrum_v2_mnemonic_utils.dart';
22 | export 'mnemonic_v2/electrum_v2_mnemonic_validator.dart';
23 | export 'mnemonic_v2/electrum_v2_seed_generator.dart';
24 |
25 | /// Export statement for Electrum-style version 1 (v1) address keys and derivation.
26 | export 'electrum_v1.dart';
27 |
28 | /// Export statement for Electrum-style version 2 (v2) address keys and derivation.
29 | export 'electrum_v2.dart';
30 |
--------------------------------------------------------------------------------
/lib/bip/electrum/mnemonic_v1/electrum_v1_mnemonic_validator.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/bip/electrum/mnemonic_v1/electrum_v1_mnemonic.dart';
2 | import 'package:blockchain_utils/bip/electrum/mnemonic_v1/electrum_v1_mnemonic_decoder.dart';
3 | import 'package:blockchain_utils/bip/mnemonic/mnemonic_validator.dart';
4 |
5 | /// A class for validating Electrum V1 mnemonics, extending the MnemonicValidator class.
6 | class ElectrumV1MnemonicValidator extends MnemonicValidator {
7 | /// Constructs an ElectrumV1MnemonicValidator with an optional language specification.
8 | ///
9 | /// The validator is initialized with an `ElectrumV1MnemonicDecoder` that uses the specified language
10 | /// (default: English) for decoding Electrum V1 mnemonics.
11 | ///
12 | /// [language]: The language to use for mnemonic decoding (default: English).
13 | ElectrumV1MnemonicValidator(
14 | [ElectrumV1Languages? language = ElectrumV1Languages.english])
15 | : super(ElectrumV1MnemonicDecoder(language));
16 | }
17 |
--------------------------------------------------------------------------------
/lib/bip/electrum/mnemonic_v1/wrodlist/languages.dart:
--------------------------------------------------------------------------------
1 | /// Library for Electrum V1 mnemonic language support.
2 |
3 | library;
4 |
5 | /// Part for the English Electrum V1 mnemonic language.
6 | part 'english.dart';
7 |
8 | /// A list of Electrum V1 mnemonic words, specifically for the English language.
9 | List get elctrumMnemonicWordsList => _english;
10 |
--------------------------------------------------------------------------------
/lib/bip/electrum/mnemonic_v2/electrum_v2_mnemonic_validator.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/bip/electrum/mnemonic_v2/electrum_v2_mnemonic.dart';
2 | import 'package:blockchain_utils/bip/electrum/mnemonic_v2/electrum_v2_mnemonic_decoder.dart';
3 | import 'package:blockchain_utils/bip/mnemonic/mnemonic_validator.dart';
4 |
5 | /// Validator class for Electrum V2 mnemonics.
6 | class ElectrumV2MnemonicValidator extends MnemonicValidator {
7 | /// Creates a new instance of the Electrum V2 mnemonic validator.
8 | ///
9 | /// [v2mnemonicTypes] (Optional) The specific type of Electrum V2 mnemonic to validate.
10 | /// [language] (Optional) The language to use for validation.
11 | ElectrumV2MnemonicValidator(
12 | {ElectrumV2MnemonicTypes? v2mnemonicTypes, ElectrumV2Languages? language})
13 | : super(ElectrumV2MnemonicDecoder(
14 | mnemonicType: v2mnemonicTypes, language: language));
15 | }
16 |
--------------------------------------------------------------------------------
/lib/bip/mnemonic/entropy_generator.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/crypto/quick_crypto.dart';
2 |
3 | /// A class for generating cryptographically secure random entropy.
4 | ///
5 | /// The [EntropyGenerator] class is designed to produce random entropy with a specified bit length.
6 | /// It uses a cryptographically secure random number generator to generate the entropy.
7 | class EntropyGenerator {
8 | final int bitlen;
9 |
10 | /// Creates an [EntropyGenerator] instance with the desired bit length.
11 | ///
12 | /// The [bitlen] parameter specifies the length of the entropy in bits.
13 | EntropyGenerator(this.bitlen);
14 |
15 | /// Generates and returns random entropy as a [List].
16 | ///
17 | /// The length of the generated entropy is determined by the [bitlen] parameter, and it is converted
18 | /// to bytes (rounded up to the nearest byte).
19 | List generate() {
20 | return QuickCrypto.generateRandom(bitlen ~/ 8);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/lib/bip/mnemonic/mnemonic_encoder_base.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/bip/mnemonic/mnemonic.dart';
2 | import 'package:blockchain_utils/bip/mnemonic/mnemonic_utils.dart';
3 |
4 | /// An abstract class for encoding binary entropy data into human-readable mnemonic phrases.
5 | ///
6 | /// Subclasses of this class implement specific encoding algorithms for different mnemonic standards.
7 | abstract class MnemonicEncoderBase {
8 | /// The list of words used for encoding.
9 | final MnemonicWordsList wordsList;
10 |
11 | /// Creates an instance of MnemonicEncoderBase.
12 | ///
13 | /// The [language] parameter specifies the language used for the mnemonic words.
14 | /// The [wordsListGetter] is a helper class to retrieve the appropriate words list.
15 | MnemonicEncoderBase(
16 | MnemonicLanguages language, MnemonicWordsListGetterBase wordsListGetter)
17 | : wordsList = wordsListGetter.getByLanguage(language);
18 |
19 | /// Encodes the provided binary entropy data into a human-readable mnemonic phrase.
20 | ///
21 | /// The [entropyBytes] parameter is the binary entropy data to be encoded.
22 | Mnemonic encode(List entropyBytes);
23 | }
24 |
--------------------------------------------------------------------------------
/lib/bip/mnemonic/mnemonic_ex.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/exception/exceptions.dart';
2 |
3 | /// An exception representing an error related to mnemonic.
4 | class MnemonicException extends BlockchainUtilsException {
5 | const MnemonicException(super.message, {super.details});
6 | }
7 |
--------------------------------------------------------------------------------
/lib/bip/mnemonic/mnemonic_validator.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/bip/mnemonic/mnemonic_decoder_base.dart';
2 |
3 | /// Utility class for validating and checking the validity of mnemonic phrases.
4 | ///
5 | /// The `MnemonicValidator` class provides methods to validate and determine the
6 | /// validity of mnemonic phrases using a specified `MnemonicDecoderBase`. It can
7 | /// check whether a given mnemonic phrase is valid and adheres to the expected format.
8 | class MnemonicValidator {
9 | final T decoder;
10 |
11 | /// Creates a new instance of the MnemonicValidator with the provided [decoder].
12 | ///
13 | /// The [decoder] is responsible for decoding and verifying the correctness
14 | /// of the mnemonic phrase.
15 | MnemonicValidator(this.decoder);
16 |
17 | /// Validates a given [mnemonic] phrase using the associated decoder.
18 | ///
19 | /// Throws an exception if the mnemonic phrase is invalid or cannot be decoded.
20 | void validate(String mnemonic) {
21 | decoder.decode(mnemonic);
22 | }
23 |
24 | /// Checks if a given [mnemonic] phrase is valid.
25 | ///
26 | /// Returns `true` if the mnemonic is valid, `false` otherwise.
27 | bool isValid(String mnemonic) {
28 | try {
29 | validate(mnemonic);
30 | return true;
31 | } catch (e) {
32 | return false;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/lib/bip/monero/conf/monero_conf.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/bip/bip/conf/core/coin_conf.dart';
2 | import 'package:blockchain_utils/bip/coin_conf/constant/coins_conf.dart';
3 | import 'package:blockchain_utils/bip/monero/conf/monero_coin_conf.dart';
4 |
5 | /// A configuration class for Monero that defines the key network versions and
6 | /// maps each supported MoneroCoins to its corresponding BipCoinConfig.
7 | class MoneroConf {
8 | // Configuration for Monero main net
9 | static final MoneroCoinConf mainNet = MoneroCoinConf.fromCoinConf(
10 | coinConf: CoinsConf.moneroMainNet, chainType: ChainType.mainnet);
11 |
12 | // Configuration for Monero stage net
13 | static final MoneroCoinConf stageNet = MoneroCoinConf.fromCoinConf(
14 | coinConf: CoinsConf.moneroStageNet, chainType: ChainType.testnet);
15 |
16 | // Configuration for Monero test net
17 | static final MoneroCoinConf testNet = MoneroCoinConf.fromCoinConf(
18 | coinConf: CoinsConf.moneroTestNet, chainType: ChainType.testnet);
19 | }
20 |
--------------------------------------------------------------------------------
/lib/bip/monero/mnemonic/monero_mnemonic_validator.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/bip/monero/mnemonic/monero_mnemonic.dart';
2 | import 'package:blockchain_utils/bip/monero/mnemonic/monero_mnemonic_decoder.dart';
3 | import 'package:blockchain_utils/bip/mnemonic/mnemonic_validator.dart';
4 |
5 | /// A class for validating Monero mnemonics.
6 | ///
7 | /// This class extends `MnemonicValidator` and is specialized for validating Monero mnemonics.
8 | /// It uses a `MoneroMnemonicDecoder` for decoding and validating Monero mnemonics.
9 | ///
10 | /// [language]: The Monero language used for validation. Defaults to null, allowing the decoder
11 | /// to use the default language.
12 | class MoneroMnemonicValidator extends MnemonicValidator {
13 | /// Constructs a MoneroMnemonicValidator with an optional language parameter.
14 | ///
15 | /// [language]: The Monero language used for validation. Defaults to null.
16 | MoneroMnemonicValidator([MoneroLanguages? language])
17 | : super(MoneroMnemonicDecoder(language));
18 | }
19 |
--------------------------------------------------------------------------------
/lib/bip/monero/mnemonic/monero_seed_generator.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/bip/monero/mnemonic/monero_mnemonic.dart';
2 | import 'package:blockchain_utils/bip/monero/mnemonic/monero_mnemonic_decoder.dart';
3 | import 'package:blockchain_utils/bip/mnemonic/mnemonic.dart';
4 |
5 | /// A class responsible for generating a seed from Monero mnemonic entropy.
6 | ///
7 | /// This class takes a Monero mnemonic, decodes it to obtain the associated entropy bytes,
8 | /// and allows you to generate a seed from that entropy. The generated seed can be used
9 | /// as a cryptographic seed in Monero-related operations.
10 | class MoneroSeedGenerator {
11 | final List _entropyBytes;
12 |
13 | /// Constructs a MoneroSeedGenerator with a Monero mnemonic and an optional language.
14 | ///
15 | /// [mnemonic]: The Monero mnemonic from which to derive the seed.
16 | /// [language]: The Monero language used for decoding. Defaults to null, allowing the decoder
17 | /// to use the default language.
18 | MoneroSeedGenerator(Mnemonic mnemonic, [MoneroLanguages? language])
19 | : _entropyBytes =
20 | MoneroMnemonicDecoder(language).decode(mnemonic.toStr());
21 |
22 | /// Generates a seed from the decoded entropy bytes.
23 | ///
24 | /// This method generates a seed from the decoded entropy bytes obtained from the
25 | /// Monero mnemonic. The seed can be used for cryptographic purposes.
26 | ///
27 | /// Returns a `List` containing the generated seed.
28 | List generate() => List.from(_entropyBytes);
29 | }
30 |
--------------------------------------------------------------------------------
/lib/bip/monero/monero.dart:
--------------------------------------------------------------------------------
1 | /// The 'monero' library provides tools for working with Monero cryptocurrency, including
2 | /// configuration data, mnemonic phrases, keys, and address generation.
3 | library;
4 |
5 | /// Export statement for Monero coin definitions and configuration.
6 | export 'conf/monero_coins.dart';
7 | export 'conf/monero_conf.dart';
8 |
9 | /// Export statements for Monero mnemonic-related components.
10 | export 'mnemonic/monero_entropy_generator.dart';
11 | export 'mnemonic/monero_mnemonic.dart';
12 | export 'mnemonic/monero_mnemonic_decoder.dart';
13 | export 'mnemonic/monero_mnemonic_encoder.dart';
14 | export 'mnemonic/monero_mnemonic_generator.dart';
15 | export 'mnemonic/monero_mnemonic_utils.dart';
16 | export 'mnemonic/monero_mnemonic_validator.dart';
17 | export 'mnemonic/monero_seed_generator.dart';
18 | export 'mnemonic/words_list/languages.dart';
19 |
20 | /// Export statement for Monero base components, including address generation.
21 | export 'monero_base.dart';
22 |
23 | /// Export statement for Monero subaddress components.
24 | export 'monero_subaddr.dart';
25 |
--------------------------------------------------------------------------------
/lib/bip/monero/monero_exc.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/exception/exceptions.dart';
2 |
3 | /// An exception class representing an error related to Monero keys.
4 | ///
5 | /// This exception class is used to represent errors and exceptions related to Monero keys.
6 | class MoneroKeyError extends BlockchainUtilsException {
7 | const MoneroKeyError(super.message, {super.details});
8 | }
9 |
--------------------------------------------------------------------------------
/lib/bip/slip/slip.dart:
--------------------------------------------------------------------------------
1 | export 'slip173/slip173.dart';
2 | export 'slip32/slip32.dart';
3 | export 'slip32/slip32_key_net_ver.dart';
4 | export 'slip44/slip44.dart';
5 |
--------------------------------------------------------------------------------
/lib/bip/slip/slip173/slip173.dart:
--------------------------------------------------------------------------------
1 | /// SLIP-0173 class.
2 | /// It defines the human-readable parts in accordance with SLIP-0173.
3 | class Slip173 {
4 | static const String akashNetwork = "akash";
5 | static const String axelar = "axelar";
6 | static const String bandProtocol = "band";
7 | static const String binanceChain = "bnb";
8 | static const String bitcoinMainnet = "bc";
9 | static const String bitcoinTestnet = "tb";
10 | static const String certik = "certik";
11 | static const String chihuahua = "chihuahua";
12 | static const String cosmos = "cosmos";
13 | static const String elrond = "erd";
14 | static const String harmonyOne = "one";
15 | static const String injective = "inj";
16 | static const String irisNetwork = "iaa";
17 | static const String kava = "kava";
18 | static const String litecoinMainnet = "ltc";
19 | static const String litecoinTestnet = "tltc";
20 | static const String okexChain = "ex";
21 | static const String osmosis = "osmo";
22 | static const String secretNetwork = "secret";
23 | static const String terra = "terra";
24 | static const String zilliqa = "zil";
25 | static const String electraProtocol = "ep";
26 | static const String electraProtocolTestnet = "te";
27 | }
28 |
--------------------------------------------------------------------------------
/lib/bip/substrate/exception/substrate_ex.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/exception/exceptions.dart';
2 |
3 | /// An exception class representing an error related to Substrate keys.
4 | class SubstrateKeyError extends BlockchainUtilsException {
5 | const SubstrateKeyError(super.message, {super.details});
6 | }
7 |
8 | /// An exception class representing an error related to Substrate paths.
9 | class SubstratePathError extends BlockchainUtilsException {
10 | const SubstratePathError(super.message, {super.details});
11 | }
12 |
--------------------------------------------------------------------------------
/lib/bip/substrate/scale/substrate_scale_enc_base.dart:
--------------------------------------------------------------------------------
1 | /// An abstract base class for encoding values in Substrate SCALE format.
2 | abstract class SubstrateScaleEncoderBase {
3 | const SubstrateScaleEncoderBase();
4 |
5 | /// Encode the provided [value] into a `List` in Substrate SCALE format.
6 | List encode(String value);
7 | }
8 |
--------------------------------------------------------------------------------
/lib/bip/substrate/scale/substrate_scale_enc_bytes.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/bip/substrate/scale/substrate_scale_enc_base.dart';
2 | import 'package:blockchain_utils/bip/substrate/scale/substrate_scale_enc_cuint.dart';
3 | import 'package:blockchain_utils/utils/utils.dart';
4 |
5 | /// A Substrate SCALE encoder for string values represented as bytes.
6 | class SubstrateScaleBytesEncoder extends SubstrateScaleEncoderBase {
7 | const SubstrateScaleBytesEncoder();
8 |
9 | /// Encode the provided [value] as bytes and wrap it in Substrate SCALE format.
10 | @override
11 | List encode(String value) {
12 | final toBytes = StringUtils.encode(value);
13 | final List lengthBytes =
14 | const SubstrateScaleCUintEncoder().encode(toBytes.length.toString());
15 | return List.from([...lengthBytes, ...toBytes]);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/lib/bip/substrate/substrate.dart:
--------------------------------------------------------------------------------
1 | /// The 'substrate' library provides tools for working with the Substrate blockchain
2 | /// ecosystem, including coin definitions, configuration data, and encoding utilities.
3 | library;
4 |
5 | /// Export statement for Substrate coin definitions and configuration.
6 | export 'conf/substrate_coins.dart';
7 | export 'conf/substrate_conf.dart';
8 |
9 | /// Export statements for Substrate SCALE encoding utilities.
10 | export 'scale/substrate_scale_enc_base.dart';
11 | export 'scale/substrate_scale_enc_bytes.dart';
12 | export 'scale/substrate_scale_enc_cuint.dart';
13 | export 'scale/substrate_scale_enc_uint.dart';
14 |
15 | /// Export statement for Substrate base components, including key, derivation, address.
16 | export 'core/substrate_base.dart';
17 |
18 | /// Export statement for Substrate key management components.
19 | export 'keys/substrate_keys.dart';
20 |
21 | /// Export statement for Substrate path components.
22 | export 'path/substrate_path.dart';
23 |
--------------------------------------------------------------------------------
/lib/bip/ton/mnemonic/ton_mnemonic_language.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/bip/bip/bip39/bip39.dart';
2 | import 'package:blockchain_utils/bip/mnemonic/mnemonic_ex.dart';
3 | import 'package:blockchain_utils/bip/mnemonic/mnemonic_utils.dart';
4 | import 'package:blockchain_utils/bip/bip/bip39/word_list/languages.dart'
5 | as languages;
6 |
7 | /// The TonMnemonicLanguages class implements the Bip39Languages interface to
8 | /// provide support for BIP-39 mnemonic languages, specifically tailored for TON (The Open Network).
9 | class TonMnemonicLanguages implements Bip39Languages {
10 | @override
11 | final String name;
12 |
13 | /// Predefined constant for the English language.
14 | static const TonMnemonicLanguages english = TonMnemonicLanguages._("English");
15 |
16 | /// Private constructor for defining language instances.
17 | const TonMnemonicLanguages._(this.name);
18 |
19 | /// List of all supported TonMnemonicLanguages instances.
20 | static const List values = [english];
21 |
22 | // Retrieves the word list associated with the language instance.
23 | @override
24 | List get wordList {
25 | switch (this) {
26 | case TonMnemonicLanguages.english:
27 | return languages.bip39WordList(Bip39Languages.english);
28 | default:
29 | throw const MnemonicException(
30 | "TonMnemonicLanguages only support english");
31 | }
32 | }
33 |
34 | /// Provides a list of all mnemonic language values.
35 | @override
36 | List get languageValues => TonMnemonicLanguages.values;
37 | }
38 |
--------------------------------------------------------------------------------
/lib/bip/ton/ton.dart:
--------------------------------------------------------------------------------
1 | export 'mnemonic/ton_entropy_generator.dart';
2 | export 'mnemonic/ton_mnemonic_encoder.dart';
3 | export 'mnemonic/ton_mnemonic_generator.dart';
4 | export 'mnemonic/ton_mnemonic_language.dart';
5 | export 'mnemonic/ton_mnemonic_validator.dart';
6 | export 'mnemonic/ton_seed_generator.dart';
7 |
--------------------------------------------------------------------------------
/lib/cbor/cbor.dart:
--------------------------------------------------------------------------------
1 | /// Library for working with Concise Binary Object Representation (CBOR) data format.
2 | library;
3 |
4 | /// Export statement for the core CBOR data types and decode functionality.
5 | export 'core/cbor.dart';
6 |
7 | export 'types/types.dart';
8 |
9 | export 'exception/exception.dart';
10 |
--------------------------------------------------------------------------------
/lib/cbor/exception/exception.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/exception/exceptions.dart';
2 |
3 | class CborException extends BlockchainUtilsException {
4 | const CborException(super.message, {super.details});
5 | }
6 |
--------------------------------------------------------------------------------
/lib/cbor/extention/extenton.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/blockchain_utils.dart';
2 |
3 | extension QuickCastingCbor on CborObject {
4 | T cast() {
5 | if (this is T) return this as T;
6 | throw CborException("cbor object casting faild",
7 | details: {"expected": "$T", "value": runtimeType.toString()});
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/lib/cbor/types/boolean.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/utils/utils.dart';
2 | import 'package:blockchain_utils/cbor/utils/dynamic_bytes.dart';
3 | import 'package:blockchain_utils/cbor/core/tags.dart';
4 | import 'package:blockchain_utils/cbor/core/cbor.dart';
5 |
6 | /// A class representing a CBOR (Concise Binary Object Representation) boolean value.
7 | class CborBoleanValue implements CborObject {
8 | /// Constructor for creating a CborBoleanValue instance with the provided parameters.
9 | /// It accepts the boolean value.
10 | const CborBoleanValue(this.value);
11 |
12 | /// The value as a boolean.
13 | @override
14 | final bool value;
15 |
16 | /// Encode the value into CBOR bytes
17 | @override
18 | List encode() {
19 | final bytes = CborBytesTracker();
20 | bytes.pushInt(MajorTags.simpleOrFloat,
21 | value ? SimpleTags.simpleTrue : SimpleTags.simpleFalse);
22 | return bytes.toBytes();
23 | }
24 |
25 | /// Encode the value into CBOR bytes an then to hex
26 | @override
27 | String toCborHex() {
28 | return BytesUtils.toHexString(encode());
29 | }
30 |
31 | /// Returns the string representation of the value.
32 | @override
33 | String toString() {
34 | return value.toString();
35 | }
36 |
37 | /// overide equal operation
38 | @override
39 | operator ==(other) {
40 | if (other is! CborBoleanValue) return false;
41 |
42 | return value == other.value;
43 | }
44 |
45 | /// ovveride hash code
46 | @override
47 | int get hashCode => value.hashCode;
48 | }
49 |
--------------------------------------------------------------------------------
/lib/cbor/types/cbor_tag.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/helper/helper.dart';
2 | import 'package:blockchain_utils/utils/utils.dart';
3 | import 'package:blockchain_utils/cbor/utils/dynamic_bytes.dart';
4 | import 'package:blockchain_utils/cbor/core/cbor.dart';
5 |
6 | /// A class representing a CBOR (Concise Binary Object Representation) tag value.
7 | class CborTagValue implements CborObject {
8 | /// Constructor for creating a CborBoleanValue instance with the provided parameters.
9 | /// It accepts the all encodable cbor value.
10 | CborTagValue(T value, List tags)
11 | : _value = value,
12 | tags = tags.immutable;
13 |
14 | final List tags;
15 |
16 | final T _value;
17 | @override
18 | T get value => _value;
19 |
20 | /// Encode the value into CBOR bytes
21 | @override
22 | List encode() {
23 | final bytes = CborBytesTracker();
24 | bytes.pushTags(tags);
25 | final obj = CborObject.fromDynamic(_value).encode();
26 | bytes.pushBytes(obj);
27 | return bytes.buffer();
28 | }
29 |
30 | /// Encode the value into CBOR bytes an then to hex
31 | @override
32 | String toCborHex() {
33 | return BytesUtils.toHexString(encode());
34 | }
35 |
36 | /// Returns the string representation of the value.
37 | @override
38 | String toString() {
39 | return value.toString();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/lib/cbor/types/mime.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/utils/utils.dart';
2 | import 'package:blockchain_utils/cbor/utils/dynamic_bytes.dart';
3 | import 'package:blockchain_utils/cbor/core/tags.dart';
4 | import 'package:blockchain_utils/cbor/core/cbor.dart';
5 | import 'package:blockchain_utils/cbor/types/string.dart';
6 |
7 | /// A class representing a CBOR (Concise Binary Object Representation) mime value.
8 | class CborMimeValue implements CborObject {
9 | /// Constructor for creating a CborMimeValue instance with the provided parameters.
10 | /// It accepts the string value.
11 | const CborMimeValue(this.value);
12 |
13 | /// value as string
14 | @override
15 | final String value;
16 |
17 | /// Encode the value into CBOR bytes
18 | @override
19 | List encode() {
20 | final bytes = CborBytesTracker();
21 | bytes.pushTags(CborTags.mime);
22 | final toBytes = CborStringValue(value);
23 | bytes.pushBytes(toBytes.encode());
24 | return bytes.toBytes();
25 | }
26 |
27 | /// Encode the value into CBOR bytes an then to hex
28 | @override
29 | String toCborHex() {
30 | return BytesUtils.toHexString(encode());
31 | }
32 |
33 | /// Returns the string representation of the value.
34 | @override
35 | String toString() {
36 | return value;
37 | }
38 |
39 | /// override equal operation
40 | @override
41 | operator ==(other) {
42 | if (other is! CborMimeValue) return false;
43 | return value == other.value;
44 | }
45 |
46 | /// override hashcode
47 | @override
48 | int get hashCode => value.hashCode;
49 | }
50 |
--------------------------------------------------------------------------------
/lib/cbor/types/regex.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/utils/utils.dart';
2 | import 'package:blockchain_utils/cbor/utils/dynamic_bytes.dart';
3 | import 'package:blockchain_utils/cbor/core/tags.dart';
4 | import 'package:blockchain_utils/cbor/types/string.dart';
5 |
6 | /// A class representing a CBOR (Concise Binary Object Representation) Regex value.
7 | class CborRegxpValue implements CborString {
8 | /// Constructor for creating a CborRegxpValue instance with the provided parameters.
9 | /// It accepts string value of regex.
10 | const CborRegxpValue(this.value);
11 |
12 | /// value as string
13 | @override
14 | final String value;
15 |
16 | /// Encode the value into CBOR bytes
17 | @override
18 | List encode() {
19 | final bytes = CborBytesTracker();
20 | bytes.pushTags(CborTags.regexp);
21 | final toBytes = CborStringValue(value);
22 | bytes.pushBytes(toBytes.encode());
23 | return bytes.toBytes();
24 | }
25 |
26 | /// Encode the value into CBOR bytes an then to hex
27 | @override
28 | String toCborHex() {
29 | return BytesUtils.toHexString(encode());
30 | }
31 |
32 | /// Returns the string representation of the value.
33 | @override
34 | String toString() {
35 | return value;
36 | }
37 |
38 | /// override equal operation
39 | @override
40 | operator ==(other) {
41 | if (other is! CborRegxpValue) return false;
42 | return value == other.value;
43 | }
44 |
45 | /// override hashcode
46 | @override
47 | int get hashCode => value.hashCode;
48 | }
49 |
--------------------------------------------------------------------------------
/lib/cbor/types/url.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/utils/utils.dart';
2 | import 'package:blockchain_utils/cbor/utils/dynamic_bytes.dart';
3 | import 'package:blockchain_utils/cbor/core/tags.dart';
4 | import 'package:blockchain_utils/cbor/types/string.dart';
5 |
6 | /// A class representing a CBOR (Concise Binary Object Representation) uri value.
7 | class CborUriValue implements CborString {
8 | /// Constructor for creating a CborUriValue instance with the provided parameters.
9 | /// It accepts string value of uri.
10 | const CborUriValue(this.value);
11 |
12 | /// value as string
13 | @override
14 | final String value;
15 |
16 | /// Encode the value into CBOR bytes
17 | @override
18 | List encode() {
19 | final bytes = CborBytesTracker();
20 | bytes.pushTags(CborTags.uri);
21 | final toBytes = CborStringValue(value);
22 | bytes.pushBytes(toBytes.encode());
23 | return bytes.toBytes();
24 | }
25 |
26 | /// Returns the string representation of the value.
27 | @override
28 | String toString() {
29 | return value;
30 | }
31 |
32 | /// Encode the value into CBOR bytes an then to hex
33 | @override
34 | String toCborHex() {
35 | return BytesUtils.toHexString(encode());
36 | }
37 |
38 | /// override equal operation
39 | @override
40 | operator ==(other) {
41 | if (other is! CborUriValue) return false;
42 | return value == other.value;
43 | }
44 |
45 | /// override hashcode
46 | @override
47 | int get hashCode => value.hashCode;
48 | }
49 |
--------------------------------------------------------------------------------
/lib/cbor/utils/extentions.dart:
--------------------------------------------------------------------------------
1 | /// Extension on the DateTime class to format a DateTime object as an RFC3339 string
2 | extension RFC3339 on DateTime {
3 | /// Convert the DateTime to an RFC3339 formatted string with time zone information.
4 | String toRFC3339WithTimeZone() {
5 | final String year = this.year.toString().padLeft(4, '0');
6 | final String month = this.month.toString().padLeft(2, '0');
7 | final String day = this.day.toString().padLeft(2, '0');
8 | final String hour = this.hour.toString().padLeft(2, '0');
9 | final String minute = this.minute.toString().padLeft(2, '0');
10 | final String second = this.second.toString().padLeft(2, '0');
11 | final String millisecond = this
12 | .millisecond
13 | .toString()
14 | .padLeft(3, '0')
15 | .replaceAll(RegExp(r'0*$'), '');
16 |
17 | final Duration timeZoneOffset = isUtc ? Duration.zero : this.timeZoneOffset;
18 |
19 | final String timeZoneOffsetSign = timeZoneOffset.isNegative ? '-' : '+';
20 | final int timeZoneOffsetHours = timeZoneOffset.inHours.abs();
21 | final int timeZoneOffsetMinutes = timeZoneOffset.inMinutes.abs() % 60;
22 |
23 | final String timeZoneOffsetFormatted = isUtc
24 | ? "Z"
25 | : '$timeZoneOffsetSign${timeZoneOffsetHours.toString().padLeft(2, '0')}:${timeZoneOffsetMinutes.toString().padLeft(2, '0')}';
26 |
27 | return '$year-$month-${day}T$hour:$minute:$second.$millisecond$timeZoneOffsetFormatted';
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/lib/crypto/crypto/cdsa/cdsa.dart:
--------------------------------------------------------------------------------
1 | /// The 'cdsa' library provides tools and components for working with various cryptographic
2 | /// algorithms, including elliptic curve cryptography (ECDSA and EDDSA) and related functionality.
3 | library;
4 |
5 | /// Export statement for cryptographic curve definitions.
6 | export 'curve/curves.dart';
7 |
8 | /// Export statement for ECDSA (Elliptic Curve Digital Signature Algorithm) private and
9 | /// public key components, as well as signature functionality.
10 | export 'ecdsa/private_key.dart';
11 | export 'ecdsa/public_key.dart';
12 | export 'ecdsa/signature.dart';
13 |
14 | /// Export statement for EDDSA (Edwards-curve Digital Signature Algorithm) private and
15 | /// public key components.
16 | export 'eddsa/keys.dart';
17 |
18 | /// Export statements for elliptic curve point representations, including Edwards
19 | /// and projective points.
20 | export 'point/edwards.dart';
21 | export 'point/point.dart';
22 | export 'point/ec_projective_point.dart';
23 |
24 | /// Export statement for RFC 6979, which provides deterministic ECDSA signatures,
25 | /// allowing for secure signature generation.
26 | export 'rfc6979/rfc6979.dart';
27 | export 'crypto_ops/crypto_ops.dart';
28 |
29 | export 'musig2/musig2.dart';
30 |
31 | export 'utils/ed25519.dart';
32 | export 'utils/ristretto.dart';
33 | export 'utils/secp256k1.dart';
34 |
--------------------------------------------------------------------------------
/lib/crypto/crypto/cdsa/crypto_ops/crypto_ops.dart:
--------------------------------------------------------------------------------
1 | export 'const/const.dart';
2 | export 'exception/exception.dart';
3 | export 'models/models.dart';
4 | export 'operations/ops.dart';
5 |
--------------------------------------------------------------------------------
/lib/crypto/crypto/cdsa/crypto_ops/exception/exception.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/exception/exceptions.dart';
2 |
3 | class CryptoOpsException extends BlockchainUtilsException {
4 | const CryptoOpsException(super.message, {super.details});
5 | }
6 |
--------------------------------------------------------------------------------
/lib/crypto/crypto/cdsa/eddsa/keys.dart:
--------------------------------------------------------------------------------
1 | export 'keys/privatekey.dart';
2 | export 'keys/publickey.dart';
3 |
--------------------------------------------------------------------------------
/lib/crypto/crypto/cdsa/musig2/constants/const.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/blockchain_utils.dart';
2 | import 'package:blockchain_utils/crypto/crypto/cdsa/curve/curve.dart';
3 |
4 | class MuSig2Const {
5 | static const int xOnlyBytesLength = 32;
6 | static const int partialSignatureLength = 32;
7 | static const int minimumRequiredKey = 2;
8 | static const int pubnonceLength = 66;
9 | // static const int schnorrSignatureLength = 64;
10 | static const int secnoncelength =
11 | QuickCrypto.sha256DigestSize * 2 + EcdsaKeysConst.pubKeyCompressedByteLen;
12 | static final CurveFp curve = Curves.curveSecp256k1;
13 | static final BigInt order = Curves.generatorSecp256k1.order!;
14 | static final ProjectiveECCPoint generator = Curves.generatorSecp256k1;
15 | static final List zero =
16 | List.unmodifiable(List.filled(EcdsaKeysConst.pubKeyCompressedByteLen, 0));
17 | static const String deterministicNonceDomain = "MuSig/deterministic/nonce";
18 | static const String auxDomain = "MuSig/deterministic/nonce";
19 | static const String noncecoefDomain = 'MuSig/noncecoef';
20 | static const String challengeDomain = 'BIP0340/challenge';
21 | static const String keyAggListDomain = 'KeyAgg list';
22 | static const String keyAggCoeffDomain = 'KeyAgg coefficient';
23 | static const String nonceDomain = 'MuSig/nonce';
24 | static const String musigAuxDomain = "MuSig/aux";
25 | }
26 |
--------------------------------------------------------------------------------
/lib/crypto/crypto/cdsa/musig2/exception/exception.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/crypto/crypto/exception/exception.dart';
2 |
3 | class MuSig2Exception extends CryptoException {
4 | const MuSig2Exception(super.message, {super.details});
5 | }
6 |
--------------------------------------------------------------------------------
/lib/crypto/crypto/cdsa/musig2/musig2.dart:
--------------------------------------------------------------------------------
1 | export 'musig2/musig2.dart';
2 | export 'exception/exception.dart';
3 | export 'types/types.dart';
4 | export 'utils/utils.dart';
5 |
--------------------------------------------------------------------------------
/lib/crypto/crypto/cdsa/secp256k1/secp256k1.dart:
--------------------------------------------------------------------------------
1 | export 'types/types.dart';
2 | export 'impl/secp256k1.dart';
3 | export 'constants/constants.dart';
4 |
--------------------------------------------------------------------------------
/lib/crypto/crypto/crc16/crc16.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/utils/utils.dart';
2 |
3 | class Crc16 {
4 | static const int _poly = 0x1021;
5 |
6 | static List quickIntDigest(List data) {
7 | int reg = 0;
8 | final List message = List.filled(data.length + 2, 0);
9 | message.setAll(0, data);
10 |
11 | for (final byte in message) {
12 | int mask = 0x80;
13 | while (mask > 0) {
14 | reg <<= 1;
15 | if (byte & mask != 0) {
16 | reg += 1;
17 | }
18 | mask >>= 1;
19 | if (reg > mask16) {
20 | reg &= mask16;
21 | reg ^= _poly;
22 | }
23 | }
24 | }
25 | return List.from([reg >> 8, reg & mask8]);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lib/crypto/crypto/exception/exception.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/exception/exception/exception.dart';
2 |
3 | class CryptoException extends BlockchainUtilsException {
4 | const CryptoException(super.message, {super.details});
5 |
6 | @override
7 | String toString() {
8 | return message;
9 | }
10 | }
11 |
12 | /// An exception class for errors related to square root calculations.
13 | ///
14 | /// This exception is thrown when there is an issue with computing the square root
15 | /// of a BigInt value within the defined constraints.
16 | ///
17 | class SquareRootError extends CryptoException {
18 | const SquareRootError(super.message, {super.details});
19 | }
20 |
21 | /// An exception class for errors related to Jacobi symbol calculations.
22 | ///
23 | /// This exception is thrown when there is an issue with computing the Jacobi symbol
24 | /// for a pair of BigInt values within the defined constraints.
25 | ///
26 | class JacobiError extends CryptoException {
27 | const JacobiError(super.message, {super.details});
28 | }
29 |
--------------------------------------------------------------------------------
/lib/crypto/crypto/hash/sha224/sha224.dart:
--------------------------------------------------------------------------------
1 | part of 'package:blockchain_utils/crypto/crypto/hash/hash.dart';
2 |
3 | /// The `SHA224` class represents the SHA-224 hash algorithm, which is a variant of SHA-256.
4 | ///
5 | /// SHA-224 is a cryptographic hash function that produces a 224-bit (28-byte) hash
6 | /// value from an input message. It's a variant of SHA-256 and follows a similar
7 | /// implementation with a different initial hash value and digest length.
8 | class SHA224 extends SHA256 {
9 | /// digest length
10 | static const int digestLength = 28;
11 |
12 | // block size
13 | static const int blockSize = 64;
14 |
15 | /// digest length
16 | @override
17 | int get getDigestLength => SHA224.digestLength;
18 |
19 | // block size
20 | @override
21 | int get getBlockSize => SHA224.blockSize;
22 |
23 | @override
24 | void _initState() {
25 | _state[0] = 0xc1059ed8;
26 | _state[1] = 0x367cd507;
27 | _state[2] = 0x3070dd17;
28 | _state[3] = 0xf70e5939;
29 | _state[4] = 0xffc00b31;
30 | _state[5] = 0x68581511;
31 | _state[6] = 0x64f98fa7;
32 | _state[7] = 0xbefa4fa4;
33 | }
34 |
35 | /// Computes the SHA224 hash of the provided data.
36 | static List hash(List data) {
37 | final h = SHA224();
38 | h.update(data);
39 | final digest = h.digest();
40 | h.clean();
41 | return digest;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/lib/crypto/crypto/schnorrkel/shnorrkel.dart:
--------------------------------------------------------------------------------
1 | /// The 'schnorrkel' library provides tools for working with the Schnorrkel
2 | /// digital signature scheme, including key management and cryptographic functions.
3 | library;
4 |
5 | /// Export statement for Schnorrkel key management components.
6 | export 'keys/keys.dart';
7 |
8 | /// Export statement for the Schnorrkel Merlin transcript, which is used for
9 | /// creating transcripts to be used in the signature process.
10 | export 'merlin/transcript.dart';
11 |
12 | /// Export statement for the Schnorrkel Strobe framework, which provides
13 | /// cryptographic primitives for building the Schnorrkel digital signature scheme.
14 | export 'strobe/strobe.dart';
15 |
--------------------------------------------------------------------------------
/lib/double/codec/double_utils.dart:
--------------------------------------------------------------------------------
1 | import 'dart:typed_data';
2 |
3 | /// Utility class for encoding and decoding double values.
4 | class DoubleCoder {
5 | /// Converts a double value to bytes.
6 | ///
7 | /// - [value] : The double value to encode.
8 | /// - [byteOrder] (optional): The byte order for encoding. Defaults to big endian.
9 | static List toBytes(double value, {Endian byteOrder = Endian.big}) {
10 | final ByteData byteData = ByteData(8);
11 | byteData.setFloat64(0, value, byteOrder);
12 | return byteData.buffer.asUint8List();
13 | }
14 |
15 | /// Converts bytes to a double value.
16 | ///
17 | /// - [bytes] : The bytes to decode.
18 | /// - [byteOrder] (optional): The byte order for decoding. Defaults to big endian.
19 | static double fromBytes(List bytes, {Endian byteOrder = Endian.big}) {
20 | final ByteData byteData = ByteData.sublistView(Uint8List.fromList(bytes));
21 | return byteData.getFloat64(0, byteOrder);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/lib/double/codec/float_utils.dart:
--------------------------------------------------------------------------------
1 | import 'dart:typed_data';
2 |
3 | /// Utility class for encoding and decoding float values.
4 | class FloatCoder {
5 | /// Converts a double value to bytes.
6 | ///
7 | /// - [value] : The double value to encode.
8 | /// - [byteOrder] (optional): The byte order for encoding. Defaults to big endian.
9 | static List toBytes(double value, {Endian byteOrder = Endian.big}) {
10 | final ByteData byteData = ByteData(4);
11 | byteData.setFloat32(0, value, byteOrder);
12 | return byteData.buffer.asUint8List();
13 | }
14 |
15 | /// Converts bytes to a double value.
16 | ///
17 | /// - [bytes] : The bytes to decode.
18 | /// - [byteOrder] (optional): The byte order for decoding. Defaults to big endian.
19 | static double fromBytes(List bytes, {Endian byteOrder = Endian.big}) {
20 | final ByteData byteData = ByteData.sublistView(Uint8List.fromList(bytes));
21 | return byteData.getFloat32(0, byteOrder);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/lib/double/double_codec.dart:
--------------------------------------------------------------------------------
1 | export 'codec/double_utils.dart';
2 | export 'codec/float_utils.dart';
3 |
--------------------------------------------------------------------------------
/lib/exception/const/const.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/exception/exception/exception.dart';
2 |
3 | class ExceptionConst {
4 | static GenericException itemNotFound({String? item}) =>
5 | GenericException("${item ?? 'item'} not found.");
6 | }
7 |
--------------------------------------------------------------------------------
/lib/exception/exceptions.dart:
--------------------------------------------------------------------------------
1 | export 'exception/exception.dart';
2 | export 'exception/rpc_error.dart';
3 |
--------------------------------------------------------------------------------
/lib/helper/helper.dart:
--------------------------------------------------------------------------------
1 | export 'extensions/extensions.dart';
2 |
--------------------------------------------------------------------------------
/lib/layout/byte/byte_handler.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/utils/utils.dart';
2 | import 'package:blockchain_utils/layout/exception/exception.dart';
3 | import 'package:blockchain_utils/layout/utils/utils.dart';
4 | part 'reader.dart';
5 | part 'writer.dart';
6 |
--------------------------------------------------------------------------------
/lib/layout/byte/writer.dart:
--------------------------------------------------------------------------------
1 | part of "package:blockchain_utils/layout/byte/byte_handler.dart";
2 |
3 | /// A utility class for writing layout bytes dynamically.
4 | class LayoutByteWriter {
5 | // static const int _minimuBufferLength = 1024;
6 | final bool growable;
7 | LayoutByteWriter(int span)
8 | : _buffer = LayoutByteReader.write(
9 | span >= 0 ? List.filled(span, 0) : List.empty(growable: true)),
10 | growable = span < 0;
11 | final LayoutByteReader _buffer;
12 |
13 | /// Get the last byte in the tracked bytes.
14 | int get last => _buffer.last;
15 |
16 | LayoutByteReader get reader => _buffer;
17 |
18 | /// buffer bytes.
19 | List toBytes() {
20 | return _buffer._bytes;
21 | }
22 |
23 | List sublist(int start, int end) {
24 | return _buffer.sublist(start, end);
25 | }
26 |
27 | int get length => _buffer.length;
28 |
29 | void _filled(int end) {
30 | if (growable) {
31 | if (end > _buffer.length) {
32 | final filled = end - (_buffer.length);
33 | _buffer._bytes.addAll(List.filled(filled, 0, growable: true));
34 | }
35 | }
36 | }
37 |
38 | void setAll(int index, List bytes) {
39 | _filled(index + bytes.length);
40 | _buffer._bytes.setAll(index, bytes);
41 | }
42 |
43 | void set(int offset, int value) {
44 | _filled(offset);
45 | _buffer._bytes[offset] = value & mask8;
46 | }
47 |
48 | int at(int pos) => _buffer._bytes[pos];
49 | }
50 |
--------------------------------------------------------------------------------
/lib/layout/core/core.dart:
--------------------------------------------------------------------------------
1 | export 'core/core.dart';
2 | export 'types/custom_layout.dart';
3 | export 'types/none.dart';
4 | export 'types/numeric.dart';
5 | export 'types/optional_layout.dart';
6 | export 'types/tuple_layout.dart';
7 | export 'types/coption_layout.dart';
8 | export 'types/array.dart';
9 | export 'types/compact.dart';
10 | export 'types/compact_bytes.dart';
11 | export 'types/struct.dart';
12 | export 'types/union.dart';
13 | export 'types/raw.dart';
14 | export 'types/map.dart';
15 | export 'types/constant.dart';
16 | export 'types/compact_layout.dart';
17 | export 'types/padding_layout.dart';
18 | export 'types/bit_sequence.dart';
19 | export 'types/xdr_bytes.dart';
20 | export 'types/lazy_union.dart';
21 | export 'types/lazy_struct.dart';
22 | export 'types/leb128.dart';
23 | export 'types/leb128_offset.dart';
24 |
--------------------------------------------------------------------------------
/lib/layout/core/types/bit_sequence.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/layout/byte/byte_handler.dart';
2 | import 'package:blockchain_utils/layout/constant/constant.dart';
3 | import 'package:blockchain_utils/layout/core/core/core.dart';
4 |
5 | class BitSequenceLayout extends Layout> {
6 | const BitSequenceLayout({String? property}) : super(-1, property: property);
7 | static final _lengthCodec = LayoutConst.compactIntU48();
8 |
9 | @override
10 | BitSequenceLayout clone({String? newProperty}) {
11 | return BitSequenceLayout(property: property);
12 | }
13 |
14 | @override
15 | int getSpan(LayoutByteReader? bytes, {int offset = 0, List? source}) {
16 | return bytes!.getCompactTotalLenght(offset).item2 ~/ 8;
17 | }
18 |
19 | @override
20 | LayoutDecodeResult> decode(LayoutByteReader bytes,
21 | {int offset = 0}) {
22 | final decode = bytes.getCompactLengthInfos(offset);
23 | final totalLength = decode.item1 + (decode.item2 ~/ 8);
24 | final result = bytes.sublist(offset + decode.item1, offset + totalLength);
25 | return LayoutDecodeResult(consumed: totalLength, value: result);
26 | }
27 |
28 | @override
29 | int encode(List source, LayoutByteWriter writer, {int offset = 0}) {
30 | final int length =
31 | _lengthCodec.encode(source.length * 8, writer, offset: offset);
32 |
33 | writer.setAll(offset + length, source);
34 | return source.length + length;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lib/layout/core/types/compact.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/layout/byte/byte_handler.dart';
2 | import 'package:blockchain_utils/layout/core/core/core.dart';
3 | import 'package:blockchain_utils/layout/utils/utils.dart';
4 | import 'numeric.dart';
5 |
6 | class CompactOffsetLayout extends ExternalLayout {
7 | const CompactOffsetLayout({String? property}) : super(-1, property: property);
8 |
9 | @override
10 | bool isCount() {
11 | return true;
12 | }
13 |
14 | @override
15 | LayoutDecodeResult decode(LayoutByteReader bytes, {int offset = 0}) {
16 | throw UnimplementedError();
17 | }
18 |
19 | @override
20 | int encode(int source, LayoutByteWriter writer, {int offset = 0}) {
21 | final encodeLength = LayoutSerializationUtils.compactIntToBytes(source);
22 | writer.setAll(offset, encodeLength);
23 | return encodeLength.length;
24 | }
25 |
26 | @override
27 | CompactOffsetLayout clone({String? newProperty}) {
28 | return CompactOffsetLayout(property: newProperty);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/lib/layout/core/types/compact_bytes.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/layout/byte/byte_handler.dart';
2 | import 'package:blockchain_utils/layout/constant/constant.dart';
3 | import 'package:blockchain_utils/layout/core/core/core.dart';
4 |
5 | class CompactBytes extends Layout> {
6 | const CompactBytes({String? property}) : super(-1, property: property);
7 | static final _lengthCodec = LayoutConst.compactIntU48();
8 |
9 | @override
10 | CompactBytes clone({String? newProperty}) {
11 | return CompactBytes(property: property);
12 | }
13 |
14 | @override
15 | int getSpan(LayoutByteReader? bytes, {int offset = 0, List? source}) {
16 | return bytes!.getCompactTotalLenght(offset).item2;
17 | }
18 |
19 | @override
20 | LayoutDecodeResult> decode(LayoutByteReader bytes,
21 | {int offset = 0}) {
22 | final decode = bytes.getCompactTotalLenght(offset);
23 | final result = bytes.sublist(offset + decode.item1, offset + decode.item2);
24 | return LayoutDecodeResult(consumed: decode.item2, value: result);
25 | }
26 |
27 | @override
28 | int encode(List source, LayoutByteWriter writer, {int offset = 0}) {
29 | final int length =
30 | _lengthCodec.encode(source.length, writer, offset: offset);
31 | writer.setAll(offset + length, source);
32 | return source.length + length;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/lib/layout/core/types/compact_layout.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/layout/byte/byte_handler.dart';
2 | import 'package:blockchain_utils/layout/core/core/core.dart';
3 | import 'package:blockchain_utils/layout/utils/utils.dart';
4 |
5 | class CompactLayout extends Layout {
6 | CompactLayout(this.layout, {String? property})
7 | : super(-1, property: property);
8 | final Layout layout;
9 |
10 | @override
11 | LayoutDecodeResult decode(LayoutByteReader bytes, {int offset = 0}) {
12 | final decode = bytes.getCompactTotalLenght(offset);
13 | final result = layout
14 | .decode(bytes.getReader(offset + decode.item1, offset + decode.item2));
15 | return LayoutDecodeResult(consumed: decode.item2, value: result.value);
16 | }
17 |
18 | @override
19 | int encode(T source, LayoutByteWriter writer, {int offset = 0}) {
20 | final encode = layout.serialize(source);
21 | final lengthBytes = LayoutSerializationUtils.encodeLength(encode);
22 | writer.setAll(offset, lengthBytes);
23 | writer.setAll(offset + lengthBytes.length, encode);
24 | return encode.length + lengthBytes.length;
25 | }
26 |
27 | @override
28 | int getSpan(LayoutByteReader? bytes, {int offset = 0, T? source}) {
29 | return bytes!.getCompactTotalLenght(offset).item2;
30 | }
31 |
32 | @override
33 | CompactLayout clone({String? newProperty}) {
34 | return CompactLayout(layout, property: newProperty);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lib/layout/core/types/constant.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/layout/byte/byte_handler.dart';
2 | import 'package:blockchain_utils/layout/core/core/core.dart';
3 |
4 | /// A class representing a constant layout within a buffer.
5 | class ConstantLayout extends Layout {
6 | /// The value produced by this constant when the layout is decoded.
7 | ///
8 | /// Any Dart value including `null` and `undefined` is permitted.
9 | ///
10 | /// **WARNING** If `value` passed in the constructor was not
11 | /// frozen, it is possible for users of decoded values to change
12 | /// the content of the value.
13 | final T value;
14 |
15 | /// Constructs a [ConstantLayout] layout with the given [value] and [property].
16 | const ConstantLayout(this.value, {String? property})
17 | : super(0, property: property);
18 |
19 | @override
20 | LayoutDecodeResult decode(LayoutByteReader bytes, {int offset = 0}) {
21 | return LayoutDecodeResult(consumed: 0, value: value);
22 | }
23 |
24 | @override
25 | int encode(T source, LayoutByteWriter writer, {int offset = 0}) {
26 | // Constants take no space
27 | return 0;
28 | }
29 |
30 | @override
31 | Layout clone({String? newProperty}) {
32 | return ConstantLayout(value, property: newProperty);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/lib/layout/core/types/none.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/layout/byte/byte_handler.dart';
2 | import 'package:blockchain_utils/layout/core/core/core.dart';
3 |
4 | /// Represents a layout with no data.
5 | class NoneLayout extends Layout {
6 | const NoneLayout({String? property}) : super(0, property: property);
7 |
8 | /// Constructs a [NoneLayout] layout.
9 | ///
10 | /// - [property] (optional): The property identifier.
11 | @override
12 | Layout clone({String? newProperty}) {
13 | return NoneLayout(property: newProperty);
14 | }
15 |
16 | @override
17 | decode(LayoutByteReader bytes, {int offset = 0}) {
18 | return const LayoutDecodeResult(consumed: 0, value: null);
19 | }
20 |
21 | @override
22 | int encode(source, LayoutByteWriter writer, {int offset = 0}) {
23 | return 0;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/lib/layout/core/types/padding_layout.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/layout/byte/byte_handler.dart';
2 | import 'package:blockchain_utils/layout/core/core/core.dart';
3 | import 'numeric.dart';
4 |
5 | class PaddingLayout extends Layout {
6 | final BaseIntiger layout;
7 | PaddingLayout(this.layout, {String? property})
8 | : super(layout.span, property: property);
9 |
10 | @override
11 | int getSpan(LayoutByteReader? bytes, {int offset = 0, T? source}) {
12 | return layout.getSpan(bytes, offset: offset, source: source);
13 | }
14 |
15 | @override
16 | PaddingLayout clone({String? newProperty}) {
17 | return PaddingLayout(layout, property: newProperty);
18 | }
19 |
20 | @override
21 | LayoutDecodeResult decode(LayoutByteReader bytes, {int offset = 0}) {
22 | return layout.decode(bytes, offset: offset);
23 | }
24 |
25 | @override
26 | int encode(T source, LayoutByteWriter writer, {int offset = 0}) {
27 | return layout.encode(source, writer, offset: offset);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/lib/layout/exception/exception.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/exception/exceptions.dart';
2 |
3 | class LayoutException extends BlockchainUtilsException {
4 | const LayoutException(super.message, {super.details});
5 | }
6 |
--------------------------------------------------------------------------------
/lib/layout/layout.dart:
--------------------------------------------------------------------------------
1 | export 'core/core.dart';
2 | export 'constant/constant.dart';
3 | export 'utils/utils.dart';
4 | export 'exception/exception.dart';
5 |
--------------------------------------------------------------------------------
/lib/secret_wallet/exception.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/blockchain_utils.dart';
2 |
3 | class Web3SecretStorageDefinationV3Exception extends BlockchainUtilsException {
4 | const Web3SecretStorageDefinationV3Exception(super.message, {super.details});
5 | }
6 |
--------------------------------------------------------------------------------
/lib/service/service.dart:
--------------------------------------------------------------------------------
1 | export 'models/params.dart';
2 | export 'const/constant.dart';
3 | export 'utils/utils.dart';
4 |
--------------------------------------------------------------------------------
/lib/signer/exception/signing_exception.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/crypto/crypto/exception/exception.dart';
2 |
3 | class CryptoSignException extends CryptoException {
4 | const CryptoSignException(super.message, {super.details});
5 | }
6 |
--------------------------------------------------------------------------------
/lib/signer/signer.dart:
--------------------------------------------------------------------------------
1 | export 'xrp/xrp_signer.dart';
2 | export 'bitcoin/bitcoin_signer.dart';
3 | export 'types/eth_signature.dart';
4 | export 'eth/eth_signer.dart';
5 | export 'tron/tron_signer.dart';
6 | export 'cardano/cardano_signer.dart';
7 | export 'substrate/substrate.dart';
8 | export 'const/constants.dart';
9 | export 'secp256k1/secp256k1_signer.dart';
10 | export 'secp256r1/secp256r1_signer.dart';
11 | export 'ed25519/ed25519.dart';
12 | export 'signing_key/ecdsa_signing_key.dart';
13 | export 'utils/utils.dart';
14 | export 'bitcoin/bitcoin_key_signer.dart';
15 | export 'exception/signing_exception.dart';
16 |
--------------------------------------------------------------------------------
/lib/ss58/ss58.dart:
--------------------------------------------------------------------------------
1 | /// Library for SS58 address encoding and decoding.
2 | library;
3 |
4 | /// Export statement for SS58 address encoding-decoding functionality.
5 | export 'ss58_base.dart';
6 |
--------------------------------------------------------------------------------
/lib/ss58/ss58_ex.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/exception/exceptions.dart';
2 |
3 | /// An exception class for errors related to SS58 address checksum validation.
4 | ///
5 | /// The [message] field can contain additional information about the error.
6 | class SS58ChecksumError extends BlockchainUtilsException {
7 | const SS58ChecksumError(super.message, {super.details});
8 | }
9 |
--------------------------------------------------------------------------------
/lib/utils/binary/bit_utils.dart:
--------------------------------------------------------------------------------
1 | /// Class container for bit utility functions.
2 | class BitUtils {
3 | /// Get if the specified bit is set.
4 | static bool intIsBitSet(int value, int bitNum) {
5 | return (value & (1 << bitNum)) != 0;
6 | }
7 |
8 | /// Get if the specified bits are set.
9 | static bool areBitsSet(int value, int bitMask) {
10 | return (value & bitMask) != 0;
11 | }
12 |
13 | /// Set the specified bit.
14 | static int setBit(int value, int bitNum) {
15 | return value | (1 << bitNum);
16 | }
17 |
18 | /// Set the specified bits.
19 | static int setBits(int value, int bitMask) {
20 | return value | bitMask;
21 | }
22 |
23 | /// Reset the specified bit.
24 | static int resetBit(int value, int bitNum) {
25 | return value & ~(1 << bitNum);
26 | }
27 |
28 | /// Reset the specified bits.
29 | static int resetBits(int value, int bitMask) {
30 | return value & ~bitMask;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/lib/utils/binary/bytes_tracker.dart:
--------------------------------------------------------------------------------
1 | import 'package:blockchain_utils/helper/helper.dart';
2 |
3 | /// A utility class for tracking bytes dynamically.
4 | class DynamicByteTracker {
5 | final List _buffer = List.empty(growable: true);
6 |
7 | /// Get the last byte in the tracked bytes.
8 | int get last => _buffer.last;
9 |
10 | /// buffer bytes.
11 | List toBytes() {
12 | return List.from(_buffer);
13 | }
14 |
15 | void add(List chunk) {
16 | _buffer.addAll(chunk.asBytes);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/lib/utils/compare/hash_code.dart:
--------------------------------------------------------------------------------
1 | import '../binary/binary_operation.dart';
2 |
3 | /// A utility class for generating consistent and efficient hash codes
4 | /// for collections and objects.
5 | class HashCodeGenerator {
6 | /// Generates a hash code for a list of bytes, optionally including
7 | /// additional objects in the calculation.
8 | ///
9 | /// Returns: A 32-bit integer hash code.
10 | static int generateBytesHashCode(List bytes,
11 | [List