mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-16 17:27:37 +00:00
c7deeaea9b
* New versions Fix issues with Monero.com * Add sending for Solana tokens exchanges * Add default keyword for P2WPKH [skip ci] * chore: Switch solana commitment to confirmed to reduced blockhash expiration (#1313) * Modify test workflow to send arm64-v8a build only * Fix workflow build path * Remove unnecessary reverse of txId * Show case sensitive evm wallet address * Revert default Cake Theme add custom package id for test builds * Fix workflow script * Fix workflow * hash branch name * hash branch name * Update versions * Add user image to Nostr Add fetching address from text for tokens * Fix test app package id * fix: Solana message improvement (#1316) --------- Co-authored-by: Adegoke David <64401859+Blazebrain@users.noreply.github.com>
42 lines
1.4 KiB
Dart
42 lines
1.4 KiB
Dart
import 'package:bitcoin_base/bitcoin_base.dart';
|
|
import 'package:cw_core/receive_page_option.dart';
|
|
|
|
class BitcoinReceivePageOption implements ReceivePageOption {
|
|
static const p2wpkh = BitcoinReceivePageOption._('Segwit (P2WPKH) (Default)');
|
|
static const p2sh = BitcoinReceivePageOption._('Segwit-Compatible (P2SH)');
|
|
static const p2tr = BitcoinReceivePageOption._('Taproot (P2TR)');
|
|
static const p2wsh = BitcoinReceivePageOption._('Segwit (P2WSH)');
|
|
static const p2pkh = BitcoinReceivePageOption._('Legacy (P2PKH)');
|
|
|
|
const BitcoinReceivePageOption._(this.value);
|
|
|
|
final String value;
|
|
|
|
String toString() {
|
|
return value;
|
|
}
|
|
|
|
static const all = [
|
|
BitcoinReceivePageOption.p2wpkh,
|
|
BitcoinReceivePageOption.p2tr,
|
|
BitcoinReceivePageOption.p2wsh,
|
|
BitcoinReceivePageOption.p2sh,
|
|
BitcoinReceivePageOption.p2pkh
|
|
];
|
|
|
|
factory BitcoinReceivePageOption.fromType(BitcoinAddressType type) {
|
|
switch (type) {
|
|
case SegwitAddresType.p2tr:
|
|
return BitcoinReceivePageOption.p2tr;
|
|
case SegwitAddresType.p2wsh:
|
|
return BitcoinReceivePageOption.p2wsh;
|
|
case P2pkhAddressType.p2pkh:
|
|
return BitcoinReceivePageOption.p2pkh;
|
|
case P2shAddressType.p2wpkhInP2sh:
|
|
return BitcoinReceivePageOption.p2sh;
|
|
case SegwitAddresType.p2wpkh:
|
|
default:
|
|
return BitcoinReceivePageOption.p2wpkh;
|
|
}
|
|
}
|
|
}
|