Skip to content

Commit 5b58137

Browse files
authored
feat(chains)!: Remove Lens network support (#205)
* chore(chains)\!: remove Lens network support * fix: add missing file * chore: update deps * fix: fix import * fix: fix build * fix: fix TS * fix: restore old yarn.lock * fix: fix TS issues * fix: fix TS issues * fix: fix mockt.ts types * fix: fix mockt.ts types
1 parent 77c836a commit 5b58137

18 files changed

Lines changed: 236 additions & 128 deletions

File tree

apps/notification-producer/src/utils/getNotificationSummary.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NATIVE_CURRENCY_ADDRESS, SupportedChainId } from '@cowprotocol/cow-sdk';
1+
import { EVM_NATIVE_CURRENCY_ADDRESS, SupportedChainId } from '@cowprotocol/cow-sdk';
22
import { getAddress } from 'viem';
33
import { ChainNames, formatAmount, formatTokenName } from '@cowprotocol/shared';
44
import { Erc20Repository } from '@cowprotocol/repositories';
@@ -18,7 +18,7 @@ export async function getNotificationSummary(params: OrderInfoForNotificationPar
1818

1919
const sellToken = await erc20Repository.get(
2020
chainId,
21-
isEthFlowOrder ? NATIVE_CURRENCY_ADDRESS : getAddress(params.sellTokenAddress)
21+
isEthFlowOrder ? EVM_NATIVE_CURRENCY_ADDRESS : getAddress(params.sellTokenAddress)
2222
);
2323

2424
const buyToken = await erc20Repository.get(

libs/repositories/src/const.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ export const USDC = {
3333
address: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e',
3434
decimals: 6,
3535
},
36-
// https://explorer.lens.xyz/address/0x88f08e304ec4f90d644cec3fb69b8ad414acf884
37-
[SupportedChainId.LENS]: {
38-
address: '0x88f08e304ec4f90d644cec3fb69b8ad414acf884',
39-
decimals: 6,
40-
},
4136
// https://bscscan.com/token/0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d
4237
[SupportedChainId.BNB]: {
4338
address: '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d',

libs/repositories/src/datasources/alchemy.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export const ALCHEMY_CLIENT_NETWORK_MAPPING: Record<
1717
[SupportedChainId.POLYGON]: 'polygon-mainnet',
1818
[SupportedChainId.AVALANCHE]: 'avax-mainnet',
1919
[SupportedChainId.BASE]: 'base-mainnet',
20-
[SupportedChainId.LENS]: 'lens-mainnet',
2120
[SupportedChainId.BNB]: 'bnb-mainnet',
2221
[SupportedChainId.LINEA]: 'linea-mainnet',
2322
[SupportedChainId.INK]: 'ink-mainnet',

libs/repositories/src/datasources/coingecko.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export const SUPPORTED_COINGECKO_PLATFORMS = {
1515
[SupportedChainId.BASE]: 'base',
1616
[SupportedChainId.POLYGON]: 'polygon-pos',
1717
[SupportedChainId.AVALANCHE]: 'avalanche',
18-
[SupportedChainId.LENS]: 'lens',
1918
[SupportedChainId.BNB]: 'binance-smart-chain',
2019
[SupportedChainId.LINEA]: 'linea',
2120
[SupportedChainId.PLASMA]: 'plasma',

libs/repositories/src/datasources/ethplorer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export const ETHPLORER_BASE_URL = {
1313
[SupportedChainId.BASE]: null,
1414
[SupportedChainId.POLYGON]: null,
1515
[SupportedChainId.AVALANCHE]: null,
16-
[SupportedChainId.LENS]: null,
1716
[SupportedChainId.BNB]: 'https://api.binplorer.com',
1817
[SupportedChainId.LINEA]: 'https://api.lineaplorer.build',
1918
[SupportedChainId.PLASMA]: null,

libs/repositories/src/datasources/goldRush.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const GOLD_RUSH_CLIENT_NETWORK_MAPPING = {
1414
[SupportedChainId.POLYGON]: 'polygon-mainnet',
1515
[SupportedChainId.AVALANCHE]: 'avalanche-mainnet',
1616
[SupportedChainId.SEPOLIA]: 'eth-sepolia',
17-
[SupportedChainId.LENS]: 'lens-mainnet',
1817
[SupportedChainId.BNB]: 'bsc-mainnet',
1918
[SupportedChainId.LINEA]: 'linea-mainnet',
2019
[SupportedChainId.PLASMA]: 'plasma-mainnet',

libs/repositories/src/datasources/moralis.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const MORALIS_CLIENT_NETWORK_MAPPING = {
1414
[SupportedChainId.POLYGON]: 'polygon',
1515
[SupportedChainId.AVALANCHE]: 'avalanche',
1616
[SupportedChainId.BASE]: 'base',
17-
[SupportedChainId.LENS]: null,
1817
[SupportedChainId.BNB]: 'bsc',
1918
[SupportedChainId.LINEA]: 'linea',
2019
[SupportedChainId.PLASMA]: null,

libs/repositories/src/datasources/orderBookDbPool.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const chainToDbNameMap = {
1717
[SupportedChainId.AVALANCHE]: 'avalanche',
1818
[SupportedChainId.ARBITRUM_ONE]: 'arbitrum-one',
1919
[SupportedChainId.BNB]: 'bnb',
20-
[SupportedChainId.LENS]: 'lens',
2120
[SupportedChainId.SEPOLIA]: 'sepolia',
2221
[SupportedChainId.LINEA]: 'linea',
2322
[SupportedChainId.PLASMA]: 'plasma',

libs/repositories/src/datasources/viem.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { lens as lensCoWSdk, SupportedChainId } from '@cowprotocol/cow-sdk';
1+
import { SupportedChainId } from '@cowprotocol/cow-sdk';
22
import { AllChainIds, logger } from '@cowprotocol/shared';
33
import {
44
Chain,
5-
ChainContract,
65
createPublicClient,
76
http,
87
PublicClient,
@@ -14,7 +13,6 @@ import {
1413
base,
1514
bsc,
1615
gnosis,
17-
lens,
1816
linea,
1917
mainnet,
2018
plasma,
@@ -30,13 +28,6 @@ const NETWORKS = {
3028
[SupportedChainId.BASE]: base,
3129
[SupportedChainId.POLYGON]: polygon,
3230
[SupportedChainId.AVALANCHE]: avalanche,
33-
[SupportedChainId.LENS]: {
34-
...lens,
35-
contracts: {
36-
...lens.contracts,
37-
multicall3: lensCoWSdk.contracts.multicall3 as ChainContract,
38-
},
39-
},
4031
[SupportedChainId.BNB]: bsc,
4132
[SupportedChainId.SEPOLIA]: sepolia,
4233
[SupportedChainId.LINEA]: linea,

libs/repositories/src/gen/cow/cow-api-types.ts

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,27 @@ export interface paths {
481481
patch?: never;
482482
trace?: never;
483483
};
484+
"/api/v1/debug/order/{uid}": {
485+
parameters: {
486+
query?: never;
487+
header?: never;
488+
path?: never;
489+
cookie?: never;
490+
};
491+
/**
492+
* Debug an order's lifecycle.
493+
* @description Returns a comprehensive debug report for the given order, including order details, lifecycle events, auction participation, proposed solutions, executions, trades, and settlement attempts.
494+
*
495+
*/
496+
get: operations["debugOrder"];
497+
put?: never;
498+
post?: never;
499+
delete?: never;
500+
options?: never;
501+
head?: never;
502+
patch?: never;
503+
trace?: never;
504+
};
484505
}
485506
export type webhooks = Record<string, never>;
486507
export interface components {
@@ -1269,6 +1290,92 @@ export interface components {
12691290
amount?: unknown & components["schemas"]["TokenAmount"];
12701291
token?: unknown & components["schemas"]["Address"];
12711292
};
1293+
DebugOrderResponse: {
1294+
/** @description The UID of the order being debugged. */
1295+
orderUid: components["schemas"]["UID"];
1296+
order: components["schemas"]["Order"];
1297+
events: components["schemas"]["DebugEvent"][];
1298+
/** @description Auctions this order participated in, sorted by ID. Each auction groups all related data: native prices, proposed solutions, executions, settlement attempts, and fee policies.
1299+
* */
1300+
auctions: components["schemas"]["DebugAuction"][];
1301+
trades: components["schemas"]["DebugTrade"][];
1302+
};
1303+
DebugEvent: {
1304+
/** @description Event type (e.g. created, ready, filtered, traded). */
1305+
label: string;
1306+
/** Format: date-time */
1307+
timestamp: string;
1308+
};
1309+
DebugAuction: {
1310+
/** @description Auction ID. */
1311+
id: number;
1312+
/** @description Block number of the auction. */
1313+
block: number;
1314+
/** @description Deadline block for the auction. */
1315+
deadline: number;
1316+
/** @description Native prices for the order's sell and buy tokens in this auction. Keys are hex-encoded token addresses, values are decimal price strings.
1317+
* */
1318+
nativePrices: {
1319+
[key: string]: string | undefined;
1320+
};
1321+
proposedSolutions: components["schemas"]["DebugProposedSolution"][];
1322+
executions: components["schemas"]["DebugExecution"][];
1323+
settlementAttempts: components["schemas"]["DebugSettlementAttempt"][];
1324+
feePolicies: components["schemas"]["DebugFeePolicy"][];
1325+
};
1326+
DebugProposedSolution: {
1327+
solutionUid: number;
1328+
ranking: number;
1329+
solver: components["schemas"]["Address"];
1330+
isWinner: boolean;
1331+
filteredOut: boolean;
1332+
/** @description Decimal-encoded score. */
1333+
score: string;
1334+
executedSell: components["schemas"]["TokenAmount"];
1335+
executedBuy: components["schemas"]["TokenAmount"];
1336+
};
1337+
DebugExecution: {
1338+
executedFee: components["schemas"]["TokenAmount"];
1339+
executedFeeToken: components["schemas"]["Address"];
1340+
blockNumber: number;
1341+
protocolFees: components["schemas"]["DebugProtocolFee"][];
1342+
};
1343+
DebugProtocolFee: {
1344+
token: components["schemas"]["Address"];
1345+
amount: components["schemas"]["TokenAmount"];
1346+
};
1347+
DebugTrade: {
1348+
blockNumber: number;
1349+
logIndex: number;
1350+
buyAmount: components["schemas"]["TokenAmount"];
1351+
sellAmount: components["schemas"]["TokenAmount"];
1352+
sellAmountBeforeFees: components["schemas"]["TokenAmount"];
1353+
txHash?: components["schemas"]["TransactionHash"];
1354+
auctionId?: number;
1355+
};
1356+
DebugSettlementAttempt: {
1357+
solver: components["schemas"]["Address"];
1358+
solutionUid: number;
1359+
/** Format: date-time */
1360+
startTimestamp: string;
1361+
/** Format: date-time */
1362+
endTimestamp?: string;
1363+
startBlock: number;
1364+
endBlock?: number;
1365+
deadlineBlock: number;
1366+
/** @description Settlement outcome (e.g. "success", "revert"). */
1367+
outcome?: string;
1368+
};
1369+
/** @description Fee policy applied to this order in this auction. */
1370+
DebugFeePolicy: {
1371+
/** @enum {string} */
1372+
kind: "surplus" | "volume" | "priceImprovement";
1373+
surplusFactor?: number;
1374+
surplusMaxVolumeFactor?: number;
1375+
volumeFactor?: number;
1376+
priceImprovementFactor?: number;
1377+
priceImprovementMaxVolumeFactor?: number;
1378+
};
12721379
};
12731380
responses: never;
12741381
parameters: never;
@@ -2227,4 +2334,47 @@ export interface operations {
22272334
};
22282335
};
22292336
};
2337+
debugOrder: {
2338+
parameters: {
2339+
query?: never;
2340+
header?: never;
2341+
path: {
2342+
uid: components["schemas"]["UID"];
2343+
};
2344+
cookie?: never;
2345+
};
2346+
requestBody?: never;
2347+
responses: {
2348+
/** @description Debug report returned. */
2349+
200: {
2350+
headers: {
2351+
[name: string]: unknown;
2352+
};
2353+
content: {
2354+
"application/json": components["schemas"]["DebugOrderResponse"];
2355+
};
2356+
};
2357+
/** @description Invalid order UID (malformed hex or wrong length). */
2358+
400: {
2359+
headers: {
2360+
[name: string]: unknown;
2361+
};
2362+
content?: never;
2363+
};
2364+
/** @description Order not found. */
2365+
404: {
2366+
headers: {
2367+
[name: string]: unknown;
2368+
};
2369+
content?: never;
2370+
};
2371+
/** @description Internal error. */
2372+
500: {
2373+
headers: {
2374+
[name: string]: unknown;
2375+
};
2376+
content?: never;
2377+
};
2378+
};
2379+
};
22302380
}

0 commit comments

Comments
 (0)