add sweepAll for Monero send-all; add copy buttons for accounts/subaddresses
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user