Skip to content

Commit 17dd23b

Browse files
feat: add rainbow wallet (#1475)
* feat: rainbow injected provider support * bumped @web3-onboard/injected-wallets version * version bumpies Co-authored-by: Taylor Dawson <taylorjdawson@gmail.com>
1 parent c5988e7 commit 17dd23b

File tree

11 files changed

+91
-11
lines changed

11 files changed

+91
-11
lines changed

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"@web3-onboard/fortmatic": "^2.0.14",
6262
"@web3-onboard/gas": "^2.1.4",
6363
"@web3-onboard/gnosis": "^2.1.5",
64-
"@web3-onboard/injected-wallets": "^2.4.0",
64+
"@web3-onboard/injected-wallets": "^2.6.1-alpha.1",
6565
"@web3-onboard/keepkey": "^2.3.2",
6666
"@web3-onboard/keystone": "^2.3.2",
6767
"@web3-onboard/ledger": "^2.4.1",

examples/with-nextjs-13/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@web3-onboard/dcent": "^2.2.1",
1717
"@web3-onboard/fortmatic": "^2.0.14",
1818
"@web3-onboard/gnosis": "^2.1.3",
19-
"@web3-onboard/injected-wallets": "^2.2.4",
19+
"@web3-onboard/injected-wallets": "^2.6.1-alpha.1",
2020
"@web3-onboard/keepkey": "^2.3.1",
2121
"@web3-onboard/keystone": "^2.3.1",
2222
"@web3-onboard/ledger": "^2.3.1",

examples/with-vite-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@web3-onboard/dcent": "^2.2.1",
1414
"@web3-onboard/fortmatic": "^2.0.14",
1515
"@web3-onboard/gnosis": "^2.1.5",
16-
"@web3-onboard/injected-wallets": "^2.2.4",
16+
"@web3-onboard/injected-wallets": "^2.6.1-alpha.1",
1717
"@web3-onboard/keepkey": "^2.3.1",
1818
"@web3-onboard/keystone": "^2.3.1",
1919
"@web3-onboard/ledger": "^2.3.1",

examples/with-vuejs-v2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"serve": "vite preview"
88
},
99
"dependencies": {
10-
"@web3-onboard/injected-wallets": "^2.2.0",
10+
"@web3-onboard/injected-wallets": "^2.6.1-alpha.1",
1111
"@web3-onboard/vue": "^2.3.1",
1212
"vue": "^2.6.12",
1313
"vue-template-compiler": "^2.7.10"

examples/with-vuejs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
99
},
1010
"dependencies": {
11-
"@web3-onboard/injected-wallets": "^2.0.15",
11+
"@web3-onboard/injected-wallets": "^2.6.1-alpha.1",
1212
"@web3-onboard/vue": "^2.3.1",
1313
"pinia": "^2.0.16",
1414
"vue": "^3.2.37",

packages/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"@web3-onboard/keepkey": "^2.3.3-alpha.2",
3535
"@web3-onboard/keystone": "^2.3.3-alpha.2",
3636
"@web3-onboard/ledger": "^2.4.2-alpha.1",
37-
"@web3-onboard/injected-wallets": "^2.6.0",
37+
"@web3-onboard/injected-wallets": "^2.6.1-alpha.1",
3838
"@web3-onboard/magic": "^2.1.3",
3939
"@web3-onboard/phantom": "^2.0.0-alpha.1",
4040
"@web3-onboard/portis": "^2.1.3",

packages/injected/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/injected-wallets",
3-
"version": "2.6.0",
3+
"version": "2.6.1-alpha.1",
44
"description": "Injected wallet module for connecting browser extension and mobile wallets to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",

packages/injected/src/constants.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ export const WALLET_NAMES: { [key: string]: string } = {
1818
core: 'Core',
1919
enkrypt: 'Enkrypt',
2020
frontier: 'Frontier',
21-
zerion: 'Zerion'
21+
zerion: 'Zerion',
22+
rainbow: 'Rainbow'
2223
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
export default `
2+
<svg width="100%" height="100%" viewBox="0 0 120 120" fill="none" xmlns="http://www.w3.org/2000/svg">
3+
<g clip-path="url(#clip0_1_19)">
4+
<mask id="mask0_1_19" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="120" height="120">
5+
<circle cx="60" cy="60" r="60" fill="#D9D9D9"/>
6+
</mask>
7+
<g mask="url(#mask0_1_19)">
8+
<rect width="120" height="120" fill="url(#paint0_linear_1_19)"/>
9+
</g>
10+
<path d="M26.6667 41.6667H31.6667C57.44 41.6667 78.3333 62.56 78.3333 88.3333V93.3333H88.3333C91.0948 93.3333 93.3333 91.0947 93.3333 88.3333C93.3333 54.2758 65.7242 26.6667 31.6667 26.6667C28.9052 26.6667 26.6667 28.9052 26.6667 31.6667V41.6667Z" fill="url(#paint1_radial_1_19)"/>
11+
<path d="M80 88.3333H93.3333C93.3333 91.0948 91.0947 93.3333 88.3333 93.3333H80V88.3333Z" fill="url(#paint2_linear_1_19)"/>
12+
<path d="M31.6667 26.6667L31.6667 40H26.6667L26.6667 31.6667C26.6667 28.9052 28.9052 26.6667 31.6667 26.6667Z" fill="url(#paint3_linear_1_19)"/>
13+
<path d="M26.6666 40H31.6666C58.3604 40 80 61.6396 80 88.3333V93.3333H65V88.3333C65 69.9238 50.0761 55 31.6666 55H26.6666V40Z" fill="url(#paint4_radial_1_19)"/>
14+
<path d="M66.6666 88.3333H80V93.3333H66.6666V88.3333Z" fill="url(#paint5_linear_1_19)"/>
15+
<path d="M26.6666 53.3333L26.6666 40L31.6666 40L31.6666 53.3333H26.6666Z" fill="url(#paint6_linear_1_19)"/>
16+
<path d="M26.6666 61.6667C26.6666 64.4281 28.9052 66.6667 31.6666 66.6667C43.6328 66.6667 53.3333 76.3672 53.3333 88.3333C53.3333 91.0948 55.5719 93.3333 58.3333 93.3333H66.6666V88.3333C66.6666 69.0034 50.9966 53.3333 31.6666 53.3333H26.6666V61.6667Z" fill="url(#paint7_radial_1_19)"/>
17+
<path d="M53.3333 88.3333H66.6666V93.3333H58.3333C55.5719 93.3333 53.3333 91.0948 53.3333 88.3333Z" fill="url(#paint8_radial_1_19)"/>
18+
<path d="M31.6666 66.6667C28.9052 66.6667 26.6666 64.4281 26.6666 61.6667L26.6666 53.3333L31.6666 53.3333L31.6666 66.6667Z" fill="url(#paint9_radial_1_19)"/>
19+
</g>
20+
<defs>
21+
<linearGradient id="paint0_linear_1_19" x1="60" y1="0" x2="60" y2="120" gradientUnits="userSpaceOnUse">
22+
<stop stop-color="#174299"/>
23+
<stop offset="1" stop-color="#001E59"/>
24+
</linearGradient>
25+
<radialGradient id="paint1_radial_1_19" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(31.6667 88.3333) rotate(-90) scale(61.6667)">
26+
<stop offset="0.770277" stop-color="#FF4000"/>
27+
<stop offset="1" stop-color="#8754C9"/>
28+
</radialGradient>
29+
<linearGradient id="paint2_linear_1_19" x1="79.1666" y1="90.8333" x2="93.3333" y2="90.8333" gradientUnits="userSpaceOnUse">
30+
<stop stop-color="#FF4000"/>
31+
<stop offset="1" stop-color="#8754C9"/>
32+
</linearGradient>
33+
<linearGradient id="paint3_linear_1_19" x1="29.1667" y1="26.6667" x2="29.1667" y2="40.8333" gradientUnits="userSpaceOnUse">
34+
<stop stop-color="#8754C9"/>
35+
<stop offset="1" stop-color="#FF4000"/>
36+
</linearGradient>
37+
<radialGradient id="paint4_radial_1_19" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(31.6666 88.3333) rotate(-90) scale(48.3333)">
38+
<stop offset="0.723929" stop-color="#FFF700"/>
39+
<stop offset="1" stop-color="#FF9901"/>
40+
</radialGradient>
41+
<linearGradient id="paint5_linear_1_19" x1="66.6666" y1="90.8333" x2="80" y2="90.8333" gradientUnits="userSpaceOnUse">
42+
<stop stop-color="#FFF700"/>
43+
<stop offset="1" stop-color="#FF9901"/>
44+
</linearGradient>
45+
<linearGradient id="paint6_linear_1_19" x1="29.1666" y1="53.3333" x2="29.1666" y2="40" gradientUnits="userSpaceOnUse">
46+
<stop stop-color="#FFF700"/>
47+
<stop offset="1" stop-color="#FF9901"/>
48+
</linearGradient>
49+
<radialGradient id="paint7_radial_1_19" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(31.6666 88.3333) rotate(-90) scale(35)">
50+
<stop offset="0.59513" stop-color="#00AAFF"/>
51+
<stop offset="1" stop-color="#01DA40"/>
52+
</radialGradient>
53+
<radialGradient id="paint8_radial_1_19" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(52.5 90.8333) scale(14.1667 37.7778)">
54+
<stop stop-color="#00AAFF"/>
55+
<stop offset="1" stop-color="#01DA40"/>
56+
</radialGradient>
57+
<radialGradient id="paint9_radial_1_19" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(29.1666 67.5) rotate(-90) scale(14.1667 268.642)">
58+
<stop stop-color="#00AAFF"/>
59+
<stop offset="1" stop-color="#01DA40"/>
60+
</radialGradient>
61+
<clipPath id="clip0_1_19">
62+
<rect width="120" height="120" fill="white"/>
63+
</clipPath>
64+
</defs>
65+
</svg>
66+
`

packages/injected/src/types.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ export enum ProviderIdentityFlag {
5353
Enkrypt = 'isEnkrypt',
5454
Zeal = 'isZeal',
5555
Phantom = 'isPhantom',
56-
Zerion = 'isZerion'
56+
Zerion = 'isZerion',
57+
Rainbow = 'isRainbow'
5758
}
5859

5960
export enum ProviderLabel {
@@ -97,7 +98,8 @@ export enum ProviderLabel {
9798
Enkrypt = 'Enkrypt',
9899
Zeal = 'Zeal',
99100
Phantom = 'Phantom',
100-
Zerion = 'Zerion'
101+
Zerion = 'Zerion',
102+
Rainbow = 'Rainbow'
101103
}
102104

103105
export interface MeetOneProvider extends ExternalProvider {

packages/injected/src/wallets.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,16 @@ const phantom: InjectedWalletModule = {
660660
platforms: ['all']
661661
}
662662

663+
const rainbow: InjectedWalletModule = {
664+
label: ProviderLabel.Rainbow,
665+
injectedNamespace: InjectedNameSpace.Ethereum,
666+
checkProviderIdentity: ({ provider }) =>
667+
!!provider && !!provider[ProviderIdentityFlag.Rainbow],
668+
getIcon: async () => (await import('./icons/rainbow.js')).default,
669+
getInterface: getInjectedInterface(ProviderIdentityFlag.Rainbow),
670+
platforms: ['all']
671+
}
672+
663673
const wallets = [
664674
zeal,
665675
exodus,
@@ -699,7 +709,8 @@ const wallets = [
699709
bitski,
700710
enkrypt,
701711
phantom,
702-
zerion
712+
zerion,
713+
rainbow
703714
]
704715

705716
export default wallets

0 commit comments

Comments
 (0)