diff --git a/root/src/mappings/staking-nft.ts b/root/src/mappings/staking-nft.ts index 010e734..1a57af1 100644 --- a/root/src/mappings/staking-nft.ts +++ b/root/src/mappings/staking-nft.ts @@ -1,5 +1,5 @@ import { Transfer } from '../../generated/StakingNft/StakingNft' -import { StakingNFTTransfer } from '../../generated/schema' +import { StakingNFTTransfer, Validator } from '../../generated/schema' // To be invoked when staking NFT contracts Transfer event to be emitted // @@ -27,6 +27,10 @@ export function handleTransfer(event: Transfer): void { transactionHashes.push(event.transaction.hash) entity.transactionHashes = transactionHashes + let validator = Validator.load(event.params.tokenId) + validator.owner = event.params.to + // save entity entity.save() + validator.save() } diff --git a/root/subgraph.template.yaml b/root/subgraph.template.yaml index 4a52674..694f7de 100644 --- a/root/subgraph.template.yaml +++ b/root/subgraph.template.yaml @@ -210,6 +210,7 @@ dataSources: language: wasm/assemblyscript entities: - StakingNFTTransfer + - Validator abis: - name: StakingNft file: ./abis/StakingNft.json