Initial public release

This commit is contained in:
BB-fat
2026-06-22 17:36:26 +08:00
commit f1036a860c
289 changed files with 54589 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
// Central RpcError builders with stable `data.reason` values for CLI
// rendering. Extension handlers attach reasons here; human-facing copy
// lives in bsk-cli `render_error.rs`.
import type { ErrorCode, RpcError, RpcErrorData, RpcErrorReason } from "@/transport/types";
export type { RpcErrorData, RpcErrorReason };
export function rpcError(
code: ErrorCode,
reason: RpcErrorReason,
message: string,
extra?: Record<string, unknown>,
): RpcError {
const data: RpcErrorData = { reason, ...extra };
return { code, message, data };
}