Skip to content

Commit

Permalink
[SWA-46] Move CoW api to Services
Browse files Browse the repository at this point in the history
  • Loading branch information
Wixzi committed Jul 21, 2023
1 parent dca8322 commit 309d30f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/services/LimitOrders/CoW/CoW.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { Currency, TokenAmount } from '@swapr/sdk'
import dayjs from 'dayjs'
import { formatUnits, parseUnits } from 'ethers/lib/utils'

import { getQuote } from '../../../pages/Swap/LimitOrder/api/cow'
import { getDefaultTokens } from '../LimitOrder.config'
import { Kind, WalletData, OrderExpiresInUnit, ProtocolContructor, LimitOrder } from '../LimitOrder.types'
import { LimitOrderBase } from '../LimitOrder.utils'

import { getQuote } from './api/cow'
import { type CoWQuote } from './CoW.types'

export class CoW extends LimitOrderBase {
Expand Down
3 changes: 2 additions & 1 deletion src/services/LimitOrders/CoW/CoW.types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { SigningResult } from '@cowprotocol/cow-sdk/dist/utils/sign'

import { getQuote } from '../../../pages/Swap/LimitOrder/api/cow'
import { LimitOrder } from '../LimitOrder.types'

import { getQuote } from './api/cow'

export interface SignedLimitOrder extends LimitOrder {
signature: string
signingScheme: SigningResult['signingScheme']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import contractNetworks from '@cowprotocol/contracts/networks.json'
import { OrderKind as CoWOrderKind } from '@cowprotocol/cow-sdk'
import type { UnsignedOrder } from '@cowprotocol/cow-sdk/dist/utils/sign'

import { Kind, LimitOrder } from '../../../../services/LimitOrders'
import { SignedLimitOrder } from '../../../../services/LimitOrders/CoW/CoW.types'
import cowAppData from '../generated/cow-app-data/app-data.json'
import { Kind, LimitOrder } from '../..'
import cowAppData from '../../../../pages/Swap/LimitOrder/generated/cow-app-data/app-data.json'
import { SignedLimitOrder } from '../CoW.types'
// import { LimitOrderKind, SerializableLimitOrder, SerializableSignedLimitOrder } from '../interfaces'

export const COW_APP_DATA = cowAppData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ChainId, CoWTrade } from '@swapr/sdk'
import { SigningScheme } from '@cowprotocol/contracts'
import { OrderKind as CoWOrderKind } from '@cowprotocol/cow-sdk'

import { LimitOrderKind, SerializableSignedLimitOrder } from '../../LimitOrderBox/interfaces'
import { LimitOrderKind, SerializableSignedLimitOrder } from '../../../../pages/Swap/LimitOrderBox/interfaces'

// import { LimitOrderKind, SerializableSignedLimitOrder } from '../interfaces'

Expand Down

0 comments on commit 309d30f

Please sign in to comment.