Skip to content

Commit 40c8cb3

Browse files
committed
Add to injected
1 parent 2787f8c commit 40c8cb3

File tree

6 files changed

+74
-7
lines changed

6 files changed

+74
-7
lines changed

packages/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"@web3-onboard/gas": "^2.2.1",
4545
"@web3-onboard/gnosis": "^2.3.1",
4646
"@web3-onboard/infinity-wallet": "^2.1.1",
47-
"@web3-onboard/injected-wallets": "^2.11.1",
47+
"@web3-onboard/injected-wallets": "^2.11.2-alpha.2",
4848
"@web3-onboard/keepkey": "^2.3.8",
4949
"@web3-onboard/keplr": "2.0.0-alpha.1",
5050
"@web3-onboard/keystone": "^2.3.8",

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.11.2-alpha.1",
3+
"version": "2.11.2-alpha.2",
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/icons/keplr.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
export default `
2+
<svg width="42" height="42" viewBox="0 0 42 42" fill="none"
3+
xmlns="http://www.w3.org/2000/svg">
4+
<g clip-path="url(#clip0_425_5107)">
5+
<path d="M32.4545 0H9.54545C4.27365 0 0 4.27365 0 9.54545V32.4545C0 37.7264 4.27365 42 9.54545 42H32.4545C37.7264 42 42 37.7264 42 32.4545V9.54545C42 4.27365 37.7264 0 32.4545 0Z" fill="url(#paint0_linear_425_5107)"/>
6+
<path d="M32.4545 0H9.54545C4.27365 0 0 4.27365 0 9.54545V32.4545C0 37.7264 4.27365 42 9.54545 42H32.4545C37.7264 42 42 37.7264 42 32.4545V9.54545C42 4.27365 37.7264 0 32.4545 0Z" fill="url(#paint1_radial_425_5107)"/>
7+
<path d="M32.4545 0H9.54545C4.27365 0 0 4.27365 0 9.54545V32.4545C0 37.7264 4.27365 42 9.54545 42H32.4545C37.7264 42 42 37.7264 42 32.4545V9.54545C42 4.27365 37.7264 0 32.4545 0Z" fill="url(#paint2_radial_425_5107)"/>
8+
<path d="M32.4545 0H9.54545C4.27365 0 0 4.27365 0 9.54545V32.4545C0 37.7264 4.27365 42 9.54545 42H32.4545C37.7264 42 42 37.7264 42 32.4545V9.54545C42 4.27365 37.7264 0 32.4545 0Z" fill="url(#paint3_radial_425_5107)"/>
9+
<path d="M17.2526 32.2614V22.5192L26.7185 32.2614H31.9849V32.0079L21.0964 20.9122L31.1469 10.3857V10.2614H25.8464L17.2526 19.5635V10.2614H12.9849V32.2614H17.2526Z" fill="white"/>
10+
</g>
11+
<defs>
12+
<linearGradient id="paint0_linear_425_5107" x1="21" y1="0" x2="21" y2="42" gradientUnits="userSpaceOnUse">
13+
<stop stop-color="#1FD1FF"/>
14+
<stop offset="1" stop-color="#1BB8FF"/>
15+
</linearGradient>
16+
<radialGradient id="paint1_radial_425_5107" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(2.00623 40.4086) rotate(-45.1556) scale(67.3547 68.3624)">
17+
<stop stop-color="#232DE3"/>
18+
<stop offset="1" stop-color="#232DE3" stop-opacity="0"/>
19+
</radialGradient>
20+
<radialGradient id="paint2_radial_425_5107" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(39.7379 41.7602) rotate(-138.45) scale(42.1137 64.2116)">
21+
<stop stop-color="#8B4DFF"/>
22+
<stop offset="1" stop-color="#8B4DFF" stop-opacity="0"/>
23+
</radialGradient>
24+
<radialGradient id="paint3_radial_425_5107" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(20.6501 0.311498) rotate(90) scale(33.1135 80.3423)">
25+
<stop stop-color="#24D5FF"/>
26+
<stop offset="1" stop-color="#1BB8FF" stop-opacity="0"/>
27+
</radialGradient>
28+
<clipPath id="clip0_425_5107">
29+
<rect width="42" height="42" fill="white"/>
30+
</clipPath>
31+
</defs>
32+
</svg>
33+
`

packages/injected/src/types.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ export enum ProviderIdentityFlag {
7171
Lif3Wallet = 'isLif3Wallet',
7272
ZodiacPilot = 'isZodiacPilot',
7373
StableWallet = 'isStableWallet',
74-
Echooo = 'isEchooo'
74+
Echooo = 'isEchooo',
75+
Keplr = 'keplr'
7576
}
7677

7778
/**
@@ -101,7 +102,8 @@ export enum ProviderExternalUrl {
101102
Lif3Wallet = 'https://lif3.com',
102103
Rabby = 'https://rabby.io',
103104
ZodiacPilot = 'https://pilot.gnosisguild.org/',
104-
Echooo = 'https://www.echooo.xyz'
105+
Echooo = 'https://www.echooo.xyz',
106+
Keplr = 'https://www.keplr.app/download'
105107
}
106108

107109
export enum ProviderLabel {
@@ -164,7 +166,8 @@ export enum ProviderLabel {
164166
Lif3Wallet = 'Lif3 Wallet',
165167
ZodiacPilot = 'Zodiac Pilot',
166168
StableWallet = 'StableWallet',
167-
Echooo = 'Echooo'
169+
Echooo = 'Echooo',
170+
Keplr = 'Keplr'
168171
}
169172

170173
export interface MeetOneProvider extends ExternalProvider {
@@ -291,7 +294,7 @@ export interface InjectedWalletOptions {
291294
walletUnavailableMessage?: (wallet: WalletModule) => string
292295
/**Function that can be used to sort the order of wallets that are displayed */
293296
sort?: (wallets: WalletModule[]) => WalletModule[]
294-
/** A boolean that can be passed to disable supporting 6963 (https://eips.ethereum.org/EIPS/eip-6963)
297+
/** A boolean that can be passed to disable supporting 6963 (https://eips.ethereum.org/EIPS/eip-6963)
295298
* which will display wallets available on the browser
296299
*/
297300
disable6963Support?: boolean

packages/injected/src/wallets.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,17 @@ const echooo: InjectedWalletModule = {
920920
externalUrl: ProviderExternalUrl.Echooo
921921
}
922922

923+
const keplr: InjectedWalletModule = {
924+
label: ProviderLabel.Keplr,
925+
injectedNamespace: InjectedNameSpace.Ethereum,
926+
checkProviderIdentity: ({ provider }) =>
927+
!!provider && !!provider[ProviderIdentityFlag.Keplr],
928+
getIcon: async () => (await import('./icons/keplr.js')).default,
929+
getInterface: getInjectedInterface(ProviderIdentityFlag.Keplr),
930+
platforms: ['all'],
931+
externalUrl: ProviderExternalUrl.Keplr
932+
}
933+
923934
const wallets = [
924935
zeal,
925936
exodus,
@@ -978,7 +989,8 @@ const wallets = [
978989
Lif3Wallet,
979990
zodiacPilot,
980991
stablewallet,
981-
echooo
992+
echooo,
993+
keplr
982994
]
983995

984996
export default wallets

yarn.lock

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5529,6 +5529,25 @@
55295529
dependencies:
55305530
"@web3-onboard/common" "^2.4.1"
55315531

5532+
"@web3-onboard/passport@^2.1.1":
5533+
version "2.1.1"
5534+
resolved "https://registry.yarnpkg.com/@web3-onboard/passport/-/passport-2.1.1.tgz#4a3421803f174197160a3ea3e30e1c3cf7f47790"
5535+
integrity sha512-73kAE6KPBNYi+b67ziA5EGzRBY6foN7NHINmk25hMnivBzUiyXvSvV85V35wH7EnWfzUlHvihFmd0fFurQuE6A==
5536+
dependencies:
5537+
"@0xpass/passport" "2.1.1"
5538+
"@0xpass/passport-viem" "2.0.1"
5539+
"@web3-onboard/common" "^2.4.1"
5540+
crypto-js "^4.2.0"
5541+
react-dom "^18.2.0"
5542+
viem "^2.9.4"
5543+
5544+
"@web3-onboard/trust@^2.1.1":
5545+
version "2.1.1"
5546+
resolved "https://registry.yarnpkg.com/@web3-onboard/trust/-/trust-2.1.1.tgz#334d3c8297249193516aa9e3847b87ba02039863"
5547+
integrity sha512-NvSfJ4a7SpHwiVLsAQQq6j4cj5V8HqRfX9hreJcjpvixWK0TtUMkFVbdU5QnnhBaU6gUe+WUva64i0SeRSpYRg==
5548+
dependencies:
5549+
"@web3-onboard/common" "^2.4.1"
5550+
55325551
"@web3-onboard/wagmi@2.0.0":
55335552
version "2.0.0"
55345553
resolved "https://registry.yarnpkg.com/@web3-onboard/wagmi/-/wagmi-2.0.0.tgz#9beda01b4539d399aa0420e7afaacc09fc25ed7d"

0 commit comments

Comments
 (0)