show subaddress 0 in ui, log subaddresses with account on backend
This commit is contained in:
@@ -194,6 +194,19 @@ export class MoneroWalletManager {
|
||||
if (!this.wallet) throw new Error('Wallet RPC not started')
|
||||
const accounts = await this.wallet.getAccounts(true) as any[]
|
||||
console.log(`[monero] accounts: ${accounts?.length ?? 0} returned`)
|
||||
if (accounts?.length) {
|
||||
for (const acct of accounts) {
|
||||
const subs = acct.getSubaddresses() ?? []
|
||||
console.log(`[monero] account ${acct.getIndex()}: balance=${acct.getBalance()?.toString() ?? '0'} subs=${subs.length} primary=${(acct.getPrimaryAddress() ?? '').substring(0, 16)}...`)
|
||||
const has0 = subs.some((s: any) => s.getIndex() === 0)
|
||||
if (!has0) {
|
||||
console.log(`[monero] sub 0 (primary): addr=${(acct.getPrimaryAddress() ?? '').substring(0, 16)}...`)
|
||||
}
|
||||
for (const sub of subs) {
|
||||
console.log(`[monero] sub ${sub.getIndex()}: addr=${(sub.getAddress() ?? '').substring(0, 16)}... label=${sub.getLabel() ?? ''} balance=${sub.getBalance()?.toString() ?? '0'} used=${sub.getIsUsed()}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
return accounts?.map(a => a.toJson()) ?? []
|
||||
}
|
||||
|
||||
|
||||
@@ -310,7 +310,6 @@
|
||||
<div class="space-y-1 border-t border-border pt-2">
|
||||
<p class="text-xs text-muted-foreground mb-1">Subaddresses</p>
|
||||
{#each account.subaddresses as sub}
|
||||
{#if sub.index > 0}
|
||||
<div class="rounded-sm bg-background px-2 py-1.5 text-xs">
|
||||
<div class="flex items-center justify-between">
|
||||
<p class="font-medium">#{sub.index}{sub.label ? ` - ${sub.label}` : ''}</p>
|
||||
@@ -318,7 +317,6 @@
|
||||
</div>
|
||||
<p class="font-mono text-muted-foreground/50 truncate">{sub.address}</p>
|
||||
</div>
|
||||
{/if}
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user