Documentation Index
Fetch the complete documentation index at: https://docs.layerswap.io/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Starknet wallet provider supports ArgentX, Braavos, and all Starknet-compatible wallets on Starknet Mainnet and Sepolia.
Installation
npm install @layerswap/wallet-starknet
Basic Usage
import { LayerswapProvider, Swap } from "@layerswap/widget"
import { createStarknetProvider } from "@layerswap/wallet-starknet"
import "@layerswap/widget/index.css"
export const App = () => {
const starknetProvider = createStarknetProvider({
walletConnectConfigs: {
projectId: "YOUR_WALLETCONNECT_PROJECT_ID",
name: "Your App Name",
description: "Your app description",
url: "https://yourapp.com",
icons: ["https://yourapp.com/icon.png"]
}
})
return (
<LayerswapProvider
walletProviders={[starknetProvider]}
>
<Swap />
</LayerswapProvider>
)
}
Configuration
WalletConnect Configuration
The Starknet provider requires WalletConnect configuration:
import { createStarknetProvider } from "@layerswap/wallet-starknet"
import type { WalletConnectConfig } from "@layerswap/wallet-starknet"
const walletConnectConfigs: WalletConnectConfig = {
projectId: string, // Required: Your WalletConnect project ID
name: string, // Required: Your app name
description: string, // Required: Your app description
url: string, // Required: Your app URL
icons: string[] // Required: Array of logo URLs
}
const starknetProvider = createStarknetProvider({ walletConnectConfigs })
Get your WalletConnect project ID at WalletConnect Cloud.