@privy-io/node 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +1 -1
  3. package/client.d.mts +2 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +2 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs.map +1 -1
  9. package/lib/identity-token.d.mts.map +1 -1
  10. package/lib/identity-token.d.ts.map +1 -1
  11. package/lib/identity-token.js +10 -0
  12. package/lib/identity-token.js.map +1 -1
  13. package/lib/identity-token.mjs +10 -0
  14. package/lib/identity-token.mjs.map +1 -1
  15. package/package.json +1 -1
  16. package/public-api/services/ethereum.d.mts +7 -7
  17. package/public-api/services/ethereum.d.mts.map +1 -1
  18. package/public-api/services/ethereum.d.ts +7 -7
  19. package/public-api/services/ethereum.d.ts.map +1 -1
  20. package/public-api/services/ethereum.js.map +1 -1
  21. package/public-api/services/ethereum.mjs.map +1 -1
  22. package/public-api/services/solana.d.mts +4 -4
  23. package/public-api/services/solana.d.mts.map +1 -1
  24. package/public-api/services/solana.d.ts +4 -4
  25. package/public-api/services/solana.d.ts.map +1 -1
  26. package/public-api/services/solana.js.map +1 -1
  27. package/public-api/services/solana.mjs.map +1 -1
  28. package/resources/index.d.mts +1 -1
  29. package/resources/index.d.mts.map +1 -1
  30. package/resources/index.d.ts +1 -1
  31. package/resources/index.d.ts.map +1 -1
  32. package/resources/index.js.map +1 -1
  33. package/resources/index.mjs.map +1 -1
  34. package/resources/key-quorums.d.mts +18 -3
  35. package/resources/key-quorums.d.mts.map +1 -1
  36. package/resources/key-quorums.d.ts +18 -3
  37. package/resources/key-quorums.d.ts.map +1 -1
  38. package/resources/policies.d.mts +6 -4
  39. package/resources/policies.d.mts.map +1 -1
  40. package/resources/policies.d.ts +6 -4
  41. package/resources/policies.d.ts.map +1 -1
  42. package/resources/users.d.mts +3 -3
  43. package/resources/users.d.mts.map +1 -1
  44. package/resources/users.d.ts +3 -3
  45. package/resources/users.d.ts.map +1 -1
  46. package/resources/users.js +1 -1
  47. package/resources/users.mjs +1 -1
  48. package/resources/wallets/index.d.mts +1 -1
  49. package/resources/wallets/index.d.mts.map +1 -1
  50. package/resources/wallets/index.d.ts +1 -1
  51. package/resources/wallets/index.d.ts.map +1 -1
  52. package/resources/wallets/index.js.map +1 -1
  53. package/resources/wallets/index.mjs.map +1 -1
  54. package/resources/wallets/transactions.d.mts +1 -0
  55. package/resources/wallets/transactions.d.mts.map +1 -1
  56. package/resources/wallets/transactions.d.ts +1 -0
  57. package/resources/wallets/transactions.d.ts.map +1 -1
  58. package/resources/wallets/wallets.d.mts +466 -228
  59. package/resources/wallets/wallets.d.mts.map +1 -1
  60. package/resources/wallets/wallets.d.ts +466 -228
  61. package/resources/wallets/wallets.d.ts.map +1 -1
  62. package/resources/wallets/wallets.js +7 -3
  63. package/resources/wallets/wallets.js.map +1 -1
  64. package/resources/wallets/wallets.mjs +7 -3
  65. package/resources/wallets/wallets.mjs.map +1 -1
  66. package/src/client.ts +36 -0
  67. package/src/lib/identity-token.ts +11 -0
  68. package/src/public-api/services/ethereum.ts +15 -7
  69. package/src/public-api/services/solana.ts +9 -4
  70. package/src/resources/index.ts +18 -0
  71. package/src/resources/key-quorums.ts +18 -3
  72. package/src/resources/policies.ts +6 -4
  73. package/src/resources/users.ts +3 -3
  74. package/src/resources/wallets/index.ts +18 -0
  75. package/src/resources/wallets/transactions.ts +2 -0
  76. package/src/resources/wallets/wallets.ts +595 -260
  77. package/src/version.ts +1 -1
  78. package/version.d.mts +1 -1
  79. package/version.d.ts +1 -1
  80. package/version.js +1 -1
  81. 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
  */
@@ -372,233 +376,526 @@ export type WalletChainType =
372
376
  | 'starknet'
373
377
  | 'spark';
374
378
 
375
- export interface WalletExportResponse {
376
- /**
377
- * The encrypted private key.
378
- */
379
- ciphertext: string;
379
+ /**
380
+ * Executes the EVM `personal_sign` RPC (EIP-191) to sign a message.
381
+ */
382
+ export interface EthereumPersonalSignRpcInput {
383
+ method: 'personal_sign';
380
384
 
381
- /**
382
- * The base64-encoded encapsulated key that was generated during encryption, for
383
- * use during decryption.
384
- */
385
- encapsulated_key: string;
385
+ params: EthereumPersonalSignRpcInput.Params;
386
386
 
387
- /**
388
- * The encryption type of the wallet to import. Currently only supports `HPKE`.
389
- */
390
- encryption_type: 'HPKE';
387
+ address?: string;
388
+
389
+ chain_type?: 'ethereum';
391
390
  }
392
391
 
393
- export interface WalletInitImportResponse {
394
- /**
395
- * The base64-encoded encryption public key to encrypt the wallet entropy with.
396
- */
397
- encryption_public_key: string;
392
+ export namespace EthereumPersonalSignRpcInput {
393
+ export interface Params {
394
+ encoding: 'utf-8' | 'hex';
398
395
 
399
- /**
400
- * The encryption type of the wallet to import. Currently only supports `HPKE`.
401
- */
402
- encryption_type: 'HPKE';
396
+ message: string;
397
+ }
403
398
  }
404
399
 
405
- export interface WalletRawSignResponse {
406
- data: WalletRawSignResponse.Data;
400
+ /**
401
+ * Executes the EVM `eth_signTransaction` RPC to sign a transaction.
402
+ */
403
+ export interface EthereumSignTransactionRpcInput {
404
+ method: 'eth_signTransaction';
405
+
406
+ params: EthereumSignTransactionRpcInput.Params;
407
+
408
+ address?: string;
409
+
410
+ chain_type?: 'ethereum';
407
411
  }
408
412
 
409
- export namespace WalletRawSignResponse {
410
- export interface Data {
411
- encoding: 'hex';
413
+ export namespace EthereumSignTransactionRpcInput {
414
+ export interface Params {
415
+ transaction: Params.Transaction;
416
+ }
412
417
 
413
- signature: string;
418
+ export namespace Params {
419
+ export interface Transaction {
420
+ chain_id?: string | number;
421
+
422
+ data?: string;
423
+
424
+ from?: string;
425
+
426
+ gas_limit?: string | number;
427
+
428
+ gas_price?: string | number;
429
+
430
+ max_fee_per_gas?: string | number;
431
+
432
+ max_priority_fee_per_gas?: string | number;
433
+
434
+ nonce?: string | number;
435
+
436
+ to?: string;
437
+
438
+ type?: 0 | 1 | 2;
439
+
440
+ value?: string | number;
441
+ }
414
442
  }
415
443
  }
416
444
 
417
- export type WalletRpcResponse =
418
- | WalletRpcResponse.SolanaSignTransactionRpcResponse
419
- | WalletRpcResponse.SolanaSignAndSendTransactionRpcResponse
420
- | WalletRpcResponse.SolanaSignMessageRpcResponse
421
- | WalletRpcResponse.EthereumSignTransactionRpcResponse
422
- | WalletRpcResponse.EthereumSendTransactionRpcResponse
423
- | WalletRpcResponse.EthereumPersonalSignRpcResponse
424
- | WalletRpcResponse.EthereumSignTypedDataRpcResponse
425
- | WalletRpcResponse.EthereumSign7702AuthorizationRpcResponse
426
- | WalletRpcResponse.EthereumSecp256k1SignRpcResponse;
427
-
428
- export namespace WalletRpcResponse {
429
- export interface SolanaSignTransactionRpcResponse {
430
- data: SolanaSignTransactionRpcResponse.Data;
445
+ /**
446
+ * Executes the EVM `eth_sendTransaction` RPC to sign and broadcast a transaction.
447
+ */
448
+ export interface EthereumSendTransactionRpcInput {
449
+ caip2: string;
431
450
 
432
- method: 'signTransaction';
451
+ method: 'eth_sendTransaction';
452
+
453
+ params: EthereumSendTransactionRpcInput.Params;
454
+
455
+ address?: string;
456
+
457
+ chain_type?: 'ethereum';
458
+
459
+ sponsor?: boolean;
460
+ }
461
+
462
+ export namespace EthereumSendTransactionRpcInput {
463
+ export interface Params {
464
+ transaction: Params.Transaction;
433
465
  }
434
466
 
435
- export namespace SolanaSignTransactionRpcResponse {
436
- export interface Data {
437
- encoding: 'base64';
467
+ export namespace Params {
468
+ export interface Transaction {
469
+ chain_id?: string | number;
470
+
471
+ data?: string;
472
+
473
+ from?: string;
438
474
 
439
- signed_transaction: string;
475
+ gas_limit?: string | number;
476
+
477
+ gas_price?: string | number;
478
+
479
+ max_fee_per_gas?: string | number;
480
+
481
+ max_priority_fee_per_gas?: string | number;
482
+
483
+ nonce?: string | number;
484
+
485
+ to?: string;
486
+
487
+ type?: 0 | 1 | 2;
488
+
489
+ value?: string | number;
440
490
  }
441
491
  }
492
+ }
442
493
 
443
- export interface SolanaSignAndSendTransactionRpcResponse {
444
- data: SolanaSignAndSendTransactionRpcResponse.Data;
494
+ /**
495
+ * Executes the EVM `eth_signTypedData_v4` RPC (EIP-712) to sign a typed data
496
+ * object.
497
+ */
498
+ export interface EthereumSignTypedDataRpcInput {
499
+ method: 'eth_signTypedData_v4';
445
500
 
446
- method: 'signAndSendTransaction';
501
+ params: EthereumSignTypedDataRpcInput.Params;
502
+
503
+ address?: string;
504
+
505
+ chain_type?: 'ethereum';
506
+ }
507
+
508
+ export namespace EthereumSignTypedDataRpcInput {
509
+ export interface Params {
510
+ typed_data: Params.TypedData;
447
511
  }
448
512
 
449
- export namespace SolanaSignAndSendTransactionRpcResponse {
450
- export interface Data {
451
- caip2: string;
513
+ export namespace Params {
514
+ export interface TypedData {
515
+ domain: { [key: string]: unknown };
452
516
 
453
- hash: string;
517
+ message: { [key: string]: unknown };
518
+
519
+ primary_type: string;
454
520
 
455
- transaction_id?: string;
521
+ types: { [key: string]: Array<TypedData.Type> };
522
+ }
523
+
524
+ export namespace TypedData {
525
+ export interface Type {
526
+ name: string;
527
+
528
+ type: string;
529
+ }
456
530
  }
457
531
  }
532
+ }
458
533
 
459
- export interface SolanaSignMessageRpcResponse {
460
- data: SolanaSignMessageRpcResponse.Data;
534
+ /**
535
+ * Signs an EIP-7702 authorization.
536
+ */
537
+ export interface EthereumSign7702AuthorizationRpcInput {
538
+ method: 'eth_sign7702Authorization';
461
539
 
462
- method: 'signMessage';
540
+ params: EthereumSign7702AuthorizationRpcInput.Params;
541
+
542
+ address?: string;
543
+
544
+ chain_type?: 'ethereum';
545
+ }
546
+
547
+ export namespace EthereumSign7702AuthorizationRpcInput {
548
+ export interface Params {
549
+ chain_id: string | number;
550
+
551
+ contract: string;
552
+
553
+ nonce?: string | number;
463
554
  }
555
+ }
464
556
 
465
- export namespace SolanaSignMessageRpcResponse {
466
- export interface Data {
467
- encoding: 'base64';
557
+ /**
558
+ * Signs a raw hash on the secp256k1 curve.
559
+ */
560
+ export interface EthereumSecp256k1SignRpcInput {
561
+ method: 'secp256k1_sign';
468
562
 
469
- signature: string;
470
- }
563
+ params: EthereumSecp256k1SignRpcInput.Params;
564
+
565
+ address?: string;
566
+
567
+ chain_type?: 'ethereum';
568
+ }
569
+
570
+ export namespace EthereumSecp256k1SignRpcInput {
571
+ export interface Params {
572
+ hash: string;
471
573
  }
574
+ }
575
+
576
+ /**
577
+ * Executes the SVM `signTransaction` RPC to sign a transaction.
578
+ */
579
+ export interface SolanaSignTransactionRpcInput {
580
+ method: 'signTransaction';
472
581
 
473
- export interface EthereumSignTransactionRpcResponse {
474
- data: EthereumSignTransactionRpcResponse.Data;
582
+ params: SolanaSignTransactionRpcInput.Params;
475
583
 
476
- method: 'eth_signTransaction';
584
+ address?: string;
585
+
586
+ chain_type?: 'solana';
587
+ }
588
+
589
+ export namespace SolanaSignTransactionRpcInput {
590
+ export interface Params {
591
+ encoding: 'base64';
592
+
593
+ transaction: string;
477
594
  }
595
+ }
478
596
 
479
- export namespace EthereumSignTransactionRpcResponse {
480
- export interface Data {
481
- encoding: 'rlp';
597
+ /**
598
+ * Executes the SVM `signAndSendTransaction` RPC to sign and broadcast a
599
+ * transaction.
600
+ */
601
+ export interface SolanaSignAndSendTransactionRpcInput {
602
+ caip2: string;
482
603
 
483
- signed_transaction: string;
484
- }
604
+ method: 'signAndSendTransaction';
605
+
606
+ params: SolanaSignAndSendTransactionRpcInput.Params;
607
+
608
+ address?: string;
609
+
610
+ chain_type?: 'solana';
611
+
612
+ sponsor?: boolean;
613
+ }
614
+
615
+ export namespace SolanaSignAndSendTransactionRpcInput {
616
+ export interface Params {
617
+ encoding: 'base64';
618
+
619
+ transaction: string;
485
620
  }
621
+ }
486
622
 
487
- export interface EthereumSendTransactionRpcResponse {
488
- data: EthereumSendTransactionRpcResponse.Data;
623
+ /**
624
+ * Executes the SVM `signMessage` RPC to sign a message.
625
+ */
626
+ export interface SolanaSignMessageRpcInput {
627
+ method: 'signMessage';
489
628
 
490
- method: 'eth_sendTransaction';
629
+ params: SolanaSignMessageRpcInput.Params;
630
+
631
+ address?: string;
632
+
633
+ chain_type?: 'solana';
634
+ }
635
+
636
+ export namespace SolanaSignMessageRpcInput {
637
+ export interface Params {
638
+ encoding: 'base64';
639
+
640
+ message: string;
491
641
  }
642
+ }
492
643
 
493
- export namespace EthereumSendTransactionRpcResponse {
494
- export interface Data {
495
- caip2: string;
644
+ /**
645
+ * Response to the EVM `eth_signTransaction` RPC.
646
+ */
647
+ export interface EthereumSignTransactionRpcResponse {
648
+ data: EthereumSignTransactionRpcResponse.Data;
496
649
 
497
- hash: string;
650
+ method: 'eth_signTransaction';
651
+ }
498
652
 
499
- transaction_id?: string;
653
+ export namespace EthereumSignTransactionRpcResponse {
654
+ export interface Data {
655
+ encoding: 'rlp';
500
656
 
501
- transaction_request?: Data.TransactionRequest;
502
- }
657
+ signed_transaction: string;
658
+ }
659
+ }
503
660
 
504
- export namespace Data {
505
- export interface TransactionRequest {
506
- chain_id?: string | number;
661
+ /**
662
+ * Response to the EVM `eth_sendTransaction` RPC.
663
+ */
664
+ export interface EthereumSendTransactionRpcResponse {
665
+ data: EthereumSendTransactionRpcResponse.Data;
507
666
 
508
- data?: string;
667
+ method: 'eth_sendTransaction';
668
+ }
509
669
 
510
- from?: string;
670
+ export namespace EthereumSendTransactionRpcResponse {
671
+ export interface Data {
672
+ caip2: string;
511
673
 
512
- gas_limit?: string | number;
674
+ hash: string;
513
675
 
514
- gas_price?: string | number;
676
+ transaction_id?: string;
515
677
 
516
- max_fee_per_gas?: string | number;
678
+ transaction_request?: Data.TransactionRequest;
679
+ }
517
680
 
518
- max_priority_fee_per_gas?: string | number;
681
+ export namespace Data {
682
+ export interface TransactionRequest {
683
+ chain_id?: string | number;
519
684
 
520
- nonce?: string | number;
685
+ data?: string;
521
686
 
522
- to?: string;
687
+ from?: string;
523
688
 
524
- type?: 0 | 1 | 2;
689
+ gas_limit?: string | number;
525
690
 
526
- value?: string | number;
527
- }
691
+ gas_price?: string | number;
692
+
693
+ max_fee_per_gas?: string | number;
694
+
695
+ max_priority_fee_per_gas?: string | number;
696
+
697
+ nonce?: string | number;
698
+
699
+ to?: string;
700
+
701
+ type?: 0 | 1 | 2;
702
+
703
+ value?: string | number;
528
704
  }
529
705
  }
706
+ }
530
707
 
531
- export interface EthereumPersonalSignRpcResponse {
532
- data: EthereumPersonalSignRpcResponse.Data;
708
+ /**
709
+ * Response to the EVM `personal_sign` RPC.
710
+ */
711
+ export interface EthereumPersonalSignRpcResponse {
712
+ data: EthereumPersonalSignRpcResponse.Data;
533
713
 
534
- method: 'personal_sign';
714
+ method: 'personal_sign';
715
+ }
716
+
717
+ export namespace EthereumPersonalSignRpcResponse {
718
+ export interface Data {
719
+ encoding: 'hex';
720
+
721
+ signature: string;
535
722
  }
723
+ }
724
+
725
+ /**
726
+ * Response to the EVM `eth_signTypedData_v4` RPC.
727
+ */
728
+ export interface EthereumSignTypedDataRpcResponse {
729
+ data: EthereumSignTypedDataRpcResponse.Data;
536
730
 
537
- export namespace EthereumPersonalSignRpcResponse {
538
- export interface Data {
539
- encoding: 'hex';
731
+ method: 'eth_signTypedData_v4';
732
+ }
540
733
 
541
- signature: string;
542
- }
734
+ export namespace EthereumSignTypedDataRpcResponse {
735
+ export interface Data {
736
+ encoding: 'hex';
737
+
738
+ signature: string;
543
739
  }
740
+ }
544
741
 
545
- export interface EthereumSignTypedDataRpcResponse {
546
- data: EthereumSignTypedDataRpcResponse.Data;
742
+ /**
743
+ * Response to the EVM `eth_sign7702Authorization` RPC.
744
+ */
745
+ export interface EthereumSign7702AuthorizationRpcResponse {
746
+ data: EthereumSign7702AuthorizationRpcResponse.Data;
547
747
 
548
- method: 'eth_signTypedData_v4';
748
+ method: 'eth_sign7702Authorization';
749
+ }
750
+
751
+ export namespace EthereumSign7702AuthorizationRpcResponse {
752
+ export interface Data {
753
+ authorization: Data.Authorization;
549
754
  }
550
755
 
551
- export namespace EthereumSignTypedDataRpcResponse {
552
- export interface Data {
553
- encoding: 'hex';
756
+ export namespace Data {
757
+ export interface Authorization {
758
+ chain_id: string | number;
759
+
760
+ contract: string;
761
+
762
+ nonce: string | number;
763
+
764
+ r: string;
765
+
766
+ s: string;
554
767
 
555
- signature: string;
768
+ y_parity: number;
556
769
  }
557
770
  }
771
+ }
558
772
 
559
- export interface EthereumSign7702AuthorizationRpcResponse {
560
- data: EthereumSign7702AuthorizationRpcResponse.Data;
773
+ /**
774
+ * Response to the EVM `secp256k1_sign` RPC.
775
+ */
776
+ export interface EthereumSecp256k1SignRpcResponse {
777
+ data: EthereumSecp256k1SignRpcResponse.Data;
561
778
 
562
- method: 'eth_sign7702Authorization';
779
+ method: 'secp256k1_sign';
780
+ }
781
+
782
+ export namespace EthereumSecp256k1SignRpcResponse {
783
+ export interface Data {
784
+ encoding: 'hex';
785
+
786
+ signature: string;
563
787
  }
788
+ }
564
789
 
565
- export namespace EthereumSign7702AuthorizationRpcResponse {
566
- export interface Data {
567
- authorization: Data.Authorization;
568
- }
790
+ /**
791
+ * Response to the SVM `signTransaction` RPC.
792
+ */
793
+ export interface SolanaSignTransactionRpcResponse {
794
+ data: SolanaSignTransactionRpcResponse.Data;
569
795
 
570
- export namespace Data {
571
- export interface Authorization {
572
- chain_id: string | number;
796
+ method: 'signTransaction';
797
+ }
573
798
 
574
- contract: string;
799
+ export namespace SolanaSignTransactionRpcResponse {
800
+ export interface Data {
801
+ encoding: 'base64';
575
802
 
576
- nonce: string | number;
803
+ signed_transaction: string;
804
+ }
805
+ }
577
806
 
578
- r: string;
807
+ /**
808
+ * Response to the SVM `signAndSendTransaction` RPC.
809
+ */
810
+ export interface SolanaSignAndSendTransactionRpcResponse {
811
+ data: SolanaSignAndSendTransactionRpcResponse.Data;
579
812
 
580
- s: string;
813
+ method: 'signAndSendTransaction';
814
+ }
581
815
 
582
- y_parity: number;
583
- }
584
- }
816
+ export namespace SolanaSignAndSendTransactionRpcResponse {
817
+ export interface Data {
818
+ caip2: string;
819
+
820
+ hash: string;
821
+
822
+ transaction_id?: string;
585
823
  }
824
+ }
825
+
826
+ /**
827
+ * Response to the SVM `signMessage` RPC.
828
+ */
829
+ export interface SolanaSignMessageRpcResponse {
830
+ data: SolanaSignMessageRpcResponse.Data;
831
+
832
+ method: 'signMessage';
833
+ }
834
+
835
+ export namespace SolanaSignMessageRpcResponse {
836
+ export interface Data {
837
+ encoding: 'base64';
838
+
839
+ signature: string;
840
+ }
841
+ }
842
+
843
+ export interface WalletExportResponse {
844
+ /**
845
+ * The encrypted private key.
846
+ */
847
+ ciphertext: string;
848
+
849
+ /**
850
+ * The base64-encoded encapsulated key that was generated during encryption, for
851
+ * use during decryption.
852
+ */
853
+ encapsulated_key: string;
854
+
855
+ /**
856
+ * The encryption type of the wallet to import. Currently only supports `HPKE`.
857
+ */
858
+ encryption_type: 'HPKE';
859
+ }
860
+
861
+ export interface WalletInitImportResponse {
862
+ /**
863
+ * The base64-encoded encryption public key to encrypt the wallet entropy with.
864
+ */
865
+ encryption_public_key: string;
586
866
 
587
- export interface EthereumSecp256k1SignRpcResponse {
588
- data: EthereumSecp256k1SignRpcResponse.Data;
867
+ /**
868
+ * The encryption type of the wallet to import. Currently only supports `HPKE`.
869
+ */
870
+ encryption_type: 'HPKE';
871
+ }
589
872
 
590
- method: 'secp256k1_sign';
591
- }
873
+ export interface WalletRawSignResponse {
874
+ data: WalletRawSignResponse.Data;
875
+ }
592
876
 
593
- export namespace EthereumSecp256k1SignRpcResponse {
594
- export interface Data {
595
- encoding: 'hex';
877
+ export namespace WalletRawSignResponse {
878
+ export interface Data {
879
+ encoding: 'hex';
596
880
 
597
- signature: string;
598
- }
881
+ signature: string;
599
882
  }
600
883
  }
601
884
 
885
+ /**
886
+ * Response to the EVM `personal_sign` RPC.
887
+ */
888
+ export type WalletRpcResponse =
889
+ | EthereumPersonalSignRpcResponse
890
+ | EthereumSignTypedDataRpcResponse
891
+ | EthereumSignTransactionRpcResponse
892
+ | EthereumSendTransactionRpcResponse
893
+ | EthereumSign7702AuthorizationRpcResponse
894
+ | EthereumSecp256k1SignRpcResponse
895
+ | SolanaSignMessageRpcResponse
896
+ | SolanaSignTransactionRpcResponse
897
+ | SolanaSignAndSendTransactionRpcResponse;
898
+
602
899
  export type WalletAuthenticateWithJwtResponse =
603
900
  | WalletAuthenticateWithJwtResponse.WithEncryption
604
901
  | WalletAuthenticateWithJwtResponse.WithoutEncryption;
@@ -718,8 +1015,9 @@ export namespace WalletCreateParams {
718
1015
  }
719
1016
 
720
1017
  /**
721
- * The P-256 public key of the owner of the resource. If you provide this, do not
722
- * specify an owner_id as it will be generated automatically.
1018
+ * The P-256 public key of the owner of the resource, in base64-encoded DER format.
1019
+ * If you provide this, do not specify an owner_id as it will be generated
1020
+ * automatically.
723
1021
  */
724
1022
  export interface PublicKeyOwner {
725
1023
  public_key: string;
@@ -830,9 +1128,9 @@ export declare namespace WalletInitImportParams {
830
1128
 
831
1129
  export interface WalletRawSignParams {
832
1130
  /**
833
- * Body param:
1131
+ * Body param: Sign a pre-computed hash
834
1132
  */
835
- params: WalletRawSignParams.Params;
1133
+ params: WalletRawSignParams.Hash | WalletRawSignParams.Bytes;
836
1134
 
837
1135
  /**
838
1136
  * Header param: Request authorization signature. If multiple signatures are
@@ -848,36 +1146,54 @@ export interface WalletRawSignParams {
848
1146
  }
849
1147
 
850
1148
  export namespace WalletRawSignParams {
851
- export interface Params {
1149
+ /**
1150
+ * Sign a pre-computed hash
1151
+ */
1152
+ export interface Hash {
852
1153
  /**
853
1154
  * The hash to sign. Must start with `0x`.
854
1155
  */
855
- hash?: string;
1156
+ hash: string;
1157
+ }
1158
+
1159
+ /**
1160
+ * Hash and sign bytes (Tron only)
1161
+ */
1162
+ export interface Bytes {
1163
+ /**
1164
+ * The bytes to hash and sign.
1165
+ */
1166
+ bytes: string;
1167
+
1168
+ /**
1169
+ * Encoding scheme. Currently only utf-8 is supported.
1170
+ */
1171
+ encoding: 'utf-8';
856
1172
  }
857
1173
  }
858
1174
 
859
1175
  export type WalletRpcParams =
860
- | WalletRpcParams.EthereumSignTransactionRpcInput
861
- | WalletRpcParams.EthereumSendTransactionRpcInput
862
1176
  | WalletRpcParams.EthereumPersonalSignRpcInput
863
1177
  | WalletRpcParams.EthereumSignTypedDataRpcInput
1178
+ | WalletRpcParams.EthereumSignTransactionRpcInput
1179
+ | WalletRpcParams.EthereumSendTransactionRpcInput
864
1180
  | WalletRpcParams.EthereumSign7702AuthorizationRpcInput
865
1181
  | WalletRpcParams.EthereumSecp256k1SignRpcInput
1182
+ | WalletRpcParams.SolanaSignMessageRpcInput
866
1183
  | WalletRpcParams.SolanaSignTransactionRpcInput
867
- | WalletRpcParams.SolanaSignAndSendTransactionRpcInput
868
- | WalletRpcParams.SolanaSignMessageRpcInput;
1184
+ | WalletRpcParams.SolanaSignAndSendTransactionRpcInput;
869
1185
 
870
1186
  export declare namespace WalletRpcParams {
871
- export interface EthereumSignTransactionRpcInput {
1187
+ export interface EthereumPersonalSignRpcInput {
872
1188
  /**
873
1189
  * Body param:
874
1190
  */
875
- method: 'eth_signTransaction';
1191
+ method: 'personal_sign';
876
1192
 
877
1193
  /**
878
1194
  * Body param:
879
1195
  */
880
- params: EthereumSignTransactionRpcInput.Params;
1196
+ params: EthereumPersonalSignRpcInput.Params;
881
1197
 
882
1198
  /**
883
1199
  * Body param:
@@ -902,53 +1218,24 @@ export declare namespace WalletRpcParams {
902
1218
  'privy-idempotency-key'?: string;
903
1219
  }
904
1220
 
905
- export namespace EthereumSignTransactionRpcInput {
1221
+ export namespace EthereumPersonalSignRpcInput {
906
1222
  export interface Params {
907
- transaction: Params.Transaction;
908
- }
909
-
910
- export namespace Params {
911
- export interface Transaction {
912
- chain_id?: string | number;
913
-
914
- data?: string;
915
-
916
- from?: string;
917
-
918
- gas_limit?: string | number;
919
-
920
- gas_price?: string | number;
921
-
922
- max_fee_per_gas?: string | number;
923
-
924
- max_priority_fee_per_gas?: string | number;
925
-
926
- nonce?: string | number;
927
-
928
- to?: string;
929
-
930
- type?: 0 | 1 | 2;
1223
+ encoding: 'utf-8' | 'hex';
931
1224
 
932
- value?: string | number;
933
- }
1225
+ message: string;
934
1226
  }
935
1227
  }
936
1228
 
937
- export interface EthereumSendTransactionRpcInput {
938
- /**
939
- * Body param:
940
- */
941
- caip2: string;
942
-
1229
+ export interface EthereumSignTypedDataRpcInput {
943
1230
  /**
944
1231
  * Body param:
945
1232
  */
946
- method: 'eth_sendTransaction';
1233
+ method: 'eth_signTypedData_v4';
947
1234
 
948
1235
  /**
949
1236
  * Body param:
950
1237
  */
951
- params: EthereumSendTransactionRpcInput.Params;
1238
+ params: EthereumSignTypedDataRpcInput.Params;
952
1239
 
953
1240
  /**
954
1241
  * Body param:
@@ -960,11 +1247,6 @@ export declare namespace WalletRpcParams {
960
1247
  */
961
1248
  chain_type?: 'ethereum';
962
1249
 
963
- /**
964
- * Body param:
965
- */
966
- sponsor?: boolean;
967
-
968
1250
  /**
969
1251
  * Header param: Request authorization signature. If multiple signatures are
970
1252
  * required, they should be comma separated.
@@ -978,48 +1260,42 @@ export declare namespace WalletRpcParams {
978
1260
  'privy-idempotency-key'?: string;
979
1261
  }
980
1262
 
981
- export namespace EthereumSendTransactionRpcInput {
1263
+ export namespace EthereumSignTypedDataRpcInput {
982
1264
  export interface Params {
983
- transaction: Params.Transaction;
1265
+ typed_data: Params.TypedData;
984
1266
  }
985
1267
 
986
1268
  export namespace Params {
987
- export interface Transaction {
988
- chain_id?: string | number;
989
-
990
- data?: string;
991
-
992
- from?: string;
993
-
994
- gas_limit?: string | number;
995
-
996
- gas_price?: string | number;
997
-
998
- max_fee_per_gas?: string | number;
1269
+ export interface TypedData {
1270
+ domain: { [key: string]: unknown };
999
1271
 
1000
- max_priority_fee_per_gas?: string | number;
1272
+ message: { [key: string]: unknown };
1001
1273
 
1002
- nonce?: string | number;
1274
+ primary_type: string;
1003
1275
 
1004
- to?: string;
1276
+ types: { [key: string]: Array<TypedData.Type> };
1277
+ }
1005
1278
 
1006
- type?: 0 | 1 | 2;
1279
+ export namespace TypedData {
1280
+ export interface Type {
1281
+ name: string;
1007
1282
 
1008
- value?: string | number;
1283
+ type: string;
1284
+ }
1009
1285
  }
1010
1286
  }
1011
1287
  }
1012
1288
 
1013
- export interface EthereumPersonalSignRpcInput {
1289
+ export interface EthereumSignTransactionRpcInput {
1014
1290
  /**
1015
1291
  * Body param:
1016
1292
  */
1017
- method: 'personal_sign';
1293
+ method: 'eth_signTransaction';
1018
1294
 
1019
1295
  /**
1020
1296
  * Body param:
1021
1297
  */
1022
- params: EthereumPersonalSignRpcInput.Params;
1298
+ params: EthereumSignTransactionRpcInput.Params;
1023
1299
 
1024
1300
  /**
1025
1301
  * Body param:
@@ -1044,24 +1320,53 @@ export declare namespace WalletRpcParams {
1044
1320
  'privy-idempotency-key'?: string;
1045
1321
  }
1046
1322
 
1047
- export namespace EthereumPersonalSignRpcInput {
1323
+ export namespace EthereumSignTransactionRpcInput {
1048
1324
  export interface Params {
1049
- encoding: 'utf-8' | 'hex';
1325
+ transaction: Params.Transaction;
1326
+ }
1050
1327
 
1051
- message: string;
1328
+ export namespace Params {
1329
+ export interface Transaction {
1330
+ chain_id?: string | number;
1331
+
1332
+ data?: string;
1333
+
1334
+ from?: string;
1335
+
1336
+ gas_limit?: string | number;
1337
+
1338
+ gas_price?: string | number;
1339
+
1340
+ max_fee_per_gas?: string | number;
1341
+
1342
+ max_priority_fee_per_gas?: string | number;
1343
+
1344
+ nonce?: string | number;
1345
+
1346
+ to?: string;
1347
+
1348
+ type?: 0 | 1 | 2;
1349
+
1350
+ value?: string | number;
1351
+ }
1052
1352
  }
1053
1353
  }
1054
1354
 
1055
- export interface EthereumSignTypedDataRpcInput {
1355
+ export interface EthereumSendTransactionRpcInput {
1056
1356
  /**
1057
1357
  * Body param:
1058
1358
  */
1059
- method: 'eth_signTypedData_v4';
1359
+ caip2: string;
1060
1360
 
1061
1361
  /**
1062
1362
  * Body param:
1063
1363
  */
1064
- params: EthereumSignTypedDataRpcInput.Params;
1364
+ method: 'eth_sendTransaction';
1365
+
1366
+ /**
1367
+ * Body param:
1368
+ */
1369
+ params: EthereumSendTransactionRpcInput.Params;
1065
1370
 
1066
1371
  /**
1067
1372
  * Body param:
@@ -1073,6 +1378,11 @@ export declare namespace WalletRpcParams {
1073
1378
  */
1074
1379
  chain_type?: 'ethereum';
1075
1380
 
1381
+ /**
1382
+ * Body param:
1383
+ */
1384
+ sponsor?: boolean;
1385
+
1076
1386
  /**
1077
1387
  * Header param: Request authorization signature. If multiple signatures are
1078
1388
  * required, they should be comma separated.
@@ -1086,28 +1396,34 @@ export declare namespace WalletRpcParams {
1086
1396
  'privy-idempotency-key'?: string;
1087
1397
  }
1088
1398
 
1089
- export namespace EthereumSignTypedDataRpcInput {
1399
+ export namespace EthereumSendTransactionRpcInput {
1090
1400
  export interface Params {
1091
- typed_data: Params.TypedData;
1401
+ transaction: Params.Transaction;
1092
1402
  }
1093
1403
 
1094
1404
  export namespace Params {
1095
- export interface TypedData {
1096
- domain: { [key: string]: unknown };
1405
+ export interface Transaction {
1406
+ chain_id?: string | number;
1097
1407
 
1098
- message: { [key: string]: unknown };
1408
+ data?: string;
1099
1409
 
1100
- primary_type: string;
1410
+ from?: string;
1101
1411
 
1102
- types: { [key: string]: Array<TypedData.Type> };
1103
- }
1412
+ gas_limit?: string | number;
1104
1413
 
1105
- export namespace TypedData {
1106
- export interface Type {
1107
- name: string;
1414
+ gas_price?: string | number;
1108
1415
 
1109
- type: string;
1110
- }
1416
+ max_fee_per_gas?: string | number;
1417
+
1418
+ max_priority_fee_per_gas?: string | number;
1419
+
1420
+ nonce?: string | number;
1421
+
1422
+ to?: string;
1423
+
1424
+ type?: 0 | 1 | 2;
1425
+
1426
+ value?: string | number;
1111
1427
  }
1112
1428
  }
1113
1429
  }
@@ -1196,16 +1512,16 @@ export declare namespace WalletRpcParams {
1196
1512
  }
1197
1513
  }
1198
1514
 
1199
- export interface SolanaSignTransactionRpcInput {
1515
+ export interface SolanaSignMessageRpcInput {
1200
1516
  /**
1201
1517
  * Body param:
1202
1518
  */
1203
- method: 'signTransaction';
1519
+ method: 'signMessage';
1204
1520
 
1205
1521
  /**
1206
1522
  * Body param:
1207
1523
  */
1208
- params: SolanaSignTransactionRpcInput.Params;
1524
+ params: SolanaSignMessageRpcInput.Params;
1209
1525
 
1210
1526
  /**
1211
1527
  * Body param:
@@ -1230,29 +1546,24 @@ export declare namespace WalletRpcParams {
1230
1546
  'privy-idempotency-key'?: string;
1231
1547
  }
1232
1548
 
1233
- export namespace SolanaSignTransactionRpcInput {
1549
+ export namespace SolanaSignMessageRpcInput {
1234
1550
  export interface Params {
1235
1551
  encoding: 'base64';
1236
1552
 
1237
- transaction: string;
1553
+ message: string;
1238
1554
  }
1239
1555
  }
1240
1556
 
1241
- export interface SolanaSignAndSendTransactionRpcInput {
1242
- /**
1243
- * Body param:
1244
- */
1245
- caip2: string;
1246
-
1557
+ export interface SolanaSignTransactionRpcInput {
1247
1558
  /**
1248
1559
  * Body param:
1249
1560
  */
1250
- method: 'signAndSendTransaction';
1561
+ method: 'signTransaction';
1251
1562
 
1252
1563
  /**
1253
1564
  * Body param:
1254
1565
  */
1255
- params: SolanaSignAndSendTransactionRpcInput.Params;
1566
+ params: SolanaSignTransactionRpcInput.Params;
1256
1567
 
1257
1568
  /**
1258
1569
  * Body param:
@@ -1264,11 +1575,6 @@ export declare namespace WalletRpcParams {
1264
1575
  */
1265
1576
  chain_type?: 'solana';
1266
1577
 
1267
- /**
1268
- * Body param:
1269
- */
1270
- sponsor?: boolean;
1271
-
1272
1578
  /**
1273
1579
  * Header param: Request authorization signature. If multiple signatures are
1274
1580
  * required, they should be comma separated.
@@ -1282,7 +1588,7 @@ export declare namespace WalletRpcParams {
1282
1588
  'privy-idempotency-key'?: string;
1283
1589
  }
1284
1590
 
1285
- export namespace SolanaSignAndSendTransactionRpcInput {
1591
+ export namespace SolanaSignTransactionRpcInput {
1286
1592
  export interface Params {
1287
1593
  encoding: 'base64';
1288
1594
 
@@ -1290,16 +1596,21 @@ export declare namespace WalletRpcParams {
1290
1596
  }
1291
1597
  }
1292
1598
 
1293
- export interface SolanaSignMessageRpcInput {
1599
+ export interface SolanaSignAndSendTransactionRpcInput {
1294
1600
  /**
1295
1601
  * Body param:
1296
1602
  */
1297
- method: 'signMessage';
1603
+ caip2: string;
1298
1604
 
1299
1605
  /**
1300
1606
  * Body param:
1301
1607
  */
1302
- params: SolanaSignMessageRpcInput.Params;
1608
+ method: 'signAndSendTransaction';
1609
+
1610
+ /**
1611
+ * Body param:
1612
+ */
1613
+ params: SolanaSignAndSendTransactionRpcInput.Params;
1303
1614
 
1304
1615
  /**
1305
1616
  * Body param:
@@ -1311,6 +1622,11 @@ export declare namespace WalletRpcParams {
1311
1622
  */
1312
1623
  chain_type?: 'solana';
1313
1624
 
1625
+ /**
1626
+ * Body param:
1627
+ */
1628
+ sponsor?: boolean;
1629
+
1314
1630
  /**
1315
1631
  * Header param: Request authorization signature. If multiple signatures are
1316
1632
  * required, they should be comma separated.
@@ -1324,11 +1640,11 @@ export declare namespace WalletRpcParams {
1324
1640
  'privy-idempotency-key'?: string;
1325
1641
  }
1326
1642
 
1327
- export namespace SolanaSignMessageRpcInput {
1643
+ export namespace SolanaSignAndSendTransactionRpcInput {
1328
1644
  export interface Params {
1329
1645
  encoding: 'base64';
1330
1646
 
1331
- message: string;
1647
+ transaction: string;
1332
1648
  }
1333
1649
  }
1334
1650
  }
@@ -1475,8 +1791,9 @@ export namespace WalletUpdateParams {
1475
1791
  }
1476
1792
 
1477
1793
  /**
1478
- * The P-256 public key of the owner of the resource. If you provide this, do not
1479
- * specify an owner_id as it will be generated automatically.
1794
+ * The P-256 public key of the owner of the resource, in base64-encoded DER format.
1795
+ * If you provide this, do not specify an owner_id as it will be generated
1796
+ * automatically.
1480
1797
  */
1481
1798
  export interface PublicKeyOwner {
1482
1799
  public_key: string;
@@ -1574,6 +1891,24 @@ export declare namespace Wallets {
1574
1891
  type FirstClassChainType as FirstClassChainType,
1575
1892
  type Wallet as Wallet,
1576
1893
  type WalletChainType as WalletChainType,
1894
+ type EthereumPersonalSignRpcInput as EthereumPersonalSignRpcInput,
1895
+ type EthereumSignTransactionRpcInput as EthereumSignTransactionRpcInput,
1896
+ type EthereumSendTransactionRpcInput as EthereumSendTransactionRpcInput,
1897
+ type EthereumSignTypedDataRpcInput as EthereumSignTypedDataRpcInput,
1898
+ type EthereumSign7702AuthorizationRpcInput as EthereumSign7702AuthorizationRpcInput,
1899
+ type EthereumSecp256k1SignRpcInput as EthereumSecp256k1SignRpcInput,
1900
+ type SolanaSignTransactionRpcInput as SolanaSignTransactionRpcInput,
1901
+ type SolanaSignAndSendTransactionRpcInput as SolanaSignAndSendTransactionRpcInput,
1902
+ type SolanaSignMessageRpcInput as SolanaSignMessageRpcInput,
1903
+ type EthereumSignTransactionRpcResponse as EthereumSignTransactionRpcResponse,
1904
+ type EthereumSendTransactionRpcResponse as EthereumSendTransactionRpcResponse,
1905
+ type EthereumPersonalSignRpcResponse as EthereumPersonalSignRpcResponse,
1906
+ type EthereumSignTypedDataRpcResponse as EthereumSignTypedDataRpcResponse,
1907
+ type EthereumSign7702AuthorizationRpcResponse as EthereumSign7702AuthorizationRpcResponse,
1908
+ type EthereumSecp256k1SignRpcResponse as EthereumSecp256k1SignRpcResponse,
1909
+ type SolanaSignTransactionRpcResponse as SolanaSignTransactionRpcResponse,
1910
+ type SolanaSignAndSendTransactionRpcResponse as SolanaSignAndSendTransactionRpcResponse,
1911
+ type SolanaSignMessageRpcResponse as SolanaSignMessageRpcResponse,
1577
1912
  type WalletExportResponse as WalletExportResponse,
1578
1913
  type WalletInitImportResponse as WalletInitImportResponse,
1579
1914
  type WalletRawSignResponse as WalletRawSignResponse,