Skip to content

Commit 7e1ca7b

Browse files
pzuraqAdamj1232
andauthored
Add the Bitski extension injected provider (#1327)
* Add the Bitski extension injected provider * Update packages/injected/package.json * Bump version in demo package and yarn it Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com>
1 parent cab41b1 commit 7e1ca7b

File tree

6 files changed

+25
-4
lines changed

6 files changed

+25
-4
lines changed

packages/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"@web3-onboard/fortmatic": "^2.0.14",
2929
"@web3-onboard/gas": "^2.1.3",
3030
"@web3-onboard/gnosis": "^2.1.3",
31-
"@web3-onboard/injected-wallets": "^2.2.4",
31+
"@web3-onboard/injected-wallets": "^2.3.0-alpha.1",
3232
"@web3-onboard/keepkey": "^2.3.1",
3333
"@web3-onboard/keystone": "^2.3.1",
3434
"@web3-onboard/ledger": "^2.3.1",

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.2.4",
3+
"version": "2.3.0-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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export const WALLET_NAMES: { [key: string]: string } = {
66
atoken: 'AToken',
77
binance: 'Binance Chain Wallet',
88
bitpie: 'Bitpie',
9+
bitski: 'Bitski',
910
coinbasewallet: 'Coinbase Wallet',
1011
dcentwallet: "D'CENT",
1112
metamask: 'MetaMask',

packages/injected/src/icons/bitski.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="none" xmlns:v="https://vecta.io/nano"><g clip-path="url(#G)"><g clip-path="url(#H)"><path fill="#ff245a" d="M0 0h32v32H0z"/><g filter="url(#B)"><path stroke="url(#D)" stroke-width="16" d="M 8.00001 8.00001 L 24 8 L 24 24 L 8 24 Z"/></g><mask id="A" maskUnits="userSpaceOnUse" x="4" y="4" width="24" height="24" mask-type="alpha"><path fill-rule="evenodd" d="M10.377 8.118l-3.541 3.541c-.266.266-.249.482.017.748l10.872 10.872c.266.266.482.283.748.017l4.971-4.971c2.593-2.593 2.377-5.336.332-7.381-1.463-1.463-2.992-1.995-4.738-1.513-.283.083-.416.05-.549-.083-.049-.049-.088-.106-.139-.179l-.061-.087c-.2-.299-.532-.765-.798-1.031-2.095-2.095-4.771-2.277-7.115.066zm4.572 4.571l-.848.848c-.266.266-.482.249-.748-.017l-.798-.798c-.266-.266-.283-.482-.017-.748l.848-.848c.432-.432 1.047-.482 1.546.017.515.515.449 1.114.017 1.546zm5.436 2.677l-2.227 2.228c-.266.266-.482.249-.748-.017l-.798-.798c-.266-.266-.283-.482-.017-.748l2.228-2.228c.648-.648 1.263-.765 1.795-.233.549.549.416 1.147-.233 1.795zM7.792 17.352a.98.98 0 0 0 0 1.385l6.927 6.927a.98.98 0 0 0 1.385 0 .98.98 0 0 0 0-1.385l-6.927-6.927a.98.98 0 0 0-1.385 0z" fill="#fff"/></mask><g mask="url(#A)"><g filter="url(#C)"><rect x="6.645" y="6.42" width="18.704" height="19.719" rx="9.352" fill="url(#E)"/><rect x="6.645" y="6.42" width="18.704" height="19.719" rx="9.352" fill="url(#F)" fill-opacity=".12"/><rect x="6.645" y="6.42" width="18.704" height="19.719" rx="9.352" fill="#fff" fill-opacity=".2" style="mix-blend-mode:overlay"/></g></g></g></g><defs><filter id="B" x="-100" y="-100" width="232" height="232" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0"/><feBlend in="SourceGraphic"/><feGaussianBlur stdDeviation="50"/></filter><filter id="C" x="-53.355" y="-9.58" width="138.705" height="139.72" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="A"/><feColorMatrix in="SourceAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/><feOffset dy="44"/><feGaussianBlur stdDeviation="30"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.28 0"/><feBlend in2="A"/><feBlend in="SourceGraphic"/></filter><linearGradient id="D" x1="16" y1="0" x2="16" y2="31.594" gradientUnits="userSpaceOnUse"><stop stop-color="#fff" stop-opacity=".5"/><stop offset=".633" stop-color="#e00037"/></linearGradient><linearGradient id="E" x1="15.997" y1="6.42" x2="15.997" y2="26.139" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset=".544" stop-color="#f9f7fa"/><stop offset=".77" stop-color="#f7f7f7"/><stop offset="1" stop-color="#e6e6e6"/></linearGradient><radialGradient id="F" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(15.9967 11.8975) rotate(90) scale(14.2418 13.5087)"><stop offset=".479" stop-color="#fff"/><stop offset="1"/></radialGradient><clipPath id="G"><rect width="32" height="32" rx="8" fill="#fff"/></clipPath><clipPath id="H"><path fill="#fff" d="M0 0h32v32H0z"/></clipPath></defs></svg>`

packages/injected/src/types.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export enum ProviderLabel {
5555
AToken = 'AToken',
5656
Binance = 'Binance Smart Wallet',
5757
Bitpie = 'Bitpie',
58+
Bitski = 'Bitski',
5859
BlockWallet = 'BlockWallet',
5960
Brave = 'Brave Wallet',
6061
Coinbase = 'Coinbase Wallet',
@@ -107,7 +108,8 @@ export enum InjectedNameSpace {
107108
XFI = 'xfi',
108109
GameStop = 'gamestop',
109110
BitKeep = 'bitkeep',
110-
Avalanche = 'avalanche'
111+
Avalanche = 'avalanche',
112+
Bitski = 'Bitski'
111113
}
112114

113115
export interface CustomWindow extends Window {
@@ -124,6 +126,9 @@ export interface CustomWindow extends Window {
124126
ethereum: InjectedProvider
125127
}
126128
avalanche: InjectedProvider
129+
Bitski: {
130+
getProvider(): InjectedProvider
131+
}
127132
}
128133

129134
export type InjectedProvider = ExternalProvider &

packages/injected/src/wallets.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,19 @@ const core: InjectedWalletModule = {
565565
platforms: ['desktop', 'Chrome', 'Chromium', 'Microsoft Edge']
566566
}
567567

568+
const bitski: InjectedWalletModule = {
569+
label: ProviderLabel.Bitski,
570+
injectedNamespace: InjectedNameSpace.Bitski,
571+
checkProviderIdentity: ({ provider }) =>
572+
!!provider && !!provider.getProvider && !!provider.getProvider().isBitski,
573+
getIcon: async () => (await import('./icons/bitski.js')).default,
574+
getInterface: async () => ({
575+
provider:
576+
window.Bitski && window.Bitski.getProvider && window.Bitski.getProvider()
577+
}),
578+
platforms: ['all']
579+
}
580+
568581
const wallets = [
569582
exodus,
570583
metamask,
@@ -598,7 +611,8 @@ const wallets = [
598611
gamestop,
599612
bitkeep,
600613
sequence,
601-
core
614+
core,
615+
bitski
602616
]
603617

604618
export default wallets

0 commit comments

Comments
 (0)