@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,283 @@
1
+ /**
2
+ * Generated by orval v7.6.0 🍺
3
+ * Do not edit manually.
4
+ * Coinbase Developer Platform APIs
5
+ * The Coinbase Developer Platform APIs - leading the world's transition onchain.
6
+ * OpenAPI spec version: 2.0.0
7
+ */
8
+ import { faker } from "@faker-js/faker";
9
+
10
+ import { HttpResponse, delay, http } from "msw";
11
+
12
+ import type {
13
+ EvmSmartAccount,
14
+ EvmUserOperation,
15
+ ListEvmSmartAccounts200,
16
+ } from "../coinbaseDeveloperPlatformAPIs.schemas.js";
17
+
18
+ export const getListEvmSmartAccountsResponseMock = (): ListEvmSmartAccounts200 => ({
19
+ ...{
20
+ accounts: Array.from({ length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1).map(
21
+ () => ({
22
+ address: faker.helpers.fromRegExp("^0x[0-9a-fA-F]{40}$"),
23
+ owners: Array.from({ length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1).map(
24
+ () => faker.helpers.fromRegExp("^0x[0-9a-fA-F]{40}$"),
25
+ ),
26
+ name: faker.helpers.arrayElement([
27
+ faker.helpers.fromRegExp("^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$"),
28
+ undefined,
29
+ ]),
30
+ }),
31
+ ),
32
+ },
33
+ ...{ nextPageToken: faker.helpers.arrayElement([faker.string.alpha(20), undefined]) },
34
+ });
35
+
36
+ export const getCreateEvmSmartAccountResponseMock = (
37
+ overrideResponse: Partial<EvmSmartAccount> = {},
38
+ ): EvmSmartAccount => ({
39
+ address: faker.helpers.fromRegExp("^0x[0-9a-fA-F]{40}$"),
40
+ owners: Array.from({ length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() =>
41
+ faker.helpers.fromRegExp("^0x[0-9a-fA-F]{40}$"),
42
+ ),
43
+ name: faker.helpers.arrayElement([
44
+ faker.helpers.fromRegExp("^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$"),
45
+ undefined,
46
+ ]),
47
+ ...overrideResponse,
48
+ });
49
+
50
+ export const getGetEvmSmartAccountResponseMock = (
51
+ overrideResponse: Partial<EvmSmartAccount> = {},
52
+ ): EvmSmartAccount => ({
53
+ address: faker.helpers.fromRegExp("^0x[0-9a-fA-F]{40}$"),
54
+ owners: Array.from({ length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() =>
55
+ faker.helpers.fromRegExp("^0x[0-9a-fA-F]{40}$"),
56
+ ),
57
+ name: faker.helpers.arrayElement([
58
+ faker.helpers.fromRegExp("^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$"),
59
+ undefined,
60
+ ]),
61
+ ...overrideResponse,
62
+ });
63
+
64
+ export const getPrepareUserOperationResponseMock = (
65
+ overrideResponse: Partial<EvmUserOperation> = {},
66
+ ): EvmUserOperation => ({
67
+ network: faker.helpers.arrayElement(["base-sepolia", "base"] as const),
68
+ userOpHash: faker.helpers.fromRegExp("^0x[0-9a-fA-F]{64}$"),
69
+ calls: Array.from({ length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({
70
+ to: faker.helpers.fromRegExp("^0x[0-9a-fA-F]{40}$"),
71
+ value: faker.string.alpha(20),
72
+ data: faker.helpers.fromRegExp("^0x[0-9a-fA-F]*$"),
73
+ })),
74
+ status: faker.helpers.arrayElement([
75
+ "pending",
76
+ "signed",
77
+ "broadcast",
78
+ "complete",
79
+ "failed",
80
+ ] as const),
81
+ transactionHash: faker.helpers.arrayElement([
82
+ faker.helpers.fromRegExp("^0x[0-9a-fA-F]{64}$|^$"),
83
+ undefined,
84
+ ]),
85
+ ...overrideResponse,
86
+ });
87
+
88
+ export const getGetUserOperationResponseMock = (
89
+ overrideResponse: Partial<EvmUserOperation> = {},
90
+ ): EvmUserOperation => ({
91
+ network: faker.helpers.arrayElement(["base-sepolia", "base"] as const),
92
+ userOpHash: faker.helpers.fromRegExp("^0x[0-9a-fA-F]{64}$"),
93
+ calls: Array.from({ length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({
94
+ to: faker.helpers.fromRegExp("^0x[0-9a-fA-F]{40}$"),
95
+ value: faker.string.alpha(20),
96
+ data: faker.helpers.fromRegExp("^0x[0-9a-fA-F]*$"),
97
+ })),
98
+ status: faker.helpers.arrayElement([
99
+ "pending",
100
+ "signed",
101
+ "broadcast",
102
+ "complete",
103
+ "failed",
104
+ ] as const),
105
+ transactionHash: faker.helpers.arrayElement([
106
+ faker.helpers.fromRegExp("^0x[0-9a-fA-F]{64}$|^$"),
107
+ undefined,
108
+ ]),
109
+ ...overrideResponse,
110
+ });
111
+
112
+ export const getSendUserOperationResponseMock = (
113
+ overrideResponse: Partial<EvmUserOperation> = {},
114
+ ): EvmUserOperation => ({
115
+ network: faker.helpers.arrayElement(["base-sepolia", "base"] as const),
116
+ userOpHash: faker.helpers.fromRegExp("^0x[0-9a-fA-F]{64}$"),
117
+ calls: Array.from({ length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({
118
+ to: faker.helpers.fromRegExp("^0x[0-9a-fA-F]{40}$"),
119
+ value: faker.string.alpha(20),
120
+ data: faker.helpers.fromRegExp("^0x[0-9a-fA-F]*$"),
121
+ })),
122
+ status: faker.helpers.arrayElement([
123
+ "pending",
124
+ "signed",
125
+ "broadcast",
126
+ "complete",
127
+ "failed",
128
+ ] as const),
129
+ transactionHash: faker.helpers.arrayElement([
130
+ faker.helpers.fromRegExp("^0x[0-9a-fA-F]{64}$|^$"),
131
+ undefined,
132
+ ]),
133
+ ...overrideResponse,
134
+ });
135
+
136
+ export const getListEvmSmartAccountsMockHandler = (
137
+ overrideResponse?:
138
+ | ListEvmSmartAccounts200
139
+ | ((
140
+ info: Parameters<Parameters<typeof http.get>[1]>[0],
141
+ ) => Promise<ListEvmSmartAccounts200> | ListEvmSmartAccounts200),
142
+ ) => {
143
+ return http.get("*/v2/evm/smart-accounts", async info => {
144
+ await delay(0);
145
+
146
+ return new HttpResponse(
147
+ JSON.stringify(
148
+ overrideResponse !== undefined
149
+ ? typeof overrideResponse === "function"
150
+ ? await overrideResponse(info)
151
+ : overrideResponse
152
+ : getListEvmSmartAccountsResponseMock(),
153
+ ),
154
+ { status: 200, headers: { "Content-Type": "application/json" } },
155
+ );
156
+ });
157
+ };
158
+
159
+ export const getCreateEvmSmartAccountMockHandler = (
160
+ overrideResponse?:
161
+ | EvmSmartAccount
162
+ | ((
163
+ info: Parameters<Parameters<typeof http.post>[1]>[0],
164
+ ) => Promise<EvmSmartAccount> | EvmSmartAccount),
165
+ ) => {
166
+ return http.post("*/v2/evm/smart-accounts", async info => {
167
+ await delay(0);
168
+
169
+ return new HttpResponse(
170
+ JSON.stringify(
171
+ overrideResponse !== undefined
172
+ ? typeof overrideResponse === "function"
173
+ ? await overrideResponse(info)
174
+ : overrideResponse
175
+ : getCreateEvmSmartAccountResponseMock(),
176
+ ),
177
+ { status: 201, headers: { "Content-Type": "application/json" } },
178
+ );
179
+ });
180
+ };
181
+
182
+ export const getGetEvmSmartAccountMockHandler = (
183
+ overrideResponse?:
184
+ | EvmSmartAccount
185
+ | ((
186
+ info: Parameters<Parameters<typeof http.get>[1]>[0],
187
+ ) => Promise<EvmSmartAccount> | EvmSmartAccount),
188
+ ) => {
189
+ return http.get("*/v2/evm/smart-accounts/:address", async info => {
190
+ await delay(0);
191
+
192
+ return new HttpResponse(
193
+ JSON.stringify(
194
+ overrideResponse !== undefined
195
+ ? typeof overrideResponse === "function"
196
+ ? await overrideResponse(info)
197
+ : overrideResponse
198
+ : getGetEvmSmartAccountResponseMock(),
199
+ ),
200
+ { status: 200, headers: { "Content-Type": "application/json" } },
201
+ );
202
+ });
203
+ };
204
+
205
+ export const getPrepareUserOperationMockHandler = (
206
+ overrideResponse?:
207
+ | EvmUserOperation
208
+ | ((
209
+ info: Parameters<Parameters<typeof http.post>[1]>[0],
210
+ ) => Promise<EvmUserOperation> | EvmUserOperation),
211
+ ) => {
212
+ return http.post("*/v2/evm/smart-accounts/:address/user-operations", async info => {
213
+ await delay(0);
214
+
215
+ return new HttpResponse(
216
+ JSON.stringify(
217
+ overrideResponse !== undefined
218
+ ? typeof overrideResponse === "function"
219
+ ? await overrideResponse(info)
220
+ : overrideResponse
221
+ : getPrepareUserOperationResponseMock(),
222
+ ),
223
+ { status: 201, headers: { "Content-Type": "application/json" } },
224
+ );
225
+ });
226
+ };
227
+
228
+ export const getGetUserOperationMockHandler = (
229
+ overrideResponse?:
230
+ | EvmUserOperation
231
+ | ((
232
+ info: Parameters<Parameters<typeof http.get>[1]>[0],
233
+ ) => Promise<EvmUserOperation> | EvmUserOperation),
234
+ ) => {
235
+ return http.get("*/v2/evm/smart-accounts/:address/user-operations/:userOpHash", async info => {
236
+ await delay(0);
237
+
238
+ return new HttpResponse(
239
+ JSON.stringify(
240
+ overrideResponse !== undefined
241
+ ? typeof overrideResponse === "function"
242
+ ? await overrideResponse(info)
243
+ : overrideResponse
244
+ : getGetUserOperationResponseMock(),
245
+ ),
246
+ { status: 200, headers: { "Content-Type": "application/json" } },
247
+ );
248
+ });
249
+ };
250
+
251
+ export const getSendUserOperationMockHandler = (
252
+ overrideResponse?:
253
+ | EvmUserOperation
254
+ | ((
255
+ info: Parameters<Parameters<typeof http.post>[1]>[0],
256
+ ) => Promise<EvmUserOperation> | EvmUserOperation),
257
+ ) => {
258
+ return http.post(
259
+ "*/v2/evm/smart-accounts/:address/user-operations/:userOpHash/send",
260
+ async info => {
261
+ await delay(0);
262
+
263
+ return new HttpResponse(
264
+ JSON.stringify(
265
+ overrideResponse !== undefined
266
+ ? typeof overrideResponse === "function"
267
+ ? await overrideResponse(info)
268
+ : overrideResponse
269
+ : getSendUserOperationResponseMock(),
270
+ ),
271
+ { status: 200, headers: { "Content-Type": "application/json" } },
272
+ );
273
+ },
274
+ );
275
+ };
276
+ export const getEvmSmartAccountsMock = () => [
277
+ getListEvmSmartAccountsMockHandler(),
278
+ getCreateEvmSmartAccountMockHandler(),
279
+ getGetEvmSmartAccountMockHandler(),
280
+ getPrepareUserOperationMockHandler(),
281
+ getGetUserOperationMockHandler(),
282
+ getSendUserOperationMockHandler(),
283
+ ];
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Generated by orval v7.6.0 🍺
3
+ * Do not edit manually.
4
+ * Coinbase Developer Platform APIs
5
+ * The Coinbase Developer Platform APIs - leading the world's transition onchain.
6
+ * OpenAPI spec version: 2.0.0
7
+ */
8
+ import type {
9
+ CreateEvmSmartAccountBody,
10
+ EvmSmartAccount,
11
+ EvmUserOperation,
12
+ ListEvmSmartAccounts200,
13
+ ListEvmSmartAccountsParams,
14
+ PrepareUserOperationBody,
15
+ SendUserOperationBody,
16
+ } from "../coinbaseDeveloperPlatformAPIs.schemas.js";
17
+
18
+ import { cdpApiClient } from "../../cdpApiClient.js";
19
+
20
+ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
21
+
22
+ /**
23
+ * Lists the Smart Accounts belonging to the developer's CDP Project.
24
+ The response is paginated, and by default, returns 20 accounts per page.
25
+ * @summary List Smart Accounts
26
+ */
27
+ export const listEvmSmartAccounts = (
28
+ params?: ListEvmSmartAccountsParams,
29
+ options?: SecondParameter<typeof cdpApiClient>,
30
+ ) => {
31
+ return cdpApiClient<ListEvmSmartAccounts200>(
32
+ { url: `/v2/evm/smart-accounts`, method: "GET", params },
33
+ options,
34
+ );
35
+ };
36
+ /**
37
+ * Creates a new Smart Account.
38
+ * @summary Create a Smart Account
39
+ */
40
+ export const createEvmSmartAccount = (
41
+ createEvmSmartAccountBody: CreateEvmSmartAccountBody,
42
+ options?: SecondParameter<typeof cdpApiClient>,
43
+ ) => {
44
+ return cdpApiClient<EvmSmartAccount>(
45
+ {
46
+ url: `/v2/evm/smart-accounts`,
47
+ method: "POST",
48
+ headers: { "Content-Type": "application/json" },
49
+ data: createEvmSmartAccountBody,
50
+ },
51
+ options,
52
+ );
53
+ };
54
+ /**
55
+ * Gets a Smart Account by its address.
56
+ * @summary Get a Smart Account by address
57
+ */
58
+ export const getEvmSmartAccount = (
59
+ address: string,
60
+ options?: SecondParameter<typeof cdpApiClient>,
61
+ ) => {
62
+ return cdpApiClient<EvmSmartAccount>(
63
+ { url: `/v2/evm/smart-accounts/${address}`, method: "GET" },
64
+ options,
65
+ );
66
+ };
67
+ /**
68
+ * Prepares a new user operation on a Smart Account for a specific network.
69
+ * @summary Prepare a user operation
70
+ */
71
+ export const prepareUserOperation = (
72
+ address: string,
73
+ prepareUserOperationBody: PrepareUserOperationBody,
74
+ options?: SecondParameter<typeof cdpApiClient>,
75
+ ) => {
76
+ return cdpApiClient<EvmUserOperation>(
77
+ {
78
+ url: `/v2/evm/smart-accounts/${address}/user-operations`,
79
+ method: "POST",
80
+ headers: { "Content-Type": "application/json" },
81
+ data: prepareUserOperationBody,
82
+ },
83
+ options,
84
+ );
85
+ };
86
+ /**
87
+ * Gets a user operation by its hash.
88
+ * @summary Get a user operation
89
+ */
90
+ export const getUserOperation = (
91
+ address: string,
92
+ userOpHash: string,
93
+ options?: SecondParameter<typeof cdpApiClient>,
94
+ ) => {
95
+ return cdpApiClient<EvmUserOperation>(
96
+ { url: `/v2/evm/smart-accounts/${address}/user-operations/${userOpHash}`, method: "GET" },
97
+ options,
98
+ );
99
+ };
100
+ /**
101
+ * Sends a user operation with a signature.
102
+ The signature that is sent should be 65 bytes, consisting of the `r`, `s`, and `v` values of the ECDSA signature. Note that the `v` value should conform to the `personal_sign` standard, which means it should be 27 or 28.
103
+ * @summary Send a user operation
104
+ */
105
+ export const sendUserOperation = (
106
+ address: string,
107
+ userOpHash: string,
108
+ sendUserOperationBody: SendUserOperationBody,
109
+ options?: SecondParameter<typeof cdpApiClient>,
110
+ ) => {
111
+ return cdpApiClient<EvmUserOperation>(
112
+ {
113
+ url: `/v2/evm/smart-accounts/${address}/user-operations/${userOpHash}/send`,
114
+ method: "POST",
115
+ headers: { "Content-Type": "application/json" },
116
+ data: sendUserOperationBody,
117
+ },
118
+ options,
119
+ );
120
+ };
121
+ export type ListEvmSmartAccountsResult = NonNullable<
122
+ Awaited<ReturnType<typeof listEvmSmartAccounts>>
123
+ >;
124
+ export type CreateEvmSmartAccountResult = NonNullable<
125
+ Awaited<ReturnType<typeof createEvmSmartAccount>>
126
+ >;
127
+ export type GetEvmSmartAccountResult = NonNullable<Awaited<ReturnType<typeof getEvmSmartAccount>>>;
128
+ export type PrepareUserOperationResult = NonNullable<
129
+ Awaited<ReturnType<typeof prepareUserOperation>>
130
+ >;
131
+ export type GetUserOperationResult = NonNullable<Awaited<ReturnType<typeof getUserOperation>>>;
132
+ export type SendUserOperationResult = NonNullable<Awaited<ReturnType<typeof sendUserOperation>>>;
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Generated by orval v7.6.0 🍺
3
+ * Do not edit manually.
4
+ * Coinbase Developer Platform APIs
5
+ * The Coinbase Developer Platform APIs - leading the world's transition onchain.
6
+ * OpenAPI spec version: 2.0.0
7
+ */
8
+ import { faker } from "@faker-js/faker";
9
+
10
+ import { HttpResponse, delay, http } from "msw";
11
+
12
+ import { ListEvmTokenBalancesNetwork } from "../coinbaseDeveloperPlatformAPIs.schemas.js";
13
+ import type { ListEvmTokenBalances200 } from "../coinbaseDeveloperPlatformAPIs.schemas.js";
14
+
15
+ export const getListEvmTokenBalancesResponseMock = (): ListEvmTokenBalances200 => ({
16
+ ...{
17
+ balances: Array.from({ length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1).map(
18
+ () => ({
19
+ amount: {
20
+ amount: faker.helpers.fromRegExp("^[0-9]+$"),
21
+ decimals: faker.number.int({ min: undefined, max: undefined }),
22
+ },
23
+ token: {
24
+ network: faker.helpers.arrayElement(Object.values(ListEvmTokenBalancesNetwork)),
25
+ symbol: faker.helpers.arrayElement([faker.string.alpha(20), undefined]),
26
+ name: faker.helpers.arrayElement([faker.string.alpha(20), undefined]),
27
+ contractAddress: faker.helpers.fromRegExp("^0x[0-9a-fA-F]{40}$"),
28
+ },
29
+ }),
30
+ ),
31
+ },
32
+ ...{ nextPageToken: faker.helpers.arrayElement([faker.string.alpha(20), undefined]) },
33
+ });
34
+
35
+ export const getListEvmTokenBalancesMockHandler = (
36
+ overrideResponse?:
37
+ | ListEvmTokenBalances200
38
+ | ((
39
+ info: Parameters<Parameters<typeof http.get>[1]>[0],
40
+ ) => Promise<ListEvmTokenBalances200> | ListEvmTokenBalances200),
41
+ ) => {
42
+ return http.get("*/v2/evm/token-balances/:network/:address", async info => {
43
+ await delay(0);
44
+
45
+ return new HttpResponse(
46
+ JSON.stringify(
47
+ overrideResponse !== undefined
48
+ ? typeof overrideResponse === "function"
49
+ ? await overrideResponse(info)
50
+ : overrideResponse
51
+ : getListEvmTokenBalancesResponseMock(),
52
+ ),
53
+ { status: 200, headers: { "Content-Type": "application/json" } },
54
+ );
55
+ });
56
+ };
57
+ export const getEvmTokenBalancesMock = () => [getListEvmTokenBalancesMockHandler()];
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Generated by orval v7.6.0 🍺
3
+ * Do not edit manually.
4
+ * Coinbase Developer Platform APIs
5
+ * The Coinbase Developer Platform APIs - leading the world's transition onchain.
6
+ * OpenAPI spec version: 2.0.0
7
+ */
8
+ import type {
9
+ ListEvmTokenBalances200,
10
+ ListEvmTokenBalancesNetwork,
11
+ ListEvmTokenBalancesParams,
12
+ } from "../coinbaseDeveloperPlatformAPIs.schemas.js";
13
+
14
+ import { cdpApiClient } from "../../cdpApiClient.js";
15
+
16
+ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
17
+
18
+ /**
19
+ * Lists the token balances of an EVM address on a given network. The balances include ERC-20 tokens and the native gas token (usually ETH). The response is paginated, and by default, returns 20 balances per page.
20
+
21
+ **Note:** This endpoint is still under development and does not yet provide strong freshness guarantees. Specifically, balances of new tokens can, on occasion, take up to ~30 seconds to appear, while balances of tokens already belonging to an address will generally be close to chain tip. Freshness of new token balances will improve over the coming weeks.
22
+ * @summary List EVM token balances
23
+ */
24
+ export const listEvmTokenBalances = (
25
+ network: ListEvmTokenBalancesNetwork,
26
+ address: string,
27
+ params?: ListEvmTokenBalancesParams,
28
+ options?: SecondParameter<typeof cdpApiClient>,
29
+ ) => {
30
+ return cdpApiClient<ListEvmTokenBalances200>(
31
+ { url: `/v2/evm/token-balances/${network}/${address}`, method: "GET", params },
32
+ options,
33
+ );
34
+ };
35
+ export type ListEvmTokenBalancesResult = NonNullable<
36
+ Awaited<ReturnType<typeof listEvmTokenBalances>>
37
+ >;
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Generated by orval v7.6.0 🍺
3
+ * Do not edit manually.
4
+ * Coinbase Developer Platform APIs
5
+ * The Coinbase Developer Platform APIs - leading the world's transition onchain.
6
+ * OpenAPI spec version: 2.0.0
7
+ */
8
+ import { faker } from "@faker-js/faker";
9
+
10
+ import { HttpResponse, delay, http } from "msw";
11
+
12
+ import type {
13
+ RequestEvmFaucet200,
14
+ RequestSolanaFaucet200,
15
+ } from "../coinbaseDeveloperPlatformAPIs.schemas.js";
16
+
17
+ export const getRequestEvmFaucetResponseMock = (
18
+ overrideResponse: Partial<RequestEvmFaucet200> = {},
19
+ ): RequestEvmFaucet200 => ({ transactionHash: faker.string.alpha(20), ...overrideResponse });
20
+
21
+ export const getRequestSolanaFaucetResponseMock = (
22
+ overrideResponse: Partial<RequestSolanaFaucet200> = {},
23
+ ): RequestSolanaFaucet200 => ({
24
+ transactionSignature: faker.string.alpha(20),
25
+ ...overrideResponse,
26
+ });
27
+
28
+ export const getRequestEvmFaucetMockHandler = (
29
+ overrideResponse?:
30
+ | RequestEvmFaucet200
31
+ | ((
32
+ info: Parameters<Parameters<typeof http.post>[1]>[0],
33
+ ) => Promise<RequestEvmFaucet200> | RequestEvmFaucet200),
34
+ ) => {
35
+ return http.post("*/v2/evm/faucet", async info => {
36
+ await delay(0);
37
+
38
+ return new HttpResponse(
39
+ JSON.stringify(
40
+ overrideResponse !== undefined
41
+ ? typeof overrideResponse === "function"
42
+ ? await overrideResponse(info)
43
+ : overrideResponse
44
+ : getRequestEvmFaucetResponseMock(),
45
+ ),
46
+ { status: 200, headers: { "Content-Type": "application/json" } },
47
+ );
48
+ });
49
+ };
50
+
51
+ export const getRequestSolanaFaucetMockHandler = (
52
+ overrideResponse?:
53
+ | RequestSolanaFaucet200
54
+ | ((
55
+ info: Parameters<Parameters<typeof http.post>[1]>[0],
56
+ ) => Promise<RequestSolanaFaucet200> | RequestSolanaFaucet200),
57
+ ) => {
58
+ return http.post("*/v2/solana/faucet", async info => {
59
+ await delay(0);
60
+
61
+ return new HttpResponse(
62
+ JSON.stringify(
63
+ overrideResponse !== undefined
64
+ ? typeof overrideResponse === "function"
65
+ ? await overrideResponse(info)
66
+ : overrideResponse
67
+ : getRequestSolanaFaucetResponseMock(),
68
+ ),
69
+ { status: 200, headers: { "Content-Type": "application/json" } },
70
+ );
71
+ });
72
+ };
73
+ export const getFaucetsMock = () => [
74
+ getRequestEvmFaucetMockHandler(),
75
+ getRequestSolanaFaucetMockHandler(),
76
+ ];
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Generated by orval v7.6.0 🍺
3
+ * Do not edit manually.
4
+ * Coinbase Developer Platform APIs
5
+ * The Coinbase Developer Platform APIs - leading the world's transition onchain.
6
+ * OpenAPI spec version: 2.0.0
7
+ */
8
+ import type {
9
+ RequestEvmFaucet200,
10
+ RequestEvmFaucetBody,
11
+ RequestSolanaFaucet200,
12
+ RequestSolanaFaucetBody,
13
+ } from "../coinbaseDeveloperPlatformAPIs.schemas.js";
14
+
15
+ import { cdpApiClient } from "../../cdpApiClient.js";
16
+
17
+ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
18
+
19
+ /**
20
+ * Request funds from the CDP Faucet on supported EVM test networks.
21
+
22
+ Faucets are available for ETH, USDC, EURC, and cbBTC on Base Sepolia and Ethereum Sepolia.
23
+
24
+ To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested.
25
+ These limits are applied at both the CDP User level and the blockchain address level.
26
+ A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address.
27
+
28
+ | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits|
29
+ |:-----:|:-------------------------:|:--------------------------------:|
30
+ | ETH | 0.0001 ETH | 0.1 ETH |
31
+ | USDC | 1 USDC | 10 USDC |
32
+ | EURC | 1 EURC | 10 EURC |
33
+ | cbBTC | 0.0001 cbBTC | 0.001 cbBTC |
34
+
35
+ * @summary Request funds on EVM test networks
36
+ */
37
+ export const requestEvmFaucet = (
38
+ requestEvmFaucetBody: RequestEvmFaucetBody,
39
+ options?: SecondParameter<typeof cdpApiClient>,
40
+ ) => {
41
+ return cdpApiClient<RequestEvmFaucet200>(
42
+ {
43
+ url: `/v2/evm/faucet`,
44
+ method: "POST",
45
+ headers: { "Content-Type": "application/json" },
46
+ data: requestEvmFaucetBody,
47
+ },
48
+ options,
49
+ );
50
+ };
51
+ /**
52
+ * Request funds from the CDP Faucet on Solana devnet.
53
+
54
+ Faucets are available for SOL.
55
+
56
+ To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested.
57
+ These limits are applied at both the CDP User level and the blockchain address level.
58
+ A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address.
59
+
60
+ | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits|
61
+ |:-----:|:-------------------------:|:--------------------------------:|
62
+ | SOL | 0.00125 SOL | 0.0125 SOL |
63
+ | USDC | 1 USDC | 10 USDC |
64
+
65
+ * @summary Request funds on Solana devnet
66
+ */
67
+ export const requestSolanaFaucet = (
68
+ requestSolanaFaucetBody: RequestSolanaFaucetBody,
69
+ options?: SecondParameter<typeof cdpApiClient>,
70
+ ) => {
71
+ return cdpApiClient<RequestSolanaFaucet200>(
72
+ {
73
+ url: `/v2/solana/faucet`,
74
+ method: "POST",
75
+ headers: { "Content-Type": "application/json" },
76
+ data: requestSolanaFaucetBody,
77
+ },
78
+ options,
79
+ );
80
+ };
81
+ export type RequestEvmFaucetResult = NonNullable<Awaited<ReturnType<typeof requestEvmFaucet>>>;
82
+ export type RequestSolanaFaucetResult = NonNullable<
83
+ Awaited<ReturnType<typeof requestSolanaFaucet>>
84
+ >;
@@ -0,0 +1,5 @@
1
+ export * from "./evm-accounts/evm-accounts.msw.js";
2
+ export * from "./faucets/faucets.msw.js";
3
+ export * from "./evm-smart-accounts/evm-smart-accounts.msw.js";
4
+ export * from "./evm-token-balances/evm-token-balances.msw.js";
5
+ export * from "./solana-accounts/solana-accounts.msw.js";