Skip to content
Open
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
5 changes: 5 additions & 0 deletions .changeset/ciphertrade-wallet-contribution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rainbow-me/rainbowkit": patch
---

Added CipherTrade support with `cipherTradeWallet` wallet connector.
2 changes: 2 additions & 0 deletions packages/example/src/wagmi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
bitverseWallet,
bloomWallet,
bybitWallet,
cipherTradeWallet,
clvWallet,
coin98Wallet,
compassWallet,
Expand Down Expand Up @@ -228,6 +229,7 @@ export const config = getDefaultConfig({
bitverseWallet,
bloomWallet,
bybitWallet,
cipherTradeWallet,
clvWallet,
coin98Wallet,
compassWallet,
Expand Down
17 changes: 17 additions & 0 deletions packages/rainbowkit/src/locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions packages/rainbowkit/src/types/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export type WalletProviderFlags =
| 'isBitski'
| 'isBinance'
| 'isBlockWallet'
| 'isCipherTrade'
| 'isBraveWallet'
| 'isCoinbaseWallet'
| 'isDawn'
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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',
Comment thread
iamsstef marked this conversation as resolved.
},
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' }),
};
};
2 changes: 2 additions & 0 deletions packages/rainbowkit/src/wallets/walletConnectors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -89,6 +90,7 @@ export {
bloomWallet,
braveWallet,
bybitWallet,
cipherTradeWallet,
clvWallet,
coin98Wallet,
coinbaseWallet,
Expand Down
6 changes: 6 additions & 0 deletions site/data/en-US/docs/custom-wallet-list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down