Commit cd27a24 1 parent f3b501b commit cd27a24 Copy full SHA for cd27a24
File tree 3 files changed +13
-2
lines changed
3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,10 @@ type Nft @entity{
99
99
"nft creation transaction id"
100
100
tx : String !
101
101
"block number when it was created"
102
- block : Int
102
+ block : Int
103
+
104
+ "number of orders executed for all underlying datatokens"
105
+ orderCount : BigInt !
103
106
}
104
107
105
108
type Pool @entity {
Original file line number Diff line number Diff line change 1
- import { Order } from '../@types/schema'
1
+ import { Order , Nft } from '../@types/schema'
2
2
import { BigInt } from '@graphprotocol/graph-ts'
3
3
import {
4
4
NewPaymentCollector ,
@@ -60,6 +60,13 @@ export function handleOrderStarted(event: OrderStarted): void {
60
60
order . save ( )
61
61
token . save ( )
62
62
addOrder ( )
63
+ if ( token . nft ) {
64
+ const nft = Nft . load ( token . nft as string ) as Nft
65
+ if ( nft ) {
66
+ nft . orderCount = nft . orderCount . plus ( integer . ONE )
67
+ nft . save ( )
68
+ }
69
+ }
63
70
}
64
71
65
72
export function handleNewPaymentCollector ( event : NewPaymentCollector ) : void { }
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ export function handleCreated(event: MetadataCreated): void {
17
17
18
18
nft . assetState = event . params . state
19
19
nft . providerUrl = event . params . decryptorUrl . toString ( )
20
+
20
21
const nftUpdate = new NftUpdate (
21
22
getId ( event . transaction . hash . toHex ( ) , nftAddress )
22
23
)
You can’t perform that action at this time.
0 commit comments