mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
Cw-58: Show subaddress label on the transaction details page (#333)
* CW-58: Show subaddress label on the transaction details page * add translations * Fix interface
This commit is contained in:
parent
04db28e276
commit
135ede6a78
23 changed files with 69 additions and 13 deletions
|
@ -766,6 +766,11 @@ extern "C"
|
|||
return strdup(m_wallet->getTxKey(std::string(txId)).c_str());
|
||||
}
|
||||
|
||||
char *get_subaddress_label(uint32_t accountIndex, uint32_t addressIndex)
|
||||
{
|
||||
return strdup(get_current_wallet()->getSubaddressLabel(accountIndex, addressIndex).c_str());
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -120,3 +120,7 @@ typedef close_current_wallet = Void Function();
|
|||
typedef on_startup = Void Function();
|
||||
|
||||
typedef rescan_blockchain = Void Function();
|
||||
|
||||
typedef get_subaddress_label = Pointer<Utf8> Function(
|
||||
Int32 accountIndex,
|
||||
Int32 addressIndex);
|
|
@ -117,4 +117,8 @@ typedef CloseCurrentWallet = void Function();
|
|||
|
||||
typedef OnStartup = void Function();
|
||||
|
||||
typedef RescanBlockchainAsync = void Function();
|
||||
typedef RescanBlockchainAsync = void Function();
|
||||
|
||||
typedef GetSubaddressLabel = Pointer<Utf8> Function(
|
||||
int accountIndex,
|
||||
int addressIndex);
|
|
@ -112,6 +112,10 @@ final rescanBlockchainAsyncNative = moneroApi
|
|||
.lookup<NativeFunction<rescan_blockchain>>('rescan_blockchain')
|
||||
.asFunction<RescanBlockchainAsync>();
|
||||
|
||||
final getSubaddressLabelNative = moneroApi
|
||||
.lookup<NativeFunction<get_subaddress_label>>('get_subaddress_label')
|
||||
.asFunction<GetSubaddressLabel>();
|
||||
|
||||
int getSyncingHeight() => getSyncingHeightNative();
|
||||
|
||||
bool isNeededToRefresh() => isNeededToRefreshNative() != 0;
|
||||
|
@ -327,3 +331,7 @@ Future<bool> isConnected() => compute(_isConnected, 0);
|
|||
Future<int> getNodeHeight() => compute(_getNodeHeight, 0);
|
||||
|
||||
void rescanBlockchainAsync() => rescanBlockchainAsyncNative();
|
||||
|
||||
String getSubaddressLabel(int accountIndex, int addressIndex) {
|
||||
return convertUTF8ToString(pointer: getSubaddressLabelNative(accountIndex, addressIndex));
|
||||
}
|
|
@ -314,6 +314,10 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
|
|||
}
|
||||
}
|
||||
|
||||
String getSubaddressLabel(int accountIndex, int addressIndex) {
|
||||
return monero_wallet.getSubaddressLabel(accountIndex, addressIndex);
|
||||
}
|
||||
|
||||
List<MoneroTransactionInfo> _getAllTransactions(dynamic _) =>
|
||||
monero_transaction_history
|
||||
.getAllTransations()
|
||||
|
|
|
@ -294,4 +294,9 @@ class CWMonero extends Monero {
|
|||
final moneroWallet = wallet as MoneroWallet;
|
||||
return moneroWallet.getTransactionAddress(accountIndex, addressIndex);
|
||||
}
|
||||
|
||||
String getSubaddressLabel(Object wallet, int accountIndex, int addressIndex) {
|
||||
final moneroWallet = wallet as MoneroWallet;
|
||||
return moneroWallet.getSubaddressLabel(accountIndex, addressIndex);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ abstract class TransactionDetailsViewModelBase with Store {
|
|||
addressIndex != null) {
|
||||
try {
|
||||
final address = monero.getTransactionAddress(wallet, accountIndex, addressIndex);
|
||||
final label = monero.getSubaddressLabel(wallet, accountIndex, addressIndex);
|
||||
|
||||
if (address?.isNotEmpty ?? false) {
|
||||
isRecipientAddressShown = true;
|
||||
|
@ -68,6 +69,14 @@ abstract class TransactionDetailsViewModelBase with Store {
|
|||
title: S.current.transaction_details_recipient_address,
|
||||
value: address));
|
||||
}
|
||||
|
||||
if (label?.isNotEmpty ?? false) {
|
||||
_items.add(
|
||||
StandartListItem(
|
||||
title: S.current.address_label,
|
||||
value: label)
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
print(e.toString());
|
||||
}
|
||||
|
|
|
@ -268,6 +268,7 @@
|
|||
"new_subaddress_label_name" : "Bezeichnung",
|
||||
"new_subaddress_create" : "Erstellen",
|
||||
|
||||
"address_label" : "Address label",
|
||||
|
||||
"subaddress_title" : "Unteradressenliste",
|
||||
|
||||
|
|
|
@ -268,6 +268,7 @@
|
|||
"new_subaddress_label_name" : "Label name",
|
||||
"new_subaddress_create" : "Create",
|
||||
|
||||
"address_label" : "Address label",
|
||||
|
||||
"subaddress_title" : "Subaddress list",
|
||||
|
||||
|
|
|
@ -268,6 +268,7 @@
|
|||
"new_subaddress_label_name" : "Nombre de etiqueta",
|
||||
"new_subaddress_create" : "Crear",
|
||||
|
||||
"address_label" : "Address label",
|
||||
|
||||
"subaddress_title" : "Lista de subdirecciones",
|
||||
|
||||
|
@ -528,4 +529,4 @@
|
|||
"search": "Búsqueda",
|
||||
"new_template" : "Nueva plantilla",
|
||||
"electrum_address_disclaimer": "Generamos nuevas direcciones cada vez que usa una, pero las direcciones anteriores siguen funcionando"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -266,6 +266,7 @@
|
|||
"new_subaddress_label_name" : "Nom",
|
||||
"new_subaddress_create" : "Créer",
|
||||
|
||||
"address_label" : "Address label",
|
||||
|
||||
"subaddress_title" : "Liste des sous-adresses",
|
||||
|
||||
|
|
|
@ -268,6 +268,7 @@
|
|||
"new_subaddress_label_name" : "लेबल का नाम",
|
||||
"new_subaddress_create" : "सर्जन करना",
|
||||
|
||||
"address_label" : "Address label",
|
||||
|
||||
"subaddress_title" : "उपखंड सूची",
|
||||
|
||||
|
@ -528,4 +529,4 @@
|
|||
"search": "खोज",
|
||||
"new_template" : "नया टेम्पलेट",
|
||||
"electrum_address_disclaimer": "हर बार जब आप एक का उपयोग करते हैं तो हम नए पते उत्पन्न करते हैं, लेकिन पिछले पते काम करना जारी रखते हैं"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -268,6 +268,7 @@
|
|||
"new_subaddress_label_name" : "Oznaka",
|
||||
"new_subaddress_create" : "Izradi",
|
||||
|
||||
"address_label" : "Address label",
|
||||
|
||||
"subaddress_title" : "Lista podadresa",
|
||||
|
||||
|
@ -528,4 +529,4 @@
|
|||
"search": "Traži",
|
||||
"new_template" : "novi predložak",
|
||||
"electrum_address_disclaimer": "Minden egyes alkalommal új címeket generálunk, de a korábbi címek továbbra is működnek"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -268,6 +268,7 @@
|
|||
"new_subaddress_label_name" : "Nome etichetta",
|
||||
"new_subaddress_create" : "Crea",
|
||||
|
||||
"address_label" : "Address label",
|
||||
|
||||
"subaddress_title" : "Lista sottoindirizzi",
|
||||
|
||||
|
@ -528,4 +529,4 @@
|
|||
"search": "Ricerca",
|
||||
"new_template" : "Nuovo modello",
|
||||
"electrum_address_disclaimer": "Generiamo nuovi indirizzi ogni volta che ne utilizzi uno, ma gli indirizzi precedenti continuano a funzionare"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -268,6 +268,7 @@
|
|||
"new_subaddress_label_name" : "ラベル名",
|
||||
"new_subaddress_create" : "作成する",
|
||||
|
||||
"address_label" : "Address label",
|
||||
|
||||
"subaddress_title" : "サブアドレス一覧",
|
||||
|
||||
|
@ -528,4 +529,4 @@
|
|||
"search": "検索",
|
||||
"new_template" : "新しいテンプレート",
|
||||
"electrum_address_disclaimer": "使用するたびに新しいアドレスが生成されますが、以前のアドレスは引き続き機能します"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -268,6 +268,7 @@
|
|||
"new_subaddress_label_name" : "라벨 이름",
|
||||
"new_subaddress_create" : "몹시 떠들어 대다",
|
||||
|
||||
"address_label" : "Address label",
|
||||
|
||||
"subaddress_title" : "하위 주소 목록",
|
||||
|
||||
|
@ -528,4 +529,4 @@
|
|||
"search": "찾다",
|
||||
"new_template" : "새 템플릿",
|
||||
"electrum_address_disclaimer": "사용할 때마다 새 주소가 생성되지만 이전 주소는 계속 작동합니다."
|
||||
}
|
||||
}
|
||||
|
|
|
@ -268,6 +268,7 @@
|
|||
"new_subaddress_label_name" : "Label naam",
|
||||
"new_subaddress_create" : "Creëren",
|
||||
|
||||
"address_label" : "Address label",
|
||||
|
||||
"subaddress_title" : "Subadreslijst",
|
||||
|
||||
|
@ -528,4 +529,4 @@
|
|||
"search": "Zoekopdracht",
|
||||
"new_template" : "Nieuwe sjabloon",
|
||||
"electrum_address_disclaimer": "We generate new addresses each time you use one, but previous addresses continue to work"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -271,6 +271,7 @@
|
|||
"new_subaddress_label_name" : "Nazwa etykiety",
|
||||
"new_subaddress_create" : "Stwórz",
|
||||
|
||||
"address_label" : "Address label",
|
||||
|
||||
"subaddress_title" : "Lista podadresów",
|
||||
|
||||
|
@ -531,4 +532,4 @@
|
|||
"search": "Szukaj",
|
||||
"new_template" : "Nowy szablon",
|
||||
"electrum_address_disclaimer": "Za każdym razem, gdy korzystasz z jednego z nich, generujemy nowe adresy, ale poprzednie adresy nadal działają"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -268,6 +268,7 @@
|
|||
"new_subaddress_label_name" : "Nome",
|
||||
"new_subaddress_create" : "Criar",
|
||||
|
||||
"address_label" : "Address label",
|
||||
|
||||
"subaddress_title" : "Sub-endereços",
|
||||
|
||||
|
@ -528,4 +529,4 @@
|
|||
"search": "Procurar",
|
||||
"new_template" : "Novo modelo",
|
||||
"electrum_address_disclaimer": "Geramos novos endereços cada vez que você usa um, mas os endereços anteriores continuam funcionando"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -268,6 +268,7 @@
|
|||
"new_subaddress_label_name" : "Имя",
|
||||
"new_subaddress_create" : "Создать",
|
||||
|
||||
"address_label" : "Address label",
|
||||
|
||||
"subaddress_title" : "Список субадресов",
|
||||
|
||||
|
@ -528,4 +529,4 @@
|
|||
"search": "Поиск",
|
||||
"new_template" : "Новый шаблон",
|
||||
"electrum_address_disclaimer": "Мы генерируем новые адреса каждый раз, когда вы их используете, но предыдущие адреса продолжают работать."
|
||||
}
|
||||
}
|
||||
|
|
|
@ -267,6 +267,7 @@
|
|||
"new_subaddress_label_name" : "Ім'я",
|
||||
"new_subaddress_create" : "Створити",
|
||||
|
||||
"address_label" : "Address label",
|
||||
|
||||
"subaddress_title" : "Список Субадрес",
|
||||
|
||||
|
@ -527,4 +528,4 @@
|
|||
"search": "Пошук",
|
||||
"new_template" : "Новий шаблон",
|
||||
"electrum_address_disclaimer": "Ми створюємо нові адреси щоразу, коли ви використовуєте їх, але попередні адреси продовжують працювати"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -268,6 +268,7 @@
|
|||
"new_subaddress_label_name" : "标签名称",
|
||||
"new_subaddress_create" : "创建",
|
||||
|
||||
"address_label" : "Address label",
|
||||
|
||||
"subaddress_title" : "子地址列表",
|
||||
|
||||
|
@ -526,4 +527,4 @@
|
|||
"search": "搜索",
|
||||
"new_template" : "新模板",
|
||||
"electrum_address_disclaimer": "每次您使用一个地址时,我们都会生成新地址,但之前的地址仍然有效"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -209,6 +209,8 @@ abstract class Monero {
|
|||
|
||||
String getTransactionAddress(Object wallet, int accountIndex, int addressIndex);
|
||||
|
||||
String getSubaddressLabel(Object wallet, int accountIndex, int addressIndex);
|
||||
|
||||
int getHeigthByDate({DateTime date});
|
||||
TransactionPriority getDefaultTransactionPriority();
|
||||
TransactionPriority deserializeMoneroTransactionPriority({int raw});
|
||||
|
|
Loading…
Reference in a new issue