@coinbase/cdp-sdk 1.1.1 → 1.2.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 (311) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/LICENSE +21 -0
  3. package/{dist → _cjs}/accounts/evm/toEvmServerAccount.js +1 -0
  4. package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -0
  5. package/{dist → _cjs}/accounts/evm/toEvmSmartAccount.js +1 -0
  6. package/_cjs/accounts/evm/toEvmSmartAccount.js.map +1 -0
  7. package/{dist → _cjs}/accounts/types.js +1 -0
  8. package/_cjs/accounts/types.js.map +1 -0
  9. package/{dist → _cjs}/actions/evm/sendUserOperation.js +1 -0
  10. package/_cjs/actions/evm/sendUserOperation.js.map +1 -0
  11. package/{dist → _cjs}/actions/evm/waitForUserOperation.js +10 -9
  12. package/_cjs/actions/evm/waitForUserOperation.js.map +1 -0
  13. package/{dist → _cjs}/analytics.js +7 -6
  14. package/_cjs/analytics.js.map +1 -0
  15. package/{dist → _cjs}/auth/errors.js +1 -0
  16. package/_cjs/auth/errors.js.map +1 -0
  17. package/{dist → _cjs}/auth/hooks/axios/index.js +2 -1
  18. package/_cjs/auth/hooks/axios/index.js.map +1 -0
  19. package/{dist → _cjs}/auth/hooks/axios/withAuth.js +3 -2
  20. package/_cjs/auth/hooks/axios/withAuth.js.map +1 -0
  21. package/{dist → _cjs}/auth/index.js +4 -3
  22. package/_cjs/auth/index.js.map +1 -0
  23. package/{dist → _cjs}/auth/utils/http.js +6 -5
  24. package/_cjs/auth/utils/http.js.map +1 -0
  25. package/{dist → _cjs}/auth/utils/index.js +3 -2
  26. package/_cjs/auth/utils/index.js.map +1 -0
  27. package/{dist → _cjs}/auth/utils/jwt.js +4 -3
  28. package/_cjs/auth/utils/jwt.js.map +1 -0
  29. package/{dist → _cjs}/client/cdp.js +13 -8
  30. package/_cjs/client/cdp.js.map +1 -0
  31. package/{dist → _cjs}/client/evm/evm.js +30 -28
  32. package/_cjs/client/evm/evm.js.map +1 -0
  33. package/{dist → _cjs}/client/evm/evm.types.js +1 -0
  34. package/_cjs/client/evm/evm.types.js.map +1 -0
  35. package/{dist → _cjs}/client/solana/index.js +3 -2
  36. package/_cjs/client/solana/index.js.map +1 -0
  37. package/{dist → _cjs}/client/solana/solana.js +9 -8
  38. package/_cjs/client/solana/solana.js.map +1 -0
  39. package/{dist → _cjs}/client/solana/solana.types.js +1 -0
  40. package/_cjs/client/solana/solana.types.js.map +1 -0
  41. package/{dist → _cjs}/constants.js +1 -0
  42. package/_cjs/constants.js.map +1 -0
  43. package/{dist → _cjs}/errors.js +1 -0
  44. package/_cjs/errors.js.map +1 -0
  45. package/{dist → _cjs}/index.js +4 -3
  46. package/_cjs/index.js.map +1 -0
  47. package/{dist → _cjs}/openapi-client/cdpApiClient.js +18 -14
  48. package/_cjs/openapi-client/cdpApiClient.js.map +1 -0
  49. package/{dist → _cjs}/openapi-client/errors.js +6 -0
  50. package/_cjs/openapi-client/errors.js.map +1 -0
  51. package/{dist → _cjs}/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +31 -30
  52. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -0
  53. package/{dist → _cjs}/openapi-client/generated/evm-accounts/evm-accounts.js +46 -41
  54. package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.js.map +1 -0
  55. package/{dist → _cjs}/openapi-client/generated/evm-accounts/evm-accounts.msw.js +73 -40
  56. package/_cjs/openapi-client/generated/evm-accounts/evm-accounts.msw.js.map +1 -0
  57. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +69 -0
  58. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -0
  59. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +188 -0
  60. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js.map +1 -0
  61. package/{dist → _cjs}/openapi-client/generated/faucets/faucets.js +18 -13
  62. package/_cjs/openapi-client/generated/faucets/faucets.js.map +1 -0
  63. package/{dist → _cjs}/openapi-client/generated/faucets/faucets.msw.js +16 -12
  64. package/_cjs/openapi-client/generated/faucets/faucets.msw.js.map +1 -0
  65. package/{dist → _cjs}/openapi-client/generated/index.msw.js +5 -4
  66. package/_cjs/openapi-client/generated/index.msw.js.map +1 -0
  67. package/{dist → _cjs}/openapi-client/generated/solana-accounts/solana-accounts.js +38 -35
  68. package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.js.map +1 -0
  69. package/{dist → _cjs}/openapi-client/generated/solana-accounts/solana-accounts.msw.js +68 -35
  70. package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.msw.js.map +1 -0
  71. package/{dist → _cjs}/openapi-client/index.js +12 -11
  72. package/_cjs/openapi-client/index.js.map +1 -0
  73. package/_cjs/package.json +1 -0
  74. package/{dist → _cjs}/types/calls.js +1 -0
  75. package/_cjs/types/calls.js.map +1 -0
  76. package/{dist → _cjs}/types/contract.js +1 -0
  77. package/_cjs/types/contract.js.map +1 -0
  78. package/{dist → _cjs}/types/misc.js +1 -0
  79. package/_cjs/types/misc.js.map +1 -0
  80. package/{dist → _cjs}/types/multicall.js +1 -0
  81. package/_cjs/types/multicall.js.map +1 -0
  82. package/{dist → _cjs}/types/utils.js +1 -0
  83. package/_cjs/types/utils.js.map +1 -0
  84. package/{dist → _cjs}/utils/wait.js +3 -2
  85. package/_cjs/utils/wait.js.map +1 -0
  86. package/_cjs/version.js +5 -0
  87. package/_cjs/version.js.map +1 -0
  88. package/_esm/accounts/evm/toEvmServerAccount.js +40 -0
  89. package/_esm/accounts/evm/toEvmServerAccount.js.map +1 -0
  90. package/_esm/accounts/evm/toEvmSmartAccount.js +22 -0
  91. package/_esm/accounts/evm/toEvmSmartAccount.js.map +1 -0
  92. package/_esm/accounts/types.js +2 -0
  93. package/_esm/accounts/types.js.map +1 -0
  94. package/_esm/actions/evm/sendUserOperation.js +85 -0
  95. package/_esm/actions/evm/sendUserOperation.js.map +1 -0
  96. package/_esm/actions/evm/waitForUserOperation.js +58 -0
  97. package/_esm/actions/evm/waitForUserOperation.js.map +1 -0
  98. package/_esm/analytics.js +84 -0
  99. package/_esm/analytics.js.map +1 -0
  100. package/_esm/auth/errors.js +57 -0
  101. package/_esm/auth/errors.js.map +1 -0
  102. package/_esm/auth/hooks/axios/index.js +2 -0
  103. package/_esm/auth/hooks/axios/index.js.map +1 -0
  104. package/_esm/auth/hooks/axios/withAuth.js +71 -0
  105. package/_esm/auth/hooks/axios/withAuth.js.map +1 -0
  106. package/_esm/auth/index.js +5 -0
  107. package/_esm/auth/index.js.map +1 -0
  108. package/_esm/auth/utils/http.js +70 -0
  109. package/_esm/auth/utils/http.js.map +1 -0
  110. package/_esm/auth/utils/index.js +3 -0
  111. package/_esm/auth/utils/index.js.map +1 -0
  112. package/_esm/auth/utils/jwt.js +199 -0
  113. package/_esm/auth/utils/jwt.js.map +1 -0
  114. package/_esm/client/cdp.js +95 -0
  115. package/_esm/client/cdp.js.map +1 -0
  116. package/_esm/client/evm/evm.js +518 -0
  117. package/_esm/client/evm/evm.js.map +1 -0
  118. package/_esm/client/evm/evm.types.js +2 -0
  119. package/_esm/client/evm/evm.types.js.map +1 -0
  120. package/_esm/client/solana/index.js +2 -0
  121. package/_esm/client/solana/index.js.map +1 -0
  122. package/_esm/client/solana/solana.js +204 -0
  123. package/_esm/client/solana/solana.js.map +1 -0
  124. package/_esm/client/solana/solana.types.js +2 -0
  125. package/_esm/client/solana/solana.types.js.map +1 -0
  126. package/_esm/constants.js +5 -0
  127. package/_esm/constants.js.map +1 -0
  128. package/_esm/errors.js +18 -0
  129. package/_esm/errors.js.map +1 -0
  130. package/_esm/index.js +3 -0
  131. package/_esm/index.js.map +1 -0
  132. package/_esm/openapi-client/cdpApiClient.js +112 -0
  133. package/_esm/openapi-client/cdpApiClient.js.map +1 -0
  134. package/_esm/openapi-client/errors.js +71 -0
  135. package/_esm/openapi-client/errors.js.map +1 -0
  136. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +52 -0
  137. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -0
  138. package/_esm/openapi-client/generated/evm-accounts/evm-accounts.js +80 -0
  139. package/_esm/openapi-client/generated/evm-accounts/evm-accounts.js.map +1 -0
  140. package/_esm/openapi-client/generated/evm-accounts/evm-accounts.msw.js +128 -0
  141. package/_esm/openapi-client/generated/evm-accounts/evm-accounts.msw.js.map +1 -0
  142. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +60 -0
  143. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -0
  144. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +172 -0
  145. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js.map +1 -0
  146. package/_esm/openapi-client/generated/faucets/faucets.js +51 -0
  147. package/_esm/openapi-client/generated/faucets/faucets.js.map +1 -0
  148. package/_esm/openapi-client/generated/faucets/faucets.msw.js +39 -0
  149. package/_esm/openapi-client/generated/faucets/faucets.msw.js.map +1 -0
  150. package/_esm/openapi-client/generated/index.msw.js +5 -0
  151. package/_esm/openapi-client/generated/index.msw.js.map +1 -0
  152. package/_esm/openapi-client/generated/solana-accounts/solana-accounts.js +73 -0
  153. package/_esm/openapi-client/generated/solana-accounts/solana-accounts.js.map +1 -0
  154. package/_esm/openapi-client/generated/solana-accounts/solana-accounts.msw.js +116 -0
  155. package/_esm/openapi-client/generated/solana-accounts/solana-accounts.msw.js.map +1 -0
  156. package/_esm/openapi-client/index.js +27 -0
  157. package/_esm/openapi-client/index.js.map +1 -0
  158. package/_esm/package.json +1 -0
  159. package/_esm/types/calls.js +4 -0
  160. package/_esm/types/calls.js.map +1 -0
  161. package/_esm/types/contract.js +4 -0
  162. package/_esm/types/contract.js.map +1 -0
  163. package/_esm/types/misc.js +3 -0
  164. package/_esm/types/misc.js.map +1 -0
  165. package/_esm/types/multicall.js +2 -0
  166. package/_esm/types/multicall.js.map +1 -0
  167. package/_esm/types/utils.js +4 -0
  168. package/_esm/types/utils.js.map +1 -0
  169. package/_esm/utils/wait.js +32 -0
  170. package/_esm/utils/wait.js.map +1 -0
  171. package/_esm/version.js +2 -0
  172. package/_esm/version.js.map +1 -0
  173. package/{dist → _types}/accounts/evm/toEvmServerAccount.d.ts +3 -2
  174. package/_types/accounts/evm/toEvmServerAccount.d.ts.map +1 -0
  175. package/{dist → _types}/accounts/evm/toEvmSmartAccount.d.ts +3 -2
  176. package/_types/accounts/evm/toEvmSmartAccount.d.ts.map +1 -0
  177. package/{dist → _types}/accounts/types.d.ts +3 -2
  178. package/_types/accounts/types.d.ts.map +1 -0
  179. package/{dist → _types}/actions/evm/sendUserOperation.d.ts +5 -5
  180. package/_types/actions/evm/sendUserOperation.d.ts.map +1 -0
  181. package/{dist → _types}/actions/evm/waitForUserOperation.d.ts +4 -3
  182. package/_types/actions/evm/waitForUserOperation.d.ts.map +1 -0
  183. package/{dist → _types}/analytics.d.ts +1 -0
  184. package/_types/analytics.d.ts.map +1 -0
  185. package/{dist → _types}/auth/errors.d.ts +1 -0
  186. package/_types/auth/errors.d.ts.map +1 -0
  187. package/_types/auth/hooks/axios/index.d.ts +2 -0
  188. package/_types/auth/hooks/axios/index.d.ts.map +1 -0
  189. package/{dist → _types}/auth/hooks/axios/withAuth.d.ts +1 -0
  190. package/_types/auth/hooks/axios/withAuth.d.ts.map +1 -0
  191. package/_types/auth/index.d.ts +5 -0
  192. package/_types/auth/index.d.ts.map +1 -0
  193. package/{dist → _types}/auth/utils/http.d.ts +1 -0
  194. package/_types/auth/utils/http.d.ts.map +1 -0
  195. package/_types/auth/utils/index.d.ts +3 -0
  196. package/_types/auth/utils/index.d.ts.map +1 -0
  197. package/{dist → _types}/auth/utils/jwt.d.ts +1 -0
  198. package/_types/auth/utils/jwt.d.ts.map +1 -0
  199. package/{dist → _types}/client/cdp.d.ts +3 -2
  200. package/_types/client/cdp.d.ts.map +1 -0
  201. package/{dist → _types}/client/evm/evm.d.ts +4 -3
  202. package/_types/client/evm/evm.d.ts.map +1 -0
  203. package/{dist → _types}/client/evm/evm.types.d.ts +7 -6
  204. package/_types/client/evm/evm.types.d.ts.map +1 -0
  205. package/_types/client/solana/index.d.ts +2 -0
  206. package/_types/client/solana/index.d.ts.map +1 -0
  207. package/{dist → _types}/client/solana/solana.d.ts +2 -1
  208. package/_types/client/solana/solana.d.ts.map +1 -0
  209. package/{dist → _types}/client/solana/solana.types.d.ts +2 -1
  210. package/_types/client/solana/solana.types.d.ts.map +1 -0
  211. package/{dist → _types}/constants.d.ts +1 -0
  212. package/_types/constants.d.ts.map +1 -0
  213. package/{dist → _types}/errors.d.ts +1 -0
  214. package/_types/errors.d.ts.map +1 -0
  215. package/_types/index.d.ts +4 -0
  216. package/_types/index.d.ts.map +1 -0
  217. package/{dist → _types}/openapi-client/cdpApiClient.d.ts +1 -0
  218. package/_types/openapi-client/cdpApiClient.d.ts.map +1 -0
  219. package/{dist → _types}/openapi-client/errors.d.ts +2 -1
  220. package/_types/openapi-client/errors.d.ts.map +1 -0
  221. package/{dist → _types}/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +13 -12
  222. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -0
  223. package/{dist → _types}/openapi-client/generated/evm-accounts/evm-accounts.d.ts +24 -23
  224. package/_types/openapi-client/generated/evm-accounts/evm-accounts.d.ts.map +1 -0
  225. package/{dist → _types}/openapi-client/generated/evm-accounts/evm-accounts.msw.d.ts +3 -2
  226. package/_types/openapi-client/generated/evm-accounts/evm-accounts.msw.d.ts.map +1 -0
  227. package/{dist → _types}/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts +21 -20
  228. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts.map +1 -0
  229. package/{dist → _types}/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.d.ts +3 -2
  230. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.d.ts.map +1 -0
  231. package/{dist → _types}/openapi-client/generated/faucets/faucets.d.ts +9 -8
  232. package/_types/openapi-client/generated/faucets/faucets.d.ts.map +1 -0
  233. package/{dist → _types}/openapi-client/generated/faucets/faucets.msw.d.ts +3 -2
  234. package/_types/openapi-client/generated/faucets/faucets.msw.d.ts.map +1 -0
  235. package/_types/openapi-client/generated/index.msw.d.ts +5 -0
  236. package/_types/openapi-client/generated/index.msw.d.ts.map +1 -0
  237. package/{dist → _types}/openapi-client/generated/solana-accounts/solana-accounts.d.ts +21 -20
  238. package/_types/openapi-client/generated/solana-accounts/solana-accounts.d.ts.map +1 -0
  239. package/{dist → _types}/openapi-client/generated/solana-accounts/solana-accounts.msw.d.ts +3 -2
  240. package/_types/openapi-client/generated/solana-accounts/solana-accounts.msw.d.ts.map +1 -0
  241. package/_types/openapi-client/index.d.ts +56 -0
  242. package/_types/openapi-client/index.d.ts.map +1 -0
  243. package/{dist → _types}/types/calls.d.ts +4 -3
  244. package/_types/types/calls.d.ts.map +1 -0
  245. package/{dist → _types}/types/contract.d.ts +3 -2
  246. package/_types/types/contract.d.ts.map +1 -0
  247. package/{dist → _types}/types/misc.d.ts +1 -0
  248. package/_types/types/misc.d.ts.map +1 -0
  249. package/{dist → _types}/types/multicall.d.ts +2 -1
  250. package/_types/types/multicall.d.ts.map +1 -0
  251. package/{dist → _types}/types/utils.d.ts +1 -0
  252. package/_types/types/utils.d.ts.map +1 -0
  253. package/{dist → _types}/utils/wait.d.ts +1 -0
  254. package/_types/utils/wait.d.ts.map +1 -0
  255. package/_types/version.d.ts +2 -0
  256. package/_types/version.d.ts.map +1 -0
  257. package/accounts/evm/toEvmServerAccount.ts +60 -0
  258. package/accounts/evm/toEvmSmartAccount.ts +37 -0
  259. package/accounts/types.ts +53 -0
  260. package/actions/evm/sendUserOperation.ts +163 -0
  261. package/actions/evm/waitForUserOperation.ts +115 -0
  262. package/analytics.ts +123 -0
  263. package/auth/README.md +145 -0
  264. package/auth/errors.ts +59 -0
  265. package/auth/hooks/axios/index.ts +1 -0
  266. package/auth/hooks/axios/withAuth.ts +120 -0
  267. package/auth/index.ts +5 -0
  268. package/auth/utils/http.ts +146 -0
  269. package/auth/utils/index.ts +2 -0
  270. package/auth/utils/jwt.ts +324 -0
  271. package/client/cdp.ts +113 -0
  272. package/client/evm/evm.ts +606 -0
  273. package/client/evm/evm.types.ts +303 -0
  274. package/client/solana/index.ts +1 -0
  275. package/client/solana/solana.ts +237 -0
  276. package/client/solana/solana.types.ts +114 -0
  277. package/constants.ts +4 -0
  278. package/errors.ts +17 -0
  279. package/index.ts +4 -0
  280. package/openapi-client/cdpApiClient.ts +214 -0
  281. package/openapi-client/errors.ts +96 -0
  282. package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +411 -0
  283. package/openapi-client/generated/evm-accounts/evm-accounts.msw.ts +242 -0
  284. package/openapi-client/generated/evm-accounts/evm-accounts.ts +150 -0
  285. package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.ts +283 -0
  286. package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.ts +131 -0
  287. package/openapi-client/generated/faucets/faucets.msw.ts +76 -0
  288. package/openapi-client/generated/faucets/faucets.ts +83 -0
  289. package/openapi-client/generated/index.msw.ts +4 -0
  290. package/openapi-client/generated/solana-accounts/solana-accounts.msw.ts +219 -0
  291. package/openapi-client/generated/solana-accounts/solana-accounts.ts +143 -0
  292. package/openapi-client/index.ts +32 -0
  293. package/package.json +31 -66
  294. package/types/calls.ts +40 -0
  295. package/types/contract.ts +126 -0
  296. package/types/misc.ts +5 -0
  297. package/types/multicall.ts +29 -0
  298. package/types/utils.ts +288 -0
  299. package/utils/wait.ts +52 -0
  300. package/version.ts +1 -0
  301. package/dist/auth/hooks/axios/index.d.ts +0 -1
  302. package/dist/auth/index.d.ts +0 -4
  303. package/dist/auth/utils/index.d.ts +0 -2
  304. package/dist/client/evm/index.d.ts +0 -1
  305. package/dist/client/evm/index.js +0 -5
  306. package/dist/client/solana/index.d.ts +0 -1
  307. package/dist/index.d.ts +0 -3
  308. package/dist/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +0 -66
  309. package/dist/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +0 -99
  310. package/dist/openapi-client/generated/index.msw.d.ts +0 -4
  311. package/dist/openapi-client/index.d.ts +0 -55
@@ -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,MAA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CAAC,WAAW,CAAC;SACnC,CAAC;QAEF,6BAA6B;QAC7B,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAE1C,0BAA0B;QAC1B,OAAO,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;aAC7B,kBAAkB,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,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"}
@@ -0,0 +1,95 @@
1
+ import { CdpOpenApiClient } from "../openapi-client/index.js";
2
+ import { version } from "../version.js";
3
+ import { EvmClient } from "./evm/evm.js";
4
+ import { SolanaClient } from "./solana/solana.js";
5
+ /**
6
+ * The main client for interacting with the CDP API.
7
+ */
8
+ export class CdpClient {
9
+ /** Namespace containing all EVM methods. */
10
+ evm;
11
+ /** Namespace containing all Solana methods. */
12
+ solana;
13
+ /**
14
+ * The CdpClient is the main class for interacting with the CDP API.
15
+ *
16
+ * There are a few required parameters that are configured in the [CDP Portal](https://portal.cdp.coinbase.com/projects/api-keys):
17
+ * - **CDP Secret API Key** (`apiKeyId` & `apiKeySecret`): These are used to authenticate requests to the entire suite of
18
+ * APIs offered on Coinbase Developer Platform.
19
+ * [Read more about CDP API keys](https://docs.cdp.coinbase.com/get-started/docs/cdp-api-keys).
20
+ * - **Wallet Secret** (`walletSecret`): This secret is used specifically to authenticate requests to `POST`, and `DELETE`
21
+ * endpoints in the EVM and Solana Account APIs.
22
+ *
23
+ * These parameters can be set as environment variables:
24
+ * ```
25
+ * CDP_API_KEY_ID=your-api-key-id
26
+ * CDP_API_KEY_SECRET=your-api-key-secret
27
+ * CDP_WALLET_SECRET=your-wallet-secret
28
+ * ```
29
+ *
30
+ * Or passed as options to the constructor:
31
+ *
32
+ * ```typescript
33
+ * const cdp = new CdpClient({
34
+ * apiKeyId: "your-api-key-id",
35
+ * apiKeySecret: "your-api-key-secret",
36
+ * walletSecret: "your-wallet-secret",
37
+ * });
38
+ * ```
39
+ *
40
+ * The CdpClient is namespaced by chain type: `evm` or `solana`.
41
+ *
42
+ * As an example, to create a new EVM account, use `cdp.evm.createAccount()`.
43
+ *
44
+ * To create a new Solana account, use `cdp.solana.createAccount()`.
45
+ *
46
+ * @param {CdpClientOptions} [options] - Configuration options for the CdpClient.
47
+ */
48
+ constructor(options = {}) {
49
+ const apiKeyId = options.apiKeyId ?? process.env.CDP_API_KEY_ID ?? process.env.CDP_API_KEY_NAME;
50
+ const apiKeySecret = options.apiKeySecret ?? process.env.CDP_API_KEY_SECRET;
51
+ const walletSecret = options.walletSecret ?? process.env.CDP_WALLET_SECRET;
52
+ if (!apiKeyId || !apiKeySecret) {
53
+ throw new Error(`
54
+ \nMissing required CDP Secret API Key configuration parameters.
55
+
56
+ You can set them as environment variables:
57
+
58
+ CDP_API_KEY_ID=your-api-key-id
59
+ CDP_API_KEY_SECRET=your-api-key-secret
60
+
61
+ You can also pass them as options to the constructor:
62
+
63
+ const cdp = new CdpClient({
64
+ apiKeyId: "your-api-key-id",
65
+ apiKeySecret: "your-api-key-secret",
66
+ });
67
+
68
+ If you're performing write operations, make sure to also set your wallet secret:
69
+
70
+ CDP_WALLET_SECRET=your-wallet-secret
71
+
72
+ This is also available as an option to the constructor:
73
+
74
+ const cdp = new CdpClient({
75
+ apiKeyId: "your-api-key-id",
76
+ apiKeySecret: "your-api-key-secret",
77
+ walletSecret: "your-wallet-secret",
78
+ });
79
+
80
+ For more information, see: https://github.com/coinbase/cdp-sdk/blob/main/typescript/README.md#api-keys.
81
+ `);
82
+ }
83
+ CdpOpenApiClient.configure({
84
+ ...options,
85
+ apiKeyId,
86
+ apiKeySecret,
87
+ walletSecret,
88
+ source: "sdk",
89
+ sourceVersion: version,
90
+ });
91
+ this.evm = new EvmClient();
92
+ this.solana = new SolanaClient();
93
+ }
94
+ }
95
+ //# sourceMappingURL=cdp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cdp.js","sourceRoot":"","sources":["../../client/cdp.ts"],"names":[],"mappings":"AAAA,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,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