@privy-io/node 0.5.0 → 0.6.1

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 (74) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/client.d.mts +8 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +8 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +3 -3
  11. package/resources/analytics.d.mts +17 -0
  12. package/resources/analytics.d.mts.map +1 -0
  13. package/resources/analytics.d.ts +17 -0
  14. package/resources/analytics.d.ts.map +1 -0
  15. package/resources/analytics.js +9 -0
  16. package/resources/analytics.js.map +1 -0
  17. package/resources/analytics.mjs +5 -0
  18. package/resources/analytics.mjs.map +1 -0
  19. package/resources/apps.d.mts +126 -0
  20. package/resources/apps.d.mts.map +1 -0
  21. package/resources/apps.d.ts +126 -0
  22. package/resources/apps.d.ts.map +1 -0
  23. package/resources/apps.js +9 -0
  24. package/resources/apps.js.map +1 -0
  25. package/resources/apps.mjs +5 -0
  26. package/resources/apps.mjs.map +1 -0
  27. package/resources/index.d.mts +3 -1
  28. package/resources/index.d.mts.map +1 -1
  29. package/resources/index.d.ts +3 -1
  30. package/resources/index.d.ts.map +1 -1
  31. package/resources/index.js +5 -1
  32. package/resources/index.js.map +1 -1
  33. package/resources/index.mjs +2 -0
  34. package/resources/index.mjs.map +1 -1
  35. package/resources/policies.d.mts +122 -18
  36. package/resources/policies.d.mts.map +1 -1
  37. package/resources/policies.d.ts +122 -18
  38. package/resources/policies.d.ts.map +1 -1
  39. package/resources/users.d.mts +4 -1
  40. package/resources/users.d.mts.map +1 -1
  41. package/resources/users.d.ts +4 -1
  42. package/resources/users.d.ts.map +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 +123 -9
  56. package/resources/wallets/wallets.d.mts.map +1 -1
  57. package/resources/wallets/wallets.d.ts +123 -9
  58. package/resources/wallets/wallets.d.ts.map +1 -1
  59. package/resources/wallets/wallets.js.map +1 -1
  60. package/resources/wallets/wallets.mjs.map +1 -1
  61. package/src/client.ts +18 -0
  62. package/src/resources/analytics.ts +20 -0
  63. package/src/resources/apps.ts +213 -0
  64. package/src/resources/index.ts +6 -0
  65. package/src/resources/policies.ts +210 -2
  66. package/src/resources/users.ts +4 -14
  67. package/src/resources/wallets/index.ts +4 -0
  68. package/src/resources/wallets/transactions.ts +2 -2
  69. package/src/resources/wallets/wallets.ts +185 -19
  70. package/src/version.ts +1 -1
  71. package/version.d.mts +1 -1
  72. package/version.d.ts +1 -1
  73. package/version.js +1 -1
  74. package/version.mjs +1 -1
@@ -13,7 +13,7 @@ export class Transactions extends APIResource {
13
13
  * ```ts
14
14
  * const transaction = await client.wallets.transactions.get(
15
15
  * 'wallet_id',
16
- * { asset: 'usdc', chain: 'base' },
16
+ * { asset: 'usdc', chain: 'ethereum' },
17
17
  * );
18
18
  * ```
19
19
  */
@@ -141,7 +141,7 @@ export namespace TransactionGetResponse {
141
141
  export interface TransactionGetParams {
142
142
  asset: 'usdc' | 'eth' | 'pol' | 'usdt' | 'sol' | Array<'usdc' | 'eth' | 'pol' | 'usdt' | 'sol'>;
143
143
 
144
- chain: 'base';
144
+ chain: 'ethereum' | 'arbitrum' | 'base' | 'linea' | 'optimism' | 'polygon' | 'solana' | 'sepolia';
145
145
 
146
146
  cursor?: string;
147
147
 
@@ -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'
@@ -376,6 +392,13 @@ export type WalletChainType =
376
392
  | 'starknet'
377
393
  | 'spark';
378
394
 
395
+ /**
396
+ * Information about the custodian managing this wallet.
397
+ */
398
+ export interface WalletCustodian {
399
+ name: string;
400
+ }
401
+
379
402
  /**
380
403
  * Executes the EVM `personal_sign` RPC (EIP-191) to sign a message.
381
404
  */
@@ -531,6 +554,57 @@ export namespace EthereumSignTypedDataRpcInput {
531
554
  }
532
555
  }
533
556
 
557
+ /**
558
+ * Executes an RPC method to hash and sign a UserOperation.
559
+ */
560
+ export interface EthereumSignUserOperationRpcInput {
561
+ method: 'eth_signUserOperation';
562
+
563
+ params: EthereumSignUserOperationRpcInput.Params;
564
+
565
+ address?: string;
566
+
567
+ chain_type?: 'ethereum';
568
+ }
569
+
570
+ export namespace EthereumSignUserOperationRpcInput {
571
+ export interface Params {
572
+ chain_id: string | number;
573
+
574
+ contract: string;
575
+
576
+ user_operation: Params.UserOperation;
577
+ }
578
+
579
+ export namespace Params {
580
+ export interface UserOperation {
581
+ call_data: string;
582
+
583
+ call_gas_limit: string;
584
+
585
+ max_fee_per_gas: string;
586
+
587
+ max_priority_fee_per_gas: string;
588
+
589
+ nonce: string;
590
+
591
+ paymaster: string;
592
+
593
+ paymaster_data: string;
594
+
595
+ paymaster_post_op_gas_limit: string;
596
+
597
+ paymaster_verification_gas_limit: string;
598
+
599
+ pre_verification_gas: string;
600
+
601
+ sender: string;
602
+
603
+ verification_gas_limit: string;
604
+ }
605
+ }
606
+ }
607
+
534
608
  /**
535
609
  * Signs an EIP-7702 authorization.
536
610
  */
@@ -739,6 +813,23 @@ export namespace EthereumSignTypedDataRpcResponse {
739
813
  }
740
814
  }
741
815
 
816
+ /**
817
+ * Response to the EVM `eth_signUserOperation` RPC.
818
+ */
819
+ export interface EthereumSignUserOperationRpcResponse {
820
+ data: EthereumSignUserOperationRpcResponse.Data;
821
+
822
+ method: 'eth_signUserOperation';
823
+ }
824
+
825
+ export namespace EthereumSignUserOperationRpcResponse {
826
+ export interface Data {
827
+ encoding: 'hex';
828
+
829
+ signature: string;
830
+ }
831
+ }
832
+
742
833
  /**
743
834
  * Response to the EVM `eth_sign7702Authorization` RPC.
744
835
  */
@@ -872,6 +963,8 @@ export interface WalletInitImportResponse {
872
963
 
873
964
  export interface WalletRawSignResponse {
874
965
  data: WalletRawSignResponse.Data;
966
+
967
+ method: 'raw_sign';
875
968
  }
876
969
 
877
970
  export namespace WalletRawSignResponse {
@@ -890,6 +983,7 @@ export type WalletRpcResponse =
890
983
  | EthereumSignTypedDataRpcResponse
891
984
  | EthereumSignTransactionRpcResponse
892
985
  | EthereumSendTransactionRpcResponse
986
+ | EthereumSignUserOperationRpcResponse
893
987
  | EthereumSign7702AuthorizationRpcResponse
894
988
  | EthereumSecp256k1SignRpcResponse
895
989
  | SolanaSignMessageRpcResponse
@@ -1034,20 +1128,10 @@ export namespace WalletCreateParams {
1034
1128
  }
1035
1129
 
1036
1130
  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';
1131
+ /**
1132
+ * The wallet chain types.
1133
+ */
1134
+ chain_type?: WalletChainType;
1051
1135
 
1052
1136
  user_id?: string;
1053
1137
  }
@@ -1157,7 +1241,7 @@ export namespace WalletRawSignParams {
1157
1241
  }
1158
1242
 
1159
1243
  /**
1160
- * Hash and sign bytes (Tron only)
1244
+ * Hash and sign bytes using the specified encoding and hash function.
1161
1245
  */
1162
1246
  export interface Bytes {
1163
1247
  /**
@@ -1166,9 +1250,14 @@ export namespace WalletRawSignParams {
1166
1250
  bytes: string;
1167
1251
 
1168
1252
  /**
1169
- * Encoding scheme. Currently only utf-8 is supported.
1253
+ * The encoding scheme for the bytes.
1254
+ */
1255
+ encoding: 'utf-8' | 'hex';
1256
+
1257
+ /**
1258
+ * The hash function to hash the bytes.
1170
1259
  */
1171
- encoding: 'utf-8';
1260
+ hash_function: 'keccak256' | 'sha256';
1172
1261
  }
1173
1262
  }
1174
1263
 
@@ -1176,6 +1265,7 @@ export type WalletRpcParams =
1176
1265
  | WalletRpcParams.EthereumPersonalSignRpcInput
1177
1266
  | WalletRpcParams.EthereumSignTypedDataRpcInput
1178
1267
  | WalletRpcParams.EthereumSignTransactionRpcInput
1268
+ | WalletRpcParams.EthereumSignUserOperationRpcInput
1179
1269
  | WalletRpcParams.EthereumSendTransactionRpcInput
1180
1270
  | WalletRpcParams.EthereumSign7702AuthorizationRpcInput
1181
1271
  | WalletRpcParams.EthereumSecp256k1SignRpcInput
@@ -1352,6 +1442,78 @@ export declare namespace WalletRpcParams {
1352
1442
  }
1353
1443
  }
1354
1444
 
1445
+ export interface EthereumSignUserOperationRpcInput {
1446
+ /**
1447
+ * Body param:
1448
+ */
1449
+ method: 'eth_signUserOperation';
1450
+
1451
+ /**
1452
+ * Body param:
1453
+ */
1454
+ params: EthereumSignUserOperationRpcInput.Params;
1455
+
1456
+ /**
1457
+ * Body param:
1458
+ */
1459
+ address?: string;
1460
+
1461
+ /**
1462
+ * Body param:
1463
+ */
1464
+ chain_type?: 'ethereum';
1465
+
1466
+ /**
1467
+ * Header param: Request authorization signature. If multiple signatures are
1468
+ * required, they should be comma separated.
1469
+ */
1470
+ 'privy-authorization-signature'?: string;
1471
+
1472
+ /**
1473
+ * Header param: Idempotency keys ensure API requests are executed only once within
1474
+ * a 24-hour window.
1475
+ */
1476
+ 'privy-idempotency-key'?: string;
1477
+ }
1478
+
1479
+ export namespace EthereumSignUserOperationRpcInput {
1480
+ export interface Params {
1481
+ chain_id: string | number;
1482
+
1483
+ contract: string;
1484
+
1485
+ user_operation: Params.UserOperation;
1486
+ }
1487
+
1488
+ export namespace Params {
1489
+ export interface UserOperation {
1490
+ call_data: string;
1491
+
1492
+ call_gas_limit: string;
1493
+
1494
+ max_fee_per_gas: string;
1495
+
1496
+ max_priority_fee_per_gas: string;
1497
+
1498
+ nonce: string;
1499
+
1500
+ paymaster: string;
1501
+
1502
+ paymaster_data: string;
1503
+
1504
+ paymaster_post_op_gas_limit: string;
1505
+
1506
+ paymaster_verification_gas_limit: string;
1507
+
1508
+ pre_verification_gas: string;
1509
+
1510
+ sender: string;
1511
+
1512
+ verification_gas_limit: string;
1513
+ }
1514
+ }
1515
+ }
1516
+
1355
1517
  export interface EthereumSendTransactionRpcInput {
1356
1518
  /**
1357
1519
  * Body param:
@@ -1891,10 +2053,13 @@ export declare namespace Wallets {
1891
2053
  type FirstClassChainType as FirstClassChainType,
1892
2054
  type Wallet as Wallet,
1893
2055
  type WalletChainType as WalletChainType,
2056
+ type ExtendedChainType as ExtendedChainType,
2057
+ type WalletCustodian as WalletCustodian,
1894
2058
  type EthereumPersonalSignRpcInput as EthereumPersonalSignRpcInput,
1895
2059
  type EthereumSignTransactionRpcInput as EthereumSignTransactionRpcInput,
1896
2060
  type EthereumSendTransactionRpcInput as EthereumSendTransactionRpcInput,
1897
2061
  type EthereumSignTypedDataRpcInput as EthereumSignTypedDataRpcInput,
2062
+ type EthereumSignUserOperationRpcInput as EthereumSignUserOperationRpcInput,
1898
2063
  type EthereumSign7702AuthorizationRpcInput as EthereumSign7702AuthorizationRpcInput,
1899
2064
  type EthereumSecp256k1SignRpcInput as EthereumSecp256k1SignRpcInput,
1900
2065
  type SolanaSignTransactionRpcInput as SolanaSignTransactionRpcInput,
@@ -1904,6 +2069,7 @@ export declare namespace Wallets {
1904
2069
  type EthereumSendTransactionRpcResponse as EthereumSendTransactionRpcResponse,
1905
2070
  type EthereumPersonalSignRpcResponse as EthereumPersonalSignRpcResponse,
1906
2071
  type EthereumSignTypedDataRpcResponse as EthereumSignTypedDataRpcResponse,
2072
+ type EthereumSignUserOperationRpcResponse as EthereumSignUserOperationRpcResponse,
1907
2073
  type EthereumSign7702AuthorizationRpcResponse as EthereumSign7702AuthorizationRpcResponse,
1908
2074
  type EthereumSecp256k1SignRpcResponse as EthereumSecp256k1SignRpcResponse,
1909
2075
  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.1'; // 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.1";
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.1";
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.1'; // 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.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map