Skip to content

Commit 5e581e8

Browse files
Bump @graphprotocol/graph-cli from 0.29.0 to 0.33.0 (#495)
* 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] <[email protected]> * 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] <[email protected]> * fix other defaults Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <[email protected]>
1 parent 838de4b commit 5e581e8

8 files changed

+237
-84
lines changed

package-lock.json

+199-76
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"changelog": "auto-changelog -p"
3434
},
3535
"devDependencies": {
36-
"@graphprotocol/graph-cli": "^0.29.0",
36+
"@graphprotocol/graph-cli": "^0.33.0",
3737
"@graphprotocol/graph-ts": "^0.27.0",
3838
"@types/chai": "^4.3.1",
3939
"@types/chai-spies": "^1.0.3",

schema.graphql

+2-2
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ type OrderReuse @entity {
246246
id: ID!
247247
order: Order!
248248
caller: String!
249-
createdTimestamp: BigInt!
249+
createdTimestamp: Int!
250250
tx: String!
251-
block: BigInt!
251+
block: Int!
252252
providerFee: String
253253
providerFeeValidUntil: BigInt
254254
}

src/mappings/erc20Templates.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ export function handlerOrderReused(event: OrderReused): void {
9393
const reuseOrder = new OrderReuse(event.transaction.hash.toHex())
9494
reuseOrder.order = orderId
9595
reuseOrder.caller = event.params.caller.toHexString()
96-
reuseOrder.createdTimestamp = event.params.timestamp
96+
reuseOrder.createdTimestamp = event.params.timestamp.toI32()
9797
reuseOrder.tx = event.transaction.hash.toHex()
98-
reuseOrder.block = event.params.number
98+
reuseOrder.block = event.params.number.toI32()
9999

100100
reuseOrder.save()
101101
}
@@ -230,6 +230,11 @@ export function handleProviderFee(event: ProviderFee): void {
230230
orderReuse = new OrderReuse(event.transaction.hash.toHex())
231231
orderReuse.providerFee = providerFee
232232
orderReuse.providerFeeValidUntil = event.params.validUntil
233+
orderReuse.order = orderId
234+
orderReuse.createdTimestamp = event.block.timestamp.toI32()
235+
orderReuse.tx = event.transaction.hash.toHex()
236+
orderReuse.block = event.block.number.toI32()
237+
orderReuse.caller = event.transaction.from.toHex()
233238
orderReuse.save()
234239
}
235240
}

src/mappings/nftUpdate.ts

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export function handleMetadataCreated(event: MetadataCreated): void {
4141

4242
nftUpdate.nft = nft.id
4343
nftUpdate.providerUrl = nft.providerUrl
44+
nftUpdate.tokenUri = nft.tokenUri
4445

4546
nftUpdate.timestamp = event.block.timestamp.toI32()
4647
nftUpdate.tx = event.transaction.hash.toHex()

src/mappings/utils/globalUtils.ts

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ export function getGlobalStats(): GlobalStatistic {
1515
if (!globalStats) {
1616
globalStats = new GlobalStatistic(GLOBAL_ID)
1717
globalStats.version = '2.0.1'
18+
globalStats.orderCount = 0
19+
globalStats.fixedCount = 0
20+
globalStats.datatokenCount = 0
21+
globalStats.poolCount = 0
22+
globalStats.dispenserCount = 0
23+
globalStats.nftCount = 0
1824
globalStats.save()
1925
}
2026
return globalStats

src/mappings/utils/tokenUtils.ts

+18-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Address, log, BigDecimal } from '@graphprotocol/graph-ts'
1+
import { Address, log, BigDecimal, BigInt } from '@graphprotocol/graph-ts'
22
import { Nft, Token } from '../../@types/schema'
33
import { ERC20 } from '../../@types/templates/ERC20Template/ERC20'
44
import { ERC20Template, ERC721Template } from '../../@types/templates'
@@ -25,6 +25,11 @@ export function createToken(address: Address, isDatatoken: boolean): Token {
2525
else token.decimals = decimals.value
2626
token.lastPriceToken = ZERO_ADDRESS
2727
token.lastPriceValue = BigDecimal.zero()
28+
token.orderCount = BigInt.zero()
29+
token.holderCount = BigInt.zero()
30+
token.createdTimestamp = 0
31+
token.block = 0
32+
token.tx = ''
2833
token.save()
2934
return token
3035
}
@@ -38,15 +43,25 @@ export function getToken(address: Address, isDatatoken: boolean): Token {
3843
}
3944

4045
export function createNftToken(address: Address): Nft {
41-
log.debug('started creating nft token with address: {}', [
46+
log.warning('started creating nft token with address: {}', [
4247
address.toHexString()
4348
])
4449
ERC721Template.create(address)
4550
const token = new Nft(address.toHexString())
46-
// const contract = ERC721Template.bind(address)
4751
token.name = ''
4852
token.symbol = ''
4953
token.address = address.toHexString()
54+
token.providerUrl = ''
55+
token.tokenUri = ''
56+
token.owner = ''
57+
token.creator = ''
58+
token.assetState = 0
59+
token.template = ''
60+
token.transferable = true
61+
token.createdTimestamp = 0
62+
token.block = 0
63+
token.tx = ''
64+
token.orderCount = BigInt.zero()
5065
token.save()
5166
addNft()
5267
return token

src/mappings/utils/userUtils.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
import { BigInt } from '@graphprotocol/graph-ts'
12
import { User } from '../../@types/schema'
23

34
export function getUser(address: string): User {
45
let user = User.load(address)
56
if (user === null) {
67
user = new User(address)
8+
user.totalOrders = BigInt.zero()
9+
user.totalSales = BigInt.zero()
710
user.save()
811
}
912

0 commit comments

Comments
 (0)