Skip to content

Commit

Permalink
chore: cleanup small mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
CumpsD committed Nov 26, 2024
1 parent f147a1f commit 3d7600e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/swapper/src/swappers/ChainflipSwapper/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const chainflipApi: SwapperApi = {

if (!isExecutableTradeStep(step)) throw Error('Unable to execute step')

// For DCA swaps we already opened a deposit address in getTradeRate, we only need to open for regular swaps
// For DCA swaps we already opened a deposit address in getTradeQuote, we only need to open for regular swaps
if (!step.chainflipDepositAddress) {
const brokerUrl = config.REACT_APP_CHAINFLIP_API_URL
const apiKey = config.REACT_APP_CHAINFLIP_API_KEY
Expand Down Expand Up @@ -174,7 +174,7 @@ export const chainflipApi: SwapperApi = {

const adapter = assertGetUtxoChainAdapter(step.sellAsset.chainId)

// For DCA swaps we already opened a deposit address in getTradeRate, we only need to open for regular swaps
// For DCA swaps we already opened a deposit address in getTradeQuote, we only need to open for regular swaps
if (!step.chainflipDepositAddress) {
const brokerUrl = config.REACT_APP_CHAINFLIP_API_URL
const apiKey = config.REACT_APP_CHAINFLIP_API_KEY
Expand Down Expand Up @@ -268,7 +268,7 @@ export const chainflipApi: SwapperApi = {

if (!isExecutableTradeStep(step)) throw Error('Unable to execute step')

// For DCA swaps we already opened a deposit address in getTradeRate, we only need to open for regular swaps
// For DCA swaps we already opened a deposit address in getTradeQuote, we only need to open for regular swaps
if (!step.chainflipDepositAddress) {
const brokerUrl = config.REACT_APP_CHAINFLIP_API_URL
const apiKey = config.REACT_APP_CHAINFLIP_API_KEY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import {
} from '../utils/helpers'
import { _getTradeRate } from './getTradeRate'

// This isn't a mistake. A trade quote *is* a trade rate. Chainflip doesn't really have a notion of a trade rate,
// they do have a notion of a "swap" (which we effectively only use to get the deposit address), which is irrelevant to the notion of quote vs. rate
export const getTradeQuote = async (
input: CommonTradeQuoteInput,
deps: SwapperDeps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const getChainFlipSwap = ({
refundAddress,
retryDurationInBlocks = 10,
commissionBps,
numberOfChunks = undefined,
numberOfChunks,
chunkIntervalBlocks = 2,
}: GetChainFlipSwapArgs): Promise<
Result<AxiosResponse<ChainflipBaasSwapDepositAddress, any>, SwapErrorRight>
Expand All @@ -116,7 +116,7 @@ export const getChainFlipSwap = ({
`&retryDurationInBlocks=${retryDurationInBlocks}` +
`&commissionBps=${commissionBps}`

if (numberOfChunks) {
if (numberOfChunks && chunkIntervalBlocks) {
swapUrl += `&numberOfChunks=${numberOfChunks}`
swapUrl += `&chunkIntervalBlocks=${chunkIntervalBlocks}`
}
Expand Down
2 changes: 1 addition & 1 deletion packages/swapper/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import type { TypedData } from 'eip-712'
import type { InterpolationOptions } from 'node-polyglot'
import type { Address } from 'viem'

import type { CowMessageToSign, CowSwapQuoteResponse } from './swappers/CowSwapper'
import type { CowMessageToSign, CowSwapQuoteResponse } from './swappers/CowSwapper/types'
import type { makeSwapperAxiosServiceMonadic } from './utils'

// TODO: Rename all properties in this type to be camel case and not react specific
Expand Down

0 comments on commit 3d7600e

Please sign in to comment.