Skip to main content

Moxie Client

The Moxie Client is a specialized Eliza client that extends the DirectClient class, serving as the primary interface for users on moxie.xyz to interact with their agents.

One of its key features is the ability to inject authenticated users data into predefined states, enabling developers to access relevant information during Skill development.

In the Moxie Skills Framework, the Moxie Client does not include an authentication layer for local development purposes. Consequently, the injected states will return mock data instead of real user data.

These states include:

States

agentName

The agentName state contains the name of the agent.

export default Action {
handler: async (
runtime: IAgentRuntime,
message: Memory,
state: State,
_options: { [key: string]: unknown },
callback?: HandlerCallback
): Promise<boolean> => {
const agentName: string = state.agentName;
}
}

moxieUserInfo

The moxieUserInfo state contains the authenticated user's information, including their wallet address, username, and profile image, etc.

export default Action {
handler: async (
runtime: IAgentRuntime,
message: Memory,
state: State,
_options: { [key: string]: unknown },
callback?: HandlerCallback
): Promise<boolean> => {
const moxieUserInfo: MoxieUser = state.moxieUserInfo;
}
}

agentWallet

The agentWallet state is a MoxieWalletClient instance that provides methods for interacting with the user's agent wallet.

export default Action {
handler: async (
runtime: IAgentRuntime,
message: Memory,
state: State,
_options: { [key: string]: unknown },
callback?: HandlerCallback
): Promise<boolean> => {
const agentWallet: MoxieWalletClient = state.agentWallet;
}
}

More Resources

Developer Support

If you have any questions or need help with other use cases, feel free to join the Moxie Telegram Developers Channel and ask your questions there.

Our team is always ready to help you with any questions you may have.