@crossmint/client-sdk-smart-wallet 0.1.24 → 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-2BBSPDW4.cjs +0 -99
  165. package/dist/chunk-2BBSPDW4.cjs.map +0 -1
  166. package/dist/chunk-2GADBKIW.cjs +0 -39
  167. package/dist/chunk-2GADBKIW.cjs.map +0 -1
  168. package/dist/chunk-2HB65Y7D.js +0 -79
  169. package/dist/chunk-2HB65Y7D.js.map +0 -1
  170. package/dist/chunk-3EQHAQXO.js +0 -112
  171. package/dist/chunk-3EQHAQXO.js.map +0 -1
  172. package/dist/chunk-3R6PW6HY.js +0 -30
  173. package/dist/chunk-3R6PW6HY.js.map +0 -1
  174. package/dist/chunk-5MG5CIEX.cjs.map +0 -1
  175. package/dist/chunk-5URMCCO6.js +0 -9
  176. package/dist/chunk-5URMCCO6.js.map +0 -1
  177. package/dist/chunk-5WVQ7J3E.cjs +0 -369
  178. package/dist/chunk-5WVQ7J3E.cjs.map +0 -1
  179. package/dist/chunk-6FS2OI5W.js +0 -66
  180. package/dist/chunk-6FS2OI5W.js.map +0 -1
  181. package/dist/chunk-6NJVFL2X.js +0 -60
  182. package/dist/chunk-6NJVFL2X.js.map +0 -1
  183. package/dist/chunk-74NTQGER.js +0 -44
  184. package/dist/chunk-74NTQGER.js.map +0 -1
  185. package/dist/chunk-77GT6B5L.cjs +0 -79
  186. package/dist/chunk-77GT6B5L.cjs.map +0 -1
  187. package/dist/chunk-7KTQNIAZ.cjs +0 -112
  188. package/dist/chunk-7KTQNIAZ.cjs.map +0 -1
  189. package/dist/chunk-7ORLXP6K.cjs +0 -93
  190. package/dist/chunk-7ORLXP6K.cjs.map +0 -1
  191. package/dist/chunk-ASIPMVRQ.js +0 -90
  192. package/dist/chunk-ASIPMVRQ.js.map +0 -1
  193. package/dist/chunk-BARW756O.js +0 -27
  194. package/dist/chunk-BARW756O.js.map +0 -1
  195. package/dist/chunk-BXSAJOIV.cjs +0 -90
  196. package/dist/chunk-BXSAJOIV.cjs.map +0 -1
  197. package/dist/chunk-DTEA33DF.cjs +0 -59
  198. package/dist/chunk-DTEA33DF.cjs.map +0 -1
  199. package/dist/chunk-DYO4HODM.cjs +0 -36
  200. package/dist/chunk-DYO4HODM.cjs.map +0 -1
  201. package/dist/chunk-EPEGJY6N.cjs +0 -9
  202. package/dist/chunk-EPEGJY6N.cjs.map +0 -1
  203. package/dist/chunk-EQSMHR77.js +0 -30
  204. package/dist/chunk-EQSMHR77.js.map +0 -1
  205. package/dist/chunk-FSIMJYXR.js +0 -36
  206. package/dist/chunk-FSIMJYXR.js.map +0 -1
  207. package/dist/chunk-FXGOVLZW.cjs +0 -9
  208. package/dist/chunk-FXGOVLZW.cjs.map +0 -1
  209. package/dist/chunk-ICLDP7BD.cjs +0 -36
  210. package/dist/chunk-ICLDP7BD.cjs.map +0 -1
  211. package/dist/chunk-IZZQHNZT.cjs +0 -22
  212. package/dist/chunk-IZZQHNZT.cjs.map +0 -1
  213. package/dist/chunk-JLZCSWUY.cjs +0 -14
  214. package/dist/chunk-JLZCSWUY.cjs.map +0 -1
  215. package/dist/chunk-JOB7STIS.js +0 -9
  216. package/dist/chunk-JOB7STIS.js.map +0 -1
  217. package/dist/chunk-KHROQTVY.js +0 -1
  218. package/dist/chunk-KHROQTVY.js.map +0 -1
  219. package/dist/chunk-LWVV7JDJ.js +0 -36
  220. package/dist/chunk-LWVV7JDJ.js.map +0 -1
  221. package/dist/chunk-N6DG5EZG.cjs +0 -156
  222. package/dist/chunk-N6DG5EZG.cjs.map +0 -1
  223. package/dist/chunk-NI6WQXMN.js +0 -99
  224. package/dist/chunk-NI6WQXMN.js.map +0 -1
  225. package/dist/chunk-O6IFYHDP.cjs +0 -36
  226. package/dist/chunk-O6IFYHDP.cjs.map +0 -1
  227. package/dist/chunk-OGA3YDWS.cjs +0 -112
  228. package/dist/chunk-OGA3YDWS.cjs.map +0 -1
  229. package/dist/chunk-OIEP34C6.js +0 -41
  230. package/dist/chunk-OIEP34C6.js.map +0 -1
  231. package/dist/chunk-ON4DOYVD.js +0 -369
  232. package/dist/chunk-ON4DOYVD.js.map +0 -1
  233. package/dist/chunk-PVFA6PBX.cjs +0 -60
  234. package/dist/chunk-PVFA6PBX.cjs.map +0 -1
  235. package/dist/chunk-QBQDYMNI.js +0 -39
  236. package/dist/chunk-QBQDYMNI.js.map +0 -1
  237. package/dist/chunk-QJ3BSVGV.js +0 -36
  238. package/dist/chunk-QJ3BSVGV.js.map +0 -1
  239. package/dist/chunk-RUTDRRS2.cjs +0 -66
  240. package/dist/chunk-RUTDRRS2.cjs.map +0 -1
  241. package/dist/chunk-SBR2CREX.js +0 -82
  242. package/dist/chunk-SBR2CREX.js.map +0 -1
  243. package/dist/chunk-SMDX2MXU.js +0 -13
  244. package/dist/chunk-SMDX2MXU.js.map +0 -1
  245. package/dist/chunk-TDJDKTRS.js +0 -156
  246. package/dist/chunk-TDJDKTRS.js.map +0 -1
  247. package/dist/chunk-TZUJ5MXW.cjs +0 -82
  248. package/dist/chunk-TZUJ5MXW.cjs.map +0 -1
  249. package/dist/chunk-U4OBHCIP.js +0 -59
  250. package/dist/chunk-U4OBHCIP.js.map +0 -1
  251. package/dist/chunk-UQKE6R5W.cjs +0 -27
  252. package/dist/chunk-UQKE6R5W.cjs.map +0 -1
  253. package/dist/chunk-UZGHOTKZ.js +0 -112
  254. package/dist/chunk-UZGHOTKZ.js.map +0 -1
  255. package/dist/chunk-WRH3YJT3.js +0 -14
  256. package/dist/chunk-WRH3YJT3.js.map +0 -1
  257. package/dist/chunk-X4KT4AKM.cjs +0 -123
  258. package/dist/chunk-X4KT4AKM.cjs.map +0 -1
  259. package/dist/chunk-YKW7PMBU.js +0 -22
  260. package/dist/chunk-YKW7PMBU.js.map +0 -1
  261. package/dist/chunk-YWCXHOSD.cjs +0 -30
  262. package/dist/chunk-YWCXHOSD.cjs.map +0 -1
  263. package/dist/chunk-Z5DNJTAW.cjs +0 -41
  264. package/dist/chunk-Z5DNJTAW.cjs.map +0 -1
  265. package/dist/chunk-Z7JWER3L.js +0 -93
  266. package/dist/chunk-Z7JWER3L.js.map +0 -1
  267. package/dist/chunk-ZAQLXUMA.cjs +0 -44
  268. package/dist/chunk-ZAQLXUMA.cjs.map +0 -1
  269. package/dist/chunk-ZEWOQEKM.js +0 -123
  270. package/dist/chunk-ZEWOQEKM.js.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,320 +0,0 @@
1
- [
2
- {
3
- "inputs": [
4
- {
5
- "internalType": "string",
6
- "name": "name_",
7
- "type": "string"
8
- },
9
- {
10
- "internalType": "string",
11
- "name": "symbol_",
12
- "type": "string"
13
- }
14
- ],
15
- "stateMutability": "nonpayable",
16
- "type": "constructor"
17
- },
18
- {
19
- "anonymous": false,
20
- "inputs": [
21
- {
22
- "indexed": true,
23
- "internalType": "address",
24
- "name": "owner",
25
- "type": "address"
26
- },
27
- {
28
- "indexed": true,
29
- "internalType": "address",
30
- "name": "approved",
31
- "type": "address"
32
- },
33
- {
34
- "indexed": true,
35
- "internalType": "uint256",
36
- "name": "tokenId",
37
- "type": "uint256"
38
- }
39
- ],
40
- "name": "Approval",
41
- "type": "event"
42
- },
43
- {
44
- "anonymous": false,
45
- "inputs": [
46
- {
47
- "indexed": true,
48
- "internalType": "address",
49
- "name": "owner",
50
- "type": "address"
51
- },
52
- {
53
- "indexed": true,
54
- "internalType": "address",
55
- "name": "operator",
56
- "type": "address"
57
- },
58
- {
59
- "indexed": false,
60
- "internalType": "bool",
61
- "name": "approved",
62
- "type": "bool"
63
- }
64
- ],
65
- "name": "ApprovalForAll",
66
- "type": "event"
67
- },
68
- {
69
- "anonymous": false,
70
- "inputs": [
71
- {
72
- "indexed": true,
73
- "internalType": "address",
74
- "name": "from",
75
- "type": "address"
76
- },
77
- {
78
- "indexed": true,
79
- "internalType": "address",
80
- "name": "to",
81
- "type": "address"
82
- },
83
- {
84
- "indexed": true,
85
- "internalType": "uint256",
86
- "name": "tokenId",
87
- "type": "uint256"
88
- }
89
- ],
90
- "name": "Transfer",
91
- "type": "event"
92
- },
93
- {
94
- "inputs": [
95
- {
96
- "internalType": "address",
97
- "name": "to",
98
- "type": "address"
99
- },
100
- {
101
- "internalType": "uint256",
102
- "name": "tokenId",
103
- "type": "uint256"
104
- }
105
- ],
106
- "name": "approve",
107
- "outputs": [],
108
- "stateMutability": "nonpayable",
109
- "type": "function"
110
- },
111
- {
112
- "inputs": [
113
- {
114
- "internalType": "address",
115
- "name": "owner",
116
- "type": "address"
117
- }
118
- ],
119
- "name": "balanceOf",
120
- "outputs": [
121
- {
122
- "internalType": "uint256",
123
- "name": "",
124
- "type": "uint256"
125
- }
126
- ],
127
- "stateMutability": "view",
128
- "type": "function"
129
- },
130
- {
131
- "inputs": [
132
- {
133
- "internalType": "uint256",
134
- "name": "tokenId",
135
- "type": "uint256"
136
- }
137
- ],
138
- "name": "getApproved",
139
- "outputs": [
140
- {
141
- "internalType": "address",
142
- "name": "",
143
- "type": "address"
144
- }
145
- ],
146
- "stateMutability": "view",
147
- "type": "function"
148
- },
149
- {
150
- "inputs": [
151
- {
152
- "internalType": "address",
153
- "name": "owner",
154
- "type": "address"
155
- },
156
- {
157
- "internalType": "address",
158
- "name": "operator",
159
- "type": "address"
160
- }
161
- ],
162
- "name": "isApprovedForAll",
163
- "outputs": [
164
- {
165
- "internalType": "bool",
166
- "name": "",
167
- "type": "bool"
168
- }
169
- ],
170
- "stateMutability": "view",
171
- "type": "function"
172
- },
173
- {
174
- "inputs": [],
175
- "name": "name",
176
- "outputs": [
177
- {
178
- "internalType": "string",
179
- "name": "",
180
- "type": "string"
181
- }
182
- ],
183
- "stateMutability": "view",
184
- "type": "function"
185
- },
186
- {
187
- "inputs": [
188
- {
189
- "internalType": "uint256",
190
- "name": "tokenId",
191
- "type": "uint256"
192
- }
193
- ],
194
- "name": "ownerOf",
195
- "outputs": [
196
- {
197
- "internalType": "address",
198
- "name": "",
199
- "type": "address"
200
- }
201
- ],
202
- "stateMutability": "view",
203
- "type": "function"
204
- },
205
- {
206
- "inputs": [
207
- {
208
- "internalType": "address",
209
- "name": "from",
210
- "type": "address"
211
- },
212
- {
213
- "internalType": "address",
214
- "name": "to",
215
- "type": "address"
216
- },
217
- {
218
- "internalType": "uint256",
219
- "name": "tokenId",
220
- "type": "uint256"
221
- }
222
- ],
223
- "name": "safeTransferFrom",
224
- "outputs": [],
225
- "stateMutability": "nonpayable",
226
- "type": "function"
227
- },
228
- {
229
- "inputs": [
230
- {
231
- "internalType": "address",
232
- "name": "operator",
233
- "type": "address"
234
- },
235
- {
236
- "internalType": "bool",
237
- "name": "approved",
238
- "type": "bool"
239
- }
240
- ],
241
- "name": "setApprovalForAll",
242
- "outputs": [],
243
- "stateMutability": "nonpayable",
244
- "type": "function"
245
- },
246
- {
247
- "inputs": [
248
- {
249
- "internalType": "bytes4",
250
- "name": "interfaceId",
251
- "type": "bytes4"
252
- }
253
- ],
254
- "name": "supportsInterface",
255
- "outputs": [
256
- {
257
- "internalType": "bool",
258
- "name": "",
259
- "type": "bool"
260
- }
261
- ],
262
- "stateMutability": "view",
263
- "type": "function"
264
- },
265
- {
266
- "inputs": [],
267
- "name": "symbol",
268
- "outputs": [
269
- {
270
- "internalType": "string",
271
- "name": "",
272
- "type": "string"
273
- }
274
- ],
275
- "stateMutability": "view",
276
- "type": "function"
277
- },
278
- {
279
- "inputs": [
280
- {
281
- "internalType": "uint256",
282
- "name": "tokenId",
283
- "type": "uint256"
284
- }
285
- ],
286
- "name": "tokenURI",
287
- "outputs": [
288
- {
289
- "internalType": "string",
290
- "name": "",
291
- "type": "string"
292
- }
293
- ],
294
- "stateMutability": "view",
295
- "type": "function"
296
- },
297
- {
298
- "inputs": [
299
- {
300
- "internalType": "address",
301
- "name": "from",
302
- "type": "address"
303
- },
304
- {
305
- "internalType": "address",
306
- "name": "to",
307
- "type": "address"
308
- },
309
- {
310
- "internalType": "uint256",
311
- "name": "tokenId",
312
- "type": "uint256"
313
- }
314
- ],
315
- "name": "transferFrom",
316
- "outputs": [],
317
- "stateMutability": "nonpayable",
318
- "type": "function"
319
- }
320
- ]
@@ -1,31 +0,0 @@
1
- import { beforeEach, describe, expect, it, vi } from "vitest";
2
-
3
- import { SmartWalletSDK } from "./SmartWalletSDK";
4
-
5
- vi.mock("./services/logging");
6
-
7
- // Mock global window object
8
- vi.stubGlobal("window", {
9
- location: {
10
- origin: "http://localhost",
11
- },
12
- });
13
-
14
- describe("SmartWalletSDK", () => {
15
- let sdk: SmartWalletSDK;
16
-
17
- beforeEach(() => {
18
- // Reset mocks before each test
19
- vi.clearAllMocks();
20
- sdk = SmartWalletSDK.init({
21
- clientApiKey:
22
- "sk_staging_A4vDwAp4t5az6fVQMpQK6qapBnAqgpxrrD35TaFQnyKgxehNbd959uZeaHjNCadWDXrgLRAK1CxeasZjtYEq4TbFkKMBBvbQ9oinAxQf8LbHsSYW2DMzT8fBko3YGLq9t7ZiXZjmgkTioxGVUUjyLtWLeBKwNUDLgpshWjaoR7pKRnSE9SqhwjQbiK62VKiBTdA3KvHsyG9k8mLMcKrDyfXp",
23
- });
24
- });
25
-
26
- describe("init", () => {
27
- it("should initialize the SDK correctly", () => {
28
- expect(sdk).toBeInstanceOf(SmartWalletSDK);
29
- });
30
- });
31
- });
@@ -1,104 +0,0 @@
1
- import { stringify } from "viem";
2
-
3
- import { type APIKeyEnvironmentPrefix, validateAPIKey } from "@crossmint/common-sdk-base";
4
-
5
- import { CrossmintWalletService } from "./api/CrossmintWalletService";
6
- import { type SmartWalletChain, isMainnetChain, isTestnetChain } from "./blockchain/chains";
7
- import type { EVMSmartWallet } from "./blockchain/wallets";
8
- import { AccountConfigCache } from "./blockchain/wallets/account/cache";
9
- import { AccountConfigService } from "./blockchain/wallets/account/config";
10
- import { AccountCreator } from "./blockchain/wallets/account/creator";
11
- import { EOACreationStrategy } from "./blockchain/wallets/account/eoa";
12
- import { PasskeyCreationStrategy } from "./blockchain/wallets/account/passkey";
13
- import { ClientDecorator } from "./blockchain/wallets/clientDecorator";
14
- import { SmartWalletService } from "./blockchain/wallets/service";
15
- import { SmartWalletError } from "./error";
16
- import { ErrorProcessor } from "./error/processor";
17
- import { scwDatadogLogger, scwLogger } from "./services";
18
- import type { SmartWalletSDKInitParams, UserParams, WalletParams } from "./types/params";
19
- import { SDK_VERSION } from "./utils/constants";
20
- import { isClient } from "./utils/environment";
21
-
22
- export class SmartWalletSDK {
23
- private constructor(
24
- private readonly crossmintEnv: APIKeyEnvironmentPrefix,
25
- private readonly smartWalletService: SmartWalletService,
26
- private readonly errorProcessor: ErrorProcessor,
27
- private readonly logger = scwLogger
28
- ) {}
29
-
30
- /**
31
- * Initializes the SDK with the **client side** API key obtained from the Crossmint console.
32
- * @throws error if the api key is not formatted correctly.
33
- */
34
- static init({ clientApiKey }: SmartWalletSDKInitParams): SmartWalletSDK {
35
- const validationResult = validateAPIKey(clientApiKey);
36
- if (!validationResult.isValid) {
37
- throw new Error("API key invalid");
38
- }
39
-
40
- const crossmintService = new CrossmintWalletService(clientApiKey);
41
- const errorProcessor = new ErrorProcessor(scwDatadogLogger);
42
- const accountCreator = new AccountCreator(
43
- new EOACreationStrategy(),
44
- new PasskeyCreationStrategy(crossmintService.getPasskeyServerUrl(), clientApiKey)
45
- );
46
- const accountCache = new AccountConfigCache(`smart-wallet-${SDK_VERSION}`);
47
-
48
- const smartWalletService = new SmartWalletService(
49
- crossmintService,
50
- new AccountConfigService(crossmintService, accountCache),
51
- accountCreator,
52
- new ClientDecorator(errorProcessor)
53
- );
54
-
55
- return new SmartWalletSDK(validationResult.environment, smartWalletService, errorProcessor);
56
- }
57
-
58
- /**
59
- * Retrieves or creates a wallet for the specified user.
60
- * The default configuration is a `PasskeySigner` with the name, which is displayed to the user during creation or signing prompts, derived from the provided jwt.
61
- *
62
- * Example using the default passkey signer:
63
- * ```ts
64
- * const wallet = await smartWalletSDK.getOrCreateWallet({ jwt: "xxx" }, "base");
65
- * ```
66
- */
67
- async getOrCreateWallet(
68
- user: UserParams,
69
- chain: SmartWalletChain,
70
- walletParams: WalletParams = { signer: { type: "PASSKEY" } }
71
- ): Promise<EVMSmartWallet> {
72
- if (!isClient()) {
73
- throw new SmartWalletError("Smart Wallet SDK should only be used client side.");
74
- }
75
- this.assertValidChain(chain);
76
-
77
- return await this.logger.logPerformance("GET_OR_CREATE_WALLET", async () => {
78
- try {
79
- return await this.smartWalletService.getOrCreate(user, chain, walletParams);
80
- } catch (error: any) {
81
- throw this.errorProcessor.map(
82
- error,
83
- new SmartWalletError(`Wallet creation failed: ${error.message}.`, stringify(error))
84
- );
85
- }
86
- });
87
- }
88
-
89
- private assertValidChain(chain: SmartWalletChain) {
90
- if (!this.validChain(chain)) {
91
- throw new SmartWalletError(
92
- `The selected chain "${chain}" is not available in "${this.crossmintEnv}". Either set a valid chain or check you're using an API key for the environment you're trying to target.`
93
- );
94
- }
95
- }
96
-
97
- private validChain(chain: SmartWalletChain): boolean {
98
- if (this.crossmintEnv === "development" || this.crossmintEnv === "staging") {
99
- return isTestnetChain(chain);
100
- }
101
-
102
- return isMainnetChain(chain);
103
- }
104
- }
@@ -1,43 +0,0 @@
1
- import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
2
-
3
- import { CROSSMINT_STG_URL } from "@crossmint/common-sdk-base";
4
-
5
- import { CrossmintWalletService } from "./CrossmintWalletService";
6
-
7
- vi.mock("../services/logging", () => ({
8
- logError: vi.fn(),
9
- logInfo: vi.fn(),
10
- }));
11
-
12
- vi.mock("../utils/helpers", () => ({
13
- isLocalhost: vi.fn().mockReturnValue(true),
14
- }));
15
-
16
- describe("CrossmintService", () => {
17
- let crossmintService: CrossmintWalletService;
18
- const apiKey =
19
- "sk_staging_A4vDwAp4t5az6fVQMpQK6qapBnAqgpxrrD35TaFQnyKgxehNbd959uZeaHjNCadWDXrgLRAK1CxeasZjtYEq4TbFkKMBBvbQ9oinAxQf8LbHsSYW2DMzT8fBko3YGLq9t7ZiXZjmgkTioxGVUUjyLtWLeBKwNUDLgpshWjaoR7pKRnSE9SqhwjQbiK62VKiBTdA3KvHsyG9k8mLMcKrDyfXp";
20
-
21
- beforeEach(() => {
22
- crossmintService = new CrossmintWalletService(apiKey);
23
- });
24
-
25
- describe("constructor", () => {
26
- it("should initialize with correct headers and base URL", () => {
27
- expect(crossmintService).toBeDefined();
28
-
29
- expect(crossmintService["crossmintAPIHeaders"]).toEqual({
30
- accept: "application/json",
31
- "content-type": "application/json",
32
- "x-api-key": apiKey,
33
- });
34
-
35
- // Check if the base URL is correctly set to the staging URL
36
- expect(crossmintService["crossmintBaseUrl"]).toBe(CROSSMINT_STG_URL);
37
- });
38
- });
39
-
40
- afterEach(() => {
41
- vi.clearAllMocks();
42
- });
43
- });
@@ -1,84 +0,0 @@
1
- import type { UserOperation } from "permissionless";
2
- import type { EntryPoint, GetEntryPointVersion } from "permissionless/types/entrypoint";
3
-
4
- import { APIErrorService, BaseCrossmintService, CrossmintServiceError } from "@crossmint/client-sdk-base";
5
- import { blockchainToChainId } from "@crossmint/common-sdk-base";
6
-
7
- import type { SmartWalletChain } from "../blockchain/chains";
8
- import { AdminAlreadyUsedError, SmartWalletsNotEnabledError, UserWalletAlreadyCreatedError } from "../error";
9
- import { scwLogger } from "../services";
10
- import type { UserParams } from "../types/params";
11
- import { SmartWalletConfigSchema } from "../types/schema";
12
- import type { SmartWalletConfig, StoreSmartWalletParams } from "../types/service";
13
- import { bigintsToHex, parseBigintAPIResponse } from "../utils/api";
14
- import { API_VERSION } from "../utils/constants";
15
-
16
- type WalletsAPIErrorCodes =
17
- | "ERROR_USER_WALLET_ALREADY_CREATED"
18
- | "ERROR_ADMIN_SIGNER_ALREADY_USED"
19
- | "ERROR_PROJECT_NONCUSTODIAL_WALLETS_NOT_ENABLED";
20
-
21
- export class CrossmintWalletService extends BaseCrossmintService {
22
- logger = scwLogger;
23
- protected apiErrorService = new APIErrorService<WalletsAPIErrorCodes>({
24
- ERROR_USER_WALLET_ALREADY_CREATED: ({ userId }: { userId: string }) =>
25
- new UserWalletAlreadyCreatedError(userId),
26
- ERROR_ADMIN_SIGNER_ALREADY_USED: () => new AdminAlreadyUsedError(),
27
- ERROR_PROJECT_NONCUSTODIAL_WALLETS_NOT_ENABLED: () => new SmartWalletsNotEnabledError(),
28
- });
29
-
30
- async idempotentCreateSmartWallet(user: UserParams, input: StoreSmartWalletParams): Promise<void> {
31
- await this.fetchCrossmintAPI(
32
- `${API_VERSION}/sdk/smart-wallet`,
33
- { method: "PUT", body: JSON.stringify(input) },
34
- "Error creating abstract wallet. Please contact support",
35
- user.jwt
36
- );
37
- }
38
-
39
- async sponsorUserOperation<E extends EntryPoint>(
40
- user: UserParams,
41
- userOp: UserOperation<GetEntryPointVersion<E>>,
42
- entryPoint: E,
43
- chain: SmartWalletChain
44
- ): Promise<{ sponsorUserOpParams: UserOperation<GetEntryPointVersion<E>> }> {
45
- const chainId = blockchainToChainId(chain);
46
- const result = await this.fetchCrossmintAPI(
47
- `${API_VERSION}/sdk/paymaster`,
48
- { method: "POST", body: JSON.stringify({ userOp: bigintsToHex(userOp), entryPoint, chainId }) },
49
- "Error sponsoring user operation. Please contact support",
50
- user.jwt
51
- );
52
- return parseBigintAPIResponse(result);
53
- }
54
-
55
- async getSmartWalletConfig(user: UserParams, chain: SmartWalletChain): Promise<SmartWalletConfig> {
56
- const data: unknown = await this.fetchCrossmintAPI(
57
- `${API_VERSION}/sdk/smart-wallet/config?chain=${chain}`,
58
- { method: "GET" },
59
- "Error getting smart wallet version configuration. Please contact support",
60
- user.jwt
61
- );
62
-
63
- const result = SmartWalletConfigSchema.safeParse(data);
64
- if (!result.success) {
65
- throw new CrossmintServiceError(
66
- `Invalid smart wallet config, please contact support. Details below:\n${result.error.toString()}`
67
- );
68
- }
69
-
70
- return result.data;
71
- }
72
-
73
- async fetchNFTs(address: string, chain: SmartWalletChain) {
74
- return this.fetchCrossmintAPI(
75
- `v1-alpha1/wallets/${chain}:${address}/nfts`,
76
- { method: "GET" },
77
- `Error fetching NFTs for wallet: ${address}`
78
- );
79
- }
80
-
81
- public getPasskeyServerUrl(): string {
82
- return this.crossmintBaseUrl + "api/internal/passkeys";
83
- }
84
- }
@@ -1,57 +0,0 @@
1
- import {
2
- type Chain,
3
- arbitrum,
4
- arbitrumSepolia,
5
- base,
6
- baseSepolia,
7
- optimism,
8
- optimismSepolia,
9
- polygon,
10
- polygonAmoy,
11
- } from "viem/chains";
12
-
13
- import { BlockchainIncludingTestnet as Blockchain, type ObjectValues, objectValues } from "@crossmint/common-sdk-base";
14
-
15
- export const SmartWalletTestnet = {
16
- BASE_SEPOLIA: Blockchain.BASE_SEPOLIA,
17
- POLYGON_AMOY: Blockchain.POLYGON_AMOY,
18
- OPTIMISM_SEPOLIA: Blockchain.OPTIMISM_SEPOLIA,
19
- ARBITRUM_SEPOLIA: Blockchain.ARBITRUM_SEPOLIA,
20
- } as const;
21
- export type SmartWalletTestnet = ObjectValues<typeof SmartWalletTestnet>;
22
- export const SMART_WALLET_TESTNETS = objectValues(SmartWalletTestnet);
23
-
24
- export const SmartWalletMainnet = {
25
- BASE: Blockchain.BASE,
26
- POLYGON: Blockchain.POLYGON,
27
- OPTIMISM: Blockchain.OPTIMISM,
28
- ARBITRUM: Blockchain.ARBITRUM,
29
- } as const;
30
- export type SmartWalletMainnet = ObjectValues<typeof SmartWalletMainnet>;
31
- export const SMART_WALLET_MAINNETS = objectValues(SmartWalletMainnet);
32
-
33
- export const SmartWalletChain = {
34
- ...SmartWalletTestnet,
35
- ...SmartWalletMainnet,
36
- } as const;
37
- export type SmartWalletChain = ObjectValues<typeof SmartWalletChain>;
38
- export const SMART_WALLET_CHAINS = objectValues(SmartWalletChain);
39
-
40
- export function isTestnetChain(chain: SmartWalletChain): chain is SmartWalletTestnet {
41
- return (SMART_WALLET_TESTNETS as any).includes(chain);
42
- }
43
-
44
- export function isMainnetChain(chain: SmartWalletChain): chain is SmartWalletMainnet {
45
- return (SMART_WALLET_MAINNETS as any).includes(chain);
46
- }
47
-
48
- export const viemNetworks: Record<SmartWalletChain, Chain> = {
49
- polygon: polygon,
50
- "polygon-amoy": polygonAmoy,
51
- base: base,
52
- "base-sepolia": baseSepolia,
53
- optimism: optimism,
54
- "optimism-sepolia": optimismSepolia,
55
- arbitrum: arbitrum,
56
- "arbitrum-sepolia": arbitrumSepolia,
57
- };
@@ -1,25 +0,0 @@
1
- import { blockchainToChainId } from "@crossmint/common-sdk-base";
2
-
3
- import type { SmartWalletChain } from "./chains";
4
-
5
- const ALCHEMY_API_KEY = "-7M6vRDBDknwvMxnqah_jbcieWg0qad9";
6
- const PIMLICO_API_KEY = "pim_9dKmQPxiTCvtbUNF7XFBbA";
7
-
8
- export const ALCHEMY_RPC_SUBDOMAIN: Record<SmartWalletChain, string> = {
9
- polygon: "polygon-mainnet",
10
- "polygon-amoy": "polygon-amoy",
11
- base: "base-mainnet",
12
- "base-sepolia": "base-sepolia",
13
- optimism: "opt-mainnet",
14
- "optimism-sepolia": "opt-sepolia",
15
- arbitrum: "arb-mainnet",
16
- "arbitrum-sepolia": "arb-sepolia",
17
- };
18
-
19
- export function getAlchemyRPC(chain: SmartWalletChain): string {
20
- return `https://${ALCHEMY_RPC_SUBDOMAIN[chain]}.g.alchemy.com/v2/${ALCHEMY_API_KEY}`;
21
- }
22
-
23
- export function getPimlicoBundlerRPC(chain: SmartWalletChain): string {
24
- return `https://api.pimlico.io/v2/${blockchainToChainId(chain)}/rpc?apikey=${PIMLICO_API_KEY}`;
25
- }