@coinbase/cdp-sdk 1.31.0 → 1.31.1

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 (48) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/_cjs/accounts/evm/toNetworkScopedEvmServerAccount.js +61 -0
  3. package/_cjs/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -1
  4. package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js +21 -0
  5. package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
  6. package/_cjs/actions/evm/listSpendPermissions.js +18 -0
  7. package/_cjs/actions/evm/listSpendPermissions.js.map +1 -0
  8. package/_cjs/actions/evm/listTokenBalances.js +2 -0
  9. package/_cjs/actions/evm/listTokenBalances.js.map +1 -1
  10. package/_cjs/client/evm/evm.js +157 -60
  11. package/_cjs/client/evm/evm.js.map +1 -1
  12. package/_cjs/client/solana/solana.js +47 -27
  13. package/_cjs/client/solana/solana.js.map +1 -1
  14. package/_cjs/version.js +1 -1
  15. package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js +61 -0
  16. package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -1
  17. package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js +21 -0
  18. package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
  19. package/_esm/actions/evm/listSpendPermissions.js +15 -0
  20. package/_esm/actions/evm/listSpendPermissions.js.map +1 -0
  21. package/_esm/actions/evm/listTokenBalances.js +2 -0
  22. package/_esm/actions/evm/listTokenBalances.js.map +1 -1
  23. package/_esm/client/evm/evm.js +157 -60
  24. package/_esm/client/evm/evm.js.map +1 -1
  25. package/_esm/client/solana/solana.js +47 -27
  26. package/_esm/client/solana/solana.js.map +1 -1
  27. package/_esm/version.js +1 -1
  28. package/_types/accounts/evm/toNetworkScopedEvmServerAccount.d.ts.map +1 -1
  29. package/_types/accounts/evm/toNetworkScopedEvmSmartAccount.d.ts.map +1 -1
  30. package/_types/actions/evm/listSpendPermissions.d.ts +12 -0
  31. package/_types/actions/evm/listSpendPermissions.d.ts.map +1 -0
  32. package/_types/actions/evm/listTokenBalances.d.ts.map +1 -1
  33. package/_types/client/evm/evm.d.ts +66 -1
  34. package/_types/client/evm/evm.d.ts.map +1 -1
  35. package/_types/client/evm/evm.types.d.ts +2 -1
  36. package/_types/client/evm/evm.types.d.ts.map +1 -1
  37. package/_types/client/solana/solana.d.ts +16 -0
  38. package/_types/client/solana/solana.d.ts.map +1 -1
  39. package/_types/version.d.ts +1 -1
  40. package/accounts/evm/toNetworkScopedEvmServerAccount.ts +69 -0
  41. package/accounts/evm/toNetworkScopedEvmSmartAccount.ts +22 -0
  42. package/actions/evm/listSpendPermissions.ts +20 -0
  43. package/actions/evm/listTokenBalances.ts +2 -0
  44. package/client/evm/evm.ts +200 -81
  45. package/client/evm/evm.types.ts +4 -0
  46. package/client/solana/solana.ts +60 -38
  47. package/package.json +1 -1
  48. package/version.ts +1 -1
package/client/evm/evm.ts CHANGED
@@ -6,6 +6,7 @@ import {
6
6
  CreateServerAccountOptions,
7
7
  CreateSmartAccountOptions,
8
8
  CreateSpendPermissionOptions,
9
+ RevokeSpendPermissionOptions,
9
10
  CreateSwapQuoteOptions,
10
11
  CreateSwapQuoteResult,
11
12
  EvmClientInterface,
@@ -22,6 +23,7 @@ import {
22
23
  ListServerAccountsOptions,
23
24
  ListSmartAccountResult,
24
25
  ListSmartAccountsOptions,
26
+ ListSpendPermissionsOptions,
25
27
  PrepareUserOperationOptions,
26
28
  ServerAccount,
27
29
  SignatureResult,
@@ -39,6 +41,7 @@ import {
39
41
  import { toEvmServerAccount } from "../../accounts/evm/toEvmServerAccount.js";
40
42
  import { toEvmSmartAccount } from "../../accounts/evm/toEvmSmartAccount.js";
41
43
  import { getUserOperation } from "../../actions/evm/getUserOperation.js";
44
+ import { listSpendPermissions } from "../../actions/evm/listSpendPermissions.js";
42
45
  import {
43
46
  listTokenBalances,
44
47
  ListTokenBalancesOptions,
@@ -67,6 +70,7 @@ import { UserInputValidationError } from "../../errors.js";
67
70
  import { APIError } from "../../openapi-client/errors.js";
68
71
  import {
69
72
  CdpOpenApiClient,
73
+ ListSpendPermissionsResult,
70
74
  EIP712Message as OpenAPIEIP712Message,
71
75
  } from "../../openapi-client/index.js";
72
76
  import { SPEND_PERMISSION_MANAGER_ADDRESS } from "../../spend-permissions/constants.js";
@@ -122,21 +126,7 @@ export class EvmClient implements EvmClientInterface {
122
126
  accountType: "evm_server",
123
127
  });
124
128
 
125
- const openApiAccount = await CdpOpenApiClient.createEvmAccount(
126
- {
127
- name: options.name,
128
- accountPolicy: options.accountPolicy,
129
- },
130
- options.idempotencyKey,
131
- );
132
-
133
- const account = toEvmServerAccount(CdpOpenApiClient, {
134
- account: openApiAccount,
135
- });
136
-
137
- Analytics.wrapObjectMethodsWithErrorTracking(account);
138
-
139
- return account;
129
+ return this._createAccountInternal(options);
140
130
  }
141
131
 
142
132
  /**
@@ -343,28 +333,7 @@ export class EvmClient implements EvmClientInterface {
343
333
  accountType: "evm_smart",
344
334
  });
345
335
 
346
- const owners = [options.owner.address];
347
-
348
- if (options.__experimental_enableSpendPermission) {
349
- owners.push(SPEND_PERMISSION_MANAGER_ADDRESS);
350
- }
351
-
352
- const openApiSmartAccount = await CdpOpenApiClient.createEvmSmartAccount(
353
- {
354
- owners: owners,
355
- name: options.name,
356
- },
357
- options.idempotencyKey,
358
- );
359
-
360
- const smartAccount = toEvmSmartAccount(CdpOpenApiClient, {
361
- smartAccount: openApiSmartAccount,
362
- owner: options.owner,
363
- });
364
-
365
- Analytics.wrapObjectMethodsWithErrorTracking(smartAccount);
366
-
367
- return smartAccount;
336
+ return this._createSmartAccountInternal(options);
368
337
  }
369
338
 
370
339
  /**
@@ -419,6 +388,53 @@ export class EvmClient implements EvmClientInterface {
419
388
  };
420
389
  }
421
390
 
391
+ /**
392
+ * Revokes a spend permission for a smart account.
393
+ *
394
+ * @param {RevokeSpendPermissionOptions} options - Parameters for revoking the spend permission.
395
+ * @param {string} options.address - The address of the smart account.
396
+ * @param {string} options.permissionHash - The hash of the spend permission to revoke.
397
+ * @param {string} options.network - The network of the spend permission.
398
+ * @param {string} [options.paymasterUrl] - The paymaster URL of the spend permission.
399
+ *
400
+ * @returns A promise that resolves to the user operation.
401
+ *
402
+ * @example
403
+ * ```ts
404
+ * const userOperation = await cdp.evm.revokeSpendPermission({
405
+ * address: "0x1234567890123456789012345678901234567890",
406
+ * permissionHash: "0x1234567890123456789012345678901234567890123456789012345678901234",
407
+ * network: "base-sepolia",
408
+ * });
409
+ * ```
410
+ */
411
+ async revokeSpendPermission(options: RevokeSpendPermissionOptions): Promise<UserOperation> {
412
+ Analytics.trackAction({
413
+ action: "revoke_spend_permission",
414
+ });
415
+
416
+ const userOperation = await CdpOpenApiClient.revokeSpendPermission(
417
+ options.address,
418
+ {
419
+ network: options.network,
420
+ permissionHash: options.permissionHash,
421
+ paymasterUrl: options.paymasterUrl,
422
+ },
423
+ options.idempotencyKey,
424
+ );
425
+
426
+ return {
427
+ network: userOperation.network,
428
+ userOpHash: userOperation.userOpHash as Hex,
429
+ status: userOperation.status,
430
+ calls: userOperation.calls.map(call => ({
431
+ to: call.to as Address,
432
+ value: BigInt(call.value),
433
+ data: call.data as Hex,
434
+ })),
435
+ };
436
+ }
437
+
422
438
  /**
423
439
  * Gets a CDP EVM account.
424
440
  *
@@ -450,25 +466,7 @@ export class EvmClient implements EvmClientInterface {
450
466
  accountType: "evm_server",
451
467
  });
452
468
 
453
- const openApiAccount = await (() => {
454
- if (options.address) {
455
- return CdpOpenApiClient.getEvmAccount(options.address);
456
- }
457
-
458
- if (options.name) {
459
- return CdpOpenApiClient.getEvmAccountByName(options.name);
460
- }
461
-
462
- throw new UserInputValidationError("Either address or name must be provided");
463
- })();
464
-
465
- const account = toEvmServerAccount(CdpOpenApiClient, {
466
- account: openApiAccount,
467
- });
468
-
469
- Analytics.wrapObjectMethodsWithErrorTracking(account);
470
-
471
- return account;
469
+ return this._getAccountInternal(options);
472
470
  }
473
471
 
474
472
  /**
@@ -498,23 +496,7 @@ export class EvmClient implements EvmClientInterface {
498
496
  action: "get_smart_account",
499
497
  });
500
498
 
501
- const openApiSmartAccount = await (async () => {
502
- if (options.address) {
503
- return CdpOpenApiClient.getEvmSmartAccount(options.address);
504
- } else if (options.name) {
505
- return CdpOpenApiClient.getEvmSmartAccountByName(options.name);
506
- }
507
- throw new UserInputValidationError("Either address or name must be provided");
508
- })();
509
-
510
- const smartAccount = toEvmSmartAccount(CdpOpenApiClient, {
511
- smartAccount: openApiSmartAccount,
512
- owner: options.owner,
513
- });
514
-
515
- Analytics.wrapObjectMethodsWithErrorTracking(smartAccount);
516
-
517
- return smartAccount;
499
+ return this._getSmartAccountInternal(options);
518
500
  }
519
501
 
520
502
  /**
@@ -539,20 +521,20 @@ export class EvmClient implements EvmClientInterface {
539
521
  });
540
522
 
541
523
  try {
542
- const account = await this.getAccount(options);
524
+ const account = await this._getAccountInternal(options);
543
525
  return account;
544
526
  } catch (error) {
545
527
  // If it failed because the account doesn't exist, create it
546
528
  const doesAccountNotExist = error instanceof APIError && error.statusCode === 404;
547
529
  if (doesAccountNotExist) {
548
530
  try {
549
- const account = await this.createAccount(options);
531
+ const account = await this._createAccountInternal(options);
550
532
  return account;
551
533
  } catch (error) {
552
- // If it failed because the account already exists, throw an error
534
+ // If it failed because the account already exists, get the existing account
553
535
  const doesAccountAlreadyExist = error instanceof APIError && error.statusCode === 409;
554
536
  if (doesAccountAlreadyExist) {
555
- const account = await this.getAccount(options);
537
+ const account = await this._getAccountInternal(options);
556
538
  return account;
557
539
  }
558
540
  throw error;
@@ -588,20 +570,20 @@ export class EvmClient implements EvmClientInterface {
588
570
  });
589
571
 
590
572
  try {
591
- const account = await this.getSmartAccount(options);
573
+ const account = await this._getSmartAccountInternal(options);
592
574
  return account;
593
575
  } catch (error) {
594
576
  // If it failed because the account doesn't exist, create it
595
577
  const doesAccountNotExist = error instanceof APIError && error.statusCode === 404;
596
578
  if (doesAccountNotExist) {
597
579
  try {
598
- const account = await this.createSmartAccount(options);
580
+ const account = await this._createSmartAccountInternal(options);
599
581
  return account;
600
582
  } catch (error) {
601
- // If it failed because the account already exists, throw an error
583
+ // If it failed because the account already exists, get the existing account
602
584
  const doesAccountAlreadyExist = error instanceof APIError && error.statusCode === 409;
603
585
  if (doesAccountAlreadyExist) {
604
- const account = await this.getSmartAccount(options);
586
+ const account = await this._getSmartAccountInternal(options);
605
587
  return account;
606
588
  }
607
589
  throw error;
@@ -837,6 +819,26 @@ export class EvmClient implements EvmClientInterface {
837
819
  };
838
820
  }
839
821
 
822
+ /**
823
+ * Lists the spend permissions for a smart account.
824
+ *
825
+ * @param {ListSpendPermissionsOptions} options - Parameters for listing the spend permissions.
826
+ * @param {string} options.address - The address of the smart account.
827
+ * @param {number} [options.pageSize] - The number of spend permissions to return.
828
+ * @param {string} [options.pageToken] - The page token to return the next page of spend permissions.
829
+ *
830
+ * @returns A promise that resolves to the spend permissions.
831
+ */
832
+ async listSpendPermissions(
833
+ options: ListSpendPermissionsOptions,
834
+ ): Promise<ListSpendPermissionsResult> {
835
+ Analytics.trackAction({
836
+ action: "list_spend_permissions",
837
+ });
838
+
839
+ return listSpendPermissions(CdpOpenApiClient, options);
840
+ }
841
+
840
842
  /**
841
843
  * Prepares a user operation for a smart account.
842
844
  *
@@ -1365,4 +1367,121 @@ export class EvmClient implements EvmClientInterface {
1365
1367
  ...options,
1366
1368
  });
1367
1369
  }
1370
+
1371
+ /**
1372
+ * Internal method to create an account without tracking analytics.
1373
+ * Used internally by composite operations to avoid double-counting.
1374
+ *
1375
+ * @param {CreateServerAccountOptions} options - Parameters for creating the account.
1376
+ * @returns {Promise<ServerAccount>} A promise that resolves to the newly created account.
1377
+ */
1378
+ private async _createAccountInternal(
1379
+ options: CreateServerAccountOptions = {},
1380
+ ): Promise<ServerAccount> {
1381
+ const openApiAccount = await CdpOpenApiClient.createEvmAccount(
1382
+ {
1383
+ name: options.name,
1384
+ accountPolicy: options.accountPolicy,
1385
+ },
1386
+ options.idempotencyKey,
1387
+ );
1388
+
1389
+ const account = toEvmServerAccount(CdpOpenApiClient, {
1390
+ account: openApiAccount,
1391
+ });
1392
+
1393
+ Analytics.wrapObjectMethodsWithErrorTracking(account);
1394
+
1395
+ return account;
1396
+ }
1397
+
1398
+ /**
1399
+ * Internal method to get an account without tracking analytics.
1400
+ * Used internally by composite operations to avoid double-counting.
1401
+ *
1402
+ * @param {GetServerAccountOptions} options - Parameters for getting the account.
1403
+ * @returns {Promise<ServerAccount>} A promise that resolves to the account.
1404
+ */
1405
+ private async _getAccountInternal(options: GetServerAccountOptions): Promise<ServerAccount> {
1406
+ const openApiAccount = await (() => {
1407
+ if (options.address) {
1408
+ return CdpOpenApiClient.getEvmAccount(options.address);
1409
+ }
1410
+
1411
+ if (options.name) {
1412
+ return CdpOpenApiClient.getEvmAccountByName(options.name);
1413
+ }
1414
+
1415
+ throw new UserInputValidationError("Either address or name must be provided");
1416
+ })();
1417
+
1418
+ const account = toEvmServerAccount(CdpOpenApiClient, {
1419
+ account: openApiAccount,
1420
+ });
1421
+
1422
+ Analytics.wrapObjectMethodsWithErrorTracking(account);
1423
+
1424
+ return account;
1425
+ }
1426
+
1427
+ /**
1428
+ * Internal method to create a smart account without tracking analytics.
1429
+ * Used internally by composite operations to avoid double-counting.
1430
+ *
1431
+ * @param {CreateSmartAccountOptions} options - Parameters for creating the smart account.
1432
+ * @returns {Promise<SmartAccount>} A promise that resolves to the newly created smart account.
1433
+ */
1434
+ private async _createSmartAccountInternal(
1435
+ options: CreateSmartAccountOptions,
1436
+ ): Promise<SmartAccount> {
1437
+ const owners = [options.owner.address];
1438
+
1439
+ if (options.__experimental_enableSpendPermission) {
1440
+ owners.push(SPEND_PERMISSION_MANAGER_ADDRESS);
1441
+ }
1442
+
1443
+ const openApiSmartAccount = await CdpOpenApiClient.createEvmSmartAccount(
1444
+ {
1445
+ owners: owners,
1446
+ name: options.name,
1447
+ },
1448
+ options.idempotencyKey,
1449
+ );
1450
+
1451
+ const smartAccount = toEvmSmartAccount(CdpOpenApiClient, {
1452
+ smartAccount: openApiSmartAccount,
1453
+ owner: options.owner,
1454
+ });
1455
+
1456
+ Analytics.wrapObjectMethodsWithErrorTracking(smartAccount);
1457
+
1458
+ return smartAccount;
1459
+ }
1460
+
1461
+ /**
1462
+ * Internal method to get a smart account without tracking analytics.
1463
+ * Used internally by composite operations to avoid double-counting.
1464
+ *
1465
+ * @param {GetSmartAccountOptions} options - Parameters for getting the smart account.
1466
+ * @returns {Promise<SmartAccount>} A promise that resolves to the smart account.
1467
+ */
1468
+ private async _getSmartAccountInternal(options: GetSmartAccountOptions): Promise<SmartAccount> {
1469
+ const openApiSmartAccount = await (async () => {
1470
+ if (options.address) {
1471
+ return CdpOpenApiClient.getEvmSmartAccount(options.address);
1472
+ } else if (options.name) {
1473
+ return CdpOpenApiClient.getEvmSmartAccountByName(options.name);
1474
+ }
1475
+ throw new UserInputValidationError("Either address or name must be provided");
1476
+ })();
1477
+
1478
+ const smartAccount = toEvmSmartAccount(CdpOpenApiClient, {
1479
+ smartAccount: openApiSmartAccount,
1480
+ owner: options.owner,
1481
+ });
1482
+
1483
+ Analytics.wrapObjectMethodsWithErrorTracking(smartAccount);
1484
+
1485
+ return smartAccount;
1486
+ }
1368
1487
  }
@@ -23,6 +23,7 @@ import type {
23
23
  EvmSwapsNetwork,
24
24
  EvmUserOperationNetwork,
25
25
  EvmUserOperationStatus,
26
+ ListSpendPermissionsResult,
26
27
  OpenApiEvmMethods,
27
28
  UpdateEvmAccountBody as UpdateEvmAccount,
28
29
  UpdateEvmSmartAccountBody as UpdateEvmSmartAccount,
@@ -88,6 +89,9 @@ export type EvmClientInterface = Omit<
88
89
  updateSmartAccount: (options: UpdateEvmSmartAccountOptions) => Promise<SmartAccount>;
89
90
  listAccounts: (options: ListServerAccountsOptions) => Promise<ListServerAccountResult>;
90
91
  listSmartAccounts: (options: ListSmartAccountsOptions) => Promise<ListSmartAccountResult>;
92
+ listSpendPermissions: (
93
+ options: ListSpendPermissionsOptions,
94
+ ) => Promise<ListSpendPermissionsResult>;
91
95
  listTokenBalances: (options: ListTokenBalancesOptions) => Promise<ListTokenBalancesResult>;
92
96
  prepareUserOperation: (options: PrepareUserOperationOptions) => Promise<UserOperation>;
93
97
  requestFaucet: (options: RequestFaucetOptions) => Promise<RequestFaucetResult>;
@@ -83,21 +83,7 @@ export class SolanaClient implements SolanaClientInterface {
83
83
  accountType: "solana",
84
84
  });
85
85
 
86
- const openApiAccount = await CdpOpenApiClient.createSolanaAccount(
87
- {
88
- name: options.name,
89
- accountPolicy: options.accountPolicy,
90
- },
91
- options.idempotencyKey,
92
- );
93
-
94
- const account = toSolanaAccount(CdpOpenApiClient, {
95
- account: openApiAccount,
96
- });
97
-
98
- Analytics.wrapObjectMethodsWithErrorTracking(account);
99
-
100
- return account;
86
+ return this._createAccountInternal(options);
101
87
  }
102
88
 
103
89
  /**
@@ -279,25 +265,7 @@ export class SolanaClient implements SolanaClientInterface {
279
265
  accountType: "solana",
280
266
  });
281
267
 
282
- const openApiAccount = await (() => {
283
- if (options.address) {
284
- return CdpOpenApiClient.getSolanaAccount(options.address);
285
- }
286
-
287
- if (options.name) {
288
- return CdpOpenApiClient.getSolanaAccountByName(options.name);
289
- }
290
-
291
- throw new UserInputValidationError("Either address or name must be provided");
292
- })();
293
-
294
- const account = toSolanaAccount(CdpOpenApiClient, {
295
- account: openApiAccount,
296
- });
297
-
298
- Analytics.wrapObjectMethodsWithErrorTracking(account);
299
-
300
- return account;
268
+ return this._getAccountInternal(options);
301
269
  }
302
270
 
303
271
  /**
@@ -322,20 +290,20 @@ export class SolanaClient implements SolanaClientInterface {
322
290
  });
323
291
 
324
292
  try {
325
- const account = await this.getAccount(options);
293
+ const account = await this._getAccountInternal(options);
326
294
  return account;
327
295
  } catch (error) {
328
296
  // If it failed because the account doesn't exist, create it
329
297
  const doesAccountNotExist = error instanceof APIError && error.statusCode === 404;
330
298
  if (doesAccountNotExist) {
331
299
  try {
332
- const account = await this.createAccount(options);
300
+ const account = await this._createAccountInternal(options);
333
301
  return account;
334
302
  } catch (error) {
335
- // If it failed because the account already exists, throw an error
303
+ // If it failed because the account already exists, get the existing account
336
304
  const doesAccountAlreadyExist = error instanceof APIError && error.statusCode === 409;
337
305
  if (doesAccountAlreadyExist) {
338
- const account = await this.getAccount(options);
306
+ const account = await this._getAccountInternal(options);
339
307
  return account;
340
308
  }
341
309
  throw error;
@@ -643,4 +611,58 @@ export class SolanaClient implements SolanaClientInterface {
643
611
  nextPageToken: tokenBalances.nextPageToken,
644
612
  };
645
613
  }
614
+
615
+ /**
616
+ * Internal method to create a Solana account without tracking analytics.
617
+ * Used internally by composite operations to avoid double-counting.
618
+ *
619
+ * @param {CreateAccountOptions} options - Parameters for creating the account.
620
+ * @returns {Promise<SolanaAccount>} A promise that resolves to the newly created account.
621
+ */
622
+ private async _createAccountInternal(options: CreateAccountOptions = {}): Promise<SolanaAccount> {
623
+ const openApiAccount = await CdpOpenApiClient.createSolanaAccount(
624
+ {
625
+ name: options.name,
626
+ accountPolicy: options.accountPolicy,
627
+ },
628
+ options.idempotencyKey,
629
+ );
630
+
631
+ const account = toSolanaAccount(CdpOpenApiClient, {
632
+ account: openApiAccount,
633
+ });
634
+
635
+ Analytics.wrapObjectMethodsWithErrorTracking(account);
636
+
637
+ return account;
638
+ }
639
+
640
+ /**
641
+ * Internal method to get a Solana account without tracking analytics.
642
+ * Used internally by composite operations to avoid double-counting.
643
+ *
644
+ * @param {GetAccountOptions} options - Parameters for getting the account.
645
+ * @returns {Promise<SolanaAccount>} A promise that resolves to the account.
646
+ */
647
+ private async _getAccountInternal(options: GetAccountOptions): Promise<SolanaAccount> {
648
+ const openApiAccount = await (() => {
649
+ if (options.address) {
650
+ return CdpOpenApiClient.getSolanaAccount(options.address);
651
+ }
652
+
653
+ if (options.name) {
654
+ return CdpOpenApiClient.getSolanaAccountByName(options.name);
655
+ }
656
+
657
+ throw new UserInputValidationError("Either address or name must be provided");
658
+ })();
659
+
660
+ const account = toSolanaAccount(CdpOpenApiClient, {
661
+ account: openApiAccount,
662
+ });
663
+
664
+ Analytics.wrapObjectMethodsWithErrorTracking(account);
665
+
666
+ return account;
667
+ }
646
668
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cdp-sdk",
3
- "version": "1.31.0",
3
+ "version": "1.31.1",
4
4
  "description": "SDK for interacting with the Coinbase Developer Platform Wallet API",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
package/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "1.31.0";
1
+ export const version = "1.31.1";