valta-sdk 2.1.8 → 2.2.2
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 +79 -188
- package/bin/valta.js +12 -12
- package/dist/cli/index.js +90 -437
- package/dist/index.cjs +2 -276
- package/dist/index.d.ts +285 -131
- package/dist/index.js +2 -17
- package/package.json +56 -35
- package/dist/chunk-HGO47A3L.mjs +0 -244
- package/dist/chunk-LBY67QV7.js +0 -244
- package/dist/chunk-LPBJPXJO.js +0 -244
- package/dist/cli/index.cjs +0 -678
- package/dist/cli/index.d.cts +0 -2
- package/dist/cli/index.d.mts +0 -2
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/index.mjs +0 -141
- package/dist/index.d.cts +0 -197
- package/dist/index.d.mts +0 -197
- package/dist/index.mjs +0 -17
package/dist/cli/index.mjs
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ValtaClient
|
|
3
|
-
} from "../chunk-HGO47A3L.mjs";
|
|
4
|
-
|
|
5
|
-
// src/cli/commands/login.ts
|
|
6
|
-
import { createInterface } from "readline";
|
|
7
|
-
|
|
8
|
-
// src/cli/config.ts
|
|
9
|
-
import { homedir } from "os";
|
|
10
|
-
import { join } from "path";
|
|
11
|
-
import { readFileSync, writeFileSync, mkdirSync, existsSync } from "fs";
|
|
12
|
-
var CONFIG_DIR = join(homedir(), ".valta");
|
|
13
|
-
var CONFIG_FILE = join(CONFIG_DIR, "config.json");
|
|
14
|
-
function saveConfig(config) {
|
|
15
|
-
if (!existsSync(CONFIG_DIR)) mkdirSync(CONFIG_DIR, { recursive: true });
|
|
16
|
-
writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
|
|
17
|
-
}
|
|
18
|
-
function loadConfig() {
|
|
19
|
-
if (!existsSync(CONFIG_FILE)) return null;
|
|
20
|
-
try {
|
|
21
|
-
return JSON.parse(readFileSync(CONFIG_FILE, "utf-8"));
|
|
22
|
-
} catch {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function clearConfig() {
|
|
27
|
-
if (existsSync(CONFIG_FILE)) writeFileSync(CONFIG_FILE, "{}");
|
|
28
|
-
}
|
|
29
|
-
function getApiKey() {
|
|
30
|
-
return loadConfig()?.apiKey ?? null;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// src/cli/commands/login.ts
|
|
34
|
-
function prompt(question) {
|
|
35
|
-
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
36
|
-
return new Promise((resolve) => {
|
|
37
|
-
rl.question(question, (answer) => {
|
|
38
|
-
rl.close();
|
|
39
|
-
resolve(answer.trim());
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
async function loginCommand() {
|
|
44
|
-
console.log("\n Valta Login\n");
|
|
45
|
-
const apiKey = await prompt(" API Key: ");
|
|
46
|
-
if (!apiKey || !apiKey.startsWith("vk_")) {
|
|
47
|
-
console.error("\n \u2716 Invalid API key. Keys start with vk_\n");
|
|
48
|
-
process.exit(1);
|
|
49
|
-
}
|
|
50
|
-
saveConfig({ apiKey });
|
|
51
|
-
console.log("\n \u2714 API key saved to ~/.valta/config.json");
|
|
52
|
-
console.log(" You can now use the Valta SDK.\n");
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// src/cli/commands/agents.ts
|
|
56
|
-
function getClient() {
|
|
57
|
-
const apiKey = getApiKey();
|
|
58
|
-
if (!apiKey) {
|
|
59
|
-
console.error("\n \u2716 Not logged in. Run: valta login\n");
|
|
60
|
-
process.exit(1);
|
|
61
|
-
}
|
|
62
|
-
return new ValtaClient(apiKey);
|
|
63
|
-
}
|
|
64
|
-
async function agentsListCommand() {
|
|
65
|
-
const client = getClient();
|
|
66
|
-
try {
|
|
67
|
-
const result = await client.agents.list();
|
|
68
|
-
const agents = result.agents;
|
|
69
|
-
if (agents.length === 0) {
|
|
70
|
-
console.log("\n No agents found. Create one at https://valta.co/dashboard\n");
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
console.log("\n ID NAME STATUS");
|
|
74
|
-
console.log(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
|
|
75
|
-
for (const agent of agents) {
|
|
76
|
-
const id = agent.id.padEnd(16);
|
|
77
|
-
const name = agent.name.padEnd(23);
|
|
78
|
-
const status = agent.status;
|
|
79
|
-
console.log(` ${id} ${name} ${status}`);
|
|
80
|
-
}
|
|
81
|
-
console.log();
|
|
82
|
-
} catch (err) {
|
|
83
|
-
console.error(`
|
|
84
|
-
\u2716 ${err instanceof Error ? err.message : "Unknown error"}
|
|
85
|
-
`);
|
|
86
|
-
process.exit(1);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
async function agentsFreezeCommand(agentId) {
|
|
90
|
-
const client = getClient();
|
|
91
|
-
try {
|
|
92
|
-
await client.agents.freeze(agentId);
|
|
93
|
-
console.log(`
|
|
94
|
-
\u2714 Agent ${agentId} frozen.
|
|
95
|
-
`);
|
|
96
|
-
} catch (err) {
|
|
97
|
-
console.error(`
|
|
98
|
-
\u2716 ${err instanceof Error ? err.message : "Unknown error"}
|
|
99
|
-
`);
|
|
100
|
-
process.exit(1);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// src/cli/index.ts
|
|
105
|
-
var [, , command, sub, ...args] = process.argv;
|
|
106
|
-
async function main() {
|
|
107
|
-
switch (command) {
|
|
108
|
-
case "login":
|
|
109
|
-
await loginCommand();
|
|
110
|
-
break;
|
|
111
|
-
case "logout":
|
|
112
|
-
clearConfig();
|
|
113
|
-
console.log("\n \u2714 Logged out. Config cleared.\n");
|
|
114
|
-
break;
|
|
115
|
-
case "agents":
|
|
116
|
-
if (sub === "list" || !sub) {
|
|
117
|
-
await agentsListCommand();
|
|
118
|
-
} else if (sub === "freeze" && args[0]) {
|
|
119
|
-
await agentsFreezeCommand(args[0]);
|
|
120
|
-
} else {
|
|
121
|
-
console.log("\n Usage:");
|
|
122
|
-
console.log(" valta agents list");
|
|
123
|
-
console.log(" valta agents freeze [id]\n");
|
|
124
|
-
}
|
|
125
|
-
break;
|
|
126
|
-
default:
|
|
127
|
-
console.log(`
|
|
128
|
-
Valta CLI
|
|
129
|
-
|
|
130
|
-
Commands:
|
|
131
|
-
valta login Save your API key
|
|
132
|
-
valta logout Clear credentials
|
|
133
|
-
valta agents list List all agents
|
|
134
|
-
valta agents freeze [id] Freeze an agent
|
|
135
|
-
`);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
main().catch((err) => {
|
|
139
|
-
console.error("\n \u2716 Unexpected error:", err.message, "\n");
|
|
140
|
-
process.exit(1);
|
|
141
|
-
});
|
package/dist/index.d.cts
DELETED
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
interface RequestOptions {
|
|
2
|
-
method?: 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
3
|
-
body?: unknown;
|
|
4
|
-
}
|
|
5
|
-
declare class Requester {
|
|
6
|
-
private apiKey;
|
|
7
|
-
private baseUrl;
|
|
8
|
-
constructor(apiKey: string, baseUrl?: string);
|
|
9
|
-
request<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface Agent {
|
|
13
|
-
id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
type: string;
|
|
16
|
-
status: 'active' | 'frozen' | 'paused';
|
|
17
|
-
walletAddress?: string;
|
|
18
|
-
createdAt: string;
|
|
19
|
-
updatedAt: string;
|
|
20
|
-
}
|
|
21
|
-
interface CreateAgentParams {
|
|
22
|
-
name: string;
|
|
23
|
-
type: string;
|
|
24
|
-
description?: string;
|
|
25
|
-
}
|
|
26
|
-
interface ListAgentsParams {
|
|
27
|
-
limit?: number;
|
|
28
|
-
offset?: number;
|
|
29
|
-
status?: 'active' | 'frozen' | 'paused';
|
|
30
|
-
}
|
|
31
|
-
interface ListAgentsResponse {
|
|
32
|
-
agents: Agent[];
|
|
33
|
-
total: number;
|
|
34
|
-
limit: number;
|
|
35
|
-
offset: number;
|
|
36
|
-
}
|
|
37
|
-
declare class AgentsResource {
|
|
38
|
-
private requester;
|
|
39
|
-
constructor(requester: Requester);
|
|
40
|
-
list(params?: ListAgentsParams): Promise<ListAgentsResponse>;
|
|
41
|
-
get(agentId: string): Promise<Agent>;
|
|
42
|
-
create(params: CreateAgentParams): Promise<Agent>;
|
|
43
|
-
update(agentId: string, params: Partial<CreateAgentParams>): Promise<Agent>;
|
|
44
|
-
freeze(agentId: string): Promise<Agent>;
|
|
45
|
-
unfreeze(agentId: string): Promise<Agent>;
|
|
46
|
-
delete(agentId: string): Promise<{
|
|
47
|
-
deleted: boolean;
|
|
48
|
-
id: string;
|
|
49
|
-
}>;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
interface WalletBalance {
|
|
53
|
-
usdc: string;
|
|
54
|
-
usdcPending: string;
|
|
55
|
-
lastUpdated: string;
|
|
56
|
-
}
|
|
57
|
-
interface WalletTransferParams {
|
|
58
|
-
toAgentId?: string;
|
|
59
|
-
toAddress?: string;
|
|
60
|
-
amount: string;
|
|
61
|
-
currency: 'USDC';
|
|
62
|
-
note?: string;
|
|
63
|
-
}
|
|
64
|
-
interface WalletTransfer {
|
|
65
|
-
id: string;
|
|
66
|
-
fromAgentId: string;
|
|
67
|
-
toAgentId?: string;
|
|
68
|
-
toAddress?: string;
|
|
69
|
-
amount: string;
|
|
70
|
-
currency: string;
|
|
71
|
-
status: 'pending' | 'completed' | 'failed';
|
|
72
|
-
createdAt: string;
|
|
73
|
-
}
|
|
74
|
-
declare class WalletsResource {
|
|
75
|
-
private requester;
|
|
76
|
-
constructor(requester: Requester);
|
|
77
|
-
get(agentId: string): Promise<WalletBalance>;
|
|
78
|
-
transfer(agentId: string, params: WalletTransferParams): Promise<WalletTransfer>;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
interface Policy {
|
|
82
|
-
id: string;
|
|
83
|
-
agentId: string;
|
|
84
|
-
name: string;
|
|
85
|
-
maxSpendPerDay?: number;
|
|
86
|
-
maxSpendPerTransaction?: number;
|
|
87
|
-
allowedRecipients?: string[];
|
|
88
|
-
currency: string;
|
|
89
|
-
active: boolean;
|
|
90
|
-
createdAt: string;
|
|
91
|
-
}
|
|
92
|
-
interface CreatePolicyParams {
|
|
93
|
-
agentId: string;
|
|
94
|
-
name: string;
|
|
95
|
-
maxSpendPerDay?: number;
|
|
96
|
-
maxSpendPerTransaction?: number;
|
|
97
|
-
allowedRecipients?: string[];
|
|
98
|
-
currency?: string;
|
|
99
|
-
}
|
|
100
|
-
declare class PoliciesResource {
|
|
101
|
-
private requester;
|
|
102
|
-
constructor(requester: Requester);
|
|
103
|
-
list(agentId?: string): Promise<Policy[]>;
|
|
104
|
-
create(params: CreatePolicyParams): Promise<Policy>;
|
|
105
|
-
update(policyId: string, params: Partial<CreatePolicyParams>): Promise<Policy>;
|
|
106
|
-
delete(policyId: string): Promise<{
|
|
107
|
-
deleted: boolean;
|
|
108
|
-
}>;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
interface AuditLog {
|
|
112
|
-
id: string;
|
|
113
|
-
agentId: string;
|
|
114
|
-
action: string;
|
|
115
|
-
amount?: string;
|
|
116
|
-
currency?: string;
|
|
117
|
-
metadata?: Record<string, unknown>;
|
|
118
|
-
hash: string;
|
|
119
|
-
previousHash: string;
|
|
120
|
-
createdAt: string;
|
|
121
|
-
}
|
|
122
|
-
interface ListAuditParams {
|
|
123
|
-
agentId?: string;
|
|
124
|
-
limit?: number;
|
|
125
|
-
offset?: number;
|
|
126
|
-
from?: string;
|
|
127
|
-
to?: string;
|
|
128
|
-
}
|
|
129
|
-
interface ListAuditResponse {
|
|
130
|
-
logs: AuditLog[];
|
|
131
|
-
total: number;
|
|
132
|
-
}
|
|
133
|
-
declare class AuditResource {
|
|
134
|
-
private requester;
|
|
135
|
-
constructor(requester: Requester);
|
|
136
|
-
list(params?: ListAuditParams): Promise<ListAuditResponse>;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
interface ApiKey {
|
|
140
|
-
id: string;
|
|
141
|
-
name: string;
|
|
142
|
-
prefix: string;
|
|
143
|
-
tier: 'free' | 'builder' | 'startup' | 'enterprise';
|
|
144
|
-
lastUsed?: string;
|
|
145
|
-
createdAt: string;
|
|
146
|
-
}
|
|
147
|
-
interface CreateKeyResponse {
|
|
148
|
-
id: string;
|
|
149
|
-
name: string;
|
|
150
|
-
key: string;
|
|
151
|
-
tier: string;
|
|
152
|
-
createdAt: string;
|
|
153
|
-
}
|
|
154
|
-
declare class KeysResource {
|
|
155
|
-
private requester;
|
|
156
|
-
constructor(requester: Requester);
|
|
157
|
-
list(): Promise<ApiKey[]>;
|
|
158
|
-
create(name: string): Promise<CreateKeyResponse>;
|
|
159
|
-
revoke(keyId: string): Promise<{
|
|
160
|
-
deleted: boolean;
|
|
161
|
-
}>;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
interface ValtaConfig {
|
|
165
|
-
apiKey: string;
|
|
166
|
-
baseUrl?: string;
|
|
167
|
-
}
|
|
168
|
-
declare class ValtaClient {
|
|
169
|
-
agents: AgentsResource;
|
|
170
|
-
wallets: WalletsResource;
|
|
171
|
-
policies: PoliciesResource;
|
|
172
|
-
audit: AuditResource;
|
|
173
|
-
keys: KeysResource;
|
|
174
|
-
constructor(config: ValtaConfig | string);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
declare class ValtaError extends Error {
|
|
178
|
-
code: string;
|
|
179
|
-
status: number;
|
|
180
|
-
constructor(message: string, code: string, status: number);
|
|
181
|
-
}
|
|
182
|
-
declare class AuthError extends ValtaError {
|
|
183
|
-
constructor(message?: string);
|
|
184
|
-
}
|
|
185
|
-
declare class TierError extends ValtaError {
|
|
186
|
-
requiredTier: string;
|
|
187
|
-
upgradeUrl: string;
|
|
188
|
-
constructor(message: string, requiredTier: string);
|
|
189
|
-
}
|
|
190
|
-
declare class RateLimitError extends ValtaError {
|
|
191
|
-
constructor(message?: string);
|
|
192
|
-
}
|
|
193
|
-
declare class NotFoundError extends ValtaError {
|
|
194
|
-
constructor(resource: string);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
export { type Agent, type ApiKey, type AuditLog, AuthError, type CreateAgentParams, type CreateKeyResponse, type CreatePolicyParams, type ListAgentsParams, type ListAuditParams, NotFoundError, type Policy, RateLimitError, TierError, ValtaClient, ValtaError, type WalletBalance, type WalletTransfer, type WalletTransferParams, ValtaClient as default };
|
package/dist/index.d.mts
DELETED
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
interface RequestOptions {
|
|
2
|
-
method?: 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
3
|
-
body?: unknown;
|
|
4
|
-
}
|
|
5
|
-
declare class Requester {
|
|
6
|
-
private apiKey;
|
|
7
|
-
private baseUrl;
|
|
8
|
-
constructor(apiKey: string, baseUrl?: string);
|
|
9
|
-
request<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface Agent {
|
|
13
|
-
id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
type: string;
|
|
16
|
-
status: 'active' | 'frozen' | 'paused';
|
|
17
|
-
walletAddress?: string;
|
|
18
|
-
createdAt: string;
|
|
19
|
-
updatedAt: string;
|
|
20
|
-
}
|
|
21
|
-
interface CreateAgentParams {
|
|
22
|
-
name: string;
|
|
23
|
-
type: string;
|
|
24
|
-
description?: string;
|
|
25
|
-
}
|
|
26
|
-
interface ListAgentsParams {
|
|
27
|
-
limit?: number;
|
|
28
|
-
offset?: number;
|
|
29
|
-
status?: 'active' | 'frozen' | 'paused';
|
|
30
|
-
}
|
|
31
|
-
interface ListAgentsResponse {
|
|
32
|
-
agents: Agent[];
|
|
33
|
-
total: number;
|
|
34
|
-
limit: number;
|
|
35
|
-
offset: number;
|
|
36
|
-
}
|
|
37
|
-
declare class AgentsResource {
|
|
38
|
-
private requester;
|
|
39
|
-
constructor(requester: Requester);
|
|
40
|
-
list(params?: ListAgentsParams): Promise<ListAgentsResponse>;
|
|
41
|
-
get(agentId: string): Promise<Agent>;
|
|
42
|
-
create(params: CreateAgentParams): Promise<Agent>;
|
|
43
|
-
update(agentId: string, params: Partial<CreateAgentParams>): Promise<Agent>;
|
|
44
|
-
freeze(agentId: string): Promise<Agent>;
|
|
45
|
-
unfreeze(agentId: string): Promise<Agent>;
|
|
46
|
-
delete(agentId: string): Promise<{
|
|
47
|
-
deleted: boolean;
|
|
48
|
-
id: string;
|
|
49
|
-
}>;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
interface WalletBalance {
|
|
53
|
-
usdc: string;
|
|
54
|
-
usdcPending: string;
|
|
55
|
-
lastUpdated: string;
|
|
56
|
-
}
|
|
57
|
-
interface WalletTransferParams {
|
|
58
|
-
toAgentId?: string;
|
|
59
|
-
toAddress?: string;
|
|
60
|
-
amount: string;
|
|
61
|
-
currency: 'USDC';
|
|
62
|
-
note?: string;
|
|
63
|
-
}
|
|
64
|
-
interface WalletTransfer {
|
|
65
|
-
id: string;
|
|
66
|
-
fromAgentId: string;
|
|
67
|
-
toAgentId?: string;
|
|
68
|
-
toAddress?: string;
|
|
69
|
-
amount: string;
|
|
70
|
-
currency: string;
|
|
71
|
-
status: 'pending' | 'completed' | 'failed';
|
|
72
|
-
createdAt: string;
|
|
73
|
-
}
|
|
74
|
-
declare class WalletsResource {
|
|
75
|
-
private requester;
|
|
76
|
-
constructor(requester: Requester);
|
|
77
|
-
get(agentId: string): Promise<WalletBalance>;
|
|
78
|
-
transfer(agentId: string, params: WalletTransferParams): Promise<WalletTransfer>;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
interface Policy {
|
|
82
|
-
id: string;
|
|
83
|
-
agentId: string;
|
|
84
|
-
name: string;
|
|
85
|
-
maxSpendPerDay?: number;
|
|
86
|
-
maxSpendPerTransaction?: number;
|
|
87
|
-
allowedRecipients?: string[];
|
|
88
|
-
currency: string;
|
|
89
|
-
active: boolean;
|
|
90
|
-
createdAt: string;
|
|
91
|
-
}
|
|
92
|
-
interface CreatePolicyParams {
|
|
93
|
-
agentId: string;
|
|
94
|
-
name: string;
|
|
95
|
-
maxSpendPerDay?: number;
|
|
96
|
-
maxSpendPerTransaction?: number;
|
|
97
|
-
allowedRecipients?: string[];
|
|
98
|
-
currency?: string;
|
|
99
|
-
}
|
|
100
|
-
declare class PoliciesResource {
|
|
101
|
-
private requester;
|
|
102
|
-
constructor(requester: Requester);
|
|
103
|
-
list(agentId?: string): Promise<Policy[]>;
|
|
104
|
-
create(params: CreatePolicyParams): Promise<Policy>;
|
|
105
|
-
update(policyId: string, params: Partial<CreatePolicyParams>): Promise<Policy>;
|
|
106
|
-
delete(policyId: string): Promise<{
|
|
107
|
-
deleted: boolean;
|
|
108
|
-
}>;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
interface AuditLog {
|
|
112
|
-
id: string;
|
|
113
|
-
agentId: string;
|
|
114
|
-
action: string;
|
|
115
|
-
amount?: string;
|
|
116
|
-
currency?: string;
|
|
117
|
-
metadata?: Record<string, unknown>;
|
|
118
|
-
hash: string;
|
|
119
|
-
previousHash: string;
|
|
120
|
-
createdAt: string;
|
|
121
|
-
}
|
|
122
|
-
interface ListAuditParams {
|
|
123
|
-
agentId?: string;
|
|
124
|
-
limit?: number;
|
|
125
|
-
offset?: number;
|
|
126
|
-
from?: string;
|
|
127
|
-
to?: string;
|
|
128
|
-
}
|
|
129
|
-
interface ListAuditResponse {
|
|
130
|
-
logs: AuditLog[];
|
|
131
|
-
total: number;
|
|
132
|
-
}
|
|
133
|
-
declare class AuditResource {
|
|
134
|
-
private requester;
|
|
135
|
-
constructor(requester: Requester);
|
|
136
|
-
list(params?: ListAuditParams): Promise<ListAuditResponse>;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
interface ApiKey {
|
|
140
|
-
id: string;
|
|
141
|
-
name: string;
|
|
142
|
-
prefix: string;
|
|
143
|
-
tier: 'free' | 'builder' | 'startup' | 'enterprise';
|
|
144
|
-
lastUsed?: string;
|
|
145
|
-
createdAt: string;
|
|
146
|
-
}
|
|
147
|
-
interface CreateKeyResponse {
|
|
148
|
-
id: string;
|
|
149
|
-
name: string;
|
|
150
|
-
key: string;
|
|
151
|
-
tier: string;
|
|
152
|
-
createdAt: string;
|
|
153
|
-
}
|
|
154
|
-
declare class KeysResource {
|
|
155
|
-
private requester;
|
|
156
|
-
constructor(requester: Requester);
|
|
157
|
-
list(): Promise<ApiKey[]>;
|
|
158
|
-
create(name: string): Promise<CreateKeyResponse>;
|
|
159
|
-
revoke(keyId: string): Promise<{
|
|
160
|
-
deleted: boolean;
|
|
161
|
-
}>;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
interface ValtaConfig {
|
|
165
|
-
apiKey: string;
|
|
166
|
-
baseUrl?: string;
|
|
167
|
-
}
|
|
168
|
-
declare class ValtaClient {
|
|
169
|
-
agents: AgentsResource;
|
|
170
|
-
wallets: WalletsResource;
|
|
171
|
-
policies: PoliciesResource;
|
|
172
|
-
audit: AuditResource;
|
|
173
|
-
keys: KeysResource;
|
|
174
|
-
constructor(config: ValtaConfig | string);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
declare class ValtaError extends Error {
|
|
178
|
-
code: string;
|
|
179
|
-
status: number;
|
|
180
|
-
constructor(message: string, code: string, status: number);
|
|
181
|
-
}
|
|
182
|
-
declare class AuthError extends ValtaError {
|
|
183
|
-
constructor(message?: string);
|
|
184
|
-
}
|
|
185
|
-
declare class TierError extends ValtaError {
|
|
186
|
-
requiredTier: string;
|
|
187
|
-
upgradeUrl: string;
|
|
188
|
-
constructor(message: string, requiredTier: string);
|
|
189
|
-
}
|
|
190
|
-
declare class RateLimitError extends ValtaError {
|
|
191
|
-
constructor(message?: string);
|
|
192
|
-
}
|
|
193
|
-
declare class NotFoundError extends ValtaError {
|
|
194
|
-
constructor(resource: string);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
export { type Agent, type ApiKey, type AuditLog, AuthError, type CreateAgentParams, type CreateKeyResponse, type CreatePolicyParams, type ListAgentsParams, type ListAuditParams, NotFoundError, type Policy, RateLimitError, TierError, ValtaClient, ValtaError, type WalletBalance, type WalletTransfer, type WalletTransferParams, ValtaClient as default };
|
package/dist/index.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AuthError,
|
|
3
|
-
NotFoundError,
|
|
4
|
-
RateLimitError,
|
|
5
|
-
TierError,
|
|
6
|
-
ValtaClient,
|
|
7
|
-
ValtaError
|
|
8
|
-
} from "./chunk-HGO47A3L.mjs";
|
|
9
|
-
export {
|
|
10
|
-
AuthError,
|
|
11
|
-
NotFoundError,
|
|
12
|
-
RateLimitError,
|
|
13
|
-
TierError,
|
|
14
|
-
ValtaClient,
|
|
15
|
-
ValtaError,
|
|
16
|
-
ValtaClient as default
|
|
17
|
-
};
|