@privy-io/api-types 0.9.0 → 0.10.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 (153) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/client.d.mts +33 -30
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +33 -30
  5. package/client.d.ts.map +1 -1
  6. package/client.js +22 -8
  7. package/client.js.map +1 -1
  8. package/client.mjs +23 -9
  9. package/client.mjs.map +1 -1
  10. package/internal/types.d.mts +6 -6
  11. package/internal/types.d.mts.map +1 -1
  12. package/internal/types.d.ts +6 -6
  13. package/internal/types.d.ts.map +1 -1
  14. package/package.json +1 -1
  15. package/resources/accounts.d.mts +128 -86
  16. package/resources/accounts.d.mts.map +1 -1
  17. package/resources/accounts.d.ts +128 -86
  18. package/resources/accounts.d.ts.map +1 -1
  19. package/resources/aggregations.d.mts +43 -43
  20. package/resources/aggregations.d.mts.map +1 -1
  21. package/resources/aggregations.d.ts +43 -43
  22. package/resources/aggregations.d.ts.map +1 -1
  23. package/resources/apps.d.mts +169 -135
  24. package/resources/apps.d.mts.map +1 -1
  25. package/resources/apps.d.ts +169 -135
  26. package/resources/apps.d.ts.map +1 -1
  27. package/resources/client-auth.d.mts +646 -644
  28. package/resources/client-auth.d.mts.map +1 -1
  29. package/resources/client-auth.d.ts +646 -644
  30. package/resources/client-auth.d.ts.map +1 -1
  31. package/resources/embedded-wallets.d.mts +114 -114
  32. package/resources/embedded-wallets.d.mts.map +1 -1
  33. package/resources/embedded-wallets.d.ts +114 -114
  34. package/resources/embedded-wallets.d.ts.map +1 -1
  35. package/resources/funding.d.mts +42 -42
  36. package/resources/funding.d.mts.map +1 -1
  37. package/resources/funding.d.ts +42 -42
  38. package/resources/funding.d.ts.map +1 -1
  39. package/resources/index.d.mts +19 -18
  40. package/resources/index.d.mts.map +1 -1
  41. package/resources/index.d.ts +19 -18
  42. package/resources/index.d.ts.map +1 -1
  43. package/resources/index.js +3 -1
  44. package/resources/index.js.map +1 -1
  45. package/resources/index.mjs +2 -1
  46. package/resources/index.mjs.map +1 -1
  47. package/resources/intents.d.mts +269 -265
  48. package/resources/intents.d.mts.map +1 -1
  49. package/resources/intents.d.ts +269 -265
  50. package/resources/intents.d.ts.map +1 -1
  51. package/resources/key-quorums.d.mts +20 -20
  52. package/resources/key-quorums.d.mts.map +1 -1
  53. package/resources/key-quorums.d.ts +20 -20
  54. package/resources/key-quorums.d.ts.map +1 -1
  55. package/resources/kraken-embed.d.mts +12 -20
  56. package/resources/kraken-embed.d.mts.map +1 -1
  57. package/resources/kraken-embed.d.ts +12 -20
  58. package/resources/kraken-embed.d.ts.map +1 -1
  59. package/resources/organizations.d.mts +65 -0
  60. package/resources/organizations.d.mts.map +1 -0
  61. package/resources/organizations.d.ts +65 -0
  62. package/resources/organizations.d.ts.map +1 -0
  63. package/resources/organizations.js +9 -0
  64. package/resources/organizations.js.map +1 -0
  65. package/resources/organizations.mjs +5 -0
  66. package/resources/organizations.mjs.map +1 -0
  67. package/resources/policies.d.mts +258 -240
  68. package/resources/policies.d.mts.map +1 -1
  69. package/resources/policies.d.ts +258 -240
  70. package/resources/policies.d.ts.map +1 -1
  71. package/resources/shared.d.mts +28 -28
  72. package/resources/shared.d.mts.map +1 -1
  73. package/resources/shared.d.ts +28 -28
  74. package/resources/shared.d.ts.map +1 -1
  75. package/resources/swaps.d.mts +6 -9
  76. package/resources/swaps.d.mts.map +1 -1
  77. package/resources/swaps.d.ts +6 -9
  78. package/resources/swaps.d.ts.map +1 -1
  79. package/resources/swaps.js.map +1 -1
  80. package/resources/swaps.mjs.map +1 -1
  81. package/resources/transactions.d.mts +53 -53
  82. package/resources/transactions.d.mts.map +1 -1
  83. package/resources/transactions.d.ts +53 -53
  84. package/resources/transactions.d.ts.map +1 -1
  85. package/resources/users.d.mts +468 -459
  86. package/resources/users.d.mts.map +1 -1
  87. package/resources/users.d.ts +468 -459
  88. package/resources/users.d.ts.map +1 -1
  89. package/resources/wallet-actions.d.mts +302 -145
  90. package/resources/wallet-actions.d.mts.map +1 -1
  91. package/resources/wallet-actions.d.ts +302 -145
  92. package/resources/wallet-actions.d.ts.map +1 -1
  93. package/resources/wallets/index.d.mts +1 -1
  94. package/resources/wallets/index.d.mts.map +1 -1
  95. package/resources/wallets/index.d.ts +1 -1
  96. package/resources/wallets/index.d.ts.map +1 -1
  97. package/resources/wallets/index.js.map +1 -1
  98. package/resources/wallets/index.mjs.map +1 -1
  99. package/resources/wallets/transactions.d.mts +7 -2
  100. package/resources/wallets/transactions.d.mts.map +1 -1
  101. package/resources/wallets/transactions.d.ts +7 -2
  102. package/resources/wallets/transactions.d.ts.map +1 -1
  103. package/resources/wallets/transactions.js +1 -1
  104. package/resources/wallets/transactions.mjs +1 -1
  105. package/resources/wallets/wallets.d.mts +1424 -1227
  106. package/resources/wallets/wallets.d.mts.map +1 -1
  107. package/resources/wallets/wallets.d.ts +1424 -1227
  108. package/resources/wallets/wallets.d.ts.map +1 -1
  109. package/resources/wallets/wallets.js +4 -1
  110. package/resources/wallets/wallets.js.map +1 -1
  111. package/resources/wallets/wallets.mjs +4 -1
  112. package/resources/wallets/wallets.mjs.map +1 -1
  113. package/resources/webhooks.d.mts +935 -877
  114. package/resources/webhooks.d.mts.map +1 -1
  115. package/resources/webhooks.d.ts +935 -877
  116. package/resources/webhooks.d.ts.map +1 -1
  117. package/resources/yield.d.mts +157 -157
  118. package/resources/yield.d.mts.map +1 -1
  119. package/resources/yield.d.ts +157 -157
  120. package/resources/yield.d.ts.map +1 -1
  121. package/src/client.ts +594 -516
  122. package/src/internal/types.ts +6 -8
  123. package/src/resources/accounts.ts +157 -103
  124. package/src/resources/aggregations.ts +55 -55
  125. package/src/resources/apps.ts +221 -178
  126. package/src/resources/client-auth.ts +887 -887
  127. package/src/resources/embedded-wallets.ts +150 -150
  128. package/src/resources/funding.ts +66 -66
  129. package/src/resources/index.ts +504 -475
  130. package/src/resources/intents.ts +326 -322
  131. package/src/resources/key-quorums.ts +23 -23
  132. package/src/resources/kraken-embed.ts +14 -22
  133. package/src/resources/organizations.ts +82 -0
  134. package/src/resources/policies.ts +379 -352
  135. package/src/resources/shared.ts +34 -34
  136. package/src/resources/swaps.ts +5 -10
  137. package/src/resources/transactions.ts +86 -86
  138. package/src/resources/users.ts +707 -696
  139. package/src/resources/wallet-actions.ts +392 -185
  140. package/src/resources/wallets/index.ts +157 -148
  141. package/src/resources/wallets/transactions.ts +18 -3
  142. package/src/resources/wallets/wallets.ts +1937 -1686
  143. package/src/resources/webhooks.ts +1172 -1100
  144. package/src/resources/yield.ts +188 -188
  145. package/src/version.ts +1 -1
  146. package/version.d.mts +1 -1
  147. package/version.d.mts.map +1 -1
  148. package/version.d.ts +1 -1
  149. package/version.d.ts.map +1 -1
  150. package/version.js +1 -1
  151. package/version.js.map +1 -1
  152. package/version.mjs +1 -1
  153. package/version.mjs.map +1 -1
@@ -5,28 +5,36 @@ import { APIResource } from '../core/resource';
5
5
  export class Shared extends APIResource {}
6
6
 
7
7
  /**
8
- * A simple success response.
8
+ * A monetary value with its currency denomination.
9
9
  */
10
- export interface SuccessResponse {
11
- success: boolean;
10
+ export interface CurrencyAmount {
11
+ /**
12
+ * Currency code
13
+ */
14
+ currency: 'usd';
15
+
16
+ /**
17
+ * The monetary value as a string.
18
+ */
19
+ value: string;
12
20
  }
13
21
 
14
22
  /**
15
- * A P-256 (secp256r1) public key.
23
+ * A unique identifier for a key quorum.
16
24
  */
17
- export type P256PublicKey = string;
25
+ export type KeyQuorumID = string;
18
26
 
19
27
  /**
20
- * A unique identifier for a key quorum.
28
+ * The key quorum ID to set as the owner of the resource. If you provide this, do
29
+ * not specify an owner.
21
30
  */
22
- export type KeyQuorumID = string;
31
+ export type OwnerIDInput = string | null;
23
32
 
24
33
  /**
25
- * Owner input specifying a Privy user ID.
34
+ * The owner of the resource, specified as a Privy user ID, a P-256 public key, or
35
+ * null to remove the current owner.
26
36
  */
27
- export interface OwnerInputUser {
28
- user_id: string;
29
- }
37
+ export type OwnerInput = OwnerInputUser | OwnerInputPublicKey;
30
38
 
31
39
  /**
32
40
  * Owner input specifying a P-256 public key.
@@ -39,41 +47,33 @@ export interface OwnerInputPublicKey {
39
47
  }
40
48
 
41
49
  /**
42
- * The owner of the resource, specified as a Privy user ID, a P-256 public key, or
43
- * null to remove the current owner.
50
+ * Owner input specifying a Privy user ID.
44
51
  */
45
- export type OwnerInput = OwnerInputUser | OwnerInputPublicKey;
52
+ export interface OwnerInputUser {
53
+ user_id: string;
54
+ }
46
55
 
47
56
  /**
48
- * The key quorum ID to set as the owner of the resource. If you provide this, do
49
- * not specify an owner.
57
+ * A P-256 (secp256r1) public key.
50
58
  */
51
- export type OwnerIDInput = string | null;
59
+ export type P256PublicKey = string;
52
60
 
53
61
  /**
54
- * A monetary value with its currency denomination.
62
+ * A simple success response.
55
63
  */
56
- export interface CurrencyAmount {
57
- /**
58
- * Currency code
59
- */
60
- currency: 'usd';
61
-
62
- /**
63
- * The monetary value as a string.
64
- */
65
- value: string;
64
+ export interface SuccessResponse {
65
+ success: boolean;
66
66
  }
67
67
 
68
68
  export declare namespace Shared {
69
69
  export {
70
- type SuccessResponse as SuccessResponse,
71
- type P256PublicKey as P256PublicKey,
70
+ type CurrencyAmount as CurrencyAmount,
72
71
  type KeyQuorumID as KeyQuorumID,
73
- type OwnerInputUser as OwnerInputUser,
74
- type OwnerInputPublicKey as OwnerInputPublicKey,
75
- type OwnerInput as OwnerInput,
76
72
  type OwnerIDInput as OwnerIDInput,
77
- type CurrencyAmount as CurrencyAmount,
73
+ type OwnerInput as OwnerInput,
74
+ type OwnerInputPublicKey as OwnerInputPublicKey,
75
+ type OwnerInputUser as OwnerInputUser,
76
+ type P256PublicKey as P256PublicKey,
77
+ type SuccessResponse as SuccessResponse,
78
78
  };
79
79
  }
@@ -1,14 +1,10 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
+ import * as WalletsAPI from './wallets/wallets';
4
5
 
5
6
  export class Swaps extends APIResource {}
6
7
 
7
- /**
8
- * Whether the swap amount refers to the input token or output token.
9
- */
10
- export type SwapAmountType = 'exact_input' | 'exact_output';
11
-
12
8
  /**
13
9
  * Input for requesting a token swap quote.
14
10
  */
@@ -34,9 +30,9 @@ export interface SwapQuoteRequestBody {
34
30
  output_token: string;
35
31
 
36
32
  /**
37
- * Whether the swap amount refers to the input token or output token.
33
+ * Whether the amount refers to the input token or output token.
38
34
  */
39
- amount_type?: SwapAmountType;
35
+ amount_type?: WalletsAPI.AmountType;
40
36
 
41
37
  /**
42
38
  * Maximum slippage tolerance in basis points (e.g., 50 for 0.5%). If omitted,
@@ -110,9 +106,9 @@ export interface SwapRequestBody {
110
106
  output_token: string;
111
107
 
112
108
  /**
113
- * Whether the swap amount refers to the input token or output token.
109
+ * Whether the amount refers to the input token or output token.
114
110
  */
115
- amount_type?: SwapAmountType;
111
+ amount_type?: WalletsAPI.AmountType;
116
112
 
117
113
  /**
118
114
  * Address to receive the output tokens. Defaults to the wallet address if not
@@ -128,7 +124,6 @@ export interface SwapRequestBody {
128
124
 
129
125
  export declare namespace Swaps {
130
126
  export {
131
- type SwapAmountType as SwapAmountType,
132
127
  type SwapQuoteRequestBody as SwapQuoteRequestBody,
133
128
  type SwapQuoteResponse as SwapQuoteResponse,
134
129
  type SwapRequestBody as SwapRequestBody,
@@ -57,45 +57,56 @@ export interface TransactionScanningResponseBody {
57
57
  }
58
58
 
59
59
  /**
60
- * Additional information for Blockaid to validate against.
60
+ * A transaction from a Privy wallet.
61
61
  */
62
- export interface TransactionScanningMetadata {
63
- domain: string;
64
- }
62
+ export interface Transaction {
63
+ id: string;
65
64
 
66
- /**
67
- * Raw RPC request to execute with the wallet.
68
- */
69
- export interface TransactionScanningRpcRequest {
70
- method: string;
65
+ caip2: string;
71
66
 
72
- params: Array<unknown>;
73
- }
67
+ created_at: number;
74
68
 
75
- /**
76
- * A failed validation result from a transaction scan.
77
- */
78
- export interface TransactionScanningValidationErrorResult {
79
- error: string;
69
+ status:
70
+ | 'broadcasted'
71
+ | 'confirmed'
72
+ | 'execution_reverted'
73
+ | 'failed'
74
+ | 'replaced'
75
+ | 'finalized'
76
+ | 'provider_error'
77
+ | 'pending';
80
78
 
81
- status: 'Error';
79
+ transaction_hash: string | null;
80
+
81
+ wallet_id: string;
82
+
83
+ reference_id?: string | null;
84
+
85
+ sponsored?: boolean;
86
+
87
+ user_operation_hash?: string;
82
88
  }
83
89
 
84
90
  /**
85
- * A successful validation result from a transaction scan.
91
+ * A list of transactions.
86
92
  */
87
- export interface TransactionScanningValidationSuccessResult {
88
- result_type: string;
89
-
90
- status: 'Success';
93
+ export interface TransactionList {
94
+ transactions: Array<Transaction>;
91
95
  }
92
96
 
93
97
  /**
94
- * The validation result from a transaction scan.
98
+ * An asset diff representing assets entering/leaving a wallet.
95
99
  */
96
- export type TransactionScanningValidationResult =
97
- | TransactionScanningValidationErrorResult
98
- | TransactionScanningValidationSuccessResult;
100
+ export interface TransactionScanningAssetDiff {
101
+ /**
102
+ * Information about the moving asset in a transaction scan.
103
+ */
104
+ asset: TransactionScanningAssetInfo;
105
+
106
+ in: Array<TransactionScanningAssetValue>;
107
+
108
+ out: Array<TransactionScanningAssetValue>;
109
+ }
99
110
 
100
111
  /**
101
112
  * Information about the moving asset in a transaction scan.
@@ -122,17 +133,14 @@ export interface TransactionScanningAssetValue {
122
133
  }
123
134
 
124
135
  /**
125
- * An asset diff representing assets entering/leaving a wallet.
136
+ * Decoded calldata from a scanned transaction.
126
137
  */
127
- export interface TransactionScanningAssetDiff {
128
- /**
129
- * Information about the moving asset in a transaction scan.
130
- */
131
- asset: TransactionScanningAssetInfo;
138
+ export interface TransactionScanningCalldata {
139
+ function_selector: string;
132
140
 
133
- in: Array<TransactionScanningAssetValue>;
141
+ function_declaration?: string;
134
142
 
135
- out: Array<TransactionScanningAssetValue>;
143
+ function_signature?: string;
136
144
  }
137
145
 
138
146
  /**
@@ -148,14 +156,10 @@ export interface TransactionScanningExposure {
148
156
  }
149
157
 
150
158
  /**
151
- * Decoded calldata from a scanned transaction.
159
+ * Additional information for Blockaid to validate against.
152
160
  */
153
- export interface TransactionScanningCalldata {
154
- function_selector: string;
155
-
156
- function_declaration?: string;
157
-
158
- function_signature?: string;
161
+ export interface TransactionScanningMetadata {
162
+ domain: string;
159
163
  }
160
164
 
161
165
  /**
@@ -184,6 +188,15 @@ export interface TransactionScanningParams {
184
188
  value?: string;
185
189
  }
186
190
 
191
+ /**
192
+ * Raw RPC request to execute with the wallet.
193
+ */
194
+ export interface TransactionScanningRpcRequest {
195
+ method: string;
196
+
197
+ params: Array<unknown>;
198
+ }
199
+
187
200
  /**
188
201
  * A failed simulation result from a transaction scan.
189
202
  */
@@ -193,6 +206,13 @@ export interface TransactionScanningSimulationErrorResult {
193
206
  status: 'Error';
194
207
  }
195
208
 
209
+ /**
210
+ * The simulation result from a transaction scan.
211
+ */
212
+ export type TransactionScanningSimulationResult =
213
+ | TransactionScanningSimulationErrorResult
214
+ | TransactionScanningSimulationSuccessResult;
215
+
196
216
  /**
197
217
  * A successful simulation result from a transaction scan.
198
218
  */
@@ -210,69 +230,49 @@ export interface TransactionScanningSimulationSuccessResult {
210
230
  }
211
231
 
212
232
  /**
213
- * The simulation result from a transaction scan.
233
+ * A failed validation result from a transaction scan.
214
234
  */
215
- export type TransactionScanningSimulationResult =
216
- | TransactionScanningSimulationErrorResult
217
- | TransactionScanningSimulationSuccessResult;
235
+ export interface TransactionScanningValidationErrorResult {
236
+ error: string;
237
+
238
+ status: 'Error';
239
+ }
218
240
 
219
241
  /**
220
- * A transaction from a Privy wallet.
242
+ * The validation result from a transaction scan.
221
243
  */
222
- export interface Transaction {
223
- id: string;
224
-
225
- caip2: string;
226
-
227
- created_at: number;
228
-
229
- status:
230
- | 'broadcasted'
231
- | 'confirmed'
232
- | 'execution_reverted'
233
- | 'failed'
234
- | 'replaced'
235
- | 'finalized'
236
- | 'provider_error'
237
- | 'pending';
238
-
239
- transaction_hash: string | null;
240
-
241
- wallet_id: string;
242
-
243
- reference_id?: string | null;
244
-
245
- sponsored?: boolean;
246
-
247
- user_operation_hash?: string;
248
- }
244
+ export type TransactionScanningValidationResult =
245
+ | TransactionScanningValidationErrorResult
246
+ | TransactionScanningValidationSuccessResult;
249
247
 
250
248
  /**
251
- * A list of transactions.
249
+ * A successful validation result from a transaction scan.
252
250
  */
253
- export interface TransactionList {
254
- transactions: Array<Transaction>;
251
+ export interface TransactionScanningValidationSuccessResult {
252
+ result_type: string;
253
+
254
+ status: 'Success';
255
255
  }
256
256
 
257
257
  export declare namespace Transactions {
258
258
  export {
259
259
  type TransactionScanningRequestBody as TransactionScanningRequestBody,
260
260
  type TransactionScanningResponseBody as TransactionScanningResponseBody,
261
- type TransactionScanningMetadata as TransactionScanningMetadata,
262
- type TransactionScanningRpcRequest as TransactionScanningRpcRequest,
263
- type TransactionScanningValidationErrorResult as TransactionScanningValidationErrorResult,
264
- type TransactionScanningValidationSuccessResult as TransactionScanningValidationSuccessResult,
265
- type TransactionScanningValidationResult as TransactionScanningValidationResult,
261
+ type Transaction as Transaction,
262
+ type TransactionList as TransactionList,
263
+ type TransactionScanningAssetDiff as TransactionScanningAssetDiff,
266
264
  type TransactionScanningAssetInfo as TransactionScanningAssetInfo,
267
265
  type TransactionScanningAssetValue as TransactionScanningAssetValue,
268
- type TransactionScanningAssetDiff as TransactionScanningAssetDiff,
269
- type TransactionScanningExposure as TransactionScanningExposure,
270
266
  type TransactionScanningCalldata as TransactionScanningCalldata,
267
+ type TransactionScanningExposure as TransactionScanningExposure,
268
+ type TransactionScanningMetadata as TransactionScanningMetadata,
271
269
  type TransactionScanningParams as TransactionScanningParams,
270
+ type TransactionScanningRpcRequest as TransactionScanningRpcRequest,
272
271
  type TransactionScanningSimulationErrorResult as TransactionScanningSimulationErrorResult,
273
- type TransactionScanningSimulationSuccessResult as TransactionScanningSimulationSuccessResult,
274
272
  type TransactionScanningSimulationResult as TransactionScanningSimulationResult,
275
- type Transaction as Transaction,
276
- type TransactionList as TransactionList,
273
+ type TransactionScanningSimulationSuccessResult as TransactionScanningSimulationSuccessResult,
274
+ type TransactionScanningValidationErrorResult as TransactionScanningValidationErrorResult,
275
+ type TransactionScanningValidationResult as TransactionScanningValidationResult,
276
+ type TransactionScanningValidationSuccessResult as TransactionScanningValidationSuccessResult,
277
277
  };
278
278
  }