Catalog npm
Back to packageRELEASE DETAILS

1.0.0

npm

@0xabcdefg/uniswapx-sdk

SDK for the UniswapX protocol

ethereumuniswap
Published30 Aug 2025
Direct dependencies24
Transitive dependenciesNot calculated

README

Current package documentation

uniswapx-sdk

SDK for the UniswapX protocol

Usage

The SDK contains bindings for two main flows: parsing serialized orders & building new orders.

Building & Signing Orders

import { DutchOrder, NonceManager } from '@uniswap/uniswapx-sdk';
import { ethers } from 'ethers';

const provider = new ethers.providers.JsonRpcProvider(RPC_URL);
const account = await provider.getSigner().getAddress(); 
const nonceMgr = new NonceManager(provider, 1); 
const nonce = await nonceMgr.useNonce(account); 

const chainId = 1;
const builder = new DutchOrderBuilder(chainId);
const order = builder
  .deadline(deadline)
  .decayEndTime(deadline)
  .decayStartTime(deadline - 100)
  .nonce(nonce)
  .input({
    token: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
    amount: BigNumber.from('1000000'),
  })
  .output({
    token: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
    startAmount: BigNumber.from('1000000000000000000'),
    endAmount: BigNumber.from('900000000000000000'),
    recipient: '0x0000000000000000000000000000000000000000',
  })
  .build();
 
// Sign the built order 
const { domain, types, values } = order.permitData();
const signature = wallet._signTypedData(domain, types, values);

const serializedOrder = order.serialize();
// submit serializedOrder and signature to order pool

Parsing Orders

import { DutchOrder, Order } from '@uniswap/uniswapx-sdk';

const serializedOrder = '0x1111222233334444555500000000234300234...';
const chainId = 1; 

const order: Order = DutchOrder.parse(serializedOrder, chainId);

const orderData = order.info;
const orderHash = order.hash();

Validating Orders

import { ethers } from 'ethers';
import { OrderValidator } from 'uniswapx-sdk';

const provider = new ethers.providers.JsonRpcProvider(RPC_URL);
const validator = new OrderValidator(provider, CHAIN_ID); 
const orders: SignedOrder[] = [
  {
    order: order1, 
    signature: signature1
  }, 
  {
    order: order2, 
    signature: signature2
  }
]; 

try {
  const statusList: OrderValidation[] = await validator.validateBatch(orders); 
  // Do something with list of statuses 
}
catch(e) {
  // Handle error
}

Order Object

serialize()

Returns an abi-encoded serialization of the order. This serialized format is passed into the corresponding reactor contract for execution.

getSigner(signature)

Recovers the address which created the given signature over the order. Used to determine the order maker.

permitData()

Returns 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.

hash()

Returns 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.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 24

Native requirements
24 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@ethersproject/bytes
Environment
{
  "local_name": "@ethersproject/bytes",
  "alias": false,
  "peer_metadata": null
}
^5.7.0runtime
@ethersproject/providers
Environment
{
  "local_name": "@ethersproject/providers",
  "alias": false,
  "peer_metadata": null
}
^5.7.0runtime
@uniswap/permit2-sdk
Environment
{
  "local_name": "@uniswap/permit2-sdk",
  "alias": false,
  "peer_metadata": null
}
^1.2.1runtime
@0xabcdefg/sdk-core
Environment
{
  "local_name": "@uniswap/sdk-core",
  "alias": true,
  "peer_metadata": null
}
npm:@0xabcdefg/sdk-core@^1.0.0runtime
ethers
Environment
{
  "local_name": "ethers",
  "alias": false,
  "peer_metadata": null
}
^5.7.0runtime
@typechain/ethers-v5
Environment
{
  "local_name": "@typechain/ethers-v5",
  "alias": false,
  "peer_metadata": null
}
^10.1.0development
@types/jest
Environment
{
  "local_name": "@types/jest",
  "alias": false,
  "peer_metadata": null
}
^24.0.25development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^18.7.16development
@typescript-eslint/eslint-plugin
Environment
{
  "local_name": "@typescript-eslint/eslint-plugin",
  "alias": false,
  "peer_metadata": null
}
^5.62development
@typescript-eslint/parser
Environment
{
  "local_name": "@typescript-eslint/parser",
  "alias": false,
  "peer_metadata": null
}
^5.62development
eslint
Environment
{
  "local_name": "eslint",
  "alias": false,
  "peer_metadata": null
}
^7.8.0development
eslint-config-prettier
Environment
{
  "local_name": "eslint-config-prettier",
  "alias": false,
  "peer_metadata": null
}
^6.11.0development
eslint-plugin-eslint-comments
Environment
{
  "local_name": "eslint-plugin-eslint-comments",
  "alias": false,
  "peer_metadata": null
}
^3.2.0development
eslint-plugin-functional
Environment
{
  "local_name": "eslint-plugin-functional",
  "alias": false,
  "peer_metadata": null
}
^3.0.2development
eslint-plugin-import
Environment
{
  "local_name": "eslint-plugin-import",
  "alias": false,
  "peer_metadata": null
}
^2.22.0development
husky
Environment
{
  "local_name": "husky",
  "alias": false,
  "peer_metadata": null
}
^8.0.3development
jest
Environment
{
  "local_name": "jest",
  "alias": false,
  "peer_metadata": null
}
25.5.0development
jest-environment-node
Environment
{
  "local_name": "jest-environment-node",
  "alias": false,
  "peer_metadata": null
}
25.5.0development
npm-run-all
Environment
{
  "local_name": "npm-run-all",
  "alias": false,
  "peer_metadata": null
}
^4.1.5development
prettier
Environment
{
  "local_name": "prettier",
  "alias": false,
  "peer_metadata": null
}
^2.4.1development
ts-jest
Environment
{
  "local_name": "ts-jest",
  "alias": false,
  "peer_metadata": null
}
25.5.0development
ts-node
Environment
{
  "local_name": "ts-node",
  "alias": false,
  "peer_metadata": null
}
^10.9.1development
typechain
Environment
{
  "local_name": "typechain",
  "alias": false,
  "peer_metadata": null
}
^8.1.0development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^4.3.3development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-ffCwWOWSl9ghYFftnvyTXTvDlggZEAVN/Z3NW+CE1vIYwXgSoKcpjdnODI7rdP0ZMH7KPsLZ6ATHlEfmKsSI7g==",
  "shasum": "92d2bba10264a59236e96d8a6876f3934e21b1e9",
  "tarball": "https://registry.npmjs.org/@0xabcdefg/uniswapx-sdk/-/uniswapx-sdk-1.0.0.tgz",
  "fileCount": 210,
  "unpackedSize": 1376818,
  "signatures": [
    {
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U",
      "sig": "MEQCIC2v/eH7Yz3D5nfV2F0AZIgwPBJHYwbxgMlyvg9U/qTmAiAoXO+xh54O2mh7WF+0O7OTT6/3aGJY8NcMuxwC08F3YQ=="
    }
  ]
}

Repository

PENDING
uniswap/sdks

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:39 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:2ee4c6309b2846676c6813f2510bef7eda8a5f2c5edfbbfc61beea6c3bb2526e

Other collected versions

View all collected versions →