mirror of
https://github.com/oceanprotocol/ocean-subgraph.git
synced 2024-12-02 05:57:29 +01:00
add chainId and nftAddress (#552)
* add chainId and nftAddress * handle null
This commit is contained in:
parent
7be20246c0
commit
95fcfe9ba7
@ -404,6 +404,8 @@ type VeAllocateUser @entity{
|
|||||||
type VeAllocateId @entity{
|
type VeAllocateId @entity{
|
||||||
"id = {DataNFT Address}-{chain id}"
|
"id = {DataNFT Address}-{chain id}"
|
||||||
id: ID!
|
id: ID!
|
||||||
|
nftAddress: String!
|
||||||
|
chainId: BigInt!
|
||||||
|
|
||||||
veAllocation: [VeAllocation!] @derivedFrom(field: "allocationId")
|
veAllocation: [VeAllocation!] @derivedFrom(field: "allocationId")
|
||||||
allocatedTotal: BigDecimal!
|
allocatedTotal: BigDecimal!
|
||||||
|
@ -62,6 +62,8 @@ export function getveAllocateId(
|
|||||||
allocateId.tx = event.transaction.hash.toHex()
|
allocateId.tx = event.transaction.hash.toHex()
|
||||||
allocateId.block = event.block.number.toI32()
|
allocateId.block = event.block.number.toI32()
|
||||||
allocateId.lastContact = 0
|
allocateId.lastContact = 0
|
||||||
|
allocateId.chainId = BigInt.zero()
|
||||||
|
allocateId.nftAddress = ''
|
||||||
|
|
||||||
allocateId.save()
|
allocateId.save()
|
||||||
}
|
}
|
||||||
@ -196,6 +198,9 @@ export function handleOneAllocation(
|
|||||||
allocationAmount
|
allocationAmount
|
||||||
)
|
)
|
||||||
|
|
||||||
|
allocateId.chainId = chainId
|
||||||
|
allocateId.nftAddress = nftAddress
|
||||||
|
|
||||||
// save entities
|
// save entities
|
||||||
allocateUser.save()
|
allocateUser.save()
|
||||||
allocateId.save()
|
allocateId.save()
|
||||||
|
Loading…
Reference in New Issue
Block a user