Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtnetwork committed Feb 27, 2024
1 parent ce7a923 commit 8334cdd
Show file tree
Hide file tree
Showing 12 changed files with 803 additions and 96 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# 4.0.0
## 4.1.0

* Update dependencies

## 4.0.0

* Added support for BitcoinSV network
* Introduced classes for improved network address handling
Expand Down
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: package:flutter_lints/flutter.yaml
include: package:lints/recommended.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
1 change: 1 addition & 0 deletions example/lib/bitcoin_cash/create_cash_token_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ void main() async {
/// by identifying the transaction that spent the 0th output of the transaction referenced by the category ID.
String? vout0Hash;
try {
// Retrieve the transaction hash of the 0th output UTXO
vout0Hash =
utxos.firstWhere((element) => element.utxo.vout == 0).utxo.txHash;
} on StateError {
Expand Down
3 changes: 2 additions & 1 deletion example/test/widget_test.dart
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
void main() {}
/// "wss://bitcoin.aranguren.org:50004"
void main() async {}
32 changes: 15 additions & 17 deletions lib/src/bitcoin_cash/bcmr_registery.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/// https://github.com/bitjson/chip-bcmr
/// A mapping of identifiers to URIs associated with an entity. URI identifiers
/// may be widely-standardized or registry-specific. Values must be valid URIs,
/// including a protocol prefix – e.g. `https://` or `ipfs://`., Clients are only
Expand Down Expand Up @@ -117,7 +115,7 @@ class Tag {
final URIs? uris;

/// A mapping of `Tag` extension identifiers to extension definitions.
/// {@link Extensions} may be widely standardized or application-specific.
/// Extensions may be widely standardized or application-specific.
final Extensions? extensions;

const Tag({required this.name, this.description, this.uris, this.extensions});
Expand Down Expand Up @@ -243,7 +241,7 @@ class NftCategoryFieldType {
final String? description;

/// The expected encoding of this field when read from the parsing altstack
/// (see {@link ParsableNftCollection}). All encoding definitions must have a
/// (see [ParsableNftCollection]). All encoding definitions must have a
/// `type`, and some encoding definitions allow for additional hinting about
/// display strategies in clients.
///
Expand Down Expand Up @@ -279,7 +277,7 @@ class NftCategoryFieldType {
final URIs? uris;

/// A mapping of NFT field extension identifiers to extension definitions.
/// {@link Extensions} may be widely standardized or application-specific.
/// [Extensions] may be widely standardized or application-specific.
final Extensions? extensions;

factory NftCategoryFieldType.fromJson(Map<String, dynamic> json) {
Expand Down Expand Up @@ -340,8 +338,8 @@ abstract class Parse {

/// Interpretation information for a collection of sequential NFTs, a collection
/// in which each NFT includes only a sequential identifier within its on-chain
/// commitment. Note that {@link SequentialNftCollection}s differ from
/// {@link ParsableNftCollection}s in that sequential collections lack a
/// commitment. Note that [SequentialNftCollection]s differ from
/// [ParsableNftCollection]s in that sequential collections lack a
/// parsing `bytecode` with which to inspect each NFT commitment: the type of
/// each NFT is indexed by the full contents its commitment (interpreted as a
/// positive VM integer in user interfaces).
Expand All @@ -366,7 +364,7 @@ class SequentialNftCollection implements Parse {
/// Interpretation information for a collection of parsable NFTs, a collection
/// in which each NFT may include additional metadata fields beyond a sequential
/// identifier within its on-chain commitment. Note that
/// {@link ParsableNftCollection}s differ from {@link SequentialNftCollection}s
/// [ParsableNftCollection]s differ from [SequentialNftCollection]s
/// in that parsable collections require a parsing `bytecode` with which to
/// inspect each NFT commitment: the type of each NFT is indexed by the
/// hex-encoded contents the bottom item on the altstack following the evaluation
Expand Down Expand Up @@ -409,7 +407,7 @@ class ParsableNftCollection implements Parse {
/// pushing the first byte to the altstack as an NFT type identifier and the
/// remaining segment of the commitment as the first NFT field value.
///
/// If undefined (in a {@link SequentialNftCollection}), this field could be
/// If undefined (in a [SequentialNftCollection]), this field could be
/// considered to have a default value of `00d26b` (OP_0 OP_UTXOTOKENCOMMITMENT
/// OP_TOALTSTACK), which takes the full contents of the commitment as a fixed
/// type index. As such, each index of the NFT category's `types` maps a
Expand Down Expand Up @@ -594,7 +592,7 @@ class IdentitySnapshot {

/// The split ID of this identity's chain of record.
///
/// If undefined, defaults to {@link Registry.defaultChain}.
/// If undefined, defaults to [Registry.defaultChain].
final String? splitId;

/// A mapping of identifiers to URIs associated with this identity. URI
Expand Down Expand Up @@ -632,7 +630,7 @@ class IdentitySnapshot {
final URIs? uris;

/// A mapping of `IdentitySnapshot` extension identifiers to extension
/// definitions. {@link Extensions} may be widely standardized or
/// definitions. [Extensions] may be widely standardized or
/// application-specific.
///
/// Standardized extensions for `IdentitySnapshot`s include the `authchain`
Expand Down Expand Up @@ -881,9 +879,9 @@ class Registry {
final Map<String, Tag>? tags;

/// The split ID of the chain/network considered the "default" chain for this
/// registry. Identities that do not specify a {@link IdentitySnapshot.splitId}
/// registry. Identities that do not specify a [IdentitySnapshot.splitId]
/// are assumed to be set to this split ID. For a description of split IDs,
/// see {@link Registry.chains}.
/// see [Registry.chains].
///
/// If not provided, the `defaultChain` is
/// `0000000000000000029e471c41818d24b8b74c911071c4ef0b4a0509f9b5a8ce`, the BCH
Expand All @@ -894,7 +892,7 @@ class Registry {
/// (chipnet)
final String? defaultChain;

/// A map of split IDs tracked by this registry to the {@link ChainHistory} for
/// A map of split IDs tracked by this registry to the [ChainHistory] for
/// that chain/network.
///
/// The split ID of a chain is the block header hash (A.K.A. block ID) of the
Expand All @@ -911,12 +909,12 @@ class Registry {
/// (losing claimable value if the receivers of their transactions don't
/// acknowledge transfers on both chains). When a registry trusted by the
/// wallet notes the split in it's `chains` map, the wallet can represent the
/// split in the user interface using the the latest {@link ChainSnapshot} for
/// split in the user interface using the the latest [ChainSnapshot] for
/// each chain and splitting coins prior to spending (by introducing post-split
/// coins in each transaction).
///
/// This map may exclude the following well-known split IDs (all clients
/// supporting any of these chains should build-in {@link ChainHistory} for
/// supporting any of these chains should build-in [ChainHistory] for
/// those chains):
///
/// - `0000000000000000029e471c41818d24b8b74c911071c4ef0b4a0509f9b5a8ce`:
Expand All @@ -942,7 +940,7 @@ class Registry {
final String? license;

/// A mapping of `Registry` extension identifiers to extension definitions.
/// {@link Extensions} may be widely standardized or application-specific.
/// [Extensions] may be widely standardized or application-specific.
///
/// Standardized extensions for `Registry`s include the `locale` extension. See
/// https://github.com/bitjson/chip-bcmr#locales-extension for details.
Expand Down
42 changes: 21 additions & 21 deletions lib/src/cash_token/cash_token.dart
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/// MIT License
/// Copyright (c) Jason Dreyzehner
/// https://github.com/bitauth/libauth?tab=MIT-1-ov-file#readme
///
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
/// The above copyright notice and this permission notice shall be included in all
/// copies or substantial portions of the Software.
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
/// SOFTWARE.
// MIT License
// Copyright (c) Jason Dreyzehner
// https://github.com/bitauth/libauth?tab=MIT-1-ov-file#readme
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

import 'dart:typed_data';
import 'package:blockchain_utils/blockchain_utils.dart';
Expand Down
6 changes: 4 additions & 2 deletions lib/src/provider/api_provider/electrum_api_provider.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'package:bitcoin_base/src/provider/api_provider.dart';
import 'dart:async';

import 'package:blockchain_utils/exception/exceptions.dart';

class ElectrumApiProvider {
final BitcoinBaseElectrumRPCService rpc;
ElectrumApiProvider(this.rpc);
Expand All @@ -22,8 +24,8 @@ class ElectrumApiProvider {
if (data["error"] != null) {
final code = int.parse(((data["error"]?['code']?.toString()) ?? "0"));
final message = data["error"]?['message'] ?? "";
throw ElectrumRPCException(
code: code,
throw RPCError(
errorCode: code,
message: message,
data: data["error"]?["data"],
request: data["request"] ?? request.params,
Expand Down
3 changes: 0 additions & 3 deletions lib/src/provider/models/utxo_details.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/// UtxoAddressDetails represents ownership details associated with a Bitcoin unspent transaction output (UTXO).
/// It includes information such as the public key, Bitcoin address, and multi-signature address (if applicable)
/// of the UTXO owner.
import 'package:bitcoin_base/bitcoin_base.dart';

abstract class UTXO {
Expand Down
1 change: 0 additions & 1 deletion lib/src/provider/service/electrum/electrum.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export 'methods.dart';
export 'params.dart';
export 'service.dart';
export 'exception.dart';
88 changes: 44 additions & 44 deletions lib/src/provider/service/electrum/exception.dart
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
import 'package:blockchain_utils/blockchain_utils.dart';
// import 'package:blockchain_utils/blockchain_utils.dart';

/// Exception class representing errors encountered during RPC (Remote Procedure Call) requests.
class ElectrumRPCException implements BlockchainUtilsException {
/// Constructs an instance of [ElectrumRPCException] with the provided details.
const ElectrumRPCException(
{required this.message,
required this.code,
required this.data,
required this.request});
// /// Exception class representing errors encountered during RPC (Remote Procedure Call) requests.
// class ElectrumRPCException implements BlockchainUtilsException {
// /// Constructs an instance of [ElectrumRPCException] with the provided details.
// const ElectrumRPCException(
// {required this.message,
// required this.code,
// required this.data,
// required this.request});

/// The error code associated with the error.
final int code;
// /// The error code associated with the error.
// final int code;

/// A human-readable error message describing the issue.
@override
final String message;
// /// A human-readable error message describing the issue.
// @override
// final String message;

/// Additional data providing more context about the error (nullable).
final dynamic data;
// /// Additional data providing more context about the error (nullable).
// final dynamic data;

/// The original request that triggered the error.
final Map<String, dynamic> request;
// /// The original request that triggered the error.
// final Map<String, dynamic> request;

@override
String toString() {
return 'RPC Error: Received code $code with message "$message".';
}
// @override
// String toString() {
// return 'RPC Error: Received code $code with message "$message".';
// }

/// Converts the exception details to a JSON-formatted representation.
Map<String, dynamic> toJson() {
final error = {"message": message, "code": code};
if (data != null) {
error["data"] = data;
}
final toJson = {
"jsonrpc": "2.0",
"error": error,
};
if (request.isNotEmpty) {
if (request.containsKey("id")) {
toJson["id"] = request["id"];
}
if (request.containsKey("params") && request.containsKey("method")) {
toJson["params"] = request["params"];
toJson["method"] = request["method"];
}
}
return toJson;
}
}
// /// Converts the exception details to a JSON-formatted representation.
// Map<String, dynamic> toJson() {
// final error = {"message": message, "code": code};
// if (data != null) {
// error["data"] = data;
// }
// final toJson = {
// "jsonrpc": "2.0",
// "error": error,
// };
// if (request.isNotEmpty) {
// if (request.containsKey("id")) {
// toJson["id"] = request["id"];
// }
// if (request.containsKey("params") && request.containsKey("method")) {
// toJson["params"] = request["params"];
// toJson["method"] = request["method"];
// }
// }
// return toJson;
// }
// }
9 changes: 4 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: bitcoin_base
description: A versatile library for Bitcoin, Dogecoin, Litecoin, Dash, BSV, and BCH. Supports P2PKH, P2SH, P2WPKH, P2WSH, P2TR, with advanced creation, signing, and spending capabilities.
version: 4.0.0
version: 4.1.0
homepage: "https://github.com/mrtnetwork/bitcoin_base"
repository: "https://github.com/mrtnetwork/bitcoin_base"
Author: mrhaydari.t@gmail.com
Expand All @@ -16,13 +16,12 @@ environment:


dependencies:
blockchain_utils: ^1.6.0
blockchain_utils: ^2.0.1


dev_dependencies:
test: ^1.24.6
flutter_lints: ^2.0.0
lints: ^2.1.1
test: ^1.25.2
lints: ^3.0.0


# For information on the generic Dart part of this file, see the
Expand Down
Loading

0 comments on commit 8334cdd

Please sign in to comment.