Skip to content

Commit

Permalink
V3.1.0
Browse files Browse the repository at this point in the history
- Ton Address Support: Implemented functionality to support Ton addresses.
- Ton Mnemonic Support:
  - Added mnemonic and seed generation capabilities for Ton.
  - Introduced a mnemonic validator for Ton.
- BIP-44 Support for TonCoin: Added TonCoin to the list of supported coins under the BIP-44 standard.
- The SecretWallet class name has been updated to Web3SecretStorageDefinitionV3.
  • Loading branch information
mrtnetwork committed Jun 15, 2024
1 parent 43d975b commit 6501ca0
Show file tree
Hide file tree
Showing 428 changed files with 3,008 additions and 1,533 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 3.1.0

- Ton Address Support: Implemented functionality to support Ton addresses.
- Ton Mnemonic Support:
- Added mnemonic and seed generation capabilities for Ton.
- Introduced a mnemonic validator for Ton.
- BIP-44 Support for TonCoin: Added TonCoin to the list of supported coins under the BIP-44 standard.
- The SecretWallet class name has been updated to Web3SecretStorageDefinitionV3.

## 3.0.0

- Improved hex performance.
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ This comprehensive package has been shaped by the influence of several key sourc
- Algorand
- Ada Shelley
- Ada Byron
- Ton

**Binary Data:**

Expand Down Expand Up @@ -90,6 +91,7 @@ This comprehensive package has been shaped by the influence of several key sourc
- SHA256
- SHA384
- SHA512
- XXhash

These algorithms provide a wide range of cryptographic functions, including encryption, decryption, message authentication, hashing, and more, to enhance security and data integrity in applications.

Expand Down Expand Up @@ -129,6 +131,8 @@ This comprehensive package has been shaped by the influence of several key sourc

24. **Electrum Mnemonic V1 and V2 with Key and Address Management:** Support for both Electrum Mnemonic V1 and V2, including SegWit and Standard transactions.

26. **TonMnemonic:** Support for Ton mnemonics has been added, enabling creation, validation, and seed generation.

These features make your package a comprehensive solution for encoding, cryptography, blockchain management, BIP39 mnemonic support, and diverse blockchain address encoding and decoding needs.

25. **Sign and Verification:** Implements classes for signing and verifying transaction digests.
Expand Down
28 changes: 26 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
include: package:lints/recommended.yaml
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/tools/linter-rules.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
# https://dart.dev/tools/analysis
9 changes: 5 additions & 4 deletions example/lib/test/address/ada_byron/byron.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:blockchain_utils/bip/address/ada/ada_byron_addr.dart';
import 'package:blockchain_utils/compare/compare.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';
import 'byron_test_vector.dart' as byron;
import 'lagacy_test_vector.dart' as lagacy;

Expand All @@ -13,7 +12,8 @@ void adaByronAddrTest() {
.encodeKey(BytesUtils.fromHexString(i["public"]), params);
assert(l == i["address"]);
final decode = AdaByronAddrDecoder().decodeAddr(l);
assert(bytesEqual(decode, BytesUtils.fromHexString(i["decode"])));
assert(
BytesUtils.bytesEqual(decode, BytesUtils.fromHexString(i["decode"])));
}

for (final i in byron.testVector) {
Expand All @@ -23,6 +23,7 @@ void adaByronAddrTest() {
.encodeKey(BytesUtils.fromHexString(i["public"]), params);
assert(l == i["address"]);
final decode = AdaByronAddrDecoder().decodeAddr(l);
assert(bytesEqual(decode, BytesUtils.fromHexString(i["decode"])));
assert(
BytesUtils.bytesEqual(decode, BytesUtils.fromHexString(i["decode"])));
}
}
2 changes: 1 addition & 1 deletion example/lib/test/address/ada_shelly/ada_shelly.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:blockchain_utils/bip/address/decoders.dart';
import 'package:blockchain_utils/bip/address/encoders.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';
import 'test_vector.dart';
import 'stacking_test_vector.dart' as t;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/algo/algo.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/algo_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';
import 'test_vector.dart';

void algoAddressTest() {
Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/aptos/aptos.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/aptos_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';
import 'test_vector.dart';

void aptosAddressTest() {
Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/atom/atom.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/atom_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';
import 'test_vector.dart';

void atomAddressTest() {
Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/avax/avax.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/avax_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_p_vector.dart' as p;
import 'test_x_vector.dart' as x;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/bch_p2pkh/bch_p2pkh.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/p2pkh_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/bch_p2sh/bch_p2sh.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/p2sh_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/egld/egld.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/egld_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/eos/eos.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/eos_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/ergo/ergo.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/ergo.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/eth/eth.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/eth_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/fil/fil.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/fil_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/icx/icx.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/icx_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVecotr;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/inj/inj.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/inj_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/nano/nano.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/nano_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/near/near.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/near_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/neo/neo.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/neo_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVecotr;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/okex/okex.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/okex_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/one/one.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/one_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/p2pkh/p2pkh.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/p2pkh_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'comperesed_test_vector.dart' show compresedTestVector;
import 'uncompresed_test_vector.dart' show uncompressedTestVector;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/p2sh/p2sh.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/p2sh_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/p2tr/p2tr.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/p2tr_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/p2wpkh/p2wpkh.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/p2wpkh_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/sol/sol.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/sol_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/substrate/substrate.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/substrate_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/trx/trx.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/trx_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test.dart' show testVecotr;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/xlm/xml.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/xlm_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/xmr/xmr.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/xmr_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;
import 'test_vector_integrate.dart' show integrateTestVecotr;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/xrp/xrp.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/xrp_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/xtz/xtz.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/xtz_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/address/zil/zil.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/bip/address/zil_addr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

import 'test_vector.dart' show testVector;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/algorand/mnemonic.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:blockchain_utils/bip/algorand/mnemonic/algorand_seed_generator.d
import 'package:blockchain_utils/bip/bip/bip44/bip44.dart';
import 'package:blockchain_utils/bip/bip/conf/bip44/bip44_coins.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';
import 'test_vector.dart';

void algorandMnemonicAndAddressTest() {
Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/base58/base58.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blockchain_utils/base58/base58.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

final List<Map<String, String>> testVectBtc = [
{"raw": "", "encode": "", "check_encode": "3QJmnh"},
Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/base58/base58_xmr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import 'package:blockchain_utils/base58/base58_xmr.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

var _testVect = [
{
Expand Down
5 changes: 2 additions & 3 deletions example/lib/test/bech32/bch_bech32.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import 'package:blockchain_utils/bech32/bch_bech32.dart';
import 'package:blockchain_utils/bip/coin_conf/coins_conf.dart';
import 'package:blockchain_utils/compare/compare.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

final List<Map<String, String>> _testVect = [
{
Expand Down Expand Up @@ -36,7 +35,7 @@ void bchBech32Test() {
final hrp = i["encode"]!.substring(0, i["encode"]!.indexOf(":"));
final decode = BchBech32Decoder.decode(hrp, i["encode"]!);
assert(decode.item2.toHex() == i["raw"]);
assert(bytesEqual(
assert(BytesUtils.bytesEqual(
decode.item1, CoinsConf.bitcoinCashMainNet.params.p2pkhStdNetVer));
}
for (final i in _testVect) {
Expand Down
2 changes: 1 addition & 1 deletion example/lib/test/bech32/bech32.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import 'package:blockchain_utils/bech32/bech32.dart';
import 'package:example/test/quick_hex.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';
// import 'package:test/test.dart';

final List<Map<String, String>> _testVect = [
Expand Down
Loading

0 comments on commit 6501ca0

Please sign in to comment.