0.1.2 • Published 2 years ago

phantom-connectivity v0.1.2

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

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