mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 03:59:23 +00:00
review fixes
This commit is contained in:
parent
fb913eb65d
commit
86768c5fe9
3 changed files with 3 additions and 82 deletions
|
@ -20,35 +20,6 @@ class CWLightning extends Lightning {
|
|||
{required String name, WalletInfo? walletInfo}) =>
|
||||
BitcoinNewWalletCredentials(name: name, walletInfo: walletInfo);
|
||||
|
||||
@override
|
||||
List<String> getWordList() => wordlist;
|
||||
|
||||
@override
|
||||
Map<String, String> getWalletKeys(Object wallet) {
|
||||
final lightningWallet = wallet as ElectrumWallet;
|
||||
final keys = lightningWallet.keys;
|
||||
|
||||
return <String, String>{
|
||||
'wif': keys.wif,
|
||||
'privateKey': keys.privateKey,
|
||||
'publicKey': keys.publicKey
|
||||
};
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> generateNewAddress(Object wallet, String label) async {
|
||||
final lightningWallet = wallet as ElectrumWallet;
|
||||
await lightningWallet.walletAddresses.generateNewAddress(label: label);
|
||||
await wallet.save();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> updateAddress(Object wallet, String address, String label) async {
|
||||
final lightningWallet = wallet as ElectrumWallet;
|
||||
lightningWallet.walletAddresses.updateAddress(address, label);
|
||||
await wallet.save();
|
||||
}
|
||||
|
||||
@override
|
||||
Object createLightningTransactionCredentials(List<Output> outputs,
|
||||
{required TransactionPriority priority, int? feeRate}) =>
|
||||
|
@ -74,35 +45,6 @@ class CWLightning extends Lightning {
|
|||
priority: priority != null ? priority as BitcoinTransactionPriority : null,
|
||||
feeRate: feeRate);
|
||||
|
||||
@override
|
||||
List<String> getAddresses(Object wallet) {
|
||||
final bitcoinWallet = wallet as ElectrumWallet;
|
||||
return bitcoinWallet.walletAddresses.addressesByReceiveType
|
||||
.map((BitcoinAddressRecord addr) => addr.address)
|
||||
.toList();
|
||||
}
|
||||
|
||||
@override
|
||||
@computed
|
||||
List<ElectrumSubAddress> getSubAddresses(Object wallet) {
|
||||
final electrumWallet = wallet as ElectrumWallet;
|
||||
return electrumWallet.walletAddresses.addressesByReceiveType
|
||||
.map((BitcoinAddressRecord addr) => ElectrumSubAddress(
|
||||
id: addr.index,
|
||||
name: addr.name,
|
||||
address: electrumWallet.type == WalletType.bitcoinCash ? addr.cashAddr : addr.address,
|
||||
txCount: addr.txCount,
|
||||
balance: addr.balance,
|
||||
isChange: addr.isHidden))
|
||||
.toList();
|
||||
}
|
||||
|
||||
@override
|
||||
String getAddress(Object wallet) {
|
||||
final lightningWallet = wallet as ElectrumWallet;
|
||||
return lightningWallet.walletAddresses.address;
|
||||
}
|
||||
|
||||
@override
|
||||
String formatterLightningAmountToString({required int amount}) =>
|
||||
bitcoinAmountToString(amount: amount * 100000000);
|
||||
|
@ -112,18 +54,8 @@ class CWLightning extends Lightning {
|
|||
bitcoinAmountToDouble(amount: amount * 100000000);
|
||||
|
||||
@override
|
||||
int formatterStringDoubleToLightningAmount(String amount) => stringDoubleToBitcoinAmount(amount * 100000000);
|
||||
|
||||
@override
|
||||
List<BitcoinUnspent> getUnspents(Object wallet) {
|
||||
final lightningWallet = wallet as ElectrumWallet;
|
||||
return lightningWallet.unspentCoins;
|
||||
}
|
||||
|
||||
Future<void> updateUnspents(Object wallet) async {
|
||||
final lightningWallet = wallet as ElectrumWallet;
|
||||
await lightningWallet.updateUnspent();
|
||||
}
|
||||
int formatterStringDoubleToLightningAmount(String amount) =>
|
||||
stringDoubleToBitcoinAmount(amount * 100000000);
|
||||
|
||||
WalletService createLightningWalletService(
|
||||
Box<WalletInfo> walletInfoSource, Box<UnspentCoinsInfo> unspentCoinSource) {
|
||||
|
|
|
@ -320,6 +320,7 @@
|
|||
"last_30_days": "पिछले 30 दिन",
|
||||
"learn_more": "और अधिक जानें",
|
||||
"light_theme": "रोशनी",
|
||||
"loading_your_wallet": "अपना बटुआ लोड कर रहा है",
|
||||
"lightning_invoice_min": "इस चालान को प्राप्त करने पर न्यूनतम ${min} SATs के साथ 0.4% का सेटअप शुल्क लागू किया जाएगा।",
|
||||
"lightning_invoice_min_max": "न्यूनतम ${min} SATs के साथ 0.4% का सेटअप शुल्क ${max} SATs से अधिक प्राप्त करने के लिए लागू किया जाएगा",
|
||||
"lightning_invoice_warning": "भुगतान पूरा होने तक आपको ऐप को खुला रखना चाहिए या लेनदेन विफल हो जाएगा",
|
||||
|
|
|
@ -756,26 +756,14 @@ abstract class Lightning {
|
|||
WalletInfo? walletInfo});
|
||||
WalletCredentials createLightningNewWalletCredentials(
|
||||
{required String name, WalletInfo? walletInfo});
|
||||
List<String> getWordList();
|
||||
Map<String, String> getWalletKeys(Object wallet);
|
||||
Future<void> generateNewAddress(Object wallet, String label);
|
||||
Future<void> updateAddress(Object wallet, String address, String label);
|
||||
Object createLightningTransactionCredentials(List<Output> outputs,
|
||||
{required TransactionPriority priority, int? feeRate});
|
||||
Object createLightningTransactionCredentialsRaw(List<OutputInfo> outputs,
|
||||
{TransactionPriority? priority, required int feeRate});
|
||||
|
||||
List<String> getAddresses(Object wallet);
|
||||
String getAddress(Object wallet);
|
||||
|
||||
List<ElectrumSubAddress> getSubAddresses(Object wallet);
|
||||
|
||||
String formatterLightningAmountToString({required int amount});
|
||||
double formatterLightningAmountToDouble({required int amount});
|
||||
int formatterStringDoubleToLightningAmount(String amount);
|
||||
|
||||
List<Unspent> getUnspents(Object wallet);
|
||||
Future<void> updateUnspents(Object wallet);
|
||||
WalletService createLightningWalletService(
|
||||
Box<WalletInfo> walletInfoSource, Box<UnspentCoinsInfo> unspentCoinSource);
|
||||
List<LightningReceivePageOption> getLightningReceivePageOptions();
|
||||
|
|
Loading…
Reference in a new issue