diff --git a/dapp/.env b/dapp/.env index 60e4f4a3b..fee5456ea 100644 --- a/dapp/.env +++ b/dapp/.env @@ -17,8 +17,6 @@ VITE_ACRE_API_ENDPOINT="http://localhost:8788/api/v1/" VITE_GELATO_RELAY_API_KEY="htaJCy_XHj8WsE3w53WBMurfySDtjLP_TrNPPa6IPIc_" # this key should not be used on production # Get the API key from: https://thegraph.com/studio/apikeys/. VITE_SUBGRAPH_API_KEY="" -# Get the API key from: 1Password. -VITE_MEZO_PORTAL_API_KEY="" # Feature flags VITE_FEATURE_FLAG_GAMIFICATION_ENABLED="false" @@ -28,4 +26,5 @@ VITE_FEATURE_FLAG_XVERSE_WALLET_ENABLED="false" VITE_FEATURE_FLAG_BEEHIVE_COMPONENT_ENABLED="false" VITE_FEATURE_FLAG_ACRE_POINTS_ENABLED="true" VITE_FEATURE_FLAG_TVL_ENABLED="false" +VITE_FEATURE_GATING_DAPP_ENABLED="true" diff --git a/dapp/manifests/ledger-live/ledger-live-manifest-development.json b/dapp/manifests/ledger-live/ledger-live-manifest-development.json index ed33cbad1..fbea240e6 100644 --- a/dapp/manifests/ledger-live/ledger-live-manifest-development.json +++ b/dapp/manifests/ledger-live/ledger-live-manifest-development.json @@ -21,10 +21,6 @@ "permissions": [ "account.request", "account.list", - "message.sign", - "transaction.sign", - "transaction.signAndBroadcast", - "bitcoin.getXPub", "bitcoin.getAddress", "bitcoin.getPublicKey", "custom.acre.messageSign", diff --git a/dapp/manifests/ledger-live/ledger-live-manifest-mainnet.json b/dapp/manifests/ledger-live/ledger-live-manifest-mainnet.json index 3a586a89a..24573e028 100644 --- a/dapp/manifests/ledger-live/ledger-live-manifest-mainnet.json +++ b/dapp/manifests/ledger-live/ledger-live-manifest-mainnet.json @@ -21,10 +21,6 @@ "permissions": [ "account.request", "account.list", - "message.sign", - "transaction.sign", - "transaction.signAndBroadcast", - "bitcoin.getXPub", "bitcoin.getAddress", "bitcoin.getPublicKey", "custom.acre.messageSign", diff --git a/dapp/manifests/ledger-live/ledger-live-manifest-testnet.json b/dapp/manifests/ledger-live/ledger-live-manifest-testnet.json index b6ac1c015..f9ab0c798 100644 --- a/dapp/manifests/ledger-live/ledger-live-manifest-testnet.json +++ b/dapp/manifests/ledger-live/ledger-live-manifest-testnet.json @@ -1,9 +1,9 @@ { "id": "acre-testnet", "name": "Acre [testnet]", - "url": "https://ledger-live-updates--acre-dapp-testnet.netlify.app/?embed=ledger-live", + "url": "https://stake.test.acre.fi/?embed=ledger-live", "homepageUrl": "https:/acre.fi/", - "icon": "https://ledger-live-updates--acre-dapp-testnet.netlify.app/acre.svg", + "icon": "https://stake.test.acre.fi/acre.svg", "platforms": "desktop", "apiVersion": "^2.0.0", "manifestVersion": "2", @@ -21,10 +21,6 @@ "permissions": [ "account.request", "account.list", - "message.sign", - "transaction.sign", - "transaction.signAndBroadcast", - "bitcoin.getXPub", "bitcoin.getAddress", "bitcoin.getPublicKey", "custom.acre.messageSign", diff --git a/dapp/manifests/ledger-live/ledger-manifest-template.json b/dapp/manifests/ledger-live/ledger-manifest-template.json index 238522b0b..08fd0883b 100644 --- a/dapp/manifests/ledger-live/ledger-manifest-template.json +++ b/dapp/manifests/ledger-live/ledger-manifest-template.json @@ -21,10 +21,6 @@ "permissions": [ "account.request", "account.list", - "message.sign", - "transaction.sign", - "transaction.signAndBroadcast", - "bitcoin.getXPub", "bitcoin.getAddress", "bitcoin.getPublicKey", "custom.acre.messageSign", diff --git a/dapp/package.json b/dapp/package.json index 56137239a..eca779a1e 100644 --- a/dapp/package.json +++ b/dapp/package.json @@ -4,7 +4,7 @@ "version": "1.0.0", "scripts": { "start": "vite", - "build": "tsc && vite build", + "build": "NODE_OPTIONS=--max-old-space-size=8192 vite build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview", "format": "npm run lint:js && npm run lint:config", @@ -13,7 +13,7 @@ "lint:js:fix": "eslint . --fix", "lint:config": "prettier -c '**/*.@(json|yaml|toml)'", "lint:config:fix": "prettier -w '**/*.@(json|yaml|toml)'", - "test": "vitest", + "test": "vitest --reporter=verbose", "generate:manifests": "for env in development testnet mainnet; do mustache config/$env.json ./manifests/ledger-live/ledger-manifest-template.json > ./manifests/ledger-live/ledger-live-manifest-$env.json; done" }, "dependencies": { @@ -21,19 +21,20 @@ "@chakra-ui/react": "^2.8.2", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", - "@orangekit/react": "1.0.0-beta.32", - "@orangekit/sign-in-with-wallet": "1.0.0-beta.6", - "@ledgerhq/wallet-api-client": "1.6.0", "@ledgerhq/wallet-api-acre-module": "0.1.0-nightly.0", + "@ledgerhq/wallet-api-client": "1.6.0", + "@orangekit/react": "1.0.0-beta.33", + "@orangekit/sign-in-with-wallet": "1.0.0-beta.6", "@reduxjs/toolkit": "^2.2.0", "@rehooks/local-storage": "^2.4.5", "@safe-global/safe-core-sdk-types": "^5.0.1", - "@sentry/react": "^7.98.0", - "@sentry/types": "^7.102.0", + "@sentry/react": "^8.34.0", + "@sentry/types": "^8.34.0", "@tabler/icons-react": "^3.1.0", "@tanstack/react-query": "^5.40.1", "@tanstack/react-query-devtools": "^5.49.2", "axios": "^1.6.7", + "bignumber.js": "^9.1.2", "ethers": "^6.10.0", "formik": "^2.4.5", "framer-motion": "^10.16.5", @@ -48,6 +49,7 @@ "wagmi": "^2.9.11" }, "devDependencies": { + "@sentry/vite-plugin": "^2.22.5", "@thesis-co/eslint-config": "github:thesis/eslint-config#7b9bc8c", "@types/react": "^18.2.38", "@types/react-dom": "^18.2.17", diff --git a/dapp/src/acre-react/contexts/AcreSdkContext.tsx b/dapp/src/acre-react/contexts/AcreSdkContext.tsx index 3cf8e1fce..914d01fa6 100644 --- a/dapp/src/acre-react/contexts/AcreSdkContext.tsx +++ b/dapp/src/acre-react/contexts/AcreSdkContext.tsx @@ -1,6 +1,5 @@ import React, { useCallback, useMemo, useState } from "react" -import { Acre } from "@acre-btc/sdk" -import { BitcoinProvider } from "@acre-btc/sdk/dist/src/lib/bitcoin/providers" +import { Acre, AcreBitcoinProvider } from "@acre-btc/sdk" import { BITCOIN_NETWORK, env } from "#/constants" const { TBTC_API_ENDPOINT, SUBGRAPH_API_KEY } = env @@ -9,7 +8,7 @@ const GELATO_API_KEY = env.GELATO_RELAY_API_KEY type AcreSdkContextValue = { acre?: Acre - init: (bitcoinProvider?: BitcoinProvider) => Promise + init: (bitcoinProvider?: AcreBitcoinProvider) => Promise isInitialized: boolean isConnected: boolean } @@ -27,7 +26,7 @@ export function AcreSdkProvider({ children }: { children: React.ReactNode }) { const [isConnected, setIsConnected] = useState(false) const init = useCallback( - async (bitcoinProvider?: BitcoinProvider) => { + async (bitcoinProvider?: AcreBitcoinProvider) => { let sdk = await Acre.initialize( BITCOIN_NETWORK, TBTC_API_ENDPOINT, diff --git a/dapp/src/components/Footer.tsx b/dapp/src/components/Footer.tsx new file mode 100644 index 000000000..7a907a5c5 --- /dev/null +++ b/dapp/src/components/Footer.tsx @@ -0,0 +1,88 @@ +import React from "react" +import { + Box, + useMultiStyleConfig, + List, + ListItem, + LinkProps, + Link, + Button, + Icon, +} from "@chakra-ui/react" +import { EXTERNAL_HREF } from "#/constants" +import { AcreSignIcon, ArrowUpRight } from "#/assets/icons" + +type FooterListItem = Pick + +const NAVIGATION: FooterListItem[] = [ + { + children: "Acre.fi", + href: EXTERNAL_HREF.WEBSITE, + }, + { + children: "Docs", + href: EXTERNAL_HREF.DOCS, + }, + { + children: "FAQ", + href: EXTERNAL_HREF.FAQ, + }, + { + children: "Blog", + href: EXTERNAL_HREF.BLOG, + }, + { + children: "Discord", + href: EXTERNAL_HREF.DISCORD, + }, + { + children: "X", + href: EXTERNAL_HREF.X, + }, +] + +const DOCUMENTS: FooterListItem[] = [ + { + children: "Privacy Policy", + href: EXTERNAL_HREF.PRIVACY_POLICY, + }, + { + children: "Terms of Use", + href: EXTERNAL_HREF.TERMS_OF_USE, + }, +] + +const getItemsList = ( + items: FooterListItem[], + styles: ReturnType, +) => ( + + {items.map((link) => ( + +