@privy-io/api-types 0.1.1 → 0.2.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 (69) hide show
  1. package/CHANGELOG.md +22 -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/package.json +1 -1
  9. package/resources/client-auth.d.mts +1 -1
  10. package/resources/client-auth.d.mts.map +1 -1
  11. package/resources/client-auth.d.ts +1 -1
  12. package/resources/client-auth.d.ts.map +1 -1
  13. package/resources/embedded-wallets.d.mts +2 -2
  14. package/resources/embedded-wallets.d.mts.map +1 -1
  15. package/resources/embedded-wallets.d.ts +2 -2
  16. package/resources/embedded-wallets.d.ts.map +1 -1
  17. package/resources/index.d.mts +1 -1
  18. package/resources/index.d.mts.map +1 -1
  19. package/resources/index.d.ts +1 -1
  20. package/resources/index.d.ts.map +1 -1
  21. package/resources/index.js.map +1 -1
  22. package/resources/index.mjs.map +1 -1
  23. package/resources/key-quorums.d.mts +18 -3
  24. package/resources/key-quorums.d.mts.map +1 -1
  25. package/resources/key-quorums.d.ts +18 -3
  26. package/resources/key-quorums.d.ts.map +1 -1
  27. package/resources/policies.d.mts +6 -4
  28. package/resources/policies.d.mts.map +1 -1
  29. package/resources/policies.d.ts +6 -4
  30. package/resources/policies.d.ts.map +1 -1
  31. package/resources/users.d.mts +3 -3
  32. package/resources/users.d.mts.map +1 -1
  33. package/resources/users.d.ts +3 -3
  34. package/resources/users.d.ts.map +1 -1
  35. package/resources/users.js +1 -1
  36. package/resources/users.mjs +1 -1
  37. package/resources/wallets/index.d.mts +1 -1
  38. package/resources/wallets/index.d.mts.map +1 -1
  39. package/resources/wallets/index.d.ts +1 -1
  40. package/resources/wallets/index.d.ts.map +1 -1
  41. package/resources/wallets/index.js.map +1 -1
  42. package/resources/wallets/index.mjs.map +1 -1
  43. package/resources/wallets/transactions.d.mts +1 -0
  44. package/resources/wallets/transactions.d.mts.map +1 -1
  45. package/resources/wallets/transactions.d.ts +1 -0
  46. package/resources/wallets/transactions.d.ts.map +1 -1
  47. package/resources/wallets/wallets.d.mts +545 -211
  48. package/resources/wallets/wallets.d.mts.map +1 -1
  49. package/resources/wallets/wallets.d.ts +545 -211
  50. package/resources/wallets/wallets.d.ts.map +1 -1
  51. package/resources/wallets/wallets.js +7 -3
  52. package/resources/wallets/wallets.js.map +1 -1
  53. package/resources/wallets/wallets.mjs +7 -3
  54. package/resources/wallets/wallets.mjs.map +1 -1
  55. package/src/client.ts +40 -0
  56. package/src/resources/client-auth.ts +1 -1
  57. package/src/resources/embedded-wallets.ts +2 -2
  58. package/src/resources/index.ts +20 -0
  59. package/src/resources/key-quorums.ts +18 -3
  60. package/src/resources/policies.ts +6 -4
  61. package/src/resources/users.ts +3 -3
  62. package/src/resources/wallets/index.ts +20 -0
  63. package/src/resources/wallets/transactions.ts +2 -0
  64. package/src/resources/wallets/wallets.ts +709 -230
  65. package/src/version.ts +1 -1
  66. package/version.d.mts +1 -1
  67. package/version.d.ts +1 -1
  68. package/version.js +1 -1
  69. package/version.mjs +1 -1
@@ -113,7 +113,11 @@ export class Wallets extends APIResource {
113
113
  * ```ts
114
114
  * const response = await client.wallets._rawSign(
115
115
  * 'wallet_id',
116
- * { params: {} },
116
+ * {
117
+ * params: {
118
+ * hash: '0x0775aeed9c9ce6e0fbc4db25c5e4e6368029651c905c286f813126a09025a21e',
119
+ * },
120
+ * },
117
121
  * );
118
122
  * ```
119
123
  */
@@ -148,8 +152,8 @@ export class Wallets extends APIResource {
148
152
  * @example
149
153
  * ```ts
150
154
  * const response = await client.wallets._rpc('wallet_id', {
151
- * method: 'eth_signTransaction',
152
- * params: { transaction: {} },
155
+ * method: 'personal_sign',
156
+ * params: { encoding: 'utf-8', message: 'message' },
153
157
  * });
154
158
  * ```
155
159
  */
@@ -379,233 +383,595 @@ export interface WalletRevokeResponse {
379
383
  message: string;
380
384
  }
381
385
 
382
- export interface WalletExportResponse {
383
- /**
384
- * The encrypted private key.
385
- */
386
- ciphertext: string;
386
+ /**
387
+ * Executes the EVM `personal_sign` RPC (EIP-191) to sign a message.
388
+ */
389
+ export interface EthereumPersonalSignRpcInput {
390
+ method: 'personal_sign';
387
391
 
388
- /**
389
- * The base64-encoded encapsulated key that was generated during encryption, for
390
- * use during decryption.
391
- */
392
- encapsulated_key: string;
392
+ params: EthereumPersonalSignRpcInput.Params;
393
393
 
394
- /**
395
- * The encryption type of the wallet to import. Currently only supports `HPKE`.
396
- */
397
- encryption_type: 'HPKE';
394
+ address?: string;
395
+
396
+ chain_type?: 'ethereum';
398
397
  }
399
398
 
400
- export interface WalletInitImportResponse {
401
- /**
402
- * The base64-encoded encryption public key to encrypt the wallet entropy with.
403
- */
404
- encryption_public_key: string;
399
+ export namespace EthereumPersonalSignRpcInput {
400
+ export interface Params {
401
+ encoding: 'utf-8' | 'hex';
405
402
 
406
- /**
407
- * The encryption type of the wallet to import. Currently only supports `HPKE`.
408
- */
409
- encryption_type: 'HPKE';
403
+ message: string;
404
+ }
410
405
  }
411
406
 
412
- export interface WalletRawSignResponse {
413
- data: WalletRawSignResponse.Data;
407
+ /**
408
+ * Executes the EVM `eth_signTransaction` RPC to sign a transaction.
409
+ */
410
+ export interface EthereumSignTransactionRpcInput {
411
+ method: 'eth_signTransaction';
412
+
413
+ params: EthereumSignTransactionRpcInput.Params;
414
+
415
+ address?: string;
416
+
417
+ chain_type?: 'ethereum';
414
418
  }
415
419
 
416
- export namespace WalletRawSignResponse {
417
- export interface Data {
418
- encoding: 'hex';
420
+ export namespace EthereumSignTransactionRpcInput {
421
+ export interface Params {
422
+ transaction: Params.Transaction;
423
+ }
419
424
 
420
- signature: string;
425
+ export namespace Params {
426
+ export interface Transaction {
427
+ chain_id?: string | number;
428
+
429
+ data?: string;
430
+
431
+ from?: string;
432
+
433
+ gas_limit?: string | number;
434
+
435
+ gas_price?: string | number;
436
+
437
+ max_fee_per_gas?: string | number;
438
+
439
+ max_priority_fee_per_gas?: string | number;
440
+
441
+ nonce?: string | number;
442
+
443
+ to?: string;
444
+
445
+ type?: 0 | 1 | 2;
446
+
447
+ value?: string | number;
448
+ }
421
449
  }
422
450
  }
423
451
 
424
- export type WalletRpcResponse =
425
- | WalletRpcResponse.SolanaSignTransactionRpcResponse
426
- | WalletRpcResponse.SolanaSignAndSendTransactionRpcResponse
427
- | WalletRpcResponse.SolanaSignMessageRpcResponse
428
- | WalletRpcResponse.EthereumSignTransactionRpcResponse
429
- | WalletRpcResponse.EthereumSendTransactionRpcResponse
430
- | WalletRpcResponse.EthereumPersonalSignRpcResponse
431
- | WalletRpcResponse.EthereumSignTypedDataRpcResponse
432
- | WalletRpcResponse.EthereumSign7702AuthorizationRpcResponse
433
- | WalletRpcResponse.EthereumSecp256k1SignRpcResponse;
434
-
435
- export namespace WalletRpcResponse {
436
- export interface SolanaSignTransactionRpcResponse {
437
- data: SolanaSignTransactionRpcResponse.Data;
452
+ /**
453
+ * Executes the EVM `eth_sendTransaction` RPC to sign and broadcast a transaction.
454
+ */
455
+ export interface EthereumSendTransactionRpcInput {
456
+ caip2: string;
438
457
 
439
- method: 'signTransaction';
458
+ method: 'eth_sendTransaction';
459
+
460
+ params: EthereumSendTransactionRpcInput.Params;
461
+
462
+ address?: string;
463
+
464
+ chain_type?: 'ethereum';
465
+
466
+ sponsor?: boolean;
467
+ }
468
+
469
+ export namespace EthereumSendTransactionRpcInput {
470
+ export interface Params {
471
+ transaction: Params.Transaction;
440
472
  }
441
473
 
442
- export namespace SolanaSignTransactionRpcResponse {
443
- export interface Data {
444
- encoding: 'base64';
474
+ export namespace Params {
475
+ export interface Transaction {
476
+ chain_id?: string | number;
477
+
478
+ data?: string;
479
+
480
+ from?: string;
481
+
482
+ gas_limit?: string | number;
483
+
484
+ gas_price?: string | number;
485
+
486
+ max_fee_per_gas?: string | number;
487
+
488
+ max_priority_fee_per_gas?: string | number;
489
+
490
+ nonce?: string | number;
491
+
492
+ to?: string;
493
+
494
+ type?: 0 | 1 | 2;
445
495
 
446
- signed_transaction: string;
496
+ value?: string | number;
447
497
  }
448
498
  }
499
+ }
449
500
 
450
- export interface SolanaSignAndSendTransactionRpcResponse {
451
- data: SolanaSignAndSendTransactionRpcResponse.Data;
501
+ /**
502
+ * Executes the EVM `eth_signTypedData_v4` RPC (EIP-712) to sign a typed data
503
+ * object.
504
+ */
505
+ export interface EthereumSignTypedDataRpcInput {
506
+ method: 'eth_signTypedData_v4';
452
507
 
453
- method: 'signAndSendTransaction';
508
+ params: EthereumSignTypedDataRpcInput.Params;
509
+
510
+ address?: string;
511
+
512
+ chain_type?: 'ethereum';
513
+ }
514
+
515
+ export namespace EthereumSignTypedDataRpcInput {
516
+ export interface Params {
517
+ typed_data: Params.TypedData;
454
518
  }
455
519
 
456
- export namespace SolanaSignAndSendTransactionRpcResponse {
457
- export interface Data {
458
- caip2: string;
520
+ export namespace Params {
521
+ export interface TypedData {
522
+ domain: { [key: string]: unknown };
459
523
 
460
- hash: string;
524
+ message: { [key: string]: unknown };
461
525
 
462
- transaction_id?: string;
526
+ primary_type: string;
527
+
528
+ types: { [key: string]: Array<TypedData.Type> };
529
+ }
530
+
531
+ export namespace TypedData {
532
+ export interface Type {
533
+ name: string;
534
+
535
+ type: string;
536
+ }
463
537
  }
464
538
  }
539
+ }
465
540
 
466
- export interface SolanaSignMessageRpcResponse {
467
- data: SolanaSignMessageRpcResponse.Data;
541
+ /**
542
+ * Executes an RPC method to hash and sign a UserOperation.
543
+ */
544
+ export interface EthereumSignUserOperationRpcInput {
545
+ method: 'eth_signUserOperation';
468
546
 
469
- method: 'signMessage';
547
+ params: EthereumSignUserOperationRpcInput.Params;
548
+
549
+ address?: string;
550
+
551
+ chain_type?: 'ethereum';
552
+ }
553
+
554
+ export namespace EthereumSignUserOperationRpcInput {
555
+ export interface Params {
556
+ chain_id: string | number;
557
+
558
+ contract: string;
559
+
560
+ user_operation: Params.UserOperation;
470
561
  }
471
562
 
472
- export namespace SolanaSignMessageRpcResponse {
473
- export interface Data {
474
- encoding: 'base64';
563
+ export namespace Params {
564
+ export interface UserOperation {
565
+ call_data: string;
566
+
567
+ call_gas_limit: string;
568
+
569
+ max_fee_per_gas: string;
475
570
 
476
- signature: string;
571
+ max_priority_fee_per_gas: string;
572
+
573
+ nonce: string;
574
+
575
+ paymaster: string;
576
+
577
+ paymaster_data: string;
578
+
579
+ paymaster_post_op_gas_limit: string;
580
+
581
+ paymaster_verification_gas_limit: string;
582
+
583
+ pre_verification_gas: string;
584
+
585
+ sender: string;
586
+
587
+ verification_gas_limit: string;
477
588
  }
478
589
  }
590
+ }
479
591
 
480
- export interface EthereumSignTransactionRpcResponse {
481
- data: EthereumSignTransactionRpcResponse.Data;
592
+ /**
593
+ * Signs an EIP-7702 authorization.
594
+ */
595
+ export interface EthereumSign7702AuthorizationRpcInput {
596
+ method: 'eth_sign7702Authorization';
482
597
 
483
- method: 'eth_signTransaction';
598
+ params: EthereumSign7702AuthorizationRpcInput.Params;
599
+
600
+ address?: string;
601
+
602
+ chain_type?: 'ethereum';
603
+ }
604
+
605
+ export namespace EthereumSign7702AuthorizationRpcInput {
606
+ export interface Params {
607
+ chain_id: string | number;
608
+
609
+ contract: string;
610
+
611
+ nonce?: string | number;
484
612
  }
613
+ }
485
614
 
486
- export namespace EthereumSignTransactionRpcResponse {
487
- export interface Data {
488
- encoding: 'rlp';
615
+ /**
616
+ * Signs a raw hash on the secp256k1 curve.
617
+ */
618
+ export interface EthereumSecp256k1SignRpcInput {
619
+ method: 'secp256k1_sign';
489
620
 
490
- signed_transaction: string;
491
- }
621
+ params: EthereumSecp256k1SignRpcInput.Params;
622
+
623
+ address?: string;
624
+
625
+ chain_type?: 'ethereum';
626
+ }
627
+
628
+ export namespace EthereumSecp256k1SignRpcInput {
629
+ export interface Params {
630
+ hash: string;
492
631
  }
632
+ }
493
633
 
494
- export interface EthereumSendTransactionRpcResponse {
495
- data: EthereumSendTransactionRpcResponse.Data;
634
+ /**
635
+ * Executes the SVM `signTransaction` RPC to sign a transaction.
636
+ */
637
+ export interface SolanaSignTransactionRpcInput {
638
+ method: 'signTransaction';
496
639
 
497
- method: 'eth_sendTransaction';
640
+ params: SolanaSignTransactionRpcInput.Params;
641
+
642
+ address?: string;
643
+
644
+ chain_type?: 'solana';
645
+ }
646
+
647
+ export namespace SolanaSignTransactionRpcInput {
648
+ export interface Params {
649
+ encoding: 'base64';
650
+
651
+ transaction: string;
498
652
  }
653
+ }
499
654
 
500
- export namespace EthereumSendTransactionRpcResponse {
501
- export interface Data {
502
- caip2: string;
655
+ /**
656
+ * Executes the SVM `signAndSendTransaction` RPC to sign and broadcast a
657
+ * transaction.
658
+ */
659
+ export interface SolanaSignAndSendTransactionRpcInput {
660
+ caip2: string;
503
661
 
504
- hash: string;
662
+ method: 'signAndSendTransaction';
505
663
 
506
- transaction_id?: string;
664
+ params: SolanaSignAndSendTransactionRpcInput.Params;
507
665
 
508
- transaction_request?: Data.TransactionRequest;
509
- }
666
+ address?: string;
510
667
 
511
- export namespace Data {
512
- export interface TransactionRequest {
513
- chain_id?: string | number;
668
+ chain_type?: 'solana';
514
669
 
515
- data?: string;
670
+ sponsor?: boolean;
671
+ }
516
672
 
517
- from?: string;
673
+ export namespace SolanaSignAndSendTransactionRpcInput {
674
+ export interface Params {
675
+ encoding: 'base64';
518
676
 
519
- gas_limit?: string | number;
677
+ transaction: string;
678
+ }
679
+ }
520
680
 
521
- gas_price?: string | number;
681
+ /**
682
+ * Executes the SVM `signMessage` RPC to sign a message.
683
+ */
684
+ export interface SolanaSignMessageRpcInput {
685
+ method: 'signMessage';
522
686
 
523
- max_fee_per_gas?: string | number;
687
+ params: SolanaSignMessageRpcInput.Params;
524
688
 
525
- max_priority_fee_per_gas?: string | number;
689
+ address?: string;
526
690
 
527
- nonce?: string | number;
691
+ chain_type?: 'solana';
692
+ }
528
693
 
529
- to?: string;
694
+ export namespace SolanaSignMessageRpcInput {
695
+ export interface Params {
696
+ encoding: 'base64';
530
697
 
531
- type?: 0 | 1 | 2;
698
+ message: string;
699
+ }
700
+ }
532
701
 
533
- value?: string | number;
534
- }
535
- }
702
+ /**
703
+ * Response to the EVM `eth_signTransaction` RPC.
704
+ */
705
+ export interface EthereumSignTransactionRpcResponse {
706
+ data: EthereumSignTransactionRpcResponse.Data;
707
+
708
+ method: 'eth_signTransaction';
709
+ }
710
+
711
+ export namespace EthereumSignTransactionRpcResponse {
712
+ export interface Data {
713
+ encoding: 'rlp';
714
+
715
+ signed_transaction: string;
536
716
  }
717
+ }
537
718
 
538
- export interface EthereumPersonalSignRpcResponse {
539
- data: EthereumPersonalSignRpcResponse.Data;
719
+ /**
720
+ * Response to the EVM `eth_sendTransaction` RPC.
721
+ */
722
+ export interface EthereumSendTransactionRpcResponse {
723
+ data: EthereumSendTransactionRpcResponse.Data;
540
724
 
541
- method: 'personal_sign';
725
+ method: 'eth_sendTransaction';
726
+ }
727
+
728
+ export namespace EthereumSendTransactionRpcResponse {
729
+ export interface Data {
730
+ caip2: string;
731
+
732
+ hash: string;
733
+
734
+ transaction_id?: string;
735
+
736
+ transaction_request?: Data.TransactionRequest;
542
737
  }
543
738
 
544
- export namespace EthereumPersonalSignRpcResponse {
545
- export interface Data {
546
- encoding: 'hex';
739
+ export namespace Data {
740
+ export interface TransactionRequest {
741
+ chain_id?: string | number;
547
742
 
548
- signature: string;
743
+ data?: string;
744
+
745
+ from?: string;
746
+
747
+ gas_limit?: string | number;
748
+
749
+ gas_price?: string | number;
750
+
751
+ max_fee_per_gas?: string | number;
752
+
753
+ max_priority_fee_per_gas?: string | number;
754
+
755
+ nonce?: string | number;
756
+
757
+ to?: string;
758
+
759
+ type?: 0 | 1 | 2;
760
+
761
+ value?: string | number;
549
762
  }
550
763
  }
764
+ }
551
765
 
552
- export interface EthereumSignTypedDataRpcResponse {
553
- data: EthereumSignTypedDataRpcResponse.Data;
766
+ /**
767
+ * Response to the EVM `personal_sign` RPC.
768
+ */
769
+ export interface EthereumPersonalSignRpcResponse {
770
+ data: EthereumPersonalSignRpcResponse.Data;
554
771
 
555
- method: 'eth_signTypedData_v4';
772
+ method: 'personal_sign';
773
+ }
774
+
775
+ export namespace EthereumPersonalSignRpcResponse {
776
+ export interface Data {
777
+ encoding: 'hex';
778
+
779
+ signature: string;
556
780
  }
781
+ }
557
782
 
558
- export namespace EthereumSignTypedDataRpcResponse {
559
- export interface Data {
560
- encoding: 'hex';
783
+ /**
784
+ * Response to the EVM `eth_signTypedData_v4` RPC.
785
+ */
786
+ export interface EthereumSignTypedDataRpcResponse {
787
+ data: EthereumSignTypedDataRpcResponse.Data;
561
788
 
562
- signature: string;
563
- }
789
+ method: 'eth_signTypedData_v4';
790
+ }
791
+
792
+ export namespace EthereumSignTypedDataRpcResponse {
793
+ export interface Data {
794
+ encoding: 'hex';
795
+
796
+ signature: string;
564
797
  }
798
+ }
565
799
 
566
- export interface EthereumSign7702AuthorizationRpcResponse {
567
- data: EthereumSign7702AuthorizationRpcResponse.Data;
800
+ /**
801
+ * Response to the EVM `eth_signUserOperation` RPC.
802
+ */
803
+ export interface EthereumSignUserOperationRpcResponse {
804
+ data: EthereumSignUserOperationRpcResponse.Data;
568
805
 
569
- method: 'eth_sign7702Authorization';
806
+ method: 'eth_signUserOperation';
807
+ }
808
+
809
+ export namespace EthereumSignUserOperationRpcResponse {
810
+ export interface Data {
811
+ encoding: 'hex';
812
+
813
+ signature: string;
570
814
  }
815
+ }
816
+
817
+ /**
818
+ * Response to the EVM `eth_sign7702Authorization` RPC.
819
+ */
820
+ export interface EthereumSign7702AuthorizationRpcResponse {
821
+ data: EthereumSign7702AuthorizationRpcResponse.Data;
822
+
823
+ method: 'eth_sign7702Authorization';
824
+ }
571
825
 
572
- export namespace EthereumSign7702AuthorizationRpcResponse {
573
- export interface Data {
574
- authorization: Data.Authorization;
826
+ export namespace EthereumSign7702AuthorizationRpcResponse {
827
+ export interface Data {
828
+ authorization: Data.Authorization;
829
+ }
830
+
831
+ export namespace Data {
832
+ export interface Authorization {
833
+ chain_id: string | number;
834
+
835
+ contract: string;
836
+
837
+ nonce: string | number;
838
+
839
+ r: string;
840
+
841
+ s: string;
842
+
843
+ y_parity: number;
575
844
  }
845
+ }
846
+ }
576
847
 
577
- export namespace Data {
578
- export interface Authorization {
579
- chain_id: string | number;
848
+ /**
849
+ * Response to the EVM `secp256k1_sign` RPC.
850
+ */
851
+ export interface EthereumSecp256k1SignRpcResponse {
852
+ data: EthereumSecp256k1SignRpcResponse.Data;
853
+
854
+ method: 'secp256k1_sign';
855
+ }
580
856
 
581
- contract: string;
857
+ export namespace EthereumSecp256k1SignRpcResponse {
858
+ export interface Data {
859
+ encoding: 'hex';
582
860
 
583
- nonce: string | number;
861
+ signature: string;
862
+ }
863
+ }
584
864
 
585
- r: string;
865
+ /**
866
+ * Response to the SVM `signTransaction` RPC.
867
+ */
868
+ export interface SolanaSignTransactionRpcResponse {
869
+ data: SolanaSignTransactionRpcResponse.Data;
870
+
871
+ method: 'signTransaction';
872
+ }
873
+
874
+ export namespace SolanaSignTransactionRpcResponse {
875
+ export interface Data {
876
+ encoding: 'base64';
877
+
878
+ signed_transaction: string;
879
+ }
880
+ }
586
881
 
587
- s: string;
882
+ /**
883
+ * Response to the SVM `signAndSendTransaction` RPC.
884
+ */
885
+ export interface SolanaSignAndSendTransactionRpcResponse {
886
+ data: SolanaSignAndSendTransactionRpcResponse.Data;
887
+
888
+ method: 'signAndSendTransaction';
889
+ }
890
+
891
+ export namespace SolanaSignAndSendTransactionRpcResponse {
892
+ export interface Data {
893
+ caip2: string;
894
+
895
+ hash: string;
896
+
897
+ transaction_id?: string;
898
+ }
899
+ }
900
+
901
+ /**
902
+ * Response to the SVM `signMessage` RPC.
903
+ */
904
+ export interface SolanaSignMessageRpcResponse {
905
+ data: SolanaSignMessageRpcResponse.Data;
906
+
907
+ method: 'signMessage';
908
+ }
909
+
910
+ export namespace SolanaSignMessageRpcResponse {
911
+ export interface Data {
912
+ encoding: 'base64';
913
+
914
+ signature: string;
915
+ }
916
+ }
917
+
918
+ export interface WalletExportResponse {
919
+ /**
920
+ * The encrypted private key.
921
+ */
922
+ ciphertext: string;
923
+
924
+ /**
925
+ * The base64-encoded encapsulated key that was generated during encryption, for
926
+ * use during decryption.
927
+ */
928
+ encapsulated_key: string;
929
+
930
+ /**
931
+ * The encryption type of the wallet to import. Currently only supports `HPKE`.
932
+ */
933
+ encryption_type: 'HPKE';
934
+ }
588
935
 
589
- y_parity: number;
590
- }
591
- }
592
- }
936
+ export interface WalletInitImportResponse {
937
+ /**
938
+ * The base64-encoded encryption public key to encrypt the wallet entropy with.
939
+ */
940
+ encryption_public_key: string;
593
941
 
594
- export interface EthereumSecp256k1SignRpcResponse {
595
- data: EthereumSecp256k1SignRpcResponse.Data;
942
+ /**
943
+ * The encryption type of the wallet to import. Currently only supports `HPKE`.
944
+ */
945
+ encryption_type: 'HPKE';
946
+ }
596
947
 
597
- method: 'secp256k1_sign';
598
- }
948
+ export interface WalletRawSignResponse {
949
+ data: WalletRawSignResponse.Data;
950
+ }
599
951
 
600
- export namespace EthereumSecp256k1SignRpcResponse {
601
- export interface Data {
602
- encoding: 'hex';
952
+ export namespace WalletRawSignResponse {
953
+ export interface Data {
954
+ encoding: 'hex';
603
955
 
604
- signature: string;
605
- }
956
+ signature: string;
606
957
  }
607
958
  }
608
959
 
960
+ /**
961
+ * Response to the EVM `personal_sign` RPC.
962
+ */
963
+ export type WalletRpcResponse =
964
+ | EthereumPersonalSignRpcResponse
965
+ | EthereumSignTypedDataRpcResponse
966
+ | EthereumSignTransactionRpcResponse
967
+ | EthereumSendTransactionRpcResponse
968
+ | EthereumSignUserOperationRpcResponse
969
+ | EthereumSign7702AuthorizationRpcResponse
970
+ | EthereumSecp256k1SignRpcResponse
971
+ | SolanaSignMessageRpcResponse
972
+ | SolanaSignTransactionRpcResponse
973
+ | SolanaSignAndSendTransactionRpcResponse;
974
+
609
975
  export type WalletAuthenticateWithJwtResponse =
610
976
  | WalletAuthenticateWithJwtResponse.WithEncryption
611
977
  | WalletAuthenticateWithJwtResponse.WithoutEncryption;
@@ -725,8 +1091,9 @@ export namespace WalletCreateParams {
725
1091
  }
726
1092
 
727
1093
  /**
728
- * The P-256 public key of the owner of the resource. If you provide this, do not
729
- * specify an owner_id as it will be generated automatically.
1094
+ * The P-256 public key of the owner of the resource, in base64-encoded DER format.
1095
+ * If you provide this, do not specify an owner_id as it will be generated
1096
+ * automatically.
730
1097
  */
731
1098
  export interface PublicKeyOwner {
732
1099
  public_key: string;
@@ -837,9 +1204,9 @@ export declare namespace WalletInitImportParams {
837
1204
 
838
1205
  export interface WalletRawSignParams {
839
1206
  /**
840
- * Body param:
1207
+ * Body param: Sign a pre-computed hash
841
1208
  */
842
- params: WalletRawSignParams.Params;
1209
+ params: WalletRawSignParams.Hash | WalletRawSignParams.Bytes;
843
1210
 
844
1211
  /**
845
1212
  * Header param: Request authorization signature. If multiple signatures are
@@ -855,36 +1222,55 @@ export interface WalletRawSignParams {
855
1222
  }
856
1223
 
857
1224
  export namespace WalletRawSignParams {
858
- export interface Params {
1225
+ /**
1226
+ * Sign a pre-computed hash
1227
+ */
1228
+ export interface Hash {
859
1229
  /**
860
1230
  * The hash to sign. Must start with `0x`.
861
1231
  */
862
- hash?: string;
1232
+ hash: string;
1233
+ }
1234
+
1235
+ /**
1236
+ * Hash and sign bytes (Tron only)
1237
+ */
1238
+ export interface Bytes {
1239
+ /**
1240
+ * The bytes to hash and sign.
1241
+ */
1242
+ bytes: string;
1243
+
1244
+ /**
1245
+ * Encoding scheme. Currently only utf-8 is supported.
1246
+ */
1247
+ encoding: 'utf-8';
863
1248
  }
864
1249
  }
865
1250
 
866
1251
  export type WalletRpcParams =
867
- | WalletRpcParams.EthereumSignTransactionRpcInput
868
- | WalletRpcParams.EthereumSendTransactionRpcInput
869
1252
  | WalletRpcParams.EthereumPersonalSignRpcInput
870
1253
  | WalletRpcParams.EthereumSignTypedDataRpcInput
1254
+ | WalletRpcParams.EthereumSignTransactionRpcInput
1255
+ | WalletRpcParams.EthereumSignUserOperationRpcInput
1256
+ | WalletRpcParams.EthereumSendTransactionRpcInput
871
1257
  | WalletRpcParams.EthereumSign7702AuthorizationRpcInput
872
1258
  | WalletRpcParams.EthereumSecp256k1SignRpcInput
1259
+ | WalletRpcParams.SolanaSignMessageRpcInput
873
1260
  | WalletRpcParams.SolanaSignTransactionRpcInput
874
- | WalletRpcParams.SolanaSignAndSendTransactionRpcInput
875
- | WalletRpcParams.SolanaSignMessageRpcInput;
1261
+ | WalletRpcParams.SolanaSignAndSendTransactionRpcInput;
876
1262
 
877
1263
  export declare namespace WalletRpcParams {
878
- export interface EthereumSignTransactionRpcInput {
1264
+ export interface EthereumPersonalSignRpcInput {
879
1265
  /**
880
1266
  * Body param:
881
1267
  */
882
- method: 'eth_signTransaction';
1268
+ method: 'personal_sign';
883
1269
 
884
1270
  /**
885
1271
  * Body param:
886
1272
  */
887
- params: EthereumSignTransactionRpcInput.Params;
1273
+ params: EthereumPersonalSignRpcInput.Params;
888
1274
 
889
1275
  /**
890
1276
  * Body param:
@@ -909,53 +1295,84 @@ export declare namespace WalletRpcParams {
909
1295
  'privy-idempotency-key'?: string;
910
1296
  }
911
1297
 
912
- export namespace EthereumSignTransactionRpcInput {
1298
+ export namespace EthereumPersonalSignRpcInput {
913
1299
  export interface Params {
914
- transaction: Params.Transaction;
1300
+ encoding: 'utf-8' | 'hex';
1301
+
1302
+ message: string;
915
1303
  }
1304
+ }
916
1305
 
917
- export namespace Params {
918
- export interface Transaction {
919
- chain_id?: string | number;
1306
+ export interface EthereumSignTypedDataRpcInput {
1307
+ /**
1308
+ * Body param:
1309
+ */
1310
+ method: 'eth_signTypedData_v4';
920
1311
 
921
- data?: string;
1312
+ /**
1313
+ * Body param:
1314
+ */
1315
+ params: EthereumSignTypedDataRpcInput.Params;
922
1316
 
923
- from?: string;
1317
+ /**
1318
+ * Body param:
1319
+ */
1320
+ address?: string;
924
1321
 
925
- gas_limit?: string | number;
1322
+ /**
1323
+ * Body param:
1324
+ */
1325
+ chain_type?: 'ethereum';
926
1326
 
927
- gas_price?: string | number;
1327
+ /**
1328
+ * Header param: Request authorization signature. If multiple signatures are
1329
+ * required, they should be comma separated.
1330
+ */
1331
+ 'privy-authorization-signature'?: string;
928
1332
 
929
- max_fee_per_gas?: string | number;
1333
+ /**
1334
+ * Header param: Idempotency keys ensure API requests are executed only once within
1335
+ * a 24-hour window.
1336
+ */
1337
+ 'privy-idempotency-key'?: string;
1338
+ }
930
1339
 
931
- max_priority_fee_per_gas?: string | number;
1340
+ export namespace EthereumSignTypedDataRpcInput {
1341
+ export interface Params {
1342
+ typed_data: Params.TypedData;
1343
+ }
932
1344
 
933
- nonce?: string | number;
1345
+ export namespace Params {
1346
+ export interface TypedData {
1347
+ domain: { [key: string]: unknown };
934
1348
 
935
- to?: string;
1349
+ message: { [key: string]: unknown };
936
1350
 
937
- type?: 0 | 1 | 2;
1351
+ primary_type: string;
938
1352
 
939
- value?: string | number;
1353
+ types: { [key: string]: Array<TypedData.Type> };
1354
+ }
1355
+
1356
+ export namespace TypedData {
1357
+ export interface Type {
1358
+ name: string;
1359
+
1360
+ type: string;
1361
+ }
940
1362
  }
941
1363
  }
942
1364
  }
943
1365
 
944
- export interface EthereumSendTransactionRpcInput {
945
- /**
946
- * Body param:
947
- */
948
- caip2: string;
949
-
1366
+ export interface EthereumSignTransactionRpcInput {
950
1367
  /**
951
1368
  * Body param:
952
1369
  */
953
- method: 'eth_sendTransaction';
1370
+ method: 'eth_signTransaction';
954
1371
 
955
1372
  /**
956
1373
  * Body param:
957
1374
  */
958
- params: EthereumSendTransactionRpcInput.Params;
1375
+ params: EthereumSignTransactionRpcInput.Params;
959
1376
 
960
1377
  /**
961
1378
  * Body param:
@@ -967,11 +1384,6 @@ export declare namespace WalletRpcParams {
967
1384
  */
968
1385
  chain_type?: 'ethereum';
969
1386
 
970
- /**
971
- * Body param:
972
- */
973
- sponsor?: boolean;
974
-
975
1387
  /**
976
1388
  * Header param: Request authorization signature. If multiple signatures are
977
1389
  * required, they should be comma separated.
@@ -985,7 +1397,7 @@ export declare namespace WalletRpcParams {
985
1397
  'privy-idempotency-key'?: string;
986
1398
  }
987
1399
 
988
- export namespace EthereumSendTransactionRpcInput {
1400
+ export namespace EthereumSignTransactionRpcInput {
989
1401
  export interface Params {
990
1402
  transaction: Params.Transaction;
991
1403
  }
@@ -1017,16 +1429,16 @@ export declare namespace WalletRpcParams {
1017
1429
  }
1018
1430
  }
1019
1431
 
1020
- export interface EthereumPersonalSignRpcInput {
1432
+ export interface EthereumSignUserOperationRpcInput {
1021
1433
  /**
1022
1434
  * Body param:
1023
1435
  */
1024
- method: 'personal_sign';
1436
+ method: 'eth_signUserOperation';
1025
1437
 
1026
1438
  /**
1027
1439
  * Body param:
1028
1440
  */
1029
- params: EthereumPersonalSignRpcInput.Params;
1441
+ params: EthereumSignUserOperationRpcInput.Params;
1030
1442
 
1031
1443
  /**
1032
1444
  * Body param:
@@ -1051,24 +1463,59 @@ export declare namespace WalletRpcParams {
1051
1463
  'privy-idempotency-key'?: string;
1052
1464
  }
1053
1465
 
1054
- export namespace EthereumPersonalSignRpcInput {
1466
+ export namespace EthereumSignUserOperationRpcInput {
1055
1467
  export interface Params {
1056
- encoding: 'utf-8' | 'hex';
1468
+ chain_id: string | number;
1057
1469
 
1058
- message: string;
1470
+ contract: string;
1471
+
1472
+ user_operation: Params.UserOperation;
1473
+ }
1474
+
1475
+ export namespace Params {
1476
+ export interface UserOperation {
1477
+ call_data: string;
1478
+
1479
+ call_gas_limit: string;
1480
+
1481
+ max_fee_per_gas: string;
1482
+
1483
+ max_priority_fee_per_gas: string;
1484
+
1485
+ nonce: string;
1486
+
1487
+ paymaster: string;
1488
+
1489
+ paymaster_data: string;
1490
+
1491
+ paymaster_post_op_gas_limit: string;
1492
+
1493
+ paymaster_verification_gas_limit: string;
1494
+
1495
+ pre_verification_gas: string;
1496
+
1497
+ sender: string;
1498
+
1499
+ verification_gas_limit: string;
1500
+ }
1059
1501
  }
1060
1502
  }
1061
1503
 
1062
- export interface EthereumSignTypedDataRpcInput {
1504
+ export interface EthereumSendTransactionRpcInput {
1063
1505
  /**
1064
1506
  * Body param:
1065
1507
  */
1066
- method: 'eth_signTypedData_v4';
1508
+ caip2: string;
1067
1509
 
1068
1510
  /**
1069
1511
  * Body param:
1070
1512
  */
1071
- params: EthereumSignTypedDataRpcInput.Params;
1513
+ method: 'eth_sendTransaction';
1514
+
1515
+ /**
1516
+ * Body param:
1517
+ */
1518
+ params: EthereumSendTransactionRpcInput.Params;
1072
1519
 
1073
1520
  /**
1074
1521
  * Body param:
@@ -1080,6 +1527,11 @@ export declare namespace WalletRpcParams {
1080
1527
  */
1081
1528
  chain_type?: 'ethereum';
1082
1529
 
1530
+ /**
1531
+ * Body param:
1532
+ */
1533
+ sponsor?: boolean;
1534
+
1083
1535
  /**
1084
1536
  * Header param: Request authorization signature. If multiple signatures are
1085
1537
  * required, they should be comma separated.
@@ -1093,28 +1545,34 @@ export declare namespace WalletRpcParams {
1093
1545
  'privy-idempotency-key'?: string;
1094
1546
  }
1095
1547
 
1096
- export namespace EthereumSignTypedDataRpcInput {
1548
+ export namespace EthereumSendTransactionRpcInput {
1097
1549
  export interface Params {
1098
- typed_data: Params.TypedData;
1550
+ transaction: Params.Transaction;
1099
1551
  }
1100
1552
 
1101
1553
  export namespace Params {
1102
- export interface TypedData {
1103
- domain: { [key: string]: unknown };
1554
+ export interface Transaction {
1555
+ chain_id?: string | number;
1104
1556
 
1105
- message: { [key: string]: unknown };
1557
+ data?: string;
1106
1558
 
1107
- primary_type: string;
1559
+ from?: string;
1108
1560
 
1109
- types: { [key: string]: Array<TypedData.Type> };
1110
- }
1561
+ gas_limit?: string | number;
1111
1562
 
1112
- export namespace TypedData {
1113
- export interface Type {
1114
- name: string;
1563
+ gas_price?: string | number;
1115
1564
 
1116
- type: string;
1117
- }
1565
+ max_fee_per_gas?: string | number;
1566
+
1567
+ max_priority_fee_per_gas?: string | number;
1568
+
1569
+ nonce?: string | number;
1570
+
1571
+ to?: string;
1572
+
1573
+ type?: 0 | 1 | 2;
1574
+
1575
+ value?: string | number;
1118
1576
  }
1119
1577
  }
1120
1578
  }
@@ -1203,16 +1661,16 @@ export declare namespace WalletRpcParams {
1203
1661
  }
1204
1662
  }
1205
1663
 
1206
- export interface SolanaSignTransactionRpcInput {
1664
+ export interface SolanaSignMessageRpcInput {
1207
1665
  /**
1208
1666
  * Body param:
1209
1667
  */
1210
- method: 'signTransaction';
1668
+ method: 'signMessage';
1211
1669
 
1212
1670
  /**
1213
1671
  * Body param:
1214
1672
  */
1215
- params: SolanaSignTransactionRpcInput.Params;
1673
+ params: SolanaSignMessageRpcInput.Params;
1216
1674
 
1217
1675
  /**
1218
1676
  * Body param:
@@ -1237,29 +1695,24 @@ export declare namespace WalletRpcParams {
1237
1695
  'privy-idempotency-key'?: string;
1238
1696
  }
1239
1697
 
1240
- export namespace SolanaSignTransactionRpcInput {
1698
+ export namespace SolanaSignMessageRpcInput {
1241
1699
  export interface Params {
1242
1700
  encoding: 'base64';
1243
1701
 
1244
- transaction: string;
1702
+ message: string;
1245
1703
  }
1246
1704
  }
1247
1705
 
1248
- export interface SolanaSignAndSendTransactionRpcInput {
1249
- /**
1250
- * Body param:
1251
- */
1252
- caip2: string;
1253
-
1706
+ export interface SolanaSignTransactionRpcInput {
1254
1707
  /**
1255
1708
  * Body param:
1256
1709
  */
1257
- method: 'signAndSendTransaction';
1710
+ method: 'signTransaction';
1258
1711
 
1259
1712
  /**
1260
1713
  * Body param:
1261
1714
  */
1262
- params: SolanaSignAndSendTransactionRpcInput.Params;
1715
+ params: SolanaSignTransactionRpcInput.Params;
1263
1716
 
1264
1717
  /**
1265
1718
  * Body param:
@@ -1271,11 +1724,6 @@ export declare namespace WalletRpcParams {
1271
1724
  */
1272
1725
  chain_type?: 'solana';
1273
1726
 
1274
- /**
1275
- * Body param:
1276
- */
1277
- sponsor?: boolean;
1278
-
1279
1727
  /**
1280
1728
  * Header param: Request authorization signature. If multiple signatures are
1281
1729
  * required, they should be comma separated.
@@ -1289,7 +1737,7 @@ export declare namespace WalletRpcParams {
1289
1737
  'privy-idempotency-key'?: string;
1290
1738
  }
1291
1739
 
1292
- export namespace SolanaSignAndSendTransactionRpcInput {
1740
+ export namespace SolanaSignTransactionRpcInput {
1293
1741
  export interface Params {
1294
1742
  encoding: 'base64';
1295
1743
 
@@ -1297,16 +1745,21 @@ export declare namespace WalletRpcParams {
1297
1745
  }
1298
1746
  }
1299
1747
 
1300
- export interface SolanaSignMessageRpcInput {
1748
+ export interface SolanaSignAndSendTransactionRpcInput {
1301
1749
  /**
1302
1750
  * Body param:
1303
1751
  */
1304
- method: 'signMessage';
1752
+ caip2: string;
1305
1753
 
1306
1754
  /**
1307
1755
  * Body param:
1308
1756
  */
1309
- params: SolanaSignMessageRpcInput.Params;
1757
+ method: 'signAndSendTransaction';
1758
+
1759
+ /**
1760
+ * Body param:
1761
+ */
1762
+ params: SolanaSignAndSendTransactionRpcInput.Params;
1310
1763
 
1311
1764
  /**
1312
1765
  * Body param:
@@ -1318,6 +1771,11 @@ export declare namespace WalletRpcParams {
1318
1771
  */
1319
1772
  chain_type?: 'solana';
1320
1773
 
1774
+ /**
1775
+ * Body param:
1776
+ */
1777
+ sponsor?: boolean;
1778
+
1321
1779
  /**
1322
1780
  * Header param: Request authorization signature. If multiple signatures are
1323
1781
  * required, they should be comma separated.
@@ -1331,11 +1789,11 @@ export declare namespace WalletRpcParams {
1331
1789
  'privy-idempotency-key'?: string;
1332
1790
  }
1333
1791
 
1334
- export namespace SolanaSignMessageRpcInput {
1792
+ export namespace SolanaSignAndSendTransactionRpcInput {
1335
1793
  export interface Params {
1336
1794
  encoding: 'base64';
1337
1795
 
1338
- message: string;
1796
+ transaction: string;
1339
1797
  }
1340
1798
  }
1341
1799
  }
@@ -1482,8 +1940,9 @@ export namespace WalletUpdateParams {
1482
1940
  }
1483
1941
 
1484
1942
  /**
1485
- * The P-256 public key of the owner of the resource. If you provide this, do not
1486
- * specify an owner_id as it will be generated automatically.
1943
+ * The P-256 public key of the owner of the resource, in base64-encoded DER format.
1944
+ * If you provide this, do not specify an owner_id as it will be generated
1945
+ * automatically.
1487
1946
  */
1488
1947
  export interface PublicKeyOwner {
1489
1948
  public_key: string;
@@ -1582,6 +2041,26 @@ export declare namespace Wallets {
1582
2041
  type Wallet as Wallet,
1583
2042
  type WalletChainType as WalletChainType,
1584
2043
  type WalletRevokeResponse as WalletRevokeResponse,
2044
+ type EthereumPersonalSignRpcInput as EthereumPersonalSignRpcInput,
2045
+ type EthereumSignTransactionRpcInput as EthereumSignTransactionRpcInput,
2046
+ type EthereumSendTransactionRpcInput as EthereumSendTransactionRpcInput,
2047
+ type EthereumSignTypedDataRpcInput as EthereumSignTypedDataRpcInput,
2048
+ type EthereumSignUserOperationRpcInput as EthereumSignUserOperationRpcInput,
2049
+ type EthereumSign7702AuthorizationRpcInput as EthereumSign7702AuthorizationRpcInput,
2050
+ type EthereumSecp256k1SignRpcInput as EthereumSecp256k1SignRpcInput,
2051
+ type SolanaSignTransactionRpcInput as SolanaSignTransactionRpcInput,
2052
+ type SolanaSignAndSendTransactionRpcInput as SolanaSignAndSendTransactionRpcInput,
2053
+ type SolanaSignMessageRpcInput as SolanaSignMessageRpcInput,
2054
+ type EthereumSignTransactionRpcResponse as EthereumSignTransactionRpcResponse,
2055
+ type EthereumSendTransactionRpcResponse as EthereumSendTransactionRpcResponse,
2056
+ type EthereumPersonalSignRpcResponse as EthereumPersonalSignRpcResponse,
2057
+ type EthereumSignTypedDataRpcResponse as EthereumSignTypedDataRpcResponse,
2058
+ type EthereumSignUserOperationRpcResponse as EthereumSignUserOperationRpcResponse,
2059
+ type EthereumSign7702AuthorizationRpcResponse as EthereumSign7702AuthorizationRpcResponse,
2060
+ type EthereumSecp256k1SignRpcResponse as EthereumSecp256k1SignRpcResponse,
2061
+ type SolanaSignTransactionRpcResponse as SolanaSignTransactionRpcResponse,
2062
+ type SolanaSignAndSendTransactionRpcResponse as SolanaSignAndSendTransactionRpcResponse,
2063
+ type SolanaSignMessageRpcResponse as SolanaSignMessageRpcResponse,
1585
2064
  type WalletExportResponse as WalletExportResponse,
1586
2065
  type WalletInitImportResponse as WalletInitImportResponse,
1587
2066
  type WalletRawSignResponse as WalletRawSignResponse,