From 6c790076113efd4ff6d0eb075f0cac65d9ac089c Mon Sep 17 00:00:00 2001 From: iamsstef <115187950+iamsstef@users.noreply.github.com> Date: Tue, 17 Mar 2026 23:17:09 +0100 Subject: [PATCH] feat: add CipherTrade wallet connector --- .changeset/ciphertrade-wallet-contribution.md | 5 ++ packages/example/src/wagmi.ts | 2 + packages/rainbowkit/src/locales/en_US.json | 17 +++++ packages/rainbowkit/src/types/utils.ts | 1 + .../cipherTradeWallet/cipherTradeWallet.svg | 1 + .../cipherTradeWallet/cipherTradeWallet.ts | 71 +++++++++++++++++++ .../src/wallets/walletConnectors/index.ts | 2 + site/data/en-US/docs/custom-wallet-list.mdx | 6 ++ 8 files changed, 105 insertions(+) create mode 100644 .changeset/ciphertrade-wallet-contribution.md create mode 100644 packages/rainbowkit/src/wallets/walletConnectors/cipherTradeWallet/cipherTradeWallet.svg create mode 100644 packages/rainbowkit/src/wallets/walletConnectors/cipherTradeWallet/cipherTradeWallet.ts diff --git a/.changeset/ciphertrade-wallet-contribution.md b/.changeset/ciphertrade-wallet-contribution.md new file mode 100644 index 0000000000..147501cb86 --- /dev/null +++ b/.changeset/ciphertrade-wallet-contribution.md @@ -0,0 +1,5 @@ +--- +"@rainbow-me/rainbowkit": patch +--- + +Added CipherTrade support with `cipherTradeWallet` wallet connector. diff --git a/packages/example/src/wagmi.ts b/packages/example/src/wagmi.ts index 868f6101db..553c3d4784 100644 --- a/packages/example/src/wagmi.ts +++ b/packages/example/src/wagmi.ts @@ -12,6 +12,7 @@ import { bitverseWallet, bloomWallet, bybitWallet, + cipherTradeWallet, clvWallet, coin98Wallet, compassWallet, @@ -228,6 +229,7 @@ export const config = getDefaultConfig({ bitverseWallet, bloomWallet, bybitWallet, + cipherTradeWallet, clvWallet, coin98Wallet, compassWallet, diff --git a/packages/rainbowkit/src/locales/en_US.json b/packages/rainbowkit/src/locales/en_US.json index a64c4de6ff..7cf5923920 100644 --- a/packages/rainbowkit/src/locales/en_US.json +++ b/packages/rainbowkit/src/locales/en_US.json @@ -409,6 +409,23 @@ } }, + "ciphertrade": { + "qr_code": { + "step1": { + "description": "Add CipherTrade to your home screen for faster access to your wallet.", + "title": "Open the CipherTrade app" + }, + "step2": { + "description": "Create a new wallet or import an existing one.", + "title": "Create or Import a Wallet" + }, + "step3": { + "description": "After you scan, a connection prompt will appear for you to connect your wallet.", + "title": "Tap the scan button" + } + } + }, + "binance": { "qr_code": { "step1": { diff --git a/packages/rainbowkit/src/types/utils.ts b/packages/rainbowkit/src/types/utils.ts index cd29449923..55ca02e33f 100644 --- a/packages/rainbowkit/src/types/utils.ts +++ b/packages/rainbowkit/src/types/utils.ts @@ -26,6 +26,7 @@ export type WalletProviderFlags = | 'isBitski' | 'isBinance' | 'isBlockWallet' + | 'isCipherTrade' | 'isBraveWallet' | 'isCoinbaseWallet' | 'isDawn' diff --git a/packages/rainbowkit/src/wallets/walletConnectors/cipherTradeWallet/cipherTradeWallet.svg b/packages/rainbowkit/src/wallets/walletConnectors/cipherTradeWallet/cipherTradeWallet.svg new file mode 100644 index 0000000000..9a11e031a6 --- /dev/null +++ b/packages/rainbowkit/src/wallets/walletConnectors/cipherTradeWallet/cipherTradeWallet.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/rainbowkit/src/wallets/walletConnectors/cipherTradeWallet/cipherTradeWallet.ts b/packages/rainbowkit/src/wallets/walletConnectors/cipherTradeWallet/cipherTradeWallet.ts new file mode 100644 index 0000000000..f4c8e3317d --- /dev/null +++ b/packages/rainbowkit/src/wallets/walletConnectors/cipherTradeWallet/cipherTradeWallet.ts @@ -0,0 +1,71 @@ +import { + getInjectedConnector, + hasInjectedProvider, +} from '../../getInjectedConnector'; +import { getWalletConnectConnector } from '../../getWalletConnectConnector'; +import type { DefaultWalletOptions, Wallet } from '../../Wallet'; + +export type CipherTradeWalletOptions = DefaultWalletOptions; + +export const cipherTradeWallet = ({ + projectId, + walletConnectParameters, +}: CipherTradeWalletOptions): Wallet => { + const isCipherTradeInjected = hasInjectedProvider({ flag: 'isCipherTrade' }); + const shouldUseWalletConnect = !isCipherTradeInjected; + + const getUriMobile = (uri: string) => + `ciphertrade://wc?uri=${encodeURIComponent(uri)}`; + + return { + id: 'ciphertrade', + name: 'CipherTrade', + rdns: 'org.ciphertrade.app', + iconUrl: async () => (await import('./cipherTradeWallet.svg')).default, + iconBackground: '#131C2B', + installed: isCipherTradeInjected || undefined, + downloadUrls: { + android: + 'https://play.google.com/store/apps/details?id=org.ciphertrade.app', + mobile: 'https://ciphertrade.org', + qrCode: 'https://ciphertrade.org', + }, + mobile: { + getUri: shouldUseWalletConnect ? getUriMobile : undefined, + }, + qrCode: shouldUseWalletConnect + ? { + getUri: (uri: string) => uri, + instructions: { + learnMoreUrl: 'https://ciphertrade.org', + steps: [ + { + description: + 'wallet_connectors.ciphertrade.qr_code.step1.description', + step: 'install', + title: 'wallet_connectors.ciphertrade.qr_code.step1.title', + }, + { + description: + 'wallet_connectors.ciphertrade.qr_code.step2.description', + step: 'create', + title: 'wallet_connectors.ciphertrade.qr_code.step2.title', + }, + { + description: + 'wallet_connectors.ciphertrade.qr_code.step3.description', + step: 'scan', + title: 'wallet_connectors.ciphertrade.qr_code.step3.title', + }, + ], + }, + } + : undefined, + createConnector: shouldUseWalletConnect + ? getWalletConnectConnector({ + projectId, + walletConnectParameters, + }) + : getInjectedConnector({ flag: 'isCipherTrade' }), + }; +}; diff --git a/packages/rainbowkit/src/wallets/walletConnectors/index.ts b/packages/rainbowkit/src/wallets/walletConnectors/index.ts index 67232f9f50..0693849fee 100644 --- a/packages/rainbowkit/src/wallets/walletConnectors/index.ts +++ b/packages/rainbowkit/src/wallets/walletConnectors/index.ts @@ -12,6 +12,7 @@ import { bitverseWallet } from './bitverseWallet/bitverseWallet'; import { bloomWallet } from './bloomWallet/bloomWallet'; import { braveWallet } from './braveWallet/braveWallet'; import { bybitWallet } from './bybitWallet/bybitWallet'; +import { cipherTradeWallet } from './cipherTradeWallet/cipherTradeWallet'; import { clvWallet } from './clvWallet/clvWallet'; import { coin98Wallet } from './coin98Wallet/coin98Wallet'; import { coinbaseWallet } from './coinbaseWallet/coinbaseWallet'; @@ -89,6 +90,7 @@ export { bloomWallet, braveWallet, bybitWallet, + cipherTradeWallet, clvWallet, coin98Wallet, coinbaseWallet, diff --git a/site/data/en-US/docs/custom-wallet-list.mdx b/site/data/en-US/docs/custom-wallet-list.mdx index 388864bde7..38fea06770 100644 --- a/site/data/en-US/docs/custom-wallet-list.mdx +++ b/site/data/en-US/docs/custom-wallet-list.mdx @@ -211,6 +211,12 @@ import { braveWallet } from '@rainbow-me/rainbowkit/wallets'; import { bybitWallet } from '@rainbow-me/rainbowkit/wallets'; ``` +#### CipherTrade + +```tsx +import { cipherTradeWallet } from '@rainbow-me/rainbowkit/wallets'; +``` + #### Coin98 Wallet ```tsx