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
| Name | Required | Description | Default |
|---|---|---|---|
| num | No |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"num": {
"default": 1,
"type": "number"
}
},
"type": "object"
}
Implementation Reference
- src/tools/account/gen-random.ts:20-31 (handler)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)); }
- src/tools/account/gen-random.ts:9-11 (schema)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), });
- src/tools/index.ts:9-17 (registration)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';
- src/tools/account/gen-random.ts:2-6 (helper)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';