Skip to content

Commit

Permalink
v4.4.0
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
mrtnetwork committed Jun 15, 2024
1 parent 2bf471b commit 3a0580d
Show file tree
Hide file tree
Showing 25 changed files with 126 additions and 82 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.4.0

* Update dependencies

## 4.3.0

* Update dependencies
Expand Down
2 changes: 1 addition & 1 deletion example/lib/bitcoin_cash/burn_token_example.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:bitcoin_base/bitcoin_base.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/blockchain_utils.dart';
import 'package:example/services_examples/electrum/electrum_websocket_service.dart';

/// https://github.com/cashtokens/cashtokens
Expand Down
2 changes: 1 addition & 1 deletion example/lib/bitcoin_cash/create_cash_token_example.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:bitcoin_base/bitcoin_base.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/blockchain_utils.dart';
import 'package:example/services_examples/electrum/electrum_websocket_service.dart';

/// please make sure read this before create transaction on mainnet
Expand Down
2 changes: 1 addition & 1 deletion example/lib/bitcoin_cash/create_nft_example.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:bitcoin_base/bitcoin_base.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/blockchain_utils.dart';
import 'package:example/services_examples/electrum/electrum_websocket_service.dart';

/// please make sure read this before create transaction on mainnet
Expand Down
2 changes: 1 addition & 1 deletion example/lib/bitcoin_cash/make_vout0_example.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:bitcoin_base/bitcoin_base.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/blockchain_utils.dart';
import 'package:example/services_examples/electrum/electrum_ssl_service.dart';

/// make vout 0 for account for create token hash
Expand Down
3 changes: 1 addition & 2 deletions example/lib/bitcoin_cash/minting_nft_example.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:convert';

import 'package:bitcoin_base/bitcoin_base.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/blockchain_utils.dart';
import 'package:example/services_examples/electrum/electrum_websocket_service.dart';

/// https://github.com/cashtokens/cashtokens
Expand Down
2 changes: 1 addition & 1 deletion example/lib/bitcoin_cash/p2sh32_spend_example.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:bitcoin_base/bitcoin_base.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/blockchain_utils.dart';
import 'package:example/services_examples/electrum/electrum_websocket_service.dart';

/// CHIP-2022-05 Pay-to-Script-Hash-32 (P2SH32) for Bitcoin Cash
Expand Down
2 changes: 1 addition & 1 deletion example/lib/bitcoin_cash/send_ft_token_example.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:bitcoin_base/bitcoin_base.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/blockchain_utils.dart';
import 'package:example/services_examples/electrum/electrum_websocket_service.dart';

/// please make sure read this before create transaction on mainnet
Expand Down
2 changes: 1 addition & 1 deletion example/lib/bitcoin_cash/transfer_bch_example.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:bitcoin_base/bitcoin_base.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/blockchain_utils.dart';
import 'package:example/services_examples/electrum/electrum_websocket_service.dart';

/// CHIP-2022-05 Pay-to-Script-Hash-32 (P2SH32) for Bitcoin Cash
Expand Down
2 changes: 1 addition & 1 deletion example/lib/global/bch_example.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:bitcoin_base/bitcoin_base.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/blockchain_utils.dart';
import 'package:example/services_examples/electrum/electrum_websocket_service.dart';

void main() async {
Expand Down
32 changes: 16 additions & 16 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ packages:
blockchain_utils:
dependency: "direct main"
description:
name: blockchain_utils
sha256: "699d72427447814bd574b95b0d3baf9b2c0ec9c9b82deef3c6264c6f5efa4406"
url: "https://pub.dev"
source: hosted
path: "../../blockchain_utils"
relative: true
source: path
version: "3.0.0"
boolean_selector:
dependency: transitive
Expand Down Expand Up @@ -110,26 +109,26 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
url: "https://pub.dev"
source: hosted
version: "10.0.0"
version: "10.0.4"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.3"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.1"
lints:
dependency: transitive
description:
Expand Down Expand Up @@ -158,10 +157,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.12.0"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -219,10 +218,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
url: "https://pub.dev"
source: hosted
version: "0.6.1"
version: "0.7.0"
typed_data:
dependency: transitive
description:
Expand All @@ -243,10 +242,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev"
source: hosted
version: "13.0.0"
version: "14.2.1"
web:
dependency: transitive
description:
Expand All @@ -257,3 +256,4 @@ packages:
version: "0.5.1"
sdks:
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
6 changes: 3 additions & 3 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ dependencies:
cupertino_icons: ^1.0.2
bitcoin_base:
path: ../
# blockchain_utils:
# path: ../../blockchain_utils
blockchain_utils: ^3.0.0
blockchain_utils:
path: ../../blockchain_utils
# blockchain_utils: ^3.0.0
http: ^1.2.0

dev_dependencies:
Expand Down
28 changes: 14 additions & 14 deletions lib/src/bitcoin/address/utils/address_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class _BitcoinAddressUtils {
/// Verify the checksum.
List<int> hash = QuickCrypto.sha256DoubleHash(data)
.sublist(0, Base58Const.checksumByteLen);
if (!bytesEqual(checksum, hash)) {
if (!BytesUtils.bytesEqual(checksum, hash)) {
return null;
}

Expand All @@ -65,9 +65,9 @@ class _BitcoinAddressUtils {
return null;
}
final decodedHex = BytesUtils.toHexString(decode.item1);
if (bytesEqual(decode.item2, networks.p2pkhNetVer)) {
if (BytesUtils.bytesEqual(decode.item2, networks.p2pkhNetVer)) {
return P2pkhAddress.fromHash160(addrHash: decodedHex);
} else if (bytesEqual(decode.item2, networks.p2shNetVer)) {
} else if (BytesUtils.bytesEqual(decode.item2, networks.p2shNetVer)) {
return P2shAddress.fromHash160(addrHash: decodedHex);
}
return null;
Expand Down Expand Up @@ -229,28 +229,28 @@ class _BitcoinAddressUtils {
return null;
}
if (scriptLength == hash160DigestLength) {
final legacyP2pk = bytesEqual(network.p2pkhNetVer, version);
final legacyP2pk = BytesUtils.bytesEqual(network.p2pkhNetVer, version);

if (bytesEqual(network.p2pkhNetVer, version) ||
bytesEqual(network.p2pkhWtNetVer, version)) {
if (BytesUtils.bytesEqual(network.p2pkhNetVer, version) ||
BytesUtils.bytesEqual(network.p2pkhWtNetVer, version)) {
return P2pkhAddress.fromHash160(
addrHash: scriptHex,
type:
legacyP2pk ? P2pkhAddressType.p2pkh : P2pkhAddressType.p2pkhwt);
}
final legacyP2sh = bytesEqual(network.p2shNetVer, version);
if (bytesEqual(network.p2shNetVer, version) ||
bytesEqual(network.p2shwt20NetVer, version)) {
final legacyP2sh = BytesUtils.bytesEqual(network.p2shNetVer, version);
if (BytesUtils.bytesEqual(network.p2shNetVer, version) ||
BytesUtils.bytesEqual(network.p2shwt20NetVer, version)) {
return P2shAddress.fromHash160(
addrHash: scriptHex,
type: legacyP2sh
? P2shAddressType.p2pkhInP2sh
: P2shAddressType.p2pkhInP2shwt);
}
} else {
final legacyP2sh = bytesEqual(network.p2sh32NetVer, version);
if (bytesEqual(network.p2sh32NetVer, version) ||
bytesEqual(network.p2shwt32NetVer, version)) {
final legacyP2sh = BytesUtils.bytesEqual(network.p2sh32NetVer, version);
if (BytesUtils.bytesEqual(network.p2sh32NetVer, version) ||
BytesUtils.bytesEqual(network.p2shwt32NetVer, version)) {
return P2shAddress.fromHash160(
addrHash: scriptHex,
type: legacyP2sh
Expand Down Expand Up @@ -296,15 +296,15 @@ class _BitcoinAddressUtils {

switch (type) {
case P2pkhAddressType.p2pkh:
if (bytesEqual(version, network.p2pkhNetVer)) {
if (BytesUtils.bytesEqual(version, network.p2pkhNetVer)) {
return scriptHex;
}
return null;
case P2shAddressType.p2pkhInP2sh:
case P2shAddressType.p2pkInP2sh:
case P2shAddressType.p2wshInP2sh:
case P2shAddressType.p2wpkhInP2sh:
if (bytesEqual(version, network.p2shNetVer)) {
if (BytesUtils.bytesEqual(version, network.p2shNetVer)) {
return scriptHex;
}
return null;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/bitcoin/script/control_block.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:bitcoin_base/src/bitcoin/script/op_code/constant.dart';
import 'package:bitcoin_base/src/crypto/keypair/ec_public.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/binary/utils.dart';

import 'script.dart';

Expand Down
5 changes: 1 addition & 4 deletions lib/src/bitcoin/script/input.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import 'package:bitcoin_base/src/bitcoin/script/op_code/constant.dart';
import 'package:blockchain_utils/binary/binary_operation.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/numbers/int_utils.dart';
import 'package:blockchain_utils/tuple/tuple.dart';
import 'package:blockchain_utils/utils/utils.dart';
import 'script.dart';

/// A transaction input requires a transaction id of a UTXO and the index of that UTXO.
Expand Down
3 changes: 1 addition & 2 deletions lib/src/bitcoin/script/op_code/tools.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:blockchain_utils/binary/binary_operation.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

List<int> opPushData(String hexData) {
final List<int> dataBytes = BytesUtils.fromHexString(hexData);
Expand Down
5 changes: 1 addition & 4 deletions lib/src/bitcoin/script/output.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import 'dart:typed_data';
import 'package:bitcoin_base/src/cash_token/cash_token.dart';
import 'package:bitcoin_base/src/bitcoin/script/script.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/numbers/bigint_utils.dart';
import 'package:blockchain_utils/numbers/int_utils.dart';
import 'package:blockchain_utils/tuple/tuple.dart';
import 'package:blockchain_utils/utils/utils.dart';

/// Represents a transaction output.
///
Expand Down
4 changes: 1 addition & 3 deletions lib/src/bitcoin/script/sequence.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'dart:typed_data';

import 'package:bitcoin_base/src/bitcoin/script/op_code/constant.dart';
import 'package:blockchain_utils/binary/binary_operation.dart';
import 'package:blockchain_utils/numbers/int_utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

/// Helps setting up appropriate sequence. Used to provide the sequence to transaction inputs and to scripts.
///
Expand Down
6 changes: 1 addition & 5 deletions lib/src/bitcoin/script/transaction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ import 'dart:typed_data';
import 'package:bitcoin_base/src/cash_token/cash_token.dart';
import 'package:bitcoin_base/src/bitcoin/script/op_code/constant.dart';
import 'package:bitcoin_base/src/crypto/crypto.dart';
import 'package:bitcoin_base/src/bytes_utils/dynamic_byte.dart';
import 'package:blockchain_utils/binary/binary_operation.dart';
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/utils/utils.dart';
import 'package:blockchain_utils/crypto/quick_crypto.dart';
import 'package:blockchain_utils/numbers/bigint_utils.dart';
import 'package:blockchain_utils/numbers/int_utils.dart';
import 'input.dart';
import 'output.dart';
import 'script.dart';
Expand Down
3 changes: 1 addition & 2 deletions lib/src/bitcoin/script/witness.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:blockchain_utils/binary/utils.dart';
import 'package:blockchain_utils/numbers/int_utils.dart';
import 'package:blockchain_utils/utils/utils.dart';

/// A list of the witness items required to satisfy the locking conditions of a segwit input (aka witness stack).
///
Expand Down
15 changes: 0 additions & 15 deletions lib/src/bytes_utils/dynamic_byte.dart

This file was deleted.

2 changes: 1 addition & 1 deletion lib/src/crypto/crypto.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ library bitcoin_crypto;

import 'package:bitcoin_base/src/bitcoin/script/op_code/constant_lib.dart';
import 'package:blockchain_utils/crypto/quick_crypto.dart';
import 'package:blockchain_utils/numbers/int_utils.dart';
import 'package:blockchain_utils/utils/utils.dart';
export 'keypair/ec_private.dart';
export 'keypair/ec_public.dart';

Expand Down
Loading

0 comments on commit 3a0580d

Please sign in to comment.