@coinbase/cdp-sdk 1.6.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 (257) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +284 -1
  3. package/_cjs/accounts/evm/toEvmServerAccount.js +4 -2
  4. package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -1
  5. package/_cjs/accounts/evm/toEvmSmartAccount.js +7 -0
  6. package/_cjs/accounts/evm/toEvmSmartAccount.js.map +1 -1
  7. package/_cjs/accounts/evm/types.js.map +1 -0
  8. package/_cjs/accounts/solana/toSolanaAccount.js +42 -0
  9. package/_cjs/accounts/solana/toSolanaAccount.js.map +1 -0
  10. package/_cjs/accounts/solana/types.js +3 -0
  11. package/_cjs/accounts/solana/types.js.map +1 -0
  12. package/_cjs/actions/evm/getUserOperation.js +36 -0
  13. package/_cjs/actions/evm/getUserOperation.js.map +1 -0
  14. package/_cjs/actions/evm/transfer/accountTransferStrategy.js +11 -7
  15. package/_cjs/actions/evm/transfer/accountTransferStrategy.js.map +1 -1
  16. package/_cjs/actions/evm/transfer/smartAccountTransferStrategy.js +9 -6
  17. package/_cjs/actions/evm/transfer/smartAccountTransferStrategy.js.map +1 -1
  18. package/_cjs/actions/evm/transfer/transfer.js +7 -3
  19. package/_cjs/actions/evm/transfer/transfer.js.map +1 -1
  20. package/_cjs/actions/solana/requestFaucet.js +29 -0
  21. package/_cjs/actions/solana/requestFaucet.js.map +1 -0
  22. package/_cjs/actions/solana/signMessage.js +29 -0
  23. package/_cjs/actions/solana/signMessage.js.map +1 -0
  24. package/_cjs/actions/solana/signTransaction.js +46 -0
  25. package/_cjs/actions/solana/signTransaction.js.map +1 -0
  26. package/_cjs/actions/solana/types.js +3 -0
  27. package/_cjs/actions/solana/types.js.map +1 -0
  28. package/_cjs/analytics.js +68 -8
  29. package/_cjs/analytics.js.map +1 -1
  30. package/_cjs/client/cdp.js +9 -3
  31. package/_cjs/client/cdp.js.map +1 -1
  32. package/_cjs/client/evm/evm.js +135 -27
  33. package/_cjs/client/evm/evm.js.map +1 -1
  34. package/_cjs/client/policies/index.js +6 -0
  35. package/_cjs/client/policies/index.js.map +1 -0
  36. package/_cjs/client/policies/policies.js +232 -0
  37. package/_cjs/client/policies/policies.js.map +1 -0
  38. package/_cjs/client/policies/policies.types.js +3 -0
  39. package/_cjs/client/policies/policies.types.js.map +1 -0
  40. package/_cjs/client/solana/solana.js +84 -22
  41. package/_cjs/client/solana/solana.js.map +1 -1
  42. package/_cjs/index.js +4 -1
  43. package/_cjs/index.js.map +1 -1
  44. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +59 -1
  45. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  46. package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.js +27 -1
  47. package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.js.map +1 -1
  48. package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.msw.js +56 -1
  49. package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.msw.js.map +1 -1
  50. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +3 -1
  51. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
  52. package/_cjs/openapi-client/generated/index.msw.js +3 -2
  53. package/_cjs/openapi-client/generated/index.msw.js.map +1 -1
  54. package/_cjs/openapi-client/generated/policy-engine/policy-engine.js +56 -0
  55. package/_cjs/openapi-client/generated/policy-engine/policy-engine.js.map +1 -0
  56. package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js +284 -0
  57. package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -0
  58. package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.js +14 -1
  59. package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.js.map +1 -1
  60. package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.msw.js +42 -1
  61. package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.msw.js.map +1 -1
  62. package/_cjs/openapi-client/index.js +7 -1
  63. package/_cjs/openapi-client/index.js.map +1 -1
  64. package/_cjs/policies/schema.js +186 -0
  65. package/_cjs/policies/schema.js.map +1 -0
  66. package/_cjs/policies/types.js +3 -0
  67. package/_cjs/{accounts → policies}/types.js.map +1 -1
  68. package/_cjs/version.js +1 -1
  69. package/_esm/accounts/evm/toEvmServerAccount.js +4 -2
  70. package/_esm/accounts/evm/toEvmServerAccount.js.map +1 -1
  71. package/_esm/accounts/evm/toEvmSmartAccount.js +7 -0
  72. package/_esm/accounts/evm/toEvmSmartAccount.js.map +1 -1
  73. package/_esm/accounts/evm/types.js.map +1 -0
  74. package/_esm/accounts/solana/toSolanaAccount.js +39 -0
  75. package/_esm/accounts/solana/toSolanaAccount.js.map +1 -0
  76. package/_esm/accounts/solana/types.js +2 -0
  77. package/_esm/accounts/solana/types.js.map +1 -0
  78. package/_esm/actions/evm/getUserOperation.js +33 -0
  79. package/_esm/actions/evm/getUserOperation.js.map +1 -0
  80. package/_esm/actions/evm/transfer/accountTransferStrategy.js +11 -7
  81. package/_esm/actions/evm/transfer/accountTransferStrategy.js.map +1 -1
  82. package/_esm/actions/evm/transfer/smartAccountTransferStrategy.js +9 -6
  83. package/_esm/actions/evm/transfer/smartAccountTransferStrategy.js.map +1 -1
  84. package/_esm/actions/evm/transfer/transfer.js +7 -3
  85. package/_esm/actions/evm/transfer/transfer.js.map +1 -1
  86. package/_esm/actions/solana/requestFaucet.js +26 -0
  87. package/_esm/actions/solana/requestFaucet.js.map +1 -0
  88. package/_esm/actions/solana/signMessage.js +26 -0
  89. package/_esm/actions/solana/signMessage.js.map +1 -0
  90. package/_esm/actions/solana/signTransaction.js +43 -0
  91. package/_esm/actions/solana/signTransaction.js.map +1 -0
  92. package/_esm/actions/solana/types.js +2 -0
  93. package/_esm/actions/solana/types.js.map +1 -0
  94. package/_esm/analytics.js +68 -7
  95. package/_esm/analytics.js.map +1 -1
  96. package/_esm/client/cdp.js +10 -4
  97. package/_esm/client/cdp.js.map +1 -1
  98. package/_esm/client/evm/evm.js +135 -27
  99. package/_esm/client/evm/evm.js.map +1 -1
  100. package/_esm/client/policies/index.js +2 -0
  101. package/_esm/client/policies/index.js.map +1 -0
  102. package/_esm/client/policies/policies.js +228 -0
  103. package/_esm/client/policies/policies.js.map +1 -0
  104. package/_esm/client/policies/policies.types.js +2 -0
  105. package/_esm/client/policies/policies.types.js.map +1 -0
  106. package/_esm/client/solana/solana.js +84 -22
  107. package/_esm/client/solana/solana.js.map +1 -1
  108. package/_esm/index.js +1 -0
  109. package/_esm/index.js.map +1 -1
  110. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +58 -0
  111. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  112. package/_esm/openapi-client/generated/evm-accounts/evm-accounts.js +24 -0
  113. package/_esm/openapi-client/generated/evm-accounts/evm-accounts.js.map +1 -1
  114. package/_esm/openapi-client/generated/evm-accounts/evm-accounts.msw.js +51 -0
  115. package/_esm/openapi-client/generated/evm-accounts/evm-accounts.msw.js.map +1 -1
  116. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +3 -1
  117. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
  118. package/_esm/openapi-client/generated/index.msw.js +3 -2
  119. package/_esm/openapi-client/generated/index.msw.js.map +1 -1
  120. package/_esm/openapi-client/generated/policy-engine/policy-engine.js +48 -0
  121. package/_esm/openapi-client/generated/policy-engine/policy-engine.js.map +1 -0
  122. package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js +259 -0
  123. package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -0
  124. package/_esm/openapi-client/generated/solana-accounts/solana-accounts.js +12 -0
  125. package/_esm/openapi-client/generated/solana-accounts/solana-accounts.js.map +1 -1
  126. package/_esm/openapi-client/generated/solana-accounts/solana-accounts.msw.js +39 -0
  127. package/_esm/openapi-client/generated/solana-accounts/solana-accounts.msw.js.map +1 -1
  128. package/_esm/openapi-client/index.js +6 -0
  129. package/_esm/openapi-client/index.js.map +1 -1
  130. package/_esm/policies/schema.js +183 -0
  131. package/_esm/policies/schema.js.map +1 -0
  132. package/_esm/policies/types.js +2 -0
  133. package/_esm/{accounts → policies}/types.js.map +1 -1
  134. package/_esm/version.js +1 -1
  135. package/_types/accounts/evm/toEvmServerAccount.d.ts +1 -1
  136. package/_types/accounts/evm/toEvmServerAccount.d.ts.map +1 -1
  137. package/_types/accounts/evm/toEvmSmartAccount.d.ts +1 -1
  138. package/_types/accounts/evm/toEvmSmartAccount.d.ts.map +1 -1
  139. package/_types/accounts/{types.d.ts → evm/types.d.ts} +10 -7
  140. package/_types/accounts/evm/types.d.ts.map +1 -0
  141. package/_types/accounts/solana/toSolanaAccount.d.ts +20 -0
  142. package/_types/accounts/solana/toSolanaAccount.d.ts.map +1 -0
  143. package/_types/accounts/solana/types.d.ts +12 -0
  144. package/_types/accounts/solana/types.d.ts.map +1 -0
  145. package/_types/actions/evm/getUserOperation.d.ts +22 -0
  146. package/_types/actions/evm/getUserOperation.d.ts.map +1 -0
  147. package/_types/actions/evm/sendUserOperation.d.ts +1 -1
  148. package/_types/actions/evm/sendUserOperation.d.ts.map +1 -1
  149. package/_types/actions/evm/transfer/accountTransferStrategy.d.ts +1 -1
  150. package/_types/actions/evm/transfer/accountTransferStrategy.d.ts.map +1 -1
  151. package/_types/actions/evm/transfer/smartAccountTransferStrategy.d.ts +1 -1
  152. package/_types/actions/evm/transfer/smartAccountTransferStrategy.d.ts.map +1 -1
  153. package/_types/actions/evm/transfer/transfer.d.ts +3 -3
  154. package/_types/actions/evm/transfer/transfer.d.ts.map +1 -1
  155. package/_types/actions/evm/transfer/types.d.ts +39 -6
  156. package/_types/actions/evm/transfer/types.d.ts.map +1 -1
  157. package/_types/actions/evm/types.d.ts +28 -5
  158. package/_types/actions/evm/types.d.ts.map +1 -1
  159. package/_types/actions/solana/requestFaucet.d.ts +23 -0
  160. package/_types/actions/solana/requestFaucet.d.ts.map +1 -0
  161. package/_types/actions/solana/signMessage.d.ts +23 -0
  162. package/_types/actions/solana/signMessage.d.ts.map +1 -0
  163. package/_types/actions/solana/signTransaction.d.ts +38 -0
  164. package/_types/actions/solana/signTransaction.d.ts.map +1 -0
  165. package/_types/actions/solana/types.d.ts +80 -0
  166. package/_types/actions/solana/types.d.ts.map +1 -0
  167. package/_types/analytics.d.ts +14 -5
  168. package/_types/analytics.d.ts.map +1 -1
  169. package/_types/client/cdp.d.ts +3 -0
  170. package/_types/client/cdp.d.ts.map +1 -1
  171. package/_types/client/evm/evm.d.ts +89 -1
  172. package/_types/client/evm/evm.d.ts.map +1 -1
  173. package/_types/client/evm/evm.types.d.ts +36 -6
  174. package/_types/client/evm/evm.types.d.ts.map +1 -1
  175. package/_types/client/policies/index.d.ts +2 -0
  176. package/_types/client/policies/index.d.ts.map +1 -0
  177. package/_types/client/policies/policies.d.ts +216 -0
  178. package/_types/client/policies/policies.d.ts.map +1 -0
  179. package/_types/client/policies/policies.types.d.ts +96 -0
  180. package/_types/client/policies/policies.types.d.ts.map +1 -0
  181. package/_types/client/solana/solana.d.ts +47 -4
  182. package/_types/client/solana/solana.d.ts.map +1 -1
  183. package/_types/client/solana/solana.types.d.ts +21 -12
  184. package/_types/client/solana/solana.types.d.ts.map +1 -1
  185. package/_types/index.d.ts +3 -1
  186. package/_types/index.d.ts.map +1 -1
  187. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +299 -0
  188. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
  189. package/_types/openapi-client/generated/evm-accounts/evm-accounts.d.ts +13 -1
  190. package/_types/openapi-client/generated/evm-accounts/evm-accounts.d.ts.map +1 -1
  191. package/_types/openapi-client/generated/evm-accounts/evm-accounts.msw.d.ts +5 -1
  192. package/_types/openapi-client/generated/evm-accounts/evm-accounts.msw.d.ts.map +1 -1
  193. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts +3 -1
  194. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts.map +1 -1
  195. package/_types/openapi-client/generated/index.msw.d.ts +3 -2
  196. package/_types/openapi-client/generated/index.msw.d.ts.map +1 -1
  197. package/_types/openapi-client/generated/policy-engine/policy-engine.d.ts +43 -0
  198. package/_types/openapi-client/generated/policy-engine/policy-engine.d.ts.map +1 -0
  199. package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts +25 -0
  200. package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts.map +1 -0
  201. package/_types/openapi-client/generated/solana-accounts/solana-accounts.d.ts +7 -1
  202. package/_types/openapi-client/generated/solana-accounts/solana-accounts.d.ts.map +1 -1
  203. package/_types/openapi-client/generated/solana-accounts/solana-accounts.msw.d.ts +2 -0
  204. package/_types/openapi-client/generated/solana-accounts/solana-accounts.msw.d.ts.map +1 -1
  205. package/_types/openapi-client/index.d.ts +19 -0
  206. package/_types/openapi-client/index.d.ts.map +1 -1
  207. package/_types/policies/schema.d.ts +922 -0
  208. package/_types/policies/schema.d.ts.map +1 -0
  209. package/_types/policies/types.d.ts +19 -0
  210. package/_types/policies/types.d.ts.map +1 -0
  211. package/_types/types/misc.d.ts +39 -0
  212. package/_types/types/misc.d.ts.map +1 -1
  213. package/_types/version.d.ts +1 -1
  214. package/accounts/evm/toEvmServerAccount.ts +7 -4
  215. package/accounts/evm/toEvmSmartAccount.ts +11 -1
  216. package/accounts/{types.ts → evm/types.ts} +10 -12
  217. package/accounts/solana/toSolanaAccount.ts +60 -0
  218. package/accounts/solana/types.ts +13 -0
  219. package/actions/evm/getUserOperation.ts +40 -0
  220. package/actions/evm/sendUserOperation.ts +1 -1
  221. package/actions/evm/transfer/accountTransferStrategy.ts +12 -8
  222. package/actions/evm/transfer/smartAccountTransferStrategy.ts +10 -7
  223. package/actions/evm/transfer/transfer.ts +17 -6
  224. package/actions/evm/transfer/types.ts +54 -11
  225. package/actions/evm/types.ts +37 -5
  226. package/actions/solana/requestFaucet.ts +35 -0
  227. package/actions/solana/signMessage.ts +36 -0
  228. package/actions/solana/signTransaction.ts +53 -0
  229. package/actions/solana/types.ts +87 -0
  230. package/analytics.ts +84 -11
  231. package/client/cdp.ts +11 -4
  232. package/client/evm/evm.ts +162 -33
  233. package/client/evm/evm.types.ts +42 -4
  234. package/client/policies/index.ts +1 -0
  235. package/client/policies/policies.ts +246 -0
  236. package/client/policies/policies.types.ts +109 -0
  237. package/client/solana/solana.ts +107 -38
  238. package/client/solana/solana.types.ts +25 -15
  239. package/index.ts +8 -1
  240. package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +360 -0
  241. package/openapi-client/generated/evm-accounts/evm-accounts.msw.ts +102 -0
  242. package/openapi-client/generated/evm-accounts/evm-accounts.ts +43 -0
  243. package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.ts +3 -1
  244. package/openapi-client/generated/index.msw.ts +3 -2
  245. package/openapi-client/generated/policy-engine/policy-engine.msw.ts +404 -0
  246. package/openapi-client/generated/policy-engine/policy-engine.ts +95 -0
  247. package/openapi-client/generated/solana-accounts/solana-accounts.msw.ts +75 -0
  248. package/openapi-client/generated/solana-accounts/solana-accounts.ts +23 -0
  249. package/openapi-client/index.ts +7 -0
  250. package/package.json +3 -2
  251. package/policies/schema.ts +266 -0
  252. package/policies/types.ts +19 -0
  253. package/types/misc.ts +41 -0
  254. package/version.ts +1 -1
  255. package/_types/accounts/types.d.ts.map +0 -1
  256. /package/_cjs/accounts/{types.js → evm/types.js} +0 -0
  257. /package/_esm/accounts/{types.js → evm/types.js} +0 -0
@@ -1,5 +1,7 @@
1
- import { Hex, TransactionReceipt, Address, PublicClient, Chain, Transport } from "viem";
2
- import { CdpOpenApiClientType, EvmAccount, EvmUserOperationNetwork, SendEvmTransactionBodyNetwork } from "../../../openapi-client/index.js";
1
+ import { Hex, TransactionReceipt, Address, PublicClient, Chain, Transport, WaitForTransactionReceiptParameters } from "viem";
2
+ import { CdpOpenApiClientType, EvmUserOperationNetwork, SendEvmTransactionBodyNetwork } from "../../../openapi-client/index.js";
3
+ import type { EvmAccount, EvmSmartAccount } from "../../../accounts/evm/types.js";
4
+ import type { WaitForUserOperationOptions } from "../waitForUserOperation.js";
3
5
  /**
4
6
  * The network to transfer the token on.
5
7
  */
@@ -20,6 +22,31 @@ export type TransferOptions = {
20
22
  /** The network to transfer the token on. */
21
23
  network: Network;
22
24
  };
25
+ /**
26
+ * The options for the transfer using an account.
27
+ */
28
+ export type AccountTransferOptions = TransferOptions & {
29
+ /** The options for waiting for the result of the transfer. */
30
+ waitOptions?: {
31
+ /**
32
+ * Polling frequency (in seconds). Defaults to 4 seconds.
33
+ */
34
+ intervalSeconds?: WaitForTransactionReceiptParameters["pollingInterval"];
35
+ /**
36
+ * Optional timeout (in seconds) to wait before stopping polling. Defaults to 180 seconds.
37
+ */
38
+ timeoutSeconds?: WaitForTransactionReceiptParameters["timeout"];
39
+ };
40
+ };
41
+ /**
42
+ * The options for the transfer using a smart account.
43
+ */
44
+ export type SmartAccountTransferOptions = TransferOptions & {
45
+ /** The paymaster URL to use for the transfer. */
46
+ paymasterUrl?: string;
47
+ /** The options for waiting for the result of the transfer. */
48
+ waitOptions?: WaitForUserOperationOptions["waitOptions"];
49
+ };
23
50
  /**
24
51
  * The result of the transfer.
25
52
  */
@@ -32,25 +59,29 @@ export type TransferResult = {
32
59
  /**
33
60
  * A strategy for executing a transfer.
34
61
  */
35
- export interface TransferExecutionStrategy<T> {
62
+ export interface TransferExecutionStrategy<T extends EvmAccount | EvmSmartAccount> {
36
63
  /**
37
64
  * Executes the transfer.
38
65
  *
39
66
  * @param args - The arguments for the transfer.
40
67
  * @param args.apiClient - The API client to use for the transfer.
41
68
  * @param args.from - The account to transfer the token from.
42
- * @param args.transferArgs - The arguments for the transfer.
43
69
  * @param args.to - The account to transfer the token to.
44
70
  * @param args.value - The value of the transfer.
71
+ * @param args.token - The token to transfer.
72
+ * @param args.network - The network to transfer the token on.
45
73
  * @returns The transaction hash of the transfer.
46
74
  */
47
75
  executeTransfer(args: {
48
76
  apiClient: CdpOpenApiClientType;
49
77
  from: T;
50
- transferArgs: TransferOptions;
51
78
  to: Address;
52
79
  value: bigint;
53
- }): Promise<Hex>;
80
+ token: TransferOptions["token"];
81
+ network: TransferOptions["network"];
82
+ } & (T extends EvmSmartAccount ? {
83
+ paymasterUrl?: string;
84
+ } : object)): Promise<Hex>;
54
85
  /**
55
86
  * Waits for the result of the transfer.
56
87
  *
@@ -59,6 +90,7 @@ export interface TransferExecutionStrategy<T> {
59
90
  * @param args.publicClient - The public client to use for the transfer.
60
91
  * @param args.from - The account to transfer the token from.
61
92
  * @param args.hash - The transaction hash of the transfer.
93
+ * @param args.waitOptions - The options for waiting for the result of the transfer.
62
94
  * @returns The result of the transfer.
63
95
  */
64
96
  waitForResult(args: {
@@ -66,6 +98,7 @@ export interface TransferExecutionStrategy<T> {
66
98
  publicClient: PublicClient<Transport, Chain>;
67
99
  from: T;
68
100
  hash: Hex;
101
+ waitOptions?: WaitForUserOperationOptions["waitOptions"];
69
102
  }): Promise<TransferResult>;
70
103
  }
71
104
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../actions/evm/transfer/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,kBAAkB,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAExF,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,uBAAuB,EACvB,6BAA6B,EAC9B,MAAM,kCAAkC,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,6BAA6B,GAAG,uBAAuB,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,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Ae,CACb,IAAI,EAAE;QACJ,SAAS,EAAE,oBAAoB,CAAC;QAChC,IAAI,EAAE,CAAC,CAAC;QACR,EAAE,EAAE,OAAO,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;QAChC,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;KACrC,GAAG,CAAC,CAAC,SAAS,eAAe,GAAG;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,GACnE,OAAO,CAAC,GAAG,CAAC,CAAC;IAEhB;;;;;;;;;;OAUG;IACH,aAAa,CAAC,IAAI,EAAE;QAClB,SAAS,EAAE,oBAAoB,CAAC;QAChC,YAAY,EAAE,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC7C,IAAI,EAAE,CAAC,CAAC;QACR,IAAI,EAAE,GAAG,CAAC;QACV,WAAW,CAAC,EAAE,2BAA2B,CAAC,aAAa,CAAC,CAAC;KAC1D,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAC7B"}
@@ -1,10 +1,12 @@
1
- import { SendUserOperationReturnType, SendUserOperationOptions } from "./sendUserOperation.js";
2
- import type { ListTokenBalancesResult, ListTokenBalancesOptions } from "./listTokenBalances.js";
1
+ import { SendUserOperationOptions, SendUserOperationReturnType } from "./sendUserOperation.js";
2
+ import { GetUserOperationOptions, UserOperation } from "../../client/evm/evm.types.js";
3
+ import { EvmAccount, EvmSmartAccount } from "../../openapi-client/index.js";
4
+ import type { ListTokenBalancesOptions, ListTokenBalancesResult } from "./listTokenBalances.js";
3
5
  import type { RequestFaucetOptions, RequestFaucetResult } from "./requestFaucet.js";
4
6
  import type { SendTransactionOptions, TransactionResult } from "./sendTransaction.js";
5
- import type { TransferOptions, TransferResult } from "./transfer/types.js";
7
+ import type { AccountTransferOptions, SmartAccountTransferOptions, TransferResult } from "./transfer/types.js";
6
8
  import type { WaitForUserOperationOptions, WaitForUserOperationReturnType } from "./waitForUserOperation.js";
7
- export type Actions = {
9
+ type Actions<T extends EvmAccount | EvmSmartAccount> = {
8
10
  /**
9
11
  * Transfer an amount of a token from an account to another account.
10
12
  *
@@ -88,7 +90,7 @@ export type Actions = {
88
90
  * });
89
91
  * ```
90
92
  */
91
- transfer: (options: TransferOptions) => Promise<TransferResult>;
93
+ transfer: (options: T extends EvmSmartAccount ? SmartAccountTransferOptions : AccountTransferOptions) => Promise<TransferResult>;
92
94
  /**
93
95
  * List the token balances of an account.
94
96
  *
@@ -124,6 +126,8 @@ export type Actions = {
124
126
  * ```
125
127
  */
126
128
  requestFaucet: (options: Omit<RequestFaucetOptions, "address">) => Promise<RequestFaucetResult>;
129
+ };
130
+ export type AccountActions = Actions<EvmAccount> & {
127
131
  /**
128
132
  * Signs an EVM transaction and sends it to the specified network using the Coinbase API.
129
133
  * This method handles nonce management and gas estimation automatically.
@@ -169,6 +173,8 @@ export type Actions = {
169
173
  * ```
170
174
  */
171
175
  sendTransaction: (options: Omit<SendTransactionOptions, "address">) => Promise<TransactionResult>;
176
+ };
177
+ export type SmartAccountActions = Actions<EvmSmartAccount> & {
172
178
  /**
173
179
  * Sends a user operation.
174
180
  *
@@ -226,5 +232,22 @@ export type Actions = {
226
232
  * ```
227
233
  */
228
234
  waitForUserOperation: (options: Omit<WaitForUserOperationOptions, "smartAccountAddress">) => Promise<WaitForUserOperationReturnType>;
235
+ /**
236
+ * Gets a user operation by its hash.
237
+ *
238
+ * @param {GetUserOperationOptions} options - Parameters for getting the user operation.
239
+ * @param {string} options.userOpHash - The user operation hash.
240
+ *
241
+ * @returns A promise that resolves to the user operation.
242
+ *
243
+ * @example
244
+ * ```ts
245
+ * const userOp = await smartAccount.getUserOperation({
246
+ * userOpHash: "0x1234567890123456789012345678901234567890",
247
+ * });
248
+ * ```
249
+ */
250
+ getUserOperation: (options: Omit<GetUserOperationOptions, "smartAccount">) => Promise<UserOperation>;
229
251
  };
252
+ export {};
230
253
  //# s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client/solana/solana.types.js";
2
+ import { CdpOpenApiClientType } from "../../openapi-client/index.js";
3
+ /**
4
+ * Requests funds from a Solana faucet.
5
+ *
6
+ * @param apiClient - The API client.
7
+ * @param {RequestFaucetOptions} options - Parameters for requesting funds from the Solana faucet.
8
+ * @param {string} options.address - The address to request funds for.
9
+ * @param {string} options.token - The token to request funds for.
10
+ * @param {string} [options.idempotencyKey] - An idempotency key.
11
+ *
12
+ * @returns A promise that resolves to the transaction signature.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const signature = await requestFaucet(cdp.solana, {
17
+ * address: "1234567890123456789012345678901234567890",
18
+ * token: "sol",
19
+ * });
20
+ * ```
21
+ */
22
+ export declare function requestFaucet(apiClient: CdpOpenApiClientType, options: RequestFaucetOptions): Promise<SignatureResult>;
23
+ //# sourceMappingURL=requestFaucet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requestFaucet.d.ts","sourceRoot":"","sources":["../../../actions/solana/requestFaucet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,aAAa,CACjC,SAAS,EAAE,oBAAoB,EAC/B,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,eAAe,CAAC,CAS1B"}
@@ -0,0 +1,23 @@
1
+ import { SignMessageOptions, SignatureResult } from "../../client/solana/solana.types.js";
2
+ import { CdpOpenApiClientType } from "../../openapi-client/index.js";
3
+ /**
4
+ * Sign a message.
5
+ *
6
+ * @param apiClient - The API client.
7
+ * @param {SignMessageOptions} options - Parameters for signing the message.
8
+ * @param {string} options.address - The address to sign the message for.
9
+ * @param {string} options.message - The message to sign.
10
+ * @param {string} [options.idempotencyKey] - An idempotency key.
11
+ *
12
+ * @returns A promise that resolves to the transaction signature.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const signature = await signMessage(cdp.solana, {
17
+ * address: "1234567890123456789012345678901234567890",
18
+ * message: "Hello, world!",
19
+ * });
20
+ * ```
21
+ */
22
+ export declare function signMessage(apiClient: CdpOpenApiClientType, options: SignMessageOptions): Promise<SignatureResult>;
23
+ //# sourceMappingURL=signMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signMessage.d.ts","sourceRoot":"","sources":["../../../actions/solana/signMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,WAAW,CAC/B,SAAS,EAAE,oBAAoB,EAC/B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,eAAe,CAAC,CAU1B"}
@@ -0,0 +1,38 @@
1
+ import { SignTransactionOptions, SignatureResult } from "../../client/solana/solana.types.js";
2
+ import { CdpOpenApiClientType } from "../../openapi-client/index.js";
3
+ /**
4
+ * Signs a transaction.
5
+ *
6
+ * @param apiClient - The API client.
7
+ * @param {SignTransactionOptions} options - Parameters for signing the transaction.
8
+ * @param {string} options.address - The address to sign the transaction for.
9
+ * @param {string} options.transaction - The transaction to sign.
10
+ * @param {string} [options.idempotencyKey] - An idempotency key.
11
+ *
12
+ * @returns A promise that resolves to the signature.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * // Create a Solana account
17
+ * const account = await cdp.solana.createAccount();
18
+ *
19
+ * // Add your transaction instructions here
20
+ * const transaction = new Transaction()
21
+ *
22
+ * // Make sure to set requireAllSignatures to false, since signing will be done through the API
23
+ * const serializedTransaction = transaction.serialize({
24
+ * requireAllSignatures: false,
25
+ * });
26
+ *
27
+ * // Base64 encode the serialized transaction
28
+ * const transaction = Buffer.from(serializedTransaction).toString("base64");
29
+ *
30
+ * // When you want to sign a transaction, you can do so by address and base64 encoded transaction
31
+ * const signature = await signTransaction(cdp.solana, {
32
+ * address: account.address,
33
+ * transaction,
34
+ * });
35
+ * ```
36
+ */
37
+ export declare function signTransaction(apiClient: CdpOpenApiClientType, options: SignTransactionOptions): Promise<SignatureResult>;
38
+ //# sourceMappingURL=signTransaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signTransaction.d.ts","sourceRoot":"","sources":["../../../actions/solana/signTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,eAAe,CACnC,SAAS,EAAE,oBAAoB,EAC/B,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,eAAe,CAAC,CAY1B"}
@@ -0,0 +1,80 @@
1
+ import { RequestFaucetOptions, SignatureResult, SignMessageOptions, SignTransactionOptions } from "../../client/solana/solana.types.js";
2
+ export type AccountActions = {
3
+ /**
4
+ * Requests funds from a Solana faucet.
5
+ *
6
+ * @param {RequestFaucetOptions} options - Parameters for requesting funds from the Solana faucet.
7
+ * @param {string} options.token - The token to request funds for.
8
+ * @param {string} [options.idempotencyKey] - An idempotency key.
9
+ *
10
+ * @returns A promise that resolves to the transaction hash.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * // Create a Solana account
15
+ * const account = await cdp.solana.createAccount();
16
+ *
17
+ * // Request funds from the Solana faucet
18
+ * const result = await account.requestFaucet({
19
+ * token: "sol",
20
+ * });
21
+ * ```
22
+ */
23
+ requestFaucet: (options: Omit<RequestFaucetOptions, "address">) => Promise<SignatureResult>;
24
+ /**
25
+ * Signs a message.
26
+ *
27
+ * @param {SignMessageOptions} options - Parameters for signing the message.
28
+ * @param {string} options.address - The address to sign the message for.
29
+ * @param {string} options.message - The message to sign.
30
+ * @param {string} [options.idempotencyKey] - An idempotency key.
31
+ *
32
+ * @returns A promise that resolves to the signature.
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * // Create a Solana account
37
+ * const account = await cdp.solana.createAccount();
38
+ *
39
+ * // Sign a message
40
+ * const { signature } = await account.signMessage({
41
+ * message: "Hello, world!",
42
+ * });
43
+ * ```
44
+ */
45
+ signMessage: (options: Omit<SignMessageOptions, "address">) => Promise<SignatureResult>;
46
+ /**
47
+ * Signs a transaction.
48
+ *
49
+ * @param {SignTransactionOptions} options - Parameters for signing the transaction.
50
+ * @param {string} options.address - The address to sign the transaction for.
51
+ * @param {string} options.transaction - The transaction to sign.
52
+ * @param {string} [options.idempotencyKey] - An idempotency key.
53
+ *
54
+ * @returns A promise that resolves to the signature.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * // Create a Solana account
59
+ * const account = await cdp.solana.createAccount();
60
+ *
61
+ * // Add your transaction instructions here
62
+ * const transaction = new Transaction()
63
+ *
64
+ * // Make sure to set requireAllSignatures to false, since signing will be done through the API
65
+ * const serializedTransaction = transaction.serialize({
66
+ * requireAllSignatures: false,
67
+ * });
68
+ *
69
+ * // Base64 encode the serialized transaction
70
+ * const transaction = Buffer.from(serializedTransaction).toString("base64");
71
+ *
72
+ * // When you want to sign a transaction, you can do so by address and base64 encoded transaction
73
+ * const { signature } = await account.signTransaction({
74
+ * transaction,
75
+ * });
76
+ * ```
77
+ */
78
+ signTransaction: (options: Omit<SignTransactionOptions, "address">) => Promise<SignatureResult>;
79
+ };
80
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../actions/solana/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,qCAAqC,CAAC;AAE7C,MAAM,MAAM,cAAc,GAAG;IAC3B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,aAAa,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAAE,SAAS,CAAC,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IAE5F;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,WAAW,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IAExF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,eAAe,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE,SAAS,CAAC,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;CACjG,CAAC"}
@@ -19,8 +19,12 @@ type ErrorEventData = {
19
19
  */
20
20
  name: "error";
21
21
  };
22
- type EventData = ErrorEventData & {
23
- apiKeyId: string;
22
+ type EventData = ErrorEventData;
23
+ export declare const Analytics: {
24
+ identifier: string;
25
+ wrapClassWithErrorTracking: typeof wrapClassWithErrorTracking;
26
+ wrapObjectMethodsWithErrorTracking: typeof wrapObjectMethodsWithErrorTracking;
27
+ sendEvent: typeof sendEvent;
24
28
  };
25
29
  /**
26
30
  * Sends an analytics event to the default endpoint
@@ -28,13 +32,18 @@ type EventData = ErrorEventData & {
28
32
  * @param event - The event data containing event-specific fields
29
33
  * @returns Promise that resolves when the event is sent
30
34
  */
31
- export declare function sendEvent(event: EventData): Promise<void>;
35
+ declare function sendEvent(event: EventData): Promise<void>;
32
36
  /**
33
37
  * Wraps all methods of a class with error tracking.
34
38
  *
35
39
  * @param ClassToWrap - The class whose prototype methods should be wrapped.
36
- * @param apiKeyId - The API key ID to use for the error tracking.
37
40
  */
38
- export declare function wrapClassWithErrorTracking(ClassToWrap: any, apiKeyId: string): void;
41
+ declare function wrapClassWithErrorTracking(ClassToWrap: any): void;
42
+ /**
43
+ * Wraps all methods of an object with error tracking.
44
+ *
45
+ * @param object - The object whose methods should be wrapped.
46
+ */
47
+ declare function wrapObjectMethodsWithErrorTracking(object: any): void;
39
48
  export {};
40
49
  //# sourceMappingURL=analytics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../analytics.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,KAAK,cAAc,GAAG;IACpB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,KAAK,SAAS,GAAG,cAAc,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAKF;;;;;GAKG;AACH,wBAAsB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAuC/D;AAED;;;;;GAKG;AAEH,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CA+BnF"}
1
+ {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../analytics.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,KAAK,cAAc,GAAG;IACpB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,KAAK,SAAS,GAAG,cAAc,CAAC;AAKhC,eAAO,MAAM,SAAS;;;;;CAKrB,CAAC;AAEF;;;;;GAKG;AACH,iBAAe,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CA2CxD;AAED;;;;GAIG;AAEH,iBAAS,0BAA0B,CAAC,WAAW,EAAE,GAAG,GAAG,IAAI,CAkC1D;AAED;;;;GAIG;AAEH,iBAAS,kCAAkC,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAkC7D"}
@@ -1,4 +1,5 @@
1
1
  import { EvmClient } from "./evm/evm.js";
2
+ import { PoliciesClient } from "./policies/policies.js";
2
3
  import { SolanaClient } from "./solana/solana.js";
3
4
  interface CdpClientOptions {
4
5
  /** The API key ID. */
@@ -20,6 +21,8 @@ export declare class CdpClient {
20
21
  evm: EvmClient;
21
22
  /** Namespace containing all Solana methods. */
22
23
  solana: SolanaClient;
24
+ /** Namespace containing all Policies methods. */
25
+ policies: PoliciesClient;
23
26
  /**
24
27
  * The CdpClient is the main class for interacting with the CDP API.
25
28
  *
@@ -1 +1 @@
1
- {"version":3,"file":"cdp.d.ts","sourceRoot":"","sources":["../../client/cdp.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,UAAU,gBAAgB;IACxB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0BAA0B;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yBAAyB;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mCAAmC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,qBAAa,SAAS;IACpB,4CAA4C;IACrC,GAAG,EAAE,SAAS,CAAC;IAEtB,+CAA+C;IACxC,MAAM,EAAE,YAAY,CAAC;IAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;gBACS,OAAO,GAAE,gBAAqB;CAuD3C"}
1
+ {"version":3,"file":"cdp.d.ts","sourceRoot":"","sources":["../../client/cdp.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,UAAU,gBAAgB;IACxB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0BAA0B;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yBAAyB;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mCAAmC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,qBAAa,SAAS;IACpB,4CAA4C;IACrC,GAAG,EAAE,SAAS,CAAC;IAEtB,+CAA+C;IACxC,MAAM,EAAE,YAAY,CAAC;IAE5B,iDAAiD;IAC1C,QAAQ,EAAE,cAAc,CAAC;IAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;gBACS,OAAO,GAAE,gBAAqB;CA0D3C"}
@@ -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,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AAe,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"}
@@ -1,23 +1,24 @@
1
- import type { EvmAccount as Account, EvmServerAccount as ServerAccount, EvmSmartAccount as SmartAccount } from "../../accounts/types.js";
1
+ import type { EvmAccount as Account, EvmServerAccount as ServerAccount, EvmSmartAccount as SmartAccount } from "../../accounts/evm/types.js";
2
2
  import type { ListTokenBalancesOptions, ListTokenBalancesResult } from "../../actions/evm/listTokenBalances.js";
3
3
  import type { RequestFaucetOptions, RequestFaucetResult } from "../../actions/evm/requestFaucet.js";
4
4
  import type { TransactionResult, SendTransactionOptions } from "../../actions/evm/sendTransaction.js";
5
5
  import type { SendUserOperationOptions, SendUserOperationReturnType } from "../../actions/evm/sendUserOperation.js";
6
- import type { Actions } from "../../actions/evm/types.js";
7
- import type { EvmUserOperationNetwork, EvmUserOperationStatus, OpenApiEvmMethods } from "../../openapi-client/index.js";
6
+ import type { SmartAccountActions } from "../../actions/evm/types.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 };
@@ -132,10 +134,21 @@ export interface ListServerAccountsOptions {
132
134
  /**
133
135
  * A smart account that only contains the owner address.
134
136
  */
135
- export interface ReadonlySmartAccount extends Omit<SmartAccount, "owners" | keyof Actions> {
137
+ export interface ReadonlySmartAccount extends Omit<SmartAccount, "owners" | keyof SmartAccountActions> {
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
  */