diff --git a/lib/base58/base58.dart b/lib/base58/base58.dart index 4cda425..bc9b519 100644 --- a/lib/base58/base58.dart +++ b/lib/base58/base58.dart @@ -1,3 +1,18 @@ +/// Base58 Encoding and Decoding Library +/// +/// This library provides functions for encoding and decoding data using the +/// Base58 encoding scheme. Base58 is commonly used in blockchain applications, +/// such as Bitcoin and Ripple, for encoding binary data into a human-readable format. +/// +/// Modules and Exports: +/// +/// - `encodeCheck`, `decodeCheck`: Exported from 'package:blockchain_utils/base58/impl/bacse58_check.dart'. +/// These functions provide Base58 encoding and decoding with checksums, which +/// are often used in blockchain addresses and data encoding. +/// +/// - `encode`, `decode`, `ripple`, `bitcoin`: Exported from 'package:blockchain_utils/base58/impl/base58.dart'. +/// These functions provide basic Base58 encoding and decoding, along with +/// implementations specific to Ripple and Bitcoin Base58 encoding schemes. library base58; export 'package:blockchain_utils/base58/impl/bacse58_check.dart' diff --git a/lib/bech32/bech32.dart b/lib/bech32/bech32.dart index a5175f8..eff5fc6 100644 --- a/lib/bech32/bech32.dart +++ b/lib/bech32/bech32.dart @@ -1,3 +1,22 @@ +/// Bech32 Encoding and Decoding Library +/// +/// This library provides functions for encoding and decoding data using the +/// Bech32 encoding scheme. Bech32 is a specialized encoding format used in +/// blockchain applications, such as Bitcoin and Bitcoin-like cryptocurrencies, +/// to represent addresses and data in a human-readable and error-checking format. +/// +/// Modules and Exports: +/// +/// - `encodeBech32`, `decodeBech32`: Exported from 'package:blockchain_utils/bech32/bech32.dart'. +/// These functions provide Bech32 encoding and decoding capabilities, allowing +/// developers to work with Bech32-encoded data. +/// +/// Usage: +/// +/// Developers can import this library to access Bech32 encoding and decoding +/// functions based on their specific requirements. For example: +library bech32; + import 'dart:typed_data'; import 'package:blockchain_utils/formating/bytes_num_formating.dart'; diff --git a/lib/bip39/bip39.dart b/lib/bip39/bip39.dart index 062fb78..5d08aa0 100644 --- a/lib/bip39/bip39.dart +++ b/lib/bip39/bip39.dart @@ -1,3 +1,54 @@ +/// BIP39 Multilanguage Support Library +/// +/// This library provides comprehensive language support for the BIP39 mnemonic +/// phrase standard, which is commonly used in cryptocurrency wallets to generate +/// and recover wallets and their associated keys. It offers translations and +/// resources for multiple languages, enabling users to create and work with +/// BIP39 mnemonics in their preferred language. +/// +/// Modules and Exports: +/// +/// - `BIP39`: Exported from 'package:blockchain_utils/bip39/bip39.dart'. +/// This class provides core functionality for generating and validating +/// BIP39 mnemonics, along with various language-specific options. +/// +/// - `Bip39Language`, `Bip39WordLength`: Exported from 'package:blockchain_utils/bip39/bip39.dart'. +/// These enumerations define supported BIP39 languages and word lengths, +/// making it easier to choose the desired language for mnemonic phrases. +/// +/// Key Methods: +/// +/// - `generateMnemonic`: Generates a new BIP39 mnemonic phrase using the specified language. +/// Example: +/// ```dart +/// final mnemonic = bip39.generateMnemonic(); +/// ``` +/// +/// - `toSeed`: Converts a BIP39 mnemonic phrase into a binary seed. +/// Example: +/// ```dart +/// final seed = bip39.toSeed(mnemonic); +/// ``` +/// +/// - `entropyToMnemonic`: Converts entropy bytes into a BIP39 mnemonic phrase. +/// Example: +/// ```dart +/// final entropy = bip39.mnemonicToEntropy(mnemonic); +/// ``` +/// +/// - `validateMnemonic`: Validates a BIP39 mnemonic phrase to check its correctness. +/// Example: +/// ```dart +/// final isValid = bip39.validateMnemonic(mnemonic); +/// ``` +/// +/// - `mnemonicToEntropy`: Converts a BIP39 mnemonic phrase back into its entropy bytes. +/// Example: +/// ```dart +/// final entropy = bip39.mnemonicToEntropy(mnemonic); +/// ``` +library bip39; + import 'dart:typed_data'; import 'package:blockchain_utils/crypto/crypto.dart'; import 'package:blockchain_utils/formating/bytes_num_formating.dart'; diff --git a/lib/bip39/load_languages/chinese_simplified.dart b/lib/bip39/load_languages/chinese_simplified.dart index 00056fd..020af5a 100644 --- a/lib/bip39/load_languages/chinese_simplified.dart +++ b/lib/bip39/load_languages/chinese_simplified.dart @@ -1,3 +1,4 @@ +// Chinese (Simplified) const List chineseSimplified = [ "的", "一", diff --git a/lib/bip39/load_languages/chinese_traditional.dart b/lib/bip39/load_languages/chinese_traditional.dart index 6c17049..d619887 100644 --- a/lib/bip39/load_languages/chinese_traditional.dart +++ b/lib/bip39/load_languages/chinese_traditional.dart @@ -1,3 +1,4 @@ +// Chinese (Traditional) const List chineseTraditional = [ "的", "一", diff --git a/lib/bip39/load_languages/czech.dart b/lib/bip39/load_languages/czech.dart index 0d44558..ac3d852 100644 --- a/lib/bip39/load_languages/czech.dart +++ b/lib/bip39/load_languages/czech.dart @@ -1,3 +1,4 @@ +// Czech const List czech = [ "abdikace", "abeceda", diff --git a/lib/bip39/load_languages/english.dart b/lib/bip39/load_languages/english.dart index bfc4a52..19395fc 100644 --- a/lib/bip39/load_languages/english.dart +++ b/lib/bip39/load_languages/english.dart @@ -1,3 +1,4 @@ +// English final List english = [ "abandon", "ability", diff --git a/lib/bip39/load_languages/french.dart b/lib/bip39/load_languages/french.dart index 45c6c38..1cad1a8 100644 --- a/lib/bip39/load_languages/french.dart +++ b/lib/bip39/load_languages/french.dart @@ -1,3 +1,4 @@ +// French const List french = [ "abaisser", "abandon", diff --git a/lib/bip39/load_languages/italian.dart b/lib/bip39/load_languages/italian.dart index 698500b..b1208ed 100644 --- a/lib/bip39/load_languages/italian.dart +++ b/lib/bip39/load_languages/italian.dart @@ -1,3 +1,4 @@ +// Italian const List italian = [ "abaco", "abbaglio", diff --git a/lib/bip39/load_languages/japanese.dart b/lib/bip39/load_languages/japanese.dart index ce12eba..896fdcc 100644 --- a/lib/bip39/load_languages/japanese.dart +++ b/lib/bip39/load_languages/japanese.dart @@ -1,3 +1,4 @@ +// Japanese const List japanese = [ "あいこくしん", "あいさつ", diff --git a/lib/bip39/load_languages/korean.dart b/lib/bip39/load_languages/korean.dart index f9f40e7..1157ebe 100644 --- a/lib/bip39/load_languages/korean.dart +++ b/lib/bip39/load_languages/korean.dart @@ -1,3 +1,4 @@ +// Korean const List korean = [ "가격", "가끔", diff --git a/lib/bip39/load_languages/languages.dart b/lib/bip39/load_languages/languages.dart index 8cc80fd..733e77e 100644 --- a/lib/bip39/load_languages/languages.dart +++ b/lib/bip39/load_languages/languages.dart @@ -1,3 +1,22 @@ +/// BIP39 Language Support Library +/// +/// This library provides language support for BIP39 mnemonic phrases used in +/// cryptocurrency wallets. It includes translations and resources for multiple +/// languages to enable mnemonic phrase generation and validation for a global +/// audience. +/// +/// Available Languages: +/// +/// - Chinese (Simplified) +/// - Chinese (Traditional) +/// - English +/// - Spanish +/// - Czech +/// - French +/// - Italian +/// - Japanese +/// - Korean +/// - Portuguese library languages; export 'chinese_simplified.dart'; diff --git a/lib/bip39/load_languages/portuguese.dart b/lib/bip39/load_languages/portuguese.dart index 8c46813..91793c3 100644 --- a/lib/bip39/load_languages/portuguese.dart +++ b/lib/bip39/load_languages/portuguese.dart @@ -1,3 +1,4 @@ +// Portuguese final List portuguese = [ "abacate", "abaixo", diff --git a/lib/bip39/load_languages/spanish.dart b/lib/bip39/load_languages/spanish.dart index cca854e..951473e 100644 --- a/lib/bip39/load_languages/spanish.dart +++ b/lib/bip39/load_languages/spanish.dart @@ -1,3 +1,4 @@ +// Spanish final List spanish = [ "ábaco", "abdomen", diff --git a/lib/blockchain_utils.dart b/lib/blockchain_utils.dart index 53ba364..e64856a 100644 --- a/lib/blockchain_utils.dart +++ b/lib/blockchain_utils.dart @@ -1,3 +1,32 @@ +/// Blockchain Utilities Library +/// +/// This library provides a collection of utility functions and classes for +/// working with blockchain-related operations and cryptographic tasks. +/// Developers can use these utilities to simplify tasks such as encoding and +/// decoding data, generating BIP39 mnemonics, working with HD wallets, +/// and more in the context of blockchain applications. +/// +/// Modules and Exports: +/// +/// - `base58`: Exported from 'package:blockchain_utils/base58/base58.dart'. +/// Provides functions for Base58 encoding and decoding. +/// +/// - `bech32`: Exported from 'package:blockchain_utils/bech32/bech32.dart'. +/// Provides functions for encoding and decoding Bech32 data. +/// +/// - `bip39`: Exported from 'package:blockchain_utils/bip39/bip39.dart'. +/// Includes classes and utilities for working with BIP39 mnemonics and +/// related functionality. +/// +/// - `hd_wallet`: Exported from 'package:blockchain_utils/hd_wallet/hd_wallet.dart'. +/// Offers support for HD wallets using the BIP32 specification. +/// +/// - `crypto_currencies`: Exported from 'package:blockchain_utils/hd_wallet/cypto_currencies/cyrpto_currency.dart'. +/// Provides information about cryptocurrency symbols and related data. +/// +/// - `secret_wallet`: Exported from 'package:blockchain_utils/secret_wallet/secret_wallet.dart'. +/// Includes utilities for creating and encoding secret wallets. + library blockchain_utils; export 'package:blockchain_utils/base58/base58.dart'; diff --git a/lib/crypto/crypto.dart b/lib/crypto/crypto.dart index a7b988b..ef3f172 100644 --- a/lib/crypto/crypto.dart +++ b/lib/crypto/crypto.dart @@ -1,5 +1,3 @@ -library bitcoin_crypto; - import 'dart:convert'; import 'package:pointycastle/export.dart'; import "dart:typed_data"; diff --git a/lib/hd_wallet/cypto_currencies/cyrpto_currency.dart b/lib/hd_wallet/cypto_currencies/cyrpto_currency.dart index b9a52e1..93f3e54 100644 --- a/lib/hd_wallet/cypto_currencies/cyrpto_currency.dart +++ b/lib/hd_wallet/cypto_currencies/cyrpto_currency.dart @@ -1,9 +1,5 @@ -library bip32_curenciess; - import 'dart:typed_data'; - import 'package:blockchain_utils/formating/bytes_num_formating.dart'; - part 'currencies.dart'; // Currecy Symbols diff --git a/lib/secret_wallet/secret_wallet.dart b/lib/secret_wallet/secret_wallet.dart index cd01a9a..09db789 100644 --- a/lib/secret_wallet/secret_wallet.dart +++ b/lib/secret_wallet/secret_wallet.dart @@ -94,8 +94,7 @@ class SecretWallet { ); /// Creates a new wallet wrapping the specified [credentials] by encrypting - /// the private key with the [password]. The [random] instance, which should - /// be cryptographically secure, is used to generate encryption keys. + /// the private key with the [password] /// You can configure the parameter N of the scrypt algorithm if you need to. /// The default value for [scryptN] is 8192. Be aware that this N must be a /// power of two. diff --git a/lib/uuid/uuid.dart b/lib/uuid/uuid.dart index 7a8b412..2bb4385 100644 --- a/lib/uuid/uuid.dart +++ b/lib/uuid/uuid.dart @@ -1,3 +1,11 @@ +/// UUID Library +/// +/// This library provides utility functions and classes for working with +/// Universally Unique Identifiers (UUIDs). UUIDs are commonly used in +/// various applications to uniquely identify entities or resources. +/// +/// The `UUID` class within this library allows for the generation UUID V4 + library uuid; import 'dart:math' as math; diff --git a/pubspec.yaml b/pubspec.yaml index 5c8183e..f50043c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: blockchain_utils -description: Blockchain Utils is a comprehensive Dart package designed to simplify blockchain-related development tasks. With support for a wide range of encoding and decoding formats, multi-language BIP39 mnemonics, Web3 secret storage management, and Bip32 wallets, this package empowers developers to work seamlessly with blockchain technologies. -version: 0.2.0 +description: Simplify blockchain dev with Base58, Bech32, BIP39 mnemonics, Web3 storage, and BIP32 HD wallets in one package. +version: 0.3.0 homepage: "https://github.com/mrtnetwork/blockchain_utils" repository: "https://github.com/mrtnetwork/blockchain_utils"