Skip to content

Commit

Permalink
include transfer tags in gc:xcm:new event
Browse files Browse the repository at this point in the history
  • Loading branch information
nohaapav committed Nov 29, 2024
1 parent 5379c8a commit e4e4847
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 6 additions & 2 deletions packages/apps/src/app/xcm/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import '@galacticcouncil/ui';
import { findNestedKey, Asset, Transaction } from '@galacticcouncil/sdk';

import {
tags as xtags,
assetsMap,
chainsMap,
routesMap,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -443,6 +446,7 @@ export class XcmApp extends PoolApp {
srcData.destinationFee.decimals,
),
dstChainFeeSymbol: srcData.destinationFee.originSymbol,
tags: tags.join(','),
},
} as TxInfo,
};
Expand Down Expand Up @@ -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() {
Expand Down
7 changes: 5 additions & 2 deletions packages/apps/src/app/xcm/Form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<Account>(this, AccountCursor);
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit e4e4847

Please sign in to comment.