@coinbase/cdp-sdk 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +222 -1
  3. package/_cjs/accounts/evm/toEvmServerAccount.js +4 -2
  4. package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -1
  5. package/_cjs/accounts/solana/toSolanaAccount.js +1 -0
  6. package/_cjs/accounts/solana/toSolanaAccount.js.map +1 -1
  7. package/_cjs/analytics.js +68 -8
  8. package/_cjs/analytics.js.map +1 -1
  9. package/_cjs/client/cdp.js +9 -3
  10. package/_cjs/client/cdp.js.map +1 -1
  11. package/_cjs/client/evm/evm.js +133 -15
  12. package/_cjs/client/evm/evm.js.map +1 -1
  13. package/_cjs/client/policies/index.js +6 -0
  14. package/_cjs/client/policies/index.js.map +1 -0
  15. package/_cjs/client/policies/policies.js +232 -0
  16. package/_cjs/client/policies/policies.js.map +1 -0
  17. package/_cjs/client/policies/policies.types.js +3 -0
  18. package/_cjs/client/policies/policies.types.js.map +1 -0
  19. package/_cjs/client/solana/solana.js +76 -19
  20. package/_cjs/client/solana/solana.js.map +1 -1
  21. package/_cjs/index.js +4 -1
  22. package/_cjs/index.js.map +1 -1
  23. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  24. package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.js +27 -1
  25. package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.js.map +1 -1
  26. package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.msw.js +56 -1
  27. package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.msw.js.map +1 -1
  28. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +3 -1
  29. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
  30. package/_cjs/openapi-client/generated/index.msw.js +1 -1
  31. package/_cjs/openapi-client/generated/index.msw.js.map +1 -1
  32. package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.js +14 -1
  33. package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.js.map +1 -1
  34. package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.msw.js +42 -1
  35. package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.msw.js.map +1 -1
  36. package/_cjs/openapi-client/index.js +6 -1
  37. package/_cjs/openapi-client/index.js.map +1 -1
  38. package/_cjs/policies/schema.js +186 -0
  39. package/_cjs/policies/schema.js.map +1 -0
  40. package/_cjs/policies/types.js +3 -0
  41. package/_cjs/policies/types.js.map +1 -0
  42. package/_cjs/version.js +1 -1
  43. package/_esm/accounts/evm/toEvmServerAccount.js +4 -2
  44. package/_esm/accounts/evm/toEvmServerAccount.js.map +1 -1
  45. package/_esm/accounts/solana/toSolanaAccount.js +1 -0
  46. package/_esm/accounts/solana/toSolanaAccount.js.map +1 -1
  47. package/_esm/analytics.js +68 -7
  48. package/_esm/analytics.js.map +1 -1
  49. package/_esm/client/cdp.js +10 -4
  50. package/_esm/client/cdp.js.map +1 -1
  51. package/_esm/client/evm/evm.js +133 -15
  52. package/_esm/client/evm/evm.js.map +1 -1
  53. package/_esm/client/policies/index.js +2 -0
  54. package/_esm/client/policies/index.js.map +1 -0
  55. package/_esm/client/policies/policies.js +228 -0
  56. package/_esm/client/policies/policies.js.map +1 -0
  57. package/_esm/client/policies/policies.types.js +2 -0
  58. package/_esm/client/policies/policies.types.js.map +1 -0
  59. package/_esm/client/solana/solana.js +76 -19
  60. package/_esm/client/solana/solana.js.map +1 -1
  61. package/_esm/index.js +1 -0
  62. package/_esm/index.js.map +1 -1
  63. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  64. package/_esm/openapi-client/generated/evm-accounts/evm-accounts.js +24 -0
  65. package/_esm/openapi-client/generated/evm-accounts/evm-accounts.js.map +1 -1
  66. package/_esm/openapi-client/generated/evm-accounts/evm-accounts.msw.js +51 -0
  67. package/_esm/openapi-client/generated/evm-accounts/evm-accounts.msw.js.map +1 -1
  68. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +3 -1
  69. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
  70. package/_esm/openapi-client/generated/index.msw.js +1 -1
  71. package/_esm/openapi-client/generated/index.msw.js.map +1 -1
  72. package/_esm/openapi-client/generated/solana-accounts/solana-accounts.js +12 -0
  73. package/_esm/openapi-client/generated/solana-accounts/solana-accounts.js.map +1 -1
  74. package/_esm/openapi-client/generated/solana-accounts/solana-accounts.msw.js +39 -0
  75. package/_esm/openapi-client/generated/solana-accounts/solana-accounts.msw.js.map +1 -1
  76. package/_esm/openapi-client/index.js +5 -0
  77. package/_esm/openapi-client/index.js.map +1 -1
  78. package/_esm/policies/schema.js +183 -0
  79. package/_esm/policies/schema.js.map +1 -0
  80. package/_esm/policies/types.js +2 -0
  81. package/_esm/policies/types.js.map +1 -0
  82. package/_esm/version.js +1 -1
  83. package/_types/accounts/evm/toEvmServerAccount.d.ts.map +1 -1
  84. package/_types/accounts/evm/types.d.ts +6 -3
  85. package/_types/accounts/evm/types.d.ts.map +1 -1
  86. package/_types/accounts/solana/toSolanaAccount.d.ts.map +1 -1
  87. package/_types/actions/evm/transfer/types.d.ts +1 -2
  88. package/_types/actions/evm/transfer/types.d.ts.map +1 -1
  89. package/_types/analytics.d.ts +14 -5
  90. package/_types/analytics.d.ts.map +1 -1
  91. package/_types/client/cdp.d.ts +3 -0
  92. package/_types/client/cdp.d.ts.map +1 -1
  93. package/_types/client/evm/evm.d.ts +89 -1
  94. package/_types/client/evm/evm.d.ts.map +1 -1
  95. package/_types/client/evm/evm.types.d.ts +33 -3
  96. package/_types/client/evm/evm.types.d.ts.map +1 -1
  97. package/_types/client/policies/index.d.ts +2 -0
  98. package/_types/client/policies/index.d.ts.map +1 -0
  99. package/_types/client/policies/policies.d.ts +216 -0
  100. package/_types/client/policies/policies.d.ts.map +1 -0
  101. package/_types/client/policies/policies.types.d.ts +96 -0
  102. package/_types/client/policies/policies.types.d.ts.map +1 -0
  103. package/_types/client/solana/solana.d.ts +43 -1
  104. package/_types/client/solana/solana.d.ts.map +1 -1
  105. package/_types/client/solana/solana.types.d.ts +14 -2
  106. package/_types/client/solana/solana.types.d.ts.map +1 -1
  107. package/_types/index.d.ts +2 -0
  108. package/_types/index.d.ts.map +1 -1
  109. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +81 -0
  110. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
  111. package/_types/openapi-client/generated/evm-accounts/evm-accounts.d.ts +13 -1
  112. package/_types/openapi-client/generated/evm-accounts/evm-accounts.d.ts.map +1 -1
  113. package/_types/openapi-client/generated/evm-accounts/evm-accounts.msw.d.ts +5 -1
  114. package/_types/openapi-client/generated/evm-accounts/evm-accounts.msw.d.ts.map +1 -1
  115. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts +3 -1
  116. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts.map +1 -1
  117. package/_types/openapi-client/generated/index.msw.d.ts +1 -1
  118. package/_types/openapi-client/generated/index.msw.d.ts.map +1 -1
  119. package/_types/openapi-client/generated/solana-accounts/solana-accounts.d.ts +7 -1
  120. package/_types/openapi-client/generated/solana-accounts/solana-accounts.d.ts.map +1 -1
  121. package/_types/openapi-client/generated/solana-accounts/solana-accounts.msw.d.ts +2 -0
  122. package/_types/openapi-client/generated/solana-accounts/solana-accounts.msw.d.ts.map +1 -1
  123. package/_types/openapi-client/index.d.ts +18 -0
  124. package/_types/openapi-client/index.d.ts.map +1 -1
  125. package/_types/policies/schema.d.ts +922 -0
  126. package/_types/policies/schema.d.ts.map +1 -0
  127. package/_types/policies/types.d.ts +19 -0
  128. package/_types/policies/types.d.ts.map +1 -0
  129. package/_types/types/misc.d.ts +39 -0
  130. package/_types/types/misc.d.ts.map +1 -1
  131. package/_types/version.d.ts +1 -1
  132. package/accounts/evm/toEvmServerAccount.ts +6 -3
  133. package/accounts/evm/types.ts +6 -8
  134. package/accounts/solana/toSolanaAccount.ts +1 -0
  135. package/actions/evm/transfer/types.ts +1 -1
  136. package/analytics.ts +84 -11
  137. package/client/cdp.ts +11 -4
  138. package/client/evm/evm.ts +159 -17
  139. package/client/evm/evm.types.ts +38 -1
  140. package/client/policies/index.ts +1 -0
  141. package/client/policies/policies.ts +246 -0
  142. package/client/policies/policies.types.ts +109 -0
  143. package/client/solana/solana.ts +94 -20
  144. package/client/solana/solana.types.ts +16 -1
  145. package/index.ts +7 -0
  146. package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +86 -0
  147. package/openapi-client/generated/evm-accounts/evm-accounts.msw.ts +102 -0
  148. package/openapi-client/generated/evm-accounts/evm-accounts.ts +43 -0
  149. package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.ts +3 -1
  150. package/openapi-client/generated/index.msw.ts +1 -1
  151. package/openapi-client/generated/solana-accounts/solana-accounts.msw.ts +75 -0
  152. package/openapi-client/generated/solana-accounts/solana-accounts.ts +23 -0
  153. package/openapi-client/index.ts +6 -0
  154. package/package.json +3 -2
  155. package/policies/schema.ts +266 -0
  156. package/policies/types.ts +19 -0
  157. package/types/misc.ts +41 -0
  158. package/version.ts +1 -1
@@ -1,4 +1,4 @@
1
- import { CreateServerAccountOptions, GetServerAccountOptions, ListServerAccountsOptions, CreateSmartAccountOptions, WaitForUserOperationOptions, SignHashOptions, SignatureResult, SignMessageOptions, SignTransactionOptions, GetSmartAccountOptions, SmartAccount, ServerAccount, EvmClientInterface, ListServerAccountResult, PrepareUserOperationOptions, UserOperation, GetUserOperationOptions, ListSmartAccountResult, ListSmartAccountsOptions, GetOrCreateServerAccountOptions } from "./evm.types.js";
1
+ import { CreateServerAccountOptions, GetServerAccountOptions, ListServerAccountsOptions, CreateSmartAccountOptions, WaitForUserOperationOptions, SignHashOptions, SignatureResult, SignMessageOptions, SignTransactionOptions, GetSmartAccountOptions, SmartAccount, ServerAccount, EvmClientInterface, ListServerAccountResult, PrepareUserOperationOptions, UserOperation, GetUserOperationOptions, ListSmartAccountResult, ListSmartAccountsOptions, GetOrCreateServerAccountOptions, SignTypedDataOptions, UpdateEvmAccountOptions } from "./evm.types.js";
2
2
  import { ListTokenBalancesResult, ListTokenBalancesOptions } from "../../actions/evm/listTokenBalances.js";
3
3
  import { RequestFaucetOptions, RequestFaucetResult } from "../../actions/evm/requestFaucet.js";
4
4
  import { SendUserOperationOptions, SendUserOperationReturnType } from "../../actions/evm/sendUserOperation.js";
@@ -421,6 +421,52 @@ export declare class EvmClient implements EvmClientInterface {
421
421
  * ```
422
422
  */
423
423
  signMessage(options: SignMessageOptions): Promise<SignatureResult>;
424
+ /**
425
+ * Signs an EIP-712 message.
426
+ *
427
+ * @param {SignTypedDataOptions} options - Parameters for signing the EIP-712 message.
428
+ * @returns A promise that resolves to the signature.
429
+ *
430
+ * @example
431
+ * ```ts
432
+ * const signature = await cdp.evm.signTypedData({
433
+ * address: account.address,
434
+ * domain: {
435
+ * name: "Permit2",
436
+ * chainId: 1,
437
+ * verifyingContract: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
438
+ * },
439
+ * types: {
440
+ * EIP712Domain: [
441
+ * { name: "name", type: "string" },
442
+ * { name: "chainId", type: "uint256" },
443
+ * { name: "verifyingContract", type: "address" },
444
+ * ],
445
+ * PermitTransferFrom: [
446
+ * { name: "permitted", type: "TokenPermissions" },
447
+ * { name: "spender", type: "address" },
448
+ * { name: "nonce", type: "uint256" },
449
+ * { name: "deadline", type: "uint256" },
450
+ * ],
451
+ * TokenPermissions: [
452
+ * { name: "token", type: "address" },
453
+ * { name: "amount", type: "uint256" },
454
+ * ],
455
+ * },
456
+ * primaryType: "PermitTransferFrom",
457
+ * message: {
458
+ * permitted: {
459
+ * token: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
460
+ * amount: "1000000",
461
+ * },
462
+ * spender: "0xFfFfFfFFfFFfFFfFFfFFFFFffFFFffffFfFFFfFf",
463
+ * nonce: "0",
464
+ * deadline: "1717123200",
465
+ * },
466
+ * });
467
+ * ```
468
+ */
469
+ signTypedData(options: SignTypedDataOptions): Promise<SignatureResult>;
424
470
  /**
425
471
  * Signs an EVM transaction.
426
472
  *
@@ -452,6 +498,48 @@ export declare class EvmClient implements EvmClientInterface {
452
498
  * ```
453
499
  */
454
500
  signTransaction(options: SignTransactionOptions): Promise<SignatureResult>;
501
+ /**
502
+ * Updates a CDP EVM account.
503
+ *
504
+ * @param {UpdateEvmAccountOptions} [options] - Optional parameters for creating the account.
505
+ * @param {string} options.address - The address of the account to update
506
+ * @param {UpdateEvmAccountBody} options.update - An object containing account fields to update.
507
+ * @param {string} [options.update.name] - The new name for the account.
508
+ * @param {string} [options.update.accountPolicy] - The ID of a Policy to apply to the account.
509
+ * @param {string} [options.idempotencyKey] - An idempotency key.
510
+ *
511
+ * @returns A promise that resolves to the updated account.
512
+ *
513
+ * @example **With a name**
514
+ * ```ts
515
+ * const account = await cdp.evm.updateAccount({ address: "0x...", update: { name: "New Name" } });
516
+ * ```
517
+ *
518
+ * @example **With an account policy**
519
+ * ```ts
520
+ * const account = await cdp.evm.updateAccount({ address: "0x...", update: { accountPolicy: "73bcaeeb-d7af-4615-b064-42b5fe83a31e" } });
521
+ * ```
522
+ *
523
+ * @example **With an idempotency key**
524
+ * ```ts
525
+ * const idempotencyKey = uuidv4();
526
+ *
527
+ * // First call
528
+ * await cdp.evm.updateAccount({
529
+ * address: "0x...",
530
+ * update: { accountPolicy: "73bcaeeb-d7af-4615-b064-42b5fe83a31e" },
531
+ * idempotencyKey,
532
+ * });
533
+ *
534
+ * // Second call with the same idempotency key will not update
535
+ * await cdp.evm.updateAccount({
536
+ * address: '0x...',
537
+ * update: { name: "" },
538
+ * idempotencyKey,
539
+ * });
540
+ * ```
541
+ */
542
+ updateAccount(options: UpdateEvmAccountOptions): Promise<ServerAccount>;
455
543
  /**
456
544
  * Waits for a user operation to complete or fail.
457
545
  *
@@ -1 +1 @@
1
- {"version":3,"file":"evm.d.ts","sourceRoot":"","sources":["../../../client/evm/evm.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,uBAAuB,EACvB,2BAA2B,EAC3B,aAAa,EACb,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,+BAA+B,EAChC,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAEL,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EAEpB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAEL,wBAAwB,EACxB,2BAA2B,EAC5B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAEL,8BAA8B,EAC/B,MAAM,2CAA2C,CAAC;AAKnD,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,qBAAa,SAAU,YAAW,kBAAkB;IAClD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACG,aAAa,CAAC,OAAO,GAAE,0BAA+B,GAAG,OAAO,CAAC,aAAa,CAAC;IAarF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4CG;IACG,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,YAAY,CAAC;IAcnF;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,UAAU,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,aAAa,CAAC;IAkB1E;;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;;;OA6CG;IACG,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAIlF;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,iBAAiB,CACrB,OAAO,EAAE,wBAAwB,CAAC,OAAO,EAAE,CAAC,GAC3C,OAAO,CAAC,2BAA2B,CAAC;IAUvC;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAclE;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC;IAcxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4CG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC;IAiB5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACG,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC;IAchF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACG,aAAa,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,aAAa,CAAC;IAgB7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACG,oBAAoB,CACxB,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,8BAA8B,CAAC;CAK3C"}
@@ -4,20 +4,21 @@ import type { RequestFaucetOptions, RequestFaucetResult } from "../../actions/ev
4
4
  import type { TransactionResult, SendTransactionOptions } from "../../actions/evm/sendTransaction.js";
5
5
  import type { SendUserOperationOptions, SendUserOperationReturnType } from "../../actions/evm/sendUserOperation.js";
6
6
  import type { SmartAccountActions } from "../../actions/evm/types.js";
7
- import type { EvmUserOperationNetwork, EvmUserOperationStatus, OpenApiEvmMethods } from "../../openapi-client/index.js";
7
+ import type { EvmUserOperationNetwork, EvmUserOperationStatus, OpenApiEvmMethods, UpdateEvmAccountBody } from "../../openapi-client/index.js";
8
8
  import type { Calls } from "../../types/calls.js";
9
- import type { Address, Hex } from "../../types/misc.js";
9
+ import type { Address, EIP712Message, Hex } from "../../types/misc.js";
10
10
  import type { WaitOptions } from "../../utils/wait.js";
11
11
  /**
12
12
  * The EvmClient type, where all OpenApiEvmMethods methods are wrapped.
13
13
  */
14
- export type EvmClientInterface = Omit<typeof OpenApiEvmMethods, "createEvmAccount" | "createEvmSmartAccount" | "getEvmAccount" | "getEvmAccountByName" | "getEvmSmartAccount" | "getUserOperation" | "listEvmAccounts" | "listEvmSmartAccounts" | "listEvmTokenBalances" | "prepareUserOperation" | "requestEvmFaucet" | "sendUserOperation" | "signEvmHash" | "signEvmMessage" | "signEvmTransaction" | "sendEvmTransaction"> & {
14
+ export type EvmClientInterface = Omit<typeof OpenApiEvmMethods, "createEvmAccount" | "createEvmSmartAccount" | "getEvmAccount" | "getEvmAccountByName" | "getEvmSmartAccount" | "getUserOperation" | "updateEvmAccount" | "listEvmAccounts" | "listEvmSmartAccounts" | "listEvmTokenBalances" | "prepareUserOperation" | "requestEvmFaucet" | "sendUserOperation" | "signEvmHash" | "signEvmMessage" | "signEvmTransaction" | "signEvmTypedData" | "sendEvmTransaction" | "signEvmTypedData" | "updateEvmAccount"> & {
15
15
  createAccount: (options: CreateServerAccountOptions) => Promise<ServerAccount>;
16
16
  createSmartAccount: (options: CreateSmartAccountOptions) => Promise<SmartAccount>;
17
17
  getAccount: (options: GetServerAccountOptions) => Promise<ServerAccount>;
18
18
  getSmartAccount: (options: GetSmartAccountOptions) => Promise<SmartAccount>;
19
19
  getOrCreateAccount: (options: GetOrCreateServerAccountOptions) => Promise<ServerAccount>;
20
20
  getUserOperation: (options: GetUserOperationOptions) => Promise<UserOperation>;
21
+ updateAccount: (options: UpdateEvmAccountOptions) => Promise<ServerAccount>;
21
22
  listAccounts: (options: ListServerAccountsOptions) => Promise<ListServerAccountResult>;
22
23
  listSmartAccounts: (options: ListSmartAccountsOptions) => Promise<ListSmartAccountResult>;
23
24
  listTokenBalances: (options: ListTokenBalancesOptions) => Promise<ListTokenBalancesResult>;
@@ -27,6 +28,7 @@ export type EvmClientInterface = Omit<typeof OpenApiEvmMethods, "createEvmAccoun
27
28
  sendUserOperation: (options: SendUserOperationOptions<unknown[]>) => Promise<SendUserOperationReturnType>;
28
29
  signHash: (options: SignHashOptions) => Promise<SignatureResult>;
29
30
  signMessage: (options: SignMessageOptions) => Promise<SignatureResult>;
31
+ signTypedData: (options: SignTypedDataOptions) => Promise<SignatureResult>;
30
32
  signTransaction: (options: SignTransactionOptions) => Promise<SignatureResult>;
31
33
  };
32
34
  export type { ServerAccount, SmartAccount };
@@ -136,6 +138,17 @@ export interface ReadonlySmartAccount extends Omit<SmartAccount, "owners" | keyo
136
138
  /** The owners of the smart account. */
137
139
  owners: Address[];
138
140
  }
141
+ /**
142
+ * Options for creating an EVM server account.
143
+ */
144
+ export interface UpdateEvmAccountOptions {
145
+ /** The address of the account. */
146
+ address: string;
147
+ /** The updates to apply to the account */
148
+ update: UpdateEvmAccountBody;
149
+ /** The idempotency key. */
150
+ idempotencyKey?: string;
151
+ }
139
152
  /**
140
153
  * The result of listing EVM smart accounts.
141
154
  */
@@ -202,6 +215,23 @@ export interface SignMessageOptions {
202
215
  /** The idempotency key. */
203
216
  idempotencyKey?: string;
204
217
  }
218
+ /**
219
+ * Options for signing an EVM message.
220
+ */
221
+ export interface SignTypedDataOptions {
222
+ /** The address of the account. */
223
+ address: Address;
224
+ /** The domain of the message. */
225
+ domain: EIP712Message["domain"];
226
+ /** The types of the message. */
227
+ types: EIP712Message["types"];
228
+ /** The primary type of the message. This is the name of the struct in the `types` object that is the root of the message. */
229
+ primaryType: EIP712Message["primaryType"];
230
+ /** The message to sign. The structure of this message must match the `primaryType` struct in the `types` object. */
231
+ message: EIP712Message["message"];
232
+ /** The idempotency key. */
233
+ idempotencyKey?: string;
234
+ }
205
235
  /**
206
236
  * Options for signing an EVM transaction.
207
237
  */
@@ -1 +1 @@
1
- {"version":3,"file":"evm.types.d.ts","sourceRoot":"","sources":["../../../client/evm/evm.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,IAAI,OAAO,EACrB,gBAAgB,IAAI,aAAa,EACjC,eAAe,IAAI,YAAY,EAChC,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACpG,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EACV,wBAAwB,EACxB,2BAA2B,EAC5B,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,OAAO,iBAAiB,EACtB,kBAAkB,GAClB,uBAAuB,GACvB,eAAe,GACf,qBAAqB,GACrB,oBAAoB,GACpB,kBAAkB,GAClB,iBAAiB,GACjB,sBAAsB,GACtB,sBAAsB,GACtB,sBAAsB,GACtB,kBAAkB,GAClB,mBAAmB,GACnB,aAAa,GACb,gBAAgB,GAChB,oBAAoB,GACpB,oBAAoB,CACvB,GAAG;IACF,aAAa,EAAE,CAAC,OAAO,EAAE,0BAA0B,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eAAe;IAC9B,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,wBAAwB;IACxB,IAAI,EAAE,GAAG,CAAC;IACV,2BAA2B;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,2BAA2B;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,WAAW,EAAE,GAAG,CAAC;IACjB,2BAA2B;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,qBAAqB;IACrB,SAAS,EAAE,GAAG,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,iCAAiC;IACjC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,+BAA+B;IAC/B,UAAU,EAAE,GAAG,CAAC;IAChB,wBAAwB;IACxB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B"}
1
+ {"version":3,"file":"evm.types.d.ts","sourceRoot":"","sources":["../../../client/evm/evm.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,IAAI,OAAO,EACrB,gBAAgB,IAAI,aAAa,EACjC,eAAe,IAAI,YAAY,EAChC,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACpG,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAA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+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../client/policies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,216 @@
1
+ import { PoliciesClientInterface, CreatePolicyOptions, ListPoliciesOptions, ListPoliciesResult, GetPolicyByIdOptions, DeletePolicyOptions, UpdatePolicyOptions } from "./policies.types.js";
2
+ import { Policy } from "../../policies/types.js";
3
+ /**
4
+ * The namespace containing all Policy methods.
5
+ */
6
+ export declare class PoliciesClient implements PoliciesClientInterface {
7
+ /**
8
+ * Lists policies belonging to the developer's CDP Project.
9
+ * Can be filtered by scope (project or account).
10
+ *
11
+ * @param {ListPoliciesOptions} [options] - Options for filtering and paginating the results
12
+ * @param {string} [options.scope] - Filter policies by scope ('project' or 'account')
13
+ * @param {number} [options.pageSize] - Maximum number of policies to return
14
+ * @param {string} [options.pageToken] - Pagination cursor for fetching next page of results
15
+ *
16
+ * @returns {Promise<ListPoliciesResult>} A paginated list of policies
17
+ *
18
+ * @example **List all policies**
19
+ * ```ts
20
+ * const { policies } = await cdp.policies.listPolicies();
21
+ * ```
22
+ *
23
+ * @example **Filter by scope**
24
+ * ```ts
25
+ * const { policies } = await cdp.policies.listPolicies({
26
+ * scope: 'project'
27
+ * });
28
+ * ```
29
+ *
30
+ * @example **With pagination**
31
+ * ```ts
32
+ * // Get first page
33
+ * const firstPage = await cdp.policies.listPolicies({
34
+ * pageSize: 10
35
+ * });
36
+ *
37
+ * // Get next page using cursor
38
+ * const nextPage = await cdp.policies.listPolicies({
39
+ * pageSize: 10,
40
+ * pageToken: firstPage.pageToken
41
+ * });
42
+ * ```
43
+ */
44
+ listPolicies(options?: ListPoliciesOptions): Promise<ListPoliciesResult>;
45
+ /**
46
+ * Creates a new policy that can be used to govern the behavior of projects and accounts.
47
+ *
48
+ * @param {CreatePolicyOptions} options - Options for creating the policy
49
+ * @param {CreatePolicyBody} options.policy - The policy configuration to create
50
+ * @param {string} [options.policy.description] - Description of the policy's purpose
51
+ * @param {Rule[]} options.policy.rules - Rules that define the policy behavior
52
+ * @param {string} [options.idempotencyKey] - An idempotency key to prevent duplicate policy creation
53
+ *
54
+ * @returns {Promise<Policy>} The created policy
55
+ * @throws {ZodError<typeof CreatePolicyBodySchema>} When the policy is invalid
56
+ *
57
+ * @example **Creating a new policy**
58
+ * ```ts
59
+ * const policy = await cdp.policies.createPolicy({
60
+ * policy: {
61
+ * scope: "account",
62
+ * description: "Limits the amount of ETH in transaction",
63
+ * rules: [
64
+ * {
65
+ * action: "reject",
66
+ * operation: "signEvmTransaction",
67
+ * criteria: [
68
+ * {
69
+ * type: "ethValue",
70
+ * ethValue: "1000000000000000000",
71
+ * operator: ">",
72
+ * },
73
+ * ],
74
+ * },
75
+ * ],
76
+ * }
77
+ * });
78
+ * ```
79
+ *
80
+ * @example **With idempotency key**
81
+ * ```ts
82
+ * const idempotencyKey = uuidv4();
83
+ *
84
+ * // First call creates the policy
85
+ * const policy = await cdp.policies.createPolicy({
86
+ * policy: {
87
+ * scope: "account",
88
+ * description: "Limits the amount of ETH in transaction",
89
+ * rules: [
90
+ * {
91
+ * action: "reject",
92
+ * operation: "signEvmTransaction",
93
+ * criteria: [
94
+ * {
95
+ * type: "ethValue",
96
+ * ethValue: "1000000000000000000",
97
+ * operator: ">",
98
+ * },
99
+ * ],
100
+ * },
101
+ * ],
102
+ * },
103
+ * idempotencyKey
104
+ * });
105
+ *
106
+ * // Second call with same key returns the same policy
107
+ * const samePolicy = await cdp.policies.createPolicy({
108
+ * policy: { ... },
109
+ * idempotencyKey
110
+ * });
111
+ * ```
112
+ */
113
+ createPolicy(options: CreatePolicyOptions): Promise<Policy>;
114
+ /**
115
+ * Retrieves a policy by its unique identifier.
116
+ *
117
+ * @param {GetPolicyByIdOptions} options - Options containing the policy ID to retrieve
118
+ * @param {string} options.id - The unique identifier of the policy to retrieve
119
+ *
120
+ * @returns {Promise<Policy>} The requested policy
121
+ *
122
+ * @example **Retrieving a policy by ID**
123
+ * ```ts
124
+ * const policy = await cdp.policies.getPolicyById({
125
+ * id: "__ID__"
126
+ * });
127
+ *
128
+ * console.log(policy.name);
129
+ * console.log(policy.rules);
130
+ * ```
131
+ */
132
+ getPolicyById(options: GetPolicyByIdOptions): Promise<Policy>;
133
+ /**
134
+ * Deletes a policy by its unique identifier.
135
+ * If a policy is referenced by an active project or account, this operation will fail.
136
+ *
137
+ * @param {DeletePolicyOptions} options - Options containing the policy ID to delete
138
+ * @param {string} options.id - The unique identifier of the policy to delete
139
+ * @param {string} [options.idempotencyKey] - An idempotency key to prevent duplicate deletion
140
+ *
141
+ * @returns {Promise<void>} Void on successful deletion
142
+ *
143
+ * @example **Deleting a policy**
144
+ * ```ts
145
+ * await cdp.policies.deletePolicy({
146
+ * id: "__ID__"
147
+ * });
148
+ * ```
149
+ *
150
+ * @example **With idempotency key**
151
+ * ```ts
152
+ * const idempotencyKey = uuidv4();
153
+ *
154
+ * // This operation is idempotent with the key
155
+ * await cdp.policies.deletePolicy({
156
+ * id: "__ID__",
157
+ * idempotencyKey
158
+ * });
159
+ * ```
160
+ */
161
+ deletePolicy(options: DeletePolicyOptions): Promise<void>;
162
+ /**
163
+ * Updates an existing policy by its unique identifier.
164
+ * This will apply the updated policy to any project or accounts that are currently using it.
165
+ *
166
+ * @param {UpdatePolicyOptions} options - Options containing the policy ID and updated policy data
167
+ * @param {string} options.id - The unique identifier of the policy to update
168
+ * @param {UpdatePolicyBody} options.policy - The updated policy configuration
169
+ * @param {string} [options.policy.description] - Updated description of the policy's purpose
170
+ * @param {Rule[]} [options.policy.rules] - Updated rules that define the policy behavior
171
+ * @param {string} [options.idempotencyKey] - An idempotency key to prevent duplicate updates
172
+ *
173
+ * @returns {Promise<Policy>} The updated policy
174
+ * @throws {ZodError<typeof UpdatePolicyBodySchema>} When the updated policy is invalid
175
+ *
176
+ * @example **Updating a policy**
177
+ * ```ts
178
+ * const updatedPolicy = await cdp.policies.updatePolicy({
179
+ * id: "__ID__",
180
+ * policy: {
181
+ * description: "Now with lower transaction limits",
182
+ * rules: [
183
+ * {
184
+ * action: "reject",
185
+ * operation: "signEvmTransaction",
186
+ * criteria: [
187
+ * {
188
+ * type: "ethValue",
189
+ * ethValue: "1000000000",
190
+ * operator: ">",
191
+ * },
192
+ * ],
193
+ * },
194
+ * ],
195
+ * },
196
+ * });
197
+ * ```
198
+ *
199
+ * @example **With idempotency key**
200
+ * ```ts
201
+ * const idempotencyKey = uuidv4();
202
+ *
203
+ * // This operation is idempotent with the key
204
+ * await cdp.policies.updatePolicy({
205
+ * id: "__ID__",
206
+ * policy: {
207
+ * description: "Modified Policy",
208
+ * rules: { ... }
209
+ * },
210
+ * idempotencyKey
211
+ * });
212
+ * ```
213
+ */
214
+ updatePolicy(options: UpdatePolicyOptions): Promise<Policy>;
215
+ }
216
+ //# sourceMappingURL=policies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policies.d.ts","sourceRoot":"","sources":["../../../client/policies/policies.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD;;GAEG;AACH,qBAAa,cAAe,YAAW,uBAAuB;IAC5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACG,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIlF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmEG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;IAKjE;;;;;;;;;;;;;;;;;OAiBG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC;IAInE;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmDG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;CAQlE"}
@@ -0,0 +1,96 @@
1
+ import { OpenApiPoliciesMethods } from "../../openapi-client/index.js";
2
+ import { CreatePolicyBody, PolicyScope, UpdatePolicyBody } from "../../policies/schema.js";
3
+ import { Policy } from "../../policies/types.js";
4
+ /**
5
+ * The PoliciesClient type, where all OpenApiPoliciesMethods methods are wrapped.
6
+ */
7
+ export type PoliciesClientInterface = Omit<typeof OpenApiPoliciesMethods, "createPolicy" | "listPolicies" | "getPolicyById" | "deletePolicy" | "updatePolicy"> & {
8
+ listPolicies: (options: ListPoliciesOptions) => Promise<ListPoliciesResult>;
9
+ createPolicy: (options: CreatePolicyOptions) => Promise<Policy>;
10
+ getPolicyById: (options: GetPolicyByIdOptions) => Promise<Policy>;
11
+ deletePolicy: (options: DeletePolicyOptions) => Promise<void>;
12
+ updatePolicy: (options: UpdatePolicyOptions) => Promise<Policy>;
13
+ };
14
+ export interface ListPoliciesOptions {
15
+ /** The page size to paginate through the accounts. */
16
+ pageSize?: number;
17
+ /** The page token to paginate through the accounts. */
18
+ pageToken?: string;
19
+ /**
20
+ * The scope of the policies to return. If `project`, the response will include exactly one policy, which is the project-level policy. If `account`, the response will include all account-level policies for the developer's CDP Project.
21
+ */
22
+ scope?: PolicyScope;
23
+ }
24
+ /**
25
+ * The result of listing policies.
26
+ */
27
+ export interface ListPoliciesResult {
28
+ /** The list of policies matching the query parameters. */
29
+ policies: Policy[];
30
+ /**
31
+ * The next page token to paginate through the policies.
32
+ * If undefined, there are no more policies to paginate through.
33
+ */
34
+ nextPageToken?: string;
35
+ }
36
+ /**
37
+ * Options for creating a Policy.
38
+ */
39
+ export interface CreatePolicyOptions {
40
+ /**
41
+ * The idempotency key to ensure the request is processed exactly once.
42
+ * Used to safely retry requests without accidentally performing the same operation twice.
43
+ */
44
+ idempotencyKey?: string;
45
+ /**
46
+ * The policy definition to create.
47
+ * Contains the scope, description, and rules for the policy.
48
+ */
49
+ policy: CreatePolicyBody;
50
+ }
51
+ /**
52
+ * Options for retrieving a Policy by ID.
53
+ */
54
+ export interface GetPolicyByIdOptions {
55
+ /**
56
+ * The unique identifier of the policy to retrieve.
57
+ * This is a UUID that's generated when the policy is created.
58
+ */
59
+ id: string;
60
+ }
61
+ /**
62
+ * Options for deleting a Policy.
63
+ */
64
+ export interface DeletePolicyOptions {
65
+ /**
66
+ * The unique identifier of the policy to delete.
67
+ * This is a UUID that's generated when the policy is created.
68
+ */
69
+ id: string;
70
+ /**
71
+ * The idempotency key to ensure the request is processed exactly once.
72
+ * Used to safely retry requests without accidentally performing the same operation twice.
73
+ */
74
+ idempotencyKey?: string;
75
+ }
76
+ /**
77
+ * Options for updating a Policy.
78
+ */
79
+ export interface UpdatePolicyOptions {
80
+ /**
81
+ * The unique identifier of the policy to update.
82
+ * This is a UUID that's generated when the policy is created.
83
+ */
84
+ id: string;
85
+ /**
86
+ * The updated policy definition.
87
+ * Contains the description and rules for the policy.
88
+ */
89
+ policy: UpdatePolicyBody;
90
+ /**
91
+ * The idempotency key to ensure the request is processed exactly once.
92
+ * Used to safely retry requests without accidentally performing the same operation twice.
93
+ */
94
+ idempotencyKey?: string;
95
+ }
96
+ //# sourceMappingURL=policies.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policies.types.d.ts","sourceRoot":"","sources":["../../../client/policies/policies.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,0BA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,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,MAAM,EAAE,gBAAgB,CAAC;IACzB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
@@ -1,4 +1,4 @@
1
- import { CreateAccountOptions, GetAccountOptions, GetOrCreateAccountOptions, ListAccountsOptions, ListAccountsResult, RequestFaucetOptions, SignatureResult, SignMessageOptions, SignTransactionOptions, SolanaClientInterface } from "./solana.types.js";
1
+ import { CreateAccountOptions, GetAccountOptions, GetOrCreateAccountOptions, ListAccountsOptions, ListAccountsResult, RequestFaucetOptions, SignatureResult, SignMessageOptions, SignTransactionOptions, SolanaClientInterface, UpdateSolanaAccountOptions } from "./solana.types.js";
2
2
  import { SolanaAccount } from "../../accounts/solana/types.js";
3
3
  /**
4
4
  * The namespace containing all Solana methods.
@@ -182,5 +182,47 @@ export declare class SolanaClient implements SolanaClientInterface {
182
182
  * ```
183
183
  */
184
184
  signTransaction(options: SignTransactionOptions): Promise<SignatureResult>;
185
+ /**
186
+ * Updates a CDP Solana account.
187
+ *
188
+ * @param {UpdateSolanaAccountOptions} [options] - Optional parameters for creating the account.
189
+ * @param {string} options.address - The address of the account to update
190
+ * @param {UpdateSolanaAccountBody} options.update - An object containing account fields to update.
191
+ * @param {string} [options.update.name] - The new name for the account.
192
+ * @param {string} [options.update.accountPolicy] - The ID of a Policy to apply to the account.
193
+ * @param {string} [options.idempotencyKey] - An idempotency key.
194
+ *
195
+ * @returns A promise that resolves to the updated account.
196
+ *
197
+ * @example **With a name**
198
+ * ```ts
199
+ * const account = await cdp.sol.updateAccount({ address: "...", update: { name: "New Name" } });
200
+ * ```
201
+ *
202
+ * @example **With an account policy**
203
+ * ```ts
204
+ * const account = await cdp.sol.updateAccount({ address: "...", update: { accountPolicy: "73bcaeeb-d7af-4615-b064-42b5fe83a31e" } });
205
+ * ```
206
+ *
207
+ * @example **With an idempotency key**
208
+ * ```ts
209
+ * const idempotencyKey = uuidv4();
210
+ *
211
+ * // First call
212
+ * await cdp.sol.updateAccount({
213
+ * address: "0x...",
214
+ * update: { accountPolicy: "73bcaeeb-d7af-4615-b064-42b5fe83a31e" },
215
+ * idempotencyKey,
216
+ * });
217
+ *
218
+ * // Second call with the same idempotency key will not update
219
+ * await cdp.sol.updateAccount({
220
+ * address: '0x...',
221
+ * update: { name: "" },
222
+ * idempotencyKey,
223
+ * });
224
+ * ```
225
+ */
226
+ updateAccount(options: UpdateSolanaAccountOptions): Promise<SolanaAccount>;
185
227
  }
186
228
  //# sourceMappingURL=solana.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../client/solana/solana.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAO/D;;GAEG;AACH,qBAAa,YAAa,YAAW,qBAAqB;IACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACG,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,aAAa,CAAC;IAQ/E;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;IAkBpE;;;;;;;;;;;;;;OAcG;IACG,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,aAAa,CAAC;IA0BpF;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,YAAY,CAAC,O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ACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC;IAI5E;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC;IAIxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC;IAIhF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACG,aAAa,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,aAAa,CAAC;CAejF"}
@@ -1,12 +1,13 @@
1
1
  import { Account, SolanaAccount } from "../../accounts/solana/types.js";
2
- import { OpenApiSolanaMethods } from "../../openapi-client/index.js";
2
+ import { OpenApiSolanaMethods, UpdateSolanaAccountBody } from "../../openapi-client/index.js";
3
3
  /**
4
4
  * The SolanaClient type, where all OpenApiSolanaMethods methods are wrapped.
5
5
  */
6
- export type SolanaClientInterface = Omit<typeof OpenApiSolanaMethods, "createSolanaAccount" | "getSolanaAccount" | "getSolanaAccountByName" | "listSolanaAccounts" | "requestSolanaFaucet" | "signSolanaMessage" | "signSolanaTransaction"> & {
6
+ export type SolanaClientInterface = Omit<typeof OpenApiSolanaMethods, "createSolanaAccount" | "getSolanaAccount" | "getSolanaAccountByName" | "updateSolanaAccount" | "listSolanaAccounts" | "requestSolanaFaucet" | "signSolanaMessage" | "signSolanaTransaction" | "updateSolanaAccount"> & {
7
7
  createAccount: (options: CreateAccountOptions) => Promise<Account>;
8
8
  getAccount: (options: GetAccountOptions) => Promise<Account>;
9
9
  getOrCreateAccount: (options: GetOrCreateAccountOptions) => Promise<Account>;
10
+ updateAccount: (options: UpdateSolanaAccountOptions) => Promise<Account>;
10
11
  listAccounts: (options: ListAccountsOptions) => Promise<ListAccountsResult>;
11
12
  requestFaucet: (options: RequestFaucetOptions) => Promise<SignatureResult>;
12
13
  signMessage: (options: SignMessageOptions) => Promise<SignatureResult>;
@@ -44,6 +45,17 @@ export interface GetOrCreateAccountOptions {
44
45
  /** The name of the account. */
45
46
  name: string;
46
47
  }
48
+ /**
49
+ * Options for creating a SOL server account.
50
+ */
51
+ export interface UpdateSolanaAccountOptions {
52
+ /** The address of the account. */
53
+ address: string;
54
+ /** The updates to apply to the account */
55
+ update: UpdateSolanaAccountBody;
56
+ /** The idempotency key. */
57
+ idempotencyKey?: string;
58
+ }
47
59
  /**
48
60
  * Options for listing Solana accounts.
49
61
  */