{"_id":"@dyadex-finance/uniswapx-sdk","name":"@dyadex-finance/uniswapx-sdk","dist-tags":{"latest":"3.0.2"},"versions":{"3.0.2":{"name":"@dyadex-finance/uniswapx-sdk","version":"3.0.2","author":{"name":"Uniswap"},"repository":{"type":"git","url":"git+https://github.com/dyadex-finance/uniswap-sdks.git"},"keywords":["uniswap","ethereum"],"license":"MIT","main":"./dist/cjs/src/index.js","typings":"./dist/types/src/index.d.ts","module":"./dist/esm/src/index.js","engines":{"node":">=18"},"scripts":{"build":"bun run typechain && bun run build:cjs && bun run build:esm && bun run build:types","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json","build:types":"tsc -p tsconfig.types.json","lint":"eslint src --ext .ts","lint:fix":"eslint src --ext .ts --fix","prettier":"prettier \"src/**/*.ts\" --list-different","release":"changeset publish","test":"run-s test:unit test:integration","test:unit":"bun test src/","test:integration":"cd integration && bun install && bun run test","typechain":"typechain --target=ethers-v5 --out-dir src/contracts --glob ./abis/**/*.json"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/bytes":"^5.7.0","@ethersproject/providers":"^5.7.0","@dyadex-finance/permit2-sdk":"^1.4.0","@dyadex-finance/sdk-core":"^7.13.0","ethers":"^5.7.0","tiny-invariant":"^1.1.0"},"devDependencies":{"@typechain/ethers-v5":"^10.1.0","@types/chai":"^4.3.3","@types/node":"^18.7.16","@typescript-eslint/eslint-plugin":"^8.38.0","@typescript-eslint/parser":"^8.38.0","chai":"^4.3.6","eslint":"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-functional":"^3.0.2","eslint-plugin-import":"^2.22.0","husky":"^8.0.3","npm-run-all":"^4.1.5","prettier":"^2.4.1","ts-node":"^10.9.1","tslib":"^2.3.0","typechain":"^8.1.0","typescript":"^4.3.3"},"husky":{"hooks":{"pre-commit":"bun run fix"}},"publishConfig":{"access":"public","provenance":true},"exports":{".":{"types":"./dist/types/src/index.d.ts","import":"./dist/esm/src/index.js","require":"./dist/cjs/src/index.js"}},"sideEffects":false,"gitHead":"06ab4ee985528ad0159a9bfb6d4356a5693d59a1","_id":"@dyadex-finance/uniswapx-sdk@3.0.2","description":"SDK for the UniswapX protocol","bugs":{"url":"https://github.com/dyadex-finance/uniswap-sdks/issues"},"homepage":"https://github.com/dyadex-finance/uniswap-sdks#readme","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-a2BKxs1UQsSoRn1tfFXDCrteZtqaso17Pq7rsqvbr5RuJaOuHK7P8VQ3QTST2ctkxKkZVhZphV4XpFEreM6IWA==","shasum":"543f34dd8402765881f7b5801f740f89adce1b2c","tarball":"https://registry.npmjs.org/@dyadex-finance/uniswapx-sdk/-/uniswapx-sdk-3.0.2.tgz","fileCount":660,"unpackedSize":5186199,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dyadex-finance%2funiswapx-sdk@3.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCju2E3BaI2gux7de63gvd5zThtxYEzj/AaQKtXsavepgIhAMDab3CSZKRm0Q6sTZSECo8dh5LmqK/XvyXBEFFgpiyS"}]},"_npmUser":{"name":"neddy34","email":"edwardlee9534@gmail.com"},"directories":{},"maintainers":[{"name":"neddy34","email":"edwardlee9534@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/uniswapx-sdk_3.0.2_1777304624400_0.8933471404675397"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-27T15:43:44.328Z","3.0.2":"2026-04-27T15:43:44.613Z","modified":"2026-04-27T15:43:44.958Z"},"maintainers":[{"name":"neddy34","email":"edwardlee9534@gmail.com"}],"description":"SDK for the UniswapX protocol","homepage":"https://github.com/dyadex-finance/uniswap-sdks#readme","keywords":["uniswap","ethereum"],"repository":{"type":"git","url":"git+https://github.com/dyadex-finance/uniswap-sdks.git"},"author":{"name":"Uniswap"},"bugs":{"url":"https://github.com/dyadex-finance/uniswap-sdks/issues"},"license":"MIT","readme":"# uniswapx-sdk\n\nSDK for the UniswapX protocol\n\n## Usage\n\nThe SDK contains bindings for two main flows: parsing serialized orders & building new orders.\n\n### Building & Signing Orders\n\n```ts\nimport { DutchOrder, NonceManager } from '@uniswap/uniswapx-sdk';\nimport { ethers } from 'ethers';\n\nconst provider = new ethers.providers.JsonRpcProvider(RPC_URL);\nconst account = await provider.getSigner().getAddress(); \nconst nonceMgr = new NonceManager(provider, 1); \nconst nonce = await nonceMgr.useNonce(account); \n\nconst chainId = 1;\nconst builder = new DutchOrderBuilder(chainId);\nconst order = builder\n  .deadline(deadline)\n  .decayEndTime(deadline)\n  .decayStartTime(deadline - 100)\n  .nonce(nonce)\n  .input({\n    token: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n    amount: BigNumber.from('1000000'),\n  })\n  .output({\n    token: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',\n    startAmount: BigNumber.from('1000000000000000000'),\n    endAmount: BigNumber.from('900000000000000000'),\n    recipient: '0x0000000000000000000000000000000000000000',\n  })\n  .build();\n \n// Sign the built order \nconst { domain, types, values } = order.permitData();\nconst signature = wallet._signTypedData(domain, types, values);\n\nconst serializedOrder = order.serialize();\n// submit serializedOrder and signature to order pool\n```\n\n### Parsing Orders\n```ts\nimport { DutchOrder, Order } from '@uniswap/uniswapx-sdk';\n\nconst serializedOrder = '0x1111222233334444555500000000234300234...';\nconst chainId = 1; \n\nconst order: Order = DutchOrder.parse(serializedOrder, chainId);\n\nconst orderData = order.info;\nconst orderHash = order.hash();\n```\n### Validating Orders \n```ts\nimport { ethers } from 'ethers';\nimport { OrderValidator } from 'uniswapx-sdk';\n\nconst provider = new ethers.providers.JsonRpcProvider(RPC_URL);\nconst validator = new OrderValidator(provider, CHAIN_ID); \nconst orders: SignedOrder[] = [\n  {\n    order: order1, \n    signature: signature1\n  }, \n  {\n    order: order2, \n    signature: signature2\n  }\n]; \n\ntry {\n  const statusList: OrderValidation[] = await validator.validateBatch(orders); \n  // Do something with list of statuses \n}\ncatch(e) {\n  // Handle error\n}\n\n```\n\n### Order Object\n\n**serialize()**\n\nReturns an abi-encoded serialization of the order. This serialized format is passed into the corresponding reactor contract for execution.\n\n\n**getSigner(signature)**\n\nRecovers the address which created the given signature over the order. Used to determine the order maker.\n\n\n**permitData()**\n\nReturns the domain, types, and values used to generate an EIP-712 signature over the order. Note that this signature both approves the release of the order's input tokens _and_ the execution of the order itself.\n\n\n**hash()**\n\nReturns the order hash. This is used as a key to track order fulfillment on-chain. It may also be useful as a unique order identifier for off-chain purposes.\n\n","readmeFilename":"README.md","_rev":"1-7cc551c782ce4979b6336005ee97a06e"}