import { ethereum } from '@graphprotocol/graph-ts' ; import { Address } from '@graphprotocol/graph-ts/index' ; export enum EventTypeRef { NoType , Deposit , Borrow , Redeem , Repay , Swap , UsageAsCollateral , RebalanceStableBorrowRate , LiquidationCall , FlashLoan , OriginationFeeLiquidation , SwapAdapter } export function getHistoryId ( event , type = EventTypeRef . NoType ) { let postfix = type !== EventTypeRef . NoType ? ':' + type . toString ( ) : '' ; return event . transaction . hash . toHexString ( ) + postfix ; } export function getHistoryEntityId ( event ) { return event . transaction . hash . toHexString ( ) + ':' + event . logIndex . toString ( ) ; } export function getReserveId ( underlyingAsset , poolId ) { return underlyingAsset . toHexString ( ) + poolId ; } export function getUserReserveId ( userAddress , underlyingAssetAddress , poolId ) { return userAddress . toHexString ( ) + underlyingAssetAddress . toHexString ( ) + poolId ; } export function getAtokenId ( aTokenAddress ) { return aTokenAddress . toHexString ( ) ; }