Moderation
Adding or removing a moderator will only succeed for an owner of a channel.
Add a Sage channel moderator
import { useSignAndExecuteTransaction } from '@mysten/dapp-kit';
import { useUser } from '@sage-app/sdk/react';
interface ChannelModeratorInput {
amounts: number[]; // payment amounts set to [0, 0]
channelId: string; // channel address
self: string; // user's wallet address
soulId: string; // address of user's owned soul
}
...
const { mutateAsync: signAndExecuteTransaction } = useSignAndExecuteTransaction();
const { addModerator } = useChannel();
...
const addChannelModerator = async (data: ChannelModeratorInput) => {
const { ok, err, transaction } = await addModerator(data);
const { digest } = await signAndExecuteTransaction({
transaction
});
};Error Codes
Channel 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.
Moderation module
Code
Value
Meaning
372
EIsNotOwner
User is not the owner of the channel.
Remove a Sage channel moderator
Error Codes
Channel 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.
Moderation module
Code
Value
Meaning
372
EIsNotOwner
User is not the owner of the channel.
Querying for Channel Moderation Events
In this case events will take the shape of an array of ChannelModerationEvent:
Last updated