Skip to content

Commit

Permalink
Merge pull request #192 from roiLeo/fix/event/mint_to
Browse files Browse the repository at this point in the history
🔧 mint send_to
  • Loading branch information
vikiival authored Jan 12, 2024
2 parents e798605 + 717202a commit 5cdeec1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
14 changes: 10 additions & 4 deletions src/mappings/nfts/mint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,15 @@ export async function handleTokenCreate(context: Context): Promise<void> {
success(OPERATION, `${final.id}`)
await context.store.save(final)
await context.store.save(collection)
await createEvent(final, OPERATION, event, '', context.store)

const destinationAddress = final.issuer !== final.currentOwner ? final.currentOwner : ''

if (final.issuer !== final.currentOwner) {
await createEvent(final, Action.SEND, event, final.currentOwner, context.store, final.issuer)
}
await createEvent(
final,
OPERATION,
event,
destinationAddress,
context.store,
final.issuer !== final.currentOwner ? final.issuer : undefined
)
}
15 changes: 10 additions & 5 deletions src/mappings/uniques/mint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,17 @@ export async function handleTokenCreate(context: Context): Promise<void> {

await mintHandler(context, collection, final)

const destinationAddress = final.issuer !== final.currentOwner ? final.currentOwner : ''

success(OPERATION, `${final.id}`)
await context.store.save(final)
await context.store.save(collection)
await createEvent(final, OPERATION, event, '', context.store)

if (final.issuer !== final.currentOwner) {
await createEvent(final, Action.SEND, event, final.currentOwner, context.store, final.issuer)
}
await createEvent(
final,
OPERATION,
event,
destinationAddress,
context.store,
final.issuer !== final.currentOwner ? final.issuer : undefined
)
}

0 comments on commit 5cdeec1

Please sign in to comment.