@privy-io/api-types 0.7.0 → 0.8.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 (169) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/client.d.mts +37 -28
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +37 -28
  5. package/client.d.ts.map +1 -1
  6. package/client.js +9 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +9 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/accounts.d.mts +79 -106
  12. package/resources/accounts.d.mts.map +1 -1
  13. package/resources/accounts.d.ts +79 -106
  14. package/resources/accounts.d.ts.map +1 -1
  15. package/resources/accounts.js.map +1 -1
  16. package/resources/accounts.mjs.map +1 -1
  17. package/resources/aggregations.d.mts +18 -392
  18. package/resources/aggregations.d.mts.map +1 -1
  19. package/resources/aggregations.d.ts +18 -392
  20. package/resources/aggregations.d.ts.map +1 -1
  21. package/resources/aggregations.js.map +1 -1
  22. package/resources/aggregations.mjs.map +1 -1
  23. package/resources/apps.d.mts +139 -70
  24. package/resources/apps.d.mts.map +1 -1
  25. package/resources/apps.d.ts +139 -70
  26. package/resources/apps.d.ts.map +1 -1
  27. package/resources/apps.js.map +1 -1
  28. package/resources/apps.mjs.map +1 -1
  29. package/resources/client-auth.d.mts +796 -427
  30. package/resources/client-auth.d.mts.map +1 -1
  31. package/resources/client-auth.d.ts +796 -427
  32. package/resources/client-auth.d.ts.map +1 -1
  33. package/resources/client-auth.js.map +1 -1
  34. package/resources/client-auth.mjs.map +1 -1
  35. package/resources/cross-app.d.mts +14 -13
  36. package/resources/cross-app.d.mts.map +1 -1
  37. package/resources/cross-app.d.ts +14 -13
  38. package/resources/cross-app.d.ts.map +1 -1
  39. package/resources/embedded-wallets.d.mts +165 -81
  40. package/resources/embedded-wallets.d.mts.map +1 -1
  41. package/resources/embedded-wallets.d.ts +165 -81
  42. package/resources/embedded-wallets.d.ts.map +1 -1
  43. package/resources/embedded-wallets.js.map +1 -1
  44. package/resources/embedded-wallets.mjs.map +1 -1
  45. package/resources/funding.d.mts +150 -64
  46. package/resources/funding.d.mts.map +1 -1
  47. package/resources/funding.d.ts +150 -64
  48. package/resources/funding.d.ts.map +1 -1
  49. package/resources/funding.js.map +1 -1
  50. package/resources/funding.mjs.map +1 -1
  51. package/resources/index.d.mts +17 -14
  52. package/resources/index.d.mts.map +1 -1
  53. package/resources/index.d.ts +17 -14
  54. package/resources/index.d.ts.map +1 -1
  55. package/resources/index.js +7 -1
  56. package/resources/index.js.map +1 -1
  57. package/resources/index.mjs +3 -0
  58. package/resources/index.mjs.map +1 -1
  59. package/resources/intents.d.mts +224 -1757
  60. package/resources/intents.d.mts.map +1 -1
  61. package/resources/intents.d.ts +224 -1757
  62. package/resources/intents.d.ts.map +1 -1
  63. package/resources/intents.js.map +1 -1
  64. package/resources/intents.mjs.map +1 -1
  65. package/resources/key-quorums.d.mts +74 -26
  66. package/resources/key-quorums.d.mts.map +1 -1
  67. package/resources/key-quorums.d.ts +74 -26
  68. package/resources/key-quorums.d.ts.map +1 -1
  69. package/resources/key-quorums.js +8 -8
  70. package/resources/key-quorums.js.map +1 -1
  71. package/resources/key-quorums.mjs +8 -8
  72. package/resources/key-quorums.mjs.map +1 -1
  73. package/resources/policies.d.mts +335 -926
  74. package/resources/policies.d.mts.map +1 -1
  75. package/resources/policies.d.ts +335 -926
  76. package/resources/policies.d.ts.map +1 -1
  77. package/resources/policies.js +48 -41
  78. package/resources/policies.js.map +1 -1
  79. package/resources/policies.mjs +48 -41
  80. package/resources/policies.mjs.map +1 -1
  81. package/resources/shared.d.mts +59 -0
  82. package/resources/shared.d.mts.map +1 -0
  83. package/resources/shared.d.ts +59 -0
  84. package/resources/shared.d.ts.map +1 -0
  85. package/resources/shared.js +9 -0
  86. package/resources/shared.js.map +1 -0
  87. package/resources/shared.mjs +5 -0
  88. package/resources/shared.mjs.map +1 -0
  89. package/resources/swaps.d.mts +108 -0
  90. package/resources/swaps.d.mts.map +1 -0
  91. package/resources/swaps.d.ts +108 -0
  92. package/resources/swaps.d.ts.map +1 -0
  93. package/resources/swaps.js +9 -0
  94. package/resources/swaps.js.map +1 -0
  95. package/resources/swaps.mjs +5 -0
  96. package/resources/swaps.mjs.map +1 -0
  97. package/resources/transactions.d.mts +155 -93
  98. package/resources/transactions.d.mts.map +1 -1
  99. package/resources/transactions.d.ts +155 -93
  100. package/resources/transactions.d.ts.map +1 -1
  101. package/resources/users.d.mts +61 -94
  102. package/resources/users.d.mts.map +1 -1
  103. package/resources/users.d.ts +61 -94
  104. package/resources/users.d.ts.map +1 -1
  105. package/resources/users.js.map +1 -1
  106. package/resources/users.mjs.map +1 -1
  107. package/resources/wallet-actions.d.mts +187 -0
  108. package/resources/wallet-actions.d.mts.map +1 -0
  109. package/resources/wallet-actions.d.ts +187 -0
  110. package/resources/wallet-actions.d.ts.map +1 -0
  111. package/resources/wallet-actions.js +9 -0
  112. package/resources/wallet-actions.js.map +1 -0
  113. package/resources/wallet-actions.mjs +5 -0
  114. package/resources/wallet-actions.mjs.map +1 -0
  115. package/resources/wallets/index.d.mts +1 -1
  116. package/resources/wallets/index.d.mts.map +1 -1
  117. package/resources/wallets/index.d.ts +1 -1
  118. package/resources/wallets/index.d.ts.map +1 -1
  119. package/resources/wallets/index.js.map +1 -1
  120. package/resources/wallets/index.mjs.map +1 -1
  121. package/resources/wallets/transactions.d.mts +1 -0
  122. package/resources/wallets/transactions.d.mts.map +1 -1
  123. package/resources/wallets/transactions.d.ts +1 -0
  124. package/resources/wallets/transactions.d.ts.map +1 -1
  125. package/resources/wallets/wallets.d.mts +2377 -971
  126. package/resources/wallets/wallets.d.mts.map +1 -1
  127. package/resources/wallets/wallets.d.ts +2377 -971
  128. package/resources/wallets/wallets.d.ts.map +1 -1
  129. package/resources/wallets/wallets.js +18 -6
  130. package/resources/wallets/wallets.js.map +1 -1
  131. package/resources/wallets/wallets.mjs +18 -6
  132. package/resources/wallets/wallets.mjs.map +1 -1
  133. package/resources/webhooks.d.mts +438 -33
  134. package/resources/webhooks.d.mts.map +1 -1
  135. package/resources/webhooks.d.ts +438 -33
  136. package/resources/webhooks.d.ts.map +1 -1
  137. package/resources/webhooks.js.map +1 -1
  138. package/resources/webhooks.mjs.map +1 -1
  139. package/resources/yield.d.mts +25 -1
  140. package/resources/yield.d.mts.map +1 -1
  141. package/resources/yield.d.ts +25 -1
  142. package/resources/yield.d.ts.map +1 -1
  143. package/src/client.ts +721 -72
  144. package/src/resources/accounts.ts +93 -120
  145. package/src/resources/aggregations.ts +18 -702
  146. package/src/resources/apps.ts +187 -110
  147. package/src/resources/client-auth.ts +1358 -893
  148. package/src/resources/cross-app.ts +19 -15
  149. package/src/resources/embedded-wallets.ts +219 -123
  150. package/src/resources/funding.ts +263 -173
  151. package/src/resources/index.ts +368 -47
  152. package/src/resources/intents.ts +370 -3100
  153. package/src/resources/key-quorums.ts +100 -32
  154. package/src/resources/policies.ts +583 -1558
  155. package/src/resources/shared.ts +79 -0
  156. package/src/resources/swaps.ts +136 -0
  157. package/src/resources/transactions.ts +185 -91
  158. package/src/resources/users.ts +79 -132
  159. package/src/resources/wallet-actions.ts +251 -0
  160. package/src/resources/wallets/index.ts +144 -16
  161. package/src/resources/wallets/transactions.ts +2 -0
  162. package/src/resources/wallets/wallets.ts +2893 -1023
  163. package/src/resources/webhooks.ts +547 -47
  164. package/src/resources/yield.ts +29 -0
  165. package/src/version.ts +1 -1
  166. package/version.d.mts +1 -1
  167. package/version.d.ts +1 -1
  168. package/version.js +1 -1
  169. package/version.mjs +1 -1
@@ -1,6 +1,7 @@
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 SharedAPI from './shared';
4
5
  import { APIPromise } from '../core/api-promise';
5
6
  import { buildHeaders } from '../internal/headers';
6
7
  import { RequestOptions } from '../internal/request-options';
@@ -34,17 +35,20 @@ export class KeyQuorums extends APIResource {
34
35
  *
35
36
  * @example
36
37
  * ```ts
37
- * const response = await client.keyQuorums._delete(
38
- * 'key_quorum_id',
38
+ * const successResponse = await client.keyQuorums._delete(
39
+ * 'string',
39
40
  * );
40
41
  * ```
41
42
  */
42
43
  _delete(
43
- keyQuorumID: string,
44
+ keyQuorumID: SharedAPI.KeyQuorumID,
44
45
  params: KeyQuorumDeleteParams | null | undefined = {},
45
46
  options?: RequestOptions,
46
- ): APIPromise<KeyQuorumDeleteResponse> {
47
- const { 'privy-authorization-signature': privyAuthorizationSignature } = params ?? {};
47
+ ): APIPromise<SharedAPI.SuccessResponse> {
48
+ const {
49
+ 'privy-authorization-signature': privyAuthorizationSignature,
50
+ 'privy-request-expiry': privyRequestExpiry,
51
+ } = params ?? {};
48
52
  return this._client.delete(path`/v1/key_quorums/${keyQuorumID}`, {
49
53
  ...options,
50
54
  headers: buildHeaders([
@@ -52,6 +56,7 @@ export class KeyQuorums extends APIResource {
52
56
  ...(privyAuthorizationSignature != null ?
53
57
  { 'privy-authorization-signature': privyAuthorizationSignature }
54
58
  : undefined),
59
+ ...(privyRequestExpiry != null ? { 'privy-request-expiry': privyRequestExpiry } : undefined),
55
60
  },
56
61
  options?.headers,
57
62
  ]),
@@ -64,7 +69,7 @@ export class KeyQuorums extends APIResource {
64
69
  * @example
65
70
  * ```ts
66
71
  * const keyQuorum = await client.keyQuorums._update(
67
- * 'key_quorum_id',
72
+ * 'string',
68
73
  * {
69
74
  * authorization_threshold: 1,
70
75
  * display_name: 'Prod key quorum',
@@ -76,11 +81,15 @@ export class KeyQuorums extends APIResource {
76
81
  * ```
77
82
  */
78
83
  _update(
79
- keyQuorumID: string,
84
+ keyQuorumID: SharedAPI.KeyQuorumID,
80
85
  params: KeyQuorumUpdateParams,
81
86
  options?: RequestOptions,
82
87
  ): APIPromise<KeyQuorum> {
83
- const { 'privy-authorization-signature': privyAuthorizationSignature, ...body } = params;
88
+ const {
89
+ 'privy-authorization-signature': privyAuthorizationSignature,
90
+ 'privy-request-expiry': privyRequestExpiry,
91
+ ...body
92
+ } = params;
84
93
  return this._client.patch(path`/v1/key_quorums/${keyQuorumID}`, {
85
94
  body,
86
95
  ...options,
@@ -89,6 +98,7 @@ export class KeyQuorums extends APIResource {
89
98
  ...(privyAuthorizationSignature != null ?
90
99
  { 'privy-authorization-signature': privyAuthorizationSignature }
91
100
  : undefined),
101
+ ...(privyRequestExpiry != null ? { 'privy-request-expiry': privyRequestExpiry } : undefined),
92
102
  },
93
103
  options?.headers,
94
104
  ]),
@@ -100,20 +110,46 @@ export class KeyQuorums extends APIResource {
100
110
  *
101
111
  * @example
102
112
  * ```ts
103
- * const keyQuorum = await client.keyQuorums.get(
104
- * 'key_quorum_id',
105
- * );
113
+ * const keyQuorum = await client.keyQuorums.get('string');
106
114
  * ```
107
115
  */
108
- get(keyQuorumID: string, options?: RequestOptions): APIPromise<KeyQuorum> {
116
+ get(keyQuorumID: SharedAPI.KeyQuorumID, options?: RequestOptions): APIPromise<KeyQuorum> {
109
117
  return this._client.get(path`/v1/key_quorums/${keyQuorumID}`, options);
110
118
  }
111
119
  }
112
120
 
113
121
  /**
114
- * Request input for creating or updating a key quorum.
122
+ * A key quorum for authorizing wallet operations.
115
123
  */
116
- export interface KeyQuorumCreateParams {
124
+ export interface KeyQuorum {
125
+ id: string;
126
+
127
+ authorization_keys: Array<KeyQuorum.AuthorizationKey>;
128
+
129
+ authorization_threshold: number | null;
130
+
131
+ display_name: string | null;
132
+
133
+ user_ids: Array<string> | null;
134
+
135
+ /**
136
+ * List of nested key quorum IDs that are members of this key quorum.
137
+ */
138
+ key_quorum_ids?: Array<string>;
139
+ }
140
+
141
+ export namespace KeyQuorum {
142
+ export interface AuthorizationKey {
143
+ display_name: string | null;
144
+
145
+ public_key: string;
146
+ }
147
+ }
148
+
149
+ /**
150
+ * Request input for creating a key quorum.
151
+ */
152
+ export interface KeyQuorumCreateRequestBody {
117
153
  /**
118
154
  * The number of keys that must sign for an action to be valid. Must be less than
119
155
  * or equal to total number of key quorum members.
@@ -142,38 +178,56 @@ export interface KeyQuorumCreateParams {
142
178
  }
143
179
 
144
180
  /**
145
- * A key quorum for authorizing wallet operations.
181
+ * Request input for updating an existing key quorum.
146
182
  */
147
- export interface KeyQuorum {
148
- id: string;
149
-
150
- authorization_keys: Array<KeyQuorum.AuthorizationKey>;
151
-
183
+ export interface KeyQuorumUpdateRequestBody {
184
+ /**
185
+ * The number of keys that must sign for an action to be valid. Must be less than
186
+ * or equal to total number of key quorum members.
187
+ */
152
188
  authorization_threshold?: number;
153
189
 
154
190
  display_name?: string;
155
191
 
156
192
  /**
157
- * List of nested key quorum IDs that are members of this key quorum.
193
+ * List of key quorum IDs that should be members of this key quorum. Key quorums
194
+ * can only be nested 1 level deep.
158
195
  */
159
196
  key_quorum_ids?: Array<string>;
160
197
 
198
+ /**
199
+ * List of P-256 public keys of the keys that should be authorized to sign on the
200
+ * key quorum, in base64-encoded DER format.
201
+ */
202
+ public_keys?: Array<string>;
203
+
204
+ /**
205
+ * List of user IDs of the users that should be authorized to sign on the key
206
+ * quorum.
207
+ */
161
208
  user_ids?: Array<string>;
162
209
  }
163
210
 
164
- export namespace KeyQuorum {
165
- export interface AuthorizationKey {
166
- display_name: string | null;
211
+ /**
212
+ * Headers required to authorize modifications to key quorums.
213
+ */
214
+ export interface KeyQuorumAuthorizationHeaders {
215
+ /**
216
+ * ID of your Privy app.
217
+ */
218
+ 'privy-app-id': string;
167
219
 
168
- public_key: string;
169
- }
170
- }
220
+ /**
221
+ * Request authorization signature. If multiple signatures are required, they
222
+ * should be comma separated.
223
+ */
224
+ 'privy-authorization-signature'?: string;
171
225
 
172
- export interface KeyQuorumDeleteResponse {
173
226
  /**
174
- * Whether the key quorum was deleted successfully.
227
+ * Request expiry. Value is a Unix timestamp in milliseconds representing the
228
+ * deadline by which the request must be processed.
175
229
  */
176
- success: boolean;
230
+ 'privy-request-expiry'?: string;
177
231
  }
178
232
 
179
233
  export interface KeyQuorumCreateParams {
@@ -210,6 +264,12 @@ export interface KeyQuorumDeleteParams {
210
264
  * should be comma separated.
211
265
  */
212
266
  'privy-authorization-signature'?: string;
267
+
268
+ /**
269
+ * Request expiry. Value is a Unix timestamp in milliseconds representing the
270
+ * deadline by which the request must be processed.
271
+ */
272
+ 'privy-request-expiry'?: string;
213
273
  }
214
274
 
215
275
  export interface KeyQuorumUpdateParams {
@@ -247,13 +307,21 @@ export interface KeyQuorumUpdateParams {
247
307
  * required, they should be comma separated.
248
308
  */
249
309
  'privy-authorization-signature'?: string;
310
+
311
+ /**
312
+ * Header param: Request expiry. Value is a Unix timestamp in milliseconds
313
+ * representing the deadline by which the request must be processed.
314
+ */
315
+ 'privy-request-expiry'?: string;
250
316
  }
251
317
 
252
318
  export declare namespace KeyQuorums {
253
319
  export {
254
- type KeyQuorumCreateParams as KeyQuorumCreateParams,
255
320
  type KeyQuorum as KeyQuorum,
256
- type KeyQuorumDeleteResponse as KeyQuorumDeleteResponse,
321
+ type KeyQuorumCreateRequestBody as KeyQuorumCreateRequestBody,
322
+ type KeyQuorumUpdateRequestBody as KeyQuorumUpdateRequestBody,
323
+ type KeyQuorumAuthorizationHeaders as KeyQuorumAuthorizationHeaders,
324
+ type KeyQuorumCreateParams as KeyQuorumCreateParams,
257
325
  type KeyQuorumDeleteParams as KeyQuorumDeleteParams,
258
326
  type KeyQuorumUpdateParams as KeyQuorumUpdateParams,
259
327
  };