{"_id":"@bytesbrains/maktub-sdk","_rev":"9-0141eda5dd5ad8a5dc09f785a4bebbde","name":"@bytesbrains/maktub-sdk","dist-tags":{"dev":"0.1.0-dev.5","latest":"0.1.0-dev.5"},"versions":{"0.1.0-dev.1":{"name":"@bytesbrains/maktub-sdk","version":"0.1.0-dev.1","keywords":["maktub","heartbeat","conditional-execution","base","ethereum","sdk"],"author":{"name":"BytesBrains"},"license":"MIT","_id":"@bytesbrains/maktub-sdk@0.1.0-dev.1","maintainers":[{"name":"nandal","email":"sandeep@nandal.in"}],"homepage":"https://maktub.it","bugs":{"url":"https://github.com/bytesbrains/maktub/issues"},"dist":{"shasum":"2a5cf2c0e289aa1da9338d4077add3882ea77bc5","tarball":"https://registry.npmjs.org/@bytesbrains/maktub-sdk/-/maktub-sdk-0.1.0-dev.1.tgz","fileCount":220,"integrity":"sha512-bD9LPYetvcUaFB4ov6IkSG4Zm3jDatlpWYe6028i/6l4isD8Flqgs0AByZYPNKwa3BHdRtsjNVPFnqygz+gleg==","signatures":[{"sig":"MEUCIQDnL7zPhWXm8aps/hsU3EVh84Qw4M324lgBCoYlg4lXKQIgIeSSbrkJbLPiAt8mtgOBjWNUJTKy7w/r0Ah0BKpoWwI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1095277},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18"},"gitHead":"797b6f084947fb171bd1ecbf27d9851800700e76","scripts":{"test":"vitest run","build":"tsc && npm run copy:wasm","clean":"rm -rf dist","copy:wasm":"mkdir -p dist/veil/wasm && cp src/veil/wasm/warden_wasm.js src/veil/wasm/warden_wasm_bg.wasm src/veil/wasm/warden_wasm.d.ts src/veil/wasm/warden_wasm_bg.wasm.d.ts dist/veil/wasm/","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"nandal","email":"sandeep@nandal.in"},"deprecated":"Superseded by 0.1.0-dev.2 — rebuilt wasm without local build paths; please upgrade.","repository":{"url":"git+https://github.com/bytesbrains/maktub.git","type":"git","directory":"sdk"},"_npmVersion":"11.3.0","description":"TypeScript SDK for the Maktub Protocol — decentralized conditional execution engine on Base L2","directories":{},"_nodeVersion":"24.2.0","_hasShrinkwrap":false,"devDependencies":{"ethers":"^6.13.0","vitest":"^4.1.9","typescript":"^5.4.0"},"peerDependencies":{"ethers":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/maktub-sdk_0.1.0-dev.1_1782237088472_0.14349255171617115","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-dev.2":{"name":"@bytesbrains/maktub-sdk","version":"0.1.0-dev.2","keywords":["maktub","heartbeat","conditional-execution","base","ethereum","sdk"],"author":{"name":"BytesBrains"},"license":"MIT","_id":"@bytesbrains/maktub-sdk@0.1.0-dev.2","maintainers":[{"name":"nandal","email":"sandeep@nandal.in"}],"homepage":"https://maktub.it","bugs":{"url":"https://github.com/bytesbrains/maktub/issues"},"dist":{"shasum":"ca99c1b54ca4bdf829279585d79b678ff468f55b","tarball":"https://registry.npmjs.org/@bytesbrains/maktub-sdk/-/maktub-sdk-0.1.0-dev.2.tgz","fileCount":220,"integrity":"sha512-AbQ/O84z9PGA4xTAGJeQQ3Nof87bxi/Kv2PiiIC7E3s0EDdjQpOQtpv2BI/QP1KvRIuvHDQkUbIWdaQZKVC3LA==","signatures":[{"sig":"MEQCIBc58n15C7maXtPEKEJDP2x8C8HavuWmFCIBMNCru37sAiBzdp+xQ3qHNp4/kmEs0B+UXns26/U9WXDJGtqpum3dPQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1132999},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18"},"gitHead":"cdcd0426f7ab5706afe8c3e7986769de00191896","scripts":{"test":"vitest run","build":"tsc && npm run copy:wasm","clean":"rm -rf dist","copy:wasm":"mkdir -p dist/veil/wasm && cp src/veil/wasm/warden_wasm.js src/veil/wasm/warden_wasm_bg.wasm src/veil/wasm/warden_wasm.d.ts src/veil/wasm/warden_wasm_bg.wasm.d.ts dist/veil/wasm/","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"nandal","email":"sandeep@nandal.in"},"repository":{"url":"git+https://github.com/bytesbrains/maktub.git","type":"git","directory":"sdk"},"_npmVersion":"11.3.0","description":"TypeScript SDK for the Maktub Protocol — decentralized conditional execution engine on Base L2","directories":{},"_nodeVersion":"24.2.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ethers":"^6.13.0","vitest":"^4.1.9","typescript":"^5.4.0"},"peerDependencies":{"ethers":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/maktub-sdk_0.1.0-dev.2_1782244464785_0.49802763233847114","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-dev.3":{"name":"@bytesbrains/maktub-sdk","version":"0.1.0-dev.3","keywords":["maktub","heartbeat","conditional-execution","base","ethereum","sdk"],"author":{"name":"BytesBrains"},"license":"MIT","_id":"@bytesbrains/maktub-sdk@0.1.0-dev.3","maintainers":[{"name":"nandal","email":"sandeep@nandal.in"}],"homepage":"https://maktub.it","bugs":{"url":"https://github.com/bytesbrains/maktub/issues"},"dist":{"shasum":"29c6fee91b3e42efef737fd5a40e4602c338a52d","tarball":"https://registry.npmjs.org/@bytesbrains/maktub-sdk/-/maktub-sdk-0.1.0-dev.3.tgz","fileCount":221,"integrity":"sha512-PtahEiAasXieRxza+V9yjciCmMskgPK7YqGielwI0FAGqdvd8Uv+B4oWYOOAI024Al0ifAit9b/xe+GCNyB5YA==","signatures":[{"sig":"MEUCIQDXRBh8PmENtNI1ErLojQMU28Pv+Gjvnyhae5B+3J+iwgIgeRWHoZUwkgJ+oKT3FZVRg0Y3/cO4YTIKl+TqV+tc1z4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1134331},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18"},"gitHead":"2f7febbb6e805eae60b1c69aea4d61bb5ea2c6f8","scripts":{"test":"vitest run","build":"tsc && npm run copy:wasm","clean":"rm -rf dist","copy:wasm":"mkdir -p dist/veil/wasm && cp src/veil/wasm/warden_wasm.js src/veil/wasm/warden_wasm_bg.wasm src/veil/wasm/warden_wasm.d.ts src/veil/wasm/warden_wasm_bg.wasm.d.ts dist/veil/wasm/","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"nandal","email":"sandeep@nandal.in"},"repository":{"url":"git+https://github.com/bytesbrains/maktub.git","type":"git","directory":"sdk"},"_npmVersion":"11.3.0","description":"TypeScript SDK for the Maktub Protocol — decentralized conditional execution engine on Base L2","directories":{},"_nodeVersion":"24.2.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ethers":"^6.13.0","vitest":"^4.1.9","typescript":"^5.4.0"},"peerDependencies":{"ethers":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/maktub-sdk_0.1.0-dev.3_1782283575563_0.948126057144643","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-dev.4":{"name":"@bytesbrains/maktub-sdk","version":"0.1.0-dev.4","keywords":["maktub","heartbeat","conditional-execution","base","ethereum","sdk"],"author":{"name":"BytesBrains"},"license":"MIT","_id":"@bytesbrains/maktub-sdk@0.1.0-dev.4","maintainers":[{"name":"nandal","email":"sandeep@nandal.in"}],"homepage":"https://maktub.it","bugs":{"url":"https://github.com/bytesbrains/maktub/issues"},"dist":{"shasum":"527681278ac0863671a615723c15de264afd1123","tarball":"https://registry.npmjs.org/@bytesbrains/maktub-sdk/-/maktub-sdk-0.1.0-dev.4.tgz","fileCount":222,"integrity":"sha512-MYuqUkrAYOz4BoT7eWUrNdQCYMqZqGlG7iaGBKNMyHhwoBhd95iKkI9vQXP0BpsoC3sVP1lr4tV7jczjC/pM9Q==","signatures":[{"sig":"MEUCIG4y9BkJnP6Rmp207a1h2GikoMZYvPhkOcqFhcAaA4FUAiEAk0mLhm52Ye5Jdu1WNm6aj+M+ocXypptBgzoIt1PWG+k=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bytesbrains%2fmaktub-sdk@0.1.0-dev.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1138938},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18"},"gitHead":"a93101a6c03bf84842b5855bc3fbefa1ed329451","scripts":{"test":"vitest run","build":"tsc && npm run copy:wasm && npm run copy:vectors","clean":"rm -rf dist vectors","copy:wasm":"mkdir -p dist/veil/wasm && cp src/veil/wasm/warden_wasm.js src/veil/wasm/warden_wasm_bg.wasm src/veil/wasm/warden_wasm.d.ts src/veil/wasm/warden_wasm_bg.wasm.d.ts dist/veil/wasm/","typecheck":"tsc --noEmit","test:watch":"vitest","copy:vectors":"mkdir -p vectors && cp ../vectors/reading-key.json vectors/","prepublishOnly":"npm run clean && npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:70fb809f-90b4-4671-8440-426a870ea3ae"}},"repository":{"url":"git+https://github.com/bytesbrains/maktub.git","type":"git","directory":"sdk"},"_npmVersion":"12.0.1","description":"TypeScript SDK for the Maktub Protocol — decentralized conditional execution engine on Base L2","directories":{},"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ethers":"^6.13.0","vitest":"^4.1.9","typescript":"^5.4.0"},"peerDependencies":{"ethers":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/maktub-sdk_0.1.0-dev.4_1785272452913_0.5602277740885242","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-dev.5":{"name":"@bytesbrains/maktub-sdk","version":"0.1.0-dev.5","keywords":["maktub","heartbeat","conditional-execution","base","ethereum","sdk"],"author":{"name":"BytesBrains"},"license":"MIT","_id":"@bytesbrains/maktub-sdk@0.1.0-dev.5","maintainers":[{"name":"nandal","email":"sandeep@nandal.in"}],"homepage":"https://maktub.it","bugs":{"url":"https://github.com/bytesbrains/maktub/issues"},"dist":{"shasum":"4aa4cc0a0ace0f8e9890564097b71e0daaacf933","tarball":"https://registry.npmjs.org/@bytesbrains/maktub-sdk/-/maktub-sdk-0.1.0-dev.5.tgz","fileCount":440,"integrity":"sha512-wzFAaWyazGmtxLy91gKg8kPECxZFS/6D6IjheAzfHJfOJs8qNjkZBWQKuCPDasU1yBo5XApeH8avL/1xEoaAZg==","signatures":[{"sig":"MEQCIEVbgRpbnzVdwq+nLnfiza7VhEqR/93jzL2oZa8tlAKFAiBzpFkbHVdPz1F4CODJu3XoJqJNFnHzU5hZbBTOJvBXkA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bytesbrains%2fmaktub-sdk@0.1.0-dev.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1506578},"main":"./dist/cjs/index.js","types":"./dist/cjs/index.d.ts","module":"./dist/esm/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}},"./veil":{"types":"./dist/cjs/veil/veil.d.ts","default":"./dist/cjs/veil/veil.js"},"./crypto":{"import":{"types":"./dist/esm/crypto/index.d.ts","default":"./dist/esm/crypto/index.js"},"require":{"types":"./dist/cjs/crypto/index.d.ts","default":"./dist/cjs/crypto/index.js"}},"./vectors/*":"./vectors/*","./package.json":"./package.json","./deployments/*":"./deployments/*"},"gitHead":"9202fe8b3ea185967397cd5fc809bcd952250a81","scripts":{"test":"vitest run","build":"npm run build:esm && npm run build:cjs && npm run finalize:dist && npm run copy:wasm && npm run copy:vectors && npm run verify:packaging","clean":"rm -rf dist vectors","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json","copy:wasm":"mkdir -p dist/cjs/veil/wasm && cp src/veil/wasm/warden_wasm.js src/veil/wasm/warden_wasm_bg.wasm src/veil/wasm/warden_wasm.d.ts src/veil/wasm/warden_wasm_bg.wasm.d.ts dist/cjs/veil/wasm/","typecheck":"tsc --noEmit","test:watch":"vitest","copy:vectors":"mkdir -p vectors && cp ../vectors/reading-key.json vectors/","finalize:dist":"node scripts/finalize-dist.mjs","prepublishOnly":"npm run clean && npm run build","verify:packaging":"node scripts/verify-packaging.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:70fb809f-90b4-4671-8440-426a870ea3ae"}},"repository":{"url":"git+https://github.com/bytesbrains/maktub.git","type":"git","directory":"sdk"},"_npmVersion":"12.0.1","description":"TypeScript SDK for the Maktub Protocol — decentralized conditional execution engine on Base L2","directories":{},"sideEffects":["./dist/cjs/veil/wasm/warden_wasm.js"],"_nodeVersion":"22.23.1","dependencies":{"@noble/curves":"^1.2.0","@noble/hashes":"^1.3.2"},"_hasShrinkwrap":false,"devDependencies":{"ethers":"^6.13.0","vitest":"^4.1.9","typescript":"^5.4.0"},"peerDependencies":{"ethers":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/maktub-sdk_0.1.0-dev.5_1785278364587_0.7891428819375215","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-06-23T17:51:28.306Z","modified":"2026-07-28T22:42:45.938Z","0.1.0-dev.1":"2026-06-23T17:51:28.654Z","0.1.0-dev.2":"2026-06-23T19:54:24.935Z","0.1.0-dev.3":"2026-06-24T06:46:15.706Z","0.1.0-dev.4":"2026-07-28T21:00:53.129Z","0.1.0-dev.5":"2026-07-28T22:39:24.729Z"},"bugs":{"url":"https://github.com/bytesbrains/maktub/issues"},"author":{"name":"BytesBrains"},"license":"MIT","homepage":"https://maktub.it","keywords":["maktub","heartbeat","conditional-execution","base","ethereum","sdk"],"repository":{"url":"git+https://github.com/bytesbrains/maktub.git","type":"git","directory":"sdk"},"description":"TypeScript SDK for the Maktub Protocol — decentralized conditional execution engine on Base L2","maintainers":[{"name":"nandal","email":"sandeep@nandal.in"}],"readme":"# @bytesbrains/maktub-sdk\n\nTypeScript SDK for the Maktub Protocol v3 — a decentralized conditional execution engine on Base L2.\n\n## Installation\n\n```bash\nnpm install @bytesbrains/maktub-sdk ethers\n```\n\nRequires `ethers` v6 as a peer dependency.\n\n## Entry points\n\nThe package ships both ESM and CommonJS, and is split so you can take only the\npart you need.\n\n| Import | Contains | Pulls in |\n|---|---|---|\n| `@bytesbrains/maktub-sdk` | `MaktubClient`, contract wrappers, crypto, types, errors | `ethers` |\n| `@bytesbrains/maktub-sdk/crypto` | Reading-key derivation, ECIES, hybrid envelope | `@noble/*` only |\n| `@bytesbrains/maktub-sdk/veil` | Veil — time-confidential Beats (**preview**) | WebAssembly; **Node only** |\n\n```ts\n// Everything.\nimport { MaktubClient } from \"@bytesbrains/maktub-sdk\";\n\n// Just the crypto — no ethers, no WASM.\nimport { deriveReadingKeyFromPrfOutput } from \"@bytesbrains/maktub-sdk/crypto\";\n```\n\n**Browser clients should import from `/crypto`.** It has no WebAssembly\nanywhere in its module graph, which means the origin doing key derivation does\nnot need `wasm-unsafe-eval` in its CSP and can keep `script-src 'self'`. That\nmatters more than the bundle size: a reading key is long-lived and its published\nhalf is write-once, so a single injected script that reads it decrypts\neverything that user has ever received, with no way to rotate.\n\n`/veil` is Node-only by construction — its pairing crypto is wasm-bindgen glue\nbuilt for the nodejs target, which reads the `.wasm` off disk at import time.\n\nTwo data files are also published, for language ports and for downstreams that\nregenerate their own constants:\n\n```js\nrequire(\"@bytesbrains/maktub-sdk/vectors/reading-key.json\");        // cross-language vectors\nrequire(\"@bytesbrains/maktub-sdk/deployments/base-sepolia.json\");   // address carrier\n```\n\n## Quick Start\n\n```typescript\nimport { MaktubClient } from \"@bytesbrains/maktub-sdk\";\nimport { BrowserProvider } from \"ethers\";\n\n// Connect via browser wallet\nconst browserProvider = new BrowserProvider(window.ethereum);\nconst signer = await browserProvider.getSigner();\n\nconst maktub = new MaktubClient({ provider: browserProvider, signer });\n\n// Create a heartbeat with 180-day interval\nconst { heartbeatId } = await maktub.createHeartbeat({\n  recipients: [\"0xRecipient1...\", \"0xRecipient2...\"],\n  payload: \"0x...\", // IPFS CID as bytes\n  interval: 180 * 24 * 3600, // 180 days in seconds\n});\n\n// Check in to reset the timer (free, gas only)\nawait maktub.checkIn(heartbeatId);\n\n// Query heartbeat status\nconst info = await maktub.getHeartbeat(heartbeatId);\nconst remaining = await maktub.timeRemaining(heartbeatId);\nconst expired = await maktub.isExpired(heartbeatId);\n```\n\n## Core Concepts\n\n**Heartbeat** — the protocol's single primitive: `Recipients + Payload + Timer = Heartbeat`. If the owner doesn't check in within the specified interval, the encrypted payload becomes decryptable by recipients.\n\n## API Reference\n\n### MaktubClient\n\nThe high-level client wrapping all protocol interactions.\n\n#### Heartbeat Operations\n\n| Method | Description |\n|---|---|\n| `createHeartbeat(params)` | Create a new heartbeat (small one-time fee, in ETH) |\n| `checkIn(id)` | Reset the timer (free) |\n| `execute(id)` | Execute an expired heartbeat (executor only) |\n| `getHeartbeat(id)` | Get heartbeat data |\n| `timeRemaining(id)` | Seconds until expiration |\n| `isExpired(id)` | Check if timer has expired |\n| `updateRecipients(id, recipients)` | Update recipient list |\n| `updateInterval(id, interval)` | Update check-in interval |\n| `deactivate(id)` | Permanently deactivate |\n\n#### Recipient Operations\n\n| Method | Description |\n|---|---|\n| `registerRecipient(prePublicKey)` | Register as a recipient with an ECIES secp256k1 public key (the `prePublicKey` arg is named for legacy reasons) |\n| `updatePrePublicKey(newKey)` | Rotate the caller's ECIES public key |\n| `isRecipientRegistered(account)` | Check registration status |\n| `getPrePublicKey(account)` | Get recipient's ECIES public key |\n\n#### Executor & Staking\n\n| Method | Description |\n|---|---|\n| `stakeForExecution(amount)` | Stake MKTB to become executor |\n| `unstake(amount)` | Withdraw staked MKTB |\n| `isActiveExecutor(account)` | Check executor status |\n| `getExecutorInfo(account)` | Get staking and reward info |\n| `getEmissionInfo()` | Get emission schedule data |\n\n#### Token & Governance\n\n| Method | Description |\n|---|---|\n| `balanceOf(account)` | Get MKTB balance |\n| `approve(spender, amount)` | Approve MKTB spending |\n| `delegateVotes(delegatee)` | Delegate voting power |\n| `propose(targets, values, calldatas, desc)` | Create governance proposal |\n| `castVote(proposalId, support)` | Vote on proposal |\n\n### Direct Contract Access\n\nFor advanced usage, access individual contract wrappers directly:\n\n```typescript\nconst maktub = new MaktubClient({ provider, signer });\n\n// Access underlying typed contract wrappers\nmaktub.core       // MaktubCoreContract\nmaktub.registry   // RecipientRegistryContract\nmaktub.token      // MktbTokenContract\nmaktub.rewards    // ExecutorRewardsContract\nmaktub.governance // MktbGovernanceContract\n\n// Access raw ethers Contract for custom calls\nmaktub.core.contract.on(\"HeartbeatCreated\", (id, owner, recipients, interval) => {\n  console.log(`New heartbeat #${id} by ${owner}`);\n});\n```\n\n### Custom Addresses\n\nFor local development or custom deployments:\n\n```typescript\nconst maktub = new MaktubClient({\n  provider,\n  signer,\n  addresses: {\n    maktubCore: \"0x...\",\n    recipientRegistry: \"0x...\",\n    mktbToken: \"0x...\",\n    executorRewards: \"0x...\",\n    mktbGovernance: \"0x...\",\n  },\n});\n```\n\n## Supported Networks\n\n| Network | Chain ID | Status |\n|---|---|---|\n| Base Mainnet | 8453 | Pending deployment |\n| Base Sepolia | 84532 | Pending deployment |\n| Localhost | 31337 | Development |\n\n## License\n\nMIT\n","readmeFilename":"README.md"}