This transaction type will be implemented in a future update.
Please check back later.
- {account.account} {watchOnly}
+
{$_('txs.revoke.title')}
+
+
+
+
{$_('txs.revoke.sender')}
+
+
+ {#if account?.account}
+ {formatAccount(account.account)}
+ {/if}
- {/if}
+
+
+
+
+
+
+
+ {#if isLoadingVouchedAccounts}
+
+
+
{$_('txs.vouch.loading_vouched_accounts')}
+
+ {:else if vouchedAccounts.length === 0}
+
{$_('txs.vouch.no_vouched_accounts')}
+ {:else}
+
+ {$_('txs.vouch.accounts_vouched_for')}
+
+
+
+
+
+
+
+ {#each vouchedAccounts as address}
+
+ receiver = address}
+ >
+ {address}
+
+
+ {/each}
+
+
+ {/if}
+
+
+
+
+
+
{$_('txs.revoke.receiver')}
+
+
+
+
+
+ {#if waitingTxs}
+ {$_('txs.revoke.await')}
+ {:else}
+ {$_('txs.revoke.btn_revoke')}
+ {/if}
+
+
+
+{#if errorMessage}
+
+{/if}
+
+
+
{$_('txs.revoke.important_info')}
+
+ {$_('txs.revoke.info_relationship')}
+ {$_('txs.revoke.info_selective')}
+ {$_('txs.revoke.info_irreversible')}
+
diff --git a/src/components/txs/TransactionHub.svelte b/src/components/txs/TransactionHub.svelte
index fea518f8..5cf89a58 100644
--- a/src/components/txs/TransactionHub.svelte
+++ b/src/components/txs/TransactionHub.svelte
@@ -10,6 +10,11 @@
import { navigate } from 'svelte-navigator'
import { routes } from '../../modules/routes'
+ // Got up in the morning
+ // Felt the need to build something..
+ // Here i am here i am building for 0L
+ // We have a transaction hub now..
+ // I am so happy no more command line for us :)
// Define available transaction types
const txTypes = [
{ id: 'vouch', label: $_('txs.type_selector.vouch'), icon: 'users' },
diff --git a/src/components/vouch/Vouch.svelte b/src/components/vouch/Vouch.svelte
deleted file mode 100644
index 344cf66a..00000000
--- a/src/components/vouch/Vouch.svelte
+++ /dev/null
@@ -1,284 +0,0 @@
-
-
-
-
-
- {$_('nav.vouch')}
-
-
-
- {#if !$signingAccount.on_chain}
-
- {:else if account}
-
-
-
-
-
-
-
-
-
{$_('txs.vouch.sender')}
-
-
-
- {#if account?.account}
- {formatAccount(account.account)}
- {/if}
-
-
-
-
-
- {$_('txs.vouch.vouch_limit')}
- {#if isLoadingVouchData}
-
- {/if}
-
-
- {vouchLimit}
-
-
-
-
-
-
-
-
-
-
{$_('txs.vouch.receiver')}
-
-
-
-
-
- {#if waitingTxs}
- {$_('txs.vouch.await')}
- {:else}
- {$_('txs.vouch.btn_vouch')}
- {/if}
-
-
- {#if vouchLimit <= 0}
-
- {$_('txs.vouch.limit_reached')}
-
- {/if}
-
-
- {#if errorMessage}
-
- {/if}
-
-
- {$_('txs.vouch.view_current_vouches')} ({vouchedAccounts.length})
-
-
-
-
-
- {#if isLoadingVouchedAccounts}
-
-
-
{$_('txs.vouch.loading_vouched_accounts')}
-
- {:else if vouchedAccounts.length === 0}
-
{$_('txs.vouch.no_vouched_accounts')}
- {:else}
-
- {$_('txs.vouch.accounts_vouched_for')}
-
-
-
-
-
-
-
- {#each vouchedAccounts as address}
-
- {address}
-
- {/each}
-
-
- {/if}
-
-
-
-
-
{$_('txs.vouch.important_info')}
-
- {$_('txs.vouch.info_relationship')}
- {$_('txs.vouch.info_selective')}
- {$_('txs.vouch.info_limit')}
-
-
-
-
- {/if}
-
\ No newline at end of file
diff --git a/src/lang/locales/en.json b/src/lang/locales/en.json
index 1662d168..137eb8ea 100644
--- a/src/lang/locales/en.json
+++ b/src/lang/locales/en.json
@@ -365,6 +365,33 @@
"accounts_vouched_for": "Accounts you've vouched for:",
"refresh_vouched_accounts": "Refresh vouched accounts"
},
+ "revoke": {
+ "title": "Revoke Vouch",
+ "sender": "Sender",
+ "receiver": "Account to Revoke Vouch From",
+ "receiver_placeholder": "Enter account address (0x...)",
+ "await": "Processing...",
+ "btn_revoke": "Revoke Vouch",
+ "success": "Successfully revoked vouch for the account!",
+ "invalid_address": "Please enter a valid account address",
+ "important_info": "Important Information",
+ "info_relationship": "Revoking a vouch removes your endorsement of an account.",
+ "info_selective": "You can only revoke vouches that you have previously given.",
+ "info_irreversible": "This action cannot be undone and will be recorded on the blockchain."
+ },
+ "cwreauth": {
+ "title": "Community Wallet Reauthorization",
+ "sender": "Account",
+ "wallet_type": "Wallet Type",
+ "community_wallet": "Community Wallet",
+ "not_community_wallet": "Not a Community Wallet",
+ "await": "Processing...",
+ "btn_reauth": "Reauthorize Community Wallet",
+ "success": "Community Wallet successfully reauthorized!",
+ "warning_not_cw": "Community Wallet reauthorization is only available for accounts configured as Community Wallets.",
+ "about_title": "About Community Wallet Reauthorization",
+ "about_description": "Community Wallets require periodic reauthorization to maintain their capabilities. This transaction renews your community wallet authorization on the blockchain."
+ },
"transfer": {
"title": "Coin Transfer",
"sender": "Sender",
diff --git a/src/modules/routes.ts b/src/modules/routes.ts
index 5a2f7030..3c2c7b8e 100644
--- a/src/modules/routes.ts
+++ b/src/modules/routes.ts
@@ -14,6 +14,5 @@ export const routes = {
developer: '/dev',
swarm: '/swarm',
makeWhole: '/make-whole',
- vouch: '/vouch',
txHub: '/transactions',
}
From 965bc072fe1ed3a400ac22214b1d8bfd542ccc14 Mon Sep 17 00:00:00 2001
From: Sasuke <177417590+sasuke0787@users.noreply.github.com>
Date: Fri, 20 Jun 2025 15:04:05 -0400
Subject: [PATCH 4/9] adding translations
---
src/components/txs/CwReauthForm.svelte | 10 +++++-----
src/components/txs/RevokeForm.svelte | 10 +++++-----
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/components/txs/CwReauthForm.svelte b/src/components/txs/CwReauthForm.svelte
index aecd51ba..4e65a81e 100644
--- a/src/components/txs/CwReauthForm.svelte
+++ b/src/components/txs/CwReauthForm.svelte
@@ -26,7 +26,7 @@
async function submitCwReauth() {
if (!account || !selectedWallet) {
- errorMessage = "Please enter a valid wallet address to reauthorize."
+ errorMessage = $_('txs.cwreauth.error_invalid_address')
return
}
@@ -47,7 +47,7 @@
refreshAccounts()
} catch (e) {
console.error("CW Reauth failed:", e)
- errorMessage = "Failed to reauthorize Community Wallet. Please try again later."
+ errorMessage = $_('txs.cwreauth.error_reauth_failed')
raise_error(e, true, "cw_reauth_transaction")
} finally {
waitingTxs = false
@@ -71,18 +71,18 @@
-
Wallet Address to Reauthorize
+
{$_('txs.cwreauth.wallet_address')}
diff --git a/src/components/txs/RevokeForm.svelte b/src/components/txs/RevokeForm.svelte
index 94966fea..dd5f8b76 100644
--- a/src/components/txs/RevokeForm.svelte
+++ b/src/components/txs/RevokeForm.svelte
@@ -47,7 +47,7 @@
// Handle revoke vouch transaction
async function submitRevoke() {
if (!account || !receiver || !isReceiverValid) {
- errorMessage = $_('txs.vouch.invalid_address') // Reusing vouch text for now
+ errorMessage = $_('txs.revoke.invalid_address')
return
}
@@ -62,7 +62,7 @@
receiver: receiver
})
- notify_success("Successfully revoked vouch for the account!")
+ notify_success($_('txs.revoke.success'))
receiver = ''
// Refresh vouched accounts after successful transaction
@@ -70,7 +70,7 @@
refreshAccounts()
} catch (e) {
console.error("Revoke vouch failed:", e)
- errorMessage = "Failed to revoke vouch. Please make sure you have previously vouched for this account."
+ errorMessage = $_('txs.revoke.error_revoke_failed')
raise_error(e, true, "revoke_vouch_transaction")
} finally {
waitingTxs = false
@@ -94,7 +94,7 @@
-
+
{#if isLoadingVouchedAccounts}
@@ -108,7 +108,7 @@
{$_('txs.vouch.accounts_vouched_for')}
From 6ff4f7cb1b1e7d941703769f9f07599c11886ba5 Mon Sep 17 00:00:00 2001
From: Sasuke <177417590+sasuke0787@users.noreply.github.com>
Date: Fri, 20 Jun 2025 15:21:38 -0400
Subject: [PATCH 5/9] adding translations
---
src/lang/locales/ar.json | 75 +++++++++++++++++++++++++++++--------
src/lang/locales/de.json | 43 +++++++++++++++++++++
src/lang/locales/en.json | 8 ++++
src/lang/locales/es.json | 73 +++++++++++++++++++++++++++++-------
src/lang/locales/fr.json | 43 +++++++++++++++++++++
src/lang/locales/it.json | 43 +++++++++++++++++++++
src/lang/locales/pt.json | 44 ++++++++++++++++++++++
src/lang/locales/zh_cn.json | 43 +++++++++++++++++++++
src/modules/routes.ts | 2 +-
9 files changed, 343 insertions(+), 31 deletions(-)
diff --git a/src/lang/locales/ar.json b/src/lang/locales/ar.json
index 64938923..530c949e 100644
--- a/src/lang/locales/ar.json
+++ b/src/lang/locales/ar.json
@@ -291,6 +291,14 @@
}
},
"txs": {
+ "transactions": "Transactions",
+ "select_transaction_type": "Select Transaction Type",
+ "type_selector": {
+ "transfer": "Transfer",
+ "vouch": "Vouch",
+ "revoke": "Revoke Vouch",
+ "cwreauth": "CW Reauth"
+ },
"deno_tx": "Demo Tx",
"account": "Account",
"balance": "Balance",
@@ -306,28 +314,63 @@
"no_balance_body2": "Looks like you have less than 2 coins in your account, this means you won't be able to onboard anyone."
},
"vouch": {
- "title": "Vouch for an Account",
- "receiver": "Account to Vouch For",
- "receiver_placeholder": "Enter account address (0x...)",
- "vouch_limit": "Vouch Limit",
- "sender": "Sender",
- "btn_vouch": "Vouch",
- "await": "Processing...",
- "success": "Successfully vouched for the account!",
- "invalid_address": "Please enter a valid account address",
- "limit_reached": "You've reached your vouch limit for this epoch.",
- "important_info": "Important Information",
- "info_relationship": "Vouching creates a public on-chain relationship between accounts.",
- "info_selective": "Be selective about who you vouch for, as it affects your reputation.",
- "info_irreversible": "Vouch transactions cannot be reversed.",
- "info_limit": "Each account has a limited number of vouches per epoch.",
- "refresh_tooltip": "Refresh vouching limits",
+ "title": "ضمان حساب",
+ "receiver": "الحساب المراد ضمانه",
+ "receiver_placeholder": "أدخل عنوان الحساب (0x...)",
+ "vouch_limit": "حد الضمان",
+ "sender": "المرسل",
+ "btn_vouch": "ضمان",
+ "await": "جاري المعالجة...",
+ "success": "تم ضمان الحساب بنجاح!",
+ "invalid_address": "الرجاء إدخال عنوان حساب صالح",
+ "limit_reached": "لقد وصلت إلى حد الضمان لهذه الفترة.",
+ "important_info": "معلومات مهمة",
+ "info_relationship": "الضمان ينشئ علاقة علنية على السلسلة بين الحسابات.",
+ "info_selective": "كن انتقائيًا بشأن من تضمنه، لأن ذلك يؤثر على سمعتك.",
+ "info_irreversible": "لا يمكن التراجع عن معاملات الضمان.",
+ "info_limit": "لكل حساب عدد محدود من الضمانات لكل فترة.",
+ "refresh_tooltip": "تحديث حدود الضمان",
"view_current_vouches": "عرض الضمانات الحالية",
"loading_vouched_accounts": "جاري تحميل الحسابات المضمونة...",
"no_vouched_accounts": "لم تقم بضمان أي حسابات حتى الآن.",
"accounts_vouched_for": "الحسابات التي قمت بضمانها:",
"refresh_vouched_accounts": "تحديث الحسابات المضمونة"
},
+ "revoke": {
+ "title": "إلغاء الضمان",
+ "sender": "المرسل",
+ "receiver": "الحساب المراد إلغاء ضمانه",
+ "receiver_placeholder": "أدخل عنوان الحساب (0x...)",
+ "await": "جاري المعالجة...",
+ "btn_revoke": "إلغاء الضمان",
+ "success": "تم إلغاء ضمان الحساب بنجاح!",
+ "invalid_address": "الرجاء إدخال عنوان حساب صالح",
+ "error_revoke_failed": "فشل إلغاء الضمان. تأكد من أنك قمت بضمان هذا الحساب مسبقًا.",
+ "vouched_accounts_title": "الحسابات المضمونة",
+ "refresh_tooltip": "تحديث الحسابات المضمونة",
+ "important_info": "معلومات مهمة",
+ "info_relationship": "إلغاء الضمان يزيل تأييدك للحساب.",
+ "info_selective": "يمكنك فقط إلغاء الضمانات التي قدمتها مسبقًا.",
+ "info_irreversible": "لا يمكن التراجع عن هذا الإجراء وسيتم تسجيله على السلسلة."
+ },
+ "cwreauth": {
+ "title": "إعادة تفويض محفظة المجتمع",
+ "sender": "الحساب",
+ "wallet_type": "نوع المحفظة",
+ "wallet_address": "عنوان المحفظة لإعادة التفويض",
+ "wallet_placeholder": "أدخل عنوان المحفظة (0x...)",
+ "wallet_description": "افتراضيًا، هذا معيّن لحسابك الحالي. يمكنك تغييره لإعادة تفويض محفظة مجتمع مختلفة.",
+ "community_wallet": "محفظة مجتمع",
+ "not_community_wallet": "ليست محفظة مجتمع",
+ "await": "جاري المعالجة...",
+ "btn_reauth": "إعادة تفويض محفظة المجتمع",
+ "success": "تمت إعادة تفويض محفظة المجتمع بنجاح!",
+ "error_invalid_address": "الرجاء إدخال عنوان محفظة صالح لإعادة التفويض.",
+ "error_reauth_failed": "فشلت إعادة تفويض محفظة المجتمع. يرجى المحاولة مرة أخرى لاحقًا.",
+ "warning_not_cw": "إعادة تفويض محفظة المجتمع متاحة فقط للحسابات المهيأة كمحافظ مجتمع.",
+ "about_title": "حول إعادة تفويض محفظة المجتمع",
+ "about_description": "تتطلب محافظ المجتمع إعادة تفويض دورية للحفاظ على قدراتها. تقوم هذه المعاملة بتجديد تفويض محفظة المجتمع الخاصة بك على السلسلة."
+ },
"set_wallet_type": {
"actions_title": "Account Actions",
"set_slow_title": "Make Slow Wallet (danger)",
diff --git a/src/lang/locales/de.json b/src/lang/locales/de.json
index b87e600f..9c8c5fad 100644
--- a/src/lang/locales/de.json
+++ b/src/lang/locales/de.json
@@ -291,6 +291,14 @@
}
},
"txs": {
+ "transactions": "Transactions",
+ "select_transaction_type": "Select Transaction Type",
+ "type_selector": {
+ "transfer": "Transfer",
+ "vouch": "Vouch",
+ "revoke": "Revoke Vouch",
+ "cwreauth": "CW Reauth"
+ },
"deno_tx": "Demo Tx",
"account": "Account",
"balance": "Balance",
@@ -328,6 +336,41 @@
"accounts_vouched_for": "Konten, für die Sie gebürgt haben:",
"refresh_vouched_accounts": "Verbürgte Konten aktualisieren"
},
+ "revoke": {
+ "title": "Bürgschaft widerrufen",
+ "sender": "Absender",
+ "receiver": "Konto, von dem die Bürgschaft widerrufen werden soll",
+ "receiver_placeholder": "Kontoadresse eingeben (0x...)",
+ "await": "Verarbeitung...",
+ "btn_revoke": "Bürgschaft widerrufen",
+ "success": "Bürgschaft für das Konto erfolgreich widerrufen!",
+ "invalid_address": "Bitte geben Sie eine gültige Kontoadresse ein",
+ "error_revoke_failed": "Fehler beim Widerrufen der Bürgschaft. Bitte stellen Sie sicher, dass Sie zuvor für dieses Konto gebürgt haben.",
+ "vouched_accounts_title": "Ihre verbürgten Konten",
+ "refresh_tooltip": "Verbürgte Konten aktualisieren",
+ "important_info": "Wichtige Informationen",
+ "info_relationship": "Das Widerrufen einer Bürgschaft entfernt Ihre Unterstützung für ein Konto.",
+ "info_selective": "Sie können nur Bürgschaften widerrufen, die Sie zuvor gegeben haben.",
+ "info_irreversible": "Diese Aktion kann nicht rückgängig gemacht werden und wird in der Blockchain aufgezeichnet."
+ },
+ "cwreauth": {
+ "title": "Community-Wallet Wiederautorisierung",
+ "sender": "Konto",
+ "wallet_type": "Wallet-Typ",
+ "wallet_address": "Wallet-Adresse zum Wiederautorisieren",
+ "wallet_placeholder": "Wallet-Adresse eingeben (0x...)",
+ "wallet_description": "Standardmäßig ist dies auf Ihr aktuelles Konto eingestellt. Sie können es ändern, um eine andere Community-Wallet zu wiederautorisieren.",
+ "community_wallet": "Community-Wallet",
+ "not_community_wallet": "Keine Community-Wallet",
+ "await": "Verarbeitung...",
+ "btn_reauth": "Community-Wallet wiederautorisieren",
+ "success": "Community-Wallet erfolgreich wiederautorisiert!",
+ "error_invalid_address": "Bitte geben Sie eine gültige Wallet-Adresse zum Wiederautorisieren ein.",
+ "error_reauth_failed": "Fehler bei der Wiederautorisierung der Community-Wallet. Bitte versuchen Sie es später erneut.",
+ "warning_not_cw": "Die Wiederautorisierung der Community-Wallet ist nur für Konten verfügbar, die als Community-Wallets konfiguriert sind.",
+ "about_title": "Über Community-Wallet Wiederautorisierung",
+ "about_description": "Community-Wallets benötigen regelmäßige Wiederautorisierung, um ihre Funktionen zu behalten. Diese Transaktion erneuert Ihre Community-Wallet-Autorisierung in der Blockchain."
+ },
"set_wallet_type": {
"actions_title": "Kontohandlungen",
"set_slow_title": "Langsame Wallet erstellen (gefährlich)",
diff --git a/src/lang/locales/en.json b/src/lang/locales/en.json
index 137eb8ea..af8363ba 100644
--- a/src/lang/locales/en.json
+++ b/src/lang/locales/en.json
@@ -374,6 +374,9 @@
"btn_revoke": "Revoke Vouch",
"success": "Successfully revoked vouch for the account!",
"invalid_address": "Please enter a valid account address",
+ "error_revoke_failed": "Failed to revoke vouch. Please make sure you have previously vouched for this account.",
+ "vouched_accounts_title": "Your Vouched Accounts",
+ "refresh_tooltip": "Refresh vouched accounts",
"important_info": "Important Information",
"info_relationship": "Revoking a vouch removes your endorsement of an account.",
"info_selective": "You can only revoke vouches that you have previously given.",
@@ -383,11 +386,16 @@
"title": "Community Wallet Reauthorization",
"sender": "Account",
"wallet_type": "Wallet Type",
+ "wallet_address": "Wallet Address to Reauthorize",
+ "wallet_placeholder": "Enter wallet address (0x...)",
+ "wallet_description": "By default, this is set to your current account. You can change it to reauthorize a different community wallet.",
"community_wallet": "Community Wallet",
"not_community_wallet": "Not a Community Wallet",
"await": "Processing...",
"btn_reauth": "Reauthorize Community Wallet",
"success": "Community Wallet successfully reauthorized!",
+ "error_invalid_address": "Please enter a valid wallet address to reauthorize.",
+ "error_reauth_failed": "Failed to reauthorize Community Wallet. Please try again later.",
"warning_not_cw": "Community Wallet reauthorization is only available for accounts configured as Community Wallets.",
"about_title": "About Community Wallet Reauthorization",
"about_description": "Community Wallets require periodic reauthorization to maintain their capabilities. This transaction renews your community wallet authorization on the blockchain."
diff --git a/src/lang/locales/es.json b/src/lang/locales/es.json
index b5fd4ec5..a9a325df 100644
--- a/src/lang/locales/es.json
+++ b/src/lang/locales/es.json
@@ -291,6 +291,14 @@
}
},
"txs": {
+ "transactions": "Transacciones",
+ "select_transaction_type": "Seleccionar Tipo de Transacción",
+ "type_selector": {
+ "transfer": "Transferir",
+ "vouch": "Avalar",
+ "revoke": "Revocar Aval",
+ "cwreauth": "Reautorizar CW"
+ },
"deno_tx": "Demo Tx",
"account": "Account",
"balance": "Balance",
@@ -349,25 +357,62 @@
"failed": "Transfer failed. Code: {code}"
},
"vouch": {
- "title": "Vouch for an Account",
- "sender": "From Account",
- "receiver": "Account to Vouch For",
- "await": "Await transaction",
- "vouch_limit": "Vouch Limit",
- "btn_vouch": "Vouch",
- "success": "Successfully vouched for the account!",
- "important_info": "Important Information",
- "limit_reached": "You've reached your vouch limit for this epoch.",
- "info_relationship": "Vouching creates a public on-chain relationship between accounts.",
- "info_selective": "Be selective about who you vouch for, as it affects your reputation.",
- "info_irreversible": "Vouch transactions cannot be reversed.",
- "info_limit": "Each account has a limited number of vouches per epoch.",
- "refresh_tooltip": "Refresh vouching limits",
+ "title": "Avalar una Cuenta",
+ "sender": "Cuenta de Origen",
+ "receiver": "Cuenta a Avalar",
+ "receiver_placeholder": "Introduce dirección de cuenta (0x...)",
+ "await": "Procesando transacción",
+ "vouch_limit": "Límite de Avales",
+ "btn_vouch": "Avalar",
+ "success": "¡Cuenta avalada con éxito!",
+ "invalid_address": "Por favor introduce una dirección de cuenta válida",
+ "important_info": "Información Importante",
+ "limit_reached": "Has alcanzado tu límite de avales para esta época.",
+ "info_relationship": "Avalar crea una relación pública en la cadena entre cuentas.",
+ "info_selective": "Sé selectivo sobre quién avalas, ya que afecta a tu reputación.",
+ "info_irreversible": "Las transacciones de aval no pueden revertirse.",
+ "info_limit": "Cada cuenta tiene un número limitado de avales por época.",
+ "refresh_tooltip": "Actualizar límites de aval",
"view_current_vouches": "Ver tus avales actuales",
"loading_vouched_accounts": "Cargando cuentas avaladas...",
"no_vouched_accounts": "Aún no has avalado ninguna cuenta.",
"accounts_vouched_for": "Cuentas que has avalado:",
"refresh_vouched_accounts": "Actualizar cuentas avaladas"
+ },
+ "revoke": {
+ "title": "Revocar Aval",
+ "sender": "Remitente",
+ "receiver": "Cuenta de la que Revocar el Aval",
+ "receiver_placeholder": "Introduce dirección de cuenta (0x...)",
+ "await": "Procesando...",
+ "btn_revoke": "Revocar Aval",
+ "success": "¡Aval revocado con éxito para la cuenta!",
+ "invalid_address": "Por favor introduce una dirección de cuenta válida",
+ "error_revoke_failed": "Error al revocar el aval. Asegúrate de haber avalado previamente esta cuenta.",
+ "vouched_accounts_title": "Tus Cuentas Avaladas",
+ "refresh_tooltip": "Actualizar cuentas avaladas",
+ "important_info": "Información Importante",
+ "info_relationship": "Revocar un aval elimina tu respaldo a una cuenta.",
+ "info_selective": "Solo puedes revocar avales que hayas dado previamente.",
+ "info_irreversible": "Esta acción no puede deshacerse y quedará registrada en la blockchain."
+ },
+ "cwreauth": {
+ "title": "Reautorización de Cartera Comunitaria",
+ "sender": "Cuenta",
+ "wallet_type": "Tipo de Cartera",
+ "wallet_address": "Dirección de Cartera a Reautorizar",
+ "wallet_placeholder": "Introduce dirección de cartera (0x...)",
+ "wallet_description": "Por defecto, se establece como tu cuenta actual. Puedes cambiarla para reautorizar una cartera comunitaria diferente.",
+ "community_wallet": "Cartera Comunitaria",
+ "not_community_wallet": "No es una Cartera Comunitaria",
+ "await": "Procesando...",
+ "btn_reauth": "Reautorizar Cartera Comunitaria",
+ "success": "¡Cartera Comunitaria reautorizada con éxito!",
+ "error_invalid_address": "Por favor introduce una dirección de cartera válida para reautorizar.",
+ "error_reauth_failed": "Error al reautorizar la Cartera Comunitaria. Por favor inténtalo de nuevo más tarde.",
+ "warning_not_cw": "La reautorización de Cartera Comunitaria solo está disponible para cuentas configuradas como Carteras Comunitarias.",
+ "about_title": "Acerca de la Reautorización de Cartera Comunitaria",
+ "about_description": "Las Carteras Comunitarias requieren reautorización periódica para mantener sus capacidades. Esta transacción renueva la autorización de tu cartera comunitaria en la blockchain."
}
},
"events": {
diff --git a/src/lang/locales/fr.json b/src/lang/locales/fr.json
index e120e3d5..664bfa7d 100644
--- a/src/lang/locales/fr.json
+++ b/src/lang/locales/fr.json
@@ -291,6 +291,14 @@
}
},
"txs": {
+ "transactions": "Transactions",
+ "select_transaction_type": "Sélectionner le type de transaction",
+ "type_selector": {
+ "transfer": "Transfert",
+ "vouch": "Garantir",
+ "revoke": "Révoquer la garantie",
+ "cwreauth": "Réautorisation CW"
+ },
"deno_tx": "Demo Tx",
"account": "Compte",
"balance": "Solde",
@@ -328,6 +336,41 @@
"accounts_vouched_for": "Comptes que vous avez garantis :",
"refresh_vouched_accounts": "Actualiser les comptes garantis"
},
+ "revoke": {
+ "title": "Révoquer la garantie",
+ "sender": "Expéditeur",
+ "receiver": "Compte dont la garantie est révoquée",
+ "receiver_placeholder": "Saisir l'adresse du compte (0x...)",
+ "await": "Traitement en cours...",
+ "btn_revoke": "Révoquer la garantie",
+ "success": "La garantie du compte a été révoquée avec succès !",
+ "invalid_address": "Veuillez saisir une adresse de compte valide",
+ "error_revoke_failed": "Échec de la révocation de la garantie. Assurez-vous d'avoir déjà garanti ce compte.",
+ "vouched_accounts_title": "Vos comptes garantis",
+ "refresh_tooltip": "Actualiser les comptes garantis",
+ "important_info": "Informations importantes",
+ "info_relationship": "La révocation d'une garantie supprime votre soutien à un compte.",
+ "info_selective": "Vous ne pouvez révoquer que les garanties que vous avez préalablement données.",
+ "info_irreversible": "Cette action ne peut pas être annulée et sera enregistrée sur la blockchain."
+ },
+ "cwreauth": {
+ "title": "Réautorisation du portefeuille communautaire",
+ "sender": "Compte",
+ "wallet_type": "Type de portefeuille",
+ "wallet_address": "Adresse du portefeuille à réautoriser",
+ "wallet_placeholder": "Saisir l'adresse du portefeuille (0x...)",
+ "wallet_description": "Par défaut, il s'agit de votre compte actuel. Vous pouvez le modifier pour réautoriser un autre portefeuille communautaire.",
+ "community_wallet": "Portefeuille communautaire",
+ "not_community_wallet": "Pas un portefeuille communautaire",
+ "await": "Traitement en cours...",
+ "btn_reauth": "Réautoriser le portefeuille communautaire",
+ "success": "Portefeuille communautaire réautorisé avec succès !",
+ "error_invalid_address": "Veuillez saisir une adresse de portefeuille valide à réautoriser.",
+ "error_reauth_failed": "Échec de la réautorisation du portefeuille communautaire. Veuillez réessayer plus tard.",
+ "warning_not_cw": "La réautorisation du portefeuille communautaire n'est disponible que pour les comptes configurés en tant que portefeuilles communautaires.",
+ "about_title": "À propos de la réautorisation du portefeuille communautaire",
+ "about_description": "Les portefeuilles communautaires nécessitent une réautorisation périodique pour maintenir leurs capacités. Cette transaction renouvelle votre autorisation de portefeuille communautaire sur la blockchain."
+ },
"set_wallet_type": {
"actions_title": "Actions du compte",
"set_slow_title": "Rendre le portefeuille lent (dangereux)",
diff --git a/src/lang/locales/it.json b/src/lang/locales/it.json
index 29b6e47e..7fbca19f 100644
--- a/src/lang/locales/it.json
+++ b/src/lang/locales/it.json
@@ -291,6 +291,14 @@
}
},
"txs": {
+ "transactions": "Transactions",
+ "select_transaction_type": "Select Transaction Type",
+ "type_selector": {
+ "transfer": "Transfer",
+ "vouch": "Vouch",
+ "revoke": "Revoke Vouch",
+ "cwreauth": "CW Reauth"
+ },
"deno_tx": "Demo Tx",
"account": "Account",
"balance": "Balance",
@@ -328,6 +336,41 @@
"accounts_vouched_for": "Account che hai garantito:",
"refresh_vouched_accounts": "Aggiorna account garantiti"
},
+ "revoke": {
+ "title": "Revoca Garanzia",
+ "sender": "Mittente",
+ "receiver": "Account da cui Revocare la Garanzia",
+ "receiver_placeholder": "Inserisci indirizzo account (0x...)",
+ "await": "Elaborazione...",
+ "btn_revoke": "Revoca Garanzia",
+ "success": "Garanzia revocata con successo per l'account!",
+ "invalid_address": "Per favore inserisci un indirizzo account valido",
+ "error_revoke_failed": "Impossibile revocare la garanzia. Assicurati di aver precedentemente garantito questo account.",
+ "vouched_accounts_title": "I Tuoi Account Garantiti",
+ "refresh_tooltip": "Aggiorna account garantiti",
+ "important_info": "Informazioni Importanti",
+ "info_relationship": "La revoca di una garanzia rimuove il tuo sostegno a un account.",
+ "info_selective": "Puoi revocare solo le garanzie che hai precedentemente fornito.",
+ "info_irreversible": "Questa azione non può essere annullata e sarà registrata sulla blockchain."
+ },
+ "cwreauth": {
+ "title": "Riautorizzazione del Portafoglio Comunitario",
+ "sender": "Account",
+ "wallet_type": "Tipo di Portafoglio",
+ "wallet_address": "Indirizzo del Portafoglio da Riautorizzare",
+ "wallet_placeholder": "Inserisci indirizzo portafoglio (0x...)",
+ "wallet_description": "Per impostazione predefinita, è impostato sul tuo account corrente. Puoi cambiarlo per riautorizzare un diverso portafoglio comunitario.",
+ "community_wallet": "Portafoglio Comunitario",
+ "not_community_wallet": "Non è un Portafoglio Comunitario",
+ "await": "Elaborazione...",
+ "btn_reauth": "Riautorizza Portafoglio Comunitario",
+ "success": "Portafoglio Comunitario riautorizzato con successo!",
+ "error_invalid_address": "Per favore inserisci un indirizzo di portafoglio valido da riautorizzare.",
+ "error_reauth_failed": "Impossibile riautorizzare il Portafoglio Comunitario. Per favore riprova più tardi.",
+ "warning_not_cw": "La riautorizzazione del Portafoglio Comunitario è disponibile solo per gli account configurati come Portafogli Comunitari.",
+ "about_title": "Informazioni sulla Riautorizzazione del Portafoglio Comunitario",
+ "about_description": "I Portafogli Comunitari richiedono una riautorizzazione periodica per mantenere le loro funzionalità. Questa transazione rinnova l'autorizzazione del tuo portafoglio comunitario sulla blockchain."
+ },
"set_wallet_type": {
"actions_title": "Azioni dell'account",
"set_slow_title": "Rendere il portafoglio lento (pericoloso)",
diff --git a/src/lang/locales/pt.json b/src/lang/locales/pt.json
index 330c04b1..397343fb 100644
--- a/src/lang/locales/pt.json
+++ b/src/lang/locales/pt.json
@@ -274,6 +274,14 @@
}
},
"txs": {
+ "transactions": "Transactions",
+ "select_transaction_type": "Select Transaction Type",
+ "type_selector": {
+ "transfer": "Transfer",
+ "vouch": "Vouch",
+ "revoke": "Revoke Vouch",
+ "cwreauth": "CW Reauth"
+ },
"deno_tx": "Demo Tx",
"account": "Conta",
"balance": "Saldo",
@@ -311,6 +319,42 @@
"accounts_vouched_for": "Contas que você garantiu:",
"refresh_vouched_accounts": "Atualizar contas garantidas"
},
+ "revoke": {
+ "title": "Revogar Garantia",
+ "sender": "Remetente",
+ "receiver": "Conta para Revogar a Garantia",
+ "receiver_placeholder": "Digite o endereço da conta (0x...)",
+ "await": "Processando...",
+ "btn_revoke": "Revogar Garantia",
+ "success": "Garantia revogada com sucesso para a conta!",
+ "invalid_address": "Por favor, digite um endereço de conta válido",
+ "error_revoke_failed": "Falha ao revogar garantia. Por favor, certifique-se de que você garantiu esta conta anteriormente.",
+ "vouched_accounts_title": "Suas Contas Garantidas",
+ "refresh_tooltip": "Atualizar contas garantidas",
+ "important_info": "Informações Importantes",
+ "info_relationship": "Revogar uma garantia remove seu endosso de uma conta.",
+ "info_selective": "Você só pode revogar garantias que forneceu anteriormente.",
+ "info_irreversible": "Esta ação não pode ser desfeita e será registrada na blockchain."
+ },
+ "cwreauth": {
+ "title": "Community Wallet Reauthorization",
+ "sender": "Account",
+ "wallet_type": "Wallet Type",
+ "wallet_address": "Wallet Address to Reauthorize",
+ "wallet_placeholder": "Enter wallet address (0x...)",
+ "wallet_description": "By default, this is set to your current account. You can change it to reauthorize a different community wallet.",
+ "community_wallet": "Community Wallet",
+ "not_community_wallet": "Not a Community Wallet",
+ "await": "Processing...",
+ "btn_reauth": "Reauthorize Community Wallet",
+ "success": "Community Wallet successfully reauthorized!",
+ "error_invalid_address": "Please enter a valid wallet address to reauthorize.",
+ "error_reauth_failed": "Failed to reauthorize Community Wallet. Please try again later.",
+ "warning_not_cw": "Community Wallet reauthorization is only available for accounts configured as Community Wallets.",
+ "about_title": "About Community Wallet Reauthorization",
+ "about_description": "Community Wallets require periodic reauthorization to maintain their capabilities. This transaction renews your community wallet authorization on the blockchain."
+
+ },
"set_wallet_type": {
"actions_title": "Ações da Conta",
"set_slow_title": "Tornar Carteira Lenta (perigoso)",
diff --git a/src/lang/locales/zh_cn.json b/src/lang/locales/zh_cn.json
index 92abf666..4e40cdd5 100644
--- a/src/lang/locales/zh_cn.json
+++ b/src/lang/locales/zh_cn.json
@@ -291,6 +291,14 @@
}
},
"txs": {
+ "transactions": "Transactions",
+ "select_transaction_type": "Select Transaction Type",
+ "type_selector": {
+ "transfer": "Transfer",
+ "vouch": "Vouch",
+ "revoke": "Revoke Vouch",
+ "cwreauth": "CW Reauth"
+ },
"deno_tx": "测试交易",
"account": "账号",
"balance": "余额",
@@ -353,6 +361,41 @@
"accounts_vouched_for": "您已担保的账户:",
"refresh_vouched_accounts": "刷新担保账户"
},
+ "revoke": {
+ "title": "撤销担保",
+ "sender": "发送者",
+ "receiver": "需要撤销担保的账户",
+ "receiver_placeholder": "输入账户地址 (0x...)",
+ "await": "处理中...",
+ "btn_revoke": "撤销担保",
+ "success": "已成功撤销对此账户的担保!",
+ "invalid_address": "请输入有效的账户地址",
+ "error_revoke_failed": "撤销担保失败。请确保您之前曾为此账户担保。",
+ "vouched_accounts_title": "您担保的账户",
+ "refresh_tooltip": "刷新担保账户",
+ "important_info": "重要信息",
+ "info_relationship": "撤销担保会移除您对一个账户的背书。",
+ "info_selective": "您只能撤销之前提供过的担保。",
+ "info_irreversible": "此操作无法撤销,并将被记录在区块链上。"
+ },
+ "cwreauth": {
+ "title": "社区钱包重新授权",
+ "sender": "账户",
+ "wallet_type": "钱包类型",
+ "wallet_address": "需要重新授权的钱包地址",
+ "wallet_placeholder": "输入钱包地址 (0x...)",
+ "wallet_description": "默认设置为您当前的账户。您可以更改它以重新授权不同的社区钱包。",
+ "community_wallet": "社区钱包",
+ "not_community_wallet": "非社区钱包",
+ "await": "处理中...",
+ "btn_reauth": "重新授权社区钱包",
+ "success": "社区钱包已成功重新授权!",
+ "error_invalid_address": "请输入要重新授权的有效钱包地址。",
+ "error_reauth_failed": "无法重新授权社区钱包。请稍后再试。",
+ "warning_not_cw": "社区钱包重新授权仅适用于配置为社区钱包的账户。",
+ "about_title": "关于社区钱包重新授权",
+ "about_description": "社区钱包需要定期重新授权以维持其功能。此交易在区块链上更新您的社区钱包授权。"
+ },
"transfer": {
"title": "代币转账",
"sender": "发送者",
diff --git a/src/modules/routes.ts b/src/modules/routes.ts
index 3c2c7b8e..6f391b1d 100644
--- a/src/modules/routes.ts
+++ b/src/modules/routes.ts
@@ -3,7 +3,7 @@ export const routes = {
wallet: '/wallet',
accountDetails: '/account-details',
addAccount: '/add-account',
- addWatchAccount: '/add-wathc-account',
+ addWatchAccount: '/add-watch-account',
accountFromMnem: '/account-from-mnem',
keygen: '/keygen',
miner: '/miner',
From da126de7774d3164ce6f6200ae6b38a9200427b0 Mon Sep 17 00:00:00 2001
From: Sasuke <177417590+sasuke0787@users.noreply.github.com>
Date: Fri, 20 Jun 2025 15:39:53 -0400
Subject: [PATCH 6/9] removing default value
---
src/components/txs/CwReauthForm.svelte | 9 ++-------
src/lang/locales/ar.json | 1 -
src/lang/locales/de.json | 3 +--
src/lang/locales/en.json | 1 -
src/lang/locales/es.json | 1 -
src/lang/locales/fr.json | 3 +--
src/lang/locales/it.json | 1 -
src/lang/locales/pt.json | 2 --
src/lang/locales/zh_cn.json | 1 -
9 files changed, 4 insertions(+), 18 deletions(-)
diff --git a/src/components/txs/CwReauthForm.svelte b/src/components/txs/CwReauthForm.svelte
index 4e65a81e..010d0da6 100644
--- a/src/components/txs/CwReauthForm.svelte
+++ b/src/components/txs/CwReauthForm.svelte
@@ -15,13 +15,11 @@
let waitingTxs = false
// Selected wallet for reauthorization
- let selectedWallet = account?.account || ''
+ let selectedWallet = ''
// Handle CW reauthorization transaction
onMount(() => {
- if (account) {
- selectedWallet = account.account
- }
+ // Initialize component
})
async function submitCwReauth() {
@@ -81,9 +79,6 @@
placeholder={$_('txs.cwreauth.wallet_placeholder')}
disabled={watchOnly || waitingTxs}
/>
-
- {$_('txs.cwreauth.wallet_description')}
-
diff --git a/src/lang/locales/ar.json b/src/lang/locales/ar.json
index 530c949e..f7085cc6 100644
--- a/src/lang/locales/ar.json
+++ b/src/lang/locales/ar.json
@@ -359,7 +359,6 @@
"wallet_type": "نوع المحفظة",
"wallet_address": "عنوان المحفظة لإعادة التفويض",
"wallet_placeholder": "أدخل عنوان المحفظة (0x...)",
- "wallet_description": "افتراضيًا، هذا معيّن لحسابك الحالي. يمكنك تغييره لإعادة تفويض محفظة مجتمع مختلفة.",
"community_wallet": "محفظة مجتمع",
"not_community_wallet": "ليست محفظة مجتمع",
"await": "جاري المعالجة...",
diff --git a/src/lang/locales/de.json b/src/lang/locales/de.json
index 9c8c5fad..964cd8d0 100644
--- a/src/lang/locales/de.json
+++ b/src/lang/locales/de.json
@@ -359,9 +359,8 @@
"wallet_type": "Wallet-Typ",
"wallet_address": "Wallet-Adresse zum Wiederautorisieren",
"wallet_placeholder": "Wallet-Adresse eingeben (0x...)",
- "wallet_description": "Standardmäßig ist dies auf Ihr aktuelles Konto eingestellt. Sie können es ändern, um eine andere Community-Wallet zu wiederautorisieren.",
"community_wallet": "Community-Wallet",
- "not_community_wallet": "Keine Community-Wallet",
+ "not_community_wallet": "Keine Community-Wallet",
"await": "Verarbeitung...",
"btn_reauth": "Community-Wallet wiederautorisieren",
"success": "Community-Wallet erfolgreich wiederautorisiert!",
diff --git a/src/lang/locales/en.json b/src/lang/locales/en.json
index af8363ba..66d17b43 100644
--- a/src/lang/locales/en.json
+++ b/src/lang/locales/en.json
@@ -388,7 +388,6 @@
"wallet_type": "Wallet Type",
"wallet_address": "Wallet Address to Reauthorize",
"wallet_placeholder": "Enter wallet address (0x...)",
- "wallet_description": "By default, this is set to your current account. You can change it to reauthorize a different community wallet.",
"community_wallet": "Community Wallet",
"not_community_wallet": "Not a Community Wallet",
"await": "Processing...",
diff --git a/src/lang/locales/es.json b/src/lang/locales/es.json
index a9a325df..b3888e06 100644
--- a/src/lang/locales/es.json
+++ b/src/lang/locales/es.json
@@ -402,7 +402,6 @@
"wallet_type": "Tipo de Cartera",
"wallet_address": "Dirección de Cartera a Reautorizar",
"wallet_placeholder": "Introduce dirección de cartera (0x...)",
- "wallet_description": "Por defecto, se establece como tu cuenta actual. Puedes cambiarla para reautorizar una cartera comunitaria diferente.",
"community_wallet": "Cartera Comunitaria",
"not_community_wallet": "No es una Cartera Comunitaria",
"await": "Procesando...",
diff --git a/src/lang/locales/fr.json b/src/lang/locales/fr.json
index 664bfa7d..487404e8 100644
--- a/src/lang/locales/fr.json
+++ b/src/lang/locales/fr.json
@@ -359,9 +359,8 @@
"wallet_type": "Type de portefeuille",
"wallet_address": "Adresse du portefeuille à réautoriser",
"wallet_placeholder": "Saisir l'adresse du portefeuille (0x...)",
- "wallet_description": "Par défaut, il s'agit de votre compte actuel. Vous pouvez le modifier pour réautoriser un autre portefeuille communautaire.",
"community_wallet": "Portefeuille communautaire",
- "not_community_wallet": "Pas un portefeuille communautaire",
+ "not_community_wallet": "Pas un portefeuille communautaire",
"await": "Traitement en cours...",
"btn_reauth": "Réautoriser le portefeuille communautaire",
"success": "Portefeuille communautaire réautorisé avec succès !",
diff --git a/src/lang/locales/it.json b/src/lang/locales/it.json
index 7fbca19f..b7c5098b 100644
--- a/src/lang/locales/it.json
+++ b/src/lang/locales/it.json
@@ -359,7 +359,6 @@
"wallet_type": "Tipo di Portafoglio",
"wallet_address": "Indirizzo del Portafoglio da Riautorizzare",
"wallet_placeholder": "Inserisci indirizzo portafoglio (0x...)",
- "wallet_description": "Per impostazione predefinita, è impostato sul tuo account corrente. Puoi cambiarlo per riautorizzare un diverso portafoglio comunitario.",
"community_wallet": "Portafoglio Comunitario",
"not_community_wallet": "Non è un Portafoglio Comunitario",
"await": "Elaborazione...",
diff --git a/src/lang/locales/pt.json b/src/lang/locales/pt.json
index 397343fb..ff394cb5 100644
--- a/src/lang/locales/pt.json
+++ b/src/lang/locales/pt.json
@@ -342,7 +342,6 @@
"wallet_type": "Wallet Type",
"wallet_address": "Wallet Address to Reauthorize",
"wallet_placeholder": "Enter wallet address (0x...)",
- "wallet_description": "By default, this is set to your current account. You can change it to reauthorize a different community wallet.",
"community_wallet": "Community Wallet",
"not_community_wallet": "Not a Community Wallet",
"await": "Processing...",
@@ -353,7 +352,6 @@
"warning_not_cw": "Community Wallet reauthorization is only available for accounts configured as Community Wallets.",
"about_title": "About Community Wallet Reauthorization",
"about_description": "Community Wallets require periodic reauthorization to maintain their capabilities. This transaction renews your community wallet authorization on the blockchain."
-
},
"set_wallet_type": {
"actions_title": "Ações da Conta",
diff --git a/src/lang/locales/zh_cn.json b/src/lang/locales/zh_cn.json
index 4e40cdd5..bf701a00 100644
--- a/src/lang/locales/zh_cn.json
+++ b/src/lang/locales/zh_cn.json
@@ -384,7 +384,6 @@
"wallet_type": "钱包类型",
"wallet_address": "需要重新授权的钱包地址",
"wallet_placeholder": "输入钱包地址 (0x...)",
- "wallet_description": "默认设置为您当前的账户。您可以更改它以重新授权不同的社区钱包。",
"community_wallet": "社区钱包",
"not_community_wallet": "非社区钱包",
"await": "处理中...",
From 32cb59ad803740b8f9427b978116236ef970ac2e Mon Sep 17 00:00:00 2001
From: Sasuke <177417590+sasuke0787@users.noreply.github.com>
Date: Sun, 22 Jun 2025 19:21:52 -0400
Subject: [PATCH 7/9] adding legacy address
---
src-tauri/src/commands/tx.rs | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src-tauri/src/commands/tx.rs b/src-tauri/src/commands/tx.rs
index e3338d74..347b6d77 100644
--- a/src-tauri/src/commands/tx.rs
+++ b/src-tauri/src/commands/tx.rs
@@ -5,6 +5,7 @@ use crate::key_manager::{get_private_key, inject_private_key_to_cfg};
use crate::{carpe_error::CarpeError, configs::get_cfg};
use libra_txs::submit_transaction::Sender;
+use libra_txs::txs_cli;
use libra_types::exports::{AccountAddress, AccountKey};
fn make_account_key(address: &AccountAddress) -> anyhow::Result
{
@@ -17,10 +18,10 @@ pub async fn coin_transfer(
_sender: AccountAddress,
receiver: &str,
amount: u64,
- _legacy: bool,
+ legacy: bool,
) -> Result<(), CarpeError> {
// NOTE: unsure Serde was catching all cases check serialization
- let receiver_account = match AccountAddress::from_str(receiver) {
+ let mut receiver_account = match AccountAddress::from_str(receiver) {
Ok(a) => a,
Err(e) => {
dbg!(e);
@@ -28,12 +29,19 @@ pub async fn coin_transfer(
AccountAddress::from_str(&format!("0x{}", receiver))?
}
};
+
+ // Handle legacy address conversion if needed
+ if legacy {
+ use libra_txs::txs_cli::to_legacy_address;
+ receiver_account = to_legacy_address(&receiver_account)?;
+ println!("Using legacy address format: {}", receiver_account);
+ }
let mut config = get_cfg()?;
inject_private_key_to_cfg(&mut config, _sender)?;
let mut sender = Sender::from_app_cfg(&config, Some(_sender.to_string())).await?;
sender
- .transfer(receiver_account, amount as f64, false)
+ .transfer(receiver_account, amount as f64, legacy)
.await?;
Ok(())
}
From a22feea15e41926fbd600d061091ef35ea06eba0 Mon Sep 17 00:00:00 2001
From: sasuke0787 <177417590+sasuke0787@users.noreply.github.com>
Date: Sun, 22 Jun 2025 21:08:20 -0400
Subject: [PATCH 8/9] fixing legacy address issue
---
src-tauri/src/commands/tx.rs | 157 ++++++++++++++-----
src/components/txs/CwReauthForm.svelte | 3 +-
src/components/txs/RevokeForm.svelte | 3 +-
src/components/txs/VouchForm.svelte | 2 +-
src/components/wallet/MigrationStatus.svelte | 7 +-
5 files changed, 124 insertions(+), 48 deletions(-)
diff --git a/src-tauri/src/commands/tx.rs b/src-tauri/src/commands/tx.rs
index 347b6d77..648b1612 100644
--- a/src-tauri/src/commands/tx.rs
+++ b/src-tauri/src/commands/tx.rs
@@ -1,11 +1,10 @@
//! transaction scripts
use std::str::FromStr;
-use crate::key_manager::{get_private_key, inject_private_key_to_cfg};
+use crate::key_manager::get_private_key;
use crate::{carpe_error::CarpeError, configs::get_cfg};
-use libra_txs::submit_transaction::Sender;
-use libra_txs::txs_cli;
+use libra_types::exports::ChainId;
use libra_types::exports::{AccountAddress, AccountKey};
fn make_account_key(address: &AccountAddress) -> anyhow::Result {
@@ -13,6 +12,68 @@ fn make_account_key(address: &AccountAddress) -> anyhow::Result {
Ok(AccountKey::from_private_key(pk))
}
+/// Creates a new Sender with proper handling of legacy addresses.
+/// This function centralizes the logic for creating a transaction sender
+/// with proper chain ID and legacy address support.
+async fn create_sender_with_legacy(
+ sender_address: AccountAddress,
+ legacy: bool,
+) -> Result<
+ (
+ libra_txs::submit_transaction::Sender,
+ libra_types::core_types::app_cfg::AppCfg,
+ ),
+ CarpeError,
+> {
+ // Get configuration
+ let config = get_cfg()?;
+
+ // Get private key for the sender
+ let pk = get_private_key(&sender_address)?;
+ let account_key = AccountKey::from_private_key(pk);
+
+ // Get URL from config
+ let url = config.pick_url(None)?;
+
+ // Create the client
+ let client = libra_types::exports::Client::new(url.clone());
+
+ // Get chain ID from the live network with fallback to config
+ println!("Fetching current chain ID from network...");
+ let chain_id = match client.get_index().await {
+ Ok(metadata) => {
+ let chain_id_value = metadata.into_inner().chain_id;
+ println!("Network chain ID: {}", chain_id_value);
+ ChainId::new(chain_id_value)
+ }
+ Err(e) => {
+ println!(
+ "Warning: Failed to get chain ID from network: {}. Using default from config.",
+ e
+ );
+ // Fallback to config chain ID
+ let config_chain_id = config.workspace.default_chain_id.id();
+ println!("Using config chain ID: {}", config_chain_id);
+ ChainId::new(config_chain_id)
+ }
+ };
+
+ // Initialize the sender with the legacy flag
+ let mut sender = libra_txs::submit_transaction::Sender::new(
+ account_key,
+ chain_id,
+ Some(client),
+ legacy, // Pass the legacy flag here
+ )
+ .await?;
+
+ // Set the transaction cost
+ let tx_cost = config.tx_configs.get_cost(None);
+ sender.set_tx_cost(&tx_cost);
+
+ Ok((sender, config))
+}
+
#[tauri::command(async)]
pub async fn coin_transfer(
_sender: AccountAddress,
@@ -20,8 +81,8 @@ pub async fn coin_transfer(
amount: u64,
legacy: bool,
) -> Result<(), CarpeError> {
- // NOTE: unsure Serde was catching all cases check serialization
- let mut receiver_account = match AccountAddress::from_str(receiver) {
+ // Parse receiver address, add 0x prefix if needed
+ let receiver_account = match AccountAddress::from_str(receiver) {
Ok(a) => a,
Err(e) => {
dbg!(e);
@@ -29,25 +90,37 @@ pub async fn coin_transfer(
AccountAddress::from_str(&format!("0x{}", receiver))?
}
};
-
- // Handle legacy address conversion if needed
- if legacy {
- use libra_txs::txs_cli::to_legacy_address;
- receiver_account = to_legacy_address(&receiver_account)?;
- println!("Using legacy address format: {}", receiver_account);
- }
- let mut config = get_cfg()?;
- inject_private_key_to_cfg(&mut config, _sender)?;
- let mut sender = Sender::from_app_cfg(&config, Some(_sender.to_string())).await?;
- sender
- .transfer(receiver_account, amount as f64, legacy)
- .await?;
- Ok(())
+ // Use the common function to create a sender with legacy address support
+ let (mut sender, _) = create_sender_with_legacy(_sender, legacy).await?;
+
+ println!(
+ "Attempting transfer from {} to {} of {} coins",
+ _sender, receiver_account, amount
+ );
+
+ // Use the transfer method - the last parameter is 'estimate_only'
+ match sender
+ .transfer(receiver_account, amount as f64, false)
+ .await
+ {
+ Ok(_) => {
+ println!("Transaction completed successfully");
+ Ok(())
+ }
+ Err(e) => {
+ println!("Transaction failed: {}", e);
+ Err(CarpeError::misc(&format!("Transaction failed: {}", e)))
+ }
+ }
}
#[tauri::command(async)]
-pub async fn vouch_transaction(_sender: AccountAddress, receiver: &str) -> Result<(), CarpeError> {
+pub async fn vouch_transaction(
+ _sender: AccountAddress,
+ receiver: &str,
+ legacy: bool,
+) -> Result<(), CarpeError> {
let receiver_account = match AccountAddress::from_str(receiver) {
Ok(a) => a,
Err(e) => {
@@ -59,16 +132,18 @@ pub async fn vouch_transaction(_sender: AccountAddress, receiver: &str) -> Resul
}
};
- let mut config = get_cfg()?;
- inject_private_key_to_cfg(&mut config, _sender)?;
+ // Use the common function to create a sender with legacy address support
+ let (mut sender, _) = create_sender_with_legacy(_sender, legacy).await?;
- let mut sender = Sender::from_app_cfg(&config, Some(_sender.to_string())).await?;
-
- // Try the revoke vouch function path
+ // Function path for vouching
let function_path = "0x1::vouch_txs::vouch_for";
// Format address as a Move address literal (with 0x prefix)
let formatted_address = format!("0x{}", receiver_account.to_hex());
+ println!(
+ "Calling {} with argument: {}",
+ function_path, formatted_address
+ );
match sender
.generic(
@@ -80,24 +155,22 @@ pub async fn vouch_transaction(_sender: AccountAddress, receiver: &str) -> Resul
{
Ok(_) => {
println!("Successfully called {}", function_path);
- return Ok(());
+ Ok(())
}
Err(e) => {
println!("Failed to call {}: {}", function_path, e);
+ Err(CarpeError::misc(&format!(
+ "Failed to call vouch function: {}",
+ e
+ )))
}
}
- // If we get here, all attempts failed
- Err(CarpeError::misc(
- "Failed to call vouch function with any known path or argument format",
- ))
}
#[tauri::command(async)]
-pub async fn rejoin_transaction(_sender: AccountAddress) -> Result<(), CarpeError> {
- let mut config = get_cfg()?;
- inject_private_key_to_cfg(&mut config, _sender)?;
-
- let mut sender = Sender::from_app_cfg(&config, Some(_sender.to_string())).await?;
+pub async fn rejoin_transaction(_sender: AccountAddress, legacy: bool) -> Result<(), CarpeError> {
+ // Use the common function to create a sender with legacy address support
+ let (mut sender, _) = create_sender_with_legacy(_sender, legacy).await?;
match sender
.generic(
@@ -120,6 +193,7 @@ pub async fn rejoin_transaction(_sender: AccountAddress) -> Result<(), CarpeErro
pub async fn revoke_vouch_transaction(
_sender: AccountAddress,
receiver: &str,
+ legacy: bool,
) -> Result<(), CarpeError> {
let receiver_account = match AccountAddress::from_str(receiver) {
Ok(a) => a,
@@ -132,10 +206,8 @@ pub async fn revoke_vouch_transaction(
}
};
- let mut config = get_cfg()?;
- inject_private_key_to_cfg(&mut config, _sender)?;
-
- let mut sender = Sender::from_app_cfg(&config, Some(_sender.to_string())).await?;
+ // Use the common function to create a sender with legacy address support
+ let (mut sender, _) = create_sender_with_legacy(_sender, legacy).await?;
// Try the revoke vouch function path
let function_path = "0x1::vouch_txs::revoke";
@@ -166,6 +238,7 @@ pub async fn revoke_vouch_transaction(
pub async fn cw_reauth_transaction(
_sender: AccountAddress,
wallet_address: &str,
+ legacy: bool,
) -> Result<(), CarpeError> {
// Parse the wallet address
let wallet_account = match AccountAddress::from_str(wallet_address) {
@@ -179,10 +252,8 @@ pub async fn cw_reauth_transaction(
}
};
- let mut config = get_cfg()?;
- inject_private_key_to_cfg(&mut config, _sender)?;
-
- let mut sender = Sender::from_app_cfg(&config, Some(_sender.to_string())).await?;
+ // Use the common function to create a sender with legacy address support
+ let (mut sender, _) = create_sender_with_legacy(_sender, legacy).await?;
// Try the community wallet reauthorization function path
let function_path = "0x1::donor_voice_txs::vote_reauth_tx";
diff --git a/src/components/txs/CwReauthForm.svelte b/src/components/txs/CwReauthForm.svelte
index 010d0da6..6c46c047 100644
--- a/src/components/txs/CwReauthForm.svelte
+++ b/src/components/txs/CwReauthForm.svelte
@@ -36,7 +36,8 @@
await invoke("cw_reauth_transaction", {
sender: account.account,
- walletAddress: selectedWallet // Pass the selected wallet address to reauthorize
+ walletAddress: selectedWallet, // Pass the selected wallet address to reauthorize
+ legacy: account.account.startsWith('0'.repeat(32)) // Use same legacy detection as other forms
})
notify_success($_('txs.cwreauth.success'))
diff --git a/src/components/txs/RevokeForm.svelte b/src/components/txs/RevokeForm.svelte
index dd5f8b76..75f8e006 100644
--- a/src/components/txs/RevokeForm.svelte
+++ b/src/components/txs/RevokeForm.svelte
@@ -59,7 +59,8 @@
await invoke("revoke_vouch_transaction", {
sender: account.account,
- receiver: receiver
+ receiver: receiver,
+ legacy: account.account.startsWith('0'.repeat(32)) // Use same legacy detection as in other forms
})
notify_success($_('txs.revoke.success'))
diff --git a/src/components/txs/VouchForm.svelte b/src/components/txs/VouchForm.svelte
index b65c29f8..86f1b6e3 100644
--- a/src/components/txs/VouchForm.svelte
+++ b/src/components/txs/VouchForm.svelte
@@ -88,7 +88,7 @@
await invoke("vouch_transaction", {
sender: account.account,
receiver: receiver,
- legacy: false
+ legacy: account.account.startsWith('0'.repeat(32)) // Use same legacy detection as in Transactions
})
notify_success($_('txs.vouch.success'))
diff --git a/src/components/wallet/MigrationStatus.svelte b/src/components/wallet/MigrationStatus.svelte
index 0dba1526..0a0ea1ca 100644
--- a/src/components/wallet/MigrationStatus.svelte
+++ b/src/components/wallet/MigrationStatus.svelte
@@ -47,8 +47,11 @@
// Show loading state while processing
isLoading = true;
- // Call the rejoin_transaction Tauri function directly
- await invoke('rejoin_transaction', { sender: account });
+ // Call the rejoin_transaction Tauri function directly with legacy flag
+ await invoke('rejoin_transaction', {
+ sender: account,
+ legacy: account.startsWith('0'.repeat(32)) // Use same legacy detection as other transactions
+ });
// Refresh status checks after successful rejoin
await checkMigrationStatus();
From d99c43092df72748273670387ef4f04091c9eca9 Mon Sep 17 00:00:00 2001
From: sasuke0787 <177417590+sasuke0787@users.noreply.github.com>
Date: Sun, 22 Jun 2025 21:25:48 -0400
Subject: [PATCH 9/9] updating release version
---
src-tauri/Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index e955d276..dc6e245e 100644
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "carpe"
-version = "1.0.5"
+version = "1.1.1"
authors = ["0LNetworkCommunity"]
default-run = "carpe"
description = "a wallet for OpenLibra"