Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

StarkNet wallet <-> dApp bridge

License

NotificationsYou must be signed in to change notification settings

starknet-io/get-starknet

Repository files navigation

npm

Goals

  • ❤️‍🩹 Allow Starknet dApps and wallets to seamlessly connect
  • 🪶 Lightweight and easy to use
  • 🏎 Fast integration, building and testing
  • ⚙️ Customizable and extensible
  • 🌍 Open source and controlled by the community

Installation

# using npmnpm install @starknet-io/get-starknet starknet@next# using yarnyarn add @starknet-io/get-starknet starknet@next# using pnpmpnpm add @starknet-io/get-starknet starknet@next

Read more about the new Starkent Dapp<>Wallet API in thepost

Usage for dApp developers

You can use the built-in UI to connect to any Starknet wallet as fast aspossible like this:

import{connect,disconnect}from"@starknet-io/get-starknet"return<buttononClick={()=>connect()}>Connect wallet</button>

Advanced usage

You can also choose to customize the UI by overwriting the CSS classes, or byimplementing your very own UI. This is possible due to a split into acore andui package. As a library author or dapp developer who wants to implement acustom UI, you can use thecore package.

import{disconnect,enable,getAvailableWallets,getDiscoveryWallets,getLastConnectedWallet,getPreAuthorizedWallets,}from"@starknet-io/get-starknet-core"interfaceGetStarknetResult{// Returns all wallets available in the window objectgetAvailableWallets:(options?:GetWalletOptions,)=>Promise<StarknetWindowObject[]>// Returns only preauthorized wallets available in the window objectgetPreAuthorizedWallets:(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 connectedgetLastConnectedWallet:()=>Promise<StarknetWindowObject|null>// Connects to a walletenable:(wallet:StarknetWindowObject,options?:{starknetVersion?:"v4"|"v5"},)=>Promise<ConnectedStarknetWindowObject>// Disconnects from a walletdisconnect:(options?:{clearLastWallet?:boolean})=>Promise<void>}

Development

You need Node and pnpm installed. Make sure to clone this repo and run:

pnpm installpnpm build

To start watching for changes, run:

pnpm dev

and openhttp://localhost:5173/

Running tests

For running tests:

pnpmtest

[8]ページ先頭

©2009-2025 Movatter.jp