mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-04-15 02:31:57 +00:00
add bip352 address and derivation types
This commit is contained in:
parent
7439dbf9fc
commit
b5dcb9eea2
4 changed files with 16 additions and 7 deletions
lib
models/isar/models/blockchain_data
utilities/enums
wallets/isar/models
|
@ -101,7 +101,8 @@ class Address extends CryptoCurrencyAddress {
|
|||
}
|
||||
|
||||
@override
|
||||
String toString() => "{ "
|
||||
String toString() =>
|
||||
"{ "
|
||||
"id: $id, "
|
||||
"walletId: $walletId, "
|
||||
"value: $value, "
|
||||
|
@ -130,10 +131,7 @@ class Address extends CryptoCurrencyAddress {
|
|||
return jsonEncode(result);
|
||||
}
|
||||
|
||||
static Address fromJsonString(
|
||||
String jsonString, {
|
||||
String? overrideWalletId,
|
||||
}) {
|
||||
static Address fromJsonString(String jsonString, {String? overrideWalletId}) {
|
||||
final json = jsonDecode(jsonString);
|
||||
final derivationPathString = json["derivationPath"] as String?;
|
||||
|
||||
|
@ -175,7 +173,8 @@ enum AddressType {
|
|||
frostMS,
|
||||
p2tr,
|
||||
solana,
|
||||
cardanoShelley;
|
||||
cardanoShelley,
|
||||
bip352;
|
||||
|
||||
String get readableName {
|
||||
switch (this) {
|
||||
|
@ -213,6 +212,8 @@ enum AddressType {
|
|||
return "P2TR (taproot)";
|
||||
case AddressType.cardanoShelley:
|
||||
return "Cardano Shelley";
|
||||
case AddressType.bip352:
|
||||
return "Silent Payments";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -279,6 +279,7 @@ const _AddresstypeEnumValueMap = {
|
|||
'p2tr': 14,
|
||||
'solana': 15,
|
||||
'cardanoShelley': 16,
|
||||
'bip352': 17,
|
||||
};
|
||||
const _AddresstypeValueEnumMap = {
|
||||
0: AddressType.p2pkh,
|
||||
|
@ -298,6 +299,7 @@ const _AddresstypeValueEnumMap = {
|
|||
14: AddressType.p2tr,
|
||||
15: AddressType.solana,
|
||||
16: AddressType.cardanoShelley,
|
||||
17: AddressType.bip352,
|
||||
};
|
||||
|
||||
Id _addressGetId(Address object) {
|
||||
|
|
|
@ -19,7 +19,8 @@ enum DerivePathType {
|
|||
eCash44,
|
||||
solana,
|
||||
bip86,
|
||||
cardanoShelley;
|
||||
cardanoShelley,
|
||||
bip352;
|
||||
|
||||
AddressType getAddressType() {
|
||||
switch (this) {
|
||||
|
@ -45,6 +46,9 @@ enum DerivePathType {
|
|||
|
||||
case DerivePathType.cardanoShelley:
|
||||
return AddressType.cardanoShelley;
|
||||
|
||||
case DerivePathType.bip352:
|
||||
return AddressType.bip352;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -269,6 +269,7 @@ const _WalletInfomainAddressTypeEnumValueMap = {
|
|||
'p2tr': 14,
|
||||
'solana': 15,
|
||||
'cardanoShelley': 16,
|
||||
'bip352': 17,
|
||||
};
|
||||
const _WalletInfomainAddressTypeValueEnumMap = {
|
||||
0: AddressType.p2pkh,
|
||||
|
@ -288,6 +289,7 @@ const _WalletInfomainAddressTypeValueEnumMap = {
|
|||
14: AddressType.p2tr,
|
||||
15: AddressType.solana,
|
||||
16: AddressType.cardanoShelley,
|
||||
17: AddressType.bip352,
|
||||
};
|
||||
|
||||
Id _walletInfoGetId(WalletInfo object) {
|
||||
|
|
Loading…
Reference in a new issue