2.3.3 â€ĸ Published 8 months ago

starknetkit v2.3.3

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

đŸ•šī¸ StarknetKit

Install starknetkit with npm or yarn

# latest official release (main branch)
$ npm install starknetkit

# or with yarn:
$ yarn add starknetkit

Imports

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"

Establishing a connection

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:

  • Argent X
  • Braavos
  • Argent mobile
  • Argent webwallet

Connect with specific connectors

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" } })
])

Reconnect to a previously connected wallet on load:

const wallet = await connect({ modalMode: "neverAsk" })

Disconnect a wallet

await disconnect({ clearLastWallet: true })

Listen to account change

const selectedConnectorWallet = getSelectedConnectorWallet()
selectedConnectorWallet.on("accountsChanged", () => {
  setWallet(prevState => {
    const updatedWallet = { ...prevState }
    updatedWallet.account = selectedConnectorWallet.account
    return updatedWallet
  })
})

📕 Guides

Guides can be found here

âœī¸ Contributing

If you consider to contribute to this project please read CONTRIBUTING.md first.

📜 License

Copyright (c) 2023

Licensed under the MIT license.

2.4.0-beta.2

8 months ago

2.4.0-beta.1

8 months ago

2.3.4

8 months ago

2.3.0

9 months ago

2.3.2

8 months ago

2.3.1

9 months ago

2.3.3

8 months ago

2.2.17

10 months ago

2.2.18

10 months ago

2.2.15

12 months ago

2.2.16

11 months ago

2.2.13

12 months ago

2.2.14

12 months ago

2.2.11

12 months ago

2.2.7

1 year ago

2.2.12

12 months ago

2.2.10

1 year ago

2.2.19

10 months ago

2.2.26

10 months ago

2.2.24

10 months ago

2.2.25

10 months ago

2.2.22

10 months ago

2.2.23

10 months ago

2.2.20

10 months ago

2.2.21

10 months ago

2.2.9

1 year ago

2.2.8

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

2.2.6

1 year ago

2.2.5

1 year ago

2.2.4

1 year ago

2.2.3

1 year ago

2.2.1

1 year ago

2.2.0

1 year ago

2.2.2

1 year ago

2.1.1

1 year ago

2.1.0

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.30

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.26

1 year ago

1.0.27

1 year ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.9

2 years ago

1.0.11

2 years ago

1.0.21

2 years ago

1.0.10

2 years ago

1.0.20

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago