Skip to content

Commit

Permalink
main
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtnetwork committed Sep 27, 2023
1 parent 8961bd2 commit fcaee5c
Show file tree
Hide file tree
Showing 20 changed files with 154 additions and 10 deletions.
15 changes: 15 additions & 0 deletions lib/base58/base58.dart
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
19 changes: 19 additions & 0 deletions lib/bech32/bech32.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
51 changes: 51 additions & 0 deletions lib/bip39/bip39.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
1 change: 1 addition & 0 deletions lib/bip39/load_languages/chinese_simplified.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Chinese (Simplified)
const List<String> chineseSimplified = [
"的",
"一",
Expand Down
1 change: 1 addition & 0 deletions lib/bip39/load_languages/chinese_traditional.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Chinese (Traditional)
const List<String> chineseTraditional = [
"的",
"一",
Expand Down
1 change: 1 addition & 0 deletions lib/bip39/load_languages/czech.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Czech
const List<String> czech = [
"abdikace",
"abeceda",
Expand Down
1 change: 1 addition & 0 deletions lib/bip39/load_languages/english.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// English
final List<String> english = [
"abandon",
"ability",
Expand Down
1 change: 1 addition & 0 deletions lib/bip39/load_languages/french.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// French
const List<String> french = [
"abaisser",
"abandon",
Expand Down
1 change: 1 addition & 0 deletions lib/bip39/load_languages/italian.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Italian
const List<String> italian = [
"abaco",
"abbaglio",
Expand Down
1 change: 1 addition & 0 deletions lib/bip39/load_languages/japanese.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Japanese
const List<String> japanese = [
"あいこくしん",
"あいさつ",
Expand Down
1 change: 1 addition & 0 deletions lib/bip39/load_languages/korean.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Korean
const List<String> korean = [
"가격",
"가끔",
Expand Down
19 changes: 19 additions & 0 deletions lib/bip39/load_languages/languages.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
1 change: 1 addition & 0 deletions lib/bip39/load_languages/portuguese.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Portuguese
final List<String> portuguese = [
"abacate",
"abaixo",
Expand Down
1 change: 1 addition & 0 deletions lib/bip39/load_languages/spanish.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Spanish
final List<String> spanish = [
"ábaco",
"abdomen",
Expand Down
29 changes: 29 additions & 0 deletions lib/blockchain_utils.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 0 additions & 2 deletions lib/crypto/crypto.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
library bitcoin_crypto;

import 'dart:convert';
import 'package:pointycastle/export.dart';
import "dart:typed_data";
Expand Down
4 changes: 0 additions & 4 deletions lib/hd_wallet/cypto_currencies/cyrpto_currency.dart
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions lib/secret_wallet/secret_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions lib/uuid/uuid.dart
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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"

Expand Down

0 comments on commit fcaee5c

Please sign in to comment.