-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Mints Manager and Mints Addresses to Subgraph (#330)
* feat: add new zora sepolia addresses * feat: add zora mainnet addresses * feat: add mintsManagerImpl to index MintComments * fix: update changeset
- Loading branch information
1 parent
a014d74
commit 5888fd2
Showing
7 changed files
with
73 additions
and
4 deletions.
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,5 @@ | ||
--- | ||
"@zoralabs/nft-creator-subgraph": minor | ||
--- | ||
|
||
Adds Mints and Mints Manager Addresses for Zora Mainnet and Zora Sepolia. Also allows for indexing of MintComment events from the Mints Manager contract. |
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
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
25 changes: 25 additions & 0 deletions
25
packages/creator-subgraph/src/MintsMappings/mintsManagerMappings.ts
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,25 @@ | ||
import { MintComment as MintsManagerMintComment } from "../../generated/MintsManager/MintsManager"; | ||
import { getMintCommentId } from "../common/getMintCommentId"; | ||
import { MintComment } from "../../generated/schema"; | ||
import { getTokenId } from "../common/getTokenId"; | ||
import { makeTransaction } from "../common/makeTransaction"; | ||
|
||
export function handleMintComment(event: MintsManagerMintComment): void { | ||
const mintComment = new MintComment(getMintCommentId(event)); | ||
const tokenAndContract = getTokenId( | ||
event.params.tokenContract, | ||
event.params.tokenId, | ||
); | ||
mintComment.tokenAndContract = tokenAndContract; | ||
mintComment.sender = event.params.sender; | ||
mintComment.comment = event.params.comment; | ||
mintComment.mintQuantity = event.params.quantity; | ||
mintComment.tokenId = event.params.tokenId; | ||
|
||
mintComment.txn = makeTransaction(event); | ||
mintComment.block = event.block.number; | ||
mintComment.timestamp = event.block.timestamp; | ||
mintComment.address = event.address; | ||
|
||
mintComment.save(); | ||
} |
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