@privy-io/node 0.4.1 → 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 (77) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/lib/identity-token.d.mts.map +1 -1
  9. package/lib/identity-token.d.ts.map +1 -1
  10. package/lib/identity-token.js +10 -0
  11. package/lib/identity-token.js.map +1 -1
  12. package/lib/identity-token.mjs +10 -0
  13. package/lib/identity-token.mjs.map +1 -1
  14. package/package.json +1 -1
  15. package/public-api/services/ethereum.d.mts +7 -7
  16. package/public-api/services/ethereum.d.mts.map +1 -1
  17. package/public-api/services/ethereum.d.ts +7 -7
  18. package/public-api/services/ethereum.d.ts.map +1 -1
  19. package/public-api/services/ethereum.js.map +1 -1
  20. package/public-api/services/ethereum.mjs.map +1 -1
  21. package/public-api/services/solana.d.mts +4 -4
  22. package/public-api/services/solana.d.mts.map +1 -1
  23. package/public-api/services/solana.d.ts +4 -4
  24. package/public-api/services/solana.d.ts.map +1 -1
  25. package/public-api/services/solana.js.map +1 -1
  26. package/public-api/services/solana.mjs.map +1 -1
  27. package/resources/index.d.mts +1 -1
  28. package/resources/index.d.mts.map +1 -1
  29. package/resources/index.d.ts +1 -1
  30. package/resources/index.d.ts.map +1 -1
  31. package/resources/index.js.map +1 -1
  32. package/resources/index.mjs.map +1 -1
  33. package/resources/policies.d.mts +122 -18
  34. package/resources/policies.d.mts.map +1 -1
  35. package/resources/policies.d.ts +122 -18
  36. package/resources/policies.d.ts.map +1 -1
  37. package/resources/users.d.mts +6 -3
  38. package/resources/users.d.mts.map +1 -1
  39. package/resources/users.d.ts +6 -3
  40. package/resources/users.d.ts.map +1 -1
  41. package/resources/users.js +1 -1
  42. package/resources/users.mjs +1 -1
  43. package/resources/wallets/index.d.mts +1 -1
  44. package/resources/wallets/index.d.mts.map +1 -1
  45. package/resources/wallets/index.d.ts +1 -1
  46. package/resources/wallets/index.d.ts.map +1 -1
  47. package/resources/wallets/index.js.map +1 -1
  48. package/resources/wallets/index.mjs.map +1 -1
  49. package/resources/wallets/transactions.d.mts +2 -2
  50. package/resources/wallets/transactions.d.mts.map +1 -1
  51. package/resources/wallets/transactions.d.ts +2 -2
  52. package/resources/wallets/transactions.d.ts.map +1 -1
  53. package/resources/wallets/transactions.js +1 -1
  54. package/resources/wallets/transactions.mjs +1 -1
  55. package/resources/wallets/wallets.d.mts +531 -208
  56. package/resources/wallets/wallets.d.mts.map +1 -1
  57. package/resources/wallets/wallets.d.ts +531 -208
  58. package/resources/wallets/wallets.d.ts.map +1 -1
  59. package/resources/wallets/wallets.js +2 -2
  60. package/resources/wallets/wallets.js.map +1 -1
  61. package/resources/wallets/wallets.mjs +2 -2
  62. package/resources/wallets/wallets.mjs.map +1 -1
  63. package/src/client.ts +42 -0
  64. package/src/lib/identity-token.ts +11 -0
  65. package/src/public-api/services/ethereum.ts +15 -7
  66. package/src/public-api/services/solana.ts +9 -4
  67. package/src/resources/index.ts +21 -0
  68. package/src/resources/policies.ts +210 -2
  69. package/src/resources/users.ts +6 -16
  70. package/src/resources/wallets/index.ts +21 -0
  71. package/src/resources/wallets/transactions.ts +2 -2
  72. package/src/resources/wallets/wallets.ts +707 -240
  73. package/src/version.ts +1 -1
  74. package/version.d.mts +1 -1
  75. package/version.d.ts +1 -1
  76. package/version.js +1 -1
  77. package/version.mjs +1 -1
@@ -152,8 +152,8 @@ export class Wallets extends APIResource {
152
152
  * @example
153
153
  * ```ts
154
154
  * const response = await client.wallets._rpc('wallet_id', {
155
- * method: 'eth_signTransaction',
156
- * params: { transaction: {} },
155
+ * method: 'personal_sign',
156
+ * params: { encoding: 'utf-8', message: 'message' },
157
157
  * });
158
158
  * ```
159
159
  */
@@ -288,7 +288,7 @@ export type CurveSigningChainType =
288
288
  /**
289
289
  * The wallet chain types that offer first class support.
290
290
  */
291
- export type FirstClassChainType = 'solana' | 'ethereum';
291
+ export type FirstClassChainType = 'ethereum' | 'solana';
292
292
 
293
293
  export interface Wallet {
294
294
  /**
@@ -362,8 +362,8 @@ export namespace Wallet {
362
362
  * The wallet chain types.
363
363
  */
364
364
  export type WalletChainType =
365
- | 'solana'
366
365
  | 'ethereum'
366
+ | 'solana'
367
367
  | 'cosmos'
368
368
  | 'stellar'
369
369
  | 'sui'
@@ -376,233 +376,611 @@ export type WalletChainType =
376
376
  | 'starknet'
377
377
  | 'spark';
378
378
 
379
- export interface WalletExportResponse {
380
- /**
381
- * The encrypted private key.
382
- */
383
- ciphertext: string;
379
+ /**
380
+ * The wallet chain types that are not first class chains.
381
+ */
382
+ export type ExtendedChainType =
383
+ | 'cosmos'
384
+ | 'stellar'
385
+ | 'sui'
386
+ | 'aptos'
387
+ | 'movement'
388
+ | 'tron'
389
+ | 'bitcoin-segwit'
390
+ | 'near'
391
+ | 'ton'
392
+ | 'starknet'
393
+ | 'spark';
384
394
 
385
- /**
386
- * The base64-encoded encapsulated key that was generated during encryption, for
387
- * use during decryption.
388
- */
389
- encapsulated_key: string;
395
+ /**
396
+ * Executes the EVM `personal_sign` RPC (EIP-191) to sign a message.
397
+ */
398
+ export interface EthereumPersonalSignRpcInput {
399
+ method: 'personal_sign';
390
400
 
391
- /**
392
- * The encryption type of the wallet to import. Currently only supports `HPKE`.
393
- */
394
- encryption_type: 'HPKE';
401
+ params: EthereumPersonalSignRpcInput.Params;
402
+
403
+ address?: string;
404
+
405
+ chain_type?: 'ethereum';
395
406
  }
396
407
 
397
- export interface WalletInitImportResponse {
398
- /**
399
- * The base64-encoded encryption public key to encrypt the wallet entropy with.
400
- */
401
- encryption_public_key: string;
408
+ export namespace EthereumPersonalSignRpcInput {
409
+ export interface Params {
410
+ encoding: 'utf-8' | 'hex';
402
411
 
403
- /**
404
- * The encryption type of the wallet to import. Currently only supports `HPKE`.
405
- */
406
- encryption_type: 'HPKE';
412
+ message: string;
413
+ }
407
414
  }
408
415
 
409
- export interface WalletRawSignResponse {
410
- data: WalletRawSignResponse.Data;
416
+ /**
417
+ * Executes the EVM `eth_signTransaction` RPC to sign a transaction.
418
+ */
419
+ export interface EthereumSignTransactionRpcInput {
420
+ method: 'eth_signTransaction';
421
+
422
+ params: EthereumSignTransactionRpcInput.Params;
423
+
424
+ address?: string;
425
+
426
+ chain_type?: 'ethereum';
411
427
  }
412
428
 
413
- export namespace WalletRawSignResponse {
414
- export interface Data {
415
- encoding: 'hex';
429
+ export namespace EthereumSignTransactionRpcInput {
430
+ export interface Params {
431
+ transaction: Params.Transaction;
432
+ }
416
433
 
417
- signature: string;
434
+ export namespace Params {
435
+ export interface Transaction {
436
+ chain_id?: string | number;
437
+
438
+ data?: string;
439
+
440
+ from?: string;
441
+
442
+ gas_limit?: string | number;
443
+
444
+ gas_price?: string | number;
445
+
446
+ max_fee_per_gas?: string | number;
447
+
448
+ max_priority_fee_per_gas?: string | number;
449
+
450
+ nonce?: string | number;
451
+
452
+ to?: string;
453
+
454
+ type?: 0 | 1 | 2;
455
+
456
+ value?: string | number;
457
+ }
418
458
  }
419
459
  }
420
460
 
421
- export type WalletRpcResponse =
422
- | WalletRpcResponse.SolanaSignTransactionRpcResponse
423
- | WalletRpcResponse.SolanaSignAndSendTransactionRpcResponse
424
- | WalletRpcResponse.SolanaSignMessageRpcResponse
425
- | WalletRpcResponse.EthereumSignTransactionRpcResponse
426
- | WalletRpcResponse.EthereumSendTransactionRpcResponse
427
- | WalletRpcResponse.EthereumPersonalSignRpcResponse
428
- | WalletRpcResponse.EthereumSignTypedDataRpcResponse
429
- | WalletRpcResponse.EthereumSign7702AuthorizationRpcResponse
430
- | WalletRpcResponse.EthereumSecp256k1SignRpcResponse;
431
-
432
- export namespace WalletRpcResponse {
433
- export interface SolanaSignTransactionRpcResponse {
434
- data: SolanaSignTransactionRpcResponse.Data;
461
+ /**
462
+ * Executes the EVM `eth_sendTransaction` RPC to sign and broadcast a transaction.
463
+ */
464
+ export interface EthereumSendTransactionRpcInput {
465
+ caip2: string;
435
466
 
436
- method: 'signTransaction';
467
+ method: 'eth_sendTransaction';
468
+
469
+ params: EthereumSendTransactionRpcInput.Params;
470
+
471
+ address?: string;
472
+
473
+ chain_type?: 'ethereum';
474
+
475
+ sponsor?: boolean;
476
+ }
477
+
478
+ export namespace EthereumSendTransactionRpcInput {
479
+ export interface Params {
480
+ transaction: Params.Transaction;
437
481
  }
438
482
 
439
- export namespace SolanaSignTransactionRpcResponse {
440
- export interface Data {
441
- encoding: 'base64';
483
+ export namespace Params {
484
+ export interface Transaction {
485
+ chain_id?: string | number;
486
+
487
+ data?: string;
488
+
489
+ from?: string;
490
+
491
+ gas_limit?: string | number;
492
+
493
+ gas_price?: string | number;
494
+
495
+ max_fee_per_gas?: string | number;
496
+
497
+ max_priority_fee_per_gas?: string | number;
498
+
499
+ nonce?: string | number;
442
500
 
443
- signed_transaction: string;
501
+ to?: string;
502
+
503
+ type?: 0 | 1 | 2;
504
+
505
+ value?: string | number;
444
506
  }
445
507
  }
508
+ }
446
509
 
447
- export interface SolanaSignAndSendTransactionRpcResponse {
448
- data: SolanaSignAndSendTransactionRpcResponse.Data;
510
+ /**
511
+ * Executes the EVM `eth_signTypedData_v4` RPC (EIP-712) to sign a typed data
512
+ * object.
513
+ */
514
+ export interface EthereumSignTypedDataRpcInput {
515
+ method: 'eth_signTypedData_v4';
449
516
 
450
- method: 'signAndSendTransaction';
517
+ params: EthereumSignTypedDataRpcInput.Params;
518
+
519
+ address?: string;
520
+
521
+ chain_type?: 'ethereum';
522
+ }
523
+
524
+ export namespace EthereumSignTypedDataRpcInput {
525
+ export interface Params {
526
+ typed_data: Params.TypedData;
451
527
  }
452
528
 
453
- export namespace SolanaSignAndSendTransactionRpcResponse {
454
- export interface Data {
455
- caip2: string;
529
+ export namespace Params {
530
+ export interface TypedData {
531
+ domain: { [key: string]: unknown };
456
532
 
457
- hash: string;
533
+ message: { [key: string]: unknown };
534
+
535
+ primary_type: string;
536
+
537
+ types: { [key: string]: Array<TypedData.Type> };
538
+ }
458
539
 
459
- transaction_id?: string;
540
+ export namespace TypedData {
541
+ export interface Type {
542
+ name: string;
543
+
544
+ type: string;
545
+ }
460
546
  }
461
547
  }
548
+ }
462
549
 
463
- export interface SolanaSignMessageRpcResponse {
464
- data: SolanaSignMessageRpcResponse.Data;
550
+ /**
551
+ * Executes an RPC method to hash and sign a UserOperation.
552
+ */
553
+ export interface EthereumSignUserOperationRpcInput {
554
+ method: 'eth_signUserOperation';
465
555
 
466
- method: 'signMessage';
556
+ params: EthereumSignUserOperationRpcInput.Params;
557
+
558
+ address?: string;
559
+
560
+ chain_type?: 'ethereum';
561
+ }
562
+
563
+ export namespace EthereumSignUserOperationRpcInput {
564
+ export interface Params {
565
+ chain_id: string | number;
566
+
567
+ contract: string;
568
+
569
+ user_operation: Params.UserOperation;
467
570
  }
468
571
 
469
- export namespace SolanaSignMessageRpcResponse {
470
- export interface Data {
471
- encoding: 'base64';
572
+ export namespace Params {
573
+ export interface UserOperation {
574
+ call_data: string;
575
+
576
+ call_gas_limit: string;
472
577
 
473
- signature: string;
578
+ max_fee_per_gas: string;
579
+
580
+ max_priority_fee_per_gas: string;
581
+
582
+ nonce: string;
583
+
584
+ paymaster: string;
585
+
586
+ paymaster_data: string;
587
+
588
+ paymaster_post_op_gas_limit: string;
589
+
590
+ paymaster_verification_gas_limit: string;
591
+
592
+ pre_verification_gas: string;
593
+
594
+ sender: string;
595
+
596
+ verification_gas_limit: string;
474
597
  }
475
598
  }
599
+ }
476
600
 
477
- export interface EthereumSignTransactionRpcResponse {
478
- data: EthereumSignTransactionRpcResponse.Data;
601
+ /**
602
+ * Signs an EIP-7702 authorization.
603
+ */
604
+ export interface EthereumSign7702AuthorizationRpcInput {
605
+ method: 'eth_sign7702Authorization';
479
606
 
480
- method: 'eth_signTransaction';
607
+ params: EthereumSign7702AuthorizationRpcInput.Params;
608
+
609
+ address?: string;
610
+
611
+ chain_type?: 'ethereum';
612
+ }
613
+
614
+ export namespace EthereumSign7702AuthorizationRpcInput {
615
+ export interface Params {
616
+ chain_id: string | number;
617
+
618
+ contract: string;
619
+
620
+ nonce?: string | number;
481
621
  }
622
+ }
482
623
 
483
- export namespace EthereumSignTransactionRpcResponse {
484
- export interface Data {
485
- encoding: 'rlp';
624
+ /**
625
+ * Signs a raw hash on the secp256k1 curve.
626
+ */
627
+ export interface EthereumSecp256k1SignRpcInput {
628
+ method: 'secp256k1_sign';
486
629
 
487
- signed_transaction: string;
488
- }
630
+ params: EthereumSecp256k1SignRpcInput.Params;
631
+
632
+ address?: string;
633
+
634
+ chain_type?: 'ethereum';
635
+ }
636
+
637
+ export namespace EthereumSecp256k1SignRpcInput {
638
+ export interface Params {
639
+ hash: string;
489
640
  }
641
+ }
490
642
 
491
- export interface EthereumSendTransactionRpcResponse {
492
- data: EthereumSendTransactionRpcResponse.Data;
643
+ /**
644
+ * Executes the SVM `signTransaction` RPC to sign a transaction.
645
+ */
646
+ export interface SolanaSignTransactionRpcInput {
647
+ method: 'signTransaction';
493
648
 
494
- method: 'eth_sendTransaction';
649
+ params: SolanaSignTransactionRpcInput.Params;
650
+
651
+ address?: string;
652
+
653
+ chain_type?: 'solana';
654
+ }
655
+
656
+ export namespace SolanaSignTransactionRpcInput {
657
+ export interface Params {
658
+ encoding: 'base64';
659
+
660
+ transaction: string;
661
+ }
662
+ }
663
+
664
+ /**
665
+ * Executes the SVM `signAndSendTransaction` RPC to sign and broadcast a
666
+ * transaction.
667
+ */
668
+ export interface SolanaSignAndSendTransactionRpcInput {
669
+ caip2: string;
670
+
671
+ method: 'signAndSendTransaction';
672
+
673
+ params: SolanaSignAndSendTransactionRpcInput.Params;
674
+
675
+ address?: string;
676
+
677
+ chain_type?: 'solana';
678
+
679
+ sponsor?: boolean;
680
+ }
681
+
682
+ export namespace SolanaSignAndSendTransactionRpcInput {
683
+ export interface Params {
684
+ encoding: 'base64';
685
+
686
+ transaction: string;
495
687
  }
688
+ }
496
689
 
497
- export namespace EthereumSendTransactionRpcResponse {
498
- export interface Data {
499
- caip2: string;
690
+ /**
691
+ * Executes the SVM `signMessage` RPC to sign a message.
692
+ */
693
+ export interface SolanaSignMessageRpcInput {
694
+ method: 'signMessage';
500
695
 
501
- hash: string;
696
+ params: SolanaSignMessageRpcInput.Params;
502
697
 
503
- transaction_id?: string;
698
+ address?: string;
504
699
 
505
- transaction_request?: Data.TransactionRequest;
506
- }
700
+ chain_type?: 'solana';
701
+ }
507
702
 
508
- export namespace Data {
509
- export interface TransactionRequest {
510
- chain_id?: string | number;
703
+ export namespace SolanaSignMessageRpcInput {
704
+ export interface Params {
705
+ encoding: 'base64';
511
706
 
512
- data?: string;
707
+ message: string;
708
+ }
709
+ }
513
710
 
514
- from?: string;
711
+ /**
712
+ * Response to the EVM `eth_signTransaction` RPC.
713
+ */
714
+ export interface EthereumSignTransactionRpcResponse {
715
+ data: EthereumSignTransactionRpcResponse.Data;
515
716
 
516
- gas_limit?: string | number;
717
+ method: 'eth_signTransaction';
718
+ }
517
719
 
518
- gas_price?: string | number;
720
+ export namespace EthereumSignTransactionRpcResponse {
721
+ export interface Data {
722
+ encoding: 'rlp';
519
723
 
520
- max_fee_per_gas?: string | number;
724
+ signed_transaction: string;
725
+ }
726
+ }
521
727
 
522
- max_priority_fee_per_gas?: string | number;
728
+ /**
729
+ * Response to the EVM `eth_sendTransaction` RPC.
730
+ */
731
+ export interface EthereumSendTransactionRpcResponse {
732
+ data: EthereumSendTransactionRpcResponse.Data;
523
733
 
524
- nonce?: string | number;
734
+ method: 'eth_sendTransaction';
735
+ }
525
736
 
526
- to?: string;
737
+ export namespace EthereumSendTransactionRpcResponse {
738
+ export interface Data {
739
+ caip2: string;
527
740
 
528
- type?: 0 | 1 | 2;
741
+ hash: string;
529
742
 
530
- value?: string | number;
531
- }
743
+ transaction_id?: string;
744
+
745
+ transaction_request?: Data.TransactionRequest;
746
+ }
747
+
748
+ export namespace Data {
749
+ export interface TransactionRequest {
750
+ chain_id?: string | number;
751
+
752
+ data?: string;
753
+
754
+ from?: string;
755
+
756
+ gas_limit?: string | number;
757
+
758
+ gas_price?: string | number;
759
+
760
+ max_fee_per_gas?: string | number;
761
+
762
+ max_priority_fee_per_gas?: string | number;
763
+
764
+ nonce?: string | number;
765
+
766
+ to?: string;
767
+
768
+ type?: 0 | 1 | 2;
769
+
770
+ value?: string | number;
532
771
  }
533
772
  }
773
+ }
534
774
 
535
- export interface EthereumPersonalSignRpcResponse {
536
- data: EthereumPersonalSignRpcResponse.Data;
775
+ /**
776
+ * Response to the EVM `personal_sign` RPC.
777
+ */
778
+ export interface EthereumPersonalSignRpcResponse {
779
+ data: EthereumPersonalSignRpcResponse.Data;
537
780
 
538
- method: 'personal_sign';
781
+ method: 'personal_sign';
782
+ }
783
+
784
+ export namespace EthereumPersonalSignRpcResponse {
785
+ export interface Data {
786
+ encoding: 'hex';
787
+
788
+ signature: string;
539
789
  }
790
+ }
540
791
 
541
- export namespace EthereumPersonalSignRpcResponse {
542
- export interface Data {
543
- encoding: 'hex';
792
+ /**
793
+ * Response to the EVM `eth_signTypedData_v4` RPC.
794
+ */
795
+ export interface EthereumSignTypedDataRpcResponse {
796
+ data: EthereumSignTypedDataRpcResponse.Data;
544
797
 
545
- signature: string;
546
- }
798
+ method: 'eth_signTypedData_v4';
799
+ }
800
+
801
+ export namespace EthereumSignTypedDataRpcResponse {
802
+ export interface Data {
803
+ encoding: 'hex';
804
+
805
+ signature: string;
547
806
  }
807
+ }
808
+
809
+ /**
810
+ * Response to the EVM `eth_signUserOperation` RPC.
811
+ */
812
+ export interface EthereumSignUserOperationRpcResponse {
813
+ data: EthereumSignUserOperationRpcResponse.Data;
548
814
 
549
- export interface EthereumSignTypedDataRpcResponse {
550
- data: EthereumSignTypedDataRpcResponse.Data;
815
+ method: 'eth_signUserOperation';
816
+ }
551
817
 
552
- method: 'eth_signTypedData_v4';
818
+ export namespace EthereumSignUserOperationRpcResponse {
819
+ export interface Data {
820
+ encoding: 'hex';
821
+
822
+ signature: string;
823
+ }
824
+ }
825
+
826
+ /**
827
+ * Response to the EVM `eth_sign7702Authorization` RPC.
828
+ */
829
+ export interface EthereumSign7702AuthorizationRpcResponse {
830
+ data: EthereumSign7702AuthorizationRpcResponse.Data;
831
+
832
+ method: 'eth_sign7702Authorization';
833
+ }
834
+
835
+ export namespace EthereumSign7702AuthorizationRpcResponse {
836
+ export interface Data {
837
+ authorization: Data.Authorization;
553
838
  }
554
839
 
555
- export namespace EthereumSignTypedDataRpcResponse {
556
- export interface Data {
557
- encoding: 'hex';
840
+ export namespace Data {
841
+ export interface Authorization {
842
+ chain_id: string | number;
843
+
844
+ contract: string;
845
+
846
+ nonce: string | number;
847
+
848
+ r: string;
849
+
850
+ s: string;
558
851
 
559
- signature: string;
852
+ y_parity: number;
560
853
  }
561
854
  }
855
+ }
562
856
 
563
- export interface EthereumSign7702AuthorizationRpcResponse {
564
- data: EthereumSign7702AuthorizationRpcResponse.Data;
857
+ /**
858
+ * Response to the EVM `secp256k1_sign` RPC.
859
+ */
860
+ export interface EthereumSecp256k1SignRpcResponse {
861
+ data: EthereumSecp256k1SignRpcResponse.Data;
565
862
 
566
- method: 'eth_sign7702Authorization';
863
+ method: 'secp256k1_sign';
864
+ }
865
+
866
+ export namespace EthereumSecp256k1SignRpcResponse {
867
+ export interface Data {
868
+ encoding: 'hex';
869
+
870
+ signature: string;
871
+ }
872
+ }
873
+
874
+ /**
875
+ * Response to the SVM `signTransaction` RPC.
876
+ */
877
+ export interface SolanaSignTransactionRpcResponse {
878
+ data: SolanaSignTransactionRpcResponse.Data;
879
+
880
+ method: 'signTransaction';
881
+ }
882
+
883
+ export namespace SolanaSignTransactionRpcResponse {
884
+ export interface Data {
885
+ encoding: 'base64';
886
+
887
+ signed_transaction: string;
567
888
  }
889
+ }
568
890
 
569
- export namespace EthereumSign7702AuthorizationRpcResponse {
570
- export interface Data {
571
- authorization: Data.Authorization;
572
- }
891
+ /**
892
+ * Response to the SVM `signAndSendTransaction` RPC.
893
+ */
894
+ export interface SolanaSignAndSendTransactionRpcResponse {
895
+ data: SolanaSignAndSendTransactionRpcResponse.Data;
896
+
897
+ method: 'signAndSendTransaction';
898
+ }
899
+
900
+ export namespace SolanaSignAndSendTransactionRpcResponse {
901
+ export interface Data {
902
+ caip2: string;
903
+
904
+ hash: string;
573
905
 
574
- export namespace Data {
575
- export interface Authorization {
576
- chain_id: string | number;
906
+ transaction_id?: string;
907
+ }
908
+ }
909
+
910
+ /**
911
+ * Response to the SVM `signMessage` RPC.
912
+ */
913
+ export interface SolanaSignMessageRpcResponse {
914
+ data: SolanaSignMessageRpcResponse.Data;
577
915
 
578
- contract: string;
916
+ method: 'signMessage';
917
+ }
579
918
 
580
- nonce: string | number;
919
+ export namespace SolanaSignMessageRpcResponse {
920
+ export interface Data {
921
+ encoding: 'base64';
581
922
 
582
- r: string;
923
+ signature: string;
924
+ }
925
+ }
926
+
927
+ export interface WalletExportResponse {
928
+ /**
929
+ * The encrypted private key.
930
+ */
931
+ ciphertext: string;
932
+
933
+ /**
934
+ * The base64-encoded encapsulated key that was generated during encryption, for
935
+ * use during decryption.
936
+ */
937
+ encapsulated_key: string;
583
938
 
584
- s: string;
939
+ /**
940
+ * The encryption type of the wallet to import. Currently only supports `HPKE`.
941
+ */
942
+ encryption_type: 'HPKE';
943
+ }
585
944
 
586
- y_parity: number;
587
- }
588
- }
589
- }
945
+ export interface WalletInitImportResponse {
946
+ /**
947
+ * The base64-encoded encryption public key to encrypt the wallet entropy with.
948
+ */
949
+ encryption_public_key: string;
590
950
 
591
- export interface EthereumSecp256k1SignRpcResponse {
592
- data: EthereumSecp256k1SignRpcResponse.Data;
951
+ /**
952
+ * The encryption type of the wallet to import. Currently only supports `HPKE`.
953
+ */
954
+ encryption_type: 'HPKE';
955
+ }
593
956
 
594
- method: 'secp256k1_sign';
595
- }
957
+ export interface WalletRawSignResponse {
958
+ data: WalletRawSignResponse.Data;
959
+ }
596
960
 
597
- export namespace EthereumSecp256k1SignRpcResponse {
598
- export interface Data {
599
- encoding: 'hex';
961
+ export namespace WalletRawSignResponse {
962
+ export interface Data {
963
+ encoding: 'hex';
600
964
 
601
- signature: string;
602
- }
965
+ signature: string;
603
966
  }
604
967
  }
605
968
 
969
+ /**
970
+ * Response to the EVM `personal_sign` RPC.
971
+ */
972
+ export type WalletRpcResponse =
973
+ | EthereumPersonalSignRpcResponse
974
+ | EthereumSignTypedDataRpcResponse
975
+ | EthereumSignTransactionRpcResponse
976
+ | EthereumSendTransactionRpcResponse
977
+ | EthereumSignUserOperationRpcResponse
978
+ | EthereumSign7702AuthorizationRpcResponse
979
+ | EthereumSecp256k1SignRpcResponse
980
+ | SolanaSignMessageRpcResponse
981
+ | SolanaSignTransactionRpcResponse
982
+ | SolanaSignAndSendTransactionRpcResponse;
983
+
606
984
  export type WalletAuthenticateWithJwtResponse =
607
985
  | WalletAuthenticateWithJwtResponse.WithEncryption
608
986
  | WalletAuthenticateWithJwtResponse.WithoutEncryption;
@@ -741,20 +1119,10 @@ export namespace WalletCreateParams {
741
1119
  }
742
1120
 
743
1121
  export interface WalletListParams extends CursorParams {
744
- chain_type?:
745
- | 'cosmos'
746
- | 'stellar'
747
- | 'sui'
748
- | 'aptos'
749
- | 'movement'
750
- | 'tron'
751
- | 'bitcoin-segwit'
752
- | 'near'
753
- | 'ton'
754
- | 'starknet'
755
- | 'spark'
756
- | 'solana'
757
- | 'ethereum';
1122
+ /**
1123
+ * The wallet chain types.
1124
+ */
1125
+ chain_type?: WalletChainType;
758
1126
 
759
1127
  user_id?: string;
760
1128
  }
@@ -864,7 +1232,7 @@ export namespace WalletRawSignParams {
864
1232
  }
865
1233
 
866
1234
  /**
867
- * Hash and sign bytes (Tron only)
1235
+ * Hash and sign bytes
868
1236
  */
869
1237
  export interface UnionMember1 {
870
1238
  /**
@@ -873,34 +1241,40 @@ export namespace WalletRawSignParams {
873
1241
  bytes: string;
874
1242
 
875
1243
  /**
876
- * Encoding scheme. Currently only utf-8 is supported.
1244
+ * Encoding scheme for the bytes.
1245
+ */
1246
+ encoding: 'utf-8' | 'hex';
1247
+
1248
+ /**
1249
+ * Hash function to use for the bytes.
877
1250
  */
878
- encoding: 'utf-8';
1251
+ hash_function: 'keccak256' | 'sha256';
879
1252
  }
880
1253
  }
881
1254
 
882
1255
  export type WalletRpcParams =
883
- | WalletRpcParams.EthereumSignTransactionRpcInput
884
- | WalletRpcParams.EthereumSendTransactionRpcInput
885
1256
  | WalletRpcParams.EthereumPersonalSignRpcInput
886
1257
  | WalletRpcParams.EthereumSignTypedDataRpcInput
1258
+ | WalletRpcParams.EthereumSignTransactionRpcInput
1259
+ | WalletRpcParams.EthereumSignUserOperationRpcInput
1260
+ | WalletRpcParams.EthereumSendTransactionRpcInput
887
1261
  | WalletRpcParams.EthereumSign7702AuthorizationRpcInput
888
1262
  | WalletRpcParams.EthereumSecp256k1SignRpcInput
1263
+ | WalletRpcParams.SolanaSignMessageRpcInput
889
1264
  | WalletRpcParams.SolanaSignTransactionRpcInput
890
- | WalletRpcParams.SolanaSignAndSendTransactionRpcInput
891
- | WalletRpcParams.SolanaSignMessageRpcInput;
1265
+ | WalletRpcParams.SolanaSignAndSendTransactionRpcInput;
892
1266
 
893
1267
  export declare namespace WalletRpcParams {
894
- export interface EthereumSignTransactionRpcInput {
1268
+ export interface EthereumPersonalSignRpcInput {
895
1269
  /**
896
1270
  * Body param:
897
1271
  */
898
- method: 'eth_signTransaction';
1272
+ method: 'personal_sign';
899
1273
 
900
1274
  /**
901
1275
  * Body param:
902
1276
  */
903
- params: EthereumSignTransactionRpcInput.Params;
1277
+ params: EthereumPersonalSignRpcInput.Params;
904
1278
 
905
1279
  /**
906
1280
  * Body param:
@@ -925,53 +1299,84 @@ export declare namespace WalletRpcParams {
925
1299
  'privy-idempotency-key'?: string;
926
1300
  }
927
1301
 
928
- export namespace EthereumSignTransactionRpcInput {
1302
+ export namespace EthereumPersonalSignRpcInput {
929
1303
  export interface Params {
930
- transaction: Params.Transaction;
1304
+ encoding: 'utf-8' | 'hex';
1305
+
1306
+ message: string;
931
1307
  }
1308
+ }
932
1309
 
933
- export namespace Params {
934
- export interface Transaction {
935
- chain_id?: string | number;
1310
+ export interface EthereumSignTypedDataRpcInput {
1311
+ /**
1312
+ * Body param:
1313
+ */
1314
+ method: 'eth_signTypedData_v4';
936
1315
 
937
- data?: string;
1316
+ /**
1317
+ * Body param:
1318
+ */
1319
+ params: EthereumSignTypedDataRpcInput.Params;
938
1320
 
939
- from?: string;
1321
+ /**
1322
+ * Body param:
1323
+ */
1324
+ address?: string;
940
1325
 
941
- gas_limit?: string | number;
1326
+ /**
1327
+ * Body param:
1328
+ */
1329
+ chain_type?: 'ethereum';
942
1330
 
943
- gas_price?: string | number;
1331
+ /**
1332
+ * Header param: Request authorization signature. If multiple signatures are
1333
+ * required, they should be comma separated.
1334
+ */
1335
+ 'privy-authorization-signature'?: string;
944
1336
 
945
- max_fee_per_gas?: string | number;
1337
+ /**
1338
+ * Header param: Idempotency keys ensure API requests are executed only once within
1339
+ * a 24-hour window.
1340
+ */
1341
+ 'privy-idempotency-key'?: string;
1342
+ }
946
1343
 
947
- max_priority_fee_per_gas?: string | number;
1344
+ export namespace EthereumSignTypedDataRpcInput {
1345
+ export interface Params {
1346
+ typed_data: Params.TypedData;
1347
+ }
948
1348
 
949
- nonce?: string | number;
1349
+ export namespace Params {
1350
+ export interface TypedData {
1351
+ domain: { [key: string]: unknown };
950
1352
 
951
- to?: string;
1353
+ message: { [key: string]: unknown };
952
1354
 
953
- type?: 0 | 1 | 2;
1355
+ primary_type: string;
954
1356
 
955
- value?: string | number;
1357
+ types: { [key: string]: Array<TypedData.Type> };
1358
+ }
1359
+
1360
+ export namespace TypedData {
1361
+ export interface Type {
1362
+ name: string;
1363
+
1364
+ type: string;
1365
+ }
956
1366
  }
957
1367
  }
958
1368
  }
959
1369
 
960
- export interface EthereumSendTransactionRpcInput {
961
- /**
962
- * Body param:
963
- */
964
- caip2: string;
965
-
1370
+ export interface EthereumSignTransactionRpcInput {
966
1371
  /**
967
1372
  * Body param:
968
1373
  */
969
- method: 'eth_sendTransaction';
1374
+ method: 'eth_signTransaction';
970
1375
 
971
1376
  /**
972
1377
  * Body param:
973
1378
  */
974
- params: EthereumSendTransactionRpcInput.Params;
1379
+ params: EthereumSignTransactionRpcInput.Params;
975
1380
 
976
1381
  /**
977
1382
  * Body param:
@@ -983,11 +1388,6 @@ export declare namespace WalletRpcParams {
983
1388
  */
984
1389
  chain_type?: 'ethereum';
985
1390
 
986
- /**
987
- * Body param:
988
- */
989
- sponsor?: boolean;
990
-
991
1391
  /**
992
1392
  * Header param: Request authorization signature. If multiple signatures are
993
1393
  * required, they should be comma separated.
@@ -1001,7 +1401,7 @@ export declare namespace WalletRpcParams {
1001
1401
  'privy-idempotency-key'?: string;
1002
1402
  }
1003
1403
 
1004
- export namespace EthereumSendTransactionRpcInput {
1404
+ export namespace EthereumSignTransactionRpcInput {
1005
1405
  export interface Params {
1006
1406
  transaction: Params.Transaction;
1007
1407
  }
@@ -1033,16 +1433,16 @@ export declare namespace WalletRpcParams {
1033
1433
  }
1034
1434
  }
1035
1435
 
1036
- export interface EthereumPersonalSignRpcInput {
1436
+ export interface EthereumSignUserOperationRpcInput {
1037
1437
  /**
1038
1438
  * Body param:
1039
1439
  */
1040
- method: 'personal_sign';
1440
+ method: 'eth_signUserOperation';
1041
1441
 
1042
1442
  /**
1043
1443
  * Body param:
1044
1444
  */
1045
- params: EthereumPersonalSignRpcInput.Params;
1445
+ params: EthereumSignUserOperationRpcInput.Params;
1046
1446
 
1047
1447
  /**
1048
1448
  * Body param:
@@ -1067,24 +1467,59 @@ export declare namespace WalletRpcParams {
1067
1467
  'privy-idempotency-key'?: string;
1068
1468
  }
1069
1469
 
1070
- export namespace EthereumPersonalSignRpcInput {
1470
+ export namespace EthereumSignUserOperationRpcInput {
1071
1471
  export interface Params {
1072
- encoding: 'utf-8' | 'hex';
1472
+ chain_id: string | number;
1073
1473
 
1074
- message: string;
1474
+ contract: string;
1475
+
1476
+ user_operation: Params.UserOperation;
1477
+ }
1478
+
1479
+ export namespace Params {
1480
+ export interface UserOperation {
1481
+ call_data: string;
1482
+
1483
+ call_gas_limit: string;
1484
+
1485
+ max_fee_per_gas: string;
1486
+
1487
+ max_priority_fee_per_gas: string;
1488
+
1489
+ nonce: string;
1490
+
1491
+ paymaster: string;
1492
+
1493
+ paymaster_data: string;
1494
+
1495
+ paymaster_post_op_gas_limit: string;
1496
+
1497
+ paymaster_verification_gas_limit: string;
1498
+
1499
+ pre_verification_gas: string;
1500
+
1501
+ sender: string;
1502
+
1503
+ verification_gas_limit: string;
1504
+ }
1075
1505
  }
1076
1506
  }
1077
1507
 
1078
- export interface EthereumSignTypedDataRpcInput {
1508
+ export interface EthereumSendTransactionRpcInput {
1079
1509
  /**
1080
1510
  * Body param:
1081
1511
  */
1082
- method: 'eth_signTypedData_v4';
1512
+ caip2: string;
1083
1513
 
1084
1514
  /**
1085
1515
  * Body param:
1086
1516
  */
1087
- params: EthereumSignTypedDataRpcInput.Params;
1517
+ method: 'eth_sendTransaction';
1518
+
1519
+ /**
1520
+ * Body param:
1521
+ */
1522
+ params: EthereumSendTransactionRpcInput.Params;
1088
1523
 
1089
1524
  /**
1090
1525
  * Body param:
@@ -1096,6 +1531,11 @@ export declare namespace WalletRpcParams {
1096
1531
  */
1097
1532
  chain_type?: 'ethereum';
1098
1533
 
1534
+ /**
1535
+ * Body param:
1536
+ */
1537
+ sponsor?: boolean;
1538
+
1099
1539
  /**
1100
1540
  * Header param: Request authorization signature. If multiple signatures are
1101
1541
  * required, they should be comma separated.
@@ -1109,28 +1549,34 @@ export declare namespace WalletRpcParams {
1109
1549
  'privy-idempotency-key'?: string;
1110
1550
  }
1111
1551
 
1112
- export namespace EthereumSignTypedDataRpcInput {
1552
+ export namespace EthereumSendTransactionRpcInput {
1113
1553
  export interface Params {
1114
- typed_data: Params.TypedData;
1554
+ transaction: Params.Transaction;
1115
1555
  }
1116
1556
 
1117
1557
  export namespace Params {
1118
- export interface TypedData {
1119
- domain: { [key: string]: unknown };
1558
+ export interface Transaction {
1559
+ chain_id?: string | number;
1120
1560
 
1121
- message: { [key: string]: unknown };
1561
+ data?: string;
1122
1562
 
1123
- primary_type: string;
1563
+ from?: string;
1124
1564
 
1125
- types: { [key: string]: Array<TypedData.Type> };
1126
- }
1565
+ gas_limit?: string | number;
1127
1566
 
1128
- export namespace TypedData {
1129
- export interface Type {
1130
- name: string;
1567
+ gas_price?: string | number;
1131
1568
 
1132
- type: string;
1133
- }
1569
+ max_fee_per_gas?: string | number;
1570
+
1571
+ max_priority_fee_per_gas?: string | number;
1572
+
1573
+ nonce?: string | number;
1574
+
1575
+ to?: string;
1576
+
1577
+ type?: 0 | 1 | 2;
1578
+
1579
+ value?: string | number;
1134
1580
  }
1135
1581
  }
1136
1582
  }
@@ -1219,16 +1665,16 @@ export declare namespace WalletRpcParams {
1219
1665
  }
1220
1666
  }
1221
1667
 
1222
- export interface SolanaSignTransactionRpcInput {
1668
+ export interface SolanaSignMessageRpcInput {
1223
1669
  /**
1224
1670
  * Body param:
1225
1671
  */
1226
- method: 'signTransaction';
1672
+ method: 'signMessage';
1227
1673
 
1228
1674
  /**
1229
1675
  * Body param:
1230
1676
  */
1231
- params: SolanaSignTransactionRpcInput.Params;
1677
+ params: SolanaSignMessageRpcInput.Params;
1232
1678
 
1233
1679
  /**
1234
1680
  * Body param:
@@ -1253,29 +1699,24 @@ export declare namespace WalletRpcParams {
1253
1699
  'privy-idempotency-key'?: string;
1254
1700
  }
1255
1701
 
1256
- export namespace SolanaSignTransactionRpcInput {
1702
+ export namespace SolanaSignMessageRpcInput {
1257
1703
  export interface Params {
1258
1704
  encoding: 'base64';
1259
1705
 
1260
- transaction: string;
1706
+ message: string;
1261
1707
  }
1262
1708
  }
1263
1709
 
1264
- export interface SolanaSignAndSendTransactionRpcInput {
1265
- /**
1266
- * Body param:
1267
- */
1268
- caip2: string;
1269
-
1710
+ export interface SolanaSignTransactionRpcInput {
1270
1711
  /**
1271
1712
  * Body param:
1272
1713
  */
1273
- method: 'signAndSendTransaction';
1714
+ method: 'signTransaction';
1274
1715
 
1275
1716
  /**
1276
1717
  * Body param:
1277
1718
  */
1278
- params: SolanaSignAndSendTransactionRpcInput.Params;
1719
+ params: SolanaSignTransactionRpcInput.Params;
1279
1720
 
1280
1721
  /**
1281
1722
  * Body param:
@@ -1287,11 +1728,6 @@ export declare namespace WalletRpcParams {
1287
1728
  */
1288
1729
  chain_type?: 'solana';
1289
1730
 
1290
- /**
1291
- * Body param:
1292
- */
1293
- sponsor?: boolean;
1294
-
1295
1731
  /**
1296
1732
  * Header param: Request authorization signature. If multiple signatures are
1297
1733
  * required, they should be comma separated.
@@ -1305,7 +1741,7 @@ export declare namespace WalletRpcParams {
1305
1741
  'privy-idempotency-key'?: string;
1306
1742
  }
1307
1743
 
1308
- export namespace SolanaSignAndSendTransactionRpcInput {
1744
+ export namespace SolanaSignTransactionRpcInput {
1309
1745
  export interface Params {
1310
1746
  encoding: 'base64';
1311
1747
 
@@ -1313,16 +1749,21 @@ export declare namespace WalletRpcParams {
1313
1749
  }
1314
1750
  }
1315
1751
 
1316
- export interface SolanaSignMessageRpcInput {
1752
+ export interface SolanaSignAndSendTransactionRpcInput {
1317
1753
  /**
1318
1754
  * Body param:
1319
1755
  */
1320
- method: 'signMessage';
1756
+ caip2: string;
1321
1757
 
1322
1758
  /**
1323
1759
  * Body param:
1324
1760
  */
1325
- params: SolanaSignMessageRpcInput.Params;
1761
+ method: 'signAndSendTransaction';
1762
+
1763
+ /**
1764
+ * Body param:
1765
+ */
1766
+ params: SolanaSignAndSendTransactionRpcInput.Params;
1326
1767
 
1327
1768
  /**
1328
1769
  * Body param:
@@ -1334,6 +1775,11 @@ export declare namespace WalletRpcParams {
1334
1775
  */
1335
1776
  chain_type?: 'solana';
1336
1777
 
1778
+ /**
1779
+ * Body param:
1780
+ */
1781
+ sponsor?: boolean;
1782
+
1337
1783
  /**
1338
1784
  * Header param: Request authorization signature. If multiple signatures are
1339
1785
  * required, they should be comma separated.
@@ -1347,11 +1793,11 @@ export declare namespace WalletRpcParams {
1347
1793
  'privy-idempotency-key'?: string;
1348
1794
  }
1349
1795
 
1350
- export namespace SolanaSignMessageRpcInput {
1796
+ export namespace SolanaSignAndSendTransactionRpcInput {
1351
1797
  export interface Params {
1352
1798
  encoding: 'base64';
1353
1799
 
1354
- message: string;
1800
+ transaction: string;
1355
1801
  }
1356
1802
  }
1357
1803
  }
@@ -1598,6 +2044,27 @@ export declare namespace Wallets {
1598
2044
  type FirstClassChainType as FirstClassChainType,
1599
2045
  type Wallet as Wallet,
1600
2046
  type WalletChainType as WalletChainType,
2047
+ type ExtendedChainType as ExtendedChainType,
2048
+ type EthereumPersonalSignRpcInput as EthereumPersonalSignRpcInput,
2049
+ type EthereumSignTransactionRpcInput as EthereumSignTransactionRpcInput,
2050
+ type EthereumSendTransactionRpcInput as EthereumSendTransactionRpcInput,
2051
+ type EthereumSignTypedDataRpcInput as EthereumSignTypedDataRpcInput,
2052
+ type EthereumSignUserOperationRpcInput as EthereumSignUserOperationRpcInput,
2053
+ type EthereumSign7702AuthorizationRpcInput as EthereumSign7702AuthorizationRpcInput,
2054
+ type EthereumSecp256k1SignRpcInput as EthereumSecp256k1SignRpcInput,
2055
+ type SolanaSignTransactionRpcInput as SolanaSignTransactionRpcInput,
2056
+ type SolanaSignAndSendTransactionRpcInput as SolanaSignAndSendTransactionRpcInput,
2057
+ type SolanaSignMessageRpcInput as SolanaSignMessageRpcInput,
2058
+ type EthereumSignTransactionRpcResponse as EthereumSignTransactionRpcResponse,
2059
+ type EthereumSendTransactionRpcResponse as EthereumSendTransactionRpcResponse,
2060
+ type EthereumPersonalSignRpcResponse as EthereumPersonalSignRpcResponse,
2061
+ type EthereumSignTypedDataRpcResponse as EthereumSignTypedDataRpcResponse,
2062
+ type EthereumSignUserOperationRpcResponse as EthereumSignUserOperationRpcResponse,
2063
+ type EthereumSign7702AuthorizationRpcResponse as EthereumSign7702AuthorizationRpcResponse,
2064
+ type EthereumSecp256k1SignRpcResponse as EthereumSecp256k1SignRpcResponse,
2065
+ type SolanaSignTransactionRpcResponse as SolanaSignTransactionRpcResponse,
2066
+ type SolanaSignAndSendTransactionRpcResponse as SolanaSignAndSendTransactionRpcResponse,
2067
+ type SolanaSignMessageRpcResponse as SolanaSignMessageRpcResponse,
1601
2068
  type WalletExportResponse as WalletExportResponse,
1602
2069
  type WalletInitImportResponse as WalletInitImportResponse,
1603
2070
  type WalletRawSignResponse as WalletRawSignResponse,