mirror of
https://github.com/oceanprotocol/ocean-subgraph.git
synced 2024-12-02 05:57:29 +01:00
parent
c74d938c24
commit
c5d86d10df
@ -109,7 +109,10 @@ type Nft @entity{
|
||||
block: Int
|
||||
|
||||
"number of orders executed for all underlying datatokens"
|
||||
orderCount: BigInt!
|
||||
orderCount: BigInt!
|
||||
|
||||
"has metadata"
|
||||
hasMetadata: Boolean!
|
||||
}
|
||||
|
||||
type OrderReuse @entity {
|
||||
|
@ -30,6 +30,7 @@ export function handleMetadataCreated(event: MetadataCreated): void {
|
||||
|
||||
nft.assetState = event.params.state
|
||||
nft.providerUrl = event.params.decryptorUrl.toString()
|
||||
nft.hasMetadata = true
|
||||
|
||||
const nftUpdate = new NftUpdate(
|
||||
getId(event.transaction.hash.toHex(), nftAddress)
|
||||
@ -57,7 +58,7 @@ export function handleMetadataUpdated(event: MetadataUpdated): void {
|
||||
if (!nft) return
|
||||
|
||||
nft.assetState = event.params.state
|
||||
|
||||
nft.hasMetadata = true
|
||||
const nftUpdate = new NftUpdate(
|
||||
getId(event.transaction.hash.toHex(), nftAddress)
|
||||
)
|
||||
|
@ -59,6 +59,7 @@ export function createNftToken(address: Address): Nft {
|
||||
token.block = 0
|
||||
token.tx = ''
|
||||
token.orderCount = BigInt.zero()
|
||||
token.hasMetadata = false
|
||||
token.save()
|
||||
addNft()
|
||||
return token
|
||||
@ -80,6 +81,18 @@ export function getNftTokenWithID(tokenId: string): Nft {
|
||||
nftToken.name = ''
|
||||
nftToken.symbol = ''
|
||||
nftToken.address = tokenId
|
||||
nftToken.providerUrl = ''
|
||||
nftToken.tokenUri = ''
|
||||
nftToken.owner = ''
|
||||
nftToken.creator = ''
|
||||
nftToken.assetState = 0
|
||||
nftToken.template = ''
|
||||
nftToken.transferable = true
|
||||
nftToken.createdTimestamp = 0
|
||||
nftToken.block = 0
|
||||
nftToken.tx = ''
|
||||
nftToken.orderCount = BigInt.zero()
|
||||
nftToken.hasMetadata = false
|
||||
nftToken.save()
|
||||
addNft()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user