The sandbox `sign` method accepts the same request shape the API uses. For user-facing text signing, prefer `buildPersonalSignBody`. For transaction signing, send a structured request and keep `confirmed_by_user` explicit when the flow requires it.
import { ClawSandboxClient, buildPersonalSignBody } from "@claw_wallet_sdk/claw_wallet";
const sandbox = new ClawSandboxClient({ uid, sandboxUrl, sandboxToken });
const personalBody = buildPersonalSignBody({
uid,
chain: "ethereum",
message: "I confirm this action",
});
const signature = await sandbox.sign(personalBody);
const txResult = await sandbox.sign({
uid,
chain: "ethereum",
sign_mode: "transaction",
confirmed_by_user: true,
builder_kind: "native_transfer",
to: "0x1234567890abcdef1234567890abcdef12345678",
amount_wei: "50000000000000000",
data: "0x",
});
Raw hash signing exists, but the sandbox may reject it by policy design. Treat `raw_hash` as a special case, not the default path.