From 6f75edad3158455cc121bff59618e4a6f442e464 Mon Sep 17 00:00:00 2001 From: N V Rakesh Reddy Date: Thu, 9 Jan 2025 15:29:02 +0530 Subject: [PATCH] chore(tao): add tao coin to statics TICKET: WIN-4289 --- modules/statics/src/base.ts | 3 ++ modules/statics/src/coins.ts | 31 +++++++++++++++++++ modules/statics/src/networks.ts | 14 +++++++++ .../unit/fixtures/expectedColdFeatures.ts | 2 ++ 4 files changed, 50 insertions(+) diff --git a/modules/statics/src/base.ts b/modules/statics/src/base.ts index ba4348689d..8c1bb1e9d6 100644 --- a/modules/statics/src/base.ts +++ b/modules/statics/src/base.ts @@ -68,6 +68,7 @@ export enum CoinFamily { SUI = 'sui', STX = 'stx', SUSD = 'susd', + TAO = 'tao', THOR = 'thor', TIA = 'tia', // Celestia TON = 'ton', @@ -1483,6 +1484,7 @@ export enum UnderlyingAsset { SYNCH = 'synch', SYRUP = 'syrup', 'SYNTH-SUSD' = 'synth-susd', + TAO = 'tao', THRESHOLD = 'threshold', THEU = 'theu', TAUD = 'taud', @@ -2450,6 +2452,7 @@ export enum BaseUnit { TCOREUM = 'utestcore', // Coreum testnet uses different name for native coin ISLM = 'aISLM', RUNE = 'rune', + TAO = 'tao', } export interface BaseCoinConstructorOptions { diff --git a/modules/statics/src/coins.ts b/modules/statics/src/coins.ts index 4480796708..7c844ec928 100644 --- a/modules/statics/src/coins.ts +++ b/modules/statics/src/coins.ts @@ -430,6 +430,15 @@ const APT_FEATURES = [ CoinFeature.BULK_STAKING_TRANSACTION, CoinFeature.SUPPORTS_TOKENS, ]; +const TAO_FEATURES = [ + ...AccountCoin.DEFAULT_FEATURES, + CoinFeature.TSS, + CoinFeature.TSS_COLD, + CoinFeature.STAKING, + CoinFeature.BULK_TRANSACTION, + CoinFeature.BULK_STAKING_TRANSACTION, +]; + const ETH_FEATURES_WITH_FRANKFURT = [...ETH_FEATURES, CoinFeature.CUSTODY_BITGO_FRANKFURT]; const ETH_FEATURES_WITH_FRANKFURT_GERMANY = [...ETH_FEATURES_WITH_FRANKFURT, CoinFeature.CUSTODY_BITGO_GERMANY]; const SOL_TOKEN_FEATURES_WITH_FRANKFURT = [ @@ -1418,6 +1427,28 @@ export const coins = CoinMap.fromCoins([ APT_FEATURES, KeyCurve.Ed25519 ), + account( + 'a08453f0-a3be-4875-b82b-6b0c9bfa53e6', + 'tao', + 'Tao', + Networks.main.tao, + 9, + UnderlyingAsset.TAO, + BaseUnit.TAO, + TAO_FEATURES, + KeyCurve.Ed25519 + ), + account( + '0f7a1a5b-7f34-4593-80bc-2fb4ea15ebfc', + 'ttao', + 'Testnet Tao', + Networks.test.tao, + 9, + UnderlyingAsset.TAO, + BaseUnit.TAO, + TAO_FEATURES, + KeyCurve.Ed25519 + ), erc20CompatibleAccountCoin( 'bfae821b-cf3a-4190-b1a8-a54af51d730e', 'celo', diff --git a/modules/statics/src/networks.ts b/modules/statics/src/networks.ts index fbad3f76b2..128681a2de 100644 --- a/modules/statics/src/networks.ts +++ b/modules/statics/src/networks.ts @@ -886,6 +886,18 @@ class Fiat extends Mainnet implements BaseNetwork { explorerUrl = undefined; } +class Tao extends Mainnet implements AccountNetwork { + name = 'Tao'; + family = CoinFamily.TAO; + explorerUrl = 'https://taostats.io/evm/tx/'; +} + +class TaoTestnet extends Testnet implements AccountNetwork { + name = 'Testnet Tao'; + family = CoinFamily.TAO; + explorerUrl = 'https://explorer.finney.opentensor.ai/#/'; +} + class Trx extends Mainnet implements TronNetwork { name = 'Trx'; family = CoinFamily.TRX; @@ -1195,6 +1207,7 @@ export const Networks = { near: Object.freeze(new Near()), stx: Object.freeze(new Stx()), susd: Object.freeze(new SUSD()), + tao: Object.freeze(new Tao()), tia: Object.freeze(new Tia()), ton: Object.freeze(new Ton()), trx: Object.freeze(new Trx()), @@ -1259,6 +1272,7 @@ export const Networks = { stx: Object.freeze(new StxTestnet()), susd: Object.freeze(new SUSDTestnet()), coreum: Object.freeze(new CoreumTestnet()), + tao: Object.freeze(new TaoTestnet()), tia: Object.freeze(new TiaTestnet()), ton: Object.freeze(new TonTestnet()), trx: Object.freeze(new TrxTestnet()), diff --git a/modules/statics/test/unit/fixtures/expectedColdFeatures.ts b/modules/statics/test/unit/fixtures/expectedColdFeatures.ts index ce860342a8..5e44c017ee 100644 --- a/modules/statics/test/unit/fixtures/expectedColdFeatures.ts +++ b/modules/statics/test/unit/fixtures/expectedColdFeatures.ts @@ -76,6 +76,7 @@ export const expectedColdFeatures = { 'sei', 'sol', 'sui', + 'tao', 'zeta', 'tada', 'tatom', @@ -97,6 +98,7 @@ export const expectedColdFeatures = { 'tsei', 'tsol', 'tsui', + 'ttao', 'tthorchain:rune', 'ttia', 'tzeta',