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
+26
View File
@@ -18,6 +18,8 @@ import {
getFeeEstimate as walletGetFeeEstimate,
transfer as walletTransfer,
sweepAll as walletSweepAll,
createAccount as walletCreateAccount,
createSubaddress as walletCreateSubaddress,
isWalletOpen,
isConnected,
} from '../../lib/monero'
@@ -256,6 +258,30 @@ export function createMoneroHandlers(state: {
console.log('[rpc] moneroSweepAll complete:', result.txHash)
return result
},
moneroCreateAccount: async ({ label }: { label?: string }) => {
console.log('[rpc] moneroCreateAccount:', { label })
if (!state.manager) throw new Error('Monero wallet RPC not started')
const result = await walletCreateAccount(state.manager, label)
console.log('[rpc] moneroCreateAccount complete:', result)
return result
},
moneroCreateSubaddress: async ({
accountIndex,
label,
}: {
accountIndex: number
label?: string
}) => {
console.log('[rpc] moneroCreateSubaddress:', { accountIndex, label })
if (!state.manager) throw new Error('Monero wallet RPC not started')
const result = await walletCreateSubaddress(
state.manager,
accountIndex,
label,
)
console.log('[rpc] moneroCreateSubaddress complete:', result)
return result
},
moneroGetTransferDetails: async ({ txid }: { txid: string }) => {
console.log('[rpc] moneroGetTransferDetails:', txid)
if (!state.manager)