Wallet Adapters
Wallet adapters implement WalletAdapter and are selected by chainType.
Adapter options
Section titled “Adapter options”RawKeypairAdapter(@stendar/wallet-core): local Solana keypair (dev/testing)PhantomWalletAdapter(@stendar/wallet-phantom): browser Phantom integrationViemWalletAdapter(@stendar/wallet-viem): EVM signing via viem accountsTurnkeyWalletAdapter(@stendar/wallet-turnkey): managed keys for Solana or EVM
Solana + EVM in one runtime
Section titled “Solana + EVM in one runtime”Pass an array to wallet so runtime can resolve by chain type:
import { DeFiRuntime } from '@stendar/core';import { RawKeypairAdapter } from '@stendar/wallet-core';import { ViemWalletAdapter } from '@stendar/wallet-viem';
const runtime = new DeFiRuntime({ chains, providers, wallet: [ new RawKeypairAdapter(process.env.WALLET_PRIVATE_KEY!), new ViemWalletAdapter(process.env.EVM_PRIVATE_KEY! as `0x${string}`), ],});Turnkey configuration example
Section titled “Turnkey configuration example”import { TurnkeyWalletAdapter } from '@stendar/wallet-turnkey';
const turnkeyWallet = new TurnkeyWalletAdapter({ organizationId: process.env.TURNKEY_ORGANIZATION_ID!, apiPublicKey: process.env.TURNKEY_API_PUBLIC_KEY!, apiPrivateKey: process.env.TURNKEY_API_PRIVATE_KEY!, walletId: process.env.TURNKEY_WALLET_ID!, signWith: process.env.TURNKEY_SIGN_WITH!, chainType: 'evm',});Production guidance
Section titled “Production guidance”- Prefer managed wallets (
Turnkey) or hardware-backed signer flows in production. - Keep raw private keys out of source and load them via
.envor secret managers. - Pair adapter configuration with Security model controls.