Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

updateUsername

Change the username on the calling account's user record.

Usernames live in a chain-wide unique index on the user record; the chain rejects collisions and reserves names. Note that the protocol book describes the original name field as immutable once set on RegisterUser — this action surfaces a chain-side rename path that is only available where the contract permits it.

Signature

function updateUsername(
  client: Client<Signer>,
  parameters: {
    sender: Address
    username: Username
  },
): Promise<{ hash: Uint8Array } & TxData>

Example

import { createSignerClient, createTransport, testnet, PrivateKeySigner } from "@left-curve/sdk"
import type { Address } from "@left-curve/sdk"
 
const client = createSignerClient({
  chain: testnet,
  transport: createTransport(),
  signer: PrivateKeySigner.fromMnemonic(process.env.DANGO_MNEMONIC!),
})
const sender: Address = "0x1234567890abcdef1234567890abcdef12345678"
 
await client.updateUsername({ sender, username: "new-alice" })

Parameters

senderAddress. The calling account.

usernameUsername. New username. Must be unique chain-wide.

Returns

{ hash: Uint8Array } & TxData — see broadcastTxSync.

See also