From e4e484757eb1cda3ac300cd44ef36f87cbaa7b20 Mon Sep 17 00:00:00 2001 From: Pavol Noha Date: Fri, 29 Nov 2024 12:24:26 +0100 Subject: [PATCH] include transfer tags in gc:xcm:new event --- packages/apps/src/app/xcm/App.ts | 8 ++++++-- packages/apps/src/app/xcm/Form.ts | 7 +++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/apps/src/app/xcm/App.ts b/packages/apps/src/app/xcm/App.ts index 592ffba942..0a7f02afc9 100644 --- a/packages/apps/src/app/xcm/App.ts +++ b/packages/apps/src/app/xcm/App.ts @@ -32,6 +32,7 @@ import '@galacticcouncil/ui'; import { findNestedKey, Asset, Transaction } from '@galacticcouncil/sdk'; import { + tags as xtags, assetsMap, chainsMap, routesMap, @@ -66,6 +67,8 @@ import { import styles from './App.css'; +const Tag = xtags.Tag; + @customElement('gc-xcm') export class XcmApp extends PoolApp { private configService: HydrationConfigService = null; @@ -422,7 +425,7 @@ export class XcmApp extends PoolApp { ? this.notificationApproveTemplate(transfer) : this.notificationTransferTemplate(transfer); - const { srcChain, srcData, destChain } = transfer; + const { srcChain, srcData, destChain, tags } = transfer; const srcChainFeeBalance = this.xchain.balance.get(srcData.fee.key); const options = { bubbles: true, @@ -443,6 +446,7 @@ export class XcmApp extends PoolApp { srcData.destinationFee.decimals, ), dstChainFeeSymbol: srcData.destinationFee.originSymbol, + tags: tags.join(','), }, } as TxInfo, }; @@ -1210,7 +1214,7 @@ export class XcmApp extends PoolApp { private isWormholeTransfer() { const { tags } = this.transfer; - return tags.includes('Wormhole'); + return tags.includes(Tag.Wormhole); } formTab() { diff --git a/packages/apps/src/app/xcm/Form.ts b/packages/apps/src/app/xcm/Form.ts index a1a56c50bd..e18168aa5f 100644 --- a/packages/apps/src/app/xcm/Form.ts +++ b/packages/apps/src/app/xcm/Form.ts @@ -6,6 +6,7 @@ import { unsafeHTML } from 'lit/directives/unsafe-html.js'; import { map } from 'lit/directives/map.js'; import { Asset as RegAsset } from '@galacticcouncil/sdk'; +import { tags as xtags } from '@galacticcouncil/xcm-cfg'; import { AnyChain, Asset, @@ -29,6 +30,8 @@ import 'element/id'; import styles from './Form.css'; +const Tag = xtags.Tag; + @customElement('gc-xcm-form') export class XcmForm extends LitElement { private account = new DatabaseController(this, AccountCursor); @@ -73,11 +76,11 @@ export class XcmForm extends LitElement { } private isMrl() { - return this.tags.includes('Wormhole') && this.tags.includes('Mrl'); + return this.tags.includes(Tag.Wormhole) && this.tags.includes(Tag.Mrl); } private isSnowbridge() { - return this.tags.includes('Snowbridge'); + return this.tags.includes(Tag.Snowbridge); } private isValidAddress(): boolean {