@crossmint/client-sdk-smart-wallet 0.1.25 → 0.1.26

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 (351) hide show
  1. package/dist/SmartWalletSDK.cjs +1 -34
  2. package/dist/SmartWalletSDK.js +1 -34
  3. package/dist/api/CrossmintWalletService.cjs +1 -13
  4. package/dist/api/CrossmintWalletService.js +1 -13
  5. package/dist/blockchain/chains.cjs +1 -23
  6. package/dist/blockchain/chains.js +1 -23
  7. package/dist/blockchain/rpc.cjs +1 -11
  8. package/dist/blockchain/rpc.js +1 -11
  9. package/dist/blockchain/transfer.cjs +1 -7
  10. package/dist/blockchain/transfer.js +1 -7
  11. package/dist/blockchain/wallets/EVMSmartWallet.cjs +1 -10
  12. package/dist/blockchain/wallets/EVMSmartWallet.js +1 -10
  13. package/dist/blockchain/wallets/SendTransactionService.cjs +1 -11
  14. package/dist/blockchain/wallets/SendTransactionService.js +1 -11
  15. package/dist/blockchain/wallets/account/cache.cjs +1 -9
  16. package/dist/blockchain/wallets/account/cache.js +1 -9
  17. package/dist/blockchain/wallets/account/config.cjs +1 -9
  18. package/dist/blockchain/wallets/account/config.js +1 -9
  19. package/dist/blockchain/wallets/account/creator.cjs +1 -10
  20. package/dist/blockchain/wallets/account/creator.js +1 -10
  21. package/dist/blockchain/wallets/account/eoa.cjs +1 -11
  22. package/dist/blockchain/wallets/account/eoa.js +1 -11
  23. package/dist/blockchain/wallets/account/passkey.cjs +1 -9
  24. package/dist/blockchain/wallets/account/passkey.js +1 -9
  25. package/dist/blockchain/wallets/account/signer.cjs +1 -9
  26. package/dist/blockchain/wallets/account/signer.js +1 -9
  27. package/dist/blockchain/wallets/account/strategy.cjs +1 -1
  28. package/dist/blockchain/wallets/account/strategy.js +0 -1
  29. package/dist/blockchain/wallets/clientDecorator.cjs +1 -12
  30. package/dist/blockchain/wallets/clientDecorator.js +1 -12
  31. package/dist/blockchain/wallets/index.cjs +1 -10
  32. package/dist/blockchain/wallets/index.js +1 -10
  33. package/dist/blockchain/wallets/paymaster.cjs +1 -10
  34. package/dist/blockchain/wallets/paymaster.js +1 -10
  35. package/dist/blockchain/wallets/service.cjs +1 -16
  36. package/dist/blockchain/wallets/service.js +1 -16
  37. package/dist/chunk-265KNPZR.js +1 -0
  38. package/dist/chunk-2GS5TXEY.cjs +1 -0
  39. package/dist/chunk-2R6HK64N.cjs +1 -0
  40. package/dist/chunk-3F6P4HUZ.js +1 -0
  41. package/dist/chunk-4SPA557P.js +0 -0
  42. package/dist/chunk-7AVDZZGD.cjs +1 -0
  43. package/dist/chunk-7FXFOOQU.cjs +1 -0
  44. package/dist/chunk-7KTCGFU5.js +1 -0
  45. package/dist/chunk-AK6IIUTM.js +1 -0
  46. package/dist/chunk-ATQ4WGCW.js +1 -0
  47. package/dist/chunk-BIJAOWPS.js +1 -0
  48. package/dist/chunk-BJZQA5VC.js +1 -0
  49. package/dist/chunk-C3VZY7VJ.js +1 -0
  50. package/dist/chunk-CUTQYF3F.js +1 -0
  51. package/dist/chunk-D4NDUT36.js +1 -0
  52. package/dist/chunk-DIDKPOO2.cjs +1 -0
  53. package/dist/chunk-DQNKQDE2.cjs +1 -0
  54. package/dist/chunk-E3NG3YWO.js +1 -0
  55. package/dist/chunk-ETVJGLNY.js +1 -0
  56. package/dist/chunk-FHNNZVNU.js +1 -0
  57. package/dist/chunk-GB35YMN4.cjs +1 -0
  58. package/dist/chunk-H4CMXNVK.js +1 -0
  59. package/dist/chunk-HGA3WK6L.cjs +1 -0
  60. package/dist/chunk-II4HKF7X.cjs +1 -0
  61. package/dist/chunk-IQTGPM2U.cjs +1 -0
  62. package/dist/chunk-KYPTGHC6.cjs +1 -0
  63. package/dist/chunk-LDNU6SJL.cjs +3 -0
  64. package/dist/chunk-M4K3IZTT.cjs +1 -0
  65. package/dist/chunk-MJ62KCTK.cjs +1 -0
  66. package/dist/chunk-NAX6LRUY.cjs +1 -0
  67. package/dist/chunk-NLGILHJS.js +1 -0
  68. package/dist/chunk-O2ACORII.cjs +1 -0
  69. package/dist/chunk-ODAUWGUU.cjs +1 -0
  70. package/dist/chunk-PZ6Q22YJ.js +1 -0
  71. package/dist/chunk-QD2JKGX6.cjs +1 -0
  72. package/dist/chunk-S2XBSAGM.js +1 -0
  73. package/dist/chunk-SBW2PS63.cjs +1 -0
  74. package/dist/chunk-SCXFZMLR.cjs +1 -0
  75. package/dist/chunk-STH2LE35.cjs +1 -0
  76. package/dist/chunk-SWWOVT47.cjs +1 -0
  77. package/dist/chunk-TBTRV56U.cjs +2 -0
  78. package/dist/chunk-TWADESPF.cjs +1 -0
  79. package/dist/chunk-TXLAUKCK.cjs +1 -0
  80. package/dist/chunk-TZG6MROQ.js +1 -0
  81. package/dist/chunk-UG47CBKR.js +1 -0
  82. package/dist/chunk-UPURFW46.js +1 -0
  83. package/dist/chunk-UXNWF66Q.js +1 -0
  84. package/dist/chunk-VMOQWOZV.js +3 -0
  85. package/dist/chunk-VXGNAQOW.js +1 -0
  86. package/dist/chunk-WJ6XJMRD.cjs +1 -0
  87. package/dist/{chunk-5MG5CIEX.cjs → chunk-XJGFG3RT.cjs} +1 -13
  88. package/dist/chunk-XQ2K2K23.cjs +1 -0
  89. package/dist/chunk-YBHSEZMB.js +1 -0
  90. package/dist/chunk-YJUD5MVS.js +1 -0
  91. package/dist/chunk-YUWCRSYD.js +1 -0
  92. package/dist/chunk-Z7MMOBIC.js +2 -0
  93. package/dist/error/index.cjs +1 -25
  94. package/dist/error/index.js +1 -25
  95. package/dist/error/processor.cjs +1 -9
  96. package/dist/error/processor.js +1 -9
  97. package/dist/index.cjs +1 -86
  98. package/dist/index.js +1 -86
  99. package/dist/services/index.cjs +1 -11
  100. package/dist/services/index.js +1 -11
  101. package/dist/services/logger.cjs +1 -10
  102. package/dist/services/logger.js +1 -10
  103. package/dist/types/internal.cjs +1 -18
  104. package/dist/types/internal.js +1 -18
  105. package/dist/types/params.cjs +1 -1
  106. package/dist/types/params.js +0 -1
  107. package/dist/types/schema.cjs +1 -16
  108. package/dist/types/schema.js +1 -16
  109. package/dist/types/service.cjs +1 -1
  110. package/dist/types/service.js +0 -1
  111. package/dist/types/token.cjs +1 -1
  112. package/dist/types/token.js +0 -1
  113. package/dist/utils/api.cjs +1 -9
  114. package/dist/utils/api.js +1 -9
  115. package/dist/utils/blockchain.cjs +1 -7
  116. package/dist/utils/blockchain.js +1 -7
  117. package/dist/utils/constants.cjs +1 -19
  118. package/dist/utils/constants.js +1 -19
  119. package/dist/utils/environment.cjs +1 -7
  120. package/dist/utils/environment.js +1 -7
  121. package/dist/utils/helpers.cjs +1 -9
  122. package/dist/utils/helpers.js +1 -9
  123. package/dist/utils/signer.cjs +1 -10
  124. package/dist/utils/signer.js +1 -10
  125. package/dist/utils/test.cjs +1 -27
  126. package/dist/utils/test.js +1 -27
  127. package/package.json +3 -4
  128. package/dist/SmartWalletSDK.cjs.map +0 -1
  129. package/dist/SmartWalletSDK.js.map +0 -1
  130. package/dist/api/CrossmintWalletService.cjs.map +0 -1
  131. package/dist/api/CrossmintWalletService.js.map +0 -1
  132. package/dist/blockchain/chains.cjs.map +0 -1
  133. package/dist/blockchain/chains.js.map +0 -1
  134. package/dist/blockchain/rpc.cjs.map +0 -1
  135. package/dist/blockchain/rpc.js.map +0 -1
  136. package/dist/blockchain/transfer.cjs.map +0 -1
  137. package/dist/blockchain/transfer.js.map +0 -1
  138. package/dist/blockchain/wallets/EVMSmartWallet.cjs.map +0 -1
  139. package/dist/blockchain/wallets/EVMSmartWallet.js.map +0 -1
  140. package/dist/blockchain/wallets/SendTransactionService.cjs.map +0 -1
  141. package/dist/blockchain/wallets/SendTransactionService.js.map +0 -1
  142. package/dist/blockchain/wallets/account/cache.cjs.map +0 -1
  143. package/dist/blockchain/wallets/account/cache.js.map +0 -1
  144. package/dist/blockchain/wallets/account/config.cjs.map +0 -1
  145. package/dist/blockchain/wallets/account/config.js.map +0 -1
  146. package/dist/blockchain/wallets/account/creator.cjs.map +0 -1
  147. package/dist/blockchain/wallets/account/creator.js.map +0 -1
  148. package/dist/blockchain/wallets/account/eoa.cjs.map +0 -1
  149. package/dist/blockchain/wallets/account/eoa.js.map +0 -1
  150. package/dist/blockchain/wallets/account/passkey.cjs.map +0 -1
  151. package/dist/blockchain/wallets/account/passkey.js.map +0 -1
  152. package/dist/blockchain/wallets/account/signer.cjs.map +0 -1
  153. package/dist/blockchain/wallets/account/signer.js.map +0 -1
  154. package/dist/blockchain/wallets/account/strategy.cjs.map +0 -1
  155. package/dist/blockchain/wallets/account/strategy.js.map +0 -1
  156. package/dist/blockchain/wallets/clientDecorator.cjs.map +0 -1
  157. package/dist/blockchain/wallets/clientDecorator.js.map +0 -1
  158. package/dist/blockchain/wallets/index.cjs.map +0 -1
  159. package/dist/blockchain/wallets/index.js.map +0 -1
  160. package/dist/blockchain/wallets/paymaster.cjs.map +0 -1
  161. package/dist/blockchain/wallets/paymaster.js.map +0 -1
  162. package/dist/blockchain/wallets/service.cjs.map +0 -1
  163. package/dist/blockchain/wallets/service.js.map +0 -1
  164. package/dist/chunk-22PW4SGD.cjs +0 -36
  165. package/dist/chunk-22PW4SGD.cjs.map +0 -1
  166. package/dist/chunk-2HB65Y7D.js +0 -79
  167. package/dist/chunk-2HB65Y7D.js.map +0 -1
  168. package/dist/chunk-3EQHAQXO.js +0 -112
  169. package/dist/chunk-3EQHAQXO.js.map +0 -1
  170. package/dist/chunk-3PVQ4P74.cjs +0 -66
  171. package/dist/chunk-3PVQ4P74.cjs.map +0 -1
  172. package/dist/chunk-3R6PW6HY.js +0 -30
  173. package/dist/chunk-3R6PW6HY.js.map +0 -1
  174. package/dist/chunk-5EJ2YW7L.cjs +0 -93
  175. package/dist/chunk-5EJ2YW7L.cjs.map +0 -1
  176. package/dist/chunk-5IZ57G5A.js +0 -123
  177. package/dist/chunk-5IZ57G5A.js.map +0 -1
  178. package/dist/chunk-5MG5CIEX.cjs.map +0 -1
  179. package/dist/chunk-5URMCCO6.js +0 -9
  180. package/dist/chunk-5URMCCO6.js.map +0 -1
  181. package/dist/chunk-5WVQ7J3E.cjs +0 -369
  182. package/dist/chunk-5WVQ7J3E.cjs.map +0 -1
  183. package/dist/chunk-6IJLWHUN.cjs +0 -44
  184. package/dist/chunk-6IJLWHUN.cjs.map +0 -1
  185. package/dist/chunk-6NJVFL2X.js +0 -60
  186. package/dist/chunk-6NJVFL2X.js.map +0 -1
  187. package/dist/chunk-6O7DYITB.js +0 -99
  188. package/dist/chunk-6O7DYITB.js.map +0 -1
  189. package/dist/chunk-6OFQWFH6.cjs +0 -22
  190. package/dist/chunk-6OFQWFH6.cjs.map +0 -1
  191. package/dist/chunk-77GT6B5L.cjs +0 -79
  192. package/dist/chunk-77GT6B5L.cjs.map +0 -1
  193. package/dist/chunk-7KAFEHUT.js +0 -36
  194. package/dist/chunk-7KAFEHUT.js.map +0 -1
  195. package/dist/chunk-7KTQNIAZ.cjs +0 -112
  196. package/dist/chunk-7KTQNIAZ.cjs.map +0 -1
  197. package/dist/chunk-ASIPMVRQ.js +0 -90
  198. package/dist/chunk-ASIPMVRQ.js.map +0 -1
  199. package/dist/chunk-BARW756O.js +0 -27
  200. package/dist/chunk-BARW756O.js.map +0 -1
  201. package/dist/chunk-BXSAJOIV.cjs +0 -90
  202. package/dist/chunk-BXSAJOIV.cjs.map +0 -1
  203. package/dist/chunk-DMTDBTI6.js +0 -39
  204. package/dist/chunk-DMTDBTI6.js.map +0 -1
  205. package/dist/chunk-DTEA33DF.cjs +0 -59
  206. package/dist/chunk-DTEA33DF.cjs.map +0 -1
  207. package/dist/chunk-DYO4HODM.cjs +0 -36
  208. package/dist/chunk-DYO4HODM.cjs.map +0 -1
  209. package/dist/chunk-E44QR6BR.js +0 -41
  210. package/dist/chunk-E44QR6BR.js.map +0 -1
  211. package/dist/chunk-EP2KTXWN.cjs +0 -39
  212. package/dist/chunk-EP2KTXWN.cjs.map +0 -1
  213. package/dist/chunk-EPEGJY6N.cjs +0 -9
  214. package/dist/chunk-EPEGJY6N.cjs.map +0 -1
  215. package/dist/chunk-EQSMHR77.js +0 -30
  216. package/dist/chunk-EQSMHR77.js.map +0 -1
  217. package/dist/chunk-FSIMJYXR.js +0 -36
  218. package/dist/chunk-FSIMJYXR.js.map +0 -1
  219. package/dist/chunk-FVEUQ5LF.js +0 -14
  220. package/dist/chunk-FVEUQ5LF.js.map +0 -1
  221. package/dist/chunk-FXGOVLZW.cjs +0 -9
  222. package/dist/chunk-FXGOVLZW.cjs.map +0 -1
  223. package/dist/chunk-IHXCFM4Q.js +0 -22
  224. package/dist/chunk-IHXCFM4Q.js.map +0 -1
  225. package/dist/chunk-JOB7STIS.js +0 -9
  226. package/dist/chunk-JOB7STIS.js.map +0 -1
  227. package/dist/chunk-KHROQTVY.js +0 -1
  228. package/dist/chunk-KHROQTVY.js.map +0 -1
  229. package/dist/chunk-L5OEF7W3.cjs +0 -14
  230. package/dist/chunk-L5OEF7W3.cjs.map +0 -1
  231. package/dist/chunk-LGDLTGAS.js +0 -66
  232. package/dist/chunk-LGDLTGAS.js.map +0 -1
  233. package/dist/chunk-MGDAIRKC.cjs +0 -82
  234. package/dist/chunk-MGDAIRKC.cjs.map +0 -1
  235. package/dist/chunk-MPF4K2EV.cjs +0 -123
  236. package/dist/chunk-MPF4K2EV.cjs.map +0 -1
  237. package/dist/chunk-N6DG5EZG.cjs +0 -156
  238. package/dist/chunk-N6DG5EZG.cjs.map +0 -1
  239. package/dist/chunk-O6IFYHDP.cjs +0 -36
  240. package/dist/chunk-O6IFYHDP.cjs.map +0 -1
  241. package/dist/chunk-OGA3YDWS.cjs +0 -112
  242. package/dist/chunk-OGA3YDWS.cjs.map +0 -1
  243. package/dist/chunk-ON4DOYVD.js +0 -369
  244. package/dist/chunk-ON4DOYVD.js.map +0 -1
  245. package/dist/chunk-PVFA6PBX.cjs +0 -60
  246. package/dist/chunk-PVFA6PBX.cjs.map +0 -1
  247. package/dist/chunk-QHCELEYE.cjs +0 -99
  248. package/dist/chunk-QHCELEYE.cjs.map +0 -1
  249. package/dist/chunk-QIXYNYYS.js +0 -82
  250. package/dist/chunk-QIXYNYYS.js.map +0 -1
  251. package/dist/chunk-QJ3BSVGV.js +0 -36
  252. package/dist/chunk-QJ3BSVGV.js.map +0 -1
  253. package/dist/chunk-QZRRIK7N.cjs +0 -41
  254. package/dist/chunk-QZRRIK7N.cjs.map +0 -1
  255. package/dist/chunk-S5RL5PJD.js +0 -44
  256. package/dist/chunk-S5RL5PJD.js.map +0 -1
  257. package/dist/chunk-SLF7WWDT.js +0 -93
  258. package/dist/chunk-SLF7WWDT.js.map +0 -1
  259. package/dist/chunk-SMDX2MXU.js +0 -13
  260. package/dist/chunk-SMDX2MXU.js.map +0 -1
  261. package/dist/chunk-TDJDKTRS.js +0 -156
  262. package/dist/chunk-TDJDKTRS.js.map +0 -1
  263. package/dist/chunk-U4OBHCIP.js +0 -59
  264. package/dist/chunk-U4OBHCIP.js.map +0 -1
  265. package/dist/chunk-UQKE6R5W.cjs +0 -27
  266. package/dist/chunk-UQKE6R5W.cjs.map +0 -1
  267. package/dist/chunk-UZGHOTKZ.js +0 -112
  268. package/dist/chunk-UZGHOTKZ.js.map +0 -1
  269. package/dist/chunk-YWCXHOSD.cjs +0 -30
  270. package/dist/chunk-YWCXHOSD.cjs.map +0 -1
  271. package/dist/chunk-ZN42AA2G.cjs +0 -1
  272. package/dist/chunk-ZN42AA2G.cjs.map +0 -1
  273. package/dist/chunk-ZOXKITU4.cjs +0 -30
  274. package/dist/chunk-ZOXKITU4.cjs.map +0 -1
  275. package/dist/error/index.cjs.map +0 -1
  276. package/dist/error/index.js.map +0 -1
  277. package/dist/error/processor.cjs.map +0 -1
  278. package/dist/error/processor.js.map +0 -1
  279. package/dist/index.cjs.map +0 -1
  280. package/dist/index.js.map +0 -1
  281. package/dist/services/index.cjs.map +0 -1
  282. package/dist/services/index.js.map +0 -1
  283. package/dist/services/logger.cjs.map +0 -1
  284. package/dist/services/logger.js.map +0 -1
  285. package/dist/types/internal.cjs.map +0 -1
  286. package/dist/types/internal.js.map +0 -1
  287. package/dist/types/params.cjs.map +0 -1
  288. package/dist/types/params.js.map +0 -1
  289. package/dist/types/schema.cjs.map +0 -1
  290. package/dist/types/schema.js.map +0 -1
  291. package/dist/types/service.cjs.map +0 -1
  292. package/dist/types/service.js.map +0 -1
  293. package/dist/types/token.cjs.map +0 -1
  294. package/dist/types/token.js.map +0 -1
  295. package/dist/utils/api.cjs.map +0 -1
  296. package/dist/utils/api.js.map +0 -1
  297. package/dist/utils/blockchain.cjs.map +0 -1
  298. package/dist/utils/blockchain.js.map +0 -1
  299. package/dist/utils/constants.cjs.map +0 -1
  300. package/dist/utils/constants.js.map +0 -1
  301. package/dist/utils/environment.cjs.map +0 -1
  302. package/dist/utils/environment.js.map +0 -1
  303. package/dist/utils/helpers.cjs.map +0 -1
  304. package/dist/utils/helpers.js.map +0 -1
  305. package/dist/utils/signer.cjs.map +0 -1
  306. package/dist/utils/signer.js.map +0 -1
  307. package/dist/utils/test.cjs.map +0 -1
  308. package/dist/utils/test.js.map +0 -1
  309. package/src/ABI/ERC1155.json +0 -325
  310. package/src/ABI/ERC20.json +0 -222
  311. package/src/ABI/ERC721.json +0 -320
  312. package/src/SmartWalletSDK.test.ts +0 -31
  313. package/src/SmartWalletSDK.ts +0 -104
  314. package/src/api/CrossmintWalletService.test.ts +0 -43
  315. package/src/api/CrossmintWalletService.ts +0 -84
  316. package/src/blockchain/chains.ts +0 -57
  317. package/src/blockchain/rpc.ts +0 -25
  318. package/src/blockchain/transfer.ts +0 -54
  319. package/src/blockchain/wallets/EVMSmartWallet.ts +0 -157
  320. package/src/blockchain/wallets/SendTransactionService.test.ts +0 -159
  321. package/src/blockchain/wallets/SendTransactionService.ts +0 -188
  322. package/src/blockchain/wallets/account/cache.test.ts +0 -67
  323. package/src/blockchain/wallets/account/cache.ts +0 -43
  324. package/src/blockchain/wallets/account/config.test.ts +0 -103
  325. package/src/blockchain/wallets/account/config.ts +0 -116
  326. package/src/blockchain/wallets/account/creator.ts +0 -40
  327. package/src/blockchain/wallets/account/eoa.ts +0 -51
  328. package/src/blockchain/wallets/account/passkey.ts +0 -198
  329. package/src/blockchain/wallets/account/signer.ts +0 -44
  330. package/src/blockchain/wallets/account/strategy.ts +0 -5
  331. package/src/blockchain/wallets/clientDecorator.ts +0 -128
  332. package/src/blockchain/wallets/index.ts +0 -1
  333. package/src/blockchain/wallets/paymaster.ts +0 -41
  334. package/src/blockchain/wallets/service.ts +0 -107
  335. package/src/error/index.ts +0 -100
  336. package/src/error/processor.ts +0 -36
  337. package/src/index.ts +0 -47
  338. package/src/services/index.ts +0 -1
  339. package/src/services/logger.ts +0 -6
  340. package/src/types/internal.ts +0 -76
  341. package/src/types/params.ts +0 -34
  342. package/src/types/schema.ts +0 -63
  343. package/src/types/service.ts +0 -31
  344. package/src/types/token.ts +0 -29
  345. package/src/utils/api.ts +0 -39
  346. package/src/utils/blockchain.ts +0 -5
  347. package/src/utils/constants.ts +0 -9
  348. package/src/utils/environment.ts +0 -3
  349. package/src/utils/helpers.ts +0 -7
  350. package/src/utils/signer.ts +0 -33
  351. package/src/utils/test.ts +0 -24
@@ -1,41 +0,0 @@
1
- import type { CrossmintWalletService } from "@/api/CrossmintWalletService";
2
- import type { Middleware } from "permissionless/actions/smartAccount";
3
- import type { PimlicoBundlerClient } from "permissionless/clients/pimlico";
4
- import type { EntryPoint } from "permissionless/types/entrypoint";
5
-
6
- import type { UserParams } from "../../types/params";
7
- import { usesGelatoBundler } from "../../utils/blockchain";
8
- import type { SmartWalletChain } from "../chains";
9
-
10
- export function usePaymaster(chain: SmartWalletChain) {
11
- return !usesGelatoBundler(chain);
12
- }
13
-
14
- export function paymasterMiddleware({
15
- bundlerClient,
16
- entryPoint,
17
- chain,
18
- walletService,
19
- user,
20
- }: {
21
- bundlerClient: PimlicoBundlerClient<EntryPoint>;
22
- entryPoint: EntryPoint;
23
- chain: SmartWalletChain;
24
- walletService: CrossmintWalletService;
25
- user: UserParams;
26
- }): Middleware<EntryPoint> {
27
- return {
28
- middleware: {
29
- gasPrice: async () => (await bundlerClient.getUserOperationGasPrice()).fast,
30
- sponsorUserOperation: async ({ userOperation }) => {
31
- const { sponsorUserOpParams } = await walletService.sponsorUserOperation(
32
- user,
33
- userOperation,
34
- entryPoint,
35
- chain
36
- );
37
- return sponsorUserOpParams;
38
- },
39
- },
40
- };
41
- }
@@ -1,107 +0,0 @@
1
- import type { KernelSmartAccount } from "@zerodev/sdk";
2
- import { ENTRYPOINT_ADDRESS_V06, ENTRYPOINT_ADDRESS_V07, createSmartAccountClient } from "permissionless";
3
- import { createPimlicoBundlerClient } from "permissionless/clients/pimlico";
4
- import type { EntryPoint } from "permissionless/types/entrypoint";
5
- import { type HttpTransport, createPublicClient, http } from "viem";
6
-
7
- import { blockchainToChainId } from "@crossmint/common-sdk-base";
8
-
9
- import type { CrossmintWalletService } from "../../api/CrossmintWalletService";
10
- import type { SmartWalletClient } from "../../types/internal";
11
- import type { UserParams, WalletParams } from "../../types/params";
12
- import { CURRENT_VERSION, ZERO_DEV_TYPE } from "../../utils/constants";
13
- import { type SmartWalletChain, viemNetworks } from "../chains";
14
- import { getAlchemyRPC, getPimlicoBundlerRPC } from "../rpc";
15
- import { EVMSmartWallet } from "./EVMSmartWallet";
16
- import type { AccountConfigService } from "./account/config";
17
- import type { AccountCreator } from "./account/creator";
18
- import type { ClientDecorator } from "./clientDecorator";
19
- import { paymasterMiddleware, usePaymaster } from "./paymaster";
20
-
21
- export class SmartWalletService {
22
- constructor(
23
- private readonly crossmintService: CrossmintWalletService,
24
- private readonly accountConfigService: AccountConfigService,
25
- private readonly accountCreator: AccountCreator,
26
- private readonly clientDecorator: ClientDecorator
27
- ) {}
28
-
29
- public async getOrCreate(
30
- user: UserParams,
31
- chain: SmartWalletChain,
32
- walletParams: WalletParams
33
- ): Promise<EVMSmartWallet> {
34
- const {
35
- config: { entryPointVersion, kernelVersion, existing, userWithId },
36
- cached,
37
- } = await this.accountConfigService.get(user, chain);
38
-
39
- const publicClient = createPublicClient({ transport: http(getAlchemyRPC(chain)) });
40
-
41
- const { account, signerConfig } = await this.accountCreator.get({
42
- chain,
43
- walletParams,
44
- publicClient,
45
- user: userWithId,
46
- entryPoint: entryPointVersion === "v0.6" ? ENTRYPOINT_ADDRESS_V06 : ENTRYPOINT_ADDRESS_V07,
47
- kernelVersion,
48
- existing,
49
- });
50
-
51
- if (existing == null) {
52
- await this.crossmintService.idempotentCreateSmartWallet(user, {
53
- type: ZERO_DEV_TYPE,
54
- smartContractWalletAddress: account.address,
55
- signerData: signerConfig.data,
56
- version: CURRENT_VERSION,
57
- baseLayer: "evm",
58
- chainId: blockchainToChainId(chain),
59
- entryPointVersion,
60
- kernelVersion,
61
- });
62
- }
63
-
64
- if (!cached) {
65
- this.accountConfigService.cache({
66
- entryPointVersion,
67
- kernelVersion,
68
- user: userWithId,
69
- existing: { address: account.address, signerConfig },
70
- });
71
- }
72
-
73
- return new EVMSmartWallet(
74
- { wallet: this.smartAccountClient(chain, account, user), public: publicClient },
75
- chain,
76
- this.crossmintService
77
- );
78
- }
79
-
80
- private smartAccountClient(
81
- chain: SmartWalletChain,
82
- account: KernelSmartAccount<EntryPoint, HttpTransport>,
83
- user: UserParams
84
- ): SmartWalletClient {
85
- const transport = http(getPimlicoBundlerRPC(chain));
86
- const bundlerConfig = { chain: viemNetworks[chain], entryPoint: account.entryPoint };
87
- const bundlerClient = createPimlicoBundlerClient({ ...bundlerConfig, transport });
88
- const smartAccountClient: SmartWalletClient = createSmartAccountClient({
89
- account,
90
- bundlerTransport: transport,
91
- ...bundlerConfig,
92
- ...(usePaymaster(chain) &&
93
- paymasterMiddleware({
94
- bundlerClient,
95
- entryPoint: account.entryPoint,
96
- chain,
97
- walletService: this.crossmintService,
98
- user,
99
- })),
100
- });
101
-
102
- return this.clientDecorator.decorate({
103
- crossmintChain: chain,
104
- smartAccountClient,
105
- });
106
- }
107
- }
@@ -1,100 +0,0 @@
1
- import { CrossmintSDKError, SmartWalletErrorCode } from "@crossmint/client-sdk-base";
2
-
3
- import type { PasskeyDisplay, SignerDisplay } from "../types/service";
4
-
5
- export class SmartWalletError extends CrossmintSDKError {
6
- constructor(message: string, details?: string, code: SmartWalletErrorCode = SmartWalletErrorCode.UNCATEGORIZED) {
7
- super(message, code, details);
8
- }
9
- }
10
-
11
- export class AdminMismatchError extends SmartWalletError {
12
- public readonly required: SignerDisplay;
13
- public readonly used?: SignerDisplay;
14
-
15
- constructor(message: string, required: SignerDisplay, used?: SignerDisplay) {
16
- super(message, SmartWalletErrorCode.ADMIN_MISMATCH);
17
- this.required = required;
18
- this.used = used;
19
- }
20
- }
21
-
22
- export class PasskeyMismatchError extends SmartWalletError {
23
- public readonly required: PasskeyDisplay;
24
- public readonly used?: PasskeyDisplay;
25
-
26
- constructor(message: string, required: PasskeyDisplay, used?: PasskeyDisplay) {
27
- super(message, SmartWalletErrorCode.PASSKEY_MISMATCH);
28
- this.required = required;
29
- this.used = used;
30
- }
31
- }
32
-
33
- export class UserWalletAlreadyCreatedError extends SmartWalletError {
34
- public readonly code = SmartWalletErrorCode.USER_WALLET_ALREADY_CREATED;
35
-
36
- constructor(userId: string) {
37
- super(`The user with userId ${userId.toString()} already has a wallet created for this project`);
38
- }
39
- }
40
-
41
- export class PasskeyPromptError extends SmartWalletError {
42
- public passkeyName: string;
43
-
44
- constructor(passkeyName: string) {
45
- super(
46
- `Prompt was either cancelled or timed out for passkey ${passkeyName}`,
47
- undefined,
48
- SmartWalletErrorCode.PASSKEY_PROMPT
49
- );
50
- this.passkeyName = passkeyName;
51
- }
52
- }
53
-
54
- export class PasskeyRegistrationError extends SmartWalletError {
55
- public passkeyName: string;
56
-
57
- constructor(passkeyName: string) {
58
- super(
59
- `Registration for passkey ${passkeyName} failed, either the registration took too long, or passkey signature vaildation failed.`,
60
- undefined,
61
- SmartWalletErrorCode.PASSKEY_REGISTRATION
62
- );
63
- this.passkeyName = passkeyName;
64
- }
65
- }
66
-
67
- export class PasskeyIncompatibleAuthenticatorError extends SmartWalletError {
68
- public passkeyName: string;
69
-
70
- constructor(passkeyName: string) {
71
- super(
72
- `User selected authenticator for passkey ${passkeyName} is not compatible with Crossmint's Smart Wallets.`,
73
- undefined,
74
- SmartWalletErrorCode.PASSKEY_INCOMPATIBLE_AUTHENTICATOR
75
- );
76
- this.passkeyName = passkeyName;
77
- }
78
- }
79
-
80
- export class ConfigError extends SmartWalletError {
81
- constructor(message: string) {
82
- super(message, undefined, SmartWalletErrorCode.WALLET_CONFIG);
83
- }
84
- }
85
-
86
- export class AdminAlreadyUsedError extends ConfigError {
87
- public readonly code = SmartWalletErrorCode.ADMIN_SIGNER_ALREADY_USED;
88
- constructor() {
89
- super("This signer was already used to create another wallet. Please use a different signer.");
90
- }
91
- }
92
-
93
- export class SmartWalletsNotEnabledError extends ConfigError {
94
- public readonly code = SmartWalletErrorCode.SMART_WALLETS_NOT_ENABLED;
95
- constructor() {
96
- super(
97
- "Smart wallets are not enabled for this project. They can be enabled on the project settings page in the developer console."
98
- );
99
- }
100
- }
@@ -1,36 +0,0 @@
1
- import { BaseError, stringify } from "viem";
2
-
3
- import type { SDKLogger } from "@crossmint/client-sdk-base";
4
-
5
- import { SmartWalletError } from ".";
6
- import { SDK_VERSION } from "../utils/constants";
7
-
8
- export class ErrorProcessor {
9
- constructor(private readonly logger: SDKLogger) {}
10
-
11
- public map(error: unknown, fallback: SmartWalletError): SmartWalletError | BaseError {
12
- this.record(error);
13
-
14
- if (error instanceof SmartWalletError) {
15
- return error;
16
- }
17
-
18
- // Allow viem errors, which are generally pretty friendly.
19
- if (error instanceof BaseError) {
20
- return error;
21
- }
22
-
23
- return fallback;
24
- }
25
-
26
- private record(error: unknown) {
27
- const message = error instanceof Error ? error.message : String(error);
28
- this.logger.error(`Smart Wallet SDK Error: ${message}`, {
29
- stack: error instanceof Error ? error.stack : undefined,
30
- name: error instanceof Error ? error.name : "UnknownError",
31
- details: stringify(error),
32
- domain: window.location.hostname,
33
- sdk_version: SDK_VERSION,
34
- });
35
- }
36
- }
package/src/index.ts DELETED
@@ -1,47 +0,0 @@
1
- export { blockchainToChainId, EVMBlockchainIncludingTestnet as Chain } from "@crossmint/common-sdk-base";
2
-
3
- export { EVMSmartWallet } from "./blockchain/wallets/EVMSmartWallet";
4
-
5
- export type {
6
- SmartWalletSDKInitParams,
7
- UserParams,
8
- ViemAccount,
9
- PasskeySigner,
10
- ExternalSigner,
11
- WalletParams,
12
- } from "./types/params";
13
-
14
- export type { SmartWalletChain as EVMSmartWalletChain } from "./blockchain/chains";
15
-
16
- export type { TransferType, ERC20TransferType, NFTTransferType, SFTTransferType } from "./types/token";
17
-
18
- export {
19
- SmartWalletError,
20
- UserWalletAlreadyCreatedError,
21
- AdminAlreadyUsedError,
22
- AdminMismatchError,
23
- PasskeyMismatchError,
24
- PasskeyPromptError,
25
- PasskeyRegistrationError,
26
- PasskeyIncompatibleAuthenticatorError,
27
- ConfigError,
28
- SmartWalletsNotEnabledError,
29
- } from "./error";
30
-
31
- export {
32
- EVMSendTransactionError,
33
- EVMSendTransactionExecutionRevertedError,
34
- } from "./blockchain/wallets/SendTransactionService";
35
-
36
- export {
37
- SmartWalletErrorCode,
38
- CrossmintSDKError,
39
- CrossmintServiceError,
40
- JWTDecryptionError,
41
- JWTExpiredError,
42
- JWTIdentifierError,
43
- JWTInvalidError,
44
- NotAuthorizedError,
45
- } from "@crossmint/client-sdk-base";
46
-
47
- export { SmartWalletSDK } from "./SmartWalletSDK";
@@ -1 +0,0 @@
1
- export * from "./logger";
@@ -1,6 +0,0 @@
1
- import { SDKLogger, getBrowserLogger } from "@crossmint/client-sdk-base";
2
-
3
- import { SCW_SERVICE } from "../utils/constants";
4
-
5
- export const scwLogger = new SDKLogger(SCW_SERVICE);
6
- export const scwDatadogLogger = new SDKLogger(SCW_SERVICE, getBrowserLogger(SCW_SERVICE, { onlyDatadog: true }));
@@ -1,76 +0,0 @@
1
- import type { KernelSmartAccount } from "@zerodev/sdk";
2
- import type { SmartAccountClient } from "permissionless";
3
- import type { SmartAccount } from "permissionless/accounts";
4
- import type { EntryPoint } from "permissionless/types/entrypoint";
5
- import type { Address, Chain, HttpTransport, PublicClient } from "viem";
6
-
7
- import type { SmartWalletChain } from "../blockchain/chains";
8
- import type { EOASignerConfig, PasskeySignerConfig, SignerConfig } from "../blockchain/wallets/account/signer";
9
- import { SUPPORTED_ENTRYPOINT_VERSIONS, SUPPORTED_KERNEL_VERSIONS } from "../utils/constants";
10
- import type { ExternalSigner, PasskeySigner, UserParams, WalletParams } from "./params";
11
-
12
- export type SupportedKernelVersion = (typeof SUPPORTED_KERNEL_VERSIONS)[number];
13
- export function isSupportedKernelVersion(version: string): version is SupportedKernelVersion {
14
- return SUPPORTED_KERNEL_VERSIONS.includes(version as any);
15
- }
16
-
17
- export type SupportedEntryPointVersion = (typeof SUPPORTED_ENTRYPOINT_VERSIONS)[number];
18
- export function isSupportedEntryPointVersion(version: string): version is SupportedEntryPointVersion {
19
- return SUPPORTED_ENTRYPOINT_VERSIONS.includes(version as any);
20
- }
21
-
22
- export interface PreExistingWalletProperties {
23
- signerConfig: SignerConfig;
24
- address: Address;
25
- }
26
-
27
- export interface WalletCreationContext {
28
- user: UserParams & { id: string };
29
- chain: SmartWalletChain;
30
- publicClient: PublicClient<HttpTransport>;
31
- walletParams: WalletParams;
32
- entryPoint: EntryPoint;
33
- kernelVersion: SupportedKernelVersion;
34
- existing?: PreExistingWalletProperties;
35
- }
36
-
37
- export interface PasskeyCreationContext extends WalletCreationContext {
38
- walletParams: WalletParams & { signer: PasskeySigner };
39
- existing?: { signerConfig: PasskeySignerConfig; address: Address };
40
- }
41
-
42
- export interface EOACreationContext extends WalletCreationContext {
43
- walletParams: WalletParams & { signer: ExternalSigner };
44
- existing?: { signerConfig: EOASignerConfig; address: Address };
45
- }
46
-
47
- export function isPasskeyWalletParams(params: WalletParams): params is WalletParams & { signer: PasskeySigner } {
48
- return "signer" in params && "type" in params.signer && params.signer.type === "PASSKEY";
49
- }
50
-
51
- export function isPasskeyCreationContext(params: WalletCreationContext): params is PasskeyCreationContext {
52
- const signerIsPasskeyOrUndefined = params.existing == null || params.existing.signerConfig.type === "passkeys";
53
-
54
- return isPasskeyWalletParams(params.walletParams) && signerIsPasskeyOrUndefined;
55
- }
56
-
57
- export function isEOAWalletParams(params: WalletParams): params is WalletParams & { signer: ExternalSigner } {
58
- return (
59
- "signer" in params &&
60
- (("type" in params.signer && params.signer.type === "VIEM_ACCOUNT") ||
61
- ("request" in params.signer && typeof params.signer.request === "function"))
62
- );
63
- }
64
-
65
- export function isEOACreationContext(params: WalletCreationContext): params is EOACreationContext {
66
- const signerIsEOAOrUndefined = params.existing == null || params.existing.signerConfig.type === "eoa";
67
-
68
- return isEOAWalletParams(params.walletParams) && signerIsEOAOrUndefined;
69
- }
70
-
71
- export interface AccountAndSigner {
72
- account: KernelSmartAccount<EntryPoint, HttpTransport>;
73
- signerConfig: SignerConfig;
74
- }
75
-
76
- export type SmartWalletClient = SmartAccountClient<EntryPoint, HttpTransport, Chain, SmartAccount<EntryPoint>>;
@@ -1,34 +0,0 @@
1
- import type { EIP1193Provider, LocalAccount } from "viem";
2
-
3
- export type SmartWalletSDKInitParams = {
4
- clientApiKey: string;
5
- };
6
-
7
- export type UserParams = {
8
- jwt: string;
9
- };
10
-
11
- export type ViemAccount = {
12
- type: "VIEM_ACCOUNT";
13
- account: LocalAccount & { source: "custom" };
14
- };
15
-
16
- export type PasskeySigner = {
17
- type: "PASSKEY";
18
-
19
- /**
20
- * Displayed to the user during passkey registration or signing prompts.
21
- * If not provided, a default name identifier within the JWT
22
- * that is specified in the project settings (typically `sub`) will be used.
23
- */
24
- passkeyName?: string;
25
- onPrePasskeyRegistration?: () => Promise<void> | void;
26
- onPasskeyRegistrationError?: (error: unknown) => Promise<void>;
27
- onFirstTimePasskeySigning?: () => Promise<void> | void;
28
- onFirstTimePasskeySigningError?: (error: unknown) => Promise<void>;
29
- };
30
-
31
- export type ExternalSigner = EIP1193Provider | ViemAccount;
32
- export interface WalletParams {
33
- signer: ExternalSigner | PasskeySigner;
34
- }
@@ -1,63 +0,0 @@
1
- import { PasskeyValidatorContractVersion } from "@zerodev/passkey-validator";
2
- import { isAddress, isHex } from "viem";
3
- import { z } from "zod";
4
-
5
- import { SUPPORTED_ENTRYPOINT_VERSIONS, SUPPORTED_KERNEL_VERSIONS } from "../utils/constants";
6
-
7
- const HexSchema = z.custom<`0x${string}`>((val): val is `0x${string}` => isHex(val as string), {
8
- message: "Invalid hex string",
9
- });
10
-
11
- const evmAddressSchema = z.custom<`0x${string}`>((val): val is `0x${string}` => isAddress(val as string), {
12
- message: "Invalid evm address",
13
- });
14
-
15
- export const EOASignerDataSchema = z.object({
16
- eoaAddress: evmAddressSchema,
17
- type: z.literal("eoa"),
18
- });
19
-
20
- export const PasskeyValidatorSerializedDataSchema = z.object({
21
- entryPoint: evmAddressSchema,
22
- validatorAddress: evmAddressSchema,
23
- pubKeyX: z.string(),
24
- pubKeyY: z.string(),
25
- authenticatorIdHash: HexSchema,
26
- authenticatorId: z.string(),
27
- });
28
-
29
- export const PasskeySignerDataSchema = PasskeyValidatorSerializedDataSchema.extend({
30
- passkeyName: z.string(),
31
- validatorContractVersion: z.nativeEnum(PasskeyValidatorContractVersion),
32
- domain: z.string(),
33
- type: z.literal("passkeys"),
34
- });
35
-
36
- export const SignerDataSchema = z.discriminatedUnion("type", [PasskeySignerDataSchema, EOASignerDataSchema]);
37
-
38
- export const SmartWalletConfigSchema = z.object({
39
- kernelVersion: z.enum(SUPPORTED_KERNEL_VERSIONS, {
40
- errorMap: (_, ctx) => ({
41
- message: `Unsupported kernel version. Supported versions: ${SUPPORTED_KERNEL_VERSIONS.join(
42
- ", "
43
- )}. Version used: ${ctx.data}. Please contact support`,
44
- }),
45
- }),
46
- entryPointVersion: z.enum(SUPPORTED_ENTRYPOINT_VERSIONS, {
47
- errorMap: (_, ctx) => ({
48
- message: `Unsupported entry point version. Supported versions: ${SUPPORTED_ENTRYPOINT_VERSIONS.join(
49
- ", "
50
- )}. Version used: ${ctx.data}. Please contact support`,
51
- }),
52
- }),
53
- userId: z.string().min(1),
54
- signers: z
55
- .array(
56
- z.object({
57
- signerData: SignerDataSchema,
58
- })
59
- )
60
- .min(0)
61
- .max(1, "Invalid wallet signer configuration. Please contact support"),
62
- smartContractWalletAddress: evmAddressSchema.optional(),
63
- });
@@ -1,31 +0,0 @@
1
- import type { z } from "zod";
2
-
3
- import type { SupportedEntryPointVersion, SupportedKernelVersion } from "./internal";
4
- import type {
5
- EOASignerDataSchema,
6
- PasskeySignerDataSchema,
7
- PasskeyValidatorSerializedDataSchema,
8
- SignerDataSchema,
9
- SmartWalletConfigSchema,
10
- } from "./schema";
11
-
12
- export type EOASignerData = z.infer<typeof EOASignerDataSchema>;
13
- export type PasskeyValidatorSerializedData = z.infer<typeof PasskeyValidatorSerializedDataSchema>;
14
- export type PasskeySignerData = z.infer<typeof PasskeySignerDataSchema>;
15
- export type SmartWalletConfig = z.infer<typeof SmartWalletConfigSchema>;
16
- export type SignerData = z.infer<typeof SignerDataSchema>;
17
-
18
- export type PasskeyDisplay = Pick<PasskeySignerData, "type" | "passkeyName" | "pubKeyX" | "pubKeyY">;
19
- export type SignerDisplay = EOASignerData | PasskeyDisplay;
20
-
21
- export type StoreSmartWalletParams = {
22
- type: string;
23
- smartContractWalletAddress: string;
24
- signerData: SignerData;
25
- sessionKeySignerAddress?: string;
26
- version: number;
27
- baseLayer: string;
28
- chainId: number;
29
- entryPointVersion: SupportedEntryPointVersion;
30
- kernelVersion: SupportedKernelVersion;
31
- };
@@ -1,29 +0,0 @@
1
- import type { Address } from "viem";
2
-
3
- import type { SmartWalletChain } from "../blockchain/chains";
4
-
5
- export interface EVMToken {
6
- chain: SmartWalletChain;
7
- contractAddress: Address;
8
- }
9
-
10
- export interface NFTEVMToken extends EVMToken {
11
- tokenId: string;
12
- type: "nft";
13
- }
14
-
15
- export interface SFTEVMToken extends EVMToken {
16
- tokenId: string;
17
- type: "sft";
18
- }
19
-
20
- export interface ERC2OEVMToken extends EVMToken {
21
- type: "ft";
22
- }
23
-
24
- export type TokenType = "nft" | "sft" | "ft";
25
-
26
- export type ERC20TransferType = { token: ERC2OEVMToken; amount: bigint };
27
- export type SFTTransferType = { token: SFTEVMToken; quantity: number };
28
- export type NFTTransferType = { token: NFTEVMToken };
29
- export type TransferType = ERC20TransferType | SFTTransferType | NFTTransferType;
package/src/utils/api.ts DELETED
@@ -1,39 +0,0 @@
1
- import { toHex } from "viem";
2
-
3
- function mapObject(data: any, fn: (value: unknown) => { value: unknown; replace: boolean }): any {
4
- const result = fn(data);
5
- if (result.replace) {
6
- return result.value;
7
- }
8
- if (Array.isArray(data)) {
9
- return data.map((item) => mapObject(item, fn));
10
- } else if (data !== null && typeof data === "object") {
11
- return Object.fromEntries(Object.entries(data).map(([key, value]) => [key, mapObject(value, fn)]));
12
- }
13
- return result.value;
14
- }
15
-
16
- export function bigintsToHex(data: any): any {
17
- return mapObject(data, (value) => {
18
- if (typeof value === "bigint") {
19
- return { value: toHex(value), replace: true };
20
- }
21
- return { value, replace: false };
22
- });
23
- }
24
-
25
- export function parseBigintAPIResponse(data: any): any {
26
- return mapObject(data, (value) => {
27
- if (
28
- value != null &&
29
- typeof value == "object" &&
30
- "__xm_serializedType" in value &&
31
- "value" in value &&
32
- value.__xm_serializedType === "bigint" &&
33
- typeof value.value === "string"
34
- ) {
35
- return { value: BigInt(value.value), replace: true };
36
- }
37
- return { value, replace: false };
38
- });
39
- }
@@ -1,5 +0,0 @@
1
- import type { SmartWalletChain } from "../blockchain/chains";
2
-
3
- export function usesGelatoBundler(chain: SmartWalletChain) {
4
- return false;
5
- }
@@ -1,9 +0,0 @@
1
- import { version } from "../../package.json";
2
-
3
- export const ZERO_DEV_TYPE = "ZeroDev";
4
- export const CURRENT_VERSION = 0;
5
- export const SCW_SERVICE = "SCW_SDK";
6
- export const SDK_VERSION = version;
7
- export const API_VERSION = "2024-06-09";
8
- export const SUPPORTED_KERNEL_VERSIONS = ["0.3.1", "0.3.0", "0.2.4"] as const;
9
- export const SUPPORTED_ENTRYPOINT_VERSIONS = ["v0.6", "v0.7"] as const;
@@ -1,3 +0,0 @@
1
- export function isClient() {
2
- return typeof window !== "undefined";
3
- }
@@ -1,7 +0,0 @@
1
- export function isEmpty(str: string | undefined | null): str is undefined | null {
2
- return !str || str.length === 0 || str.trim().length === 0;
3
- }
4
-
5
- export function equalsIgnoreCase(a?: string, b?: string): boolean {
6
- return a?.toLowerCase() === b?.toLowerCase();
7
- }