Skip to content

Commit 1d6bd20

Browse files
committed
chore: remove logs - bump version
1 parent 97bc9b6 commit 1d6bd20

File tree

8 files changed

+12
-38
lines changed

8 files changed

+12
-38
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cowprotocol/cow-sdk",
3-
"version": "6.3.2-RC.1",
3+
"version": "6.3.2-RC.2",
44
"license": "(MIT OR Apache-2.0)",
55
"files": [
66
"/dist"

src/bridging/BridgingSdk/getCrossChainOrder.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,9 @@ interface GetCrossChainOrderParams {
2020
export async function getCrossChainOrder(params: GetCrossChainOrderParams): Promise<CrossChainOrder | null> {
2121
const { chainId, orderId, orderBookApi, providers, env } = params
2222

23-
console.log('SDK getCrossChainOrder params ==>', params)
24-
2523
const chainContext = { chainId, env }
2624
const order = await orderBookApi.getOrder(orderId, chainContext)
2725

28-
console.log('SDKgetCrossChainOrder order ==>', order)
29-
3026
// Find the provider by name (note that I could just have use this.provider, but just wanted to leave it ready in case we implement multiple providers)
3127
const provider = order.fullAppData && findBridgeProviderFromHook(order.fullAppData, providers)
3228
if (!provider) {
@@ -41,8 +37,6 @@ export async function getCrossChainOrder(params: GetCrossChainOrderParams): Prom
4137
// Check if there are any trades for this order
4238
const trades = await orderBookApi.getTrades({ orderUid: order.uid }, chainContext)
4339

44-
console.log('SDK getCrossChainOrder trades ==>', trades)
45-
4640
if (trades.length > 0) {
4741
// Bridging already initiated
4842
const firstTrade = trades[0]
@@ -58,11 +52,7 @@ export async function getCrossChainOrder(params: GetCrossChainOrderParams): Prom
5852
const { params: bridgingParams, status: statusResult } =
5953
(await provider.getBridgingParams(chainId, orderId, tradeTxHash)) || {}
6054

61-
console.log('SDK getCrossChainOrder bridgingParams ==>', bridgingParams)
62-
console.log('SDK getCrossChainOrder statusResult ==>', statusResult)
63-
6455
if (!bridgingParams || !statusResult) {
65-
console.log('SDK getCrossChainOrder bridgingParams || !statusResult ==>', bridgingParams || !statusResult)
6656
throw new BridgeOrderParsingError(`Bridging params cannot be derived from transaction: ${tradeTxHash}`)
6757
}
6858

@@ -80,15 +70,13 @@ export async function getCrossChainOrder(params: GetCrossChainOrderParams): Prom
8070
try {
8171
const explorerUrl = provider.getExplorerUrl(bridgingParams.bridgingId)
8272

83-
console.log('SDK getCrossChainOrder explorerUrl ==>', explorerUrl)
84-
8573
return {
8674
...state,
8775
statusResult,
8876
explorerUrl,
8977
}
9078
} catch (e) {
91-
console.error('SDK getCrossChainOrder Cannot get bridging status', e)
79+
console.error('Cannot get bridging status', e)
9280
return state
9381
}
9482
}

src/bridging/PROVIDER_README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,11 @@ export class YourBridgeProvider implements BridgeProvider<YourBridgeQuoteResult>
385385
): Promise<number> {
386386
// Use utility function or implement custom gas estimation
387387
return getGasLimitEstimationForHook(
388-
this.cowShedSdk,
389-
request as QuoteBridgeRequest, // cast needed due to omit
390-
this.getRpcProvider(request.sellTokenChainId),
391-
request.extraGas, // to add extra gas to the hook.
388+
cowshed: this.cowShedSdk,
389+
request: request as QuoteBridgeRequest, // cast needed due to omit
390+
provider: this.getRpcProvider(request.sellTokenChainId),
391+
extraGas: request.extraGas, // to add extra gas to the hook
392+
extraGasProxyCreation: request.extraGasProxyCreation // to add extra gas to the hook and deploy proxy account
392393
)
393394
}
394395

src/bridging/providers/bungee/BungeeApi.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,6 @@ export class BungeeApi {
338338
params,
339339
isValidBungeeEventsResponse,
340340
)
341-
console.log('SDK getEvents response ==>', response)
342341
if (!response.success) {
343342
throw new BridgeProviderError('Bungee Events Api Error', response)
344343
}
@@ -502,7 +501,7 @@ function isValidBungeeEventsResponse(response: unknown): response is BungeeEvent
502501
'fromChainId' in e &&
503502
'isCowswapTrade' in e &&
504503
'orderId' in e &&
505-
'recipient' in e &&
504+
// 'recipient' in e &&
506505
'sender' in e &&
507506
'srcTxStatus' in e &&
508507
'destTxStatus' in e

src/bridging/providers/bungee/BungeeBridgeProvider.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,7 @@ export class BungeeBridgeProvider implements BridgeProvider<BungeeQuoteResult> {
210210
orderId: string,
211211
_txHash: string,
212212
): Promise<{ params: BridgingDepositParams; status: BridgeStatusResult } | null> {
213-
console.log('SDK getBridgingParams orderId ==>', orderId)
214-
console.log('SDK getBridgingParams txHash ==>', _txHash)
215213
const events = await this.api.getEvents({ orderId })
216-
console.log('SDK getBridgingParams events ==>', events)
217214
const event = events?.[0]
218215

219216
if (!event) return null

src/bridging/providers/bungee/getBridgingStatusFromEvents.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@ export async function getBridgingStatusFromEvents(
1919
return { status: BridgeStatus.IN_PROGRESS }
2020
}
2121

22-
console.log('SDK getBridgingStatusFromEvents event ==>', event)
2322
// if srcTxStatus = completed & destTxStatus = pending,
2423
if (event.srcTxStatus === BungeeEventStatus.COMPLETED && event.destTxStatus === BungeeEventStatus.PENDING) {
25-
console.log('SDK getBridgingStatusFromEvents event.COMPLETED ==>', event.bridgeName)
26-
2724
// if bridgeName = across,
2825
if (event.bridgeName === BungeeBridgeName.ACROSS) {
2926
try {
@@ -41,15 +38,12 @@ export async function getBridgingStatusFromEvents(
4138
}
4239
}
4340

44-
console.log('SDK getBridgingStatusFromEvents is not across ==>', event.bridgeName)
4541
// if not across or across API fails, waiting for dest tx, return in_progress
4642
return { status: BridgeStatus.IN_PROGRESS, depositTxHash: event.srcTransactionHash }
4743
}
4844

4945
// if srcTxStatus = completed & destTxStatus = completed, return executed
5046
if (event.srcTxStatus === BungeeEventStatus.COMPLETED && event.destTxStatus === BungeeEventStatus.COMPLETED) {
51-
console.log('SDK getBridgingStatusFromEvents is completed ==>', event.bridgeName)
52-
5347
return {
5448
status: BridgeStatus.EXECUTED,
5549
depositTxHash: event.srcTransactionHash,

src/bridging/providers/utils/getGasLimitEstimationForHook.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,8 @@ export async function getGasLimitEstimationForHook({
2222
// Proxy is not deployed
2323
if (!proxyCode || proxyCode === '0x') {
2424
const baseGas = DEFAULT_GAS_COST_FOR_HOOK_ESTIMATION + COW_SHED_PROXY_CREATION_GAS
25-
return baseGas + (extraGasProxyCreation ? extraGasProxyCreation : 0)
25+
return baseGas + (extraGasProxyCreation && extraGasProxyCreation > 0 ? extraGasProxyCreation : 0)
2626
}
2727

28-
// Some bridges require extra gas to be added to the hook.
29-
if (extraGas && extraGas > 0) {
30-
return DEFAULT_GAS_COST_FOR_HOOK_ESTIMATION + extraGas
31-
}
32-
33-
return DEFAULT_GAS_COST_FOR_HOOK_ESTIMATION
28+
return DEFAULT_GAS_COST_FOR_HOOK_ESTIMATION + (extraGas && extraGas > 0 ? extraGas : 0)
3429
}

src/bridging/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ export interface BridgeProvider<Q extends BridgeQuoteResult> {
209209
* 2. The final amount could affect hook gas costs
210210
*
211211
* By estimating gas costs independently, we can resolve this dependency cycle.
212-
* For some providers, the `extraGas` flag adds a 150,000 gas‐unit buffer to the hook
213-
* and `extraGasProxyCreation` adds 360,000 gas‐unit buffer for the proxy creation
212+
* For some providers, the `extraGas` parameter adds additional gas‐unit buffer to the hook
213+
* and `extraGasProxyCreation` parameter adds additional gas‐unit buffer for the proxy creation
214214
* (see DEFAULT_EXTRA_GAS_FOR_HOOK_ESTIMATION and DEFAULT_EXTRA_GAS_PROXY_CREATION).
215215
*/
216216
getGasLimitEstimationForHook(

0 commit comments

Comments
 (0)