valta-sdk 2.1.7 → 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 +92 -294
- 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 -533
- 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/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
|
-
};
|