@coinbase/cdp-core 0.0.52 → 0.0.54

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 (635) hide show
  1. package/dist/esm/index.native10.js +11 -9
  2. package/dist/esm/index.native100.js +13 -8
  3. package/dist/esm/index.native101.js +4 -7
  4. package/dist/esm/index.native102.js +2 -72
  5. package/dist/esm/index.native103.js +4 -18
  6. package/dist/esm/index.native104.js +18 -3
  7. package/dist/esm/index.native105.js +7 -4
  8. package/dist/esm/index.native106.js +3 -4
  9. package/dist/esm/index.native107.js +19 -4
  10. package/dist/esm/index.native108.js +8 -19
  11. package/dist/esm/index.native109.js +7 -52
  12. package/dist/esm/index.native11.js +8 -6
  13. package/dist/esm/index.native110.js +71 -17
  14. package/dist/esm/index.native111.js +14 -16
  15. package/dist/esm/index.native112.js +3 -8
  16. package/dist/esm/index.native113.js +4 -30
  17. package/dist/esm/index.native114.js +4 -7
  18. package/dist/esm/index.native115.js +4 -20
  19. package/dist/esm/index.native116.js +18 -53
  20. package/dist/esm/index.native117.js +52 -10
  21. package/dist/esm/index.native118.js +18 -2
  22. package/dist/esm/index.native119.js +20 -44
  23. package/dist/esm/index.native12.js +10 -8
  24. package/dist/esm/index.native120.js +8 -13
  25. package/dist/esm/index.native121.js +30 -4
  26. package/dist/esm/index.native122.js +8 -2
  27. package/dist/esm/index.native123.js +18 -18
  28. package/dist/esm/index.native124.js +20 -38
  29. package/dist/esm/index.native125.js +5 -2
  30. package/dist/esm/index.native126.js +19 -69
  31. package/dist/esm/index.native127.js +79 -34
  32. package/dist/esm/index.native128.js +101 -18
  33. package/dist/esm/index.native129.js +31 -18
  34. package/dist/esm/index.native13.js +10 -8
  35. package/dist/esm/index.native130.js +6 -79
  36. package/dist/esm/index.native131.js +72 -97
  37. package/dist/esm/index.native132.js +3 -32
  38. package/dist/esm/index.native133.js +20 -6
  39. package/dist/esm/index.native134.js +10 -79
  40. package/dist/esm/index.native135.js +19 -46
  41. package/dist/esm/index.native136.js +93 -20
  42. package/dist/esm/index.native137.js +20 -9
  43. package/dist/esm/index.native138.js +114 -16
  44. package/dist/esm/index.native139.js +2 -94
  45. package/dist/esm/index.native14.js +7 -5
  46. package/dist/esm/index.native140.js +109 -21
  47. package/dist/esm/index.native141.js +2 -118
  48. package/dist/esm/index.native142.js +47 -2
  49. package/dist/esm/index.native143.js +37 -107
  50. package/dist/esm/index.native145.js +70 -2
  51. package/dist/esm/index.native146.js +35 -5
  52. package/dist/esm/index.native147.js +20 -14
  53. package/dist/esm/index.native148.js +7 -17
  54. package/dist/esm/index.native149.js +2 -28
  55. package/dist/esm/index.native15.js +7 -5
  56. package/dist/esm/index.native150.js +377 -7
  57. package/dist/esm/index.native151.js +833 -11
  58. package/dist/esm/index.native152.js +5 -13
  59. package/dist/esm/index.native153.js +16 -8
  60. package/dist/esm/index.native154.js +28 -17
  61. package/dist/esm/index.native155.js +6 -79
  62. package/dist/esm/index.native156.js +10 -78
  63. package/dist/esm/index.native157.js +15 -0
  64. package/dist/esm/index.native158.js +12 -0
  65. package/dist/esm/index.native159.js +19 -0
  66. package/dist/esm/index.native16.js +4 -4
  67. package/dist/esm/index.native160.js +83 -0
  68. package/dist/esm/index.native161.js +17 -0
  69. package/dist/esm/index.native162.js +4 -0
  70. package/dist/esm/index.native163.js +4 -0
  71. package/dist/esm/index.native164.js +4 -0
  72. package/dist/esm/index.native165.js +81 -0
  73. package/dist/esm/index.native17.js +3 -3
  74. package/dist/esm/index.native19.js +7 -5
  75. package/dist/esm/index.native22.js +28 -3
  76. package/dist/esm/index.native23.js +5 -2
  77. package/dist/esm/index.native24.js +49 -82
  78. package/dist/esm/index.native25.js +2 -18
  79. package/dist/esm/index.native26.js +85 -15
  80. package/dist/esm/index.native27.js +15 -118
  81. package/dist/esm/index.native28.js +15 -58
  82. package/dist/esm/index.native29.js +116 -12
  83. package/dist/esm/index.native3.js +48 -6
  84. package/dist/esm/index.native30.js +61 -42
  85. package/dist/esm/index.native31.js +12 -25
  86. package/dist/esm/index.native32.js +42 -153
  87. package/dist/esm/index.native33.js +150 -41
  88. package/dist/esm/index.native34.js +43 -40
  89. package/dist/esm/index.native35.js +41 -49
  90. package/dist/esm/index.native36.js +47 -71
  91. package/dist/esm/index.native37.js +70 -23
  92. package/dist/esm/index.native38.js +22 -156
  93. package/dist/esm/index.native39.js +157 -45
  94. package/dist/esm/index.native40.js +46 -71
  95. package/dist/esm/index.native41.js +66 -944
  96. package/dist/esm/index.native42.js +951 -2
  97. package/dist/esm/index.native43.js +2 -50
  98. package/dist/esm/index.native44.js +49 -27
  99. package/dist/esm/index.native45.js +26 -375
  100. package/dist/esm/index.native46.js +374 -26
  101. package/dist/esm/index.native47.js +26 -26
  102. package/dist/esm/index.native48.js +28 -16
  103. package/dist/esm/index.native49.js +15 -21
  104. package/dist/esm/index.native50.js +21 -49
  105. package/dist/esm/index.native51.js +51 -2
  106. package/dist/esm/index.native52.js +2 -2
  107. package/dist/esm/index.native53.js +4 -2
  108. package/dist/esm/index.native54.js +2 -68
  109. package/dist/esm/index.native55.js +37 -336
  110. package/dist/esm/index.native56.js +364 -17
  111. package/dist/esm/index.native57.js +16 -44
  112. package/dist/esm/index.native58.js +45 -13
  113. package/dist/esm/index.native59.js +13 -55
  114. package/dist/esm/index.native60.js +55 -6
  115. package/dist/esm/index.native61.js +6 -21
  116. package/dist/esm/index.native62.js +21 -11
  117. package/dist/esm/index.native63.js +11 -3
  118. package/dist/esm/index.native64.js +3 -3
  119. package/dist/esm/index.native65.js +3 -34
  120. package/dist/esm/index.native66.js +32 -10
  121. package/dist/esm/index.native67.js +12 -4
  122. package/dist/esm/index.native68.js +4 -28
  123. package/dist/esm/index.native69.js +28 -6
  124. package/dist/esm/index.native7.js +217 -215
  125. package/dist/esm/index.native70.js +6 -42
  126. package/dist/esm/index.native71.js +41 -54
  127. package/dist/esm/index.native72.js +54 -126
  128. package/dist/esm/index.native73.js +127 -23
  129. package/dist/esm/index.native74.js +22 -11
  130. package/dist/esm/index.native75.js +9 -101
  131. package/dist/esm/index.native76.js +104 -6
  132. package/dist/esm/index.native77.js +7 -3
  133. package/dist/esm/index.native78.js +3 -15
  134. package/dist/esm/index.native79.js +14 -34
  135. package/dist/esm/index.native8.js +12 -10
  136. package/dist/esm/index.native80.js +31 -75
  137. package/dist/esm/index.native81.js +79 -2
  138. package/dist/esm/index.native82.js +2 -2
  139. package/dist/esm/index.native83.js +2 -13
  140. package/dist/esm/index.native84.js +8 -33
  141. package/dist/esm/index.native85.js +36 -5
  142. package/dist/esm/index.native86.js +5 -33
  143. package/dist/esm/index.native87.js +34 -8
  144. package/dist/esm/index.native88.js +8 -10
  145. package/dist/esm/index.native89.js +10 -11
  146. package/dist/esm/index.native9.js +18 -16
  147. package/dist/esm/index.native90.js +11 -13
  148. package/dist/esm/index.native91.js +13 -18
  149. package/dist/esm/index.native92.js +18 -5
  150. package/dist/esm/index.native93.js +6 -5
  151. package/dist/esm/index.native94.js +5 -11
  152. package/dist/esm/index.native95.js +10 -4
  153. package/dist/esm/index.native96.js +53 -17
  154. package/dist/esm/index.native97.js +10 -7
  155. package/dist/esm/index.native98.js +2 -4
  156. package/dist/esm/index.native99.js +44 -19
  157. package/dist/esm/index.web10.js +8 -6
  158. package/dist/esm/index.web100.js +9 -2
  159. package/dist/esm/index.web101.js +7 -4
  160. package/dist/esm/index.web102.js +70 -17
  161. package/dist/esm/index.web103.js +18 -7
  162. package/dist/esm/index.web104.js +3 -3
  163. package/dist/esm/index.web105.js +4 -19
  164. package/dist/esm/index.web106.js +4 -8
  165. package/dist/esm/index.web107.js +4 -7
  166. package/dist/esm/index.web108.js +18 -70
  167. package/dist/esm/index.web109.js +47 -13
  168. package/dist/esm/index.web11.js +10 -8
  169. package/dist/esm/index.web110.js +17 -3
  170. package/dist/esm/index.web111.js +20 -4
  171. package/dist/esm/index.web112.js +8 -4
  172. package/dist/esm/index.web113.js +30 -4
  173. package/dist/esm/index.web114.js +7 -19
  174. package/dist/esm/index.web115.js +16 -48
  175. package/dist/esm/index.web116.js +4 -17
  176. package/dist/esm/index.web117.js +53 -19
  177. package/dist/esm/index.web118.js +10 -8
  178. package/dist/esm/index.web119.js +2 -31
  179. package/dist/esm/index.web12.js +10 -8
  180. package/dist/esm/index.web120.js +45 -8
  181. package/dist/esm/index.web121.js +13 -20
  182. package/dist/esm/index.web122.js +2 -21
  183. package/dist/esm/index.web123.js +20 -38
  184. package/dist/esm/index.web124.js +5 -2
  185. package/dist/esm/index.web125.js +19 -69
  186. package/dist/esm/index.web126.js +79 -34
  187. package/dist/esm/index.web127.js +101 -18
  188. package/dist/esm/index.web128.js +31 -18
  189. package/dist/esm/index.web129.js +6 -79
  190. package/dist/esm/index.web13.js +7 -5
  191. package/dist/esm/index.web130.js +72 -97
  192. package/dist/esm/index.web131.js +3 -32
  193. package/dist/esm/index.web132.js +2 -7
  194. package/dist/esm/index.web133.js +107 -77
  195. package/dist/esm/index.web134.js +2 -21
  196. package/dist/esm/index.web135.js +21 -10
  197. package/dist/esm/index.web136.js +9 -19
  198. package/dist/esm/index.web137.js +15 -89
  199. package/dist/esm/index.web138.js +92 -19
  200. package/dist/esm/index.web139.js +18 -115
  201. package/dist/esm/index.web14.js +7 -5
  202. package/dist/esm/index.web140.js +118 -2
  203. package/dist/esm/index.web141.js +46 -108
  204. package/dist/esm/index.web142.js +39 -2
  205. package/dist/esm/index.web143.js +2 -47
  206. package/dist/esm/index.web144.js +70 -2
  207. package/dist/esm/index.web145.js +35 -5
  208. package/dist/esm/index.web146.js +20 -17
  209. package/dist/esm/index.web147.js +8 -28
  210. package/dist/esm/index.web148.js +2 -8
  211. package/dist/esm/index.web149.js +378 -11
  212. package/dist/esm/index.web15.js +4 -4
  213. package/dist/esm/index.web150.js +832 -12
  214. package/dist/esm/index.web151.js +5 -10
  215. package/dist/esm/index.web152.js +15 -14
  216. package/dist/esm/index.web153.js +25 -78
  217. package/dist/esm/index.web154.js +8 -15
  218. package/dist/esm/index.web155.js +10 -78
  219. package/dist/esm/index.web156.js +15 -0
  220. package/dist/esm/index.web157.js +12 -0
  221. package/dist/esm/index.web158.js +19 -0
  222. package/dist/esm/index.web159.js +83 -0
  223. package/dist/esm/index.web16.js +3 -3
  224. package/dist/esm/index.web160.js +17 -0
  225. package/dist/esm/index.web161.js +4 -0
  226. package/dist/esm/index.web162.js +4 -0
  227. package/dist/esm/index.web163.js +4 -0
  228. package/dist/esm/index.web164.js +81 -0
  229. package/dist/esm/index.web18.js +7 -5
  230. package/dist/esm/index.web21.js +1 -1
  231. package/dist/esm/index.web22.js +53 -2
  232. package/dist/esm/index.web23.js +2 -86
  233. package/dist/esm/index.web24.js +87 -15
  234. package/dist/esm/index.web25.js +15 -17
  235. package/dist/esm/index.web26.js +15 -116
  236. package/dist/esm/index.web27.js +92 -34
  237. package/dist/esm/index.web28.js +58 -12
  238. package/dist/esm/index.web29.js +15 -42
  239. package/dist/esm/index.web30.js +42 -28
  240. package/dist/esm/index.web31.js +28 -153
  241. package/dist/esm/index.web32.js +150 -41
  242. package/dist/esm/index.web33.js +43 -40
  243. package/dist/esm/index.web34.js +41 -49
  244. package/dist/esm/index.web35.js +47 -71
  245. package/dist/esm/index.web36.js +70 -23
  246. package/dist/esm/index.web37.js +22 -156
  247. package/dist/esm/index.web38.js +157 -45
  248. package/dist/esm/index.web39.js +46 -71
  249. package/dist/esm/index.web40.js +66 -944
  250. package/dist/esm/index.web41.js +951 -2
  251. package/dist/esm/index.web42.js +2 -50
  252. package/dist/esm/index.web43.js +49 -27
  253. package/dist/esm/index.web44.js +27 -16
  254. package/dist/esm/index.web45.js +372 -18
  255. package/dist/esm/index.web46.js +28 -50
  256. package/dist/esm/index.web47.js +26 -374
  257. package/dist/esm/index.web48.js +1 -1
  258. package/dist/esm/index.web49.js +1 -1
  259. package/dist/esm/index.web51.js +16 -28
  260. package/dist/esm/index.web52.js +22 -28
  261. package/dist/esm/index.web53.js +51 -2
  262. package/dist/esm/index.web54.js +2 -2
  263. package/dist/esm/index.web55.js +2 -18
  264. package/dist/esm/index.web56.js +16 -44
  265. package/dist/esm/index.web57.js +45 -13
  266. package/dist/esm/index.web58.js +13 -55
  267. package/dist/esm/index.web59.js +55 -6
  268. package/dist/esm/index.web6.js +217 -215
  269. package/dist/esm/index.web60.js +6 -21
  270. package/dist/esm/index.web61.js +21 -11
  271. package/dist/esm/index.web62.js +11 -3
  272. package/dist/esm/index.web63.js +3 -3
  273. package/dist/esm/index.web64.js +3 -34
  274. package/dist/esm/index.web65.js +32 -10
  275. package/dist/esm/index.web66.js +12 -4
  276. package/dist/esm/index.web67.js +4 -28
  277. package/dist/esm/index.web68.js +28 -6
  278. package/dist/esm/index.web69.js +6 -42
  279. package/dist/esm/index.web7.js +12 -10
  280. package/dist/esm/index.web70.js +41 -54
  281. package/dist/esm/index.web71.js +54 -126
  282. package/dist/esm/index.web72.js +127 -23
  283. package/dist/esm/index.web73.js +22 -11
  284. package/dist/esm/index.web74.js +9 -101
  285. package/dist/esm/index.web75.js +104 -6
  286. package/dist/esm/index.web76.js +7 -3
  287. package/dist/esm/index.web77.js +3 -15
  288. package/dist/esm/index.web78.js +14 -34
  289. package/dist/esm/index.web79.js +31 -75
  290. package/dist/esm/index.web8.js +18 -16
  291. package/dist/esm/index.web80.js +79 -2
  292. package/dist/esm/index.web81.js +2 -2
  293. package/dist/esm/index.web82.js +2 -13
  294. package/dist/esm/index.web83.js +8 -33
  295. package/dist/esm/index.web84.js +36 -5
  296. package/dist/esm/index.web85.js +5 -33
  297. package/dist/esm/index.web86.js +34 -8
  298. package/dist/esm/index.web87.js +8 -10
  299. package/dist/esm/index.web88.js +10 -11
  300. package/dist/esm/index.web89.js +11 -13
  301. package/dist/esm/index.web9.js +11 -9
  302. package/dist/esm/index.web90.js +13 -18
  303. package/dist/esm/index.web91.js +18 -5
  304. package/dist/esm/index.web92.js +6 -5
  305. package/dist/esm/index.web93.js +5 -11
  306. package/dist/esm/index.web94.js +10 -54
  307. package/dist/esm/index.web95.js +4 -10
  308. package/dist/esm/index.web96.js +19 -2
  309. package/dist/esm/index.web97.js +8 -45
  310. package/dist/esm/index.web98.js +3 -13
  311. package/dist/esm/index.web99.js +19 -4
  312. package/dist/native/index.native10.js +11 -9
  313. package/dist/native/index.native100.js +13 -8
  314. package/dist/native/index.native101.js +4 -7
  315. package/dist/native/index.native102.js +2 -72
  316. package/dist/native/index.native103.js +4 -18
  317. package/dist/native/index.native104.js +18 -3
  318. package/dist/native/index.native105.js +7 -4
  319. package/dist/native/index.native106.js +3 -4
  320. package/dist/native/index.native107.js +19 -4
  321. package/dist/native/index.native108.js +8 -19
  322. package/dist/native/index.native109.js +7 -52
  323. package/dist/native/index.native11.js +8 -6
  324. package/dist/native/index.native110.js +71 -17
  325. package/dist/native/index.native111.js +14 -16
  326. package/dist/native/index.native112.js +3 -8
  327. package/dist/native/index.native113.js +4 -30
  328. package/dist/native/index.native114.js +4 -7
  329. package/dist/native/index.native115.js +4 -20
  330. package/dist/native/index.native116.js +18 -53
  331. package/dist/native/index.native117.js +52 -10
  332. package/dist/native/index.native118.js +18 -2
  333. package/dist/native/index.native119.js +20 -44
  334. package/dist/native/index.native12.js +10 -8
  335. package/dist/native/index.native120.js +8 -13
  336. package/dist/native/index.native121.js +30 -4
  337. package/dist/native/index.native122.js +8 -2
  338. package/dist/native/index.native123.js +18 -18
  339. package/dist/native/index.native124.js +20 -38
  340. package/dist/native/index.native125.js +5 -2
  341. package/dist/native/index.native126.js +19 -69
  342. package/dist/native/index.native127.js +79 -34
  343. package/dist/native/index.native128.js +101 -18
  344. package/dist/native/index.native129.js +31 -18
  345. package/dist/native/index.native13.js +10 -8
  346. package/dist/native/index.native130.js +6 -79
  347. package/dist/native/index.native131.js +72 -97
  348. package/dist/native/index.native132.js +3 -32
  349. package/dist/native/index.native133.js +20 -6
  350. package/dist/native/index.native134.js +10 -79
  351. package/dist/native/index.native135.js +19 -46
  352. package/dist/native/index.native136.js +93 -20
  353. package/dist/native/index.native137.js +20 -9
  354. package/dist/native/index.native138.js +114 -16
  355. package/dist/native/index.native139.js +2 -94
  356. package/dist/native/index.native14.js +7 -5
  357. package/dist/native/index.native140.js +109 -21
  358. package/dist/native/index.native141.js +2 -118
  359. package/dist/native/index.native142.js +47 -2
  360. package/dist/native/index.native143.js +37 -107
  361. package/dist/native/index.native145.js +70 -2
  362. package/dist/native/index.native146.js +35 -5
  363. package/dist/native/index.native147.js +20 -14
  364. package/dist/native/index.native148.js +7 -17
  365. package/dist/native/index.native149.js +2 -28
  366. package/dist/native/index.native15.js +7 -5
  367. package/dist/native/index.native150.js +377 -7
  368. package/dist/native/index.native151.js +833 -11
  369. package/dist/native/index.native152.js +5 -13
  370. package/dist/native/index.native153.js +16 -8
  371. package/dist/native/index.native154.js +28 -17
  372. package/dist/native/index.native155.js +6 -79
  373. package/dist/native/index.native156.js +10 -78
  374. package/dist/native/index.native157.js +15 -0
  375. package/dist/native/index.native158.js +12 -0
  376. package/dist/native/index.native159.js +19 -0
  377. package/dist/native/index.native16.js +4 -4
  378. package/dist/native/index.native160.js +83 -0
  379. package/dist/native/index.native161.js +17 -0
  380. package/dist/native/index.native162.js +4 -0
  381. package/dist/native/index.native163.js +4 -0
  382. package/dist/native/index.native164.js +4 -0
  383. package/dist/native/index.native165.js +81 -0
  384. package/dist/native/index.native17.js +3 -3
  385. package/dist/native/index.native19.js +7 -5
  386. package/dist/native/index.native22.js +28 -3
  387. package/dist/native/index.native23.js +5 -2
  388. package/dist/native/index.native24.js +49 -82
  389. package/dist/native/index.native25.js +2 -18
  390. package/dist/native/index.native26.js +85 -15
  391. package/dist/native/index.native27.js +15 -118
  392. package/dist/native/index.native28.js +15 -58
  393. package/dist/native/index.native29.js +116 -12
  394. package/dist/native/index.native3.js +48 -6
  395. package/dist/native/index.native30.js +61 -42
  396. package/dist/native/index.native31.js +12 -25
  397. package/dist/native/index.native32.js +42 -153
  398. package/dist/native/index.native33.js +150 -41
  399. package/dist/native/index.native34.js +43 -40
  400. package/dist/native/index.native35.js +41 -49
  401. package/dist/native/index.native36.js +47 -71
  402. package/dist/native/index.native37.js +70 -23
  403. package/dist/native/index.native38.js +22 -156
  404. package/dist/native/index.native39.js +157 -45
  405. package/dist/native/index.native40.js +46 -71
  406. package/dist/native/index.native41.js +66 -944
  407. package/dist/native/index.native42.js +951 -2
  408. package/dist/native/index.native43.js +2 -50
  409. package/dist/native/index.native44.js +49 -27
  410. package/dist/native/index.native45.js +26 -375
  411. package/dist/native/index.native46.js +374 -26
  412. package/dist/native/index.native47.js +26 -26
  413. package/dist/native/index.native48.js +28 -16
  414. package/dist/native/index.native49.js +15 -21
  415. package/dist/native/index.native50.js +21 -49
  416. package/dist/native/index.native51.js +51 -2
  417. package/dist/native/index.native52.js +2 -2
  418. package/dist/native/index.native53.js +4 -2
  419. package/dist/native/index.native54.js +2 -68
  420. package/dist/native/index.native55.js +37 -336
  421. package/dist/native/index.native56.js +364 -17
  422. package/dist/native/index.native57.js +16 -44
  423. package/dist/native/index.native58.js +45 -13
  424. package/dist/native/index.native59.js +13 -55
  425. package/dist/native/index.native60.js +55 -6
  426. package/dist/native/index.native61.js +6 -21
  427. package/dist/native/index.native62.js +21 -11
  428. package/dist/native/index.native63.js +11 -3
  429. package/dist/native/index.native64.js +3 -3
  430. package/dist/native/index.native65.js +3 -34
  431. package/dist/native/index.native66.js +32 -10
  432. package/dist/native/index.native67.js +12 -4
  433. package/dist/native/index.native68.js +4 -28
  434. package/dist/native/index.native69.js +28 -6
  435. package/dist/native/index.native7.js +217 -215
  436. package/dist/native/index.native70.js +6 -42
  437. package/dist/native/index.native71.js +41 -54
  438. package/dist/native/index.native72.js +54 -126
  439. package/dist/native/index.native73.js +127 -23
  440. package/dist/native/index.native74.js +22 -11
  441. package/dist/native/index.native75.js +9 -101
  442. package/dist/native/index.native76.js +104 -6
  443. package/dist/native/index.native77.js +7 -3
  444. package/dist/native/index.native78.js +3 -15
  445. package/dist/native/index.native79.js +14 -34
  446. package/dist/native/index.native8.js +12 -10
  447. package/dist/native/index.native80.js +31 -75
  448. package/dist/native/index.native81.js +79 -2
  449. package/dist/native/index.native82.js +2 -2
  450. package/dist/native/index.native83.js +2 -13
  451. package/dist/native/index.native84.js +8 -33
  452. package/dist/native/index.native85.js +36 -5
  453. package/dist/native/index.native86.js +5 -33
  454. package/dist/native/index.native87.js +34 -8
  455. package/dist/native/index.native88.js +8 -10
  456. package/dist/native/index.native89.js +10 -11
  457. package/dist/native/index.native9.js +18 -16
  458. package/dist/native/index.native90.js +11 -13
  459. package/dist/native/index.native91.js +13 -18
  460. package/dist/native/index.native92.js +18 -5
  461. package/dist/native/index.native93.js +6 -5
  462. package/dist/native/index.native94.js +5 -11
  463. package/dist/native/index.native95.js +10 -4
  464. package/dist/native/index.native96.js +53 -17
  465. package/dist/native/index.native97.js +10 -7
  466. package/dist/native/index.native98.js +2 -4
  467. package/dist/native/index.native99.js +44 -19
  468. package/dist/native-types/auth/oAuthManager.d.ts +1 -1
  469. package/dist/native-types/auth/types.d.ts +1 -1
  470. package/dist/native-types/platform/types.d.ts +1 -1
  471. package/dist/native-types/types.d.ts +1 -0
  472. package/dist/types/auth/oAuthManager.d.ts +1 -1
  473. package/dist/types/auth/types.d.ts +1 -1
  474. package/dist/types/platform/types.d.ts +1 -1
  475. package/dist/types/types.d.ts +1 -0
  476. package/dist/web/index.web10.js +8 -6
  477. package/dist/web/index.web100.js +9 -2
  478. package/dist/web/index.web101.js +7 -4
  479. package/dist/web/index.web102.js +70 -17
  480. package/dist/web/index.web103.js +18 -7
  481. package/dist/web/index.web104.js +3 -3
  482. package/dist/web/index.web105.js +4 -19
  483. package/dist/web/index.web106.js +4 -8
  484. package/dist/web/index.web107.js +4 -7
  485. package/dist/web/index.web108.js +18 -70
  486. package/dist/web/index.web109.js +47 -13
  487. package/dist/web/index.web11.js +10 -8
  488. package/dist/web/index.web110.js +17 -3
  489. package/dist/web/index.web111.js +20 -4
  490. package/dist/web/index.web112.js +8 -4
  491. package/dist/web/index.web113.js +30 -4
  492. package/dist/web/index.web114.js +7 -19
  493. package/dist/web/index.web115.js +16 -48
  494. package/dist/web/index.web116.js +4 -17
  495. package/dist/web/index.web117.js +53 -19
  496. package/dist/web/index.web118.js +10 -8
  497. package/dist/web/index.web119.js +2 -31
  498. package/dist/web/index.web12.js +10 -8
  499. package/dist/web/index.web120.js +45 -8
  500. package/dist/web/index.web121.js +13 -20
  501. package/dist/web/index.web122.js +2 -21
  502. package/dist/web/index.web123.js +20 -38
  503. package/dist/web/index.web124.js +5 -2
  504. package/dist/web/index.web125.js +19 -69
  505. package/dist/web/index.web126.js +79 -34
  506. package/dist/web/index.web127.js +101 -18
  507. package/dist/web/index.web128.js +31 -18
  508. package/dist/web/index.web129.js +6 -79
  509. package/dist/web/index.web13.js +7 -5
  510. package/dist/web/index.web130.js +72 -97
  511. package/dist/web/index.web131.js +3 -32
  512. package/dist/web/index.web132.js +2 -7
  513. package/dist/web/index.web133.js +107 -77
  514. package/dist/web/index.web134.js +2 -21
  515. package/dist/web/index.web135.js +21 -10
  516. package/dist/web/index.web136.js +9 -19
  517. package/dist/web/index.web137.js +15 -89
  518. package/dist/web/index.web138.js +92 -19
  519. package/dist/web/index.web139.js +18 -115
  520. package/dist/web/index.web14.js +7 -5
  521. package/dist/web/index.web140.js +118 -2
  522. package/dist/web/index.web141.js +46 -108
  523. package/dist/web/index.web142.js +39 -2
  524. package/dist/web/index.web143.js +2 -47
  525. package/dist/web/index.web144.js +70 -2
  526. package/dist/web/index.web145.js +35 -5
  527. package/dist/web/index.web146.js +20 -17
  528. package/dist/web/index.web147.js +8 -28
  529. package/dist/web/index.web148.js +2 -8
  530. package/dist/web/index.web149.js +378 -11
  531. package/dist/web/index.web15.js +4 -4
  532. package/dist/web/index.web150.js +832 -12
  533. package/dist/web/index.web151.js +5 -10
  534. package/dist/web/index.web152.js +15 -14
  535. package/dist/web/index.web153.js +25 -78
  536. package/dist/web/index.web154.js +8 -15
  537. package/dist/web/index.web155.js +10 -78
  538. package/dist/web/index.web156.js +15 -0
  539. package/dist/web/index.web157.js +12 -0
  540. package/dist/web/index.web158.js +19 -0
  541. package/dist/web/index.web159.js +83 -0
  542. package/dist/web/index.web16.js +3 -3
  543. package/dist/web/index.web160.js +17 -0
  544. package/dist/web/index.web161.js +4 -0
  545. package/dist/web/index.web162.js +4 -0
  546. package/dist/web/index.web163.js +4 -0
  547. package/dist/web/index.web164.js +81 -0
  548. package/dist/web/index.web18.js +7 -5
  549. package/dist/web/index.web21.js +1 -1
  550. package/dist/web/index.web22.js +53 -2
  551. package/dist/web/index.web23.js +2 -86
  552. package/dist/web/index.web24.js +87 -15
  553. package/dist/web/index.web25.js +15 -17
  554. package/dist/web/index.web26.js +15 -116
  555. package/dist/web/index.web27.js +92 -34
  556. package/dist/web/index.web28.js +58 -12
  557. package/dist/web/index.web29.js +15 -42
  558. package/dist/web/index.web30.js +42 -28
  559. package/dist/web/index.web31.js +28 -153
  560. package/dist/web/index.web32.js +150 -41
  561. package/dist/web/index.web33.js +43 -40
  562. package/dist/web/index.web34.js +41 -49
  563. package/dist/web/index.web35.js +47 -71
  564. package/dist/web/index.web36.js +70 -23
  565. package/dist/web/index.web37.js +22 -156
  566. package/dist/web/index.web38.js +157 -45
  567. package/dist/web/index.web39.js +46 -71
  568. package/dist/web/index.web40.js +66 -944
  569. package/dist/web/index.web41.js +951 -2
  570. package/dist/web/index.web42.js +2 -50
  571. package/dist/web/index.web43.js +49 -27
  572. package/dist/web/index.web44.js +27 -16
  573. package/dist/web/index.web45.js +372 -18
  574. package/dist/web/index.web46.js +28 -50
  575. package/dist/web/index.web47.js +26 -374
  576. package/dist/web/index.web48.js +1 -1
  577. package/dist/web/index.web49.js +1 -1
  578. package/dist/web/index.web51.js +16 -28
  579. package/dist/web/index.web52.js +22 -28
  580. package/dist/web/index.web53.js +51 -2
  581. package/dist/web/index.web54.js +2 -2
  582. package/dist/web/index.web55.js +2 -18
  583. package/dist/web/index.web56.js +16 -44
  584. package/dist/web/index.web57.js +45 -13
  585. package/dist/web/index.web58.js +13 -55
  586. package/dist/web/index.web59.js +55 -6
  587. package/dist/web/index.web6.js +217 -215
  588. package/dist/web/index.web60.js +6 -21
  589. package/dist/web/index.web61.js +21 -11
  590. package/dist/web/index.web62.js +11 -3
  591. package/dist/web/index.web63.js +3 -3
  592. package/dist/web/index.web64.js +3 -34
  593. package/dist/web/index.web65.js +32 -10
  594. package/dist/web/index.web66.js +12 -4
  595. package/dist/web/index.web67.js +4 -28
  596. package/dist/web/index.web68.js +28 -6
  597. package/dist/web/index.web69.js +6 -42
  598. package/dist/web/index.web7.js +12 -10
  599. package/dist/web/index.web70.js +41 -54
  600. package/dist/web/index.web71.js +54 -126
  601. package/dist/web/index.web72.js +127 -23
  602. package/dist/web/index.web73.js +22 -11
  603. package/dist/web/index.web74.js +9 -101
  604. package/dist/web/index.web75.js +104 -6
  605. package/dist/web/index.web76.js +7 -3
  606. package/dist/web/index.web77.js +3 -15
  607. package/dist/web/index.web78.js +14 -34
  608. package/dist/web/index.web79.js +31 -75
  609. package/dist/web/index.web8.js +18 -16
  610. package/dist/web/index.web80.js +79 -2
  611. package/dist/web/index.web81.js +2 -2
  612. package/dist/web/index.web82.js +2 -13
  613. package/dist/web/index.web83.js +8 -33
  614. package/dist/web/index.web84.js +36 -5
  615. package/dist/web/index.web85.js +5 -33
  616. package/dist/web/index.web86.js +34 -8
  617. package/dist/web/index.web87.js +8 -10
  618. package/dist/web/index.web88.js +10 -11
  619. package/dist/web/index.web89.js +11 -13
  620. package/dist/web/index.web9.js +11 -9
  621. package/dist/web/index.web90.js +13 -18
  622. package/dist/web/index.web91.js +18 -5
  623. package/dist/web/index.web92.js +6 -5
  624. package/dist/web/index.web93.js +5 -11
  625. package/dist/web/index.web94.js +10 -54
  626. package/dist/web/index.web95.js +4 -10
  627. package/dist/web/index.web96.js +19 -2
  628. package/dist/web/index.web97.js +8 -45
  629. package/dist/web/index.web98.js +3 -13
  630. package/dist/web/index.web99.js +19 -4
  631. package/dist/web-types/auth/oAuthManager.d.ts +1 -1
  632. package/dist/web-types/auth/types.d.ts +1 -1
  633. package/dist/web-types/platform/types.d.ts +1 -1
  634. package/dist/web-types/types.d.ts +1 -0
  635. package/package.json +7 -3
@@ -1,86 +1,53 @@
1
- import { verifyOAuth as u } from "./index.native7.js";
2
- import { getPlatformOAuth as s } from "./index.native6.js";
3
- import "@coinbase/cdp-api-client";
4
- import "viem";
5
- class S {
6
- oauthFlowState = null;
7
- oauthStateChangeCallbacks = [];
8
- /**
9
- * Adds a callback to be called when the OAuth state changes.
10
- *
11
- * @param callback - The function to call when the OAuth state changes.
12
- */
13
- async addOAuthStateChangeCallback(t) {
14
- this.oauthStateChangeCallbacks.push(t), t(this.oauthFlowState);
15
- }
16
- /**
17
- * Sets the OAuth flow state.
18
- *
19
- * @param oauthFlowState - The OAuth flow state.
20
- */
21
- async setOAuthFlowState(t) {
22
- this.oauthFlowState = t, this.oauthStateChangeCallbacks.forEach((a) => a(this.oauthFlowState));
23
- }
24
- /**
25
- * Clears the OAuth flow state.
26
- */
27
- async clearOAuthFlowState() {
28
- this.oauthFlowState = null, this.oauthStateChangeCallbacks.forEach((t) => t(null));
29
- }
30
- /**
31
- * Gets the OAuth flow state.
32
- *
33
- * @returns The OAuth flow state.
34
- */
35
- async getOAuthFlowState() {
36
- return this.oauthFlowState;
37
- }
38
- /**
39
- * Handles the OAuth code.
40
- */
41
- async handleOAuthCode() {
42
- try {
43
- const t = await s().getOAuthParams();
44
- if (await s().cleanupOAuthParams(), !t)
45
- return;
46
- const { providerType: a, code: e, flowId: r, error: o, errorDescription: h } = t;
47
- if (o || h) {
48
- await this.setOAuthFlowState({
49
- providerType: a,
50
- status: "error",
51
- errorDescription: o ?? h,
52
- code: e,
53
- flowId: r,
54
- error: o
55
- });
56
- return;
57
- }
58
- if (!e || !a || !r)
59
- return;
60
- await this.setOAuthFlowState({
61
- providerType: a,
62
- status: "pending",
63
- code: e,
64
- flowId: r
65
- }), await u({
66
- code: e,
67
- providerType: a,
68
- flowId: r
69
- }), await this.setOAuthFlowState({
70
- providerType: a,
71
- status: "success",
72
- code: e,
73
- flowId: r
74
- });
75
- } catch (t) {
76
- const a = t instanceof Error ? t.message : "Unknown error";
77
- await s().cleanupOAuthParams(), await this.setOAuthFlowState({
78
- status: "error",
79
- errorDescription: a
80
- });
1
+ import f from "./index.native125.js";
2
+ const p = "1f8d3e558f493e38a037dbfadb8ba344", m = "d473b1dcc969105adab157226cd9cf63", i = Symbol.for("@coinbase/cdp-analytics");
3
+ function u() {
4
+ const t = globalThis;
5
+ return t[i] || (t[i] = {
6
+ identifier: "",
7
+ enabled: !0,
8
+ isProduction: !1,
9
+ isUsingMocks: !1,
10
+ sendEvent: o,
11
+ sendActionCallEvent: (n) => o({ ...n, type: "action_call" }),
12
+ sendHookCallEvent: (n) => o({ ...n, type: "hook_call" }),
13
+ sendComponentCallEvent: (n) => o({ ...n, type: "component_call" })
14
+ }), t[i];
15
+ }
16
+ const e = u();
17
+ async function o(t) {
18
+ if (!e.enabled || !e.identifier)
19
+ return;
20
+ const n = Date.now(), a = [{
21
+ user_id: e.identifier,
22
+ event_type: t.type,
23
+ platform: s() ? "web" : "native",
24
+ timestamp: n,
25
+ event_properties: {
26
+ project_name: "cdp-embedded-wallet",
27
+ isLocalHost: y(),
28
+ isUsingMocks: e.isUsingMocks,
29
+ ...t
81
30
  }
82
- }
31
+ }], c = JSON.stringify(a), d = n.toString(), l = f(c + d), r = {
32
+ client: e.isProduction ? m : p,
33
+ e: c,
34
+ checksum: l
35
+ };
36
+ await fetch("https://cca-lite.coinbase.com/amp", {
37
+ method: "POST",
38
+ mode: "no-cors",
39
+ headers: {
40
+ "Content-Type": "application/json"
41
+ },
42
+ body: JSON.stringify(r)
43
+ });
44
+ }
45
+ function s() {
46
+ return typeof window < "u" && typeof document < "u";
47
+ }
48
+ function y() {
49
+ return s() ? window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" : !1;
83
50
  }
84
51
  export {
85
- S as OAuthManager
52
+ e as Analytics
86
53
  };
@@ -1,18 +1,2 @@
1
- import "@coinbase/cdp-api-client";
2
- const m = (c, a, e) => {
3
- const s = new Date(a).getTime(), u = {
4
- userId: e.userId,
5
- evmAccounts: e.evmAccounts?.map((t) => t) ?? [],
6
- evmSmartAccounts: e.evmSmartAccounts?.map((t) => t) ?? [],
7
- solanaAccounts: e.solanaAccounts?.map((t) => t) ?? [],
8
- authenticationMethods: e.authenticationMethods.reduce((t, o) => (t[o.type] = o, t), {})
9
- };
10
- return {
11
- accessToken: c,
12
- expiresAt: s,
13
- user: u
14
- };
15
- };
16
- export {
17
- m as toAuthState
18
- };
1
+ import { __require as r } from "./index.native148.js";
2
+ r();
@@ -1,20 +1,90 @@
1
+ import { verifyOAuth as i } from "./index.native7.js";
2
+ import { getPlatformOAuth as h } from "./index.native6.js";
1
3
  import "@coinbase/cdp-api-client";
2
4
  import "viem";
3
- const i = async (n) => await n.isSignedIn();
4
- async function f(n, r, o) {
5
- if (!await i(r))
6
- throw new Error("User not signed in");
7
- const c = await r.getUser();
8
- if ("evmAccount" in n && !c.evmAccounts?.find((t) => t === n.evmAccount))
9
- throw new Error("EVM account not found");
10
- if ("evmSmartAccount" in n && !c.evmSmartAccounts?.find((t) => t === n.evmSmartAccount))
11
- throw new Error("EVM Smart Account not found");
12
- if ("solanaAccount" in n && !c.solanaAccounts?.find((t) => t === n.solanaAccount))
13
- throw new Error("Solana account not found");
14
- const e = await r.getWalletSecretId();
15
- return o({ ...n, user: c, walletSecretId: e });
5
+ class A {
6
+ oauthFlowState = null;
7
+ oauthStateChangeCallbacks = [];
8
+ /**
9
+ * Adds a callback to be called when the OAuth state changes.
10
+ *
11
+ * @param callback - The function to call when the OAuth state changes.
12
+ */
13
+ async addOAuthStateChangeCallback(t) {
14
+ this.oauthStateChangeCallbacks.push(t), t(this.oauthFlowState);
15
+ }
16
+ /**
17
+ * Sets the OAuth flow state.
18
+ *
19
+ * @param oauthFlowState - The OAuth flow state.
20
+ */
21
+ async setOAuthFlowState(t) {
22
+ this.oauthFlowState = t, this.oauthStateChangeCallbacks.forEach((a) => a(this.oauthFlowState));
23
+ }
24
+ /**
25
+ * Clears the OAuth flow state.
26
+ */
27
+ async clearOAuthFlowState() {
28
+ this.oauthFlowState = null, this.oauthStateChangeCallbacks.forEach((t) => t(null));
29
+ }
30
+ /**
31
+ * Gets the OAuth flow state.
32
+ *
33
+ * @returns The OAuth flow state.
34
+ */
35
+ async getOAuthFlowState() {
36
+ return this.oauthFlowState;
37
+ }
38
+ /**
39
+ * Handles the OAuth code.
40
+ *
41
+ * @param url - The URL to handle.
42
+ * @returns A promise that resolves when the OAuth code is handled.
43
+ * @throws An error if the URL is required and not provided.
44
+ */
45
+ async handleOAuthCode(t) {
46
+ try {
47
+ const a = await h().getOAuthParams(t);
48
+ if (await h().cleanupOAuthParams(), !a)
49
+ return;
50
+ const { providerType: e, code: r, flowId: o, error: s, errorDescription: u } = a;
51
+ if (s || u) {
52
+ await this.setOAuthFlowState({
53
+ providerType: e,
54
+ status: "error",
55
+ errorDescription: s ?? u,
56
+ code: r,
57
+ flowId: o,
58
+ error: s
59
+ });
60
+ return;
61
+ }
62
+ if (!r || !e || !o)
63
+ return;
64
+ await this.setOAuthFlowState({
65
+ providerType: e,
66
+ status: "pending",
67
+ code: r,
68
+ flowId: o
69
+ }), await i({
70
+ code: r,
71
+ providerType: e,
72
+ flowId: o
73
+ }), await this.setOAuthFlowState({
74
+ providerType: e,
75
+ status: "success",
76
+ code: r,
77
+ flowId: o
78
+ });
79
+ } catch (a) {
80
+ const e = a instanceof Error ? a.message : "Unknown error";
81
+ await h().cleanupOAuthParams(), await this.setOAuthFlowState({
82
+ status: "error",
83
+ errorDescription: e
84
+ });
85
+ }
86
+ }
16
87
  }
17
88
  export {
18
- i as isSignedIn,
19
- f as withAuth
89
+ A as OAuthManager
20
90
  };
@@ -1,121 +1,18 @@
1
1
  import "@coinbase/cdp-api-client";
2
- import "viem";
3
- import { mockUser as e } from "./index.native29.js";
4
- class r {
5
- authState = null;
6
- authStateChangeCallback = null;
7
- /**
8
- * Initializes the mock auth manager.
9
- *
10
- * @param _projectId - The project ID (unused in mock implementation).
11
- */
12
- constructor(t) {
13
- }
14
- /**
15
- * Awaitable method whose promise only resolves when the auth manager is ready to be used.
16
- *
17
- * @returns A promise that resolves when the auth manager is ready to be used.
18
- */
19
- async ensureInitialized() {
20
- return Promise.resolve();
21
- }
22
- /**
23
- * Gets the current user, or null if there is no user signed in.
24
- *
25
- * @returns The current mock user if signed in, null otherwise.
26
- */
27
- async getUser() {
28
- return this.authState?.user ?? null;
29
- }
30
- /**
31
- * Returns whether the user is signed in - i.e., whether there is an unexpired
32
- * access token and user.
33
- *
34
- * @returns True if the mock user is signed in and token is not expired, false otherwise.
35
- */
36
- async isSignedIn() {
37
- return this.authState ? Promise.resolve(this.authState.expiresAt > Date.now()) : Promise.resolve(!1);
38
- }
39
- /**
40
- * Signs out the user, clearing all authentication state.
41
- * In the mock implementation, this simply clears the local auth state.
42
- */
43
- async signOut() {
44
- await this.clearAuthState();
45
- }
46
- /**
47
- * Sets a callback to be called when the auth state changes.
48
- * The callback is immediately called with the current auth state.
49
- *
50
- * @param callback - The function to call when the auth state changes.
51
- * Will be called with the current user or null.
52
- */
53
- addAuthStateChangeCallback(t) {
54
- this.authStateChangeCallback = t, t(this.authState?.user ?? null);
55
- }
56
- /**
57
- * Gets the access token. For mock, this always returns a valid token if signed in.
58
- * If the current token is expired, it will be refreshed automatically.
59
- *
60
- * @returns The mock access token if signed in, null otherwise.
61
- */
62
- async getToken() {
63
- return this.authState ? (this.authState.expiresAt <= Date.now() && await this.refreshToken(), this.authState?.accessToken ?? null) : null;
64
- }
65
- /**
66
- * Gets the currentlly registered wallet secret ID.
67
- *
68
- * @returns The wallet secret ID.
69
- */
70
- async getWalletSecretId() {
71
- return "mock-wallet-secret-id";
72
- }
73
- /**
74
- * Gets the X-Wallet-Auth header value.
75
- *
76
- * @param _options - The options for the request.
77
- * @param _options.requestMethod - The HTTP method of the request.
78
- * @param _options.requestHost - The host of the request.
79
- * @param _options.requestPath - The path of the request.
80
- * @param _options.requestData - The data of the request.
81
- * @returns The X-Wallet-Auth header value.
82
- */
83
- async getXWalletAuth(t) {
84
- if (!this.authState)
85
- throw new Error("User not signed in");
86
- return "x-wallet-auth";
87
- }
88
- /**
89
- * Sets the authentication state.
90
- * This will trigger the auth state change callback if one is registered.
91
- *
92
- * @param authState - The new authentication state to set.
93
- */
94
- async setAuthState(t) {
95
- this.authState = t, this.authStateChangeCallback && this.authStateChangeCallback(this.authState?.user ?? null);
96
- }
97
- /**
98
- * Clears the authentication state.
99
- * This will trigger the auth state change callback if one is registered.
100
- */
101
- async clearAuthState() {
102
- this.authState = null, this.authStateChangeCallback && this.authStateChangeCallback(null);
103
- }
104
- /**
105
- * Refreshes the mock token.
106
- * Only refreshes if there is an existing auth state (user is signed in).
107
- * Sets a new mock token with a 24-hour expiration.
108
- *
109
- * @private
110
- */
111
- async refreshToken() {
112
- this.authState && await this.setAuthState({
113
- accessToken: "mock-access-token",
114
- expiresAt: Date.now() + 1e3 * 60 * 60 * 24,
115
- user: e
116
- });
117
- }
118
- }
2
+ const m = (c, a, e) => {
3
+ const s = new Date(a).getTime(), u = {
4
+ userId: e.userId,
5
+ evmAccounts: e.evmAccounts?.map((t) => t) ?? [],
6
+ evmSmartAccounts: e.evmSmartAccounts?.map((t) => t) ?? [],
7
+ solanaAccounts: e.solanaAccounts?.map((t) => t) ?? [],
8
+ authenticationMethods: e.authenticationMethods.reduce((t, o) => (t[o.type] = o, t), {})
9
+ };
10
+ return {
11
+ accessToken: c,
12
+ expiresAt: s,
13
+ user: u
14
+ };
15
+ };
119
16
  export {
120
- r as MockAuthManager
17
+ m as toAuthState
121
18
  };
@@ -1,63 +1,20 @@
1
1
  import "@coinbase/cdp-api-client";
2
2
  import "viem";
3
- import { verifyOAuth as o } from "./index.native7.js";
4
- import { getPlatformOAuth as e } from "./index.native6.js";
5
- class i {
6
- oauthFlowState = null;
7
- oauthStateChangeCallbacks = [];
8
- /**
9
- * Initializes the mock OAuth manager.
10
- */
11
- constructor() {
12
- this.handleOAuthCode();
13
- }
14
- /**
15
- * Gets the current user, or null if there is no user signed in.
16
- *
17
- * @returns The current mock user if signed in, null otherwise.
18
- */
19
- async getOAuthFlowState() {
20
- return this.oauthFlowState ?? null;
21
- }
22
- /**
23
- * Sets the OAuth flow state.
24
- *
25
- * @param oauthFlowState - The OAuth flow state to set.
26
- */
27
- async setOAuthFlowState(t) {
28
- this.oauthFlowState = t, this.oauthStateChangeCallbacks.forEach((a) => a(this.oauthFlowState));
29
- }
30
- /**
31
- * Adds a callback to be called when the OAuth state changes.
32
- *
33
- * @param callback - The function to call when the OAuth state changes.
34
- */
35
- async addOAuthStateChangeCallback(t) {
36
- this.oauthStateChangeCallbacks.push(t), t(this.oauthFlowState);
37
- }
38
- /**
39
- * Clears the OAuth flow state.
40
- */
41
- async clearOAuthFlowState() {
42
- this.oauthFlowState = null, this.oauthStateChangeCallbacks.forEach((t) => t(null));
43
- }
44
- /**
45
- * Awaitable method whose promise only resolves when the OAuth manager is ready to be used.
46
- */
47
- async handleOAuthCode() {
48
- await e()?.cleanupOAuthParams(), await this.setOAuthFlowState({
49
- providerType: "google",
50
- status: "pending",
51
- code: "mock-oauth-code",
52
- flowId: "mock-flow-id"
53
- }), await o({ code: "mock-oauth-code", providerType: "google", flowId: "mock-flow-id" }), await this.setOAuthFlowState({
54
- providerType: "google",
55
- status: "success",
56
- code: "mock-oauth-code",
57
- flowId: "mock-flow-id"
58
- });
59
- }
3
+ const i = async (n) => await n.isSignedIn();
4
+ async function f(n, r, o) {
5
+ if (!await i(r))
6
+ throw new Error("User not signed in");
7
+ const c = await r.getUser();
8
+ if ("evmAccount" in n && !c.evmAccounts?.find((t) => t === n.evmAccount))
9
+ throw new Error("EVM account not found");
10
+ if ("evmSmartAccount" in n && !c.evmSmartAccounts?.find((t) => t === n.evmSmartAccount))
11
+ throw new Error("EVM Smart Account not found");
12
+ if ("solanaAccount" in n && !c.solanaAccounts?.find((t) => t === n.solanaAccount))
13
+ throw new Error("Solana account not found");
14
+ const e = await r.getWalletSecretId();
15
+ return o({ ...n, user: c, walletSecretId: e });
60
16
  }
61
17
  export {
62
- i as MockOAuthManager
18
+ i as isSignedIn,
19
+ f as withAuth
63
20
  };
@@ -1,17 +1,121 @@
1
1
  import "@coinbase/cdp-api-client";
2
2
  import "viem";
3
- const t = "0x0000000000000000000000000000000000000000", s = {
4
- userId: "mock-user-id",
5
- evmAccounts: [t],
6
- solanaAccounts: ["5fNfvyp5f3BB9T24s6bC8QjDXuJqvU8WjziJpEQi9PWT"],
7
- authenticationMethods: {
8
- email: {
9
- type: "email",
10
- email: "test@test.com"
11
- }
3
+ import { mockUser as e } from "./index.native31.js";
4
+ class r {
5
+ authState = null;
6
+ authStateChangeCallback = null;
7
+ /**
8
+ * Initializes the mock auth manager.
9
+ *
10
+ * @param _projectId - The project ID (unused in mock implementation).
11
+ */
12
+ constructor(t) {
12
13
  }
13
- };
14
+ /**
15
+ * Awaitable method whose promise only resolves when the auth manager is ready to be used.
16
+ *
17
+ * @returns A promise that resolves when the auth manager is ready to be used.
18
+ */
19
+ async ensureInitialized() {
20
+ return Promise.resolve();
21
+ }
22
+ /**
23
+ * Gets the current user, or null if there is no user signed in.
24
+ *
25
+ * @returns The current mock user if signed in, null otherwise.
26
+ */
27
+ async getUser() {
28
+ return this.authState?.user ?? null;
29
+ }
30
+ /**
31
+ * Returns whether the user is signed in - i.e., whether there is an unexpired
32
+ * access token and user.
33
+ *
34
+ * @returns True if the mock user is signed in and token is not expired, false otherwise.
35
+ */
36
+ async isSignedIn() {
37
+ return this.authState ? Promise.resolve(this.authState.expiresAt > Date.now()) : Promise.resolve(!1);
38
+ }
39
+ /**
40
+ * Signs out the user, clearing all authentication state.
41
+ * In the mock implementation, this simply clears the local auth state.
42
+ */
43
+ async signOut() {
44
+ await this.clearAuthState();
45
+ }
46
+ /**
47
+ * Sets a callback to be called when the auth state changes.
48
+ * The callback is immediately called with the current auth state.
49
+ *
50
+ * @param callback - The function to call when the auth state changes.
51
+ * Will be called with the current user or null.
52
+ */
53
+ addAuthStateChangeCallback(t) {
54
+ this.authStateChangeCallback = t, t(this.authState?.user ?? null);
55
+ }
56
+ /**
57
+ * Gets the access token. For mock, this always returns a valid token if signed in.
58
+ * If the current token is expired, it will be refreshed automatically.
59
+ *
60
+ * @returns The mock access token if signed in, null otherwise.
61
+ */
62
+ async getToken() {
63
+ return this.authState ? (this.authState.expiresAt <= Date.now() && await this.refreshToken(), this.authState?.accessToken ?? null) : null;
64
+ }
65
+ /**
66
+ * Gets the currentlly registered wallet secret ID.
67
+ *
68
+ * @returns The wallet secret ID.
69
+ */
70
+ async getWalletSecretId() {
71
+ return "mock-wallet-secret-id";
72
+ }
73
+ /**
74
+ * Gets the X-Wallet-Auth header value.
75
+ *
76
+ * @param _options - The options for the request.
77
+ * @param _options.requestMethod - The HTTP method of the request.
78
+ * @param _options.requestHost - The host of the request.
79
+ * @param _options.requestPath - The path of the request.
80
+ * @param _options.requestData - The data of the request.
81
+ * @returns The X-Wallet-Auth header value.
82
+ */
83
+ async getXWalletAuth(t) {
84
+ if (!this.authState)
85
+ throw new Error("User not signed in");
86
+ return "x-wallet-auth";
87
+ }
88
+ /**
89
+ * Sets the authentication state.
90
+ * This will trigger the auth state change callback if one is registered.
91
+ *
92
+ * @param authState - The new authentication state to set.
93
+ */
94
+ async setAuthState(t) {
95
+ this.authState = t, this.authStateChangeCallback && this.authStateChangeCallback(this.authState?.user ?? null);
96
+ }
97
+ /**
98
+ * Clears the authentication state.
99
+ * This will trigger the auth state change callback if one is registered.
100
+ */
101
+ async clearAuthState() {
102
+ this.authState = null, this.authStateChangeCallback && this.authStateChangeCallback(null);
103
+ }
104
+ /**
105
+ * Refreshes the mock token.
106
+ * Only refreshes if there is an existing auth state (user is signed in).
107
+ * Sets a new mock token with a 24-hour expiration.
108
+ *
109
+ * @private
110
+ */
111
+ async refreshToken() {
112
+ this.authState && await this.setAuthState({
113
+ accessToken: "mock-access-token",
114
+ expiresAt: Date.now() + 1e3 * 60 * 60 * 24,
115
+ user: e
116
+ });
117
+ }
118
+ }
14
119
  export {
15
- t as mockAddress,
16
- s as mockUser
120
+ r as MockAuthManager
17
121
  };
@@ -1,14 +1,56 @@
1
- const t = {
1
+ import * as u from "expo-web-browser";
2
+ import { WebBrowserResultType as o } from "expo-web-browser";
3
+ import { getCoreOAuthManager as s, getConfig as l } from "./index.native22.js";
4
+ const d = {
2
5
  getRedirectUrl: () => {
3
- throw new Error("OAuth is not supported in this platform");
6
+ const e = l().nativeOAuthCallback;
7
+ if (!e)
8
+ throw new Error("nativeOAuthCallback must be configured in order to use native OAuth");
9
+ return e;
10
+ },
11
+ getOAuthParams: (e) => {
12
+ if (!e)
13
+ return null;
14
+ const r = new URL(e), t = r.searchParams.get("code") ?? void 0, a = r.searchParams.get("provider_type") ?? void 0, i = r.searchParams.get("flow_id") ?? void 0, c = r.searchParams.get("error") ?? void 0, n = r.searchParams.get("error_description") ?? void 0;
15
+ return (!t || !a || !i) && !c && !n ? null : { code: t, providerType: a, flowId: i, error: c, errorDescription: n };
4
16
  },
5
- getOAuthParams: () => null,
6
17
  cleanupOAuthParams: () => {
7
18
  },
8
- initiateOAuthFlow: () => {
9
- throw new Error("OAuth is not supported in this platform");
19
+ initiateOAuthFlow: async (e) => {
20
+ const r = d.getRedirectUrl(), t = await u.openAuthSessionAsync(e, r);
21
+ switch (t.type) {
22
+ case "success":
23
+ if (!t.url)
24
+ throw new Error("URL is required for success result");
25
+ s().handleOAuthCode(t.url);
26
+ break;
27
+ case o.CANCEL:
28
+ s().setOAuthFlowState({
29
+ status: "error",
30
+ errorDescription: "User cancelled the OAuth flow"
31
+ });
32
+ break;
33
+ case o.DISMISS:
34
+ s().setOAuthFlowState({
35
+ status: "error",
36
+ errorDescription: "User dismissed the OAuth flow"
37
+ });
38
+ break;
39
+ case o.LOCKED:
40
+ s().setOAuthFlowState({
41
+ status: "error",
42
+ errorDescription: "The browser was locked"
43
+ });
44
+ break;
45
+ case o.OPENED:
46
+ break;
47
+ default:
48
+ throw new Error(
49
+ `Unexpected WebBrowser result type: ${t.type}`
50
+ );
51
+ }
10
52
  }
11
53
  };
12
54
  export {
13
- t as nativeOAuth
55
+ d as nativeOAuth
14
56
  };