Skip to content

Commit

Permalink
update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
SigismundSchlomo committed May 31, 2024
1 parent f558992 commit 9d60059
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 79 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ const { calldata, value } = SwapRouter.swapCallParameters([looksRareTrades, seap
### Trading ERC20s on Uniswap
warning: `swapERC20CallParameters()` to be deprecated in favor of `swapCallParameters()`
```typescript
import { TradeType } from '@sigismund/sdk-core'
import { Trade as V2TradeSDK } from '@sigismund/v2-sdk'
import { Trade as V3TradeSDK } from '@sigismund/v3-sdk'
import { MixedRouteTrade, MixedRouteSDK, Trade as RouterTrade } from '@sigismund/router-sdk'
import { TradeType } from '@airdao/sdk-core'
import { Trade as V2TradeSDK } from '@airdao/v2-sdk'
import { Trade as V3TradeSDK } from '@airdao/v3-sdk'
import { MixedRouteTrade, MixedRouteSDK, Trade as RouterTrade } from '@airdao/router-sdk'

const options = { slippageTolerance, recipient }
const routerTrade = new UniswapTrade(
Expand All @@ -46,10 +46,10 @@ Send ETH to the router by trading an ERC20 for ETH with a Uniswap Trade and enco
Use `trade_type: TradeType.EXACT_OUTPUT` to cover the entire NFT price, alternatively the transaction will send supplemental ETH to fulfill the entire price if the swap does not cover it in full. Keep in mind that `TradeType.EXACT_INPUT` trades are subject to slippage on output, and ETH will be sent to cover potential slippage and any remaining ETH will be returned to sender.
```typescript
import { TradeType } from '@sigismund/sdk-core'
import { Trade as V2TradeSDK } from '@sigismund/v2-sdk'
import { Trade as V3TradeSDK } from '@sigismund/v3-sdk'
import { MixedRouteTrade, MixedRouteSDK, Trade as RouterTrade } from '@sigismund/router-sdk'
import { TradeType } from '@airdao/sdk-core'
import { Trade as V2TradeSDK } from '@airdao/v2-sdk'
import { Trade as V3TradeSDK } from '@airdao/v3-sdk'
import { MixedRouteTrade, MixedRouteSDK, Trade as RouterTrade } from '@airdao/router-sdk'
import {
ROUTER_AS_RECIPIENT,
UniswapTrade,
Expand Down
2 changes: 1 addition & 1 deletion src/entities/protocols/element-market.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { TradeConfig } from '../Command'
import { RoutePlanner, CommandType } from '../../utils/routerCommands'
import { BigNumber } from 'ethers'
import { ZERO_ADDRESS } from '../../utils/constants'
import { ZERO } from '@sigismund/router-sdk'
import { ZERO } from '@airdao/router-sdk'

export interface Fee {
recipient: string
Expand Down
8 changes: 4 additions & 4 deletions src/entities/protocols/uniswap.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RoutePlanner, CommandType } from '../../utils/routerCommands'
import { Trade as V2Trade, Pair } from '@sigismund/v2-sdk'
import { Trade as V3Trade, Pool, encodeRouteToPath } from '@sigismund/v3-sdk'
import { Trade as V2Trade, Pair } from '@airdao/v2-sdk'
import { Trade as V3Trade, Pool, encodeRouteToPath } from '@airdao/v3-sdk'
import {
Trade as RouterTrade,
MixedRouteTrade,
Expand All @@ -14,9 +14,9 @@ import {
getOutputOfPools,
encodeMixedRouteToPath,
partitionMixedRouteByProtocol,
} from '@sigismund/router-sdk'
} from '@airdao/router-sdk'
import { Permit2Permit } from '../../utils/inputTokens'
import { Currency, TradeType, CurrencyAmount, Percent } from '@sigismund/sdk-core'
import { Currency, TradeType, CurrencyAmount, Percent } from '@airdao/sdk-core'
import { Command, RouterTradeType, TradeConfig } from '../Command'
import { SENDER_AS_RECIPIENT, ROUTER_AS_RECIPIENT, CONTRACT_BALANCE } from '../../utils/constants'
import { encodeFeeBips } from '../../utils/numbers'
Expand Down
6 changes: 3 additions & 3 deletions src/swapRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import invariant from 'tiny-invariant'
import { abi } from '@uniswap/universal-router/artifacts/contracts/UniversalRouter.sol/UniversalRouter.json'
import { Interface } from '@ethersproject/abi'
import { BigNumber, BigNumberish } from 'ethers'
import { MethodParameters } from '@sigismund/v3-sdk'
import { Trade as RouterTrade } from '@sigismund/router-sdk'
import { Currency, TradeType } from '@sigismund/sdk-core'
import { MethodParameters } from '@airdao/v3-sdk'
import { Trade as RouterTrade } from '@airdao/router-sdk'
import { Currency, TradeType } from '@airdao/sdk-core'
import { Command, RouterTradeType } from './entities/Command'
import { Market, NFTTrade, SupportedProtocolsData } from './entities/NFTTrade'
import { UniswapTrade, SwapOptions } from './entities/protocols/uniswap'
Expand Down
2 changes: 1 addition & 1 deletion src/utils/getNativeCurrencyValue.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Currency, CurrencyAmount, Ether } from '@sigismund/sdk-core'
import { Currency, CurrencyAmount, Ether } from '@airdao/sdk-core'

export function getNativeCurrencyValue(currencyValues: CurrencyAmount<Currency>[]): CurrencyAmount<Currency> {
for (const value of currencyValues) {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/numbers.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { BigNumber } from 'ethers'
import JSBI from 'jsbi'
import bn from 'bignumber.js'
import { Percent } from '@sigismund/sdk-core'
import { toHex } from '@sigismund/v3-sdk'
import { Percent } from '@airdao/sdk-core'
import { toHex } from '@airdao/v3-sdk'

export function expandTo18DecimalsBN(n: number): BigNumber {
// use bn intermediately to allow decimals in intermediate calculations
Expand Down
2 changes: 1 addition & 1 deletion test/forge/writeInterop.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from 'fs'
import { hexToDecimalString } from '../utils/hexToDecimalString'
import { MethodParameters } from '@sigismund/v3-sdk'
import { MethodParameters } from '@airdao/v3-sdk'

const INTEROP_FILE = './test/forge/interop.json'

Expand Down
6 changes: 3 additions & 3 deletions test/mixedTrades.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { utils, Wallet } from 'ethers'
import { LooksRareV2Data, LooksRareV2Trade } from '../src/entities/protocols/looksRareV2'
import { looksRareV2Orders } from './orders/looksRareV2'
import { seaportV1_4DataETHRecent } from './orders/seaportV1_4'
import { Trade as V2Trade, Route as RouteV2, Pair } from '@sigismund/v2-sdk'
import { Trade as V3Trade, Route as RouteV3, Pool } from '@sigismund/v3-sdk'
import { Trade as V2Trade, Route as RouteV2, Pair } from '@airdao/v2-sdk'
import { Trade as V3Trade, Route as RouteV3, Pool } from '@airdao/v3-sdk'
import { generatePermitSignature, makePermit } from './utils/permit2'

import { UniswapTrade } from '../src'
import { CurrencyAmount, TradeType } from '@sigismund/sdk-core'
import { CurrencyAmount, TradeType } from '@airdao/sdk-core'
import { registerFixture } from './forge/writeInterop'
import { buildTrade, getUniswapPools, swapOptions, DAI, ETHER, WETH, USDC } from './utils/uniswapData'
import {
Expand Down
8 changes: 4 additions & 4 deletions test/uniswapTrades.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import JSBI from 'jsbi'
import { BigNumber, utils, Wallet } from 'ethers'
import { expandTo18Decimals } from '../src/utils/numbers'
import { SwapRouter, UniswapTrade, FlatFeeOptions } from '../src'
import { MixedRouteTrade, MixedRouteSDK } from '@sigismund/router-sdk'
import { Trade as V2Trade, Pair, Route as RouteV2 } from '@sigismund/v2-sdk'
import { Trade as V3Trade, Route as RouteV3, Pool, FeeOptions } from '@sigismund/v3-sdk'
import { MixedRouteTrade, MixedRouteSDK } from '@airdao/router-sdk'
import { Trade as V2Trade, Pair, Route as RouteV2 } from '@airdao/v2-sdk'
import { Trade as V3Trade, Route as RouteV3, Pool, FeeOptions } from '@airdao/v3-sdk'
import { generatePermitSignature, toInputPermit, makePermit, generateEip2098PermitSignature } from './utils/permit2'
import { CurrencyAmount, Percent, TradeType } from '@sigismund/sdk-core'
import { CurrencyAmount, Percent, TradeType } from '@airdao/sdk-core'
import { registerFixture } from './forge/writeInterop'
import { buildTrade, getUniswapPools, swapOptions, ETHER, DAI, USDC } from './utils/uniswapData'
import { hexToDecimalString } from './utils/hexToDecimalString'
Expand Down
8 changes: 4 additions & 4 deletions test/utils/uniswapData.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import JSBI from 'jsbi'
import { ethers } from 'ethers'
import { MixedRouteTrade, MixedRouteSDK, Trade as RouterTrade } from '@sigismund/router-sdk'
import { Trade as V2Trade, Pair, Route as RouteV2, computePairAddress } from '@sigismund/v2-sdk'
import { MixedRouteTrade, MixedRouteSDK, Trade as RouterTrade } from '@airdao/router-sdk'
import { Trade as V2Trade, Pair, Route as RouteV2, computePairAddress } from '@airdao/v2-sdk'
import {
Trade as V3Trade,
Pool,
Expand All @@ -10,9 +10,9 @@ import {
TickMath,
TICK_SPACINGS,
FeeAmount,
} from '@sigismund/v3-sdk'
} from '@airdao/v3-sdk'
import { SwapOptions } from '../../src'
import { CurrencyAmount, TradeType, Ether, Token, Percent, Currency } from '@sigismund/sdk-core'
import { CurrencyAmount, TradeType, Ether, Token, Percent, Currency } from '@airdao/sdk-core'
import IUniswapV3Pool from '@uniswap/v3-core/artifacts/contracts/UniswapV3Pool.sol/UniswapV3Pool.json'
import { TEST_RECIPIENT_ADDRESS } from './addresses'

Expand Down
96 changes: 48 additions & 48 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,54 @@
# yarn lockfile v1


"@airdao/router-sdk@1.6.0-airdao.0":
version "1.6.0-airdao.0"
resolved "https://registry.yarnpkg.com/@airdao/router-sdk/-/router-sdk-1.6.0-airdao.0.tgz#c71eced39d48986589010ac25f1c8aa5d94bc3a9"
integrity sha512-36/NT7dpy887P1oy8RecqhEKPEC5V1Fdv/UJVdSSK11eZRy9J0xU2TlqKpUuw4NLBwmgdlhGCHHQSH9WeKqxyw==
dependencies:
"@airdao/sdk-core" "4.0.7-airdao.0"
"@airdao/v2-sdk" "3.2.3-airdao.0"
"@airdao/v3-sdk" "3.10.0-airdao.0"
"@ethersproject/abi" "^5.5.0"
"@uniswap/swap-router-contracts" "1.1.0"

"@airdao/sdk-core@4.0.7-airdao.0":
version "4.0.7-airdao.0"
resolved "https://registry.yarnpkg.com/@airdao/sdk-core/-/sdk-core-4.0.7-airdao.0.tgz#f1e7a7b6d27386eb7b1f6710bbeba45f71ba6585"
integrity sha512-HylW92Q7jbd7L3q7mvOhZi4XnPFt6kslGHkIA2mRnQ7g5lG68/ESuQWTeXWv0wXBsqNvSMskzbguR++i6nOGXg==
dependencies:
"@ethersproject/address" "^5.0.2"
big.js "^5.2.2"
decimal.js-light "^2.5.0"
jsbi "^3.1.4"
tiny-invariant "^1.1.0"
toformat "^2.0.0"

"@airdao/v2-sdk@3.2.3-airdao.0":
version "3.2.3-airdao.0"
resolved "https://registry.yarnpkg.com/@airdao/v2-sdk/-/v2-sdk-3.2.3-airdao.0.tgz#c3f3540f6e6a661c562fab3261f93783d955963e"
integrity sha512-cY3XMNxxQnd4RTARFTyi8jokccGfJWGVDA36PBcnpqdv880EhOlH0qxEHKzGF+HCf/1zAMfrMhMpSvOQaqV3UQ==
dependencies:
"@airdao/sdk-core" "4.0.7-airdao.0"
"@ethersproject/address" "^5.0.0"
"@ethersproject/solidity" "^5.0.0"
tiny-invariant "^1.1.0"
tiny-warning "^1.0.3"

"@airdao/v3-sdk@3.10.0-airdao.0":
version "3.10.0-airdao.0"
resolved "https://registry.yarnpkg.com/@airdao/v3-sdk/-/v3-sdk-3.10.0-airdao.0.tgz#a67d74466eab8d7966a6ec0750bebb4e1b57fb18"
integrity sha512-/+jo5WmhhFwIfCsR422yi/SICb9iQx5ubtz2I4hNXSojhUr5ob1AO4onTOLEdrZzEYxJKasMtNbt2KCOwM7nuA==
dependencies:
"@airdao/sdk-core" "4.0.7-airdao.0"
"@ethersproject/abi" "^5.0.12"
"@ethersproject/solidity" "^5.0.9"
"@uniswap/swap-router-contracts" "^1.2.1"
"@uniswap/v3-periphery" "^1.1.1"
"@uniswap/v3-staker" "1.0.0"
tiny-invariant "^1.1.0"
tiny-warning "^1.0.3"

"@ampproject/remapping@^2.1.0":
version "2.2.0"
resolved "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz"
Expand Down Expand Up @@ -1916,54 +1964,6 @@
"@sentry/types" "5.30.0"
tslib "^1.9.3"

"@sigismund/router-sdk@1.6.0-airdao.7":
version "1.6.0-airdao.7"
resolved "https://registry.yarnpkg.com/@sigismund/router-sdk/-/router-sdk-1.6.0-airdao.7.tgz#d7c4a47dacb2cc1418a642321f46cd47f2ffc279"
integrity sha512-XkSYm2+swDwKiGFGirAVpcQPKT4hffzVa+B3tTm5dOZQ0D4yFYoIikB8GO3s9IsxwoF1cqYFyyfnbZ8pxUIz+g==
dependencies:
"@ethersproject/abi" "^5.5.0"
"@sigismund/sdk-core" "4.0.7-airdao.1"
"@sigismund/v2-sdk" "3.2.3-airdao.5"
"@sigismund/v3-sdk" "3.10.0-airdao.3"
"@uniswap/swap-router-contracts" "1.1.0"

"@sigismund/sdk-core@4.0.7-airdao.1":
version "4.0.7-airdao.1"
resolved "https://registry.yarnpkg.com/@sigismund/sdk-core/-/sdk-core-4.0.7-airdao.1.tgz#497d22a39d59773246b724ee5d9eeca47a21120e"
integrity sha512-IatplwhfMHB2BhgkksDoRGdqx+H+UKb1wlef6OJK74dKETrjKljnmJMY3r+Pae34w6yKqX1SIZrqtqTX9Gru/Q==
dependencies:
"@ethersproject/address" "^5.0.2"
big.js "^5.2.2"
decimal.js-light "^2.5.0"
jsbi "^3.1.4"
tiny-invariant "^1.1.0"
toformat "^2.0.0"

"@sigismund/v2-sdk@3.2.3-airdao.5":
version "3.2.3-airdao.5"
resolved "https://registry.yarnpkg.com/@sigismund/v2-sdk/-/v2-sdk-3.2.3-airdao.5.tgz#7863560628a1fb3c24b2179ac16681d810c62f29"
integrity sha512-0genSS0kiKKZldBlEWx2t4VsDtFjALaS/IYDCDcwnUuWpVfcc9A86kdfjf2tkLkXWrNJqH2rL4xmWyaqgfav7Q==
dependencies:
"@ethersproject/address" "^5.0.0"
"@ethersproject/solidity" "^5.0.0"
"@sigismund/sdk-core" "4.0.7-airdao.1"
tiny-invariant "^1.1.0"
tiny-warning "^1.0.3"

"@sigismund/v3-sdk@3.10.0-airdao.3":
version "3.10.0-airdao.3"
resolved "https://registry.yarnpkg.com/@sigismund/v3-sdk/-/v3-sdk-3.10.0-airdao.3.tgz#4780a09a086baa0b059a6078fd14b5033b546cf0"
integrity sha512-2clqQ+qoxkeCD/0LB3zL8PyRFS4kFtVEotKL1Ebc2ftQ1N1BE9kqJTQlmSQguY67aVtFoz5CXcmwV4SSGOVsyA==
dependencies:
"@ethersproject/abi" "^5.0.12"
"@ethersproject/solidity" "^5.0.9"
"@sigismund/sdk-core" "4.0.7-airdao.1"
"@uniswap/swap-router-contracts" "^1.2.1"
"@uniswap/v3-periphery" "^1.1.1"
"@uniswap/v3-staker" "1.0.0"
tiny-invariant "^1.1.0"
tiny-warning "^1.0.3"

"@sinonjs/commons@^1.7.0":
version "1.8.3"
resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz"
Expand Down

0 comments on commit 9d60059

Please sign in to comment.