Skip to content

MoneroWalletFull.createSubaddress(0).getAddress() returns same address until its used #262

@Hackerokuz

Description

@Hackerokuz

I want to create a unique sub address per transaction for my web app this code returns same sub address until its used

async function createSubaddress() {
    // Note: I have tried both viewOnly and full wallet!
    let viewOnlyWallet  = await openMoneroWallet();
    await viewOnlyWallet.sync();
    return (await viewOnlyWallet.createSubaddress(0)).getAddress();
}


function openMoneroWallet() {
    return moneroTs.openWalletFull({
        path: getWalletPath(),
        password: "****",
        networkType: moneroTs.MoneroNetworkType.STAGENET,
        server: {
            uri: "****"
        }
    })
    
}

In Monero GUI wallet going to receive and clicking create new address creates a new one every time you click it.
image

I have looked through docs and code of the library and also Monero docs but I dont see why I cant create a sub address.

Am I doing something wrong or is this a bug with the library?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions