@@ -113,7 +113,7 @@ import {
113113} from "../utils/constants" ;
114114import { Address , BigInt , log , Bytes } from "@graphprotocol/graph-ts" ;
115115
116- import { ERC721Listing , Parcel , TokenCommitment } from "../../generated/schema" ;
116+ import { /*Parcel,*/ Parcel , TokenCommitment } from "../../generated/schema" ;
117117// import {
118118// RealmDiamond,
119119// MintParcel,
@@ -495,12 +495,13 @@ export function handleAavegotchiInteract(event: AavegotchiInteract): void {
495495
496496 // Update ERC721Listing if gotchi has an active listing
497497 if ( gotchi . activeListing ) {
498- let listing = ERC721Listing . load ( gotchi . activeListing ! . toString ( ) ) ;
499-
500- if ( listing ) {
501- listing . kinship = gotchi . kinship ;
502- listing . save ( ) ;
503- }
498+ let listing = getOrCreateERC721Listing (
499+ gotchi . activeListing ! . toString ( ) ,
500+ false
501+ ) ;
502+ listing . kinship = gotchi . kinship ;
503+ listing . save ( ) ;
504+ }
504505}
505506
506507//ERC721 Transfer
@@ -583,10 +584,11 @@ export function handleERC721ListingAdd(event: ERC721ListingAdd): void {
583584 ) ! ;
584585 gotchi . locked = true ;
585586 listing . collateral = gotchi . collateral ;
586- listing . kinship = gotchi . kinship ; // Explicitly set kinship when listing is created
587+
587588 gotchi . activeListing = event . params . listingId ;
588589 gotchi . save ( ) ;
589590 listing . nameLowerCase = gotchi . nameLowerCase ;
591+ listing . kinship = gotchi . kinship ;
590592
591593 // Traits for Filter in v2
592594 if (
0 commit comments