diff --git a/lib/wallets/crypto_currency/coins/bitcoin.dart b/lib/wallets/crypto_currency/coins/bitcoin.dart index d441961a7..01ce800e8 100644 --- a/lib/wallets/crypto_currency/coins/bitcoin.dart +++ b/lib/wallets/crypto_currency/coins/bitcoin.dart @@ -51,10 +51,10 @@ class Bitcoin extends Bip39HDCurrency with PaynymCurrencyInterface { ); @override - coinlib.NetworkParams get networkParams { + coinlib.Network get networkParams { switch (network) { case CryptoCurrencyNetwork.main: - return const coinlib.NetworkParams( + return coinlib.Network( wifPrefix: 0x80, p2pkhPrefix: 0x00, p2shPrefix: 0x05, @@ -62,9 +62,12 @@ class Bitcoin extends Bip39HDCurrency with PaynymCurrencyInterface { pubHDPrefix: 0x0488b21e, bech32Hrp: "bc", messagePrefix: '\x18Bitcoin Signed Message:\n', + minFee: BigInt.from(1), // TODO [prio=high]. + minOutput: BigInt.from(546), // TODO. + feePerKb: BigInt.from(1), // TODO. ); case CryptoCurrencyNetwork.test: - return const coinlib.NetworkParams( + return coinlib.Network( wifPrefix: 0xef, p2pkhPrefix: 0x6f, p2shPrefix: 0xc4, @@ -72,6 +75,9 @@ class Bitcoin extends Bip39HDCurrency with PaynymCurrencyInterface { pubHDPrefix: 0x043587cf, bech32Hrp: "tb", messagePrefix: "\x18Bitcoin Signed Message:\n", + minFee: BigInt.from(1), // TODO [prio=high]. + minOutput: BigInt.from(546), // TODO. + feePerKb: BigInt.from(1), // TODO. ); default: throw Exception("Unsupported network: $network"); diff --git a/lib/wallets/crypto_currency/coins/bitcoincash.dart b/lib/wallets/crypto_currency/coins/bitcoincash.dart index eaf40d4d0..3ae131346 100644 --- a/lib/wallets/crypto_currency/coins/bitcoincash.dart +++ b/lib/wallets/crypto_currency/coins/bitcoincash.dart @@ -59,10 +59,10 @@ class Bitcoincash extends Bip39HDCurrency { ); @override - coinlib.NetworkParams get networkParams { + coinlib.Network get networkParams { switch (network) { case CryptoCurrencyNetwork.main: - return const coinlib.NetworkParams( + return coinlib.Network( wifPrefix: 0x80, p2pkhPrefix: 0x00, p2shPrefix: 0x05, @@ -70,9 +70,12 @@ class Bitcoincash extends Bip39HDCurrency { pubHDPrefix: 0x0488b21e, bech32Hrp: "bc", messagePrefix: '\x18Bitcoin Signed Message:\n', + minFee: BigInt.from(1), // TODO [prio=high]. + minOutput: BigInt.from(546), // TODO. + feePerKb: BigInt.from(1), // TODO. ); case CryptoCurrencyNetwork.test: - return const coinlib.NetworkParams( + return coinlib.Network( wifPrefix: 0xef, p2pkhPrefix: 0x6f, p2shPrefix: 0xc4, @@ -80,6 +83,9 @@ class Bitcoincash extends Bip39HDCurrency { pubHDPrefix: 0x043587cf, bech32Hrp: "tb", messagePrefix: "\x18Bitcoin Signed Message:\n", + minFee: BigInt.from(1), // TODO [prio=high]. + minOutput: BigInt.from(546), // TODO. + feePerKb: BigInt.from(1), // TODO. ); default: throw Exception("Unsupported network: $network"); diff --git a/lib/wallets/crypto_currency/coins/dogecoin.dart b/lib/wallets/crypto_currency/coins/dogecoin.dart index 2051839e4..18670cecc 100644 --- a/lib/wallets/crypto_currency/coins/dogecoin.dart +++ b/lib/wallets/crypto_currency/coins/dogecoin.dart @@ -102,10 +102,10 @@ class Dogecoin extends Bip39HDCurrency { int get minConfirms => 1; @override - coinlib.NetworkParams get networkParams { + coinlib.Network get networkParams { switch (network) { case CryptoCurrencyNetwork.main: - return const coinlib.NetworkParams( + return coinlib.Network( wifPrefix: 0x9e, p2pkhPrefix: 0x1e, p2shPrefix: 0x16, @@ -113,9 +113,12 @@ class Dogecoin extends Bip39HDCurrency { pubHDPrefix: 0x02facafd, bech32Hrp: "doge", messagePrefix: '\x18Dogecoin Signed Message:\n', + minFee: BigInt.from(1), // TODO [prio=high]. + minOutput: BigInt.from(1), // TODO. + feePerKb: BigInt.from(1), // TODO. ); case CryptoCurrencyNetwork.test: - return const coinlib.NetworkParams( + return coinlib.Network( wifPrefix: 0xf1, p2pkhPrefix: 0x71, p2shPrefix: 0xc4, @@ -123,6 +126,9 @@ class Dogecoin extends Bip39HDCurrency { pubHDPrefix: 0x043587cf, bech32Hrp: "tdge", messagePrefix: "\x18Dogecoin Signed Message:\n", + minFee: BigInt.from(1), // TODO [prio=high]. + minOutput: BigInt.from(1), // TODO. + feePerKb: BigInt.from(1), // TODO. ); default: throw Exception("Unsupported network: $network"); diff --git a/lib/wallets/crypto_currency/coins/ecash.dart b/lib/wallets/crypto_currency/coins/ecash.dart index 07e164c6e..36d24ac82 100644 --- a/lib/wallets/crypto_currency/coins/ecash.dart +++ b/lib/wallets/crypto_currency/coins/ecash.dart @@ -57,10 +57,10 @@ class Ecash extends Bip39HDCurrency { ); @override - coinlib.NetworkParams get networkParams { + coinlib.Network get networkParams { switch (network) { case CryptoCurrencyNetwork.main: - return const coinlib.NetworkParams( + return coinlib.Network( wifPrefix: 0x80, p2pkhPrefix: 0x00, p2shPrefix: 0x05, @@ -68,9 +68,12 @@ class Ecash extends Bip39HDCurrency { pubHDPrefix: 0x0488b21e, bech32Hrp: "bc", messagePrefix: '\x18Bitcoin Signed Message:\n', + minFee: BigInt.from(1), // TODO [prio=high]. + minOutput: BigInt.from(1), // TODO. + feePerKb: BigInt.from(1), // TODO. ); case CryptoCurrencyNetwork.test: - return const coinlib.NetworkParams( + return coinlib.Network( wifPrefix: 0xef, p2pkhPrefix: 0x6f, p2shPrefix: 0xc4, @@ -78,6 +81,9 @@ class Ecash extends Bip39HDCurrency { pubHDPrefix: 0x043587cf, bech32Hrp: "tb", messagePrefix: "\x18Bitcoin Signed Message:\n", + minFee: BigInt.from(1), // TODO [prio=high]. + minOutput: BigInt.from(1), // TODO. + feePerKb: BigInt.from(1), // TODO. ); default: throw Exception("Unsupported network: $network"); diff --git a/lib/wallets/crypto_currency/coins/firo.dart b/lib/wallets/crypto_currency/coins/firo.dart index 82eb8ab39..ab008ec6e 100644 --- a/lib/wallets/crypto_currency/coins/firo.dart +++ b/lib/wallets/crypto_currency/coins/firo.dart @@ -48,10 +48,10 @@ class Firo extends Bip39HDCurrency { ); @override - coinlib.NetworkParams get networkParams { + coinlib.Network get networkParams { switch (network) { case CryptoCurrencyNetwork.main: - return const coinlib.NetworkParams( + return coinlib.Network( wifPrefix: 0xd2, p2pkhPrefix: 0x52, p2shPrefix: 0x07, @@ -59,9 +59,12 @@ class Firo extends Bip39HDCurrency { pubHDPrefix: 0x0488b21e, bech32Hrp: "bc", messagePrefix: '\x18Zcoin Signed Message:\n', + minFee: BigInt.from(1), // TODO [prio=high]. + minOutput: BigInt.from(1), // TODO. + feePerKb: BigInt.from(1), // TODO. ); case CryptoCurrencyNetwork.test: - return const coinlib.NetworkParams( + return coinlib.Network( wifPrefix: 0xb9, p2pkhPrefix: 0x41, p2shPrefix: 0xb2, @@ -69,6 +72,9 @@ class Firo extends Bip39HDCurrency { pubHDPrefix: 0x043587cf, bech32Hrp: "tb", messagePrefix: "\x18Zcoin Signed Message:\n", + minFee: BigInt.from(1), // TODO [prio=high]. + minOutput: BigInt.from(1), // TODO. + feePerKb: BigInt.from(1), // TODO. ); default: throw Exception("Unsupported network: $network"); diff --git a/lib/wallets/crypto_currency/coins/litecoin.dart b/lib/wallets/crypto_currency/coins/litecoin.dart index 5c964db5a..c8ccf9281 100644 --- a/lib/wallets/crypto_currency/coins/litecoin.dart +++ b/lib/wallets/crypto_currency/coins/litecoin.dart @@ -55,10 +55,10 @@ class Litecoin extends Bip39HDCurrency { ); @override - coinlib.NetworkParams get networkParams { + coinlib.Network get networkParams { switch (network) { case CryptoCurrencyNetwork.main: - return const coinlib.NetworkParams( + return coinlib.Network( wifPrefix: 0xb0, p2pkhPrefix: 0x30, p2shPrefix: 0x32, @@ -66,9 +66,12 @@ class Litecoin extends Bip39HDCurrency { pubHDPrefix: 0x0488b21e, bech32Hrp: "ltc", messagePrefix: '\x19Litecoin Signed Message:\n', + minFee: BigInt.from(1), // TODO [prio=high]. + minOutput: BigInt.from(1), // TODO. + feePerKb: BigInt.from(1), // TODO. ); case CryptoCurrencyNetwork.test: - return const coinlib.NetworkParams( + return coinlib.Network( wifPrefix: 0xef, p2pkhPrefix: 0x6f, p2shPrefix: 0x3a, @@ -76,6 +79,9 @@ class Litecoin extends Bip39HDCurrency { pubHDPrefix: 0x043587cf, bech32Hrp: "tltc", messagePrefix: "\x19Litecoin Signed Message:\n", + minFee: BigInt.from(1), // TODO [prio=high]. + minOutput: BigInt.from(1), // TODO. + feePerKb: BigInt.from(1), // TODO. ); default: throw Exception("Unsupported network: $network"); diff --git a/lib/wallets/crypto_currency/coins/namecoin.dart b/lib/wallets/crypto_currency/coins/namecoin.dart index ce5906ee3..4353d70db 100644 --- a/lib/wallets/crypto_currency/coins/namecoin.dart +++ b/lib/wallets/crypto_currency/coins/namecoin.dart @@ -143,10 +143,10 @@ class Namecoin extends Bip39HDCurrency { @override // See https://github.com/cypherstack/stack_wallet/blob/621aff47969761014e0a6c4e699cb637d5687ab3/lib/services/coins/namecoin/namecoin_wallet.dart#L3474 - coinlib.NetworkParams get networkParams { + coinlib.Network get networkParams { switch (network) { case CryptoCurrencyNetwork.main: - return const coinlib.NetworkParams( + return coinlib.Network( wifPrefix: 0xb4, // From 180. p2pkhPrefix: 0x34, // From 52. p2shPrefix: 0x0d, // From 13. @@ -154,6 +154,9 @@ class Namecoin extends Bip39HDCurrency { pubHDPrefix: 0x0488b21e, bech32Hrp: "nc", messagePrefix: '\x18Namecoin Signed Message:\n', + minFee: BigInt.from(1), // TODO [prio=high]. + minOutput: BigInt.from(1), // TODO. + feePerKb: BigInt.from(1), // TODO. ); // case CryptoCurrencyNetwork.test: // TODO: [prio=low] Add testnet support. diff --git a/lib/wallets/crypto_currency/coins/particl.dart b/lib/wallets/crypto_currency/coins/particl.dart index 32da6e1f3..57e0b97cf 100644 --- a/lib/wallets/crypto_currency/coins/particl.dart +++ b/lib/wallets/crypto_currency/coins/particl.dart @@ -125,10 +125,10 @@ class Particl extends Bip39HDCurrency { @override // See https://github.com/cypherstack/stack_wallet/blob/d08b5c9b22b58db800ad07b2ceeb44c6d05f9cf3/lib/services/coins/particl/particl_wallet.dart#L3532 - coinlib.NetworkParams get networkParams { + coinlib.Network get networkParams { switch (network) { case CryptoCurrencyNetwork.main: - return const coinlib.NetworkParams( + return coinlib.Network( wifPrefix: 0x6c, p2pkhPrefix: 0x38, p2shPrefix: 0x3c, @@ -136,6 +136,9 @@ class Particl extends Bip39HDCurrency { pubHDPrefix: 0x696e82d1, bech32Hrp: "pw", messagePrefix: '\x18Bitcoin Signed Message:\n', + minFee: BigInt.from(1), // TODO [prio=high]. + minOutput: BigInt.from(1), // TODO. + feePerKb: BigInt.from(1), // TODO. ); // case CryptoCurrencyNetwork.test: // TODO: [prio=low] Add testnet. diff --git a/lib/wallets/crypto_currency/intermediate/bip39_hd_currency.dart b/lib/wallets/crypto_currency/intermediate/bip39_hd_currency.dart index a2899d149..fa5d5c796 100644 --- a/lib/wallets/crypto_currency/intermediate/bip39_hd_currency.dart +++ b/lib/wallets/crypto_currency/intermediate/bip39_hd_currency.dart @@ -11,7 +11,7 @@ import 'package:stackwallet/wallets/crypto_currency/intermediate/bip39_currency. abstract class Bip39HDCurrency extends Bip39Currency { Bip39HDCurrency(super.network); - coinlib.NetworkParams get networkParams; + coinlib.Network get networkParams; Amount get dustLimit;