roce-teg-tsentark
v3.3.7
Published
[](https://www.npmjs.com/package/get-starknet) [](https://twitter.com/Starknet) [ => connect()}>Connect wallet</button>Advanced usage
You can also choose to customize the UI by overwriting the CSS classes, or by
implementing your very own UI. This is possible due to a split into a core and
ui package. As a library author or dapp developer who wants to implement a
custom UI, you can use the core package.
import {
disconnect,
enable,
getAvailableWallets,
getDiscoveryWallets,
getLastConnectedWallet,
getPreAuthorizedWallets,
} from "get-starknet-core"
interface GetStarknetResult {
// Returns all wallets available in the window object
getAvailableWallets: (
options?: GetWalletOptions,
) => Promise<StarknetWindowObject[]>
// Returns only preauthorized wallets available in the window object
getPreAuthorizedWallets: (
options?: GetWalletOptions,
) => Promise<StarknetWindowObject[]>
// Returns all wallets in existence (from discovery file)
getDiscoveryWallets: (options?: GetWalletOptions) => Promise<WalletProvider[]>
// Returns the last wallet connected when it's still connected
getLastConnectedWallet: () => Promise<StarknetWindowObject | null>
// Connects to a wallet
enable: (
wallet: StarknetWindowObject,
options?: {
starknetVersion?: "v4" | "v5"
},
) => Promise<ConnectedStarknetWindowObject>
// Disconnects from a wallet
disconnect: (options?: { clearLastWallet?: boolean }) => Promise<void>
}Development
You need Node and pnpm installed. Make sure to clone this repo and run:
pnpm install
pnpm buildTo start watching for changes, run:
pnpm devand open http://localhost:5173/
Running tests
For running tests:
pnpm test