@naturalpay/sdk 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +2 -2
  3. package/api-promise.d.mts +1 -0
  4. package/api-promise.d.mts.map +1 -1
  5. package/api-promise.d.ts +1 -0
  6. package/api-promise.d.ts.map +1 -1
  7. package/api-promise.mjs +1 -0
  8. package/api-promise.mjs.map +1 -1
  9. package/client.d.mts +17 -5
  10. package/client.d.mts.map +1 -1
  11. package/client.d.ts +17 -5
  12. package/client.d.ts.map +1 -1
  13. package/client.js +16 -4
  14. package/client.js.map +1 -1
  15. package/client.mjs +16 -4
  16. package/client.mjs.map +1 -1
  17. package/core/api-promise.d.mts.map +1 -1
  18. package/core/api-promise.d.ts.map +1 -1
  19. package/core/api-promise.mjs.map +1 -1
  20. package/core/error.mjs.map +1 -1
  21. package/core/resource.d.mts.map +1 -1
  22. package/core/resource.d.ts.map +1 -1
  23. package/core/uploads.d.mts.map +1 -1
  24. package/core/uploads.d.ts.map +1 -1
  25. package/core/uploads.mjs.map +1 -1
  26. package/error.d.mts +1 -0
  27. package/error.d.mts.map +1 -1
  28. package/error.d.ts +1 -0
  29. package/error.d.ts.map +1 -1
  30. package/error.mjs +1 -0
  31. package/error.mjs.map +1 -1
  32. package/index.d.mts.map +1 -1
  33. package/index.d.ts.map +1 -1
  34. package/index.mjs.map +1 -1
  35. package/internal/detect-platform.mjs.map +1 -1
  36. package/internal/headers.mjs.map +1 -1
  37. package/internal/parse.d.mts.map +1 -1
  38. package/internal/parse.d.ts.map +1 -1
  39. package/internal/parse.mjs.map +1 -1
  40. package/internal/qs/formats.d.mts.map +1 -1
  41. package/internal/qs/formats.d.ts.map +1 -1
  42. package/internal/qs/index.d.mts +2 -2
  43. package/internal/qs/index.d.mts.map +1 -1
  44. package/internal/qs/index.d.ts +2 -2
  45. package/internal/qs/index.d.ts.map +1 -1
  46. package/internal/qs/index.mjs.map +1 -1
  47. package/internal/qs/stringify.d.mts.map +1 -1
  48. package/internal/qs/stringify.d.ts.map +1 -1
  49. package/internal/qs/stringify.mjs.map +1 -1
  50. package/internal/qs/utils.d.mts.map +1 -1
  51. package/internal/qs/utils.d.ts.map +1 -1
  52. package/internal/qs/utils.mjs.map +1 -1
  53. package/internal/request-options.d.mts.map +1 -1
  54. package/internal/request-options.d.ts.map +1 -1
  55. package/internal/shims.d.mts +6 -0
  56. package/internal/shims.d.mts.map +1 -1
  57. package/internal/shims.d.ts +6 -0
  58. package/internal/shims.d.ts.map +1 -1
  59. package/internal/to-file.d.mts.map +1 -1
  60. package/internal/to-file.d.ts.map +1 -1
  61. package/internal/to-file.mjs.map +1 -1
  62. package/internal/types.d.mts +4 -4
  63. package/internal/types.d.mts.map +1 -1
  64. package/internal/types.d.ts +4 -4
  65. package/internal/types.d.ts.map +1 -1
  66. package/internal/uploads.d.mts.map +1 -1
  67. package/internal/uploads.d.ts.map +1 -1
  68. package/internal/uploads.mjs.map +1 -1
  69. package/internal/utils/base64.mjs.map +1 -1
  70. package/internal/utils/log.d.mts.map +1 -1
  71. package/internal/utils/log.d.ts.map +1 -1
  72. package/internal/utils/log.mjs.map +1 -1
  73. package/internal/utils/path.mjs.map +1 -1
  74. package/internal/utils/query.mjs.map +1 -1
  75. package/internal/utils/values.mjs.map +1 -1
  76. package/internal/utils.d.mts.map +1 -1
  77. package/internal/utils.d.ts.map +1 -1
  78. package/internal/utils.mjs.map +1 -1
  79. package/lib/envelope.d.mts.map +1 -1
  80. package/lib/envelope.d.ts.map +1 -1
  81. package/lib/envelope.mjs.map +1 -1
  82. package/package.json +1 -1
  83. package/resource.d.mts +1 -0
  84. package/resource.d.mts.map +1 -1
  85. package/resource.d.ts +1 -0
  86. package/resource.d.ts.map +1 -1
  87. package/resource.mjs +1 -0
  88. package/resource.mjs.map +1 -1
  89. package/resources/agents.d.mts +4 -153
  90. package/resources/agents.d.mts.map +1 -1
  91. package/resources/agents.d.ts +4 -153
  92. package/resources/agents.d.ts.map +1 -1
  93. package/resources/agents.js +5 -5
  94. package/resources/agents.js.map +1 -1
  95. package/resources/agents.mjs +5 -5
  96. package/resources/agents.mjs.map +1 -1
  97. package/resources/api-keys.d.mts.map +1 -1
  98. package/resources/api-keys.d.ts.map +1 -1
  99. package/resources/api-keys.js +1 -1
  100. package/resources/api-keys.js.map +1 -1
  101. package/resources/api-keys.mjs +1 -1
  102. package/resources/api-keys.mjs.map +1 -1
  103. package/resources/counterparties.d.mts +5 -55
  104. package/resources/counterparties.d.mts.map +1 -1
  105. package/resources/counterparties.d.ts +5 -55
  106. package/resources/counterparties.d.ts.map +1 -1
  107. package/resources/counterparties.js +1 -3
  108. package/resources/counterparties.js.map +1 -1
  109. package/resources/counterparties.mjs +1 -3
  110. package/resources/counterparties.mjs.map +1 -1
  111. package/resources/customers.d.mts.map +1 -1
  112. package/resources/customers.d.ts.map +1 -1
  113. package/resources/customers.mjs.map +1 -1
  114. package/resources/delegations.d.mts.map +1 -1
  115. package/resources/delegations.d.ts.map +1 -1
  116. package/resources/delegations.mjs.map +1 -1
  117. package/resources/external-accounts.d.mts +239 -0
  118. package/resources/external-accounts.d.mts.map +1 -0
  119. package/resources/external-accounts.d.ts +239 -0
  120. package/resources/external-accounts.d.ts.map +1 -0
  121. package/resources/external-accounts.js +47 -0
  122. package/resources/external-accounts.js.map +1 -0
  123. package/resources/external-accounts.mjs +43 -0
  124. package/resources/external-accounts.mjs.map +1 -0
  125. package/resources/index.d.mts +3 -1
  126. package/resources/index.d.mts.map +1 -1
  127. package/resources/index.d.ts +3 -1
  128. package/resources/index.d.ts.map +1 -1
  129. package/resources/index.js +5 -1
  130. package/resources/index.js.map +1 -1
  131. package/resources/index.mjs +2 -0
  132. package/resources/index.mjs.map +1 -1
  133. package/resources/invitations.d.mts +1 -1
  134. package/resources/invitations.d.mts.map +1 -1
  135. package/resources/invitations.d.ts +1 -1
  136. package/resources/invitations.d.ts.map +1 -1
  137. package/resources/invitations.js +1 -1
  138. package/resources/invitations.mjs +1 -1
  139. package/resources/invitations.mjs.map +1 -1
  140. package/resources/parties.d.mts +2 -2
  141. package/resources/parties.d.mts.map +1 -1
  142. package/resources/parties.d.ts +2 -2
  143. package/resources/parties.d.ts.map +1 -1
  144. package/resources/parties.js +3 -3
  145. package/resources/parties.js.map +1 -1
  146. package/resources/parties.mjs +3 -3
  147. package/resources/parties.mjs.map +1 -1
  148. package/resources/payment-requests.d.mts +24 -17
  149. package/resources/payment-requests.d.mts.map +1 -1
  150. package/resources/payment-requests.d.ts +24 -17
  151. package/resources/payment-requests.d.ts.map +1 -1
  152. package/resources/payment-requests.js +0 -1
  153. package/resources/payment-requests.js.map +1 -1
  154. package/resources/payment-requests.mjs +0 -1
  155. package/resources/payment-requests.mjs.map +1 -1
  156. package/resources/payments.d.mts +1 -1
  157. package/resources/payments.d.mts.map +1 -1
  158. package/resources/payments.d.ts +1 -1
  159. package/resources/payments.d.ts.map +1 -1
  160. package/resources/payments.mjs.map +1 -1
  161. package/resources/transactions.d.mts +18 -10
  162. package/resources/transactions.d.mts.map +1 -1
  163. package/resources/transactions.d.ts +18 -10
  164. package/resources/transactions.d.ts.map +1 -1
  165. package/resources/transactions.js +2 -2
  166. package/resources/transactions.mjs +2 -2
  167. package/resources/transactions.mjs.map +1 -1
  168. package/resources/wallet.d.mts +196 -328
  169. package/resources/wallet.d.mts.map +1 -1
  170. package/resources/wallet.d.ts +196 -328
  171. package/resources/wallet.d.ts.map +1 -1
  172. package/resources/wallet.js +16 -63
  173. package/resources/wallet.js.map +1 -1
  174. package/resources/wallet.mjs +16 -63
  175. package/resources/wallet.mjs.map +1 -1
  176. package/resources/webhooks.d.mts +775 -0
  177. package/resources/webhooks.d.mts.map +1 -0
  178. package/resources/webhooks.d.ts +775 -0
  179. package/resources/webhooks.d.ts.map +1 -0
  180. package/resources/webhooks.js +163 -0
  181. package/resources/webhooks.js.map +1 -0
  182. package/resources/webhooks.mjs +159 -0
  183. package/resources/webhooks.mjs.map +1 -0
  184. package/resources.d.mts.map +1 -1
  185. package/resources.d.ts.map +1 -1
  186. package/resources.mjs.map +1 -1
  187. package/src/client.ts +69 -21
  188. package/src/resources/agents.ts +5 -185
  189. package/src/resources/api-keys.ts +1 -1
  190. package/src/resources/counterparties.ts +5 -64
  191. package/src/resources/external-accounts.ts +324 -0
  192. package/src/resources/index.ts +26 -8
  193. package/src/resources/invitations.ts +1 -1
  194. package/src/resources/parties.ts +3 -3
  195. package/src/resources/payment-requests.ts +28 -18
  196. package/src/resources/payments.ts +1 -1
  197. package/src/resources/transactions.ts +20 -10
  198. package/src/resources/wallet.ts +223 -419
  199. package/src/resources/webhooks.ts +1225 -0
  200. package/src/version.ts +1 -1
  201. package/uploads.d.mts +1 -0
  202. package/uploads.d.mts.map +1 -1
  203. package/uploads.d.ts +1 -0
  204. package/uploads.d.ts.map +1 -1
  205. package/uploads.mjs +1 -0
  206. package/uploads.mjs.map +1 -1
  207. package/version.d.mts +1 -1
  208. package/version.d.ts +1 -1
  209. package/version.js +1 -1
  210. package/version.mjs +1 -1
@@ -0,0 +1,775 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import { APIPromise } from "../core/api-promise.mjs";
3
+ import { RequestOptions } from "../internal/request-options.mjs";
4
+ /**
5
+ * Webhook endpoint management
6
+ */
7
+ export declare class Webhooks extends APIResource {
8
+ /**
9
+ * Create a new webhook endpoint. The signing secret is returned only once.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const webhook = await client.webhooks.create({
14
+ * enabledEvents: ['*'],
15
+ * url: 'https://example.com',
16
+ * 'Idempotency-Key': 'Idempotency-Key',
17
+ * });
18
+ * ```
19
+ */
20
+ create(params: WebhookCreateParams, options?: RequestOptions): APIPromise<WebhookCreateResponse>;
21
+ /**
22
+ * Partially update a webhook endpoint.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const webhook = await client.webhooks.update('webhookId', {
27
+ * 'Idempotency-Key': 'Idempotency-Key',
28
+ * });
29
+ * ```
30
+ */
31
+ update(webhookID: string, params: WebhookUpdateParams, options?: RequestOptions): APIPromise<WebhookUpdateResponse>;
32
+ /**
33
+ * List webhook endpoints for the authenticated party.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const webhooks = await client.webhooks.list();
38
+ * ```
39
+ */
40
+ list(params?: WebhookListParams | null | undefined, options?: RequestOptions): APIPromise<WebhookListResponse>;
41
+ /**
42
+ * Get details of a specific webhook endpoint.
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const webhook = await client.webhooks.get('webhookId');
47
+ * ```
48
+ */
49
+ get(webhookID: string, params?: WebhookGetParams | null | undefined, options?: RequestOptions): APIPromise<WebhookGetResponse>;
50
+ /**
51
+ * Soft-delete a webhook endpoint.
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * const webhook = await client.webhooks.remove('webhookId', {
56
+ * 'Idempotency-Key': 'Idempotency-Key',
57
+ * });
58
+ * ```
59
+ */
60
+ remove(webhookID: string, params: WebhookRemoveParams, options?: RequestOptions): APIPromise<WebhookRemoveResponse>;
61
+ /**
62
+ * Generate a new signing secret. The previous secret remains valid for the
63
+ * specified grace period. Requires Idempotency-Key header.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * const response = await client.webhooks.rotateSecret(
68
+ * 'webhookId',
69
+ * {
70
+ * expiresInSeconds: 0,
71
+ * 'Idempotency-Key': 'Idempotency-Key',
72
+ * },
73
+ * );
74
+ * ```
75
+ */
76
+ rotateSecret(webhookID: string, params: WebhookRotateSecretParams, options?: RequestOptions): APIPromise<WebhookRotateSecretResponse>;
77
+ }
78
+ export interface WebhookCreateResponse {
79
+ data: WebhookCreateResponse.Data;
80
+ }
81
+ export declare namespace WebhookCreateResponse {
82
+ interface Data {
83
+ /**
84
+ * Resource ID (whk_xxx)
85
+ */
86
+ id: string;
87
+ /**
88
+ * Resource attributes
89
+ */
90
+ attributes: Data.Attributes;
91
+ /**
92
+ * Resource relationships
93
+ */
94
+ relationships: Data.Relationships;
95
+ /**
96
+ * Resource type
97
+ */
98
+ type: string;
99
+ }
100
+ namespace Data {
101
+ /**
102
+ * Resource attributes
103
+ */
104
+ interface Attributes {
105
+ /**
106
+ * Creation timestamp (ISO 8601)
107
+ */
108
+ createdAt: string;
109
+ /**
110
+ * Human-readable description
111
+ */
112
+ description: string;
113
+ /**
114
+ * Event types this webhook listens to
115
+ */
116
+ enabledEvents: Array<'*' | 'party.updated' | 'party.delegation_granted' | 'wallet.created' | 'external_account.connected' | 'agent_delegation_invitation.created' | 'agent_delegation_invitation.accepted' | 'agent_delegation_invitation.declined' | 'agent_delegation_invitation.cancelled' | 'agent_delegation.revoked' | 'delegation.activated' | 'delegation.revoked' | 'deposit.created' | 'deposit.completed' | 'deposit.failed' | 'deposit.returned' | 'withdrawal.created' | 'withdrawal.completed' | 'withdrawal.failed' | 'withdrawal.returned' | 'payment.created' | 'payment.completed' | 'payment.failed' | 'payment_request.created' | 'payment_request.completed' | 'payment_request.failed' | 'payment_request.returned'>;
117
+ /**
118
+ * Webhook signing secret (shown only once — store securely!)
119
+ */
120
+ signingSecret: string;
121
+ /**
122
+ * Webhook status
123
+ */
124
+ status: 'ENABLED' | 'DISABLED';
125
+ /**
126
+ * Custom metadata tags
127
+ */
128
+ tags: {
129
+ [key: string]: string;
130
+ };
131
+ /**
132
+ * Last update timestamp (ISO 8601)
133
+ */
134
+ updatedAt: string;
135
+ /**
136
+ * Webhook endpoint URL
137
+ */
138
+ url: string;
139
+ }
140
+ /**
141
+ * Resource relationships
142
+ */
143
+ interface Relationships {
144
+ /**
145
+ * Party that owns the webhook
146
+ */
147
+ party: Relationships.Party;
148
+ }
149
+ namespace Relationships {
150
+ /**
151
+ * Party that owns the webhook
152
+ */
153
+ interface Party {
154
+ /**
155
+ * Related resource identifier
156
+ */
157
+ data: Party.Data;
158
+ }
159
+ namespace Party {
160
+ /**
161
+ * Related resource identifier
162
+ */
163
+ interface Data {
164
+ id: string;
165
+ /**
166
+ * Resource type
167
+ */
168
+ type: string;
169
+ }
170
+ }
171
+ }
172
+ }
173
+ }
174
+ export interface WebhookUpdateResponse {
175
+ data: WebhookUpdateResponse.Data;
176
+ }
177
+ export declare namespace WebhookUpdateResponse {
178
+ interface Data {
179
+ /**
180
+ * Resource ID (whk_xxx)
181
+ */
182
+ id: string;
183
+ /**
184
+ * Resource attributes
185
+ */
186
+ attributes: Data.Attributes;
187
+ /**
188
+ * Resource relationships
189
+ */
190
+ relationships: Data.Relationships;
191
+ /**
192
+ * Resource type
193
+ */
194
+ type: string;
195
+ }
196
+ namespace Data {
197
+ /**
198
+ * Resource attributes
199
+ */
200
+ interface Attributes {
201
+ /**
202
+ * Creation timestamp (ISO 8601)
203
+ */
204
+ createdAt: string;
205
+ /**
206
+ * Human-readable description
207
+ */
208
+ description: string;
209
+ /**
210
+ * Event types this webhook listens to
211
+ */
212
+ enabledEvents: Array<'*' | 'party.updated' | 'party.delegation_granted' | 'wallet.created' | 'external_account.connected' | 'agent_delegation_invitation.created' | 'agent_delegation_invitation.accepted' | 'agent_delegation_invitation.declined' | 'agent_delegation_invitation.cancelled' | 'agent_delegation.revoked' | 'delegation.activated' | 'delegation.revoked' | 'deposit.created' | 'deposit.completed' | 'deposit.failed' | 'deposit.returned' | 'withdrawal.created' | 'withdrawal.completed' | 'withdrawal.failed' | 'withdrawal.returned' | 'payment.created' | 'payment.completed' | 'payment.failed' | 'payment_request.created' | 'payment_request.completed' | 'payment_request.failed' | 'payment_request.returned'>;
213
+ /**
214
+ * Webhook status
215
+ */
216
+ status: 'ENABLED' | 'DISABLED';
217
+ /**
218
+ * Custom metadata tags
219
+ */
220
+ tags: {
221
+ [key: string]: string;
222
+ };
223
+ /**
224
+ * Last update timestamp (ISO 8601)
225
+ */
226
+ updatedAt: string;
227
+ /**
228
+ * Webhook endpoint URL
229
+ */
230
+ url: string;
231
+ }
232
+ /**
233
+ * Resource relationships
234
+ */
235
+ interface Relationships {
236
+ /**
237
+ * Party that owns the webhook
238
+ */
239
+ party: Relationships.Party;
240
+ }
241
+ namespace Relationships {
242
+ /**
243
+ * Party that owns the webhook
244
+ */
245
+ interface Party {
246
+ /**
247
+ * Related resource identifier
248
+ */
249
+ data: Party.Data;
250
+ }
251
+ namespace Party {
252
+ /**
253
+ * Related resource identifier
254
+ */
255
+ interface Data {
256
+ id: string;
257
+ /**
258
+ * Resource type
259
+ */
260
+ type: string;
261
+ }
262
+ }
263
+ }
264
+ }
265
+ }
266
+ export interface WebhookListResponse {
267
+ data: Array<WebhookListResponse.Data>;
268
+ meta: WebhookListResponse.Meta;
269
+ }
270
+ export declare namespace WebhookListResponse {
271
+ interface Data {
272
+ /**
273
+ * Resource ID (whk_xxx)
274
+ */
275
+ id: string;
276
+ /**
277
+ * Resource attributes
278
+ */
279
+ attributes: Data.Attributes;
280
+ /**
281
+ * Resource relationships
282
+ */
283
+ relationships: Data.Relationships;
284
+ /**
285
+ * Resource type
286
+ */
287
+ type: string;
288
+ }
289
+ namespace Data {
290
+ /**
291
+ * Resource attributes
292
+ */
293
+ interface Attributes {
294
+ /**
295
+ * Creation timestamp (ISO 8601)
296
+ */
297
+ createdAt: string;
298
+ /**
299
+ * Human-readable description
300
+ */
301
+ description: string;
302
+ /**
303
+ * Event types this webhook listens to
304
+ */
305
+ enabledEvents: Array<'*' | 'party.updated' | 'party.delegation_granted' | 'wallet.created' | 'external_account.connected' | 'agent_delegation_invitation.created' | 'agent_delegation_invitation.accepted' | 'agent_delegation_invitation.declined' | 'agent_delegation_invitation.cancelled' | 'agent_delegation.revoked' | 'delegation.activated' | 'delegation.revoked' | 'deposit.created' | 'deposit.completed' | 'deposit.failed' | 'deposit.returned' | 'withdrawal.created' | 'withdrawal.completed' | 'withdrawal.failed' | 'withdrawal.returned' | 'payment.created' | 'payment.completed' | 'payment.failed' | 'payment_request.created' | 'payment_request.completed' | 'payment_request.failed' | 'payment_request.returned'>;
306
+ /**
307
+ * Webhook status
308
+ */
309
+ status: 'ENABLED' | 'DISABLED';
310
+ /**
311
+ * Custom metadata tags
312
+ */
313
+ tags: {
314
+ [key: string]: string;
315
+ };
316
+ /**
317
+ * Last update timestamp (ISO 8601)
318
+ */
319
+ updatedAt: string;
320
+ /**
321
+ * Webhook endpoint URL
322
+ */
323
+ url: string;
324
+ }
325
+ /**
326
+ * Resource relationships
327
+ */
328
+ interface Relationships {
329
+ /**
330
+ * Party that owns the webhook
331
+ */
332
+ party: Relationships.Party;
333
+ }
334
+ namespace Relationships {
335
+ /**
336
+ * Party that owns the webhook
337
+ */
338
+ interface Party {
339
+ /**
340
+ * Related resource identifier
341
+ */
342
+ data: Party.Data;
343
+ }
344
+ namespace Party {
345
+ /**
346
+ * Related resource identifier
347
+ */
348
+ interface Data {
349
+ id: string;
350
+ /**
351
+ * Resource type
352
+ */
353
+ type: string;
354
+ }
355
+ }
356
+ }
357
+ }
358
+ interface Meta {
359
+ pagination: Meta.Pagination;
360
+ }
361
+ namespace Meta {
362
+ interface Pagination {
363
+ hasMore: boolean;
364
+ nextCursor: string | null;
365
+ }
366
+ }
367
+ }
368
+ export interface WebhookGetResponse {
369
+ data: WebhookGetResponse.Data;
370
+ }
371
+ export declare namespace WebhookGetResponse {
372
+ interface Data {
373
+ /**
374
+ * Resource ID (whk_xxx)
375
+ */
376
+ id: string;
377
+ /**
378
+ * Resource attributes
379
+ */
380
+ attributes: Data.Attributes;
381
+ /**
382
+ * Resource relationships
383
+ */
384
+ relationships: Data.Relationships;
385
+ /**
386
+ * Resource type
387
+ */
388
+ type: string;
389
+ }
390
+ namespace Data {
391
+ /**
392
+ * Resource attributes
393
+ */
394
+ interface Attributes {
395
+ /**
396
+ * Creation timestamp (ISO 8601)
397
+ */
398
+ createdAt: string;
399
+ /**
400
+ * Human-readable description
401
+ */
402
+ description: string;
403
+ /**
404
+ * Event types this webhook listens to
405
+ */
406
+ enabledEvents: Array<'*' | 'party.updated' | 'party.delegation_granted' | 'wallet.created' | 'external_account.connected' | 'agent_delegation_invitation.created' | 'agent_delegation_invitation.accepted' | 'agent_delegation_invitation.declined' | 'agent_delegation_invitation.cancelled' | 'agent_delegation.revoked' | 'delegation.activated' | 'delegation.revoked' | 'deposit.created' | 'deposit.completed' | 'deposit.failed' | 'deposit.returned' | 'withdrawal.created' | 'withdrawal.completed' | 'withdrawal.failed' | 'withdrawal.returned' | 'payment.created' | 'payment.completed' | 'payment.failed' | 'payment_request.created' | 'payment_request.completed' | 'payment_request.failed' | 'payment_request.returned'>;
407
+ /**
408
+ * Webhook status
409
+ */
410
+ status: 'ENABLED' | 'DISABLED';
411
+ /**
412
+ * Custom metadata tags
413
+ */
414
+ tags: {
415
+ [key: string]: string;
416
+ };
417
+ /**
418
+ * Last update timestamp (ISO 8601)
419
+ */
420
+ updatedAt: string;
421
+ /**
422
+ * Webhook endpoint URL
423
+ */
424
+ url: string;
425
+ }
426
+ /**
427
+ * Resource relationships
428
+ */
429
+ interface Relationships {
430
+ /**
431
+ * Party that owns the webhook
432
+ */
433
+ party: Relationships.Party;
434
+ }
435
+ namespace Relationships {
436
+ /**
437
+ * Party that owns the webhook
438
+ */
439
+ interface Party {
440
+ /**
441
+ * Related resource identifier
442
+ */
443
+ data: Party.Data;
444
+ }
445
+ namespace Party {
446
+ /**
447
+ * Related resource identifier
448
+ */
449
+ interface Data {
450
+ id: string;
451
+ /**
452
+ * Resource type
453
+ */
454
+ type: string;
455
+ }
456
+ }
457
+ }
458
+ }
459
+ }
460
+ export interface WebhookRemoveResponse {
461
+ data: WebhookRemoveResponse.Data;
462
+ meta: WebhookRemoveResponse.Meta;
463
+ }
464
+ export declare namespace WebhookRemoveResponse {
465
+ interface Data {
466
+ /**
467
+ * Resource ID (whk_xxx)
468
+ */
469
+ id: string;
470
+ /**
471
+ * Resource attributes
472
+ */
473
+ attributes: Data.Attributes;
474
+ /**
475
+ * Resource relationships
476
+ */
477
+ relationships: Data.Relationships;
478
+ /**
479
+ * Resource type
480
+ */
481
+ type: string;
482
+ }
483
+ namespace Data {
484
+ /**
485
+ * Resource attributes
486
+ */
487
+ interface Attributes {
488
+ /**
489
+ * Creation timestamp (ISO 8601)
490
+ */
491
+ createdAt: string;
492
+ /**
493
+ * Human-readable description
494
+ */
495
+ description: string;
496
+ /**
497
+ * Event types this webhook listens to
498
+ */
499
+ enabledEvents: Array<'*' | 'party.updated' | 'party.delegation_granted' | 'wallet.created' | 'external_account.connected' | 'agent_delegation_invitation.created' | 'agent_delegation_invitation.accepted' | 'agent_delegation_invitation.declined' | 'agent_delegation_invitation.cancelled' | 'agent_delegation.revoked' | 'delegation.activated' | 'delegation.revoked' | 'deposit.created' | 'deposit.completed' | 'deposit.failed' | 'deposit.returned' | 'withdrawal.created' | 'withdrawal.completed' | 'withdrawal.failed' | 'withdrawal.returned' | 'payment.created' | 'payment.completed' | 'payment.failed' | 'payment_request.created' | 'payment_request.completed' | 'payment_request.failed' | 'payment_request.returned'>;
500
+ /**
501
+ * Webhook status
502
+ */
503
+ status: 'ENABLED' | 'DISABLED';
504
+ /**
505
+ * Custom metadata tags
506
+ */
507
+ tags: {
508
+ [key: string]: string;
509
+ };
510
+ /**
511
+ * Last update timestamp (ISO 8601)
512
+ */
513
+ updatedAt: string;
514
+ /**
515
+ * Webhook endpoint URL
516
+ */
517
+ url: string;
518
+ }
519
+ /**
520
+ * Resource relationships
521
+ */
522
+ interface Relationships {
523
+ /**
524
+ * Party that owns the webhook
525
+ */
526
+ party: Relationships.Party;
527
+ }
528
+ namespace Relationships {
529
+ /**
530
+ * Party that owns the webhook
531
+ */
532
+ interface Party {
533
+ /**
534
+ * Related resource identifier
535
+ */
536
+ data: Party.Data;
537
+ }
538
+ namespace Party {
539
+ /**
540
+ * Related resource identifier
541
+ */
542
+ interface Data {
543
+ id: string;
544
+ /**
545
+ * Resource type
546
+ */
547
+ type: string;
548
+ }
549
+ }
550
+ }
551
+ }
552
+ interface Meta {
553
+ /**
554
+ * Indicates the resource was deleted
555
+ */
556
+ deleted: true;
557
+ }
558
+ }
559
+ export interface WebhookRotateSecretResponse {
560
+ data: WebhookRotateSecretResponse.Data;
561
+ }
562
+ export declare namespace WebhookRotateSecretResponse {
563
+ interface Data {
564
+ /**
565
+ * Resource ID (whk_xxx)
566
+ */
567
+ id: string;
568
+ /**
569
+ * Resource attributes
570
+ */
571
+ attributes: Data.Attributes;
572
+ /**
573
+ * Resource relationships
574
+ */
575
+ relationships: Data.Relationships;
576
+ /**
577
+ * Resource type
578
+ */
579
+ type: string;
580
+ }
581
+ namespace Data {
582
+ /**
583
+ * Resource attributes
584
+ */
585
+ interface Attributes {
586
+ /**
587
+ * When the previous secret expires (null if immediate cutover)
588
+ */
589
+ previousSecretExpiresAt: string | null;
590
+ /**
591
+ * New webhook signing secret (shown only once — store securely!)
592
+ */
593
+ signingSecret: string;
594
+ }
595
+ /**
596
+ * Resource relationships
597
+ */
598
+ interface Relationships {
599
+ /**
600
+ * Party that owns the webhook
601
+ */
602
+ party: Relationships.Party;
603
+ }
604
+ namespace Relationships {
605
+ /**
606
+ * Party that owns the webhook
607
+ */
608
+ interface Party {
609
+ /**
610
+ * Related resource identifier
611
+ */
612
+ data: Party.Data;
613
+ }
614
+ namespace Party {
615
+ /**
616
+ * Related resource identifier
617
+ */
618
+ interface Data {
619
+ id: string;
620
+ /**
621
+ * Resource type
622
+ */
623
+ type: string;
624
+ }
625
+ }
626
+ }
627
+ }
628
+ }
629
+ export interface WebhookCreateParams {
630
+ /**
631
+ * Body param: Event types to subscribe to
632
+ */
633
+ enabledEvents: Array<'*' | 'party.updated' | 'party.delegation_granted' | 'wallet.created' | 'external_account.connected' | 'agent_delegation_invitation.created' | 'agent_delegation_invitation.accepted' | 'agent_delegation_invitation.declined' | 'agent_delegation_invitation.cancelled' | 'agent_delegation.revoked' | 'delegation.activated' | 'delegation.revoked' | 'deposit.created' | 'deposit.completed' | 'deposit.failed' | 'deposit.returned' | 'withdrawal.created' | 'withdrawal.completed' | 'withdrawal.failed' | 'withdrawal.returned' | 'payment.created' | 'payment.completed' | 'payment.failed' | 'payment_request.created' | 'payment_request.completed' | 'payment_request.failed' | 'payment_request.returned'>;
634
+ /**
635
+ * Body param: Webhook endpoint URL
636
+ */
637
+ url: string;
638
+ /**
639
+ * Header param: Unique key for idempotent request handling. If a request with the
640
+ * same key was already processed, the original response is returned.
641
+ */
642
+ 'Idempotency-Key': string;
643
+ /**
644
+ * Body param: Human-readable description
645
+ */
646
+ description?: string;
647
+ /**
648
+ * Body param: Custom metadata tags
649
+ */
650
+ tags?: {
651
+ [key: string]: string;
652
+ };
653
+ /**
654
+ * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
655
+ */
656
+ 'X-Agent-ID'?: string;
657
+ /**
658
+ * Header param: Required when X-Agent-ID is present. Session or conversation ID
659
+ * for agent observability.
660
+ */
661
+ 'X-Instance-ID'?: string;
662
+ }
663
+ export interface WebhookUpdateParams {
664
+ /**
665
+ * Header param: Unique key for idempotent request handling. If a request with the
666
+ * same key was already processed, the original response is returned.
667
+ */
668
+ 'Idempotency-Key': string;
669
+ /**
670
+ * Body param: New description
671
+ */
672
+ description?: string;
673
+ /**
674
+ * Body param: Event types to subscribe to
675
+ */
676
+ enabledEvents?: Array<'*' | 'party.updated' | 'party.delegation_granted' | 'wallet.created' | 'external_account.connected' | 'agent_delegation_invitation.created' | 'agent_delegation_invitation.accepted' | 'agent_delegation_invitation.declined' | 'agent_delegation_invitation.cancelled' | 'agent_delegation.revoked' | 'delegation.activated' | 'delegation.revoked' | 'deposit.created' | 'deposit.completed' | 'deposit.failed' | 'deposit.returned' | 'withdrawal.created' | 'withdrawal.completed' | 'withdrawal.failed' | 'withdrawal.returned' | 'payment.created' | 'payment.completed' | 'payment.failed' | 'payment_request.created' | 'payment_request.completed' | 'payment_request.failed' | 'payment_request.returned'>;
677
+ /**
678
+ * Body param: New status
679
+ */
680
+ status?: 'ENABLED' | 'DISABLED';
681
+ /**
682
+ * Body param: Tag updates (set value to empty string to remove key)
683
+ */
684
+ tags?: {
685
+ [key: string]: string;
686
+ };
687
+ /**
688
+ * Body param: New webhook endpoint URL
689
+ */
690
+ url?: string;
691
+ /**
692
+ * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
693
+ */
694
+ 'X-Agent-ID'?: string;
695
+ /**
696
+ * Header param: Required when X-Agent-ID is present. Session or conversation ID
697
+ * for agent observability.
698
+ */
699
+ 'X-Instance-ID'?: string;
700
+ }
701
+ export interface WebhookListParams {
702
+ /**
703
+ * Query param: Cursor for keyset pagination
704
+ */
705
+ cursor?: string;
706
+ /**
707
+ * Query param: Max items per page (1-100)
708
+ */
709
+ limit?: number;
710
+ /**
711
+ * Query param: Filter by status
712
+ */
713
+ status?: 'ENABLED' | 'DISABLED';
714
+ /**
715
+ * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
716
+ */
717
+ 'X-Agent-ID'?: string;
718
+ /**
719
+ * Header param: Required when X-Agent-ID is present. Session or conversation ID
720
+ * for agent observability.
721
+ */
722
+ 'X-Instance-ID'?: string;
723
+ }
724
+ export interface WebhookGetParams {
725
+ /**
726
+ * Agent ID (agt_xxx) identifying which agent is making the request.
727
+ */
728
+ 'X-Agent-ID'?: string;
729
+ /**
730
+ * Required when X-Agent-ID is present. Session or conversation ID for agent
731
+ * observability.
732
+ */
733
+ 'X-Instance-ID'?: string;
734
+ }
735
+ export interface WebhookRemoveParams {
736
+ /**
737
+ * Unique key for idempotent request handling. If a request with the same key was
738
+ * already processed, the original response is returned.
739
+ */
740
+ 'Idempotency-Key': string;
741
+ /**
742
+ * Agent ID (agt_xxx) identifying which agent is making the request.
743
+ */
744
+ 'X-Agent-ID'?: string;
745
+ /**
746
+ * Required when X-Agent-ID is present. Session or conversation ID for agent
747
+ * observability.
748
+ */
749
+ 'X-Instance-ID'?: string;
750
+ }
751
+ export interface WebhookRotateSecretParams {
752
+ /**
753
+ * Body param: Grace period in seconds for the previous secret (0 = immediate
754
+ * cutover, max 86400)
755
+ */
756
+ expiresInSeconds: number;
757
+ /**
758
+ * Header param: Unique key for idempotent request handling. If a request with the
759
+ * same key was already processed, the original response is returned.
760
+ */
761
+ 'Idempotency-Key': string;
762
+ /**
763
+ * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
764
+ */
765
+ 'X-Agent-ID'?: string;
766
+ /**
767
+ * Header param: Required when X-Agent-ID is present. Session or conversation ID
768
+ * for agent observability.
769
+ */
770
+ 'X-Instance-ID'?: string;
771
+ }
772
+ export declare namespace Webhooks {
773
+ export { type WebhookCreateResponse as WebhookCreateResponse, type WebhookUpdateResponse as WebhookUpdateResponse, type WebhookListResponse as WebhookListResponse, type WebhookGetResponse as WebhookGetResponse, type WebhookRemoveResponse as WebhookRemoveResponse, type WebhookRotateSecretResponse as WebhookRotateSecretResponse, type WebhookCreateParams as WebhookCreateParams, type WebhookUpdateParams as WebhookUpdateParams, type WebhookListParams as WebhookListParams, type WebhookGetParams as WebhookGetParams, type WebhookRemoveParams as WebhookRemoveParams, type WebhookRotateSecretParams as WebhookRotateSecretParams, };
774
+ }
775
+ //# sourceMappingURL=webhooks.d.mts.map