Update

Updating a user will only succeed for the user object associated with the user's wallet. The lowercase value of the user name must remain the same.

Update a Sage user

import { useSignAndExecuteTransaction } from '@mysten/dapp-kit';
import { useUser } from '@sage-app/sdk/react';

interface UserUpdateInput {
  amounts: number[];           // payment amounts set to [0, 0]
  avatarHash?: string;
  bannerHash?: string;
  description: string;
  name: string;
  self: string;                // user's wallet address
  userId: string;              // user's object address
}

...

const { mutateAsync: signAndExecuteTransaction } = useSignAndExecuteTransaction();
const { update } = useUser();

...

const updateUser = async (data: UserUpdateInput) => {
  const { ok, err, transaction } = await update(data);
    
  const { digest } = await signAndExecuteTransaction({
    transaction
  });
};

Error Codes

User Actions module

Code
Value
Meaning

373

EUserNameMismatch

The lowercase value of the new channel name must match the lowercase value of the old channel name, or the user object is not associated with the wallet address.

User Fees module

Code
Value
Meaning

370

EIncorrectCoinType

Custom payment type does not match configured custom payment coin.

371

EIncorrectCustomPayment

Incorrect custom payment value.

372

EIncorrectSuiPayment

Incorrect sui payment value.

Querying for Channel Update Events

In this case events will take the shape of an array of UserUpdateEvent:

Last updated