Skip to content

Commit 3f790c8

Browse files
authored
feat(apps-backend): add recognized coins to recognized packages list (#9690)
# Description of change Please write a summary of your changes and why you made them. ## Links to any relevant issues Fixes #9192 ## How the change has been tested - [ ] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have checked that new and existing unit tests pass locally with my changes
1 parent 01efaa2 commit 3f790c8

File tree

3 files changed

+60
-21
lines changed

3 files changed

+60
-21
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright (c) 2025 IOTA Stiftung
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
export const RECOGNIZED_COINS = [
5+
{
6+
type: '0x2::iota::IOTA',
7+
packageId: '0xd02db1bb647dfcc94f35b82a14e8bab07661be3e6d4b022bdc7ee63eed0728f8',
8+
name: 'IOTA',
9+
},
10+
{
11+
type: '0x1ec64aa5356180866521292ebefb778a16e2852380ff6425784ebc62fc98463f::cyb::CYB',
12+
packageId: '0xfa4a69abd685216e84f110e852ffd86a5f9ab0d1f87a4099535b12b730f5cf69',
13+
name: 'CYB',
14+
},
15+
{
16+
type: '0x206501fb7068b78c2fe3c827a019a6490c9b2aa3dbcd80071b7813e7d56a05c7::spam::SPAM',
17+
packageId: '0xa2286b2676cf53a88d82a90a202223caf4461f264a35aa7f349ff529ff6b9890',
18+
name: 'SPAM',
19+
},
20+
{
21+
type: '0xcb9bb938865bdfbb3b9b841279eab1ba793ef8846de68d30fb45c32ef5b78ab4::spec_coin::SPEC_COIN',
22+
packageId: '0x4309bb022f601fe3695638575513e15d28f4ab306a3ef38824f45ab0e220e74c',
23+
name: 'Speculation Coin',
24+
},
25+
{
26+
type: '0x346778989a9f57480ec3fee15f2cd68409c73a62112d40a3efd13987997be68c::cert::CERT',
27+
packageId: '0xc52f4441ce99aade4eb41b898dafb23ec59aa7c36a208a329034f7f18fcc22ab',
28+
name: 'Staked IOTA',
29+
},
30+
{
31+
type: '0xb63c04714082f9edb86b4b8fd07f89f0afebb9e6a96dd1a360a810e17691b674::tln_token::TLN_TOKEN',
32+
packageId: '0xe288d9a3f75fbdf1f5f7489da026e04520fc9bba55bb045ab399ba45ba3ef4d0',
33+
name: 'TokenLabs',
34+
},
35+
{
36+
type: '0xd3b63e603a78786facf65ff22e79701f3e824881a12fa3268d62a75530fe904f::vusd::VUSD',
37+
packageId: '0x7742d42bca53ef6edfc914786cc85ab0051d57a327a1609ee1f9aa464a24e753',
38+
name: 'Virtue USD',
39+
},
40+
];

apps/apps-backend/src/features/features.constants.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import { Network } from '@iota/iota-sdk/client';
55
import { normalizeIotaAddress } from '@iota/iota-sdk/utils';
6+
import { RECOGNIZED_COINS } from './coins.constants';
67

78
type FeatureEnabledByNetwork = Record<Network, boolean>;
89

@@ -36,3 +37,15 @@ export const NAME_ADDRESS_RESOLUTION_FEATURE: FeatureEnabledByNetwork = {
3637
[Network.Localnet]: false,
3738
[Network.Custom]: false,
3839
};
40+
41+
export const RECOGNIZED_PACKAGES = [
42+
'0x2',
43+
'0x3',
44+
'0x1',
45+
'0x107a',
46+
'0x0000000000000000000000000000000000000000000000000000000000000002',
47+
'0x0000000000000000000000000000000000000000000000000000000000000003',
48+
'0x0000000000000000000000000000000000000000000000000000000000000001',
49+
'0x000000000000000000000000000000000000000000000000000000000000107a',
50+
...RECOGNIZED_COINS.map((coin) => coin.packageId),
51+
];

apps/apps-backend/src/features/features.controller.ts

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
import { Controller, Get } from '@nestjs/common';
55
import { Feature } from '@iota/core/enums/features.enums';
66
import { Network } from '@iota/iota-sdk/client';
7-
import { NAME_ADDRESS_RESOLUTION_FEATURE, KNOWN_ADDRESSES_ALIASES } from './features.constants';
7+
import {
8+
NAME_ADDRESS_RESOLUTION_FEATURE,
9+
KNOWN_ADDRESSES_ALIASES,
10+
RECOGNIZED_PACKAGES,
11+
} from './features.constants';
812

913
@Controller('/api/features')
1014
export class FeaturesController {
@@ -14,16 +18,7 @@ export class FeaturesController {
1418
status: 200,
1519
features: {
1620
[Feature.RecognizedPackages]: {
17-
defaultValue: [
18-
'0x2',
19-
'0x3',
20-
'0x1',
21-
'0x107a',
22-
'0x0000000000000000000000000000000000000000000000000000000000000002',
23-
'0x0000000000000000000000000000000000000000000000000000000000000003',
24-
'0x0000000000000000000000000000000000000000000000000000000000000001',
25-
'0x000000000000000000000000000000000000000000000000000000000000107a',
26-
],
21+
defaultValue: RECOGNIZED_PACKAGES,
2722
},
2823
[Feature.WalletSentryTracing]: {
2924
defaultValue: 0.0025,
@@ -124,16 +119,7 @@ export class FeaturesController {
124119
status: 200,
125120
features: {
126121
[Feature.RecognizedPackages]: {
127-
defaultValue: [
128-
'0x2',
129-
'0x3',
130-
'0x1',
131-
'0x107a',
132-
'0x0000000000000000000000000000000000000000000000000000000000000002',
133-
'0x0000000000000000000000000000000000000000000000000000000000000003',
134-
'0x0000000000000000000000000000000000000000000000000000000000000001',
135-
'0x000000000000000000000000000000000000000000000000000000000000107a',
136-
],
122+
defaultValue: RECOGNIZED_PACKAGES,
137123
},
138124
[Feature.WalletSentryTracing]: {
139125
defaultValue: 0.0025,

0 commit comments

Comments
 (0)