diff --git a/package.json b/package.json index 6e5ff50a..e9d3487d 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "build": "./build.py && vite build; cp dist/index.html dist/404.html", "mainnet": "cp src/configs/mainnet.json public/config.json", "beta": "cp src/configs/beta.json public/config.json", + "pro": "cp src/configs/pro.json public/config.json", "testnet": "cp src/configs/testnet.json public/config.json", "prettier": "npx prettier src public tests e2e docs *.js *.ts *.mjs *.json", "prettier:write": "npm run prettier -- --write", diff --git a/src/components/Nav.tsx b/src/components/Nav.tsx index 22b05945..ea74a69d 100644 --- a/src/components/Nav.tsx +++ b/src/components/Nav.tsx @@ -10,7 +10,7 @@ import { useGlobalContext } from "../context/Global"; import locales from "../i18n/i18n"; import "../style/nav.scss"; -const Nav = (props: { network: string }) => { +const Nav = (props: { network: string; isPro?: boolean }) => { let timeout: ReturnType | undefined; const { t, setHideHero, setI18nConfigured } = useGlobalContext(); @@ -28,6 +28,11 @@ const Nav = (props: { network: string }) => { {props.network} + +
+ {t("pro")} +
+
e.currentTarget.classList.toggle("active")} diff --git a/src/components/Warnings.tsx b/src/components/Warnings.tsx index 8691b589..f9d19cb9 100644 --- a/src/components/Warnings.tsx +++ b/src/components/Warnings.tsx @@ -25,6 +25,9 @@ const Warnings = () => { + + +
); }; diff --git a/src/config.ts b/src/config.ts index 8226d7e9..576de7c7 100644 --- a/src/config.ts +++ b/src/config.ts @@ -63,6 +63,7 @@ export type Config = { isBoltzClient?: boolean; boltzClientApiUrl?: string; isBeta?: boolean; + isPro?: boolean; assets?: Record; torUrl?: string; } & typeof defaults; diff --git a/src/configs/beta.json b/src/configs/beta.json index 6a2cbf97..c6b2a6ae 100644 --- a/src/configs/beta.json +++ b/src/configs/beta.json @@ -1,6 +1,6 @@ { - "torUrl": "http://boltzzzbnus4m7mta3cxmflnps4fp7dueu2tgurstbvrbt6xswzcocyd.onion/", "isBeta": true, + "torUrl": "http://boltzzzbnus4m7mta3cxmflnps4fp7dueu2tgurstbvrbt6xswzcocyd.onion/", "network": "mainnet", "loglevel": "debug", "apiUrl": { @@ -22,7 +22,7 @@ }, "RBTC": { "blockExplorerUrl": { - "normal": "https://explorer.rootstock.io" + "normal": "https://rootstock.blockscout.com" }, "network": { "chainName": "Rootstock", diff --git a/src/configs/pro.json b/src/configs/pro.json new file mode 100644 index 00000000..366a12d7 --- /dev/null +++ b/src/configs/pro.json @@ -0,0 +1,45 @@ +{ + "isPro": true, + "torUrl": "http://boltzzzbnus4m7mta3cxmflnps4fp7dueu2tgurstbvrbt6xswzcocyd.onion/", + "network": "mainnet", + "loglevel": "debug", + "apiUrl": { + "normal": "https://api.boltz.exchange", + "tor": "http://boltzzzbnus4m7mta3cxmflnps4fp7dueu2tgurstbvrbt6xswzcocyd.onion/api" + }, + "assets": { + "BTC": { + "blockExplorerUrl": { + "normal": "https://mempool.space", + "tor": "http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion" + } + }, + "L-BTC": { + "blockExplorerUrl": { + "normal": "https://blockstream.info/liquid", + "tor": "http://explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion/liquid" + } + }, + "RBTC": { + "blockExplorerUrl": { + "normal": "https://rootstock.blockscout.com" + }, + "network": { + "chainName": "Rootstock", + "chainId": 30, + "rpcUrls": ["https://public-node.rsk.co"], + "nativeCurrency": { + "name": "RBTC", + "symbol": "RBTC", + "decimals": 18 + } + }, + "rifRelay": "https://boltz.mainnet.relay.rifcomputing.net", + "contracts": { + "deployHeight": 6747215, + "smartWalletFactory": "0x44944a80861120B58cc48B066d57cDAf5eC213dd", + "deployVerifier": "0xc0F5bEF6b20Be41174F826684c663a8635c6A081" + } + } + } +} diff --git a/src/context/Global.tsx b/src/context/Global.tsx index e23da708..9d18a817 100644 --- a/src/context/Global.tsx +++ b/src/context/Global.tsx @@ -98,6 +98,14 @@ export type GlobalContextType = { getRdnsForAddress: (address: string) => Promise; }; +const defaultReferral = () => { + if (config.isPro) { + return "pro"; + } + + return isMobile() ? "boltz_webapp_mobile" : "boltz_webapp_desktop"; +}; + // Local storage serializer to support the values created by the deprecated "createStorageSignal" const stringSerializer = { serialize: (value: never) => value, @@ -130,9 +138,7 @@ const GlobalProvider = (props: { children: JSX.Element }) => { const [ref, setRef] = makePersisted( // eslint-disable-next-line solid/reactivity - createSignal( - isMobile() ? "boltz_webapp_mobile" : "boltz_webapp_desktop", - ), + createSignal(defaultReferral()), { name: referralIdKey, ...stringSerializer, @@ -427,4 +433,4 @@ const useGlobalContext = () => { return context; }; -export { useGlobalContext, GlobalProvider }; +export { useGlobalContext, GlobalProvider, defaultReferral }; diff --git a/src/i18n/i18n.ts b/src/i18n/i18n.ts index 307619af..ded9ad2c 100644 --- a/src/i18n/i18n.ts +++ b/src/i18n/i18n.ts @@ -157,6 +157,8 @@ const dict = { peers: "Number of Peers", num_channels: "Number of Channels", beta_caution: "BETA - USE WITH CAUTION!", + pro: "pro", + pro_banner: "BETA: AVAILABILITY NOT GUARANTEED", warning_return: "Important: Return to this page after paying invoice", warning_expiry: "Make sure your transaction confirms within ~24 hours after creation of this swap!", @@ -390,6 +392,8 @@ const dict = { peers: "Anzahl der Peers", num_channels: "Anzahl der Kanäle", beta_caution: "BETA - OBACHT!", + pro: "pro", + pro_banner: "BETA: VERFÜGBARKEIT NICHT GARANTIERT", warning_return: "Wichtig: Kehre nach dem Bezahlen der Rechnung zu dieser Seite zurück!", warning_expiry: @@ -627,6 +631,8 @@ const dict = { peers: "Número de peers", num_channels: "Número de canales", beta_caution: "BETA - ¡ÚSALO CON PRECAUCIÓN!", + pro: "pro", + pro_banner: "BETA: DISPONIBILIDAD NO GARANTIZADA", warning_return: "Importante: Regresa a esta página después de pagar la factura!", warning_expiry: @@ -846,6 +852,8 @@ const dict = { peers: "对端数", num_channels: "通道数", beta_caution: "BETA - 谨慎使用!", + pro: "pro", + pro_banner: "测试版:不保证可用性", warning_return: "重要:支付发票后返回此页面", warning_expiry: "确保您的交易在创建此交换后的约24小时内确认!", not_found: "404 - 页面未找到", @@ -1071,6 +1079,8 @@ const dict = { peers: "ピアの数", num_channels: "チャネルの数", beta_caution: "ベータ版の為、ご利用は慎重にお願いします", + pro: "pro", + pro_banner: "ベータ版:利用可能性は保証されない", warning_return: "重要:インボイスのお支払い後、このページへ戻ってください", warning_expiry: diff --git a/src/index.tsx b/src/index.tsx index d851d11b..2adb8d15 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -70,7 +70,10 @@ const App = (props: RouteSectionProps) => { -