Skip to content

updatename ​

Summary ​

This action is used to set a user’s display username.

Technical Behavior ​

The action requires that there is an authorization of the user, and the name need to contains only valid character which are alphabet numerical with . and _.

Action Parameters ​

Property NameC++ TypeJavaScript TypeDescription
accounteosio::nameStringThe account of user
usernamestringStringThe username of user

CLI - cleos ​

bash
cleos push action ultra.avatar updatename '["alice", "alice123"]' -p alice

Javascript - eosjs ​

js
await api.transact([
    {
        account: 'ultra.avatar',
        name: 'updatename',
        authorization: [{ actor: 'alice', permission: 'active' }],
        data: {
            account: 'alice',
            username: 'alice123',
        },
    },
    {
        blocksBehind: 3,
        expireSeconds: 30,
    }
]);