Skip to main content
Glama

random-sui-account

Generate random SUI blockchain accounts for testing and development purposes, not intended for production or real-world transactions. Easily create one or multiple accounts as needed.

Instructions

Create random SUI account, do not use it in production.

Input Schema

NameRequiredDescriptionDefault
numNo

Input Schema (JSON Schema)

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

Implementation Reference

  • The asynchronous callback method 'cb' that executes the core logic of the 'random-sui-account' tool: generates a random mnemonic, derives multiple keypairs from it, extracts account info, and returns JSON stringified account details.
    async cb(args: RandomAccountParams) { const accountInfos = []; const mnemonic = genRandomMnemonic(); for (let i = 0; i < args.num; i++) { const keypair = getKeypairFromMnemonic(mnemonic, i); const accountInfo = getAccountInfoFromKeypair(keypair); accountInfos.push(accountInfo); } return this.createTextResponse(JSON.stringify(accountInfos)); }
  • Zod schema defining the input parameters for the tool, with an optional 'num' parameter defaulting to 1.
    const randomAccountParamsSchema = z.object({ num: z.number().default(1), });
  • The tool instance 'randomSuiAccountTool' is included in the default export array of all tools from src/tools/index.ts, likely used for overall tool registration.
    export default [ faucetTool, suiBalanceTool, suiTransferTool, randomSuiAccountTool, genMnemonicTool, genSuiAccountsByMnemonicTool, getAccountInfoByPriKeyTool, ];
  • src/tools/index.ts:4-4 (registration)
    Import of the pre-instantiated RandomSuiAccountTool from its implementation file.
    import randomSuiAccountTool from './account/gen-random.js';
  • Imports helper functions from utils/keypair.js used in the handler for mnemonic generation and keypair derivation.
    import { genRandomMnemonic, getKeypairFromMnemonic, getAccountInfoFromKeypair, } from '../../utils/keypair.js';

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