Skip to content

Commit

Permalink
Add tokenId to listing entity (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
cujowolf authored Jan 30, 2024
1 parent 51be692 commit 276dfd1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions carbonmark/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type Listing @entity {
totalAmountToSell: BigInt!
leftToSell: BigInt!
tokenAddress: Bytes!
tokenId: BigInt!
active: Boolean
deleted: Boolean # uint256
batches: [BigInt!] # uint256
Expand Down
1 change: 1 addition & 0 deletions carbonmark/src/Carbonmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export function handleListingCreated(event: ListingCreated): void {
listing.totalAmountToSell = event.params.amount
listing.leftToSell = event.params.amount
listing.tokenAddress = event.params.token
listing.tokenId = event.params.tokenId
listing.active = true
listing.deleted = false
listing.singleUnitPrice = event.params.price
Expand Down
1 change: 1 addition & 0 deletions carbonmark/src/Entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export function loadOrCreateListing(id: string): Listing {
listing.totalAmountToSell = ZERO_BI
listing.leftToSell = ZERO_BI
listing.tokenAddress = ZERO_ADDRESS
listing.tokenId = ZERO_BI
listing.active = false
listing.deleted = false
listing.batches = [ZERO_BI]
Expand Down

0 comments on commit 276dfd1

Please sign in to comment.