diff --git a/src/adapters/xy-finance/index.ts b/src/adapters/xy-finance/index.ts index 1b76bc52..22157930 100644 --- a/src/adapters/xy-finance/index.ts +++ b/src/adapters/xy-finance/index.ts @@ -38,6 +38,28 @@ const getYBridgeSwapRequestedEventParams = (chain: Exclude } } +const getYBridgeSwappedForUserEventParams = (chain: Exclude) => { + const contractAddress = YBridgeContractAddress[chain] + return { + target: contractAddress, + topic: 'SwappedForUser(address,address,uint256,address,uint256,address)', + abi: [ + "event SwappedForUser(address indexed _aggregatorAdaptor, address indexed _srcToken, uint256 _srcTokenAmount, address _dstToken, uint256 _dstTokenAmountOut, address _receiver)", + ], + logKeys: { + blockNumber: "blockNumber", + txHash: "transactionHash", + }, + argKeys: { + token: "_dstToken", + amount: "_dstTokenAmountOut", + from: "_srcToken", + to: "_receiver", + }, + isDeposit: false, + } +} + export const getXYRouterRequestedEventParams = (chain: Chain) => { const contractAddress = XYRouterContractAddress[chain] return { @@ -101,7 +123,10 @@ const constructParams = (chain: Chain) => { const eventParams: (ContractEventParams | PartialContractEventParams)[] = [getXYRouterRequestedEventParams(chain)] if (chain !== Chain.Numbers) { + /** Deposit */ eventParams.push(getYBridgeSwapRequestedEventParams(chain)) + /** Withdrawal */ + eventParams.push(getYBridgeSwappedForUserEventParams(chain)) } return async (fromBlock: number, toBlock: number) => diff --git a/src/data/bridgeNetworkData.ts b/src/data/bridgeNetworkData.ts index e868d447..76129b68 100644 --- a/src/data/bridgeNetworkData.ts +++ b/src/data/bridgeNetworkData.ts @@ -708,41 +708,41 @@ export default [ }, destinationChain: "ShimmerEVM", }, - // { - // id: 46, - // displayName: "XY Finance", - // bridgeDbName: "xy", - // iconLink: "protocols:xy-finance", - // largeTxThreshold: 10000, - // url: "https://app.xy.finance", - // chains: [ - // "Ethereum", - // "Scroll", - // "Mantle", - // "Linea", - // "Base", - // "Arbitrum", - // "zkSync Era", - // "BSC", - // "Polygon", - // "Klaytn", - // "Polygon zkEVM", - // "Avalanche", - // "Optimism", - // "Cronos", - // "Fantom", - // "Astar", - // "KCC", - // "Moonriver", - // "ThunderCore", - // // "Numbers", - // ], - // chainMapping: { - // "zksync era": "era", - // "polygon zkevm": "polygon_zkevm", - // avalanche: "avax", - // }, - // }, + { + id: 46, + displayName: "XY Finance", + bridgeDbName: "xy", + iconLink: "protocols:xy-finance", + largeTxThreshold: 10000, + url: "https://app.xy.finance", + chains: [ + "Ethereum", + "Scroll", + "Mantle", + "Linea", + "Base", + "Arbitrum", + "zkSync Era", + "BSC", + "Polygon", + "Klaytn", + "Polygon zkEVM", + "Avalanche", + "Optimism", + "Cronos", + "Fantom", + "Astar", + "KCC", + "Moonriver", + "ThunderCore", + // "Numbers", + ], + chainMapping: { + "zksync era": "era", + "polygon zkevm": "polygon_zkevm", + avalanche: "avax", + }, + }, // { // id: 47, // displayName: "Butter Network",