@privy-io/api-types 0.10.0 → 0.12.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.
- package/CHANGELOG.md +27 -0
- package/client.d.mts +22 -28
- package/client.d.mts.map +1 -1
- package/client.d.ts +22 -28
- package/client.d.ts.map +1 -1
- package/client.js +6 -12
- package/client.js.map +1 -1
- package/client.mjs +7 -13
- package/client.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +2 -0
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +2 -0
- package/internal/utils/log.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/apps.d.mts +5 -0
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +5 -0
- package/resources/apps.d.ts.map +1 -1
- package/resources/client-auth.d.mts +496 -514
- package/resources/client-auth.d.mts.map +1 -1
- package/resources/client-auth.d.ts +496 -514
- package/resources/client-auth.d.ts.map +1 -1
- package/resources/client-auth.js.map +1 -1
- package/resources/client-auth.mjs.map +1 -1
- package/resources/cross-app.d.mts +5 -0
- package/resources/cross-app.d.mts.map +1 -1
- package/resources/cross-app.d.ts +5 -0
- package/resources/cross-app.d.ts.map +1 -1
- package/resources/embedded-wallets.d.mts +10 -10
- package/resources/embedded-wallets.d.mts.map +1 -1
- package/resources/embedded-wallets.d.ts +10 -10
- package/resources/embedded-wallets.d.ts.map +1 -1
- package/resources/fiat.d.mts +110 -0
- package/resources/fiat.d.mts.map +1 -0
- package/resources/fiat.d.ts +110 -0
- package/resources/fiat.d.ts.map +1 -0
- package/resources/fiat.js +9 -0
- package/resources/fiat.js.map +1 -0
- package/resources/fiat.mjs +5 -0
- package/resources/fiat.mjs.map +1 -0
- package/resources/funding.d.mts +46 -46
- package/resources/funding.d.mts.map +1 -1
- package/resources/funding.d.ts +46 -46
- package/resources/funding.d.ts.map +1 -1
- package/resources/index.d.mts +11 -10
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +11 -10
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -1
- package/resources/index.mjs.map +1 -1
- package/resources/key-quorums.d.mts +1 -132
- package/resources/key-quorums.d.mts.map +1 -1
- package/resources/key-quorums.d.ts +1 -132
- package/resources/key-quorums.d.ts.map +1 -1
- package/resources/key-quorums.js +0 -92
- package/resources/key-quorums.js.map +1 -1
- package/resources/key-quorums.mjs +0 -92
- package/resources/key-quorums.mjs.map +1 -1
- package/resources/policies.d.mts +2 -312
- package/resources/policies.d.mts.map +1 -1
- package/resources/policies.d.ts +2 -312
- package/resources/policies.d.ts.map +1 -1
- package/resources/policies.js +0 -229
- package/resources/policies.js.map +1 -1
- package/resources/policies.mjs +0 -229
- package/resources/policies.mjs.map +1 -1
- package/resources/swaps.d.mts +54 -26
- package/resources/swaps.d.mts.map +1 -1
- package/resources/swaps.d.ts +54 -26
- package/resources/swaps.d.ts.map +1 -1
- package/resources/transactions.d.mts +28 -44
- package/resources/transactions.d.mts.map +1 -1
- package/resources/transactions.d.ts +28 -44
- package/resources/transactions.d.ts.map +1 -1
- package/resources/transactions.js +0 -17
- package/resources/transactions.js.map +1 -1
- package/resources/transactions.mjs +0 -17
- package/resources/transactions.mjs.map +1 -1
- package/resources/users.d.mts +1 -345
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +1 -345
- package/resources/users.d.ts.map +1 -1
- package/resources/users.js +0 -272
- package/resources/users.js.map +1 -1
- package/resources/users.mjs +0 -272
- package/resources/users.mjs.map +1 -1
- package/resources/wallet-actions.d.mts +22 -3
- package/resources/wallet-actions.d.mts.map +1 -1
- package/resources/wallet-actions.d.ts +22 -3
- package/resources/wallet-actions.d.ts.map +1 -1
- package/resources/wallets/index.d.mts +1 -1
- package/resources/wallets/index.d.mts.map +1 -1
- package/resources/wallets/index.d.ts +1 -1
- package/resources/wallets/index.d.ts.map +1 -1
- package/resources/wallets/index.js.map +1 -1
- package/resources/wallets/index.mjs.map +1 -1
- package/resources/wallets/transactions.d.mts +6 -2
- package/resources/wallets/transactions.d.mts.map +1 -1
- package/resources/wallets/transactions.d.ts +6 -2
- package/resources/wallets/transactions.d.ts.map +1 -1
- package/resources/wallets/wallets.d.mts +184 -342
- package/resources/wallets/wallets.d.mts.map +1 -1
- package/resources/wallets/wallets.d.ts +184 -342
- package/resources/wallets/wallets.d.ts.map +1 -1
- package/resources/wallets/wallets.js +41 -102
- package/resources/wallets/wallets.js.map +1 -1
- package/resources/wallets/wallets.mjs +41 -102
- package/resources/wallets/wallets.mjs.map +1 -1
- package/src/client.ts +122 -153
- package/src/internal/utils/log.ts +2 -0
- package/src/resources/apps.ts +6 -0
- package/src/resources/client-auth.ts +743 -787
- package/src/resources/cross-app.ts +6 -0
- package/src/resources/embedded-wallets.ts +16 -15
- package/src/resources/fiat.ts +177 -0
- package/src/resources/funding.ts +65 -65
- package/src/resources/index.ts +97 -107
- package/src/resources/key-quorums.ts +1 -203
- package/src/resources/policies.ts +1 -495
- package/src/resources/swaps.ts +59 -25
- package/src/resources/transactions.ts +35 -55
- package/src/resources/users.ts +1 -479
- package/src/resources/wallet-actions.ts +38 -2
- package/src/resources/wallets/index.ts +4 -9
- package/src/resources/wallets/transactions.ts +6 -2
- package/src/resources/wallets/wallets.ts +236 -450
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,60 +1,8 @@
|
|
|
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 { APIPromise } from '../core/api-promise';
|
|
5
|
-
import { RequestOptions } from '../internal/request-options';
|
|
6
|
-
import { path } from '../internal/utils/path';
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
* Operations related to transactions
|
|
10
|
-
*/
|
|
11
|
-
export class Transactions extends APIResource {
|
|
12
|
-
/**
|
|
13
|
-
* Get a transaction by transaction ID.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```ts
|
|
17
|
-
* const transaction = await client.transactions.get(
|
|
18
|
-
* 'transaction_id',
|
|
19
|
-
* );
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
get(transactionID: string, options?: RequestOptions): APIPromise<Transaction> {
|
|
23
|
-
return this._client.get(path`/v1/transactions/${transactionID}`, options);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* The request body for scanning a transaction.
|
|
29
|
-
*/
|
|
30
|
-
export interface TransactionScanningRequestBody {
|
|
31
|
-
chain_id: string;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Additional information for Blockaid to validate against.
|
|
35
|
-
*/
|
|
36
|
-
metadata: TransactionScanningMetadata;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Raw RPC request to execute with the wallet.
|
|
40
|
-
*/
|
|
41
|
-
request: TransactionScanningRpcRequest;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* The response from scanning a transaction.
|
|
46
|
-
*/
|
|
47
|
-
export interface TransactionScanningResponseBody {
|
|
48
|
-
/**
|
|
49
|
-
* The simulation result from a transaction scan.
|
|
50
|
-
*/
|
|
51
|
-
simulation: TransactionScanningSimulationResult;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* The validation result from a transaction scan.
|
|
55
|
-
*/
|
|
56
|
-
validation: TransactionScanningValidationResult;
|
|
57
|
-
}
|
|
5
|
+
export class Transactions extends APIResource {}
|
|
58
6
|
|
|
59
7
|
/**
|
|
60
8
|
* A transaction from a Privy wallet.
|
|
@@ -188,6 +136,38 @@ export interface TransactionScanningParams {
|
|
|
188
136
|
value?: string;
|
|
189
137
|
}
|
|
190
138
|
|
|
139
|
+
/**
|
|
140
|
+
* The request body for scanning a transaction.
|
|
141
|
+
*/
|
|
142
|
+
export interface TransactionScanningRequestBody {
|
|
143
|
+
chain_id: string;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Additional information for Blockaid to validate against.
|
|
147
|
+
*/
|
|
148
|
+
metadata: TransactionScanningMetadata;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Raw RPC request to execute with the wallet.
|
|
152
|
+
*/
|
|
153
|
+
request: TransactionScanningRpcRequest;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* The response from scanning a transaction.
|
|
158
|
+
*/
|
|
159
|
+
export interface TransactionScanningResponseBody {
|
|
160
|
+
/**
|
|
161
|
+
* The simulation result from a transaction scan.
|
|
162
|
+
*/
|
|
163
|
+
simulation: TransactionScanningSimulationResult;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* The validation result from a transaction scan.
|
|
167
|
+
*/
|
|
168
|
+
validation: TransactionScanningValidationResult;
|
|
169
|
+
}
|
|
170
|
+
|
|
191
171
|
/**
|
|
192
172
|
* Raw RPC request to execute with the wallet.
|
|
193
173
|
*/
|
|
@@ -256,8 +236,6 @@ export interface TransactionScanningValidationSuccessResult {
|
|
|
256
236
|
|
|
257
237
|
export declare namespace Transactions {
|
|
258
238
|
export {
|
|
259
|
-
type TransactionScanningRequestBody as TransactionScanningRequestBody,
|
|
260
|
-
type TransactionScanningResponseBody as TransactionScanningResponseBody,
|
|
261
239
|
type Transaction as Transaction,
|
|
262
240
|
type TransactionList as TransactionList,
|
|
263
241
|
type TransactionScanningAssetDiff as TransactionScanningAssetDiff,
|
|
@@ -267,6 +245,8 @@ export declare namespace Transactions {
|
|
|
267
245
|
type TransactionScanningExposure as TransactionScanningExposure,
|
|
268
246
|
type TransactionScanningMetadata as TransactionScanningMetadata,
|
|
269
247
|
type TransactionScanningParams as TransactionScanningParams,
|
|
248
|
+
type TransactionScanningRequestBody as TransactionScanningRequestBody,
|
|
249
|
+
type TransactionScanningResponseBody as TransactionScanningResponseBody,
|
|
270
250
|
type TransactionScanningRpcRequest as TransactionScanningRpcRequest,
|
|
271
251
|
type TransactionScanningSimulationErrorResult as TransactionScanningSimulationErrorResult,
|
|
272
252
|
type TransactionScanningSimulationResult as TransactionScanningSimulationResult,
|
package/src/resources/users.ts
CHANGED
|
@@ -4,324 +4,9 @@ import { APIResource } from '../core/resource';
|
|
|
4
4
|
import * as UsersAPI from './users';
|
|
5
5
|
import * as ClientAuthAPI from './client-auth';
|
|
6
6
|
import * as EmbeddedWalletsAPI from './embedded-wallets';
|
|
7
|
-
import * as SharedAPI from './shared';
|
|
8
7
|
import * as WalletsAPI from './wallets/wallets';
|
|
9
|
-
import { APIPromise } from '../core/api-promise';
|
|
10
|
-
import { Cursor, type CursorParams, PagePromise } from '../core/pagination';
|
|
11
|
-
import { buildHeaders } from '../internal/headers';
|
|
12
|
-
import { RequestOptions } from '../internal/request-options';
|
|
13
|
-
import { path } from '../internal/utils/path';
|
|
14
8
|
|
|
15
|
-
|
|
16
|
-
* Operations related to users
|
|
17
|
-
*/
|
|
18
|
-
export class Users extends APIResource {
|
|
19
|
-
/**
|
|
20
|
-
* Create a new user with linked accounts. Optionally pre-generate embedded wallets
|
|
21
|
-
* for the user.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* const user = await client.users.create({
|
|
26
|
-
* linked_accounts: [
|
|
27
|
-
* { address: 'tom.bombadill@privy.io', type: 'email' },
|
|
28
|
-
* ],
|
|
29
|
-
* });
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
create(body: UserCreateParams, options?: RequestOptions): APIPromise<User> {
|
|
33
|
-
return this._client.post('/v1/users', { body, ...options });
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Get all users in your app.
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```ts
|
|
41
|
-
* // Automatically fetches more pages as needed.
|
|
42
|
-
* for await (const user of client.users.list()) {
|
|
43
|
-
* // ...
|
|
44
|
-
* }
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
list(
|
|
48
|
-
query: UserListParams | null | undefined = {},
|
|
49
|
-
options?: RequestOptions,
|
|
50
|
-
): PagePromise<UsersCursor, User> {
|
|
51
|
-
return this._client.getAPIList('/v1/users', Cursor<User>, { query, ...options });
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Delete a user by user ID.
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* ```ts
|
|
59
|
-
* await client.users.delete('user_id');
|
|
60
|
-
* ```
|
|
61
|
-
*/
|
|
62
|
-
delete(userID: string, options?: RequestOptions): APIPromise<void> {
|
|
63
|
-
return this._client.delete(path`/v1/users/${userID}`, {
|
|
64
|
-
...options,
|
|
65
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Get a user by user ID.
|
|
71
|
-
*
|
|
72
|
-
* @example
|
|
73
|
-
* ```ts
|
|
74
|
-
* const user = await client.users._get('user_id');
|
|
75
|
-
* ```
|
|
76
|
-
*/
|
|
77
|
-
_get(userID: string, options?: RequestOptions): APIPromise<User> {
|
|
78
|
-
return this._client.get(path`/v1/users/${userID}`, options);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Looks up a user by their custom auth ID.
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* ```ts
|
|
86
|
-
* const user = await client.users.getByCustomAuthID({
|
|
87
|
-
* custom_user_id: 'custom_user_id',
|
|
88
|
-
* });
|
|
89
|
-
* ```
|
|
90
|
-
*/
|
|
91
|
-
getByCustomAuthID(body: UserGetByCustomAuthIDParams, options?: RequestOptions): APIPromise<User> {
|
|
92
|
-
return this._client.post('/v1/users/custom_auth/id', { body, ...options });
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Looks up a user by their Discord username.
|
|
97
|
-
*
|
|
98
|
-
* @example
|
|
99
|
-
* ```ts
|
|
100
|
-
* const user = await client.users.getByDiscordUsername({
|
|
101
|
-
* username: 'username',
|
|
102
|
-
* });
|
|
103
|
-
* ```
|
|
104
|
-
*/
|
|
105
|
-
getByDiscordUsername(body: UserGetByDiscordUsernameParams, options?: RequestOptions): APIPromise<User> {
|
|
106
|
-
return this._client.post('/v1/users/discord/username', { body, ...options });
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Looks up a user by their email address.
|
|
111
|
-
*
|
|
112
|
-
* @example
|
|
113
|
-
* ```ts
|
|
114
|
-
* const user = await client.users.getByEmailAddress({
|
|
115
|
-
* address: 'dev@stainless.com',
|
|
116
|
-
* });
|
|
117
|
-
* ```
|
|
118
|
-
*/
|
|
119
|
-
getByEmailAddress(body: UserGetByEmailAddressParams, options?: RequestOptions): APIPromise<User> {
|
|
120
|
-
return this._client.post('/v1/users/email/address', { body, ...options });
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Looks up a user by their Farcaster ID.
|
|
125
|
-
*
|
|
126
|
-
* @example
|
|
127
|
-
* ```ts
|
|
128
|
-
* const user = await client.users.getByFarcasterID({
|
|
129
|
-
* fid: 0,
|
|
130
|
-
* });
|
|
131
|
-
* ```
|
|
132
|
-
*/
|
|
133
|
-
getByFarcasterID(body: UserGetByFarcasterIDParams, options?: RequestOptions): APIPromise<User> {
|
|
134
|
-
return this._client.post('/v1/users/farcaster/fid', { body, ...options });
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Looks up a user by their Github username.
|
|
139
|
-
*
|
|
140
|
-
* @example
|
|
141
|
-
* ```ts
|
|
142
|
-
* const user = await client.users.getByGitHubUsername({
|
|
143
|
-
* username: 'username',
|
|
144
|
-
* });
|
|
145
|
-
* ```
|
|
146
|
-
*/
|
|
147
|
-
getByGitHubUsername(body: UserGetByGitHubUsernameParams, options?: RequestOptions): APIPromise<User> {
|
|
148
|
-
return this._client.post('/v1/users/github/username', { body, ...options });
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Looks up a user by their phone number.
|
|
153
|
-
*
|
|
154
|
-
* @example
|
|
155
|
-
* ```ts
|
|
156
|
-
* const user = await client.users.getByPhoneNumber({
|
|
157
|
-
* number: 'number',
|
|
158
|
-
* });
|
|
159
|
-
* ```
|
|
160
|
-
*/
|
|
161
|
-
getByPhoneNumber(body: UserGetByPhoneNumberParams, options?: RequestOptions): APIPromise<User> {
|
|
162
|
-
return this._client.post('/v1/users/phone/number', { body, ...options });
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Looks up a user by their smart wallet address.
|
|
167
|
-
*
|
|
168
|
-
* @example
|
|
169
|
-
* ```ts
|
|
170
|
-
* const user = await client.users.getBySmartWalletAddress({
|
|
171
|
-
* address: 'address',
|
|
172
|
-
* });
|
|
173
|
-
* ```
|
|
174
|
-
*/
|
|
175
|
-
getBySmartWalletAddress(
|
|
176
|
-
body: UserGetBySmartWalletAddressParams,
|
|
177
|
-
options?: RequestOptions,
|
|
178
|
-
): APIPromise<User> {
|
|
179
|
-
return this._client.post('/v1/users/smart_wallet/address', { body, ...options });
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Looks up a user by their Telegram user ID.
|
|
184
|
-
*
|
|
185
|
-
* @example
|
|
186
|
-
* ```ts
|
|
187
|
-
* const user = await client.users.getByTelegramUserID({
|
|
188
|
-
* telegram_user_id: 'telegram_user_id',
|
|
189
|
-
* });
|
|
190
|
-
* ```
|
|
191
|
-
*/
|
|
192
|
-
getByTelegramUserID(body: UserGetByTelegramUserIDParams, options?: RequestOptions): APIPromise<User> {
|
|
193
|
-
return this._client.post('/v1/users/telegram/telegram_user_id', { body, ...options });
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Looks up a user by their Telegram username.
|
|
198
|
-
*
|
|
199
|
-
* @example
|
|
200
|
-
* ```ts
|
|
201
|
-
* const user = await client.users.getByTelegramUsername({
|
|
202
|
-
* username: 'username',
|
|
203
|
-
* });
|
|
204
|
-
* ```
|
|
205
|
-
*/
|
|
206
|
-
getByTelegramUsername(body: UserGetByTelegramUsernameParams, options?: RequestOptions): APIPromise<User> {
|
|
207
|
-
return this._client.post('/v1/users/telegram/username', { body, ...options });
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Looks up a user by their Twitter subject.
|
|
212
|
-
*
|
|
213
|
-
* @example
|
|
214
|
-
* ```ts
|
|
215
|
-
* const user = await client.users.getByTwitterSubject({
|
|
216
|
-
* subject: 'subject',
|
|
217
|
-
* });
|
|
218
|
-
* ```
|
|
219
|
-
*/
|
|
220
|
-
getByTwitterSubject(body: UserGetByTwitterSubjectParams, options?: RequestOptions): APIPromise<User> {
|
|
221
|
-
return this._client.post('/v1/users/twitter/subject', { body, ...options });
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* Looks up a user by their Twitter username.
|
|
226
|
-
*
|
|
227
|
-
* @example
|
|
228
|
-
* ```ts
|
|
229
|
-
* const user = await client.users.getByTwitterUsername({
|
|
230
|
-
* username: 'username',
|
|
231
|
-
* });
|
|
232
|
-
* ```
|
|
233
|
-
*/
|
|
234
|
-
getByTwitterUsername(body: UserGetByTwitterUsernameParams, options?: RequestOptions): APIPromise<User> {
|
|
235
|
-
return this._client.post('/v1/users/twitter/username', { body, ...options });
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* Looks up a user by their wallet address.
|
|
240
|
-
*
|
|
241
|
-
* @example
|
|
242
|
-
* ```ts
|
|
243
|
-
* const user = await client.users.getByWalletAddress({
|
|
244
|
-
* address: 'address',
|
|
245
|
-
* });
|
|
246
|
-
* ```
|
|
247
|
-
*/
|
|
248
|
-
getByWalletAddress(body: UserGetByWalletAddressParams, options?: RequestOptions): APIPromise<User> {
|
|
249
|
-
return this._client.post('/v1/users/wallet/address', { body, ...options });
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Creates an embedded wallet for an existing user.
|
|
254
|
-
*
|
|
255
|
-
* @example
|
|
256
|
-
* ```ts
|
|
257
|
-
* const user = await client.users.pregenerateWallets(
|
|
258
|
-
* 'user_id',
|
|
259
|
-
* { wallets: [{ chain_type: 'ethereum' }] },
|
|
260
|
-
* );
|
|
261
|
-
* ```
|
|
262
|
-
*/
|
|
263
|
-
pregenerateWallets(
|
|
264
|
-
userID: string,
|
|
265
|
-
body: UserPregenerateWalletsParams,
|
|
266
|
-
options?: RequestOptions,
|
|
267
|
-
): APIPromise<User> {
|
|
268
|
-
return this._client.post(path`/v1/users/${userID}/wallets`, { body, ...options });
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Search users by search term, emails, phone numbers, or wallet addresses.
|
|
273
|
-
*
|
|
274
|
-
* @example
|
|
275
|
-
* ```ts
|
|
276
|
-
* const user = await client.users.search({
|
|
277
|
-
* searchTerm: 'searchTerm',
|
|
278
|
-
* });
|
|
279
|
-
* ```
|
|
280
|
-
*/
|
|
281
|
-
search(body: UserSearchParams, options?: RequestOptions): APIPromise<User> {
|
|
282
|
-
return this._client.post('/v1/users/search', { body, ...options });
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Adds custom metadata to a user by user ID.
|
|
287
|
-
*
|
|
288
|
-
* @example
|
|
289
|
-
* ```ts
|
|
290
|
-
* const user = await client.users.setCustomMetadata(
|
|
291
|
-
* 'user_id',
|
|
292
|
-
* { custom_metadata: { key: 'value' } },
|
|
293
|
-
* );
|
|
294
|
-
* ```
|
|
295
|
-
*/
|
|
296
|
-
setCustomMetadata(
|
|
297
|
-
userID: string,
|
|
298
|
-
body: UserSetCustomMetadataParams,
|
|
299
|
-
options?: RequestOptions,
|
|
300
|
-
): APIPromise<User> {
|
|
301
|
-
return this._client.post(path`/v1/users/${userID}/custom_metadata`, { body, ...options });
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* Unlinks a user linked account.
|
|
306
|
-
*
|
|
307
|
-
* @example
|
|
308
|
-
* ```ts
|
|
309
|
-
* const user = await client.users.unlinkLinkedAccount(
|
|
310
|
-
* 'user_id',
|
|
311
|
-
* { handle: 'test@test.com', type: 'email' },
|
|
312
|
-
* );
|
|
313
|
-
* ```
|
|
314
|
-
*/
|
|
315
|
-
unlinkLinkedAccount(
|
|
316
|
-
userID: string,
|
|
317
|
-
body: UserUnlinkLinkedAccountParams,
|
|
318
|
-
options?: RequestOptions,
|
|
319
|
-
): APIPromise<User> {
|
|
320
|
-
return this._client.post(path`/v1/users/${userID}/accounts/unlink`, { body, ...options });
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
export type UsersCursor = Cursor<User>;
|
|
9
|
+
export class Users extends APIResource {}
|
|
325
10
|
|
|
326
11
|
/**
|
|
327
12
|
* The authenticated user.
|
|
@@ -1592,150 +1277,6 @@ export interface UserWithIdentityToken {
|
|
|
1592
1277
|
user: User;
|
|
1593
1278
|
}
|
|
1594
1279
|
|
|
1595
|
-
export interface UserCreateParams {
|
|
1596
|
-
linked_accounts: Array<LinkedAccountInput>;
|
|
1597
|
-
|
|
1598
|
-
/**
|
|
1599
|
-
* Custom metadata associated with the user.
|
|
1600
|
-
*/
|
|
1601
|
-
custom_metadata?: CustomMetadata;
|
|
1602
|
-
|
|
1603
|
-
/**
|
|
1604
|
-
* Wallets to create for the user.
|
|
1605
|
-
*/
|
|
1606
|
-
wallets?: Array<UserCreateParams.Wallet>;
|
|
1607
|
-
}
|
|
1608
|
-
|
|
1609
|
-
export namespace UserCreateParams {
|
|
1610
|
-
export interface Wallet {
|
|
1611
|
-
/**
|
|
1612
|
-
* The wallet chain types.
|
|
1613
|
-
*/
|
|
1614
|
-
chain_type: WalletsAPI.WalletChainType;
|
|
1615
|
-
|
|
1616
|
-
/**
|
|
1617
|
-
* Additional signers for the wallet.
|
|
1618
|
-
*/
|
|
1619
|
-
additional_signers?: Array<Wallet.AdditionalSigner>;
|
|
1620
|
-
|
|
1621
|
-
/**
|
|
1622
|
-
* Create a smart wallet with this wallet as the signer. Only supported for wallets
|
|
1623
|
-
* with `chain_type: "ethereum"`.
|
|
1624
|
-
*/
|
|
1625
|
-
create_smart_wallet?: boolean;
|
|
1626
|
-
|
|
1627
|
-
/**
|
|
1628
|
-
* Policy IDs to enforce on the wallet. Currently, only one policy is supported per
|
|
1629
|
-
* wallet.
|
|
1630
|
-
*/
|
|
1631
|
-
policy_ids?: Array<string>;
|
|
1632
|
-
}
|
|
1633
|
-
|
|
1634
|
-
export namespace Wallet {
|
|
1635
|
-
export interface AdditionalSigner {
|
|
1636
|
-
/**
|
|
1637
|
-
* A unique identifier for a key quorum.
|
|
1638
|
-
*/
|
|
1639
|
-
signer_id: SharedAPI.KeyQuorumID;
|
|
1640
|
-
|
|
1641
|
-
/**
|
|
1642
|
-
* The array of policy IDs that will be applied to wallet requests. If specified,
|
|
1643
|
-
* this will override the base policy IDs set on the wallet. Currently, only one
|
|
1644
|
-
* policy is supported per signer.
|
|
1645
|
-
*/
|
|
1646
|
-
override_policy_ids?: Array<string>;
|
|
1647
|
-
}
|
|
1648
|
-
}
|
|
1649
|
-
}
|
|
1650
|
-
|
|
1651
|
-
export interface UserListParams extends CursorParams {}
|
|
1652
|
-
|
|
1653
|
-
export interface UserGetByCustomAuthIDParams {
|
|
1654
|
-
custom_user_id: string;
|
|
1655
|
-
}
|
|
1656
|
-
|
|
1657
|
-
export interface UserGetByDiscordUsernameParams {
|
|
1658
|
-
username: string;
|
|
1659
|
-
}
|
|
1660
|
-
|
|
1661
|
-
export interface UserGetByEmailAddressParams {
|
|
1662
|
-
address: string;
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1665
|
-
export interface UserGetByFarcasterIDParams {
|
|
1666
|
-
fid: number;
|
|
1667
|
-
}
|
|
1668
|
-
|
|
1669
|
-
export interface UserGetByGitHubUsernameParams {
|
|
1670
|
-
username: string;
|
|
1671
|
-
}
|
|
1672
|
-
|
|
1673
|
-
export interface UserGetByPhoneNumberParams {
|
|
1674
|
-
number: string;
|
|
1675
|
-
}
|
|
1676
|
-
|
|
1677
|
-
export interface UserGetBySmartWalletAddressParams {
|
|
1678
|
-
address: string;
|
|
1679
|
-
}
|
|
1680
|
-
|
|
1681
|
-
export interface UserGetByTelegramUserIDParams {
|
|
1682
|
-
telegram_user_id: string;
|
|
1683
|
-
}
|
|
1684
|
-
|
|
1685
|
-
export interface UserGetByTelegramUsernameParams {
|
|
1686
|
-
username: string;
|
|
1687
|
-
}
|
|
1688
|
-
|
|
1689
|
-
export interface UserGetByTwitterSubjectParams {
|
|
1690
|
-
subject: string;
|
|
1691
|
-
}
|
|
1692
|
-
|
|
1693
|
-
export interface UserGetByTwitterUsernameParams {
|
|
1694
|
-
username: string;
|
|
1695
|
-
}
|
|
1696
|
-
|
|
1697
|
-
export interface UserGetByWalletAddressParams {
|
|
1698
|
-
address: string;
|
|
1699
|
-
}
|
|
1700
|
-
|
|
1701
|
-
export interface UserPregenerateWalletsParams {
|
|
1702
|
-
wallets: Array<EmbeddedWalletsAPI.WalletCreationInput>;
|
|
1703
|
-
}
|
|
1704
|
-
|
|
1705
|
-
export type UserSearchParams = UserSearchParams.Variant0 | UserSearchParams.Variant1;
|
|
1706
|
-
|
|
1707
|
-
export declare namespace UserSearchParams {
|
|
1708
|
-
export interface Variant0 {
|
|
1709
|
-
searchTerm: string;
|
|
1710
|
-
}
|
|
1711
|
-
|
|
1712
|
-
export interface Variant1 {
|
|
1713
|
-
emails: Array<string>;
|
|
1714
|
-
|
|
1715
|
-
phoneNumbers: Array<string>;
|
|
1716
|
-
|
|
1717
|
-
walletAddresses: Array<string>;
|
|
1718
|
-
}
|
|
1719
|
-
}
|
|
1720
|
-
|
|
1721
|
-
export interface UserSetCustomMetadataParams {
|
|
1722
|
-
/**
|
|
1723
|
-
* Custom metadata associated with the user.
|
|
1724
|
-
*/
|
|
1725
|
-
custom_metadata: CustomMetadata;
|
|
1726
|
-
}
|
|
1727
|
-
|
|
1728
|
-
export interface UserUnlinkLinkedAccountParams {
|
|
1729
|
-
handle: string;
|
|
1730
|
-
|
|
1731
|
-
/**
|
|
1732
|
-
* The possible types of linked accounts.
|
|
1733
|
-
*/
|
|
1734
|
-
type: LinkedAccountType;
|
|
1735
|
-
|
|
1736
|
-
provider?: string;
|
|
1737
|
-
}
|
|
1738
|
-
|
|
1739
1280
|
export declare namespace Users {
|
|
1740
1281
|
export {
|
|
1741
1282
|
type AuthenticatedUser as AuthenticatedUser,
|
|
@@ -1804,24 +1345,5 @@ export declare namespace Users {
|
|
|
1804
1345
|
type User as User,
|
|
1805
1346
|
type UserBatchCreateInput as UserBatchCreateInput,
|
|
1806
1347
|
type UserWithIdentityToken as UserWithIdentityToken,
|
|
1807
|
-
type UsersCursor as UsersCursor,
|
|
1808
|
-
type UserCreateParams as UserCreateParams,
|
|
1809
|
-
type UserListParams as UserListParams,
|
|
1810
|
-
type UserGetByCustomAuthIDParams as UserGetByCustomAuthIDParams,
|
|
1811
|
-
type UserGetByDiscordUsernameParams as UserGetByDiscordUsernameParams,
|
|
1812
|
-
type UserGetByEmailAddressParams as UserGetByEmailAddressParams,
|
|
1813
|
-
type UserGetByFarcasterIDParams as UserGetByFarcasterIDParams,
|
|
1814
|
-
type UserGetByGitHubUsernameParams as UserGetByGitHubUsernameParams,
|
|
1815
|
-
type UserGetByPhoneNumberParams as UserGetByPhoneNumberParams,
|
|
1816
|
-
type UserGetBySmartWalletAddressParams as UserGetBySmartWalletAddressParams,
|
|
1817
|
-
type UserGetByTelegramUserIDParams as UserGetByTelegramUserIDParams,
|
|
1818
|
-
type UserGetByTelegramUsernameParams as UserGetByTelegramUsernameParams,
|
|
1819
|
-
type UserGetByTwitterSubjectParams as UserGetByTwitterSubjectParams,
|
|
1820
|
-
type UserGetByTwitterUsernameParams as UserGetByTwitterUsernameParams,
|
|
1821
|
-
type UserGetByWalletAddressParams as UserGetByWalletAddressParams,
|
|
1822
|
-
type UserPregenerateWalletsParams as UserPregenerateWalletsParams,
|
|
1823
|
-
type UserSearchParams as UserSearchParams,
|
|
1824
|
-
type UserSetCustomMetadataParams as UserSetCustomMetadataParams,
|
|
1825
|
-
type UserUnlinkLinkedAccountParams as UserUnlinkLinkedAccountParams,
|
|
1826
1348
|
};
|
|
1827
1349
|
}
|
|
@@ -507,6 +507,35 @@ export interface EthereumEarnVaultDetailsResponse {
|
|
|
507
507
|
vault_address: string;
|
|
508
508
|
}
|
|
509
509
|
|
|
510
|
+
/**
|
|
511
|
+
* A wallet action step representing a cross-chain/cross-asset fill by an external
|
|
512
|
+
* provider.
|
|
513
|
+
*/
|
|
514
|
+
export interface ExternalTransactionWalletActionStep {
|
|
515
|
+
/**
|
|
516
|
+
* Status of an external transaction step in a wallet action.
|
|
517
|
+
*/
|
|
518
|
+
status: ExternalTransactionWalletActionStepStatus;
|
|
519
|
+
|
|
520
|
+
type: 'external_transaction';
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* A description of why a wallet action (or a step within a wallet action) failed.
|
|
524
|
+
*/
|
|
525
|
+
failure_reason?: FailureReason;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Status of an external transaction step in a wallet action.
|
|
530
|
+
*/
|
|
531
|
+
export type ExternalTransactionWalletActionStepStatus =
|
|
532
|
+
| 'preparing'
|
|
533
|
+
| 'queued'
|
|
534
|
+
| 'pending'
|
|
535
|
+
| 'confirmed'
|
|
536
|
+
| 'rejected'
|
|
537
|
+
| 'failed';
|
|
538
|
+
|
|
510
539
|
/**
|
|
511
540
|
* A description of why a wallet action (or a step within a wallet action) failed.
|
|
512
541
|
*/
|
|
@@ -732,12 +761,17 @@ export type WalletActionStatus = 'pending' | 'succeeded' | 'rejected' | 'failed'
|
|
|
732
761
|
export type WalletActionStep =
|
|
733
762
|
| EvmTransactionWalletActionStep
|
|
734
763
|
| EvmUserOperationWalletActionStep
|
|
735
|
-
| SvmTransactionWalletActionStep
|
|
764
|
+
| SvmTransactionWalletActionStep
|
|
765
|
+
| ExternalTransactionWalletActionStep;
|
|
736
766
|
|
|
737
767
|
/**
|
|
738
768
|
* Type of a wallet action step.
|
|
739
769
|
*/
|
|
740
|
-
export type WalletActionStepType =
|
|
770
|
+
export type WalletActionStepType =
|
|
771
|
+
| 'evm_transaction'
|
|
772
|
+
| 'evm_user_operation'
|
|
773
|
+
| 'svm_transaction'
|
|
774
|
+
| 'external_transaction';
|
|
741
775
|
|
|
742
776
|
/**
|
|
743
777
|
* Type of wallet action
|
|
@@ -766,6 +800,8 @@ export declare namespace WalletActions {
|
|
|
766
800
|
type EthereumEarnPositionResponse as EthereumEarnPositionResponse,
|
|
767
801
|
type EthereumEarnProvider as EthereumEarnProvider,
|
|
768
802
|
type EthereumEarnVaultDetailsResponse as EthereumEarnVaultDetailsResponse,
|
|
803
|
+
type ExternalTransactionWalletActionStep as ExternalTransactionWalletActionStep,
|
|
804
|
+
type ExternalTransactionWalletActionStepStatus as ExternalTransactionWalletActionStepStatus,
|
|
769
805
|
type FailureReason as FailureReason,
|
|
770
806
|
type SvmTransactionWalletActionStep as SvmTransactionWalletActionStep,
|
|
771
807
|
type SvmWalletActionStepStatus as SvmWalletActionStepStatus,
|