@coinbase/cdp-sdk 1.1.2 → 1.3.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 (332) hide show
  1. package/CHANGELOG.md +91 -0
  2. package/LICENSE +21 -0
  3. package/README.md +88 -1
  4. package/{dist → _cjs}/accounts/evm/toEvmServerAccount.js +1 -0
  5. package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -0
  6. package/{dist → _cjs}/accounts/evm/toEvmSmartAccount.js +1 -0
  7. package/_cjs/accounts/evm/toEvmSmartAccount.js.map +1 -0
  8. package/{dist → _cjs}/accounts/types.js +1 -0
  9. package/_cjs/accounts/types.js.map +1 -0
  10. package/{dist → _cjs}/actions/evm/sendUserOperation.js +1 -0
  11. package/_cjs/actions/evm/sendUserOperation.js.map +1 -0
  12. package/{dist → _cjs}/actions/evm/waitForUserOperation.js +10 -9
  13. package/_cjs/actions/evm/waitForUserOperation.js.map +1 -0
  14. package/{dist → _cjs}/analytics.js +32 -12
  15. package/_cjs/analytics.js.map +1 -0
  16. package/{dist → _cjs}/auth/errors.js +1 -0
  17. package/_cjs/auth/errors.js.map +1 -0
  18. package/{dist → _cjs}/auth/hooks/axios/index.js +2 -1
  19. package/_cjs/auth/hooks/axios/index.js.map +1 -0
  20. package/{dist → _cjs}/auth/hooks/axios/withAuth.js +4 -2
  21. package/_cjs/auth/hooks/axios/withAuth.js.map +1 -0
  22. package/{dist → _cjs}/auth/index.js +4 -3
  23. package/_cjs/auth/index.js.map +1 -0
  24. package/{dist → _cjs}/auth/utils/http.js +6 -5
  25. package/_cjs/auth/utils/http.js.map +1 -0
  26. package/{dist → _cjs}/auth/utils/index.js +3 -2
  27. package/_cjs/auth/utils/index.js.map +1 -0
  28. package/{dist → _cjs}/auth/utils/jwt.js +4 -3
  29. package/_cjs/auth/utils/jwt.js.map +1 -0
  30. package/_cjs/client/cdp.js +101 -0
  31. package/_cjs/client/cdp.js.map +1 -0
  32. package/_cjs/client/evm/evm.js +641 -0
  33. package/_cjs/client/evm/evm.js.map +1 -0
  34. package/{dist → _cjs}/client/evm/evm.types.js +1 -0
  35. package/_cjs/client/evm/evm.types.js.map +1 -0
  36. package/{dist → _cjs}/client/solana/index.js +3 -2
  37. package/_cjs/client/solana/index.js.map +1 -0
  38. package/{dist → _cjs}/client/solana/solana.js +9 -8
  39. package/_cjs/client/solana/solana.js.map +1 -0
  40. package/{dist → _cjs}/client/solana/solana.types.js +1 -0
  41. package/_cjs/client/solana/solana.types.js.map +1 -0
  42. package/{dist → _cjs}/constants.js +1 -0
  43. package/_cjs/constants.js.map +1 -0
  44. package/{dist → _cjs}/errors.js +1 -0
  45. package/_cjs/errors.js.map +1 -0
  46. package/{dist → _cjs}/index.js +4 -3
  47. package/_cjs/index.js.map +1 -0
  48. package/_cjs/openapi-client/cdpApiClient.js +116 -0
  49. package/_cjs/openapi-client/cdpApiClient.js.map +1 -0
  50. package/{dist → _cjs}/openapi-client/errors.js +44 -3
  51. package/_cjs/openapi-client/errors.js.map +1 -0
  52. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +66 -0
  53. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -0
  54. package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.js +125 -0
  55. package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.js.map +1 -0
  56. package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.msw.js +160 -0
  57. package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.msw.js.map +1 -0
  58. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +70 -0
  59. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -0
  60. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +188 -0
  61. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js.map +1 -0
  62. package/_cjs/openapi-client/generated/evm-token-balances/evm-token-balances.js +15 -0
  63. package/_cjs/openapi-client/generated/evm-token-balances/evm-token-balances.js.map +1 -0
  64. package/_cjs/openapi-client/generated/evm-token-balances/evm-token-balances.msw.js +45 -0
  65. package/_cjs/openapi-client/generated/evm-token-balances/evm-token-balances.msw.js.map +1 -0
  66. package/{dist → _cjs}/openapi-client/generated/faucets/faucets.js +20 -14
  67. package/_cjs/openapi-client/generated/faucets/faucets.js.map +1 -0
  68. package/{dist → _cjs}/openapi-client/generated/faucets/faucets.msw.js +16 -12
  69. package/_cjs/openapi-client/generated/faucets/faucets.msw.js.map +1 -0
  70. package/{dist → _cjs}/openapi-client/generated/index.msw.js +6 -4
  71. package/_cjs/openapi-client/generated/index.msw.js.map +1 -0
  72. package/{dist → _cjs}/openapi-client/generated/solana-accounts/solana-accounts.js +38 -35
  73. package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.js.map +1 -0
  74. package/{dist → _cjs}/openapi-client/generated/solana-accounts/solana-accounts.msw.js +68 -35
  75. package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.msw.js.map +1 -0
  76. package/{dist → _cjs}/openapi-client/index.js +16 -11
  77. package/_cjs/openapi-client/index.js.map +1 -0
  78. package/_cjs/package.json +1 -0
  79. package/{dist → _cjs}/types/calls.js +1 -0
  80. package/_cjs/types/calls.js.map +1 -0
  81. package/{dist → _cjs}/types/contract.js +1 -0
  82. package/_cjs/types/contract.js.map +1 -0
  83. package/{dist → _cjs}/types/misc.js +1 -0
  84. package/_cjs/types/misc.js.map +1 -0
  85. package/{dist → _cjs}/types/multicall.js +1 -0
  86. package/_cjs/types/multicall.js.map +1 -0
  87. package/{dist → _cjs}/types/utils.js +1 -0
  88. package/_cjs/types/utils.js.map +1 -0
  89. package/{dist → _cjs}/utils/wait.js +3 -2
  90. package/_cjs/utils/wait.js.map +1 -0
  91. package/_cjs/version.js +5 -0
  92. package/_cjs/version.js.map +1 -0
  93. package/_esm/accounts/evm/toEvmServerAccount.js +40 -0
  94. package/_esm/accounts/evm/toEvmServerAccount.js.map +1 -0
  95. package/_esm/accounts/evm/toEvmSmartAccount.js +22 -0
  96. package/_esm/accounts/evm/toEvmSmartAccount.js.map +1 -0
  97. package/_esm/accounts/types.js +2 -0
  98. package/_esm/accounts/types.js.map +1 -0
  99. package/_esm/actions/evm/sendUserOperation.js +85 -0
  100. package/_esm/actions/evm/sendUserOperation.js.map +1 -0
  101. package/_esm/actions/evm/waitForUserOperation.js +58 -0
  102. package/_esm/actions/evm/waitForUserOperation.js.map +1 -0
  103. package/_esm/analytics.js +101 -0
  104. package/_esm/analytics.js.map +1 -0
  105. package/_esm/auth/errors.js +57 -0
  106. package/_esm/auth/errors.js.map +1 -0
  107. package/_esm/auth/hooks/axios/index.js +2 -0
  108. package/_esm/auth/hooks/axios/index.js.map +1 -0
  109. package/_esm/auth/hooks/axios/withAuth.js +72 -0
  110. package/_esm/auth/hooks/axios/withAuth.js.map +1 -0
  111. package/_esm/auth/index.js +5 -0
  112. package/_esm/auth/index.js.map +1 -0
  113. package/_esm/auth/utils/http.js +70 -0
  114. package/_esm/auth/utils/http.js.map +1 -0
  115. package/_esm/auth/utils/index.js +3 -0
  116. package/_esm/auth/utils/index.js.map +1 -0
  117. package/_esm/auth/utils/jwt.js +199 -0
  118. package/_esm/auth/utils/jwt.js.map +1 -0
  119. package/{dist → _esm}/client/cdp.js +16 -13
  120. package/_esm/client/cdp.js.map +1 -0
  121. package/{dist → _esm}/client/evm/evm.js +146 -30
  122. package/_esm/client/evm/evm.js.map +1 -0
  123. package/_esm/client/evm/evm.types.js +2 -0
  124. package/_esm/client/evm/evm.types.js.map +1 -0
  125. package/_esm/client/solana/index.js +2 -0
  126. package/_esm/client/solana/index.js.map +1 -0
  127. package/_esm/client/solana/solana.js +204 -0
  128. package/_esm/client/solana/solana.js.map +1 -0
  129. package/_esm/client/solana/solana.types.js +2 -0
  130. package/_esm/client/solana/solana.types.js.map +1 -0
  131. package/_esm/constants.js +5 -0
  132. package/_esm/constants.js.map +1 -0
  133. package/_esm/errors.js +18 -0
  134. package/_esm/errors.js.map +1 -0
  135. package/_esm/index.js +3 -0
  136. package/_esm/index.js.map +1 -0
  137. package/_esm/openapi-client/cdpApiClient.js +108 -0
  138. package/_esm/openapi-client/cdpApiClient.js.map +1 -0
  139. package/_esm/openapi-client/errors.js +104 -0
  140. package/_esm/openapi-client/errors.js.map +1 -0
  141. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +63 -0
  142. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -0
  143. package/_esm/openapi-client/generated/evm-accounts/evm-accounts.js +114 -0
  144. package/_esm/openapi-client/generated/evm-accounts/evm-accounts.js.map +1 -0
  145. package/_esm/openapi-client/generated/evm-accounts/evm-accounts.msw.js +140 -0
  146. package/_esm/openapi-client/generated/evm-accounts/evm-accounts.msw.js.map +1 -0
  147. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +61 -0
  148. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -0
  149. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +172 -0
  150. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js.map +1 -0
  151. package/_esm/openapi-client/generated/evm-token-balances/evm-token-balances.js +11 -0
  152. package/_esm/openapi-client/generated/evm-token-balances/evm-token-balances.js.map +1 -0
  153. package/_esm/openapi-client/generated/evm-token-balances/evm-token-balances.msw.js +39 -0
  154. package/_esm/openapi-client/generated/evm-token-balances/evm-token-balances.msw.js.map +1 -0
  155. package/_esm/openapi-client/generated/faucets/faucets.js +52 -0
  156. package/_esm/openapi-client/generated/faucets/faucets.js.map +1 -0
  157. package/_esm/openapi-client/generated/faucets/faucets.msw.js +39 -0
  158. package/_esm/openapi-client/generated/faucets/faucets.msw.js.map +1 -0
  159. package/_esm/openapi-client/generated/index.msw.js +6 -0
  160. package/_esm/openapi-client/generated/index.msw.js.map +1 -0
  161. package/_esm/openapi-client/generated/solana-accounts/solana-accounts.js +73 -0
  162. package/_esm/openapi-client/generated/solana-accounts/solana-accounts.js.map +1 -0
  163. package/_esm/openapi-client/generated/solana-accounts/solana-accounts.msw.js +116 -0
  164. package/_esm/openapi-client/generated/solana-accounts/solana-accounts.msw.js.map +1 -0
  165. package/_esm/openapi-client/index.js +31 -0
  166. package/_esm/openapi-client/index.js.map +1 -0
  167. package/_esm/package.json +1 -0
  168. package/_esm/types/calls.js +4 -0
  169. package/_esm/types/calls.js.map +1 -0
  170. package/_esm/types/contract.js +4 -0
  171. package/_esm/types/contract.js.map +1 -0
  172. package/_esm/types/misc.js +3 -0
  173. package/_esm/types/misc.js.map +1 -0
  174. package/_esm/types/multicall.js +2 -0
  175. package/_esm/types/multicall.js.map +1 -0
  176. package/_esm/types/utils.js +4 -0
  177. package/_esm/types/utils.js.map +1 -0
  178. package/_esm/utils/wait.js +32 -0
  179. package/_esm/utils/wait.js.map +1 -0
  180. package/_esm/version.js +2 -0
  181. package/_esm/version.js.map +1 -0
  182. package/{dist → _types}/accounts/evm/toEvmServerAccount.d.ts +3 -2
  183. package/_types/accounts/evm/toEvmServerAccount.d.ts.map +1 -0
  184. package/{dist → _types}/accounts/evm/toEvmSmartAccount.d.ts +3 -2
  185. package/_types/accounts/evm/toEvmSmartAccount.d.ts.map +1 -0
  186. package/{dist → _types}/accounts/types.d.ts +3 -2
  187. package/_types/accounts/types.d.ts.map +1 -0
  188. package/{dist → _types}/actions/evm/sendUserOperation.d.ts +5 -5
  189. package/_types/actions/evm/sendUserOperation.d.ts.map +1 -0
  190. package/{dist → _types}/actions/evm/waitForUserOperation.d.ts +4 -3
  191. package/_types/actions/evm/waitForUserOperation.d.ts.map +1 -0
  192. package/{dist → _types}/analytics.d.ts +16 -0
  193. package/_types/analytics.d.ts.map +1 -0
  194. package/{dist → _types}/auth/errors.d.ts +1 -0
  195. package/_types/auth/errors.d.ts.map +1 -0
  196. package/_types/auth/hooks/axios/index.d.ts +2 -0
  197. package/_types/auth/hooks/axios/index.d.ts.map +1 -0
  198. package/{dist → _types}/auth/hooks/axios/withAuth.d.ts +1 -0
  199. package/_types/auth/hooks/axios/withAuth.d.ts.map +1 -0
  200. package/_types/auth/index.d.ts +5 -0
  201. package/_types/auth/index.d.ts.map +1 -0
  202. package/{dist → _types}/auth/utils/http.d.ts +1 -0
  203. package/_types/auth/utils/http.d.ts.map +1 -0
  204. package/_types/auth/utils/index.d.ts +3 -0
  205. package/_types/auth/utils/index.d.ts.map +1 -0
  206. package/{dist → _types}/auth/utils/jwt.d.ts +1 -0
  207. package/_types/auth/utils/jwt.d.ts.map +1 -0
  208. package/{dist → _types}/client/cdp.d.ts +3 -2
  209. package/_types/client/cdp.d.ts.map +1 -0
  210. package/{dist → _types}/client/evm/evm.d.ts +86 -3
  211. package/_types/client/evm/evm.d.ts.map +1 -0
  212. package/{dist → _types}/client/evm/evm.types.d.ts +104 -7
  213. package/_types/client/evm/evm.types.d.ts.map +1 -0
  214. package/_types/client/solana/index.d.ts +2 -0
  215. package/_types/client/solana/index.d.ts.map +1 -0
  216. package/{dist → _types}/client/solana/solana.d.ts +2 -1
  217. package/_types/client/solana/solana.d.ts.map +1 -0
  218. package/{dist → _types}/client/solana/solana.types.d.ts +2 -1
  219. package/_types/client/solana/solana.types.d.ts.map +1 -0
  220. package/{dist → _types}/constants.d.ts +1 -0
  221. package/_types/constants.d.ts.map +1 -0
  222. package/{dist → _types}/errors.d.ts +1 -0
  223. package/_types/errors.d.ts.map +1 -0
  224. package/_types/index.d.ts +4 -0
  225. package/_types/index.d.ts.map +1 -0
  226. package/{dist → _types}/openapi-client/cdpApiClient.d.ts +1 -0
  227. package/_types/openapi-client/cdpApiClient.d.ts.map +1 -0
  228. package/{dist → _types}/openapi-client/errors.d.ts +30 -2
  229. package/_types/openapi-client/errors.d.ts.map +1 -0
  230. package/{dist → _types}/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +100 -14
  231. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -0
  232. package/_types/openapi-client/generated/evm-accounts/evm-accounts.d.ts +91 -0
  233. package/_types/openapi-client/generated/evm-accounts/evm-accounts.d.ts.map +1 -0
  234. package/{dist → _types}/openapi-client/generated/evm-accounts/evm-accounts.msw.d.ts +5 -2
  235. package/_types/openapi-client/generated/evm-accounts/evm-accounts.msw.d.ts.map +1 -0
  236. package/{dist → _types}/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts +22 -20
  237. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts.map +1 -0
  238. package/{dist → _types}/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.d.ts +3 -2
  239. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.d.ts.map +1 -0
  240. package/_types/openapi-client/generated/evm-token-balances/evm-token-balances.d.ts +20 -0
  241. package/_types/openapi-client/generated/evm-token-balances/evm-token-balances.d.ts.map +1 -0
  242. package/_types/openapi-client/generated/evm-token-balances/evm-token-balances.msw.d.ts +6 -0
  243. package/_types/openapi-client/generated/evm-token-balances/evm-token-balances.msw.d.ts.map +1 -0
  244. package/{dist → _types}/openapi-client/generated/faucets/faucets.d.ts +11 -9
  245. package/_types/openapi-client/generated/faucets/faucets.d.ts.map +1 -0
  246. package/{dist → _types}/openapi-client/generated/faucets/faucets.msw.d.ts +3 -2
  247. package/_types/openapi-client/generated/faucets/faucets.msw.d.ts.map +1 -0
  248. package/_types/openapi-client/generated/index.msw.d.ts +6 -0
  249. package/_types/openapi-client/generated/index.msw.d.ts.map +1 -0
  250. package/{dist → _types}/openapi-client/generated/solana-accounts/solana-accounts.d.ts +21 -20
  251. package/_types/openapi-client/generated/solana-accounts/solana-accounts.d.ts.map +1 -0
  252. package/{dist → _types}/openapi-client/generated/solana-accounts/solana-accounts.msw.d.ts +3 -2
  253. package/_types/openapi-client/generated/solana-accounts/solana-accounts.msw.d.ts.map +1 -0
  254. package/_types/openapi-client/index.d.ts +61 -0
  255. package/_types/openapi-client/index.d.ts.map +1 -0
  256. package/{dist → _types}/types/calls.d.ts +4 -3
  257. package/_types/types/calls.d.ts.map +1 -0
  258. package/{dist → _types}/types/contract.d.ts +3 -2
  259. package/_types/types/contract.d.ts.map +1 -0
  260. package/_types/types/misc.d.ts +41 -0
  261. package/_types/types/misc.d.ts.map +1 -0
  262. package/{dist → _types}/types/multicall.d.ts +2 -1
  263. package/_types/types/multicall.d.ts.map +1 -0
  264. package/{dist → _types}/types/utils.d.ts +1 -0
  265. package/_types/types/utils.d.ts.map +1 -0
  266. package/{dist → _types}/utils/wait.d.ts +1 -0
  267. package/_types/utils/wait.d.ts.map +1 -0
  268. package/_types/version.d.ts +2 -0
  269. package/_types/version.d.ts.map +1 -0
  270. package/accounts/evm/toEvmServerAccount.ts +60 -0
  271. package/accounts/evm/toEvmSmartAccount.ts +37 -0
  272. package/accounts/types.ts +53 -0
  273. package/actions/evm/sendUserOperation.ts +163 -0
  274. package/actions/evm/waitForUserOperation.ts +115 -0
  275. package/analytics.ts +142 -0
  276. package/auth/README.md +145 -0
  277. package/auth/errors.ts +59 -0
  278. package/auth/hooks/axios/index.ts +1 -0
  279. package/auth/hooks/axios/withAuth.ts +121 -0
  280. package/auth/index.ts +5 -0
  281. package/auth/utils/http.ts +146 -0
  282. package/auth/utils/index.ts +2 -0
  283. package/auth/utils/jwt.ts +324 -0
  284. package/client/cdp.ts +116 -0
  285. package/client/evm/evm.ts +739 -0
  286. package/client/evm/evm.types.ts +408 -0
  287. package/client/solana/index.ts +1 -0
  288. package/client/solana/solana.ts +237 -0
  289. package/client/solana/solana.types.ts +114 -0
  290. package/constants.ts +4 -0
  291. package/errors.ts +17 -0
  292. package/index.ts +4 -0
  293. package/openapi-client/cdpApiClient.ts +221 -0
  294. package/openapi-client/errors.ts +132 -0
  295. package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +512 -0
  296. package/openapi-client/generated/evm-accounts/evm-accounts.msw.ts +271 -0
  297. package/openapi-client/generated/evm-accounts/evm-accounts.ts +194 -0
  298. package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.ts +283 -0
  299. package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.ts +132 -0
  300. package/openapi-client/generated/evm-token-balances/evm-token-balances.msw.ts +57 -0
  301. package/openapi-client/generated/evm-token-balances/evm-token-balances.ts +37 -0
  302. package/openapi-client/generated/faucets/faucets.msw.ts +76 -0
  303. package/openapi-client/generated/faucets/faucets.ts +84 -0
  304. package/openapi-client/generated/index.msw.ts +5 -0
  305. package/openapi-client/generated/solana-accounts/solana-accounts.msw.ts +219 -0
  306. package/openapi-client/generated/solana-accounts/solana-accounts.ts +143 -0
  307. package/openapi-client/index.ts +36 -0
  308. package/package.json +31 -66
  309. package/types/calls.ts +40 -0
  310. package/types/contract.ts +126 -0
  311. package/types/misc.ts +44 -0
  312. package/types/multicall.ts +29 -0
  313. package/types/utils.ts +288 -0
  314. package/utils/wait.ts +52 -0
  315. package/version.ts +1 -0
  316. package/dist/auth/hooks/axios/index.d.ts +0 -1
  317. package/dist/auth/index.d.ts +0 -4
  318. package/dist/auth/utils/index.d.ts +0 -2
  319. package/dist/client/evm/index.d.ts +0 -1
  320. package/dist/client/evm/index.js +0 -5
  321. package/dist/client/solana/index.d.ts +0 -1
  322. package/dist/index.d.ts +0 -3
  323. package/dist/openapi-client/cdpApiClient.js +0 -146
  324. package/dist/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +0 -54
  325. package/dist/openapi-client/generated/evm-accounts/evm-accounts.d.ts +0 -62
  326. package/dist/openapi-client/generated/evm-accounts/evm-accounts.js +0 -85
  327. package/dist/openapi-client/generated/evm-accounts/evm-accounts.msw.js +0 -113
  328. package/dist/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +0 -66
  329. package/dist/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +0 -99
  330. package/dist/openapi-client/generated/index.msw.d.ts +0 -4
  331. package/dist/openapi-client/index.d.ts +0 -55
  332. package/dist/types/misc.d.ts +0 -3
@@ -0,0 +1,199 @@
1
+ import * as crypto from "crypto";
2
+ import { createPrivateKey } from "crypto";
3
+ import { SignJWT, importPKCS8, importJWK } from "jose";
4
+ import { InvalidWalletSecretFormatError, UndefinedWalletSecretError } from "../errors.js";
5
+ /**
6
+ * Generates a JWT (also known as a Bearer token) for authenticating with Coinbase's REST APIs.
7
+ * Supports both EC (ES256) and Ed25519 (EdDSA) keys.
8
+ *
9
+ * @param options - The configuration options for generating the JWT
10
+ * @returns The generated JWT (Bearer token) string
11
+ * @throws {Error} If required parameters are missing, invalid, or if JWT signing fails
12
+ */
13
+ export async function generateJwt(options) {
14
+ // Validate required parameters
15
+ if (!options.apiKeyId) {
16
+ throw new Error("Key name is required");
17
+ }
18
+ if (!options.apiKeySecret) {
19
+ throw new Error("Private key is required");
20
+ }
21
+ if (!options.requestMethod || !options.requestHost || !options.requestPath) {
22
+ throw new Error("Request details (method, host, path) are required");
23
+ }
24
+ const now = Math.floor(Date.now() / 1000);
25
+ const expiresIn = options.expiresIn || 120; // Default to 120 seconds if not specified
26
+ const uri = `${options.requestMethod} ${options.requestHost}${options.requestPath}`;
27
+ // Prepare the JWT payload
28
+ const claims = {
29
+ sub: options.apiKeyId,
30
+ iss: "cdp",
31
+ aud: ["cdp_service"],
32
+ uris: [uri],
33
+ };
34
+ // Generate random nonce for the header
35
+ const randomNonce = nonce();
36
+ // Determine if we're using EC or Edwards key based on the key format
37
+ if (isValidECKey(options.apiKeySecret)) {
38
+ return await buildECJWT(options.apiKeySecret, options.apiKeyId, claims, now, expiresIn, randomNonce);
39
+ }
40
+ else if (isValidEd25519Key(options.apiKeySecret)) {
41
+ return await buildEdwardsJWT(options.apiKeySecret, options.apiKeyId, claims, now, expiresIn, randomNonce);
42
+ }
43
+ else {
44
+ throw new Error("Invalid key format - must be either PEM EC key or base64 Ed25519 key");
45
+ }
46
+ }
47
+ /**
48
+ * Generates a wallet authentication JWT for the given API endpoint URL.
49
+ * Used for authenticating with specific endpoints that require wallet authentication.
50
+ *
51
+ * @param options - The configuration options for generating the JWT
52
+ * @returns The generated JWT (Bearer token) string
53
+ * @throws {UndefinedWalletSecretError} If the Wallet Secret is not defined.
54
+ * @throws {InvalidWalletSecretFormatError} If the private key is not in the correct format or signing fails.
55
+ */
56
+ export async function generateWalletJwt(options) {
57
+ if (!options.walletSecret) {
58
+ throw new UndefinedWalletSecretError("Wallet Secret is not defined");
59
+ }
60
+ const uri = `${options.requestMethod} ${options.requestHost}${options.requestPath}`;
61
+ const now = Math.floor(Date.now() / 1000);
62
+ const claims = {
63
+ uris: [uri],
64
+ };
65
+ if (Object.keys(options.requestData).length > 0) {
66
+ claims.req = options.requestData;
67
+ }
68
+ try {
69
+ const ecKey = createPrivateKey({
70
+ key: options.walletSecret,
71
+ format: "der",
72
+ type: "pkcs8",
73
+ encoding: "base64",
74
+ });
75
+ return await new SignJWT(claims)
76
+ .setProtectedHeader({ alg: "ES256", typ: "JWT" })
77
+ .setIssuedAt(now)
78
+ .setNotBefore(now)
79
+ .setJti(nonce())
80
+ .sign(ecKey);
81
+ }
82
+ catch (error) {
83
+ throw new InvalidWalletSecretFormatError("Could not create the EC key: " + error);
84
+ }
85
+ }
86
+ /**
87
+ * Determines if a string could be a valid Ed25519 key
88
+ *
89
+ * @param str - The string to test
90
+ * @returns True if the string could be a valid Ed25519 key, false otherwise
91
+ */
92
+ function isValidEd25519Key(str) {
93
+ try {
94
+ const decoded = Buffer.from(str, "base64");
95
+ return decoded.length === 64;
96
+ }
97
+ catch {
98
+ return false;
99
+ }
100
+ }
101
+ /**
102
+ * Determines if a string is a valid EC private key in PEM format
103
+ *
104
+ * @param str - The string to test
105
+ * @returns True if the string is a valid EC private key in PEM format
106
+ */
107
+ function isValidECKey(str) {
108
+ try {
109
+ // Attempt to create a private key object - will throw if invalid
110
+ const key = createPrivateKey(str);
111
+ // Check if it's an EC key by examining its asymmetric key type
112
+ return key.asymmetricKeyType === "ec";
113
+ }
114
+ catch {
115
+ return false;
116
+ }
117
+ }
118
+ /**
119
+ * Builds a JWT using an EC key.
120
+ *
121
+ * @param privateKey - The EC private key in PEM format
122
+ * @param keyName - The key name/ID
123
+ * @param claims - The JWT claims
124
+ * @param now - Current timestamp in seconds
125
+ * @param expiresIn - Number of seconds until the token expires
126
+ * @param nonce - Random nonce for the JWT header
127
+ * @returns A JWT token signed with an EC key
128
+ * @throws {Error} If key conversion, import, or signing fails
129
+ */
130
+ async function buildECJWT(privateKey, keyName, claims, now, expiresIn, nonce) {
131
+ try {
132
+ // Convert to PKCS8 format
133
+ const keyObj = createPrivateKey(privateKey);
134
+ const pkcs8Key = keyObj.export({ type: "pkcs8", format: "pem" }).toString();
135
+ // Import the key for signing
136
+ const ecKey = await importPKCS8(pkcs8Key, "ES256");
137
+ // Sign and return the JWT
138
+ return await new SignJWT(claims)
139
+ .setProtectedHeader({ alg: "ES256", kid: keyName, typ: "JWT", nonce })
140
+ .setIssuedAt(Math.floor(now))
141
+ .setNotBefore(Math.floor(now))
142
+ .setExpirationTime(Math.floor(now + expiresIn))
143
+ .sign(ecKey);
144
+ }
145
+ catch (error) {
146
+ throw new Error(`Failed to generate EC JWT: ${error.message}`);
147
+ }
148
+ }
149
+ /**
150
+ * Builds a JWT using an Ed25519 key.
151
+ *
152
+ * @param privateKey - The Ed25519 private key in base64 format
153
+ * @param keyName - The key name/ID
154
+ * @param claims - The JWT claims
155
+ * @param now - Current timestamp in seconds
156
+ * @param expiresIn - Number of seconds until the token expires
157
+ * @param nonce - Random nonce for the JWT header
158
+ * @returns A JWT token using an Ed25519 key
159
+ * @throws {Error} If key parsing, import, or signing fails
160
+ */
161
+ async function buildEdwardsJWT(privateKey, keyName, claims, now, expiresIn, nonce) {
162
+ try {
163
+ // Decode the base64 key (expecting 64 bytes: 32 for seed + 32 for public key)
164
+ const decoded = Buffer.from(privateKey, "base64");
165
+ if (decoded.length !== 64) {
166
+ throw new Error("Invalid Ed25519 key length");
167
+ }
168
+ const seed = decoded.subarray(0, 32);
169
+ const publicKey = decoded.subarray(32);
170
+ // Create JWK from the key components
171
+ const jwk = {
172
+ kty: "OKP",
173
+ crv: "Ed25519",
174
+ d: seed.toString("base64url"),
175
+ x: publicKey.toString("base64url"),
176
+ };
177
+ // Import the key for signing
178
+ const key = await importJWK(jwk, "EdDSA");
179
+ // Sign and return the JWT
180
+ return await new SignJWT(claims)
181
+ .setProtectedHeader({ alg: "EdDSA", kid: keyName, typ: "JWT", nonce })
182
+ .setIssuedAt(Math.floor(now))
183
+ .setNotBefore(Math.floor(now))
184
+ .setExpirationTime(Math.floor(now + expiresIn))
185
+ .sign(key);
186
+ }
187
+ catch (error) {
188
+ throw new Error(`Failed to generate Ed25519 JWT: ${error.message}`);
189
+ }
190
+ }
191
+ /**
192
+ * Generates a random nonce for the JWT.
193
+ *
194
+ * @returns {string} The generated nonce.
195
+ */
196
+ function nonce() {
197
+ return crypto.randomBytes(16).toString("hex");
198
+ }
199
+ //# sourceMappingURL=jwt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jwt.js","sourceRoot":"","sources":["../../../auth/utils/jwt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAc,MAAM,MAAM,CAAC;AAEnE,OAAO,EAAE,8BAA8B,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAmF1F;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAmB;IACnD,+BAA+B;IAC/B,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC1C,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,YAAY,EA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O,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;aACrE,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aAC5B,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aAC7B,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC;aAC9C,IAAI,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,mCAAoC,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,KAAK;IACZ,OAAO,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC"}
@@ -1,14 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CdpClient = void 0;
4
- const openapi_client_1 = require("../openapi-client");
5
- const package_json_1 = require("../../package.json");
6
- const evm_1 = require("./evm");
7
- const solana_1 = require("./solana");
1
+ import { AnalyticsConfig } from "../analytics.js";
2
+ import { CdpOpenApiClient } from "../openapi-client/index.js";
3
+ import { version } from "../version.js";
4
+ import { EvmClient } from "./evm/evm.js";
5
+ import { SolanaClient } from "./solana/solana.js";
8
6
  /**
9
7
  * The main client for interacting with the CDP API.
10
8
  */
11
- class CdpClient {
9
+ export class CdpClient {
10
+ /** Namespace containing all EVM methods. */
11
+ evm;
12
+ /** Namespace containing all Solana methods. */
13
+ solana;
12
14
  /**
13
15
  * The CdpClient is the main class for interacting with the CDP API.
14
16
  *
@@ -79,16 +81,17 @@ const cdp = new CdpClient({
79
81
  For more information, see: https://github.com/coinbase/cdp-sdk/blob/main/typescript/README.md#api-keys.
80
82
  `);
81
83
  }
82
- openapi_client_1.CdpOpenApiClient.configure({
84
+ CdpOpenApiClient.configure({
83
85
  ...options,
84
86
  apiKeyId,
85
87
  apiKeySecret,
86
88
  walletSecret,
87
89
  source: "sdk",
88
- sourceVersion: package_json_1.version,
90
+ sourceVersion: version,
89
91
  });
90
- this.evm = new evm_1.EvmClient();
91
- this.solana = new solana_1.SolanaClient();
92
+ AnalyticsConfig.set(apiKeyId);
93
+ this.evm = new EvmClient();
94
+ this.solana = new SolanaClient();
92
95
  }
93
96
  }
94
- exports.CdpClient = CdpClient;
97
+ //# sourceMappingURL=cdp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cdp.js","sourceRoot":"","sources":["../../client/cdp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAelD;;GAEG;AACH,MAAM,OAAO,SAAS;IACpB,4CAA4C;IACrC,GAAG,CAAY;IAEtB,+CAA+C;IACxC,MAAM,CAAe;IAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,YAAY,UAA4B,EAAE;QACxC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;QAChG,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;QAC5E,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;QAE3E,IAAI,CAAC,QAAQ,IAAI,CAAC,YAAY,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BrB,CAAC,CAAC;QACC,CAAC;QAED,gBAAgB,CAAC,SAAS,CAAC;YACzB,GAAG,OAAO;YACV,QAAQ;YACR,YAAY;YACZ,YAAY;YACZ,MAAM,EAAE,KAAK;YACb,aAAa,EAAE,OAAO;SACvB,CAAC,CAAC;QAEH,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAE9B,IAAI,CAAC,GAAG,GAAG,IAAI,SAAS,EAAE,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;IACnC,CAAC;CACF"}
@@ -1,15 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EvmClient = void 0;
4
- const openapi_client_1 = require("../../openapi-client");
5
- const sendUserOperation_1 = require("../../actions/evm/sendUserOperation");
6
- const waitForUserOperation_1 = require("../../actions/evm/waitForUserOperation");
7
- const toEvmServerAccount_1 = require("../../accounts/evm/toEvmServerAccount");
8
- const toEvmSmartAccount_1 = require("../../accounts/evm/toEvmSmartAccount");
1
+ import { serializeTransaction } from "viem";
2
+ import { toEvmServerAccount } from "../../accounts/evm/toEvmServerAccount.js";
3
+ import { toEvmSmartAccount } from "../../accounts/evm/toEvmSmartAccount.js";
4
+ import { sendUserOperation, } from "../../actions/evm/sendUserOperation.js";
5
+ import { waitForUserOperation, } from "../../actions/evm/waitForUserOperation.js";
6
+ import { CdpOpenApiClient } from "../../openapi-client/index.js";
9
7
  /**
10
8
  * The namespace containing all EVM methods.
11
9
  */
12
- class EvmClient {
10
+ export class EvmClient {
13
11
  /**
14
12
  * Creates a new CDP EVM account.
15
13
  *
@@ -45,10 +43,10 @@ class EvmClient {
45
43
  * ```
46
44
  */
47
45
  async createAccount(options = {}) {
48
- const account = await openapi_client_1.CdpOpenApiClient.createEvmAccount({
46
+ const account = await CdpOpenApiClient.createEvmAccount({
49
47
  name: options.name,
50
48
  }, options.idempotencyKey);
51
- return (0, toEvmServerAccount_1.toEvmServerAccount)(openapi_client_1.CdpOpenApiClient, {
49
+ return toEvmServerAccount(CdpOpenApiClient, {
52
50
  account,
53
51
  });
54
52
  }
@@ -98,10 +96,10 @@ class EvmClient {
98
96
  * ```
99
97
  */
100
98
  async createSmartAccount(options) {
101
- const smartAccount = await openapi_client_1.CdpOpenApiClient.createEvmSmartAccount({
99
+ const smartAccount = await CdpOpenApiClient.createEvmSmartAccount({
102
100
  owners: [options.owner.address],
103
101
  }, options.idempotencyKey);
104
- return (0, toEvmSmartAccount_1.toEvmSmartAccount)({
102
+ return toEvmSmartAccount({
105
103
  smartAccount,
106
104
  owner: options.owner,
107
105
  });
@@ -134,14 +132,14 @@ class EvmClient {
134
132
  async getAccount(options) {
135
133
  const account = await (() => {
136
134
  if (options.address) {
137
- return openapi_client_1.CdpOpenApiClient.getEvmAccount(options.address);
135
+ return CdpOpenApiClient.getEvmAccount(options.address);
138
136
  }
139
137
  if (options.name) {
140
- return openapi_client_1.CdpOpenApiClient.getEvmAccountByName(options.name);
138
+ return CdpOpenApiClient.getEvmAccountByName(options.name);
141
139
  }
142
140
  throw new Error("Either address or name must be provided");
143
141
  })();
144
- return (0, toEvmServerAccount_1.toEvmServerAccount)(openapi_client_1.CdpOpenApiClient, {
142
+ return toEvmServerAccount(CdpOpenApiClient, {
145
143
  account,
146
144
  });
147
145
  }
@@ -165,8 +163,8 @@ class EvmClient {
165
163
  * ```
166
164
  */
167
165
  async getSmartAccount(options) {
168
- const smartAccount = await openapi_client_1.CdpOpenApiClient.getEvmSmartAccount(options.address);
169
- return (0, toEvmSmartAccount_1.toEvmSmartAccount)({
166
+ const smartAccount = await CdpOpenApiClient.getEvmSmartAccount(options.address);
167
+ return toEvmSmartAccount({
170
168
  smartAccount,
171
169
  owner: options.owner,
172
170
  });
@@ -189,7 +187,7 @@ class EvmClient {
189
187
  * ```
190
188
  */
191
189
  async getUserOperation(options) {
192
- const userOp = await openapi_client_1.CdpOpenApiClient.getUserOperation(options.smartAccount.address, options.userOpHash);
190
+ const userOp = await CdpOpenApiClient.getUserOperation(options.smartAccount.address, options.userOpHash);
193
191
  return {
194
192
  calls: userOp.calls.map(call => ({
195
193
  to: call.to,
@@ -227,17 +225,73 @@ class EvmClient {
227
225
  * ```
228
226
  */
229
227
  async listAccounts(options = {}) {
230
- const ethAccounts = await openapi_client_1.CdpOpenApiClient.listEvmAccounts({
228
+ const ethAccounts = await CdpOpenApiClient.listEvmAccounts({
231
229
  pageSize: options.pageSize,
232
230
  pageToken: options.pageToken,
233
231
  });
234
232
  return {
235
- accounts: ethAccounts.accounts.map(account => (0, toEvmServerAccount_1.toEvmServerAccount)(openapi_client_1.CdpOpenApiClient, {
233
+ accounts: ethAccounts.accounts.map(account => toEvmServerAccount(CdpOpenApiClient, {
236
234
  account: account,
237
235
  })),
238
236
  nextPageToken: ethAccounts.nextPageToken,
239
237
  };
240
238
  }
239
+ /**
240
+ * Lists CDP EVM token balances.
241
+ *
242
+ * @param {ListTokenBalancesOptions} options - Parameters for listing the token balances.
243
+ * @param {number} [options.pageSize] - The number of token balances to return.
244
+ * @param {string} [options.pageToken] - The page token to begin listing from.
245
+ * This is obtained by previous calls to this method.
246
+ *
247
+ * @returns A promise that resolves to an array of token balances, and a token to paginate through the token balances.
248
+ *
249
+ * @example
250
+ * ```ts
251
+ * const tokenBalances = await cdp.evm.listTokenBalances({
252
+ * address: "0x1234567890123456789012345678901234567890",
253
+ * network: "base-sepolia",
254
+ * });
255
+ * ```
256
+ *
257
+ * @example
258
+ * **With pagination**
259
+ * ```ts
260
+ * let page = await cdp.evm.listTokenBalances({
261
+ * address: "0x1234567890123456789012345678901234567890",
262
+ * network: "base-sepolia",
263
+ * });
264
+ *
265
+ * while (page.nextPageToken) {
266
+ * page = await cdp.evm.listTokenBalances({
267
+ * address: "0x1234567890123456789012345678901234567890",
268
+ * network: "base-sepolia",
269
+ * pageToken: page.nextPageToken,
270
+ * });
271
+ * }
272
+ */
273
+ async listTokenBalances(options) {
274
+ const response = await CdpOpenApiClient.listEvmTokenBalances(options.network, options.address, {
275
+ pageSize: options.pageSize,
276
+ pageToken: options.pageToken,
277
+ });
278
+ const balances = response.balances.map(balance => {
279
+ return {
280
+ token: {
281
+ network: balance.token.network,
282
+ contractAddress: balance.token.contractAddress,
283
+ },
284
+ amount: {
285
+ amount: BigInt(balance.amount.amount),
286
+ decimals: BigInt(balance.amount.decimals),
287
+ },
288
+ };
289
+ });
290
+ return {
291
+ balances,
292
+ nextPageToken: response.nextPageToken,
293
+ };
294
+ }
241
295
  /**
242
296
  * Lists CDP EVM smart accounts.
243
297
  *
@@ -262,7 +316,7 @@ class EvmClient {
262
316
  * }
263
317
  */
264
318
  async listSmartAccounts(options = {}) {
265
- const smartAccounts = await openapi_client_1.CdpOpenApiClient.listEvmSmartAccounts({
319
+ const smartAccounts = await CdpOpenApiClient.listEvmSmartAccounts({
266
320
  pageSize: options.pageSize,
267
321
  pageToken: options.pageToken,
268
322
  });
@@ -302,7 +356,7 @@ class EvmClient {
302
356
  * ```
303
357
  */
304
358
  async prepareUserOperation(options) {
305
- const userOp = await openapi_client_1.CdpOpenApiClient.prepareUserOperation(options.smartAccount.address, {
359
+ const userOp = await CdpOpenApiClient.prepareUserOperation(options.smartAccount.address, {
306
360
  network: options.network,
307
361
  calls: options.calls.map(call => ({
308
362
  to: call.to,
@@ -343,11 +397,73 @@ class EvmClient {
343
397
  * ```
344
398
  */
345
399
  async requestFaucet(options) {
346
- const { transactionHash } = await openapi_client_1.CdpOpenApiClient.requestEvmFaucet({ address: options.address, network: options.network, token: options.token }, options.idempotencyKey);
400
+ const { transactionHash } = await CdpOpenApiClient.requestEvmFaucet({ address: options.address, network: options.network, token: options.token }, options.idempotencyKey);
347
401
  return {
348
402
  transactionHash: transactionHash,
349
403
  };
350
404
  }
405
+ /**
406
+ * Signs an EVM transaction and sends it to the specified network using the Coinbase API.
407
+ * This method handles nonce management and gas estimation automatically.
408
+ *
409
+ * @param {SendTransactionOptions} options - Configuration options for sending the transaction.
410
+ * @returns A promise that resolves to the transaction hash.
411
+ *
412
+ * @example
413
+ * **Sending an RLP-encoded transaction**
414
+ * ```ts
415
+ * import { parseEther, serializeTransaction } from "viem";
416
+ * import { baseSepolia } from "viem/chains";
417
+ *
418
+ * const { transactionHash } = await cdp.evm.sendTransaction({
419
+ * address: account.address,
420
+ * transaction: serializeTransaction({
421
+ * to: "0x4252e0c9A3da5A2700e7d91cb50aEf522D0C6Fe8",
422
+ * value: parseEther("0.000001"),
423
+ * chainId: baseSepolia.id,
424
+ * // Fields below are optional, CDP API will populate them if omitted.
425
+ * // nonce
426
+ * // maxPriorityFeePerGas
427
+ * // maxFeePerGas
428
+ * // gas
429
+ * }),
430
+ * network: "base-sepolia",
431
+ * });
432
+ * ```
433
+ * @example
434
+ * **Sending an EIP-1559 transaction request object**
435
+ * ```ts
436
+ * const { transactionHash } = await cdp.evm.sendTransaction({
437
+ * address: account.address,
438
+ * transaction: {
439
+ * to: "0x4252e0c9A3da5A2700e7d91cb50aEf522D0C6Fe8",
440
+ * value: parseEther("0.000001"),
441
+ * // Fields below are optional, CDP API will populate them if omitted.
442
+ * // nonce
443
+ * // maxPriorityFeePerGas
444
+ * // maxFeePerGas
445
+ * // gas
446
+ * },
447
+ * network: "base-sepolia",
448
+ * });
449
+ * ```
450
+ */
451
+ async sendTransaction(options) {
452
+ const { address, network, idempotencyKey } = options;
453
+ let transaction = options.transaction;
454
+ if (typeof transaction !== "string") {
455
+ transaction = serializeTransaction({
456
+ ...transaction,
457
+ // chainId is ignored in favor of network
458
+ chainId: 1,
459
+ type: "eip1559",
460
+ });
461
+ }
462
+ const result = await CdpOpenApiClient.sendEvmTransaction(address, { transaction, network }, idempotencyKey);
463
+ return {
464
+ transactionHash: result.transactionHash,
465
+ };
466
+ }
351
467
  /**
352
468
  * Sends a user operation.
353
469
  *
@@ -377,7 +493,7 @@ class EvmClient {
377
493
  * ```
378
494
  */
379
495
  async sendUserOperation(options) {
380
- return (0, sendUserOperation_1.sendUserOperation)(openapi_client_1.CdpOpenApiClient, options.smartAccount, {
496
+ return sendUserOperation(CdpOpenApiClient, options.smartAccount, {
381
497
  network: options.network,
382
498
  calls: options.calls,
383
499
  paymasterUrl: options.paymasterUrl,
@@ -406,7 +522,7 @@ class EvmClient {
406
522
  * ```
407
523
  */
408
524
  async signHash(options) {
409
- const signature = await openapi_client_1.CdpOpenApiClient.signEvmHash(options.address, {
525
+ const signature = await CdpOpenApiClient.signEvmHash(options.address, {
410
526
  hash: options.hash,
411
527
  }, options.idempotencyKey);
412
528
  return {
@@ -435,7 +551,7 @@ class EvmClient {
435
551
  * ```
436
552
  */
437
553
  async signMessage(options) {
438
- const signature = await openapi_client_1.CdpOpenApiClient.signEvmMessage(options.address, {
554
+ const signature = await CdpOpenApiClient.signEvmMessage(options.address, {
439
555
  message: options.message,
440
556
  }, options.idempotencyKey);
441
557
  return {
@@ -473,7 +589,7 @@ class EvmClient {
473
589
  * ```
474
590
  */
475
591
  async signTransaction(options) {
476
- const signature = await openapi_client_1.CdpOpenApiClient.signEvmTransaction(options.address, {
592
+ const signature = await CdpOpenApiClient.signEvmTransaction(options.address, {
477
593
  transaction: options.transaction,
478
594
  }, options.idempotencyKey);
479
595
  return {
@@ -513,9 +629,9 @@ class EvmClient {
513
629
  * ```
514
630
  */
515
631
  async waitForUserOperation(options) {
516
- return (0, waitForUserOperation_1.waitForUserOperation)(openapi_client_1.CdpOpenApiClient, {
632
+ return waitForUserOperation(CdpOpenApiClient, {
517
633
  ...options,
518
634
  });
519
635
  }
520
636
  }
521
- exports.EvmClient = EvmClient;
637
+ //# sourceMappingURL=evm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evm.js","sourceRoot":"","sources":["../../../client/evm/evm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,oBAAoB,EAAE,MAAM,MAAM,CAAC;AA8BrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAA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
+ //# sourceMappingURL=evm.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evm.types.js","sourceRoot":"","sources":["../../../client/evm/evm.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export { SolanaClient } from "./solana.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../client/solana/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}