@privy-io/node 0.5.0 → 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 (52) hide show
  1. package/CHANGELOG.md +12 -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/index.d.mts +1 -1
  10. package/resources/index.d.mts.map +1 -1
  11. package/resources/index.d.ts +1 -1
  12. package/resources/index.d.ts.map +1 -1
  13. package/resources/index.js.map +1 -1
  14. package/resources/index.mjs.map +1 -1
  15. package/resources/policies.d.mts +122 -18
  16. package/resources/policies.d.mts.map +1 -1
  17. package/resources/policies.d.ts +122 -18
  18. package/resources/policies.d.ts.map +1 -1
  19. package/resources/users.d.mts +4 -1
  20. package/resources/users.d.mts.map +1 -1
  21. package/resources/users.d.ts +4 -1
  22. package/resources/users.d.ts.map +1 -1
  23. package/resources/wallets/index.d.mts +1 -1
  24. package/resources/wallets/index.d.mts.map +1 -1
  25. package/resources/wallets/index.d.ts +1 -1
  26. package/resources/wallets/index.d.ts.map +1 -1
  27. package/resources/wallets/index.js.map +1 -1
  28. package/resources/wallets/index.mjs.map +1 -1
  29. package/resources/wallets/transactions.d.mts +2 -2
  30. package/resources/wallets/transactions.d.mts.map +1 -1
  31. package/resources/wallets/transactions.d.ts +2 -2
  32. package/resources/wallets/transactions.d.ts.map +1 -1
  33. package/resources/wallets/transactions.js +1 -1
  34. package/resources/wallets/transactions.mjs +1 -1
  35. package/resources/wallets/wallets.d.mts +118 -11
  36. package/resources/wallets/wallets.d.mts.map +1 -1
  37. package/resources/wallets/wallets.d.ts +118 -11
  38. package/resources/wallets/wallets.d.ts.map +1 -1
  39. package/resources/wallets/wallets.js.map +1 -1
  40. package/resources/wallets/wallets.mjs.map +1 -1
  41. package/src/client.ts +6 -0
  42. package/src/resources/index.ts +3 -0
  43. package/src/resources/policies.ts +210 -2
  44. package/src/resources/users.ts +4 -14
  45. package/src/resources/wallets/index.ts +3 -0
  46. package/src/resources/wallets/transactions.ts +2 -2
  47. package/src/resources/wallets/wallets.ts +177 -21
  48. package/src/version.ts +1 -1
  49. package/version.d.mts +1 -1
  50. package/version.d.ts +1 -1
  51. package/version.js +1 -1
  52. package/version.mjs +1 -1
@@ -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,24 @@ export namespace Wallet {
362
362
  * The wallet chain types.
363
363
  */
364
364
  export type WalletChainType =
365
- | 'solana'
366
365
  | 'ethereum'
366
+ | 'solana'
367
+ | 'cosmos'
368
+ | 'stellar'
369
+ | 'sui'
370
+ | 'aptos'
371
+ | 'movement'
372
+ | 'tron'
373
+ | 'bitcoin-segwit'
374
+ | 'near'
375
+ | 'ton'
376
+ | 'starknet'
377
+ | 'spark';
378
+
379
+ /**
380
+ * The wallet chain types that are not first class chains.
381
+ */
382
+ export type ExtendedChainType =
367
383
  | 'cosmos'
368
384
  | 'stellar'
369
385
  | 'sui'
@@ -531,6 +547,57 @@ export namespace EthereumSignTypedDataRpcInput {
531
547
  }
532
548
  }
533
549
 
550
+ /**
551
+ * Executes an RPC method to hash and sign a UserOperation.
552
+ */
553
+ export interface EthereumSignUserOperationRpcInput {
554
+ method: 'eth_signUserOperation';
555
+
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;
570
+ }
571
+
572
+ export namespace Params {
573
+ export interface UserOperation {
574
+ call_data: string;
575
+
576
+ call_gas_limit: string;
577
+
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;
597
+ }
598
+ }
599
+ }
600
+
534
601
  /**
535
602
  * Signs an EIP-7702 authorization.
536
603
  */
@@ -739,6 +806,23 @@ export namespace EthereumSignTypedDataRpcResponse {
739
806
  }
740
807
  }
741
808
 
809
+ /**
810
+ * Response to the EVM `eth_signUserOperation` RPC.
811
+ */
812
+ export interface EthereumSignUserOperationRpcResponse {
813
+ data: EthereumSignUserOperationRpcResponse.Data;
814
+
815
+ method: 'eth_signUserOperation';
816
+ }
817
+
818
+ export namespace EthereumSignUserOperationRpcResponse {
819
+ export interface Data {
820
+ encoding: 'hex';
821
+
822
+ signature: string;
823
+ }
824
+ }
825
+
742
826
  /**
743
827
  * Response to the EVM `eth_sign7702Authorization` RPC.
744
828
  */
@@ -890,6 +974,7 @@ export type WalletRpcResponse =
890
974
  | EthereumSignTypedDataRpcResponse
891
975
  | EthereumSignTransactionRpcResponse
892
976
  | EthereumSendTransactionRpcResponse
977
+ | EthereumSignUserOperationRpcResponse
893
978
  | EthereumSign7702AuthorizationRpcResponse
894
979
  | EthereumSecp256k1SignRpcResponse
895
980
  | SolanaSignMessageRpcResponse
@@ -1034,20 +1119,10 @@ export namespace WalletCreateParams {
1034
1119
  }
1035
1120
 
1036
1121
  export interface WalletListParams extends CursorParams {
1037
- chain_type?:
1038
- | 'cosmos'
1039
- | 'stellar'
1040
- | 'sui'
1041
- | 'aptos'
1042
- | 'movement'
1043
- | 'tron'
1044
- | 'bitcoin-segwit'
1045
- | 'near'
1046
- | 'ton'
1047
- | 'starknet'
1048
- | 'spark'
1049
- | 'solana'
1050
- | 'ethereum';
1122
+ /**
1123
+ * The wallet chain types.
1124
+ */
1125
+ chain_type?: WalletChainType;
1051
1126
 
1052
1127
  user_id?: string;
1053
1128
  }
@@ -1130,7 +1205,7 @@ export interface WalletRawSignParams {
1130
1205
  /**
1131
1206
  * Body param: Sign a pre-computed hash
1132
1207
  */
1133
- params: WalletRawSignParams.Hash | WalletRawSignParams.Bytes;
1208
+ params: WalletRawSignParams.Hash | WalletRawSignParams.UnionMember1;
1134
1209
 
1135
1210
  /**
1136
1211
  * Header param: Request authorization signature. If multiple signatures are
@@ -1157,18 +1232,23 @@ export namespace WalletRawSignParams {
1157
1232
  }
1158
1233
 
1159
1234
  /**
1160
- * Hash and sign bytes (Tron only)
1235
+ * Hash and sign bytes
1161
1236
  */
1162
- export interface Bytes {
1237
+ export interface UnionMember1 {
1163
1238
  /**
1164
1239
  * The bytes to hash and sign.
1165
1240
  */
1166
1241
  bytes: string;
1167
1242
 
1168
1243
  /**
1169
- * 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.
1170
1250
  */
1171
- encoding: 'utf-8';
1251
+ hash_function: 'keccak256' | 'sha256';
1172
1252
  }
1173
1253
  }
1174
1254
 
@@ -1176,6 +1256,7 @@ export type WalletRpcParams =
1176
1256
  | WalletRpcParams.EthereumPersonalSignRpcInput
1177
1257
  | WalletRpcParams.EthereumSignTypedDataRpcInput
1178
1258
  | WalletRpcParams.EthereumSignTransactionRpcInput
1259
+ | WalletRpcParams.EthereumSignUserOperationRpcInput
1179
1260
  | WalletRpcParams.EthereumSendTransactionRpcInput
1180
1261
  | WalletRpcParams.EthereumSign7702AuthorizationRpcInput
1181
1262
  | WalletRpcParams.EthereumSecp256k1SignRpcInput
@@ -1352,6 +1433,78 @@ export declare namespace WalletRpcParams {
1352
1433
  }
1353
1434
  }
1354
1435
 
1436
+ export interface EthereumSignUserOperationRpcInput {
1437
+ /**
1438
+ * Body param:
1439
+ */
1440
+ method: 'eth_signUserOperation';
1441
+
1442
+ /**
1443
+ * Body param:
1444
+ */
1445
+ params: EthereumSignUserOperationRpcInput.Params;
1446
+
1447
+ /**
1448
+ * Body param:
1449
+ */
1450
+ address?: string;
1451
+
1452
+ /**
1453
+ * Body param:
1454
+ */
1455
+ chain_type?: 'ethereum';
1456
+
1457
+ /**
1458
+ * Header param: Request authorization signature. If multiple signatures are
1459
+ * required, they should be comma separated.
1460
+ */
1461
+ 'privy-authorization-signature'?: string;
1462
+
1463
+ /**
1464
+ * Header param: Idempotency keys ensure API requests are executed only once within
1465
+ * a 24-hour window.
1466
+ */
1467
+ 'privy-idempotency-key'?: string;
1468
+ }
1469
+
1470
+ export namespace EthereumSignUserOperationRpcInput {
1471
+ export interface Params {
1472
+ chain_id: string | number;
1473
+
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
+ }
1505
+ }
1506
+ }
1507
+
1355
1508
  export interface EthereumSendTransactionRpcInput {
1356
1509
  /**
1357
1510
  * Body param:
@@ -1891,10 +2044,12 @@ export declare namespace Wallets {
1891
2044
  type FirstClassChainType as FirstClassChainType,
1892
2045
  type Wallet as Wallet,
1893
2046
  type WalletChainType as WalletChainType,
2047
+ type ExtendedChainType as ExtendedChainType,
1894
2048
  type EthereumPersonalSignRpcInput as EthereumPersonalSignRpcInput,
1895
2049
  type EthereumSignTransactionRpcInput as EthereumSignTransactionRpcInput,
1896
2050
  type EthereumSendTransactionRpcInput as EthereumSendTransactionRpcInput,
1897
2051
  type EthereumSignTypedDataRpcInput as EthereumSignTypedDataRpcInput,
2052
+ type EthereumSignUserOperationRpcInput as EthereumSignUserOperationRpcInput,
1898
2053
  type EthereumSign7702AuthorizationRpcInput as EthereumSign7702AuthorizationRpcInput,
1899
2054
  type EthereumSecp256k1SignRpcInput as EthereumSecp256k1SignRpcInput,
1900
2055
  type SolanaSignTransactionRpcInput as SolanaSignTransactionRpcInput,
@@ -1904,6 +2059,7 @@ export declare namespace Wallets {
1904
2059
  type EthereumSendTransactionRpcResponse as EthereumSendTransactionRpcResponse,
1905
2060
  type EthereumPersonalSignRpcResponse as EthereumPersonalSignRpcResponse,
1906
2061
  type EthereumSignTypedDataRpcResponse as EthereumSignTypedDataRpcResponse,
2062
+ type EthereumSignUserOperationRpcResponse as EthereumSignUserOperationRpcResponse,
1907
2063
  type EthereumSign7702AuthorizationRpcResponse as EthereumSign7702AuthorizationRpcResponse,
1908
2064
  type EthereumSecp256k1SignRpcResponse as EthereumSecp256k1SignRpcResponse,
1909
2065
  type SolanaSignTransactionRpcResponse as SolanaSignTransactionRpcResponse,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.5.0'; // x-release-please-version
1
+ export const VERSION = '0.6.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.5.0";
1
+ export declare const VERSION = "0.6.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.5.0";
1
+ export declare const VERSION = "0.6.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.5.0'; // x-release-please-version
4
+ exports.VERSION = '0.6.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.5.0'; // x-release-please-version
1
+ export const VERSION = '0.6.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map