phantom-connect

0.1.3 • Public • Published

phantom-connect

Installation

npm i phantom-connect

import { connectWallet, checkIfConnected, getProfileInfo, disconnect, discordAuth} from "phantom-connect";

connectWallet()

Created connection with Phantom wallet and returns public key which needs to be converted into string.

checkIfConnected()

After a web application connects to Phantom for the first time, it becomes trusted. Once trusted, it's possible for the application to automatically connect to Phantom on page refresh. It returns public key.

getProfileInfo(rpcUrl, addressPublicKey)

Returns the account info to the Public Key provided. rpcUrl states that blockchain is either on testnet or mainnet

example: rpcUrl="https://api.devnet.solana.com" (testnet)

disconnect()

Disconnects the user from phantom wallet but if checkIfConnected() is being implemented, upon refresh it will connect again because we had given the right to the site.

discordAuth()

For discord auth, configuration needs to be done from the dicord developer portal. At the end of the configs, a random URL gets generated with a callback

Readme

Keywords

none

Package Sidebar

Install

npm i phantom-connect

Weekly Downloads

0

Version

0.1.3

License

none

Unpacked Size

53.9 kB

Total Files

13

Last publish

Collaborators

  • ammag