@privy-io/node 0.3.0 → 0.4.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 (99) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +2 -2
  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/lib/identity-token.d.mts.map +1 -1
  16. package/lib/identity-token.d.ts.map +1 -1
  17. package/lib/identity-token.js +1 -0
  18. package/lib/identity-token.js.map +1 -1
  19. package/lib/identity-token.mjs +1 -0
  20. package/lib/identity-token.mjs.map +1 -1
  21. package/lib/user-utils.d.mts +5 -9
  22. package/lib/user-utils.d.mts.map +1 -1
  23. package/lib/user-utils.d.ts +5 -9
  24. package/lib/user-utils.d.ts.map +1 -1
  25. package/lib/user-utils.js.map +1 -1
  26. package/lib/user-utils.mjs.map +1 -1
  27. package/package.json +1 -1
  28. package/resources/client-auth.d.mts +24 -0
  29. package/resources/client-auth.d.mts.map +1 -0
  30. package/resources/client-auth.d.ts +24 -0
  31. package/resources/client-auth.d.ts.map +1 -0
  32. package/resources/client-auth.js +9 -0
  33. package/resources/client-auth.js.map +1 -0
  34. package/resources/client-auth.mjs +5 -0
  35. package/resources/client-auth.mjs.map +1 -0
  36. package/resources/index.d.mts +3 -2
  37. package/resources/index.d.mts.map +1 -1
  38. package/resources/index.d.ts +3 -2
  39. package/resources/index.d.ts.map +1 -1
  40. package/resources/index.js +3 -1
  41. package/resources/index.js.map +1 -1
  42. package/resources/index.mjs +1 -0
  43. package/resources/index.mjs.map +1 -1
  44. package/resources/key-quorums.d.mts +18 -3
  45. package/resources/key-quorums.d.mts.map +1 -1
  46. package/resources/key-quorums.d.ts +18 -3
  47. package/resources/key-quorums.d.ts.map +1 -1
  48. package/resources/policies.d.mts +82 -80
  49. package/resources/policies.d.mts.map +1 -1
  50. package/resources/policies.d.ts +82 -80
  51. package/resources/policies.d.ts.map +1 -1
  52. package/resources/policies.js +4 -4
  53. package/resources/policies.mjs +4 -4
  54. package/resources/users.d.mts +200 -96
  55. package/resources/users.d.mts.map +1 -1
  56. package/resources/users.d.ts +200 -96
  57. package/resources/users.d.ts.map +1 -1
  58. package/resources/users.js.map +1 -1
  59. package/resources/users.mjs.map +1 -1
  60. package/resources/wallets/balance.d.mts +2 -2
  61. package/resources/wallets/balance.d.mts.map +1 -1
  62. package/resources/wallets/balance.d.ts +2 -2
  63. package/resources/wallets/balance.d.ts.map +1 -1
  64. package/resources/wallets/index.d.mts +1 -1
  65. package/resources/wallets/index.d.mts.map +1 -1
  66. package/resources/wallets/index.d.ts +1 -1
  67. package/resources/wallets/index.d.ts.map +1 -1
  68. package/resources/wallets/index.js.map +1 -1
  69. package/resources/wallets/index.mjs.map +1 -1
  70. package/resources/wallets/transactions.d.mts +3 -2
  71. package/resources/wallets/transactions.d.mts.map +1 -1
  72. package/resources/wallets/transactions.d.ts +3 -2
  73. package/resources/wallets/transactions.d.ts.map +1 -1
  74. package/resources/wallets/wallets.d.mts +69 -23
  75. package/resources/wallets/wallets.d.mts.map +1 -1
  76. package/resources/wallets/wallets.d.ts +69 -23
  77. package/resources/wallets/wallets.d.ts.map +1 -1
  78. package/resources/wallets/wallets.js +5 -1
  79. package/resources/wallets/wallets.js.map +1 -1
  80. package/resources/wallets/wallets.mjs +5 -1
  81. package/resources/wallets/wallets.mjs.map +1 -1
  82. package/src/client.ts +45 -0
  83. package/src/index.ts +1 -1
  84. package/src/lib/identity-token.ts +22 -21
  85. package/src/lib/user-utils.ts +6 -10
  86. package/src/resources/client-auth.ts +46 -0
  87. package/src/resources/index.ts +21 -0
  88. package/src/resources/key-quorums.ts +18 -3
  89. package/src/resources/policies.ts +82 -80
  90. package/src/resources/users.ts +367 -187
  91. package/src/resources/wallets/balance.ts +7 -1
  92. package/src/resources/wallets/index.ts +3 -0
  93. package/src/resources/wallets/transactions.ts +8 -2
  94. package/src/resources/wallets/wallets.ts +102 -61
  95. package/src/version.ts +1 -1
  96. package/version.d.mts +1 -1
  97. package/version.d.ts +1 -1
  98. package/version.js +1 -1
  99. package/version.mjs +1 -1
@@ -44,7 +44,9 @@ export namespace BalanceGetResponse {
44
44
  | 'base_sepolia'
45
45
  | 'linea_testnet'
46
46
  | 'optimism_sepolia'
47
- | 'polygon_amoy';
47
+ | 'polygon_amoy'
48
+ | 'solana_devnet'
49
+ | 'solana_testnet';
48
50
 
49
51
  display_values: { [key: string]: string };
50
52
 
@@ -72,6 +74,8 @@ export interface BalanceGetParams {
72
74
  | 'linea_testnet'
73
75
  | 'optimism_sepolia'
74
76
  | 'polygon_amoy'
77
+ | 'solana_devnet'
78
+ | 'solana_testnet'
75
79
  | Array<
76
80
  | 'ethereum'
77
81
  | 'arbitrum'
@@ -87,6 +91,8 @@ export interface BalanceGetParams {
87
91
  | 'linea_testnet'
88
92
  | 'optimism_sepolia'
89
93
  | 'polygon_amoy'
94
+ | 'solana_devnet'
95
+ | 'solana_testnet'
90
96
  >;
91
97
 
92
98
  include_currency?: 'usd';
@@ -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,
@@ -77,7 +77,9 @@ export namespace TransactionGetResponse {
77
77
  | 'base_sepolia'
78
78
  | 'linea_testnet'
79
79
  | 'optimism_sepolia'
80
- | 'polygon_amoy';
80
+ | 'polygon_amoy'
81
+ | 'solana_devnet'
82
+ | 'solana_testnet';
81
83
 
82
84
  display_values: { [key: string]: string };
83
85
 
@@ -113,7 +115,9 @@ export namespace TransactionGetResponse {
113
115
  | 'base_sepolia'
114
116
  | 'linea_testnet'
115
117
  | 'optimism_sepolia'
116
- | 'polygon_amoy';
118
+ | 'polygon_amoy'
119
+ | 'solana_devnet'
120
+ | 'solana_testnet';
117
121
 
118
122
  display_values: { [key: string]: string };
119
123
 
@@ -142,6 +146,8 @@ export interface TransactionGetParams {
142
146
  cursor?: string;
143
147
 
144
148
  limit?: number | null;
149
+
150
+ tx_hash?: string;
145
151
  }
146
152
 
147
153
  export declare namespace Transactions {
@@ -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
  */
@@ -266,6 +270,26 @@ export class Wallets extends APIResource {
266
270
 
267
271
  export type WalletsCursor = Cursor<Wallet>;
268
272
 
273
+ /**
274
+ * The wallet chain types that support curve-based signing.
275
+ */
276
+ export type CurveSigningChainType =
277
+ | 'cosmos'
278
+ | 'stellar'
279
+ | 'sui'
280
+ | 'aptos'
281
+ | 'movement'
282
+ | 'tron'
283
+ | 'bitcoin-segwit'
284
+ | 'near'
285
+ | 'ton'
286
+ | 'starknet';
287
+
288
+ /**
289
+ * The wallet chain types that offer first class support.
290
+ */
291
+ export type FirstClassChainType = 'solana' | 'ethereum';
292
+
269
293
  export interface Wallet {
270
294
  /**
271
295
  * Unique ID of the wallet. This will be the primary identifier when using the
@@ -284,21 +308,9 @@ export interface Wallet {
284
308
  address: string;
285
309
 
286
310
  /**
287
- * Chain type of the wallet
311
+ * The wallet chain types.
288
312
  */
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';
313
+ chain_type: WalletChainType;
302
314
 
303
315
  /**
304
316
  * Unix timestamp of when the wallet was created in milliseconds.
@@ -318,14 +330,14 @@ export interface Wallet {
318
330
  imported_at: number | null;
319
331
 
320
332
  /**
321
- * List of policy IDs for policies that are enforced on the wallet.
333
+ * The key quorum ID of the owner of the wallet.
322
334
  */
323
- policy_ids: Array<string>;
335
+ owner_id: string | null;
324
336
 
325
337
  /**
326
- * The key quorum ID of the owner of the wallet.
338
+ * List of policy IDs for policies that are enforced on the wallet.
327
339
  */
328
- owner_id?: string;
340
+ policy_ids: Array<string>;
329
341
 
330
342
  /**
331
343
  * The compressed, raw public key for the wallet along the chain cryptographic
@@ -336,12 +348,34 @@ export interface Wallet {
336
348
 
337
349
  export namespace Wallet {
338
350
  export interface AdditionalSigner {
339
- override_policy_ids: Array<string>;
340
-
341
351
  signer_id: string;
352
+
353
+ /**
354
+ * The array of policy IDs that will be applied to wallet requests. If specified,
355
+ * this will override the base policy IDs set on the wallet.
356
+ */
357
+ override_policy_ids?: Array<string>;
342
358
  }
343
359
  }
344
360
 
361
+ /**
362
+ * The wallet chain types.
363
+ */
364
+ export type WalletChainType =
365
+ | 'solana'
366
+ | 'ethereum'
367
+ | 'cosmos'
368
+ | 'stellar'
369
+ | 'sui'
370
+ | 'aptos'
371
+ | 'movement'
372
+ | 'tron'
373
+ | 'bitcoin-segwit'
374
+ | 'near'
375
+ | 'ton'
376
+ | 'starknet'
377
+ | 'spark';
378
+
345
379
  export interface WalletExportResponse {
346
380
  /**
347
381
  * The encrypted private key.
@@ -641,21 +675,9 @@ export interface WalletCreateWalletsWithRecoveryResponse {
641
675
 
642
676
  export interface WalletCreateParams {
643
677
  /**
644
- * Body param: Chain type of the wallet
678
+ * Body param: The wallet chain types.
645
679
  */
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';
680
+ chain_type: WalletChainType;
659
681
 
660
682
  /**
661
683
  * Body param: Additional signers for the wallet.
@@ -690,14 +712,19 @@ export interface WalletCreateParams {
690
712
 
691
713
  export namespace WalletCreateParams {
692
714
  export interface AdditionalSigner {
693
- override_policy_ids: Array<string>;
694
-
695
715
  signer_id: string;
716
+
717
+ /**
718
+ * The array of policy IDs that will be applied to wallet requests. If specified,
719
+ * this will override the base policy IDs set on the wallet.
720
+ */
721
+ override_policy_ids?: Array<string>;
696
722
  }
697
723
 
698
724
  /**
699
- * The P-256 public key of the owner of the resource. If you provide this, do not
700
- * specify an owner_id as it will be generated automatically.
725
+ * The P-256 public key of the owner of the resource, in base64-encoded DER format.
726
+ * If you provide this, do not specify an owner_id as it will be generated
727
+ * automatically.
701
728
  */
702
729
  export interface PublicKeyOwner {
703
730
  public_key: string;
@@ -808,9 +835,9 @@ export declare namespace WalletInitImportParams {
808
835
 
809
836
  export interface WalletRawSignParams {
810
837
  /**
811
- * Body param:
838
+ * Body param: Sign a pre-computed hash
812
839
  */
813
- params: WalletRawSignParams.Params;
840
+ params: WalletRawSignParams.Hash | WalletRawSignParams.UnionMember1;
814
841
 
815
842
  /**
816
843
  * Header param: Request authorization signature. If multiple signatures are
@@ -826,11 +853,29 @@ export interface WalletRawSignParams {
826
853
  }
827
854
 
828
855
  export namespace WalletRawSignParams {
829
- export interface Params {
856
+ /**
857
+ * Sign a pre-computed hash
858
+ */
859
+ export interface Hash {
830
860
  /**
831
861
  * The hash to sign. Must start with `0x`.
832
862
  */
833
- hash?: string;
863
+ hash: string;
864
+ }
865
+
866
+ /**
867
+ * Hash and sign bytes (Tron only)
868
+ */
869
+ export interface UnionMember1 {
870
+ /**
871
+ * The bytes to hash and sign.
872
+ */
873
+ bytes: string;
874
+
875
+ /**
876
+ * Encoding scheme. Currently only utf-8 is supported.
877
+ */
878
+ encoding: 'utf-8';
834
879
  }
835
880
  }
836
881
 
@@ -1443,14 +1488,19 @@ export interface WalletUpdateParams {
1443
1488
 
1444
1489
  export namespace WalletUpdateParams {
1445
1490
  export interface AdditionalSigner {
1446
- override_policy_ids: Array<string>;
1447
-
1448
1491
  signer_id: string;
1492
+
1493
+ /**
1494
+ * The array of policy IDs that will be applied to wallet requests. If specified,
1495
+ * this will override the base policy IDs set on the wallet.
1496
+ */
1497
+ override_policy_ids?: Array<string>;
1449
1498
  }
1450
1499
 
1451
1500
  /**
1452
- * The P-256 public key of the owner of the resource. If you provide this, do not
1453
- * specify an owner_id as it will be generated automatically.
1501
+ * The P-256 public key of the owner of the resource, in base64-encoded DER format.
1502
+ * If you provide this, do not specify an owner_id as it will be generated
1503
+ * automatically.
1454
1504
  */
1455
1505
  export interface PublicKeyOwner {
1456
1506
  public_key: string;
@@ -1527,21 +1577,9 @@ export namespace WalletCreateWalletsWithRecoveryParams {
1527
1577
 
1528
1578
  export interface Wallet {
1529
1579
  /**
1530
- * Chain type of the wallet
1580
+ * The wallet chain types.
1531
1581
  */
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';
1582
+ chain_type: WalletsAPI.WalletChainType;
1545
1583
 
1546
1584
  /**
1547
1585
  * List of policy IDs for policies that should be enforced on the wallet.
@@ -1556,7 +1594,10 @@ Wallets.Balance = Balance;
1556
1594
 
1557
1595
  export declare namespace Wallets {
1558
1596
  export {
1597
+ type CurveSigningChainType as CurveSigningChainType,
1598
+ type FirstClassChainType as FirstClassChainType,
1559
1599
  type Wallet as Wallet,
1600
+ type WalletChainType as WalletChainType,
1560
1601
  type WalletExportResponse as WalletExportResponse,
1561
1602
  type WalletInitImportResponse as WalletInitImportResponse,
1562
1603
  type WalletRawSignResponse as WalletRawSignResponse,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.3.0'; // x-release-please-version
1
+ export const VERSION = '0.4.1'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.3.0";
1
+ export declare const VERSION = "0.4.1";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.3.0";
1
+ export declare const VERSION = "0.4.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.3.0'; // x-release-please-version
4
+ exports.VERSION = '0.4.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.3.0'; // x-release-please-version
1
+ export const VERSION = '0.4.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map