diff --git a/packages/checkout/sdk/src/gasEstimate/gasEstimator.test.ts b/packages/checkout/sdk/src/gasEstimate/gasEstimator.test.ts index abf72dfc4b..b637f388ad 100644 --- a/packages/checkout/sdk/src/gasEstimate/gasEstimator.test.ts +++ b/packages/checkout/sdk/src/gasEstimate/gasEstimator.test.ts @@ -91,6 +91,7 @@ describe('gasServiceEstimator', () => { name: 'TEST', decimals: 18, chainId: 1, + type: 'erc20', }, }, }, @@ -150,6 +151,7 @@ describe('gasServiceEstimator', () => { name: 'TEST', decimals: 18, chainId: 1, + type: 'erc20', }, }, }, diff --git a/packages/checkout/sdk/src/smartCheckout/routing/bridgeAndSwap/bridgeAndSwapRoute.test.ts b/packages/checkout/sdk/src/smartCheckout/routing/bridgeAndSwap/bridgeAndSwapRoute.test.ts index 24d6b914c6..fe10d54f38 100644 --- a/packages/checkout/sdk/src/smartCheckout/routing/bridgeAndSwap/bridgeAndSwapRoute.test.ts +++ b/packages/checkout/sdk/src/smartCheckout/routing/bridgeAndSwap/bridgeAndSwapRoute.test.ts @@ -163,7 +163,7 @@ describe('bridgeAndSwapRoute', () => { }, ], } as Quote, - approval: undefined, + approval: null, swap: null, }; const dexQuoteETH: DexQuote = { @@ -194,7 +194,7 @@ describe('bridgeAndSwapRoute', () => { }, ], } as Quote, - approval: undefined, + approval: null, swap: null, }; diff --git a/packages/checkout/sdk/src/smartCheckout/routing/bridgeAndSwap/constructBridgeRequirements.test.ts b/packages/checkout/sdk/src/smartCheckout/routing/bridgeAndSwap/constructBridgeRequirements.test.ts index 5658fb8ce0..fd377c0995 100644 --- a/packages/checkout/sdk/src/smartCheckout/routing/bridgeAndSwap/constructBridgeRequirements.test.ts +++ b/packages/checkout/sdk/src/smartCheckout/routing/bridgeAndSwap/constructBridgeRequirements.test.ts @@ -1,5 +1,5 @@ import { BigNumber } from 'ethers'; -import { TokenInfo as DexTokenInfo } from '@imtbl/dex-sdk'; +import { ERC20 as DexTokenInfo } from '@imtbl/dex-sdk'; import { DexQuote } from '../types'; import { ChainId, @@ -26,7 +26,7 @@ describe('constructBridgeRequirements', () => { approval?: number, ) => { const dexQuote: DexQuote = { - approval: undefined, + approval: null, swap: null, quote: { amount: { @@ -75,6 +75,7 @@ describe('constructBridgeRequirements', () => { decimals: 18, symbol: 'ERC20', name: 'ERC20', + type: 'erc20', }; const swapTokenInfoB: DexTokenInfo = { @@ -83,6 +84,7 @@ describe('constructBridgeRequirements', () => { decimals: 18, symbol: 'ERC20', name: 'ERC20', + type: 'erc20', }; const feesTokenInfo: DexTokenInfo = { @@ -91,6 +93,7 @@ describe('constructBridgeRequirements', () => { decimals: 18, symbol: 'ERC20', name: 'ERC20', + type: 'erc20', }; const dexQuoteA = constructDexQuote( @@ -195,6 +198,7 @@ describe('constructBridgeRequirements', () => { decimals: 18, symbol: 'ETH', name: 'ETH', + type: 'erc20', }; const feesTokenInfo: DexTokenInfo = { @@ -203,6 +207,7 @@ describe('constructBridgeRequirements', () => { decimals: 18, symbol: 'IMX', name: 'IMX', + type: 'erc20', }; const ethDexQuote = constructDexQuote( @@ -278,6 +283,7 @@ describe('constructBridgeRequirements', () => { decimals: 18, symbol: 'ERC20', name: 'ERC20', + type: 'erc20', }; const swapTokenInfoB: DexTokenInfo = { @@ -286,6 +292,7 @@ describe('constructBridgeRequirements', () => { decimals: 18, symbol: 'ERC20', name: 'ERC20', + type: 'erc20', }; const feesTokenInfo: DexTokenInfo = { @@ -294,6 +301,7 @@ describe('constructBridgeRequirements', () => { decimals: 18, symbol: 'ERC20', name: 'ERC20', + type: 'erc20', }; const dexQuoteA = constructDexQuote( @@ -394,6 +402,7 @@ describe('constructBridgeRequirements', () => { decimals: 18, symbol: '0xIMX', name: '0xIMX', + type: 'erc20', }; const feesTokenInfo: DexTokenInfo = { @@ -402,6 +411,7 @@ describe('constructBridgeRequirements', () => { decimals: 18, symbol: '0xIMX', name: '0xIMX', + type: 'erc20', }; const dexQuote = constructDexQuote( @@ -487,6 +497,7 @@ describe('constructBridgeRequirements', () => { decimals: 18, symbol: '0xL2', name: '0xL2', + type: 'erc20', }; const feesTokenInfo: DexTokenInfo = { @@ -495,6 +506,7 @@ describe('constructBridgeRequirements', () => { decimals: 18, symbol: '0xIMX', name: '0xIMX', + type: 'erc20', }; const dexQuote = constructDexQuote( diff --git a/packages/checkout/sdk/src/smartCheckout/routing/routingCalculator.test.ts b/packages/checkout/sdk/src/smartCheckout/routing/routingCalculator.test.ts index ae45c22b52..51fe931ca2 100644 --- a/packages/checkout/sdk/src/smartCheckout/routing/routingCalculator.test.ts +++ b/packages/checkout/sdk/src/smartCheckout/routing/routingCalculator.test.ts @@ -1,7 +1,7 @@ import { BigNumber, utils } from 'ethers'; import { Environment } from '@imtbl/config'; import { JsonRpcProvider } from '@ethersproject/providers'; -import { TokenInfo } from '@imtbl/dex-sdk'; +import { ERC20 } from '@imtbl/dex-sdk'; import { getBridgeAndSwapFundingSteps, getSwapFundingSteps, @@ -67,11 +67,11 @@ describe('routingCalculator', () => { symbol: 'ERC20_2', decimals: 18, address: '0xERC20_2', - } as TokenInfo, + } as ERC20, }, amountWithMaxSlippage: { value: BigNumber.from(1), - token: {} as TokenInfo, + token: {} as ERC20, }, slippage: 0, fees: [ @@ -84,7 +84,7 @@ describe('routingCalculator', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, - } as TokenInfo, + } as ERC20, }, recipient: '', basisPoints: 0, @@ -99,11 +99,11 @@ describe('routingCalculator', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, - } as TokenInfo, + } as ERC20, }, swap: { value: BigNumber.from(1), - token: {} as TokenInfo, + token: {} as ERC20, }, }, ], @@ -123,11 +123,11 @@ describe('routingCalculator', () => { symbol: 'ERC20_1', decimals: 18, address: '0xERC20_1', - } as TokenInfo, + } as ERC20, }, amountWithMaxSlippage: { value: BigNumber.from(2), - token: {} as TokenInfo, + token: {} as ERC20, }, slippage: 0, fees: [ @@ -140,7 +140,7 @@ describe('routingCalculator', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, - } as TokenInfo, + } as ERC20, }, recipient: '', basisPoints: 0, @@ -155,11 +155,11 @@ describe('routingCalculator', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, - } as TokenInfo, + } as ERC20, }, swap: { value: BigNumber.from(2), - token: {} as TokenInfo, + token: {} as ERC20, }, }, ], diff --git a/packages/checkout/sdk/src/smartCheckout/routing/swap/dexQuoteCache.test.ts b/packages/checkout/sdk/src/smartCheckout/routing/swap/dexQuoteCache.test.ts index 20172c0149..d684d0dd13 100644 --- a/packages/checkout/sdk/src/smartCheckout/routing/swap/dexQuoteCache.test.ts +++ b/packages/checkout/sdk/src/smartCheckout/routing/swap/dexQuoteCache.test.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { TokenInfo } from '@imtbl/dex-sdk'; +import { ERC20 } from '@imtbl/dex-sdk'; import { BigNumber } from 'ethers'; import { Environment } from '@imtbl/config'; import { getOrSetQuotesFromCache } from './dexQuoteCache'; @@ -27,18 +27,18 @@ describe('dexQuoteCache', () => { quote: { amount: { value: BigNumber.from(1), - token: {} as TokenInfo, + token: {} as ERC20, }, amountWithMaxSlippage: { value: BigNumber.from(1), - token: {} as TokenInfo, + token: {} as ERC20, }, slippage: 0, fees: [ { amount: { value: BigNumber.from(1), - token: {} as TokenInfo, + token: {} as ERC20, }, recipient: '', basisPoints: 0, @@ -47,11 +47,11 @@ describe('dexQuoteCache', () => { }, approval: { value: BigNumber.from(1), - token: {} as TokenInfo, + token: {} as ERC20, }, swap: { value: BigNumber.from(1), - token: {} as TokenInfo, + token: {} as ERC20, }, }, ], @@ -65,18 +65,18 @@ describe('dexQuoteCache', () => { quote: { amount: { value: BigNumber.from(2), - token: {} as TokenInfo, + token: {} as ERC20, }, amountWithMaxSlippage: { value: BigNumber.from(2), - token: {} as TokenInfo, + token: {} as ERC20, }, slippage: 0, fees: [ { amount: { value: BigNumber.from(2), - token: {} as TokenInfo, + token: {} as ERC20, }, recipient: '', basisPoints: 0, @@ -85,11 +85,11 @@ describe('dexQuoteCache', () => { }, approval: { value: BigNumber.from(2), - token: {} as TokenInfo, + token: {} as ERC20, }, swap: { value: BigNumber.from(2), - token: {} as TokenInfo, + token: {} as ERC20, }, }, ], @@ -120,18 +120,18 @@ describe('dexQuoteCache', () => { quote: { amount: { value: BigNumber.from(1), - token: {} as TokenInfo, + token: {} as ERC20, }, amountWithMaxSlippage: { value: BigNumber.from(1), - token: {} as TokenInfo, + token: {} as ERC20, }, slippage: 0, fees: [ { amount: { value: BigNumber.from(1), - token: {} as TokenInfo, + token: {} as ERC20, }, recipient: '', basisPoints: 0, @@ -140,11 +140,11 @@ describe('dexQuoteCache', () => { }, approval: { value: BigNumber.from(1), - token: {} as TokenInfo, + token: {} as ERC20, }, swap: { value: BigNumber.from(1), - token: {} as TokenInfo, + token: {} as ERC20, }, }, ], @@ -166,18 +166,18 @@ describe('dexQuoteCache', () => { quote: { amount: { value: BigNumber.from(2), - token: {} as TokenInfo, + token: {} as ERC20, }, amountWithMaxSlippage: { value: BigNumber.from(2), - token: {} as TokenInfo, + token: {} as ERC20, }, slippage: 0, fees: [ { amount: { value: BigNumber.from(2), - token: {} as TokenInfo, + token: {} as ERC20, }, recipient: '', basisPoints: 0, @@ -186,11 +186,11 @@ describe('dexQuoteCache', () => { }, approval: { value: BigNumber.from(2), - token: {} as TokenInfo, + token: {} as ERC20, }, swap: { value: BigNumber.from(2), - token: {} as TokenInfo, + token: {} as ERC20, }, }, ], @@ -222,18 +222,18 @@ describe('dexQuoteCache', () => { quote: { amount: { value: BigNumber.from(1), - token: {} as TokenInfo, + token: {} as ERC20, }, amountWithMaxSlippage: { value: BigNumber.from(1), - token: {} as TokenInfo, + token: {} as ERC20, }, slippage: 0, fees: [ { amount: { value: BigNumber.from(1), - token: {} as TokenInfo, + token: {} as ERC20, }, recipient: '', basisPoints: 0, @@ -242,11 +242,11 @@ describe('dexQuoteCache', () => { }, approval: { value: BigNumber.from(1), - token: {} as TokenInfo, + token: {} as ERC20, }, swap: { value: BigNumber.from(1), - token: {} as TokenInfo, + token: {} as ERC20, }, }, ], diff --git a/packages/checkout/sdk/src/smartCheckout/routing/swap/quoteFetcher.test.ts b/packages/checkout/sdk/src/smartCheckout/routing/swap/quoteFetcher.test.ts index 5227d9a12d..66853a199f 100644 --- a/packages/checkout/sdk/src/smartCheckout/routing/swap/quoteFetcher.test.ts +++ b/packages/checkout/sdk/src/smartCheckout/routing/swap/quoteFetcher.test.ts @@ -1,7 +1,7 @@ import { Environment } from '@imtbl/config'; import { BigNumber } from 'ethers'; import { - TokenInfo, + ERC20, TransactionDetails, TransactionResponse, } from '@imtbl/dex-sdk'; @@ -29,18 +29,18 @@ describe('quoteFetcher', () => { quote: { amount: { value: BigNumber.from(quoteAmount), - token: {} as TokenInfo, + token: {} as ERC20, }, amountWithMaxSlippage: { value: BigNumber.from(quoteAmount), - token: {} as TokenInfo, + token: {} as ERC20, }, slippage: 0, fees: [ { amount: { value: BigNumber.from(feeAmount), - token: {} as TokenInfo, + token: {} as ERC20, }, recipient: '', basisPoints: 0, @@ -53,7 +53,7 @@ describe('quoteFetcher', () => { if (swapGasFeeEstimate) { transactionResponse.swap.gasFeeEstimate = { value: BigNumber.from(swapGasFeeEstimate), - token: {} as TokenInfo, + token: {} as ERC20, }; } @@ -61,7 +61,7 @@ describe('quoteFetcher', () => { transactionResponse.approval = { gasFeeEstimate: { value: BigNumber.from(approvalGasFeeEstimate), - token: {} as TokenInfo, + token: {} as ERC20, }, } as TransactionDetails; } @@ -76,23 +76,23 @@ describe('quoteFetcher', () => { approval?: number, ) => { const dexQuote: DexQuote = { - approval: undefined, + approval: null, swap: null, quote: { amount: { value: BigNumber.from(quoteAmount), - token: {} as TokenInfo, + token: {} as ERC20, }, amountWithMaxSlippage: { value: BigNumber.from(quoteAmount), - token: {} as TokenInfo, + token: {} as ERC20, }, slippage: 0, fees: [ { amount: { value: BigNumber.from(feeAmount), - token: {} as TokenInfo, + token: {} as ERC20, }, recipient: '', basisPoints: 0, @@ -104,14 +104,14 @@ describe('quoteFetcher', () => { if (swap) { dexQuote.swap = { value: BigNumber.from(swap), - token: {} as TokenInfo, + token: {} as ERC20, }; } if (approval) { dexQuote.approval = { value: BigNumber.from(approval), - token: {} as TokenInfo, + token: {} as ERC20, }; } diff --git a/packages/checkout/sdk/src/smartCheckout/routing/swap/quoteFetcher.ts b/packages/checkout/sdk/src/smartCheckout/routing/swap/quoteFetcher.ts index a3e963a700..3ed5e7bf0b 100644 --- a/packages/checkout/sdk/src/smartCheckout/routing/swap/quoteFetcher.ts +++ b/packages/checkout/sdk/src/smartCheckout/routing/swap/quoteFetcher.ts @@ -46,7 +46,7 @@ export const quoteFetcher = async ( const swappableToken = fromToken[index]; dexQuotes.set(swappableToken, { quote: response.value.quote, - approval: response.value.approval?.gasFeeEstimate, + approval: response.value.approval?.gasFeeEstimate ?? null, swap: response.value.swap.gasFeeEstimate, }); }); diff --git a/packages/checkout/sdk/src/smartCheckout/routing/swap/swapRoute.test.ts b/packages/checkout/sdk/src/smartCheckout/routing/swap/swapRoute.test.ts index f80e58fb1e..1624280f66 100644 --- a/packages/checkout/sdk/src/smartCheckout/routing/swap/swapRoute.test.ts +++ b/packages/checkout/sdk/src/smartCheckout/routing/swap/swapRoute.test.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/naming-convention */ import { Environment } from '@imtbl/config'; -import { Fee, TokenInfo } from '@imtbl/dex-sdk'; +import { Fee, ERC20 } from '@imtbl/dex-sdk'; import { BigNumber, utils } from 'ethers'; import { CheckoutConfiguration } from '../../../config'; import { BalanceRequirement, BalanceCheckResult } from '../../balanceCheck/types'; @@ -48,11 +48,11 @@ describe('swapRoute', () => { symbol: 'ERC20_2', decimals: 18, address: '0xERC20_2', - } as TokenInfo, + } as ERC20, }, amountWithMaxSlippage: { value: BigNumber.from(1), - token: {} as TokenInfo, + token: {} as ERC20, }, slippage: 0, fees: [ @@ -65,7 +65,7 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, - } as TokenInfo, + } as ERC20, }, recipient: '', basisPoints: 0, @@ -80,7 +80,7 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, - } as TokenInfo, + } as ERC20, }, swap: { value: BigNumber.from(2), @@ -90,7 +90,7 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, - } as TokenInfo, + } as ERC20, }, }, ], @@ -105,11 +105,11 @@ describe('swapRoute', () => { symbol: 'ERC20_3', decimals: 18, address: '0xERC20_3', - } as TokenInfo, + } as ERC20, }, amountWithMaxSlippage: { value: BigNumber.from(1), - token: {} as TokenInfo, + token: {} as ERC20, }, slippage: 0, fees: [ @@ -122,7 +122,7 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, - } as TokenInfo, + } as ERC20, }, recipient: '', basisPoints: 0, @@ -137,7 +137,7 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, - } as TokenInfo, + } as ERC20, }, swap: { value: BigNumber.from(2), @@ -147,7 +147,7 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, - } as TokenInfo, + } as ERC20, }, }, ], @@ -167,11 +167,11 @@ describe('swapRoute', () => { symbol: 'ERC20_1', decimals: 18, address: '0xERC20_1', - } as TokenInfo, + } as ERC20, }, amountWithMaxSlippage: { value: BigNumber.from(2), - token: {} as TokenInfo, + token: {} as ERC20, }, slippage: 0, fees: [ @@ -184,7 +184,7 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, - } as TokenInfo, + } as ERC20, }, recipient: '', basisPoints: 0, @@ -199,11 +199,11 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, - } as TokenInfo, + } as ERC20, }, swap: { value: BigNumber.from(2), - token: {} as TokenInfo, + token: {} as ERC20, }, }, ], @@ -1275,7 +1275,7 @@ describe('swapRoute', () => { }, }, ], - undefined, + null, ); expect(approvalFees).toEqual( @@ -1298,6 +1298,7 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, + type: 'erc20', }, }, ); @@ -1333,6 +1334,7 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, + type: 'erc20', }, }, ); @@ -1368,6 +1370,7 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, + type: 'erc20', }, }, ); @@ -1403,6 +1406,7 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, + type: 'erc20', }, }, ); @@ -1444,6 +1448,7 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, + type: 'erc20', }, }, }, @@ -1496,6 +1501,7 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, + type: 'erc20', }, }, }, @@ -1571,6 +1577,7 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: '0xERC20_1', + type: 'erc20', }, }, }, @@ -1585,6 +1592,7 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: '0xERC20_2', + type: 'erc20', }, }, }, @@ -1599,6 +1607,7 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: '0xERC20_3', + type: 'erc20', }, }, }, @@ -1652,6 +1661,7 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, + type: 'erc20', }, }, }, @@ -1704,6 +1714,7 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: IMX_ADDRESS_ZKEVM, + type: 'erc20', }, }, }, @@ -1756,6 +1767,7 @@ describe('swapRoute', () => { symbol: 'IMX', decimals: 18, address: '0xERC20', + type: 'erc20', }, }, }, @@ -1909,6 +1921,7 @@ describe('swapRoute', () => { symbol: 'ERC20', decimals: 18, address: '0xERC20', + type: 'erc20', }, }, }, @@ -1923,6 +1936,7 @@ describe('swapRoute', () => { symbol: 'ERC20', decimals: 18, address: '0xERC20', + type: 'erc20', }, }, }, @@ -2029,6 +2043,7 @@ describe('swapRoute', () => { symbol: 'ERC20', decimals: 18, address: '0xERC20', + type: 'erc20', }, }, }, @@ -2043,6 +2058,7 @@ describe('swapRoute', () => { symbol: 'ERC20', decimals: 18, address: '0xERC20', + type: 'erc20', }, }, }, diff --git a/packages/checkout/sdk/src/smartCheckout/routing/swap/swapRoute.ts b/packages/checkout/sdk/src/smartCheckout/routing/swap/swapRoute.ts index bb72777a8a..8f2bb0baf4 100644 --- a/packages/checkout/sdk/src/smartCheckout/routing/swap/swapRoute.ts +++ b/packages/checkout/sdk/src/smartCheckout/routing/swap/swapRoute.ts @@ -1,5 +1,5 @@ import { BigNumber, utils } from 'ethers'; -import { Amount, Fee } from '@imtbl/dex-sdk'; +import { Amount, ERC20, Fee } from '@imtbl/dex-sdk'; import { CheckoutConfiguration, getL2ChainId } from '../../../config'; import { AvailableRoutingOptions, @@ -17,8 +17,8 @@ import { DexQuoteCache, TokenBalanceResult } from '../types'; import { getOrSetQuotesFromCache } from './dexQuoteCache'; const constructFees = ( - approvalGasFees: Amount | null | undefined, - swapGasFees: Amount | null, + approvalGasFees: Amount | null | undefined, + swapGasFees: Amount | null, swapFees: Fee[], ): SwapFees => { let approvalGasFeeAmount = BigNumber.from(0); @@ -137,7 +137,7 @@ export const getRequiredToken = ( type SufficientApprovalFees = { sufficient: boolean, approvalGasFee: BigNumber, approvalGasTokenAddress: string }; export const checkUserCanCoverApprovalFees = ( l2Balances: GetBalanceResult[], - approval: Amount | null | undefined, + approval: Amount | null, ): SufficientApprovalFees => { // Check if approval required if (!approval) return { sufficient: true, approvalGasFee: BigNumber.from(0), approvalGasTokenAddress: '' }; diff --git a/packages/checkout/sdk/src/smartCheckout/routing/types.ts b/packages/checkout/sdk/src/smartCheckout/routing/types.ts index 3ed6a69141..e663d359e5 100644 --- a/packages/checkout/sdk/src/smartCheckout/routing/types.ts +++ b/packages/checkout/sdk/src/smartCheckout/routing/types.ts @@ -1,4 +1,4 @@ -import { Amount, Quote } from '@imtbl/dex-sdk'; +import { Amount, ERC20, Quote } from '@imtbl/dex-sdk'; import { ChainId, GetBalanceResult, @@ -19,6 +19,6 @@ export type DexQuoteCache = Map; export type DexQuotes = Map; export type DexQuote = { quote: Quote, - approval: Amount | null | undefined, - swap: Amount | null, + approval: Amount | null, + swap: Amount | null, }; diff --git a/packages/internal/dex/sdk/package.json b/packages/internal/dex/sdk/package.json index 833fbc4bcb..23a4ff1262 100644 --- a/packages/internal/dex/sdk/package.json +++ b/packages/internal/dex/sdk/package.json @@ -45,7 +45,8 @@ "lint": "eslint ./src --ext .ts --max-warnings=0", "lint:fix": "cd ../../../.. && yarn wsrun -p @imtbl/dex-sdk -c lint --fix", "test": "jest test", - "test:watch": "jest --watch" + "test:watch": "jest --watch", + "typecheck": "tsc --noEmit" }, "source": "src/index.ts", "type": "module", diff --git a/packages/internal/dex/sdk/src/constants/tokens/immutable-testnet.ts b/packages/internal/dex/sdk/src/constants/tokens/immutable-testnet.ts index ccd2bec413..3b7b5037f4 100644 --- a/packages/internal/dex/sdk/src/constants/tokens/immutable-testnet.ts +++ b/packages/internal/dex/sdk/src/constants/tokens/immutable-testnet.ts @@ -1,14 +1,15 @@ import { IMMUTABLE_TESTNET_CHAIN_ID } from 'constants/chains'; -import { TokenInfo } from 'types'; +import { ERC20 } from 'types'; -export const TIMX_IMMUTABLE_TESTNET: TokenInfo = { +export const TIMX_IMMUTABLE_TESTNET: ERC20 = { chainId: IMMUTABLE_TESTNET_CHAIN_ID, address: '0x0000000000000000000000000000000000001010', decimals: 18, symbol: 'tIMX', name: 'Immutable Testnet Token', + type: 'erc20', }; -export const IMMUTABLE_TESTNET_COMMON_ROUTING_TOKENS: TokenInfo[] = [ +export const IMMUTABLE_TESTNET_COMMON_ROUTING_TOKENS: ERC20[] = [ TIMX_IMMUTABLE_TESTNET, ]; diff --git a/packages/internal/dex/sdk/src/types/index.ts b/packages/internal/dex/sdk/src/types/index.ts index 4c256cf3bc..5b9099b7f5 100644 --- a/packages/internal/dex/sdk/src/types/index.ts +++ b/packages/internal/dex/sdk/src/types/index.ts @@ -39,7 +39,7 @@ export type SecondaryFee = { export type Fee = { recipient: string; basisPoints: number; - amount: Amount; + amount: Amount; }; /** diff --git a/packages/internal/economy-building-blocks/playground/.gitignore b/packages/internal/economy-building-blocks/playground/.gitignore index f94c9e6ce9..172193e064 100644 --- a/packages/internal/economy-building-blocks/playground/.gitignore +++ b/packages/internal/economy-building-blocks/playground/.gitignore @@ -1,3 +1,4 @@ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. .yarn +build