@glosso/sdk
v0.1.1
Published
Glosso SDK — wallet infrastructure for AI agents on Solana
Maintainers
Readme
@glosso/sdk
Wallet infrastructure for AI agents on Solana.
Installation
npm install @glosso/sdk
# or
pnpm add @glosso/sdkQuick Start
import { GlossoWallet } from '@glosso/sdk';
// Reads GLOSSO_MODE, GLOSSO_MASTER_SEED_ENCRYPTED, etc. from process.env
const wallet = new GlossoWallet();
// Get wallet address
const address = await wallet.getAddress(); // primary wallet
const trading = await wallet.getAddress(1); // trading sub-wallet
// Check balance
const balance = await wallet.getBalance(); // in SOL
// Send SOL
const sig = await wallet.send(recipientAddress, 100_000); // lamports
console.log(`Transaction: https://explorer.solana.com/tx/${sig}?cluster=devnet`);
// Sign without broadcasting
const signedTx = await wallet.sign(transaction);Environment Variables
Set these in your .env file (or use glosso provision to auto-generate):
GLOSSO_MODE=sovereign
GLOSSO_NETWORK=devnet
GLOSSO_MASTER_SEED_ENCRYPTED=<encrypted-blob>
GLOSSO_ENCRYPTION_PASSPHRASE=<passphrase>Wallet Modes
| Mode | Description | Key Custody |
|---|---|---|
| sovereign | Self-custodial, keys encrypted on disk | You |
| privy | Privy embedded wallets | Privy enclaves |
| turnkey | Turnkey infrastructure wallets | Turnkey HSMs |
Multi-Wallet Support
Each wallet supports multiple sub-wallets derived from a single master seed:
wallet.getAddress(0) // Primary wallet
wallet.getAddress(1) // Trading wallet
wallet.getAddress(2) // Vault wallet
wallet.send(to, amount, 1) // Send from trading walletAPI Reference
GlossoWallet
getAddress(index?: number): Promise<string>— Get wallet public addressgetBalance(index?: number): Promise<number>— Get SOL balancesign(transaction: Transaction, index?: number): Promise<Transaction>— Sign a transactionsend(to: string, lamports: number, index?: number): Promise<string>— Send SOL, returns tx signature
SovereignAdapter
Direct access to the sovereign wallet backend, implements WalletAdapter.
Utilities
generateMnemonic(): stringderiveKeypair(mnemonic, index): KeypairderiveAddress(mnemonic, index): stringencrypt(plaintext, passphrase): stringdecrypt(blob, passphrase): string
License
MIT
