@privy-io/api-types 0.4.0 → 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 (103) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/client.d.mts +18 -11
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +18 -11
  5. package/client.d.ts.map +1 -1
  6. package/client.js +17 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +17 -3
  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/package.json +1 -1
  17. package/resources/aggregations.d.mts +213 -2
  18. package/resources/aggregations.d.mts.map +1 -1
  19. package/resources/aggregations.d.ts +213 -2
  20. package/resources/aggregations.d.ts.map +1 -1
  21. package/resources/client-auth.d.mts +167 -1
  22. package/resources/client-auth.d.mts.map +1 -1
  23. package/resources/client-auth.d.ts +167 -1
  24. package/resources/client-auth.d.ts.map +1 -1
  25. package/resources/funding.d.mts +4 -4
  26. package/resources/funding.d.mts.map +1 -1
  27. package/resources/funding.d.ts +4 -4
  28. package/resources/funding.d.ts.map +1 -1
  29. package/resources/index.d.mts +7 -5
  30. package/resources/index.d.mts.map +1 -1
  31. package/resources/index.d.ts +7 -5
  32. package/resources/index.d.ts.map +1 -1
  33. package/resources/index.js +5 -1
  34. package/resources/index.js.map +1 -1
  35. package/resources/index.mjs +2 -0
  36. package/resources/index.mjs.map +1 -1
  37. package/resources/policies.d.mts +58 -60
  38. package/resources/policies.d.mts.map +1 -1
  39. package/resources/policies.d.ts +58 -60
  40. package/resources/policies.d.ts.map +1 -1
  41. package/resources/users.d.mts +72 -62
  42. package/resources/users.d.mts.map +1 -1
  43. package/resources/users.d.ts +72 -62
  44. package/resources/users.d.ts.map +1 -1
  45. package/resources/wallets/balance.d.mts +10 -5
  46. package/resources/wallets/balance.d.mts.map +1 -1
  47. package/resources/wallets/balance.d.ts +10 -5
  48. package/resources/wallets/balance.d.ts.map +1 -1
  49. package/resources/wallets/balance.js +1 -2
  50. package/resources/wallets/balance.js.map +1 -1
  51. package/resources/wallets/balance.mjs +1 -2
  52. package/resources/wallets/balance.mjs.map +1 -1
  53. package/resources/wallets/index.d.mts +1 -1
  54. package/resources/wallets/index.d.mts.map +1 -1
  55. package/resources/wallets/index.d.ts +1 -1
  56. package/resources/wallets/index.d.ts.map +1 -1
  57. package/resources/wallets/index.js.map +1 -1
  58. package/resources/wallets/index.mjs.map +1 -1
  59. package/resources/wallets/transactions.d.mts +2 -2
  60. package/resources/wallets/transactions.d.mts.map +1 -1
  61. package/resources/wallets/transactions.d.ts +2 -2
  62. package/resources/wallets/transactions.d.ts.map +1 -1
  63. package/resources/wallets/wallets.d.mts +192 -72
  64. package/resources/wallets/wallets.d.mts.map +1 -1
  65. package/resources/wallets/wallets.d.ts +192 -72
  66. package/resources/wallets/wallets.d.ts.map +1 -1
  67. package/resources/wallets/wallets.js.map +1 -1
  68. package/resources/wallets/wallets.mjs.map +1 -1
  69. package/resources/webhooks.d.mts +940 -0
  70. package/resources/webhooks.d.mts.map +1 -0
  71. package/resources/webhooks.d.ts +940 -0
  72. package/resources/webhooks.d.ts.map +1 -0
  73. package/resources/webhooks.js +9 -0
  74. package/resources/webhooks.js.map +1 -0
  75. package/resources/webhooks.mjs +5 -0
  76. package/resources/webhooks.mjs.map +1 -0
  77. package/resources/yield.d.mts +264 -0
  78. package/resources/yield.d.mts.map +1 -0
  79. package/resources/yield.d.ts +264 -0
  80. package/resources/yield.d.ts.map +1 -0
  81. package/resources/yield.js +9 -0
  82. package/resources/yield.js.map +1 -0
  83. package/resources/yield.mjs +5 -0
  84. package/resources/yield.mjs.map +1 -0
  85. package/src/client.ts +184 -14
  86. package/src/internal/parse.ts +6 -0
  87. package/src/resources/aggregations.ts +361 -5
  88. package/src/resources/client-auth.ts +287 -0
  89. package/src/resources/funding.ts +4 -1
  90. package/src/resources/index.ts +84 -8
  91. package/src/resources/policies.ts +78 -80
  92. package/src/resources/users.ts +128 -111
  93. package/src/resources/wallets/balance.ts +15 -5
  94. package/src/resources/wallets/index.ts +7 -3
  95. package/src/resources/wallets/transactions.ts +2 -2
  96. package/src/resources/wallets/wallets.ts +237 -91
  97. package/src/resources/webhooks.ts +1287 -0
  98. package/src/resources/yield.ts +330 -0
  99. package/src/version.ts +1 -1
  100. package/version.d.mts +1 -1
  101. package/version.d.ts +1 -1
  102. package/version.js +1 -1
  103. package/version.mjs +1 -1
@@ -4,12 +4,11 @@ export { Balance, type BalanceGetResponse, type BalanceGetParams } from './balan
4
4
  export { Transactions, type TransactionGetResponse, type TransactionGetParams } from './transactions';
5
5
  export {
6
6
  Wallets,
7
+ type WalletRevokeResponse,
7
8
  type CurveSigningChainType,
9
+ type ExtendedChainType,
8
10
  type FirstClassChainType,
9
- type Wallet,
10
11
  type WalletChainType,
11
- type WalletRevokeResponse,
12
- type ExtendedChainType,
13
12
  type WalletCustodian,
14
13
  type CustodialWalletProvider,
15
14
  type CustodialWalletChainType,
@@ -17,6 +16,11 @@ export {
17
16
  type CustodialWallet,
18
17
  type HpkeImportConfig,
19
18
  type SuiCommandName,
19
+ type Wallet,
20
+ type WalletBatchItemInput,
21
+ type WalletBatchCreateInput,
22
+ type WalletBatchCreateResult,
23
+ type WalletBatchCreateResponse,
20
24
  type EthereumPersonalSignRpcInput,
21
25
  type EthereumSignTransactionRpcInput,
22
26
  type EthereumSendTransactionRpcInput,
@@ -61,7 +61,7 @@ export namespace TransactionGetResponse {
61
61
 
62
62
  export namespace Transaction {
63
63
  export interface UnionMember0 {
64
- asset: 'usdc' | 'eth' | 'pol' | 'usdt' | 'eurc' | 'usdb' | 'sol';
64
+ asset: 'usdc' | 'eth' | 'pol' | 'usdt' | 'eurc' | 'usdb' | 'sol' | (string & {});
65
65
 
66
66
  chain:
67
67
  | 'ethereum'
@@ -99,7 +99,7 @@ export namespace TransactionGetResponse {
99
99
  }
100
100
 
101
101
  export interface UnionMember1 {
102
- asset: 'usdc' | 'eth' | 'pol' | 'usdt' | 'eurc' | 'usdb' | 'sol';
102
+ asset: 'usdc' | 'eth' | 'pol' | 'usdt' | 'eurc' | 'usdb' | 'sol' | (string & {});
103
103
 
104
104
  chain:
105
105
  | 'ethereum'
@@ -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'
@@ -525,6 +454,210 @@ export interface HpkeImportConfig {
525
454
  */
526
455
  export type SuiCommandName = 'TransferObjects' | 'SplitCoins' | 'MergeCoins';
527
456
 
457
+ /**
458
+ * A wallet managed by Privy's wallet infrastructure.
459
+ */
460
+ export interface Wallet {
461
+ /**
462
+ * Unique ID of the wallet. This will be the primary identifier when using the
463
+ * wallet in the future.
464
+ */
465
+ id: string;
466
+
467
+ /**
468
+ * Additional signers for the wallet.
469
+ */
470
+ additional_signers: Array<Wallet.AdditionalSigner>;
471
+
472
+ /**
473
+ * Address of the wallet.
474
+ */
475
+ address: string;
476
+
477
+ /**
478
+ * The wallet chain types.
479
+ */
480
+ chain_type: WalletChainType;
481
+
482
+ /**
483
+ * Unix timestamp of when the wallet was created in milliseconds.
484
+ */
485
+ created_at: number;
486
+
487
+ /**
488
+ * Unix timestamp of when the wallet was exported in milliseconds, if the wallet
489
+ * was exported.
490
+ */
491
+ exported_at: number | null;
492
+
493
+ /**
494
+ * Unix timestamp of when the wallet was imported in milliseconds, if the wallet
495
+ * was imported.
496
+ */
497
+ imported_at: number | null;
498
+
499
+ /**
500
+ * The key quorum ID of the owner of the wallet.
501
+ */
502
+ owner_id: string | null;
503
+
504
+ /**
505
+ * List of policy IDs for policies that are enforced on the wallet.
506
+ */
507
+ policy_ids: Array<string>;
508
+
509
+ /**
510
+ * The compressed, raw public key for the wallet along the chain cryptographic
511
+ * curve.
512
+ */
513
+ public_key?: string;
514
+ }
515
+
516
+ export namespace Wallet {
517
+ export interface AdditionalSigner {
518
+ signer_id: string;
519
+
520
+ /**
521
+ * The array of policy IDs that will be applied to wallet requests. If specified,
522
+ * this will override the base policy IDs set on the wallet.
523
+ */
524
+ override_policy_ids?: Array<string>;
525
+ }
526
+ }
527
+
528
+ /**
529
+ * Input for a single wallet in a batch creation request.
530
+ */
531
+ export interface WalletBatchItemInput {
532
+ /**
533
+ * The wallet chain types.
534
+ */
535
+ chain_type: WalletChainType;
536
+
537
+ /**
538
+ * Additional signers for the wallet.
539
+ */
540
+ additional_signers?: Array<WalletBatchItemInput.AdditionalSigner>;
541
+
542
+ /**
543
+ * The owner of the resource. If you provide this, do not specify an owner_id as it
544
+ * will be generated automatically. When updating a wallet, you can set the owner
545
+ * to null to remove the owner.
546
+ */
547
+ owner?: WalletBatchItemInput.PublicKeyOwner | WalletBatchItemInput.UserOwner | null;
548
+
549
+ /**
550
+ * The key quorum ID to set as the owner of the resource. If you provide this, do
551
+ * not specify an owner.
552
+ */
553
+ owner_id?: string;
554
+
555
+ /**
556
+ * List of policy IDs for policies that should be enforced on the wallet.
557
+ * Currently, only one policy is supported per wallet.
558
+ */
559
+ policy_ids?: Array<string>;
560
+ }
561
+
562
+ export namespace WalletBatchItemInput {
563
+ export interface AdditionalSigner {
564
+ signer_id: string;
565
+
566
+ /**
567
+ * The array of policy IDs that will be applied to wallet requests. If specified,
568
+ * this will override the base policy IDs set on the wallet.
569
+ */
570
+ override_policy_ids?: Array<string>;
571
+ }
572
+
573
+ /**
574
+ * The P-256 public key of the owner of the resource, in base64-encoded DER format.
575
+ * If you provide this, do not specify an owner_id as it will be generated
576
+ * automatically.
577
+ */
578
+ export interface PublicKeyOwner {
579
+ public_key: string;
580
+ }
581
+
582
+ /**
583
+ * The user ID of the owner of the resource. The user must already exist, and this
584
+ * value must start with "did:privy:". If you provide this, do not specify an
585
+ * owner_id as it will be generated automatically.
586
+ */
587
+ export interface UserOwner {
588
+ user_id: string;
589
+ }
590
+ }
591
+
592
+ /**
593
+ * Request body for batch wallet creation.
594
+ */
595
+ export interface WalletBatchCreateInput {
596
+ /**
597
+ * Array of wallet creation requests. Minimum 1, maximum 100.
598
+ */
599
+ wallets: Array<WalletBatchItemInput>;
600
+ }
601
+
602
+ /**
603
+ * A single result from a batch wallet creation operation.
604
+ */
605
+ export type WalletBatchCreateResult =
606
+ | WalletBatchCreateResult.WalletBatchCreateSuccess
607
+ | WalletBatchCreateResult.WalletBatchCreateFailure;
608
+
609
+ export namespace WalletBatchCreateResult {
610
+ /**
611
+ * A successful wallet creation result within a batch operation.
612
+ */
613
+ export interface WalletBatchCreateSuccess {
614
+ /**
615
+ * The index of the wallet in the original request array.
616
+ */
617
+ index: number;
618
+
619
+ success: true;
620
+
621
+ /**
622
+ * A wallet managed by Privy's wallet infrastructure.
623
+ */
624
+ wallet: WalletsAPI.Wallet;
625
+ }
626
+
627
+ /**
628
+ * A failed wallet creation result within a batch operation.
629
+ */
630
+ export interface WalletBatchCreateFailure {
631
+ /**
632
+ * A PrivyErrorCode string identifying the error type (e.g., "invalid_data",
633
+ * "resource_conflict").
634
+ */
635
+ code: string;
636
+
637
+ /**
638
+ * A human-readable error message with details about what went wrong.
639
+ */
640
+ error: string;
641
+
642
+ /**
643
+ * The index of the wallet in the original request array.
644
+ */
645
+ index: number;
646
+
647
+ success: false;
648
+ }
649
+ }
650
+
651
+ /**
652
+ * Response for a batch wallet creation request.
653
+ */
654
+ export interface WalletBatchCreateResponse {
655
+ /**
656
+ * Array of results for each wallet creation request, in the same order as input.
657
+ */
658
+ results: Array<WalletBatchCreateResult>;
659
+ }
660
+
528
661
  /**
529
662
  * Executes the EVM `personal_sign` RPC (EIP-191) to sign a message.
530
663
  */
@@ -1310,11 +1443,21 @@ export namespace WalletCreateParams {
1310
1443
  }
1311
1444
 
1312
1445
  export interface WalletListParams extends CursorParams {
1446
+ /**
1447
+ * Filter wallets by authorization public key. Returns wallets owned by key quorums
1448
+ * that include the specified P-256 public key (base64-encoded DER format). Cannot
1449
+ * be used together with user_id.
1450
+ */
1451
+ authorization_key?: string;
1452
+
1313
1453
  /**
1314
1454
  * The wallet chain types.
1315
1455
  */
1316
1456
  chain_type?: WalletChainType;
1317
1457
 
1458
+ /**
1459
+ * Filter wallets by user ID. Cannot be used together with authorization_key.
1460
+ */
1318
1461
  user_id?: string;
1319
1462
  }
1320
1463
 
@@ -2155,8 +2298,7 @@ export interface WalletUpdateParams {
2155
2298
  owner?: WalletUpdateParams.PublicKeyOwner | WalletUpdateParams.UserOwner | null;
2156
2299
 
2157
2300
  /**
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.
2301
+ * Body param
2160
2302
  */
2161
2303
  owner_id?: string | null;
2162
2304
 
@@ -2281,12 +2423,11 @@ Wallets.Balance = Balance;
2281
2423
 
2282
2424
  export declare namespace Wallets {
2283
2425
  export {
2426
+ type WalletRevokeResponse as WalletRevokeResponse,
2284
2427
  type CurveSigningChainType as CurveSigningChainType,
2428
+ type ExtendedChainType as ExtendedChainType,
2285
2429
  type FirstClassChainType as FirstClassChainType,
2286
- type Wallet as Wallet,
2287
2430
  type WalletChainType as WalletChainType,
2288
- type WalletRevokeResponse as WalletRevokeResponse,
2289
- type ExtendedChainType as ExtendedChainType,
2290
2431
  type WalletCustodian as WalletCustodian,
2291
2432
  type CustodialWalletProvider as CustodialWalletProvider,
2292
2433
  type CustodialWalletChainType as CustodialWalletChainType,
@@ -2294,6 +2435,11 @@ export declare namespace Wallets {
2294
2435
  type CustodialWallet as CustodialWallet,
2295
2436
  type HpkeImportConfig as HpkeImportConfig,
2296
2437
  type SuiCommandName as SuiCommandName,
2438
+ type Wallet as Wallet,
2439
+ type WalletBatchItemInput as WalletBatchItemInput,
2440
+ type WalletBatchCreateInput as WalletBatchCreateInput,
2441
+ type WalletBatchCreateResult as WalletBatchCreateResult,
2442
+ type WalletBatchCreateResponse as WalletBatchCreateResponse,
2297
2443
  type EthereumPersonalSignRpcInput as EthereumPersonalSignRpcInput,
2298
2444
  type EthereumSignTransactionRpcInput as EthereumSignTransactionRpcInput,
2299
2445
  type EthereumSendTransactionRpcInput as EthereumSendTransactionRpcInput,