This guide will walk you through integrating Typink into your dapp. Typink is designed to be flexible, making it easy to integrate whether you're building a new project or migrating an existing one—especially if your dapp already relies on external wallet connectors like SubConnect or Talisman Connect.
appName: The name of your dApp (used when connecting to wallets)
deployments: Array of your contract deployments.
supportedNetworks: Array of networks your dApp supports
defaultNetworkId: The default network to connect to, or defaultNetworkIdsif you want to connect to multiple networks at once
cacheMetadata: Whether to cache network metadata (recommended: true)
For a complete list of props and advanced configuration (multi-network, light client, etc.), see the TypinkProvider documentation.
Setup Wallet Connector
Typink offers flexibility in wallet integration with two main approaches:
Option 1: Built-in Typink Wallet Connector (Recommended for New Projects)
The built-in wallet connector manages wallet connections, signers, and accounts internally. It supports SubWallet, Talisman, and PolkadotJS by default.
Adding Custom Wallets
You can also add custom wallet extensions:
Using the useTypink Hook
Once you've set up the built-in wallet connector, use the useTypink hook to access wallet state and actions in your components.
Available Properties:
Example: Connect Wallet Button
Example: Account Selection & Disconnect
Key Points:
Call connectWallet(id) with a wallet's id property to connect
accounts includes all accounts from all connected wallets
Use setConnectedAccount() to switch between accounts
Call disconnect() without arguments to disconnect all wallets, or pass a walletId to disconnect a specific wallet
connectedAccount and signer are automatically managed and available for contract interactions