Skip to content

Commit

Permalink
Begin implementing Bitcoin Protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenAppers committed Oct 22, 2019
1 parent 736b7eb commit 842eaa7
Show file tree
Hide file tree
Showing 30 changed files with 559 additions and 266 deletions.
9 changes: 9 additions & 0 deletions example/pubspec.lock
Expand Up @@ -99,6 +99,15 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2+dart2"
dartssh:
dependency: transitive
description:
path: "."
ref: HEAD
resolved-ref: f52beca2e424456464b27e61a9685622d2c70e70
url: "https://github.com/GreenAppers/dartssh"
source: git
version: "1.0.0+0"
ed25519_hd_key:
dependency: transitive
description:
Expand Down
17 changes: 11 additions & 6 deletions lib/currency.dart
Expand Up @@ -6,11 +6,11 @@ import 'dart:typed_data';

import "package:pointycastle/src/utils.dart";

import 'package:cruzawl/btc.dart';
import 'package:cruzawl/cruz.dart';
import 'package:cruzawl/eth.dart';
import 'package:cruzawl/http.dart';
import 'package:cruzawl/currency/btc.dart';
import 'package:cruzawl/currency/cruz.dart';
import 'package:cruzawl/currency/eth.dart';
import 'package:cruzawl/network.dart';
import 'package:cruzawl/network/http.dart';
import 'package:cruzawl/util.dart';

/// Interface [Wallet] interacts with, potentially supports multiple cryptos
Expand Down Expand Up @@ -56,6 +56,9 @@ abstract class Currency {
/// Address with the value of zero.
PublicAddress get nullAddress;

/// Optional list of supported connections, e.g. [ 'Bitcoin', 'BitcoinRPC', 'BlockChainAPI' ].
List<String> get supportedPeerTypes => null;

/// Marshals [Currency] as a JSON-encoded string.
String toJson() => ticker;

Expand Down Expand Up @@ -84,7 +87,8 @@ abstract class Currency {
PeerNetwork createNetwork(
{VoidCallback peerChanged,
VoidCallback tipChanged,
HttpClient httpClient});
HttpClient httpClient,
String userAgent});

/// The [Block] with [Block.height] equal zero.
Block genesisBlock();
Expand Down Expand Up @@ -144,7 +148,8 @@ class LoadingCurrency extends Currency {
PeerNetwork createNetwork(
{VoidCallback peerChanged,
VoidCallback tipChanged,
HttpClient httpClient}) =>
HttpClient httpClient,
String userAgent}) =>
null;
Block genesisBlock() => null;
Address deriveAddress(Uint8List seed, String path,
Expand Down

0 comments on commit 842eaa7

Please sign in to comment.