1.4.7 • Published 1 year ago

@moraswap/universal-router-sdk v1.4.7

Weekly downloads
-
License
-
Repository
github
Last release
1 year 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.

// Use the raw calldata and value returned to call into Universal Swap Router contracts // Trades will happen in the order that they are handed in const { calldata, value } = SwapRouter.swapCallParameters(looksRareTrades, seaportTrades)

### Trading ERC20s on Moraswap
warning: `swapERC20CallParameters()` to be deprecated in favor of `swapCallParameters()`
```typescript
import { TradeType } from '@moraswap/sdk-core'
import { Trade as V2TradeSDK } from '@moraswap/v2-sdk'
import { Trade as V3TradeSDK } from '@moraswap/v3-sdk'
import { MixedRouteTrade, MixedRouteSDK, Trade as RouterTrade } from '@moraswap/router-sdk'

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

Running this package

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

yarn install
yarn test:hardhat

Run forge integration tests

yarn symlink # must install git submodules
forge install
yarn test:forge
1.4.7

1 year ago

1.4.6

1 year ago

1.4.5

1 year ago

1.4.4

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.2.18

2 years ago

1.3.2

2 years ago

1.4.0

1 year ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.16

2 years ago

1.2.17

2 years ago

1.2.14

2 years ago

1.2.15

2 years ago

1.2.12

2 years ago

1.2.13

2 years ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.9

2 years ago

1.2.10

2 years ago

1.2.11

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago