INNER CODE UNIT · TypeScript

writePrivateJsonSync

BlockRunAI/ClawRouter · src/index.ts:106

function writePrivateJsonSync(path: string, value: unknown): void {
  const temporary = `${path}.tmp.${randomUUID()}`;
  try {
    writeFileSync(temporary, JSON.stringify(value, null, 2), { mode: 0o600 });
    renameSync(temporary, path);
    chmodSync(path, 0o600);
  } finally {
    if (existsSync(temporary)) unlinkSync(temporary);
  }
}

function hasConfiguredWallet(): boolean {
  return Boolean(
    process["env"].BLOCKRUN_WALLET_KEY || existsSync(CORE_WALLET_FILE) || existsSync(WALLET_FILE),
  );
}

/**

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…