MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / getOrCreate

Method getOrCreate

warp/warp.ts:54–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52 const localAccount = await this.readLocal();
53 if (localAccount) return localAccount;
54
55 // 注册新账户
56 return await this.register();
57 }
58
59 private static async readLocal(): Promise<{ privateKey: string; address6: string } | null> {
60 const result = await SystemExecutor.runSudo(`cat ${WARP_CONFIG_FILE}`);
61 if (!result.success || !result.output) return null;
62
63 try {
64 const data = JSON.parse(result.output);

Callers 1

setupAndStartMethod · 0.80

Calls 2

readLocalMethod · 0.95
registerMethod · 0.95

Tested by

no test coverage detected