Skip to content

Commit a61433e

Browse files
Support D'CENT wallet in PC and mobile (#996)
* Support D'CENT wallet in PC/Mobile * Upgrade eth-dcent-keyring package * Update packages/dcent/package.json Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com> * add README file for D'CENT * Remove console.log, yarn.lock Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com>
1 parent 88b5724 commit a61433e

File tree

11 files changed

+444
-20
lines changed

11 files changed

+444
-20
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ For full documentation, check out the README.md for each package:
7777
- [Ledger](packages/ledger/README.md)
7878
- [Trezor](packages/trezor/README.md)
7979
- [Keystone](packages/keystone/README.md)
80-
80+
- [D'CENT](packages/dcent/README.md)
8181
**Frameworks**
8282

8383
- [React](packages/react/README.md)

packages/@types/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
declare module '*.png'
22
declare module 'window'
33
declare module '@keystonehq/eth-keyring'
4+
declare module 'eth-dcent-keyring'
45
declare module 'hdkey'
56
declare const global: typeof globalThis & { window: CustomWindow }

packages/dcent/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# @web3-onboard/dcent
2+
3+
## Wallet module for connecting D'CENT hardware wallets to web3-onboard
4+
5+
### Install
6+
7+
`npm i @web3-onboard/dcent`
8+
9+
### Usage
10+
11+
```typescript
12+
import Onboard from '@web3-onboard/core'
13+
import dcentModule from '@web3-onboard/dcent'
14+
15+
const dcent = dcentModule()
16+
17+
const onboard = Onboard({
18+
// ... other Onboard options
19+
wallets: [
20+
dcent
21+
//... other wallets
22+
]
23+
})
24+
25+
const connectedWallets = await onboard.connectWallet()
26+
console.log(connectedWallets)
27+
```

packages/dcent/package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "@web3-onboard/dcent",
3+
"version": "1.0.0-alpha.1",
4+
"description": "D'CENT module for web3-onboard",
5+
"module": "dist/index.js",
6+
"typings": "dist/index.d.ts",
7+
"files": [
8+
"dist"
9+
],
10+
"type": "module",
11+
"scripts": {
12+
"build": "tsc",
13+
"dev": "tsc -w",
14+
"type-check": "tsc --noEmit"
15+
},
16+
"license": "MIT",
17+
"devDependencies": {
18+
"typescript": "^4.5.5"
19+
},
20+
"dependencies": {
21+
"@web3-onboard/common": "^2.0.0",
22+
"@ethereumjs/common": "^2.6.1",
23+
"@ethereumjs/tx": "^3.4.0",
24+
"@ethersproject/providers": "^5.5.0",
25+
"eth-dcent-keyring": "^0.2.2"
26+
}
27+
}

packages/dcent/src/icon.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
export default `<svg xmlns="http://www.w3.org/2000/svg" id="_171_4" width="100%" height="100%" viewBox="0 0 48 48">
3+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4+
viewBox="0 0 62.27 71.11" style="enable-background:new 0 0 62.27 71.11;" xml:space="preserve">
5+
<style type="text/css">
6+
.st0{fill:#B3B5B5;}
7+
.st1{fill:#72BFBC;}
8+
.st2{fill:#6D6E70;}
9+
</style>
10+
<g>
11+
<polygon class="st0" points="32.04,13.43 37.34,10.37 37.34,3.06 32.04,0 32.04,0 "/>
12+
<path class="st1" d="M12.53,45.25V24.69l17.71-10.22V0L0.9,16.94C0.34,17.26,0,17.86,0,18.5v33.88c0,0.03,0.01,0.07,0.01,0.1
13+
L12.53,45.25z"/>
14+
<path class="st2" d="M48.86,46.69L31.14,56.93L13.52,46.75L0.99,53.99l29.25,16.89c0.28,0.16,0.59,0.24,0.9,0.24
15+
c0.31,0,0.62-0.08,0.9-0.24l29.34-16.94c0.01,0,0.01-0.01,0.02-0.01L48.86,46.69z"/>
16+
<g>
17+
<path class="st0" d="M61.38,16.94l-11.63-6.71v7.3l-12.5,7.22l12.5,7.21v13.16l12.53,7.23V18.5
18+
C62.27,17.86,61.93,17.26,61.38,16.94z"/>
19+
</g>
20+
<polygon class="st2" points="24.93,31.85 24.94,46.18 37.1,39.16 37.1,24.83 "/>
21+
</g>
22+
</svg>
23+
`

0 commit comments

Comments
 (0)