valta-sdk 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,158 @@
1
+ # Valta SDK
2
+
3
+ Official TypeScript SDK for [Valta](https://valta.co) - Programmable AI Agent Spending Controls.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install valta-sdk
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```typescript
14
+ import { Valta } from "valta-sdk";
15
+
16
+ const valta = new Valta({
17
+ apiKey: "sk_valta_...", // Your API key from valta.co/dashboard/api-keys
18
+ });
19
+
20
+ // Request agent spending permission
21
+ const result = await valta.requestSpend({
22
+ agentId: "research-agent",
23
+ amount: 20,
24
+ category: "api_calls",
25
+ description: "Purchase dataset access",
26
+ });
27
+
28
+ if (result.approved) {
29
+ console.log("Approved! TX:", result.tx_id);
30
+ } else if (result.requires_approval) {
31
+ console.log("Pending human approval:", result.request_id);
32
+ } else {
33
+ console.log("Denied:", result.reason);
34
+ }
35
+ ```
36
+
37
+ ## Features
38
+
39
+ - **Spending Controls** - Request permission before agents spend money
40
+ - **Spending Policies** - Set per-transaction, daily, and monthly limits
41
+ - **Human Approval Mode** - Require manual approval above thresholds
42
+ - **Kill Switch** - Instantly freeze agent spending
43
+ - **Agent Tools** - Configure and execute agent tools
44
+ - **Agent Chains** - Create agent-to-agent workflows
45
+ - **Balance Queries** - Check wallet balance programmatically
46
+
47
+ ## API Reference
48
+
49
+ ### Initialize
50
+
51
+ ```typescript
52
+ const valta = new Valta({
53
+ apiKey: "sk_valta_...",
54
+ baseUrl: "https://valta.co", // optional, defaults to production
55
+ });
56
+ ```
57
+
58
+ ### Spending
59
+
60
+ ```typescript
61
+ // Request a spend action
62
+ const result = await valta.requestSpend({
63
+ agentId: "my-agent",
64
+ amount: 10,
65
+ category: "api_calls",
66
+ description: "Call external API",
67
+ });
68
+
69
+ // Check balance
70
+ const { balance, currency } = await valta.getBalance();
71
+ ```
72
+
73
+ ### Policies
74
+
75
+ ```typescript
76
+ // Create a spending policy
77
+ const policy = await valta.createPolicy({
78
+ agentId: "research-agent",
79
+ name: "Research Budget",
80
+ dailyLimit: 100,
81
+ monthlyLimit: 1000,
82
+ maxPerTransaction: 50,
83
+ requireApprovalAbove: 25,
84
+ allowedCategories: ["api_calls", "datasets"],
85
+ });
86
+
87
+ // List all policies
88
+ const policies = await valta.listPolicies();
89
+ ```
90
+
91
+ ### Approvals
92
+
93
+ ```typescript
94
+ // Get pending approvals
95
+ const pending = await valta.getPendingApprovals();
96
+
97
+ // Approve or reject
98
+ await valta.approveRequest(requestId);
99
+ await valta.rejectRequest(requestId, "Too expensive");
100
+ ```
101
+
102
+ ### Kill Switch
103
+
104
+ ```typescript
105
+ // Freeze an agent immediately
106
+ await valta.freezeAgent("rogue-agent", "Suspicious activity detected");
107
+
108
+ // Unfreeze when resolved
109
+ await valta.unfreezeAgent("rogue-agent");
110
+ ```
111
+
112
+ ### Agent Tools
113
+
114
+ ```typescript
115
+ // Get tools configured for an agent
116
+ const tools = await valta.getAgentTools("my-agent");
117
+
118
+ // Toggle a tool on/off
119
+ await valta.toggleTool(toolId, false);
120
+
121
+ // Execute a tool
122
+ const result = await valta.executeTool("my-agent", toolId, { query: "data" });
123
+ ```
124
+
125
+ ### Agent Chains
126
+
127
+ ```typescript
128
+ // Create an agent chain (agent-to-agent workflow)
129
+ const chain = await valta.createChain({
130
+ name: "Research Pipeline",
131
+ steps: [
132
+ { order: 1, agent_id: "research", agent_name: "Research Agent", action: "gather_data", input_from: "user" },
133
+ { order: 2, agent_id: "analysis", agent_name: "Analysis Agent", action: "analyze", input_from: "previous" },
134
+ { order: 3, agent_id: "report", agent_name: "Report Agent", action: "generate_report", input_from: "previous" },
135
+ ],
136
+ });
137
+
138
+ // Execute a chain
139
+ await valta.executeChain(chain.chain_id);
140
+ ```
141
+
142
+ ## Error Handling
143
+
144
+ ```typescript
145
+ import { ValtaError } from "valta-sdk";
146
+
147
+ try {
148
+ await valta.requestSpend({ agentId: "agent", amount: 1000 });
149
+ } catch (error) {
150
+ if (error instanceof ValtaError) {
151
+ console.error(`Valta error (${error.status}):`, error.message);
152
+ }
153
+ }
154
+ ```
155
+
156
+ ## License
157
+
158
+ MIT
package/bin/valta.js ADDED
@@ -0,0 +1,159 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { readFileSync, writeFileSync, existsSync } from "fs";
4
+ import { join } from "path";
5
+ import { homedir } from "os";
6
+
7
+ const CONFIG_FILE = join(homedir(), ".valta", "config.json");
8
+ const VERSION = "2.0.0";
9
+
10
+ function loadConfig() {
11
+ if (!existsSync(CONFIG_FILE)) return {};
12
+ try { return JSON.parse(readFileSync(CONFIG_FILE, "utf8")); } catch { return {}; }
13
+ }
14
+
15
+ function saveConfig(data) {
16
+ const dir = join(homedir(), ".valta");
17
+ if (!existsSync(dir)) {
18
+ const { mkdirSync } = await import("fs");
19
+ mkdirSync(dir, { recursive: true });
20
+ }
21
+ writeFileSync(CONFIG_FILE, JSON.stringify(data, null, 2));
22
+ }
23
+
24
+ const args = process.argv.slice(2);
25
+ const command = args[0];
26
+
27
+ const help = `
28
+ Valta CLI v${VERSION}
29
+
30
+ COMMANDS
31
+ valta init Initialize a new Valta project
32
+ valta login Save your API key
33
+ valta create-agent Generate an agent starter file
34
+ valta run Run a quick agent query
35
+ valta --version Show CLI version
36
+ valta help Show this help
37
+
38
+ EXAMPLES
39
+ valta login
40
+ valta create-agent trading
41
+ valta run "What is BTC doing today?" --agent trading_signal
42
+ `;
43
+
44
+ async function main() {
45
+ switch (command) {
46
+ case "init": {
47
+ const template = `// Valta project starter
48
+ // https://valta.co/docs
49
+
50
+ import { ValtaClient } from "valta-sdk";
51
+
52
+ const valta = new ValtaClient({
53
+ apiKey: process.env.VALTA_API_KEY,
54
+ });
55
+
56
+ // List available agents
57
+ const agents = await valta.listAgents();
58
+ console.log("Available agents:", agents.map(a => a.name));
59
+
60
+ // Chat with the Trading Signal agent
61
+ const agent = valta.createAgent("trading_signal");
62
+ const response = await agent.chat("What is BTC doing today?");
63
+ console.log(response.message);
64
+ `;
65
+ writeFileSync("valta-starter.js", template);
66
+ console.log("✓ Created valta-starter.js");
67
+ console.log(" Run: node valta-starter.js");
68
+ break;
69
+ }
70
+
71
+ case "login": {
72
+ const { createInterface } = await import("readline");
73
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
74
+ rl.question("Enter your Valta API key (from /dashboard/api-keys): ", (key) => {
75
+ rl.close();
76
+ const trimmed = key.trim();
77
+ if (!trimmed) { console.error("✗ No API key provided"); process.exit(1); }
78
+ const cfg = loadConfig();
79
+ cfg.apiKey = trimmed;
80
+ try { saveConfig(cfg); } catch {
81
+ const { mkdirSync } = require("fs");
82
+ mkdirSync(join(homedir(), ".valta"), { recursive: true });
83
+ saveConfig(cfg);
84
+ }
85
+ console.log(`✓ API key saved to ${CONFIG_FILE}`);
86
+ console.log(" You can now import it as: VALTA_API_KEY from your environment.");
87
+ });
88
+ break;
89
+ }
90
+
91
+ case "create-agent": {
92
+ const type = args[1] || "general";
93
+ const fileName = `${type}Agent.js`;
94
+ const agentTemplate = `// ${type.charAt(0).toUpperCase() + type.slice(1)} Agent — Valta SDK
95
+ import { ValtaClient } from "valta-sdk";
96
+
97
+ const valta = new ValtaClient({ apiKey: process.env.VALTA_API_KEY });
98
+ const agent = valta.createAgent("${type}_agent");
99
+
100
+ const response = await agent.chat("Your question here");
101
+ console.log(response.message);
102
+ `;
103
+ writeFileSync(fileName, agentTemplate);
104
+ console.log(`✓ Created ${fileName}`);
105
+ break;
106
+ }
107
+
108
+ case "run": {
109
+ const message = args[1];
110
+ const agentFlag = args.indexOf("--agent");
111
+ const agentId = agentFlag !== -1 ? args[agentFlag + 1] : "financial_advisor";
112
+
113
+ if (!message) {
114
+ console.error("Usage: valta run \"your question\" --agent <agent_id>");
115
+ process.exit(1);
116
+ }
117
+
118
+ const cfg = loadConfig();
119
+ const apiKey = cfg.apiKey || process.env.VALTA_API_KEY;
120
+ if (!apiKey) {
121
+ console.error("✗ No API key. Run: valta login");
122
+ process.exit(1);
123
+ }
124
+
125
+ console.log(`Running ${agentId}...`);
126
+ const res = await fetch(`https://valta.co/api/bot/${encodeURIComponent(agentId)}/chat`, {
127
+ method: "POST",
128
+ headers: { "Content-Type": "application/json", "Authorization": `Bearer ${apiKey}` },
129
+ body: JSON.stringify({ message }),
130
+ });
131
+ const data = await res.json();
132
+ if (!res.ok) { console.error("✗", data.error || "Request failed"); process.exit(1); }
133
+ console.log("\n" + (data.message || data.response || JSON.stringify(data)));
134
+ break;
135
+ }
136
+
137
+ case "--version":
138
+ case "-v":
139
+ console.log(`valta-sdk v${VERSION}`);
140
+ break;
141
+
142
+ case "help":
143
+ case "--help":
144
+ case "-h":
145
+ case undefined:
146
+ console.log(help);
147
+ break;
148
+
149
+ default:
150
+ console.error(`Unknown command: ${command}`);
151
+ console.log(help);
152
+ process.exit(1);
153
+ }
154
+ }
155
+
156
+ main().catch((err) => {
157
+ console.error("✗", err.message);
158
+ process.exit(1);
159
+ });
@@ -0,0 +1,167 @@
1
+ interface ValtaConfig {
2
+ /** Your Valta API key — get it from /dashboard/api-keys */
3
+ apiKey: string;
4
+ /** Base URL. Defaults to https://valta.co */
5
+ baseUrl?: string;
6
+ /** Optional timeout in milliseconds. Default: 30000 */
7
+ timeout?: number;
8
+ }
9
+
10
+ type AgentCategory = "finance" | "trading" | "analytics" | "development" | "marketing" | "compliance" | "research" | "general";
11
+ type PlanType = "FREE" | "PRO" | "ENTERPRISE";
12
+ interface AgentConfig {
13
+ agentId: string;
14
+ name: string;
15
+ category: AgentCategory;
16
+ description?: string;
17
+ planRequired?: PlanType;
18
+ isLive?: boolean;
19
+ }
20
+ interface ChatMessage {
21
+ role: "user" | "assistant" | "system";
22
+ content: string;
23
+ }
24
+ interface ChatResponse {
25
+ message: string;
26
+ agentId: string;
27
+ tokens?: number;
28
+ provider?: string;
29
+ }
30
+ interface AutomationConfig {
31
+ name: string;
32
+ agentId: string;
33
+ task: string;
34
+ schedule: "daily" | "every:30m" | "every:1h" | "every:6h" | "every:12h" | "every:168h";
35
+ enabled?: boolean;
36
+ }
37
+ interface Automation {
38
+ automationId: string;
39
+ name: string;
40
+ agentId: string;
41
+ schedule: string;
42
+ enabled: boolean;
43
+ runCount: number;
44
+ lastRunAt: string | null;
45
+ nextRunAt: string | null;
46
+ }
47
+ interface PipelineStep {
48
+ agentId: string;
49
+ task: string;
50
+ }
51
+ interface PipelineConfig {
52
+ name: string;
53
+ description?: string;
54
+ steps: PipelineStep[];
55
+ }
56
+ interface PipelineResult {
57
+ agentId: string;
58
+ agentName: string;
59
+ response: string;
60
+ durationMs: number;
61
+ }
62
+ interface WalletBalance {
63
+ balance: number;
64
+ currency: string;
65
+ }
66
+ interface Transaction {
67
+ txnId: string;
68
+ type: string;
69
+ amount: number;
70
+ status: string;
71
+ createdAt: string;
72
+ }
73
+
74
+ declare class WalletTool {
75
+ private apiKey;
76
+ private baseUrl;
77
+ constructor(apiKey: string, baseUrl: string);
78
+ getBalance(): Promise<WalletBalance>;
79
+ getTransactions(limit?: number): Promise<Transaction[]>;
80
+ getAddress(): Promise<string>;
81
+ }
82
+
83
+ interface AnalyticsSummary {
84
+ totalSpend: number;
85
+ topAgents: Array<{
86
+ agentId: string;
87
+ name: string;
88
+ spend: number;
89
+ }>;
90
+ spendByDay: Array<{
91
+ date: string;
92
+ amount: number;
93
+ }>;
94
+ }
95
+ declare class AnalyticsTool {
96
+ private apiKey;
97
+ private baseUrl;
98
+ constructor(apiKey: string, baseUrl: string);
99
+ getSummary(): Promise<AnalyticsSummary>;
100
+ getAuditTrail(limit?: number): Promise<unknown[]>;
101
+ }
102
+
103
+ declare class TradingAgent {
104
+ private apiKey;
105
+ private baseUrl;
106
+ constructor(apiKey: string, baseUrl: string);
107
+ analyze(question: string): Promise<ChatResponse>;
108
+ getMarketBrief(): Promise<string>;
109
+ getSignals(assets: string[]): Promise<string>;
110
+ }
111
+
112
+ declare class PortfolioAgent {
113
+ private apiKey;
114
+ private baseUrl;
115
+ constructor(apiKey: string, baseUrl: string);
116
+ analyze(question: string): Promise<ChatResponse>;
117
+ getReport(): Promise<string>;
118
+ getRebalancingSuggestions(targetAllocation: Record<string, number>): Promise<string>;
119
+ }
120
+
121
+ type Plugin = (client: ValtaClient) => void;
122
+ declare class ValtaClient {
123
+ readonly apiKey: string;
124
+ readonly baseUrl: string;
125
+ readonly wallet: WalletTool;
126
+ readonly analytics: AnalyticsTool;
127
+ readonly trading: TradingAgent;
128
+ readonly portfolio: PortfolioAgent;
129
+ private plugins;
130
+ constructor(config: ValtaConfig);
131
+ use(plugin: Plugin): this;
132
+ listAgents(): Promise<AgentConfig[]>;
133
+ createAgent(agentId: string): AgentHandle;
134
+ createAutomation(config: AutomationConfig): Promise<Automation>;
135
+ listAutomations(): Promise<Automation[]>;
136
+ runAutomation(automationId: string): Promise<{
137
+ response: string | null;
138
+ }>;
139
+ createPipeline(config: PipelineConfig): Promise<string>;
140
+ runPipeline(pipelineId: string): Promise<PipelineResult[]>;
141
+ }
142
+ declare class AgentHandle {
143
+ private apiKey;
144
+ private baseUrl;
145
+ readonly agentId: string;
146
+ constructor(apiKey: string, baseUrl: string, agentId: string);
147
+ chat(message: string, conversationId?: string): Promise<ChatResponse>;
148
+ run(): this;
149
+ }
150
+
151
+ declare class ValtaError extends Error {
152
+ status: number;
153
+ code?: string;
154
+ constructor(message: string, status?: number, code?: string);
155
+ }
156
+ declare class ValtaAuthError extends ValtaError {
157
+ constructor(message?: string);
158
+ }
159
+ declare class ValtaRateLimitError extends ValtaError {
160
+ retryAfter?: number;
161
+ constructor(message?: string, retryAfter?: number);
162
+ }
163
+ declare class ValtaUpgradeError extends ValtaError {
164
+ constructor(message?: string);
165
+ }
166
+
167
+ export { type AgentCategory, type AgentConfig, AgentHandle, AnalyticsTool, type Automation, type AutomationConfig, type ChatMessage, type ChatResponse, type PipelineConfig, type PipelineResult, type PipelineStep, type PlanType, PortfolioAgent, TradingAgent, type Transaction, ValtaAuthError, ValtaClient, type ValtaConfig, ValtaError, ValtaRateLimitError, ValtaUpgradeError, type WalletBalance, WalletTool, ValtaClient as default };
@@ -0,0 +1,167 @@
1
+ interface ValtaConfig {
2
+ /** Your Valta API key — get it from /dashboard/api-keys */
3
+ apiKey: string;
4
+ /** Base URL. Defaults to https://valta.co */
5
+ baseUrl?: string;
6
+ /** Optional timeout in milliseconds. Default: 30000 */
7
+ timeout?: number;
8
+ }
9
+
10
+ type AgentCategory = "finance" | "trading" | "analytics" | "development" | "marketing" | "compliance" | "research" | "general";
11
+ type PlanType = "FREE" | "PRO" | "ENTERPRISE";
12
+ interface AgentConfig {
13
+ agentId: string;
14
+ name: string;
15
+ category: AgentCategory;
16
+ description?: string;
17
+ planRequired?: PlanType;
18
+ isLive?: boolean;
19
+ }
20
+ interface ChatMessage {
21
+ role: "user" | "assistant" | "system";
22
+ content: string;
23
+ }
24
+ interface ChatResponse {
25
+ message: string;
26
+ agentId: string;
27
+ tokens?: number;
28
+ provider?: string;
29
+ }
30
+ interface AutomationConfig {
31
+ name: string;
32
+ agentId: string;
33
+ task: string;
34
+ schedule: "daily" | "every:30m" | "every:1h" | "every:6h" | "every:12h" | "every:168h";
35
+ enabled?: boolean;
36
+ }
37
+ interface Automation {
38
+ automationId: string;
39
+ name: string;
40
+ agentId: string;
41
+ schedule: string;
42
+ enabled: boolean;
43
+ runCount: number;
44
+ lastRunAt: string | null;
45
+ nextRunAt: string | null;
46
+ }
47
+ interface PipelineStep {
48
+ agentId: string;
49
+ task: string;
50
+ }
51
+ interface PipelineConfig {
52
+ name: string;
53
+ description?: string;
54
+ steps: PipelineStep[];
55
+ }
56
+ interface PipelineResult {
57
+ agentId: string;
58
+ agentName: string;
59
+ response: string;
60
+ durationMs: number;
61
+ }
62
+ interface WalletBalance {
63
+ balance: number;
64
+ currency: string;
65
+ }
66
+ interface Transaction {
67
+ txnId: string;
68
+ type: string;
69
+ amount: number;
70
+ status: string;
71
+ createdAt: string;
72
+ }
73
+
74
+ declare class WalletTool {
75
+ private apiKey;
76
+ private baseUrl;
77
+ constructor(apiKey: string, baseUrl: string);
78
+ getBalance(): Promise<WalletBalance>;
79
+ getTransactions(limit?: number): Promise<Transaction[]>;
80
+ getAddress(): Promise<string>;
81
+ }
82
+
83
+ interface AnalyticsSummary {
84
+ totalSpend: number;
85
+ topAgents: Array<{
86
+ agentId: string;
87
+ name: string;
88
+ spend: number;
89
+ }>;
90
+ spendByDay: Array<{
91
+ date: string;
92
+ amount: number;
93
+ }>;
94
+ }
95
+ declare class AnalyticsTool {
96
+ private apiKey;
97
+ private baseUrl;
98
+ constructor(apiKey: string, baseUrl: string);
99
+ getSummary(): Promise<AnalyticsSummary>;
100
+ getAuditTrail(limit?: number): Promise<unknown[]>;
101
+ }
102
+
103
+ declare class TradingAgent {
104
+ private apiKey;
105
+ private baseUrl;
106
+ constructor(apiKey: string, baseUrl: string);
107
+ analyze(question: string): Promise<ChatResponse>;
108
+ getMarketBrief(): Promise<string>;
109
+ getSignals(assets: string[]): Promise<string>;
110
+ }
111
+
112
+ declare class PortfolioAgent {
113
+ private apiKey;
114
+ private baseUrl;
115
+ constructor(apiKey: string, baseUrl: string);
116
+ analyze(question: string): Promise<ChatResponse>;
117
+ getReport(): Promise<string>;
118
+ getRebalancingSuggestions(targetAllocation: Record<string, number>): Promise<string>;
119
+ }
120
+
121
+ type Plugin = (client: ValtaClient) => void;
122
+ declare class ValtaClient {
123
+ readonly apiKey: string;
124
+ readonly baseUrl: string;
125
+ readonly wallet: WalletTool;
126
+ readonly analytics: AnalyticsTool;
127
+ readonly trading: TradingAgent;
128
+ readonly portfolio: PortfolioAgent;
129
+ private plugins;
130
+ constructor(config: ValtaConfig);
131
+ use(plugin: Plugin): this;
132
+ listAgents(): Promise<AgentConfig[]>;
133
+ createAgent(agentId: string): AgentHandle;
134
+ createAutomation(config: AutomationConfig): Promise<Automation>;
135
+ listAutomations(): Promise<Automation[]>;
136
+ runAutomation(automationId: string): Promise<{
137
+ response: string | null;
138
+ }>;
139
+ createPipeline(config: PipelineConfig): Promise<string>;
140
+ runPipeline(pipelineId: string): Promise<PipelineResult[]>;
141
+ }
142
+ declare class AgentHandle {
143
+ private apiKey;
144
+ private baseUrl;
145
+ readonly agentId: string;
146
+ constructor(apiKey: string, baseUrl: string, agentId: string);
147
+ chat(message: string, conversationId?: string): Promise<ChatResponse>;
148
+ run(): this;
149
+ }
150
+
151
+ declare class ValtaError extends Error {
152
+ status: number;
153
+ code?: string;
154
+ constructor(message: string, status?: number, code?: string);
155
+ }
156
+ declare class ValtaAuthError extends ValtaError {
157
+ constructor(message?: string);
158
+ }
159
+ declare class ValtaRateLimitError extends ValtaError {
160
+ retryAfter?: number;
161
+ constructor(message?: string, retryAfter?: number);
162
+ }
163
+ declare class ValtaUpgradeError extends ValtaError {
164
+ constructor(message?: string);
165
+ }
166
+
167
+ export { type AgentCategory, type AgentConfig, AgentHandle, AnalyticsTool, type Automation, type AutomationConfig, type ChatMessage, type ChatResponse, type PipelineConfig, type PipelineResult, type PipelineStep, type PlanType, PortfolioAgent, TradingAgent, type Transaction, ValtaAuthError, ValtaClient, type ValtaConfig, ValtaError, ValtaRateLimitError, ValtaUpgradeError, type WalletBalance, WalletTool, ValtaClient as default };
package/dist/index.js ADDED
@@ -0,0 +1,355 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ AgentHandle: () => AgentHandle,
24
+ AnalyticsTool: () => AnalyticsTool,
25
+ PortfolioAgent: () => PortfolioAgent,
26
+ TradingAgent: () => TradingAgent,
27
+ ValtaAuthError: () => ValtaAuthError,
28
+ ValtaClient: () => ValtaClient,
29
+ ValtaError: () => ValtaError,
30
+ ValtaRateLimitError: () => ValtaRateLimitError,
31
+ ValtaUpgradeError: () => ValtaUpgradeError,
32
+ WalletTool: () => WalletTool,
33
+ default: () => ValtaClient
34
+ });
35
+ module.exports = __toCommonJS(index_exports);
36
+
37
+ // src/core/config.ts
38
+ var DEFAULT_BASE_URL = "https://valta.co";
39
+ function validateConfig(config) {
40
+ if (!config.apiKey || typeof config.apiKey !== "string") {
41
+ throw new Error("ValtaClient: apiKey is required. Get yours at https://valta.co/dashboard/api-keys");
42
+ }
43
+ return {
44
+ apiKey: config.apiKey.trim(),
45
+ baseUrl: (config.baseUrl || DEFAULT_BASE_URL).replace(/\/$/, ""),
46
+ timeout: config.timeout || 3e4
47
+ };
48
+ }
49
+
50
+ // src/utils/errors.ts
51
+ var ValtaError = class extends Error {
52
+ constructor(message, status = 500, code) {
53
+ super(message);
54
+ this.name = "ValtaError";
55
+ this.status = status;
56
+ this.code = code;
57
+ }
58
+ };
59
+ var ValtaAuthError = class extends ValtaError {
60
+ constructor(message = "Invalid or missing API key") {
61
+ super(message, 401, "AUTH_ERROR");
62
+ this.name = "ValtaAuthError";
63
+ }
64
+ };
65
+ var ValtaRateLimitError = class extends ValtaError {
66
+ constructor(message = "Rate limit exceeded", retryAfter) {
67
+ super(message, 429, "RATE_LIMIT");
68
+ this.name = "ValtaRateLimitError";
69
+ this.retryAfter = retryAfter;
70
+ }
71
+ };
72
+ var ValtaUpgradeError = class extends ValtaError {
73
+ constructor(message = "Upgrade your plan to access this feature") {
74
+ super(message, 403, "UPGRADE_REQUIRED");
75
+ this.name = "ValtaUpgradeError";
76
+ }
77
+ };
78
+
79
+ // src/utils/http.ts
80
+ async function request(apiKey, baseUrl, method, path, body) {
81
+ const url = `${baseUrl.replace(/\/$/, "")}${path}`;
82
+ const res = await fetch(url, {
83
+ method,
84
+ headers: {
85
+ "Content-Type": "application/json",
86
+ "Authorization": `Bearer ${apiKey}`,
87
+ "X-Valta-SDK": "1.0.0"
88
+ },
89
+ body: body ? JSON.stringify(body) : void 0
90
+ });
91
+ if (!res.ok) {
92
+ let parsed;
93
+ try {
94
+ parsed = await res.json();
95
+ } catch {
96
+ parsed = {};
97
+ }
98
+ const message = parsed?.error || parsed?.message || `HTTP ${res.status}`;
99
+ const code = parsed?.code;
100
+ if (res.status === 401) throw new ValtaAuthError(message);
101
+ if (res.status === 403) throw new ValtaUpgradeError(message);
102
+ if (res.status === 429) {
103
+ const retryAfter = Number(res.headers.get("retry-after")) || void 0;
104
+ throw new ValtaRateLimitError(message, retryAfter);
105
+ }
106
+ throw new ValtaError(message, res.status, code);
107
+ }
108
+ return res.json();
109
+ }
110
+ async function get(apiKey, baseUrl, path) {
111
+ return request(apiKey, baseUrl, "GET", path);
112
+ }
113
+ async function post(apiKey, baseUrl, path, body) {
114
+ return request(apiKey, baseUrl, "POST", path, body);
115
+ }
116
+
117
+ // src/tools/wallet.ts
118
+ var WalletTool = class {
119
+ constructor(apiKey, baseUrl) {
120
+ this.apiKey = apiKey;
121
+ this.baseUrl = baseUrl;
122
+ }
123
+ async getBalance() {
124
+ const res = await get(
125
+ this.apiKey,
126
+ this.baseUrl,
127
+ "/api/user/wallet/balance"
128
+ );
129
+ return { balance: res.balance || 0, currency: res.currency || "USDC" };
130
+ }
131
+ async getTransactions(limit = 20) {
132
+ const res = await get(
133
+ this.apiKey,
134
+ this.baseUrl,
135
+ `/api/user/transactions?limit=${limit}`
136
+ );
137
+ return res.transactions || res.data || [];
138
+ }
139
+ async getAddress() {
140
+ const res = await get(
141
+ this.apiKey,
142
+ this.baseUrl,
143
+ "/api/user/wallet"
144
+ );
145
+ return res.address || res.walletAddress || "";
146
+ }
147
+ };
148
+
149
+ // src/tools/analytics.ts
150
+ var AnalyticsTool = class {
151
+ constructor(apiKey, baseUrl) {
152
+ this.apiKey = apiKey;
153
+ this.baseUrl = baseUrl;
154
+ }
155
+ async getSummary() {
156
+ const res = await get(
157
+ this.apiKey,
158
+ this.baseUrl,
159
+ "/api/user/analytics"
160
+ );
161
+ return res.summary || { totalSpend: 0, topAgents: [], spendByDay: [] };
162
+ }
163
+ async getAuditTrail(limit = 50) {
164
+ const res = await get(
165
+ this.apiKey,
166
+ this.baseUrl,
167
+ `/api/user/audit-trail?limit=${limit}`
168
+ );
169
+ return res.events || [];
170
+ }
171
+ };
172
+
173
+ // src/agents/tradingAgent.ts
174
+ var TRADING_AGENT_ID = "trading_signal";
175
+ var TradingAgent = class {
176
+ constructor(apiKey, baseUrl) {
177
+ this.apiKey = apiKey;
178
+ this.baseUrl = baseUrl;
179
+ }
180
+ async analyze(question) {
181
+ const res = await post(
182
+ this.apiKey,
183
+ this.baseUrl,
184
+ `/api/bot/${TRADING_AGENT_ID}/chat`,
185
+ { message: question }
186
+ );
187
+ return { message: res.message || "", agentId: TRADING_AGENT_ID, tokens: res.tokens, provider: res.provider };
188
+ }
189
+ async getMarketBrief() {
190
+ const res = await this.analyze(
191
+ "Give me a brief market analysis for BTC, ETH, and SOL. Include price action, key levels, and sentiment."
192
+ );
193
+ return res.message;
194
+ }
195
+ async getSignals(assets) {
196
+ const assetList = assets.join(", ").toUpperCase();
197
+ const res = await this.analyze(
198
+ `Provide buy/sell/hold signals for: ${assetList}. Include entry price, target, and stop-loss.`
199
+ );
200
+ return res.message;
201
+ }
202
+ };
203
+
204
+ // src/agents/portfolioAgent.ts
205
+ var PORTFOLIO_AGENT_ID = "portfolio_analyzer";
206
+ var PortfolioAgent = class {
207
+ constructor(apiKey, baseUrl) {
208
+ this.apiKey = apiKey;
209
+ this.baseUrl = baseUrl;
210
+ }
211
+ async analyze(question) {
212
+ const res = await post(
213
+ this.apiKey,
214
+ this.baseUrl,
215
+ `/api/bot/${PORTFOLIO_AGENT_ID}/chat`,
216
+ { message: question }
217
+ );
218
+ return { message: res.message || "", agentId: PORTFOLIO_AGENT_ID, tokens: res.tokens, provider: res.provider };
219
+ }
220
+ async getReport() {
221
+ const res = await this.analyze(
222
+ "Generate a full portfolio health report. Include current allocation, risk score, and rebalancing suggestions."
223
+ );
224
+ return res.message;
225
+ }
226
+ async getRebalancingSuggestions(targetAllocation) {
227
+ const allocStr = Object.entries(targetAllocation).map(([asset, pct]) => `${asset}: ${pct}%`).join(", ");
228
+ const res = await this.analyze(
229
+ `Suggest how to rebalance my portfolio to reach this target allocation: ${allocStr}`
230
+ );
231
+ return res.message;
232
+ }
233
+ };
234
+
235
+ // src/core/client.ts
236
+ var ValtaClient = class {
237
+ constructor(config) {
238
+ this.plugins = [];
239
+ const validated = validateConfig(config);
240
+ this.apiKey = validated.apiKey;
241
+ this.baseUrl = validated.baseUrl;
242
+ this.wallet = new WalletTool(this.apiKey, this.baseUrl);
243
+ this.analytics = new AnalyticsTool(this.apiKey, this.baseUrl);
244
+ this.trading = new TradingAgent(this.apiKey, this.baseUrl);
245
+ this.portfolio = new PortfolioAgent(this.apiKey, this.baseUrl);
246
+ }
247
+ // ── Plugin system (express-style middleware) ────────────────
248
+ use(plugin) {
249
+ plugin(this);
250
+ this.plugins.push(plugin);
251
+ return this;
252
+ }
253
+ // ── Agents ──────────────────────────────────────────────────
254
+ async listAgents() {
255
+ const res = await get(
256
+ this.apiKey,
257
+ this.baseUrl,
258
+ "/api/agents"
259
+ );
260
+ return res.agents || res.capabilities || [];
261
+ }
262
+ createAgent(agentId) {
263
+ return new AgentHandle(this.apiKey, this.baseUrl, agentId);
264
+ }
265
+ // ── Automations ─────────────────────────────────────────────
266
+ async createAutomation(config) {
267
+ const res = await post(
268
+ this.apiKey,
269
+ this.baseUrl,
270
+ "/api/user/automations",
271
+ {
272
+ name: config.name,
273
+ triggerType: "schedule",
274
+ schedule: config.schedule,
275
+ agentId: config.agentId,
276
+ enabled: config.enabled ?? true,
277
+ payload: JSON.stringify({ task: config.task })
278
+ }
279
+ );
280
+ const list = await this.listAutomations();
281
+ return list.find((a) => a.automationId === res.automationId) || { automationId: res.automationId };
282
+ }
283
+ async listAutomations() {
284
+ const res = await get(
285
+ this.apiKey,
286
+ this.baseUrl,
287
+ "/api/user/automations"
288
+ );
289
+ return res.automations || [];
290
+ }
291
+ async runAutomation(automationId) {
292
+ const res = await post(
293
+ this.apiKey,
294
+ this.baseUrl,
295
+ `/api/user/automations/${encodeURIComponent(automationId)}/run`
296
+ );
297
+ return { response: res.result?.agentResponse || null };
298
+ }
299
+ // ── Multi-Agent Pipelines (Enterprise) ──────────────────────
300
+ async createPipeline(config) {
301
+ const res = await post(
302
+ this.apiKey,
303
+ this.baseUrl,
304
+ "/api/user/pipelines",
305
+ config
306
+ );
307
+ return res.pipelineId;
308
+ }
309
+ async runPipeline(pipelineId) {
310
+ const res = await post(
311
+ this.apiKey,
312
+ this.baseUrl,
313
+ `/api/user/pipelines/${encodeURIComponent(pipelineId)}/run`
314
+ );
315
+ return res.results || [];
316
+ }
317
+ };
318
+ var AgentHandle = class {
319
+ constructor(apiKey, baseUrl, agentId) {
320
+ this.apiKey = apiKey;
321
+ this.baseUrl = baseUrl;
322
+ this.agentId = agentId;
323
+ }
324
+ async chat(message, conversationId) {
325
+ const res = await post(
326
+ this.apiKey,
327
+ this.baseUrl,
328
+ `/api/bot/${encodeURIComponent(this.agentId)}/chat`,
329
+ { message, conversationId }
330
+ );
331
+ return {
332
+ message: res.message || "",
333
+ agentId: this.agentId,
334
+ tokens: res.tokens,
335
+ provider: res.provider
336
+ };
337
+ }
338
+ run() {
339
+ console.log(`Agent ${this.agentId} is ready. Use .chat(message) to interact.`);
340
+ return this;
341
+ }
342
+ };
343
+ // Annotate the CommonJS export names for ESM import in node:
344
+ 0 && (module.exports = {
345
+ AgentHandle,
346
+ AnalyticsTool,
347
+ PortfolioAgent,
348
+ TradingAgent,
349
+ ValtaAuthError,
350
+ ValtaClient,
351
+ ValtaError,
352
+ ValtaRateLimitError,
353
+ ValtaUpgradeError,
354
+ WalletTool
355
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,319 @@
1
+ // src/core/config.ts
2
+ var DEFAULT_BASE_URL = "https://valta.co";
3
+ function validateConfig(config) {
4
+ if (!config.apiKey || typeof config.apiKey !== "string") {
5
+ throw new Error("ValtaClient: apiKey is required. Get yours at https://valta.co/dashboard/api-keys");
6
+ }
7
+ return {
8
+ apiKey: config.apiKey.trim(),
9
+ baseUrl: (config.baseUrl || DEFAULT_BASE_URL).replace(/\/$/, ""),
10
+ timeout: config.timeout || 3e4
11
+ };
12
+ }
13
+
14
+ // src/utils/errors.ts
15
+ var ValtaError = class extends Error {
16
+ constructor(message, status = 500, code) {
17
+ super(message);
18
+ this.name = "ValtaError";
19
+ this.status = status;
20
+ this.code = code;
21
+ }
22
+ };
23
+ var ValtaAuthError = class extends ValtaError {
24
+ constructor(message = "Invalid or missing API key") {
25
+ super(message, 401, "AUTH_ERROR");
26
+ this.name = "ValtaAuthError";
27
+ }
28
+ };
29
+ var ValtaRateLimitError = class extends ValtaError {
30
+ constructor(message = "Rate limit exceeded", retryAfter) {
31
+ super(message, 429, "RATE_LIMIT");
32
+ this.name = "ValtaRateLimitError";
33
+ this.retryAfter = retryAfter;
34
+ }
35
+ };
36
+ var ValtaUpgradeError = class extends ValtaError {
37
+ constructor(message = "Upgrade your plan to access this feature") {
38
+ super(message, 403, "UPGRADE_REQUIRED");
39
+ this.name = "ValtaUpgradeError";
40
+ }
41
+ };
42
+
43
+ // src/utils/http.ts
44
+ async function request(apiKey, baseUrl, method, path, body) {
45
+ const url = `${baseUrl.replace(/\/$/, "")}${path}`;
46
+ const res = await fetch(url, {
47
+ method,
48
+ headers: {
49
+ "Content-Type": "application/json",
50
+ "Authorization": `Bearer ${apiKey}`,
51
+ "X-Valta-SDK": "1.0.0"
52
+ },
53
+ body: body ? JSON.stringify(body) : void 0
54
+ });
55
+ if (!res.ok) {
56
+ let parsed;
57
+ try {
58
+ parsed = await res.json();
59
+ } catch {
60
+ parsed = {};
61
+ }
62
+ const message = parsed?.error || parsed?.message || `HTTP ${res.status}`;
63
+ const code = parsed?.code;
64
+ if (res.status === 401) throw new ValtaAuthError(message);
65
+ if (res.status === 403) throw new ValtaUpgradeError(message);
66
+ if (res.status === 429) {
67
+ const retryAfter = Number(res.headers.get("retry-after")) || void 0;
68
+ throw new ValtaRateLimitError(message, retryAfter);
69
+ }
70
+ throw new ValtaError(message, res.status, code);
71
+ }
72
+ return res.json();
73
+ }
74
+ async function get(apiKey, baseUrl, path) {
75
+ return request(apiKey, baseUrl, "GET", path);
76
+ }
77
+ async function post(apiKey, baseUrl, path, body) {
78
+ return request(apiKey, baseUrl, "POST", path, body);
79
+ }
80
+
81
+ // src/tools/wallet.ts
82
+ var WalletTool = class {
83
+ constructor(apiKey, baseUrl) {
84
+ this.apiKey = apiKey;
85
+ this.baseUrl = baseUrl;
86
+ }
87
+ async getBalance() {
88
+ const res = await get(
89
+ this.apiKey,
90
+ this.baseUrl,
91
+ "/api/user/wallet/balance"
92
+ );
93
+ return { balance: res.balance || 0, currency: res.currency || "USDC" };
94
+ }
95
+ async getTransactions(limit = 20) {
96
+ const res = await get(
97
+ this.apiKey,
98
+ this.baseUrl,
99
+ `/api/user/transactions?limit=${limit}`
100
+ );
101
+ return res.transactions || res.data || [];
102
+ }
103
+ async getAddress() {
104
+ const res = await get(
105
+ this.apiKey,
106
+ this.baseUrl,
107
+ "/api/user/wallet"
108
+ );
109
+ return res.address || res.walletAddress || "";
110
+ }
111
+ };
112
+
113
+ // src/tools/analytics.ts
114
+ var AnalyticsTool = class {
115
+ constructor(apiKey, baseUrl) {
116
+ this.apiKey = apiKey;
117
+ this.baseUrl = baseUrl;
118
+ }
119
+ async getSummary() {
120
+ const res = await get(
121
+ this.apiKey,
122
+ this.baseUrl,
123
+ "/api/user/analytics"
124
+ );
125
+ return res.summary || { totalSpend: 0, topAgents: [], spendByDay: [] };
126
+ }
127
+ async getAuditTrail(limit = 50) {
128
+ const res = await get(
129
+ this.apiKey,
130
+ this.baseUrl,
131
+ `/api/user/audit-trail?limit=${limit}`
132
+ );
133
+ return res.events || [];
134
+ }
135
+ };
136
+
137
+ // src/agents/tradingAgent.ts
138
+ var TRADING_AGENT_ID = "trading_signal";
139
+ var TradingAgent = class {
140
+ constructor(apiKey, baseUrl) {
141
+ this.apiKey = apiKey;
142
+ this.baseUrl = baseUrl;
143
+ }
144
+ async analyze(question) {
145
+ const res = await post(
146
+ this.apiKey,
147
+ this.baseUrl,
148
+ `/api/bot/${TRADING_AGENT_ID}/chat`,
149
+ { message: question }
150
+ );
151
+ return { message: res.message || "", agentId: TRADING_AGENT_ID, tokens: res.tokens, provider: res.provider };
152
+ }
153
+ async getMarketBrief() {
154
+ const res = await this.analyze(
155
+ "Give me a brief market analysis for BTC, ETH, and SOL. Include price action, key levels, and sentiment."
156
+ );
157
+ return res.message;
158
+ }
159
+ async getSignals(assets) {
160
+ const assetList = assets.join(", ").toUpperCase();
161
+ const res = await this.analyze(
162
+ `Provide buy/sell/hold signals for: ${assetList}. Include entry price, target, and stop-loss.`
163
+ );
164
+ return res.message;
165
+ }
166
+ };
167
+
168
+ // src/agents/portfolioAgent.ts
169
+ var PORTFOLIO_AGENT_ID = "portfolio_analyzer";
170
+ var PortfolioAgent = class {
171
+ constructor(apiKey, baseUrl) {
172
+ this.apiKey = apiKey;
173
+ this.baseUrl = baseUrl;
174
+ }
175
+ async analyze(question) {
176
+ const res = await post(
177
+ this.apiKey,
178
+ this.baseUrl,
179
+ `/api/bot/${PORTFOLIO_AGENT_ID}/chat`,
180
+ { message: question }
181
+ );
182
+ return { message: res.message || "", agentId: PORTFOLIO_AGENT_ID, tokens: res.tokens, provider: res.provider };
183
+ }
184
+ async getReport() {
185
+ const res = await this.analyze(
186
+ "Generate a full portfolio health report. Include current allocation, risk score, and rebalancing suggestions."
187
+ );
188
+ return res.message;
189
+ }
190
+ async getRebalancingSuggestions(targetAllocation) {
191
+ const allocStr = Object.entries(targetAllocation).map(([asset, pct]) => `${asset}: ${pct}%`).join(", ");
192
+ const res = await this.analyze(
193
+ `Suggest how to rebalance my portfolio to reach this target allocation: ${allocStr}`
194
+ );
195
+ return res.message;
196
+ }
197
+ };
198
+
199
+ // src/core/client.ts
200
+ var ValtaClient = class {
201
+ constructor(config) {
202
+ this.plugins = [];
203
+ const validated = validateConfig(config);
204
+ this.apiKey = validated.apiKey;
205
+ this.baseUrl = validated.baseUrl;
206
+ this.wallet = new WalletTool(this.apiKey, this.baseUrl);
207
+ this.analytics = new AnalyticsTool(this.apiKey, this.baseUrl);
208
+ this.trading = new TradingAgent(this.apiKey, this.baseUrl);
209
+ this.portfolio = new PortfolioAgent(this.apiKey, this.baseUrl);
210
+ }
211
+ // ── Plugin system (express-style middleware) ────────────────
212
+ use(plugin) {
213
+ plugin(this);
214
+ this.plugins.push(plugin);
215
+ return this;
216
+ }
217
+ // ── Agents ──────────────────────────────────────────────────
218
+ async listAgents() {
219
+ const res = await get(
220
+ this.apiKey,
221
+ this.baseUrl,
222
+ "/api/agents"
223
+ );
224
+ return res.agents || res.capabilities || [];
225
+ }
226
+ createAgent(agentId) {
227
+ return new AgentHandle(this.apiKey, this.baseUrl, agentId);
228
+ }
229
+ // ── Automations ─────────────────────────────────────────────
230
+ async createAutomation(config) {
231
+ const res = await post(
232
+ this.apiKey,
233
+ this.baseUrl,
234
+ "/api/user/automations",
235
+ {
236
+ name: config.name,
237
+ triggerType: "schedule",
238
+ schedule: config.schedule,
239
+ agentId: config.agentId,
240
+ enabled: config.enabled ?? true,
241
+ payload: JSON.stringify({ task: config.task })
242
+ }
243
+ );
244
+ const list = await this.listAutomations();
245
+ return list.find((a) => a.automationId === res.automationId) || { automationId: res.automationId };
246
+ }
247
+ async listAutomations() {
248
+ const res = await get(
249
+ this.apiKey,
250
+ this.baseUrl,
251
+ "/api/user/automations"
252
+ );
253
+ return res.automations || [];
254
+ }
255
+ async runAutomation(automationId) {
256
+ const res = await post(
257
+ this.apiKey,
258
+ this.baseUrl,
259
+ `/api/user/automations/${encodeURIComponent(automationId)}/run`
260
+ );
261
+ return { response: res.result?.agentResponse || null };
262
+ }
263
+ // ── Multi-Agent Pipelines (Enterprise) ──────────────────────
264
+ async createPipeline(config) {
265
+ const res = await post(
266
+ this.apiKey,
267
+ this.baseUrl,
268
+ "/api/user/pipelines",
269
+ config
270
+ );
271
+ return res.pipelineId;
272
+ }
273
+ async runPipeline(pipelineId) {
274
+ const res = await post(
275
+ this.apiKey,
276
+ this.baseUrl,
277
+ `/api/user/pipelines/${encodeURIComponent(pipelineId)}/run`
278
+ );
279
+ return res.results || [];
280
+ }
281
+ };
282
+ var AgentHandle = class {
283
+ constructor(apiKey, baseUrl, agentId) {
284
+ this.apiKey = apiKey;
285
+ this.baseUrl = baseUrl;
286
+ this.agentId = agentId;
287
+ }
288
+ async chat(message, conversationId) {
289
+ const res = await post(
290
+ this.apiKey,
291
+ this.baseUrl,
292
+ `/api/bot/${encodeURIComponent(this.agentId)}/chat`,
293
+ { message, conversationId }
294
+ );
295
+ return {
296
+ message: res.message || "",
297
+ agentId: this.agentId,
298
+ tokens: res.tokens,
299
+ provider: res.provider
300
+ };
301
+ }
302
+ run() {
303
+ console.log(`Agent ${this.agentId} is ready. Use .chat(message) to interact.`);
304
+ return this;
305
+ }
306
+ };
307
+ export {
308
+ AgentHandle,
309
+ AnalyticsTool,
310
+ PortfolioAgent,
311
+ TradingAgent,
312
+ ValtaAuthError,
313
+ ValtaClient,
314
+ ValtaError,
315
+ ValtaRateLimitError,
316
+ ValtaUpgradeError,
317
+ WalletTool,
318
+ ValtaClient as default
319
+ };
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "valta-sdk",
3
+ "version": "2.0.0",
4
+ "description": "Official Valta SDK — AI agents, automations, pipelines, and wallet tools",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
13
+ }
14
+ },
15
+ "bin": "./bin/valta.js",
16
+ "files": [
17
+ "dist",
18
+ "bin"
19
+ ],
20
+ "scripts": {
21
+ "build": "tsup src/index.ts --format cjs,esm --dts",
22
+ "prepublishOnly": "npm run build"
23
+ },
24
+ "keywords": [
25
+ "valta",
26
+ "ai",
27
+ "agent",
28
+ "wallet",
29
+ "automation",
30
+ "pipeline",
31
+ "fintech",
32
+ "sdk",
33
+ "trading",
34
+ "portfolio"
35
+ ],
36
+ "author": "Valta",
37
+ "license": "MIT",
38
+ "homepage": "https://valta.co",
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "git+https://github.com/Billionaire664/Valta.co.git"
42
+ },
43
+ "devDependencies": {
44
+ "tsup": "^8.0.0",
45
+ "typescript": "^5.0.0"
46
+ }
47
+ }