@@ -1998,79 +1998,3 @@ export function handleERC1155BuyOrderCancel(
19981998 entity . canceled = true ;
19991999 entity . save ( ) ;
20002000}
2001-
2002- export function handleAavegotchiHistory ( event : AavegotchiHistory ) : void {
2003- const data = event . params . data ;
2004- let gotchi = getOrCreateAavegotchi ( data . gotchiId . toString ( ) , event ) ;
2005- if ( ! gotchi ) return ;
2006-
2007- // Update basic info
2008- gotchi . name = data . name ;
2009- gotchi . createdAt = data . createdAtBlock ;
2010- gotchi . timesTraded = data . timesTraded ;
2011- if ( data . activeListing != BIGINT_ZERO ) {
2012- gotchi . activeListing = data . activeListing ;
2013- }
2014-
2015- // Update historical prices array
2016- let historicalPrices = data . historicalPrices ;
2017- if ( historicalPrices . length > 0 ) {
2018- gotchi . historicalPrices = historicalPrices ;
2019- }
2020-
2021- gotchi . save ( ) ;
2022- }
2023-
2024- export function handlePortalData ( event : PortalData ) : void {
2025- const data = event . params . data ;
2026- let portal = getOrCreatePortal ( data . gotchiId . toString ( ) ) ;
2027-
2028- let owner = getOrCreateUser ( data . owner . toHexString ( ) ) ;
2029- owner . save ( ) ;
2030- portal . owner = owner . id ;
2031-
2032- // Update basic portal info
2033- portal . gotchiId = data . gotchiId ;
2034- portal . buyer = data . buyer . toHexString ( ) ;
2035- portal . hauntId = data . hauntId ;
2036- portal . status = data . status ;
2037-
2038- // Update timestamps
2039- portal . boughtAt = data . boughtAtBlock ;
2040- portal . openedAt = data . openedAtBlock ;
2041- portal . claimedAt = data . claimedAtBlock ;
2042- portal . claimedTime = data . claimedTimestamp ;
2043-
2044- // Update trading info
2045- portal . timesTraded = data . timesTraded ;
2046- portal . historicalPrices = data . historicalPrices ;
2047- if ( data . activeListingId != BIGINT_ZERO ) {
2048- portal . activeListing = data . activeListingId ;
2049- }
2050-
2051- // Handle portal options
2052- let options = data . options ;
2053-
2054- for ( let i = 0 ; i < options . length ; i ++ ) {
2055- let option = getOrCreateAavegotchiOption ( portal . id , i ) ;
2056- option . portal = portal . id ;
2057- option . owner = portal . owner ;
2058- option . portalOptionId = options [ i ] . portalOptionId ;
2059- option . randomNumber = options [ i ] . randomNumber ;
2060- option . numericTraits = options [ i ] . numericTraits ;
2061- option . collateralType = options [ i ] . collateralType ;
2062- option . minimumStake = options [ i ] . minimumStake ;
2063- option . baseRarityScore = options [ i ] . baseRarityScore ;
2064-
2065- option . save ( ) ;
2066- }
2067-
2068- portal . save ( ) ;
2069- }
2070-
2071- export function handleResyncAavegotchis ( event : ResyncAavegotchis ) : void {
2072- let gotchi = getOrCreateAavegotchi ( event . params . _tokenId . toString ( ) , event ) ;
2073- if ( ! gotchi ) return ;
2074- gotchi = updateAavegotchiInfo ( gotchi , event . params . _tokenId , event , false ) ;
2075- gotchi . save ( ) ;
2076- }
0 commit comments