mirror of
https://github.com/oceanprotocol/ocean-subgraph.git
synced 2024-06-15 17:03:32 +02:00
5e581e8418
* Bump @graphprotocol/graph-cli from 0.29.0 to 0.33.0 Bumps @graphprotocol/graph-cli from 0.29.0 to 0.33.0. --- updated-dependencies: - dependency-name: "@graphprotocol/graph-cli" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump @graphprotocol/graph-cli from 0.29.0 to 0.33.0 Bumps @graphprotocol/graph-cli from 0.29.0 to 0.33.0. --- updated-dependencies: - dependency-name: "@graphprotocol/graph-cli" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix other defaults Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai@oceanprotocol.com>
15 lines
336 B
TypeScript
15 lines
336 B
TypeScript
import { BigInt } from '@graphprotocol/graph-ts'
|
|
import { User } from '../../@types/schema'
|
|
|
|
export function getUser(address: string): User {
|
|
let user = User.load(address)
|
|
if (user === null) {
|
|
user = new User(address)
|
|
user.totalOrders = BigInt.zero()
|
|
user.totalSales = BigInt.zero()
|
|
user.save()
|
|
}
|
|
|
|
return user
|
|
}
|