create accounts/subaddresses, chunked address style, fix canSend for subaddresses

This commit is contained in:
2026-05-26 13:33:28 +08:00
parent 34602a4bfa
commit 2139d5e6ff
7 changed files with 259 additions and 12 deletions
@@ -308,6 +308,23 @@ export const MoneroWallet = () => {
return result
}
const createAccount = async (label?: string) => {
if (!electrobun.rpc) throw new Error('RPC not available')
const result = await electrobun.rpc.request.moneroCreateAccount({ label })
await refresh()
return result
}
const createSubaddress = async (accountIndex: number, label?: string) => {
if (!electrobun.rpc) throw new Error('RPC not available')
const result = await electrobun.rpc.request.moneroCreateSubaddress({
accountIndex,
label,
})
await refresh()
return result
}
return {
get accountType() {
return accountType
@@ -412,6 +429,8 @@ export const MoneroWallet = () => {
refresh,
send,
sendAll,
createAccount,
createSubaddress,
}
}