The imperative web SDK for Seeker Connect — for dapps that do not use Wallet Standard and want to manage sessions, the authorization token, and UI themselves.
Most dapps should use
@solana-mobile/seeker-connect-wallet-standard
instead, which builds on this package and exposes Seeker Connect through the
standard wallet interface. Reach for this package directly only when you need
the low-level SeekerLink port.
npm install @solana-mobile/seeker-connect-web
createNostrSeekerLink() returns a SeekerLink. Its transact method opens a
short-lived MWA session over a Nostr relay, runs your callback against a
SeekerWallet, and closes the session when the callback settles. The wallet
handle is valid only inside the callback; payloads are raw Uint8Array and
addresses are base58 strings.
import { createNostrSeekerLink } from '@solana-mobile/seeker-connect-web';
import type { SeekerConnectConfig } from '@solana-mobile/seeker-connect-web';
const link = createNostrSeekerLink();
const config: SeekerConnectConfig = {
identity: { name: 'My Dapp', uri: window.location.origin, icon: '/icon.png' },
relayDomain: '<relay-domain>',
};
const authorization = await link.transact(config, async (wallet) => {
return wallet.authorize({ chain: 'solana:mainnet' });
});
// Persist authorization.authToken and authorization.walletUriBase yourself;
// restoring them is what makes the dapp "connected".
Licensed under Apache-2.0.