
Product
Redesigned Repositories Page: A Faster Way to Prioritize Security Risk
Our redesigned Repositories page adds alert severity, filtering, and tabs for faster triage and clearer insights across all your projects.
starknetkit
Advanced tools
Install starknetkit with npm
or yarn
# latest official release (main branch)
$ npm install starknetkit
# or with yarn:
$ yarn add starknetkit
After installation, we get access to different methods, such as connect
, disconnect
, etc which we should import for use in our application:
import { connect, disconnect } from "starknetkit"
To establish a wallet connection, we need to call the connect method which was imported earlier like this:
const wallet = await connect()
By default, the list of connectors is:
const webwallet = await connect([new WebWalletConnector()])
const argentMobileWallet = await connect([
new ArgentMobileConnector()
])
const wallet = await connect([
new InjectedConnector({ options: { id: "argentX" } }),
new InjectedConnector({ options: { id: "braavos" } })
])
const wallet = await connect({ modalMode: "neverAsk" })
await disconnect({ clearLastWallet: true })
In your application, import handleWebwalletLogoutEvent
and pass a callback to manage the state of your dapp
useEffect(() => {
handleWebwalletLogoutEvent(() => {
// clear state
})
}, [])
const selectedConnectorWallet = getSelectedConnectorWallet()
selectedConnectorWallet.on("accountsChanged", () => {
setWallet(prevState => {
const updatedWallet = { ...prevState }
updatedWallet.account = selectedConnectorWallet.account
return updatedWallet
})
})
Guides can be found here
If you consider to contribute to this project please read CONTRIBUTING.md first.
Copyright (c) 2023
Licensed under the MIT license.
FAQs
<!-- logo -->
The npm package starknetkit receives a total of 4,230 weekly downloads. As such, starknetkit popularity was classified as popular.
We found that starknetkit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Our redesigned Repositories page adds alert severity, filtering, and tabs for faster triage and clearer insights across all your projects.
Security News
Multiple deserialization flaws in PyTorch Lightning could allow remote code execution when loading untrusted model files, affecting versions up to 2.4.0.
Security News
NVD now marks all pre-2018 CVEs as "Deferred," signaling it will no longer enrich older vulnerabilities, further eroding trust in its data.