Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: mock remote config and enble testnet dtao staking #1806

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/extension-core/src/util/fetchRemoteConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { log, TALISMAN_CONFIG_URL } from "extension-shared"
import toml from "toml"

import { RemoteConfigStoreData } from "../domains/app/types"
import { mockedRemoteConfig } from "./mockedRemoteConfig"

export const fetchRemoteConfig = async () => {
log.debug("Fetching config.toml")
Expand All @@ -10,10 +11,11 @@ export const fetchRemoteConfig = async () => {
if (!response.ok)
throw new Error(`Unable to fetch config.toml: ${response.status} ${response.statusText}`)

const text = await response.text()
// const text = await response.text()

try {
return toml.parse(text) as RemoteConfigStoreData
// return toml.parse(text) as RemoteConfigStoreData
return toml.parse(mockedRemoteConfig) as RemoteConfigStoreData
} catch (e) {
throw new Error("Unable to parse config.toml", { cause: e })
}
Expand Down
77 changes: 77 additions & 0 deletions packages/extension-core/src/util/mockedRemoteConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
export const mockedRemoteConfig = `[featureFlags]
BUY_CRYPTO = true # shows the buy crypto button in the wallet
LINK_TX_HISTORY = true # shows the transaction history link in the wallet
LINK_STAKING = true # shows the staking link in the wallet
I18N = false # enables internationalization
USE_ONFINALITY_API_KEY = false # enables the use of the onFinality API key
QUEST_LINK = true # enables quest link in portfolio header
# UNIFIED_ADDRESS_BANNER = true # enables unified address banners on home page and copy address chain picker
# RISK_ANALYSIS = true # enables risk analysis feature

[rampConfig]
rampBasePath = "https://app.ramp.network"
rampApiBasePath = "https://api.ramp.network/api/host-api/v3"
rampApiKey = "5ga4dyv63auqe9t2ytrcz8jaaudmq4m2js8egzsh"

[rampSupportedTokenIds]
# To support more tokens add "CHAIN_SYMBOL: tokenId". Get the "chain" key and token "symbol" from Ramp's API response, and the tokenId from our chain data.
POLKADOT_DOT = "polkadot-substrate-native"
DOT_DOT = "polkadot-asset-hub-substrate-native"
KUSAMA_KSM = "kusama-substrate-native"
DOT_USDC = "polkadot-asset-hub-substrate-assets-1337-usdc"
DOT_USDT = "polkadot-asset-hub-substrate-assets-1984-usdt"
MATIC_POL = "137-evm-native"
ETH_USDT = "1-evm-erc20-0xdac17f958d2ee523a2206206994597c13d831ec7"
ARBITRUM_USDT = "42161-evm-erc20-0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"
OPTIMISM_USDT = "10-evm-erc20-0x94b008aa00579c1307b0ef2c499ad98a8ce58e58"
MATIC_USDT = "137-evm-erc20-0xc2132d05d31c914a87c6611c10748aeb04b58e8f"
ETH_USDC = "1-evm-erc20-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
BASE_USDC = "8453-evm-erc20-0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
ARBITRUM_USDC = "42161-evm-erc20-0xaf88d065e77c8cc2239327c5edb3a432268e5831"
MATIC_USDC = "137-evm-erc20-0x3c499c542cef5e3811e1192ce70d8cc03d5c3359"
OPTIMISM_USDC = "10-evm-erc20-0x0b2c639c533813f4aa9d7837caf62653d097ff85"
ETH_ETH = "1-evm-native"
OPTIMISM_ETH = "10-evm-native"
ARBITRUM_ETH = "42161-evm-native"
BASE_ETH = "8453-evm-native"
MATIC_ETH = "137-evm-erc20-0x7ceb23fd6bc0add59e62ac25578270cff1b9f619"

[buyTokens]
tokenIds = [
"polkadot-substrate-native-dot", # keep old native token ids format to prevent breaking old builds
"polkadot-substrate-native",
"kusama-substrate-native-ksm",
"kusama-substrate-native",
"moonbeam-substrate-native-glmr",
"moonbeam-substrate-native",
"moonriver-substrate-native-movr",
"moonriver-substrate-native",
"ternoa-substrate-native-caps",
"ternoa-substrate-native",
"1-evm-native-eth",
"1-evm-native",
"56-evm-native-bnb",
"56-evm-native",
"137-evm-native-matic",
"137-evm-native",
]

[coingecko]
apiUrl = "https://cgp.talisman.xyz"

[nominationPools]
polkadot = [282, 12, 16]
kusama = [15]
avail = [66, 68, 2]
vara = [8]
aleph-zero = [47]
cere = [1]
analog-timechain = [1]

[stakingPools]
bittensor = ["5ELREhApbCahM7FyGLM1V9WDsnnjCRmMCJTmtQD51oAEqwVh"]
bittensor-testnet = ['5FCPTnjevGqAuTttetBy4a24Ej3pH9fiQ8fmvP1ZkrVsLUoT']

[documentation]
unifiedAddressDocsUrl = "https://polkadot-ux-bounty.notion.site/UXB-1-User-Wiki-Page-188e1c2781f380259c4ef29041bacc49"
`