@privy-io/api-types 0.3.4 → 0.5.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 (118) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/LICENSE +1 -1
  3. package/README.md +31 -0
  4. package/client.d.mts +21 -11
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +21 -11
  7. package/client.d.ts.map +1 -1
  8. package/client.js +20 -3
  9. package/client.js.map +1 -1
  10. package/client.mjs +20 -3
  11. package/client.mjs.map +1 -1
  12. package/internal/parse.d.mts.map +1 -1
  13. package/internal/parse.d.ts.map +1 -1
  14. package/internal/parse.js +5 -0
  15. package/internal/parse.js.map +1 -1
  16. package/internal/parse.mjs +5 -0
  17. package/internal/parse.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/resources/aggregations.d.mts +507 -0
  20. package/resources/aggregations.d.mts.map +1 -0
  21. package/resources/aggregations.d.ts +507 -0
  22. package/resources/aggregations.d.ts.map +1 -0
  23. package/resources/aggregations.js +9 -0
  24. package/resources/aggregations.js.map +1 -0
  25. package/resources/aggregations.mjs +5 -0
  26. package/resources/aggregations.mjs.map +1 -0
  27. package/resources/client-auth.d.mts +183 -24
  28. package/resources/client-auth.d.mts.map +1 -1
  29. package/resources/client-auth.d.ts +183 -24
  30. package/resources/client-auth.d.ts.map +1 -1
  31. package/resources/funding.d.mts +4 -4
  32. package/resources/funding.d.mts.map +1 -1
  33. package/resources/funding.d.ts +4 -4
  34. package/resources/funding.d.ts.map +1 -1
  35. package/resources/index.d.mts +7 -4
  36. package/resources/index.d.mts.map +1 -1
  37. package/resources/index.d.ts +7 -4
  38. package/resources/index.d.ts.map +1 -1
  39. package/resources/index.js +7 -1
  40. package/resources/index.js.map +1 -1
  41. package/resources/index.mjs +3 -0
  42. package/resources/index.mjs.map +1 -1
  43. package/resources/key-quorums.d.mts +4 -1
  44. package/resources/key-quorums.d.mts.map +1 -1
  45. package/resources/key-quorums.d.ts +4 -1
  46. package/resources/key-quorums.d.ts.map +1 -1
  47. package/resources/policies.d.mts +89 -135
  48. package/resources/policies.d.mts.map +1 -1
  49. package/resources/policies.d.ts +89 -135
  50. package/resources/policies.d.ts.map +1 -1
  51. package/resources/policies.js.map +1 -1
  52. package/resources/policies.mjs.map +1 -1
  53. package/resources/users.d.mts +679 -415
  54. package/resources/users.d.mts.map +1 -1
  55. package/resources/users.d.ts +679 -415
  56. package/resources/users.d.ts.map +1 -1
  57. package/resources/wallets/balance.d.mts +11 -6
  58. package/resources/wallets/balance.d.mts.map +1 -1
  59. package/resources/wallets/balance.d.ts +11 -6
  60. package/resources/wallets/balance.d.ts.map +1 -1
  61. package/resources/wallets/balance.js +1 -2
  62. package/resources/wallets/balance.js.map +1 -1
  63. package/resources/wallets/balance.mjs +1 -2
  64. package/resources/wallets/balance.mjs.map +1 -1
  65. package/resources/wallets/index.d.mts +1 -1
  66. package/resources/wallets/index.d.mts.map +1 -1
  67. package/resources/wallets/index.d.ts +1 -1
  68. package/resources/wallets/index.d.ts.map +1 -1
  69. package/resources/wallets/index.js.map +1 -1
  70. package/resources/wallets/index.mjs.map +1 -1
  71. package/resources/wallets/transactions.d.mts +3 -3
  72. package/resources/wallets/transactions.d.mts.map +1 -1
  73. package/resources/wallets/transactions.d.ts +3 -3
  74. package/resources/wallets/transactions.d.ts.map +1 -1
  75. package/resources/wallets/wallets.d.mts +347 -65
  76. package/resources/wallets/wallets.d.mts.map +1 -1
  77. package/resources/wallets/wallets.d.ts +347 -65
  78. package/resources/wallets/wallets.d.ts.map +1 -1
  79. package/resources/wallets/wallets.js +1 -1
  80. package/resources/wallets/wallets.js.map +1 -1
  81. package/resources/wallets/wallets.mjs +1 -1
  82. package/resources/wallets/wallets.mjs.map +1 -1
  83. package/resources/webhooks.d.mts +940 -0
  84. package/resources/webhooks.d.mts.map +1 -0
  85. package/resources/webhooks.d.ts +940 -0
  86. package/resources/webhooks.d.ts.map +1 -0
  87. package/resources/webhooks.js +9 -0
  88. package/resources/webhooks.js.map +1 -0
  89. package/resources/webhooks.mjs +5 -0
  90. package/resources/webhooks.mjs.map +1 -0
  91. package/resources/yield.d.mts +264 -0
  92. package/resources/yield.d.mts.map +1 -0
  93. package/resources/yield.d.ts +264 -0
  94. package/resources/yield.d.ts.map +1 -0
  95. package/resources/yield.js +9 -0
  96. package/resources/yield.js.map +1 -0
  97. package/resources/yield.mjs +5 -0
  98. package/resources/yield.mjs.map +1 -0
  99. package/src/client.ts +331 -16
  100. package/src/internal/parse.ts +6 -0
  101. package/src/resources/aggregations.ts +853 -0
  102. package/src/resources/client-auth.ts +309 -35
  103. package/src/resources/funding.ts +4 -1
  104. package/src/resources/index.ts +156 -9
  105. package/src/resources/key-quorums.ts +4 -1
  106. package/src/resources/policies.ts +129 -214
  107. package/src/resources/users.ts +974 -650
  108. package/src/resources/wallets/balance.ts +24 -6
  109. package/src/resources/wallets/index.ts +13 -3
  110. package/src/resources/wallets/transactions.ts +11 -3
  111. package/src/resources/wallets/wallets.ts +468 -91
  112. package/src/resources/webhooks.ts +1287 -0
  113. package/src/resources/yield.ts +330 -0
  114. package/src/version.ts +1 -1
  115. package/version.d.mts +1 -1
  116. package/version.d.ts +1 -1
  117. package/version.js +1 -1
  118. package/version.mjs +1 -1
@@ -0,0 +1,1287 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import * as UsersAPI from './users';
5
+
6
+ export class Webhooks extends APIResource {}
7
+
8
+ /**
9
+ * Payload for the user.created webhook event.
10
+ */
11
+ export interface UserCreatedWebhookPayload {
12
+ /**
13
+ * The type of webhook event.
14
+ */
15
+ type: 'user.created';
16
+
17
+ /**
18
+ * A Privy user object.
19
+ */
20
+ user: UsersAPI.User;
21
+ }
22
+
23
+ /**
24
+ * Payload for the user.authenticated webhook event.
25
+ */
26
+ export interface UserAuthenticatedWebhookPayload {
27
+ /**
28
+ * A linked account for the user.
29
+ */
30
+ account: UsersAPI.LinkedAccount;
31
+
32
+ /**
33
+ * The type of webhook event.
34
+ */
35
+ type: 'user.authenticated';
36
+
37
+ /**
38
+ * A Privy user object.
39
+ */
40
+ user: UsersAPI.User;
41
+ }
42
+
43
+ /**
44
+ * Payload for the user.linked_account webhook event.
45
+ */
46
+ export interface UserLinkedAccountWebhookPayload {
47
+ /**
48
+ * A linked account for the user.
49
+ */
50
+ account: UsersAPI.LinkedAccount;
51
+
52
+ /**
53
+ * The type of webhook event.
54
+ */
55
+ type: 'user.linked_account';
56
+
57
+ /**
58
+ * A Privy user object.
59
+ */
60
+ user: UsersAPI.User;
61
+ }
62
+
63
+ /**
64
+ * Payload for the user.unlinked_account webhook event.
65
+ */
66
+ export interface UserUnlinkedAccountWebhookPayload {
67
+ /**
68
+ * A linked account for the user.
69
+ */
70
+ account: UsersAPI.LinkedAccount;
71
+
72
+ /**
73
+ * The type of webhook event.
74
+ */
75
+ type: 'user.unlinked_account';
76
+
77
+ /**
78
+ * A Privy user object.
79
+ */
80
+ user: UsersAPI.User;
81
+ }
82
+
83
+ /**
84
+ * Payload for the user.updated_account webhook event.
85
+ */
86
+ export interface UserUpdatedAccountWebhookPayload {
87
+ /**
88
+ * A linked account for the user.
89
+ */
90
+ account: UsersAPI.LinkedAccount;
91
+
92
+ /**
93
+ * The type of webhook event.
94
+ */
95
+ type: 'user.updated_account';
96
+
97
+ /**
98
+ * A Privy user object.
99
+ */
100
+ user: UsersAPI.User;
101
+ }
102
+
103
+ /**
104
+ * Payload for the user.transferred_account webhook event.
105
+ */
106
+ export interface UserTransferredAccountWebhookPayload {
107
+ /**
108
+ * A linked account for the user.
109
+ */
110
+ account: UsersAPI.LinkedAccount;
111
+
112
+ deletedUser: true;
113
+
114
+ fromUser: UserTransferredAccountWebhookPayload.FromUser;
115
+
116
+ /**
117
+ * A Privy user object.
118
+ */
119
+ toUser: UsersAPI.User;
120
+
121
+ /**
122
+ * The type of webhook event.
123
+ */
124
+ type: 'user.transferred_account';
125
+ }
126
+
127
+ export namespace UserTransferredAccountWebhookPayload {
128
+ export interface FromUser {
129
+ id: string;
130
+ }
131
+ }
132
+
133
+ /**
134
+ * Payload for the user.wallet_created webhook event.
135
+ */
136
+ export interface UserWalletCreatedWebhookPayload {
137
+ /**
138
+ * The type of webhook event.
139
+ */
140
+ type: 'user.wallet_created';
141
+
142
+ /**
143
+ * A Privy user object.
144
+ */
145
+ user: UsersAPI.User;
146
+
147
+ /**
148
+ * Base schema for wallet accounts linked to the user.
149
+ */
150
+ wallet: UsersAPI.LinkedAccountBaseWallet;
151
+ }
152
+
153
+ /**
154
+ * Payload for the transaction.broadcasted webhook event.
155
+ */
156
+ export interface TransactionBroadcastedWebhookPayload {
157
+ /**
158
+ * The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet).
159
+ */
160
+ caip2: string;
161
+
162
+ /**
163
+ * The blockchain transaction hash.
164
+ */
165
+ transaction_hash: string;
166
+
167
+ /**
168
+ * The Privy-assigned ID for this transaction.
169
+ */
170
+ transaction_id: string;
171
+
172
+ /**
173
+ * The type of webhook event.
174
+ */
175
+ type: 'transaction.broadcasted';
176
+
177
+ /**
178
+ * The ID of the wallet that initiated the transaction.
179
+ */
180
+ wallet_id: string;
181
+ }
182
+
183
+ /**
184
+ * Payload for the transaction.confirmed webhook event.
185
+ */
186
+ export interface TransactionConfirmedWebhookPayload {
187
+ /**
188
+ * The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet).
189
+ */
190
+ caip2: string;
191
+
192
+ /**
193
+ * The blockchain transaction hash.
194
+ */
195
+ transaction_hash: string;
196
+
197
+ /**
198
+ * The Privy-assigned ID for this transaction.
199
+ */
200
+ transaction_id: string;
201
+
202
+ /**
203
+ * The type of webhook event.
204
+ */
205
+ type: 'transaction.confirmed';
206
+
207
+ /**
208
+ * The ID of the wallet that initiated the transaction.
209
+ */
210
+ wallet_id: string;
211
+ }
212
+
213
+ /**
214
+ * Payload for the transaction.execution_reverted webhook event.
215
+ */
216
+ export interface TransactionExecutionRevertedWebhookPayload {
217
+ /**
218
+ * The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet).
219
+ */
220
+ caip2: string;
221
+
222
+ /**
223
+ * The blockchain transaction hash.
224
+ */
225
+ transaction_hash: string;
226
+
227
+ /**
228
+ * The Privy-assigned ID for this transaction.
229
+ */
230
+ transaction_id: string;
231
+
232
+ /**
233
+ * The type of webhook event.
234
+ */
235
+ type: 'transaction.execution_reverted';
236
+
237
+ /**
238
+ * The ID of the wallet that initiated the transaction.
239
+ */
240
+ wallet_id: string;
241
+ }
242
+
243
+ /**
244
+ * Payload for the transaction.still_pending webhook event.
245
+ */
246
+ export interface TransactionStillPendingWebhookPayload {
247
+ /**
248
+ * The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet).
249
+ */
250
+ caip2: string;
251
+
252
+ /**
253
+ * The blockchain transaction hash.
254
+ */
255
+ transaction_hash: string;
256
+
257
+ /**
258
+ * The Privy-assigned ID for this transaction.
259
+ */
260
+ transaction_id: string;
261
+
262
+ /**
263
+ * The original transaction request that is still pending.
264
+ */
265
+ transaction_request: TransactionStillPendingWebhookPayload.TransactionRequest;
266
+
267
+ /**
268
+ * The type of webhook event.
269
+ */
270
+ type: 'transaction.still_pending';
271
+
272
+ /**
273
+ * The ID of the wallet that initiated the transaction.
274
+ */
275
+ wallet_id: string;
276
+ }
277
+
278
+ export namespace TransactionStillPendingWebhookPayload {
279
+ /**
280
+ * The original transaction request that is still pending.
281
+ */
282
+ export interface TransactionRequest {
283
+ authorization_list?: Array<TransactionRequest.AuthorizationList>;
284
+
285
+ chain_id?: string | number;
286
+
287
+ data?: string;
288
+
289
+ from?: string;
290
+
291
+ gas_limit?: string | number;
292
+
293
+ gas_price?: string | number;
294
+
295
+ max_fee_per_gas?: string | number;
296
+
297
+ max_priority_fee_per_gas?: string | number;
298
+
299
+ nonce?: string | number;
300
+
301
+ to?: string;
302
+
303
+ type?: 0 | 1 | 2 | 4;
304
+
305
+ value?: string | number;
306
+ }
307
+
308
+ export namespace TransactionRequest {
309
+ export interface AuthorizationList {
310
+ chain_id: string | number;
311
+
312
+ contract: string;
313
+
314
+ nonce: string | number;
315
+
316
+ r: string;
317
+
318
+ s: string;
319
+
320
+ y_parity: number;
321
+ }
322
+ }
323
+ }
324
+
325
+ /**
326
+ * Payload for the transaction.failed webhook event.
327
+ */
328
+ export interface TransactionFailedWebhookPayload {
329
+ /**
330
+ * The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet).
331
+ */
332
+ caip2: string;
333
+
334
+ /**
335
+ * The blockchain transaction hash.
336
+ */
337
+ transaction_hash: string;
338
+
339
+ /**
340
+ * The Privy-assigned ID for this transaction.
341
+ */
342
+ transaction_id: string;
343
+
344
+ /**
345
+ * The type of webhook event.
346
+ */
347
+ type: 'transaction.failed';
348
+
349
+ /**
350
+ * The ID of the wallet that initiated the transaction.
351
+ */
352
+ wallet_id: string;
353
+ }
354
+
355
+ /**
356
+ * Payload for the transaction.replaced webhook event.
357
+ */
358
+ export interface TransactionReplacedWebhookPayload {
359
+ /**
360
+ * The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet).
361
+ */
362
+ caip2: string;
363
+
364
+ /**
365
+ * The blockchain transaction hash.
366
+ */
367
+ transaction_hash: string;
368
+
369
+ /**
370
+ * The Privy-assigned ID for this transaction.
371
+ */
372
+ transaction_id: string;
373
+
374
+ /**
375
+ * The type of webhook event.
376
+ */
377
+ type: 'transaction.replaced';
378
+
379
+ /**
380
+ * The ID of the wallet that initiated the transaction.
381
+ */
382
+ wallet_id: string;
383
+ }
384
+
385
+ /**
386
+ * Payload for the transaction.provider_error webhook event.
387
+ */
388
+ export interface TransactionProviderErrorWebhookPayload {
389
+ /**
390
+ * The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet).
391
+ */
392
+ caip2: string;
393
+
394
+ /**
395
+ * The blockchain transaction hash.
396
+ */
397
+ transaction_hash: string;
398
+
399
+ /**
400
+ * The Privy-assigned ID for this transaction.
401
+ */
402
+ transaction_id: string;
403
+
404
+ /**
405
+ * The type of webhook event.
406
+ */
407
+ type: 'transaction.provider_error';
408
+
409
+ /**
410
+ * The ID of the wallet that initiated the transaction.
411
+ */
412
+ wallet_id: string;
413
+ }
414
+
415
+ /**
416
+ * Payload for the wallet.funds_deposited webhook event.
417
+ */
418
+ export interface FundsDepositedWebhookPayload {
419
+ /**
420
+ * The amount transferred, as a stringified bigint.
421
+ */
422
+ amount: string;
423
+
424
+ /**
425
+ * The asset type being transferred.
426
+ */
427
+ asset:
428
+ | FundsDepositedWebhookPayload.UnionMember0
429
+ | FundsDepositedWebhookPayload.UnionMember1
430
+ | FundsDepositedWebhookPayload.UnionMember2
431
+ | FundsDepositedWebhookPayload.UnionMember3;
432
+
433
+ block: FundsDepositedWebhookPayload.Block;
434
+
435
+ /**
436
+ * The CAIP-2 chain identifier.
437
+ */
438
+ caip2: string;
439
+
440
+ /**
441
+ * A unique key for this event.
442
+ */
443
+ idempotency_key: string;
444
+
445
+ /**
446
+ * The recipient address.
447
+ */
448
+ recipient: string;
449
+
450
+ /**
451
+ * The sender address.
452
+ */
453
+ sender: string;
454
+
455
+ /**
456
+ * The blockchain transaction hash.
457
+ */
458
+ transaction_hash: string;
459
+
460
+ /**
461
+ * The type of webhook event.
462
+ */
463
+ type: 'wallet.funds_deposited';
464
+
465
+ /**
466
+ * The ID of the wallet.
467
+ */
468
+ wallet_id: string;
469
+
470
+ /**
471
+ * Optional Bridge metadata for custodial wallet deposits.
472
+ */
473
+ bridge_metadata?:
474
+ | FundsDepositedWebhookPayload.BridgeMetadataUnionMember0
475
+ | FundsDepositedWebhookPayload.BridgeMetadataUnionMember1
476
+ | FundsDepositedWebhookPayload.BridgeMetadataUnionMember2
477
+ | FundsDepositedWebhookPayload.BridgeMetadataUnionMember3
478
+ | FundsDepositedWebhookPayload.BridgeMetadataUnionMember4
479
+ | FundsDepositedWebhookPayload.BridgeMetadataUnionMember5;
480
+
481
+ /**
482
+ * The transaction fee paid, as a stringified bigint in the chain's native token.
483
+ */
484
+ transaction_fee?: string;
485
+ }
486
+
487
+ export namespace FundsDepositedWebhookPayload {
488
+ export interface UnionMember0 {
489
+ address: null;
490
+
491
+ type: 'native-token';
492
+ }
493
+
494
+ export interface UnionMember1 {
495
+ address: string;
496
+
497
+ type: 'erc20';
498
+ }
499
+
500
+ export interface UnionMember2 {
501
+ mint: string;
502
+
503
+ type: 'spl';
504
+ }
505
+
506
+ export interface UnionMember3 {
507
+ address: string;
508
+
509
+ type: 'sac';
510
+ }
511
+
512
+ export interface Block {
513
+ /**
514
+ * The block number.
515
+ */
516
+ number: number;
517
+
518
+ /**
519
+ * The block timestamp.
520
+ */
521
+ timestamp: number;
522
+ }
523
+
524
+ export interface BridgeMetadataUnionMember0 {
525
+ drain_id: string;
526
+
527
+ /**
528
+ * The crypto address of the liquidation address that received the deposit.
529
+ */
530
+ liquidation_address: string;
531
+
532
+ liquidation_address_id: string;
533
+
534
+ method: 'liquidation_address';
535
+
536
+ /**
537
+ * The address that sent the deposit.
538
+ */
539
+ source_wallet_address: string;
540
+
541
+ type: 'crypto_deposit';
542
+ }
543
+
544
+ export interface BridgeMetadataUnionMember1 {
545
+ drain_id: string;
546
+
547
+ liquidation_address_id: string;
548
+
549
+ method: 'liquidation_address';
550
+
551
+ /**
552
+ * The original deposit transaction hash that triggered the failed drain.
553
+ */
554
+ original_transaction_hash: string;
555
+
556
+ type: 'refund';
557
+ }
558
+
559
+ export interface BridgeMetadataUnionMember2 {
560
+ activity_id: string;
561
+
562
+ method: 'virtual_account';
563
+
564
+ type: 'fiat_deposit';
565
+
566
+ virtual_account_id: string;
567
+ }
568
+
569
+ export interface BridgeMetadataUnionMember3 {
570
+ method: 'transfer';
571
+
572
+ /**
573
+ * The wallet address that sent the transfer.
574
+ */
575
+ source_wallet_address: string;
576
+
577
+ transfer_id: string;
578
+
579
+ type: 'crypto_deposit';
580
+ }
581
+
582
+ export interface BridgeMetadataUnionMember4 {
583
+ method: 'transfer';
584
+
585
+ transfer_id: string;
586
+
587
+ type: 'fiat_deposit';
588
+ }
589
+
590
+ export interface BridgeMetadataUnionMember5 {
591
+ method: 'transfer';
592
+
593
+ transfer_id: string;
594
+
595
+ type: 'refund';
596
+
597
+ /**
598
+ * The original transfer transaction hash (if available).
599
+ */
600
+ original_transaction_hash?: string;
601
+ }
602
+ }
603
+
604
+ /**
605
+ * Payload for the wallet.funds_withdrawn webhook event.
606
+ */
607
+ export interface FundsWithdrawnWebhookPayload {
608
+ /**
609
+ * The amount transferred, as a stringified bigint.
610
+ */
611
+ amount: string;
612
+
613
+ /**
614
+ * The asset type being transferred.
615
+ */
616
+ asset:
617
+ | FundsWithdrawnWebhookPayload.UnionMember0
618
+ | FundsWithdrawnWebhookPayload.UnionMember1
619
+ | FundsWithdrawnWebhookPayload.UnionMember2
620
+ | FundsWithdrawnWebhookPayload.UnionMember3;
621
+
622
+ block: FundsWithdrawnWebhookPayload.Block;
623
+
624
+ /**
625
+ * The CAIP-2 chain identifier.
626
+ */
627
+ caip2: string;
628
+
629
+ /**
630
+ * A unique key for this event.
631
+ */
632
+ idempotency_key: string;
633
+
634
+ /**
635
+ * The recipient address.
636
+ */
637
+ recipient: string;
638
+
639
+ /**
640
+ * The sender address.
641
+ */
642
+ sender: string;
643
+
644
+ /**
645
+ * The blockchain transaction hash.
646
+ */
647
+ transaction_hash: string;
648
+
649
+ /**
650
+ * The type of webhook event.
651
+ */
652
+ type: 'wallet.funds_withdrawn';
653
+
654
+ /**
655
+ * The ID of the wallet.
656
+ */
657
+ wallet_id: string;
658
+
659
+ /**
660
+ * The transaction fee paid, as a stringified bigint in the chain's native token.
661
+ */
662
+ transaction_fee?: string;
663
+ }
664
+
665
+ export namespace FundsWithdrawnWebhookPayload {
666
+ export interface UnionMember0 {
667
+ address: null;
668
+
669
+ type: 'native-token';
670
+ }
671
+
672
+ export interface UnionMember1 {
673
+ address: string;
674
+
675
+ type: 'erc20';
676
+ }
677
+
678
+ export interface UnionMember2 {
679
+ mint: string;
680
+
681
+ type: 'spl';
682
+ }
683
+
684
+ export interface UnionMember3 {
685
+ address: string;
686
+
687
+ type: 'sac';
688
+ }
689
+
690
+ export interface Block {
691
+ /**
692
+ * The block number.
693
+ */
694
+ number: number;
695
+
696
+ /**
697
+ * The block timestamp.
698
+ */
699
+ timestamp: number;
700
+ }
701
+ }
702
+
703
+ /**
704
+ * Payload for the wallet.private_key_export webhook event.
705
+ */
706
+ export interface PrivateKeyExportWebhookPayload {
707
+ /**
708
+ * The type of webhook event.
709
+ */
710
+ type: 'wallet.private_key_export';
711
+
712
+ /**
713
+ * The ID of the user who exported the key.
714
+ */
715
+ user_id: string;
716
+
717
+ /**
718
+ * The address of the wallet.
719
+ */
720
+ wallet_address: string;
721
+
722
+ /**
723
+ * The ID of the wallet.
724
+ */
725
+ wallet_id: string;
726
+
727
+ export_source?: 'display' | 'client';
728
+ }
729
+
730
+ /**
731
+ * Payload for the wallet.recovery_setup webhook event.
732
+ */
733
+ export interface WalletRecoverySetupWebhookPayload {
734
+ /**
735
+ * The recovery method that was set up.
736
+ */
737
+ method:
738
+ | 'user_passcode_derived_recovery_key'
739
+ | 'privy_passcode_derived_recovery_key'
740
+ | 'privy_generated_recovery_key'
741
+ | 'google_drive_recovery_secret'
742
+ | 'icloud_recovery_secret'
743
+ | 'recovery_encryption_key';
744
+
745
+ /**
746
+ * The type of webhook event.
747
+ */
748
+ type: 'wallet.recovery_setup';
749
+
750
+ /**
751
+ * The ID of the user.
752
+ */
753
+ user_id: string;
754
+
755
+ /**
756
+ * The address of the wallet.
757
+ */
758
+ wallet_address: string;
759
+
760
+ /**
761
+ * The ID of the wallet.
762
+ */
763
+ wallet_id: string;
764
+ }
765
+
766
+ /**
767
+ * Payload for the wallet.recovered webhook event.
768
+ */
769
+ export interface WalletRecoveredWebhookPayload {
770
+ /**
771
+ * The type of webhook event.
772
+ */
773
+ type: 'wallet.recovered';
774
+
775
+ /**
776
+ * The ID of the user.
777
+ */
778
+ user_id: string;
779
+
780
+ /**
781
+ * The address of the wallet.
782
+ */
783
+ wallet_address: string;
784
+
785
+ /**
786
+ * The ID of the wallet.
787
+ */
788
+ wallet_id: string;
789
+ }
790
+
791
+ /**
792
+ * Payload for the mfa.enabled webhook event.
793
+ */
794
+ export interface MfaEnabledWebhookPayload {
795
+ /**
796
+ * The MFA method that was enabled.
797
+ */
798
+ method: 'sms' | 'totp' | 'passkey';
799
+
800
+ /**
801
+ * The type of webhook event.
802
+ */
803
+ type: 'mfa.enabled';
804
+
805
+ /**
806
+ * The ID of the user who enabled MFA.
807
+ */
808
+ user_id: string;
809
+ }
810
+
811
+ /**
812
+ * Payload for the mfa.disabled webhook event.
813
+ */
814
+ export interface MfaDisabledWebhookPayload {
815
+ /**
816
+ * The MFA method that was disabled.
817
+ */
818
+ method: 'sms' | 'totp' | 'passkey';
819
+
820
+ /**
821
+ * The type of webhook event.
822
+ */
823
+ type: 'mfa.disabled';
824
+
825
+ /**
826
+ * The ID of the user who disabled MFA.
827
+ */
828
+ user_id: string;
829
+ }
830
+
831
+ /**
832
+ * Payload for the kraken_embed.verification_completed webhook event.
833
+ */
834
+ export interface KrakenEmbedVerificationCompletedWebhookPayload {
835
+ /**
836
+ * ISO 8601 timestamp of when verification completed.
837
+ */
838
+ completed_at: string;
839
+
840
+ /**
841
+ * The type of webhook event.
842
+ */
843
+ type: 'kraken_embed.verification_completed';
844
+
845
+ /**
846
+ * The ID of the user.
847
+ */
848
+ user_id: string;
849
+ }
850
+
851
+ /**
852
+ * Payload for the kraken_embed.verification_failed webhook event.
853
+ */
854
+ export interface KrakenEmbedVerificationFailedWebhookPayload {
855
+ /**
856
+ * ISO 8601 timestamp of when verification failed.
857
+ */
858
+ failed_at: string;
859
+
860
+ /**
861
+ * The reason for the failure.
862
+ */
863
+ failure_reason: 'timeout' | 'api_error' | 'disabled_or_closed';
864
+
865
+ /**
866
+ * The type of webhook event.
867
+ */
868
+ type: 'kraken_embed.verification_failed';
869
+
870
+ /**
871
+ * The ID of the user.
872
+ */
873
+ user_id: string;
874
+
875
+ /**
876
+ * The user's status at the time of failure.
877
+ */
878
+ status?:
879
+ | KrakenEmbedVerificationFailedWebhookPayload.UnionMember0
880
+ | KrakenEmbedVerificationFailedWebhookPayload.UnionMember1
881
+ | KrakenEmbedVerificationFailedWebhookPayload.UnionMember2;
882
+ }
883
+
884
+ export namespace KrakenEmbedVerificationFailedWebhookPayload {
885
+ export interface UnionMember0 {
886
+ required_actions: Array<
887
+ UnionMember0.UnionMember0 | UnionMember0.UnionMember1 | UnionMember0.UnionMember2
888
+ >;
889
+
890
+ state: 'ok';
891
+ }
892
+
893
+ export namespace UnionMember0 {
894
+ export interface UnionMember0 {
895
+ action_type: 'verification';
896
+
897
+ deadline: string | null;
898
+
899
+ reasons: Array<string>;
900
+
901
+ verification_type:
902
+ | 'identity'
903
+ | 'residence'
904
+ | 'selfie'
905
+ | 'sanctions_check'
906
+ | 'pep_check'
907
+ | 'negative_news_check'
908
+ | 'tax_id';
909
+ }
910
+
911
+ export interface UnionMember1 {
912
+ action_type: 'provide_details';
913
+
914
+ deadline: string | null;
915
+
916
+ details_type:
917
+ | UnionMember1.UnionMember0
918
+ | UnionMember1.FullNameType
919
+ | UnionMember1.DateOfBirthType
920
+ | UnionMember1.CityOfBirthType
921
+ | UnionMember1.CountryOfBirthType
922
+ | UnionMember1.NationalitiesType
923
+ | UnionMember1.ResidenceType
924
+ | UnionMember1.PhoneType
925
+ | UnionMember1.OccupationType
926
+ | UnionMember1.EmployerType
927
+ | UnionMember1.TaxIdsType
928
+ | UnionMember1.ClientIdentifierType;
929
+
930
+ reason: string | null;
931
+ }
932
+
933
+ export namespace UnionMember1 {
934
+ export interface UnionMember0 {
935
+ type: 'terms_of_service';
936
+
937
+ version?: number;
938
+ }
939
+
940
+ export interface FullNameType {
941
+ type: 'full_name';
942
+ }
943
+
944
+ export interface DateOfBirthType {
945
+ type: 'date_of_birth';
946
+ }
947
+
948
+ export interface CityOfBirthType {
949
+ type: 'city_of_birth';
950
+ }
951
+
952
+ export interface CountryOfBirthType {
953
+ type: 'country_of_birth';
954
+ }
955
+
956
+ export interface NationalitiesType {
957
+ type: 'nationalities';
958
+ }
959
+
960
+ export interface ResidenceType {
961
+ type: 'residence';
962
+ }
963
+
964
+ export interface PhoneType {
965
+ type: 'phone';
966
+ }
967
+
968
+ export interface OccupationType {
969
+ type: 'occupation';
970
+ }
971
+
972
+ export interface EmployerType {
973
+ type: 'employer';
974
+ }
975
+
976
+ export interface TaxIdsType {
977
+ type: 'tax_ids';
978
+ }
979
+
980
+ export interface ClientIdentifierType {
981
+ type: 'client_identifier';
982
+ }
983
+ }
984
+
985
+ export interface UnionMember2 {
986
+ action_type: 'wait';
987
+
988
+ wait_reason_code: string;
989
+ }
990
+ }
991
+
992
+ export interface UnionMember1 {
993
+ reasons: Array<string>;
994
+
995
+ required_actions: Array<
996
+ UnionMember1.UnionMember0 | UnionMember1.UnionMember1 | UnionMember1.UnionMember2
997
+ >;
998
+
999
+ state: 'disabled';
1000
+ }
1001
+
1002
+ export namespace UnionMember1 {
1003
+ export interface UnionMember0 {
1004
+ action_type: 'verification';
1005
+
1006
+ deadline: string | null;
1007
+
1008
+ reasons: Array<string>;
1009
+
1010
+ verification_type:
1011
+ | 'identity'
1012
+ | 'residence'
1013
+ | 'selfie'
1014
+ | 'sanctions_check'
1015
+ | 'pep_check'
1016
+ | 'negative_news_check'
1017
+ | 'tax_id';
1018
+ }
1019
+
1020
+ export interface UnionMember1 {
1021
+ action_type: 'provide_details';
1022
+
1023
+ deadline: string | null;
1024
+
1025
+ details_type:
1026
+ | UnionMember1.UnionMember0
1027
+ | UnionMember1.FullNameType
1028
+ | UnionMember1.DateOfBirthType
1029
+ | UnionMember1.CityOfBirthType
1030
+ | UnionMember1.CountryOfBirthType
1031
+ | UnionMember1.NationalitiesType
1032
+ | UnionMember1.ResidenceType
1033
+ | UnionMember1.PhoneType
1034
+ | UnionMember1.OccupationType
1035
+ | UnionMember1.EmployerType
1036
+ | UnionMember1.TaxIdsType
1037
+ | UnionMember1.ClientIdentifierType;
1038
+
1039
+ reason: string | null;
1040
+ }
1041
+
1042
+ export namespace UnionMember1 {
1043
+ export interface UnionMember0 {
1044
+ type: 'terms_of_service';
1045
+
1046
+ version?: number;
1047
+ }
1048
+
1049
+ export interface FullNameType {
1050
+ type: 'full_name';
1051
+ }
1052
+
1053
+ export interface DateOfBirthType {
1054
+ type: 'date_of_birth';
1055
+ }
1056
+
1057
+ export interface CityOfBirthType {
1058
+ type: 'city_of_birth';
1059
+ }
1060
+
1061
+ export interface CountryOfBirthType {
1062
+ type: 'country_of_birth';
1063
+ }
1064
+
1065
+ export interface NationalitiesType {
1066
+ type: 'nationalities';
1067
+ }
1068
+
1069
+ export interface ResidenceType {
1070
+ type: 'residence';
1071
+ }
1072
+
1073
+ export interface PhoneType {
1074
+ type: 'phone';
1075
+ }
1076
+
1077
+ export interface OccupationType {
1078
+ type: 'occupation';
1079
+ }
1080
+
1081
+ export interface EmployerType {
1082
+ type: 'employer';
1083
+ }
1084
+
1085
+ export interface TaxIdsType {
1086
+ type: 'tax_ids';
1087
+ }
1088
+
1089
+ export interface ClientIdentifierType {
1090
+ type: 'client_identifier';
1091
+ }
1092
+ }
1093
+
1094
+ export interface UnionMember2 {
1095
+ action_type: 'wait';
1096
+
1097
+ wait_reason_code: string;
1098
+ }
1099
+ }
1100
+
1101
+ export interface UnionMember2 {
1102
+ reasons: Array<string>;
1103
+
1104
+ state: 'closed';
1105
+ }
1106
+ }
1107
+
1108
+ /**
1109
+ * Payload for the kraken_embed.quote_executed webhook event.
1110
+ */
1111
+ export interface KrakenEmbedQuoteExecutedWebhookPayload {
1112
+ /**
1113
+ * ISO 8601 timestamp of when the quote was executed.
1114
+ */
1115
+ executed_at: string;
1116
+
1117
+ /**
1118
+ * The ID of the executed quote.
1119
+ */
1120
+ quote_id: string;
1121
+
1122
+ /**
1123
+ * The type of webhook event.
1124
+ */
1125
+ type: 'kraken_embed.quote.executed';
1126
+
1127
+ /**
1128
+ * The ID of the user.
1129
+ */
1130
+ user_id: string;
1131
+ }
1132
+
1133
+ /**
1134
+ * Payload for the kraken_embed.quote.execution_failed webhook event.
1135
+ */
1136
+ export interface KrakenEmbedQuoteExecutionFailedWebhookPayload {
1137
+ /**
1138
+ * ISO 8601 timestamp of when the quote execution failed.
1139
+ */
1140
+ failed_at: string;
1141
+
1142
+ /**
1143
+ * The ID of the quote that failed to execute.
1144
+ */
1145
+ quote_id: string;
1146
+
1147
+ /**
1148
+ * A human-readable description of why the quote execution failed. Intended for
1149
+ * display and logging purposes only.
1150
+ */
1151
+ reason: string;
1152
+
1153
+ /**
1154
+ * The type of webhook event.
1155
+ */
1156
+ type: 'kraken_embed.quote.execution_failed';
1157
+
1158
+ /**
1159
+ * The ID of the user.
1160
+ */
1161
+ user_id: string;
1162
+ }
1163
+
1164
+ /**
1165
+ * Payload for the kraken_embed.quote.cancelled webhook event.
1166
+ */
1167
+ export interface KrakenEmbedQuoteCancelledWebhookPayload {
1168
+ /**
1169
+ * ISO 8601 timestamp of when the quote was cancelled.
1170
+ */
1171
+ cancelled_at: string;
1172
+
1173
+ /**
1174
+ * The ID of the cancelled quote.
1175
+ */
1176
+ quote_id: string;
1177
+
1178
+ /**
1179
+ * A human-readable description of why the quote was cancelled. Intended for
1180
+ * display and logging purposes only.
1181
+ */
1182
+ reason: string;
1183
+
1184
+ /**
1185
+ * The type of webhook event.
1186
+ */
1187
+ type: 'kraken_embed.quote.cancelled';
1188
+
1189
+ /**
1190
+ * The ID of the user.
1191
+ */
1192
+ user_id: string;
1193
+ }
1194
+
1195
+ /**
1196
+ * Payload for the kraken_embed.user.verified webhook event.
1197
+ */
1198
+ export interface KrakenEmbedUserVerifiedWebhookPayload {
1199
+ /**
1200
+ * The type of webhook event.
1201
+ */
1202
+ type: 'kraken_embed.user.verified';
1203
+
1204
+ /**
1205
+ * The ID of the user.
1206
+ */
1207
+ user_id: string;
1208
+
1209
+ /**
1210
+ * ISO 8601 timestamp of when the user was verified.
1211
+ */
1212
+ verified_at: string;
1213
+ }
1214
+
1215
+ /**
1216
+ * Payload for the kraken_embed.user.disabled webhook event.
1217
+ */
1218
+ export interface KrakenEmbedUserDisabledWebhookPayload {
1219
+ /**
1220
+ * ISO 8601 timestamp of when the user was disabled.
1221
+ */
1222
+ disabled_at: string;
1223
+
1224
+ /**
1225
+ * The type of webhook event.
1226
+ */
1227
+ type: 'kraken_embed.user.disabled';
1228
+
1229
+ /**
1230
+ * The ID of the user.
1231
+ */
1232
+ user_id: string;
1233
+ }
1234
+
1235
+ /**
1236
+ * Payload for the kraken_embed.user.closed webhook event.
1237
+ */
1238
+ export interface KrakenEmbedUserClosedWebhookPayload {
1239
+ /**
1240
+ * ISO 8601 timestamp of when the user was closed.
1241
+ */
1242
+ closed_at: string;
1243
+
1244
+ /**
1245
+ * The type of webhook event.
1246
+ */
1247
+ type: 'kraken_embed.user.closed';
1248
+
1249
+ /**
1250
+ * The ID of the user.
1251
+ */
1252
+ user_id: string;
1253
+ }
1254
+
1255
+ export declare namespace Webhooks {
1256
+ export {
1257
+ type UserCreatedWebhookPayload as UserCreatedWebhookPayload,
1258
+ type UserAuthenticatedWebhookPayload as UserAuthenticatedWebhookPayload,
1259
+ type UserLinkedAccountWebhookPayload as UserLinkedAccountWebhookPayload,
1260
+ type UserUnlinkedAccountWebhookPayload as UserUnlinkedAccountWebhookPayload,
1261
+ type UserUpdatedAccountWebhookPayload as UserUpdatedAccountWebhookPayload,
1262
+ type UserTransferredAccountWebhookPayload as UserTransferredAccountWebhookPayload,
1263
+ type UserWalletCreatedWebhookPayload as UserWalletCreatedWebhookPayload,
1264
+ type TransactionBroadcastedWebhookPayload as TransactionBroadcastedWebhookPayload,
1265
+ type TransactionConfirmedWebhookPayload as TransactionConfirmedWebhookPayload,
1266
+ type TransactionExecutionRevertedWebhookPayload as TransactionExecutionRevertedWebhookPayload,
1267
+ type TransactionStillPendingWebhookPayload as TransactionStillPendingWebhookPayload,
1268
+ type TransactionFailedWebhookPayload as TransactionFailedWebhookPayload,
1269
+ type TransactionReplacedWebhookPayload as TransactionReplacedWebhookPayload,
1270
+ type TransactionProviderErrorWebhookPayload as TransactionProviderErrorWebhookPayload,
1271
+ type FundsDepositedWebhookPayload as FundsDepositedWebhookPayload,
1272
+ type FundsWithdrawnWebhookPayload as FundsWithdrawnWebhookPayload,
1273
+ type PrivateKeyExportWebhookPayload as PrivateKeyExportWebhookPayload,
1274
+ type WalletRecoverySetupWebhookPayload as WalletRecoverySetupWebhookPayload,
1275
+ type WalletRecoveredWebhookPayload as WalletRecoveredWebhookPayload,
1276
+ type MfaEnabledWebhookPayload as MfaEnabledWebhookPayload,
1277
+ type MfaDisabledWebhookPayload as MfaDisabledWebhookPayload,
1278
+ type KrakenEmbedVerificationCompletedWebhookPayload as KrakenEmbedVerificationCompletedWebhookPayload,
1279
+ type KrakenEmbedVerificationFailedWebhookPayload as KrakenEmbedVerificationFailedWebhookPayload,
1280
+ type KrakenEmbedQuoteExecutedWebhookPayload as KrakenEmbedQuoteExecutedWebhookPayload,
1281
+ type KrakenEmbedQuoteExecutionFailedWebhookPayload as KrakenEmbedQuoteExecutionFailedWebhookPayload,
1282
+ type KrakenEmbedQuoteCancelledWebhookPayload as KrakenEmbedQuoteCancelledWebhookPayload,
1283
+ type KrakenEmbedUserVerifiedWebhookPayload as KrakenEmbedUserVerifiedWebhookPayload,
1284
+ type KrakenEmbedUserDisabledWebhookPayload as KrakenEmbedUserDisabledWebhookPayload,
1285
+ type KrakenEmbedUserClosedWebhookPayload as KrakenEmbedUserClosedWebhookPayload,
1286
+ };
1287
+ }