Skip to content

Commit

Permalink
feat: paraSwapWallet connector (#2189)
Browse files Browse the repository at this point in the history
* feat: paraSwapWallet

* chore: prettify

* chore: prettify

* chore: fix linting

---------

Co-authored-by: proinsights <proinsights@gmail.com>
  • Loading branch information
proinsights and proinsights authored Sep 26, 2024
1 parent 1785c6c commit f93cd0e
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-spies-yell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rainbow-me/rainbowkit": patch
---

Added ParaSwap Wallet support with `paraSwapWallet` 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 @@ -36,6 +36,7 @@ import {
omniWallet,
oneInchWallet,
oneKeyWallet,
paraSwapWallet,
phantomWallet,
rabbyWallet,
rainbowWallet,
Expand Down Expand Up @@ -216,6 +217,7 @@ export const config = getDefaultConfig({
omniWallet,
oneInchWallet,
oneKeyWallet,
paraSwapWallet,
phantomWallet,
rabbyWallet,
ramperWallet,
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 @@ -997,6 +997,23 @@
}
},

"paraswap": {
"qr_code": {
"step1": {
"title": "Open the ParaSwap app",
"description": "Add ParaSwap Wallet to your home screen for faster access to your wallet."
},
"step2": {
"title": "Create or Import a Wallet",
"description": "Create a new wallet or import an existing one."
},
"step3": {
"title": "Tap the QR icon and scan",
"description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
}
}
},

"phantom": {
"extension": {
"step1": {
Expand Down
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 @@ -36,6 +36,7 @@ import { okxWallet } from './okxWallet/okxWallet';
import { omniWallet } from './omniWallet/omniWallet';
import { oneInchWallet } from './oneInchWallet/oneInchWallet';
import { oneKeyWallet } from './oneKeyWallet/oneKeyWallet';
import { paraSwapWallet } from './paraSwapWallet/paraswapWallet';
import { phantomWallet } from './phantomWallet/phantomWallet';
import { rabbyWallet } from './rabbyWallet/rabbyWallet';
import { rainbowWallet } from './rainbowWallet/rainbowWallet';
Expand Down Expand Up @@ -97,6 +98,7 @@ export {
omniWallet,
oneInchWallet,
oneKeyWallet,
paraSwapWallet,
phantomWallet,
rabbyWallet,
rainbowWallet,
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,52 @@
import type { Wallet } from '../../Wallet';
import type { DefaultWalletOptions } from '../../Wallet';
import { getWalletConnectConnector } from '../../getWalletConnectConnector';

export type ParaSwapWalletOptions = DefaultWalletOptions;

export const paraSwapWallet = ({
projectId,
walletConnectParameters,
}: ParaSwapWalletOptions): Wallet => ({
id: 'paraswap',
name: 'ParaSwap Wallet',
iconUrl: async () => (await import('./paraSwapWallet.svg')).default,
iconBackground: '#578CFC',
downloadUrls: {
ios: 'https://apps.apple.com/us/app/paraswap-multichain-wallet/id1584610690',
mobile: 'https://paraswap.io',
qrCode: 'https://paraswap.io',
},
mobile: {
getUri: (uri: string) => {
return `paraswap://wc?uri=${encodeURIComponent(uri)}`;
},
},
qrCode: {
getUri: (uri: string) => uri,
instructions: {
learnMoreUrl: 'https://paraswap.io',
steps: [
{
description: 'wallet_connectors.paraswap.qr_code.step1.description',
step: 'install',
title: 'wallet_connectors.paraswap.qr_code.step1.title',
},
{
description: 'wallet_connectors.paraswap.qr_code.step2.description',
step: 'create',
title: 'wallet_connectors.paraswap.qr_code.step2.title',
},
{
description: 'wallet_connectors.paraswap.qr_code.step3.description',
step: 'scan',
title: 'wallet_connectors.paraswap.qr_code.step3.title',
},
],
},
},
createConnector: getWalletConnectConnector({
projectId,
walletConnectParameters,
}),
});
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 @@ -307,6 +307,12 @@ import { omniWallet } from '@rainbow-me/rainbowkit/wallets';
import { oneKeyWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### ParaSwap

```tsx
import { paraSwapWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### Phantom

```tsx
Expand Down

0 comments on commit f93cd0e

Please sign in to comment.