From 26fb10f9b7b1a5685b8638c1f7899517a6c6d12e Mon Sep 17 00:00:00 2001 From: Petar Todorovic Date: Fri, 15 Aug 2025 17:01:42 +0200 Subject: [PATCH 1/2] feat: additional validator info --- .changeset/fair-poets-wash.md | 5 ++ biome.json | 12 ++- package.json | 2 +- packages/widget/package.json | 2 +- .../molecules/select-validator/meta-info.tsx | 30 +++++++ .../select-validator-list.tsx | 3 + .../src/translation/English/translations.json | 5 +- .../src/translation/French/translations.json | 70 ++++++++++++++-- packages/widget/tests/utils/setup.ts | 2 +- pnpm-lock.yaml | 84 +++++++++---------- 10 files changed, 158 insertions(+), 57 deletions(-) create mode 100644 .changeset/fair-poets-wash.md diff --git a/.changeset/fair-poets-wash.md b/.changeset/fair-poets-wash.md new file mode 100644 index 000000000..1bbc44ff5 --- /dev/null +++ b/.changeset/fair-poets-wash.md @@ -0,0 +1,5 @@ +--- +"@stakekit/widget": patch +--- + +feat: additional validator info diff --git a/biome.json b/biome.json index 1afed634b..f6d691529 100644 --- a/biome.json +++ b/biome.json @@ -44,10 +44,16 @@ "noInferrableTypes": "error", "noUselessElse": "error" }, - "suspicious": { "noArrayIndexKey": "off" }, + "suspicious": { + "noArrayIndexKey": "off", + "useIterableCallbackReturn": "off" + }, "a11y": { "noSvgWithoutTitle": "off" }, - "correctness": { "useJsxKeyInIterable": "off" }, - "complexity": { "noForEach": "off" } + "correctness": { + "useJsxKeyInIterable": "off", + "useUniqueElementIds": "off" + }, + "complexity": { "noForEach": "off", "useIndexOf": "off" } } }, "javascript": { diff --git a/package.json b/package.json index 0c60968a7..e8ccdbe37 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "version": "changeset version" }, "devDependencies": { - "@biomejs/biome": "^2.1.2", + "@biomejs/biome": "^2.2.0", "@changesets/cli": "^2.29.5", "@commitlint/cli": "^19.8.1", "@commitlint/config-conventional": "^19.8.1", diff --git a/packages/widget/package.json b/packages/widget/package.json index f20adadae..eba91f2d8 100644 --- a/packages/widget/package.json +++ b/packages/widget/package.json @@ -72,7 +72,7 @@ "@radix-ui/react-visually-hidden": "^1.2.3", "@safe-global/safe-apps-provider": "^0.18.6", "@safe-global/safe-apps-sdk": "^9.1.0", - "@stakekit/api-hooks": "0.0.108", + "@stakekit/api-hooks": "0.0.109", "@stakekit/common": "^0.0.55", "@stakekit/rainbowkit": "^2.2.6", "@tanstack/react-query": "^5.83.0", diff --git a/packages/widget/src/components/molecules/select-validator/meta-info.tsx b/packages/widget/src/components/molecules/select-validator/meta-info.tsx index 5d7e33c08..347777051 100644 --- a/packages/widget/src/components/molecules/select-validator/meta-info.tsx +++ b/packages/widget/src/components/molecules/select-validator/meta-info.tsx @@ -21,6 +21,9 @@ export const useMetaInfo = ({ rewardType, website, nominatorCount, + subnetName, + marketCap, + tokenSymbol, }: { [Key in keyof Pick< ValidatorDto, @@ -30,6 +33,9 @@ export const useMetaInfo = ({ | "address" | "website" | "nominatorCount" + | "subnetName" + | "marketCap" + | "tokenSymbol" >]: ValidatorDto[Key] | undefined; } & { stakedBalanceToken: YieldDto["token"] | undefined; @@ -47,6 +53,9 @@ export const useMetaInfo = ({ | "address" | "website" | "nominatorCount" + | "subnetName" + | "marketCap" + | "tokenSymbol" >]: { title: string; val: ReactNode } | null; }>( () => ({ @@ -115,6 +124,24 @@ export const useMetaInfo = ({ ), } : null, + subnetName: subnetName + ? { + title: t("details.validators_subnet_name"), + val: subnetName, + } + : null, + marketCap: marketCap + ? { + title: t("details.validators_market_cap"), + val: formatNumber(marketCap, 2), + } + : null, + tokenSymbol: tokenSymbol + ? { + title: t("details.validators_token_symbol"), + val: tokenSymbol, + } + : null, }), [ rewardRate, @@ -127,6 +154,9 @@ export const useMetaInfo = ({ address, website, nominatorCount, + subnetName, + marketCap, + tokenSymbol, ] ); }; diff --git a/packages/widget/src/components/molecules/select-validator/select-validator-list.tsx b/packages/widget/src/components/molecules/select-validator/select-validator-list.tsx index fd6a4ec29..a6e64c398 100644 --- a/packages/widget/src/components/molecules/select-validator/select-validator-list.tsx +++ b/packages/widget/src/components/molecules/select-validator/select-validator-list.tsx @@ -213,6 +213,9 @@ export const SelectValidatorList = ({ stakedBalance={item.stakedBalance} votingPower={item.votingPower} nominatorCount={item.nominatorCount} + subnetName={item.subnetName} + marketCap={item.marketCap} + tokenSymbol={item.tokenSymbol} rewardRate={undefined} rewardType={undefined} stakedBalanceToken={selectedStake.token} diff --git a/packages/widget/src/translation/English/translations.json b/packages/widget/src/translation/English/translations.json index 088be0dbc..122071569 100644 --- a/packages/widget/src/translation/English/translations.json +++ b/packages/widget/src/translation/English/translations.json @@ -144,7 +144,10 @@ "validators_address": "Address", "validators_comission": "Commission", "validators_website": "Website", - "validators_nominator_count": "Nominator count" + "validators_nominator_count": "Nominator count", + "validators_subnet_name": "Subnet name", + "validators_market_cap": "Market cap", + "validators_token_symbol": "Token symbol" }, "dashboard": { "details": { diff --git a/packages/widget/src/translation/French/translations.json b/packages/widget/src/translation/French/translations.json index 143151237..4e9781f39 100644 --- a/packages/widget/src/translation/French/translations.json +++ b/packages/widget/src/translation/French/translations.json @@ -51,6 +51,7 @@ "earn": "Earn", "estimated_reward": "Récompenses estimées", "earn_with": "Earn avec", + "restake_with": "Restake avec", "additional_info": "Infos supplémentaires", "rewards": { "receive": "Vous recevrez des via", @@ -66,6 +67,10 @@ "no_opportunities": "Pas d'opportunité de yield pour ce token", "selected_validators_one": "{{providerName}}", "selected_validators_other": "{{providerName}} + {{count}} autres", + "campaign_susd_description": "Après avoir staké sUSD, la position est bloquée jusqu'au 20 avril 2026.", + "campaign_susd_extra": "Les récompenses gagnées sont distribuées périodiquement sous forme de SNX et se débloquent linéairement sur 3 mois après la fin du programme.", + "campaign_susd_position_locked": "La position est bloquée jusqu'au 20 avril 2026. En savoir plus", + "campaign_susd": "En savoir plus sur le programme de staking sUSD ici", "campaign": "Les récompenses sont bloquées jusqu'au 28 mai 2026. Les retraits anticipés peuvent entraîner des pénalités. En savoir plus", "lockup_period": "La période de blocage minimum est de {{days}} jours", "native_staking": { @@ -78,6 +83,7 @@ }, "vault": { "description": "En déposant du {{stakeToken}} vous recevrez du {{depositToken}}. Vous pouvez trader cet actif liquide à tout moment", + "description_ethena_usde": "En déposant du {{stakeToken}} vous recevrez du {{depositToken}}.", "earn_after_warmup_one": "Vous commencerez à être récompensé {{count}} jour après avoir fourni vos actifs", "earn_after_warmup_other": "Vous commencerez à être récompensé {{count}} jours après avoir fourni vos actifs", "earn_yield_auto": "Le yield gagné est mis à jour chaque {{rewardSchedule}} et se cumule automatiquement", @@ -121,6 +127,7 @@ "opportunity_search_title": "Sélectionnez un rendement", "validator_search_title_one": "Sélectionnez un validateur", "validator_search_title_other": "Sélectionnez des validateurs", + "provider_search_title": "Sélectionnez un fournisseur", "reward_token": "Vous recevrez des via {{providerName}}", "tabs": { "earn": "Earn", @@ -137,7 +144,10 @@ "validators_address": "Adresse", "validators_comission": "Commission", "validators_website": "Site web", - "validators_nominator_count": "Nombre de nominators" + "validators_nominator_count": "Nombre de nominators", + "validators_subnet_name": "Nom du sous-réseau", + "validators_market_cap": "Capitalisation boursière", + "validators_token_symbol": "Symbole du token" }, "review": { "estimated_reward": "Récompenses estimées", @@ -178,10 +188,13 @@ "DEPOSIT": "DÉPÔT", "APPROVAL": "APPROBATION", "STAKE": "MISE", + "STAKE_ETHENA_USDE": "DÉPÔT", "CLAIM_UNSTAKED": "RÉCLAMER NON MIS", + "CLAIM_UNSTAKED_ETHENA_USDE": "RÉCLAMER", "CLAIM_REWARDS": "RÉCLAMER RÉCOMPENSES", "RESTAKE_REWARDS": "REMISE DES RÉCOMPENSES", "UNSTAKE": "RETIRER", + "UNSTAKE_ETHENA_USDE": "REFROIDISSEMENT", "SPLIT": "DIVISER", "MERGE": "FUSIONNER", "LOCK": "VERROUILLER", @@ -215,7 +228,15 @@ "INFSTONES_EXIT_REQUEST": "DEMANDE DE SORTIE INFSTONES", "INFSTONES_CLAIM_REQUEST": "DEMANDE DE RÉCLAMATION INFSTONES", "WRAP": "ENVELOPER", - "UNWRAP": "DÉENVELOPER" + "UNWRAP": "DÉENVELOPER", + "DELEGATE": "DÉLÉGUER", + "UNDELEGATE": "ANNULER DÉLÉGATION", + "VERIFY_WITHDRAW_CREDENTIALS": "VÉRIFIER IDENTIFIANTS RETRAIT", + "CREATE_EIGENPOD": "CRÉER EIGENPOD", + "START_CHECKPOINT": "DÉMARRER CHECKPOINT", + "VERIFY_CHECKPOINT_PROOFS": "VÉRIFIER PREUVES CHECKPOINT", + "QUEUE_WITHDRAWALS": "METTRE EN FILE RETRAITS", + "COMPLETE_QUEUED_WITHDRAWALS": "COMPLÉTER RETRAITS EN FILE" } }, "complete": { @@ -224,9 +245,11 @@ "successfully_pending_action": "{{amount}} {{tokenNetwork}} {{pendingAction}} avec succès", "view_transaction": "Voir la transaction {{type}}", "via": "via {{providerName}}", - "continue": "Aller au tableau de bord Earn", + "continue": "Aller au tableau de bord Aperçu", + "continue_ledger": "Aller au tableau de bord Earn", "stake": { "staking": "staké", + "staking_ethena_usde": "déposé", "liquid-staking": "staké", "vault": "déposé", "lending": "fourni", @@ -236,6 +259,7 @@ }, "unstake": { "staking": "déstaké", + "staking_ethena_usde": "retiré", "liquid-staking": "déstaké", "vault": "retiré", "lending": "retiré", @@ -251,6 +275,7 @@ "withdraw": "reitré", "restake": "restaké", "claim_unstaked": "déstakés réclamés", + "claim_unstaked_ethena_usde": "réclamé", "unlock_locked": "bloqués débloqués", "unlock_locked_legacy": "bloqués débloqués", "stake_locked": "bloqués stakés", @@ -260,7 +285,15 @@ "revote": "Revoter", "rebond": "Re-staker", "migrate": "Migrer", - "withdraw_all": "Retirer tout" + "withdraw_all": "Retirer tout", + "verify_withdraw_credentials": "identifiants de retrait vérifiés", + "delegate": "délégué", + "undelegate": "délégation annulée", + "create_eigenpod": "eigenpod créé", + "start_checkpoint": "checkpoint démarré", + "verify_checkpoint_proofs": "preuves de checkpoint vérifiées", + "queue_withdrawals": "retraits mis en file", + "complete_queued_withdrawals": "retraits en file complétés" } }, "help_modals": { @@ -396,6 +429,7 @@ "withdraw_all": "Retirer tout", "restake": "Restaker", "claim_unstaked": "Réclamer les déstakés", + "claim_unstaked_ethena_usde": "Réclamer", "unlock_locked": "Débloquer", "unlock_locked_legacy": "Débloquer", "stake_locked": "Staker", @@ -404,7 +438,15 @@ "vote_locked": "Voter", "revote": "Revoter", "rebond": "Re-staker", - "migrate": "Migrer" + "migrate": "Migrer", + "verify_withdraw_credentials": "Vérifier identifiants de retrait", + "delegate": "Déléguer", + "undelegate": "Annuler délégation", + "create_eigenpod": "Créer eigenpod", + "start_checkpoint": "Démarrer checkpoint", + "verify_checkpoint_proofs": "Vérifier preuves checkpoint", + "queue_withdrawals": "Mettre en file retraits", + "complete_queued_withdrawals": "Compléter retraits en file" }, "pending_action_button": { "stake": "Staker", @@ -423,7 +465,9 @@ "vote_locked": "Voter bloqué", "revote": "Revoter", "rebond": "Re-staker", - "migrate": "Migrer" + "migrate": "Migrer", + "verify_withdraw_credentials": "Vérifier identifiants de retrait", + "delegate": "Déléguer" }, "unstake_sign": { "title": "Vérifier la propriété", @@ -444,6 +488,7 @@ "withdraw_all": "Retirer tout de {{providerName}}", "restake": "Restaker avec {{providerName}}", "claim_unstaked": "Réclamer le déstaké de {{providerName}}", + "claim_unstaked_ethena_usde": "Réclamer de {{providerName}}", "unlock_locked": "Débloquer le bloqué de {{providerName}}", "unlock_locked_legacy": "Débloquer le bloqué de {{providerName}}", "stake_locked": "Staker le bloqué avec {{providerName}}", @@ -452,7 +497,9 @@ "vote_locked": "Voter bloqué avec {{providerName}}", "revote": "Revoter avec {{providerName}}", "rebond": "Re-staker avec {{providerName}}", - "migrate": "Migrer de {{providerName}}" + "migrate": "Migrer de {{providerName}}", + "verify_withdraw_credentials": "Vérifier identifiants de retrait de {{providerName}}", + "delegate": "Déléguer avec {{providerName}}" } }, "select_token": { @@ -463,6 +510,7 @@ "error_modal": { "solution": "Solution potentielle :" }, + "chain_modal_disclaimer": "Alimenté par Yield.xyz", "dashboard": { "details": { "tabs": { @@ -470,7 +518,13 @@ "rewards": "Récompenses", "activity": "Activité" }, - "positions_tooltip": "Les positions sont vos soldes actuellement stakés sur le réseau." + "positions_tooltip": "Les positions sont vos soldes liés au rendement sur le réseau.", + "positions_yield": "Rendement", + "positions_reward_rate": "Taux de récompense", + "positions_amount": "Montant", + "positions_rewards": "Récompenses", + "positions_connect_wallet": "Connectez un portefeuille pour voir vos positions", + "activity_connect_wallet": "Connectez un portefeuille pour voir votre activité" }, "position_details_info": { "balances": "Soldes" diff --git a/packages/widget/tests/utils/setup.ts b/packages/widget/tests/utils/setup.ts index c9bf2ba82..d88d5479b 100644 --- a/packages/widget/tests/utils/setup.ts +++ b/packages/widget/tests/utils/setup.ts @@ -16,7 +16,7 @@ const originalConsoleError = console.error; const originalConsoleLog = console.log; const originalStdoutWrite = process.stdout.write.bind(process.stdout); -//@ts-ignore +//@ts-expect-error process.stdout.write = (chunk, encoding, callback) => { if (typeof chunk === "string" && chunk.includes("relay.walletconnect")) { return true; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4372eeab5..a57c4b6d3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,8 +18,8 @@ importers: .: devDependencies: '@biomejs/biome': - specifier: ^2.1.2 - version: 2.1.2 + specifier: ^2.2.0 + version: 2.2.0 '@changesets/cli': specifier: ^2.29.5 version: 2.29.5 @@ -157,8 +157,8 @@ importers: specifier: ^9.1.0 version: 9.1.0(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.76) '@stakekit/api-hooks': - specifier: 0.0.108 - version: 0.0.108(@faker-js/faker@9.9.0)(@tanstack/react-query@5.83.0(react@19.1.0))(msw@2.10.4(@types/node@24.0.15)(typescript@5.8.3))(react@19.1.0) + specifier: 0.0.109 + version: 0.0.109(@faker-js/faker@9.9.0)(@tanstack/react-query@5.83.0(react@19.1.0))(msw@2.10.4(@types/node@24.0.15)(typescript@5.8.3))(react@19.1.0) '@stakekit/common': specifier: ^0.0.55 version: 0.0.55 @@ -500,55 +500,55 @@ packages: resolution: {integrity: sha512-x0LvFTekgSX+83TI28Y9wYPUfzrnl2aT5+5QLnO6v7mSJYtEEevuDRN0F0uSHRk1G1IWZC43o00Y0xDDrpBGPQ==} engines: {node: '>=6.9.0'} - '@biomejs/biome@2.1.2': - resolution: {integrity: sha512-yq8ZZuKuBVDgAS76LWCfFKHSYIAgqkxVB3mGVVpOe2vSkUTs7xG46zXZeNPRNVjiJuw0SZ3+J2rXiYx0RUpfGg==} + '@biomejs/biome@2.2.0': + resolution: {integrity: sha512-3On3RSYLsX+n9KnoSgfoYlckYBoU6VRM22cw1gB4Y0OuUVSYd/O/2saOJMrA4HFfA1Ff0eacOvMN1yAAvHtzIw==} engines: {node: '>=14.21.3'} hasBin: true - '@biomejs/cli-darwin-arm64@2.1.2': - resolution: {integrity: sha512-leFAks64PEIjc7MY/cLjE8u5OcfBKkcDB0szxsWUB4aDfemBep1WVKt0qrEyqZBOW8LPHzrFMyDl3FhuuA0E7g==} + '@biomejs/cli-darwin-arm64@2.2.0': + resolution: {integrity: sha512-zKbwUUh+9uFmWfS8IFxmVD6XwqFcENjZvEyfOxHs1epjdH3wyyMQG80FGDsmauPwS2r5kXdEM0v/+dTIA9FXAg==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [darwin] - '@biomejs/cli-darwin-x64@2.1.2': - resolution: {integrity: sha512-Nmmv7wRX5Nj7lGmz0FjnWdflJg4zii8Ivruas6PBKzw5SJX/q+Zh2RfnO+bBnuKLXpj8kiI2x2X12otpH6a32A==} + '@biomejs/cli-darwin-x64@2.2.0': + resolution: {integrity: sha512-+OmT4dsX2eTfhD5crUOPw3RPhaR+SKVspvGVmSdZ9y9O/AgL8pla6T4hOn1q+VAFBHuHhsdxDRJgFCSC7RaMOw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [darwin] - '@biomejs/cli-linux-arm64-musl@2.1.2': - resolution: {integrity: sha512-qgHvafhjH7Oca114FdOScmIKf1DlXT1LqbOrrbR30kQDLFPEOpBG0uzx6MhmsrmhGiCFCr2obDamu+czk+X0HQ==} + '@biomejs/cli-linux-arm64-musl@2.2.0': + resolution: {integrity: sha512-egKpOa+4FL9YO+SMUMLUvf543cprjevNc3CAgDNFLcjknuNMcZ0GLJYa3EGTCR2xIkIUJDVneBV3O9OcIlCEZQ==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-arm64@2.1.2': - resolution: {integrity: sha512-NWNy2Diocav61HZiv2enTQykbPP/KrA/baS7JsLSojC7Xxh2nl9IczuvE5UID7+ksRy2e7yH7klm/WkA72G1dw==} + '@biomejs/cli-linux-arm64@2.2.0': + resolution: {integrity: sha512-6eoRdF2yW5FnW9Lpeivh7Mayhq0KDdaDMYOJnH9aT02KuSIX5V1HmWJCQQPwIQbhDh68Zrcpl8inRlTEan0SXw==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-x64-musl@2.1.2': - resolution: {integrity: sha512-xlB3mU14ZUa3wzLtXfmk2IMOGL+S0aHFhSix/nssWS/2XlD27q+S6f0dlQ8WOCbYoXcuz8BCM7rCn2lxdTrlQA==} + '@biomejs/cli-linux-x64-musl@2.2.0': + resolution: {integrity: sha512-I5J85yWwUWpgJyC1CcytNSGusu2p9HjDnOPAFG4Y515hwRD0jpR9sT9/T1cKHtuCvEQ/sBvx+6zhz9l9wEJGAg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-linux-x64@2.1.2': - resolution: {integrity: sha512-Km/UYeVowygTjpX6sGBzlizjakLoMQkxWbruVZSNE6osuSI63i4uCeIL+6q2AJlD3dxoiBJX70dn1enjQnQqwA==} + '@biomejs/cli-linux-x64@2.2.0': + resolution: {integrity: sha512-5UmQx/OZAfJfi25zAnAGHUMuOd+LOsliIt119x2soA2gLggQYrVPA+2kMUxR6Mw5M1deUF/AWWP2qpxgH7Nyfw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-win32-arm64@2.1.2': - resolution: {integrity: sha512-G8KWZli5ASOXA3yUQgx+M4pZRv3ND16h77UsdunUL17uYpcL/UC7RkWTdkfvMQvogVsAuz5JUcBDjgZHXxlKoA==} + '@biomejs/cli-win32-arm64@2.2.0': + resolution: {integrity: sha512-n9a1/f2CwIDmNMNkFs+JI0ZjFnMO0jdOyGNtihgUNFnlmd84yIYY2KMTBmMV58ZlVHjgmY5Y6E1hVTnSRieggA==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [win32] - '@biomejs/cli-win32-x64@2.1.2': - resolution: {integrity: sha512-9zajnk59PMpjBkty3bK2IrjUsUHvqe9HWwyAWQBjGLE7MIBjbX2vwv1XPEhmO2RRuGoTkVx3WCanHrjAytICLA==} + '@biomejs/cli-win32-x64@2.2.0': + resolution: {integrity: sha512-Nawu5nHjP/zPKTIryh2AavzTc/KEg4um/MxWdXW0A6P/RZOyIpa7+QSjeXwAwX/utJGaCoXRPWtF3m5U/bB3Ww==} engines: {node: '>=14.21.3'} cpu: [x64] os: [win32] @@ -2807,8 +2807,8 @@ packages: '@stacks/transactions@6.17.0': resolution: {integrity: sha512-FUah2BRgV66ApLcEXGNGhwyFTRXqX5Zco3LpiM3essw8PF0NQlHwwdPgtDko5RfrJl3LhGXXe/30nwsfNnB3+g==} - '@stakekit/api-hooks@0.0.108': - resolution: {integrity: sha512-dJU2B2y5cBtljcuHcdJKxQKk0f1eHQr9VwAns16NEx5nnPf1EmfGOsvgYnd6tbEuYGbRwZlqjHid+/292qJqyQ==} + '@stakekit/api-hooks@0.0.109': + resolution: {integrity: sha512-3NDTNsYlwP7h2dX0K2jRB61xdmtCC28ahTinmJc1Eww4zhmaL0huWNSVJwgoCTML3mOzUtvKaED9VEzXnL7axA==} peerDependencies: '@faker-js/faker': ^9 '@tanstack/react-query': '>=5' @@ -7432,39 +7432,39 @@ snapshots: '@babel/helper-string-parser': 7.27.1 '@babel/helper-validator-identifier': 7.27.1 - '@biomejs/biome@2.1.2': + '@biomejs/biome@2.2.0': optionalDependencies: - '@biomejs/cli-darwin-arm64': 2.1.2 - '@biomejs/cli-darwin-x64': 2.1.2 - '@biomejs/cli-linux-arm64': 2.1.2 - '@biomejs/cli-linux-arm64-musl': 2.1.2 - '@biomejs/cli-linux-x64': 2.1.2 - '@biomejs/cli-linux-x64-musl': 2.1.2 - '@biomejs/cli-win32-arm64': 2.1.2 - '@biomejs/cli-win32-x64': 2.1.2 + '@biomejs/cli-darwin-arm64': 2.2.0 + '@biomejs/cli-darwin-x64': 2.2.0 + '@biomejs/cli-linux-arm64': 2.2.0 + '@biomejs/cli-linux-arm64-musl': 2.2.0 + '@biomejs/cli-linux-x64': 2.2.0 + '@biomejs/cli-linux-x64-musl': 2.2.0 + '@biomejs/cli-win32-arm64': 2.2.0 + '@biomejs/cli-win32-x64': 2.2.0 - '@biomejs/cli-darwin-arm64@2.1.2': + '@biomejs/cli-darwin-arm64@2.2.0': optional: true - '@biomejs/cli-darwin-x64@2.1.2': + '@biomejs/cli-darwin-x64@2.2.0': optional: true - '@biomejs/cli-linux-arm64-musl@2.1.2': + '@biomejs/cli-linux-arm64-musl@2.2.0': optional: true - '@biomejs/cli-linux-arm64@2.1.2': + '@biomejs/cli-linux-arm64@2.2.0': optional: true - '@biomejs/cli-linux-x64-musl@2.1.2': + '@biomejs/cli-linux-x64-musl@2.2.0': optional: true - '@biomejs/cli-linux-x64@2.1.2': + '@biomejs/cli-linux-x64@2.2.0': optional: true - '@biomejs/cli-win32-arm64@2.1.2': + '@biomejs/cli-win32-arm64@2.2.0': optional: true - '@biomejs/cli-win32-x64@2.1.2': + '@biomejs/cli-win32-x64@2.2.0': optional: true '@bundled-es-modules/cookie@2.0.1': @@ -10436,7 +10436,7 @@ snapshots: transitivePeerDependencies: - encoding - '@stakekit/api-hooks@0.0.108(@faker-js/faker@9.9.0)(@tanstack/react-query@5.83.0(react@19.1.0))(msw@2.10.4(@types/node@24.0.15)(typescript@5.8.3))(react@19.1.0)': + '@stakekit/api-hooks@0.0.109(@faker-js/faker@9.9.0)(@tanstack/react-query@5.83.0(react@19.1.0))(msw@2.10.4(@types/node@24.0.15)(typescript@5.8.3))(react@19.1.0)': dependencies: react: 19.1.0 optionalDependencies: From bc6bf64d2603ccf1fac9a87d931b6ca15abf7d80 Mon Sep 17 00:00:00 2001 From: Petar Todorovic Date: Fri, 15 Aug 2025 18:58:08 +0200 Subject: [PATCH 2/2] feat: show subnet token symbol --- packages/widget/src/domain/types/tokens.ts | 8 -------- packages/widget/src/hooks/use-estimated-rewards.ts | 2 +- .../pages/details/earn-page/state/earn-page-context.tsx | 6 +++--- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/packages/widget/src/domain/types/tokens.ts b/packages/widget/src/domain/types/tokens.ts index a03524a85..92af25e39 100644 --- a/packages/widget/src/domain/types/tokens.ts +++ b/packages/widget/src/domain/types/tokens.ts @@ -5,11 +5,3 @@ export type TokenString = `${TokenDto["network"]}-${TokenDto["address"]}`; export const isUSDeToken = (token: TokenDto) => token.network === EvmNetworks.ethereum && token.address === "0x4c9edd5852cd905f086c759e8383e09bff1e68b3"; - -export const bittensorAlphaToken: TokenDto = { - name: "Alpha", - network: "bittensor", - symbol: "Alpha", - decimals: 9, - logoURI: "https://assets.stakek.it/tokens/tao.svg", -}; diff --git a/packages/widget/src/hooks/use-estimated-rewards.ts b/packages/widget/src/hooks/use-estimated-rewards.ts index 66d105b95..bc6e7bdbe 100644 --- a/packages/widget/src/hooks/use-estimated-rewards.ts +++ b/packages/widget/src/hooks/use-estimated-rewards.ts @@ -27,7 +27,7 @@ export const useEstimatedRewards = ({ /** * If the selected stake is a bittensor staking, we need to divide the stake amount by the price per share - * to convert to Alpha token + * to convert to subnet token */ const correctAmount = useMemo(() => { return selectedStake diff --git a/packages/widget/src/pages/details/earn-page/state/earn-page-context.tsx b/packages/widget/src/pages/details/earn-page/state/earn-page-context.tsx index 01ec99c0c..d1eede761 100644 --- a/packages/widget/src/pages/details/earn-page/state/earn-page-context.tsx +++ b/packages/widget/src/pages/details/earn-page/state/earn-page-context.tsx @@ -26,7 +26,6 @@ import { stakeTokenSameAsGasToken, tokenString, } from "../../../../domain"; -import { bittensorAlphaToken } from "../../../../domain/types/tokens"; import { type ExtendedYieldType, getExtendedYieldType, @@ -133,9 +132,10 @@ export const EarnPageContextProvider = ({ children }: PropsWithChildren) => { const rewardsTokenSymbol = useMemo(() => { return selectedStake .filter((val) => isBittensorStaking(val.id)) - .map(() => bittensorAlphaToken.symbol) + .chain(() => List.head([...selectedValidators.values()])) + .map((validator) => validator.tokenSymbol ?? "") .orDefault(symbol); - }, [selectedStake, symbol]); + }, [selectedStake, symbol, selectedValidators]); const formattedPrice = useMemo( () =>