mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-22 02:24:30 +00:00
ecash cash addr specific script hash convert
This commit is contained in:
parent
9269835a95
commit
226617c4c1
1 changed files with 17 additions and 0 deletions
|
@ -82,6 +82,23 @@ class Ecash 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,
|
||||||
|
|
Loading…
Reference in a new issue