Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion carbonmark/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "carbonmark",
"version": "1.7.4",
"version": "1.7.5",
"repository": "https://github.com/KlimaDAO/klima-subgraphs/carbonmark",
"license": "MIT",
"scripts": {
Expand Down
21 changes: 21 additions & 0 deletions carbonmark/src/Carbonmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ import { SubgraphVersion } from '../generated/schema'
import { SCHEMA_VERSION, PUBLISHED_VERSION } from './utils/version'

export function handleListingCreated(event: ListingCreated): void {
log.info('handleListingCreated tx={} block={} id={}', [
event.transaction.hash.toHexString(),
event.block.number.toString(),
event.params.id.toHexString(),
])
let blockNumber = event.block.number
// Ensure the user entity exists
loadOrCreateUser(event.params.account)
Expand Down Expand Up @@ -71,6 +76,11 @@ export function handleListingCreated(event: ListingCreated): void {
}

export function handleListingUpdated(event: ListingUpdated): void {
log.info('handleListingUpdated tx={} block={} id={}', [
event.transaction.hash.toHexString(),
event.block.number.toString(),
event.params.id.toHexString(),
])
let blockNumber = event.block.number
// User should already exist from creating the listing.

Expand Down Expand Up @@ -170,6 +180,11 @@ export function handleListingUpdated(event: ListingUpdated): void {
}

export function handleListingFilled(event: ListingFilled): void {
log.info('handleListingFilled tx={} block={} id={}', [
event.transaction.hash.toHexString(),
event.block.number.toString(),
event.params.id.toHexString(),
])
let blockNumber = event.block.number
// Ensure the buyer user entity exists
loadOrCreateUser(event.transaction.from)
Expand Down Expand Up @@ -219,6 +234,11 @@ export function handleListingFilled(event: ListingFilled): void {
}

export function handleListingCancelled(event: ListingCancelled): void {
log.info('handleListingCancelled tx={} block={} id={}', [
event.transaction.hash.toHexString(),
event.block.number.toString(),
event.params.id.toHexString(),
])
let listing = loadOrCreateListing(event.params.id.toHexString())

listing.active = false
Expand All @@ -238,6 +258,7 @@ export function handleListingCancelled(event: ListingCancelled): void {
}

export function handleSetSubgraphVersion(block: ethereum.Block): void {
log.info('handleSetSubgraphVersion block={}', [block.number.toString()])
let version = new SubgraphVersion('carbonmark')
version.schemaVersion = SCHEMA_VERSION
version.publishedVersion = PUBLISHED_VERSION
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading