{"_id":"@carnot-zk/sdk","_rev":"4-0ca745e34f77d34c5d8f5b9faa47e6ae","name":"@carnot-zk/sdk","dist-tags":{"latest":"0.1.7"},"versions":{"0.1.4":{"name":"@carnot-zk/sdk","version":"0.1.4","_id":"@carnot-zk/sdk@0.1.4","maintainers":[{"name":"startup-dreamer","email":"prsumit35@gmail.com"}],"dist":{"shasum":"ea326539080d948eded32a44af34e5076b16f84f","tarball":"https://registry.npmjs.org/@carnot-zk/sdk/-/sdk-0.1.4.tgz","fileCount":26,"integrity":"sha512-Kc/afhKzexE+Mj6lCjE9hjB819d9CFulNqU1vYDdjS+zh0SXHGEVi5OBx+UDrMFyGY8cpJpHsKL+TLHHCrtfJg==","signatures":[{"sig":"MEUCIQDS/N0jPnvRRQVvOk5rsm0tmHiVyJM0bSGhypD6WhsrYAIgFy+WsjTqnIniuR+1gFaTY8IeLam3Kuf0MHRlTeKCeUA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":682409},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./idl":{"types":"./dist/idl/index.d.ts","import":"./dist/idl/index.mjs","require":"./dist/idl/index.js"},"./pda":{"types":"./dist/pda/index.d.ts","import":"./dist/pda/index.mjs","require":"./dist/pda/index.js"},"./constants":{"types":"./dist/constants/index.d.ts","import":"./dist/constants/index.mjs","require":"./dist/constants/index.js"}},"gitHead":"52b6b501369fb135830704f7e949fb9cc5fea238","scripts":{"dev":"tsup --watch","lint":"eslint src --ext .ts","build":"tsup","typecheck":"tsc --noEmit","prepublishOnly":"yarn build"},"_npmUser":{"name":"startup-dreamer","email":"prsumit35@gmail.com"},"_npmVersion":"10.9.4","description":"Shared types, Anchor IDLs, PDA helpers, and constants for the Carnot platform","directories":{},"_nodeVersion":"22.21.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.3.0","@types/node":"^20.0.0","@solana/web3.js":"^1.91.0"},"peerDependencies":{"@solana/web3.js":"^1.91.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.4_1778138703985_0.09444082918461705","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@carnot-zk/sdk","version":"0.1.5","_id":"@carnot-zk/sdk@0.1.5","maintainers":[{"name":"startup-dreamer","email":"prsumit35@gmail.com"}],"dist":{"shasum":"264b724ec591778f02aed96d35253bebb7a9be73","tarball":"https://registry.npmjs.org/@carnot-zk/sdk/-/sdk-0.1.5.tgz","fileCount":26,"integrity":"sha512-YPj1IiIpip3BtjG1mq3kAzYytP2cbQVV4lm+i8VSGcwjdiCJSsCS4ar+ctzWZrlLOeeSWViRYxThUgA5tK8TVQ==","signatures":[{"sig":"MEYCIQDcNCe5C2WT/nD+fAQjZuKupqm5j6NkAVapxBM7tkxlAwIhAIzEaLDd3R1kZ9kDydGjUe8mwDw8IlG1kT83fXM81InP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":682451},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./idl":{"types":"./dist/idl/index.d.ts","import":"./dist/idl/index.mjs","require":"./dist/idl/index.js"},"./pda":{"types":"./dist/pda/index.d.ts","import":"./dist/pda/index.mjs","require":"./dist/pda/index.js"},"./constants":{"types":"./dist/constants/index.d.ts","import":"./dist/constants/index.mjs","require":"./dist/constants/index.js"}},"gitHead":"52b6b501369fb135830704f7e949fb9cc5fea238","scripts":{"dev":"tsup --watch","lint":"eslint src --ext .ts","build":"tsup","typecheck":"tsc --noEmit","prepublishOnly":"yarn build"},"_npmUser":{"name":"startup-dreamer","email":"prsumit35@gmail.com"},"_npmVersion":"10.9.4","description":"Shared types, Anchor IDLs, PDA helpers, and constants for the Carnot platform","directories":{},"_nodeVersion":"22.21.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.3.0","@types/node":"^20.0.0","@solana/web3.js":"^1.91.0"},"peerDependencies":{"@solana/web3.js":"^1.91.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.5_1778138783000_0.0990863319391393","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@carnot-zk/sdk","version":"0.1.6","_id":"@carnot-zk/sdk@0.1.6","maintainers":[{"name":"startup-dreamer","email":"prsumit35@gmail.com"}],"dist":{"shasum":"30a27332bec41b970c6d6424e1aa39b1ac6e37fa","tarball":"https://registry.npmjs.org/@carnot-zk/sdk/-/sdk-0.1.6.tgz","fileCount":26,"integrity":"sha512-zIPq7rFoD6/0XXmf7xBaHeSZOACvLD8OrFTWLS/JInw8n0wns3oCMtn3jEzYmzWOdw4Zp5H2E6cetFMUb4MldA==","signatures":[{"sig":"MEUCIQDhfm5rUPakpwfjpspnGxO2lrl6ydQF70TgrRU5DOhVzwIgIllgE4LVcYIbFtX+YHHViDJkXFmFch9Bbe9GsaBygs8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":748933},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./idl":{"types":"./dist/idl/index.d.ts","import":"./dist/idl/index.mjs","require":"./dist/idl/index.js"},"./pda":{"types":"./dist/pda/index.d.ts","import":"./dist/pda/index.mjs","require":"./dist/pda/index.js"},"./constants":{"types":"./dist/constants/index.d.ts","import":"./dist/constants/index.mjs","require":"./dist/constants/index.js"}},"gitHead":"143d8f8a6eb41803c94ab2b0abc11a24841de2f0","scripts":{"dev":"tsup --watch","lint":"eslint src --ext .ts","build":"tsup","typecheck":"tsc --noEmit","prepublishOnly":"yarn build"},"_npmUser":{"name":"startup-dreamer","email":"prsumit35@gmail.com"},"_npmVersion":"10.9.4","description":"Shared types, Anchor IDLs, PDA helpers, and constants for the Carnot platform","directories":{},"_nodeVersion":"22.21.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","madge":"^8.0.0","typescript":"^5.3.0","@types/node":"^20.0.0","@solana/web3.js":"^1.91.0"},"peerDependencies":{"@solana/web3.js":"^1.91.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.6_1778185249411_0.42525610588567475","host":"s3://npm-registry-packages-npm-production"}},"0.1.7":{"name":"@carnot-zk/sdk","version":"0.1.7","description":"Shared types, Anchor IDLs, PDA helpers, and constants for the Carnot platform","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./idl":{"types":"./dist/idl/index.d.ts","import":"./dist/idl/index.mjs","require":"./dist/idl/index.js"},"./pda":{"types":"./dist/pda/index.d.ts","import":"./dist/pda/index.mjs","require":"./dist/pda/index.js"},"./constants":{"types":"./dist/constants/index.d.ts","import":"./dist/constants/index.mjs","require":"./dist/constants/index.js"}},"scripts":{"build":"tsup","dev":"tsup --watch","lint":"eslint src --ext .ts","typecheck":"tsc --noEmit","prepublishOnly":"yarn build"},"peerDependencies":{"@solana/web3.js":"^1.91.0"},"devDependencies":{"@solana/web3.js":"^1.91.0","@types/node":"^20.0.0","madge":"^8.0.0","tsup":"^8.0.0","typescript":"^5.3.0"},"publishConfig":{"access":"public"},"_id":"@carnot-zk/sdk@0.1.7","gitHead":"a29aae39948849fb7c3174d5c6bd4c666a6a4ed6","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-BhG/ObuDCg5eZbd2C4PqmIg7O0S76v5tKlrLh1OXDIm/JlyU+ee9nZeG6OUANurcDj2gWY+b+7HAxCxUHzk7sA==","shasum":"aee2aa1be7b5570146a0cbff81f8f46ff6cc151c","tarball":"https://registry.npmjs.org/@carnot-zk/sdk/-/sdk-0.1.7.tgz","fileCount":26,"unpackedSize":726021,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICTQhThmkwT8ILGulZrc55WSuxdaJoNNk6l8+pKteoobAiBLxZMFaisHLD4FMc3vXsmvjGZpl3l/Jf57HUQsVnBa8g=="}]},"_npmUser":{"name":"startup-dreamer","email":"prsumit35@gmail.com"},"directories":{},"maintainers":[{"name":"startup-dreamer","email":"prsumit35@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.7_1778500402842_0.0783030747708997"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T07:25:03.871Z","modified":"2026-05-11T11:53:23.134Z","0.1.4":"2026-05-07T07:25:04.166Z","0.1.5":"2026-05-07T07:26:23.182Z","0.1.6":"2026-05-07T20:20:49.558Z","0.1.7":"2026-05-11T11:53:22.997Z"},"description":"Shared types, Anchor IDLs, PDA helpers, and constants for the Carnot platform","maintainers":[{"name":"startup-dreamer","email":"prsumit35@gmail.com"}],"readme":"# @carnot-zk/sdk\n\nShared types, Anchor IDLs, PDA helpers, and constants for the Carnot platform.\n\n## Installation\n\n```bash\nnpm install @carnot-zk/sdk\n# or\nyarn add @carnot-zk/sdk\n# or\npnpm add @carnot-zk/sdk\n```\n\n**Peer dependency:** `@solana/web3.js ^1.91.0`\n\n## Entry Points\n\nThe package exposes four sub-path imports so you only bundle what you need:\n\n| Import | Contents |\n|--------|----------|\n| `@carnot-zk/sdk` | Everything (re-exports all below) |\n| `@carnot-zk/sdk/constants` | Program IDs, USDT mint, Pyth feed IDs, risk parameters |\n| `@carnot-zk/sdk/pda` | PDA derivation helpers |\n| `@carnot-zk/sdk/idl` | Carnot Engine Anchor IDL |\n\n## Usage\n\n### Constants\n\n```ts\nimport {\n  PROGRAM_IDS,\n  USDT_MINT,\n  getUsdtMint,\n  normalizeSolanaNetwork,\n} from '@carnot-zk/sdk/constants';\n\nconst network = 'mainnet';\nconst programId = PROGRAM_IDS[network].carnot;\nconst usdtMint = getUsdtMint(network);\n```\n\n### Pyth Price Feed IDs\n\n```ts\nimport {\n  getPythBtcUsdFeedId,\n  getPythEthUsdFeedId,\n  getPythSolUsdFeedId,\n  getPythJupUsdFeedId,\n  PYTH_MAX_PRICE_AGE_SECS,\n} from '@carnot-zk/sdk/constants';\n\nconst btcFeedId = getPythBtcUsdFeedId('mainnet');\n```\n\n### Risk Parameters\n\n```ts\nimport {\n  PLATFORM_EDGE_BPS,\n  KEEPER_FEE_BPS,\n  PROTOCOL_FEE_BPS,\n  MAX_SINGLE_BET_EXPOSURE_BPS,\n} from '@carnot-zk/sdk/constants';\n```\n\n### PDA Derivation\n\n```ts\nimport { PublicKey } from '@solana/web3.js';\nimport {\n  findCarnotGlobalStatePda,\n  findCarnotVaultStatePda,\n  findCarnotMarketStatePda,\n  findCarnotTraderAccountPda,\n  findCarnotLpPositionPda,\n  findCarnotBatchReceiptPda,\n  findCarnotClaimReceiptPda,\n  findCarnotNullifierPda,\n} from '@carnot-zk/sdk/pda';\n\nconst programId = new PublicKey('cartX31ocscytAK988e5h1xAMAeNXt6zqdgeyr3pZ3U'); // devnet\n\nconst [globalState] = findCarnotGlobalStatePda(programId);\nconst [vaultState] = findCarnotVaultStatePda(programId);\nconst [traderAccount] = findCarnotTraderAccountPda(traderPubkey, programId);\nconst [lpPosition] = findCarnotLpPositionPda(lpPubkey, programId);\n```\n\n### Encoding Utilities\n\n```ts\nimport { hexToBytes, hexToBuffer, bytesToHex, stripHexPrefix } from '@carnot-zk/sdk';\n\nconst bytes = hexToBytes('0xdeadbeef');\nconst hex   = bytesToHex(bytes); // '0xdeadbeef'\n```\n\n### Types\n\n```ts\nimport type {\n  // Trade\n  TradeRecord,\n  OhlcTick,\n  Direction,\n  KeeperTradeRecordWire,\n  KeeperOhlcTickWire,\n  // ZK settlement\n  CarnotSubmission,\n  CarnotPublicInputs,\n  CarnotVerifyAndSettleArgs,\n  // Network\n  SolanaNetwork,\n  ProgramIds,\n} from '@carnot-zk/sdk';\n```\n\n## Program IDs\n\n| Network | Program ID |\n|---------|-----------|\n| mainnet | `carCrmy6qN8tRgvUp9v6JrfUuxroGrKdndUdwMMNumS` |\n| devnet  | `cartX31ocscytAK988e5h1xAMAeNXt6zqdgeyr3pZ3U` |\n\n## Building\n\n```bash\npnpm build       # builds CJS + ESM + .d.ts into dist/\npnpm typecheck   # tsc --noEmit\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}