Skip to main content
Glama

gen_sui_accounts_by_mnemonic

Generate multiple SUI blockchain accounts from a single mnemonic phrase for testing purposes, enabling easy account creation in development environments.

Instructions

Create SUI accounts from mnemonic(Not recommended for production)

Input Schema

NameRequiredDescriptionDefault
mnemonicYes
numNo

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "mnemonic": { "type": "string" }, "num": { "default": 1, "type": "number" } }, "required": [ "mnemonic" ], "type": "object" }

Implementation Reference

  • GenSuiAccountsByMnemonicTool class: defines the tool name, description, schema reference, and the cb method implementing the core logic to generate multiple SUI accounts from a mnemonic using helper functions.
    export class GenSuiAccountsByMnemonicTool extends BaseTool<GenByMnemonicParams> { name = 'gen_sui_accounts_by_mnemonic'; description = 'Create SUI accounts from mnemonic(Not recommended for production)'; paramsSchema = genByMnemonicParamsSchema; async cb(args: GenByMnemonicParams) { if (!args.mnemonic) { throw new Error('Mnemonic is required'); } const { mnemonic, num } = args; const accountInfos = []; for (let i = 0; i < num; i++) { const keypair = getKeypairFromMnemonic(mnemonic, i); const accountInfo = getAccountInfoFromKeypair(keypair); accountInfos.push(accountInfo); } const result = { mnemonic: mnemonic, accounts: accountInfos, }; return this.createTextResponse(JSON.stringify(result)); } }
  • Zod schema for input parameters: mnemonic (string, required), num (number, default 1). Type alias GenByMnemonicParams.
    const genByMnemonicParamsSchema = z.object({ mnemonic: z.string(), num: z.number().default(1), }); type GenByMnemonicParams = z.output<typeof genByMnemonicParamsSchema>;
  • The tool is imported from its implementation file and included in the default-exported array of all tools, serving as the registration point.
    import genSuiAccountsByMnemonicTool from './account/gen-by-mnemonic.js'; import getAccountInfoByPriKeyTool from './account/get-info-by-pri-key.js'; export default [ faucetTool, suiBalanceTool, suiTransferTool, randomSuiAccountTool, genMnemonicTool, genSuiAccountsByMnemonicTool,

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/0xdwong/sui-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server