1.4.30 • Published 6 months ago

@kittycorn-labs/universal-router-sdk v1.4.30

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

universal-router-sdk

This SDK facilitates interactions with the contracts in Universal Router

Usage

Install latest version of universal-router-sdk. Then import the corresponding Trade class and Data object for each protocol you'd like to interact with.

Trading on Uniswap

warning: swapERC20CallParameters() to be deprecated in favor of swapCallParameters()

import { TradeType } from '@uniswap/sdk-core'
import { Trade as V2TradeSDK } from '@uniswap/v2-sdk'
import { Trade as V3TradeSDK } from '@uniswap/v3-sdk'
import { MixedRouteTrade, MixedRouteSDK, Trade as RouterTrade } from '@uniswap/router-sdk'

const options = { slippageTolerance, recipient }
const routerTrade = new RouterTrade({ v2Routes, v3Routes, mixedRoutes, tradeType: TradeType.EXACT_INPUT })
// Use the raw calldata and value returned to call into Universal Swap Router contracts
const { calldata, value } = SwapRouter.swapCallParameters(routerTrade, options)

Running this package

Make sure you are running node v18 Install dependencies and run typescript unit tests

yarn install
yarn test:hardhat

Run forge integration tests

forge install
yarn test:forge
1.4.30

6 months ago

1.4.29

6 months ago

1.4.28

6 months ago

1.4.27

6 months ago

1.4.26

6 months ago

1.4.25

6 months ago

1.4.24

6 months ago

1.4.23

6 months ago

1.4.22

6 months ago

1.4.21

6 months ago

1.4.20

6 months ago

1.4.19

6 months ago

1.4.18

6 months ago

1.4.17

6 months ago

1.4.16

6 months ago

1.4.15

6 months ago

1.4.14

7 months ago

1.4.13

7 months ago

1.4.12

7 months ago

1.4.11

7 months ago

1.4.10

7 months ago

1.4.9

7 months ago

1.4.8

8 months ago

1.4.7

8 months ago

1.4.6

8 months ago

1.4.5

8 months ago

1.4.4

8 months ago

1.4.3

9 months ago

1.4.2

9 months ago

1.4.1

9 months ago

1.4.0

9 months ago

1.3.1

9 months ago

1.3.0

9 months ago

1.2.0

9 months ago

1.1.0

9 months ago

1.0.0

9 months ago