Skip to content

Commit

Permalink
add sns
Browse files Browse the repository at this point in the history
  • Loading branch information
justraman committed Nov 8, 2023
1 parent 78d7d61 commit 5db99be
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/mappings/multiTokens/events/claim_tokens_initiated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Event as EventModel, Extrinsic, MultiTokensClaimTokensInitiated, MultiT
import { CommonContext } from '../../types/contexts'
import { Event } from '../../../types/generated/support'
import { getOrCreateAccount } from '../../util/entities'
import { Sns } from '../../../common/sns'

function getEventData(ctx: CommonContext, event: Event) {
const data = new MultiTokensClaimTokensInitiatedEvent(ctx, event)
Expand Down Expand Up @@ -36,6 +37,15 @@ export async function claimTokensInitiated(

await ctx.store.insert(MultiTokensClaims, claim as any)

Sns.getInstance().send({
id: item.event.id,
name: item.event.name,
body: {
account: u8aToHex(data.accountId),
ethAccount: u8aToHex(data.ethereumAddress),
},
})

return new EventModel({
id: item.event.id,
extrinsic: item.event.extrinsic?.id ? new Extrinsic({ id: item.event.extrinsic.id }) : null,
Expand Down

0 comments on commit 5db99be

Please sign in to comment.