add sweepAll for Monero send-all; add copy buttons for accounts/subaddresses

This commit is contained in:
2026-05-26 13:09:18 +08:00
parent 915f6f36f6
commit 34602a4bfa
7 changed files with 113 additions and 10 deletions
+1
View File
@@ -179,6 +179,7 @@ export type MoneroRpcRequests = {
moneroGetAccounts: { params: {}; response: MoneroAccountEntry[] }
moneroListWallets: { params: {}; response: string[] }
moneroTransfer: { params: { address: string; amount: string; priority?: number; accountIndex?: number }; response: MoneroSendResult }
moneroSweepAll: { params: { address: string; priority?: number; accountIndex?: number }; response: MoneroSendResult }
moneroGetTransferDetails: { params: { txid: string }; response: MoneroTransferDetails | null }
moneroGetFeeEstimate: { params: {}; response: MoneroFeeEstimate | null }
}
@@ -293,6 +293,21 @@ export const MoneroWallet = () => {
return result
}
const sendAll = async (
address: string,
priority?: number,
accountIndex?: number,
): Promise<MoneroSendResult> => {
if (!electrobun.rpc) throw new Error('RPC not available')
const result = await electrobun.rpc.request.moneroSweepAll({
address,
priority,
accountIndex,
})
await refresh()
return result
}
return {
get accountType() {
return accountType
@@ -396,6 +411,7 @@ export const MoneroWallet = () => {
openWallet,
refresh,
send,
sendAll,
}
}