import { StellarWalletsKit, WalletNetwork, FREIGHTER_ID } from '@creit-tech/stellar-wallets-kit';
import { StellarWalletsKitAdapter } from 'smart-account-kit';
// Create the StellarWalletsKit instance
const swk = new StellarWalletsKit({
network: WalletNetwork.TESTNET,
selectedWalletId: FREIGHTER_ID,
// ... other config
});
// Wrap it in the adapter
const adapter = new StellarWalletsKitAdapter({
kit: swk,
onConnectionChange: (connected: boolean) => {
console.log('External wallet:', connected ? 'connected' : 'disconnected');
},
});
// Register with SmartAccountKit
await kit.externalSigners.addFromWallet(adapter);