Links a wallet the signed-in user owns in Privy to their Music Nerd account. If a legacy (pre-Privy) account already has that wallet, the two are merged into the legacy account, which takes over the Privy identity and the signed-in account's contributions and comes back as userId. A name the user confirmed in the welcome flow wins over the legacy name.
POST/api/auth/link-wallet
Authorizations
Authorizationstringheaderrequired
Bearer authentication header of the form Bearer <token>. The signed-in user's access token. Copy it at https://musicnerd.net/access after signing in. Any Music Nerd user; the account is the token's, never the request's.
Body
application/jsonrequired
walletAddressstringrequired
An EVM wallet address. It must be one of the wallets linked to the caller's Privy account; it is stored lower-cased.
pattern: ^0x[a-fA-F0-9]{40}$
Response
application/json
The wallet is linked. merged: true means a legacy account was found and merged; userId is then the surviving account's id, which the client must use from now on.
statusstring · enumrequired
Values: "ok"
successboolean · enumrequired
Values: true
mergedbooleanrequired
True when a legacy account with this wallet was merged into.
userIdstring
Only when merged is true: the surviving (legacy) account's id. The caller's token now maps to this account.