Skip to content

Commit 05a3868

Browse files
Integrating StableWallet into InjectedWallet (#2116)
* feature: Integrating StableWallet into onboard * Integrating StableWallet into InjectedWallet * bump the alpha version within the injected/package.json * update injected version * Update docs/package.json Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com> * Update packages/demo/package.json Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com> * Update packages/injected/package.json Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com> --------- Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com>
1 parent 2fa8181 commit 05a3868

File tree

7 files changed

+37
-6
lines changed

7 files changed

+37
-6
lines changed

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"@web3-onboard/gas": "^2.1.8",
6868
"@web3-onboard/gnosis": "^2.1.10",
6969
"@web3-onboard/infinity-wallet": "^2.0.4",
70-
"@web3-onboard/injected-wallets": "^2.10.15",
70+
"@web3-onboard/injected-wallets": "^2.10.16-alpha.1",
7171
"@web3-onboard/keepkey": "^2.3.7",
7272
"@web3-onboard/keystone": "^2.3.7",
7373
"@web3-onboard/ledger": "^2.6.0",

docs/src/routes/docs/[...4]wallets/[...14]injected/+page.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ const injected = injectedModule({
375375
- SubWallet - _Desktop & Mobile_
376376
- Kayros - _Desktop_
377377
- Lif3Wallet - _Mobile_
378+
- StableWallet - _Mobile_
378379

379380
## Build Environments
380381

packages/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"@web3-onboard/gas": "^2.1.7",
4343
"@web3-onboard/gnosis": "^2.2.1",
4444
"@web3-onboard/infinity-wallet": "^2.0.3",
45-
"@web3-onboard/injected-wallets": "^2.10.14",
45+
"@web3-onboard/injected-wallets": "^2.10.16-alpha.1",
4646
"@web3-onboard/keepkey": "^2.3.8",
4747
"@web3-onboard/keystone": "^2.3.8",
4848
"@web3-onboard/ledger": "^2.6.0",

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.10.15",
3+
"version": "2.10.16-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",
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export default `<svg width="1024" height="1024" viewBox="0 0 1024 1024" fill="none" xmlns="http://www.w3.org/2000/svg">
2+
<g clip-path="url(#clip0_3620_3151)">
3+
<path d="M0 0H1024V1024H0V0Z" fill="url(#paint0_linear_3620_3151)"/>
4+
<path fill-rule="evenodd" clip-rule="evenodd" d="M354.295 862.225C402.408 883.923 455.794 895.999 512.001 895.999C568.205 895.999 621.588 883.924 669.699 862.227L670.03 862.078C705.371 846.099 737.86 824.927 766.525 799.534C827.689 745.352 871.439 671.955 888.319 588.799C888.913 585.869 889.475 582.927 890.002 579.974C893.943 557.911 896 535.195 896 511.999C896 499.04 895.358 486.229 894.104 473.599C882.939 361.151 823.266 262.972 736.305 200.287C705.668 178.202 671.643 160.522 635.16 148.176C596.5 135.093 555.079 128 512.001 128C469.477 128 428.567 134.912 390.335 147.674C368.981 154.802 348.462 163.754 328.964 174.347C314.631 182.133 300.848 190.805 287.691 200.29C200.733 262.976 141.062 361.153 129.897 473.599C128.643 486.229 128 499.039 128 511.999C128 538.301 130.644 563.985 135.681 588.799C152.561 671.952 196.31 745.348 257.471 799.53C280.748 820.15 306.547 837.988 334.347 852.521C340.783 855.886 347.327 859.074 353.971 862.078C354.079 862.127 354.187 862.176 354.295 862.225ZM678.113 473.599L836.165 473.599C825.482 382.445 777.24 302.772 707.33 250.473L628.391 387.2C576.66 476.799 447.334 476.799 395.604 387.2L316.667 250.477C246.759 302.776 198.519 382.447 187.836 473.599H345.881C449.342 473.599 514.005 585.599 462.275 675.199L383.273 812.034C422.77 829.002 466.288 838.399 512.001 838.399C557.711 838.399 601.227 829.003 640.722 812.036L561.719 675.199C509.988 585.599 574.652 473.599 678.113 473.599ZM286.973 748.431L362.509 617.599C369.899 604.799 360.661 588.799 345.881 588.799H194.688C209.638 650.789 242.28 705.88 286.973 748.431ZM678.113 588.799L829.314 588.799C814.363 650.791 781.718 705.885 737.023 748.435L661.485 617.599C654.095 604.799 663.332 588.799 678.113 588.799ZM419.847 198.79C449.071 190.206 479.998 185.6 512.001 185.6C544.001 185.6 574.926 190.205 604.149 198.789L528.625 329.6C521.235 342.4 502.76 342.4 495.37 329.6L419.847 198.79Z" fill="white"/>
5+
</g>
6+
<defs>
7+
<linearGradient id="paint0_linear_3620_3151" x1="1024" y1="0" x2="0" y2="1024" gradientUnits="userSpaceOnUse">
8+
<stop stop-color="#26D3A6"/>
9+
<stop offset="0.598026" stop-color="#36A2CB"/>
10+
<stop offset="1" stop-color="#4C62FD"/>
11+
</linearGradient>
12+
<clipPath id="clip0_3620_3151">
13+
<rect width="1024" height="1024" fill="white"/>
14+
</clipPath>
15+
</defs>
16+
</svg>
17+
`

packages/injected/src/types.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ export enum ProviderIdentityFlag {
6868
SubWallet = 'isSubWallet',
6969
Kayros = 'isKayros',
7070
FoxWallet = 'isFoxWallet',
71-
Lif3Wallet = 'isLif3Wallet'
71+
Lif3Wallet = 'isLif3Wallet',
72+
StableWallet = 'isStableWallet',
7273
}
7374

7475
/**
@@ -156,7 +157,8 @@ export enum ProviderLabel {
156157
SubWallet = 'SubWallet',
157158
Kayros = 'Kayros',
158159
FoxWallet = 'FoxWallet',
159-
Lif3Wallet = 'Lif3 Wallet'
160+
Lif3Wallet = 'Lif3 Wallet',
161+
StableWallet = 'StableWallet',
160162
}
161163

162164
export interface MeetOneProvider extends ExternalProvider {

packages/injected/src/wallets.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,16 @@ const Lif3Wallet: InjectedWalletModule = {
886886
platforms: ['mobile']
887887
}
888888

889+
const stablewallet: InjectedWalletModule = {
890+
label: ProviderLabel.StableWallet,
891+
injectedNamespace: InjectedNameSpace.Ethereum,
892+
checkProviderIdentity: ({ provider }) =>
893+
!!provider && !!provider[ProviderIdentityFlag.StableWallet],
894+
getIcon: async () => (await import('./icons/stablewallet.js')).default,
895+
getInterface: getInjectedInterface(ProviderIdentityFlag.StableWallet),
896+
platforms: ['mobile']
897+
}
898+
889899
const wallets = [
890900
zeal,
891901
exodus,
@@ -941,7 +951,8 @@ const wallets = [
941951
subwallet,
942952
kayros,
943953
foxwallet,
944-
Lif3Wallet
954+
Lif3Wallet,
955+
stablewallet
945956
]
946957

947958
export default wallets

0 commit comments

Comments
 (0)