changeCurvyHandle
Rename the active account's Curvy handle.
The metadata service authenticates the rename with the bearer token, whose subject is the current handle, so only the active (registered) account can be renamed. On success the new handle is published to state.accounts (so watch* fire), written to durable storage (so restoreSession sees it), and the bearer token is replaced with the one issued for the new handle. Keys are untouched; the account id does not change.
Import
import { changeCurvyHandle } from "@0xcurvy/curvy-sdk/actions";Usage
const handle = await changeCurvyHandle({ handle: "alice-two.curvy.name" });Signature
function changeCurvyHandle(parameters: ChangeCurvyHandleParameters): Promise<CurvyId>Returns
Promise<\${string}.staging-curvy.name` | `${string}.curvy.name` | `${string}.local-curvy.name`>`
The action resolves or returns the value shown in the signature.
Parameters
handle
- Type:
string - Required: yes
The new Curvy handle for the active account, such as alice-two.curvy.name.
const result = await changeCurvyHandle({
handle,
});config
- Type:
CurvyConfig - Required: no
Curvy config to use. Defaults to the ambient config.
const result = await changeCurvyHandle({
handle,
config,
});Errors
Errors from config resolution and the underlying SDK operation are propagated to the caller.
Related
Source
packages/@0xcurvy/sdk/src/actions/account/changeCurvyHandle.ts