@distilled.cloud/coinbase 0.0.0 → 0.2.5-alpha2

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 (412) hide show
  1. package/lib/category.d.ts +5 -0
  2. package/lib/category.d.ts.map +1 -0
  3. package/lib/category.js +5 -0
  4. package/lib/category.js.map +1 -0
  5. package/lib/client.d.ts +45 -0
  6. package/lib/client.d.ts.map +1 -0
  7. package/lib/client.js +244 -0
  8. package/lib/client.js.map +1 -0
  9. package/lib/credentials.d.ts +32 -0
  10. package/lib/credentials.d.ts.map +1 -0
  11. package/lib/credentials.js +29 -0
  12. package/lib/credentials.js.map +1 -0
  13. package/lib/errors.d.ts +855 -0
  14. package/lib/errors.d.ts.map +1 -0
  15. package/lib/errors.js +466 -0
  16. package/lib/errors.js.map +1 -0
  17. package/lib/index.d.ts +16 -0
  18. package/lib/index.d.ts.map +1 -0
  19. package/lib/index.js +16 -0
  20. package/lib/index.js.map +1 -0
  21. package/lib/operations/addEndUserEvmAccount.d.ts +30 -0
  22. package/lib/operations/addEndUserEvmAccount.d.ts.map +1 -0
  23. package/lib/operations/addEndUserEvmAccount.js +38 -0
  24. package/lib/operations/addEndUserEvmAccount.js.map +1 -0
  25. package/lib/operations/addEndUserEvmSmartAccount.d.ts +32 -0
  26. package/lib/operations/addEndUserEvmSmartAccount.d.ts.map +1 -0
  27. package/lib/operations/addEndUserEvmSmartAccount.js +43 -0
  28. package/lib/operations/addEndUserEvmSmartAccount.js.map +1 -0
  29. package/lib/operations/addEndUserSolanaAccount.d.ts +30 -0
  30. package/lib/operations/addEndUserSolanaAccount.d.ts.map +1 -0
  31. package/lib/operations/addEndUserSolanaAccount.js +38 -0
  32. package/lib/operations/addEndUserSolanaAccount.js.map +1 -0
  33. package/lib/operations/createEndUser.d.ts +61 -0
  34. package/lib/operations/createEndUser.d.ts.map +1 -0
  35. package/lib/operations/createEndUser.js +67 -0
  36. package/lib/operations/createEndUser.js.map +1 -0
  37. package/lib/operations/createEvmAccount.d.ts +30 -0
  38. package/lib/operations/createEvmAccount.d.ts.map +1 -0
  39. package/lib/operations/createEvmAccount.js +36 -0
  40. package/lib/operations/createEvmAccount.js.map +1 -0
  41. package/lib/operations/createEvmEip7702Delegation.d.ts +34 -0
  42. package/lib/operations/createEvmEip7702Delegation.d.ts.map +1 -0
  43. package/lib/operations/createEvmEip7702Delegation.js +53 -0
  44. package/lib/operations/createEvmEip7702Delegation.js.map +1 -0
  45. package/lib/operations/createEvmSmartAccount.d.ts +27 -0
  46. package/lib/operations/createEvmSmartAccount.d.ts.map +1 -0
  47. package/lib/operations/createEvmSmartAccount.js +35 -0
  48. package/lib/operations/createEvmSmartAccount.js.map +1 -0
  49. package/lib/operations/createEvmSwapQuote.d.ts +26 -0
  50. package/lib/operations/createEvmSwapQuote.d.ts.map +1 -0
  51. package/lib/operations/createEvmSwapQuote.js +40 -0
  52. package/lib/operations/createEvmSwapQuote.js.map +1 -0
  53. package/lib/operations/createOnrampOrder.d.ts +58 -0
  54. package/lib/operations/createOnrampOrder.d.ts.map +1 -0
  55. package/lib/operations/createOnrampOrder.js +79 -0
  56. package/lib/operations/createOnrampOrder.js.map +1 -0
  57. package/lib/operations/createOnrampSession.d.ts +55 -0
  58. package/lib/operations/createOnrampSession.d.ts.map +1 -0
  59. package/lib/operations/createOnrampSession.js +70 -0
  60. package/lib/operations/createOnrampSession.js.map +1 -0
  61. package/lib/operations/createPolicy.d.ts +28 -0
  62. package/lib/operations/createPolicy.d.ts.map +1 -0
  63. package/lib/operations/createPolicy.js +34 -0
  64. package/lib/operations/createPolicy.js.map +1 -0
  65. package/lib/operations/createSolanaAccount.d.ts +30 -0
  66. package/lib/operations/createSolanaAccount.d.ts.map +1 -0
  67. package/lib/operations/createSolanaAccount.js +38 -0
  68. package/lib/operations/createSolanaAccount.js.map +1 -0
  69. package/lib/operations/createSpendPermission.d.ts +55 -0
  70. package/lib/operations/createSpendPermission.d.ts.map +1 -0
  71. package/lib/operations/createSpendPermission.js +93 -0
  72. package/lib/operations/createSpendPermission.js.map +1 -0
  73. package/lib/operations/createWebhookSubscription.d.ts +74 -0
  74. package/lib/operations/createWebhookSubscription.d.ts.map +1 -0
  75. package/lib/operations/createWebhookSubscription.js +82 -0
  76. package/lib/operations/createWebhookSubscription.js.map +1 -0
  77. package/lib/operations/deletePolicy.d.ts +20 -0
  78. package/lib/operations/deletePolicy.d.ts.map +1 -0
  79. package/lib/operations/deletePolicy.js +26 -0
  80. package/lib/operations/deletePolicy.js.map +1 -0
  81. package/lib/operations/deleteWebhookSubscription.d.ts +21 -0
  82. package/lib/operations/deleteWebhookSubscription.d.ts.map +1 -0
  83. package/lib/operations/deleteWebhookSubscription.js +32 -0
  84. package/lib/operations/deleteWebhookSubscription.js.map +1 -0
  85. package/lib/operations/exportEvmAccount.d.ts +27 -0
  86. package/lib/operations/exportEvmAccount.d.ts.map +1 -0
  87. package/lib/operations/exportEvmAccount.js +33 -0
  88. package/lib/operations/exportEvmAccount.js.map +1 -0
  89. package/lib/operations/exportEvmAccountByName.d.ts +27 -0
  90. package/lib/operations/exportEvmAccountByName.d.ts.map +1 -0
  91. package/lib/operations/exportEvmAccountByName.js +35 -0
  92. package/lib/operations/exportEvmAccountByName.js.map +1 -0
  93. package/lib/operations/exportSolanaAccount.d.ts +27 -0
  94. package/lib/operations/exportSolanaAccount.d.ts.map +1 -0
  95. package/lib/operations/exportSolanaAccount.js +35 -0
  96. package/lib/operations/exportSolanaAccount.js.map +1 -0
  97. package/lib/operations/exportSolanaAccountByName.d.ts +27 -0
  98. package/lib/operations/exportSolanaAccountByName.d.ts.map +1 -0
  99. package/lib/operations/exportSolanaAccountByName.js +38 -0
  100. package/lib/operations/exportSolanaAccountByName.js.map +1 -0
  101. package/lib/operations/getEndUser.d.ts +46 -0
  102. package/lib/operations/getEndUser.d.ts.map +1 -0
  103. package/lib/operations/getEndUser.js +52 -0
  104. package/lib/operations/getEndUser.js.map +1 -0
  105. package/lib/operations/getEvmAccount.d.ts +22 -0
  106. package/lib/operations/getEvmAccount.d.ts.map +1 -0
  107. package/lib/operations/getEvmAccount.js +28 -0
  108. package/lib/operations/getEvmAccount.js.map +1 -0
  109. package/lib/operations/getEvmAccountByName.d.ts +22 -0
  110. package/lib/operations/getEvmAccountByName.d.ts.map +1 -0
  111. package/lib/operations/getEvmAccountByName.js +30 -0
  112. package/lib/operations/getEvmAccountByName.js.map +1 -0
  113. package/lib/operations/getEvmEip7702DelegationOperationById.d.ts +22 -0
  114. package/lib/operations/getEvmEip7702DelegationOperationById.d.ts.map +1 -0
  115. package/lib/operations/getEvmEip7702DelegationOperationById.js +48 -0
  116. package/lib/operations/getEvmEip7702DelegationOperationById.js.map +1 -0
  117. package/lib/operations/getEvmSmartAccount.d.ts +23 -0
  118. package/lib/operations/getEvmSmartAccount.d.ts.map +1 -0
  119. package/lib/operations/getEvmSmartAccount.js +31 -0
  120. package/lib/operations/getEvmSmartAccount.js.map +1 -0
  121. package/lib/operations/getEvmSmartAccountByName.d.ts +23 -0
  122. package/lib/operations/getEvmSmartAccountByName.d.ts.map +1 -0
  123. package/lib/operations/getEvmSmartAccountByName.js +31 -0
  124. package/lib/operations/getEvmSmartAccountByName.js.map +1 -0
  125. package/lib/operations/getEvmSwapPrice.d.ts +21 -0
  126. package/lib/operations/getEvmSwapPrice.d.ts.map +1 -0
  127. package/lib/operations/getEvmSwapPrice.js +27 -0
  128. package/lib/operations/getEvmSwapPrice.js.map +1 -0
  129. package/lib/operations/getOnrampOrderById.d.ts +39 -0
  130. package/lib/operations/getOnrampOrderById.d.ts.map +1 -0
  131. package/lib/operations/getOnrampOrderById.js +56 -0
  132. package/lib/operations/getOnrampOrderById.js.map +1 -0
  133. package/lib/operations/getOnrampUserLimits.d.ts +24 -0
  134. package/lib/operations/getOnrampUserLimits.d.ts.map +1 -0
  135. package/lib/operations/getOnrampUserLimits.js +38 -0
  136. package/lib/operations/getOnrampUserLimits.js.map +1 -0
  137. package/lib/operations/getPolicyById.d.ts +23 -0
  138. package/lib/operations/getPolicyById.d.ts.map +1 -0
  139. package/lib/operations/getPolicyById.js +29 -0
  140. package/lib/operations/getPolicyById.js.map +1 -0
  141. package/lib/operations/getSQLGrammar.d.ts +14 -0
  142. package/lib/operations/getSQLGrammar.d.ts.map +1 -0
  143. package/lib/operations/getSQLGrammar.js +20 -0
  144. package/lib/operations/getSQLGrammar.js.map +1 -0
  145. package/lib/operations/getSolanaAccount.d.ts +22 -0
  146. package/lib/operations/getSolanaAccount.d.ts.map +1 -0
  147. package/lib/operations/getSolanaAccount.js +28 -0
  148. package/lib/operations/getSolanaAccount.js.map +1 -0
  149. package/lib/operations/getSolanaAccountByName.d.ts +22 -0
  150. package/lib/operations/getSolanaAccountByName.d.ts.map +1 -0
  151. package/lib/operations/getSolanaAccountByName.js +30 -0
  152. package/lib/operations/getSolanaAccountByName.js.map +1 -0
  153. package/lib/operations/getUserOperation.d.ts +39 -0
  154. package/lib/operations/getUserOperation.d.ts.map +1 -0
  155. package/lib/operations/getUserOperation.js +66 -0
  156. package/lib/operations/getUserOperation.js.map +1 -0
  157. package/lib/operations/getWebhookSubscription.d.ts +37 -0
  158. package/lib/operations/getWebhookSubscription.d.ts.map +1 -0
  159. package/lib/operations/getWebhookSubscription.js +48 -0
  160. package/lib/operations/getWebhookSubscription.js.map +1 -0
  161. package/lib/operations/importEndUser.d.ts +56 -0
  162. package/lib/operations/importEndUser.d.ts.map +1 -0
  163. package/lib/operations/importEndUser.js +62 -0
  164. package/lib/operations/importEndUser.js.map +1 -0
  165. package/lib/operations/importEvmAccount.d.ts +31 -0
  166. package/lib/operations/importEvmAccount.d.ts.map +1 -0
  167. package/lib/operations/importEvmAccount.js +37 -0
  168. package/lib/operations/importEvmAccount.js.map +1 -0
  169. package/lib/operations/importSolanaAccount.d.ts +30 -0
  170. package/lib/operations/importSolanaAccount.d.ts.map +1 -0
  171. package/lib/operations/importSolanaAccount.js +38 -0
  172. package/lib/operations/importSolanaAccount.js.map +1 -0
  173. package/lib/operations/index.d.ts +74 -0
  174. package/lib/operations/index.d.ts.map +1 -0
  175. package/lib/operations/index.js +74 -0
  176. package/lib/operations/index.js.map +1 -0
  177. package/lib/operations/listDataTokenBalances.d.ts +37 -0
  178. package/lib/operations/listDataTokenBalances.d.ts.map +1 -0
  179. package/lib/operations/listDataTokenBalances.js +48 -0
  180. package/lib/operations/listDataTokenBalances.js.map +1 -0
  181. package/lib/operations/listEndUsers.d.ts +53 -0
  182. package/lib/operations/listEndUsers.d.ts.map +1 -0
  183. package/lib/operations/listEndUsers.js +59 -0
  184. package/lib/operations/listEndUsers.js.map +1 -0
  185. package/lib/operations/listEvmAccounts.d.ts +28 -0
  186. package/lib/operations/listEvmAccounts.d.ts.map +1 -0
  187. package/lib/operations/listEvmAccounts.js +34 -0
  188. package/lib/operations/listEvmAccounts.js.map +1 -0
  189. package/lib/operations/listEvmSmartAccounts.d.ts +29 -0
  190. package/lib/operations/listEvmSmartAccounts.d.ts.map +1 -0
  191. package/lib/operations/listEvmSmartAccounts.js +37 -0
  192. package/lib/operations/listEvmSmartAccounts.js.map +1 -0
  193. package/lib/operations/listEvmTokenBalances.d.ts +37 -0
  194. package/lib/operations/listEvmTokenBalances.d.ts.map +1 -0
  195. package/lib/operations/listEvmTokenBalances.js +48 -0
  196. package/lib/operations/listEvmTokenBalances.js.map +1 -0
  197. package/lib/operations/listPolicies.d.ts +31 -0
  198. package/lib/operations/listPolicies.d.ts.map +1 -0
  199. package/lib/operations/listPolicies.js +37 -0
  200. package/lib/operations/listPolicies.js.map +1 -0
  201. package/lib/operations/listSolanaAccounts.d.ts +29 -0
  202. package/lib/operations/listSolanaAccounts.d.ts.map +1 -0
  203. package/lib/operations/listSolanaAccounts.js +37 -0
  204. package/lib/operations/listSolanaAccounts.js.map +1 -0
  205. package/lib/operations/listSolanaTokenBalances.d.ts +36 -0
  206. package/lib/operations/listSolanaTokenBalances.d.ts.map +1 -0
  207. package/lib/operations/listSolanaTokenBalances.js +47 -0
  208. package/lib/operations/listSolanaTokenBalances.js.map +1 -0
  209. package/lib/operations/listSpendPermissions.d.ts +40 -0
  210. package/lib/operations/listSpendPermissions.d.ts.map +1 -0
  211. package/lib/operations/listSpendPermissions.js +60 -0
  212. package/lib/operations/listSpendPermissions.js.map +1 -0
  213. package/lib/operations/listTokensForAccount.d.ts +23 -0
  214. package/lib/operations/listTokensForAccount.d.ts.map +1 -0
  215. package/lib/operations/listTokensForAccount.js +34 -0
  216. package/lib/operations/listTokensForAccount.js.map +1 -0
  217. package/lib/operations/listWebhookSubscriptions.d.ts +42 -0
  218. package/lib/operations/listWebhookSubscriptions.d.ts.map +1 -0
  219. package/lib/operations/listWebhookSubscriptions.js +50 -0
  220. package/lib/operations/listWebhookSubscriptions.js.map +1 -0
  221. package/lib/operations/prepareAndSendUserOperation.d.ts +53 -0
  222. package/lib/operations/prepareAndSendUserOperation.d.ts.map +1 -0
  223. package/lib/operations/prepareAndSendUserOperation.js +93 -0
  224. package/lib/operations/prepareAndSendUserOperation.js.map +1 -0
  225. package/lib/operations/prepareUserOperation.d.ts +46 -0
  226. package/lib/operations/prepareUserOperation.d.ts.map +1 -0
  227. package/lib/operations/prepareUserOperation.js +86 -0
  228. package/lib/operations/prepareUserOperation.js.map +1 -0
  229. package/lib/operations/requestEvmFaucet.d.ts +22 -0
  230. package/lib/operations/requestEvmFaucet.d.ts.map +1 -0
  231. package/lib/operations/requestEvmFaucet.js +32 -0
  232. package/lib/operations/requestEvmFaucet.js.map +1 -0
  233. package/lib/operations/requestSolanaFaucet.d.ts +21 -0
  234. package/lib/operations/requestSolanaFaucet.d.ts.map +1 -0
  235. package/lib/operations/requestSolanaFaucet.js +29 -0
  236. package/lib/operations/requestSolanaFaucet.js.map +1 -0
  237. package/lib/operations/revokeSpendPermission.d.ts +48 -0
  238. package/lib/operations/revokeSpendPermission.d.ts.map +1 -0
  239. package/lib/operations/revokeSpendPermission.js +86 -0
  240. package/lib/operations/revokeSpendPermission.js.map +1 -0
  241. package/lib/operations/runSQLQuery.d.ts +47 -0
  242. package/lib/operations/runSQLQuery.d.ts.map +1 -0
  243. package/lib/operations/runSQLQuery.js +74 -0
  244. package/lib/operations/runSQLQuery.js.map +1 -0
  245. package/lib/operations/sendEvmTransaction.d.ts +44 -0
  246. package/lib/operations/sendEvmTransaction.d.ts.map +1 -0
  247. package/lib/operations/sendEvmTransaction.js +64 -0
  248. package/lib/operations/sendEvmTransaction.js.map +1 -0
  249. package/lib/operations/sendSolanaTransaction.d.ts +38 -0
  250. package/lib/operations/sendSolanaTransaction.d.ts.map +1 -0
  251. package/lib/operations/sendSolanaTransaction.js +46 -0
  252. package/lib/operations/sendSolanaTransaction.js.map +1 -0
  253. package/lib/operations/sendUserOperation.d.ts +43 -0
  254. package/lib/operations/sendUserOperation.d.ts.map +1 -0
  255. package/lib/operations/sendUserOperation.js +71 -0
  256. package/lib/operations/sendUserOperation.js.map +1 -0
  257. package/lib/operations/settleX402Payment.d.ts +23 -0
  258. package/lib/operations/settleX402Payment.d.ts.map +1 -0
  259. package/lib/operations/settleX402Payment.js +79 -0
  260. package/lib/operations/settleX402Payment.js.map +1 -0
  261. package/lib/operations/signEvmHash.d.ts +27 -0
  262. package/lib/operations/signEvmHash.d.ts.map +1 -0
  263. package/lib/operations/signEvmHash.js +33 -0
  264. package/lib/operations/signEvmHash.js.map +1 -0
  265. package/lib/operations/signEvmMessage.d.ts +28 -0
  266. package/lib/operations/signEvmMessage.d.ts.map +1 -0
  267. package/lib/operations/signEvmMessage.js +34 -0
  268. package/lib/operations/signEvmMessage.js.map +1 -0
  269. package/lib/operations/signEvmTransaction.d.ts +29 -0
  270. package/lib/operations/signEvmTransaction.d.ts.map +1 -0
  271. package/lib/operations/signEvmTransaction.js +40 -0
  272. package/lib/operations/signEvmTransaction.js.map +1 -0
  273. package/lib/operations/signEvmTypedData.d.ts +36 -0
  274. package/lib/operations/signEvmTypedData.d.ts.map +1 -0
  275. package/lib/operations/signEvmTypedData.js +45 -0
  276. package/lib/operations/signEvmTypedData.js.map +1 -0
  277. package/lib/operations/signSolanaMessage.d.ts +28 -0
  278. package/lib/operations/signSolanaMessage.d.ts.map +1 -0
  279. package/lib/operations/signSolanaMessage.js +38 -0
  280. package/lib/operations/signSolanaMessage.js.map +1 -0
  281. package/lib/operations/signSolanaTransaction.d.ts +33 -0
  282. package/lib/operations/signSolanaTransaction.d.ts.map +1 -0
  283. package/lib/operations/signSolanaTransaction.js +44 -0
  284. package/lib/operations/signSolanaTransaction.js.map +1 -0
  285. package/lib/operations/supportedX402PaymentKinds.d.ts +21 -0
  286. package/lib/operations/supportedX402PaymentKinds.d.ts.map +1 -0
  287. package/lib/operations/supportedX402PaymentKinds.js +40 -0
  288. package/lib/operations/supportedX402PaymentKinds.js.map +1 -0
  289. package/lib/operations/updateEvmAccount.d.ts +28 -0
  290. package/lib/operations/updateEvmAccount.d.ts.map +1 -0
  291. package/lib/operations/updateEvmAccount.js +34 -0
  292. package/lib/operations/updateEvmAccount.js.map +1 -0
  293. package/lib/operations/updateEvmSmartAccount.d.ts +24 -0
  294. package/lib/operations/updateEvmSmartAccount.d.ts.map +1 -0
  295. package/lib/operations/updateEvmSmartAccount.js +32 -0
  296. package/lib/operations/updateEvmSmartAccount.js.map +1 -0
  297. package/lib/operations/updatePolicy.d.ts +29 -0
  298. package/lib/operations/updatePolicy.d.ts.map +1 -0
  299. package/lib/operations/updatePolicy.js +35 -0
  300. package/lib/operations/updatePolicy.js.map +1 -0
  301. package/lib/operations/updateSolanaAccount.d.ts +28 -0
  302. package/lib/operations/updateSolanaAccount.d.ts.map +1 -0
  303. package/lib/operations/updateSolanaAccount.js +36 -0
  304. package/lib/operations/updateSolanaAccount.js.map +1 -0
  305. package/lib/operations/updateWebhookSubscription.d.ts +47 -0
  306. package/lib/operations/updateWebhookSubscription.d.ts.map +1 -0
  307. package/lib/operations/updateWebhookSubscription.js +58 -0
  308. package/lib/operations/updateWebhookSubscription.js.map +1 -0
  309. package/lib/operations/validateEndUserAccessToken.d.ts +44 -0
  310. package/lib/operations/validateEndUserAccessToken.d.ts.map +1 -0
  311. package/lib/operations/validateEndUserAccessToken.js +52 -0
  312. package/lib/operations/validateEndUserAccessToken.js.map +1 -0
  313. package/lib/operations/verifyX402Payment.d.ts +21 -0
  314. package/lib/operations/verifyX402Payment.d.ts.map +1 -0
  315. package/lib/operations/verifyX402Payment.js +72 -0
  316. package/lib/operations/verifyX402Payment.js.map +1 -0
  317. package/lib/retry.d.ts +22 -0
  318. package/lib/retry.d.ts.map +1 -0
  319. package/lib/retry.js +21 -0
  320. package/lib/retry.js.map +1 -0
  321. package/lib/sensitive.d.ts +5 -0
  322. package/lib/sensitive.d.ts.map +1 -0
  323. package/lib/sensitive.js +5 -0
  324. package/lib/sensitive.js.map +1 -0
  325. package/lib/traits.d.ts +5 -0
  326. package/lib/traits.d.ts.map +1 -0
  327. package/lib/traits.js +5 -0
  328. package/lib/traits.js.map +1 -0
  329. package/package.json +82 -9
  330. package/src/category.ts +4 -0
  331. package/src/client.ts +290 -0
  332. package/src/credentials.ts +65 -0
  333. package/src/errors.ts +694 -0
  334. package/src/index.ts +15 -0
  335. package/src/operations/addEndUserEvmAccount.ts +44 -0
  336. package/src/operations/addEndUserEvmSmartAccount.ts +53 -0
  337. package/src/operations/addEndUserSolanaAccount.ts +46 -0
  338. package/src/operations/createEndUser.ts +87 -0
  339. package/src/operations/createEvmAccount.ts +42 -0
  340. package/src/operations/createEvmEip7702Delegation.ts +63 -0
  341. package/src/operations/createEvmSmartAccount.ts +42 -0
  342. package/src/operations/createEvmSwapQuote.ts +44 -0
  343. package/src/operations/createOnrampOrder.ts +89 -0
  344. package/src/operations/createOnrampSession.ts +80 -0
  345. package/src/operations/createPolicy.ts +38 -0
  346. package/src/operations/createSolanaAccount.ts +42 -0
  347. package/src/operations/createSpendPermission.ts +110 -0
  348. package/src/operations/createWebhookSubscription.ts +92 -0
  349. package/src/operations/deletePolicy.ts +32 -0
  350. package/src/operations/deleteWebhookSubscription.ts +42 -0
  351. package/src/operations/exportEvmAccount.ts +39 -0
  352. package/src/operations/exportEvmAccountByName.ts +45 -0
  353. package/src/operations/exportSolanaAccount.ts +41 -0
  354. package/src/operations/exportSolanaAccountByName.ts +48 -0
  355. package/src/operations/getEndUser.ts +68 -0
  356. package/src/operations/getEvmAccount.ts +32 -0
  357. package/src/operations/getEvmAccountByName.ts +34 -0
  358. package/src/operations/getEvmEip7702DelegationOperationById.ts +56 -0
  359. package/src/operations/getEvmSmartAccount.ts +35 -0
  360. package/src/operations/getEvmSmartAccountByName.ts +41 -0
  361. package/src/operations/getEvmSwapPrice.ts +31 -0
  362. package/src/operations/getOnrampOrderById.ts +62 -0
  363. package/src/operations/getOnrampUserLimits.ts +44 -0
  364. package/src/operations/getPolicyById.ts +35 -0
  365. package/src/operations/getSQLGrammar.ts +26 -0
  366. package/src/operations/getSolanaAccount.ts +34 -0
  367. package/src/operations/getSolanaAccountByName.ts +40 -0
  368. package/src/operations/getUserOperation.ts +82 -0
  369. package/src/operations/getWebhookSubscription.ts +60 -0
  370. package/src/operations/importEndUser.ts +78 -0
  371. package/src/operations/importEvmAccount.ts +43 -0
  372. package/src/operations/importSolanaAccount.ts +42 -0
  373. package/src/operations/index.ts +73 -0
  374. package/src/operations/listDataTokenBalances.ts +59 -0
  375. package/src/operations/listEndUsers.ts +77 -0
  376. package/src/operations/listEvmAccounts.ts +40 -0
  377. package/src/operations/listEvmSmartAccounts.ts +45 -0
  378. package/src/operations/listEvmTokenBalances.ts +58 -0
  379. package/src/operations/listPolicies.ts +43 -0
  380. package/src/operations/listSolanaAccounts.ts +43 -0
  381. package/src/operations/listSolanaTokenBalances.ts +59 -0
  382. package/src/operations/listSpendPermissions.ts +70 -0
  383. package/src/operations/listTokensForAccount.ts +42 -0
  384. package/src/operations/listWebhookSubscriptions.ts +62 -0
  385. package/src/operations/prepareAndSendUserOperation.ts +113 -0
  386. package/src/operations/prepareUserOperation.ts +104 -0
  387. package/src/operations/requestEvmFaucet.ts +38 -0
  388. package/src/operations/requestSolanaFaucet.ts +33 -0
  389. package/src/operations/revokeSpendPermission.ts +103 -0
  390. package/src/operations/runSQLQuery.ts +92 -0
  391. package/src/operations/sendEvmTransaction.ts +70 -0
  392. package/src/operations/sendSolanaTransaction.ts +55 -0
  393. package/src/operations/sendUserOperation.ts +87 -0
  394. package/src/operations/settleX402Payment.ts +87 -0
  395. package/src/operations/signEvmHash.ts +37 -0
  396. package/src/operations/signEvmMessage.ts +40 -0
  397. package/src/operations/signEvmTransaction.ts +46 -0
  398. package/src/operations/signEvmTypedData.ts +53 -0
  399. package/src/operations/signSolanaMessage.ts +46 -0
  400. package/src/operations/signSolanaTransaction.ts +53 -0
  401. package/src/operations/supportedX402PaymentKinds.ts +52 -0
  402. package/src/operations/updateEvmAccount.ts +40 -0
  403. package/src/operations/updateEvmSmartAccount.ts +39 -0
  404. package/src/operations/updatePolicy.ts +41 -0
  405. package/src/operations/updateSolanaAccount.ts +40 -0
  406. package/src/operations/updateWebhookSubscription.ts +70 -0
  407. package/src/operations/validateEndUserAccessToken.ts +74 -0
  408. package/src/operations/verifyX402Payment.ts +80 -0
  409. package/src/retry.ts +37 -0
  410. package/src/sensitive.ts +4 -0
  411. package/src/traits.ts +4 -0
  412. package/index.js +0 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAYlE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK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ACH,qBAAa,oBAAqB,SAAQ,yBAMV;CAAG;;;;;;;;;AAEnC;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,uBAMT;CAAG"}
package/lib/errors.js ADDED
@@ -0,0 +1,466 @@
1
+ /**
2
+ * Coinbase-specific error types.
3
+ *
4
+ * Re-exports common HTTP errors from sdk-core and adds Coinbase CDP-specific
5
+ * error types based on the `ErrorType` enum from the OpenAPI spec.
6
+ *
7
+ * Coinbase errors have the shape:
8
+ * ```json
9
+ * {
10
+ * "errorType": "invalid_request",
11
+ * "errorMessage": "Invalid request.",
12
+ * "correlationId": "41deb8d59a9dc9a7-IAD",
13
+ * "errorLink": "https://docs.cdp.coinbase.com/api-reference/v2/errors#invalid-request"
14
+ * }
15
+ * ```
16
+ */
17
+ export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeout, InternalServerError, Locked, NotFound, ServiceUnavailable, TooManyRequests, Unauthorized, UnprocessableEntity, HTTP_STATUS_MAP, DEFAULT_ERRORS, API_ERRORS, } from "@distilled.cloud/core/errors";
18
+ import { BadGateway, BadRequest, Forbidden, InternalServerError, NotFound, ServiceUnavailable, TooManyRequests, Unauthorized, } from "@distilled.cloud/core/errors";
19
+ import * as Schema from "effect/Schema";
20
+ import * as Category from "@distilled.cloud/core/category";
21
+ // ============================================================================
22
+ // Base fields shared by all Coinbase CDP errors
23
+ // ============================================================================
24
+ const CoinbaseErrorFields = {
25
+ errorType: Schema.optional(Schema.String),
26
+ errorMessage: Schema.optional(Schema.String),
27
+ correlationId: Schema.optional(Schema.String),
28
+ errorLink: Schema.optional(Schema.String),
29
+ };
30
+ // ============================================================================
31
+ // Coinbase-specific error types (from the ErrorType enum in the OpenAPI spec)
32
+ // ============================================================================
33
+ // --- Payment / Billing ---
34
+ /**
35
+ * Payment method required — a valid payment method is required (HTTP 402).
36
+ * errorType: "payment_method_required" | "payment_required"
37
+ */
38
+ export class PaymentRequired extends Schema.TaggedErrorClass()("PaymentRequired", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
39
+ }
40
+ // --- Idempotency ---
41
+ /**
42
+ * Idempotency key conflict — the same key was used with different request params (HTTP 422).
43
+ * errorType: "idempotency_error"
44
+ */
45
+ export class IdempotencyError extends Schema.TaggedErrorClass()("IdempotencyError", CoinbaseErrorFields).pipe(Category.withConflictError) {
46
+ }
47
+ // --- Resource Conflicts ---
48
+ /**
49
+ * Resource already exists — trying to create a duplicate resource (HTTP 409).
50
+ * errorType: "already_exists"
51
+ */
52
+ export class AlreadyExists extends Schema.TaggedErrorClass()("AlreadyExists", CoinbaseErrorFields).pipe(Category.withAlreadyExistsError) {
53
+ }
54
+ // --- Faucet ---
55
+ /**
56
+ * Faucet limit exceeded — too many faucet requests.
57
+ * errorType: "faucet_limit_exceeded"
58
+ */
59
+ export class FaucetLimitExceeded extends Schema.TaggedErrorClass()("FaucetLimitExceeded", CoinbaseErrorFields).pipe(Category.withQuotaError) {
60
+ }
61
+ // --- Query ---
62
+ /**
63
+ * Invalid SQL query — the underlying SQL string is invalid.
64
+ * errorType: "invalid_sql_query"
65
+ */
66
+ export class InvalidSqlQuery extends Schema.TaggedErrorClass()("InvalidSqlQuery", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
67
+ }
68
+ // --- Signing / Transaction ---
69
+ /**
70
+ * Invalid signature — the transaction or message signature is invalid.
71
+ * errorType: "invalid_signature"
72
+ */
73
+ export class InvalidSignature extends Schema.TaggedErrorClass()("InvalidSignature", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
74
+ }
75
+ /**
76
+ * Malformed transaction — the transaction data is malformed.
77
+ * errorType: "malformed_transaction"
78
+ */
79
+ export class MalformedTransaction extends Schema.TaggedErrorClass()("MalformedTransaction", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
80
+ }
81
+ /**
82
+ * Settlement failed — payment settlement could not be completed.
83
+ * errorType: "settlement_failed"
84
+ */
85
+ export class SettlementFailed extends Schema.TaggedErrorClass()("SettlementFailed", CoinbaseErrorFields).pipe(Category.withServerError) {
86
+ }
87
+ // --- Timeout / Abort ---
88
+ /**
89
+ * Request timed out — the server did not respond in time.
90
+ * errorType: "timed_out"
91
+ */
92
+ export class TimedOut extends Schema.TaggedErrorClass()("TimedOut", CoinbaseErrorFields).pipe(Category.withTimeoutError, Category.withRetryable()) {
93
+ }
94
+ /**
95
+ * Client closed request — the client disconnected before the response.
96
+ * errorType: "client_closed_request"
97
+ */
98
+ export class ClientClosedRequest extends Schema.TaggedErrorClass()("ClientClosedRequest", CoinbaseErrorFields).pipe(Category.withAbortedError) {
99
+ }
100
+ /**
101
+ * Request canceled — the request was canceled.
102
+ * errorType: "request_canceled"
103
+ */
104
+ export class RequestCanceled extends Schema.TaggedErrorClass()("RequestCanceled", CoinbaseErrorFields).pipe(Category.withAbortedError) {
105
+ }
106
+ // --- Policy ---
107
+ /**
108
+ * Policy violation — the request violated an account or project policy.
109
+ * errorType: "policy_violation"
110
+ */
111
+ export class PolicyViolation extends Schema.TaggedErrorClass()("PolicyViolation", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
112
+ }
113
+ /**
114
+ * Policy in use — the policy cannot be deleted because it's in use.
115
+ * errorType: "policy_in_use"
116
+ */
117
+ export class PolicyInUse extends Schema.TaggedErrorClass()("PolicyInUse", CoinbaseErrorFields).pipe(Category.withConflictError) {
118
+ }
119
+ // --- Account Limits / State ---
120
+ /**
121
+ * Account limit exceeded — too many accounts created.
122
+ * errorType: "account_limit_exceeded"
123
+ */
124
+ export class AccountLimitExceeded extends Schema.TaggedErrorClass()("AccountLimitExceeded", CoinbaseErrorFields).pipe(Category.withQuotaError) {
125
+ }
126
+ /**
127
+ * Insufficient balance — the account does not have enough funds.
128
+ * errorType: "insufficient_balance"
129
+ */
130
+ export class InsufficientBalance extends Schema.TaggedErrorClass()("InsufficientBalance", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
131
+ }
132
+ /**
133
+ * Account not ready — the account is not in a ready state for the operation.
134
+ * errorType: "account_not_ready"
135
+ */
136
+ export class AccountNotReady extends Schema.TaggedErrorClass()("AccountNotReady", CoinbaseErrorFields).pipe(Category.withRetryableError, Category.withRetryable()) {
137
+ }
138
+ // --- MFA ---
139
+ /**
140
+ * MFA required — multi-factor authentication is required.
141
+ * errorType: "mfa_required"
142
+ */
143
+ export class MfaRequired extends Schema.TaggedErrorClass()("MfaRequired", CoinbaseErrorFields).pipe(Category.withAuthError) {
144
+ }
145
+ /**
146
+ * MFA already enrolled — the user already has MFA set up.
147
+ * errorType: "mfa_already_enrolled"
148
+ */
149
+ export class MfaAlreadyEnrolled extends Schema.TaggedErrorClass()("MfaAlreadyEnrolled", CoinbaseErrorFields).pipe(Category.withConflictError) {
150
+ }
151
+ /**
152
+ * MFA invalid code — the provided MFA code is incorrect.
153
+ * errorType: "mfa_invalid_code"
154
+ */
155
+ export class MfaInvalidCode extends Schema.TaggedErrorClass()("MfaInvalidCode", CoinbaseErrorFields).pipe(Category.withAuthError) {
156
+ }
157
+ /**
158
+ * MFA flow expired — the MFA verification flow has expired.
159
+ * errorType: "mfa_flow_expired"
160
+ */
161
+ export class MfaFlowExpired extends Schema.TaggedErrorClass()("MfaFlowExpired", CoinbaseErrorFields).pipe(Category.withAuthError) {
162
+ }
163
+ /**
164
+ * MFA not enrolled — the user has not set up MFA.
165
+ * errorType: "mfa_not_enrolled"
166
+ */
167
+ export class MfaNotEnrolled extends Schema.TaggedErrorClass()("MfaNotEnrolled", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
168
+ }
169
+ // --- Network / Swap ---
170
+ /**
171
+ * Network not tradable — the specified network does not support trading.
172
+ * errorType: "network_not_tradable"
173
+ */
174
+ export class NetworkNotTradable extends Schema.TaggedErrorClass()("NetworkNotTradable", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
175
+ }
176
+ // --- Guest (Onramp) ---
177
+ /**
178
+ * Guest permission denied — the guest user does not have permission for this action.
179
+ * errorType: "guest_permission_denied"
180
+ */
181
+ export class GuestPermissionDenied extends Schema.TaggedErrorClass()("GuestPermissionDenied", CoinbaseErrorFields).pipe(Category.withAuthError) {
182
+ }
183
+ /**
184
+ * Guest region forbidden — the guest user's region is not supported.
185
+ * errorType: "guest_region_forbidden"
186
+ */
187
+ export class GuestRegionForbidden extends Schema.TaggedErrorClass()("GuestRegionForbidden", CoinbaseErrorFields).pipe(Category.withAuthError) {
188
+ }
189
+ /**
190
+ * Guest transaction limit — the guest user has exceeded their transaction amount limit.
191
+ * errorType: "guest_transaction_limit"
192
+ */
193
+ export class GuestTransactionLimit extends Schema.TaggedErrorClass()("GuestTransactionLimit", CoinbaseErrorFields).pipe(Category.withQuotaError) {
194
+ }
195
+ /**
196
+ * Guest transaction count — the guest user has exceeded their transaction count limit.
197
+ * errorType: "guest_transaction_count"
198
+ */
199
+ export class GuestTransactionCount extends Schema.TaggedErrorClass()("GuestTransactionCount", CoinbaseErrorFields).pipe(Category.withQuotaError) {
200
+ }
201
+ // --- Verification ---
202
+ /**
203
+ * Phone number verification expired — the phone number verification has expired.
204
+ * errorType: "phone_number_verification_expired"
205
+ */
206
+ export class PhoneNumberVerificationExpired extends Schema.TaggedErrorClass()("PhoneNumberVerificationExpired", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
207
+ }
208
+ /**
209
+ * Document verification failed — the document verification check failed.
210
+ * errorType: "document_verification_failed"
211
+ */
212
+ export class DocumentVerificationFailed extends Schema.TaggedErrorClass()("DocumentVerificationFailed", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
213
+ }
214
+ // --- Recipient Allowlist ---
215
+ /**
216
+ * Recipient allowlist violation — the recipient address is not on the allowlist.
217
+ * errorType: "recipient_allowlist_violation"
218
+ */
219
+ export class RecipientAllowlistViolation extends Schema.TaggedErrorClass()("RecipientAllowlistViolation", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
220
+ }
221
+ /**
222
+ * Recipient allowlist pending — the recipient address is pending allowlist approval.
223
+ * errorType: "recipient_allowlist_pending"
224
+ */
225
+ export class RecipientAllowlistPending extends Schema.TaggedErrorClass()("RecipientAllowlistPending", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
226
+ }
227
+ // --- Travel Rules ---
228
+ /**
229
+ * Travel rules recipient violation — the recipient violates travel rule requirements.
230
+ * errorType: "travel_rules_recipient_violation"
231
+ */
232
+ export class TravelRulesRecipientViolation extends Schema.TaggedErrorClass()("TravelRulesRecipientViolation", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
233
+ }
234
+ /**
235
+ * Travel rules field missing — a required travel rules field is missing.
236
+ * errorType: "travel_rules_field_missing"
237
+ */
238
+ export class TravelRulesFieldMissing extends Schema.TaggedErrorClass()("TravelRulesFieldMissing", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
239
+ }
240
+ // --- Account Validation ---
241
+ /**
242
+ * Source account invalid — the source account is not valid for this operation.
243
+ * errorType: "source_account_invalid"
244
+ */
245
+ export class SourceAccountInvalid extends Schema.TaggedErrorClass()("SourceAccountInvalid", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
246
+ }
247
+ /**
248
+ * Target account invalid — the target account is not valid for this operation.
249
+ * errorType: "target_account_invalid"
250
+ */
251
+ export class TargetAccountInvalid extends Schema.TaggedErrorClass()("TargetAccountInvalid", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
252
+ }
253
+ /**
254
+ * Source account not found — the source account does not exist.
255
+ * errorType: "source_account_not_found"
256
+ */
257
+ export class SourceAccountNotFound extends Schema.TaggedErrorClass()("SourceAccountNotFound", CoinbaseErrorFields).pipe(Category.withNotFoundError) {
258
+ }
259
+ /**
260
+ * Target account not found — the target account does not exist.
261
+ * errorType: "target_account_not_found"
262
+ */
263
+ export class TargetAccountNotFound extends Schema.TaggedErrorClass()("TargetAccountNotFound", CoinbaseErrorFields).pipe(Category.withNotFoundError) {
264
+ }
265
+ // --- Asset Support ---
266
+ /**
267
+ * Source asset not supported — the source asset is not supported for this operation.
268
+ * errorType: "source_asset_not_supported"
269
+ */
270
+ export class SourceAssetNotSupported extends Schema.TaggedErrorClass()("SourceAssetNotSupported", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
271
+ }
272
+ /**
273
+ * Target asset not supported — the target asset is not supported for this operation.
274
+ * errorType: "target_asset_not_supported"
275
+ */
276
+ export class TargetAssetNotSupported extends Schema.TaggedErrorClass()("TargetAssetNotSupported", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
277
+ }
278
+ /**
279
+ * Transfer asset not supported — the asset is not supported for transfers.
280
+ * errorType: "transfer_asset_not_supported"
281
+ */
282
+ export class TransferAssetNotSupported extends Schema.TaggedErrorClass()("TransferAssetNotSupported", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
283
+ }
284
+ /**
285
+ * Asset mismatch — the source and target assets do not match as expected.
286
+ * errorType: "asset_mismatch"
287
+ */
288
+ export class AssetMismatch extends Schema.TaggedErrorClass()("AssetMismatch", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
289
+ }
290
+ // --- Transfer Validation ---
291
+ /**
292
+ * Target email invalid — the target email address is not valid.
293
+ * errorType: "target_email_invalid"
294
+ */
295
+ export class TargetEmailInvalid extends Schema.TaggedErrorClass()("TargetEmailInvalid", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
296
+ }
297
+ /**
298
+ * Target onchain address invalid — the target onchain address is not valid.
299
+ * errorType: "target_onchain_address_invalid"
300
+ */
301
+ export class TargetOnchainAddressInvalid extends Schema.TaggedErrorClass()("TargetOnchainAddressInvalid", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
302
+ }
303
+ /**
304
+ * Transfer amount invalid — the transfer amount is not valid.
305
+ * errorType: "transfer_amount_invalid"
306
+ */
307
+ export class TransferAmountInvalid extends Schema.TaggedErrorClass()("TransferAmountInvalid", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
308
+ }
309
+ // --- Metadata ---
310
+ /**
311
+ * Metadata too many entries — too many metadata entries were provided.
312
+ * errorType: "metadata_too_many_entries"
313
+ */
314
+ export class MetadataTooManyEntries extends Schema.TaggedErrorClass()("MetadataTooManyEntries", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
315
+ }
316
+ /**
317
+ * Metadata key too long — a metadata key exceeds the maximum length.
318
+ * errorType: "metadata_key_too_long"
319
+ */
320
+ export class MetadataKeyTooLong extends Schema.TaggedErrorClass()("MetadataKeyTooLong", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
321
+ }
322
+ /**
323
+ * Metadata value too long — a metadata value exceeds the maximum length.
324
+ * errorType: "metadata_value_too_long"
325
+ */
326
+ export class MetadataValueTooLong extends Schema.TaggedErrorClass()("MetadataValueTooLong", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
327
+ }
328
+ // --- Order ---
329
+ /**
330
+ * Order quote expired — the order quote has expired and must be refreshed.
331
+ * errorType: "order_quote_expired"
332
+ */
333
+ export class OrderQuoteExpired extends Schema.TaggedErrorClass()("OrderQuoteExpired", CoinbaseErrorFields).pipe(Category.withBadRequestError) {
334
+ }
335
+ /**
336
+ * Order already filled — the order has already been filled.
337
+ * errorType: "order_already_filled"
338
+ */
339
+ export class OrderAlreadyFilled extends Schema.TaggedErrorClass()("OrderAlreadyFilled", CoinbaseErrorFields).pipe(Category.withConflictError) {
340
+ }
341
+ /**
342
+ * Order already canceled — the order has already been canceled.
343
+ * errorType: "order_already_canceled"
344
+ */
345
+ export class OrderAlreadyCanceled extends Schema.TaggedErrorClass()("OrderAlreadyCanceled", CoinbaseErrorFields).pipe(Category.withConflictError) {
346
+ }
347
+ // ============================================================================
348
+ // Coinbase-specific HTTP status code mappings
349
+ // ============================================================================
350
+ /**
351
+ * Coinbase HTTP status code to error class mapping.
352
+ * Extends core HTTP_STATUS_MAP with Coinbase-specific statuses.
353
+ */
354
+ export const COINBASE_HTTP_STATUS_MAP = {
355
+ 402: PaymentRequired,
356
+ };
357
+ // ============================================================================
358
+ // Error type to error class mapping (for errorType-based dispatching)
359
+ // ============================================================================
360
+ /**
361
+ * Maps standard Coinbase `errorType` values to core HTTP error classes.
362
+ * These represent generic error types that map directly to HTTP status codes.
363
+ */
364
+ export const STANDARD_ERROR_TYPE_MAP = {
365
+ bad_gateway: BadGateway,
366
+ forbidden: Forbidden,
367
+ internal_server_error: InternalServerError,
368
+ invalid_request: BadRequest,
369
+ not_found: NotFound,
370
+ rate_limit_exceeded: TooManyRequests,
371
+ service_unavailable: ServiceUnavailable,
372
+ unauthorized: Unauthorized,
373
+ };
374
+ /**
375
+ * Maps Coinbase-specific `errorType` values to their corresponding error classes.
376
+ * Used by the client's matchError function for type-based error dispatching.
377
+ */
378
+ export const ERROR_TYPE_MAP = {
379
+ // Resource conflicts
380
+ already_exists: AlreadyExists,
381
+ idempotency_error: IdempotencyError,
382
+ policy_in_use: PolicyInUse,
383
+ // Quota / limits
384
+ faucet_limit_exceeded: FaucetLimitExceeded,
385
+ account_limit_exceeded: AccountLimitExceeded,
386
+ guest_transaction_limit: GuestTransactionLimit,
387
+ guest_transaction_count: GuestTransactionCount,
388
+ // Payment / billing
389
+ payment_method_required: PaymentRequired,
390
+ payment_required: PaymentRequired,
391
+ settlement_failed: SettlementFailed,
392
+ // Signing / transaction
393
+ invalid_signature: InvalidSignature,
394
+ invalid_sql_query: InvalidSqlQuery,
395
+ malformed_transaction: MalformedTransaction,
396
+ network_not_tradable: NetworkNotTradable,
397
+ // Timeout / abort
398
+ timed_out: TimedOut,
399
+ client_closed_request: ClientClosedRequest,
400
+ request_canceled: RequestCanceled,
401
+ // Policy
402
+ policy_violation: PolicyViolation,
403
+ // Account state
404
+ insufficient_balance: InsufficientBalance,
405
+ account_not_ready: AccountNotReady,
406
+ // MFA
407
+ mfa_required: MfaRequired,
408
+ mfa_already_enrolled: MfaAlreadyEnrolled,
409
+ mfa_invalid_code: MfaInvalidCode,
410
+ mfa_flow_expired: MfaFlowExpired,
411
+ mfa_not_enrolled: MfaNotEnrolled,
412
+ // Guest (onramp)
413
+ guest_permission_denied: GuestPermissionDenied,
414
+ guest_region_forbidden: GuestRegionForbidden,
415
+ // Verification
416
+ phone_number_verification_expired: PhoneNumberVerificationExpired,
417
+ document_verification_failed: DocumentVerificationFailed,
418
+ // Recipient allowlist
419
+ recipient_allowlist_violation: RecipientAllowlistViolation,
420
+ recipient_allowlist_pending: RecipientAllowlistPending,
421
+ // Travel rules
422
+ travel_rules_recipient_violation: TravelRulesRecipientViolation,
423
+ travel_rules_field_missing: TravelRulesFieldMissing,
424
+ // Account validation
425
+ source_account_invalid: SourceAccountInvalid,
426
+ target_account_invalid: TargetAccountInvalid,
427
+ source_account_not_found: SourceAccountNotFound,
428
+ target_account_not_found: TargetAccountNotFound,
429
+ // Asset support
430
+ source_asset_not_supported: SourceAssetNotSupported,
431
+ target_asset_not_supported: TargetAssetNotSupported,
432
+ transfer_asset_not_supported: TransferAssetNotSupported,
433
+ asset_mismatch: AssetMismatch,
434
+ // Transfer validation
435
+ target_email_invalid: TargetEmailInvalid,
436
+ target_onchain_address_invalid: TargetOnchainAddressInvalid,
437
+ transfer_amount_invalid: TransferAmountInvalid,
438
+ // Metadata
439
+ metadata_too_many_entries: MetadataTooManyEntries,
440
+ metadata_key_too_long: MetadataKeyTooLong,
441
+ metadata_value_too_long: MetadataValueTooLong,
442
+ // Order
443
+ order_quote_expired: OrderQuoteExpired,
444
+ order_already_filled: OrderAlreadyFilled,
445
+ order_already_canceled: OrderAlreadyCanceled,
446
+ };
447
+ // ============================================================================
448
+ // Catch-all errors
449
+ // ============================================================================
450
+ /**
451
+ * Unknown Coinbase error — returned when an errorType is not recognized.
452
+ */
453
+ export class UnknownCoinbaseError extends Schema.TaggedErrorClass()("UnknownCoinbaseError", {
454
+ ...CoinbaseErrorFields,
455
+ body: Schema.Unknown,
456
+ }).pipe(Category.withServerError) {
457
+ }
458
+ /**
459
+ * Schema parse error wrapper — returned when the response body fails schema decoding.
460
+ */
461
+ export class CoinbaseParseError extends Schema.TaggedErrorClass()("CoinbaseParseError", {
462
+ body: Schema.Unknown,
463
+ cause: Schema.Unknown,
464
+ }).pipe(Category.withParseError) {
465
+ }
466
+ //# source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cAAc,EAAE,aAAa;IAE7B,sBAAsB;IACtB,oBAAoB,EAAE,kBAAkB;IACxC,8BAA8B,EAAE,2BAA2B;IAC3D,uBAAuB,EAAE,qBAAqB;IAE9C,WAAW;IACX,yBAAyB,EAAE,sBAAsB;IACjD,qBAAqB,EAAE,kBAAkB;IACzC,uBAAuB,EAAE,oBAAoB;IAE7C,QAAQ;IACR,mBAAmB,EAAE,iBAAiB;IACtC,oBAAoB,EAAE,kBAAkB;IACxC,sBAAsB,EAAE,oBAAoB;CACpC,CAAC;AAEX,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,MAAM,CAAC,gBAAgB,EAAwB,CACvF,sBAAsB,EACtB;IACE,GAAG,mBAAmB;IACtB,IAAI,EAAE,MAAM,CAAC,OAAO;CACrB,CACF,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;CAAG;AAEnC;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,MAAM,CAAC,gBAAgB,EAAsB,CACnF,oBAAoB,EACpB;IACE,IAAI,EAAE,MAAM,CAAC,OAAO;IACpB,KAAK,EAAE,MAAM,CAAC,OAAO;CACtB,CACF,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC;CAAG"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Coinbase SDK for Effect
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * import * as Coinbase from "@distilled.cloud/coinbase";
7
+ * ```
8
+ */
9
+ export * from "./credentials.ts";
10
+ export * as Category from "./category.ts";
11
+ export * as T from "./traits.ts";
12
+ export * as Retry from "./retry.ts";
13
+ export { API } from "./client.ts";
14
+ export * from "./errors.ts";
15
+ export { SensitiveString, SensitiveNullableString } from "./sensitive.ts";
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,kBAAkB,CAAC;AACjC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Coinbase SDK for Effect
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * import * as Coinbase from "@distilled.cloud/coinbase";
7
+ * ```
8
+ */
9
+ export * from "./credentials.js";
10
+ export * as Category from "./category.js";
11
+ export * as T from "./traits.js";
12
+ export * as Retry from "./retry.js";
13
+ export { API } from "./client.js";
14
+ export * from "./errors.js";
15
+ export { SensitiveString, SensitiveNullableString } from "./sensitive.js";
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,kBAAkB,CAAC;AACjC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,30 @@
1
+ import * as Schema from "effect/Schema";
2
+ export declare const AddEndUserEvmAccountInput: Schema.Struct<{
3
+ readonly userId: Schema.String;
4
+ }>;
5
+ export type AddEndUserEvmAccountInput = typeof AddEndUserEvmAccountInput.Type;
6
+ export declare const AddEndUserEvmAccountOutput: Schema.Struct<{
7
+ readonly evmAccount: Schema.Struct<{
8
+ readonly address: Schema.String;
9
+ readonly createdAt: Schema.String;
10
+ }>;
11
+ }>;
12
+ export type AddEndUserEvmAccountOutput = typeof AddEndUserEvmAccountOutput.Type;
13
+ /**
14
+ * Add an EVM account to an end user
15
+ *
16
+ * Adds a new EVM EOA account to an existing end user. End users can have up to 10 EVM accounts.
17
+ * This API is intended to be used by the developer's own backend, and is authenticated using the developer's CDP API key.
18
+ *
19
+ * @param userId - The ID of the end user to add the account to.
20
+ * @param X-Wallet-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
21
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
22
+ section of our Authentication docs for more details on how to generate your Wallet Token.
23
+
24
+ * @param X-Idempotency-Key - An optional string request header for making requests safely retryable.
25
+ When included, duplicate requests with the same key will return identical responses.
26
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
27
+
28
+ */
29
+ export declare const addEndUserEvmAccount: any;
30
+ //# sourceMappingURL=addEndUserEvmAccount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addEndUserEvmAccount.d.ts","sourceRoot":"","sources":["../../src/operations/addEndUserEvmAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,eAAO,MAAM,yBAAyB;;EAGmC,CAAC;AAC1E,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAC,IAAI,CAAC;AAG9E,eAAO,MAAM,0BAA0B;;;;;EAMnC,CAAC;AACL,MAAM,MAAM,0BAA0B,GAAG,OAAO,0BAA0B,CAAC,IAAI,CAAC;AAGhF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,KAKhC,CAAC"}
@@ -0,0 +1,38 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client";
3
+ import * as T from "../traits";
4
+ // Input Schema
5
+ export const AddEndUserEvmAccountInput =
6
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
7
+ userId: Schema.String.pipe(T.PathParam()),
8
+ }).pipe(T.Http({ method: "POST", path: "/v2/end-users/{userId}/evm" }));
9
+ // Output Schema
10
+ export const AddEndUserEvmAccountOutput =
11
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
12
+ evmAccount: Schema.Struct({
13
+ address: Schema.String,
14
+ createdAt: Schema.String,
15
+ }),
16
+ });
17
+ // The operation
18
+ /**
19
+ * Add an EVM account to an end user
20
+ *
21
+ * Adds a new EVM EOA account to an existing end user. End users can have up to 10 EVM accounts.
22
+ * This API is intended to be used by the developer's own backend, and is authenticated using the developer's CDP API key.
23
+ *
24
+ * @param userId - The ID of the end user to add the account to.
25
+ * @param X-Wallet-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
26
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
27
+ section of our Authentication docs for more details on how to generate your Wallet Token.
28
+
29
+ * @param X-Idempotency-Key - An optional string request header for making requests safely retryable.
30
+ When included, duplicate requests with the same key will return identical responses.
31
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
32
+
33
+ */
34
+ export const addEndUserEvmAccount = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
35
+ inputSchema: AddEndUserEvmAccountInput,
36
+ outputSchema: AddEndUserEvmAccountOutput,
37
+ }));
38
+ //# sourceMappingURL=addEndUserEvmAccount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addEndUserEvmAccount.js","sourceRoot":"","sources":["../../src/operations/addEndUserEvmAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,KAAK,CAAC,MAAM,WAAW,CAAC;AAE/B,eAAe;AACf,MAAM,CAAC,MAAM,yBAAyB;AACpC,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;CAC1C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,4BAA4B,EAAE,CAAC,CAAC,CAAC;AAG1E,gBAAgB;AAChB,MAAM,CAAC,MAAM,0BAA0B;AACrC,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC;IACxC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC;QACxB,OAAO,EAAE,MAAM,CAAC,MAAM;QACtB,SAAS,EAAE,MAAM,CAAC,MAAM;KACzB,CAAC;CACH,CAAC,CAAC;AAGL,gBAAgB;AAChB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CACtE,GAAG,EAAE,CAAC,CAAC;IACL,WAAW,EAAE,yBAAyB;IACtC,YAAY,EAAE,0BAA0B;CACzC,CAAC,CACH,CAAC"}
@@ -0,0 +1,32 @@
1
+ import * as Schema from "effect/Schema";
2
+ export declare const AddEndUserEvmSmartAccountInput: Schema.Struct<{
3
+ readonly userId: Schema.String;
4
+ readonly enableSpendPermissions: Schema.optional<Schema.Boolean>;
5
+ }>;
6
+ export type AddEndUserEvmSmartAccountInput = typeof AddEndUserEvmSmartAccountInput.Type;
7
+ export declare const AddEndUserEvmSmartAccountOutput: Schema.Struct<{
8
+ readonly evmSmartAccount: Schema.Struct<{
9
+ readonly address: Schema.String;
10
+ readonly ownerAddresses: Schema.$Array<Schema.String>;
11
+ readonly createdAt: Schema.String;
12
+ }>;
13
+ }>;
14
+ export type AddEndUserEvmSmartAccountOutput = typeof AddEndUserEvmSmartAccountOutput.Type;
15
+ /**
16
+ * Add an EVM smart account to an end user
17
+ *
18
+ * Creates an EVM smart account for an existing end user. The backend will create a new EVM EOA account to serve as the owner of the smart account.
19
+ * This API is intended to be used by the developer's own backend, and is authenticated using the developer's CDP API key.
20
+ *
21
+ * @param userId - The ID of the end user to add the smart account to.
22
+ * @param X-Wallet-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
23
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
24
+ section of our Authentication docs for more details on how to generate your Wallet Token.
25
+
26
+ * @param X-Idempotency-Key - An optional string request header for making requests safely retryable.
27
+ When included, duplicate requests with the same key will return identical responses.
28
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
29
+
30
+ */
31
+ export declare const addEndUserEvmSmartAccount: any;
32
+ //# sourceMappingURL=addEndUserEvmSmartAccount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addEndUserEvmSmartAccount.d.ts","sourceRoot":"","sources":["../../src/operations/addEndUserEvmSmartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,eAAO,MAAM,8BAA8B;;;EASxC,CAAC;AACJ,MAAM,MAAM,8BAA8B,GACxC,OAAO,8BAA8B,CAAC,IAAI,CAAC;AAG7C,eAAO,MAAM,+BAA+B;;;;;;EAOxC,CAAC;AACL,MAAM,MAAM,+BAA+B,GACzC,OAAO,+BAA+B,CAAC,IAAI,CAAC;AAG9C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,yBAAyB,KAKrC,CAAC"}