@privy-io/node 0.8.0 → 0.10.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 (158) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/client.d.mts +23 -10
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +23 -10
  5. package/client.d.ts.map +1 -1
  6. package/client.js +30 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +30 -3
  9. package/client.mjs.map +1 -1
  10. package/index.d.mts +1 -1
  11. package/index.d.mts.map +1 -1
  12. package/index.d.ts +1 -1
  13. package/index.d.ts.map +1 -1
  14. package/internal/parse.d.mts.map +1 -1
  15. package/internal/parse.d.ts.map +1 -1
  16. package/internal/parse.js +5 -0
  17. package/internal/parse.js.map +1 -1
  18. package/internal/parse.mjs +5 -0
  19. package/internal/parse.mjs.map +1 -1
  20. package/package.json +21 -1
  21. package/public-api/services/ethereum.d.mts +4 -1
  22. package/public-api/services/ethereum.d.mts.map +1 -1
  23. package/public-api/services/ethereum.d.ts +4 -1
  24. package/public-api/services/ethereum.d.ts.map +1 -1
  25. package/public-api/services/ethereum.js +8 -0
  26. package/public-api/services/ethereum.js.map +1 -1
  27. package/public-api/services/ethereum.mjs +8 -0
  28. package/public-api/services/ethereum.mjs.map +1 -1
  29. package/public-api/services/webhooks.d.mts +3 -1
  30. package/public-api/services/webhooks.d.mts.map +1 -1
  31. package/public-api/services/webhooks.d.ts +3 -1
  32. package/public-api/services/webhooks.d.ts.map +1 -1
  33. package/public-api/services/webhooks.js +1 -0
  34. package/public-api/services/webhooks.js.map +1 -1
  35. package/public-api/services/webhooks.mjs +1 -0
  36. package/public-api/services/webhooks.mjs.map +1 -1
  37. package/resources/accounts.d.mts +72 -0
  38. package/resources/accounts.d.mts.map +1 -0
  39. package/resources/accounts.d.ts +72 -0
  40. package/resources/accounts.d.ts.map +1 -0
  41. package/resources/accounts.js +9 -0
  42. package/resources/accounts.js.map +1 -0
  43. package/resources/accounts.mjs +5 -0
  44. package/resources/accounts.mjs.map +1 -0
  45. package/resources/aggregations.d.mts +213 -2
  46. package/resources/aggregations.d.mts.map +1 -1
  47. package/resources/aggregations.d.ts +213 -2
  48. package/resources/aggregations.d.ts.map +1 -1
  49. package/resources/client-auth.d.mts +182 -2
  50. package/resources/client-auth.d.mts.map +1 -1
  51. package/resources/client-auth.d.ts +182 -2
  52. package/resources/client-auth.d.ts.map +1 -1
  53. package/resources/index.d.mts +8 -4
  54. package/resources/index.d.mts.map +1 -1
  55. package/resources/index.d.ts +8 -4
  56. package/resources/index.d.ts.map +1 -1
  57. package/resources/index.js +9 -1
  58. package/resources/index.js.map +1 -1
  59. package/resources/index.mjs +4 -0
  60. package/resources/index.mjs.map +1 -1
  61. package/resources/intents.d.mts +104 -0
  62. package/resources/intents.d.mts.map +1 -0
  63. package/resources/intents.d.ts +104 -0
  64. package/resources/intents.d.ts.map +1 -0
  65. package/resources/intents.js +9 -0
  66. package/resources/intents.js.map +1 -0
  67. package/resources/intents.mjs +5 -0
  68. package/resources/intents.mjs.map +1 -0
  69. package/resources/key-quorums.d.mts +14 -0
  70. package/resources/key-quorums.d.mts.map +1 -1
  71. package/resources/key-quorums.d.ts +14 -0
  72. package/resources/key-quorums.d.ts.map +1 -1
  73. package/resources/policies.d.mts +10 -12
  74. package/resources/policies.d.mts.map +1 -1
  75. package/resources/policies.d.ts +10 -12
  76. package/resources/policies.d.ts.map +1 -1
  77. package/resources/users.d.mts +16 -6
  78. package/resources/users.d.mts.map +1 -1
  79. package/resources/users.d.ts +16 -6
  80. package/resources/users.d.ts.map +1 -1
  81. package/resources/wallets/balance.d.mts +10 -5
  82. package/resources/wallets/balance.d.mts.map +1 -1
  83. package/resources/wallets/balance.d.ts +10 -5
  84. package/resources/wallets/balance.d.ts.map +1 -1
  85. package/resources/wallets/balance.js +1 -2
  86. package/resources/wallets/balance.js.map +1 -1
  87. package/resources/wallets/balance.mjs +1 -2
  88. package/resources/wallets/balance.mjs.map +1 -1
  89. package/resources/wallets/index.d.mts +1 -1
  90. package/resources/wallets/index.d.mts.map +1 -1
  91. package/resources/wallets/index.d.ts +1 -1
  92. package/resources/wallets/index.d.ts.map +1 -1
  93. package/resources/wallets/index.js.map +1 -1
  94. package/resources/wallets/index.mjs.map +1 -1
  95. package/resources/wallets/transactions.d.mts +2 -2
  96. package/resources/wallets/transactions.d.mts.map +1 -1
  97. package/resources/wallets/transactions.d.ts +2 -2
  98. package/resources/wallets/transactions.d.ts.map +1 -1
  99. package/resources/wallets/wallets.d.mts +141 -14
  100. package/resources/wallets/wallets.d.mts.map +1 -1
  101. package/resources/wallets/wallets.d.ts +141 -14
  102. package/resources/wallets/wallets.d.ts.map +1 -1
  103. package/resources/wallets/wallets.js.map +1 -1
  104. package/resources/wallets/wallets.mjs.map +1 -1
  105. package/resources/webhooks.d.mts +977 -0
  106. package/resources/webhooks.d.mts.map +1 -0
  107. package/resources/webhooks.d.ts +977 -0
  108. package/resources/webhooks.d.ts.map +1 -0
  109. package/resources/webhooks.js +9 -0
  110. package/resources/webhooks.js.map +1 -0
  111. package/resources/webhooks.mjs +5 -0
  112. package/resources/webhooks.mjs.map +1 -0
  113. package/resources/yield.d.mts +311 -0
  114. package/resources/yield.d.mts.map +1 -0
  115. package/resources/yield.d.ts +311 -0
  116. package/resources/yield.d.ts.map +1 -0
  117. package/resources/yield.js +9 -0
  118. package/resources/yield.js.map +1 -0
  119. package/resources/yield.mjs +5 -0
  120. package/resources/yield.mjs.map +1 -0
  121. package/src/client.ts +229 -9
  122. package/src/index.ts +1 -1
  123. package/src/internal/parse.ts +6 -0
  124. package/src/public-api/services/ethereum.ts +16 -0
  125. package/src/public-api/services/webhooks.ts +49 -2
  126. package/src/resources/accounts.ts +90 -0
  127. package/src/resources/aggregations.ts +361 -5
  128. package/src/resources/client-auth.ts +310 -1
  129. package/src/resources/index.ts +95 -3
  130. package/src/resources/intents.ts +138 -0
  131. package/src/resources/key-quorums.ts +17 -0
  132. package/src/resources/policies.ts +10 -12
  133. package/src/resources/users.ts +52 -35
  134. package/src/resources/wallets/balance.ts +15 -5
  135. package/src/resources/wallets/index.ts +6 -2
  136. package/src/resources/wallets/transactions.ts +2 -2
  137. package/src/resources/wallets/wallets.ts +185 -31
  138. package/src/resources/webhooks.ts +1347 -0
  139. package/src/resources/yield.ts +389 -0
  140. package/src/types/x402.d.ts +18 -0
  141. package/src/version.ts +1 -1
  142. package/src/x402.ts +87 -0
  143. package/version.d.mts +1 -1
  144. package/version.d.mts.map +1 -1
  145. package/version.d.ts +1 -1
  146. package/version.d.ts.map +1 -1
  147. package/version.js +1 -1
  148. package/version.js.map +1 -1
  149. package/version.mjs +1 -1
  150. package/version.mjs.map +1 -1
  151. package/x402.d.mts +54 -0
  152. package/x402.d.mts.map +1 -0
  153. package/x402.d.ts +54 -0
  154. package/x402.d.ts.map +1 -0
  155. package/x402.js +75 -0
  156. package/x402.js.map +1 -0
  157. package/x402.mjs +72 -0
  158. package/x402.mjs.map +1 -0
@@ -270,26 +270,6 @@ export class Wallets extends APIResource {
270
270
 
271
271
  export type WalletsCursor = Cursor<Wallet>;
272
272
 
273
- /**
274
- * The wallet chain types that support curve-based signing.
275
- */
276
- export type CurveSigningChainType =
277
- | 'cosmos'
278
- | 'stellar'
279
- | 'sui'
280
- | 'aptos'
281
- | 'movement'
282
- | 'tron'
283
- | 'bitcoin-segwit'
284
- | 'near'
285
- | 'ton'
286
- | 'starknet';
287
-
288
- /**
289
- * The wallet chain types that offer first class support.
290
- */
291
- export type FirstClassChainType = 'ethereum' | 'solana';
292
-
293
273
  /**
294
274
  * A wallet managed by Privy's wallet infrastructure.
295
275
  */
@@ -362,11 +342,9 @@ export namespace Wallet {
362
342
  }
363
343
 
364
344
  /**
365
- * The wallet chain types.
345
+ * The wallet chain types that support curve-based signing.
366
346
  */
367
- export type WalletChainType =
368
- | 'ethereum'
369
- | 'solana'
347
+ export type CurveSigningChainType =
370
348
  | 'cosmos'
371
349
  | 'stellar'
372
350
  | 'sui'
@@ -376,8 +354,7 @@ export type WalletChainType =
376
354
  | 'bitcoin-segwit'
377
355
  | 'near'
378
356
  | 'ton'
379
- | 'starknet'
380
- | 'spark';
357
+ | 'starknet';
381
358
 
382
359
  /**
383
360
  * The wallet chain types that are not first class chains.
@@ -395,11 +372,42 @@ export type ExtendedChainType =
395
372
  | 'starknet'
396
373
  | 'spark';
397
374
 
375
+ /**
376
+ * The wallet chain types that offer first class support.
377
+ */
378
+ export type FirstClassChainType = 'ethereum' | 'solana';
379
+
380
+ /**
381
+ * The wallet chain types.
382
+ */
383
+ export type WalletChainType =
384
+ | 'ethereum'
385
+ | 'solana'
386
+ | 'cosmos'
387
+ | 'stellar'
388
+ | 'sui'
389
+ | 'aptos'
390
+ | 'movement'
391
+ | 'tron'
392
+ | 'bitcoin-segwit'
393
+ | 'near'
394
+ | 'ton'
395
+ | 'starknet'
396
+ | 'spark';
397
+
398
398
  /**
399
399
  * Information about the custodian managing this wallet.
400
400
  */
401
401
  export interface WalletCustodian {
402
- name: string;
402
+ /**
403
+ * The custodian responsible for the wallet.
404
+ */
405
+ provider: string;
406
+
407
+ /**
408
+ * The resource ID of the beneficiary of the custodial wallet.
409
+ */
410
+ provider_user_id: string;
403
411
  }
404
412
 
405
413
  /**
@@ -518,6 +526,139 @@ export interface HpkeImportConfig {
518
526
  */
519
527
  export type SuiCommandName = 'TransferObjects' | 'SplitCoins' | 'MergeCoins';
520
528
 
529
+ /**
530
+ * Input for a single wallet in a batch creation request.
531
+ */
532
+ export interface WalletBatchItemInput {
533
+ /**
534
+ * The wallet chain types.
535
+ */
536
+ chain_type: WalletChainType;
537
+
538
+ /**
539
+ * Additional signers for the wallet.
540
+ */
541
+ additional_signers?: Array<WalletBatchItemInput.AdditionalSigner>;
542
+
543
+ /**
544
+ * The owner of the resource. If you provide this, do not specify an owner_id as it
545
+ * will be generated automatically. When updating a wallet, you can set the owner
546
+ * to null to remove the owner.
547
+ */
548
+ owner?: WalletBatchItemInput.PublicKeyOwner | WalletBatchItemInput.UserOwner | null;
549
+
550
+ /**
551
+ * The key quorum ID to set as the owner of the resource. If you provide this, do
552
+ * not specify an owner.
553
+ */
554
+ owner_id?: string;
555
+
556
+ /**
557
+ * List of policy IDs for policies that should be enforced on the wallet.
558
+ * Currently, only one policy is supported per wallet.
559
+ */
560
+ policy_ids?: Array<string>;
561
+ }
562
+
563
+ export namespace WalletBatchItemInput {
564
+ export interface AdditionalSigner {
565
+ signer_id: string;
566
+
567
+ /**
568
+ * The array of policy IDs that will be applied to wallet requests. If specified,
569
+ * this will override the base policy IDs set on the wallet.
570
+ */
571
+ override_policy_ids?: Array<string>;
572
+ }
573
+
574
+ /**
575
+ * The P-256 public key of the owner of the resource, in base64-encoded DER format.
576
+ * If you provide this, do not specify an owner_id as it will be generated
577
+ * automatically.
578
+ */
579
+ export interface PublicKeyOwner {
580
+ public_key: string;
581
+ }
582
+
583
+ /**
584
+ * The user ID of the owner of the resource. The user must already exist, and this
585
+ * value must start with "did:privy:". If you provide this, do not specify an
586
+ * owner_id as it will be generated automatically.
587
+ */
588
+ export interface UserOwner {
589
+ user_id: string;
590
+ }
591
+ }
592
+
593
+ /**
594
+ * Request body for batch wallet creation.
595
+ */
596
+ export interface WalletBatchCreateInput {
597
+ /**
598
+ * Array of wallet creation requests. Minimum 1, maximum 100.
599
+ */
600
+ wallets: Array<WalletBatchItemInput>;
601
+ }
602
+
603
+ /**
604
+ * A single result from a batch wallet creation operation.
605
+ */
606
+ export type WalletBatchCreateResult =
607
+ | WalletBatchCreateResult.WalletBatchCreateSuccess
608
+ | WalletBatchCreateResult.WalletBatchCreateFailure;
609
+
610
+ export namespace WalletBatchCreateResult {
611
+ /**
612
+ * A successful wallet creation result within a batch operation.
613
+ */
614
+ export interface WalletBatchCreateSuccess {
615
+ /**
616
+ * The index of the wallet in the original request array.
617
+ */
618
+ index: number;
619
+
620
+ success: true;
621
+
622
+ /**
623
+ * A wallet managed by Privy's wallet infrastructure.
624
+ */
625
+ wallet: WalletsAPI.Wallet;
626
+ }
627
+
628
+ /**
629
+ * A failed wallet creation result within a batch operation.
630
+ */
631
+ export interface WalletBatchCreateFailure {
632
+ /**
633
+ * A PrivyErrorCode string identifying the error type (e.g., "invalid_data",
634
+ * "resource_conflict").
635
+ */
636
+ code: string;
637
+
638
+ /**
639
+ * A human-readable error message with details about what went wrong.
640
+ */
641
+ error: string;
642
+
643
+ /**
644
+ * The index of the wallet in the original request array.
645
+ */
646
+ index: number;
647
+
648
+ success: false;
649
+ }
650
+ }
651
+
652
+ /**
653
+ * Response for a batch wallet creation request.
654
+ */
655
+ export interface WalletBatchCreateResponse {
656
+ /**
657
+ * Array of results for each wallet creation request, in the same order as input.
658
+ */
659
+ results: Array<WalletBatchCreateResult>;
660
+ }
661
+
521
662
  /**
522
663
  * Executes the EVM `personal_sign` RPC (EIP-191) to sign a message.
523
664
  */
@@ -1303,11 +1444,21 @@ export namespace WalletCreateParams {
1303
1444
  }
1304
1445
 
1305
1446
  export interface WalletListParams extends CursorParams {
1447
+ /**
1448
+ * Filter wallets by authorization public key. Returns wallets owned by key quorums
1449
+ * that include the specified P-256 public key (base64-encoded DER format). Cannot
1450
+ * be used together with user_id.
1451
+ */
1452
+ authorization_key?: string;
1453
+
1306
1454
  /**
1307
1455
  * The wallet chain types.
1308
1456
  */
1309
1457
  chain_type?: WalletChainType;
1310
1458
 
1459
+ /**
1460
+ * Filter wallets by user ID. Cannot be used together with authorization_key.
1461
+ */
1311
1462
  user_id?: string;
1312
1463
  }
1313
1464
 
@@ -2148,8 +2299,7 @@ export interface WalletUpdateParams {
2148
2299
  owner?: WalletUpdateParams.PublicKeyOwner | WalletUpdateParams.UserOwner | null;
2149
2300
 
2150
2301
  /**
2151
- * Body param: The key quorum ID to set as the owner of the resource. If you
2152
- * provide this, do not specify an owner.
2302
+ * Body param
2153
2303
  */
2154
2304
  owner_id?: string | null;
2155
2305
 
@@ -2274,11 +2424,11 @@ Wallets.Balance = Balance;
2274
2424
 
2275
2425
  export declare namespace Wallets {
2276
2426
  export {
2427
+ type Wallet as Wallet,
2277
2428
  type CurveSigningChainType as CurveSigningChainType,
2429
+ type ExtendedChainType as ExtendedChainType,
2278
2430
  type FirstClassChainType as FirstClassChainType,
2279
- type Wallet as Wallet,
2280
2431
  type WalletChainType as WalletChainType,
2281
- type ExtendedChainType as ExtendedChainType,
2282
2432
  type WalletCustodian as WalletCustodian,
2283
2433
  type CustodialWalletProvider as CustodialWalletProvider,
2284
2434
  type CustodialWalletChainType as CustodialWalletChainType,
@@ -2286,6 +2436,10 @@ export declare namespace Wallets {
2286
2436
  type CustodialWallet as CustodialWallet,
2287
2437
  type HpkeImportConfig as HpkeImportConfig,
2288
2438
  type SuiCommandName as SuiCommandName,
2439
+ type WalletBatchItemInput as WalletBatchItemInput,
2440
+ type WalletBatchCreateInput as WalletBatchCreateInput,
2441
+ type WalletBatchCreateResult as WalletBatchCreateResult,
2442
+ type WalletBatchCreateResponse as WalletBatchCreateResponse,
2289
2443
  type EthereumPersonalSignRpcInput as EthereumPersonalSignRpcInput,
2290
2444
  type EthereumSignTransactionRpcInput as EthereumSignTransactionRpcInput,
2291
2445
  type EthereumSendTransactionRpcInput as EthereumSendTransactionRpcInput,