Skip to content

Commit

Permalink
fix vite
Browse files Browse the repository at this point in the history
  • Loading branch information
Max-3-7 committed Jun 19, 2024
1 parent 45b826d commit 31a0b5d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 24 deletions.
1 change: 1 addition & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"module": "dist/index.js",
"files": [
"dist"
],
Expand Down
20 changes: 10 additions & 10 deletions packages/core/src/entities/currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ export class CNATIVE extends NativeCurrency {
const symbol = [43113, 43114].includes(chainId)
? 'AVAX'
: 56 === chainId
? 'BNB'
: 97 === chainId
? 'tBNB'
: 5000 === chainId
? 'MNT'
: 'ETH'
? 'BNB'

Check failure on line 50 in packages/core/src/entities/currency.ts

View workflow job for this annotation

GitHub Actions / Verify / Lint

Delete `··`
: 97 === chainId

Check failure on line 51 in packages/core/src/entities/currency.ts

View workflow job for this annotation

GitHub Actions / Verify / Lint

Delete `··`
? 'tBNB'

Check failure on line 52 in packages/core/src/entities/currency.ts

View workflow job for this annotation

GitHub Actions / Verify / Lint

Delete `····`
: 5000 === chainId

Check failure on line 53 in packages/core/src/entities/currency.ts

View workflow job for this annotation

GitHub Actions / Verify / Lint

Replace `··········` with `······`
? 'MNT'

Check failure on line 54 in packages/core/src/entities/currency.ts

View workflow job for this annotation

GitHub Actions / Verify / Lint

Delete `······`
: 'ETH'

Check failure on line 55 in packages/core/src/entities/currency.ts

View workflow job for this annotation

GitHub Actions / Verify / Lint

Delete `······`
const name = [43113, 43114].includes(chainId)
? 'Avalanche'
: [56, 97].includes(chainId)
? 'BNB'
: 5000 === chainId
? 'Mantle'
: 'Ethereum'
? 'BNB'

Check failure on line 59 in packages/core/src/entities/currency.ts

View workflow job for this annotation

GitHub Actions / Verify / Lint

Delete `··`
: 5000 === chainId

Check failure on line 60 in packages/core/src/entities/currency.ts

View workflow job for this annotation

GitHub Actions / Verify / Lint

Delete `··`
? 'Mantle'

Check failure on line 61 in packages/core/src/entities/currency.ts

View workflow job for this annotation

GitHub Actions / Verify / Lint

Delete `····`
: 'Ethereum'
super(chainId, 18, symbol, name)
}
public equals(other: NativeCurrency): boolean {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export function parseBigintIsh(bigintIsh: BigintIsh): JSBI {
return bigintIsh instanceof JSBI
? bigintIsh
: typeof bigintIsh === 'bigint'
? JSBI.BigInt(bigintIsh.toString())
: JSBI.BigInt(bigintIsh)
? JSBI.BigInt(bigintIsh.toString())
: JSBI.BigInt(bigintIsh)
}

// mock the on-chain sqrt function
Expand Down
2 changes: 1 addition & 1 deletion packages/v1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"traderjoe-xyz",
"avalanche"
],
"module": "dist/sdk.esm.js",
"module": "dist/index.js",
"scripts": {
"test": "vitest --config ./vitest.config.ts",
"lint": "eslint \"src/**/*.ts*\" \"test/**/*.ts*\"",
Expand Down
16 changes: 8 additions & 8 deletions packages/v1/src/entities/trade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,14 @@ export class Trade {
tradeType === TradeType.EXACT_INPUT
? amount
: route.input.isNative
? CurrencyAmount.ether(chainId, amounts[0].raw)
: amounts[0]
? CurrencyAmount.ether(chainId, amounts[0].raw)
: amounts[0]
this.outputAmount =
tradeType === TradeType.EXACT_OUTPUT
? amount
: route.output.isNative
? CurrencyAmount.ether(chainId, amounts[amounts.length - 1].raw)
: amounts[amounts.length - 1]
? CurrencyAmount.ether(chainId, amounts[amounts.length - 1].raw)
: amounts[amounts.length - 1]
this.executionPrice = new Price(
this.inputAmount.currency,
this.outputAmount.currency,
Expand Down Expand Up @@ -317,8 +317,8 @@ export class Trade {
currencyAmountIn instanceof TokenAmount
? currencyAmountIn.token.chainId
: currencyOut instanceof Token
? currencyOut.chainId
: undefined
? currencyOut.chainId
: undefined
invariant(chainId !== undefined, 'CHAIN_ID')

const amountIn = wrappedAmount(currencyAmountIn, chainId)
Expand Down Expand Up @@ -419,8 +419,8 @@ export class Trade {
currencyAmountOut instanceof TokenAmount
? currencyAmountOut.token.chainId
: currencyIn instanceof Token
? currencyIn.chainId
: undefined
? currencyIn.chainId
: undefined
invariant(chainId !== undefined, 'CHAIN_ID')

const amountOut = wrappedAmount(currencyAmountOut, chainId)
Expand Down
6 changes: 3 additions & 3 deletions packages/v2/src/v2entities/trade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,9 @@ export class TradeV2 {
? currentTrade
: previousTrade
: currentTrade.trade.inputAmount.greaterThan('0') &&
currentTrade.swapOutcome.lessThan(previousTrade.swapOutcome)
? currentTrade
: previousTrade
currentTrade.swapOutcome.lessThan(previousTrade.swapOutcome)
? currentTrade
: previousTrade
)

return { bestTrade: bestTrade.trade, estimatedGas: bestTrade.estimatedGas }
Expand Down

0 comments on commit 31a0b5d

Please sign in to comment.