⚠️ This repository is archived and no longer maintained.
Do not use it in new projects. The code here is kept for reference only and will not receive updates, bug fixes or security patches.
The
@talismn/connect-wallets,@talismn/connect-components,@talismn/connect-uinpm packages are deprecated.
Connect your DApp to Ethereum and Polkadot wallets with Talisman Connect. A minimal SDK to connect your DApp with your users’ favourite EOA wallets.
Add the SDK to your DApp’s dependencies:
# Using npm
npm install --save @talismn/connect-wallets
# Using bun
bun add @talismn/connect-wallets
# Using pnpm
pnpm add @talismn/connect-wallets
# Using yarn
yarn add @talismn/connect-wallets
Add the code
import { getWallets } from '@talismn/connect-wallets'
// get an array of wallets which are installed
const installedWallets = getWallets().filter((wallet) => wallet.installed)
// get talisman from the array of installed wallets
const talismanWallet = installedWallets.find(
(wallet) => wallet.extensionName === 'talisman',
)
// enable the wallet
if (talismanWallet) {
talismanWallet.enable('myCoolDapp').then(() => {
talismanWallet.subscribeAccounts((accounts) => {
// do anything you want with the accounts provided by the wallet
console.log('got accounts', accounts)
})
})
}
Talisman Connect can be used in one of three ways:
[POPULAR] Integrate as a standalone library within your own UI.
See @talismn/connect-wallets for instructions on this option.
Integrate using a set of themeable React components.
See @talismn/connect-components for instructions on this option.
Integrate using our generic ready-to-use modal UI. See @talismn/connect-ui for instructions on this option.
Clone this repo and install its dependencies.
git clone git@github.com:TalismanSociety/talisman-connect.git
cd talisman-connect
pnpm install
pnpm build
Run the devserver to preview your changes as you make them.
pnpm run dev