{"_id":"@claw_wallet_sdk/claw_wallet","_rev":"3-a330f94a1a430cbe7b2921135f4d978c","name":"@claw_wallet_sdk/claw_wallet","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@claw_wallet_sdk/claw_wallet","version":"1.0.0","keywords":["claw","wallet","sandbox","openapi"],"author":{"name":"clawwallet"},"license":"ISC","_id":"@claw_wallet_sdk/claw_wallet@1.0.0","maintainers":[{"name":"zorrot_chen","email":"uizorrot@gmail.com"}],"homepage":"https://www.clawwallet.cc/","bugs":{"url":"https://github.com/BitsLabSec/claw_wallet_sdk/issues"},"dist":{"shasum":"af2714c7b250e3bcd88b2ef3f0e29c6f3ce0a1fe","tarball":"https://registry.npmjs.org/@claw_wallet_sdk/claw_wallet/-/claw_wallet-1.0.0.tgz","fileCount":32,"integrity":"sha512-qiCQHxYVjpwpWbIU1yj3Yb+4i1R24btCHbi0IKyOE6oUzcM9BZuseN6fJrpa4LYXlJcSPFteixrhDm0ad7ZowA==","signatures":[{"sig":"MEUCIHAadZ/qpbSWO0WPY4Nn7HsggoQ4MXCZ7ZU5gJdj0t8aAiEA0x7JL8aywMEl91EQHoRLn//pPdNZ2Ike6xOHvh/UHAw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":429340},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./sui":{"types":"./dist/sui.d.ts","import":"./dist/sui.js","default":"./dist/sui.js"},"./viem":{"types":"./dist/viem.d.ts","import":"./dist/viem.js","default":"./dist/viem.js"},"./ethers":{"types":"./dist/ethers.d.ts","import":"./dist/ethers.js","default":"./dist/ethers.js"},"./solana":{"types":"./dist/solana.d.ts","import":"./dist/solana.js","default":"./dist/solana.js"}},"gitHead":"46e89d8980265853934bf49168be20553eb81e52","scripts":{"build":"tsc","codegen":"openapi-typescript ../sandbox/openapi/openapi.yaml -o src/generated/paths.ts","test:all":"npm run test:fixtures && npm run test:unit && npm run test:openapi-public && npm run test:sandbox-readonly && npm run test:pack-consumer && npm run test:integration","test:unit":"npm run build && node test/unit.encoding.mjs && node test/unit.signing.mjs","test:fixtures":"npm run build && node test/lifecycle-fixtures.mjs","prepublishOnly":"npm run build && npm run test:unit && npm run test:pack-consumer","test:integration":"npm run build && node test/run-integration.mjs","test:pack-consumer":"npm run build && node test/pack-consumer.mjs","test:openapi-public":"node test/integration.openapi-public.mjs","test:sandbox-readonly":"npm run build && node test/integration.sandbox-readonly.mjs"},"_npmUser":{"name":"zorrot_chen","email":"uizorrot@gmail.com"},"repository":{"url":"git+https://github.com/BitsLabSec/claw_wallet_sdk.git","type":"git"},"_npmVersion":"11.4.2","description":"TypeScript SDK for the Claw Wallet sandbox HTTP API and signer adapters","directories":{"test":"test","example":"examples"},"_nodeVersion":"24.13.0","dependencies":{"openapi-fetch":"^0.17.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"viem":"^2.47.6","ethers":"^6.16.0","typescript":"^5.9.3","@mysten/sui":"^2.9.1","@solana/web3.js":"^1.98.4","openapi-typescript":"^7.13.0"},"peerDependencies":{"viem":"^2.21.0","ethers":"^6.14.0","@mysten/sui":"^2.9.1","@solana/web3.js":"^1.98.4"},"peerDependenciesMeta":{"viem":{"optional":true},"ethers":{"optional":true},"@mysten/sui":{"optional":true},"@solana/web3.js":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/claw_wallet_1.0.0_1774596885799_0.5069498975273805","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@claw_wallet_sdk/claw_wallet","version":"1.0.1","keywords":["claw","wallet","sandbox","openapi"],"author":{"name":"clawwallet"},"license":"ISC","_id":"@claw_wallet_sdk/claw_wallet@1.0.1","maintainers":[{"name":"zorrot_chen","email":"uizorrot@gmail.com"}],"homepage":"https://www.clawwallet.cc/","bugs":{"url":"https://github.com/BitsLabSec/claw_wallet_sdk/issues"},"dist":{"shasum":"858d69f1578c4d5644495452417986bf7d8a11b7","tarball":"https://registry.npmjs.org/@claw_wallet_sdk/claw_wallet/-/claw_wallet-1.0.1.tgz","fileCount":35,"integrity":"sha512-+TDHTNUW/4kGFxXSW2/60oFv8gXWVFHL7oRSGJAUiRAcrbN2xWgajNUYfgYbIwEeFai2ZJ9HC7wjBEEet0Jwkw==","signatures":[{"sig":"MEYCIQDWDULgQhS/mnWhsBGihq0akWlljAEQjp2tyNfvUgk+gQIhAMAVOJa6+mqmos70mSKBu0jdyBg7mkaiInd5HKjX0KNW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":433728},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./sui":{"types":"./dist/sui.d.ts","import":"./dist/sui.js","default":"./dist/sui.js"},"./viem":{"types":"./dist/viem.d.ts","import":"./dist/viem.js","default":"./dist/viem.js"},"./ethers":{"types":"./dist/ethers.d.ts","import":"./dist/ethers.js","default":"./dist/ethers.js"},"./solana":{"types":"./dist/solana.d.ts","import":"./dist/solana.js","default":"./dist/solana.js"}},"gitHead":"8ddaf7eb4a592bed526fc682943e95d1bc3b7206","scripts":{"build":"tsc","codegen":"openapi-typescript ../sandbox/openapi/openapi.yaml -o src/generated/paths.ts","test:all":"npm run test:fixtures && npm run test:unit && npm run test:openapi-public && npm run test:sandbox-readonly && npm run test:pack-consumer && npm run test:integration","test:unit":"npm run build && node test/unit.encoding.mjs && node test/unit.signing.mjs","test:fixtures":"npm run build && node test/lifecycle-fixtures.mjs","prepublishOnly":"npm run build && npm run test:unit && npm run test:pack-consumer","test:integration":"npm run build && node test/run-integration.mjs","test:pack-consumer":"npm run build && node test/pack-consumer.mjs","test:openapi-public":"node test/integration.openapi-public.mjs","test:sandbox-readonly":"npm run build && node test/integration.sandbox-readonly.mjs"},"_npmUser":{"name":"zorrot_chen","email":"uizorrot@gmail.com"},"repository":{"url":"git+https://github.com/BitsLabSec/claw_wallet_sdk.git","type":"git"},"_npmVersion":"11.4.2","description":"TypeScript SDK for the Claw Wallet sandbox HTTP API and signer adapters","directories":{"test":"test","example":"examples"},"_nodeVersion":"24.13.0","dependencies":{"openapi-fetch":"^0.17.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"viem":"^2.47.6","ethers":"^6.16.0","typescript":"^5.9.3","@mysten/sui":"^2.9.1","@solana/web3.js":"^1.98.4","openapi-typescript":"^7.13.0"},"peerDependencies":{"viem":"^2.21.0","ethers":"^6.14.0","@mysten/sui":"^2.9.1","@solana/web3.js":"^1.98.4"},"peerDependenciesMeta":{"viem":{"optional":true},"ethers":{"optional":true},"@mysten/sui":{"optional":true},"@solana/web3.js":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/claw_wallet_1.0.1_1775069033488_0.11917793512820452","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@claw_wallet_sdk/claw_wallet","version":"1.0.2","description":"TypeScript SDK for the Claw Wallet sandbox HTTP API and signer adapters","keywords":["claw","wallet","sandbox","openapi"],"homepage":"https://www.clawwallet.cc/","bugs":{"url":"https://github.com/BitsLabSec/claw_wallet_sdk/issues"},"repository":{"type":"git","url":"git+https://github.com/BitsLabSec/claw_wallet_sdk.git"},"license":"ISC","author":{"name":"clawwallet"},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./solana":{"types":"./dist/solana.d.ts","import":"./dist/solana.js","default":"./dist/solana.js"},"./sui":{"types":"./dist/sui.d.ts","import":"./dist/sui.js","default":"./dist/sui.js"},"./viem":{"types":"./dist/viem.d.ts","import":"./dist/viem.js","default":"./dist/viem.js"},"./ethers":{"types":"./dist/ethers.d.ts","import":"./dist/ethers.js","default":"./dist/ethers.js"}},"main":"./dist/index.js","types":"./dist/index.d.ts","directories":{"example":"examples","test":"test"},"scripts":{"codegen":"openapi-typescript ../sandbox/openapi/openapi.yaml -o src/generated/paths.ts","build":"tsc","test:fixtures":"npm run build && node test/lifecycle-fixtures.mjs","test:unit":"npm run build && node test/unit.encoding.mjs && node test/unit.signing.mjs && node test/unit.evm-adapters.mjs","test:openapi-public":"node test/integration.openapi-public.mjs","test:sandbox-readonly":"npm run build && node test/integration.sandbox-readonly.mjs","test:integration":"npm run build && node test/run-integration.mjs","test:pack-consumer":"npm run build && node test/pack-consumer.mjs","test:all":"npm run test:fixtures && npm run test:unit && npm run test:openapi-public && npm run test:sandbox-readonly && npm run test:pack-consumer && npm run test:integration","prepublishOnly":"npm run build && npm run test:unit && npm run test:pack-consumer"},"dependencies":{"openapi-fetch":"^0.17.0"},"devDependencies":{"@mysten/sui":"^2.9.1","@solana/web3.js":"^1.98.4","ethers":"^6.16.0","openapi-typescript":"^7.13.0","typescript":"^5.9.3","viem":"^2.47.6"},"peerDependencies":{"@mysten/sui":"^2.9.1","@solana/web3.js":"^1.98.4","ethers":"^6.14.0","viem":"^2.21.0"},"peerDependenciesMeta":{"@mysten/sui":{"optional":true},"@solana/web3.js":{"optional":true},"ethers":{"optional":true},"viem":{"optional":true}},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"_id":"@claw_wallet_sdk/claw_wallet@1.0.2","gitHead":"8ddaf7eb4a592bed526fc682943e95d1bc3b7206","_nodeVersion":"24.13.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-FSBEs6tgslDQIl47h7QFWxKsxgui2aG0dGodgRCvglq+fPkbYpVbI4WwkoghudPss2tWPDw/mVOqKYwh03g+pQ==","shasum":"8a8a71a57043c4a7e885e31cf5ecedfb8cc31551","tarball":"https://registry.npmjs.org/@claw_wallet_sdk/claw_wallet/-/claw_wallet-1.0.2.tgz","fileCount":35,"unpackedSize":434118,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIE4PBnfPQaVgJzrHZurBnPQZSPaM4BktBtubvxoIV64wAiBtlUGPCWrXZA2AF6/cupvMGnm10fz1ej3ByM0Wo/X/Zg=="}]},"_npmUser":{"name":"zorrot_chen","email":"uizorrot@gmail.com"},"maintainers":[{"name":"zorrot_chen","email":"uizorrot@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/claw_wallet_1.0.2_1775109452080_0.12668331570601588"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-27T07:34:45.697Z","modified":"2026-04-02T05:57:32.313Z","1.0.0":"2026-03-27T07:34:45.966Z","1.0.1":"2026-04-01T18:43:53.617Z","1.0.2":"2026-04-02T05:57:32.205Z"},"bugs":{"url":"https://github.com/BitsLabSec/claw_wallet_sdk/issues"},"author":{"name":"clawwallet"},"license":"ISC","homepage":"https://www.clawwallet.cc/","keywords":["claw","wallet","sandbox","openapi"],"repository":{"type":"git","url":"git+https://github.com/BitsLabSec/claw_wallet_sdk.git"},"description":"TypeScript SDK for the Claw Wallet sandbox HTTP API and signer adapters","maintainers":[{"name":"zorrot_chen","email":"uizorrot@gmail.com"}],"readme":"# @claw_wallet_sdk/claw_wallet\n\nTypeScript SDK for the Claw Wallet sandbox.\n\nThis package provides:\n\n- a typed HTTP client for the live sandbox OpenAPI\n- signer and account adapters for `ethers`, `viem`, `@solana/web3.js`, and `@mysten/sui`\n\n## Install\n\n```bash\nnpm install @claw_wallet_sdk/claw_wallet\n```\n\nInstall optional peers **only for the adapters you import**:\n\n```bash\nnpm install ethers          # for `@claw_wallet_sdk/claw_wallet/ethers`\nnpm install viem            # for `@claw_wallet_sdk/claw_wallet/viem`\nnpm install @solana/web3.js # for `@claw_wallet_sdk/claw_wallet/solana`\nnpm install @mysten/sui     # for `@claw_wallet_sdk/claw_wallet/sui`\n```\n\nThe main entry (`@claw_wallet_sdk/claw_wallet`) only loads `openapi-fetch`; it does **not** pull viem/ethers/Solana/Sui at runtime.\n\n## Import boundaries\n\nUse the root entry only for core SDK functionality:\n\n```ts\nimport {\n  createClawWalletClient,\n  ClawSandboxClient,\n  buildPersonalSignBody,\n} from \"@claw_wallet_sdk/claw_wallet\";\n```\n\nUse subpath imports for chain adapters:\n\n```ts\nimport { ClawEthersSigner } from \"@claw_wallet_sdk/claw_wallet/ethers\";\nimport { createClawAccountFromSandbox } from \"@claw_wallet_sdk/claw_wallet/viem\";\nimport { ClawSolanaSigner } from \"@claw_wallet_sdk/claw_wallet/solana\";\nimport { ClawSuiSigner } from \"@claw_wallet_sdk/claw_wallet/sui\";\n```\n\nThis is an intentional breaking change from earlier in-repo revisions that re-exported adapters from the root entry.\n\n## Core client\n\n```ts\nimport { createClawWalletClient } from \"@claw_wallet_sdk/claw_wallet\";\n\nconst client = createClawWalletClient({\n  baseUrl: process.env.CLAY_SANDBOX_URL!,\n  agentToken: process.env.CLAY_AGENT_TOKEN,\n});\n\nconst { data } = await client.GET(\"/api/v1/wallet/status\", {});\n```\n\n## Sandbox helper client\n\n```ts\nimport { ClawSandboxClient } from \"@claw_wallet_sdk/claw_wallet\";\n\nconst sandbox = new ClawSandboxClient({\n  uid: process.env.CLAY_UID!,\n  sandboxUrl: process.env.CLAY_SANDBOX_URL!,\n  sandboxToken: process.env.CLAY_AGENT_TOKEN!,\n});\n\nconst status = await sandbox.getStatus();\nconst ready = await sandbox.reactivateWallet();\nconst policy = await sandbox.getLocalPolicy();\nconst assets = await sandbox.getAssets();\nconst history = await sandbox.getHistory({ chain: \"ethereum\", limit: 20 });\nawait sandbox.refreshWallet();\n```\n\nHigh-frequency helper methods currently include:\n\n- `getStatus()`\n- `initWallet()`\n- `unlockWallet()`\n- `reactivateWallet()`\n- `refreshWallet()`\n- `getAssets()`\n- `getHistory()`\n- `getLocalPolicy()`\n- `sign()`\n- `broadcast()`\n- `transfer()`\n\n## Wallet lifecycle\n\n```ts\nimport { ClawSandboxClient } from \"@claw_wallet_sdk/claw_wallet\";\n\nconst sandbox = new ClawSandboxClient({\n  uid: process.env.CLAY_UID!,\n  sandboxUrl: process.env.CLAY_SANDBOX_URL!,\n  sandboxToken: process.env.CLAY_AGENT_TOKEN!,\n});\n\nawait sandbox.initWallet({ master_pin: \"123456\" });\n\n// For provisioned/imported wallets that require a PIN:\nawait sandbox.unlockWallet({ pin: \"123456\" });\n\n// For locally initialized wallets with a persisted local SEK:\nawait sandbox.reactivateWallet();\n```\n\n## Ethers signer\n\n```ts\nimport { JsonRpcProvider } from \"ethers\";\nimport { ClawEthersSigner } from \"@claw_wallet_sdk/claw_wallet/ethers\";\n\nconst signer = new ClawEthersSigner(\n  {\n    uid: process.env.CLAY_UID!,\n    sandboxUrl: process.env.CLAY_SANDBOX_URL!,\n    sandboxToken: process.env.CLAY_AGENT_TOKEN!,\n  },\n  new JsonRpcProvider(process.env.RPC_URL!),\n);\n```\n\n## Viem account\n\n```ts\nimport { createClawAccountFromSandbox } from \"@claw_wallet_sdk/claw_wallet/viem\";\n\nconst account = await createClawAccountFromSandbox({\n  uid: process.env.CLAY_UID!,\n  sandboxUrl: process.env.CLAY_SANDBOX_URL!,\n  sandboxToken: process.env.CLAY_AGENT_TOKEN!,\n});\n```\n\n## Solana signer\n\n```ts\nimport { ClawSolanaSigner } from \"@claw_wallet_sdk/claw_wallet/solana\";\n\nconst signer = await ClawSolanaSigner.fromSandbox({\n  uid: process.env.CLAY_UID!,\n  sandboxUrl: process.env.CLAY_SANDBOX_URL!,\n  sandboxToken: process.env.CLAY_AGENT_TOKEN!,\n});\n\nconst signed = await signer.signMessage(new Uint8Array([1, 2, 3]));\n```\n\n## Sui signer\n\n```ts\nimport { ClawSuiSigner } from \"@claw_wallet_sdk/claw_wallet/sui\";\n\nconst signer = await ClawSuiSigner.fromSandbox({\n  uid: process.env.CLAY_UID!,\n  sandboxUrl: process.env.CLAY_SANDBOX_URL!,\n  sandboxToken: process.env.CLAY_AGENT_TOKEN!,\n});\n\nconst signed = await signer.signPersonalMessage(new Uint8Array([1, 2, 3]));\n```\n\n### Sui `personal_sign` sandbox semantics\n\nThe sandbox currently uses a Claw-specific verification flow for Sui `personal_sign`:\n\n- if the provided message bytes do not already start with the Sui personal-message intent prefix, the sandbox prepends `0x03 0x00 0x00`\n- it computes `blake2b-256` over that prefixed payload\n- it signs the digest with the wallet's Ed25519 key\n- the SDK serializes the returned signature as `flag || rawSignature || rawPublicKey`, where `flag=0x00` for Ed25519\n\nThat means `ClawSuiSigner.signPersonalMessage()` is aligned with sandbox behavior, not with every generic Mysten helper's default assumptions for plain message verification.\n\nFor Sui transaction bytes, the sandbox signs `blake2b-256(txBytes)` without adding the `personal_sign` intent prefix.\n\n## Verifying packaging locally\n\nAfter `npm run build`, run `npm run test:pack-consumer` to simulate `npm pack` + a clean consumer project: core import with **no** viem/ethers/Solana/Sui installed, then each subpath after installing the matching peer.\n\n## Migration\n\nIf existing code imports adapters from the root entry, change them to subpath imports:\n\n```ts\n// before\nimport { ClawEthersSigner, createClawAccountFromSandbox } from \"@claw_wallet_sdk/claw_wallet\";\n\n// after\nimport { ClawEthersSigner } from \"@claw_wallet_sdk/claw_wallet/ethers\";\nimport { createClawAccountFromSandbox } from \"@claw_wallet_sdk/claw_wallet/viem\";\n```\n\n## Notes\n\n- The sandbox still writes `CLAY_*` environment variables today. That is a sandbox compatibility detail, not SDK naming guidance. If you just don't know how to get environment variables, find it on your sandbox dir, or ask your agent.\n- Public API naming in this package should use `claw`, not `clay`.\n- The sandbox must already be initialized and unlocked before signing flows succeed.\n","readmeFilename":"README.md"}