Skip to content

Commit 31a107f

Browse files
0xfaihaiAdamj1232
andauthored
feat: add BitKeep (#1177)
* feat: add BitKeep * Update version and bitkeep window provider Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com>
1 parent af5a09f commit 31a107f

File tree

5 files changed

+32
-7
lines changed

5 files changed

+32
-7
lines changed

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.0.15-alpha.2",
3+
"version": "2.0.15-alpha.3",
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
@@ -11,5 +11,6 @@ export const WALLET_NAMES: { [key: string]: string } = {
1111
metamask: 'MetaMask',
1212
detected: 'Detected Wallet',
1313
meetone: 'MeetOne',
14-
frame: 'Frame'
14+
frame: 'Frame',
15+
bitkeep: 'BitKeep',
1516
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default `<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
2+
<path d="M18 0C27.942 0 36 8.05967 36 18C36 27.942 27.942 36 18 36C8.05967 36 0 27.9413 0 18C0 8.05967 8.05967 0 18 0Z" fill="#7524F9"/>
3+
<path fill-rule="evenodd" clip-rule="evenodd" d="M28 13.1817V14.2863C28.0002 14.3931 27.9714 14.4981 27.9165 14.5907C27.8616 14.6833 27.7826 14.7601 27.6875 14.8135L24.0242 16.8686L27.2969 18.6995C27.5108 18.8196 27.6884 18.9924 27.8118 19.2005C27.9353 19.4085 28.0002 19.6445 28 19.8847V22.8302C28.0003 23.0705 27.9355 23.3066 27.812 23.5148C27.6886 23.723 27.5109 23.8959 27.2969 24.0161L18.6898 28.8168C18.4761 28.9368 18.2336 29 17.9867 29C17.7399 29 17.4974 28.9368 17.2836 28.8168L14.4672 27.235C14.4196 27.2084 14.3802 27.17 14.3527 27.1238C14.3253 27.0776 14.3108 27.0252 14.3108 26.9718C14.3108 26.9184 14.3253 26.866 14.3527 26.8198C14.3802 26.7736 14.4196 26.7352 14.4672 26.7086L23.7641 21.5052C23.7877 21.4918 23.8074 21.4727 23.8211 21.4496C23.8347 21.4265 23.8419 21.4004 23.8419 21.3738C23.8419 21.3472 23.8347 21.321 23.8211 21.2979C23.8074 21.2749 23.7877 21.2557 23.7641 21.2423L20.3125 19.3035C20.2175 19.2502 20.1097 19.2221 20 19.2221C19.8903 19.2221 19.7825 19.2502 19.6875 19.3035L10.2445 24.5927C10.1733 24.6327 10.0924 24.6538 10.0102 24.6538C9.92788 24.6538 9.84704 24.6327 9.77578 24.5927L8.70625 23.9979C8.4913 23.8779 8.31277 23.7048 8.18875 23.4961C8.06472 23.2875 7.99961 23.0507 8 22.8096V21.6055C7.99995 21.5254 8.02158 21.4468 8.06273 21.3774C8.10387 21.3081 8.16307 21.2505 8.23438 21.2104L21.7734 13.6443C21.7971 13.631 21.8168 13.6118 21.8304 13.5887C21.8441 13.5657 21.8513 13.5395 21.8513 13.5129C21.8513 13.4863 21.8441 13.4601 21.8304 13.4371C21.8168 13.414 21.7971 13.3948 21.7734 13.3815L18.3164 11.4358C18.2214 11.3825 18.1136 11.3544 18.0039 11.3544C17.8942 11.3544 17.7864 11.3825 17.6914 11.4358L8.46875 16.5936C8.42127 16.6202 8.36741 16.6343 8.31258 16.6343C8.25775 16.6343 8.20389 16.6203 8.15639 16.5937C8.10889 16.567 8.06944 16.5287 8.04199 16.4826C8.01454 16.4364 8.00006 16.384 8 16.3307V13.1672C7.99971 12.9269 8.06454 12.6907 8.18798 12.4825C8.31142 12.2743 8.4891 12.1015 8.70313 11.9813L17.3086 7.18212C17.5219 7.0628 17.7637 7 18.0098 7C18.2558 7 18.4976 7.0628 18.7109 7.18212L27.2969 11.998C27.5106 12.118 27.688 12.2905 27.8114 12.4983C27.9349 12.706 27.9999 12.9417 28 13.1817Z" fill="white"/>
4+
</svg>
5+
`

packages/injected/src/types.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ export enum ProviderIdentityFlag {
4343
BraveWallet = 'isBraveWallet',
4444
Rabby = 'isRabby',
4545
MathWallet = 'isMathWallet',
46-
GameStop = 'isGamestop'
46+
GameStop = 'isGamestop',
47+
BitKeep = 'isBitKeep'
4748
}
4849

4950
export enum ProviderLabel {
@@ -78,7 +79,8 @@ export enum ProviderLabel {
7879
Tally = 'Tally Wallet',
7980
Rabby = 'Rabby',
8081
MathWallet = 'MathWallet',
81-
GameStop = 'GameStop Wallet'
82+
GameStop = 'GameStop Wallet',
83+
BitKeep = 'BitKeep'
8284
}
8385

8486
export interface MeetOneProvider extends ExternalProvider {
@@ -98,7 +100,8 @@ export enum InjectedNameSpace {
98100
Web3 = 'web3',
99101
Arbitrum = 'arbitrum',
100102
XFI = 'xfi',
101-
GameStop = 'gamestop'
103+
GameStop = 'gamestop',
104+
BitKeep = 'bitkeep'
102105
}
103106

104107
export interface CustomWindow extends Window {
@@ -110,7 +113,10 @@ export interface CustomWindow extends Window {
110113
xfi: {
111114
ethereum: InjectedProvider
112115
}
113-
gamestop: InjectedProvider
116+
gamestop: InjectedProvider,
117+
bitkeep: {
118+
ethereum: InjectedProvider
119+
}
114120
}
115121

116122
export type InjectedProvider = ExternalProvider &

packages/injected/src/wallets.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,18 @@ const gamestop: InjectedWalletModule = {
508508
platforms: ['desktop']
509509
}
510510

511+
const bitkeep: InjectedWalletModule = {
512+
label: ProviderLabel.BitKeep,
513+
injectedNamespace: InjectedNameSpace.BitKeep,
514+
checkProviderIdentity: ({ provider }) =>
515+
!!provider && !!provider["ethereum"][ProviderIdentityFlag.BitKeep],
516+
getIcon: async () => (await import('./icons/bitkeep.js')).default,
517+
getInterface: async () => ({
518+
provider: window.bitkeep && window.bitkeep.ethereum,
519+
}),
520+
platforms: ['all']
521+
}
522+
511523
const wallets = [
512524
exodus,
513525
metamask,
@@ -538,7 +550,8 @@ const wallets = [
538550
tally,
539551
rabby,
540552
mathwallet,
541-
gamestop
553+
gamestop,
554+
bitkeep
542555
]
543556

544557
export default wallets

0 commit comments

Comments
 (0)