@privy-io/node 0.2.0 → 0.4.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 (120) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +1 -1
  3. package/client.d.mts +7 -4
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +7 -4
  6. package/client.d.ts.map +1 -1
  7. package/client.js +3 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +3 -0
  10. package/client.mjs.map +1 -1
  11. package/index.d.mts +1 -1
  12. package/index.d.mts.map +1 -1
  13. package/index.d.ts +1 -1
  14. package/index.d.ts.map +1 -1
  15. package/internal/to-file.d.mts +1 -1
  16. package/internal/to-file.d.ts +1 -1
  17. package/internal/to-file.js +1 -1
  18. package/internal/to-file.mjs +1 -1
  19. package/lib/identity-token.d.mts.map +1 -1
  20. package/lib/identity-token.d.ts.map +1 -1
  21. package/lib/identity-token.js +1 -0
  22. package/lib/identity-token.js.map +1 -1
  23. package/lib/identity-token.mjs +1 -0
  24. package/lib/identity-token.mjs.map +1 -1
  25. package/lib/user-utils.d.mts +5 -9
  26. package/lib/user-utils.d.mts.map +1 -1
  27. package/lib/user-utils.d.ts +5 -9
  28. package/lib/user-utils.d.ts.map +1 -1
  29. package/lib/user-utils.js.map +1 -1
  30. package/lib/user-utils.mjs.map +1 -1
  31. package/package.json +4 -3
  32. package/public-api/PrivyClient.d.mts +5 -1
  33. package/public-api/PrivyClient.d.mts.map +1 -1
  34. package/public-api/PrivyClient.d.ts +5 -1
  35. package/public-api/PrivyClient.d.ts.map +1 -1
  36. package/public-api/PrivyClient.js +6 -1
  37. package/public-api/PrivyClient.js.map +1 -1
  38. package/public-api/PrivyClient.mjs +6 -1
  39. package/public-api/PrivyClient.mjs.map +1 -1
  40. package/public-api/services/webhooks.d.mts +34 -0
  41. package/public-api/services/webhooks.d.mts.map +1 -0
  42. package/public-api/services/webhooks.d.ts +34 -0
  43. package/public-api/services/webhooks.d.ts.map +1 -0
  44. package/public-api/services/webhooks.js +48 -0
  45. package/public-api/services/webhooks.js.map +1 -0
  46. package/public-api/services/webhooks.mjs +43 -0
  47. package/public-api/services/webhooks.mjs.map +1 -0
  48. package/resources/client-auth.d.mts +24 -0
  49. package/resources/client-auth.d.mts.map +1 -0
  50. package/resources/client-auth.d.ts +24 -0
  51. package/resources/client-auth.d.ts.map +1 -0
  52. package/resources/client-auth.js +9 -0
  53. package/resources/client-auth.js.map +1 -0
  54. package/resources/client-auth.mjs +5 -0
  55. package/resources/client-auth.mjs.map +1 -0
  56. package/resources/index.d.mts +3 -2
  57. package/resources/index.d.mts.map +1 -1
  58. package/resources/index.d.ts +3 -2
  59. package/resources/index.d.ts.map +1 -1
  60. package/resources/index.js +3 -1
  61. package/resources/index.js.map +1 -1
  62. package/resources/index.mjs +1 -0
  63. package/resources/index.mjs.map +1 -1
  64. package/resources/policies.d.mts +76 -76
  65. package/resources/policies.d.mts.map +1 -1
  66. package/resources/policies.d.ts +76 -76
  67. package/resources/policies.d.ts.map +1 -1
  68. package/resources/policies.js +4 -4
  69. package/resources/policies.mjs +4 -4
  70. package/resources/transactions.d.mts +1 -1
  71. package/resources/transactions.d.mts.map +1 -1
  72. package/resources/transactions.d.ts +1 -1
  73. package/resources/transactions.d.ts.map +1 -1
  74. package/resources/users.d.mts +215 -98
  75. package/resources/users.d.mts.map +1 -1
  76. package/resources/users.d.ts +215 -98
  77. package/resources/users.d.ts.map +1 -1
  78. package/resources/users.js.map +1 -1
  79. package/resources/users.mjs.map +1 -1
  80. package/resources/wallets/balance.d.mts +4 -4
  81. package/resources/wallets/balance.d.mts.map +1 -1
  82. package/resources/wallets/balance.d.ts +4 -4
  83. package/resources/wallets/balance.d.ts.map +1 -1
  84. package/resources/wallets/index.d.mts +1 -1
  85. package/resources/wallets/index.d.mts.map +1 -1
  86. package/resources/wallets/index.d.ts +1 -1
  87. package/resources/wallets/index.d.ts.map +1 -1
  88. package/resources/wallets/index.js.map +1 -1
  89. package/resources/wallets/index.mjs.map +1 -1
  90. package/resources/wallets/transactions.d.mts +6 -6
  91. package/resources/wallets/transactions.d.mts.map +1 -1
  92. package/resources/wallets/transactions.d.ts +6 -6
  93. package/resources/wallets/transactions.d.ts.map +1 -1
  94. package/resources/wallets/wallets.d.mts +38 -14
  95. package/resources/wallets/wallets.d.mts.map +1 -1
  96. package/resources/wallets/wallets.d.ts +38 -14
  97. package/resources/wallets/wallets.d.ts.map +1 -1
  98. package/resources/wallets/wallets.js.map +1 -1
  99. package/resources/wallets/wallets.mjs.map +1 -1
  100. package/src/client.ts +45 -0
  101. package/src/index.ts +1 -1
  102. package/src/internal/to-file.ts +1 -1
  103. package/src/lib/identity-token.ts +22 -21
  104. package/src/lib/user-utils.ts +6 -10
  105. package/src/public-api/PrivyClient.ts +9 -0
  106. package/src/public-api/services/webhooks.ts +63 -0
  107. package/src/resources/client-auth.ts +46 -0
  108. package/src/resources/index.ts +21 -0
  109. package/src/resources/policies.ts +76 -76
  110. package/src/resources/transactions.ts +9 -1
  111. package/src/resources/users.ts +390 -184
  112. package/src/resources/wallets/balance.ts +45 -4
  113. package/src/resources/wallets/index.ts +3 -0
  114. package/src/resources/wallets/transactions.ts +48 -8
  115. package/src/resources/wallets/wallets.ts +69 -52
  116. package/src/version.ts +1 -1
  117. package/version.d.mts +1 -1
  118. package/version.d.ts +1 -1
  119. package/version.js +1 -1
  120. package/version.mjs +1 -1
@@ -28,9 +28,25 @@ export interface BalanceGetResponse {
28
28
 
29
29
  export namespace BalanceGetResponse {
30
30
  export interface Balance {
31
- asset: 'usdc' | 'eth' | 'pol' | 'sol';
31
+ asset: 'usdc' | 'eth' | 'pol' | 'usdt' | 'sol';
32
32
 
33
- chain: 'ethereum' | 'arbitrum' | 'base' | 'linea' | 'optimism' | 'polygon' | 'solana' | 'zksync_era';
33
+ chain:
34
+ | 'ethereum'
35
+ | 'arbitrum'
36
+ | 'base'
37
+ | 'linea'
38
+ | 'optimism'
39
+ | 'polygon'
40
+ | 'solana'
41
+ | 'zksync_era'
42
+ | 'sepolia'
43
+ | 'arbitrum_sepolia'
44
+ | 'base_sepolia'
45
+ | 'linea_testnet'
46
+ | 'optimism_sepolia'
47
+ | 'polygon_amoy'
48
+ | 'solana_devnet'
49
+ | 'solana_testnet';
34
50
 
35
51
  display_values: { [key: string]: string };
36
52
 
@@ -41,7 +57,7 @@ export namespace BalanceGetResponse {
41
57
  }
42
58
 
43
59
  export interface BalanceGetParams {
44
- asset: 'usdc' | 'eth' | 'pol' | 'sol' | Array<'usdc' | 'eth' | 'pol' | 'sol'>;
60
+ asset: 'usdc' | 'eth' | 'pol' | 'usdt' | 'sol' | Array<'usdc' | 'eth' | 'pol' | 'usdt' | 'sol'>;
45
61
 
46
62
  chain:
47
63
  | 'ethereum'
@@ -52,7 +68,32 @@ export interface BalanceGetParams {
52
68
  | 'polygon'
53
69
  | 'solana'
54
70
  | 'zksync_era'
55
- | Array<'ethereum' | 'arbitrum' | 'base' | 'linea' | 'optimism' | 'polygon' | 'solana' | 'zksync_era'>;
71
+ | 'sepolia'
72
+ | 'arbitrum_sepolia'
73
+ | 'base_sepolia'
74
+ | 'linea_testnet'
75
+ | 'optimism_sepolia'
76
+ | 'polygon_amoy'
77
+ | 'solana_devnet'
78
+ | 'solana_testnet'
79
+ | Array<
80
+ | 'ethereum'
81
+ | 'arbitrum'
82
+ | 'base'
83
+ | 'linea'
84
+ | 'optimism'
85
+ | 'polygon'
86
+ | 'solana'
87
+ | 'zksync_era'
88
+ | 'sepolia'
89
+ | 'arbitrum_sepolia'
90
+ | 'base_sepolia'
91
+ | 'linea_testnet'
92
+ | 'optimism_sepolia'
93
+ | 'polygon_amoy'
94
+ | 'solana_devnet'
95
+ | 'solana_testnet'
96
+ >;
56
97
 
57
98
  include_currency?: 'usd';
58
99
  }
@@ -4,7 +4,10 @@ export { Balance, type BalanceGetResponse, type BalanceGetParams } from './balan
4
4
  export { Transactions, type TransactionGetResponse, type TransactionGetParams } from './transactions';
5
5
  export {
6
6
  Wallets,
7
+ type CurveSigningChainType,
8
+ type FirstClassChainType,
7
9
  type Wallet,
10
+ type WalletChainType,
8
11
  type WalletExportResponse,
9
12
  type WalletInitImportResponse,
10
13
  type WalletRawSignResponse,
@@ -42,7 +42,15 @@ export namespace TransactionGetResponse {
42
42
 
43
43
  privy_transaction_id: string;
44
44
 
45
- status: 'broadcasted' | 'confirmed' | 'execution_reverted' | 'failed' | 'replaced';
45
+ status:
46
+ | 'broadcasted'
47
+ | 'confirmed'
48
+ | 'execution_reverted'
49
+ | 'failed'
50
+ | 'replaced'
51
+ | 'finalized'
52
+ | 'provider_error'
53
+ | 'pending';
46
54
 
47
55
  transaction_hash: string | null;
48
56
 
@@ -53,9 +61,25 @@ export namespace TransactionGetResponse {
53
61
 
54
62
  export namespace Transaction {
55
63
  export interface UnionMember0 {
56
- asset: 'usdc' | 'eth' | 'pol' | 'sol';
57
-
58
- chain: 'ethereum' | 'arbitrum' | 'base' | 'linea' | 'optimism' | 'polygon' | 'solana' | 'zksync_era';
64
+ asset: 'usdc' | 'eth' | 'pol' | 'usdt' | 'sol';
65
+
66
+ chain:
67
+ | 'ethereum'
68
+ | 'arbitrum'
69
+ | 'base'
70
+ | 'linea'
71
+ | 'optimism'
72
+ | 'polygon'
73
+ | 'solana'
74
+ | 'zksync_era'
75
+ | 'sepolia'
76
+ | 'arbitrum_sepolia'
77
+ | 'base_sepolia'
78
+ | 'linea_testnet'
79
+ | 'optimism_sepolia'
80
+ | 'polygon_amoy'
81
+ | 'solana_devnet'
82
+ | 'solana_testnet';
59
83
 
60
84
  display_values: { [key: string]: string };
61
85
 
@@ -75,9 +99,25 @@ export namespace TransactionGetResponse {
75
99
  }
76
100
 
77
101
  export interface UnionMember1 {
78
- asset: 'usdc' | 'eth' | 'pol' | 'sol';
79
-
80
- chain: 'ethereum' | 'arbitrum' | 'base' | 'linea' | 'optimism' | 'polygon' | 'solana' | 'zksync_era';
102
+ asset: 'usdc' | 'eth' | 'pol' | 'usdt' | 'sol';
103
+
104
+ chain:
105
+ | 'ethereum'
106
+ | 'arbitrum'
107
+ | 'base'
108
+ | 'linea'
109
+ | 'optimism'
110
+ | 'polygon'
111
+ | 'solana'
112
+ | 'zksync_era'
113
+ | 'sepolia'
114
+ | 'arbitrum_sepolia'
115
+ | 'base_sepolia'
116
+ | 'linea_testnet'
117
+ | 'optimism_sepolia'
118
+ | 'polygon_amoy'
119
+ | 'solana_devnet'
120
+ | 'solana_testnet';
81
121
 
82
122
  display_values: { [key: string]: string };
83
123
 
@@ -99,7 +139,7 @@ export namespace TransactionGetResponse {
99
139
  }
100
140
 
101
141
  export interface TransactionGetParams {
102
- asset: 'usdc' | 'eth' | 'pol' | 'sol' | Array<'usdc' | 'eth' | 'pol' | 'sol'>;
142
+ asset: 'usdc' | 'eth' | 'pol' | 'usdt' | 'sol' | Array<'usdc' | 'eth' | 'pol' | 'usdt' | 'sol'>;
103
143
 
104
144
  chain: 'base';
105
145
 
@@ -266,6 +266,26 @@ export class Wallets extends APIResource {
266
266
 
267
267
  export type WalletsCursor = Cursor<Wallet>;
268
268
 
269
+ /**
270
+ * The wallet chain types that support curve-based signing.
271
+ */
272
+ export type CurveSigningChainType =
273
+ | 'cosmos'
274
+ | 'stellar'
275
+ | 'sui'
276
+ | 'aptos'
277
+ | 'movement'
278
+ | 'tron'
279
+ | 'bitcoin-segwit'
280
+ | 'near'
281
+ | 'ton'
282
+ | 'starknet';
283
+
284
+ /**
285
+ * The wallet chain types that offer first class support.
286
+ */
287
+ export type FirstClassChainType = 'solana' | 'ethereum';
288
+
269
289
  export interface Wallet {
270
290
  /**
271
291
  * Unique ID of the wallet. This will be the primary identifier when using the
@@ -284,21 +304,9 @@ export interface Wallet {
284
304
  address: string;
285
305
 
286
306
  /**
287
- * Chain type of the wallet
307
+ * The wallet chain types.
288
308
  */
289
- chain_type:
290
- | 'solana'
291
- | 'ethereum'
292
- | 'cosmos'
293
- | 'stellar'
294
- | 'sui'
295
- | 'tron'
296
- | 'bitcoin-segwit'
297
- | 'near'
298
- | 'spark'
299
- | 'ton'
300
- | 'starknet'
301
- | 'movement';
309
+ chain_type: WalletChainType;
302
310
 
303
311
  /**
304
312
  * Unix timestamp of when the wallet was created in milliseconds.
@@ -318,14 +326,14 @@ export interface Wallet {
318
326
  imported_at: number | null;
319
327
 
320
328
  /**
321
- * List of policy IDs for policies that are enforced on the wallet.
329
+ * The key quorum ID of the owner of the wallet.
322
330
  */
323
- policy_ids: Array<string>;
331
+ owner_id: string | null;
324
332
 
325
333
  /**
326
- * The key quorum ID of the owner of the wallet.
334
+ * List of policy IDs for policies that are enforced on the wallet.
327
335
  */
328
- owner_id?: string;
336
+ policy_ids: Array<string>;
329
337
 
330
338
  /**
331
339
  * The compressed, raw public key for the wallet along the chain cryptographic
@@ -336,12 +344,34 @@ export interface Wallet {
336
344
 
337
345
  export namespace Wallet {
338
346
  export interface AdditionalSigner {
339
- override_policy_ids: Array<string>;
340
-
341
347
  signer_id: string;
348
+
349
+ /**
350
+ * The array of policy IDs that will be applied to wallet requests. If specified,
351
+ * this will override the base policy IDs set on the wallet.
352
+ */
353
+ override_policy_ids?: Array<string>;
342
354
  }
343
355
  }
344
356
 
357
+ /**
358
+ * The wallet chain types.
359
+ */
360
+ export type WalletChainType =
361
+ | 'solana'
362
+ | 'ethereum'
363
+ | 'cosmos'
364
+ | 'stellar'
365
+ | 'sui'
366
+ | 'aptos'
367
+ | 'movement'
368
+ | 'tron'
369
+ | 'bitcoin-segwit'
370
+ | 'near'
371
+ | 'ton'
372
+ | 'starknet'
373
+ | 'spark';
374
+
345
375
  export interface WalletExportResponse {
346
376
  /**
347
377
  * The encrypted private key.
@@ -641,21 +671,9 @@ export interface WalletCreateWalletsWithRecoveryResponse {
641
671
 
642
672
  export interface WalletCreateParams {
643
673
  /**
644
- * Body param: Chain type of the wallet
674
+ * Body param: The wallet chain types.
645
675
  */
646
- chain_type:
647
- | 'solana'
648
- | 'ethereum'
649
- | 'cosmos'
650
- | 'stellar'
651
- | 'sui'
652
- | 'tron'
653
- | 'bitcoin-segwit'
654
- | 'near'
655
- | 'spark'
656
- | 'ton'
657
- | 'starknet'
658
- | 'movement';
676
+ chain_type: WalletChainType;
659
677
 
660
678
  /**
661
679
  * Body param: Additional signers for the wallet.
@@ -690,9 +708,13 @@ export interface WalletCreateParams {
690
708
 
691
709
  export namespace WalletCreateParams {
692
710
  export interface AdditionalSigner {
693
- override_policy_ids: Array<string>;
694
-
695
711
  signer_id: string;
712
+
713
+ /**
714
+ * The array of policy IDs that will be applied to wallet requests. If specified,
715
+ * this will override the base policy IDs set on the wallet.
716
+ */
717
+ override_policy_ids?: Array<string>;
696
718
  }
697
719
 
698
720
  /**
@@ -1443,9 +1465,13 @@ export interface WalletUpdateParams {
1443
1465
 
1444
1466
  export namespace WalletUpdateParams {
1445
1467
  export interface AdditionalSigner {
1446
- override_policy_ids: Array<string>;
1447
-
1448
1468
  signer_id: string;
1469
+
1470
+ /**
1471
+ * The array of policy IDs that will be applied to wallet requests. If specified,
1472
+ * this will override the base policy IDs set on the wallet.
1473
+ */
1474
+ override_policy_ids?: Array<string>;
1449
1475
  }
1450
1476
 
1451
1477
  /**
@@ -1527,21 +1553,9 @@ export namespace WalletCreateWalletsWithRecoveryParams {
1527
1553
 
1528
1554
  export interface Wallet {
1529
1555
  /**
1530
- * Chain type of the wallet
1556
+ * The wallet chain types.
1531
1557
  */
1532
- chain_type:
1533
- | 'solana'
1534
- | 'ethereum'
1535
- | 'cosmos'
1536
- | 'stellar'
1537
- | 'sui'
1538
- | 'tron'
1539
- | 'bitcoin-segwit'
1540
- | 'near'
1541
- | 'spark'
1542
- | 'ton'
1543
- | 'starknet'
1544
- | 'movement';
1558
+ chain_type: WalletsAPI.WalletChainType;
1545
1559
 
1546
1560
  /**
1547
1561
  * List of policy IDs for policies that should be enforced on the wallet.
@@ -1556,7 +1570,10 @@ Wallets.Balance = Balance;
1556
1570
 
1557
1571
  export declare namespace Wallets {
1558
1572
  export {
1573
+ type CurveSigningChainType as CurveSigningChainType,
1574
+ type FirstClassChainType as FirstClassChainType,
1559
1575
  type Wallet as Wallet,
1576
+ type WalletChainType as WalletChainType,
1560
1577
  type WalletExportResponse as WalletExportResponse,
1561
1578
  type WalletInitImportResponse as WalletInitImportResponse,
1562
1579
  type WalletRawSignResponse as WalletRawSignResponse,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.2.0'; // x-release-please-version
1
+ export const VERSION = '0.4.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.2.0";
1
+ export declare const VERSION = "0.4.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.2.0";
1
+ export declare const VERSION = "0.4.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.2.0'; // x-release-please-version
4
+ exports.VERSION = '0.4.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.2.0'; // x-release-please-version
1
+ export const VERSION = '0.4.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map