@graphitti/privy-core 0.1.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.
@@ -0,0 +1,494 @@
1
+ import { validatePrivyCredentials } from "./credentials.js";
2
+ import { fail, ok } from "./http.js";
3
+ import { createPrivyKeyQuorum, createPrivyPolicy, createPrivyRpcIntent, createPrivyTransferIntent, createPrivyWallet, getPrivyIntent, getPrivyKeyQuorum, getPrivyPolicy, getPrivyUser, getPrivyWallet, getPrivyWalletBalance, getPrivyWalletByAddress, getPrivyWalletTransaction, listPrivyIntents, listPrivyWallets, privyWalletSwap as requestWalletSwap, privyWalletTransfer as requestWalletTransfer, searchPrivyUsers, } from "./privy-client.js";
4
+ import { parseUnits, requireChain } from "./chains.js";
5
+ import { personalSign, sendSponsoredTransaction, signTypedDataV4, } from "./privy-signer.js";
6
+ import { isRecord, strParam } from "./shared.js";
7
+ import { randomUUID } from "node:crypto";
8
+ function requireCreds(credentials) {
9
+ const validated = validatePrivyCredentials(credentials);
10
+ if (!validated.ok) {
11
+ return fail(validated.error);
12
+ }
13
+ return validated;
14
+ }
15
+ function isAuthError(auth) {
16
+ return "success" in auth;
17
+ }
18
+ function transferBody(params) {
19
+ const destinationAddress = strParam(params, "destination_address") ?? strParam(params, "destinationAddress");
20
+ const amount = strParam(params, "amount");
21
+ const sourceChain = strParam(params, "source_chain") ?? strParam(params, "sourceChain");
22
+ const sourceAsset = strParam(params, "source_asset") ?? strParam(params, "sourceAsset");
23
+ if (!(destinationAddress && amount && sourceChain && sourceAsset)) {
24
+ return fail("destination_address, amount, source_chain, and source_asset are required");
25
+ }
26
+ return {
27
+ source: { chain: sourceChain, asset: sourceAsset },
28
+ destination: {
29
+ address: destinationAddress,
30
+ ...(strParam(params, "destination_chain")
31
+ ? { chain: strParam(params, "destination_chain") }
32
+ : {}),
33
+ ...(strParam(params, "destination_asset")
34
+ ? { asset: strParam(params, "destination_asset") }
35
+ : {}),
36
+ },
37
+ amount,
38
+ amount_type: "exact_input",
39
+ nonce: randomUUID(),
40
+ reference_id: randomUUID(),
41
+ };
42
+ }
43
+ export async function privyGetUser(params, credentials) {
44
+ const auth = requireCreds(credentials);
45
+ if (isAuthError(auth)) {
46
+ return auth;
47
+ }
48
+ const userId = strParam(params, "privy_user_id") ?? strParam(params, "privyUserId");
49
+ if (!userId) {
50
+ return fail("privy_user_id is required");
51
+ }
52
+ try {
53
+ const user = await getPrivyUser(userId, credentials);
54
+ return ok({
55
+ id: user.id,
56
+ linked_accounts: user.linked_accounts ?? [],
57
+ wallets: user.wallets ?? [],
58
+ });
59
+ }
60
+ catch (error) {
61
+ return fail(error instanceof Error ? error.message : String(error));
62
+ }
63
+ }
64
+ export async function privyListUsers(params, credentials) {
65
+ const auth = requireCreds(credentials);
66
+ if (isAuthError(auth)) {
67
+ return auth;
68
+ }
69
+ const query = strParam(params, "query") ?? strParam(params, "search") ?? "";
70
+ if (!query) {
71
+ return fail("query is required");
72
+ }
73
+ try {
74
+ const result = await searchPrivyUsers(query, credentials);
75
+ return ok({ users: result.data, count: result.data.length });
76
+ }
77
+ catch (error) {
78
+ return fail(error instanceof Error ? error.message : String(error));
79
+ }
80
+ }
81
+ export async function privyListWallets(_params, credentials) {
82
+ const auth = requireCreds(credentials);
83
+ if (isAuthError(auth)) {
84
+ return auth;
85
+ }
86
+ try {
87
+ const result = await listPrivyWallets(credentials);
88
+ return ok({ wallets: result.data, count: result.data.length });
89
+ }
90
+ catch (error) {
91
+ return fail(error instanceof Error ? error.message : String(error));
92
+ }
93
+ }
94
+ export async function privyCreateWallet(params, credentials) {
95
+ const auth = requireCreds(credentials);
96
+ if (isAuthError(auth)) {
97
+ return auth;
98
+ }
99
+ try {
100
+ const wallet = await createPrivyWallet(credentials, strParam(params, "chain_type") ?? strParam(params, "chainType") ?? "ethereum");
101
+ return ok({ id: wallet.id, address: wallet.address, chain_type: wallet.chain_type });
102
+ }
103
+ catch (error) {
104
+ return fail(error instanceof Error ? error.message : String(error));
105
+ }
106
+ }
107
+ export async function privyGetWallet(params, credentials) {
108
+ const auth = requireCreds(credentials);
109
+ if (isAuthError(auth)) {
110
+ return auth;
111
+ }
112
+ const walletId = strParam(params, "wallet_id") ?? strParam(params, "walletId");
113
+ if (!walletId) {
114
+ return fail("wallet_id is required");
115
+ }
116
+ try {
117
+ const wallet = await getPrivyWallet(walletId, credentials);
118
+ return ok({ id: wallet.id, address: wallet.address, chain_type: wallet.chain_type });
119
+ }
120
+ catch (error) {
121
+ return fail(error instanceof Error ? error.message : String(error));
122
+ }
123
+ }
124
+ export async function privyGetWalletByAddress(params, credentials) {
125
+ const auth = requireCreds(credentials);
126
+ if (isAuthError(auth)) {
127
+ return auth;
128
+ }
129
+ const address = strParam(params, "address");
130
+ if (!address) {
131
+ return fail("address is required");
132
+ }
133
+ try {
134
+ const result = await getPrivyWalletByAddress(address, credentials);
135
+ return ok({ wallets: result.data, count: result.data.length });
136
+ }
137
+ catch (error) {
138
+ return fail(error instanceof Error ? error.message : String(error));
139
+ }
140
+ }
141
+ export async function privyGetBalance(params, credentials) {
142
+ const auth = requireCreds(credentials);
143
+ if (isAuthError(auth)) {
144
+ return auth;
145
+ }
146
+ const walletId = strParam(params, "wallet_id") ?? strParam(params, "walletId");
147
+ if (!walletId) {
148
+ return fail("wallet_id is required");
149
+ }
150
+ try {
151
+ const balance = await getPrivyWalletBalance(walletId, credentials, strParam(params, "asset") ?? "eth");
152
+ return ok({ balance, wallet_id: walletId });
153
+ }
154
+ catch (error) {
155
+ return fail(error instanceof Error ? error.message : String(error));
156
+ }
157
+ }
158
+ export async function privyGetTransaction(params, credentials) {
159
+ const auth = requireCreds(credentials);
160
+ if (isAuthError(auth)) {
161
+ return auth;
162
+ }
163
+ const walletId = strParam(params, "wallet_id") ?? strParam(params, "walletId");
164
+ const transactionId = strParam(params, "transaction_id") ?? strParam(params, "transactionId");
165
+ if (!(walletId && transactionId)) {
166
+ return fail("wallet_id and transaction_id are required");
167
+ }
168
+ try {
169
+ const transaction = await getPrivyWalletTransaction(walletId, transactionId, credentials);
170
+ return ok({ transaction });
171
+ }
172
+ catch (error) {
173
+ return fail(error instanceof Error ? error.message : String(error));
174
+ }
175
+ }
176
+ export async function privySignMessage(params, credentials) {
177
+ const auth = requireCreds(credentials);
178
+ if (isAuthError(auth)) {
179
+ return auth;
180
+ }
181
+ const walletId = strParam(params, "wallet_id") ?? strParam(params, "walletId");
182
+ const message = strParam(params, "message");
183
+ const network = strParam(params, "network") ?? "ethereum";
184
+ if (!(walletId && message)) {
185
+ return fail("wallet_id and message are required");
186
+ }
187
+ try {
188
+ const { signature } = await personalSign({
189
+ walletId,
190
+ message,
191
+ chain: requireChain(network),
192
+ credentials,
193
+ });
194
+ return ok({ signature });
195
+ }
196
+ catch (error) {
197
+ return fail(error instanceof Error ? error.message : String(error));
198
+ }
199
+ }
200
+ export async function privySignTypedData(params, credentials) {
201
+ const auth = requireCreds(credentials);
202
+ if (isAuthError(auth)) {
203
+ return auth;
204
+ }
205
+ const walletId = strParam(params, "wallet_id") ?? strParam(params, "walletId");
206
+ const typedDataRaw = strParam(params, "typed_data") ?? strParam(params, "typedData");
207
+ const network = strParam(params, "network") ?? "ethereum";
208
+ if (!(walletId && typedDataRaw)) {
209
+ return fail("wallet_id and typed_data are required");
210
+ }
211
+ try {
212
+ const typedData = JSON.parse(typedDataRaw);
213
+ const { signature } = await signTypedDataV4({
214
+ walletId,
215
+ typedData,
216
+ chain: requireChain(network),
217
+ credentials,
218
+ });
219
+ return ok({ signature });
220
+ }
221
+ catch (error) {
222
+ return fail(error instanceof Error ? error.message : String(error));
223
+ }
224
+ }
225
+ export async function privySendTransaction(params, credentials) {
226
+ const auth = requireCreds(credentials);
227
+ if (isAuthError(auth)) {
228
+ return auth;
229
+ }
230
+ const walletId = strParam(params, "wallet_id") ?? strParam(params, "walletId");
231
+ const to = strParam(params, "to");
232
+ const network = strParam(params, "network") ?? "ethereum";
233
+ if (!(walletId && to)) {
234
+ return fail("wallet_id and to are required");
235
+ }
236
+ try {
237
+ const chain = requireChain(network);
238
+ const valueRaw = strParam(params, "value") ?? "0";
239
+ const value = valueRaw.startsWith("0x")
240
+ ? valueRaw
241
+ : `0x${parseUnits(valueRaw, chain.nativeDecimals).toString(16)}`;
242
+ const { hash, gasMode } = await sendSponsoredTransaction({
243
+ walletId,
244
+ chain,
245
+ to,
246
+ data: strParam(params, "data") ?? "0x",
247
+ value,
248
+ credentials,
249
+ });
250
+ return ok({ hash, to, gas_mode: gasMode, explorer: `${chain.explorerUrl}/tx/${hash}` });
251
+ }
252
+ catch (error) {
253
+ return fail(error instanceof Error ? error.message : String(error));
254
+ }
255
+ }
256
+ export async function privyTransfer(params, credentials) {
257
+ const auth = requireCreds(credentials);
258
+ if (isAuthError(auth)) {
259
+ return auth;
260
+ }
261
+ const walletId = strParam(params, "wallet_id") ?? strParam(params, "walletId");
262
+ const to = strParam(params, "to");
263
+ const amount = strParam(params, "amount");
264
+ const network = strParam(params, "network") ?? "ethereum";
265
+ if (!(walletId && to && amount)) {
266
+ return fail("wallet_id, to, and amount are required");
267
+ }
268
+ try {
269
+ const chain = requireChain(network);
270
+ const value = `0x${parseUnits(amount, chain.nativeDecimals).toString(16)}`;
271
+ const { hash, gasMode } = await sendSponsoredTransaction({
272
+ walletId,
273
+ chain,
274
+ to,
275
+ value,
276
+ credentials,
277
+ });
278
+ return ok({ hash, to, amount, gas_mode: gasMode, explorer: `${chain.explorerUrl}/tx/${hash}` });
279
+ }
280
+ catch (error) {
281
+ return fail(error instanceof Error ? error.message : String(error));
282
+ }
283
+ }
284
+ export async function privyWalletTransfer(params, credentials) {
285
+ const auth = requireCreds(credentials);
286
+ if (isAuthError(auth)) {
287
+ return auth;
288
+ }
289
+ const walletId = strParam(params, "wallet_id") ?? strParam(params, "walletId");
290
+ if (!walletId) {
291
+ return fail("wallet_id is required");
292
+ }
293
+ const body = transferBody(params);
294
+ if (!isRecord(body) || "success" in body) {
295
+ return body;
296
+ }
297
+ try {
298
+ const action = await requestWalletTransfer(walletId, body, credentials);
299
+ return ok({
300
+ id: action.id,
301
+ status: action.status,
302
+ transaction_hash: action.transaction_hash,
303
+ mode: "direct",
304
+ note: "Direct Privy USDC wallet transfer. For listed Graphitti payroll flows use privy_call_workflow.",
305
+ });
306
+ }
307
+ catch (error) {
308
+ return fail(error instanceof Error ? error.message : String(error));
309
+ }
310
+ }
311
+ export async function privyWalletSwap(params, credentials) {
312
+ const auth = requireCreds(credentials);
313
+ if (isAuthError(auth)) {
314
+ return auth;
315
+ }
316
+ const walletId = strParam(params, "wallet_id") ?? strParam(params, "walletId");
317
+ const fromAsset = strParam(params, "from_asset") ?? strParam(params, "fromAsset");
318
+ const toAsset = strParam(params, "to_asset") ?? strParam(params, "toAsset");
319
+ const amount = strParam(params, "amount");
320
+ if (!(walletId && fromAsset && toAsset && amount)) {
321
+ return fail("wallet_id, from_asset, to_asset, and amount are required");
322
+ }
323
+ try {
324
+ const action = await requestWalletSwap(walletId, {
325
+ chain: strParam(params, "chain") ?? "base_sepolia",
326
+ from_asset: fromAsset,
327
+ to_asset: toAsset,
328
+ amount,
329
+ nonce: randomUUID(),
330
+ reference_id: randomUUID(),
331
+ }, credentials);
332
+ return ok({
333
+ id: action.id,
334
+ status: action.status,
335
+ transaction_hash: action.transaction_hash,
336
+ });
337
+ }
338
+ catch (error) {
339
+ return fail(error instanceof Error ? error.message : String(error));
340
+ }
341
+ }
342
+ export async function privyCreatePolicy(params, credentials) {
343
+ const auth = requireCreds(credentials);
344
+ if (isAuthError(auth)) {
345
+ return auth;
346
+ }
347
+ const name = strParam(params, "name");
348
+ const rulesJson = strParam(params, "rules_json") ?? strParam(params, "rulesJson");
349
+ if (!(name && rulesJson)) {
350
+ return fail("name and rules_json are required");
351
+ }
352
+ try {
353
+ const rules = JSON.parse(rulesJson);
354
+ const policy = await createPrivyPolicy(credentials, {
355
+ name,
356
+ chainType: strParam(params, "chain_type") ?? "ethereum",
357
+ rules,
358
+ ownerId: strParam(params, "owner_id") ?? strParam(params, "ownerId"),
359
+ });
360
+ return ok({ id: policy.id, name: policy.name });
361
+ }
362
+ catch (error) {
363
+ return fail(error instanceof Error ? error.message : String(error));
364
+ }
365
+ }
366
+ export async function privyGetPolicy(params, credentials) {
367
+ const auth = requireCreds(credentials);
368
+ if (isAuthError(auth)) {
369
+ return auth;
370
+ }
371
+ const policyId = strParam(params, "policy_id") ?? strParam(params, "policyId");
372
+ if (!policyId) {
373
+ return fail("policy_id is required");
374
+ }
375
+ try {
376
+ const policy = await getPrivyPolicy(policyId, credentials);
377
+ return ok({ policy });
378
+ }
379
+ catch (error) {
380
+ return fail(error instanceof Error ? error.message : String(error));
381
+ }
382
+ }
383
+ export async function privyCreateKeyQuorum(params, credentials) {
384
+ const auth = requireCreds(credentials);
385
+ if (isAuthError(auth)) {
386
+ return auth;
387
+ }
388
+ const displayName = strParam(params, "display_name") ?? strParam(params, "displayName");
389
+ const threshold = strParam(params, "authorization_threshold") ??
390
+ strParam(params, "authorizationThreshold");
391
+ if (!(displayName && threshold)) {
392
+ return fail("display_name and authorization_threshold are required");
393
+ }
394
+ try {
395
+ const userIdsJson = strParam(params, "user_ids_json") ?? strParam(params, "userIdsJson");
396
+ const quorum = await createPrivyKeyQuorum(credentials, {
397
+ displayName,
398
+ authorizationThreshold: Number.parseInt(threshold, 10),
399
+ userIds: userIdsJson ? JSON.parse(userIdsJson) : undefined,
400
+ });
401
+ return ok({ id: quorum.id, display_name: quorum.display_name });
402
+ }
403
+ catch (error) {
404
+ return fail(error instanceof Error ? error.message : String(error));
405
+ }
406
+ }
407
+ export async function privyGetKeyQuorum(params, credentials) {
408
+ const auth = requireCreds(credentials);
409
+ if (isAuthError(auth)) {
410
+ return auth;
411
+ }
412
+ const quorumId = strParam(params, "quorum_id") ?? strParam(params, "quorumId");
413
+ if (!quorumId) {
414
+ return fail("quorum_id is required");
415
+ }
416
+ try {
417
+ const quorum = await getPrivyKeyQuorum(quorumId, credentials);
418
+ return ok({ quorum });
419
+ }
420
+ catch (error) {
421
+ return fail(error instanceof Error ? error.message : String(error));
422
+ }
423
+ }
424
+ export async function privyCreateTransferIntent(params, credentials) {
425
+ const auth = requireCreds(credentials);
426
+ if (isAuthError(auth)) {
427
+ return auth;
428
+ }
429
+ const walletId = strParam(params, "wallet_id") ?? strParam(params, "walletId");
430
+ if (!walletId) {
431
+ return fail("wallet_id is required");
432
+ }
433
+ const body = transferBody(params);
434
+ if (!isRecord(body) || "success" in body) {
435
+ return body;
436
+ }
437
+ try {
438
+ const intent = await createPrivyTransferIntent(walletId, body, credentials);
439
+ return ok({ intent_id: intent.intent_id, status: intent.status });
440
+ }
441
+ catch (error) {
442
+ return fail(error instanceof Error ? error.message : String(error));
443
+ }
444
+ }
445
+ export async function privyCreateRpcIntent(params, credentials) {
446
+ const auth = requireCreds(credentials);
447
+ if (isAuthError(auth)) {
448
+ return auth;
449
+ }
450
+ const walletId = strParam(params, "wallet_id") ?? strParam(params, "walletId");
451
+ const rpcBodyRaw = strParam(params, "rpc_body") ?? strParam(params, "rpcBody");
452
+ if (!(walletId && rpcBodyRaw)) {
453
+ return fail("wallet_id and rpc_body are required");
454
+ }
455
+ try {
456
+ const rpcBody = JSON.parse(rpcBodyRaw);
457
+ const intent = await createPrivyRpcIntent(walletId, rpcBody, credentials);
458
+ return ok({ intent_id: intent.intent_id, status: intent.status });
459
+ }
460
+ catch (error) {
461
+ return fail(error instanceof Error ? error.message : String(error));
462
+ }
463
+ }
464
+ export async function privyGetIntent(params, credentials) {
465
+ const auth = requireCreds(credentials);
466
+ if (isAuthError(auth)) {
467
+ return auth;
468
+ }
469
+ const intentId = strParam(params, "intent_id") ?? strParam(params, "intentId");
470
+ if (!intentId) {
471
+ return fail("intent_id is required");
472
+ }
473
+ try {
474
+ const intent = await getPrivyIntent(intentId, credentials);
475
+ return ok(intent);
476
+ }
477
+ catch (error) {
478
+ return fail(error instanceof Error ? error.message : String(error));
479
+ }
480
+ }
481
+ export async function privyListIntents(params, credentials) {
482
+ const auth = requireCreds(credentials);
483
+ if (isAuthError(auth)) {
484
+ return auth;
485
+ }
486
+ try {
487
+ const walletId = strParam(params, "wallet_id") ?? strParam(params, "walletId");
488
+ const result = await listPrivyIntents(credentials, walletId);
489
+ return ok({ intents: result.data, count: result.data.length });
490
+ }
491
+ catch (error) {
492
+ return fail(error instanceof Error ? error.message : String(error));
493
+ }
494
+ }
@@ -0,0 +1,93 @@
1
+ import type { PrivyCredentials } from "./types.js";
2
+ export type PrivyWallet = {
3
+ id: string;
4
+ address: string;
5
+ chain_type: string;
6
+ policy_ids?: string[];
7
+ owner_id?: string;
8
+ };
9
+ export type PrivyPolicy = {
10
+ id: string;
11
+ name: string;
12
+ chain_type: string;
13
+ };
14
+ export type PrivyKeyQuorum = {
15
+ id: string;
16
+ display_name: string | null;
17
+ authorization_threshold: number | null;
18
+ user_ids?: string[] | null;
19
+ };
20
+ export type PrivyIntent = {
21
+ intent_id: string;
22
+ status: string;
23
+ resource_id?: string;
24
+ };
25
+ export type PrivyWalletAction = {
26
+ id: string;
27
+ status: string;
28
+ type?: string;
29
+ transaction_hash?: string;
30
+ };
31
+ export type PrivyUser = {
32
+ id: string;
33
+ linked_accounts?: Array<Record<string, unknown>>;
34
+ wallets?: PrivyWallet[];
35
+ };
36
+ export type WalletTransferRequest = {
37
+ source: {
38
+ chain: string;
39
+ asset: string;
40
+ amount?: string;
41
+ };
42
+ destination: {
43
+ address: string;
44
+ chain?: string;
45
+ asset?: string;
46
+ };
47
+ amount?: string;
48
+ amount_type?: "exact_input" | "exact_output";
49
+ reference_id?: string;
50
+ nonce?: string;
51
+ };
52
+ export declare function privyFetch<T>(path: string, credentials: PrivyCredentials, init?: RequestInit): Promise<T>;
53
+ export declare function getPrivyUser(privyUserId: string, credentials: PrivyCredentials): Promise<PrivyUser>;
54
+ export declare function searchPrivyUsers(query: string, credentials: PrivyCredentials): Promise<{
55
+ data: PrivyUser[];
56
+ }>;
57
+ export declare function listPrivyWallets(credentials: PrivyCredentials): Promise<{
58
+ data: PrivyWallet[];
59
+ }>;
60
+ export declare function createPrivyWallet(credentials: PrivyCredentials, chainType?: string): Promise<PrivyWallet>;
61
+ export declare function getPrivyWallet(walletId: string, credentials: PrivyCredentials): Promise<PrivyWallet>;
62
+ export declare function getPrivyWalletByAddress(address: string, credentials: PrivyCredentials): Promise<{
63
+ data: PrivyWallet[];
64
+ }>;
65
+ export declare function getPrivyWalletBalance(walletId: string, credentials: PrivyCredentials, asset?: string): Promise<Record<string, unknown>>;
66
+ export declare function getPrivyWalletTransaction(walletId: string, transactionId: string, credentials: PrivyCredentials): Promise<Record<string, unknown>>;
67
+ export declare function createPrivyKeyQuorum(credentials: PrivyCredentials, input: {
68
+ displayName: string;
69
+ authorizationThreshold: number;
70
+ userIds?: string[];
71
+ publicKeys?: string[];
72
+ keyQuorumIds?: string[];
73
+ }): Promise<PrivyKeyQuorum>;
74
+ export declare function getPrivyKeyQuorum(quorumId: string, credentials: PrivyCredentials): Promise<PrivyKeyQuorum>;
75
+ export declare function createPrivyPolicy(credentials: PrivyCredentials, input: {
76
+ name: string;
77
+ chainType?: string;
78
+ rules: Record<string, unknown>[];
79
+ ownerId?: string;
80
+ }): Promise<PrivyPolicy>;
81
+ export declare function getPrivyPolicy(policyId: string, credentials: PrivyCredentials): Promise<PrivyPolicy>;
82
+ export declare function privyWalletTransfer(walletId: string, body: WalletTransferRequest, credentials: PrivyCredentials): Promise<PrivyWalletAction>;
83
+ export declare function privyWalletSwap(walletId: string, body: Record<string, unknown>, credentials: PrivyCredentials): Promise<PrivyWalletAction>;
84
+ export declare function createPrivyTransferIntent(walletId: string, body: WalletTransferRequest, credentials: PrivyCredentials): Promise<PrivyIntent>;
85
+ export declare function createPrivyRpcIntent(walletId: string, body: Record<string, unknown>, credentials: PrivyCredentials): Promise<PrivyIntent>;
86
+ export declare function getPrivyIntent(intentId: string, credentials: PrivyCredentials): Promise<PrivyIntent & Record<string, unknown>>;
87
+ export declare function listPrivyIntents(credentials: PrivyCredentials, walletId?: string): Promise<{
88
+ data: Array<PrivyIntent & Record<string, unknown>>;
89
+ }>;
90
+ export declare function walletRpc(walletId: string, body: Record<string, unknown>, credentials: PrivyCredentials): Promise<{
91
+ method: string;
92
+ data: Record<string, unknown>;
93
+ }>;