Skip to content

Wallet Integration

The SDK provides a built-in helper class for Bittensor wallet connections. For EVM and Solana, you use standard ecosystem libraries (wagmi, viem, Solana Wallet Adapter) alongside the SDK’s transaction payload methods.


ChainSupported Wallets
EVM (Ethereum, Arbitrum, etc.)MetaMask, Rabbit, Rainbow, any WalletConnect-compatible wallet
BittensorTalisman, Subwallet, Polkadot.js
SolanaPhantom, Solflare

The SDK includes a built-in BittensorWallet class for connecting Polkadot.js-compatible browser extensions.

try {
const account = await sdk.wallets.bittensor.connect();
console.log('Address:', account.address);
console.log('Extension:', account.source); // e.g. 'talisman'
console.log('Name:', account.name);
} catch (err) {
console.error('Failed to connect Bittensor wallet:', err);
// Common error: "No compatible wallet extension found"
}
if (sdk.wallets.bittensor.isConnected()) {
const account = sdk.wallets.bittensor.getAccount();
console.log('Currently connected:', account);
}
sdk.wallets.bittensor.disconnect();

For EVM chains, manage wallet connections with Wagmi, Ethers.js, or viem. The SDK’s bridge() method returns a transaction payload that you sign and send using your chosen library.

// 1. Request connected accounts
const accounts = await window.ethereum.request({
method: 'eth_requestAccounts',
});
const evmAddress = accounts[0];
// 2. Pass address to SDK calls
const response = await sdk.bridge.bridge({
fromChain: 'ethereum',
fromWallet: evmAddress,
// ...other params
});

For Solana, use the Solana Wallet Adapter to manage connections. Pass the connected public key address to SDK calls.

// 1. Connect Phantom wallet
await window.solana.connect();
const solAddress = window.solana.publicKey.toString();
// 2. Pass address to SDK calls
const response = await sdk.bridge.bridge({
fromChain: 'solana',
fromWallet: solAddress,
// ...other params
});