Skip to content

Commit 2e41c97

Browse files
authored
Feature/sequence wallet (#1205)
* sequence integration * fixed types * incremented versions of relevant packages * cleanup, docs update, made sequence option optional * fixed injected provider * added eth_chainId * remove console.log * fix * removed ts-ignore * removed ununsed var
1 parent 748f7d8 commit 2e41c97

File tree

15 files changed

+930
-9
lines changed

15 files changed

+930
-9
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ For full documentation, check out the README.md for each package:
9595
- [Portis](packages/portis/README.md)
9696
- [MEW](packages/mew/README.md)
9797
- [Web3Auth](packages/web3auth/README.md)
98+
- [Sequence](packages/sequence/README.md)
9899

99100
**Hardware Wallets**
100101

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"Injected Wallet",
3737
"GameStop",
3838
"Crypto",
39-
"Crypto Wallet"
39+
"Crypto Wallet",
40+
"Sequence"
4041
],
4142
"repository": {
4243
"type": "git",

packages/demo/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "demo",
3-
"version": "2.0.8",
3+
"version": "2.0.9",
44
"devDependencies": {
55
"assert": "^2.0.0",
66
"buffer": "^6.0.3",
@@ -34,6 +34,7 @@
3434
"@web3-onboard/ledger": "^2.2.0",
3535
"@web3-onboard/magic": "^2.1.0",
3636
"@web3-onboard/portis": "^2.1.0",
37+
"@web3-onboard/sequence": "^1.0.0",
3738
"@web3-onboard/torus": "^2.1.0",
3839
"@web3-onboard/trezor": "^2.2.0",
3940
"@web3-onboard/walletconnect": "^2.1.0",

packages/demo/src/App.svelte

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
import magicModule from '@web3-onboard/magic'
1515
import web3authModule from '@web3-onboard/web3auth'
1616
import gas from '@web3-onboard/gas'
17-
1817
import dcentModule from '@web3-onboard/dcent'
18+
import sequenceModule from '@web3-onboard/sequence'
1919
import {
2020
recoverAddress,
2121
arrayify,
@@ -100,6 +100,8 @@
100100
101101
const dcent = dcentModule()
102102
103+
const sequence = sequenceModule()
104+
103105
const onboard = Onboard({
104106
wallets: [
105107
web3auth,
@@ -115,7 +117,8 @@
115117
portis,
116118
torus,
117119
gnosis,
118-
dcent
120+
dcent,
121+
sequence
119122
],
120123
gas,
121124
chains: [

packages/demo/webpack.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,9 @@ module.exports = {
8282
static: {
8383
directory: path.join(__dirname, 'public')
8484
}
85+
},
86+
performance: {
87+
maxEntrypointSize: 3000000,
88+
maxAssetSize: 3000000
8589
}
8690
}

packages/injected/src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ export const WALLET_NAMES: { [key: string]: string } = {
1313
meetone: 'MeetOne',
1414
frame: 'Frame',
1515
bitkeep: 'BitKeep',
16+
sequence: 'Sequence',
1617
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
export default `
2+
<svg viewBox="0 0 396 318" fill="none" xmlns="http://www.w3.org/2000/svg">
3+
<g clip-path="url(#clip0_5_131)">
4+
<g clip-path="url(#clip1_5_131)">
5+
<path d="M0 67.5049L0 250.165C0 287.447 30.1402 317.67 67.32 317.67H328.68C365.86 317.67 396 287.447 396 250.165V67.5049C396 30.223 365.86 0 328.68 0H67.32C30.1402 0 0 30.223 0 67.5049Z" fill="#111111"/>
6+
<path d="M0 67.5049L0 250.165C0 287.447 30.1402 317.67 67.32 317.67H328.68C365.86 317.67 396 287.447 396 250.165V67.5049C396 30.223 365.86 0 328.68 0H67.32C30.1402 0 0 30.223 0 67.5049Z" fill="url(#paint0_linear_5_131)"/>
7+
<path d="M98.9999 79.4176C98.9999 68.4523 90.1351 59.5632 79.1999 59.5632C68.2647 59.5632 59.3999 68.4523 59.3999 79.4176C59.3999 90.3828 68.2647 99.272 79.1999 99.272C90.1351 99.272 98.9999 90.3828 98.9999 79.4176Z" fill="url(#paint1_linear_5_131)"/>
8+
<path d="M98.9999 79.4176C98.9999 68.4523 90.1351 59.5632 79.1999 59.5632C68.2647 59.5632 59.3999 68.4523 59.3999 79.4176C59.3999 90.3828 68.2647 99.272 79.1999 99.272C90.1351 99.272 98.9999 90.3828 98.9999 79.4176Z" fill="url(#paint2_linear_5_131)"/>
9+
<path d="M98.9999 79.4176C98.9999 68.4523 90.1351 59.5632 79.1999 59.5632C68.2647 59.5632 59.3999 68.4523 59.3999 79.4176C59.3999 90.3828 68.2647 99.272 79.1999 99.272C90.1351 99.272 98.9999 90.3828 98.9999 79.4176Z" fill="url(#paint3_linear_5_131)"/>
10+
<path d="M98.9999 238.126C98.9999 227.161 90.1351 218.272 79.1999 218.272C68.2647 218.272 59.3999 227.161 59.3999 238.126C59.3999 249.092 68.2647 257.981 79.1999 257.981C90.1351 257.981 98.9999 249.092 98.9999 238.126Z" fill="url(#paint4_linear_5_131)"/>
11+
<path d="M336.6 158.835C336.6 147.87 327.735 138.981 316.8 138.981C305.865 138.981 297 147.87 297 158.835C297 169.8 305.865 178.69 316.8 178.69C327.735 178.69 336.6 169.8 336.6 158.835Z" fill="url(#paint5_linear_5_131)"/>
12+
<path d="M336.6 158.835C336.6 147.87 327.735 138.981 316.8 138.981C305.865 138.981 297 147.87 297 158.835C297 169.8 305.865 178.69 316.8 178.69C327.735 178.69 336.6 169.8 336.6 158.835Z" fill="url(#paint6_linear_5_131)"/>
13+
<path d="M316.8 59.5632H158.4C147.465 59.5632 138.6 68.4523 138.6 79.4176C138.6 90.3828 147.465 99.272 158.4 99.272H316.8C327.735 99.272 336.6 90.3828 336.6 79.4176C336.6 68.4523 327.735 59.5632 316.8 59.5632Z" fill="url(#paint7_linear_5_131)"/>
14+
<path d="M316.8 218.272H158.4C147.465 218.272 138.6 227.161 138.6 238.126C138.6 249.092 147.465 257.981 158.4 257.981H316.8C327.735 257.981 336.6 249.092 336.6 238.126C336.6 227.161 327.735 218.272 316.8 218.272Z" fill="url(#paint8_linear_5_131)"/>
15+
<path d="M237.6 138.981H79.2C68.2648 138.981 59.4 147.87 59.4 158.835C59.4 169.8 68.2648 178.69 79.2 178.69H237.6C248.535 178.69 257.4 169.8 257.4 158.835C257.4 147.87 248.535 138.981 237.6 138.981Z" fill="url(#paint9_linear_5_131)"/>
16+
</g>
17+
</g>
18+
<defs>
19+
<linearGradient id="paint0_linear_5_131" x1="198" y1="4.05854e-05" x2="198" y2="318" gradientUnits="userSpaceOnUse">
20+
<stop stop-color="#1D273D"/>
21+
<stop offset="1" stop-color="#0D0F13"/>
22+
</linearGradient>
23+
<linearGradient id="paint1_linear_5_131" x1="65.5" y1="99" x2="92.5" y2="63" gradientUnits="userSpaceOnUse">
24+
<stop stop-color="#4462FE"/>
25+
<stop offset="1" stop-color="#7D69FA"/>
26+
</linearGradient>
27+
<linearGradient id="paint2_linear_5_131" x1="62.8799" y1="99.2912" x2="96.1377" y2="97.5911" gradientUnits="userSpaceOnUse">
28+
<stop stop-color="#3757FD"/>
29+
<stop offset="1" stop-color="#6980FA"/>
30+
</linearGradient>
31+
<linearGradient id="paint3_linear_5_131" x1="62.8799" y1="99.2912" x2="96.1377" y2="97.5911" gradientUnits="userSpaceOnUse">
32+
<stop stop-color="#2447FF"/>
33+
<stop offset="1" stop-color="#6980FA"/>
34+
</linearGradient>
35+
<linearGradient id="paint4_linear_5_131" x1="65" y1="251.5" x2="91.5" y2="223.5" gradientUnits="userSpaceOnUse">
36+
<stop stop-color="#BC3EE6"/>
37+
<stop offset="1" stop-color="#D972F1"/>
38+
</linearGradient>
39+
<linearGradient id="paint5_linear_5_131" x1="305" y1="172" x2="329.5" y2="146" gradientUnits="userSpaceOnUse">
40+
<stop stop-color="#29BDFF"/>
41+
<stop offset="1" stop-color="#96E7FB"/>
42+
</linearGradient>
43+
<linearGradient id="paint6_linear_5_131" x1="300.18" y1="178.418" x2="334.567" y2="176.772" gradientUnits="userSpaceOnUse">
44+
<stop stop-color="#23BBFF"/>
45+
<stop offset="1" stop-color="#85E7FF"/>
46+
</linearGradient>
47+
<linearGradient id="paint7_linear_5_131" x1="154.5" y1="99" x2="317.5" y2="60" gradientUnits="userSpaceOnUse">
48+
<stop stop-color="#23BBFF"/>
49+
<stop offset="1" stop-color="#85E7FF"/>
50+
</linearGradient>
51+
<linearGradient id="paint8_linear_5_131" x1="156" y1="258" x2="312.5" y2="218" gradientUnits="userSpaceOnUse">
52+
<stop stop-color="#2447FF"/>
53+
<stop offset="1" stop-color="#6980FA"/>
54+
</linearGradient>
55+
<linearGradient id="paint9_linear_5_131" x1="86.0001" y1="179" x2="235.5" y2="139" gradientUnits="userSpaceOnUse">
56+
<stop stop-color="#6634FF"/>
57+
<stop offset="1" stop-color="#9C6DFF"/>
58+
</linearGradient>
59+
<clipPath id="clip0_5_131">
60+
<rect width="396" height="317.67" fill="white"/>
61+
</clipPath>
62+
<clipPath id="clip1_5_131">
63+
<rect width="396" height="317.67" fill="white"/>
64+
</clipPath>
65+
</defs>
66+
</svg>
67+
`

packages/injected/src/types.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export enum ProviderIdentityFlag {
4444
Rabby = 'isRabby',
4545
MathWallet = 'isMathWallet',
4646
GameStop = 'isGamestop',
47-
BitKeep = 'isBitKeep'
47+
BitKeep = 'isBitKeep',
48+
Sequence = 'isSequence'
4849
}
4950

5051
export enum ProviderLabel {
@@ -80,7 +81,8 @@ export enum ProviderLabel {
8081
Rabby = 'Rabby',
8182
MathWallet = 'MathWallet',
8283
GameStop = 'GameStop Wallet',
83-
BitKeep = 'BitKeep'
84+
BitKeep = 'BitKeep',
85+
Sequence = 'Sequence'
8486
}
8587

8688
export interface MeetOneProvider extends ExternalProvider {

packages/injected/src/wallets.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,18 @@ const bitkeep: InjectedWalletModule = {
520520
platforms: ['all']
521521
}
522522

523+
const sequence: InjectedWalletModule = {
524+
label: ProviderLabel.Sequence,
525+
injectedNamespace: InjectedNameSpace.Ethereum,
526+
checkProviderIdentity: ({ provider }) =>
527+
!!provider && !!provider[ProviderIdentityFlag.Sequence],
528+
getIcon: async () => (await import('./icons/sequence.js')).default,
529+
getInterface: async () => ({
530+
provider: window.ethereum
531+
}),
532+
platforms: ['all']
533+
}
534+
523535
const wallets = [
524536
exodus,
525537
metamask,
@@ -551,7 +563,8 @@ const wallets = [
551563
rabby,
552564
mathwallet,
553565
gamestop,
554-
bitkeep
566+
bitkeep,
567+
sequence
555568
]
556569

557570
export default wallets

packages/sequence/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# @web3-onboard/sequence
2+
3+
## Wallet module for connecting Sequence wallet to web3-onboard
4+
5+
### Install
6+
7+
`npm i @web3-onboard/sequence`
8+
9+
## Options
10+
11+
```typescript
12+
type SequenceOptions {
13+
appName?: string
14+
network?: number | string
15+
}
16+
```
17+
18+
## Usage
19+
20+
```typescript
21+
import Onboard from '@web3-onboard/core'
22+
import sequenceModule from '@web3-onboard/sequence'
23+
24+
const sequence = sequenceModule({
25+
appName: 'My app'
26+
})
27+
28+
const onboard = Onboard({
29+
// ... other Onboard options
30+
wallets: [
31+
sequence
32+
//... other wallets
33+
]
34+
})
35+
36+
const connectedWallets = await onboard.connectWallet()
37+
console.log(connectedWallets)
38+
```

packages/sequence/package.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"name": "@web3-onboard/sequence",
3+
"version": "1.0.0",
4+
"description": "Sequence is the smartest Web3 wallet. Easy, fun and secure.",
5+
"keywords": [
6+
"Ethereum",
7+
"Web3",
8+
"EVM",
9+
"dapp",
10+
"Multichain",
11+
"Wallet",
12+
"Transaction",
13+
"Provider",
14+
"Hardware Wallet",
15+
"Notifications",
16+
"React",
17+
"Svelte",
18+
"Vue",
19+
"Next",
20+
"Nuxt",
21+
"MetaMask",
22+
"Coinbase",
23+
"WalletConnect",
24+
"Ledger",
25+
"Trezor",
26+
"Connect Wallet",
27+
"Ethereum Hooks",
28+
"Blocknative",
29+
"Mempool",
30+
"pending",
31+
"confirmed",
32+
"Injected Wallet"
33+
],
34+
"repository": {
35+
"type": "git",
36+
"url": "https://github.com/blocknative/web3-onboard.git",
37+
"directory": "packages/core"
38+
},
39+
"homepage": "https://www.blocknative.com/onboard",
40+
"bugs": "https://github.com/blocknative/web3-onboard/issues",
41+
"module": "dist/index.js",
42+
"browser": "dist/index.js",
43+
"main": "dist/index.js",
44+
"type": "module",
45+
"typings": "dist/index.d.ts",
46+
"files": [
47+
"dist"
48+
],
49+
"scripts": {
50+
"build": "tsc",
51+
"dev": "tsc -w",
52+
"type-check": "tsc --noEmit"
53+
},
54+
"license": "MIT",
55+
"devDependencies": {
56+
"typescript": "^4.5.5"
57+
},
58+
"dependencies": {
59+
"@web3-onboard/common": "^2.1.7",
60+
"0xsequence": "^0.40.5"
61+
}
62+
}

packages/sequence/src/icon.ts

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
export default `
2+
<svg viewBox="0 0 396 318" fill="none" xmlns="http://www.w3.org/2000/svg">
3+
<g clip-path="url(#clip0_5_131)">
4+
<g clip-path="url(#clip1_5_131)">
5+
<path d="M0 67.5049L0 250.165C0 287.447 30.1402 317.67 67.32 317.67H328.68C365.86 317.67 396 287.447 396 250.165V67.5049C396 30.223 365.86 0 328.68 0H67.32C30.1402 0 0 30.223 0 67.5049Z" fill="#111111"/>
6+
<path d="M0 67.5049L0 250.165C0 287.447 30.1402 317.67 67.32 317.67H328.68C365.86 317.67 396 287.447 396 250.165V67.5049C396 30.223 365.86 0 328.68 0H67.32C30.1402 0 0 30.223 0 67.5049Z" fill="url(#paint0_linear_5_131)"/>
7+
<path d="M98.9999 79.4176C98.9999 68.4523 90.1351 59.5632 79.1999 59.5632C68.2647 59.5632 59.3999 68.4523 59.3999 79.4176C59.3999 90.3828 68.2647 99.272 79.1999 99.272C90.1351 99.272 98.9999 90.3828 98.9999 79.4176Z" fill="url(#paint1_linear_5_131)"/>
8+
<path d="M98.9999 79.4176C98.9999 68.4523 90.1351 59.5632 79.1999 59.5632C68.2647 59.5632 59.3999 68.4523 59.3999 79.4176C59.3999 90.3828 68.2647 99.272 79.1999 99.272C90.1351 99.272 98.9999 90.3828 98.9999 79.4176Z" fill="url(#paint2_linear_5_131)"/>
9+
<path d="M98.9999 79.4176C98.9999 68.4523 90.1351 59.5632 79.1999 59.5632C68.2647 59.5632 59.3999 68.4523 59.3999 79.4176C59.3999 90.3828 68.2647 99.272 79.1999 99.272C90.1351 99.272 98.9999 90.3828 98.9999 79.4176Z" fill="url(#paint3_linear_5_131)"/>
10+
<path d="M98.9999 238.126C98.9999 227.161 90.1351 218.272 79.1999 218.272C68.2647 218.272 59.3999 227.161 59.3999 238.126C59.3999 249.092 68.2647 257.981 79.1999 257.981C90.1351 257.981 98.9999 249.092 98.9999 238.126Z" fill="url(#paint4_linear_5_131)"/>
11+
<path d="M336.6 158.835C336.6 147.87 327.735 138.981 316.8 138.981C305.865 138.981 297 147.87 297 158.835C297 169.8 305.865 178.69 316.8 178.69C327.735 178.69 336.6 169.8 336.6 158.835Z" fill="url(#paint5_linear_5_131)"/>
12+
<path d="M336.6 158.835C336.6 147.87 327.735 138.981 316.8 138.981C305.865 138.981 297 147.87 297 158.835C297 169.8 305.865 178.69 316.8 178.69C327.735 178.69 336.6 169.8 336.6 158.835Z" fill="url(#paint6_linear_5_131)"/>
13+
<path d="M316.8 59.5632H158.4C147.465 59.5632 138.6 68.4523 138.6 79.4176C138.6 90.3828 147.465 99.272 158.4 99.272H316.8C327.735 99.272 336.6 90.3828 336.6 79.4176C336.6 68.4523 327.735 59.5632 316.8 59.5632Z" fill="url(#paint7_linear_5_131)"/>
14+
<path d="M316.8 218.272H158.4C147.465 218.272 138.6 227.161 138.6 238.126C138.6 249.092 147.465 257.981 158.4 257.981H316.8C327.735 257.981 336.6 249.092 336.6 238.126C336.6 227.161 327.735 218.272 316.8 218.272Z" fill="url(#paint8_linear_5_131)"/>
15+
<path d="M237.6 138.981H79.2C68.2648 138.981 59.4 147.87 59.4 158.835C59.4 169.8 68.2648 178.69 79.2 178.69H237.6C248.535 178.69 257.4 169.8 257.4 158.835C257.4 147.87 248.535 138.981 237.6 138.981Z" fill="url(#paint9_linear_5_131)"/>
16+
</g>
17+
</g>
18+
<defs>
19+
<linearGradient id="paint0_linear_5_131" x1="198" y1="4.05854e-05" x2="198" y2="318" gradientUnits="userSpaceOnUse">
20+
<stop stop-color="#1D273D"/>
21+
<stop offset="1" stop-color="#0D0F13"/>
22+
</linearGradient>
23+
<linearGradient id="paint1_linear_5_131" x1="65.5" y1="99" x2="92.5" y2="63" gradientUnits="userSpaceOnUse">
24+
<stop stop-color="#4462FE"/>
25+
<stop offset="1" stop-color="#7D69FA"/>
26+
</linearGradient>
27+
<linearGradient id="paint2_linear_5_131" x1="62.8799" y1="99.2912" x2="96.1377" y2="97.5911" gradientUnits="userSpaceOnUse">
28+
<stop stop-color="#3757FD"/>
29+
<stop offset="1" stop-color="#6980FA"/>
30+
</linearGradient>
31+
<linearGradient id="paint3_linear_5_131" x1="62.8799" y1="99.2912" x2="96.1377" y2="97.5911" gradientUnits="userSpaceOnUse">
32+
<stop stop-color="#2447FF"/>
33+
<stop offset="1" stop-color="#6980FA"/>
34+
</linearGradient>
35+
<linearGradient id="paint4_linear_5_131" x1="65" y1="251.5" x2="91.5" y2="223.5" gradientUnits="userSpaceOnUse">
36+
<stop stop-color="#BC3EE6"/>
37+
<stop offset="1" stop-color="#D972F1"/>
38+
</linearGradient>
39+
<linearGradient id="paint5_linear_5_131" x1="305" y1="172" x2="329.5" y2="146" gradientUnits="userSpaceOnUse">
40+
<stop stop-color="#29BDFF"/>
41+
<stop offset="1" stop-color="#96E7FB"/>
42+
</linearGradient>
43+
<linearGradient id="paint6_linear_5_131" x1="300.18" y1="178.418" x2="334.567" y2="176.772" gradientUnits="userSpaceOnUse">
44+
<stop stop-color="#23BBFF"/>
45+
<stop offset="1" stop-color="#85E7FF"/>
46+
</linearGradient>
47+
<linearGradient id="paint7_linear_5_131" x1="154.5" y1="99" x2="317.5" y2="60" gradientUnits="userSpaceOnUse">
48+
<stop stop-color="#23BBFF"/>
49+
<stop offset="1" stop-color="#85E7FF"/>
50+
</linearGradient>
51+
<linearGradient id="paint8_linear_5_131" x1="156" y1="258" x2="312.5" y2="218" gradientUnits="userSpaceOnUse">
52+
<stop stop-color="#2447FF"/>
53+
<stop offset="1" stop-color="#6980FA"/>
54+
</linearGradient>
55+
<linearGradient id="paint9_linear_5_131" x1="86.0001" y1="179" x2="235.5" y2="139" gradientUnits="userSpaceOnUse">
56+
<stop stop-color="#6634FF"/>
57+
<stop offset="1" stop-color="#9C6DFF"/>
58+
</linearGradient>
59+
<clipPath id="clip0_5_131">
60+
<rect width="396" height="317.67" fill="white"/>
61+
</clipPath>
62+
<clipPath id="clip1_5_131">
63+
<rect width="396" height="317.67" fill="white"/>
64+
</clipPath>
65+
</defs>
66+
</svg>
67+
`

0 commit comments

Comments
 (0)