@privy-io/api-types 0.8.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 (167) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/client.d.mts +35 -32
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +35 -32
  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 +22 -8
  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/internal/utils/env.js +2 -2
  15. package/internal/utils/env.js.map +1 -1
  16. package/internal/utils/env.mjs +2 -2
  17. package/internal/utils/env.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/resources/accounts.d.mts +128 -86
  20. package/resources/accounts.d.mts.map +1 -1
  21. package/resources/accounts.d.ts +128 -86
  22. package/resources/accounts.d.ts.map +1 -1
  23. package/resources/aggregations.d.mts +43 -43
  24. package/resources/aggregations.d.mts.map +1 -1
  25. package/resources/aggregations.d.ts +43 -43
  26. package/resources/aggregations.d.ts.map +1 -1
  27. package/resources/apps.d.mts +177 -129
  28. package/resources/apps.d.mts.map +1 -1
  29. package/resources/apps.d.ts +177 -129
  30. package/resources/apps.d.ts.map +1 -1
  31. package/resources/client-auth.d.mts +650 -648
  32. package/resources/client-auth.d.mts.map +1 -1
  33. package/resources/client-auth.d.ts +650 -648
  34. package/resources/client-auth.d.ts.map +1 -1
  35. package/resources/embedded-wallets.d.mts +84 -84
  36. package/resources/embedded-wallets.d.mts.map +1 -1
  37. package/resources/embedded-wallets.d.ts +84 -84
  38. package/resources/embedded-wallets.d.ts.map +1 -1
  39. package/resources/funding.d.mts +42 -42
  40. package/resources/funding.d.mts.map +1 -1
  41. package/resources/funding.d.ts +42 -42
  42. package/resources/funding.d.ts.map +1 -1
  43. package/resources/index.d.mts +19 -18
  44. package/resources/index.d.mts.map +1 -1
  45. package/resources/index.d.ts +19 -18
  46. package/resources/index.d.ts.map +1 -1
  47. package/resources/index.js +3 -1
  48. package/resources/index.js.map +1 -1
  49. package/resources/index.mjs +2 -1
  50. package/resources/index.mjs.map +1 -1
  51. package/resources/intents.d.mts +270 -266
  52. package/resources/intents.d.mts.map +1 -1
  53. package/resources/intents.d.ts +270 -266
  54. package/resources/intents.d.ts.map +1 -1
  55. package/resources/key-quorums.d.mts +20 -20
  56. package/resources/key-quorums.d.mts.map +1 -1
  57. package/resources/key-quorums.d.ts +20 -20
  58. package/resources/key-quorums.d.ts.map +1 -1
  59. package/resources/kraken-embed.d.mts +62 -19
  60. package/resources/kraken-embed.d.mts.map +1 -1
  61. package/resources/kraken-embed.d.ts +62 -19
  62. package/resources/kraken-embed.d.ts.map +1 -1
  63. package/resources/organizations.d.mts +65 -0
  64. package/resources/organizations.d.mts.map +1 -0
  65. package/resources/organizations.d.ts +65 -0
  66. package/resources/organizations.d.ts.map +1 -0
  67. package/resources/organizations.js +9 -0
  68. package/resources/organizations.js.map +1 -0
  69. package/resources/organizations.mjs +5 -0
  70. package/resources/organizations.mjs.map +1 -0
  71. package/resources/policies.d.mts +360 -231
  72. package/resources/policies.d.mts.map +1 -1
  73. package/resources/policies.d.ts +360 -231
  74. package/resources/policies.d.ts.map +1 -1
  75. package/resources/shared.d.mts +28 -28
  76. package/resources/shared.d.mts.map +1 -1
  77. package/resources/shared.d.ts +28 -28
  78. package/resources/shared.d.ts.map +1 -1
  79. package/resources/swaps.d.mts +8 -11
  80. package/resources/swaps.d.mts.map +1 -1
  81. package/resources/swaps.d.ts +8 -11
  82. package/resources/swaps.d.ts.map +1 -1
  83. package/resources/swaps.js.map +1 -1
  84. package/resources/swaps.mjs.map +1 -1
  85. package/resources/transactions.d.mts +56 -66
  86. package/resources/transactions.d.mts.map +1 -1
  87. package/resources/transactions.d.ts +56 -66
  88. package/resources/transactions.d.ts.map +1 -1
  89. package/resources/users.d.mts +457 -448
  90. package/resources/users.d.mts.map +1 -1
  91. package/resources/users.d.ts +457 -448
  92. package/resources/users.d.ts.map +1 -1
  93. package/resources/wallet-actions.d.mts +450 -41
  94. package/resources/wallet-actions.d.mts.map +1 -1
  95. package/resources/wallet-actions.d.ts +450 -41
  96. package/resources/wallet-actions.d.ts.map +1 -1
  97. package/resources/wallets/balance.d.mts +2 -1
  98. package/resources/wallets/balance.d.mts.map +1 -1
  99. package/resources/wallets/balance.d.ts +2 -1
  100. package/resources/wallets/balance.d.ts.map +1 -1
  101. package/resources/wallets/balance.js.map +1 -1
  102. package/resources/wallets/balance.mjs.map +1 -1
  103. package/resources/wallets/index.d.mts +1 -1
  104. package/resources/wallets/index.d.mts.map +1 -1
  105. package/resources/wallets/index.d.ts +1 -1
  106. package/resources/wallets/index.d.ts.map +1 -1
  107. package/resources/wallets/index.js.map +1 -1
  108. package/resources/wallets/index.mjs.map +1 -1
  109. package/resources/wallets/transactions.d.mts +16 -31
  110. package/resources/wallets/transactions.d.mts.map +1 -1
  111. package/resources/wallets/transactions.d.ts +16 -31
  112. package/resources/wallets/transactions.d.ts.map +1 -1
  113. package/resources/wallets/transactions.js +1 -1
  114. package/resources/wallets/transactions.js.map +1 -1
  115. package/resources/wallets/transactions.mjs +1 -1
  116. package/resources/wallets/transactions.mjs.map +1 -1
  117. package/resources/wallets/wallets.d.mts +1475 -1172
  118. package/resources/wallets/wallets.d.mts.map +1 -1
  119. package/resources/wallets/wallets.d.ts +1475 -1172
  120. package/resources/wallets/wallets.d.ts.map +1 -1
  121. package/resources/wallets/wallets.js +10 -6
  122. package/resources/wallets/wallets.js.map +1 -1
  123. package/resources/wallets/wallets.mjs +10 -6
  124. package/resources/wallets/wallets.mjs.map +1 -1
  125. package/resources/webhooks.d.mts +1345 -582
  126. package/resources/webhooks.d.mts.map +1 -1
  127. package/resources/webhooks.d.ts +1345 -582
  128. package/resources/webhooks.d.ts.map +1 -1
  129. package/resources/yield.d.mts +157 -157
  130. package/resources/yield.d.mts.map +1 -1
  131. package/resources/yield.d.ts +157 -157
  132. package/resources/yield.d.ts.map +1 -1
  133. package/src/client.ts +661 -455
  134. package/src/internal/types.ts +6 -8
  135. package/src/internal/utils/env.ts +2 -2
  136. package/src/resources/accounts.ts +157 -103
  137. package/src/resources/aggregations.ts +55 -55
  138. package/src/resources/apps.ts +232 -166
  139. package/src/resources/client-auth.ts +890 -890
  140. package/src/resources/embedded-wallets.ts +123 -123
  141. package/src/resources/funding.ts +66 -66
  142. package/src/resources/index.ts +521 -431
  143. package/src/resources/intents.ts +326 -322
  144. package/src/resources/key-quorums.ts +23 -23
  145. package/src/resources/kraken-embed.ts +116 -19
  146. package/src/resources/organizations.ts +82 -0
  147. package/src/resources/policies.ts +495 -339
  148. package/src/resources/shared.ts +34 -34
  149. package/src/resources/swaps.ts +9 -14
  150. package/src/resources/transactions.ts +88 -115
  151. package/src/resources/users.ts +664 -653
  152. package/src/resources/wallet-actions.ts +585 -56
  153. package/src/resources/wallets/balance.ts +2 -1
  154. package/src/resources/wallets/index.ts +158 -138
  155. package/src/resources/wallets/transactions.ts +20 -83
  156. package/src/resources/wallets/wallets.ts +1997 -1563
  157. package/src/resources/webhooks.ts +1652 -700
  158. package/src/resources/yield.ts +188 -188
  159. package/src/version.ts +1 -1
  160. package/version.d.mts +1 -1
  161. package/version.d.mts.map +1 -1
  162. package/version.d.ts +1 -1
  163. package/version.d.ts.map +1 -1
  164. package/version.js +1 -1
  165. package/version.js.map +1 -1
  166. package/version.mjs +1 -1
  167. package/version.mjs.map +1 -1
@@ -146,6 +146,28 @@ export namespace KeyQuorum {
146
146
  }
147
147
  }
148
148
 
149
+ /**
150
+ * Headers required to authorize modifications to key quorums.
151
+ */
152
+ export interface KeyQuorumAuthorizationHeaders {
153
+ /**
154
+ * ID of your Privy app.
155
+ */
156
+ 'privy-app-id': string;
157
+
158
+ /**
159
+ * Request authorization signature. If multiple signatures are required, they
160
+ * should be comma separated.
161
+ */
162
+ 'privy-authorization-signature'?: string;
163
+
164
+ /**
165
+ * Request expiry. Value is a Unix timestamp in milliseconds representing the
166
+ * deadline by which the request must be processed.
167
+ */
168
+ 'privy-request-expiry'?: string;
169
+ }
170
+
149
171
  /**
150
172
  * Request input for creating a key quorum.
151
173
  */
@@ -208,28 +230,6 @@ export interface KeyQuorumUpdateRequestBody {
208
230
  user_ids?: Array<string>;
209
231
  }
210
232
 
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;
219
-
220
- /**
221
- * Request authorization signature. If multiple signatures are required, they
222
- * should be comma separated.
223
- */
224
- 'privy-authorization-signature'?: string;
225
-
226
- /**
227
- * Request expiry. Value is a Unix timestamp in milliseconds representing the
228
- * deadline by which the request must be processed.
229
- */
230
- 'privy-request-expiry'?: string;
231
- }
232
-
233
233
  export interface KeyQuorumCreateParams {
234
234
  /**
235
235
  * The number of keys that must sign for an action to be valid. Must be less than
@@ -318,9 +318,9 @@ export interface KeyQuorumUpdateParams {
318
318
  export declare namespace KeyQuorums {
319
319
  export {
320
320
  type KeyQuorum as KeyQuorum,
321
+ type KeyQuorumAuthorizationHeaders as KeyQuorumAuthorizationHeaders,
321
322
  type KeyQuorumCreateRequestBody as KeyQuorumCreateRequestBody,
322
323
  type KeyQuorumUpdateRequestBody as KeyQuorumUpdateRequestBody,
323
- type KeyQuorumAuthorizationHeaders as KeyQuorumAuthorizationHeaders,
324
324
  type KeyQuorumCreateParams as KeyQuorumCreateParams,
325
325
  type KeyQuorumDeleteParams as KeyQuorumDeleteParams,
326
326
  type KeyQuorumUpdateParams as KeyQuorumUpdateParams,
@@ -6,22 +6,78 @@ import * as KrakenEmbedAPI from './kraken-embed';
6
6
  export class KrakenEmbed extends APIResource {}
7
7
 
8
8
  /**
9
- * Query parameters for getting a portfolio summary.
9
+ * Current day profit and loss for a portfolio, calculated from the most recent
10
+ * available balance.
10
11
  */
11
- export interface KrakenEmbedGetPortfolioSummaryQueryParams {
12
- 'include[current_day_pnl]'?: 'true' | 'false';
12
+ export interface KrakenEmbedCurrentDayPnl {
13
+ pnl: string;
14
+
15
+ since: string;
16
+ }
17
+
18
+ /**
19
+ * Query parameters for listing and filtering available assets.
20
+ */
21
+ export interface KrakenEmbedGetAssetListQueryParamsSchema {
22
+ 'filter[assets]'?: Array<string>;
23
+
24
+ 'filter[platform_statuses]'?: Array<
25
+ | 'enabled'
26
+ | 'deposit_only'
27
+ | 'withdrawal_only'
28
+ | 'funding_temporarily_disabled'
29
+ | 'disabled'
30
+ | (string & {})
31
+ >;
32
+
33
+ 'filter[tradable_only]'?: boolean | null;
34
+
35
+ 'filter[user]'?: string;
36
+
37
+ lang?: string;
38
+
39
+ 'page[number]'?: number;
40
+
41
+ 'page[size]'?: number;
13
42
 
14
43
  quote?: string;
44
+
45
+ sort?:
46
+ | 'trending'
47
+ | 'market_cap_rank'
48
+ | '-market_cap_rank'
49
+ | 'symbol'
50
+ | '-symbol'
51
+ | 'name'
52
+ | '-name'
53
+ | 'change_percent_1h'
54
+ | '-change_percent_1h'
55
+ | 'change_percent_24h'
56
+ | '-change_percent_24h'
57
+ | 'change_percent_7d'
58
+ | '-change_percent_7d'
59
+ | 'change_percent_30d'
60
+ | '-change_percent_30d'
61
+ | 'change_percent_1y'
62
+ | '-change_percent_1y'
63
+ | 'listing_date'
64
+ | '-listing_date';
15
65
  }
16
66
 
17
67
  /**
18
- * Current day profit and loss for a portfolio, calculated from the most recent
19
- * available balance.
68
+ * Query parameters for portfolio details endpoint.
20
69
  */
21
- export interface KrakenEmbedCurrentDayPnl {
22
- pnl: string;
70
+ export interface KrakenEmbedGetPortfolioDetailsQueryParamsSchema {
71
+ quote?: string;
72
+ }
23
73
 
24
- since: string;
74
+ /**
75
+ * Query parameters for getting a portfolio summary.
76
+ */
77
+ export interface KrakenEmbedGetPortfolioSummaryQueryParams {
78
+ 'include[current_day_pnl]'?: 'true' | 'false';
79
+
80
+ quote?: string;
25
81
  }
26
82
 
27
83
  /**
@@ -36,9 +92,9 @@ export namespace KrakenEmbedGetPortfolioSummaryResponse {
36
92
  export interface Data {
37
93
  result: Data.Result | null;
38
94
 
39
- error?: Array<unknown>;
95
+ error?: Array<string>;
40
96
 
41
- errors?: Array<unknown>;
97
+ errors?: Array<string>;
42
98
  }
43
99
 
44
100
  export namespace Data {
@@ -61,25 +117,66 @@ export namespace KrakenEmbedGetPortfolioSummaryResponse {
61
117
  * Current day profit and loss for a portfolio, calculated from the most recent
62
118
  * available balance.
63
119
  */
64
- current_day_pnl?: Result.CurrentDayPnl;
120
+ current_day_pnl?: KrakenEmbedAPI.KrakenEmbedCurrentDayPnl | null;
65
121
 
66
122
  lots_upnl?: string | null;
67
123
  }
124
+ }
125
+ }
68
126
 
69
- export namespace Result {
70
- /**
71
- * Current day profit and loss for a portfolio, calculated from the most recent
72
- * available balance.
73
- */
74
- export interface CurrentDayPnl extends KrakenEmbedAPI.KrakenEmbedCurrentDayPnl {}
75
- }
127
+ /**
128
+ * Query parameters for filtering and paginating portfolio transactions.
129
+ */
130
+ export interface KrakenEmbedGetPortfolioTransactionsQueryParamsSchema {
131
+ assets?: Array<string>;
132
+
133
+ cursor?: string;
134
+
135
+ from_time?: string;
136
+
137
+ ids?: Array<string>;
138
+
139
+ page_size?: number;
140
+
141
+ quote?: string;
142
+
143
+ ref_ids?: Array<KrakenEmbedGetPortfolioTransactionsQueryParamsSchema.RefID>;
144
+
145
+ sorting?: 'descending' | 'ascending';
146
+
147
+ statuses?: Array<'unspecified' | 'in_progress' | 'successful' | 'failed'>;
148
+
149
+ types?: Array<'simple_order' | 'simple_order_failed' | 'earn_reward'>;
150
+
151
+ until_time?: string;
152
+ }
153
+
154
+ export namespace KrakenEmbedGetPortfolioTransactionsQueryParamsSchema {
155
+ export interface RefID {
156
+ ref_id: string;
157
+
158
+ type: 'simple_order_quote' | 'simple_order_quote_failed';
76
159
  }
77
160
  }
78
161
 
162
+ /**
163
+ * Query parameters for getting a quote status.
164
+ */
165
+ export interface KrakenEmbedGetQuoteQueryParams {
166
+ /**
167
+ * The ID of the Privy user.
168
+ */
169
+ user_id: string;
170
+ }
171
+
79
172
  export declare namespace KrakenEmbed {
80
173
  export {
81
- type KrakenEmbedGetPortfolioSummaryQueryParams as KrakenEmbedGetPortfolioSummaryQueryParams,
82
174
  type KrakenEmbedCurrentDayPnl as KrakenEmbedCurrentDayPnl,
175
+ type KrakenEmbedGetAssetListQueryParamsSchema as KrakenEmbedGetAssetListQueryParamsSchema,
176
+ type KrakenEmbedGetPortfolioDetailsQueryParamsSchema as KrakenEmbedGetPortfolioDetailsQueryParamsSchema,
177
+ type KrakenEmbedGetPortfolioSummaryQueryParams as KrakenEmbedGetPortfolioSummaryQueryParams,
83
178
  type KrakenEmbedGetPortfolioSummaryResponse as KrakenEmbedGetPortfolioSummaryResponse,
179
+ type KrakenEmbedGetPortfolioTransactionsQueryParamsSchema as KrakenEmbedGetPortfolioTransactionsQueryParamsSchema,
180
+ type KrakenEmbedGetQuoteQueryParams as KrakenEmbedGetQuoteQueryParams,
84
181
  };
85
182
  }
@@ -0,0 +1,82 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+
5
+ export class Organizations extends APIResource {}
6
+
7
+ /**
8
+ * Response returned when creating a new organization secret.
9
+ */
10
+ export interface CreateOrganizationSecretResponse extends OrganizationSecretView {
11
+ /**
12
+ * The plaintext organization secret. Returned only at creation time.
13
+ */
14
+ organization_secret: string;
15
+ }
16
+
17
+ /**
18
+ * Request body for targeting a specific organization secret.
19
+ */
20
+ export interface OrganizationSecretIDInput {
21
+ /**
22
+ * The organization secret ID.
23
+ */
24
+ secret_id: string;
25
+ }
26
+
27
+ /**
28
+ * View of an organization secret for list and management endpoints.
29
+ */
30
+ export interface OrganizationSecretView {
31
+ /**
32
+ * Unique secret identifier
33
+ */
34
+ id: string;
35
+
36
+ /**
37
+ * ISO 8601 creation timestamp
38
+ */
39
+ created_at: string;
40
+
41
+ /**
42
+ * Last four characters of the secret
43
+ */
44
+ last_four: string;
45
+
46
+ /**
47
+ * ISO 8601 revocation timestamp, or null if active
48
+ */
49
+ revoked_at: string | null;
50
+
51
+ /**
52
+ * P-256 public key in PEM format for request signing, or null if not configured
53
+ */
54
+ signing_public_key: string | null;
55
+ }
56
+
57
+ /**
58
+ * Response returned when listing organization secrets for an account.
59
+ */
60
+ export interface OrganizationSecretsListResponse {
61
+ data: Array<OrganizationSecretView>;
62
+ }
63
+
64
+ /**
65
+ * Request body for updating the signing public key on an organization secret.
66
+ */
67
+ export interface UpdateOrganizationSecretSigningKeyInput extends OrganizationSecretIDInput {
68
+ /**
69
+ * P-256 public key in PEM format, or null to clear the configured signing key.
70
+ */
71
+ signing_public_key: string | null;
72
+ }
73
+
74
+ export declare namespace Organizations {
75
+ export {
76
+ type CreateOrganizationSecretResponse as CreateOrganizationSecretResponse,
77
+ type OrganizationSecretIDInput as OrganizationSecretIDInput,
78
+ type OrganizationSecretView as OrganizationSecretView,
79
+ type OrganizationSecretsListResponse as OrganizationSecretsListResponse,
80
+ type UpdateOrganizationSecretSigningKeyInput as UpdateOrganizationSecretSigningKeyInput,
81
+ };
82
+ }