From 27572965ef9a1885b44bb445bf4d404dc6e0a18a Mon Sep 17 00:00:00 2001 From: Crypto Minion <154598612+jrwbabylonlab@users.noreply.github.com> Date: Fri, 16 Aug 2024 18:55:40 +1000 Subject: [PATCH 1/6] chore: update the medium and mainnet url to labs (#82) --- src/app/components/Footer/Footer.tsx | 2 +- src/config/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/Footer/Footer.tsx b/src/app/components/Footer/Footer.tsx index 09ba31e6..170e4060 100644 --- a/src/app/components/Footer/Footer.tsx +++ b/src/app/components/Footer/Footer.tsx @@ -40,7 +40,7 @@ const iconLinks = [ }, { name: "Medium", - url: "https://medium.com/babylonchain-io", + url: "https://medium.com/babylonlabs-io", Icon: BsMedium, }, { diff --git a/src/config/index.ts b/src/config/index.ts index 88fc21ef..ec639445 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -10,5 +10,5 @@ export const shouldDisplayTestingMsg = (): boolean => { export const getNetworkAppUrl = (): string => { return shouldDisplayTestingMsg() ? "https://btcstaking.testnet.babylonchain.io" - : "https://btcstaking.babylonchain.io"; + : "https://btcstaking.babylonlabs.io"; }; From 61b2e05f7d081493b4442c809e522f8b59c9b152 Mon Sep 17 00:00:00 2001 From: Jeremy <168515712+jeremy-babylonlabs@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:09:04 +0800 Subject: [PATCH 2/6] Hotfix - clean input after staking and updated title text (#78) * update text explaination and improve input reset logic * update font weight --- package-lock.json | 4 ++-- package.json | 2 +- .../Staking/FinalityProviders/FinalityProviders.tsx | 4 +++- src/app/components/Staking/Form/StakingAmount.tsx | 3 +-- src/app/components/Staking/Staking.tsx | 4 +++- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index c7bb927a..2fe56d31 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "simple-staking", - "version": "0.2.33", + "version": "0.2.34", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "simple-staking", - "version": "0.2.33", + "version": "0.2.34", "dependencies": { "@bitcoinerlab/secp256k1": "^1.1.1", "@keystonehq/animated-qr": "^0.8.6", diff --git a/package.json b/package.json index a3564de8..7d9e8ac2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simple-staking", - "version": "0.2.33", + "version": "0.2.34", "private": true, "scripts": { "dev": "next dev", diff --git a/src/app/components/Staking/FinalityProviders/FinalityProviders.tsx b/src/app/components/Staking/FinalityProviders/FinalityProviders.tsx index 95e3cd45..879fc989 100644 --- a/src/app/components/Staking/FinalityProviders/FinalityProviders.tsx +++ b/src/app/components/Staking/FinalityProviders/FinalityProviders.tsx @@ -31,7 +31,9 @@ export const FinalityProviders: React.FC = ({ return ( <> -

Select a finality provider.

+

+ Step-1: Select a finaltiy provider +

Finality Provider

BTC PK

diff --git a/src/app/components/Staking/Form/StakingAmount.tsx b/src/app/components/Staking/Form/StakingAmount.tsx index 2ce5d531..9da311e2 100644 --- a/src/app/components/Staking/Form/StakingAmount.tsx +++ b/src/app/components/Staking/Form/StakingAmount.tsx @@ -94,7 +94,6 @@ export const StakingAmount: React.FC = ({ } else { setError(""); onStakingAmountSatChange(satoshis); - setValue(maxDecimals(satoshiToBtc(satoshis), 8).toString()); } }, [ btcWalletBalanceSat, @@ -126,7 +125,7 @@ export const StakingAmount: React.FC = ({
= ({ return ( <> -

Set up staking terms

+

+ Step-2: Set up staking terms +

Date: Fri, 16 Aug 2024 19:16:58 +1000 Subject: [PATCH 3/6] chore: modify-license (#83) * chore: modify-license --- LICENSE | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 78 insertions(+), 8 deletions(-) diff --git a/LICENSE b/LICENSE index 735df13e..bf18d722 100644 --- a/LICENSE +++ b/LICENSE @@ -8,14 +8,84 @@ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. Parameters -Licensor: Babylon Labs, Ltd. - -Licensed Work: simple-staking - The Licensed Work is (c) 2024 Babylon Labs, Ltd. - -Additional Use Grant: None. - -Change Date: 2027-05-15 (March 15th, 2027] +Licensor: Babylon Labs Ltd. + +Licensed Work: Simple Staking + The Licensed Work is (c) 2024 Babylon Labs Ltd. + +Additional Use Grant: + +In addition to the uses permitted under the non-production license below, +we grant you a limited, non-exclusive, non-transferable, non-sublicensable, +revocable license, limited as set forth below, to use the Licensed Work +in this repository for production commercial uses built on or using and integrated +with the Babylon Protocol, not including Competing Uses. + +Any use beyond the scope of this license, including uses that are not built on or +using and integrated with the Babylon Protocol, or are Competing Uses, +will terminate this license to you, automatically and without notice. + +This License applies separately and solely to the specific versions of the Licensed Work +in the specified repository on or before the date of this License, and we may require a +different license and different provisions for each subsequent version of the +Licensed Work released by us. + +"Babylon Labs", "we", "our", or "us" means Babylon Labs Ltd. + +"Babylon Protocol" means the Bitcoin staking protocol as further described in the documentation +here (https://docs.babylonlabs.io/docs/introduction/babylon-overview), as updated from time to time. + +"Competing Use" means any use of the Licensed Work in any product, software, protocol, network, +application, or service that is made available to any party and that +(i) substitutes for the use of the Babylon Protocol, +(ii) offers the same or substantially similar functionality as the Babylon Protocol or +(iii) is built on or uses a protocol with substantially similar functionality as the Babylon Protocol +or otherwise facilitates the staking of bitcoin other than by utilizing the Babylon Protocol. + +The provisions in this License apply to each individual, entity, group, or association +(each and collectively, "you" or "your") who uses the Licensed Work for production, +and you agree to such provisions. Your production use of the Licensed Work is conditional on your +agreement to this License. If you do not agree and consent to be bound to this License, +do not so use the Software. + +If you do not fall within the limited scope of this license as described above or below, +or are otherwise not in strict compliance with this License, then this production license does not +extend to you and does not grant you any production use, including any copying, distributing, or +making any derivative use of the Licensed Work for production purposes. + +Limited Scope of License. Your commercial production license to the Licensed Work +under this License does not extend to any use: + +1. unless you have legal capacity to consent and agree to be bound by this License; +2. unless you have the technical knowledge necessary or advisable to understand and evaluate the + risks of using the Licensed Work and the Babylon Protocol; +3. if you are a resident or agent of, or an entity organized, incorporated or doing business in, + Afghanistan, Belarus, Bosnia and Herzegovina, Burundi, Central African Republic, Crimea, Cuba, + Democratic People's Republic of Korea, Democratic Republic of the Congo, + Donetsk or Luhansk Regions of Ukraine, Eritrea, Guinea, Guinea-Bissau, Haiti, Iran, Iraq, Lebanon, + Libya, Mali, Myanmar, Nicaragua, Russia, Somalia, South Sudan, Sudan, Syria, Venezuela, Yemen, + or Zimbabwe or any other country to which the United States, the United Kingdom, + the European Union or any of its member states or the United Nations or any of its member states + (collectively, the "Major Jurisdictions") embargoes goods or imposes sanctions + (such embargoed or sanctioned territories, collectively, the "Restricted Territories"); +4. if you are, or if you directly or indirectly own or control, from any person or entity that is + listed on any sanctions list or equivalent maintained by any of the Major Jurisdictions + (collectively, "Sanctions Lists Persons"); +5. to transact in or with any Restricted Territories or Sanctions List Persons; +6. if you are a U.S. Person as defined in 17 CFR ยง 230.902, or currently or ordinarily located or + resident in (or incorporated or organized in) the United States of America, Canada, or + Australia (collectively, "Excluded Jurisdictions"), or to transact in or with Excluded Jurisdictions; +7. to defraud, or otherwise materially mislead, any person; +8. in violation of applicable laws, rules or regulations in your relevant jurisdiction; +9. that circumvents any sanctions or export controls targeting you or the country or territory where + you are located; or +10. in any activity that transmits, exchanges, or is otherwise supported by the direct or indirect + proceeds of criminal or fraudulent activity. + +Any production use of the Licensed Work by you confirms your agreement to the foregoing limitations, +and your understanding and agreement that they are limitations and not restrictions. + +Change Date: 2027-03-15 (March 15th, 2027) Change License: Apache 2.0 From eb211630c090f2e201231420e3c417d89bd57095 Mon Sep 17 00:00:00 2001 From: Crypto Minion <154598612+jrwbabylonlab@users.noreply.github.com> Date: Fri, 16 Aug 2024 21:53:57 +1000 Subject: [PATCH 4/6] fix: exclude the oneKey from injectable wallet (#85) --- package-lock.json | 4 ++-- package.json | 2 +- src/app/components/Modals/ConnectModal.tsx | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2fe56d31..9d5c9c85 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "simple-staking", - "version": "0.2.34", + "version": "0.2.35", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "simple-staking", - "version": "0.2.34", + "version": "0.2.35", "dependencies": { "@bitcoinerlab/secp256k1": "^1.1.1", "@keystonehq/animated-qr": "^0.8.6", diff --git a/package.json b/package.json index 7d9e8ac2..d849223f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simple-staking", - "version": "0.2.34", + "version": "0.2.35", "private": true, "scripts": { "dev": "next dev", diff --git a/src/app/components/Modals/ConnectModal.tsx b/src/app/components/Modals/ConnectModal.tsx index 7ff42c9f..3bd37d67 100644 --- a/src/app/components/Modals/ConnectModal.tsx +++ b/src/app/components/Modals/ConnectModal.tsx @@ -102,7 +102,9 @@ export const ConnectModal: React.FC = ({ }; const buildInjectableWallet = (shouldDisplay: boolean, name: string) => { - if (!shouldDisplay) { + // NOTE: The 'OneKey (Browser)' special case here is a temporary solution + // while waiting for the OneKey wallet to release their fixes + if (!shouldDisplay || injectedWalletProviderName === "OneKey (Browser)") { return null; } From 695288570d50306afc0fee1cba57873a98014cdd Mon Sep 17 00:00:00 2001 From: Govard Barkhatov Date: Sun, 18 Aug 2024 13:48:59 +0200 Subject: [PATCH 5/6] feature: Preview Unbonding fee (#86) * unbonding fee * text change * patch --- package-lock.json | 4 ++-- package.json | 2 +- src/app/components/Modals/PreviewModal.tsx | 16 +++++++++++++--- src/app/components/Staking/Staking.tsx | 2 ++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9d5c9c85..aaaa807a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "simple-staking", - "version": "0.2.35", + "version": "0.2.36", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "simple-staking", - "version": "0.2.35", + "version": "0.2.36", "dependencies": { "@bitcoinerlab/secp256k1": "^1.1.1", "@keystonehq/animated-qr": "^0.8.6", diff --git a/package.json b/package.json index d849223f..3c57a014 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simple-staking", - "version": "0.2.35", + "version": "0.2.36", "private": true, "scripts": { "dev": "next dev", diff --git a/src/app/components/Modals/PreviewModal.tsx b/src/app/components/Modals/PreviewModal.tsx index b6a78118..33a653f8 100644 --- a/src/app/components/Modals/PreviewModal.tsx +++ b/src/app/components/Modals/PreviewModal.tsx @@ -18,6 +18,7 @@ interface PreviewModalProps { feeRate: number; unbondingTimeBlocks: number; confirmationDepth: number; + unbondingFeeSat: number; } export const PreviewModal: React.FC = ({ @@ -31,6 +32,7 @@ export const PreviewModal: React.FC = ({ stakingFeeSat, feeRate, confirmationDepth, + unbondingFeeSat, }) => { const cardStyles = "card border bg-base-300 p-4 text-sm dark:border-0 dark:bg-base-200"; @@ -76,7 +78,7 @@ export const PreviewModal: React.FC = ({

Term

{blocksToDisplayTime(stakingTimeBlocks)}

-
+

On-demand unbonding

@@ -85,12 +87,20 @@ export const PreviewModal: React.FC = ({ time)

+
+

Unbonding fee

+

{`${maxDecimals(satoshiToBtc(unbondingFeeSat), 8)} ${coinName}`}

+

Attention!

1. Your stake may "overflow" the staking TVL cap and need to - be unbonded and withdrawn, which will cost you extra transaction fees. - So please stake wisely. + be unbonded and withdrawn, which will cost you {coinName} transaction + fees. So please stake wisely. Unbonding will cost you a static + transaction fee of{" "} + {`${maxDecimals(satoshiToBtc(unbondingFeeSat), 8)} ${coinName}`} + , while the withdrawal fee depends on network conditions. All fees go + to the {coinName} miners.

2. No third party possesses your staked {coinName}. You are the only diff --git a/src/app/components/Staking/Staking.tsx b/src/app/components/Staking/Staking.tsx index ac866c67..fb33013c 100644 --- a/src/app/components/Staking/Staking.tsx +++ b/src/app/components/Staking/Staking.tsx @@ -579,6 +579,7 @@ export const Staking: React.FC = ({ maxStakingTimeBlocks, unbondingTime, confirmationDepth, + unbondingFeeSat, } = stakingParams; // Staking time is fixed @@ -664,6 +665,7 @@ export const Staking: React.FC = ({ confirmationDepth={confirmationDepth} feeRate={feeRate} unbondingTimeBlocks={unbondingTime} + unbondingFeeSat={unbondingFeeSat} /> )}

From 526fc24bffb496e603a133f4573aa58d67e3498e Mon Sep 17 00:00:00 2001 From: Crypto Minion <154598612+jrwbabylonlab@users.noreply.github.com> Date: Mon, 19 Aug 2024 11:11:18 +1000 Subject: [PATCH 6/6] fix: update balance to stakable balance with tooltip (#84) * fix: update balance to stakable balance with tooltip --------- Co-authored-by: jeremy-babylonchain Co-authored-by: Govard Barkhatov --- src/app/components/Summary/Summary.tsx | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/app/components/Summary/Summary.tsx b/src/app/components/Summary/Summary.tsx index d8f2ed06..57b52cc4 100644 --- a/src/app/components/Summary/Summary.tsx +++ b/src/app/components/Summary/Summary.tsx @@ -1,4 +1,6 @@ +import { AiOutlineInfoCircle } from "react-icons/ai"; import { FaBitcoin } from "react-icons/fa"; +import { Tooltip } from "react-tooltip"; import { getNetworkConfig } from "@/config/network.config"; import { satoshiToBtc } from "@/utils/btcConversions"; @@ -23,7 +25,7 @@ export const Summary: React.FC = ({

Your staking summary

-
+

Total staked

@@ -36,8 +38,22 @@ export const Summary: React.FC = ({
-
-

Balance

+
+
+

Stakable Balance

+ + + + +
{typeof btcWalletBalanceSat === "number" ? ( @@ -53,7 +69,7 @@ export const Summary: React.FC = ({ href="https://discord.com/invite/babylonglobal" target="_blank" rel="noopener noreferrer" - className="font-light text-primary hover:underline text-right lg:text-left" + className="font-light text-primary hover:underline text-right" > Get Test Tokens