Skip to content

Wallet Adapters

Wallet adapters implement WalletAdapter and are selected by chainType.

  • RawKeypairAdapter (@stendar/wallet-core): local Solana keypair (dev/testing)
  • PhantomWalletAdapter (@stendar/wallet-phantom): browser Phantom integration
  • ViemWalletAdapter (@stendar/wallet-viem): EVM signing via viem accounts
  • TurnkeyWalletAdapter (@stendar/wallet-turnkey): managed keys for Solana or EVM

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}`),
],
});
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',
});
  • Prefer managed wallets (Turnkey) or hardware-backed signer flows in production.
  • Keep raw private keys out of source and load them via .env or secret managers.
  • Pair adapter configuration with Security model controls.