From 4e89d10a9a77e2518b23eb674b0c99090ea98d27 Mon Sep 17 00:00:00 2001 From: Matthew Militante Date: Wed, 18 Mar 2026 15:59:51 -0400 Subject: [PATCH 1/2] chore: removed babylon --- demo/src/components/MainContent.tsx | 35 +---------------------------- demo/src/components/Sidebar.tsx | 14 ------------ demo/src/components/ToggleGroup.tsx | 6 +---- demo/src/types.ts | 2 +- src/elements/staking.tsx | 20 ++--------------- src/elements/types.ts | 29 ------------------------ 6 files changed, 5 insertions(+), 101 deletions(-) diff --git a/demo/src/components/MainContent.tsx b/demo/src/components/MainContent.tsx index 2861459..c2396c3 100644 --- a/demo/src/components/MainContent.tsx +++ b/demo/src/components/MainContent.tsx @@ -22,10 +22,8 @@ export function MainContent({ }: MainContentProps) { const [wallet, setWallet] = useState<{ address: string; - publicKey: string; }>({ address: "", - publicKey: "", }); const customWalletConfigMap = { @@ -64,40 +62,11 @@ export function MainContent({ return signature; }, }, - babylon: { - address: wallet.address, - publicKey: wallet?.publicKey, - signMessage: async (message: string) => { - const signature = await window?.tomo_btc?.signMessage( - message, - "bip322-simple", - ); - if (!signature) throw new Error("Failed to sign message"); - return signature; - }, - signTransaction: async (transaction: string) => { - const signedTx = await window?.tomo_btc?.signPsbt(transaction); - if (!signedTx) throw new Error("Failed to sign transaction"); - return signedTx; - }, - }, }; useEffect(() => { const fetchWallet = async () => { - if (walletType === "custom" && selectedProtocol.id === "babylon") { - const tomo = window.tomo_btc; - - if (!tomo) throw new Error("Failed to get tomo"); - - const addresses = await tomo.requestAccounts(); - const publicKey = await tomo.getPublicKey(); - - setWallet({ - address: addresses[0], - publicKey, - }); - } else if (walletType === "custom" && selectedProtocol.id === "solana") { + if (walletType === "custom" && selectedProtocol.id === "solana") { const phantom = window.phantom?.solana; if (!phantom) throw new Error("Failed to get phantom"); @@ -106,12 +75,10 @@ export function MainContent({ setWallet({ address: resp.publicKey.toString(), - publicKey: "", }); } else { setWallet({ address: "", - publicKey: "", }); } }; diff --git a/demo/src/components/Sidebar.tsx b/demo/src/components/Sidebar.tsx index 6ab908e..e920a82 100644 --- a/demo/src/components/Sidebar.tsx +++ b/demo/src/components/Sidebar.tsx @@ -6,12 +6,6 @@ import { FigmentLogo } from "./icons"; const protocols: Protocol[] = [ { name: "ETH", id: "ethereum" }, { name: "SOL", id: "solana" }, - { - name: "Babylon", - id: "babylon", - disabled: true, - tooltip: "Protocol temporarily disabled", - }, ]; const networksByProtocol: Record = { @@ -23,10 +17,6 @@ const networksByProtocol: Record = { { name: "Devnet", id: "devnet" }, { name: "Mainnet", id: "mainnet", disabled: true }, ], - babylon: [ - { name: "Signet", id: "signet" }, - { name: "Mainnet", id: "mainnet", disabled: true }, - ], }; const walletDescriptions: WalletDescription = { @@ -38,10 +28,6 @@ const walletDescriptions: WalletDescription = { default: "Uses Solana Wallet Adapter", custom: "With own signing function.", }, - babylon: { - default: "Uses OneKey Wallet", - custom: "With own signing function.", - }, } as const; const themeOptions = [ diff --git a/demo/src/components/ToggleGroup.tsx b/demo/src/components/ToggleGroup.tsx index c4b8883..034e944 100644 --- a/demo/src/components/ToggleGroup.tsx +++ b/demo/src/components/ToggleGroup.tsx @@ -1,6 +1,6 @@ import { cn } from "../utils"; import { Wallet, Code2, TestTubeIcon, GlobeIcon } from "lucide-react"; -import { EthereumIcon, SolanaIcon, BitcoinIcon } from "./icons"; +import { EthereumIcon, SolanaIcon } from "./icons"; interface ToggleGroupProps { value: T | null; @@ -23,8 +23,6 @@ const getIcon = (value: string) => { return ; case "ethereum": return ; - case "babylon": - return ; case "solana": return ; case "mainnet": @@ -43,12 +41,10 @@ const shouldShowIcon = (value: string) => { "default", "custom", "ethereum", - "babylon", "solana", "mainnet", "hoodi", "devnet", - "signet", ].includes(value); }; diff --git a/demo/src/types.ts b/demo/src/types.ts index 7d3b257..e681348 100644 --- a/demo/src/types.ts +++ b/demo/src/types.ts @@ -1,6 +1,6 @@ export interface Protocol { name: string; - id: "ethereum" | "solana" | "babylon"; + id: "ethereum" | "solana"; disabled?: boolean; tooltip?: string; } diff --git a/src/elements/staking.tsx b/src/elements/staking.tsx index 72ed9ae..6d9c026 100644 --- a/src/elements/staking.tsx +++ b/src/elements/staking.tsx @@ -1,10 +1,6 @@ import React, { useEffect, useRef, useState } from "react"; import { style } from "./style"; -import { - BabylonCustomWalletConfig, - PostMessageType, - StakingProps, -} from "./types"; +import { PostMessageType, StakingProps } from "./types"; const Staking: React.FC = ({ protocol, @@ -90,11 +86,6 @@ const Staking: React.FC = ({ const iframeWalletConfig = JSON.stringify({ address: wallet.address, network, - ...(protocol === "babylon" - ? { - publicKey: (wallet as BabylonCustomWalletConfig).publicKey, - } - : {}), }); sendMessageToIframe({ @@ -102,14 +93,7 @@ const Staking: React.FC = ({ walletConfig: iframeWalletConfig, }); } - }, [ - isIframeReady, - wallet, - wallet?.address, - (wallet as BabylonCustomWalletConfig)?.publicKey, - network, - protocol, - ]); + }, [isIframeReady, wallet, wallet?.address, network, protocol]); const sendMessageToIframe = (message: any) => { if (iframeRef.current && iframeRef.current.contentWindow) { diff --git a/src/elements/types.ts b/src/elements/types.ts index a0e1698..7e26bf0 100644 --- a/src/elements/types.ts +++ b/src/elements/types.ts @@ -1,6 +1,5 @@ enum Protocol { ethereum = "ethereum", - babylon = "babylon", solana = "solana", } @@ -9,23 +8,11 @@ enum EthereumNetwork { hoodi = "hoodi", } -enum BabylonNetwork { - mainnet = "mainnet", - signet = "signet", -} - enum SolanaNetwork { mainnet = "mainnet", devnet = "devnet", } -export type BabylonCustomWalletConfig = { - address: string; - publicKey: string; - signTransaction: (transaction: string) => Promise; - signMessage: (message: string) => Promise; -}; - export type SolanaCustomWalletConfig = { address: string; signTransaction: (transaction: string) => Promise; @@ -34,12 +21,10 @@ export type SolanaCustomWalletConfig = { type ProtocolToNetworkMap = { [Protocol.ethereum]: keyof typeof EthereumNetwork; - [Protocol.babylon]: keyof typeof BabylonNetwork; [Protocol.solana]: keyof typeof SolanaNetwork; }; export type ProtocolToWalletConfigMap = { - [Protocol.babylon]: BabylonCustomWalletConfig; [Protocol.solana]: SolanaCustomWalletConfig; }; @@ -55,12 +40,6 @@ type BaseStakingProps = { // wallet: CustomWalletConfig; // }; -type StakingPropsWithWalletBabylon = BaseStakingProps & { - protocol: "babylon"; - network: ProtocolToNetworkMap[Protocol.babylon]; - wallet: ProtocolToWalletConfigMap[Protocol.babylon]; -}; - type StakingPropsWithWalletSolana = BaseStakingProps & { protocol: "solana"; network: ProtocolToNetworkMap[Protocol.solana]; @@ -73,12 +52,6 @@ type StakingPropsWithoutWalletEthereum = BaseStakingProps & { wallet?: undefined; }; -type StakingPropsWithoutWalletBabylon = BaseStakingProps & { - protocol: "babylon"; - network: ProtocolToNetworkMap[Protocol.babylon]; - wallet?: undefined; -}; - type StakingPropsWithoutWalletSolana = BaseStakingProps & { protocol: "solana"; network: ProtocolToNetworkMap[Protocol.solana]; @@ -88,10 +61,8 @@ type StakingPropsWithoutWalletSolana = BaseStakingProps & { export type StakingProps = // Once we enable custom wallets for Ethereum, we can uncomment this // | StakingPropsWithWalletEthereum - | StakingPropsWithWalletBabylon | StakingPropsWithWalletSolana | StakingPropsWithoutWalletEthereum - | StakingPropsWithoutWalletBabylon | StakingPropsWithoutWalletSolana; export enum PostMessageType { From b76f5f57ab20d06d5871d08dab1c83ed1493302d Mon Sep 17 00:00:00 2001 From: Matthew Militante Date: Wed, 18 Mar 2026 16:04:09 -0400 Subject: [PATCH 2/2] chore: bump version --- CHANGELOG.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index def679b..8a6b2ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # @figmentio/elements +## 2.2.0 + +### Minor Changes + +- Removed Babylon support + ## 2.1.2 ### Patch Changes diff --git a/package.json b/package.json index 659ce34..740c254 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@figmentio/elements", - "version": "2.1.2", + "version": "2.2.0", "description": "Install and import Figment Elements directly to your project to gain access to Figment's functionality, such as staking.", "type": "module", "main": "./dist/index.cjs",