@ampersend_ai/ampersend-sdk 0.0.22 → 0.0.26
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/dist/ampersend/agent-client.d.ts +81 -0
- package/dist/ampersend/agent-client.d.ts.map +1 -0
- package/dist/ampersend/agent-client.js +104 -0
- package/dist/ampersend/agent-client.js.map +1 -0
- package/dist/ampersend/agent.d.ts +118 -0
- package/dist/ampersend/agent.d.ts.map +1 -0
- package/dist/ampersend/agent.js +109 -0
- package/dist/ampersend/agent.js.map +1 -0
- package/dist/ampersend/approval.js.map +1 -1
- package/dist/ampersend/client.d.ts +32 -8
- package/dist/ampersend/client.d.ts.map +1 -1
- package/dist/ampersend/client.js +81 -3
- package/dist/ampersend/client.js.map +1 -1
- package/dist/ampersend/curated-agent.d.ts +94 -94
- package/dist/ampersend/curated-agent.d.ts.map +1 -1
- package/dist/ampersend/curated-agent.js +41 -41
- package/dist/ampersend/curated-agent.js.map +1 -1
- package/dist/ampersend/index.d.ts +2 -0
- package/dist/ampersend/index.d.ts.map +1 -1
- package/dist/ampersend/index.js +4 -0
- package/dist/ampersend/index.js.map +1 -1
- package/dist/ampersend/management.d.ts +23 -59
- package/dist/ampersend/management.d.ts.map +1 -1
- package/dist/ampersend/management.js +6 -8
- package/dist/ampersend/management.js.map +1 -1
- package/dist/ampersend/marketplace.d.ts +20 -14
- package/dist/ampersend/marketplace.d.ts.map +1 -1
- package/dist/ampersend/marketplace.js +23 -49
- package/dist/ampersend/marketplace.js.map +1 -1
- package/dist/ampersend/treasurer.d.ts +4 -0
- package/dist/ampersend/treasurer.d.ts.map +1 -1
- package/dist/ampersend/treasurer.js +2 -2
- package/dist/ampersend/treasurer.js.map +1 -1
- package/dist/ampersend/types.d.ts +215 -310
- package/dist/ampersend/types.d.ts.map +1 -1
- package/dist/ampersend/types.js +146 -119
- package/dist/ampersend/types.js.map +1 -1
- package/dist/ampersend/zod-bridge.d.ts +4 -5
- package/dist/ampersend/zod-bridge.d.ts.map +1 -1
- package/dist/ampersend/zod-bridge.js +35 -19
- package/dist/ampersend/zod-bridge.js.map +1 -1
- package/dist/cli/ampersend.js +45 -2
- package/dist/cli/ampersend.js.map +1 -1
- package/dist/cli/commands/agent.d.ts +24 -0
- package/dist/cli/commands/agent.d.ts.map +1 -0
- package/dist/cli/commands/agent.js +166 -0
- package/dist/cli/commands/agent.js.map +1 -0
- package/dist/cli/commands/card.d.ts +128 -0
- package/dist/cli/commands/card.d.ts.map +1 -0
- package/dist/cli/commands/card.js +404 -0
- package/dist/cli/commands/card.js.map +1 -0
- package/dist/cli/commands/config.d.ts +1 -1
- package/dist/cli/commands/config.d.ts.map +1 -1
- package/dist/cli/commands/config.js +31 -42
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/fetch.d.ts +77 -2
- package/dist/cli/commands/fetch.d.ts.map +1 -1
- package/dist/cli/commands/fetch.js +210 -129
- package/dist/cli/commands/fetch.js.map +1 -1
- package/dist/cli/commands/fund.d.ts +3 -0
- package/dist/cli/commands/fund.d.ts.map +1 -0
- package/dist/cli/commands/fund.js +22 -0
- package/dist/cli/commands/fund.js.map +1 -0
- package/dist/cli/commands/marketplace.d.ts +6 -0
- package/dist/cli/commands/marketplace.d.ts.map +1 -1
- package/dist/cli/commands/marketplace.js +27 -8
- package/dist/cli/commands/marketplace.js.map +1 -1
- package/dist/cli/commands/setup.d.ts +4 -1
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +66 -41
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/version.d.ts +3 -0
- package/dist/cli/commands/version.d.ts.map +1 -0
- package/dist/cli/commands/version.js +12 -0
- package/dist/cli/commands/version.js.map +1 -0
- package/dist/cli/config.d.ts +225 -45
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +426 -115
- package/dist/cli/config.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/proxy/cli.js +1 -0
- package/dist/mcp/proxy/cli.js.map +1 -1
- package/dist/mcp/proxy/factory.d.ts +2 -0
- package/dist/mcp/proxy/factory.d.ts.map +1 -1
- package/dist/mcp/proxy/factory.js +10 -1
- package/dist/mcp/proxy/factory.js.map +1 -1
- package/dist/mcp/proxy/server/init.js +1 -1
- package/dist/mcp/proxy/server/init.js.map +1 -1
- package/dist/mcp/proxy/server/server.d.ts +3 -1
- package/dist/mcp/proxy/server/server.d.ts.map +1 -1
- package/dist/mcp/proxy/server/server.js +5 -2
- package/dist/mcp/proxy/server/server.js.map +1 -1
- package/dist/mcp/proxy/types.d.ts +7 -0
- package/dist/mcp/proxy/types.d.ts.map +1 -1
- package/dist/mcp/proxy/types.js.map +1 -1
- package/dist/version.d.ts +3 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +3 -1
- package/dist/version.js.map +1 -1
- package/dist/x402/http/factory.d.ts +2 -0
- package/dist/x402/http/factory.d.ts.map +1 -1
- package/dist/x402/http/factory.js +1 -0
- package/dist/x402/http/factory.js.map +1 -1
- package/dist/x402/index.d.ts +2 -0
- package/dist/x402/index.d.ts.map +1 -1
- package/dist/x402/index.js +2 -0
- package/dist/x402/index.js.map +1 -1
- package/dist/x402/siwx.d.ts +55 -0
- package/dist/x402/siwx.d.ts.map +1 -0
- package/dist/x402/siwx.js +122 -0
- package/dist/x402/siwx.js.map +1 -0
- package/dist/x402/wallets/smart-account/cosigned.d.ts +9 -2
- package/dist/x402/wallets/smart-account/cosigned.d.ts.map +1 -1
- package/dist/x402/wallets/smart-account/cosigned.js +13 -4
- package/dist/x402/wallets/smart-account/cosigned.js.map +1 -1
- package/package.json +3 -2
|
@@ -1,136 +1,76 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const NonEmptyTrimmedString: Schema.NonEmptyString;
|
|
3
|
+
export type NonEmptyTrimmedString = typeof NonEmptyTrimmedString.Type;
|
|
4
|
+
export declare const NonNegativeInt: Schema.Int;
|
|
5
|
+
export type NonNegativeInt = typeof NonNegativeInt.Type;
|
|
6
|
+
export declare const Scheme: Schema.Literals<readonly ["exact", "deferred"]>;
|
|
3
7
|
export type Scheme = typeof Scheme.Type;
|
|
4
|
-
export declare const Address: Schema.
|
|
8
|
+
export declare const Address: Schema.NonEmptyString;
|
|
5
9
|
export type Address = typeof Address.Type;
|
|
6
|
-
export declare const TxHash: Schema.
|
|
10
|
+
export declare const TxHash: Schema.NonEmptyString;
|
|
7
11
|
export type TxHash = typeof TxHash.Type;
|
|
8
|
-
export declare const Caip2ID: Schema.
|
|
12
|
+
export declare const Caip2ID: Schema.NonEmptyString;
|
|
9
13
|
export type Caip2ID = typeof Caip2ID.Type;
|
|
10
|
-
export declare const Hex32Bytes: Schema.
|
|
14
|
+
export declare const Hex32Bytes: Schema.NonEmptyString;
|
|
11
15
|
export type Hex32Bytes = typeof Hex32Bytes.Type;
|
|
12
|
-
export declare const Hex65Bytes: Schema.
|
|
16
|
+
export declare const Hex65Bytes: Schema.NonEmptyString;
|
|
13
17
|
export type Hex65Bytes = typeof Hex65Bytes.Type;
|
|
14
|
-
export declare const NonNegativeIntegerString: Schema.
|
|
18
|
+
export declare const NonNegativeIntegerString: Schema.NonEmptyString;
|
|
15
19
|
export type NonNegativeIntegerString = typeof NonNegativeIntegerString.Type;
|
|
16
|
-
export declare const ID: Schema.brand<
|
|
20
|
+
export declare const ID: Schema.brand<Schema.String, "ID">;
|
|
17
21
|
export type ID = typeof ID.Type;
|
|
18
|
-
export declare const ConvertedTimestamp: Schema.Union<[Schema.
|
|
22
|
+
export declare const ConvertedTimestamp: Schema.Union<readonly [Schema.Int, Schema.compose<Schema.Int, Schema.NumberFromString>]>;
|
|
19
23
|
export type ConvertedTimestamp = typeof ConvertedTimestamp.Type;
|
|
20
|
-
declare const
|
|
21
|
-
nonce: Schema.
|
|
22
|
-
sessionId: Schema.
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
readonly
|
|
28
|
-
|
|
29
|
-
readonly
|
|
30
|
-
}
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
readonly
|
|
45
|
-
|
|
46
|
-
readonly
|
|
47
|
-
|
|
48
|
-
readonly
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
readonly agentAddress: string;
|
|
64
|
-
} & {
|
|
65
|
-
readonly token: string;
|
|
66
|
-
} & {
|
|
67
|
-
readonly expiresAt: import("effect/DateTime").Utc;
|
|
68
|
-
}, {}, {}>;
|
|
69
|
-
export declare class SIWELoginResponse extends SIWELoginResponse_base {
|
|
70
|
-
}
|
|
71
|
-
declare const ERC3009AuthorizationData_base: Schema.Class<ERC3009AuthorizationData, {
|
|
72
|
-
from: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
73
|
-
to: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
74
|
-
value: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
75
|
-
validAfter: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
76
|
-
validBefore: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
77
|
-
nonce: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
78
|
-
}, Schema.Struct.Encoded<{
|
|
79
|
-
from: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
80
|
-
to: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
81
|
-
value: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
82
|
-
validAfter: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
83
|
-
validBefore: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
84
|
-
nonce: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
85
|
-
}>, never, {
|
|
86
|
-
readonly nonce: string;
|
|
87
|
-
} & {
|
|
88
|
-
readonly from: string;
|
|
89
|
-
} & {
|
|
90
|
-
readonly to: string;
|
|
91
|
-
} & {
|
|
92
|
-
readonly value: string;
|
|
93
|
-
} & {
|
|
94
|
-
readonly validAfter: string;
|
|
95
|
-
} & {
|
|
96
|
-
readonly validBefore: string;
|
|
97
|
-
}, {}, {}>;
|
|
98
|
-
export declare class ERC3009AuthorizationData extends ERC3009AuthorizationData_base {
|
|
99
|
-
}
|
|
100
|
-
declare const ServerAuthorizationData_base: Schema.Class<ServerAuthorizationData, {
|
|
101
|
-
authorizationData: Schema.SchemaClass<ERC3009AuthorizationData, {
|
|
102
|
-
readonly nonce: string;
|
|
103
|
-
readonly from: string;
|
|
104
|
-
readonly to: string;
|
|
105
|
-
readonly value: string;
|
|
106
|
-
readonly validAfter: string;
|
|
107
|
-
readonly validBefore: string;
|
|
108
|
-
}, never>;
|
|
109
|
-
serverSignature: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
110
|
-
}, Schema.Struct.Encoded<{
|
|
111
|
-
authorizationData: Schema.SchemaClass<ERC3009AuthorizationData, {
|
|
112
|
-
readonly nonce: string;
|
|
113
|
-
readonly from: string;
|
|
114
|
-
readonly to: string;
|
|
115
|
-
readonly value: string;
|
|
116
|
-
readonly validAfter: string;
|
|
117
|
-
readonly validBefore: string;
|
|
118
|
-
}, never>;
|
|
119
|
-
serverSignature: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
120
|
-
}>, never, {
|
|
121
|
-
readonly authorizationData: ERC3009AuthorizationData;
|
|
122
|
-
} & {
|
|
123
|
-
readonly serverSignature: string;
|
|
124
|
-
}, {}, {}>;
|
|
125
|
-
export declare class ServerAuthorizationData extends ServerAuthorizationData_base {
|
|
126
|
-
}
|
|
24
|
+
export declare const SIWENonceResponse: Schema.Struct<{
|
|
25
|
+
readonly nonce: Schema.NonEmptyString;
|
|
26
|
+
readonly sessionId: Schema.NonEmptyString;
|
|
27
|
+
}>;
|
|
28
|
+
export type SIWENonceResponse = typeof SIWENonceResponse.Type;
|
|
29
|
+
export declare const SIWELoginRequest: Schema.Struct<{
|
|
30
|
+
readonly signature: Schema.NonEmptyString;
|
|
31
|
+
readonly message: Schema.NonEmptyString;
|
|
32
|
+
readonly sessionId: Schema.NonEmptyString;
|
|
33
|
+
readonly agentAddress: Schema.NonEmptyString;
|
|
34
|
+
}>;
|
|
35
|
+
export type SIWELoginRequest = typeof SIWELoginRequest.Type;
|
|
36
|
+
export declare const SIWELoginResponse: Schema.Struct<{
|
|
37
|
+
readonly token: Schema.NonEmptyString;
|
|
38
|
+
readonly agentAddress: Schema.NonEmptyString;
|
|
39
|
+
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
40
|
+
}>;
|
|
41
|
+
export type SIWELoginResponse = typeof SIWELoginResponse.Type;
|
|
42
|
+
export declare const SignSiwxResponse: Schema.Struct<{
|
|
43
|
+
readonly serverSignature: Schema.NonEmptyString;
|
|
44
|
+
}>;
|
|
45
|
+
export type SignSiwxResponse = typeof SignSiwxResponse.Type;
|
|
46
|
+
export declare const ERC3009AuthorizationData: Schema.Struct<{
|
|
47
|
+
readonly from: Schema.NonEmptyString;
|
|
48
|
+
readonly to: Schema.NonEmptyString;
|
|
49
|
+
readonly value: Schema.NonEmptyString;
|
|
50
|
+
readonly validAfter: Schema.NonEmptyString;
|
|
51
|
+
readonly validBefore: Schema.NonEmptyString;
|
|
52
|
+
readonly nonce: Schema.NonEmptyString;
|
|
53
|
+
}>;
|
|
54
|
+
export type ERC3009AuthorizationData = typeof ERC3009AuthorizationData.Type;
|
|
55
|
+
export declare const ServerAuthorizationData: Schema.Struct<{
|
|
56
|
+
readonly authorizationData: Schema.Struct<{
|
|
57
|
+
readonly from: Schema.NonEmptyString;
|
|
58
|
+
readonly to: Schema.NonEmptyString;
|
|
59
|
+
readonly value: Schema.NonEmptyString;
|
|
60
|
+
readonly validAfter: Schema.NonEmptyString;
|
|
61
|
+
readonly validBefore: Schema.NonEmptyString;
|
|
62
|
+
readonly nonce: Schema.NonEmptyString;
|
|
63
|
+
}>;
|
|
64
|
+
readonly serverSignature: Schema.NonEmptyString;
|
|
65
|
+
}>;
|
|
66
|
+
export type ServerAuthorizationData = typeof ServerAuthorizationData.Type;
|
|
127
67
|
/** Dispatch tag on wire envelopes. Distinct from any individual protocol's internal version. */
|
|
128
|
-
export declare const Protocol: Schema.
|
|
68
|
+
export declare const Protocol: Schema.Literals<readonly ["x402-v1", "x402-v2"]>;
|
|
129
69
|
export type Protocol = typeof Protocol.Type;
|
|
130
70
|
/** Wire envelope for a {@link PaymentRequest}; `data` validated via `@x402/core/schemas` on decode. */
|
|
131
|
-
export declare const PaymentRequestEnvelope: Schema.Union<[Schema.Struct<{
|
|
132
|
-
protocol: Schema.Literal<
|
|
133
|
-
data: Schema.
|
|
71
|
+
export declare const PaymentRequestEnvelope: Schema.Union<readonly [Schema.Struct<{
|
|
72
|
+
readonly protocol: Schema.Literal<"x402-v1">;
|
|
73
|
+
readonly data: Schema.Codec<{
|
|
134
74
|
x402Version: 1;
|
|
135
75
|
accepts: {
|
|
136
76
|
description: string;
|
|
@@ -162,10 +102,10 @@ export declare const PaymentRequestEnvelope: Schema.Union<[Schema.Struct<{
|
|
|
162
102
|
extra?: Record<string, unknown> | null | undefined;
|
|
163
103
|
}[];
|
|
164
104
|
error?: string | undefined;
|
|
165
|
-
}, never>;
|
|
105
|
+
}, never, never>;
|
|
166
106
|
}>, Schema.Struct<{
|
|
167
|
-
protocol: Schema.Literal<
|
|
168
|
-
data: Schema.
|
|
107
|
+
readonly protocol: Schema.Literal<"x402-v2">;
|
|
108
|
+
readonly data: Schema.Codec<{
|
|
169
109
|
resource: {
|
|
170
110
|
url: string;
|
|
171
111
|
description?: string | undefined;
|
|
@@ -201,13 +141,13 @@ export declare const PaymentRequestEnvelope: Schema.Union<[Schema.Struct<{
|
|
|
201
141
|
}[];
|
|
202
142
|
error?: string | undefined;
|
|
203
143
|
extensions?: Record<string, unknown> | null | undefined;
|
|
204
|
-
}, never>;
|
|
144
|
+
}, never, never>;
|
|
205
145
|
}>]>;
|
|
206
146
|
export type PaymentRequestEnvelope = typeof PaymentRequestEnvelope.Type;
|
|
207
147
|
/** Wire envelope for a signed {@link PaymentAuthorization}. */
|
|
208
|
-
export declare const PaymentAuthorizationEnvelope: Schema.Union<[Schema.Struct<{
|
|
209
|
-
protocol: Schema.Literal<
|
|
210
|
-
data: Schema.
|
|
148
|
+
export declare const PaymentAuthorizationEnvelope: Schema.Union<readonly [Schema.Struct<{
|
|
149
|
+
readonly protocol: Schema.Literal<"x402-v1">;
|
|
150
|
+
readonly data: Schema.Codec<{
|
|
211
151
|
scheme: string;
|
|
212
152
|
network: string;
|
|
213
153
|
x402Version: 1;
|
|
@@ -217,10 +157,10 @@ export declare const PaymentAuthorizationEnvelope: Schema.Union<[Schema.Struct<{
|
|
|
217
157
|
network: string;
|
|
218
158
|
x402Version: 1;
|
|
219
159
|
payload: Record<string, unknown>;
|
|
220
|
-
}, never>;
|
|
160
|
+
}, never, never>;
|
|
221
161
|
}>, Schema.Struct<{
|
|
222
|
-
protocol: Schema.Literal<
|
|
223
|
-
data: Schema.
|
|
162
|
+
readonly protocol: Schema.Literal<"x402-v2">;
|
|
163
|
+
readonly data: Schema.Codec<{
|
|
224
164
|
x402Version: 2;
|
|
225
165
|
payload: Record<string, unknown>;
|
|
226
166
|
accepted: {
|
|
@@ -256,14 +196,14 @@ export declare const PaymentAuthorizationEnvelope: Schema.Union<[Schema.Struct<{
|
|
|
256
196
|
mimeType?: string | undefined;
|
|
257
197
|
} | undefined;
|
|
258
198
|
extensions?: Record<string, unknown> | null | undefined;
|
|
259
|
-
}, never>;
|
|
199
|
+
}, never, never>;
|
|
260
200
|
}>]>;
|
|
261
201
|
export type PaymentAuthorizationEnvelope = typeof PaymentAuthorizationEnvelope.Type;
|
|
262
202
|
/** Request body for `POST /api/v1/agents/:agent/payment/authorize`. */
|
|
263
203
|
export declare const AgentAuthorizeRequest: Schema.Struct<{
|
|
264
|
-
paymentRequest: Schema.Union<[Schema.Struct<{
|
|
265
|
-
protocol: Schema.Literal<
|
|
266
|
-
data: Schema.
|
|
204
|
+
readonly paymentRequest: Schema.Union<readonly [Schema.Struct<{
|
|
205
|
+
readonly protocol: Schema.Literal<"x402-v1">;
|
|
206
|
+
readonly data: Schema.Codec<{
|
|
267
207
|
x402Version: 1;
|
|
268
208
|
accepts: {
|
|
269
209
|
description: string;
|
|
@@ -295,10 +235,10 @@ export declare const AgentAuthorizeRequest: Schema.Struct<{
|
|
|
295
235
|
extra?: Record<string, unknown> | null | undefined;
|
|
296
236
|
}[];
|
|
297
237
|
error?: string | undefined;
|
|
298
|
-
}, never>;
|
|
238
|
+
}, never, never>;
|
|
299
239
|
}>, Schema.Struct<{
|
|
300
|
-
protocol: Schema.Literal<
|
|
301
|
-
data: Schema.
|
|
240
|
+
readonly protocol: Schema.Literal<"x402-v2">;
|
|
241
|
+
readonly data: Schema.Codec<{
|
|
302
242
|
resource: {
|
|
303
243
|
url: string;
|
|
304
244
|
description?: string | undefined;
|
|
@@ -334,46 +274,31 @@ export declare const AgentAuthorizeRequest: Schema.Struct<{
|
|
|
334
274
|
}[];
|
|
335
275
|
error?: string | undefined;
|
|
336
276
|
extensions?: Record<string, unknown> | null | undefined;
|
|
337
|
-
}, never>;
|
|
277
|
+
}, never, never>;
|
|
338
278
|
}>]>;
|
|
339
|
-
context: Schema.optional<Schema.Struct<{
|
|
340
|
-
method: Schema.optional<
|
|
341
|
-
serverUrl: Schema.optional<
|
|
342
|
-
params: Schema.optional<
|
|
279
|
+
readonly context: Schema.optional<Schema.Struct<{
|
|
280
|
+
readonly method: Schema.optional<Schema.NonEmptyString>;
|
|
281
|
+
readonly serverUrl: Schema.optional<Schema.NonEmptyString>;
|
|
282
|
+
readonly params: Schema.optional<Schema.Unknown>;
|
|
343
283
|
}>>;
|
|
344
284
|
}>;
|
|
345
285
|
export type AgentAuthorizeRequest = typeof AgentAuthorizeRequest.Type;
|
|
346
|
-
declare const CoSignature_base: Schema.Class<CoSignature, {
|
|
347
|
-
authorizationData: Schema.SchemaClass<ERC3009AuthorizationData, {
|
|
348
|
-
readonly nonce: string;
|
|
349
|
-
readonly from: string;
|
|
350
|
-
readonly to: string;
|
|
351
|
-
readonly value: string;
|
|
352
|
-
readonly validAfter: string;
|
|
353
|
-
readonly validBefore: string;
|
|
354
|
-
}, never>;
|
|
355
|
-
serverSignature: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
356
|
-
}, Schema.Struct.Encoded<{
|
|
357
|
-
authorizationData: Schema.SchemaClass<ERC3009AuthorizationData, {
|
|
358
|
-
readonly nonce: string;
|
|
359
|
-
readonly from: string;
|
|
360
|
-
readonly to: string;
|
|
361
|
-
readonly value: string;
|
|
362
|
-
readonly validAfter: string;
|
|
363
|
-
readonly validBefore: string;
|
|
364
|
-
}, never>;
|
|
365
|
-
serverSignature: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
366
|
-
}>, never, {
|
|
367
|
-
readonly authorizationData: ERC3009AuthorizationData;
|
|
368
|
-
} & {
|
|
369
|
-
readonly serverSignature: string;
|
|
370
|
-
}, {}, {}>;
|
|
371
286
|
/**
|
|
372
287
|
* ERC-3009 authorization data + server signature for co-signed agent keys;
|
|
373
288
|
* the agent signs alongside. Scheme-specific today (exact EVM).
|
|
374
289
|
*/
|
|
375
|
-
export declare
|
|
376
|
-
|
|
290
|
+
export declare const CoSignature: Schema.Struct<{
|
|
291
|
+
readonly authorizationData: Schema.Struct<{
|
|
292
|
+
readonly from: Schema.NonEmptyString;
|
|
293
|
+
readonly to: Schema.NonEmptyString;
|
|
294
|
+
readonly value: Schema.NonEmptyString;
|
|
295
|
+
readonly validAfter: Schema.NonEmptyString;
|
|
296
|
+
readonly validBefore: Schema.NonEmptyString;
|
|
297
|
+
readonly nonce: Schema.NonEmptyString;
|
|
298
|
+
}>;
|
|
299
|
+
readonly serverSignature: Schema.NonEmptyString;
|
|
300
|
+
}>;
|
|
301
|
+
export type CoSignature = typeof CoSignature.Type;
|
|
377
302
|
/**
|
|
378
303
|
* Response body for `POST /api/v1/agents/:agent/payment/authorize`. Returns
|
|
379
304
|
* *indices* into the request's `accepts[]` — the client has the original
|
|
@@ -385,58 +310,75 @@ export declare class CoSignature extends CoSignature_base {
|
|
|
385
310
|
* selected: { acceptsIndex, limits, coSignature? } | null,
|
|
386
311
|
* alternatives: [{ acceptsIndex, limits }],
|
|
387
312
|
* },
|
|
388
|
-
* rejected: [{ acceptsIndex, reason }],
|
|
313
|
+
* rejected: [{ acceptsIndex, reason, reasonCode? }],
|
|
389
314
|
* suggested?: { nonce, validBefore },
|
|
390
315
|
* }
|
|
391
316
|
* ```
|
|
317
|
+
*
|
|
318
|
+
* `reasonCode` on rejected items is a stable string identifier for the
|
|
319
|
+
* rejection category (e.g., `per_tx_limit_exceeded`,
|
|
320
|
+
* `compliance_high_risk`). Optional for backwards compatibility with
|
|
321
|
+
* older API versions that only emit `reason`; consumers should fall
|
|
322
|
+
* back to a default branch when an unknown code arrives.
|
|
392
323
|
*/
|
|
393
324
|
export declare const AgentAuthorizeResponse: Schema.Struct<{
|
|
394
|
-
authorized: Schema.Struct<{
|
|
395
|
-
selected: Schema.NullOr<Schema.Struct<{
|
|
396
|
-
acceptsIndex: Schema.
|
|
397
|
-
limits: Schema.Struct<{
|
|
398
|
-
dailyRemaining: Schema.
|
|
399
|
-
monthlyRemaining: Schema.
|
|
325
|
+
readonly authorized: Schema.Struct<{
|
|
326
|
+
readonly selected: Schema.NullOr<Schema.Struct<{
|
|
327
|
+
readonly acceptsIndex: Schema.Int;
|
|
328
|
+
readonly limits: Schema.Struct<{
|
|
329
|
+
readonly dailyRemaining: Schema.NonEmptyString;
|
|
330
|
+
readonly monthlyRemaining: Schema.NonEmptyString;
|
|
400
331
|
}>;
|
|
401
|
-
coSignature: Schema.optional<
|
|
332
|
+
readonly coSignature: Schema.optional<Schema.Struct<{
|
|
333
|
+
readonly authorizationData: Schema.Struct<{
|
|
334
|
+
readonly from: Schema.NonEmptyString;
|
|
335
|
+
readonly to: Schema.NonEmptyString;
|
|
336
|
+
readonly value: Schema.NonEmptyString;
|
|
337
|
+
readonly validAfter: Schema.NonEmptyString;
|
|
338
|
+
readonly validBefore: Schema.NonEmptyString;
|
|
339
|
+
readonly nonce: Schema.NonEmptyString;
|
|
340
|
+
}>;
|
|
341
|
+
readonly serverSignature: Schema.NonEmptyString;
|
|
342
|
+
}>>;
|
|
402
343
|
}>>;
|
|
403
|
-
alternatives: Schema
|
|
404
|
-
acceptsIndex: Schema.
|
|
405
|
-
limits: Schema.Struct<{
|
|
406
|
-
dailyRemaining: Schema.
|
|
407
|
-
monthlyRemaining: Schema.
|
|
344
|
+
readonly alternatives: Schema.$Array<Schema.Struct<{
|
|
345
|
+
readonly acceptsIndex: Schema.Int;
|
|
346
|
+
readonly limits: Schema.Struct<{
|
|
347
|
+
readonly dailyRemaining: Schema.NonEmptyString;
|
|
348
|
+
readonly monthlyRemaining: Schema.NonEmptyString;
|
|
408
349
|
}>;
|
|
409
350
|
}>>;
|
|
410
351
|
}>;
|
|
411
|
-
rejected: Schema
|
|
412
|
-
acceptsIndex: Schema.
|
|
413
|
-
reason:
|
|
352
|
+
readonly rejected: Schema.$Array<Schema.Struct<{
|
|
353
|
+
readonly acceptsIndex: Schema.Int;
|
|
354
|
+
readonly reason: Schema.NonEmptyString;
|
|
355
|
+
readonly reasonCode: Schema.optional<Schema.NonEmptyString>;
|
|
414
356
|
}>>;
|
|
415
|
-
suggested: Schema.optional<Schema.Struct<{
|
|
416
|
-
nonce: Schema.
|
|
417
|
-
validBefore: Schema.
|
|
357
|
+
readonly suggested: Schema.optional<Schema.Struct<{
|
|
358
|
+
readonly nonce: Schema.NonEmptyString;
|
|
359
|
+
readonly validBefore: Schema.NonEmptyString;
|
|
418
360
|
}>>;
|
|
419
361
|
}>;
|
|
420
362
|
export type AgentAuthorizeResponse = typeof AgentAuthorizeResponse.Type;
|
|
421
|
-
export declare const PaymentEventType: Schema.Union<[Schema.Struct<{
|
|
422
|
-
type: Schema.Literal<
|
|
363
|
+
export declare const PaymentEventType: Schema.Union<readonly [Schema.Struct<{
|
|
364
|
+
readonly type: Schema.Literal<"sending">;
|
|
423
365
|
}>, Schema.Struct<{
|
|
424
|
-
type: Schema.Literal<
|
|
366
|
+
readonly type: Schema.Literal<"accepted">;
|
|
425
367
|
}>, Schema.Struct<{
|
|
426
|
-
type: Schema.Literal<
|
|
427
|
-
reason: Schema.
|
|
368
|
+
readonly type: Schema.Literal<"rejected">;
|
|
369
|
+
readonly reason: Schema.NonEmptyString;
|
|
428
370
|
}>, Schema.Struct<{
|
|
429
|
-
type: Schema.Literal<
|
|
430
|
-
reason: Schema.
|
|
371
|
+
readonly type: Schema.Literal<"error">;
|
|
372
|
+
readonly reason: Schema.NonEmptyString;
|
|
431
373
|
}>]>;
|
|
432
374
|
export type PaymentEventType = typeof PaymentEventType.Type;
|
|
433
375
|
export type PaymentEvent = PaymentEventType;
|
|
434
376
|
/** Request body for `POST /api/v1/agents/:agent/payment/events`. */
|
|
435
377
|
export declare const AgentPaymentEventReport: Schema.Struct<{
|
|
436
|
-
id: Schema.
|
|
437
|
-
payment: Schema.Union<[Schema.Struct<{
|
|
438
|
-
protocol: Schema.Literal<
|
|
439
|
-
data: Schema.
|
|
378
|
+
readonly id: Schema.NonEmptyString;
|
|
379
|
+
readonly payment: Schema.Union<readonly [Schema.Struct<{
|
|
380
|
+
readonly protocol: Schema.Literal<"x402-v1">;
|
|
381
|
+
readonly data: Schema.Codec<{
|
|
440
382
|
scheme: string;
|
|
441
383
|
network: string;
|
|
442
384
|
x402Version: 1;
|
|
@@ -446,10 +388,10 @@ export declare const AgentPaymentEventReport: Schema.Struct<{
|
|
|
446
388
|
network: string;
|
|
447
389
|
x402Version: 1;
|
|
448
390
|
payload: Record<string, unknown>;
|
|
449
|
-
}, never>;
|
|
391
|
+
}, never, never>;
|
|
450
392
|
}>, Schema.Struct<{
|
|
451
|
-
protocol: Schema.Literal<
|
|
452
|
-
data: Schema.
|
|
393
|
+
readonly protocol: Schema.Literal<"x402-v2">;
|
|
394
|
+
readonly data: Schema.Codec<{
|
|
453
395
|
x402Version: 2;
|
|
454
396
|
payload: Record<string, unknown>;
|
|
455
397
|
accepted: {
|
|
@@ -485,39 +427,44 @@ export declare const AgentPaymentEventReport: Schema.Struct<{
|
|
|
485
427
|
mimeType?: string | undefined;
|
|
486
428
|
} | undefined;
|
|
487
429
|
extensions?: Record<string, unknown> | null | undefined;
|
|
488
|
-
}, never>;
|
|
430
|
+
}, never, never>;
|
|
489
431
|
}>]>;
|
|
490
|
-
event: Schema.Union<[Schema.Struct<{
|
|
491
|
-
type: Schema.Literal<
|
|
432
|
+
readonly event: Schema.Union<readonly [Schema.Struct<{
|
|
433
|
+
readonly type: Schema.Literal<"sending">;
|
|
492
434
|
}>, Schema.Struct<{
|
|
493
|
-
type: Schema.Literal<
|
|
435
|
+
readonly type: Schema.Literal<"accepted">;
|
|
494
436
|
}>, Schema.Struct<{
|
|
495
|
-
type: Schema.Literal<
|
|
496
|
-
reason: Schema.
|
|
437
|
+
readonly type: Schema.Literal<"rejected">;
|
|
438
|
+
readonly reason: Schema.NonEmptyString;
|
|
497
439
|
}>, Schema.Struct<{
|
|
498
|
-
type: Schema.Literal<
|
|
499
|
-
reason: Schema.
|
|
440
|
+
readonly type: Schema.Literal<"error">;
|
|
441
|
+
readonly reason: Schema.NonEmptyString;
|
|
500
442
|
}>]>;
|
|
501
443
|
}>;
|
|
502
444
|
export type AgentPaymentEventReport = typeof AgentPaymentEventReport.Type;
|
|
503
|
-
declare const
|
|
504
|
-
received: Schema.
|
|
505
|
-
paymentId: Schema.optional<
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
paymentId: Schema.optional<typeof Schema.UUID>;
|
|
509
|
-
}>, never, {
|
|
510
|
-
readonly received: boolean;
|
|
511
|
-
} & {
|
|
512
|
-
readonly paymentId?: string | undefined;
|
|
513
|
-
}, {}, {}>;
|
|
514
|
-
export declare class AgentPaymentEventResponse extends AgentPaymentEventResponse_base {
|
|
515
|
-
}
|
|
445
|
+
export declare const AgentPaymentEventResponse: Schema.Struct<{
|
|
446
|
+
readonly received: Schema.Boolean;
|
|
447
|
+
readonly paymentId: Schema.optional<Schema.String>;
|
|
448
|
+
}>;
|
|
449
|
+
export type AgentPaymentEventResponse = typeof AgentPaymentEventResponse.Type;
|
|
516
450
|
export interface ApiClientOptions {
|
|
517
451
|
baseUrl: string;
|
|
518
452
|
sessionKeyPrivateKey?: `0x${string}`;
|
|
519
|
-
|
|
453
|
+
/**
|
|
454
|
+
* The agent's smart-account address. Required for any authenticated call
|
|
455
|
+
* (the SIWE login binds to it); optional when the client is used only for
|
|
456
|
+
* unauthenticated reads. Authenticated paths throw a clear error if it's
|
|
457
|
+
* missing — see `ApiClient.performAuthentication`.
|
|
458
|
+
*/
|
|
459
|
+
agentAddress?: Address;
|
|
520
460
|
timeout?: number;
|
|
461
|
+
/**
|
|
462
|
+
* Identifies the calling client for the API's product-analytics
|
|
463
|
+
* attribution. Sent on every authenticated request as
|
|
464
|
+
* `Ampersend-Client: <clientName>/<version>`. The `ampersend` CLI passes
|
|
465
|
+
* `"ampersend-cli"`; library callers default to `"sdk-typescript"`.
|
|
466
|
+
*/
|
|
467
|
+
clientName?: string;
|
|
521
468
|
}
|
|
522
469
|
export interface AuthenticationState {
|
|
523
470
|
token: string | null;
|
|
@@ -529,107 +476,65 @@ export declare class ApiError extends Error {
|
|
|
529
476
|
constructor(message: string, status?: number | undefined, response?: Response | undefined);
|
|
530
477
|
}
|
|
531
478
|
export declare const SpendConfigInput: Schema.Struct<{
|
|
532
|
-
auto_topup_allowed: Schema.
|
|
533
|
-
daily_limit: Schema.NullOr<
|
|
534
|
-
monthly_limit: Schema.NullOr<
|
|
535
|
-
per_transaction_limit: Schema.NullOr<
|
|
479
|
+
readonly auto_topup_allowed: Schema.Boolean;
|
|
480
|
+
readonly daily_limit: Schema.NullOr<Schema.String>;
|
|
481
|
+
readonly monthly_limit: Schema.NullOr<Schema.String>;
|
|
482
|
+
readonly per_transaction_limit: Schema.NullOr<Schema.String>;
|
|
536
483
|
}>;
|
|
537
|
-
declare const
|
|
538
|
-
name: Schema.NullOr<
|
|
539
|
-
agent_key_address: Schema.
|
|
540
|
-
key_name: Schema.optional<Schema.
|
|
541
|
-
spend_config: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
542
|
-
auto_topup_allowed: Schema.
|
|
543
|
-
daily_limit: Schema.NullOr<
|
|
544
|
-
monthly_limit: Schema.NullOr<
|
|
545
|
-
per_transaction_limit: Schema.NullOr<
|
|
484
|
+
export declare const AgentApprovalRequest: Schema.Struct<{
|
|
485
|
+
readonly name: Schema.NullOr<Schema.String>;
|
|
486
|
+
readonly agent_key_address: Schema.NonEmptyString;
|
|
487
|
+
readonly key_name: Schema.optional<Schema.String>;
|
|
488
|
+
readonly spend_config: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
489
|
+
readonly auto_topup_allowed: Schema.Boolean;
|
|
490
|
+
readonly daily_limit: Schema.NullOr<Schema.String>;
|
|
491
|
+
readonly monthly_limit: Schema.NullOr<Schema.String>;
|
|
492
|
+
readonly per_transaction_limit: Schema.NullOr<Schema.String>;
|
|
546
493
|
}>>>;
|
|
547
|
-
mode: Schema.optional<Schema.
|
|
548
|
-
agent_address: Schema.optional<Schema.
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
per_transaction_limit: Schema.NullOr<typeof Schema.String>;
|
|
558
|
-
}>>>;
|
|
559
|
-
mode: Schema.optional<Schema.Literal<["create", "connect", "connect_choose"]>>;
|
|
560
|
-
agent_address: Schema.optional<Schema.refine<string, typeof Schema.NonEmptyTrimmedString>>;
|
|
561
|
-
}>, never, {
|
|
562
|
-
readonly name: string | null;
|
|
563
|
-
} & {
|
|
564
|
-
readonly agent_key_address: string;
|
|
565
|
-
} & {
|
|
566
|
-
readonly key_name?: string | undefined;
|
|
567
|
-
} & {
|
|
568
|
-
readonly spend_config?: {
|
|
569
|
-
readonly auto_topup_allowed: boolean;
|
|
570
|
-
readonly daily_limit: string | null;
|
|
571
|
-
readonly monthly_limit: string | null;
|
|
572
|
-
readonly per_transaction_limit: string | null;
|
|
573
|
-
} | null | undefined;
|
|
574
|
-
} & {
|
|
575
|
-
readonly mode?: "create" | "connect" | "connect_choose" | undefined;
|
|
576
|
-
} & {
|
|
577
|
-
readonly agent_address?: string | undefined;
|
|
578
|
-
}, {}, {}>;
|
|
579
|
-
export declare class AgentApprovalRequest extends AgentApprovalRequest_base {
|
|
580
|
-
}
|
|
581
|
-
declare const ApprovalResponse_base: Schema.Class<ApprovalResponse, {
|
|
582
|
-
token: Schema.refine<string, typeof Schema.Trimmed>;
|
|
583
|
-
status_url: Schema.refine<string, typeof Schema.Trimmed>;
|
|
584
|
-
user_approve_url: Schema.refine<string, typeof Schema.Trimmed>;
|
|
585
|
-
}, Schema.Struct.Encoded<{
|
|
586
|
-
token: Schema.refine<string, typeof Schema.Trimmed>;
|
|
587
|
-
status_url: Schema.refine<string, typeof Schema.Trimmed>;
|
|
588
|
-
user_approve_url: Schema.refine<string, typeof Schema.Trimmed>;
|
|
589
|
-
}>, never, {
|
|
590
|
-
readonly token: string;
|
|
591
|
-
} & {
|
|
592
|
-
readonly status_url: string;
|
|
593
|
-
} & {
|
|
594
|
-
readonly user_approve_url: string;
|
|
595
|
-
}, {}, {}>;
|
|
596
|
-
export declare class ApprovalResponse extends ApprovalResponse_base {
|
|
597
|
-
}
|
|
494
|
+
readonly mode: Schema.optional<Schema.Literals<readonly ["create", "connect", "connect_choose"]>>;
|
|
495
|
+
readonly agent_address: Schema.optional<Schema.NonEmptyString>;
|
|
496
|
+
}>;
|
|
497
|
+
export type AgentApprovalRequest = typeof AgentApprovalRequest.Type;
|
|
498
|
+
export declare const ApprovalResponse: Schema.Struct<{
|
|
499
|
+
readonly token: Schema.NonEmptyString;
|
|
500
|
+
readonly status_url: Schema.NonEmptyString;
|
|
501
|
+
readonly user_approve_url: Schema.NonEmptyString;
|
|
502
|
+
}>;
|
|
503
|
+
export type ApprovalResponse = typeof ApprovalResponse.Type;
|
|
598
504
|
export declare const ApprovalStatusPending: Schema.Struct<{
|
|
599
|
-
status: Schema.Literal<
|
|
505
|
+
readonly status: Schema.Literal<"pending">;
|
|
600
506
|
}>;
|
|
601
507
|
export declare const ApprovalStatusResolved: Schema.Struct<{
|
|
602
|
-
status: Schema.Literal<
|
|
603
|
-
agent: Schema.optional<Schema.Struct<{
|
|
604
|
-
address: Schema.
|
|
605
|
-
agent_key_address: Schema.optional<Schema.
|
|
508
|
+
readonly status: Schema.Literal<"resolved">;
|
|
509
|
+
readonly agent: Schema.optional<Schema.Struct<{
|
|
510
|
+
readonly address: Schema.NonEmptyString;
|
|
511
|
+
readonly agent_key_address: Schema.optional<Schema.NonEmptyString>;
|
|
606
512
|
}>>;
|
|
607
|
-
resolved_at: Schema.
|
|
513
|
+
readonly resolved_at: Schema.String;
|
|
608
514
|
}>;
|
|
609
515
|
export declare const ApprovalStatusRejected: Schema.Struct<{
|
|
610
|
-
status: Schema.Literal<
|
|
611
|
-
resolved_at: Schema.
|
|
516
|
+
readonly status: Schema.Literal<"rejected">;
|
|
517
|
+
readonly resolved_at: Schema.String;
|
|
612
518
|
}>;
|
|
613
519
|
export declare const ApprovalStatusBlocked: Schema.Struct<{
|
|
614
|
-
status: Schema.Literal<
|
|
615
|
-
resolved_at: Schema.
|
|
520
|
+
readonly status: Schema.Literal<"blocked">;
|
|
521
|
+
readonly resolved_at: Schema.String;
|
|
616
522
|
}>;
|
|
617
|
-
export declare const ApprovalStatus: Schema.Union<[Schema.Struct<{
|
|
618
|
-
status: Schema.Literal<
|
|
523
|
+
export declare const ApprovalStatus: Schema.Union<readonly [Schema.Struct<{
|
|
524
|
+
readonly status: Schema.Literal<"pending">;
|
|
619
525
|
}>, Schema.Struct<{
|
|
620
|
-
status: Schema.Literal<
|
|
621
|
-
agent: Schema.optional<Schema.Struct<{
|
|
622
|
-
address: Schema.
|
|
623
|
-
agent_key_address: Schema.optional<Schema.
|
|
526
|
+
readonly status: Schema.Literal<"resolved">;
|
|
527
|
+
readonly agent: Schema.optional<Schema.Struct<{
|
|
528
|
+
readonly address: Schema.NonEmptyString;
|
|
529
|
+
readonly agent_key_address: Schema.optional<Schema.NonEmptyString>;
|
|
624
530
|
}>>;
|
|
625
|
-
resolved_at: Schema.
|
|
531
|
+
readonly resolved_at: Schema.String;
|
|
626
532
|
}>, Schema.Struct<{
|
|
627
|
-
status: Schema.Literal<
|
|
628
|
-
resolved_at: Schema.
|
|
533
|
+
readonly status: Schema.Literal<"rejected">;
|
|
534
|
+
readonly resolved_at: Schema.String;
|
|
629
535
|
}>, Schema.Struct<{
|
|
630
|
-
status: Schema.Literal<
|
|
631
|
-
resolved_at: Schema.
|
|
536
|
+
readonly status: Schema.Literal<"blocked">;
|
|
537
|
+
readonly resolved_at: Schema.String;
|
|
632
538
|
}>]>;
|
|
633
539
|
export type ApprovalStatus = typeof ApprovalStatus.Type;
|
|
634
|
-
export {};
|
|
635
540
|
//# sourceMappingURL=types.d.ts.map
|