Skip to content

Commit

Permalink
Merge pull request #313 from kodadot/main
Browse files Browse the repository at this point in the history
🔖 🐛  Speck v13
  • Loading branch information
vikiival authored Sep 24, 2024
2 parents ecb9548 + fa9b511 commit 727c50b
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/mappings/nfts/buy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function handleTokenBuy(context: Context): Promise<void> {
const originalPrice = event.price
const originalOwner = entity.currentOwner ?? undefined

entity.price = BigInt(0)
entity.price = null
entity.currentOwner = event.caller
entity.updatedAt = event.timestamp

Expand Down
2 changes: 1 addition & 1 deletion src/mappings/nfts/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export async function handleTokenList(context: Context): Promise<void> {
const id = createTokenId(event.collectionId, event.sn)
const entity = await getWith(context.store, NE, id, { collection: true })

entity.price = event.price
entity.price = Boolean(event.price) ? event.price : null

if (event.price && (entity.collection.floor === 0n || event.price < entity.collection.floor)) {
entity.collection.floor = event.price
Expand Down
2 changes: 1 addition & 1 deletion src/mappings/nfts/mint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export async function handleTokenCreate(context: Context): Promise<void> {
final.collection = collection
final.sn = BigInt(event.sn)
final.metadata = event.metadata || tokenUri(collection.baseUri, event.sn) || collection.metadata
final.price = BigInt(0)
final.price = null
final.burned = false
final.createdAt = event.timestamp
final.updatedAt = event.timestamp
Expand Down
2 changes: 1 addition & 1 deletion src/mappings/nfts/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export async function handleTokenTransfer(context: Context): Promise<void> {
const entity = await getWith(context.store, NE, id, { collection: true })

const oldOwner = entity.currentOwner
entity.price = BigInt(0)
entity.price = null
entity.currentOwner = event.to
entity.updatedAt = event.timestamp

Expand Down
2 changes: 1 addition & 1 deletion src/mappings/uniques/buy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function handleTokenBuy(context: Context): Promise<void> {
const originalPrice = event.price
const originalOwner = entity.currentOwner ?? undefined

entity.price = BigInt(0)
entity.price = null
entity.currentOwner = event.caller
entity.updatedAt = event.timestamp

Expand Down
2 changes: 1 addition & 1 deletion src/mappings/uniques/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export async function handleTokenList(context: Context): Promise<void> {
const id = createTokenId(event.collectionId, event.sn)
const entity = await getWith(context.store, NE, id, { collection: true })

entity.price = event.price
entity.price = Boolean(event.price) ? event.price : null

if (event.price && (entity.collection.floor === 0n || event.price < entity.collection.floor)) {
entity.collection.floor = event.price
Expand Down
2 changes: 1 addition & 1 deletion src/mappings/uniques/mint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export async function handleTokenCreate(context: Context): Promise<void> {
final.collection = collection
final.sn = BigInt(event.sn)
final.metadata = event.metadata || collection.metadata
final.price = BigInt(0)
final.price = null
final.burned = false
final.createdAt = event.timestamp
final.updatedAt = event.timestamp
Expand Down
2 changes: 1 addition & 1 deletion src/mappings/uniques/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function handleTokenTransfer(context: Context): Promise<void> {
const entity = await getWith(context.store, NE, id, { collection: true })

const oldOwner = entity.currentOwner
entity.price = BigInt(0)
entity.price = null
entity.currentOwner = event.to
entity.updatedAt = event.timestamp

Expand Down
2 changes: 1 addition & 1 deletion src/server-extension/query/tokenEntities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ SELECT
nc.count as count,
nc.supply as supply,
col.id AS collection_id,
col.name AS collection_name
col.name AS collection_name,
col.kind AS kind
FROM
token_entity as t
Expand Down

0 comments on commit 727c50b

Please sign in to comment.