@privy-io/api-types 0.4.0 → 0.6.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 (142) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/client.d.mts +25 -12
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +25 -12
  5. package/client.d.ts.map +1 -1
  6. package/client.js +32 -5
  7. package/client.js.map +1 -1
  8. package/client.mjs +32 -5
  9. package/client.mjs.map +1 -1
  10. package/internal/parse.d.mts.map +1 -1
  11. package/internal/parse.d.ts.map +1 -1
  12. package/internal/parse.js +5 -0
  13. package/internal/parse.js.map +1 -1
  14. package/internal/parse.mjs +5 -0
  15. package/internal/parse.mjs.map +1 -1
  16. package/internal/tslib.js +17 -17
  17. package/internal/utils/query.d.mts +2 -0
  18. package/internal/utils/query.d.mts.map +1 -0
  19. package/internal/utils/query.d.ts +2 -0
  20. package/internal/utils/query.d.ts.map +1 -0
  21. package/internal/utils/query.js +10 -0
  22. package/internal/utils/query.js.map +1 -0
  23. package/internal/utils/query.mjs +6 -0
  24. package/internal/utils/query.mjs.map +1 -0
  25. package/internal/utils.d.mts +1 -0
  26. package/internal/utils.d.ts +1 -0
  27. package/internal/utils.js +1 -0
  28. package/internal/utils.js.map +1 -1
  29. package/internal/utils.mjs +1 -0
  30. package/package.json +1 -1
  31. package/resources/accounts.d.mts +85 -0
  32. package/resources/accounts.d.mts.map +1 -0
  33. package/resources/accounts.d.ts +85 -0
  34. package/resources/accounts.d.ts.map +1 -0
  35. package/resources/accounts.js +9 -0
  36. package/resources/accounts.js.map +1 -0
  37. package/resources/accounts.mjs +5 -0
  38. package/resources/accounts.mjs.map +1 -0
  39. package/resources/aggregations.d.mts +213 -2
  40. package/resources/aggregations.d.mts.map +1 -1
  41. package/resources/aggregations.d.ts +213 -2
  42. package/resources/aggregations.d.ts.map +1 -1
  43. package/resources/client-auth.d.mts +181 -1
  44. package/resources/client-auth.d.mts.map +1 -1
  45. package/resources/client-auth.d.ts +181 -1
  46. package/resources/client-auth.d.ts.map +1 -1
  47. package/resources/funding.d.mts +4 -4
  48. package/resources/funding.d.mts.map +1 -1
  49. package/resources/funding.d.ts +4 -4
  50. package/resources/funding.d.ts.map +1 -1
  51. package/resources/index.d.mts +9 -5
  52. package/resources/index.d.mts.map +1 -1
  53. package/resources/index.d.ts +9 -5
  54. package/resources/index.d.ts.map +1 -1
  55. package/resources/index.js +9 -1
  56. package/resources/index.js.map +1 -1
  57. package/resources/index.mjs +4 -0
  58. package/resources/index.mjs.map +1 -1
  59. package/resources/intents.d.mts +104 -0
  60. package/resources/intents.d.mts.map +1 -0
  61. package/resources/intents.d.ts +104 -0
  62. package/resources/intents.d.ts.map +1 -0
  63. package/resources/intents.js +9 -0
  64. package/resources/intents.js.map +1 -0
  65. package/resources/intents.mjs +5 -0
  66. package/resources/intents.mjs.map +1 -0
  67. package/resources/key-quorums.d.mts +14 -0
  68. package/resources/key-quorums.d.mts.map +1 -1
  69. package/resources/key-quorums.d.ts +14 -0
  70. package/resources/key-quorums.d.ts.map +1 -1
  71. package/resources/policies.d.mts +66 -68
  72. package/resources/policies.d.mts.map +1 -1
  73. package/resources/policies.d.ts +66 -68
  74. package/resources/policies.d.ts.map +1 -1
  75. package/resources/users.d.mts +72 -62
  76. package/resources/users.d.mts.map +1 -1
  77. package/resources/users.d.ts +72 -62
  78. package/resources/users.d.ts.map +1 -1
  79. package/resources/wallets/balance.d.mts +10 -5
  80. package/resources/wallets/balance.d.mts.map +1 -1
  81. package/resources/wallets/balance.d.ts +10 -5
  82. package/resources/wallets/balance.d.ts.map +1 -1
  83. package/resources/wallets/balance.js +1 -2
  84. package/resources/wallets/balance.js.map +1 -1
  85. package/resources/wallets/balance.mjs +1 -2
  86. package/resources/wallets/balance.mjs.map +1 -1
  87. package/resources/wallets/index.d.mts +1 -1
  88. package/resources/wallets/index.d.mts.map +1 -1
  89. package/resources/wallets/index.d.ts +1 -1
  90. package/resources/wallets/index.d.ts.map +1 -1
  91. package/resources/wallets/index.js.map +1 -1
  92. package/resources/wallets/index.mjs.map +1 -1
  93. package/resources/wallets/transactions.d.mts +2 -2
  94. package/resources/wallets/transactions.d.mts.map +1 -1
  95. package/resources/wallets/transactions.d.ts +2 -2
  96. package/resources/wallets/transactions.d.ts.map +1 -1
  97. package/resources/wallets/wallets.d.mts +203 -76
  98. package/resources/wallets/wallets.d.mts.map +1 -1
  99. package/resources/wallets/wallets.d.ts +203 -76
  100. package/resources/wallets/wallets.d.ts.map +1 -1
  101. package/resources/wallets/wallets.js.map +1 -1
  102. package/resources/wallets/wallets.mjs.map +1 -1
  103. package/resources/webhooks.d.mts +977 -0
  104. package/resources/webhooks.d.mts.map +1 -0
  105. package/resources/webhooks.d.ts +977 -0
  106. package/resources/webhooks.d.ts.map +1 -0
  107. package/resources/webhooks.js +9 -0
  108. package/resources/webhooks.js.map +1 -0
  109. package/resources/webhooks.mjs +5 -0
  110. package/resources/webhooks.mjs.map +1 -0
  111. package/resources/yield.d.mts +311 -0
  112. package/resources/yield.d.mts.map +1 -0
  113. package/resources/yield.d.ts +311 -0
  114. package/resources/yield.d.ts.map +1 -0
  115. package/resources/yield.js +9 -0
  116. package/resources/yield.js.map +1 -0
  117. package/resources/yield.mjs +5 -0
  118. package/resources/yield.mjs.map +1 -0
  119. package/src/client.ts +240 -18
  120. package/src/internal/parse.ts +6 -0
  121. package/src/internal/utils/query.ts +7 -0
  122. package/src/internal/utils.ts +1 -0
  123. package/src/resources/accounts.ts +106 -0
  124. package/src/resources/aggregations.ts +361 -5
  125. package/src/resources/client-auth.ts +309 -0
  126. package/src/resources/funding.ts +4 -1
  127. package/src/resources/index.ts +101 -8
  128. package/src/resources/intents.ts +138 -0
  129. package/src/resources/key-quorums.ts +17 -0
  130. package/src/resources/policies.ts +86 -88
  131. package/src/resources/users.ts +128 -111
  132. package/src/resources/wallets/balance.ts +15 -5
  133. package/src/resources/wallets/index.ts +7 -3
  134. package/src/resources/wallets/transactions.ts +2 -2
  135. package/src/resources/wallets/wallets.ts +250 -96
  136. package/src/resources/webhooks.ts +1347 -0
  137. package/src/resources/yield.ts +389 -0
  138. package/src/version.ts +1 -1
  139. package/version.d.mts +1 -1
  140. package/version.d.ts +1 -1
  141. package/version.js +1 -1
  142. package/version.mjs +1 -1
@@ -270,6 +270,13 @@ export class Wallets extends APIResource {
270
270
 
271
271
  export type WalletsCursor = Cursor<Wallet>;
272
272
 
273
+ /**
274
+ * The response body from revoking a wallet delegation.
275
+ */
276
+ export interface WalletRevokeResponse {
277
+ message: string;
278
+ }
279
+
273
280
  /**
274
281
  * The wallet chain types that support curve-based signing.
275
282
  */
@@ -286,87 +293,9 @@ export type CurveSigningChainType =
286
293
  | 'starknet';
287
294
 
288
295
  /**
289
- * The wallet chain types that offer first class support.
290
- */
291
- export type FirstClassChainType = 'ethereum' | 'solana';
292
-
293
- /**
294
- * A wallet managed by Privy's wallet infrastructure.
295
- */
296
- export interface Wallet {
297
- /**
298
- * Unique ID of the wallet. This will be the primary identifier when using the
299
- * wallet in the future.
300
- */
301
- id: string;
302
-
303
- /**
304
- * Additional signers for the wallet.
305
- */
306
- additional_signers: Array<Wallet.AdditionalSigner>;
307
-
308
- /**
309
- * Address of the wallet.
310
- */
311
- address: string;
312
-
313
- /**
314
- * The wallet chain types.
315
- */
316
- chain_type: WalletChainType;
317
-
318
- /**
319
- * Unix timestamp of when the wallet was created in milliseconds.
320
- */
321
- created_at: number;
322
-
323
- /**
324
- * Unix timestamp of when the wallet was exported in milliseconds, if the wallet
325
- * was exported.
326
- */
327
- exported_at: number | null;
328
-
329
- /**
330
- * Unix timestamp of when the wallet was imported in milliseconds, if the wallet
331
- * was imported.
332
- */
333
- imported_at: number | null;
334
-
335
- /**
336
- * The key quorum ID of the owner of the wallet.
337
- */
338
- owner_id: string | null;
339
-
340
- /**
341
- * List of policy IDs for policies that are enforced on the wallet.
342
- */
343
- policy_ids: Array<string>;
344
-
345
- /**
346
- * The compressed, raw public key for the wallet along the chain cryptographic
347
- * curve.
348
- */
349
- public_key?: string;
350
- }
351
-
352
- export namespace Wallet {
353
- export interface AdditionalSigner {
354
- signer_id: string;
355
-
356
- /**
357
- * The array of policy IDs that will be applied to wallet requests. If specified,
358
- * this will override the base policy IDs set on the wallet.
359
- */
360
- override_policy_ids?: Array<string>;
361
- }
362
- }
363
-
364
- /**
365
- * The wallet chain types.
296
+ * The wallet chain types that are not first class chains.
366
297
  */
367
- export type WalletChainType =
368
- | 'ethereum'
369
- | 'solana'
298
+ export type ExtendedChainType =
370
299
  | 'cosmos'
371
300
  | 'stellar'
372
301
  | 'sui'
@@ -380,16 +309,16 @@ export type WalletChainType =
380
309
  | 'spark';
381
310
 
382
311
  /**
383
- * The response body from revoking a wallet delegation.
312
+ * The wallet chain types that offer first class support.
384
313
  */
385
- export interface WalletRevokeResponse {
386
- message: string;
387
- }
314
+ export type FirstClassChainType = 'ethereum' | 'solana';
388
315
 
389
316
  /**
390
- * The wallet chain types that are not first class chains.
317
+ * The wallet chain types.
391
318
  */
392
- export type ExtendedChainType =
319
+ export type WalletChainType =
320
+ | 'ethereum'
321
+ | 'solana'
393
322
  | 'cosmos'
394
323
  | 'stellar'
395
324
  | 'sui'
@@ -406,7 +335,15 @@ export type ExtendedChainType =
406
335
  * Information about the custodian managing this wallet.
407
336
  */
408
337
  export interface WalletCustodian {
409
- name: string;
338
+ /**
339
+ * The custodian responsible for the wallet.
340
+ */
341
+ provider: string;
342
+
343
+ /**
344
+ * The resource ID of the beneficiary of the custodial wallet.
345
+ */
346
+ provider_user_id: string;
410
347
  }
411
348
 
412
349
  /**
@@ -475,12 +412,12 @@ export interface CustodialWallet {
475
412
  */
476
413
  chain_type: CustodialWalletChainType;
477
414
 
478
- owner_id: string | null;
479
-
480
415
  /**
481
- * The provider of the custodial wallet.
416
+ * Information about the custodian managing this wallet.
482
417
  */
483
- provider: CustodialWalletProvider;
418
+ custody: WalletCustodian;
419
+
420
+ owner_id: string | null;
484
421
 
485
422
  additional_signers?: Array<CustodialWallet.AdditionalSigner>;
486
423
 
@@ -525,6 +462,210 @@ export interface HpkeImportConfig {
525
462
  */
526
463
  export type SuiCommandName = 'TransferObjects' | 'SplitCoins' | 'MergeCoins';
527
464
 
465
+ /**
466
+ * A wallet managed by Privy's wallet infrastructure.
467
+ */
468
+ export interface Wallet {
469
+ /**
470
+ * Unique ID of the wallet. This will be the primary identifier when using the
471
+ * wallet in the future.
472
+ */
473
+ id: string;
474
+
475
+ /**
476
+ * Additional signers for the wallet.
477
+ */
478
+ additional_signers: Array<Wallet.AdditionalSigner>;
479
+
480
+ /**
481
+ * Address of the wallet.
482
+ */
483
+ address: string;
484
+
485
+ /**
486
+ * The wallet chain types.
487
+ */
488
+ chain_type: WalletChainType;
489
+
490
+ /**
491
+ * Unix timestamp of when the wallet was created in milliseconds.
492
+ */
493
+ created_at: number;
494
+
495
+ /**
496
+ * Unix timestamp of when the wallet was exported in milliseconds, if the wallet
497
+ * was exported.
498
+ */
499
+ exported_at: number | null;
500
+
501
+ /**
502
+ * Unix timestamp of when the wallet was imported in milliseconds, if the wallet
503
+ * was imported.
504
+ */
505
+ imported_at: number | null;
506
+
507
+ /**
508
+ * The key quorum ID of the owner of the wallet.
509
+ */
510
+ owner_id: string | null;
511
+
512
+ /**
513
+ * List of policy IDs for policies that are enforced on the wallet.
514
+ */
515
+ policy_ids: Array<string>;
516
+
517
+ /**
518
+ * The compressed, raw public key for the wallet along the chain cryptographic
519
+ * curve.
520
+ */
521
+ public_key?: string;
522
+ }
523
+
524
+ export namespace Wallet {
525
+ export interface AdditionalSigner {
526
+ signer_id: string;
527
+
528
+ /**
529
+ * The array of policy IDs that will be applied to wallet requests. If specified,
530
+ * this will override the base policy IDs set on the wallet.
531
+ */
532
+ override_policy_ids?: Array<string>;
533
+ }
534
+ }
535
+
536
+ /**
537
+ * Input for a single wallet in a batch creation request.
538
+ */
539
+ export interface WalletBatchItemInput {
540
+ /**
541
+ * The wallet chain types.
542
+ */
543
+ chain_type: WalletChainType;
544
+
545
+ /**
546
+ * Additional signers for the wallet.
547
+ */
548
+ additional_signers?: Array<WalletBatchItemInput.AdditionalSigner>;
549
+
550
+ /**
551
+ * The owner of the resource. If you provide this, do not specify an owner_id as it
552
+ * will be generated automatically. When updating a wallet, you can set the owner
553
+ * to null to remove the owner.
554
+ */
555
+ owner?: WalletBatchItemInput.PublicKeyOwner | WalletBatchItemInput.UserOwner | null;
556
+
557
+ /**
558
+ * The key quorum ID to set as the owner of the resource. If you provide this, do
559
+ * not specify an owner.
560
+ */
561
+ owner_id?: string;
562
+
563
+ /**
564
+ * List of policy IDs for policies that should be enforced on the wallet.
565
+ * Currently, only one policy is supported per wallet.
566
+ */
567
+ policy_ids?: Array<string>;
568
+ }
569
+
570
+ export namespace WalletBatchItemInput {
571
+ export interface AdditionalSigner {
572
+ signer_id: string;
573
+
574
+ /**
575
+ * The array of policy IDs that will be applied to wallet requests. If specified,
576
+ * this will override the base policy IDs set on the wallet.
577
+ */
578
+ override_policy_ids?: Array<string>;
579
+ }
580
+
581
+ /**
582
+ * The P-256 public key of the owner of the resource, in base64-encoded DER format.
583
+ * If you provide this, do not specify an owner_id as it will be generated
584
+ * automatically.
585
+ */
586
+ export interface PublicKeyOwner {
587
+ public_key: string;
588
+ }
589
+
590
+ /**
591
+ * The user ID of the owner of the resource. The user must already exist, and this
592
+ * value must start with "did:privy:". If you provide this, do not specify an
593
+ * owner_id as it will be generated automatically.
594
+ */
595
+ export interface UserOwner {
596
+ user_id: string;
597
+ }
598
+ }
599
+
600
+ /**
601
+ * Request body for batch wallet creation.
602
+ */
603
+ export interface WalletBatchCreateInput {
604
+ /**
605
+ * Array of wallet creation requests. Minimum 1, maximum 100.
606
+ */
607
+ wallets: Array<WalletBatchItemInput>;
608
+ }
609
+
610
+ /**
611
+ * A single result from a batch wallet creation operation.
612
+ */
613
+ export type WalletBatchCreateResult =
614
+ | WalletBatchCreateResult.WalletBatchCreateSuccess
615
+ | WalletBatchCreateResult.WalletBatchCreateFailure;
616
+
617
+ export namespace WalletBatchCreateResult {
618
+ /**
619
+ * A successful wallet creation result within a batch operation.
620
+ */
621
+ export interface WalletBatchCreateSuccess {
622
+ /**
623
+ * The index of the wallet in the original request array.
624
+ */
625
+ index: number;
626
+
627
+ success: true;
628
+
629
+ /**
630
+ * A wallet managed by Privy's wallet infrastructure.
631
+ */
632
+ wallet: WalletsAPI.Wallet;
633
+ }
634
+
635
+ /**
636
+ * A failed wallet creation result within a batch operation.
637
+ */
638
+ export interface WalletBatchCreateFailure {
639
+ /**
640
+ * A PrivyErrorCode string identifying the error type (e.g., "invalid_data",
641
+ * "resource_conflict").
642
+ */
643
+ code: string;
644
+
645
+ /**
646
+ * A human-readable error message with details about what went wrong.
647
+ */
648
+ error: string;
649
+
650
+ /**
651
+ * The index of the wallet in the original request array.
652
+ */
653
+ index: number;
654
+
655
+ success: false;
656
+ }
657
+ }
658
+
659
+ /**
660
+ * Response for a batch wallet creation request.
661
+ */
662
+ export interface WalletBatchCreateResponse {
663
+ /**
664
+ * Array of results for each wallet creation request, in the same order as input.
665
+ */
666
+ results: Array<WalletBatchCreateResult>;
667
+ }
668
+
528
669
  /**
529
670
  * Executes the EVM `personal_sign` RPC (EIP-191) to sign a message.
530
671
  */
@@ -1310,11 +1451,21 @@ export namespace WalletCreateParams {
1310
1451
  }
1311
1452
 
1312
1453
  export interface WalletListParams extends CursorParams {
1454
+ /**
1455
+ * Filter wallets by authorization public key. Returns wallets owned by key quorums
1456
+ * that include the specified P-256 public key (base64-encoded DER format). Cannot
1457
+ * be used together with user_id.
1458
+ */
1459
+ authorization_key?: string;
1460
+
1313
1461
  /**
1314
1462
  * The wallet chain types.
1315
1463
  */
1316
1464
  chain_type?: WalletChainType;
1317
1465
 
1466
+ /**
1467
+ * Filter wallets by user ID. Cannot be used together with authorization_key.
1468
+ */
1318
1469
  user_id?: string;
1319
1470
  }
1320
1471
 
@@ -2155,8 +2306,7 @@ export interface WalletUpdateParams {
2155
2306
  owner?: WalletUpdateParams.PublicKeyOwner | WalletUpdateParams.UserOwner | null;
2156
2307
 
2157
2308
  /**
2158
- * Body param: The key quorum ID to set as the owner of the resource. If you
2159
- * provide this, do not specify an owner.
2309
+ * Body param
2160
2310
  */
2161
2311
  owner_id?: string | null;
2162
2312
 
@@ -2281,12 +2431,11 @@ Wallets.Balance = Balance;
2281
2431
 
2282
2432
  export declare namespace Wallets {
2283
2433
  export {
2434
+ type WalletRevokeResponse as WalletRevokeResponse,
2284
2435
  type CurveSigningChainType as CurveSigningChainType,
2436
+ type ExtendedChainType as ExtendedChainType,
2285
2437
  type FirstClassChainType as FirstClassChainType,
2286
- type Wallet as Wallet,
2287
2438
  type WalletChainType as WalletChainType,
2288
- type WalletRevokeResponse as WalletRevokeResponse,
2289
- type ExtendedChainType as ExtendedChainType,
2290
2439
  type WalletCustodian as WalletCustodian,
2291
2440
  type CustodialWalletProvider as CustodialWalletProvider,
2292
2441
  type CustodialWalletChainType as CustodialWalletChainType,
@@ -2294,6 +2443,11 @@ export declare namespace Wallets {
2294
2443
  type CustodialWallet as CustodialWallet,
2295
2444
  type HpkeImportConfig as HpkeImportConfig,
2296
2445
  type SuiCommandName as SuiCommandName,
2446
+ type Wallet as Wallet,
2447
+ type WalletBatchItemInput as WalletBatchItemInput,
2448
+ type WalletBatchCreateInput as WalletBatchCreateInput,
2449
+ type WalletBatchCreateResult as WalletBatchCreateResult,
2450
+ type WalletBatchCreateResponse as WalletBatchCreateResponse,
2297
2451
  type EthereumPersonalSignRpcInput as EthereumPersonalSignRpcInput,
2298
2452
  type EthereumSignTransactionRpcInput as EthereumSignTransactionRpcInput,
2299
2453
  type EthereumSendTransactionRpcInput as EthereumSendTransactionRpcInput,