mirror of
https://github.com/oceanprotocol/ocean-subgraph.git
synced 2024-12-02 05:57:29 +01:00
create new user when processing new datatoken
This commit is contained in:
parent
7184969ece
commit
d834f6bdfa
@ -115,7 +115,7 @@ type Datatoken @entity {
|
||||
cap: BigDecimal!
|
||||
supply: BigDecimal!
|
||||
minter: User!
|
||||
publisher: User!
|
||||
publisher: String!
|
||||
|
||||
holderCount: BigInt! # Number of addresses holding a balance of datatoken
|
||||
orderCount: BigInt! # Number of orders executed for this dataset
|
||||
|
@ -3,6 +3,7 @@ import { TokenRegistered } from '../types/DTFactory/DTFactory'
|
||||
import { DatatokenFactory, Datatoken } from '../types/schema'
|
||||
import { Datatoken as DatatokenContract } from '../types/templates'
|
||||
import {
|
||||
createUserEntity,
|
||||
tokenToDecimal,
|
||||
ZERO_BD,
|
||||
} from './helpers'
|
||||
@ -29,6 +30,8 @@ export function handleNewToken(event: TokenRegistered): void {
|
||||
datatoken.address = event.params.tokenAddress.toHexString()
|
||||
datatoken.cap = tokenToDecimal(event.params.tokenCap.toBigDecimal(), 18)
|
||||
datatoken.supply = ZERO_BD
|
||||
|
||||
createUserEntity(event.params.registeredBy.toHex())
|
||||
datatoken.minter = event.params.registeredBy.toHex()
|
||||
datatoken.publisher = event.params.registeredBy.toHex()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user