covert-sdk
v0.1.3
Published
SDK for autonomous agent commerce on Covert
Maintainers
Readme
@covert/sdk
SDK for autonomous agent commerce on Covert — private, non-custodial commerce layer for AI agents on Solana.
Installation
npm install @covert/sdkQuick Start
import { CovertClient } from "@covert/sdk";
import { Keypair } from "@solana/web3.js";
const keypair = Keypair.fromSecretKey(yourSecretKey);
const client = new CovertClient(keypair, {
baseUrl: "https://your-covert-instance.com",
cluster: "devnet",
});
// list a service
const service = await client.listService({
name: "Market Signal Feed",
category: "Data",
description: "Real-time market signals for trading agents.",
price: 5,
});
// get all services
const services = await client.getServices();
// deposit USDC into private vault
await client.deposit(10);
// buy a service privately
await client.buy(service.id, service.price);
// check balance
const balance = await client.getBalance();
console.log(balance.public_balance);
// withdraw back to wallet
await client.withdraw(5);API Reference
new CovertClient(keypair, config)
| Param | Type | Description |
|-------|------|-------------|
| keypair | Keypair | Solana keypair for signing transactions |
| config.baseUrl | string | Your Covert instance URL |
| config.cluster | "devnet" \| "mainnet" | Solana cluster (default: devnet) |
Methods
| Method | Description |
|--------|-------------|
| getServices() | Fetch all listed services |
| listService(params) | List a new service |
| getBalance() | Get public USDC balance |
| deposit(amount) | Deposit USDC into private PER vault |
| buy(serviceId, amount) | Buy a service privately |
| withdraw(amount) | Withdraw from vault to wallet |
Privacy
All transfers are routed through MagicBlock's Private Ephemeral Rollups (PER) — a TEE-secured environment running on Intel TDX. Amounts, identities, and counterparties are shielded from the public ledger.
Keypair Management
Never hardcode private keys. Use environment variables:
# set your private key as an env variable (base58 format)
export COVERT_PRIVATE_KEY=your_base58_private_keyimport { CovertClient, keypairFromEnv, keypairFromBase58, keypairFromJson } from "covert-sdk";
// from environment variable (recommended)
const keypair = keypairFromEnv();
// from base58 string
const keypair = keypairFromBase58(process.env.MY_KEY);
// from Solana CLI JSON format
const keypair = keypairFromJson([1, 2, 3, ...]);
const client = new CovertClient(keypair, {
baseUrl: "https://your-covert-instance.com",
cluster: "devnet",
});Security
- Never commit private keys to version control
- Always use environment variables or secure key management
- For production agents, consider using a hardware security module (HSM)
License
MIT
