From 5db99beb749ede3de2ca1a7d100e27793e92c489 Mon Sep 17 00:00:00 2001 From: Raman Shekhawat Date: Thu, 9 Nov 2023 03:23:16 +0530 Subject: [PATCH] add sns --- .../multiTokens/events/claim_tokens_initiated.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mappings/multiTokens/events/claim_tokens_initiated.ts b/src/mappings/multiTokens/events/claim_tokens_initiated.ts index 7b3c331ed..341baf0ed 100644 --- a/src/mappings/multiTokens/events/claim_tokens_initiated.ts +++ b/src/mappings/multiTokens/events/claim_tokens_initiated.ts @@ -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) @@ -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,