@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.
Files changed (119) hide show
  1. package/dist/ampersend/agent-client.d.ts +81 -0
  2. package/dist/ampersend/agent-client.d.ts.map +1 -0
  3. package/dist/ampersend/agent-client.js +104 -0
  4. package/dist/ampersend/agent-client.js.map +1 -0
  5. package/dist/ampersend/agent.d.ts +118 -0
  6. package/dist/ampersend/agent.d.ts.map +1 -0
  7. package/dist/ampersend/agent.js +109 -0
  8. package/dist/ampersend/agent.js.map +1 -0
  9. package/dist/ampersend/approval.js.map +1 -1
  10. package/dist/ampersend/client.d.ts +32 -8
  11. package/dist/ampersend/client.d.ts.map +1 -1
  12. package/dist/ampersend/client.js +81 -3
  13. package/dist/ampersend/client.js.map +1 -1
  14. package/dist/ampersend/curated-agent.d.ts +94 -94
  15. package/dist/ampersend/curated-agent.d.ts.map +1 -1
  16. package/dist/ampersend/curated-agent.js +41 -41
  17. package/dist/ampersend/curated-agent.js.map +1 -1
  18. package/dist/ampersend/index.d.ts +2 -0
  19. package/dist/ampersend/index.d.ts.map +1 -1
  20. package/dist/ampersend/index.js +4 -0
  21. package/dist/ampersend/index.js.map +1 -1
  22. package/dist/ampersend/management.d.ts +23 -59
  23. package/dist/ampersend/management.d.ts.map +1 -1
  24. package/dist/ampersend/management.js +6 -8
  25. package/dist/ampersend/management.js.map +1 -1
  26. package/dist/ampersend/marketplace.d.ts +20 -14
  27. package/dist/ampersend/marketplace.d.ts.map +1 -1
  28. package/dist/ampersend/marketplace.js +23 -49
  29. package/dist/ampersend/marketplace.js.map +1 -1
  30. package/dist/ampersend/treasurer.d.ts +4 -0
  31. package/dist/ampersend/treasurer.d.ts.map +1 -1
  32. package/dist/ampersend/treasurer.js +2 -2
  33. package/dist/ampersend/treasurer.js.map +1 -1
  34. package/dist/ampersend/types.d.ts +215 -310
  35. package/dist/ampersend/types.d.ts.map +1 -1
  36. package/dist/ampersend/types.js +146 -119
  37. package/dist/ampersend/types.js.map +1 -1
  38. package/dist/ampersend/zod-bridge.d.ts +4 -5
  39. package/dist/ampersend/zod-bridge.d.ts.map +1 -1
  40. package/dist/ampersend/zod-bridge.js +35 -19
  41. package/dist/ampersend/zod-bridge.js.map +1 -1
  42. package/dist/cli/ampersend.js +45 -2
  43. package/dist/cli/ampersend.js.map +1 -1
  44. package/dist/cli/commands/agent.d.ts +24 -0
  45. package/dist/cli/commands/agent.d.ts.map +1 -0
  46. package/dist/cli/commands/agent.js +166 -0
  47. package/dist/cli/commands/agent.js.map +1 -0
  48. package/dist/cli/commands/card.d.ts +128 -0
  49. package/dist/cli/commands/card.d.ts.map +1 -0
  50. package/dist/cli/commands/card.js +404 -0
  51. package/dist/cli/commands/card.js.map +1 -0
  52. package/dist/cli/commands/config.d.ts +1 -1
  53. package/dist/cli/commands/config.d.ts.map +1 -1
  54. package/dist/cli/commands/config.js +31 -42
  55. package/dist/cli/commands/config.js.map +1 -1
  56. package/dist/cli/commands/fetch.d.ts +77 -2
  57. package/dist/cli/commands/fetch.d.ts.map +1 -1
  58. package/dist/cli/commands/fetch.js +210 -129
  59. package/dist/cli/commands/fetch.js.map +1 -1
  60. package/dist/cli/commands/fund.d.ts +3 -0
  61. package/dist/cli/commands/fund.d.ts.map +1 -0
  62. package/dist/cli/commands/fund.js +22 -0
  63. package/dist/cli/commands/fund.js.map +1 -0
  64. package/dist/cli/commands/marketplace.d.ts +6 -0
  65. package/dist/cli/commands/marketplace.d.ts.map +1 -1
  66. package/dist/cli/commands/marketplace.js +27 -8
  67. package/dist/cli/commands/marketplace.js.map +1 -1
  68. package/dist/cli/commands/setup.d.ts +4 -1
  69. package/dist/cli/commands/setup.d.ts.map +1 -1
  70. package/dist/cli/commands/setup.js +66 -41
  71. package/dist/cli/commands/setup.js.map +1 -1
  72. package/dist/cli/commands/version.d.ts +3 -0
  73. package/dist/cli/commands/version.d.ts.map +1 -0
  74. package/dist/cli/commands/version.js +12 -0
  75. package/dist/cli/commands/version.js.map +1 -0
  76. package/dist/cli/config.d.ts +225 -45
  77. package/dist/cli/config.d.ts.map +1 -1
  78. package/dist/cli/config.js +426 -115
  79. package/dist/cli/config.js.map +1 -1
  80. package/dist/index.d.ts +2 -0
  81. package/dist/index.d.ts.map +1 -1
  82. package/dist/index.js +1 -0
  83. package/dist/index.js.map +1 -1
  84. package/dist/mcp/proxy/cli.js +1 -0
  85. package/dist/mcp/proxy/cli.js.map +1 -1
  86. package/dist/mcp/proxy/factory.d.ts +2 -0
  87. package/dist/mcp/proxy/factory.d.ts.map +1 -1
  88. package/dist/mcp/proxy/factory.js +10 -1
  89. package/dist/mcp/proxy/factory.js.map +1 -1
  90. package/dist/mcp/proxy/server/init.js +1 -1
  91. package/dist/mcp/proxy/server/init.js.map +1 -1
  92. package/dist/mcp/proxy/server/server.d.ts +3 -1
  93. package/dist/mcp/proxy/server/server.d.ts.map +1 -1
  94. package/dist/mcp/proxy/server/server.js +5 -2
  95. package/dist/mcp/proxy/server/server.js.map +1 -1
  96. package/dist/mcp/proxy/types.d.ts +7 -0
  97. package/dist/mcp/proxy/types.d.ts.map +1 -1
  98. package/dist/mcp/proxy/types.js.map +1 -1
  99. package/dist/version.d.ts +3 -1
  100. package/dist/version.d.ts.map +1 -1
  101. package/dist/version.js +3 -1
  102. package/dist/version.js.map +1 -1
  103. package/dist/x402/http/factory.d.ts +2 -0
  104. package/dist/x402/http/factory.d.ts.map +1 -1
  105. package/dist/x402/http/factory.js +1 -0
  106. package/dist/x402/http/factory.js.map +1 -1
  107. package/dist/x402/index.d.ts +2 -0
  108. package/dist/x402/index.d.ts.map +1 -1
  109. package/dist/x402/index.js +2 -0
  110. package/dist/x402/index.js.map +1 -1
  111. package/dist/x402/siwx.d.ts +55 -0
  112. package/dist/x402/siwx.d.ts.map +1 -0
  113. package/dist/x402/siwx.js +122 -0
  114. package/dist/x402/siwx.js.map +1 -0
  115. package/dist/x402/wallets/smart-account/cosigned.d.ts +9 -2
  116. package/dist/x402/wallets/smart-account/cosigned.d.ts.map +1 -1
  117. package/dist/x402/wallets/smart-account/cosigned.js +13 -4
  118. package/dist/x402/wallets/smart-account/cosigned.js.map +1 -1
  119. package/package.json +3 -2
@@ -1,136 +1,76 @@
1
1
  import { Schema } from "effect";
2
- export declare const Scheme: Schema.Literal<["exact", "deferred"]>;
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.refine<string, typeof Schema.NonEmptyTrimmedString>;
8
+ export declare const Address: Schema.NonEmptyString;
5
9
  export type Address = typeof Address.Type;
6
- export declare const TxHash: Schema.filter<typeof Schema.NonEmptyTrimmedString>;
10
+ export declare const TxHash: Schema.NonEmptyString;
7
11
  export type TxHash = typeof TxHash.Type;
8
- export declare const Caip2ID: Schema.filter<typeof Schema.NonEmptyTrimmedString>;
12
+ export declare const Caip2ID: Schema.NonEmptyString;
9
13
  export type Caip2ID = typeof Caip2ID.Type;
10
- export declare const Hex32Bytes: Schema.filter<typeof Schema.NonEmptyTrimmedString>;
14
+ export declare const Hex32Bytes: Schema.NonEmptyString;
11
15
  export type Hex32Bytes = typeof Hex32Bytes.Type;
12
- export declare const Hex65Bytes: Schema.filter<typeof Schema.NonEmptyTrimmedString>;
16
+ export declare const Hex65Bytes: Schema.NonEmptyString;
13
17
  export type Hex65Bytes = typeof Hex65Bytes.Type;
14
- export declare const NonNegativeIntegerString: Schema.filter<typeof Schema.NonEmptyTrimmedString>;
18
+ export declare const NonNegativeIntegerString: Schema.NonEmptyString;
15
19
  export type NonNegativeIntegerString = typeof NonNegativeIntegerString.Type;
16
- export declare const ID: Schema.brand<typeof Schema.UUID, "ID">;
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.refine<number, typeof Schema.NonNegative>, Schema.filter<Schema.filter<typeof Schema.NumberFromString>>]>;
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 SIWENonceResponse_base: Schema.Class<SIWENonceResponse, {
21
- nonce: Schema.refine<string, typeof Schema.Trimmed>;
22
- sessionId: Schema.refine<string, typeof Schema.Trimmed>;
23
- }, Schema.Struct.Encoded<{
24
- nonce: Schema.refine<string, typeof Schema.Trimmed>;
25
- sessionId: Schema.refine<string, typeof Schema.Trimmed>;
26
- }>, never, {
27
- readonly nonce: string;
28
- } & {
29
- readonly sessionId: string;
30
- }, {}, {}>;
31
- export declare class SIWENonceResponse extends SIWENonceResponse_base {
32
- }
33
- declare const SIWELoginRequest_base: Schema.Class<SIWELoginRequest, {
34
- signature: Schema.refine<string, typeof Schema.Trimmed>;
35
- message: Schema.refine<string, typeof Schema.Trimmed>;
36
- sessionId: Schema.refine<string, typeof Schema.Trimmed>;
37
- agentAddress: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
38
- }, Schema.Struct.Encoded<{
39
- signature: Schema.refine<string, typeof Schema.Trimmed>;
40
- message: Schema.refine<string, typeof Schema.Trimmed>;
41
- sessionId: Schema.refine<string, typeof Schema.Trimmed>;
42
- agentAddress: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
43
- }>, never, {
44
- readonly sessionId: string;
45
- } & {
46
- readonly signature: string;
47
- } & {
48
- readonly message: string;
49
- } & {
50
- readonly agentAddress: string;
51
- }, {}, {}>;
52
- export declare class SIWELoginRequest extends SIWELoginRequest_base {
53
- }
54
- declare const SIWELoginResponse_base: Schema.Class<SIWELoginResponse, {
55
- token: Schema.refine<string, typeof Schema.Trimmed>;
56
- agentAddress: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
57
- expiresAt: Schema.transformOrFail<Schema.SchemaClass<string, string, never>, typeof Schema.DateTimeUtcFromSelf, never>;
58
- }, Schema.Struct.Encoded<{
59
- token: Schema.refine<string, typeof Schema.Trimmed>;
60
- agentAddress: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
61
- expiresAt: Schema.transformOrFail<Schema.SchemaClass<string, string, never>, typeof Schema.DateTimeUtcFromSelf, never>;
62
- }>, never, {
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.Literal<["x402-v1", "x402-v2"]>;
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<["x402-v1"]>;
133
- data: Schema.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<["x402-v2"]>;
168
- data: Schema.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<["x402-v1"]>;
210
- data: Schema.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<["x402-v2"]>;
223
- data: Schema.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<["x402-v1"]>;
266
- data: Schema.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<["x402-v2"]>;
301
- data: Schema.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<typeof Schema.NonEmptyTrimmedString>;
341
- serverUrl: Schema.optional<typeof Schema.NonEmptyTrimmedString>;
342
- params: Schema.optional<typeof Schema.Unknown>;
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 class CoSignature extends CoSignature_base {
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.refine<number, typeof Schema.NonNegative>;
397
- limits: Schema.Struct<{
398
- dailyRemaining: Schema.refine<string, typeof Schema.Trimmed>;
399
- monthlyRemaining: Schema.refine<string, typeof Schema.Trimmed>;
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<typeof CoSignature>;
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.Array$<Schema.Struct<{
404
- acceptsIndex: Schema.refine<number, typeof Schema.NonNegative>;
405
- limits: Schema.Struct<{
406
- dailyRemaining: Schema.refine<string, typeof Schema.Trimmed>;
407
- monthlyRemaining: Schema.refine<string, typeof Schema.Trimmed>;
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.Array$<Schema.Struct<{
412
- acceptsIndex: Schema.refine<number, typeof Schema.NonNegative>;
413
- reason: typeof Schema.NonEmptyTrimmedString;
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.refine<string, typeof Schema.NonEmptyTrimmedString>;
417
- validBefore: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
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<["sending"]>;
363
+ export declare const PaymentEventType: Schema.Union<readonly [Schema.Struct<{
364
+ readonly type: Schema.Literal<"sending">;
423
365
  }>, Schema.Struct<{
424
- type: Schema.Literal<["accepted"]>;
366
+ readonly type: Schema.Literal<"accepted">;
425
367
  }>, Schema.Struct<{
426
- type: Schema.Literal<["rejected"]>;
427
- reason: Schema.refine<string, typeof Schema.Trimmed>;
368
+ readonly type: Schema.Literal<"rejected">;
369
+ readonly reason: Schema.NonEmptyString;
428
370
  }>, Schema.Struct<{
429
- type: Schema.Literal<["error"]>;
430
- reason: Schema.refine<string, typeof Schema.Trimmed>;
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.refine<string, typeof Schema.Trimmed>;
437
- payment: Schema.Union<[Schema.Struct<{
438
- protocol: Schema.Literal<["x402-v1"]>;
439
- data: Schema.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<["x402-v2"]>;
452
- data: Schema.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<["sending"]>;
432
+ readonly event: Schema.Union<readonly [Schema.Struct<{
433
+ readonly type: Schema.Literal<"sending">;
492
434
  }>, Schema.Struct<{
493
- type: Schema.Literal<["accepted"]>;
435
+ readonly type: Schema.Literal<"accepted">;
494
436
  }>, Schema.Struct<{
495
- type: Schema.Literal<["rejected"]>;
496
- reason: Schema.refine<string, typeof Schema.Trimmed>;
437
+ readonly type: Schema.Literal<"rejected">;
438
+ readonly reason: Schema.NonEmptyString;
497
439
  }>, Schema.Struct<{
498
- type: Schema.Literal<["error"]>;
499
- reason: Schema.refine<string, typeof Schema.Trimmed>;
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 AgentPaymentEventResponse_base: Schema.Class<AgentPaymentEventResponse, {
504
- received: Schema.SchemaClass<boolean, boolean, never>;
505
- paymentId: Schema.optional<typeof Schema.UUID>;
506
- }, Schema.Struct.Encoded<{
507
- received: Schema.SchemaClass<boolean, boolean, never>;
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
- agentAddress: Address;
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.SchemaClass<boolean, boolean, never>;
533
- daily_limit: Schema.NullOr<typeof Schema.String>;
534
- monthly_limit: Schema.NullOr<typeof Schema.String>;
535
- per_transaction_limit: Schema.NullOr<typeof Schema.String>;
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 AgentApprovalRequest_base: Schema.Class<AgentApprovalRequest, {
538
- name: Schema.NullOr<typeof Schema.String>;
539
- agent_key_address: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
540
- key_name: Schema.optional<Schema.SchemaClass<string, string, never>>;
541
- spend_config: Schema.optional<Schema.NullOr<Schema.Struct<{
542
- auto_topup_allowed: Schema.SchemaClass<boolean, boolean, never>;
543
- daily_limit: Schema.NullOr<typeof Schema.String>;
544
- monthly_limit: Schema.NullOr<typeof Schema.String>;
545
- per_transaction_limit: Schema.NullOr<typeof Schema.String>;
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.Literal<["create", "connect", "connect_choose"]>>;
548
- agent_address: Schema.optional<Schema.refine<string, typeof Schema.NonEmptyTrimmedString>>;
549
- }, Schema.Struct.Encoded<{
550
- name: Schema.NullOr<typeof Schema.String>;
551
- agent_key_address: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
552
- key_name: Schema.optional<Schema.SchemaClass<string, string, never>>;
553
- spend_config: Schema.optional<Schema.NullOr<Schema.Struct<{
554
- auto_topup_allowed: Schema.SchemaClass<boolean, boolean, never>;
555
- daily_limit: Schema.NullOr<typeof Schema.String>;
556
- monthly_limit: Schema.NullOr<typeof Schema.String>;
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<["pending"]>;
505
+ readonly status: Schema.Literal<"pending">;
600
506
  }>;
601
507
  export declare const ApprovalStatusResolved: Schema.Struct<{
602
- status: Schema.Literal<["resolved"]>;
603
- agent: Schema.optional<Schema.Struct<{
604
- address: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
605
- agent_key_address: Schema.optional<Schema.refine<string, typeof Schema.NonEmptyTrimmedString>>;
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.SchemaClass<string, string, never>;
513
+ readonly resolved_at: Schema.String;
608
514
  }>;
609
515
  export declare const ApprovalStatusRejected: Schema.Struct<{
610
- status: Schema.Literal<["rejected"]>;
611
- resolved_at: Schema.SchemaClass<string, string, never>;
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<["blocked"]>;
615
- resolved_at: Schema.SchemaClass<string, string, never>;
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<["pending"]>;
523
+ export declare const ApprovalStatus: Schema.Union<readonly [Schema.Struct<{
524
+ readonly status: Schema.Literal<"pending">;
619
525
  }>, Schema.Struct<{
620
- status: Schema.Literal<["resolved"]>;
621
- agent: Schema.optional<Schema.Struct<{
622
- address: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
623
- agent_key_address: Schema.optional<Schema.refine<string, typeof Schema.NonEmptyTrimmedString>>;
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.SchemaClass<string, string, never>;
531
+ readonly resolved_at: Schema.String;
626
532
  }>, Schema.Struct<{
627
- status: Schema.Literal<["rejected"]>;
628
- resolved_at: Schema.SchemaClass<string, string, never>;
533
+ readonly status: Schema.Literal<"rejected">;
534
+ readonly resolved_at: Schema.String;
629
535
  }>, Schema.Struct<{
630
- status: Schema.Literal<["blocked"]>;
631
- resolved_at: Schema.SchemaClass<string, string, never>;
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