Skip to content

Commit e549e6b

Browse files
committed
Add Phantom docs
1 parent 687506c commit e549e6b

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Phantom
2+
3+
:::admonition type=warning
4+
_Wallet module for connecting Phantom to web3-onboard is still in alpha testing and Phantom Eth mainnet coverage is not fully public yet but will be soon. Please visit the [Official Phantom Site](https://phantom.app/) for more details.
5+
:::
6+
7+
[Web3-Onboard](https://onboard.blocknative.com/) is an open-source, framework-agnostic JavaScript library to onboard users to web3 apps. This package can be used to integrate [Phantom Wallet](https://phantom.app/) support into Web3-Onboard's "Connect Wallet" modal. With this module the Phantom option will be shown even if the extension is not installed on the users browser or used within the Phantom app. If selected the user will be taken to a download screen and prompted to create a Phantom wallet. For more information on Phantom, please refer to the [Phantom developer docs](https://docs.phantom.app/).
8+
9+
### Install
10+
11+
<Tabs values={['yarn', 'npm']}>
12+
<TabPanel value="yarn">
13+
14+
```sh copy
15+
yarn add @web3-onboard/core @web3-onboard/phantom
16+
```
17+
18+
</TabPanel>
19+
<TabPanel value="npm">
20+
21+
```sh copy
22+
npm install @web3-onboard/core @web3-onboard/phantom
23+
```
24+
25+
</TabPanel>
26+
</Tabs>
27+
28+
## Usage
29+
30+
```typescript
31+
import Onboard from '@web3-onboard/core'
32+
import phantomModule from '@web3-onboard/phantom'
33+
34+
// initialize the module
35+
const phantom = phantomModule()
36+
37+
const onboard = Onboard({
38+
// ... other Onboard options
39+
wallets: [
40+
phantom
41+
//... other wallets
42+
]
43+
})
44+
45+
const connectedWallets = await onboard.connectWallet()
46+
console.log(connectedWallets)
47+
```

0 commit comments

Comments
 (0)