Skip to content

Commit

Permalink
Merge branch 'main' into FSP-72_sol-staking
Browse files Browse the repository at this point in the history
  • Loading branch information
icfor committed Mar 26, 2024
2 parents 439806b + bd31da3 commit 02c36b7
Show file tree
Hide file tree
Showing 18 changed files with 67 additions and 204 deletions.
4 changes: 2 additions & 2 deletions public/locales/en/analytics_tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"empowering": "Empowering you with real-time on-chain data",
"free": "<0>Free and easy access to <1>real-time</1> on-chain data</0>",
"governance_tool": "Free Governance Tool",
"networks": "<0>Supporting over <1>50 networks</1></0>",
"our": "Our award-winning block explorer Big Dipper empowers token holders and blockchain developers with easy access to on-chain data. Big Dipper currently supports more than 50 blockchain networks and has been forked over 700 times. Big Dipper is also a user-friendly tool for staking and voting on governance proposals on multi-chains.",
"networks": "<0>Supporting over <1>40 networks</1></0>",
"our": "Our award-winning block explorer Big Dipper empowers token holders and blockchain developers with easy access to on-chain data. Big Dipper currently supports more than 40 blockchain networks and has been forked over 700 times. Big Dipper is also a user-friendly tool for staking and voting on governance proposals on multi-chains.",
"staking_tool": "Free Staking Tool",
"title": "Blockchain Data Analytics Tools",
"try_now": "Try now"
Expand Down
9 changes: 8 additions & 1 deletion public/locales/en/staking.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
"definitions": {
"apy": "Annual Percentage Yield (APY) shows the rate of token earnings you can achieve from staking. It includes compound interest, helping you gauge the potential growth of your investment.",
"tvl": "Total Value Locked (TVL) is the total USD value of all assets staked with Forbole on this network. It indicates Forbole's staking scale and popularity.",
"unbonding_one": "After staking, your tokens will be locked and unable to be transferred until the {{count}}-day unstaking period ends.",
"unbonding_other": "After staking, your tokens will be locked and unable to be transferred until the {{count}}-days unstaking period ends",
"votingPower": "The \"Voting Power\" is the total amount of tokens staked with Forbole on the network. The more amount of tokens staked, the higher the voting power."
},
"description": "Stake, earn and secure the networks with Forbole",
Expand Down Expand Up @@ -78,7 +80,7 @@
"receiving bullet 2": "Nominated a validator with 100% commission holders. The rewards rate varies depending on the total amount of staked tokens, and each network has their specific settings.",
"receiving q": "Why am I not receiving staking rewards?",
"reputable validator": "Reputable Validator Journey",
"reputable validator desc": "We started as a genesis validator or Cosmos Hub and quickly expanded to other networks. Currently, we are validating on over 50 mainnets, operating nodes on all major blockchians, being guardians on major interchain bridges, and actively participating in many testnets. As a non-custodian staking service provider, we are trusted by thousands of stakers all over the world.",
"reputable validator desc": "We started as a genesis validator or Cosmos Hub and quickly expanded to other networks. Currently, we are validating on over 40 mainnets, operating nodes on all major blockchians, being guardians on major interchain bridges, and actively participating in many testnets. As a non-custodian staking service provider, we are trusted by thousands of stakers all over the world.",
"reward para 1": "Newly minted tokens and transaction fees are given out as rewards to bonded staking token holders. The rewards rate varies depending on the total amount of staked tokens, and each network has their specific settings.",
"reward para 2": "<0>You can calculate your staking rewards <1>here</1>. You can also view your real-time rewards on each Big Dipper explorer. Or if you are interested in the detailed calculation, please refer to the whitepapers or tokenomics papers of each network, which can be found on their websites.</0>",
"reward para 3": "Staking rewards should be “claimed” before becoming available in your account. This is a type of transaction so you would need to pay for the transaction when claiming rewards. While staking new tokens, your rewards will automatically be claimed into your available balance. The rewards are also automatically withdrawn to your account if there is a network upgrade.",
Expand Down Expand Up @@ -107,6 +109,10 @@
"stake_now": "Stake Now",
"stakeAccounts": "Accounts",
"staked by forbole": "Staked by Forbole",
"staking": {
"days_one": "{{count}} day",
"days_other": "{{count}} days"
},
"staking para 1": "The action that token holders stake their tokens to validators to secure the network is called staking. Staked tokens are eligible to receive staking rewards. Newly minted tokens and transactions fees are given out as rewards to bonded staking token holders.",
"staking para 2": "Stakers stake their staking power to validators, but that does not mean the validators possess or have custody of the tokens staked to them. In other words, validators cannot steal or take away stakers’ tokens. Your staked amount of tokens will not be decreased in most situations, however, if your validator is punished by slashing, your staked token is at risk of being slashed too (see below for “slashing”).",
"staking q": "What is staking?",
Expand Down Expand Up @@ -145,6 +151,7 @@
},
"title": "Stake with Forbole",
"tokenAmount": "Token amount",
"unbonding": "Unstaking period",
"walletSellect": "Stake from:"
},
"stakingWidget": {
Expand Down
4 changes: 2 additions & 2 deletions public/locales/en/validator_infrastructure.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"grid_3rd_title": "Wormhole",
"headercard_desc": "Building the Multi-chain from the ground up",
"headercard_title": "Validator Infrastructure",
"infrastructure_item1": "Trusted by 50+ networks and bridges worldwide",
"infrastructure_item1": "Trusted by 40+ networks and bridges worldwide",
"infrastructure_item2": "Enterprise grade setup including remote signer, DDoS protection and double-signing prevention",
"infrastructure_item3": "Industry leading security protocols",
"infrastructure_item4": "Self-owned and cloud-based servers across the world",
Expand All @@ -25,7 +25,7 @@
"section_2nd_large_title": "<0>Your go-to Web3 <1>infrastructure choice</1></0>",
"section_2nd_title": "Our Strengths",
"section_3rd_desc": "Partners who trust us",
"section_3rd_large_title": "<0>Supporting over <1>50 networks</1></0>",
"section_3rd_large_title": "<0>Supporting over <1>40 networks</1></0>",
"section_3rd_title": "Testimonials",
"see_more_networks": "See more networks",
"stake_now": "Stake now",
Expand Down
4 changes: 2 additions & 2 deletions public/locales/zh-CN/analytics_tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"empowering": "区块链数据分析工具",
"free": "<0>轻松取得免费<1>实时</1>链上数据</0>",
"governance_tool": "免费治理工具",
"networks": "<0>支援 <1>50</1> 多个<1>网络</1></0>",
"our": "屡获殊荣的区块链浏览器 Big Dipper 提供予通证持有者及区块链工程师轻松获取实时链上数据。 Big Dipper目前支援超过 50 个区块链网络,并已被建立程式分枝 超过 700 次。 Big Dipper 是用户至上的工具,可供多链上的治理提案进行质押和投票。",
"networks": "<0>支援 <1>40</1> 多个<1>网络</1></0>",
"our": "屡获殊荣的区块链浏览器 Big Dipper 提供予通证持有者及区块链工程师轻松获取实时链上数据。 Big Dipper目前支援超过 40 个区块链网络,并已被建立程式分枝 超过 700 次。 Big Dipper 是用户至上的工具,可供多链上的治理提案进行质押和投票。",
"staking_tool": "免费质押工具",
"title": "区块链数据分析工具",
"try_now": "立即试用"
Expand Down
7 changes: 6 additions & 1 deletion public/locales/zh-CN/staking.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"definitions": {
"apy": "年收益率(APY)显示您可以通过质押获得的代币收益率。 它包括复利,帮助您衡量投资的潜在增长。",
"tvl": "锁定总价值 (TVL) 是 Forbole 在该网络上质押的所有资产的美元总价值。 它表明了 Forbole 的质押规模和受欢迎程度。",
"unbonding_other": "质押后,您的代币将被锁定,直到 {{count}} 天解质期结束后才能转移",
"votingPower": "“投票权”是指 Forbole 在网络上质押的代币总量。 质押的代币数量越多,投票权就越高。"
},
"description": " 在 Forbole 质押,赚取收益,守护网络",
Expand Down Expand Up @@ -78,7 +79,7 @@
"receiving bullet 2": "提名一名验证者,佣金持有者为 100%。",
"receiving q": "为什么我没有收到质押奖励?",
"reputable validator": "信誉良好的验证人",
"reputable validator desc": "始于 Cosmos Hub 创世验证人的我们,已在短时期内快速拓展,现阶段已在超过 50 个主网中运行验证节点,保护重要的跨链桥,并积极参与多个测试网络。身为一家非托管式质押服务提供商,我们深得全球数千计质押者的信任。",
"reputable validator desc": "始于 Cosmos Hub 创世验证人的我们,已在短时期内快速拓展,现阶段已在超过 40 个主网中运行验证节点,保护重要的跨链桥,并积极参与多个测试网络。身为一家非托管式质押服务提供商,我们深得全球数千计质押者的信任。",
"reward para 1": "新铸造的代币和交易费用将作为奖励给予质押代币持有者。",
"reward para 2": "<0>您可以计算您的质押奖励 <1>这里</1>。</0>",
"reward para 3": "质押奖励应在您的账户中可用之前“领取”。",
Expand Down Expand Up @@ -107,6 +108,9 @@
"stake_now": "立即质押",
"stakeAccounts": "Accounts",
"staked by forbole": "Forbole 质押",
"staking": {
"days_other": "{{count}}天"
},
"staking para 1": "代币持有者将其代币质押给验证者以保护网络的行为称为质押。",
"staking para 2": "质押者将质押权质押给验证者,但这并不意味着验证者拥有或保管质押给他们的代币。",
"staking q": "什么是质押?",
Expand Down Expand Up @@ -145,6 +149,7 @@
},
"title": "用 Forbole 进行桩桩",
"tokenAmount": "代币数量",
"unbonding": "解押期",
"walletSellect": "股权来自:"
},
"stakingWidget": {
Expand Down
4 changes: 2 additions & 2 deletions public/locales/zh-CN/validator_infrastructure.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"grid_3rd_title": "Wormhole",
"headercard_desc": "构建多链 由零开始",
"headercard_title": "验证人基础建设",
"infrastructure_item1": "获得超过 50 个网络及跨链桥的信任",
"infrastructure_item1": "获得超过 40 个网络及跨链桥的信任",
"infrastructure_item2": "企业级设置,包括远端签署、DDoS 保护和双重支付防护",
"infrastructure_item3": "行业领先的安全协议",
"infrastructure_item4": "自家拥有的云伺服器遍布全球",
Expand All @@ -25,7 +25,7 @@
"section_2nd_large_title": "<0>你的首选 Web3 <1>基础建设</1></0>",
"section_2nd_title": "我们的优势",
"section_3rd_desc": "获得合作伙伴的信任",
"section_3rd_large_title": "<0>支援 <1>50</1> 多个<1>网络</1></0>",
"section_3rd_large_title": "<0>支援 <1>40</1> 多个<1>网络</1></0>",
"section_3rd_title": "值得信赖",
"see_more_networks": "查看更多网络",
"stake_now": "立即质押",
Expand Down
4 changes: 2 additions & 2 deletions public/locales/zh-HK/analytics_tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"empowering": "為你提供實時鏈上數據",
"free": "<0>輕鬆取得免費<1>實時</1>鏈上數據</0>",
"governance_tool": "免費治理工具",
"networks": "<0>支援 <1>50</1> 多個<1>網絡</1></0>",
"our": "屢獲殊榮的區塊鏈瀏覽器 Big Dipper 提供予通證持有者及區塊鏈工程師輕鬆獲取實時鏈上數據。 Big Dipper目前支援超過 50 個區塊鏈網絡,並已被建立程式分枝 超過 700 次。Big Dipper 是用戶至上的工具,可供多鏈上的治理提案進行質押和投票。",
"networks": "<0>支援 <1>40</1> 多個<1>網絡</1></0>",
"our": "屢獲殊榮的區塊鏈瀏覽器 Big Dipper 提供予通證持有者及區塊鏈工程師輕鬆獲取實時鏈上數據。 Big Dipper目前支援超過 40 個區塊鏈網絡,並已被建立程式分枝 超過 700 次。Big Dipper 是用戶至上的工具,可供多鏈上的治理提案進行質押和投票。",
"staking_tool": "免費質押工具",
"title": "區塊鏈數據分析工具",
"try_now": "立即試用"
Expand Down
7 changes: 6 additions & 1 deletion public/locales/zh-HK/staking.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"definitions": {
"apy": "年收益率(APY)顯示您可以透過質押獲得的代幣收益率。 它包括複利,幫助您衡量投資的潛在成長。",
"tvl": "鎖定總價值 (TVL) 是 Forbole 在該網絡上質押的所有資產的美元總價值。 它顯示了 Forbole 的質押規模和受歡迎程度。",
"unbonding_other": "質押後,您的代幣將被鎖定,直到 {{count}} 天解質期結束後才能轉移",
"votingPower": "「投票權」指 Forbole 在網路上質押的代幣總量。 質押的代幣數量越多,投票權越高。"
},
"description": " 在 Forbole 质押,赚取收益,守护网络",
Expand Down Expand Up @@ -78,7 +79,7 @@
"receiving bullet 2": "提名一名驗證者,佣金持有者為 100%。",
"receiving q": "為什麼我沒有收到質押獎勵?",
"reputable validator": "信譽良好的驗證人",
"reputable validator desc": "始於 Cosmos Hub 創世驗證人的我們,已在短時期內快速拓展,現階段已在超過 50 個主網中運行驗證節點,保護重要的跨鏈橋,並積極參與多個測試網路。身為一家非託管式質押服務提供者,我們深得全球數千計質押者的信任。",
"reputable validator desc": "始於 Cosmos Hub 創世驗證人的我們,已在短時期內快速拓展,現階段已在超過 40 個主網中運行驗證節點,保護重要的跨鏈橋,並積極參與多個測試網路。身為一家非託管式質押服務提供者,我們深得全球數千計質押者的信任。",
"reward para 1": "新鑄造的代幣和交易費用將作為獎勵給予質押代幣持有者。",
"reward para 2": "<0>您可以計算您的質押獎勵 <1>這裡</1>。</0>",
"reward para 3": "質押獎勵應在您的帳戶中可用之前「領取」。",
Expand Down Expand Up @@ -107,6 +108,9 @@
"stake_now": "立即質押",
"stakeAccounts": "Accounts",
"staked by forbole": "Forbole 質押",
"staking": {
"days_other": "{{count}}日"
},
"staking para 1": "代幣持有者將其代幣質押給驗證者以保護網路的行為稱為質押。",
"staking para 2": "質押者將質押權質押給驗證者,但這並不意味著驗證者擁有或保管質押給他們的代幣。",
"staking q": "什麼是質押?",
Expand Down Expand Up @@ -145,6 +149,7 @@
},
"title": "用 Forbole 進行樁樁",
"tokenAmount": "代幣數量",
"unbonding": "解押期",
"walletSellect": "股權來自:"
},
"stakingWidget": {
Expand Down
4 changes: 2 additions & 2 deletions public/locales/zh-HK/validator_infrastructure.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"grid_3rd_title": "Wormhole",
"headercard_desc": "構建多鏈 由零開始",
"headercard_title": "驗證人基礎建設",
"infrastructure_item1": "獲得超過 50 個網絡及跨鏈橋的信任",
"infrastructure_item1": "獲得超過 40 個網絡及跨鏈橋的信任",
"infrastructure_item2": "企業級設置,包括遠端簽署、DDoS 保護和雙重支付防護",
"infrastructure_item3": "行業領先的安全協議",
"infrastructure_item4": "自家擁有的雲伺服器遍佈全球",
Expand All @@ -25,7 +25,7 @@
"section_2nd_large_title": "<0>你的首選 Web3 <1>基礎建設</1></0>",
"section_2nd_title": "我們的優勢",
"section_3rd_desc": "獲得合作夥伴的信任",
"section_3rd_large_title": "<0>支援 <1>50</1> 多個<1>網絡</1></0>",
"section_3rd_large_title": "<0>支援 <1>40</1> 多個<1>網絡</1></0>",
"section_3rd_title": "值得信賴",
"see_more_networks": "查看更多網絡",
"stake_now": "立即質押",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,8 @@
flex-direction: column;
gap: 12px;
}

.labelValue {
color: #25282d;
font-weight: 600;
}
26 changes: 25 additions & 1 deletion src/screens/staking/components/staking_section/staking_modal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import BigNumber from "bignumber.js";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";

import FormInput from "@src/components/form_input";
Expand Down Expand Up @@ -56,6 +57,7 @@ const StakingModal = () => {
const [memoError, setMemoError] = useState("");
const [memo, setMemo] = useState("");

const { locale } = useRouter();
const isOpen = !!selectedAccount && selectedAction === "stake";

const { state: stakingState } = stakingRef.current;
Expand Down Expand Up @@ -194,6 +196,8 @@ const StakingModal = () => {
return null;
})();

const unbondingPeriod = getUnbondingTimeForNetwork(networkInfo, locale);

return (
<ModalBase onClose={onClose} open={isOpen} title={t("stakingModal.title")}>
<form className={styles.wrapper} onSubmit={onSubmit}>
Expand All @@ -214,7 +218,27 @@ const StakingModal = () => {
/>{" "}
APY
</Label>
<div>{(networkInfo.apy * 100).toFixed(0)}%</div>
<div className={styles.labelValue}>
{(networkInfo.apy * 100).toFixed(0)}%
</div>
</div>
)}
{unbondingPeriod && (
<div className={styles.row}>
<Label className={styles.apy}>
<IconInfoCircle
data-tooltip-content={t("definitions.unbonding", {
count: unbondingPeriod.days,
})}
data-tooltip-id={tooltipId}
/>{" "}
{t("stakingModal.unbonding")}
</Label>
<div className={styles.labelValue}>
{t("staking.days", {
count: unbondingPeriod.days,
})}
</div>
</div>
)}
<div className={styles.selectGroup}>
Expand Down
3 changes: 0 additions & 3 deletions src/screens/staking/lib/staking_sdk/core/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export enum CoinDenom {
KAVA = "KAVA",
OSMO = "OSMO",
PICA = "PICA",
REGEN = "REGEN",
SOL = "SOL",
STARS = "STARS",
TIA = "TIA",
Expand All @@ -40,7 +39,6 @@ export enum StakingNetworkId {
Kava = "kava_2222-10",
KavaTestnet = "kava_2221-16000",
Osmosis = "osmosis-1",
Regen = "regen-1",
Solana = "solana",
SolanaDevnet = "solana-devnet",
SolanaTestnet = "solana-testnet",
Expand All @@ -59,7 +57,6 @@ export const mainNetworkDenom: Record<StakingNetworkId, CoinDenom | null> = {
[StakingNetworkId.Kava]: CoinDenom.KAVA,
[StakingNetworkId.KavaTestnet]: CoinDenom.KAVA,
[StakingNetworkId.Osmosis]: CoinDenom.OSMO,
[StakingNetworkId.Regen]: CoinDenom.REGEN,
[StakingNetworkId.Solana]: CoinDenom.SOL,
[StakingNetworkId.SolanaDevnet]: CoinDenom.SOL,
[StakingNetworkId.SolanaTestnet]: CoinDenom.SOL,
Expand Down
12 changes: 2 additions & 10 deletions src/screens/staking/lib/staking_sdk/core/cosmos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,15 @@ export const keplrNonNativeChains = new Set([
StakingNetworkId.StargazeTestnet,
]);

const leapExcludedNetworks = new Set([
StakingNetworkId.Celestia,
StakingNetworkId.ComposableFinance,
StakingNetworkId.DyDx,
StakingNetworkId.Regen,
StakingNetworkId.KavaTestnet,
]);

export const leapNetworks = new Set(
Array.from(keplrNetworks).filter(
(network) => !leapExcludedNetworks.has(network),
(network) => !keplrNonNativeChains.has(network),
),
);

export const cosmosWallets = new Set([
WalletId.Keplr,
// WalletId.Leap // @TODO: Enable when ready
// WalletId.Leap, // @TODO: Enable Leap wallet when ready
]);

export const cosmosStakingNetworks = new Set([
Expand Down
1 change: 0 additions & 1 deletion src/screens/staking/lib/staking_sdk/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const networkIdToNetworkKey: Record<StakingNetworkId, NetworkKey> = {
[StakingNetworkId.Kava]: "kava",
[StakingNetworkId.KavaTestnet]: "kava-testnet",
[StakingNetworkId.Osmosis]: "osmosis",
[StakingNetworkId.Regen]: "regen",
[StakingNetworkId.Solana]: "solana",
[StakingNetworkId.SolanaDevnet]: "solana-devnet",
[StakingNetworkId.SolanaTestnet]: "solana-testnet",
Expand Down
1 change: 0 additions & 1 deletion src/screens/staking/lib/staking_sdk/gecko_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const geckoClient = {
[CoinDenom.KAVA]: "kava",
[CoinDenom.OSMO]: "osmosis",
[CoinDenom.PICA]: "picasso",
[CoinDenom.REGEN]: "regen",
[CoinDenom.SOL]: "solana",
[CoinDenom.STARS]: "stargaze",
[CoinDenom.TIA]: "celestia",
Expand Down
2 changes: 0 additions & 2 deletions src/screens/staking/lib/staking_sdk/utils/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const networkToUnnormalisedDenom = {
[StakingNetworkId.Kava]: "UKAVA",
[StakingNetworkId.KavaTestnet]: "UKAVA",
[StakingNetworkId.Osmosis]: "UOSMO",
[StakingNetworkId.Regen]: "UREGEN",
[StakingNetworkId.Solana]: "LAMPORTS",
[StakingNetworkId.SolanaDevnet]: "LAMPORTS",
[StakingNetworkId.SolanaTestnet]: "LAMPORTS",
Expand All @@ -37,7 +36,6 @@ const denomMap: Record<DenomToNormalise, [CoinDenom, number]> = {
UATOM: [CoinDenom.ATOM, uExp],
UKAVA: [CoinDenom.KAVA, uExp],
UOSMO: [CoinDenom.OSMO, uExp],
UREGEN: [CoinDenom.REGEN, uExp],
USTARS: [CoinDenom.STARS, uExp],
UTIA: [CoinDenom.TIA, uExp],
};
Expand Down
Loading

0 comments on commit 02c36b7

Please sign in to comment.