{"_id":"@amt-1/sdk","_rev":"2-af1a1b4542841f3e3755477b85cc12b3","name":"@amt-1/sdk","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@amt-1/sdk","version":"0.1.0","keywords":["amt-1","robinhood-chain","uniswap-v4","bonding-curve","viem"],"license":"MIT","_id":"@amt-1/sdk@0.1.0","maintainers":[{"name":"amtprotocol","email":"nihataltuntas@gmail.com"}],"dist":{"shasum":"b1433437e3dbf0a363b6193b931ebadc9bdb7237","tarball":"https://registry.npmjs.org/@amt-1/sdk/-/sdk-0.1.0.tgz","fileCount":11,"integrity":"sha512-MPWBYr7bhPgODiLZ6SWuWvlqAJQR/UNW7ppvJVxmBDlb+7411Dw/SeQc2Q/GbBZVIyDONoWPs2n5qHgBda67Sg==","signatures":[{"sig":"MEUCIEiYzPxH6Reo3cDjjCYcqh2IAu7+NY6koqKOXFb0B7mDAiEA5t3e8nfGNPwoVGwzLmvzt/S+dm8vqcJU6Sytw3Jo07I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":55460},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"npm run build && node --test test/sdk.test.mjs","build":"tsc -p tsconfig.json","prepack":"npm test","check:fork":"npm run build && node test/fork-roundtrip.mjs","check:mainnet":"npm run build && node test/mainnet.mjs"},"_npmUser":{"name":"amtprotocol","email":"nihataltuntas@gmail.com"},"_npmVersion":"11.11.0","description":"Permissionless discovery, quoting and transaction builders for AMT-1 markets","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"viem":"2.55.7","typescript":"5.8.3"},"peerDependencies":{"viem":">=2.50.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.0_1784825922797_0.6874246605257157","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@amt-1/sdk","version":"0.2.0","description":"Permissionless discovery, quoting and transaction builders for AMT-1 markets","keywords":["amt-1","robinhood-chain","uniswap-v4","bonding-curve","viem"],"type":"module","sideEffects":false,"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"publishConfig":{"access":"public"},"engines":{"node":">=20"},"scripts":{"build":"tsc -p tsconfig.json","prepack":"npm test","test":"npm run build && node --test test/sdk.test.mjs","check:mainnet":"npm run build && node test/mainnet.mjs","check:fork":"npm run build && node test/fork-roundtrip.mjs"},"peerDependencies":{"viem":">=2.50.0"},"devDependencies":{"typescript":"5.8.3","viem":"2.55.7"},"license":"MIT","_id":"@amt-1/sdk@0.2.0","_nodeVersion":"20.10.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-01TmjBOXR2zJpho2Fyxzk+YC09IpM9lB7JG7p4SkqeV7YqEFLAtUz2hVNko8T80bcug4V63rk1sU7qJJhjc1jA==","shasum":"ab9b4a356dc5da988c4c2a9285c084ec3c6c085d","tarball":"https://registry.npmjs.org/@amt-1/sdk/-/sdk-0.2.0.tgz","fileCount":11,"unpackedSize":56429,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCPM4z4ACr/KC+sEomMh/vpvHHHpflaEWTeJSCFgERy8AIgd4TVprECOctP5xkMbgaj0NApChSqGYrerV4WCGrfO1I="}]},"_npmUser":{"name":"amtprotocol","email":"nihataltuntas@gmail.com"},"directories":{},"maintainers":[{"name":"amtprotocol","email":"nihataltuntas@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.2.0_1784896532863_0.033636159788146935"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-23T16:58:42.673Z","modified":"2026-07-24T12:35:33.157Z","0.1.0":"2026-07-23T16:58:42.938Z","0.2.0":"2026-07-24T12:35:32.999Z"},"license":"MIT","keywords":["amt-1","robinhood-chain","uniswap-v4","bonding-curve","viem"],"description":"Permissionless discovery, quoting and transaction builders for AMT-1 markets","maintainers":[{"name":"amtprotocol","email":"nihataltuntas@gmail.com"}],"readme":"# @amt-1/sdk\n\nPermissionless AMT-1 discovery, quoting and transaction construction. The SDK\ntalks directly to contracts through a viem `PublicClient`; no AMT-hosted API is\nrequired.\n\n`discoverAMT` validates live token/hook/router bindings and solvency. Full AMT-1\nconformance additionally requires the repository's bytecode and privilege tests.\nVersion 0.2.x recognizes the uncapped Draft 0.2 profile and deliberately rejects\nthe legacy capped Draft 0.1 deployment.\n\n```ts\nimport { discoverAMT, quoteMint, buildUniversalRouterBuy } from \"@amt-1/sdk\";\n\nconst market = await discoverAMT(client, token);\nconst tokensOut = await quoteMint(client, token, reserveIn);\nconst transaction = buildUniversalRouterBuy({\n  market,\n  reserveIn,\n  minTokensOut: tokensOut * 995n / 1000n,\n  deadline: BigInt(Math.floor(Date.now() / 1000) + 300),\n});\n\nawait wallet.sendTransaction(transaction);\n```\n\nUniversal Router `TAKE_ALL` sends AMT to the wallet that calls `execute`; no\nAMT-hosted service or intermediary receiver is involved.\n\nCanonical buy and sell builders are also available. A canonical sell requires\nthe token holder to approve `market.router`; it never requires a hosted service.\n\nUniversal Router AMT-to-ETH exact-input sells are supported through\n`buildUniversalRouterSell`. On first use, call\n`buildUniversalRouterSellApprovals` and submit only the approvals reported as\nmissing by `getUniversalRouterSellRequirements`. These approvals target the\ncanonical Permit2 contract and Robinhood Chain's official Universal Router.\n\n```ts\nconst tokensIn = balance;\nconst requirements = await getUniversalRouterSellRequirements({\n  client,\n  owner: account.address,\n  token,\n  tokensIn,\n});\nconst approvals = buildUniversalRouterSellApprovals({\n  token,\n  expiration: Math.floor(Date.now() / 1000) + 86_400,\n});\n\nif (requirements.tokenApprovalRequired)\n  await wallet.sendTransaction(approvals.tokenToPermit2);\nif (requirements.permit2ApprovalRequired)\n  await wallet.sendTransaction(approvals.permit2ToUniversalRouter);\n\nconst reserveOut = await quoteBurn(client, token, tokensIn);\nawait wallet.sendTransaction(buildUniversalRouterSell({\n  market,\n  tokensIn,\n  minReserveOut: reserveOut * 995n / 1000n,\n  deadline: BigInt(Math.floor(Date.now() / 1000) + 300),\n}));\n```\n\nThe sell builder deliberately encodes `SETTLE → SWAP → TAKE`. AMT custom\naccounting consumes its ERC-20 input during `beforeSwap`, so the common\npost-swap settlement order is not valid for this market.\n\nRun `npm run check:fork` against a local Robinhood mainnet Anvil fork to execute\nthe exact SDK buy, Permit2 approvals and full-balance sell as an end-to-end test.\nSet `AMT_TOKEN_ADDRESS` to a deployed Draft 0.2 token and `ANVIL_PRIVATE_KEY` to\nan unfunded account created only by the local Anvil process. Never use or commit\na funded deployment key. Until Draft 0.2 is deployed, the live/fork scripts are\nexpected to remain unconfigured.\n","readmeFilename":"README.md"}