From 8da762e94cbf509eb5b7fb86c4449ef968d8a7ad Mon Sep 17 00:00:00 2001 From: CleanBread Date: Fri, 24 Jan 2025 13:38:02 +0100 Subject: [PATCH] base and base sepolia --- local_modules/wallet/chains.ts | 4 ++-- local_modules/wallet/config.ts | 6 ++++-- package-lock.json | 16 ++++++++-------- package.json | 2 +- public/images/icons/currency/weth.svg | 1 + src/components/ui/Icon/icons.ts | 3 +++ src/helpers/constants.ts | 8 +++++++- 7 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 public/images/icons/currency/weth.svg diff --git a/local_modules/wallet/chains.ts b/local_modules/wallet/chains.ts index 5c3ee9b..5565632 100644 --- a/local_modules/wallet/chains.ts +++ b/local_modules/wallet/chains.ts @@ -1,6 +1,6 @@ -import { polygonAmoy, spicy, polygon, gnosis, chiliz } from 'viem/chains' +import { polygonAmoy, spicy, polygon, gnosis, chiliz, base, baseSepolia } from 'viem/chains' const isDevEnabled = Boolean(JSON.parse(process.env.AZURO_UNSTABLE_DEV_ENABLED || 'false')) -export const appChains = isDevEnabled ? [ polygonAmoy, gnosis, spicy ] as const : [ polygon, polygonAmoy, gnosis, chiliz, spicy ] as const +export const appChains = isDevEnabled ? [ polygonAmoy, gnosis, spicy, baseSepolia ] as const : [ polygon, polygonAmoy, gnosis, chiliz, spicy, base ] as const diff --git a/local_modules/wallet/config.ts b/local_modules/wallet/config.ts index c6a4dbe..82b3188 100644 --- a/local_modules/wallet/config.ts +++ b/local_modules/wallet/config.ts @@ -3,7 +3,7 @@ import { cookieStorage, createStorage, http } from 'wagmi' import { type PrivyConfig } from '@azuro-org/sdk-social-aa-connector' import { createConfig } from '@privy-io/wagmi' -import { polygon, polygonAmoy, gnosis, chiliz, spicy } from 'viem/chains' +import { polygon, polygonAmoy, gnosis, chiliz, spicy, base, baseSepolia } from 'viem/chains' import { constants } from 'helpers' import { appChains } from './chains' @@ -39,13 +39,15 @@ const wagmiConfig = createConfig({ [gnosis.id]: http(constants.rpcByChains[gnosis.id]), [chiliz.id]: http(constants.rpcByChains[chiliz.id]), [spicy.id]: http(constants.rpcByChains[spicy.id]), + [base.id]: http(constants.rpcByChains[base.id]), + [baseSepolia.id]: http(constants.rpcByChains[baseSepolia.id]), }, ssr: false, syncConnectedChain: true, multiInjectedProviderDiscovery: true, storage: createStorage({ storage: cookieStorage, - }) + }), }) declare module 'wagmi' { diff --git a/package-lock.json b/package-lock.json index bf1f32a..7994f2d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@apollo/client": "^3.11.1", "@azuro-org/dictionaries": "^3.0.26", - "@azuro-org/sdk": "5.4.0", + "@azuro-org/sdk": "5.4.1", "@azuro-org/sdk-social-aa-connector": "^1.0.6", "@floating-ui/react-dom-interactions": "^0.13.3", "@glidejs/glide": "^3.6.2", @@ -150,11 +150,11 @@ } }, "node_modules/@azuro-org/sdk": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@azuro-org/sdk/-/sdk-5.4.0.tgz", - "integrity": "sha512-OmlYiC+NLjxGzCNhw2p5VEqwn7X3yqPfhqleyCY8wAb0r7dCEoor9Mm+yDRqJuHPuPWbxQwic8BR57w+QEAy0A==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@azuro-org/sdk/-/sdk-5.4.1.tgz", + "integrity": "sha512-cwZZSDNe87bKhzo8OumS5hEM/+E8cSr2HnM+VsbAFiO94naHxECuO4MBJ8rBJWN0su4vJGwzGoUU5/jJ9EGrDA==", "dependencies": { - "@azuro-org/toolkit": "4.5.0" + "@azuro-org/toolkit": "4.5.1" }, "peerDependencies": { "@apollo/client": "^3.11.10", @@ -187,9 +187,9 @@ } }, "node_modules/@azuro-org/toolkit": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@azuro-org/toolkit/-/toolkit-4.5.0.tgz", - "integrity": "sha512-FXVlC1SVNs2npmMD6t2TXQP7mezIbuzxijGAlNvUsswnCp9aOrmRn/0BId7e8BE1Gg7bnV5qctBbz+/dAsd8eg==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@azuro-org/toolkit/-/toolkit-4.5.1.tgz", + "integrity": "sha512-M2YclDvkN6aL2uBoxnYBw532fVlq+TZPRz7MtUT/64pOXw8QWkECCFduRk6TWo7VLob/KCotgatITmIhUBwADQ==", "peerDependencies": { "@azuro-org/dictionaries": "^3.0.26", "@wagmi/core": "^2.16.3", diff --git a/package.json b/package.json index 82cfa1a..ec4d8ff 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "dependencies": { "@apollo/client": "^3.11.1", "@azuro-org/dictionaries": "^3.0.26", - "@azuro-org/sdk": "5.4.0", + "@azuro-org/sdk": "5.4.1", "@azuro-org/sdk-social-aa-connector": "^1.0.6", "@floating-ui/react-dom-interactions": "^0.13.3", "@glidejs/glide": "^3.6.2", diff --git a/public/images/icons/currency/weth.svg b/public/images/icons/currency/weth.svg new file mode 100644 index 0000000..d95243b --- /dev/null +++ b/public/images/icons/currency/weth.svg @@ -0,0 +1 @@ + diff --git a/src/components/ui/Icon/icons.ts b/src/components/ui/Icon/icons.ts index 748d49f..60ea26d 100644 --- a/src/components/ui/Icon/icons.ts +++ b/src/components/ui/Icon/icons.ts @@ -189,6 +189,8 @@ import _currency_usdt from '../../../../public/images/icons/currency/usdt.svg?ur import _currency_usdtSource from '!!raw-loader!../../../../public/images/icons/currency/usdt.svg' import _currency_wchz from '../../../../public/images/icons/currency/wchz.svg?url' import _currency_wchzSource from '!!raw-loader!../../../../public/images/icons/currency/wchz.svg' +import _currency_weth from '../../../../public/images/icons/currency/weth.svg?url' +import _currency_wethSource from '!!raw-loader!../../../../public/images/icons/currency/weth.svg' import _currency_wxdai from '../../../../public/images/icons/currency/wxdai.svg?url' import _currency_wxdaiSource from '!!raw-loader!../../../../public/images/icons/currency/wxdai.svg' @@ -290,6 +292,7 @@ const icons = { 'currency/usdc': { src: _currency_usdc.src, source: isServer && _currency_usdcSource, width: _currency_usdc.width, height: _currency_usdc.height, aspect: _currency_usdc.width/_currency_usdc.height }, 'currency/usdt': { src: _currency_usdt.src, source: isServer && _currency_usdtSource, width: _currency_usdt.width, height: _currency_usdt.height, aspect: _currency_usdt.width/_currency_usdt.height }, 'currency/wchz': { src: _currency_wchz.src, source: isServer && _currency_wchzSource, width: _currency_wchz.width, height: _currency_wchz.height, aspect: _currency_wchz.width/_currency_wchz.height }, + 'currency/weth': { src: _currency_weth.src, source: isServer && _currency_wethSource, width: _currency_weth.width, height: _currency_weth.height, aspect: _currency_weth.width/_currency_weth.height }, 'currency/wxdai': { src: _currency_wxdai.src, source: isServer && _currency_wxdaiSource, width: _currency_wxdai.width, height: _currency_wxdai.height, aspect: _currency_wxdai.width/_currency_wxdai.height } } as const diff --git a/src/helpers/constants.ts b/src/helpers/constants.ts index d589711..b7e5fc7 100644 --- a/src/helpers/constants.ts +++ b/src/helpers/constants.ts @@ -1,4 +1,4 @@ -import { chiliz, gnosis, polygon, polygonAmoy, spicy } from 'viem/chains' +import { chiliz, gnosis, polygon, polygonAmoy, spicy, base, baseSepolia } from 'viem/chains' import { type ChainId } from '@azuro-org/toolkit' import { type IconName } from 'components/ui' @@ -14,6 +14,8 @@ const rpcByChains: Record = { [polygonAmoy.id]: 'https://polygon-amoy-bor-rpc.publicnode.com', [chiliz.id]: 'https://chiliz-rpc.publicnode.com', [spicy.id]: 'https://chiliz-spicy-rpc.publicnode.com', + [base.id]: 'https://base-rpc.publicnode.com', + [baseSepolia.id]: 'https://base-sepolia-rpc.publicnode.com', } as const const chainIcons: Record = { @@ -22,6 +24,8 @@ const chainIcons: Record = { [polygonAmoy.id]: 'networks/polygon', [chiliz.id]: 'networks/chiliz', [spicy.id]: 'networks/chiliz', + [base.id]: 'networks/base', + [baseSepolia.id]: 'networks/base', } const currencyIcons: Record = { @@ -30,6 +34,8 @@ const currencyIcons: Record = { [polygonAmoy.id]: 'currency/azusd', [chiliz.id]: 'currency/wchz', [spicy.id]: 'currency/wchz', + [base.id]: 'currency/weth', + [baseSepolia.id]: 'currency/weth', } const sportsOrder = [ 'politics', 'football', 'basketball', 'tennis', 'cricket', 'mma', 'boxing', 'ice-hockey', 'american-football', 'baseball', 'rugby-union', 'rugby-league' ]