Skip to content

Commit

Permalink
feat: oneInchWallet (1inch Wallet) (#1876)
Browse files Browse the repository at this point in the history
* feat: oneInchWallet

* fix: 1inch svg

* fix: bitverse, bybit

---------

Co-authored-by: Magomed Khamidov <[email protected]>
Co-authored-by: Daniel Sinclair <[email protected]>
  • Loading branch information
3 people authored Mar 27, 2024
1 parent 34419b5 commit 5c60239
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changeset/tidy-shrimps-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@rainbow-me/rainbowkit": patch
"example": patch
"site": patch
---

Added 1inch Wallet support with `oneInchWallet` wallet connector
2 changes: 2 additions & 0 deletions packages/example/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {
oktoWallet,
okxWallet,
omniWallet,
oneInchWallet,
oneKeyWallet,
phantomWallet,
rabbyWallet,
Expand Down Expand Up @@ -176,6 +177,7 @@ const config = getDefaultConfig({
oktoWallet,
okxWallet,
omniWallet,
oneInchWallet,
oneKeyWallet,
phantomWallet,
rabbyWallet,
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 @@ -649,6 +649,23 @@
}
},

"1inch": {
"qr_code": {
"step1": {
"description": "Put 1inch Wallet on your home screen for faster access to your wallet.",
"title": "Open the 1inch Wallet app"
},
"step2": {
"description": "Create a wallet and username, or import an existing wallet.",
"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 QR button"
}
}
},

"token_pocket": {
"qr_code": {
"step1": {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ -25,6 +25,7 @@ import { mewWallet } from './mewWallet/mewWallet';
import { oktoWallet } from './oktoWallet/oktoWallet';
import { okxWallet } from './okxWallet/okxWallet';
import { omniWallet } from './omniWallet/omniWallet';
import { oneInchWallet } from './oneInchWallet/oneInchWallet';
import { oneKeyWallet } from './oneKeyWallet/oneKeyWallet';
import { phantomWallet } from './phantomWallet/phantomWallet';
import { rabbyWallet } from './rabbyWallet/rabbyWallet';
Expand Down Expand Up @@ -74,6 +75,7 @@ export {
oktoWallet,
okxWallet,
omniWallet,
oneInchWallet,
oneKeyWallet,
phantomWallet,
rabbyWallet,
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,50 @@
import { DefaultWalletOptions, Wallet } from '../../Wallet';
import { getWalletConnectConnector } from '../../getWalletConnectConnector';

export type OneInchWalletOptions = DefaultWalletOptions;

export const oneInchWallet = ({
projectId,
walletConnectParameters,
}: OneInchWalletOptions): Wallet => ({
id: '1inch',
name: '1inch Wallet',
iconUrl: async () => (await import('./oneInchWallet.svg')).default,
iconBackground: '#fff',
downloadUrls: {
android: 'https://play.google.com/store/apps/details?id=io.oneinch.android',
ios: 'https://apps.apple.com/us/app/1inch-crypto-defi-wallet/id1546049391',
mobile: 'https://1inch.io/wallet',
qrCode: 'https://1inch.io/wallet',
},
mobile: {
getUri: (uri: string) => `oneinch://wc?uri=${encodeURIComponent(uri)}`,
},
qrCode: {
getUri: (uri: string) => uri,
instructions: {
learnMoreUrl: 'https://1inch.io/wallet',
steps: [
{
description: 'wallet_connectors.1inch.qr_code.step1.description',
step: 'install',
title: 'wallet_connectors.1inch.qr_code.step1.title',
},
{
description: 'wallet_connectors.1inch.qr_code.step2.description',
step: 'create',
title: 'wallet_connectors.1inch.qr_code.step2.title',
},
{
description: 'wallet_connectors.1inch.qr_code.step3.description',
step: 'scan',
title: 'wallet_connectors.1inch.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 @@ -236,6 +236,12 @@ import { okxWallet } from '@rainbow-me/rainbowkit/wallets';
import { omniWallet } from '@rainbow-me/rainbowkit/wallets';
```

#### 1inch Wallet

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

#### OneKey

```tsx
Expand Down

0 comments on commit 5c60239

Please sign in to comment.