+
+
+
+
+
+
+ {t("PoolDialogs:assetAHoverCardContent", { assetA: currentBalance.symbol })}
+
+
+
{
+ const pool = poolArray[index];
+ return (
+
+
+
+ );
+ };
+
+ return (
+
+ );
+ };
+
return (
<>
@@ -482,11 +609,25 @@ export default function PortfolioTabs(properties) {
-
+
{t("PortfolioTabs:accountBalances", { username: usr.username })}
- {t("PortfolioTabs:accountBalancesDescription")}
+
+ {t("PortfolioTabs:accountBalancesDescription")}
+
+
+
+
+
+
+
{balances &&
@@ -496,7 +637,7 @@ export default function PortfolioTabs(properties) {
{BalanceRow}
diff --git a/src/components/Smartcoin.jsx b/src/components/Smartcoin.jsx
index 91fe6cb..33dfca2 100644
--- a/src/components/Smartcoin.jsx
+++ b/src/components/Smartcoin.jsx
@@ -2,6 +2,7 @@ import React, { useState, useEffect, useSyncExternalStore, useMemo, useCallback
import { FixedSizeList as List } from "react-window";
import { useForm } from "react-hook-form";
import { LockOpen2Icon, LockClosedIcon } from "@radix-ui/react-icons";
+import { useStore } from '@nanostores/react';
import { useTranslation } from "react-i18next";
import { i18n as i18nInstance, locale } from "@/lib/i18n.js";
diff --git a/src/components/Smartcoins.jsx b/src/components/Smartcoins.jsx
index 406c5a5..0e9bc0d 100644
--- a/src/components/Smartcoins.jsx
+++ b/src/components/Smartcoins.jsx
@@ -1,6 +1,8 @@
import React, { useState, useEffect, useSyncExternalStore, useMemo, useCallback } from "react";
import { FixedSizeList as List } from "react-window";
import Fuse from "fuse.js";
+import { useStore } from '@nanostores/react';
+
import { useTranslation } from "react-i18next";
import { i18n as i18nInstance, locale } from "@/lib/i18n.js";
diff --git a/src/components/Transfer.jsx b/src/components/Transfer.jsx
index e292323..1ff81a0 100644
--- a/src/components/Transfer.jsx
+++ b/src/components/Transfer.jsx
@@ -1,5 +1,6 @@
import React, { useState, useEffect, useSyncExternalStore, useMemo } from "react";
import { useForm } from "react-hook-form";
+import { useStore } from "@nanostores/react";
import { useTranslation } from "react-i18next";
import { i18n as i18nInstance, locale } from "@/lib/i18n.js";
@@ -428,7 +429,7 @@ export default function Transfer(properties) {
otherAsset={null}
marketSearch={marketSearch}
type={null}
- />
+ chain={usr && usr.chain ? usr.chain : "bitshares"} />
diff --git a/src/data/locales/da/AssetDropDownCard.json b/src/data/locales/da/AssetDropDownCard.json
index aafb319..f109d17 100644
--- a/src/data/locales/da/AssetDropDownCard.json
+++ b/src/data/locales/da/AssetDropDownCard.json
@@ -7,5 +7,7 @@
"baseType": "Vælg venligst et nyt basisaktiv",
"quoteType": "Vælg venligst et nyt tilbudsaktiv",
"search": "Søg efter et aktiv",
- "issued": "Udstedt af {{user}}"
+ "issued": "Udstedt af {{user}}",
+ "search2": "Søge",
+ "favourites": "Favoritter"
}
diff --git a/src/data/locales/da/PortfolioTabs.json b/src/data/locales/da/PortfolioTabs.json
index e6341f1..2264aba 100644
--- a/src/data/locales/da/PortfolioTabs.json
+++ b/src/data/locales/da/PortfolioTabs.json
@@ -43,5 +43,9 @@
"recentBlockchainActivityTitle": "Seneste blockchain-aktivitet",
"recentBlockchainActivityDescription": "Din seneste blockchain-aktivitet",
"noRecentActivityFound": "Der blev ikke fundet nogen nylig aktivitet",
- "refreshRecentActivityButton": "Opdater seneste aktivitet"
+ "refreshRecentActivityButton": "Opdater seneste aktivitet",
+ "pools": "Pools",
+ "default": "Misligholdelse",
+ "alphabetical": "Alfabetisk",
+ "amount": "Beløb"
}
diff --git a/src/data/locales/de/AssetDropDownCard.json b/src/data/locales/de/AssetDropDownCard.json
index 0a3bc06..6439b1e 100644
--- a/src/data/locales/de/AssetDropDownCard.json
+++ b/src/data/locales/de/AssetDropDownCard.json
@@ -7,5 +7,7 @@
"baseType": "Bitte wählen Sie ein neues Basis-Asset aus",
"quoteType": "Bitte wählen Sie ein neues Angebots-Asset aus",
"search": "Suchen Sie nach einem Vermögenswert",
- "issued": "Ausgestellt von {{user}}"
+ "issued": "Ausgestellt von {{user}}",
+ "search2": "Suchen",
+ "favourites": "Favoriten"
}
diff --git a/src/data/locales/de/PortfolioTabs.json b/src/data/locales/de/PortfolioTabs.json
index 1dd43d5..30b5e1a 100644
--- a/src/data/locales/de/PortfolioTabs.json
+++ b/src/data/locales/de/PortfolioTabs.json
@@ -43,5 +43,9 @@
"recentBlockchainActivityTitle": "Aktuelle Blockchain-Aktivität",
"recentBlockchainActivityDescription": "Ihre letzte Blockchain-Aktivität",
"noRecentActivityFound": "Keine aktuelle Aktivität gefunden",
- "refreshRecentActivityButton": "Aktuelle Aktivität aktualisieren"
+ "refreshRecentActivityButton": "Aktuelle Aktivität aktualisieren",
+ "pools": "Pools",
+ "default": "Standard",
+ "alphabetical": "Alphabetisch",
+ "amount": "Menge"
}
diff --git a/src/data/locales/en/AssetDropDownCard.json b/src/data/locales/en/AssetDropDownCard.json
index 8b1a1cf..2c76f0b 100644
--- a/src/data/locales/en/AssetDropDownCard.json
+++ b/src/data/locales/en/AssetDropDownCard.json
@@ -7,5 +7,7 @@
"baseType": "Please select a new base asset",
"quoteType": "Please select a new quote asset",
"search": "Search for an asset",
- "issued": "Issued by {{user}}"
+ "issued": "Issued by {{user}}",
+ "search2": "Search",
+ "favourites": "Favourites"
}
diff --git a/src/data/locales/en/PortfolioTabs.json b/src/data/locales/en/PortfolioTabs.json
index 53bb8e5..73caf8c 100644
--- a/src/data/locales/en/PortfolioTabs.json
+++ b/src/data/locales/en/PortfolioTabs.json
@@ -43,5 +43,9 @@
"recentBlockchainActivityTitle": "Recent blockchain activity",
"recentBlockchainActivityDescription": "Your recent blockchain activity",
"noRecentActivityFound": "No recent activity found",
- "refreshRecentActivityButton": "Refresh recent activity"
+ "refreshRecentActivityButton": "Refresh recent activity",
+ "pools": "Pools",
+ "default": "Default",
+ "alphabetical": "Alphabetical",
+ "amount": "Amount"
}
diff --git a/src/data/locales/es/AssetDropDownCard.json b/src/data/locales/es/AssetDropDownCard.json
index 2af6595..7e0c0c8 100644
--- a/src/data/locales/es/AssetDropDownCard.json
+++ b/src/data/locales/es/AssetDropDownCard.json
@@ -7,5 +7,7 @@
"baseType": "Seleccione un nuevo recurso base",
"quoteType": "Seleccione un nuevo activo de cotización",
"search": "Buscar un activo",
- "issued": "Expedido por {{user}}"
+ "issued": "Expedido por {{user}}",
+ "search2": "Buscar",
+ "favourites": "Favoritos"
}
diff --git a/src/data/locales/es/PortfolioTabs.json b/src/data/locales/es/PortfolioTabs.json
index 08cb002..c3c16cd 100644
--- a/src/data/locales/es/PortfolioTabs.json
+++ b/src/data/locales/es/PortfolioTabs.json
@@ -43,5 +43,9 @@
"recentBlockchainActivityTitle": "Actividad reciente de blockchain",
"recentBlockchainActivityDescription": "Su actividad reciente en blockchain",
"noRecentActivityFound": "No se encontró actividad reciente",
- "refreshRecentActivityButton": "Actualizar actividad reciente"
+ "refreshRecentActivityButton": "Actualizar actividad reciente",
+ "pools": "Quinielas",
+ "default": "Por defecto",
+ "alphabetical": "Alfabético",
+ "amount": "Cantidad"
}
diff --git a/src/data/locales/et/AssetDropDownCard.json b/src/data/locales/et/AssetDropDownCard.json
index a4e1e95..41e22c0 100644
--- a/src/data/locales/et/AssetDropDownCard.json
+++ b/src/data/locales/et/AssetDropDownCard.json
@@ -7,5 +7,7 @@
"baseType": "Valige uus põhivara",
"quoteType": "Valige uus hinnapakkumise vara",
"search": "Otsige vara",
- "issued": "Välja andnud {{user}}"
+ "issued": "Välja andnud {{user}}",
+ "search2": "Otsi",
+ "favourites": "Lemmikud"
}
diff --git a/src/data/locales/et/PortfolioTabs.json b/src/data/locales/et/PortfolioTabs.json
index 639c97b..c9bd0d3 100644
--- a/src/data/locales/et/PortfolioTabs.json
+++ b/src/data/locales/et/PortfolioTabs.json
@@ -43,5 +43,9 @@
"recentBlockchainActivityTitle": "Hiljutine plokiahela tegevus",
"recentBlockchainActivityDescription": "Teie hiljutine tegevus plokiahelas",
"noRecentActivityFound": "Hiljutist tegevust ei leitud",
- "refreshRecentActivityButton": "Värskendage hiljutisi tegevusi"
+ "refreshRecentActivityButton": "Värskendage hiljutisi tegevusi",
+ "pools": "Basseinid",
+ "default": "Vaikimisi",
+ "alphabetical": "Tähestikuline",
+ "amount": "Summa"
}
diff --git a/src/data/locales/fr/AssetDropDownCard.json b/src/data/locales/fr/AssetDropDownCard.json
index c70de1e..f22ecec 100644
--- a/src/data/locales/fr/AssetDropDownCard.json
+++ b/src/data/locales/fr/AssetDropDownCard.json
@@ -7,5 +7,7 @@
"baseType": "Veuillez sélectionner un nouvel actif de base",
"quoteType": "Veuillez sélectionner un nouvel actif de devis",
"search": "Rechercher un bien",
- "issued": "Délivré par {{user}}"
+ "issued": "Délivré par {{user}}",
+ "search2": "Recherche",
+ "favourites": "Favoris"
}
diff --git a/src/data/locales/fr/PortfolioTabs.json b/src/data/locales/fr/PortfolioTabs.json
index 100198e..aa9e856 100644
--- a/src/data/locales/fr/PortfolioTabs.json
+++ b/src/data/locales/fr/PortfolioTabs.json
@@ -43,5 +43,9 @@
"recentBlockchainActivityTitle": "Activité récente de la blockchain",
"recentBlockchainActivityDescription": "Votre activité blockchain récente",
"noRecentActivityFound": "Aucune activité récente trouvée",
- "refreshRecentActivityButton": "Actualiser l'activité récente"
+ "refreshRecentActivityButton": "Actualiser l'activité récente",
+ "pools": "Piscines",
+ "default": "Défaut",
+ "alphabetical": "Alphabétique",
+ "amount": "Montant"
}
diff --git a/src/data/locales/it/AssetDropDownCard.json b/src/data/locales/it/AssetDropDownCard.json
index 7a97fa6..d12088c 100644
--- a/src/data/locales/it/AssetDropDownCard.json
+++ b/src/data/locales/it/AssetDropDownCard.json
@@ -7,5 +7,7 @@
"baseType": "Seleziona una nuova risorsa di base",
"quoteType": "Seleziona una nuova risorsa preventivo",
"search": "Cerca una risorsa",
- "issued": "Rilasciato da {{user}}"
+ "issued": "Rilasciato da {{user}}",
+ "search2": "Ricerca",
+ "favourites": "Preferiti"
}
diff --git a/src/data/locales/it/PortfolioTabs.json b/src/data/locales/it/PortfolioTabs.json
index fa4c8fa..60ce01e 100644
--- a/src/data/locales/it/PortfolioTabs.json
+++ b/src/data/locales/it/PortfolioTabs.json
@@ -43,5 +43,9 @@
"recentBlockchainActivityTitle": "Attività recente sulla blockchain",
"recentBlockchainActivityDescription": "La tua recente attività blockchain",
"noRecentActivityFound": "Nessuna attività recente trovata",
- "refreshRecentActivityButton": "Aggiorna l'attività recente"
+ "refreshRecentActivityButton": "Aggiorna l'attività recente",
+ "pools": "Piscine",
+ "default": "Predefinito",
+ "alphabetical": "Alfabetico",
+ "amount": "Quantità"
}
diff --git a/src/data/locales/ja/AssetDropDownCard.json b/src/data/locales/ja/AssetDropDownCard.json
index af2602c..bf6a667 100644
--- a/src/data/locales/ja/AssetDropDownCard.json
+++ b/src/data/locales/ja/AssetDropDownCard.json
@@ -7,5 +7,7 @@
"baseType": "新しいベースアセットを選択してください",
"quoteType": "新しい見積資産を選択してください",
"search": "アセットを検索する",
- "issued": "発行者 {{user}}"
+ "issued": "発行者 {{user}}",
+ "search2": "検索",
+ "favourites": "お気に入り"
}
diff --git a/src/data/locales/ja/PortfolioTabs.json b/src/data/locales/ja/PortfolioTabs.json
index da037fe..c6e0c2f 100644
--- a/src/data/locales/ja/PortfolioTabs.json
+++ b/src/data/locales/ja/PortfolioTabs.json
@@ -43,5 +43,9 @@
"recentBlockchainActivityTitle": "最近のブロックチェーン活動",
"recentBlockchainActivityDescription": "最近のブロックチェーン アクティビティ",
"noRecentActivityFound": "最近のアクティビティは見つかりませんでした",
- "refreshRecentActivityButton": "最近のアクティビティを更新する"
+ "refreshRecentActivityButton": "最近のアクティビティを更新する",
+ "pools": "プール",
+ "default": "デフォルト",
+ "alphabetical": "アルファベット順",
+ "amount": "額"
}
diff --git a/src/data/locales/ko/AssetDropDownCard.json b/src/data/locales/ko/AssetDropDownCard.json
index 2261d92..420a465 100644
--- a/src/data/locales/ko/AssetDropDownCard.json
+++ b/src/data/locales/ko/AssetDropDownCard.json
@@ -7,5 +7,7 @@
"baseType": "새 기본 자산을 선택하세요.",
"quoteType": "새 견적 자산을 선택하세요.",
"search": "자산 검색",
- "issued": "발행자 {{user}}"
+ "issued": "발행자 {{user}}",
+ "search2": "찾다",
+ "favourites": "즐겨찾기"
}
diff --git a/src/data/locales/ko/PortfolioTabs.json b/src/data/locales/ko/PortfolioTabs.json
index f4962bc..86d4ece 100644
--- a/src/data/locales/ko/PortfolioTabs.json
+++ b/src/data/locales/ko/PortfolioTabs.json
@@ -43,5 +43,9 @@
"recentBlockchainActivityTitle": "최근 블록체인 활동",
"recentBlockchainActivityDescription": "최근 블록체인 활동",
"noRecentActivityFound": "최근 활동이 없습니다.",
- "refreshRecentActivityButton": "최근 활동 새로 고침"
+ "refreshRecentActivityButton": "최근 활동 새로 고침",
+ "pools": "풀",
+ "default": "기본",
+ "alphabetical": "알파벳순",
+ "amount": "양"
}
diff --git a/src/data/locales/pt/AssetDropDownCard.json b/src/data/locales/pt/AssetDropDownCard.json
index a5260e8..f262ed9 100644
--- a/src/data/locales/pt/AssetDropDownCard.json
+++ b/src/data/locales/pt/AssetDropDownCard.json
@@ -7,5 +7,7 @@
"baseType": "Selecione um novo recurso base",
"quoteType": "Selecione um novo ativo de cotação",
"search": "Procure um ativo",
- "issued": "Emitida pela {{user}}"
+ "issued": "Emitida pela {{user}}",
+ "search2": "찾다",
+ "favourites": "즐겨찾기"
}
diff --git a/src/data/locales/pt/PortfolioTabs.json b/src/data/locales/pt/PortfolioTabs.json
index 1b026f1..493f9f3 100644
--- a/src/data/locales/pt/PortfolioTabs.json
+++ b/src/data/locales/pt/PortfolioTabs.json
@@ -43,5 +43,9 @@
"recentBlockchainActivityTitle": "Atividade recente de blockchain",
"recentBlockchainActivityDescription": "Sua atividade recente de blockchain",
"noRecentActivityFound": "Nenhuma atividade recente encontrada",
- "refreshRecentActivityButton": "Atualizar atividade recente"
+ "refreshRecentActivityButton": "Atualizar atividade recente",
+ "pools": "Piscinas",
+ "default": "Padrão",
+ "alphabetical": "Alfabético",
+ "amount": "Quantia"
}
diff --git a/src/data/locales/th/AssetDropDownCard.json b/src/data/locales/th/AssetDropDownCard.json
index 538c0ad..b2879dc 100644
--- a/src/data/locales/th/AssetDropDownCard.json
+++ b/src/data/locales/th/AssetDropDownCard.json
@@ -7,5 +7,7 @@
"baseType": "โปรดเลือกสินทรัพย์ฐานใหม่",
"quoteType": "โปรดเลือกสินทรัพย์ใบเสนอราคาใหม่",
"search": "ค้นหาสินทรัพย์",
- "issued": "ออกโดย {{user}}"
+ "issued": "ออกโดย {{user}}",
+ "search2": "ค้นหา",
+ "favourites": "รายการโปรด"
}
diff --git a/src/data/locales/th/PortfolioTabs.json b/src/data/locales/th/PortfolioTabs.json
index 11c2270..8822e61 100644
--- a/src/data/locales/th/PortfolioTabs.json
+++ b/src/data/locales/th/PortfolioTabs.json
@@ -43,5 +43,9 @@
"recentBlockchainActivityTitle": "กิจกรรมบล็อกเชนล่าสุด",
"recentBlockchainActivityDescription": "กิจกรรมบล็อกเชนล่าสุดของคุณ",
"noRecentActivityFound": "ไม่พบกิจกรรมล่าสุด",
- "refreshRecentActivityButton": "รีเฟรชกิจกรรมล่าสุด"
+ "refreshRecentActivityButton": "รีเฟรชกิจกรรมล่าสุด",
+ "pools": "สระน้ำ",
+ "default": "ค่าเริ่มต้น",
+ "alphabetical": "ตามตัวอักษร",
+ "amount": "จำนวน"
}
diff --git a/src/stores/favourites.ts b/src/stores/favourites.ts
new file mode 100644
index 0000000..d947b68
--- /dev/null
+++ b/src/stores/favourites.ts
@@ -0,0 +1,111 @@
+import { persistentMap } from "@nanostores/persistent";
+
+type Asset = {
+ symbol: string;
+ id: string;
+ issuer: string;
+}
+
+type User = {
+ name: string;
+ id: string;
+}
+
+type StoredAssets = {
+ bitshares: Asset[] | [];
+ bitshares_testnet: Asset[] | [];
+}
+
+type StoredUsers = {
+ bitshares: User[] | [];
+ bitshares_testnet: User[] | [];
+}
+
+const $favouriteAssets = persistentMap
(
+ "favouriteAssets",
+ {
+ bitshares: [],
+ bitshares_testnet: []
+ },
+ {
+ encode(value) {
+ return JSON.stringify(value);
+ },
+ decode(value) {
+ try {
+ return JSON.parse(value);
+ } catch (e) {
+ console.log(e);
+ return value;
+ }
+ }
+ }
+);
+
+const $favouriteUsers = persistentMap(
+ "favouriteUsers",
+ {
+ bitshares: [],
+ bitshares_testnet: []
+ },
+ {
+ encode(value) {
+ return JSON.stringify(value);
+ },
+ decode(value) {
+ try {
+ return JSON.parse(value);
+ } catch (e) {
+ console.log(e);
+ return value;
+ }
+ }
+ }
+);
+
+function addFavouriteAsset(chain: string, asset: Asset) {
+ const assets = $favouriteAssets.get()[chain];
+ if (assets.find((a) => a.id === asset.id)) {
+ return; // already exists
+ }
+ assets.push(asset);
+ $favouriteAssets.set({ ...$favouriteAssets.get(), [chain]: assets });
+}
+
+function removeFavouriteAsset(chain: string, asset: Asset) {
+ const assets = $favouriteAssets.get()[chain];
+ const index = assets.findIndex((a) => a.id === asset.id);
+ if (index === -1) {
+ return; // not found
+ }
+ assets.splice(index, 1);
+ $favouriteAssets.set({ ...$favouriteAssets.get(), [chain]: assets });
+}
+
+function addFavouriteUser(chain: string, user: User) {
+ const users = $favouriteUsers.get()[chain];
+ if (users.find((u) => u.id === user.id)) {
+ return; // already exists
+ }
+ users.push(user);
+ $favouriteUsers.set({ ...$favouriteUsers.get(), [chain]: users });
+}
+
+function removeFavouriteUser(chain: string, user: User) {
+ const users = $favouriteUsers.get()[chain];
+ const index = users.findIndex((u) => u.id === user.id);
+ if (index === -1) {
+ return; // not found
+ }
+ users.splice(index, 1);
+ $favouriteUsers.set({ ...$favouriteUsers.get(), [chain]: users });
+}
+
+export {
+ $favouriteAssets,
+ $favouriteUsers,
+ addFavouriteAsset,
+ addFavouriteUser,
+ removeFavouriteAsset,
+ removeFavouriteUser
+};
\ No newline at end of file
diff --git a/src/stores/node.ts b/src/stores/node.ts
index 8510be6..c3b96ea 100644
--- a/src/stores/node.ts
+++ b/src/stores/node.ts
@@ -10,8 +10,8 @@ type Node = {
const $currentNode = map({ url: "", chain: "" });
function setCurrentNode(chain: string, url?: string) {
- if (!(chains as any)[chain] || url && !(chains as any)[chain].nodeList.find((node: any) => node.url === url)) {
- return; // block invalid nodes
+ if (!(chains as any)[chain]) {
+ return;
}
$currentNode.set({ chain, url: url ?? (chains as any)[chain].nodeList[0].url });