• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cowprotocol / cow-sdk / 13048394494

30 Jan 2025 08:29AM UTC coverage: 78.102% (-0.7%) from 78.851%
13048394494

push

github

shoom3301
fix(trading-sdk): fix eth-flow

287 of 401 branches covered (71.57%)

Branch coverage included in aggregate %.

0 of 2 new or added lines in 2 files covered. (0.0%)

8 existing lines in 2 files now uncovered.

651 of 800 relevant lines covered (81.38%)

19.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

33.33
/src/trading/postSellNativeCurrencyOrder.ts
1
import { Signer } from 'ethers'
2
import { AppDataInfo, LimitTradeParametersFromQuote } from './types'
3
import { EthFlowOrderExistsCallback } from './calculateUniqueOrderId'
4

5
import { log } from './consts'
6
import { OrderBookApi } from '../order-book'
7
import { getEthFlowTransaction } from './getEthFlowTransaction'
8

9
export async function postSellNativeCurrencyOrder(
10
  orderBookApi: OrderBookApi,
11
  signer: Signer,
12
  appData: Pick<AppDataInfo, 'fullAppData' | 'appDataKeccak256'>,
13
  _params: LimitTradeParametersFromQuote,
14
  networkCostsAmount = '0',
3✔
15
  checkEthFlowOrderExists?: EthFlowOrderExistsCallback
16
): Promise<{ txHash: string; orderId: string }> {
17
  const { appDataKeccak256, fullAppData } = appData
4✔
18

19
  const { orderId, transaction } = await getEthFlowTransaction(
4✔
20
    signer,
21
    appDataKeccak256,
22
    _params,
23
    orderBookApi.context.chainId,
24
    networkCostsAmount,
25
    checkEthFlowOrderExists
26
  )
27

UNCOV
28
  log('Uploading app-data')
×
UNCOV
29
  await orderBookApi.uploadAppData(appDataKeccak256, fullAppData)
×
30

UNCOV
31
  log('Sending on-chain order transaction')
×
UNCOV
32
  const txReceipt = await signer.sendTransaction(transaction)
×
33

UNCOV
34
  log(`On-chain order transaction sent, txHash: ${txReceipt.hash}, order: ${orderId}`)
×
UNCOV
35
  return { txHash: txReceipt.hash, orderId }
×
36
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc