-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Chain } from "@defillama/sdk/build/general"; | ||
import { BridgeAdapter, PartialContractEventParams } from "../../helpers/bridgeAdapter.type"; | ||
import { constructTransferParams } from "../../helpers/eventParams"; | ||
import { getTxDataFromEVMEventLogs } from "../../helpers/processTransactions"; | ||
|
||
const HYPERLIQUID_BRIDGE_ADDRESS = "0x2Df1c51E09aECF9cacB7bc98cB1742757f163dF7"; | ||
|
||
const erc20WithdrawalEventParams: PartialContractEventParams = constructTransferParams( | ||
HYPERLIQUID_BRIDGE_ADDRESS, | ||
false | ||
); | ||
|
||
const erc20DepositEventParams: PartialContractEventParams = constructTransferParams(HYPERLIQUID_BRIDGE_ADDRESS, true); | ||
|
||
const constructParams = (chain: string) => { | ||
let eventParams = [] as PartialContractEventParams[]; | ||
eventParams.push(erc20WithdrawalEventParams, erc20DepositEventParams); | ||
return async (fromBlock: number, toBlock: number) => | ||
getTxDataFromEVMEventLogs("hyperliquid", chain as Chain, fromBlock, toBlock, eventParams); | ||
}; | ||
|
||
const adapter: BridgeAdapter = { | ||
arbitrum: constructParams("arbitrum"), | ||
}; | ||
|
||
export default adapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters