mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-02-02 03:06:29 +00:00
bch tweaks
This commit is contained in:
parent
5b5908196d
commit
157c7874f5
2 changed files with 31 additions and 8 deletions
|
@ -28,6 +28,10 @@ class Bitcoincash extends Bip39HDCurrency {
|
||||||
@override
|
@override
|
||||||
int get maxNumberOfIndexesToCheck => 10000000;
|
int get maxNumberOfIndexesToCheck => 10000000;
|
||||||
|
|
||||||
|
@override
|
||||||
|
// change this to change the number of confirms a tx needs in order to show as confirmed
|
||||||
|
int get minConfirms => 0; // bch zeroconf
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<DerivePathType> get supportedDerivationPathTypes => [
|
List<DerivePathType> get supportedDerivationPathTypes => [
|
||||||
DerivePathType.bip44,
|
DerivePathType.bip44,
|
||||||
|
@ -80,6 +84,23 @@ class Bitcoincash extends Bip39HDCurrency {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String addressToScriptHash({required String address}) {
|
||||||
|
try {
|
||||||
|
if (bitbox.Address.detectFormat(address) ==
|
||||||
|
bitbox.Address.formatCashAddr &&
|
||||||
|
_validateCashAddr(address)) {
|
||||||
|
address = bitbox.Address.toLegacyAddress(address);
|
||||||
|
}
|
||||||
|
|
||||||
|
final addr = coinlib.Address.fromString(address, networkParams);
|
||||||
|
return Bip39HDCurrency.convertBytesToScriptHash(
|
||||||
|
addr.program.script.compiled);
|
||||||
|
} catch (e) {
|
||||||
|
rethrow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String constructDerivePath({
|
String constructDerivePath({
|
||||||
required DerivePathType derivePathType,
|
required DerivePathType derivePathType,
|
||||||
|
@ -143,10 +164,6 @@ class Bitcoincash extends Bip39HDCurrency {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
// change this to change the number of confirms a tx needs in order to show as confirmed
|
|
||||||
int get minConfirms => 0; // bch zeroconf
|
|
||||||
|
|
||||||
// TODO: [prio=med] bch p2sh addresses (complaints regarding sending to)
|
// TODO: [prio=med] bch p2sh addresses (complaints regarding sending to)
|
||||||
@override
|
@override
|
||||||
bool validateAddress(String address) {
|
bool validateAddress(String address) {
|
||||||
|
|
|
@ -28,11 +28,14 @@ class BitcoincashWallet extends Bip39HDWallet with ElectrumX {
|
||||||
[
|
[
|
||||||
...standardChangeAddressFilters,
|
...standardChangeAddressFilters,
|
||||||
FilterGroup.not(
|
FilterGroup.not(
|
||||||
const FilterCondition.startsWith(
|
const ObjectFilter(
|
||||||
property: "derivationPath",
|
property: "derivationPath",
|
||||||
|
filter: FilterCondition.startsWith(
|
||||||
|
property: "value",
|
||||||
value: "m/44'/0'",
|
value: "m/44'/0'",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -41,11 +44,14 @@ class BitcoincashWallet extends Bip39HDWallet with ElectrumX {
|
||||||
[
|
[
|
||||||
...standardReceivingAddressFilters,
|
...standardReceivingAddressFilters,
|
||||||
FilterGroup.not(
|
FilterGroup.not(
|
||||||
const FilterCondition.startsWith(
|
const ObjectFilter(
|
||||||
property: "derivationPath",
|
property: "derivationPath",
|
||||||
|
filter: FilterCondition.startsWith(
|
||||||
|
property: "value",
|
||||||
value: "m/44'/0'",
|
value: "m/44'/0'",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue