@crossmint/wallets-sdk 1.6.2 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/dist/api/__tests__/constants.d.cts +1 -1
  2. package/dist/api/__tests__/constants.d.ts +1 -1
  3. package/dist/api/__tests__/test-utils.cjs +1 -1
  4. package/dist/api/__tests__/test-utils.d.cts +1 -1
  5. package/dist/api/__tests__/test-utils.d.ts +1 -1
  6. package/dist/api/__tests__/test-utils.js +1 -1
  7. package/dist/api/client.cjs +1 -1
  8. package/dist/api/client.d.cts +1 -1
  9. package/dist/api/client.d.ts +1 -1
  10. package/dist/api/client.js +1 -1
  11. package/dist/api/index.cjs +1 -1
  12. package/dist/api/index.d.cts +1 -1
  13. package/dist/api/index.d.ts +1 -1
  14. package/dist/api/index.js +1 -1
  15. package/dist/api/types.d.cts +1 -1
  16. package/dist/api/types.d.ts +1 -1
  17. package/dist/chains/adapters/evm.cjs +1 -1
  18. package/dist/chains/adapters/evm.d.cts +1 -1
  19. package/dist/chains/adapters/evm.d.ts +1 -1
  20. package/dist/chains/adapters/evm.js +1 -1
  21. package/dist/chains/adapters/solana.cjs +1 -1
  22. package/dist/chains/adapters/solana.d.cts +1 -1
  23. package/dist/chains/adapters/solana.d.ts +1 -1
  24. package/dist/chains/adapters/solana.js +1 -1
  25. package/dist/chains/adapters/stellar.cjs +1 -1
  26. package/dist/chains/adapters/stellar.d.cts +1 -1
  27. package/dist/chains/adapters/stellar.d.ts +1 -1
  28. package/dist/chains/adapters/stellar.js +1 -1
  29. package/dist/chains/chain-adapter.cjs +1 -1
  30. package/dist/chains/chain-adapter.d.cts +1 -1
  31. package/dist/chains/chain-adapter.d.ts +1 -1
  32. package/dist/chains/chain-adapter.js +1 -1
  33. package/dist/chains/chains.cjs +1 -1
  34. package/dist/chains/chains.js +1 -1
  35. package/dist/{chunk-743T6QIO.cjs → chunk-2FEUZYLP.cjs} +1 -1
  36. package/dist/{chunk-FU4UIDNT.cjs → chunk-2GKFULT7.cjs} +1 -1
  37. package/dist/{chunk-S77GSXV7.cjs → chunk-577FVL6N.cjs} +1 -1
  38. package/dist/{chunk-RRFUWLFA.cjs → chunk-5CGCTYQJ.cjs} +1 -1
  39. package/dist/chunk-6FHMUKOW.js +1 -0
  40. package/dist/{chunk-IUMKG7QD.js → chunk-6HB4WO5J.js} +1 -1
  41. package/dist/{chunk-KB3LRV7O.cjs → chunk-6MQ7FVEV.cjs} +1 -1
  42. package/dist/chunk-AAWVNX5D.cjs +1 -0
  43. package/dist/{chunk-GA6L6LLY.js → chunk-ACJUNZGV.js} +1 -1
  44. package/dist/{chunk-GRUUP7GG.cjs → chunk-BXXQTV75.cjs} +1 -1
  45. package/dist/{chunk-SELBUWOU.js → chunk-CIIIXKSM.js} +1 -1
  46. package/dist/{chunk-OMIY25UF.js → chunk-D3KX5W6W.js} +1 -1
  47. package/dist/{chunk-OWDSSX2P.js → chunk-DCKFFFPG.js} +1 -1
  48. package/dist/{chunk-6K642Q7K.cjs → chunk-DF753J5G.cjs} +1 -1
  49. package/dist/{chunk-4A7AWKUP.js → chunk-DXVNNTYG.js} +1 -1
  50. package/dist/chunk-EXFV7SBW.cjs +1 -0
  51. package/dist/{chunk-X2KTGVIG.js → chunk-FDKID63Z.js} +1 -1
  52. package/dist/chunk-FQZQGXWS.js +1 -0
  53. package/dist/{chunk-NWVX4HDR.js → chunk-GAGWB24A.js} +1 -1
  54. package/dist/{chunk-MPORS4W6.js → chunk-H3XK3D3Y.js} +1 -1
  55. package/dist/{chunk-VEYCF4FT.js → chunk-H7FDW5J4.js} +1 -1
  56. package/dist/{chunk-BXAEGY4R.js → chunk-HTZPHRO2.js} +1 -1
  57. package/dist/{chunk-4KOD6QEX.cjs → chunk-HUD23LSC.cjs} +1 -1
  58. package/dist/{chunk-QTTIFAND.cjs → chunk-I3H3U7XW.cjs} +1 -1
  59. package/dist/{chunk-2VVOL5YA.cjs → chunk-ILJXME26.cjs} +1 -1
  60. package/dist/{chunk-YWFITULD.cjs → chunk-INBDFSBN.cjs} +1 -1
  61. package/dist/chunk-IVKPY3XN.js +1 -0
  62. package/dist/{chunk-RKUCX4Z4.cjs → chunk-IW4FVUP5.cjs} +2 -2
  63. package/dist/{chunk-4MMD5K7I.js → chunk-IYQVWJXN.js} +1 -1
  64. package/dist/{chunk-XQ4G3OAY.cjs → chunk-J6ETRZYR.cjs} +1 -1
  65. package/dist/{chunk-F7G24ULL.cjs → chunk-JUVF537D.cjs} +1 -1
  66. package/dist/chunk-KIZY54AZ.cjs +1 -0
  67. package/dist/{chunk-NJUHI3JB.cjs → chunk-KWILWKSM.cjs} +1 -1
  68. package/dist/{chunk-27L66KDT.cjs → chunk-LFVAI5O6.cjs} +1 -1
  69. package/dist/{chunk-RUL7HCDJ.js → chunk-M7QSZTNV.js} +1 -1
  70. package/dist/{chunk-HOISPTBK.js → chunk-MEJ7ZHBM.js} +1 -1
  71. package/dist/{chunk-WXFPGZKE.js → chunk-NFX2WUB6.js} +1 -1
  72. package/dist/{chunk-RPBBYBNA.js → chunk-OEMMPPUX.js} +1 -1
  73. package/dist/{chunk-FBCBJROD.js → chunk-OMTJMVSG.js} +1 -1
  74. package/dist/chunk-OZ6ZUQ4E.cjs +1 -0
  75. package/dist/chunk-PH5XGZFF.cjs +1 -0
  76. package/dist/{chunk-DBSQTBR2.js → chunk-PHKB5VRX.js} +1 -1
  77. package/dist/{chunk-DBMVGHLO.cjs → chunk-Q66YRLSW.cjs} +1 -1
  78. package/dist/chunk-QEIZABXJ.cjs +1 -0
  79. package/dist/{chunk-5HBCBS5W.cjs → chunk-QPCZFIUV.cjs} +1 -1
  80. package/dist/{chunk-4VCZ6SJS.js → chunk-R3LWLFO3.js} +1 -1
  81. package/dist/{chunk-3URL7PDE.cjs → chunk-RZNLDJBS.cjs} +1 -1
  82. package/dist/{chunk-ZS2PU65K.js → chunk-SAZKNE6N.js} +1 -1
  83. package/dist/{chunk-TBNAORVI.js → chunk-SXB2JOPU.js} +1 -1
  84. package/dist/{chunk-FN64UU7M.cjs → chunk-TM77X7C3.cjs} +1 -1
  85. package/dist/{chunk-3DDMAIC4.js → chunk-TSJUK3ED.js} +1 -1
  86. package/dist/{chunk-ZFHKZBIF.cjs → chunk-UCZT2O73.cjs} +1 -1
  87. package/dist/chunk-UKNAZVRC.js +1 -0
  88. package/dist/{chunk-Y5LIA4JH.js → chunk-UMQI4GDZ.js} +1 -1
  89. package/dist/{chunk-RIYT6WJT.js → chunk-V3BCKXZ6.js} +1 -1
  90. package/dist/{chunk-AA2QXFGF.js → chunk-V5VXKWOL.js} +1 -1
  91. package/dist/{chunk-PQJKDR32.js → chunk-VE25YNP3.js} +1 -1
  92. package/dist/chunk-VKXHD6UP.js +1 -0
  93. package/dist/{chunk-SZKWBEFG.js → chunk-WTIV4TTS.js} +1 -1
  94. package/dist/{chunk-YBPZA7OS.cjs → chunk-WVCLDF55.cjs} +1 -1
  95. package/dist/chunk-XMN42YI5.cjs +1 -0
  96. package/dist/{chunk-ECRMYAAK.cjs → chunk-XNCZYX2V.cjs} +1 -1
  97. package/dist/{chunk-JDQXT4RE.cjs → chunk-XRLBGNNW.cjs} +1 -1
  98. package/dist/{chunk-L4KFGW4D.js → chunk-Y7XDNVFX.js} +1 -1
  99. package/dist/{chunk-DSEXTEKG.cjs → chunk-YEHBDKR3.cjs} +1 -1
  100. package/dist/{chunk-KU74JIV5.cjs → chunk-YUCK3VTX.cjs} +1 -1
  101. package/dist/index.cjs +1 -1
  102. package/dist/index.d.cts +1 -1
  103. package/dist/index.d.ts +1 -1
  104. package/dist/index.js +1 -1
  105. package/dist/logger/index.cjs +1 -1
  106. package/dist/logger/index.js +1 -1
  107. package/dist/logger/init.cjs +1 -1
  108. package/dist/logger/init.js +1 -1
  109. package/dist/sdk.cjs +1 -1
  110. package/dist/sdk.d.cts +1 -1
  111. package/dist/sdk.d.ts +1 -1
  112. package/dist/sdk.js +1 -1
  113. package/dist/signers/descriptors/api-key.d.cts +1 -1
  114. package/dist/signers/descriptors/api-key.d.ts +1 -1
  115. package/dist/signers/descriptors/device.d.cts +1 -1
  116. package/dist/signers/descriptors/device.d.ts +1 -1
  117. package/dist/signers/descriptors/email.cjs +1 -1
  118. package/dist/signers/descriptors/email.d.cts +1 -1
  119. package/dist/signers/descriptors/email.d.ts +1 -1
  120. package/dist/signers/descriptors/email.js +1 -1
  121. package/dist/signers/descriptors/external-wallet.d.cts +1 -1
  122. package/dist/signers/descriptors/external-wallet.d.ts +1 -1
  123. package/dist/signers/descriptors/index.cjs +1 -1
  124. package/dist/signers/descriptors/index.d.cts +1 -1
  125. package/dist/signers/descriptors/index.d.ts +1 -1
  126. package/dist/signers/descriptors/index.js +1 -1
  127. package/dist/signers/descriptors/passkey.d.cts +1 -1
  128. package/dist/signers/descriptors/passkey.d.ts +1 -1
  129. package/dist/signers/descriptors/phone.cjs +1 -1
  130. package/dist/signers/descriptors/phone.d.cts +1 -1
  131. package/dist/signers/descriptors/phone.d.ts +1 -1
  132. package/dist/signers/descriptors/phone.js +1 -1
  133. package/dist/signers/descriptors/server.cjs +1 -1
  134. package/dist/signers/descriptors/server.d.cts +1 -1
  135. package/dist/signers/descriptors/server.d.ts +1 -1
  136. package/dist/signers/descriptors/server.js +1 -1
  137. package/dist/signers/descriptors/types.d.cts +2 -1
  138. package/dist/signers/descriptors/types.d.ts +2 -1
  139. package/dist/signers/device.d.cts +1 -1
  140. package/dist/signers/device.d.ts +1 -1
  141. package/dist/signers/evm-api-key.d.cts +1 -1
  142. package/dist/signers/evm-api-key.d.ts +1 -1
  143. package/dist/signers/evm-external-wallet.d.cts +1 -1
  144. package/dist/signers/evm-external-wallet.d.ts +1 -1
  145. package/dist/signers/external-wallet-signer.d.cts +1 -1
  146. package/dist/signers/external-wallet-signer.d.ts +1 -1
  147. package/dist/signers/index.cjs +1 -1
  148. package/dist/signers/index.d.cts +1 -1
  149. package/dist/signers/index.d.ts +1 -1
  150. package/dist/signers/index.js +1 -1
  151. package/dist/signers/non-custodial/index.cjs +1 -1
  152. package/dist/signers/non-custodial/index.d.cts +1 -1
  153. package/dist/signers/non-custodial/index.d.ts +1 -1
  154. package/dist/signers/non-custodial/index.js +1 -1
  155. package/dist/signers/non-custodial/ncs-evm-signer.cjs +1 -1
  156. package/dist/signers/non-custodial/ncs-evm-signer.d.cts +1 -1
  157. package/dist/signers/non-custodial/ncs-evm-signer.d.ts +1 -1
  158. package/dist/signers/non-custodial/ncs-evm-signer.js +1 -1
  159. package/dist/signers/non-custodial/ncs-signer.cjs +1 -1
  160. package/dist/signers/non-custodial/ncs-signer.d.cts +3 -1
  161. package/dist/signers/non-custodial/ncs-signer.d.ts +3 -1
  162. package/dist/signers/non-custodial/ncs-signer.js +1 -1
  163. package/dist/signers/non-custodial/ncs-solana-signer.cjs +1 -1
  164. package/dist/signers/non-custodial/ncs-solana-signer.d.cts +1 -1
  165. package/dist/signers/non-custodial/ncs-solana-signer.d.ts +1 -1
  166. package/dist/signers/non-custodial/ncs-solana-signer.js +1 -1
  167. package/dist/signers/non-custodial/ncs-stellar-signer.cjs +1 -1
  168. package/dist/signers/non-custodial/ncs-stellar-signer.d.cts +1 -1
  169. package/dist/signers/non-custodial/ncs-stellar-signer.d.ts +1 -1
  170. package/dist/signers/non-custodial/ncs-stellar-signer.js +1 -1
  171. package/dist/signers/passkey.d.cts +1 -1
  172. package/dist/signers/passkey.d.ts +1 -1
  173. package/dist/signers/server/assemble-server-signer.cjs +1 -1
  174. package/dist/signers/server/assemble-server-signer.d.cts +1 -1
  175. package/dist/signers/server/assemble-server-signer.d.ts +1 -1
  176. package/dist/signers/server/assemble-server-signer.js +1 -1
  177. package/dist/signers/server/evm-server-signer.d.cts +1 -1
  178. package/dist/signers/server/evm-server-signer.d.ts +1 -1
  179. package/dist/signers/server/helpers/derive-server-signer.cjs +1 -1
  180. package/dist/signers/server/helpers/derive-server-signer.d.cts +1 -1
  181. package/dist/signers/server/helpers/derive-server-signer.d.ts +1 -1
  182. package/dist/signers/server/helpers/derive-server-signer.js +1 -1
  183. package/dist/signers/server/helpers/index.cjs +1 -1
  184. package/dist/signers/server/helpers/index.d.cts +1 -1
  185. package/dist/signers/server/helpers/index.d.ts +1 -1
  186. package/dist/signers/server/helpers/index.js +1 -1
  187. package/dist/signers/server/index.cjs +1 -1
  188. package/dist/signers/server/index.d.cts +1 -1
  189. package/dist/signers/server/index.d.ts +1 -1
  190. package/dist/signers/server/index.js +1 -1
  191. package/dist/signers/server/resolver.cjs +1 -1
  192. package/dist/signers/server/resolver.d.cts +1 -1
  193. package/dist/signers/server/resolver.d.ts +1 -1
  194. package/dist/signers/server/resolver.js +1 -1
  195. package/dist/signers/server/solana-server-signer.d.cts +1 -1
  196. package/dist/signers/server/solana-server-signer.d.ts +1 -1
  197. package/dist/signers/server/stellar-server-signer.d.cts +1 -1
  198. package/dist/signers/server/stellar-server-signer.d.ts +1 -1
  199. package/dist/signers/solana-api-key.d.cts +1 -1
  200. package/dist/signers/solana-api-key.d.ts +1 -1
  201. package/dist/signers/solana-external-wallet.d.cts +1 -1
  202. package/dist/signers/solana-external-wallet.d.ts +1 -1
  203. package/dist/signers/stellar-external-wallet.d.cts +1 -1
  204. package/dist/signers/stellar-external-wallet.d.ts +1 -1
  205. package/dist/signers/types.cjs +1 -1
  206. package/dist/signers/types.d.cts +1 -1
  207. package/dist/signers/types.d.ts +1 -1
  208. package/dist/signers/types.js +1 -1
  209. package/dist/{types-DUFjqW3o.d.ts → types-Cd9b04Z6.d.ts} +14 -1
  210. package/dist/{types-CwTucqvZ.d.cts → types-XtGH-kml.d.cts} +14 -1
  211. package/dist/utils/constants.cjs +1 -1
  212. package/dist/utils/constants.js +1 -1
  213. package/dist/utils/device-signers/IframeDeviceSignerKeyStorage.cjs +1 -1
  214. package/dist/utils/device-signers/IframeDeviceSignerKeyStorage.js +1 -1
  215. package/dist/utils/device-signers/createDeviceSigner.d.cts +1 -1
  216. package/dist/utils/device-signers/createDeviceSigner.d.ts +1 -1
  217. package/dist/utils/device-signers/index.cjs +1 -1
  218. package/dist/utils/device-signers/index.d.cts +1 -1
  219. package/dist/utils/device-signers/index.d.ts +1 -1
  220. package/dist/utils/device-signers/index.js +1 -1
  221. package/dist/utils/locators.d.cts +1 -1
  222. package/dist/utils/locators.d.ts +1 -1
  223. package/dist/utils/server-signers/createServerSigner.cjs +1 -1
  224. package/dist/utils/server-signers/createServerSigner.js +1 -1
  225. package/dist/utils/server-signers/index.cjs +1 -1
  226. package/dist/utils/server-signers/index.js +1 -1
  227. package/dist/utils/signer-locator.d.cts +1 -1
  228. package/dist/utils/signer-locator.d.ts +1 -1
  229. package/dist/utils/signer-mapping.cjs +1 -1
  230. package/dist/utils/signer-mapping.d.cts +1 -1
  231. package/dist/utils/signer-mapping.d.ts +1 -1
  232. package/dist/utils/signer-mapping.js +1 -1
  233. package/dist/wallets/__tests__/test-helpers.cjs +1 -1
  234. package/dist/wallets/__tests__/test-helpers.d.cts +1 -1
  235. package/dist/wallets/__tests__/test-helpers.d.ts +1 -1
  236. package/dist/wallets/__tests__/test-helpers.js +1 -1
  237. package/dist/wallets/evm.cjs +1 -1
  238. package/dist/wallets/evm.d.cts +1 -1
  239. package/dist/wallets/evm.d.ts +1 -1
  240. package/dist/wallets/evm.js +1 -1
  241. package/dist/wallets/services/balance-formatter.cjs +1 -1
  242. package/dist/wallets/services/balance-formatter.d.cts +1 -1
  243. package/dist/wallets/services/balance-formatter.d.ts +1 -1
  244. package/dist/wallets/services/balance-formatter.js +1 -1
  245. package/dist/wallets/services/device-recovery-service.cjs +1 -1
  246. package/dist/wallets/services/device-recovery-service.d.cts +1 -1
  247. package/dist/wallets/services/device-recovery-service.d.ts +1 -1
  248. package/dist/wallets/services/device-recovery-service.js +1 -1
  249. package/dist/wallets/services/operation-poller.cjs +1 -1
  250. package/dist/wallets/services/operation-poller.d.cts +1 -1
  251. package/dist/wallets/services/operation-poller.d.ts +1 -1
  252. package/dist/wallets/services/operation-poller.js +1 -1
  253. package/dist/wallets/services/signer-manager.cjs +1 -1
  254. package/dist/wallets/services/signer-manager.d.cts +1 -1
  255. package/dist/wallets/services/signer-manager.d.ts +1 -1
  256. package/dist/wallets/services/signer-manager.js +1 -1
  257. package/dist/wallets/solana.cjs +1 -1
  258. package/dist/wallets/solana.d.cts +1 -1
  259. package/dist/wallets/solana.d.ts +1 -1
  260. package/dist/wallets/solana.js +1 -1
  261. package/dist/wallets/stellar.cjs +1 -1
  262. package/dist/wallets/stellar.d.cts +1 -1
  263. package/dist/wallets/stellar.d.ts +1 -1
  264. package/dist/wallets/stellar.js +1 -1
  265. package/dist/wallets/types.d.cts +1 -1
  266. package/dist/wallets/types.d.ts +1 -1
  267. package/dist/wallets/wallet-factory.cjs +1 -1
  268. package/dist/wallets/wallet-factory.d.cts +1 -1
  269. package/dist/wallets/wallet-factory.d.ts +1 -1
  270. package/dist/wallets/wallet-factory.js +1 -1
  271. package/dist/wallets/wallet.cjs +1 -1
  272. package/dist/wallets/wallet.d.cts +1 -1
  273. package/dist/wallets/wallet.d.ts +1 -1
  274. package/dist/wallets/wallet.js +1 -1
  275. package/package.json +4 -4
  276. package/dist/chunk-4MVRQKTM.js +0 -1
  277. package/dist/chunk-6LX3VLUM.js +0 -1
  278. package/dist/chunk-CEFLETL6.cjs +0 -1
  279. package/dist/chunk-F3YH6X3U.js +0 -1
  280. package/dist/chunk-GZFWSGHL.cjs +0 -1
  281. package/dist/chunk-JOSW3TFN.cjs +0 -1
  282. package/dist/chunk-MTRDSEGN.cjs +0 -1
  283. package/dist/chunk-P3CGYHYE.cjs +0 -1
  284. package/dist/chunk-RMDQOS3H.cjs +0 -1
  285. package/dist/chunk-TVGWMSVV.js +0 -1
  286. package/dist/chunk-UQAXOEBL.cjs +0 -1
  287. package/dist/chunk-WGXLV7K7.js +0 -1
@@ -1,4 +1,4 @@
1
- import { ae as WalletLocator } from '../../types-CwTucqvZ.cjs';
1
+ import { ah as WalletLocator } from '../../types-XtGH-kml.cjs';
2
2
  import 'viem';
3
3
  import '../gen/types.gen.cjs';
4
4
  import 'ox';
@@ -1,4 +1,4 @@
1
- import { ae as WalletLocator } from '../../types-DUFjqW3o.js';
1
+ import { ah as WalletLocator } from '../../types-Cd9b04Z6.js';
2
2
  import 'viem';
3
3
  import '../gen/types.gen.js';
4
4
  import 'ox';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJ33QM2IDcjs = require('../../chunk-J33QM2ID.cjs');var _chunkS77GSXV7cjs = require('../../chunk-S77GSXV7.cjs');require('../../chunk-3F4FMM3R.cjs');require('../../chunk-JDQXT4RE.cjs');require('../../chunk-NJUHI3JB.cjs');var _chunkDSIFRRBScjs = require('../../chunk-DSIFRRBS.cjs');var _vitest = require('vitest');var P=({data:e,status:t=200,ok:n=!0,statusText:s="OK"})=>({json:_vitest.vi.fn().mockResolvedValue(e),ok:n,status:t,statusText:s}),j= exports.createMockSuccessResponse =e=>P({data:e}),b= exports.createMockErrorResponse =(e,t=400,n="Bad Request")=>P({data:e,status:t,ok:!1,statusText:n}),B= exports.createMockCrossmint =(e={})=>{let t=_chunkDSIFRRBScjs.a.call(void 0, {apiKey:_chunkJ33QM2IDcjs.m},e);return _chunkDSIFRRBScjs.b.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {},t),{setJwt:_vitest.vi.fn().mockReturnThis()})},L= exports.createTestApiClient =e=>new (0, _chunkS77GSXV7cjs.a)(e||B()),K= exports.createServerSideApiClient =()=>{let e=L();return Object.defineProperty(e,"isServerSide",{get:()=>!0,configurable:!0}),e},Y= exports.extractFetchCall =e=>{let t=e.mock.calls;if(t.length===0)return;let n=t[t.length-1];return{path:n[0],options:n[1]}},N= exports.expectRequestPath =(e,t)=>{_vitest.expect.call(void 0, e==null?void 0:e.path).toBe(t)},V= exports.expectCommonHeaders =e=>{_vitest.expect.call(void 0, e["Content-Type"]).toBe("application/json")},q= exports.expectRequestBody =(e,t)=>{_vitest.expect.call(void 0, e.body).toBe(JSON.stringify(t))},z= exports.validateRequest =(e,t,n)=>{_vitest.expect.call(void 0, e).toBeDefined(),e&&(N(e,t),e.options.headers&&V(e.options.headers),n!==void 0&&e.options&&q(e.options,n))},X= exports.testHttpErrorResponse =(e,t,n,s)=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){t.mockResolvedValue(b(n,s));let a=yield e();_vitest.expect.call(void 0, l(a)).toBe(!0),l(a)&&(_vitest.expect.call(void 0, a.error).toBe(!0),n.message&&_vitest.expect.call(void 0, a.message).toBe(n.message))}),Z= exports.testCommonHttpErrors =(s,a,...o)=>_chunkDSIFRRBScjs.h.call(void 0, void 0,[s,a,...o],function*(e,t,n=[]){for(let{status:c,message:g}of _chunkJ33QM2IDcjs.a){if(n.includes(c))continue;let u={error:!0,message:g};t.mockResolvedValueOnce(b(u,c));let m=yield e();_vitest.expect.call(void 0, l(m)).toBe(!0)}}),Q= exports.testNetworkError =(e,t)=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){t.mockRejectedValue(new Error("Network error")),yield _vitest.expect.call(void 0, e()).rejects.toThrow("Network error")}),ee= exports.testInvalidJsonResponse =(e,t)=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){let n={json:_vitest.vi.fn().mockRejectedValue(new Error("Invalid JSON")),ok:!0,status:200};t.mockResolvedValue(n),yield _vitest.expect.call(void 0, e()).rejects.toThrow()}),te= exports.testTimeoutError =(e,t)=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){t.mockImplementation(()=>new Promise((n,s)=>setTimeout(()=>s(new Error("Request timeout")),0))),yield _vitest.expect.call(void 0, e()).rejects.toThrow("Request timeout")}),ne= exports.testMalformedResponse =(e,t,n)=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){t.mockResolvedValue(j(n));let s=yield e();_vitest.expect.call(void 0, s).toEqual(n)}),se= exports.createMockWalletResponse =(e={})=>_chunkDSIFRRBScjs.a.call(void 0, {address:_chunkJ33QM2IDcjs.b.evmAddress,chainType:"evm",type:"smart",config:{adminSigner:{type:"external-wallet",address:_chunkJ33QM2IDcjs.k.EVM_TEST}}},e),oe= exports.createMockSendResponse =(e={})=>_chunkDSIFRRBScjs.a.call(void 0, {id:"txn-123",status:"pending",chainType:"evm",walletType:"evm-smart-wallet",params:{transaction:"0x1234567890abcdef",signer:"api-key:test"},onChain:{txId:"0xabcdef1234567890abcdef1234567890abcdef12",explorerLink:"https://explorer.example.com/tx/0xabcdef1234567890abcdef1234567890abcdef12"},createdAt:Date.now()},e);function l(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error===!0}function C(e){return typeof e=="object"&&e!==null&&"address"in e&&"chainType"in e&&"type"in e}function $(e){return typeof e=="object"&&e!==null&&"id"in e&&"status"in e&&"chainType"in e}var x=e=>new Promise(t=>setTimeout(t,e)),re= exports.isValidEthereumAddress =e=>/^0x[a-fA-F0-9]{40}$/.test(e),ae= exports.isValidSolanaAddress =e=>/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(e),ie= exports.createIntegrationApiClient =(e,t,n={})=>{let s=_chunkDSIFRRBScjs.a.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {apiKey:e},t&&{overrideBaseUrl:t}),n),a=_chunkDSIFRRBScjs.b.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {},s),{setJwt:()=>a});return new (0, _chunkS77GSXV7cjs.a)(a)},v= exports.TestDataFactory =class{constructor(){this.wallets=[];this.transactions=[]}addWallet(t){t&&!this.wallets.includes(t)&&this.wallets.push(t)}addTransaction(t){t&&!this.transactions.includes(t)&&this.transactions.push(t)}getWallet(t=0){return this.wallets[t]}getTransaction(t=0){return this.transactions[t]}hasWallets(){return this.wallets.length>0}clear(){this.wallets=[],this.transactions=[]}};function ce(s,a){return _chunkDSIFRRBScjs.h.call(void 0, this,arguments,function*(e,t,n={}){if(t.hasWallets())return t.getWallet();let{chainType:o="evm",type:c="mpc",owner:g,testName:u="default"}=n,m=g||`userId:integration-${u}-${Date.now()}`,f=yield e.createWallet(_chunkDSIFRRBScjs.a.call(void 0, {chainType:o,type:c},g&&{owner:m}));if(C(f))return t.addWallet(f.address),f.address})}function pe(e,t,n){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let s=yield e.createWallet(n);return C(s)&&t.addWallet(s.address),s})}function le(e,t){_vitest.expect.call(void 0, l(e)).toBe(!0),t&&_vitest.expect.call(void 0, e.message).toBeDefined()}function ue(e){_vitest.expect.call(void 0, C(e)).toBe(!0)}function de(e){_vitest.expect.call(void 0, $(e)).toBe(!0)}var I=(e,t,n,s="usdxm",a="base-sepolia")=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){let o={amount:n,token:s,chain:a},c=yield e.fundWallet(t,o);if(l(c))throw new Error(`Failed to fund wallet: ${c.message||"Unknown error"}`);return yield x(_chunkJ33QM2IDcjs.i),c}),U= exports.approveTransaction =(a,o,c,...g)=>_chunkDSIFRRBScjs.h.call(void 0, void 0,[a,o,c,...g],function*(e,t,n,s=_chunkJ33QM2IDcjs.l.APPROVE_TRANSACTION_MAX_RETRIES){var m;for(let f=0;f<s;f++){let d=yield e.getTransaction(t,n);if(l(d))throw new Error(`Transaction not found: ${d.message||"Unknown error"}`);if("status"in d&&(d.status==="success"||d.status==="failed"))return d;let T="approvals"in d?(m=d.approvals)==null?void 0:m.pending:void 0;if(T&&T.length>0){let O={approvals:T.map(_=>({signer:_.signer.locator,signature:""}))},h=yield e.approveTransaction(t,n,O);if(l(h))throw new Error(`Failed to approve transaction: ${h.message||"Unknown error"}`);yield x(_chunkJ33QM2IDcjs.j);continue}yield x(_chunkJ33QM2IDcjs.i)}let u=yield e.getTransaction(t,n);if(l(u))throw new Error(`Transaction not found after retries: ${u.message||"Unknown error"}`);if(!("status"in u))throw new Error("Transaction response missing status property");return u}),me= exports.fundWalletAndWait =(e,t,n=1,s="usdxm",a="base-sepolia")=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){return I(e,t,n,s,a)}),fe= exports.sendTokenAndApprove =(e,t,n,s,a)=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){let o=yield e.send(t,n,{recipient:s,amount:a});if(l(o))throw new Error(`Failed to send token: ${o.message||"Unknown error"}`);if(typeof o=="object"&&o!==null&&"id"in o&&typeof o.id=="string")return U(e,t,o.id);throw new Error("Transaction ID not found in send response")}),ge= exports.ensureWalletFunded =(e,t,n=1,s="usdxm",a="base-sepolia")=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){try{yield I(e,t,n,s,a)}catch(o){let c=o instanceof Error?o.message:String(o);if(!c.includes("already funded")&&!c.includes("insufficient"))throw o}});exports.TestDataFactory = v; exports.approveTransaction = U; exports.createIntegrationApiClient = ie; exports.createMockCrossmint = B; exports.createMockErrorResponse = b; exports.createMockResponse = P; exports.createMockSendResponse = oe; exports.createMockSuccessResponse = j; exports.createMockWalletResponse = se; exports.createServerSideApiClient = K; exports.createTestApiClient = L; exports.createTestWallet = pe; exports.delay = x; exports.ensureWalletExists = ce; exports.ensureWalletFunded = ge; exports.expectCommonHeaders = V; exports.expectErrorResponse = le; exports.expectRequestBody = q; exports.expectRequestPath = N; exports.expectSuccessTransactionResponse = de; exports.expectSuccessWalletResponse = ue; exports.extractFetchCall = Y; exports.fundWallet = I; exports.fundWalletAndWait = me; exports.isErrorResponse = l; exports.isSuccessTransactionResponse = $; exports.isSuccessWalletResponse = C; exports.isValidEthereumAddress = re; exports.isValidSolanaAddress = ae; exports.sendTokenAndApprove = fe; exports.testCommonHttpErrors = Z; exports.testHttpErrorResponse = X; exports.testInvalidJsonResponse = ee; exports.testMalformedResponse = ne; exports.testNetworkError = Q; exports.testTimeoutError = te; exports.validateRequest = z;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJ33QM2IDcjs = require('../../chunk-J33QM2ID.cjs');var _chunk577FVL6Ncjs = require('../../chunk-577FVL6N.cjs');require('../../chunk-3F4FMM3R.cjs');require('../../chunk-XRLBGNNW.cjs');require('../../chunk-KWILWKSM.cjs');var _chunkDSIFRRBScjs = require('../../chunk-DSIFRRBS.cjs');var _vitest = require('vitest');var P=({data:e,status:t=200,ok:n=!0,statusText:s="OK"})=>({json:_vitest.vi.fn().mockResolvedValue(e),ok:n,status:t,statusText:s}),j= exports.createMockSuccessResponse =e=>P({data:e}),b= exports.createMockErrorResponse =(e,t=400,n="Bad Request")=>P({data:e,status:t,ok:!1,statusText:n}),B= exports.createMockCrossmint =(e={})=>{let t=_chunkDSIFRRBScjs.a.call(void 0, {apiKey:_chunkJ33QM2IDcjs.m},e);return _chunkDSIFRRBScjs.b.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {},t),{setJwt:_vitest.vi.fn().mockReturnThis()})},L= exports.createTestApiClient =e=>new (0, _chunk577FVL6Ncjs.a)(e||B()),K= exports.createServerSideApiClient =()=>{let e=L();return Object.defineProperty(e,"isServerSide",{get:()=>!0,configurable:!0}),e},Y= exports.extractFetchCall =e=>{let t=e.mock.calls;if(t.length===0)return;let n=t[t.length-1];return{path:n[0],options:n[1]}},N= exports.expectRequestPath =(e,t)=>{_vitest.expect.call(void 0, e==null?void 0:e.path).toBe(t)},V= exports.expectCommonHeaders =e=>{_vitest.expect.call(void 0, e["Content-Type"]).toBe("application/json")},q= exports.expectRequestBody =(e,t)=>{_vitest.expect.call(void 0, e.body).toBe(JSON.stringify(t))},z= exports.validateRequest =(e,t,n)=>{_vitest.expect.call(void 0, e).toBeDefined(),e&&(N(e,t),e.options.headers&&V(e.options.headers),n!==void 0&&e.options&&q(e.options,n))},X= exports.testHttpErrorResponse =(e,t,n,s)=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){t.mockResolvedValue(b(n,s));let a=yield e();_vitest.expect.call(void 0, l(a)).toBe(!0),l(a)&&(_vitest.expect.call(void 0, a.error).toBe(!0),n.message&&_vitest.expect.call(void 0, a.message).toBe(n.message))}),Z= exports.testCommonHttpErrors =(s,a,...o)=>_chunkDSIFRRBScjs.h.call(void 0, void 0,[s,a,...o],function*(e,t,n=[]){for(let{status:c,message:g}of _chunkJ33QM2IDcjs.a){if(n.includes(c))continue;let u={error:!0,message:g};t.mockResolvedValueOnce(b(u,c));let m=yield e();_vitest.expect.call(void 0, l(m)).toBe(!0)}}),Q= exports.testNetworkError =(e,t)=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){t.mockRejectedValue(new Error("Network error")),yield _vitest.expect.call(void 0, e()).rejects.toThrow("Network error")}),ee= exports.testInvalidJsonResponse =(e,t)=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){let n={json:_vitest.vi.fn().mockRejectedValue(new Error("Invalid JSON")),ok:!0,status:200};t.mockResolvedValue(n),yield _vitest.expect.call(void 0, e()).rejects.toThrow()}),te= exports.testTimeoutError =(e,t)=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){t.mockImplementation(()=>new Promise((n,s)=>setTimeout(()=>s(new Error("Request timeout")),0))),yield _vitest.expect.call(void 0, e()).rejects.toThrow("Request timeout")}),ne= exports.testMalformedResponse =(e,t,n)=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){t.mockResolvedValue(j(n));let s=yield e();_vitest.expect.call(void 0, s).toEqual(n)}),se= exports.createMockWalletResponse =(e={})=>_chunkDSIFRRBScjs.a.call(void 0, {address:_chunkJ33QM2IDcjs.b.evmAddress,chainType:"evm",type:"smart",config:{adminSigner:{type:"external-wallet",address:_chunkJ33QM2IDcjs.k.EVM_TEST}}},e),oe= exports.createMockSendResponse =(e={})=>_chunkDSIFRRBScjs.a.call(void 0, {id:"txn-123",status:"pending",chainType:"evm",walletType:"evm-smart-wallet",params:{transaction:"0x1234567890abcdef",signer:"api-key:test"},onChain:{txId:"0xabcdef1234567890abcdef1234567890abcdef12",explorerLink:"https://explorer.example.com/tx/0xabcdef1234567890abcdef1234567890abcdef12"},createdAt:Date.now()},e);function l(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error===!0}function C(e){return typeof e=="object"&&e!==null&&"address"in e&&"chainType"in e&&"type"in e}function $(e){return typeof e=="object"&&e!==null&&"id"in e&&"status"in e&&"chainType"in e}var x=e=>new Promise(t=>setTimeout(t,e)),re= exports.isValidEthereumAddress =e=>/^0x[a-fA-F0-9]{40}$/.test(e),ae= exports.isValidSolanaAddress =e=>/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(e),ie= exports.createIntegrationApiClient =(e,t,n={})=>{let s=_chunkDSIFRRBScjs.a.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {apiKey:e},t&&{overrideBaseUrl:t}),n),a=_chunkDSIFRRBScjs.b.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {},s),{setJwt:()=>a});return new (0, _chunk577FVL6Ncjs.a)(a)},v= exports.TestDataFactory =class{constructor(){this.wallets=[];this.transactions=[]}addWallet(t){t&&!this.wallets.includes(t)&&this.wallets.push(t)}addTransaction(t){t&&!this.transactions.includes(t)&&this.transactions.push(t)}getWallet(t=0){return this.wallets[t]}getTransaction(t=0){return this.transactions[t]}hasWallets(){return this.wallets.length>0}clear(){this.wallets=[],this.transactions=[]}};function ce(s,a){return _chunkDSIFRRBScjs.h.call(void 0, this,arguments,function*(e,t,n={}){if(t.hasWallets())return t.getWallet();let{chainType:o="evm",type:c="mpc",owner:g,testName:u="default"}=n,m=g||`userId:integration-${u}-${Date.now()}`,f=yield e.createWallet(_chunkDSIFRRBScjs.a.call(void 0, {chainType:o,type:c},g&&{owner:m}));if(C(f))return t.addWallet(f.address),f.address})}function pe(e,t,n){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let s=yield e.createWallet(n);return C(s)&&t.addWallet(s.address),s})}function le(e,t){_vitest.expect.call(void 0, l(e)).toBe(!0),t&&_vitest.expect.call(void 0, e.message).toBeDefined()}function ue(e){_vitest.expect.call(void 0, C(e)).toBe(!0)}function de(e){_vitest.expect.call(void 0, $(e)).toBe(!0)}var I=(e,t,n,s="usdxm",a="base-sepolia")=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){let o={amount:n,token:s,chain:a},c=yield e.fundWallet(t,o);if(l(c))throw new Error(`Failed to fund wallet: ${c.message||"Unknown error"}`);return yield x(_chunkJ33QM2IDcjs.i),c}),U= exports.approveTransaction =(a,o,c,...g)=>_chunkDSIFRRBScjs.h.call(void 0, void 0,[a,o,c,...g],function*(e,t,n,s=_chunkJ33QM2IDcjs.l.APPROVE_TRANSACTION_MAX_RETRIES){var m;for(let f=0;f<s;f++){let d=yield e.getTransaction(t,n);if(l(d))throw new Error(`Transaction not found: ${d.message||"Unknown error"}`);if("status"in d&&(d.status==="success"||d.status==="failed"))return d;let T="approvals"in d?(m=d.approvals)==null?void 0:m.pending:void 0;if(T&&T.length>0){let O={approvals:T.map(_=>({signer:_.signer.locator,signature:""}))},h=yield e.approveTransaction(t,n,O);if(l(h))throw new Error(`Failed to approve transaction: ${h.message||"Unknown error"}`);yield x(_chunkJ33QM2IDcjs.j);continue}yield x(_chunkJ33QM2IDcjs.i)}let u=yield e.getTransaction(t,n);if(l(u))throw new Error(`Transaction not found after retries: ${u.message||"Unknown error"}`);if(!("status"in u))throw new Error("Transaction response missing status property");return u}),me= exports.fundWalletAndWait =(e,t,n=1,s="usdxm",a="base-sepolia")=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){return I(e,t,n,s,a)}),fe= exports.sendTokenAndApprove =(e,t,n,s,a)=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){let o=yield e.send(t,n,{recipient:s,amount:a});if(l(o))throw new Error(`Failed to send token: ${o.message||"Unknown error"}`);if(typeof o=="object"&&o!==null&&"id"in o&&typeof o.id=="string")return U(e,t,o.id);throw new Error("Transaction ID not found in send response")}),ge= exports.ensureWalletFunded =(e,t,n=1,s="usdxm",a="base-sepolia")=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){try{yield I(e,t,n,s,a)}catch(o){let c=o instanceof Error?o.message:String(o);if(!c.includes("already funded")&&!c.includes("insufficient"))throw o}});exports.TestDataFactory = v; exports.approveTransaction = U; exports.createIntegrationApiClient = ie; exports.createMockCrossmint = B; exports.createMockErrorResponse = b; exports.createMockResponse = P; exports.createMockSendResponse = oe; exports.createMockSuccessResponse = j; exports.createMockWalletResponse = se; exports.createServerSideApiClient = K; exports.createTestApiClient = L; exports.createTestWallet = pe; exports.delay = x; exports.ensureWalletExists = ce; exports.ensureWalletFunded = ge; exports.expectCommonHeaders = V; exports.expectErrorResponse = le; exports.expectRequestBody = q; exports.expectRequestPath = N; exports.expectSuccessTransactionResponse = de; exports.expectSuccessWalletResponse = ue; exports.extractFetchCall = Y; exports.fundWallet = I; exports.fundWalletAndWait = me; exports.isErrorResponse = l; exports.isSuccessTransactionResponse = $; exports.isSuccessWalletResponse = C; exports.isValidEthereumAddress = re; exports.isValidSolanaAddress = ae; exports.sendTokenAndApprove = fe; exports.testCommonHttpErrors = Z; exports.testHttpErrorResponse = X; exports.testInvalidJsonResponse = ee; exports.testMalformedResponse = ne; exports.testNetworkError = Q; exports.testTimeoutError = te; exports.validateRequest = z;
@@ -1,7 +1,7 @@
1
1
  import { MockedFunction } from 'vitest';
2
2
  import { Crossmint } from '@crossmint/common-sdk-base';
3
3
  import { ApiClient } from '../client.cjs';
4
- import { ae as WalletLocator, ap as GetTransactionResponse, aq as SendResponse, ar as CreateWalletResponse, as as CreateWalletParams, a7 as FundWalletResponse } from '../../types-CwTucqvZ.cjs';
4
+ import { ah as WalletLocator, aq as GetTransactionResponse, ar as SendResponse, as as CreateWalletResponse, at as CreateWalletParams, aa as FundWalletResponse } from '../../types-XtGH-kml.cjs';
5
5
  import '../../chains/chains.cjs';
6
6
  import 'viem';
7
7
  import '../gen/types.gen.cjs';
@@ -1,7 +1,7 @@
1
1
  import { MockedFunction } from 'vitest';
2
2
  import { Crossmint } from '@crossmint/common-sdk-base';
3
3
  import { ApiClient } from '../client.js';
4
- import { ae as WalletLocator, ap as GetTransactionResponse, aq as SendResponse, ar as CreateWalletResponse, as as CreateWalletParams, a7 as FundWalletResponse } from '../../types-DUFjqW3o.js';
4
+ import { ah as WalletLocator, aq as GetTransactionResponse, ar as SendResponse, as as CreateWalletResponse, at as CreateWalletParams, aa as FundWalletResponse } from '../../types-Cd9b04Z6.js';
5
5
  import '../../chains/chains.js';
6
6
  import 'viem';
7
7
  import '../gen/types.gen.js';
@@ -1 +1 @@
1
- import{a as A,b as F,i as R,j as W,k as E,l as M,m as S}from"../../chunk-DIGDDKSF.js";import{a as w}from"../../chunk-SELBUWOU.js";import"../../chunk-TGFHY5PL.js";import"../../chunk-Y5LIA4JH.js";import"../../chunk-TVGWMSVV.js";import{a as p,b as k,h as i}from"../../chunk-NU7VF7MC.js";import{expect as r,vi as y}from"vitest";var P=({data:e,status:t=200,ok:n=!0,statusText:s="OK"})=>({json:y.fn().mockResolvedValue(e),ok:n,status:t,statusText:s}),j=e=>P({data:e}),b=(e,t=400,n="Bad Request")=>P({data:e,status:t,ok:!1,statusText:n}),B=(e={})=>{let t=p({apiKey:S},e);return k(p({},t),{setJwt:y.fn().mockReturnThis()})},L=e=>new w(e||B()),Y=()=>{let e=L();return Object.defineProperty(e,"isServerSide",{get:()=>!0,configurable:!0}),e},z=e=>{let t=e.mock.calls;if(t.length===0)return;let n=t[t.length-1];return{path:n[0],options:n[1]}},N=(e,t)=>{r(e==null?void 0:e.path).toBe(t)},V=e=>{r(e["Content-Type"]).toBe("application/json")},q=(e,t)=>{r(e.body).toBe(JSON.stringify(t))},X=(e,t,n)=>{r(e).toBeDefined(),e&&(N(e,t),e.options.headers&&V(e.options.headers),n!==void 0&&e.options&&q(e.options,n))},Z=(e,t,n,s)=>i(void 0,null,function*(){t.mockResolvedValue(b(n,s));let a=yield e();r(l(a)).toBe(!0),l(a)&&(r(a.error).toBe(!0),n.message&&r(a.message).toBe(n.message))}),Q=(s,a,...o)=>i(void 0,[s,a,...o],function*(e,t,n=[]){for(let{status:c,message:g}of A){if(n.includes(c))continue;let u={error:!0,message:g};t.mockResolvedValueOnce(b(u,c));let m=yield e();r(l(m)).toBe(!0)}}),ee=(e,t)=>i(void 0,null,function*(){t.mockRejectedValue(new Error("Network error")),yield r(e()).rejects.toThrow("Network error")}),te=(e,t)=>i(void 0,null,function*(){let n={json:y.fn().mockRejectedValue(new Error("Invalid JSON")),ok:!0,status:200};t.mockResolvedValue(n),yield r(e()).rejects.toThrow()}),ne=(e,t)=>i(void 0,null,function*(){t.mockImplementation(()=>new Promise((n,s)=>setTimeout(()=>s(new Error("Request timeout")),0))),yield r(e()).rejects.toThrow("Request timeout")}),se=(e,t,n)=>i(void 0,null,function*(){t.mockResolvedValue(j(n));let s=yield e();r(s).toEqual(n)}),oe=(e={})=>p({address:F.evmAddress,chainType:"evm",type:"smart",config:{adminSigner:{type:"external-wallet",address:E.EVM_TEST}}},e),re=(e={})=>p({id:"txn-123",status:"pending",chainType:"evm",walletType:"evm-smart-wallet",params:{transaction:"0x1234567890abcdef",signer:"api-key:test"},onChain:{txId:"0xabcdef1234567890abcdef1234567890abcdef12",explorerLink:"https://explorer.example.com/tx/0xabcdef1234567890abcdef1234567890abcdef12"},createdAt:Date.now()},e);function l(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error===!0}function C(e){return typeof e=="object"&&e!==null&&"address"in e&&"chainType"in e&&"type"in e}function $(e){return typeof e=="object"&&e!==null&&"id"in e&&"status"in e&&"chainType"in e}var x=e=>new Promise(t=>setTimeout(t,e)),ae=e=>/^0x[a-fA-F0-9]{40}$/.test(e),ie=e=>/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(e),ce=(e,t,n={})=>{let s=p(p({apiKey:e},t&&{overrideBaseUrl:t}),n),a=k(p({},s),{setJwt:()=>a});return new w(a)},v=class{constructor(){this.wallets=[];this.transactions=[]}addWallet(t){t&&!this.wallets.includes(t)&&this.wallets.push(t)}addTransaction(t){t&&!this.transactions.includes(t)&&this.transactions.push(t)}getWallet(t=0){return this.wallets[t]}getTransaction(t=0){return this.transactions[t]}hasWallets(){return this.wallets.length>0}clear(){this.wallets=[],this.transactions=[]}};function pe(s,a){return i(this,arguments,function*(e,t,n={}){if(t.hasWallets())return t.getWallet();let{chainType:o="evm",type:c="mpc",owner:g,testName:u="default"}=n,m=g||`userId:integration-${u}-${Date.now()}`,f=yield e.createWallet(p({chainType:o,type:c},g&&{owner:m}));if(C(f))return t.addWallet(f.address),f.address})}function le(e,t,n){return i(this,null,function*(){let s=yield e.createWallet(n);return C(s)&&t.addWallet(s.address),s})}function ue(e,t){r(l(e)).toBe(!0),t&&r(e.message).toBeDefined()}function de(e){r(C(e)).toBe(!0)}function me(e){r($(e)).toBe(!0)}var I=(e,t,n,s="usdxm",a="base-sepolia")=>i(void 0,null,function*(){let o={amount:n,token:s,chain:a},c=yield e.fundWallet(t,o);if(l(c))throw new Error(`Failed to fund wallet: ${c.message||"Unknown error"}`);return yield x(R),c}),U=(a,o,c,...g)=>i(void 0,[a,o,c,...g],function*(e,t,n,s=M.APPROVE_TRANSACTION_MAX_RETRIES){var m;for(let f=0;f<s;f++){let d=yield e.getTransaction(t,n);if(l(d))throw new Error(`Transaction not found: ${d.message||"Unknown error"}`);if("status"in d&&(d.status==="success"||d.status==="failed"))return d;let T="approvals"in d?(m=d.approvals)==null?void 0:m.pending:void 0;if(T&&T.length>0){let O={approvals:T.map(_=>({signer:_.signer.locator,signature:""}))},h=yield e.approveTransaction(t,n,O);if(l(h))throw new Error(`Failed to approve transaction: ${h.message||"Unknown error"}`);yield x(W);continue}yield x(R)}let u=yield e.getTransaction(t,n);if(l(u))throw new Error(`Transaction not found after retries: ${u.message||"Unknown error"}`);if(!("status"in u))throw new Error("Transaction response missing status property");return u}),fe=(e,t,n=1,s="usdxm",a="base-sepolia")=>i(void 0,null,function*(){return I(e,t,n,s,a)}),ge=(e,t,n,s,a)=>i(void 0,null,function*(){let o=yield e.send(t,n,{recipient:s,amount:a});if(l(o))throw new Error(`Failed to send token: ${o.message||"Unknown error"}`);if(typeof o=="object"&&o!==null&&"id"in o&&typeof o.id=="string")return U(e,t,o.id);throw new Error("Transaction ID not found in send response")}),Te=(e,t,n=1,s="usdxm",a="base-sepolia")=>i(void 0,null,function*(){try{yield I(e,t,n,s,a)}catch(o){let c=o instanceof Error?o.message:String(o);if(!c.includes("already funded")&&!c.includes("insufficient"))throw o}});export{v as TestDataFactory,U as approveTransaction,ce as createIntegrationApiClient,B as createMockCrossmint,b as createMockErrorResponse,P as createMockResponse,re as createMockSendResponse,j as createMockSuccessResponse,oe as createMockWalletResponse,Y as createServerSideApiClient,L as createTestApiClient,le as createTestWallet,x as delay,pe as ensureWalletExists,Te as ensureWalletFunded,V as expectCommonHeaders,ue as expectErrorResponse,q as expectRequestBody,N as expectRequestPath,me as expectSuccessTransactionResponse,de as expectSuccessWalletResponse,z as extractFetchCall,I as fundWallet,fe as fundWalletAndWait,l as isErrorResponse,$ as isSuccessTransactionResponse,C as isSuccessWalletResponse,ae as isValidEthereumAddress,ie as isValidSolanaAddress,ge as sendTokenAndApprove,Q as testCommonHttpErrors,Z as testHttpErrorResponse,te as testInvalidJsonResponse,se as testMalformedResponse,ee as testNetworkError,ne as testTimeoutError,X as validateRequest};
1
+ import{a as A,b as F,i as R,j as W,k as E,l as M,m as S}from"../../chunk-DIGDDKSF.js";import{a as w}from"../../chunk-CIIIXKSM.js";import"../../chunk-TGFHY5PL.js";import"../../chunk-UMQI4GDZ.js";import"../../chunk-FQZQGXWS.js";import{a as p,b as k,h as i}from"../../chunk-NU7VF7MC.js";import{expect as r,vi as y}from"vitest";var P=({data:e,status:t=200,ok:n=!0,statusText:s="OK"})=>({json:y.fn().mockResolvedValue(e),ok:n,status:t,statusText:s}),j=e=>P({data:e}),b=(e,t=400,n="Bad Request")=>P({data:e,status:t,ok:!1,statusText:n}),B=(e={})=>{let t=p({apiKey:S},e);return k(p({},t),{setJwt:y.fn().mockReturnThis()})},L=e=>new w(e||B()),Y=()=>{let e=L();return Object.defineProperty(e,"isServerSide",{get:()=>!0,configurable:!0}),e},z=e=>{let t=e.mock.calls;if(t.length===0)return;let n=t[t.length-1];return{path:n[0],options:n[1]}},N=(e,t)=>{r(e==null?void 0:e.path).toBe(t)},V=e=>{r(e["Content-Type"]).toBe("application/json")},q=(e,t)=>{r(e.body).toBe(JSON.stringify(t))},X=(e,t,n)=>{r(e).toBeDefined(),e&&(N(e,t),e.options.headers&&V(e.options.headers),n!==void 0&&e.options&&q(e.options,n))},Z=(e,t,n,s)=>i(void 0,null,function*(){t.mockResolvedValue(b(n,s));let a=yield e();r(l(a)).toBe(!0),l(a)&&(r(a.error).toBe(!0),n.message&&r(a.message).toBe(n.message))}),Q=(s,a,...o)=>i(void 0,[s,a,...o],function*(e,t,n=[]){for(let{status:c,message:g}of A){if(n.includes(c))continue;let u={error:!0,message:g};t.mockResolvedValueOnce(b(u,c));let m=yield e();r(l(m)).toBe(!0)}}),ee=(e,t)=>i(void 0,null,function*(){t.mockRejectedValue(new Error("Network error")),yield r(e()).rejects.toThrow("Network error")}),te=(e,t)=>i(void 0,null,function*(){let n={json:y.fn().mockRejectedValue(new Error("Invalid JSON")),ok:!0,status:200};t.mockResolvedValue(n),yield r(e()).rejects.toThrow()}),ne=(e,t)=>i(void 0,null,function*(){t.mockImplementation(()=>new Promise((n,s)=>setTimeout(()=>s(new Error("Request timeout")),0))),yield r(e()).rejects.toThrow("Request timeout")}),se=(e,t,n)=>i(void 0,null,function*(){t.mockResolvedValue(j(n));let s=yield e();r(s).toEqual(n)}),oe=(e={})=>p({address:F.evmAddress,chainType:"evm",type:"smart",config:{adminSigner:{type:"external-wallet",address:E.EVM_TEST}}},e),re=(e={})=>p({id:"txn-123",status:"pending",chainType:"evm",walletType:"evm-smart-wallet",params:{transaction:"0x1234567890abcdef",signer:"api-key:test"},onChain:{txId:"0xabcdef1234567890abcdef1234567890abcdef12",explorerLink:"https://explorer.example.com/tx/0xabcdef1234567890abcdef1234567890abcdef12"},createdAt:Date.now()},e);function l(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error===!0}function C(e){return typeof e=="object"&&e!==null&&"address"in e&&"chainType"in e&&"type"in e}function $(e){return typeof e=="object"&&e!==null&&"id"in e&&"status"in e&&"chainType"in e}var x=e=>new Promise(t=>setTimeout(t,e)),ae=e=>/^0x[a-fA-F0-9]{40}$/.test(e),ie=e=>/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(e),ce=(e,t,n={})=>{let s=p(p({apiKey:e},t&&{overrideBaseUrl:t}),n),a=k(p({},s),{setJwt:()=>a});return new w(a)},v=class{constructor(){this.wallets=[];this.transactions=[]}addWallet(t){t&&!this.wallets.includes(t)&&this.wallets.push(t)}addTransaction(t){t&&!this.transactions.includes(t)&&this.transactions.push(t)}getWallet(t=0){return this.wallets[t]}getTransaction(t=0){return this.transactions[t]}hasWallets(){return this.wallets.length>0}clear(){this.wallets=[],this.transactions=[]}};function pe(s,a){return i(this,arguments,function*(e,t,n={}){if(t.hasWallets())return t.getWallet();let{chainType:o="evm",type:c="mpc",owner:g,testName:u="default"}=n,m=g||`userId:integration-${u}-${Date.now()}`,f=yield e.createWallet(p({chainType:o,type:c},g&&{owner:m}));if(C(f))return t.addWallet(f.address),f.address})}function le(e,t,n){return i(this,null,function*(){let s=yield e.createWallet(n);return C(s)&&t.addWallet(s.address),s})}function ue(e,t){r(l(e)).toBe(!0),t&&r(e.message).toBeDefined()}function de(e){r(C(e)).toBe(!0)}function me(e){r($(e)).toBe(!0)}var I=(e,t,n,s="usdxm",a="base-sepolia")=>i(void 0,null,function*(){let o={amount:n,token:s,chain:a},c=yield e.fundWallet(t,o);if(l(c))throw new Error(`Failed to fund wallet: ${c.message||"Unknown error"}`);return yield x(R),c}),U=(a,o,c,...g)=>i(void 0,[a,o,c,...g],function*(e,t,n,s=M.APPROVE_TRANSACTION_MAX_RETRIES){var m;for(let f=0;f<s;f++){let d=yield e.getTransaction(t,n);if(l(d))throw new Error(`Transaction not found: ${d.message||"Unknown error"}`);if("status"in d&&(d.status==="success"||d.status==="failed"))return d;let T="approvals"in d?(m=d.approvals)==null?void 0:m.pending:void 0;if(T&&T.length>0){let O={approvals:T.map(_=>({signer:_.signer.locator,signature:""}))},h=yield e.approveTransaction(t,n,O);if(l(h))throw new Error(`Failed to approve transaction: ${h.message||"Unknown error"}`);yield x(W);continue}yield x(R)}let u=yield e.getTransaction(t,n);if(l(u))throw new Error(`Transaction not found after retries: ${u.message||"Unknown error"}`);if(!("status"in u))throw new Error("Transaction response missing status property");return u}),fe=(e,t,n=1,s="usdxm",a="base-sepolia")=>i(void 0,null,function*(){return I(e,t,n,s,a)}),ge=(e,t,n,s,a)=>i(void 0,null,function*(){let o=yield e.send(t,n,{recipient:s,amount:a});if(l(o))throw new Error(`Failed to send token: ${o.message||"Unknown error"}`);if(typeof o=="object"&&o!==null&&"id"in o&&typeof o.id=="string")return U(e,t,o.id);throw new Error("Transaction ID not found in send response")}),Te=(e,t,n=1,s="usdxm",a="base-sepolia")=>i(void 0,null,function*(){try{yield I(e,t,n,s,a)}catch(o){let c=o instanceof Error?o.message:String(o);if(!c.includes("already funded")&&!c.includes("insufficient"))throw o}});export{v as TestDataFactory,U as approveTransaction,ce as createIntegrationApiClient,B as createMockCrossmint,b as createMockErrorResponse,P as createMockResponse,re as createMockSendResponse,j as createMockSuccessResponse,oe as createMockWalletResponse,Y as createServerSideApiClient,L as createTestApiClient,le as createTestWallet,x as delay,pe as ensureWalletExists,Te as ensureWalletFunded,V as expectCommonHeaders,ue as expectErrorResponse,q as expectRequestBody,N as expectRequestPath,me as expectSuccessTransactionResponse,de as expectSuccessWalletResponse,z as extractFetchCall,I as fundWallet,fe as fundWalletAndWait,l as isErrorResponse,$ as isSuccessTransactionResponse,C as isSuccessWalletResponse,ae as isValidEthereumAddress,ie as isValidSolanaAddress,ge as sendTokenAndApprove,Q as testCommonHttpErrors,Z as testHttpErrorResponse,te as testInvalidJsonResponse,se as testMalformedResponse,ee as testNetworkError,ne as testTimeoutError,X as validateRequest};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkS77GSXV7cjs = require('../chunk-S77GSXV7.cjs');require('../chunk-3F4FMM3R.cjs');require('../chunk-JDQXT4RE.cjs');require('../chunk-NJUHI3JB.cjs');require('../chunk-DSIFRRBS.cjs');exports.ApiClient = _chunkS77GSXV7cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk577FVL6Ncjs = require('../chunk-577FVL6N.cjs');require('../chunk-3F4FMM3R.cjs');require('../chunk-XRLBGNNW.cjs');require('../chunk-KWILWKSM.cjs');require('../chunk-DSIFRRBS.cjs');exports.ApiClient = _chunk577FVL6Ncjs.a;
@@ -1,5 +1,5 @@
1
1
  import { CrossmintApiClient, Crossmint, APIKeyEnvironmentPrefix } from '@crossmint/common-sdk-base';
2
- import { as as CreateWalletParams, ar as CreateWalletResponse, ae as WalletLocator, ay as GetWalletResponse, az as CreateTransactionParams, aA as CreateTransactionResponse, aB as ApproveTransactionParams, aC as ApproveTransactionResponse, ap as GetTransactionResponse, aD as CreateSignatureParams, aE as CreateSignatureResponse, aF as ApproveSignatureParams, af as ApproveSignatureResponse, aG as GetSignatureResponse, a8 as GetTransactionsResponse, aH as GetTransfersResponse, aI as GetBalanceResponse, aJ as FundWalletParams, a7 as FundWalletResponse, aj as RegisterSignerParams, am as RegisterSignerResponse, aK as RemoveSignerParams, aL as RemoveSignerResponse, ag as GetSignerResponse, aM as SendParams, aq as SendResponse } from '../types-CwTucqvZ.cjs';
2
+ import { at as CreateWalletParams, as as CreateWalletResponse, ah as WalletLocator, az as GetWalletResponse, aA as CreateTransactionParams, aB as CreateTransactionResponse, aC as ApproveTransactionParams, aD as ApproveTransactionResponse, aq as GetTransactionResponse, aE as CreateSignatureParams, aF as CreateSignatureResponse, aG as ApproveSignatureParams, ai as ApproveSignatureResponse, aH as GetSignatureResponse, ab as GetTransactionsResponse, aI as GetTransfersResponse, aJ as GetBalanceResponse, aK as FundWalletParams, aa as FundWalletResponse, al as RegisterSignerParams, ao as RegisterSignerResponse, aL as RemoveSignerParams, aM as RemoveSignerResponse, aj as GetSignerResponse, aN as SendParams, ar as SendResponse } from '../types-XtGH-kml.cjs';
3
3
  import { Chain } from '../chains/chains.cjs';
4
4
  import 'viem';
5
5
  import './gen/types.gen.cjs';
@@ -1,5 +1,5 @@
1
1
  import { CrossmintApiClient, Crossmint, APIKeyEnvironmentPrefix } from '@crossmint/common-sdk-base';
2
- import { as as CreateWalletParams, ar as CreateWalletResponse, ae as WalletLocator, ay as GetWalletResponse, az as CreateTransactionParams, aA as CreateTransactionResponse, aB as ApproveTransactionParams, aC as ApproveTransactionResponse, ap as GetTransactionResponse, aD as CreateSignatureParams, aE as CreateSignatureResponse, aF as ApproveSignatureParams, af as ApproveSignatureResponse, aG as GetSignatureResponse, a8 as GetTransactionsResponse, aH as GetTransfersResponse, aI as GetBalanceResponse, aJ as FundWalletParams, a7 as FundWalletResponse, aj as RegisterSignerParams, am as RegisterSignerResponse, aK as RemoveSignerParams, aL as RemoveSignerResponse, ag as GetSignerResponse, aM as SendParams, aq as SendResponse } from '../types-DUFjqW3o.js';
2
+ import { at as CreateWalletParams, as as CreateWalletResponse, ah as WalletLocator, az as GetWalletResponse, aA as CreateTransactionParams, aB as CreateTransactionResponse, aC as ApproveTransactionParams, aD as ApproveTransactionResponse, aq as GetTransactionResponse, aE as CreateSignatureParams, aF as CreateSignatureResponse, aG as ApproveSignatureParams, ai as ApproveSignatureResponse, aH as GetSignatureResponse, ab as GetTransactionsResponse, aI as GetTransfersResponse, aJ as GetBalanceResponse, aK as FundWalletParams, aa as FundWalletResponse, al as RegisterSignerParams, ao as RegisterSignerResponse, aL as RemoveSignerParams, aM as RemoveSignerResponse, aj as GetSignerResponse, aN as SendParams, ar as SendResponse } from '../types-Cd9b04Z6.js';
3
3
  import { Chain } from '../chains/chains.js';
4
4
  import 'viem';
5
5
  import './gen/types.gen.js';
@@ -1 +1 @@
1
- import{a}from"../chunk-SELBUWOU.js";import"../chunk-TGFHY5PL.js";import"../chunk-Y5LIA4JH.js";import"../chunk-TVGWMSVV.js";import"../chunk-NU7VF7MC.js";export{a as ApiClient};
1
+ import{a}from"../chunk-CIIIXKSM.js";import"../chunk-TGFHY5PL.js";import"../chunk-UMQI4GDZ.js";import"../chunk-FQZQGXWS.js";import"../chunk-NU7VF7MC.js";export{a as ApiClient};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-6HXIZLEQ.cjs');var _chunkS77GSXV7cjs = require('../chunk-S77GSXV7.cjs');require('../chunk-ECAM5KTH.cjs');require('../chunk-3F4FMM3R.cjs');require('../chunk-JDQXT4RE.cjs');require('../chunk-NJUHI3JB.cjs');require('../chunk-DSIFRRBS.cjs');exports.ApiClient = _chunkS77GSXV7cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-6HXIZLEQ.cjs');var _chunk577FVL6Ncjs = require('../chunk-577FVL6N.cjs');require('../chunk-ECAM5KTH.cjs');require('../chunk-3F4FMM3R.cjs');require('../chunk-XRLBGNNW.cjs');require('../chunk-KWILWKSM.cjs');require('../chunk-DSIFRRBS.cjs');exports.ApiClient = _chunk577FVL6Ncjs.a;
@@ -1,5 +1,5 @@
1
1
  export { ApiClient } from './client.cjs';
2
- export { aF as ApproveSignatureParams, af as ApproveSignatureResponse, aB as ApproveTransactionParams, aC as ApproveTransactionResponse, aD as CreateSignatureParams, aE as CreateSignatureResponse, az as CreateTransactionParams, aA as CreateTransactionResponse, aN as CreateTransactionSuccessResponse, as as CreateWalletParams, ar as CreateWalletResponse, aJ as FundWalletParams, a7 as FundWalletResponse, aI as GetBalanceResponse, ax as GetBalanceSuccessResponse, aG as GetSignatureResponse, ag as GetSignerResponse, aO as GetSignersResponse, ap as GetTransactionResponse, a9 as GetTransactionSuccessResponse, a8 as GetTransactionsResponse, aH as GetTransfersResponse, ay as GetWalletResponse, aP as GetWalletSuccessResponse, aQ as RecoverySignerConfig, al as RegisterSignerChain, aj as RegisterSignerParams, R as RegisterSignerPasskeyParams, am as RegisterSignerResponse, aK as RemoveSignerParams, aL as RemoveSignerResponse, S as Scope, aM as SendParams, aq as SendResponse, ao as Signer, F as TransferScope, G as Transfers, ae as WalletLocator } from '../types-CwTucqvZ.cjs';
2
+ export { aG as ApproveSignatureParams, ai as ApproveSignatureResponse, aC as ApproveTransactionParams, aD as ApproveTransactionResponse, aE as CreateSignatureParams, aF as CreateSignatureResponse, aA as CreateTransactionParams, aB as CreateTransactionResponse, aO as CreateTransactionSuccessResponse, at as CreateWalletParams, as as CreateWalletResponse, aK as FundWalletParams, aa as FundWalletResponse, aJ as GetBalanceResponse, ay as GetBalanceSuccessResponse, aH as GetSignatureResponse, aj as GetSignerResponse, aP as GetSignersResponse, aq as GetTransactionResponse, ac as GetTransactionSuccessResponse, ab as GetTransactionsResponse, aI as GetTransfersResponse, az as GetWalletResponse, aQ as GetWalletSuccessResponse, aR as RecoverySignerConfig, an as RegisterSignerChain, al as RegisterSignerParams, R as RegisterSignerPasskeyParams, ao as RegisterSignerResponse, aL as RemoveSignerParams, aM as RemoveSignerResponse, S as Scope, aN as SendParams, ar as SendResponse, a0 as Signer, G as TransferScope, H as Transfers, ah as WalletLocator } from '../types-XtGH-kml.cjs';
3
3
  import '@crossmint/common-sdk-base';
4
4
  import '../chains/chains.cjs';
5
5
  import 'viem';
@@ -1,5 +1,5 @@
1
1
  export { ApiClient } from './client.js';
2
- export { aF as ApproveSignatureParams, af as ApproveSignatureResponse, aB as ApproveTransactionParams, aC as ApproveTransactionResponse, aD as CreateSignatureParams, aE as CreateSignatureResponse, az as CreateTransactionParams, aA as CreateTransactionResponse, aN as CreateTransactionSuccessResponse, as as CreateWalletParams, ar as CreateWalletResponse, aJ as FundWalletParams, a7 as FundWalletResponse, aI as GetBalanceResponse, ax as GetBalanceSuccessResponse, aG as GetSignatureResponse, ag as GetSignerResponse, aO as GetSignersResponse, ap as GetTransactionResponse, a9 as GetTransactionSuccessResponse, a8 as GetTransactionsResponse, aH as GetTransfersResponse, ay as GetWalletResponse, aP as GetWalletSuccessResponse, aQ as RecoverySignerConfig, al as RegisterSignerChain, aj as RegisterSignerParams, R as RegisterSignerPasskeyParams, am as RegisterSignerResponse, aK as RemoveSignerParams, aL as RemoveSignerResponse, S as Scope, aM as SendParams, aq as SendResponse, ao as Signer, F as TransferScope, G as Transfers, ae as WalletLocator } from '../types-DUFjqW3o.js';
2
+ export { aG as ApproveSignatureParams, ai as ApproveSignatureResponse, aC as ApproveTransactionParams, aD as ApproveTransactionResponse, aE as CreateSignatureParams, aF as CreateSignatureResponse, aA as CreateTransactionParams, aB as CreateTransactionResponse, aO as CreateTransactionSuccessResponse, at as CreateWalletParams, as as CreateWalletResponse, aK as FundWalletParams, aa as FundWalletResponse, aJ as GetBalanceResponse, ay as GetBalanceSuccessResponse, aH as GetSignatureResponse, aj as GetSignerResponse, aP as GetSignersResponse, aq as GetTransactionResponse, ac as GetTransactionSuccessResponse, ab as GetTransactionsResponse, aI as GetTransfersResponse, az as GetWalletResponse, aQ as GetWalletSuccessResponse, aR as RecoverySignerConfig, an as RegisterSignerChain, al as RegisterSignerParams, R as RegisterSignerPasskeyParams, ao as RegisterSignerResponse, aL as RemoveSignerParams, aM as RemoveSignerResponse, S as Scope, aN as SendParams, ar as SendResponse, a0 as Signer, G as TransferScope, H as Transfers, ah as WalletLocator } from '../types-Cd9b04Z6.js';
3
3
  import '@crossmint/common-sdk-base';
4
4
  import '../chains/chains.js';
5
5
  import 'viem';
package/dist/api/index.js CHANGED
@@ -1 +1 @@
1
- import"../chunk-5IFDVB4Y.js";import{a}from"../chunk-SELBUWOU.js";import"../chunk-KBJA7JDT.js";import"../chunk-TGFHY5PL.js";import"../chunk-Y5LIA4JH.js";import"../chunk-TVGWMSVV.js";import"../chunk-NU7VF7MC.js";export{a as ApiClient};
1
+ import"../chunk-5IFDVB4Y.js";import{a}from"../chunk-CIIIXKSM.js";import"../chunk-KBJA7JDT.js";import"../chunk-TGFHY5PL.js";import"../chunk-UMQI4GDZ.js";import"../chunk-FQZQGXWS.js";import"../chunk-NU7VF7MC.js";export{a as ApiClient};
@@ -1,6 +1,6 @@
1
1
  import 'viem';
2
2
  import './gen/types.gen.cjs';
3
- export { aF as ApproveSignatureParams, af as ApproveSignatureResponse, aB as ApproveTransactionParams, aC as ApproveTransactionResponse, aD as CreateSignatureParams, aE as CreateSignatureResponse, az as CreateTransactionParams, aA as CreateTransactionResponse, aN as CreateTransactionSuccessResponse, as as CreateWalletParams, ar as CreateWalletResponse, aJ as FundWalletParams, a7 as FundWalletResponse, aI as GetBalanceResponse, ax as GetBalanceSuccessResponse, aG as GetSignatureResponse, ag as GetSignerResponse, aO as GetSignersResponse, ap as GetTransactionResponse, a9 as GetTransactionSuccessResponse, a8 as GetTransactionsResponse, aH as GetTransfersResponse, ay as GetWalletResponse, aP as GetWalletSuccessResponse, aQ as RecoverySignerConfig, al as RegisterSignerChain, aj as RegisterSignerParams, R as RegisterSignerPasskeyParams, am as RegisterSignerResponse, aK as RemoveSignerParams, aL as RemoveSignerResponse, S as Scope, aM as SendParams, aq as SendResponse, ao as Signer, F as TransferScope, G as Transfers, ae as WalletLocator } from '../types-CwTucqvZ.cjs';
3
+ export { aG as ApproveSignatureParams, ai as ApproveSignatureResponse, aC as ApproveTransactionParams, aD as ApproveTransactionResponse, aE as CreateSignatureParams, aF as CreateSignatureResponse, aA as CreateTransactionParams, aB as CreateTransactionResponse, aO as CreateTransactionSuccessResponse, at as CreateWalletParams, as as CreateWalletResponse, aK as FundWalletParams, aa as FundWalletResponse, aJ as GetBalanceResponse, ay as GetBalanceSuccessResponse, aH as GetSignatureResponse, aj as GetSignerResponse, aP as GetSignersResponse, aq as GetTransactionResponse, ac as GetTransactionSuccessResponse, ab as GetTransactionsResponse, aI as GetTransfersResponse, az as GetWalletResponse, aQ as GetWalletSuccessResponse, aR as RecoverySignerConfig, an as RegisterSignerChain, al as RegisterSignerParams, R as RegisterSignerPasskeyParams, ao as RegisterSignerResponse, aL as RemoveSignerParams, aM as RemoveSignerResponse, S as Scope, aN as SendParams, ar as SendResponse, a0 as Signer, G as TransferScope, H as Transfers, ah as WalletLocator } from '../types-XtGH-kml.cjs';
4
4
  import '../chains/chains.cjs';
5
5
  import 'ox';
6
6
  import '@crossmint/client-sdk-window';
@@ -1,6 +1,6 @@
1
1
  import 'viem';
2
2
  import './gen/types.gen.js';
3
- export { aF as ApproveSignatureParams, af as ApproveSignatureResponse, aB as ApproveTransactionParams, aC as ApproveTransactionResponse, aD as CreateSignatureParams, aE as CreateSignatureResponse, az as CreateTransactionParams, aA as CreateTransactionResponse, aN as CreateTransactionSuccessResponse, as as CreateWalletParams, ar as CreateWalletResponse, aJ as FundWalletParams, a7 as FundWalletResponse, aI as GetBalanceResponse, ax as GetBalanceSuccessResponse, aG as GetSignatureResponse, ag as GetSignerResponse, aO as GetSignersResponse, ap as GetTransactionResponse, a9 as GetTransactionSuccessResponse, a8 as GetTransactionsResponse, aH as GetTransfersResponse, ay as GetWalletResponse, aP as GetWalletSuccessResponse, aQ as RecoverySignerConfig, al as RegisterSignerChain, aj as RegisterSignerParams, R as RegisterSignerPasskeyParams, am as RegisterSignerResponse, aK as RemoveSignerParams, aL as RemoveSignerResponse, S as Scope, aM as SendParams, aq as SendResponse, ao as Signer, F as TransferScope, G as Transfers, ae as WalletLocator } from '../types-DUFjqW3o.js';
3
+ export { aG as ApproveSignatureParams, ai as ApproveSignatureResponse, aC as ApproveTransactionParams, aD as ApproveTransactionResponse, aE as CreateSignatureParams, aF as CreateSignatureResponse, aA as CreateTransactionParams, aB as CreateTransactionResponse, aO as CreateTransactionSuccessResponse, at as CreateWalletParams, as as CreateWalletResponse, aK as FundWalletParams, aa as FundWalletResponse, aJ as GetBalanceResponse, ay as GetBalanceSuccessResponse, aH as GetSignatureResponse, aj as GetSignerResponse, aP as GetSignersResponse, aq as GetTransactionResponse, ac as GetTransactionSuccessResponse, ab as GetTransactionsResponse, aI as GetTransfersResponse, az as GetWalletResponse, aQ as GetWalletSuccessResponse, aR as RecoverySignerConfig, an as RegisterSignerChain, al as RegisterSignerParams, R as RegisterSignerPasskeyParams, ao as RegisterSignerResponse, aL as RemoveSignerParams, aM as RemoveSignerResponse, S as Scope, aN as SendParams, ar as SendResponse, a0 as Signer, G as TransferScope, H as Transfers, ah as WalletLocator } from '../types-Cd9b04Z6.js';
4
4
  import '../chains/chains.js';
5
5
  import 'ox';
6
6
  import '@crossmint/client-sdk-window';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2VVOL5YAcjs = require('../../chunk-2VVOL5YA.cjs');require('../../chunk-FN64UU7M.cjs');require('../../chunk-3F4FMM3R.cjs');require('../../chunk-CCIGWTAO.cjs');require('../../chunk-JDQXT4RE.cjs');require('../../chunk-NJUHI3JB.cjs');require('../../chunk-DSIFRRBS.cjs');exports.evmChainAdapter = _chunk2VVOL5YAcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkILJXME26cjs = require('../../chunk-ILJXME26.cjs');require('../../chunk-TM77X7C3.cjs');require('../../chunk-3F4FMM3R.cjs');require('../../chunk-CCIGWTAO.cjs');require('../../chunk-XRLBGNNW.cjs');require('../../chunk-KWILWKSM.cjs');require('../../chunk-DSIFRRBS.cjs');exports.evmChainAdapter = _chunkILJXME26cjs.a;
@@ -2,7 +2,7 @@ import { ChainAdapter } from '../chain-adapter.cjs';
2
2
  import '../chains.cjs';
3
3
  import '@crossmint/common-sdk-base';
4
4
  import 'viem';
5
- import '../../types-CwTucqvZ.cjs';
5
+ import '../../types-XtGH-kml.cjs';
6
6
  import '../../api/gen/types.gen.cjs';
7
7
  import 'ox';
8
8
  import '@crossmint/client-sdk-window';
@@ -2,7 +2,7 @@ import { ChainAdapter } from '../chain-adapter.js';
2
2
  import '../chains.js';
3
3
  import '@crossmint/common-sdk-base';
4
4
  import 'viem';
5
- import '../../types-DUFjqW3o.js';
5
+ import '../../types-Cd9b04Z6.js';
6
6
  import '../../api/gen/types.gen.js';
7
7
  import 'ox';
8
8
  import '@crossmint/client-sdk-window';
@@ -1 +1 @@
1
- import{a}from"../../chunk-TBNAORVI.js";import"../../chunk-IUMKG7QD.js";import"../../chunk-TGFHY5PL.js";import"../../chunk-455NK5LB.js";import"../../chunk-Y5LIA4JH.js";import"../../chunk-TVGWMSVV.js";import"../../chunk-NU7VF7MC.js";export{a as evmChainAdapter};
1
+ import{a}from"../../chunk-SXB2JOPU.js";import"../../chunk-6HB4WO5J.js";import"../../chunk-TGFHY5PL.js";import"../../chunk-455NK5LB.js";import"../../chunk-UMQI4GDZ.js";import"../../chunk-FQZQGXWS.js";import"../../chunk-NU7VF7MC.js";export{a as evmChainAdapter};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYBPZA7OScjs = require('../../chunk-YBPZA7OS.cjs');require('../../chunk-CCIGWTAO.cjs');require('../../chunk-JDQXT4RE.cjs');require('../../chunk-NJUHI3JB.cjs');require('../../chunk-DSIFRRBS.cjs');exports.solanaChainAdapter = _chunkYBPZA7OScjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWVCLDF55cjs = require('../../chunk-WVCLDF55.cjs');require('../../chunk-CCIGWTAO.cjs');require('../../chunk-XRLBGNNW.cjs');require('../../chunk-KWILWKSM.cjs');require('../../chunk-DSIFRRBS.cjs');exports.solanaChainAdapter = _chunkWVCLDF55cjs.a;
@@ -2,7 +2,7 @@ import { ChainAdapter } from '../chain-adapter.cjs';
2
2
  import '../chains.cjs';
3
3
  import '@crossmint/common-sdk-base';
4
4
  import 'viem';
5
- import '../../types-CwTucqvZ.cjs';
5
+ import '../../types-XtGH-kml.cjs';
6
6
  import '../../api/gen/types.gen.cjs';
7
7
  import 'ox';
8
8
  import '@crossmint/client-sdk-window';
@@ -2,7 +2,7 @@ import { ChainAdapter } from '../chain-adapter.js';
2
2
  import '../chains.js';
3
3
  import '@crossmint/common-sdk-base';
4
4
  import 'viem';
5
- import '../../types-DUFjqW3o.js';
5
+ import '../../types-Cd9b04Z6.js';
6
6
  import '../../api/gen/types.gen.js';
7
7
  import 'ox';
8
8
  import '@crossmint/client-sdk-window';
@@ -1 +1 @@
1
- import{a}from"../../chunk-4A7AWKUP.js";import"../../chunk-455NK5LB.js";import"../../chunk-Y5LIA4JH.js";import"../../chunk-TVGWMSVV.js";import"../../chunk-NU7VF7MC.js";export{a as solanaChainAdapter};
1
+ import{a}from"../../chunk-DXVNNTYG.js";import"../../chunk-455NK5LB.js";import"../../chunk-UMQI4GDZ.js";import"../../chunk-FQZQGXWS.js";import"../../chunk-NU7VF7MC.js";export{a as solanaChainAdapter};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkRRFUWLFAcjs = require('../../chunk-RRFUWLFA.cjs');require('../../chunk-CCIGWTAO.cjs');require('../../chunk-JDQXT4RE.cjs');require('../../chunk-NJUHI3JB.cjs');require('../../chunk-DSIFRRBS.cjs');exports.stellarChainAdapter = _chunkRRFUWLFAcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5CGCTYQJcjs = require('../../chunk-5CGCTYQJ.cjs');require('../../chunk-CCIGWTAO.cjs');require('../../chunk-XRLBGNNW.cjs');require('../../chunk-KWILWKSM.cjs');require('../../chunk-DSIFRRBS.cjs');exports.stellarChainAdapter = _chunk5CGCTYQJcjs.a;
@@ -2,7 +2,7 @@ import { ChainAdapter } from '../chain-adapter.cjs';
2
2
  import '../chains.cjs';
3
3
  import '@crossmint/common-sdk-base';
4
4
  import 'viem';
5
- import '../../types-CwTucqvZ.cjs';
5
+ import '../../types-XtGH-kml.cjs';
6
6
  import '../../api/gen/types.gen.cjs';
7
7
  import 'ox';
8
8
  import '@crossmint/client-sdk-window';
@@ -2,7 +2,7 @@ import { ChainAdapter } from '../chain-adapter.js';
2
2
  import '../chains.js';
3
3
  import '@crossmint/common-sdk-base';
4
4
  import 'viem';
5
- import '../../types-DUFjqW3o.js';
5
+ import '../../types-Cd9b04Z6.js';
6
6
  import '../../api/gen/types.gen.js';
7
7
  import 'ox';
8
8
  import '@crossmint/client-sdk-window';
@@ -1 +1 @@
1
- import{a}from"../../chunk-RUL7HCDJ.js";import"../../chunk-455NK5LB.js";import"../../chunk-Y5LIA4JH.js";import"../../chunk-TVGWMSVV.js";import"../../chunk-NU7VF7MC.js";export{a as stellarChainAdapter};
1
+ import{a}from"../../chunk-M7QSZTNV.js";import"../../chunk-455NK5LB.js";import"../../chunk-UMQI4GDZ.js";import"../../chunk-FQZQGXWS.js";import"../../chunk-NU7VF7MC.js";export{a as stellarChainAdapter};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkP3CGYHYEcjs = require('../chunk-P3CGYHYE.cjs');require('../chunk-2VVOL5YA.cjs');require('../chunk-YBPZA7OS.cjs');require('../chunk-RRFUWLFA.cjs');require('../chunk-FN64UU7M.cjs');require('../chunk-ENU3EKBG.cjs');require('../chunk-3F4FMM3R.cjs');require('../chunk-CCIGWTAO.cjs');require('../chunk-JDQXT4RE.cjs');require('../chunk-NJUHI3JB.cjs');require('../chunk-DSIFRRBS.cjs');exports.getChainAdapter = _chunkP3CGYHYEcjs.a; exports.isSupportedChainType = _chunkP3CGYHYEcjs.b;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKIZY54AZcjs = require('../chunk-KIZY54AZ.cjs');require('../chunk-ILJXME26.cjs');require('../chunk-WVCLDF55.cjs');require('../chunk-5CGCTYQJ.cjs');require('../chunk-TM77X7C3.cjs');require('../chunk-ENU3EKBG.cjs');require('../chunk-3F4FMM3R.cjs');require('../chunk-CCIGWTAO.cjs');require('../chunk-XRLBGNNW.cjs');require('../chunk-KWILWKSM.cjs');require('../chunk-DSIFRRBS.cjs');exports.getChainAdapter = _chunkKIZY54AZcjs.a; exports.isSupportedChainType = _chunkKIZY54AZcjs.b;
@@ -1,5 +1,5 @@
1
1
  import { Chain } from './chains.cjs';
2
- import { al as RegisterSignerChain, am as RegisterSignerResponse, ah as PendingSignerOperation, an as TokenBalance } from '../types-CwTucqvZ.cjs';
2
+ import { an as RegisterSignerChain, ao as RegisterSignerResponse, a1 as PendingSignerOperation, ap as TokenBalance } from '../types-XtGH-kml.cjs';
3
3
  import '@crossmint/common-sdk-base';
4
4
  import 'viem';
5
5
  import '../api/gen/types.gen.cjs';
@@ -1,5 +1,5 @@
1
1
  import { Chain } from './chains.js';
2
- import { al as RegisterSignerChain, am as RegisterSignerResponse, ah as PendingSignerOperation, an as TokenBalance } from '../types-DUFjqW3o.js';
2
+ import { an as RegisterSignerChain, ao as RegisterSignerResponse, a1 as PendingSignerOperation, ap as TokenBalance } from '../types-Cd9b04Z6.js';
3
3
  import '@crossmint/common-sdk-base';
4
4
  import 'viem';
5
5
  import '../api/gen/types.gen.js';
@@ -1 +1 @@
1
- import{a,b}from"../chunk-4MMD5K7I.js";import"../chunk-TBNAORVI.js";import"../chunk-4A7AWKUP.js";import"../chunk-RUL7HCDJ.js";import"../chunk-IUMKG7QD.js";import"../chunk-OQZTL6ZG.js";import"../chunk-TGFHY5PL.js";import"../chunk-455NK5LB.js";import"../chunk-Y5LIA4JH.js";import"../chunk-TVGWMSVV.js";import"../chunk-NU7VF7MC.js";export{a as getChainAdapter,b as isSupportedChainType};
1
+ import{a,b}from"../chunk-IYQVWJXN.js";import"../chunk-SXB2JOPU.js";import"../chunk-DXVNNTYG.js";import"../chunk-M7QSZTNV.js";import"../chunk-6HB4WO5J.js";import"../chunk-OQZTL6ZG.js";import"../chunk-TGFHY5PL.js";import"../chunk-455NK5LB.js";import"../chunk-UMQI4GDZ.js";import"../chunk-FQZQGXWS.js";import"../chunk-NU7VF7MC.js";export{a as getChainAdapter,b as isSupportedChainType};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKB3LRV7Ocjs = require('../chunk-KB3LRV7O.cjs');require('../chunk-5X4EOJFG.cjs');require('../chunk-HRUMWG2F.cjs');require('../chunk-IR5WN6FQ.cjs');require('../chunk-GEY574TH.cjs');require('../chunk-UE3WVHTM.cjs');require('../chunk-3F4FMM3R.cjs');require('../chunk-CCIGWTAO.cjs');require('../chunk-JDQXT4RE.cjs');require('../chunk-NJUHI3JB.cjs');require('../chunk-DSIFRRBS.cjs');exports.isMainnetChain = _chunkKB3LRV7Ocjs.c; exports.isTestnetChain = _chunkKB3LRV7Ocjs.b; exports.isValidChain = _chunkKB3LRV7Ocjs.e; exports.mainnetToTestnet = _chunkKB3LRV7Ocjs.d; exports.toViemChain = _chunkKB3LRV7Ocjs.a; exports.validateChainForEnvironment = _chunkKB3LRV7Ocjs.f;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6MQ7FVEVcjs = require('../chunk-6MQ7FVEV.cjs');require('../chunk-5X4EOJFG.cjs');require('../chunk-HRUMWG2F.cjs');require('../chunk-IR5WN6FQ.cjs');require('../chunk-GEY574TH.cjs');require('../chunk-UE3WVHTM.cjs');require('../chunk-3F4FMM3R.cjs');require('../chunk-CCIGWTAO.cjs');require('../chunk-XRLBGNNW.cjs');require('../chunk-KWILWKSM.cjs');require('../chunk-DSIFRRBS.cjs');exports.isMainnetChain = _chunk6MQ7FVEVcjs.c; exports.isTestnetChain = _chunk6MQ7FVEVcjs.b; exports.isValidChain = _chunk6MQ7FVEVcjs.e; exports.mainnetToTestnet = _chunk6MQ7FVEVcjs.d; exports.toViemChain = _chunk6MQ7FVEVcjs.a; exports.validateChainForEnvironment = _chunk6MQ7FVEVcjs.f;
@@ -1 +1 @@
1
- import{a,b,c,d,e,f}from"../chunk-NWVX4HDR.js";import"../chunk-FT5EVMLB.js";import"../chunk-SVIKBM3S.js";import"../chunk-KKQBZXFE.js";import"../chunk-S3DYQVRD.js";import"../chunk-KUP7H7X2.js";import"../chunk-TGFHY5PL.js";import"../chunk-455NK5LB.js";import"../chunk-Y5LIA4JH.js";import"../chunk-TVGWMSVV.js";import"../chunk-NU7VF7MC.js";export{c as isMainnetChain,b as isTestnetChain,e as isValidChain,d as mainnetToTestnet,a as toViemChain,f as validateChainForEnvironment};
1
+ import{a,b,c,d,e,f}from"../chunk-GAGWB24A.js";import"../chunk-FT5EVMLB.js";import"../chunk-SVIKBM3S.js";import"../chunk-KKQBZXFE.js";import"../chunk-S3DYQVRD.js";import"../chunk-KUP7H7X2.js";import"../chunk-TGFHY5PL.js";import"../chunk-455NK5LB.js";import"../chunk-UMQI4GDZ.js";import"../chunk-FQZQGXWS.js";import"../chunk-NU7VF7MC.js";export{c as isMainnetChain,b as isTestnetChain,e as isValidChain,d as mainnetToTestnet,a as toViemChain,f as validateChainForEnvironment};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGZFWSGHLcjs = require('./chunk-GZFWSGHL.cjs');var _chunkGMU3ZYLScjs = require('./chunk-GMU3ZYLS.cjs');var _chunkR7S55N7Jcjs = require('./chunk-R7S55N7J.cjs');var _chunkSEXK7X55cjs = require('./chunk-SEXK7X55.cjs');var _chunkDBMVGHLOcjs = require('./chunk-DBMVGHLO.cjs');var _chunkKB3LRV7Ocjs = require('./chunk-KB3LRV7O.cjs');var _chunk3F4FMM3Rcjs = require('./chunk-3F4FMM3R.cjs');var _chunkJDQXT4REcjs = require('./chunk-JDQXT4RE.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var _ox = require('ox');var $="When 'signers' is provided to a method that may fetch an existing wallet, each specified signer must exist in that wallet's configuration.",u= exports.a =class{constructor(r){this.apiClient=r}getWallet(r,e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let i,t;if(typeof r=="string"){if(!this.apiClient.isServerSide)throw new (0, _chunk3F4FMM3Rcjs.g)("getWallet with walletLocator is only available on the server side. Use getWallet(args) instead.");if(e==null)throw new (0, _chunk3F4FMM3Rcjs.g)("Wallet configuration is required when using walletLocator: https://docs.crossmint.com/sdk-reference/wallets/type-aliases/WalletArgsFor");i=r,t=e}else{if(this.apiClient.isServerSide)throw new (0, _chunk3F4FMM3Rcjs.g)("getWallet on server side requires a walletLocator parameter. Use getWallet(walletLocator, args) instead.");t=r,i=this.getWalletLocator(t)}let a=_chunkDSIFRRBScjs.b.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {},t),{chain:_chunkKB3LRV7Ocjs.f.call(void 0, t.chain,this.apiClient.environment)});_chunkJDQXT4REcjs.a.info("walletFactory.getWallet.start");let n=yield this.apiClient.getWallet(i);if("error"in n)throw _chunkJDQXT4REcjs.a.warn("walletFactory.getWallet.notFound",{error:n.error}),new (0, _chunk3F4FMM3Rcjs.e)(JSON.stringify(n));return _chunkJDQXT4REcjs.a.info("walletFactory.getWallet.success",{address:n.address}),yield this.createWalletInstance(n,a)})}createWallet(r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var o,c,d,h,C,p,F,P;let e=_chunkDSIFRRBScjs.b.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {},r),{chain:_chunkKB3LRV7Ocjs.f.call(void 0, r.chain,this.apiClient.environment)});if(yield(d=(c=(o=e.options)==null?void 0:o.callbacks)==null?void 0:c.onWalletCreationStart)==null?void 0:d.call(c),_chunkJDQXT4REcjs.a.info("walletFactory.createWallet.start"),!this.apiClient.isServerSide&&e.owner!=null)throw _chunkJDQXT4REcjs.a.error("walletFactory.createWallet.error",{error:"Owner field cannot be specified in client-side createWallet calls"}),new (0, _chunk3F4FMM3Rcjs.g)("Owner field cannot be specified in client-side createWallet calls. Owner is determined from JWT authentication.");let t=((h=e.options)==null?void 0:h.deviceSignerKeyStorage)!=null&&e.chain!=="solana"?this.ensureDeviceSignerInSigners(e):(C=e.signers)!=null?C:[],a=yield this.registerSigners(t,e.chain,(p=e.options)==null?void 0:p.deviceSignerKeyStorage),n;if(e.recovery.type==="passkey"&&e.recovery.id==null)n=yield this.createPasskeySigner(e.recovery);else if(e.recovery.type==="server"){let{derivedAddress:I}=_chunkDBMVGHLOcjs.b.call(void 0, e.recovery,e.chain,this.apiClient.projectId,this.apiClient.environment);n={type:"server",address:I}}else n=e.recovery;let s=yield this.apiClient.createWallet({type:"smart",chainType:this.getChainType(e.chain),config:_chunkDSIFRRBScjs.a.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {adminSigner:n},e.plugins?{plugins:e.plugins}:{}),a!=null?{delegatedSigners:a}:{}),owner:(F=e.owner)!=null?F:void 0,alias:(P=e.alias)!=null?P:void 0});if("error"in s)throw _chunkJDQXT4REcjs.a.error("walletFactory.createWallet.error",{error:s.error}),new (0, _chunk3F4FMM3Rcjs.g)(JSON.stringify(s));return _chunkJDQXT4REcjs.a.info("walletFactory.createWallet.success",{address:s.address}),yield this.createWalletInstance(s,e)})}createWalletInstance(r,e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var h,C;this.validateExistingWalletConfig(r,e);let i=e,t=r.config.adminSigner,a=((h=i.recovery)==null?void 0:h.type)==="server"||((C=i.recovery)==null?void 0:C.type)==="external-wallet"?i.recovery:t,n=r.config.delegatedSigners,s=n;s!=null&&s.length===1&&(s[0].type==="server"||s[0].type==="external-wallet")&&(s=i.signers);let o=t.type==="server"&&"address"in t&&!("secret"in t)?t.address:void 0,c=(n!=null?n:[]).filter(p=>p.type==="server"&&"address"in p&&!("secret"in p)).map(p=>p.address),d=new (0, _chunkGZFWSGHLcjs.a)({chain:e.chain,address:r.address,owner:r.owner,options:e.options,alias:e.alias,recovery:a,apiRecoveryServerSignerAddress:o,apiDelegatedServerSignerAddresses:c,signers:s!=null?s:[]},this.apiClient);return yield d.waitForInit(),d})}getWalletLocator(r){return`me:${this.getChainType(r.chain)}:smart`+(r.alias!=null?`:alias:${r.alias}`:"")}createPasskeySigner(r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var t;if(r.type!=="passkey")throw new Error("Signer is not a passkey");let e=(t=r.name)!=null?t:`Crossmint Wallet ${Date.now()}`,i=r.onCreatePasskey?yield r.onCreatePasskey(e):yield _ox.WebAuthnP256.createCredential({name:e});return{type:"passkey",id:i.id,name:e,publicKey:{x:i.publicKey.x.toString(),y:i.publicKey.y.toString()}}})}ensureDeviceSignerInSigners(r){var t;let e=(t=r.signers)!=null?t:[];return e.some(a=>a.type==="device")?e:[...e,{type:"device"}]}validateExistingWalletConfig(r,e){if(e.owner!=null&&r.owner!=null&&_chunkSEXK7X55cjs.b.call(void 0, e.owner)!==_chunkSEXK7X55cjs.b.call(void 0, r.owner))throw new (0, _chunk3F4FMM3Rcjs.g)("Wallet owner does not match existing wallet's linked user");if(e.chain==="solana"&&r.chainType!=="solana"||e.chain!=="solana"&&r.chainType==="solana"||e.chain==="stellar"&&r.chainType!=="stellar"||e.chain!=="stellar"&&r.chainType==="stellar")throw new (0, _chunk3F4FMM3Rcjs.g)(`Wallet chain does not match existing wallet's chain. You must use chain: ${r.chainType}.`);if(r.type!=="smart")return;let i=e;if(i.recovery!=null||i.signers!=null){let t=r.config,a=t==null?void 0:t.adminSigner;if(i.recovery!=null&&a!=null){if(i.recovery.type!==a.type)throw new (0, _chunk3F4FMM3Rcjs.g)("The wallet recovery signer type does not match the existing wallet's recovery signer type");_chunkSEXK7X55cjs.c.call(void 0, i.recovery,a)}let n=i.signers;n!=null&&this.validateSigners(r,n,e.chain)}}validateSigners(r,e,i){let t=r.config,a=t==null?void 0:t.delegatedSigners;if(e.length!==0){if(a==null||a.length===0)throw new (0, _chunk3F4FMM3Rcjs.g)(`${e.length} signer(s) specified, but wallet "${r.address}" has no signers. ${$}`);for(let n of e){let s=a.find(o=>{if(this.isMatchingPasskeySigner(n,o,t)||o.type==="device"&&n.type==="device")return!0;if(n.type==="server"){let{primary:c,legacy:d}=_chunkDBMVGHLOcjs.c.call(void 0, n,i,this.apiClient.projectId,this.apiClient.environment);return o.locator===`server:${c.derivedAddress}`||d!=null&&o.locator===`server:${d.derivedAddress}`}return o.locator===_chunkR7S55N7Jcjs.a.call(void 0, n)});if(s==null){let o=a.map(c=>c.locator).join(", ");throw new (0, _chunk3F4FMM3Rcjs.g)(`Signer '${n.type}' does not exist in wallet "${r.address}". Available signers: ${o}. ${$}`)}_chunkSEXK7X55cjs.c.call(void 0, n,s)}}}isMatchingPasskeySigner(r,e,i){var a,n;let t=((n=(a=i.delegatedSigners)==null?void 0:a.filter(s=>s.type==="passkey").length)!=null?n:0)+(i.adminSigner.type==="passkey"?1:0);if(r.type==="passkey"){if(r.id==null&&t===1)return e.type==="passkey";if(r.id==null&&t>1)throw new (0, _chunk3F4FMM3Rcjs.g)("When creating a wallet with multiple passkeys, you must provide the passkey ID for each passkey.")}return!1}registerSigners(r,e,i){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var t;return yield Promise.all((t=r==null?void 0:r.map(a=>_chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){if(a.type==="passkey")return a.id==null?{signer:yield this.createPasskeySigner(a)}:{signer:a};if(a.type==="device"){if(a.publicKey!=null)return{signer:{type:"device",publicKey:a.publicKey,name:a.name}};if(a.locator!=null)return{signer:a.locator};if(i==null)throw new (0, _chunk3F4FMM3Rcjs.g)("Device signer key storage is required for device signers");let n=yield _chunkGMU3ZYLScjs.a.call(void 0, i);return{signer:{type:"device",publicKey:n.publicKey,name:n.name}}}if(a.type==="server"&&e!=null){let{derivedAddress:n}=_chunkDBMVGHLOcjs.b.call(void 0, a,e,this.apiClient.projectId,this.apiClient.environment);return{signer:`server:${n}`}}return{signer:_chunkR7S55N7Jcjs.a.call(void 0, a)}})))!=null?t:[])})}getChainType(r){return r==="solana"?"solana":r==="stellar"?"stellar":"evm"}};_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkJDQXT4REcjs.a,methodName:"walletFactory.getWallet",buildContext(r,e){if(typeof e[0]=="string"){let t=e[1];return{walletLocator:e[0],chain:t==null?void 0:t.chain}}let i=e[0];return{chain:i==null?void 0:i.chain}}})],u.prototype,"getWallet",1),_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkJDQXT4REcjs.a,methodName:"walletFactory.createWallet",buildContext(r,e){return{chain:e[0].chain}}})],u.prototype,"createWallet",1);exports.a = u;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOZ6ZUQ4Ecjs = require('./chunk-OZ6ZUQ4E.cjs');var _chunkGMU3ZYLScjs = require('./chunk-GMU3ZYLS.cjs');var _chunkR7S55N7Jcjs = require('./chunk-R7S55N7J.cjs');var _chunkSEXK7X55cjs = require('./chunk-SEXK7X55.cjs');var _chunkQ66YRLSWcjs = require('./chunk-Q66YRLSW.cjs');var _chunk6MQ7FVEVcjs = require('./chunk-6MQ7FVEV.cjs');var _chunk3F4FMM3Rcjs = require('./chunk-3F4FMM3R.cjs');var _chunkXRLBGNNWcjs = require('./chunk-XRLBGNNW.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var _ox = require('ox');var $="When 'signers' is provided to a method that may fetch an existing wallet, each specified signer must exist in that wallet's configuration.",u= exports.a =class{constructor(r){this.apiClient=r}getWallet(r,e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let i,t;if(typeof r=="string"){if(!this.apiClient.isServerSide)throw new (0, _chunk3F4FMM3Rcjs.g)("getWallet with walletLocator is only available on the server side. Use getWallet(args) instead.");if(e==null)throw new (0, _chunk3F4FMM3Rcjs.g)("Wallet configuration is required when using walletLocator: https://docs.crossmint.com/sdk-reference/wallets/type-aliases/WalletArgsFor");i=r,t=e}else{if(this.apiClient.isServerSide)throw new (0, _chunk3F4FMM3Rcjs.g)("getWallet on server side requires a walletLocator parameter. Use getWallet(walletLocator, args) instead.");t=r,i=this.getWalletLocator(t)}let a=_chunkDSIFRRBScjs.b.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {},t),{chain:_chunk6MQ7FVEVcjs.f.call(void 0, t.chain,this.apiClient.environment)});_chunkXRLBGNNWcjs.a.info("walletFactory.getWallet.start");let n=yield this.apiClient.getWallet(i);if("error"in n)throw _chunkXRLBGNNWcjs.a.warn("walletFactory.getWallet.notFound",{error:n.error}),new (0, _chunk3F4FMM3Rcjs.e)(JSON.stringify(n));return _chunkXRLBGNNWcjs.a.info("walletFactory.getWallet.success",{address:n.address}),yield this.createWalletInstance(n,a)})}createWallet(r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var o,c,d,h,C,p,F,P;let e=_chunkDSIFRRBScjs.b.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {},r),{chain:_chunk6MQ7FVEVcjs.f.call(void 0, r.chain,this.apiClient.environment)});if(yield(d=(c=(o=e.options)==null?void 0:o.callbacks)==null?void 0:c.onWalletCreationStart)==null?void 0:d.call(c),_chunkXRLBGNNWcjs.a.info("walletFactory.createWallet.start"),!this.apiClient.isServerSide&&e.owner!=null)throw _chunkXRLBGNNWcjs.a.error("walletFactory.createWallet.error",{error:"Owner field cannot be specified in client-side createWallet calls"}),new (0, _chunk3F4FMM3Rcjs.g)("Owner field cannot be specified in client-side createWallet calls. Owner is determined from JWT authentication.");let t=((h=e.options)==null?void 0:h.deviceSignerKeyStorage)!=null&&e.chain!=="solana"?this.ensureDeviceSignerInSigners(e):(C=e.signers)!=null?C:[],a=yield this.registerSigners(t,e.chain,(p=e.options)==null?void 0:p.deviceSignerKeyStorage),n;if(e.recovery.type==="passkey"&&e.recovery.id==null)n=yield this.createPasskeySigner(e.recovery);else if(e.recovery.type==="server"){let{derivedAddress:I}=_chunkQ66YRLSWcjs.b.call(void 0, e.recovery,e.chain,this.apiClient.projectId,this.apiClient.environment);n={type:"server",address:I}}else n=e.recovery;let s=yield this.apiClient.createWallet({type:"smart",chainType:this.getChainType(e.chain),config:_chunkDSIFRRBScjs.a.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {adminSigner:n},e.plugins?{plugins:e.plugins}:{}),a!=null?{delegatedSigners:a}:{}),owner:(F=e.owner)!=null?F:void 0,alias:(P=e.alias)!=null?P:void 0});if("error"in s)throw _chunkXRLBGNNWcjs.a.error("walletFactory.createWallet.error",{error:s.error}),new (0, _chunk3F4FMM3Rcjs.g)(JSON.stringify(s));return _chunkXRLBGNNWcjs.a.info("walletFactory.createWallet.success",{address:s.address}),yield this.createWalletInstance(s,e)})}createWalletInstance(r,e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var h,C;this.validateExistingWalletConfig(r,e);let i=e,t=r.config.adminSigner,a=((h=i.recovery)==null?void 0:h.type)==="server"||((C=i.recovery)==null?void 0:C.type)==="external-wallet"?i.recovery:t,n=r.config.delegatedSigners,s=n;s!=null&&s.length===1&&(s[0].type==="server"||s[0].type==="external-wallet")&&(s=i.signers);let o=t.type==="server"&&"address"in t&&!("secret"in t)?t.address:void 0,c=(n!=null?n:[]).filter(p=>p.type==="server"&&"address"in p&&!("secret"in p)).map(p=>p.address),d=new (0, _chunkOZ6ZUQ4Ecjs.a)({chain:e.chain,address:r.address,owner:r.owner,options:e.options,alias:e.alias,recovery:a,apiRecoveryServerSignerAddress:o,apiDelegatedServerSignerAddresses:c,signers:s!=null?s:[]},this.apiClient);return yield d.waitForInit(),d})}getWalletLocator(r){return`me:${this.getChainType(r.chain)}:smart`+(r.alias!=null?`:alias:${r.alias}`:"")}createPasskeySigner(r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var t;if(r.type!=="passkey")throw new Error("Signer is not a passkey");let e=(t=r.name)!=null?t:`Crossmint Wallet ${Date.now()}`,i=r.onCreatePasskey?yield r.onCreatePasskey(e):yield _ox.WebAuthnP256.createCredential({name:e});return{type:"passkey",id:i.id,name:e,publicKey:{x:i.publicKey.x.toString(),y:i.publicKey.y.toString()}}})}ensureDeviceSignerInSigners(r){var t;let e=(t=r.signers)!=null?t:[];return e.some(a=>a.type==="device")?e:[...e,{type:"device"}]}validateExistingWalletConfig(r,e){if(e.owner!=null&&r.owner!=null&&_chunkSEXK7X55cjs.b.call(void 0, e.owner)!==_chunkSEXK7X55cjs.b.call(void 0, r.owner))throw new (0, _chunk3F4FMM3Rcjs.g)("Wallet owner does not match existing wallet's linked user");if(e.chain==="solana"&&r.chainType!=="solana"||e.chain!=="solana"&&r.chainType==="solana"||e.chain==="stellar"&&r.chainType!=="stellar"||e.chain!=="stellar"&&r.chainType==="stellar")throw new (0, _chunk3F4FMM3Rcjs.g)(`Wallet chain does not match existing wallet's chain. You must use chain: ${r.chainType}.`);if(r.type!=="smart")return;let i=e;if(i.recovery!=null||i.signers!=null){let t=r.config,a=t==null?void 0:t.adminSigner;if(i.recovery!=null&&a!=null){if(i.recovery.type!==a.type)throw new (0, _chunk3F4FMM3Rcjs.g)("The wallet recovery signer type does not match the existing wallet's recovery signer type");_chunkSEXK7X55cjs.c.call(void 0, i.recovery,a)}let n=i.signers;n!=null&&this.validateSigners(r,n,e.chain)}}validateSigners(r,e,i){let t=r.config,a=t==null?void 0:t.delegatedSigners;if(e.length!==0){if(a==null||a.length===0)throw new (0, _chunk3F4FMM3Rcjs.g)(`${e.length} signer(s) specified, but wallet "${r.address}" has no signers. ${$}`);for(let n of e){let s=a.find(o=>{if(this.isMatchingPasskeySigner(n,o,t)||o.type==="device"&&n.type==="device")return!0;if(n.type==="server"){let{primary:c,legacy:d}=_chunkQ66YRLSWcjs.c.call(void 0, n,i,this.apiClient.projectId,this.apiClient.environment);return o.locator===`server:${c.derivedAddress}`||d!=null&&o.locator===`server:${d.derivedAddress}`}return o.locator===_chunkR7S55N7Jcjs.a.call(void 0, n)});if(s==null){let o=a.map(c=>c.locator).join(", ");throw new (0, _chunk3F4FMM3Rcjs.g)(`Signer '${n.type}' does not exist in wallet "${r.address}". Available signers: ${o}. ${$}`)}_chunkSEXK7X55cjs.c.call(void 0, n,s)}}}isMatchingPasskeySigner(r,e,i){var a,n;let t=((n=(a=i.delegatedSigners)==null?void 0:a.filter(s=>s.type==="passkey").length)!=null?n:0)+(i.adminSigner.type==="passkey"?1:0);if(r.type==="passkey"){if(r.id==null&&t===1)return e.type==="passkey";if(r.id==null&&t>1)throw new (0, _chunk3F4FMM3Rcjs.g)("When creating a wallet with multiple passkeys, you must provide the passkey ID for each passkey.")}return!1}registerSigners(r,e,i){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var t;return yield Promise.all((t=r==null?void 0:r.map(a=>_chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){if(a.type==="passkey")return a.id==null?{signer:yield this.createPasskeySigner(a)}:{signer:a};if(a.type==="device"){if(a.publicKey!=null)return{signer:{type:"device",publicKey:a.publicKey,name:a.name}};if(a.locator!=null)return{signer:a.locator};if(i==null)throw new (0, _chunk3F4FMM3Rcjs.g)("Device signer key storage is required for device signers");let n=yield _chunkGMU3ZYLScjs.a.call(void 0, i);return{signer:{type:"device",publicKey:n.publicKey,name:n.name}}}if(a.type==="server"&&e!=null){let{derivedAddress:n}=_chunkQ66YRLSWcjs.b.call(void 0, a,e,this.apiClient.projectId,this.apiClient.environment);return{signer:`server:${n}`}}return{signer:_chunkR7S55N7Jcjs.a.call(void 0, a)}})))!=null?t:[])})}getChainType(r){return r==="solana"?"solana":r==="stellar"?"stellar":"evm"}};_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkXRLBGNNWcjs.a,methodName:"walletFactory.getWallet",buildContext(r,e){if(typeof e[0]=="string"){let t=e[1];return{walletLocator:e[0],chain:t==null?void 0:t.chain}}let i=e[0];return{chain:i==null?void 0:i.chain}}})],u.prototype,"getWallet",1),_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkXRLBGNNWcjs.a,methodName:"walletFactory.createWallet",buildContext(r,e){return{chain:e[0].chain}}})],u.prototype,"createWallet",1);exports.a = u;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk743T6QIOcjs = require('./chunk-743T6QIO.cjs');var _chunkGMU3ZYLScjs = require('./chunk-GMU3ZYLS.cjs');var _chunkS77GSXV7cjs = require('./chunk-S77GSXV7.cjs');var _chunkJDQXT4REcjs = require('./chunk-JDQXT4RE.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var _ox = require('ox');var o=class c{constructor(e){_chunkJDQXT4REcjs.b.call(void 0, e.apiKey);let t=new (0, _chunkS77GSXV7cjs.a)(e);this.walletFactory=new (0, _chunk743T6QIOcjs.a)(t),_chunkJDQXT4REcjs.a.info("wallets.sdk.initialized")}static from(e){return new c(e)}getWallet(e,t){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){if(typeof e=="string"){if(t==null)throw new Error("Args parameter is required when walletLocator is provided");return yield this.walletFactory.getWallet(e,t)}return yield this.walletFactory.getWallet(e)})}createWallet(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return yield this.walletFactory.createWallet(e)})}createDeviceSigner(e,t){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return yield _chunkGMU3ZYLScjs.a.call(void 0, e,t)})}createPasskeySigner(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let t=yield _ox.WebAuthnP256.createCredential({name:e});return{type:"passkey",id:t.id,name:e,publicKey:{x:t.publicKey.x.toString(),y:t.publicKey.y.toString()}}})}};exports.a = _commonsdkbase.createCrossmint; exports.b = o;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2FEUZYLPcjs = require('./chunk-2FEUZYLP.cjs');var _chunkGMU3ZYLScjs = require('./chunk-GMU3ZYLS.cjs');var _chunk577FVL6Ncjs = require('./chunk-577FVL6N.cjs');var _chunkXRLBGNNWcjs = require('./chunk-XRLBGNNW.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var _ox = require('ox');var o=class c{constructor(e){_chunkXRLBGNNWcjs.b.call(void 0, e.apiKey);let t=new (0, _chunk577FVL6Ncjs.a)(e);this.walletFactory=new (0, _chunk2FEUZYLPcjs.a)(t),_chunkXRLBGNNWcjs.a.info("wallets.sdk.initialized")}static from(e){return new c(e)}getWallet(e,t){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){if(typeof e=="string"){if(t==null)throw new Error("Args parameter is required when walletLocator is provided");return yield this.walletFactory.getWallet(e,t)}return yield this.walletFactory.getWallet(e)})}createWallet(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return yield this.walletFactory.createWallet(e)})}createDeviceSigner(e,t){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return yield _chunkGMU3ZYLScjs.a.call(void 0, e,t)})}createPasskeySigner(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let t=yield _ox.WebAuthnP256.createCredential({name:e});return{type:"passkey",id:t.id,name:e,publicKey:{x:t.publicKey.x.toString(),y:t.publicKey.y.toString()}}})}};exports.a = _commonsdkbase.createCrossmint; exports.b = o;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3F4FMM3Rcjs = require('./chunk-3F4FMM3R.cjs');var _chunkJDQXT4REcjs = require('./chunk-JDQXT4RE.cjs');var _chunkNJUHI3JBcjs = require('./chunk-NJUHI3JB.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var h=class extends _commonsdkbase.CrossmintApiClient{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:_chunkNJUHI3JBcjs.c,version:_chunkNJUHI3JBcjs.b}}});this.apiPrefix="api/2025-06-09/wallets";this.unstableApiPrefix="api/unstable/wallets"}createWallet(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let s=this.isServerSide?`${this.apiPrefix}`:`${this.apiPrefix}/me`;_chunkJDQXT4REcjs.a.info("wallets.api.createWallet",{chainType:e.chainType,walletType:e.type});let n=yield(yield this.post(s,{body:JSON.stringify(e),headers:this.headers})).json();return"error"in n?_chunkJDQXT4REcjs.a.error("wallets.api.createWallet.error",{error:n.error,chainType:e.chainType}):"address"in n&&_chunkJDQXT4REcjs.a.info("wallets.api.createWallet.success",{address:n.address,chainType:e.chainType}),n})}getWallet(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){_chunkJDQXT4REcjs.a.info("wallets.api.getWallet",{locator:e});let r=yield(yield this.get(`${this.apiPrefix}/${e}`,{headers:this.headers})).json();return"error"in r?_chunkJDQXT4REcjs.a.warn("wallets.api.getWallet.error",{locator:e,error:r.error}):"address"in r&&_chunkJDQXT4REcjs.a.info("wallets.api.getWallet.success",{address:r.address,locator:e}),r})}createTransaction(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveTransaction(e,s,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions/${s}/approvals`,{body:JSON.stringify(r),headers:this.headers})).json()})}getTransaction(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions/${s}`,{headers:this.headers})).json()})}createSignature(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signatures`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveSignature(e,s,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let n=yield this.post(`${this.apiPrefix}/${e}/signatures/${s}/approvals`,{body:JSON.stringify(r),headers:this.headers});return n.status===422?this.getSignature(e,s):n.json()})}getSignature(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signatures/${s}`,{headers:this.headers})).json()})}getTransactions(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions`,{headers:this.headers})).json()})}getNfts(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let s=new URLSearchParams;s.append("page",e.page.toString()),s.append("perPage",e.perPage.toString());let r=`${e.chain}:${e.address}`;return(yield this.get(`${this.apiPrefix}/${r}/nfts?${s.toString()}`,{headers:this.headers})).json()})}getTransfers(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let r=new URLSearchParams;return r.append("chain",s.chain.toString()),s.tokens!=null&&r.append("tokens",s.tokens),r.append("status",s.status),(yield this.get(`${this.unstableApiPrefix}/${e}/transfers?${r.toString()}`,{headers:this.headers})).json()})}getBalance(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let r=new URLSearchParams;return r.append("tokens",s.tokens.join(",")),r.append("chains",s.chains.join(",")),(yield this.get(`${this.apiPrefix}/${e}/balances?${r.toString()}`,{headers:this.headers})).json()})}fundWallet(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){if(this.environment===_commonsdkbase.APIKeyEnvironmentPrefix.PRODUCTION)throw new Error("Funding wallets is only supported in staging environment");return(yield this.post(`api/v1-alpha2/wallets/${e}/balances`,{body:JSON.stringify(s),headers:this.headers})).json()})}registerSigner(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signers`,{body:JSON.stringify(s),headers:this.headers})).json()})}removeSigner(e,s,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let n=encodeURIComponent(s),i=new URLSearchParams;r.chain&&i.append("chain",r.chain);let l=`${this.apiPrefix}/${e}/signers/${n}${i.size>0?`?${i.toString()}`:""}`;return(yield this.delete(l,{headers:this.headers})).json()})}getSigner(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let r=encodeURIComponent(s);return(yield this.get(`${this.apiPrefix}/${e}/signers/${r}`,{headers:this.headers})).json()})}send(e,s,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){_chunkJDQXT4REcjs.a.info("wallets.api.send",{walletLocator:e,tokenLocator:s,recipient:r.recipient});let i=yield(yield this.post(`${this.apiPrefix}/${e}/tokens/${s}/transfers`,{body:JSON.stringify(r),headers:this.headers})).json();return"error"in i?_chunkJDQXT4REcjs.a.error("wallets.api.send.error",{walletLocator:e,tokenLocator:s,error:i.error}):"id"in i&&_chunkJDQXT4REcjs.a.info("wallets.api.send.success",{walletLocator:e,transactionId:i.id}),i})}get isServerSide(){return this.parsedAPIKey.usageOrigin===_commonsdkbase.APIKeyUsageOrigin.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new (0, _chunk3F4FMM3Rcjs.a)("Invalid API key");return this.parsedAPIKey.environment}get projectId(){if(!this.parsedAPIKey.isValid)throw new (0, _chunk3F4FMM3Rcjs.a)("Invalid API key");return this.parsedAPIKey.projectId}get headers(){return{"Content-Type":"application/json"}}};exports.a = h;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3F4FMM3Rcjs = require('./chunk-3F4FMM3R.cjs');var _chunkXRLBGNNWcjs = require('./chunk-XRLBGNNW.cjs');var _chunkKWILWKSMcjs = require('./chunk-KWILWKSM.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var h=class extends _commonsdkbase.CrossmintApiClient{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:_chunkKWILWKSMcjs.c,version:_chunkKWILWKSMcjs.b}}});this.apiPrefix="api/2025-06-09/wallets";this.unstableApiPrefix="api/unstable/wallets"}createWallet(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let s=this.isServerSide?`${this.apiPrefix}`:`${this.apiPrefix}/me`;_chunkXRLBGNNWcjs.a.info("wallets.api.createWallet",{chainType:e.chainType,walletType:e.type});let n=yield(yield this.post(s,{body:JSON.stringify(e),headers:this.headers})).json();return"error"in n?_chunkXRLBGNNWcjs.a.error("wallets.api.createWallet.error",{error:n.error,chainType:e.chainType}):"address"in n&&_chunkXRLBGNNWcjs.a.info("wallets.api.createWallet.success",{address:n.address,chainType:e.chainType}),n})}getWallet(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){_chunkXRLBGNNWcjs.a.info("wallets.api.getWallet",{locator:e});let r=yield(yield this.get(`${this.apiPrefix}/${e}`,{headers:this.headers})).json();return"error"in r?_chunkXRLBGNNWcjs.a.warn("wallets.api.getWallet.error",{locator:e,error:r.error}):"address"in r&&_chunkXRLBGNNWcjs.a.info("wallets.api.getWallet.success",{address:r.address,locator:e}),r})}createTransaction(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveTransaction(e,s,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions/${s}/approvals`,{body:JSON.stringify(r),headers:this.headers})).json()})}getTransaction(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions/${s}`,{headers:this.headers})).json()})}createSignature(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signatures`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveSignature(e,s,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let n=yield this.post(`${this.apiPrefix}/${e}/signatures/${s}/approvals`,{body:JSON.stringify(r),headers:this.headers});return n.status===422?this.getSignature(e,s):n.json()})}getSignature(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signatures/${s}`,{headers:this.headers})).json()})}getTransactions(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions`,{headers:this.headers})).json()})}getNfts(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let s=new URLSearchParams;s.append("page",e.page.toString()),s.append("perPage",e.perPage.toString());let r=`${e.chain}:${e.address}`;return(yield this.get(`${this.apiPrefix}/${r}/nfts?${s.toString()}`,{headers:this.headers})).json()})}getTransfers(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let r=new URLSearchParams;return r.append("chain",s.chain.toString()),s.tokens!=null&&r.append("tokens",s.tokens),r.append("status",s.status),(yield this.get(`${this.unstableApiPrefix}/${e}/transfers?${r.toString()}`,{headers:this.headers})).json()})}getBalance(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let r=new URLSearchParams;return r.append("tokens",s.tokens.join(",")),r.append("chains",s.chains.join(",")),(yield this.get(`${this.apiPrefix}/${e}/balances?${r.toString()}`,{headers:this.headers})).json()})}fundWallet(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){if(this.environment===_commonsdkbase.APIKeyEnvironmentPrefix.PRODUCTION)throw new Error("Funding wallets is only supported in staging environment");return(yield this.post(`api/v1-alpha2/wallets/${e}/balances`,{body:JSON.stringify(s),headers:this.headers})).json()})}registerSigner(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signers`,{body:JSON.stringify(s),headers:this.headers})).json()})}removeSigner(e,s,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let n=encodeURIComponent(s),i=new URLSearchParams;r.chain&&i.append("chain",r.chain);let l=`${this.apiPrefix}/${e}/signers/${n}${i.size>0?`?${i.toString()}`:""}`;return(yield this.delete(l,{headers:this.headers})).json()})}getSigner(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let r=encodeURIComponent(s);return(yield this.get(`${this.apiPrefix}/${e}/signers/${r}`,{headers:this.headers})).json()})}send(e,s,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){_chunkXRLBGNNWcjs.a.info("wallets.api.send",{walletLocator:e,tokenLocator:s,recipient:r.recipient});let i=yield(yield this.post(`${this.apiPrefix}/${e}/tokens/${s}/transfers`,{body:JSON.stringify(r),headers:this.headers})).json();return"error"in i?_chunkXRLBGNNWcjs.a.error("wallets.api.send.error",{walletLocator:e,tokenLocator:s,error:i.error}):"id"in i&&_chunkXRLBGNNWcjs.a.info("wallets.api.send.success",{walletLocator:e,transactionId:i.id}),i})}get isServerSide(){return this.parsedAPIKey.usageOrigin===_commonsdkbase.APIKeyUsageOrigin.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new (0, _chunk3F4FMM3Rcjs.a)("Invalid API key");return this.parsedAPIKey.environment}get projectId(){if(!this.parsedAPIKey.isValid)throw new (0, _chunk3F4FMM3Rcjs.a)("Invalid API key");return this.parsedAPIKey.projectId}get headers(){return{"Content-Type":"application/json"}}};exports.a = h;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJDQXT4REcjs = require('./chunk-JDQXT4RE.cjs');var o={nativeToken:"xlm",walletLocatorPrefix:"me:stellar:smart",supportsSignatures:!1,addSignerChain(n){},extractAddSignerOperation(n,r,t){if(!("transaction"in n)||n.transaction==null)throw _chunkJDQXT4REcjs.a.error("wallet.addSigner.error",{error:"Expected transaction in response for Solana/Stellar chain"}),new Error("Expected transaction in response for Solana/Stellar chain");return{type:"transaction",id:n.transaction.id}},balanceTokenFields(n){return n!=null&&"contractId"in n?{contractId:n.contractId}:n!=null&&"contractAddress"in n?{contractAddress:n.contractAddress}:{}},emptyBalanceTokenFields(){return{contractId:void 0}}};exports.a = o;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkXRLBGNNWcjs = require('./chunk-XRLBGNNW.cjs');var o={nativeToken:"xlm",walletLocatorPrefix:"me:stellar:smart",supportsSignatures:!1,addSignerChain(n){},extractAddSignerOperation(n,r,t){if(!("transaction"in n)||n.transaction==null)throw _chunkXRLBGNNWcjs.a.error("wallet.addSigner.error",{error:"Expected transaction in response for Solana/Stellar chain"}),new Error("Expected transaction in response for Solana/Stellar chain");return{type:"transaction",id:n.transaction.id}},balanceTokenFields(n){return n!=null&&"contractId"in n?{contractId:n.contractId}:n!=null&&"contractAddress"in n?{contractAddress:n.contractAddress}:{}},emptyBalanceTokenFields(){return{contractId:void 0}}};exports.a = o;
@@ -0,0 +1 @@
1
+ import{a as m}from"./chunk-NFX2WUB6.js";import{a as A}from"./chunk-FDKID63Z.js";import{f as w}from"./chunk-DCKFFFPG.js";import{b as R,c as b}from"./chunk-6HB4WO5J.js";import{d as e,e as o,f as s,h as p}from"./chunk-NU7VF7MC.js";var a,n,d,g,S,C,u,h,v,y,x=class{constructor(r){o(this,a);o(this,n);o(this,d);o(this,g);o(this,S);o(this,C);o(this,u);o(this,h);o(this,v);o(this,y);s(this,d,r.apiClient),s(this,g,r.options),s(this,S,r.chain),s(this,C,r.walletAddress),s(this,u,r.walletLocator),s(this,h,r.serverSignerResolver),s(this,n,r.recovery),s(this,v,r.initialSigners),s(this,y,r.signers),s(this,a,r.signer)}get activeSigner(){return e(this,a)}setActiveSigner(r){s(this,a,r)}get recovery(){return e(this,n)}descriptorContext(){var r,i,t,l,c;return{chain:e(this,S),walletAddress:e(this,C),crossmint:e(this,d).crossmint,clientTEEConnection:(r=e(this,g))==null?void 0:r.clientTEEConnection,resetSignerFrame:(i=e(this,g))==null?void 0:i.resetSignerFrame,onAuthRequired:(l=(t=e(this,g))==null?void 0:t.callbacks)==null?void 0:l.onAuthRequired,deviceSignerKeyStorage:(c=e(this,g))==null?void 0:c.deviceSignerKeyStorage,serverSigners:e(this,h)}}adoptRecoveryConfig(r){s(this,n,r)}stripSecretFromRecovery(){let r=e(this,h).resolvedRecoveryAddress;e(this,n)!=null&&e(this,n).type==="server"&&!w(e(this,n))&&r!=null&&s(this,n,{type:"server",address:r})}assemble(r,i){return p(this,null,function*(){var l,c;let t=A(e(this,S),r,(l=e(this,g))==null?void 0:l.deviceSignerKeyStorage);if(i!=null&&i.isAdminSigner)t.status="active";else{let f=yield this.getSignerState(t.locator());t.status=(c=f.signer)==null?void 0:c.status}return t})}require(){if(e(this,a)==null){if(e(this,v).length>1)throw new Error("No signer is set. This wallet has multiple signers configured. Call wallet.useSigner() to select which signer to use before signing operations.");let r=m(e(this,n).type),i=r.signerUnavailableReason();throw i!=null?new Error(i):r.canAutoAssemble(e(this,n),this.descriptorContext())?new Error("This wallet is read-only because no signer was provided. Operations that require signing (send, approve, addSigner, etc.) are not available."):new Error("No signer is set. This wallet requires calling wallet.useSigner() before signing operations.")}return e(this,a)}withRecoverySigner(r){return p(this,null,function*(){var f;let i=e(this,a);if(w(e(this,n))&&!e(this,h).hasRecoveryResolution)throw new Error('Cannot assemble server signer: no secret available. Call wallet.useSigner({ type: "server", secret: ... }) first with the recovery server secret.');let t=m(e(this,n).type),l=this.descriptorContext();if(e(this,n)!=null&&e(this,n).type==="external-wallet"&&!t.canAutoAssemble(e(this,n),l))throw new Error('Cannot assemble external wallet signer: no onSign callback available. Call wallet.useSigner({ type: "external-wallet", address: "0x...", onSign: async (tx) => ... }) first.');let c=t.buildInternalConfig(e(this,n),l);s(this,a,A(e(this,S),c,(f=e(this,g))==null?void 0:f.deviceSignerKeyStorage));try{return yield r()}finally{s(this,a,i)}})}getSignerState(r){return p(this,null,function*(){let i=null;try{i=yield e(this,d).getSigner(e(this,u).call(this),r)}catch(l){return{response:null,signer:null,pendingOperation:null}}if(i==null||typeof i!="object"||"error"in i)return{response:null,signer:null,pendingOperation:null};let t=R(i,e(this,S));return{response:i,signer:t,pendingOperation:b(i,e(this,S))}})}signerIsRegistered(r){return p(this,null,function*(){return(yield e(this,y).call(this)).some(t=>t.locator===r)})}isSignerApproved(r){return p(this,null,function*(){var t;let i=yield this.getSignerState(r);return this.isApprovedSignerStatus((t=i.signer)==null?void 0:t.status)})}isApprovedSignerStatus(r){return r==="success"||r==="active"}};a=new WeakMap,n=new WeakMap,d=new WeakMap,g=new WeakMap,S=new WeakMap,C=new WeakMap,u=new WeakMap,h=new WeakMap,v=new WeakMap,y=new WeakMap;export{x as a};
@@ -1 +1 @@
1
- import{a as s,b as o}from"./chunk-NU7VF7MC.js";function l(t){switch(t.type){case"passkey":return{type:"passkey",id:t.id,name:t.name,publicKey:t.publicKey,validatorContractVersion:t.validatorContractVersion,locator:t.locator};case"api-key":return{type:"api-key",address:t.address,locator:t.locator};case"external-wallet":return{type:"external-wallet",address:t.address,locator:t.locator};case"email":return{type:"email",email:t.email,address:t.address,locator:t.locator};case"phone":return{type:"phone",phone:t.phone,address:t.address,locator:t.locator};case"device":return{type:"device",publicKey:t.publicKey,locator:t.locator};case"server":return{type:"server",address:t.address,locator:t.locator};default:throw new Error(`Unknown signer type: ${t.type}`)}}function d(t,n){let e=l(t),r="scopes"in t?t.scopes:void 0;if(n==="solana"||n==="stellar"){let a="success";return"transaction"in t&&t.transaction!=null&&(a=t.transaction.status),s(o(s({},e),{status:a}),r!=null&&{scopes:r})}if("chains"in t&&t.chains!=null&&Object.keys(t.chains).length>0){let a=t.chains[n];return a==null?null:s(o(s({},e),{status:a.status}),r!=null&&{scopes:r})}return s(o(s({},e),{status:"success"}),r!=null&&{scopes:r})}function i(t,n){if(n==="solana"||n==="stellar")return"transaction"in t&&t.transaction!=null&&(t.transaction.status==="pending"||t.transaction.status==="awaiting-approval")?{type:"transaction",id:t.transaction.id}:null;if("chains"in t&&t.chains!=null){let e=t.chains[n];if(e!=null&&(e.status==="pending"||e.status==="awaiting-approval"))return{type:"signature",id:e.id}}return null}function y(t,n){let e=o(s({},t),{status:n});return t.locator.indexOf(":")===-1&&(t.type==="api-key"?e.locator=t.locator:(e.locator=`external-wallet:${t.locator}`,e.type="external-wallet")),e}export{l as a,d as b,i as c,y as d};
1
+ import{a as o,b as a}from"./chunk-NU7VF7MC.js";function l(t){switch(t.type){case"passkey":return{type:"passkey",id:t.id,name:t.name,publicKey:t.publicKey,validatorContractVersion:t.validatorContractVersion,locator:t.locator};case"api-key":return{type:"api-key",address:t.address,locator:t.locator};case"external-wallet":return{type:"external-wallet",address:t.address,locator:t.locator};case"email":return{type:"email",email:t.email,address:t.address,locator:t.locator};case"phone":return{type:"phone",phone:t.phone,address:t.address,locator:t.locator};case"device":return{type:"device",publicKey:t.publicKey,locator:t.locator};case"server":return{type:"server",address:t.address,locator:t.locator};default:throw new Error(`Unknown signer type: ${t.type}`)}}function i(t,n){let e=l(t),s="scopes"in t?t.scopes:void 0;if(n==="solana"||n==="stellar"){let r="success";return"transaction"in t&&t.transaction!=null&&(r=t.transaction.status),o(a(o({},e),{status:r}),s!=null&&{scopes:s})}if("chains"in t&&t.chains!=null&&Object.keys(t.chains).length>0){let r=t.chains[n];return r==null?null:o(a(o({},e),{status:r.status}),s!=null&&{scopes:s})}return o(a(o({},e),{status:"success"}),s!=null&&{scopes:s})}function d(t,n){if(n==="solana"||n==="stellar")return"transaction"in t&&t.transaction!=null&&(t.transaction.status==="pending"||t.transaction.status==="awaiting-approval")?{type:"transaction",id:t.transaction.id}:null;if("chains"in t&&t.chains!=null){let e=t.chains[n];if(e!=null&&(e.status==="pending"||e.status==="awaiting-approval"))return{type:"onChain"in e?"transaction":"signature",id:e.id}}return null}function y(t,n){let e=a(o({},t),{status:n});return t.locator.indexOf(":")===-1&&(t.type==="api-key"?e.locator=t.locator:(e.locator=`external-wallet:${t.locator}`,e.type="external-wallet")),e}export{l as a,i as b,d as c,y as d};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5X4EOJFGcjs = require('./chunk-5X4EOJFG.cjs');var _chunkHRUMWG2Fcjs = require('./chunk-HRUMWG2F.cjs');var _chunkIR5WN6FQcjs = require('./chunk-IR5WN6FQ.cjs');var _chunkGEY574THcjs = require('./chunk-GEY574TH.cjs');var _chunkUE3WVHTMcjs = require('./chunk-UE3WVHTM.cjs');var _chunk3F4FMM3Rcjs = require('./chunk-3F4FMM3R.cjs');var _chunkJDQXT4REcjs = require('./chunk-JDQXT4RE.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var _chains = require('viem/chains');var w=[_commonsdkbase.BlockchainIncludingTestnet.ABSTRACT_TESTNET,_commonsdkbase.BlockchainIncludingTestnet.ARBITRUM_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.BASE_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.CURTIS,_commonsdkbase.BlockchainIncludingTestnet.ETHEREUM_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.FLOW_TESTNET,_commonsdkbase.BlockchainIncludingTestnet.MANTLE_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.MODE_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.OPTIMISM_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.PLUME_TESTNET,_commonsdkbase.BlockchainIncludingTestnet.POLYGON_AMOY,_commonsdkbase.BlockchainIncludingTestnet.SCROLL_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.SEI_ATLANTIC_2_TESTNET,_commonsdkbase.BlockchainIncludingTestnet.STORY_TESTNET,_commonsdkbase.BlockchainIncludingTestnet.WORLD_CHAIN_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.ZORA_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.ARC_TESTNET,_commonsdkbase.BlockchainIncludingTestnet.TEMPO_TESTNET],D=[_commonsdkbase.BlockchainIncludingTestnet.ABSTRACT,_commonsdkbase.BlockchainIncludingTestnet.APECHAIN,_commonsdkbase.BlockchainIncludingTestnet.ARBITRUM,_commonsdkbase.BlockchainIncludingTestnet.ARBITRUMNOVA,_commonsdkbase.BlockchainIncludingTestnet.BASE,_commonsdkbase.BlockchainIncludingTestnet.BSC,_commonsdkbase.BlockchainIncludingTestnet.ETHEREUM,_commonsdkbase.BlockchainIncludingTestnet.FLOW,_commonsdkbase.BlockchainIncludingTestnet.MANTLE,_commonsdkbase.BlockchainIncludingTestnet.MODE,_commonsdkbase.BlockchainIncludingTestnet.OPTIMISM,_commonsdkbase.BlockchainIncludingTestnet.PLUME,_commonsdkbase.BlockchainIncludingTestnet.POLYGON,_commonsdkbase.BlockchainIncludingTestnet.SCROLL,_commonsdkbase.BlockchainIncludingTestnet.SEI_PACIFIC_1,_commonsdkbase.BlockchainIncludingTestnet.SHAPE,_commonsdkbase.BlockchainIncludingTestnet.STORY,_commonsdkbase.BlockchainIncludingTestnet.TEMPO,_commonsdkbase.BlockchainIncludingTestnet.WORLDCHAIN,_commonsdkbase.BlockchainIncludingTestnet.ZORA];function X(t){switch(t){case _commonsdkbase.BlockchainIncludingTestnet.BASE_SEPOLIA:return _chains.baseSepolia;case _commonsdkbase.BlockchainIncludingTestnet.BASE:return _chains.base;case _commonsdkbase.BlockchainIncludingTestnet.POLYGON_AMOY:return _chains.polygonAmoy;case _commonsdkbase.BlockchainIncludingTestnet.POLYGON:return _chains.polygon;case _commonsdkbase.BlockchainIncludingTestnet.OPTIMISM_SEPOLIA:return _chains.optimismSepolia;case _commonsdkbase.BlockchainIncludingTestnet.OPTIMISM:return _chains.optimism;case _commonsdkbase.BlockchainIncludingTestnet.ARBITRUM_SEPOLIA:return _chains.arbitrumSepolia;case _commonsdkbase.BlockchainIncludingTestnet.ARBITRUM:return _chains.arbitrum;case _commonsdkbase.BlockchainIncludingTestnet.ARBITRUMNOVA:return _chains.arbitrumNova;case _commonsdkbase.BlockchainIncludingTestnet.STORY_TESTNET:return _chunkGEY574THcjs.a;case _commonsdkbase.BlockchainIncludingTestnet.STORY:return _chunkIR5WN6FQcjs.a;case _commonsdkbase.BlockchainIncludingTestnet.MODE_SEPOLIA:return _chains.modeTestnet;case _commonsdkbase.BlockchainIncludingTestnet.MODE:return _chains.mode;case _commonsdkbase.BlockchainIncludingTestnet.BSC:return _chains.bsc;case _commonsdkbase.BlockchainIncludingTestnet.SHAPE:return _chains.shape;case _commonsdkbase.BlockchainIncludingTestnet.ZORA:return _chains.zora;case _commonsdkbase.BlockchainIncludingTestnet.ZORA_SEPOLIA:return _chains.zoraSepolia;case _commonsdkbase.BlockchainIncludingTestnet.ETHEREUM_SEPOLIA:return _chains.sepolia;case _commonsdkbase.BlockchainIncludingTestnet.ETHEREUM:return _chains.mainnet;case _commonsdkbase.BlockchainIncludingTestnet.FLOW:return _chains.flowMainnet;case _commonsdkbase.BlockchainIncludingTestnet.FLOW_TESTNET:return _chains.flowTestnet;case _commonsdkbase.BlockchainIncludingTestnet.PLUME_TESTNET:return _chains.plumeTestnet;case _commonsdkbase.BlockchainIncludingTestnet.PLUME:return _chains.plume;case _commonsdkbase.BlockchainIncludingTestnet.ARC_TESTNET:return _chunkHRUMWG2Fcjs.a;case _commonsdkbase.BlockchainIncludingTestnet.TEMPO:return _chunkUE3WVHTMcjs.a;case _commonsdkbase.BlockchainIncludingTestnet.TEMPO_TESTNET:return _chunk5X4EOJFGcjs.a;case _commonsdkbase.BlockchainIncludingTestnet.ABSTRACT:case _commonsdkbase.BlockchainIncludingTestnet.ABSTRACT_TESTNET:case _commonsdkbase.BlockchainIncludingTestnet.APECHAIN:case _commonsdkbase.BlockchainIncludingTestnet.MANTLE:case _commonsdkbase.BlockchainIncludingTestnet.MANTLE_SEPOLIA:case _commonsdkbase.BlockchainIncludingTestnet.SCROLL:case _commonsdkbase.BlockchainIncludingTestnet.SCROLL_SEPOLIA:case _commonsdkbase.BlockchainIncludingTestnet.SEI_PACIFIC_1:case _commonsdkbase.BlockchainIncludingTestnet.SEI_ATLANTIC_2_TESTNET:case _commonsdkbase.BlockchainIncludingTestnet.CURTIS:case _commonsdkbase.BlockchainIncludingTestnet.WORLDCHAIN:case _commonsdkbase.BlockchainIncludingTestnet.WORLD_CHAIN_SEPOLIA:throw new Error(`Chain ${t} is not yet supported in toViemChain function. Please add the appropriate viem chain definition.`);default:throw new Error(`Unknown chain: ${t}`)}}function I(t){return w.includes(t)}function C(t){return D.includes(t)}var Y={[_commonsdkbase.BlockchainIncludingTestnet.ABSTRACT]:_commonsdkbase.BlockchainIncludingTestnet.ABSTRACT_TESTNET,[_commonsdkbase.BlockchainIncludingTestnet.APECHAIN]:_commonsdkbase.BlockchainIncludingTestnet.CURTIS,[_commonsdkbase.BlockchainIncludingTestnet.ARBITRUM]:_commonsdkbase.BlockchainIncludingTestnet.ARBITRUM_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.BASE]:_commonsdkbase.BlockchainIncludingTestnet.BASE_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.ETHEREUM]:_commonsdkbase.BlockchainIncludingTestnet.ETHEREUM_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.FLOW]:_commonsdkbase.BlockchainIncludingTestnet.FLOW_TESTNET,[_commonsdkbase.BlockchainIncludingTestnet.MANTLE]:_commonsdkbase.BlockchainIncludingTestnet.MANTLE_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.MODE]:_commonsdkbase.BlockchainIncludingTestnet.MODE_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.OPTIMISM]:_commonsdkbase.BlockchainIncludingTestnet.OPTIMISM_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.PLUME]:_commonsdkbase.BlockchainIncludingTestnet.PLUME_TESTNET,[_commonsdkbase.BlockchainIncludingTestnet.POLYGON]:_commonsdkbase.BlockchainIncludingTestnet.POLYGON_AMOY,[_commonsdkbase.BlockchainIncludingTestnet.SCROLL]:_commonsdkbase.BlockchainIncludingTestnet.SCROLL_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.SEI_PACIFIC_1]:_commonsdkbase.BlockchainIncludingTestnet.SEI_ATLANTIC_2_TESTNET,[_commonsdkbase.BlockchainIncludingTestnet.STORY]:_commonsdkbase.BlockchainIncludingTestnet.STORY_TESTNET,[_commonsdkbase.BlockchainIncludingTestnet.WORLDCHAIN]:_commonsdkbase.BlockchainIncludingTestnet.WORLD_CHAIN_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.ZORA]:_commonsdkbase.BlockchainIncludingTestnet.ZORA_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.TEMPO]:_commonsdkbase.BlockchainIncludingTestnet.TEMPO_TESTNET};function g(t){return Y[t]}function F(t){return t==="solana"||t==="stellar"||I(t)||C(t)}function ee(t,a){if(!F(t))throw new (0, _chunk3F4FMM3Rcjs.c)(`Unknown chain "${t}". Please use a supported chain name (e.g. "base-sepolia", "polygon", "solana", "stellar").`);if(t==="solana"||t==="stellar")return t;let r=t,T=a===_commonsdkbase.APIKeyEnvironmentPrefix.PRODUCTION;if(T&&I(r))throw new (0, _chunk3F4FMM3Rcjs.b)(`Chain "${t}" is a testnet chain and cannot be used in production. Please use a mainnet chain instead.`);if(!T&&C(r)){let n=g(r);if(n!=null)return _chunkJDQXT4REcjs.a.debug("validateChainForEnvironment.autoConverted",{chain:t,convertedTo:n,environment:a,message:`Chain "${t}" is a mainnet chain and cannot be used in ${a} environment. Automatically converted to "${n}".`}),n;_chunkJDQXT4REcjs.a.debug("validateChainForEnvironment.mismatch",{chain:t,environment:a,message:`Chain "${t}" is a mainnet chain and should not be used in ${a} environment. No testnet equivalent is available. Please use a testnet chain instead.`})}return t}exports.a = X; exports.b = I; exports.c = C; exports.d = g; exports.e = F; exports.f = ee;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5X4EOJFGcjs = require('./chunk-5X4EOJFG.cjs');var _chunkHRUMWG2Fcjs = require('./chunk-HRUMWG2F.cjs');var _chunkIR5WN6FQcjs = require('./chunk-IR5WN6FQ.cjs');var _chunkGEY574THcjs = require('./chunk-GEY574TH.cjs');var _chunkUE3WVHTMcjs = require('./chunk-UE3WVHTM.cjs');var _chunk3F4FMM3Rcjs = require('./chunk-3F4FMM3R.cjs');var _chunkXRLBGNNWcjs = require('./chunk-XRLBGNNW.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var _chains = require('viem/chains');var w=[_commonsdkbase.BlockchainIncludingTestnet.ABSTRACT_TESTNET,_commonsdkbase.BlockchainIncludingTestnet.ARBITRUM_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.BASE_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.CURTIS,_commonsdkbase.BlockchainIncludingTestnet.ETHEREUM_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.FLOW_TESTNET,_commonsdkbase.BlockchainIncludingTestnet.MANTLE_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.MODE_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.OPTIMISM_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.PLUME_TESTNET,_commonsdkbase.BlockchainIncludingTestnet.POLYGON_AMOY,_commonsdkbase.BlockchainIncludingTestnet.SCROLL_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.SEI_ATLANTIC_2_TESTNET,_commonsdkbase.BlockchainIncludingTestnet.STORY_TESTNET,_commonsdkbase.BlockchainIncludingTestnet.WORLD_CHAIN_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.ZORA_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.ARC_TESTNET,_commonsdkbase.BlockchainIncludingTestnet.TEMPO_TESTNET],D=[_commonsdkbase.BlockchainIncludingTestnet.ABSTRACT,_commonsdkbase.BlockchainIncludingTestnet.APECHAIN,_commonsdkbase.BlockchainIncludingTestnet.ARBITRUM,_commonsdkbase.BlockchainIncludingTestnet.ARBITRUMNOVA,_commonsdkbase.BlockchainIncludingTestnet.BASE,_commonsdkbase.BlockchainIncludingTestnet.BSC,_commonsdkbase.BlockchainIncludingTestnet.ETHEREUM,_commonsdkbase.BlockchainIncludingTestnet.FLOW,_commonsdkbase.BlockchainIncludingTestnet.MANTLE,_commonsdkbase.BlockchainIncludingTestnet.MODE,_commonsdkbase.BlockchainIncludingTestnet.OPTIMISM,_commonsdkbase.BlockchainIncludingTestnet.PLUME,_commonsdkbase.BlockchainIncludingTestnet.POLYGON,_commonsdkbase.BlockchainIncludingTestnet.SCROLL,_commonsdkbase.BlockchainIncludingTestnet.SEI_PACIFIC_1,_commonsdkbase.BlockchainIncludingTestnet.SHAPE,_commonsdkbase.BlockchainIncludingTestnet.STORY,_commonsdkbase.BlockchainIncludingTestnet.TEMPO,_commonsdkbase.BlockchainIncludingTestnet.WORLDCHAIN,_commonsdkbase.BlockchainIncludingTestnet.ZORA];function X(t){switch(t){case _commonsdkbase.BlockchainIncludingTestnet.BASE_SEPOLIA:return _chains.baseSepolia;case _commonsdkbase.BlockchainIncludingTestnet.BASE:return _chains.base;case _commonsdkbase.BlockchainIncludingTestnet.POLYGON_AMOY:return _chains.polygonAmoy;case _commonsdkbase.BlockchainIncludingTestnet.POLYGON:return _chains.polygon;case _commonsdkbase.BlockchainIncludingTestnet.OPTIMISM_SEPOLIA:return _chains.optimismSepolia;case _commonsdkbase.BlockchainIncludingTestnet.OPTIMISM:return _chains.optimism;case _commonsdkbase.BlockchainIncludingTestnet.ARBITRUM_SEPOLIA:return _chains.arbitrumSepolia;case _commonsdkbase.BlockchainIncludingTestnet.ARBITRUM:return _chains.arbitrum;case _commonsdkbase.BlockchainIncludingTestnet.ARBITRUMNOVA:return _chains.arbitrumNova;case _commonsdkbase.BlockchainIncludingTestnet.STORY_TESTNET:return _chunkGEY574THcjs.a;case _commonsdkbase.BlockchainIncludingTestnet.STORY:return _chunkIR5WN6FQcjs.a;case _commonsdkbase.BlockchainIncludingTestnet.MODE_SEPOLIA:return _chains.modeTestnet;case _commonsdkbase.BlockchainIncludingTestnet.MODE:return _chains.mode;case _commonsdkbase.BlockchainIncludingTestnet.BSC:return _chains.bsc;case _commonsdkbase.BlockchainIncludingTestnet.SHAPE:return _chains.shape;case _commonsdkbase.BlockchainIncludingTestnet.ZORA:return _chains.zora;case _commonsdkbase.BlockchainIncludingTestnet.ZORA_SEPOLIA:return _chains.zoraSepolia;case _commonsdkbase.BlockchainIncludingTestnet.ETHEREUM_SEPOLIA:return _chains.sepolia;case _commonsdkbase.BlockchainIncludingTestnet.ETHEREUM:return _chains.mainnet;case _commonsdkbase.BlockchainIncludingTestnet.FLOW:return _chains.flowMainnet;case _commonsdkbase.BlockchainIncludingTestnet.FLOW_TESTNET:return _chains.flowTestnet;case _commonsdkbase.BlockchainIncludingTestnet.PLUME_TESTNET:return _chains.plumeTestnet;case _commonsdkbase.BlockchainIncludingTestnet.PLUME:return _chains.plume;case _commonsdkbase.BlockchainIncludingTestnet.ARC_TESTNET:return _chunkHRUMWG2Fcjs.a;case _commonsdkbase.BlockchainIncludingTestnet.TEMPO:return _chunkUE3WVHTMcjs.a;case _commonsdkbase.BlockchainIncludingTestnet.TEMPO_TESTNET:return _chunk5X4EOJFGcjs.a;case _commonsdkbase.BlockchainIncludingTestnet.ABSTRACT:case _commonsdkbase.BlockchainIncludingTestnet.ABSTRACT_TESTNET:case _commonsdkbase.BlockchainIncludingTestnet.APECHAIN:case _commonsdkbase.BlockchainIncludingTestnet.MANTLE:case _commonsdkbase.BlockchainIncludingTestnet.MANTLE_SEPOLIA:case _commonsdkbase.BlockchainIncludingTestnet.SCROLL:case _commonsdkbase.BlockchainIncludingTestnet.SCROLL_SEPOLIA:case _commonsdkbase.BlockchainIncludingTestnet.SEI_PACIFIC_1:case _commonsdkbase.BlockchainIncludingTestnet.SEI_ATLANTIC_2_TESTNET:case _commonsdkbase.BlockchainIncludingTestnet.CURTIS:case _commonsdkbase.BlockchainIncludingTestnet.WORLDCHAIN:case _commonsdkbase.BlockchainIncludingTestnet.WORLD_CHAIN_SEPOLIA:throw new Error(`Chain ${t} is not yet supported in toViemChain function. Please add the appropriate viem chain definition.`);default:throw new Error(`Unknown chain: ${t}`)}}function I(t){return w.includes(t)}function C(t){return D.includes(t)}var Y={[_commonsdkbase.BlockchainIncludingTestnet.ABSTRACT]:_commonsdkbase.BlockchainIncludingTestnet.ABSTRACT_TESTNET,[_commonsdkbase.BlockchainIncludingTestnet.APECHAIN]:_commonsdkbase.BlockchainIncludingTestnet.CURTIS,[_commonsdkbase.BlockchainIncludingTestnet.ARBITRUM]:_commonsdkbase.BlockchainIncludingTestnet.ARBITRUM_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.BASE]:_commonsdkbase.BlockchainIncludingTestnet.BASE_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.ETHEREUM]:_commonsdkbase.BlockchainIncludingTestnet.ETHEREUM_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.FLOW]:_commonsdkbase.BlockchainIncludingTestnet.FLOW_TESTNET,[_commonsdkbase.BlockchainIncludingTestnet.MANTLE]:_commonsdkbase.BlockchainIncludingTestnet.MANTLE_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.MODE]:_commonsdkbase.BlockchainIncludingTestnet.MODE_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.OPTIMISM]:_commonsdkbase.BlockchainIncludingTestnet.OPTIMISM_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.PLUME]:_commonsdkbase.BlockchainIncludingTestnet.PLUME_TESTNET,[_commonsdkbase.BlockchainIncludingTestnet.POLYGON]:_commonsdkbase.BlockchainIncludingTestnet.POLYGON_AMOY,[_commonsdkbase.BlockchainIncludingTestnet.SCROLL]:_commonsdkbase.BlockchainIncludingTestnet.SCROLL_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.SEI_PACIFIC_1]:_commonsdkbase.BlockchainIncludingTestnet.SEI_ATLANTIC_2_TESTNET,[_commonsdkbase.BlockchainIncludingTestnet.STORY]:_commonsdkbase.BlockchainIncludingTestnet.STORY_TESTNET,[_commonsdkbase.BlockchainIncludingTestnet.WORLDCHAIN]:_commonsdkbase.BlockchainIncludingTestnet.WORLD_CHAIN_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.ZORA]:_commonsdkbase.BlockchainIncludingTestnet.ZORA_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.TEMPO]:_commonsdkbase.BlockchainIncludingTestnet.TEMPO_TESTNET};function g(t){return Y[t]}function F(t){return t==="solana"||t==="stellar"||I(t)||C(t)}function ee(t,a){if(!F(t))throw new (0, _chunk3F4FMM3Rcjs.c)(`Unknown chain "${t}". Please use a supported chain name (e.g. "base-sepolia", "polygon", "solana", "stellar").`);if(t==="solana"||t==="stellar")return t;let r=t,T=a===_commonsdkbase.APIKeyEnvironmentPrefix.PRODUCTION;if(T&&I(r))throw new (0, _chunk3F4FMM3Rcjs.b)(`Chain "${t}" is a testnet chain and cannot be used in production. Please use a mainnet chain instead.`);if(!T&&C(r)){let n=g(r);if(n!=null)return _chunkXRLBGNNWcjs.a.debug("validateChainForEnvironment.autoConverted",{chain:t,convertedTo:n,environment:a,message:`Chain "${t}" is a mainnet chain and cannot be used in ${a} environment. Automatically converted to "${n}".`}),n;_chunkXRLBGNNWcjs.a.debug("validateChainForEnvironment.mismatch",{chain:t,environment:a,message:`Chain "${t}" is a mainnet chain and should not be used in ${a} environment. No testnet equivalent is available. Please use a testnet chain instead.`})}return t}exports.a = X; exports.b = I; exports.c = C; exports.d = g; exports.e = F; exports.f = ee;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkATIC4ENGcjs = require('./chunk-ATIC4ENG.cjs');var _chunkQPCZFIUVcjs = require('./chunk-QPCZFIUV.cjs');var _chunkXRLBGNNWcjs = require('./chunk-XRLBGNNW.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var m=class{constructor(i){this.config=i;this._needsAuth=!0;this._authPromise=null;this._initializationPromise=null;this._onboardingConnectionGeneration=null;typeof window!="undefined"&&(this._initializationPromise=this.initialize()),this.type=this.config.type}locator(){return this.config.locator}address(){return this.config.address}initialize(){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){try{if(this.config.clientTEEConnection==null){let i=_commonsdkbase.validateAPIKey.call(void 0, this.config.crossmint.apiKey);if(!i.isValid)throw new Error("Invalid API key");let t=new (0, _chunkATIC4ENGcjs.a)({environment:i.environment});this.config.clientTEEConnection=yield t.initialize()}}finally{this._initializationPromise=null}})}getTEEConnection(){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){if(this.config.clientTEEConnection==null){if(this._initializationPromise){if(yield this._initializationPromise,this.config.clientTEEConnection==null)throw new Error("Failed to initialize TEE connection");return this.config.clientTEEConnection}this._initializationPromise=this.initializeTEEConnection();try{yield this._initializationPromise}finally{this._initializationPromise=null}}if(this.config.clientTEEConnection==null)throw new Error("TEE connection is not initialized");return this.config.clientTEEConnection})}initializeTEEConnection(){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){_chunkXRLBGNNWcjs.a.info("TEE connection not initialized, initializing now");let i=_commonsdkbase.validateAPIKey.call(void 0, this.config.crossmint.apiKey);if(!i.isValid)throw new Error("Invalid API key");let t=new (0, _chunkATIC4ENGcjs.a)({environment:i.environment});if(this.config.clientTEEConnection=yield t.initialize(),this.config.clientTEEConnection==null)throw new Error("Failed to initialize TEE connection");_chunkXRLBGNNWcjs.a.info("TEE connection initialized successfully")})}handleAuthRequired(){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var d;let i=yield this.getTEEConnection();if(this.config.onAuthRequired==null)throw new Error(`${this.type} signer requires the onAuthRequired callback to handle OTP verification. This callback manages the authentication flow (sending OTP and verifying user input). If using our React/React Native SDK, this is handled automatically by the provider. For other environments, implement: onAuthRequired: (needsAuth, sendOtp, verifyOtp, reject) => { /* your UI logic */ }`);_chunkXRLBGNNWcjs.a.info("get-status: sending request");let t=Date.now(),e=yield i.sendAction({event:"request:get-status",responseEvent:"response:get-status",data:{authData:{jwt:(d=this.config.crossmint.jwt)!=null?d:"",apiKey:this.config.crossmint.apiKey}},options:l}),n=Date.now()-t;if((e==null?void 0:e.status)!=="success"){let c=(e==null?void 0:e.status)==="error"&&e.error||"Failed to retrieve signer status",p=(e==null?void 0:e.status)==="error"?e.code:void 0;throw _chunkXRLBGNNWcjs.a.error("get-status: failed",{status:e==null?void 0:e.status,error:(e==null?void 0:e.status)==="error"?e.error:void 0,code:p,durationMs:n}),new (0, _chunkQPCZFIUVcjs.c)(c,p)}if(_chunkXRLBGNNWcjs.a.info("get-status: response received",{signerStatus:e.signerStatus,durationMs:n}),e.signerStatus==="ready"){this._needsAuth=!1;return}else this._needsAuth=!0;_chunkXRLBGNNWcjs.a.info("Auth required, initiating OTP flow",{needsAuth:this._needsAuth});let{promise:s,resolve:o,reject:a}=this.createAuthPromise();if(this._authPromise={promise:s,resolve:o,reject:a},this.config.onAuthRequired)try{yield this.config.onAuthRequired(this.config.type,this.locator(),this._needsAuth,()=>this.sendMessageWithOtp(),c=>this.verifyOtp(c),()=>_chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){_chunkXRLBGNNWcjs.a.info("Auth rejected",{authRejected:!0}),this._needsAuth=!1,this.config.onAuthRequired!=null&&(yield this.config.onAuthRequired(this.config.type,this.locator(),this._needsAuth,()=>this.sendMessageWithOtp(),c=>this.verifyOtp(c),()=>{var c;return(c=this._authPromise)==null?void 0:c.reject(new _chunkQPCZFIUVcjs.a)})),a(new _chunkQPCZFIUVcjs.a)}))}catch(c){_chunkXRLBGNNWcjs.a.error("handleAuthRequired error",{error:c}),a(c)}try{yield s}catch(c){throw _chunkXRLBGNNWcjs.a.error("handleAuthRequired promise error",{error:c}),c}})}ensureAuthenticated(){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){this.config.resetSignerFrame!=null&&(yield this.config.resetSignerFrame()),yield this.handleAuthRequired()})}getJwtOrThrow(){let i=this.config.crossmint.jwt;if(i==null)throw new Error("JWT is required");return i}createAuthPromise(){let i,t;return{promise:new Promise((n,s)=>{i=n,t=s}),resolve:i,reject:t}}sendMessageWithOtp(){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var o;let i=yield this.getTEEConnection(),t=this.getAuthId();_chunkXRLBGNNWcjs.a.info("start-onboarding: sending request");let e=Date.now(),n=yield i.sendAction({event:"request:start-onboarding",responseEvent:"response:start-onboarding",data:{authData:{jwt:(o=this.config.crossmint.jwt)!=null?o:"",apiKey:this.config.crossmint.apiKey},data:{authId:t}},options:l}),s=Date.now()-e;if(this._onboardingConnectionGeneration=i.connectionGeneration,_chunkXRLBGNNWcjs.a.info("start-onboarding: response received",{status:n==null?void 0:n.status,durationMs:s}),(n==null?void 0:n.status)==="success"&&n.signerStatus==="ready"){this._needsAuth=!1;return}if((n==null?void 0:n.status)==="error")throw _chunkXRLBGNNWcjs.a.error("start-onboarding: failed",{error:n.error,code:n.code}),new (0, _chunkQPCZFIUVcjs.b)(n.error||"Failed to initiate OTP process.",n.code)})}getAuthId(){return this.config.type==="email"?`email:${this.config.email}`:`phone:${this.config.phone}`}verifyOtp(i){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var s,o;let t;try{let a=yield this.getTEEConnection();_chunkXRLBGNNWcjs.a.info("complete-onboarding: sending request");let d=Date.now();t=yield a.sendAction({event:"request:complete-onboarding",responseEvent:"response:complete-onboarding",data:{authData:{jwt:(s=this.config.crossmint.jwt)!=null?s:"",apiKey:this.config.crossmint.apiKey},data:{onboardingAuthentication:{encryptedOtp:i}}},options:l}),_chunkXRLBGNNWcjs.a.info("complete-onboarding: response received",{status:t==null?void 0:t.status,durationMs:Date.now()-d})}catch(a){return _chunkXRLBGNNWcjs.a.error("complete-onboarding: error",{error:a}),yield this.handleOnboardingVerificationFailure(a)}if((t==null?void 0:t.status)==="success"){this._needsAuth=!1,this.config.onAuthRequired!=null&&(yield this.config.onAuthRequired(this.config.type,this.locator(),this._needsAuth,()=>this.sendMessageWithOtp(),a=>this.verifyOtp(a),()=>{var a;return(a=this._authPromise)==null?void 0:a.reject(new _chunkQPCZFIUVcjs.a)})),(o=this._authPromise)==null||o.resolve();return}_chunkXRLBGNNWcjs.a.error("complete-onboarding: OTP validation failed",{status:t==null?void 0:t.status,error:(t==null?void 0:t.status)==="error"?t.error:void 0,code:(t==null?void 0:t.status)==="error"?t.code:void 0});let e=(t==null?void 0:t.status)==="error"&&t.error||"Failed to validate encrypted OTP",n=(t==null?void 0:t.status)==="error"?t.code:void 0;return yield this.handleOnboardingVerificationFailure(new (0, _chunkQPCZFIUVcjs.b)(e,n))})}handleOnboardingVerificationFailure(i){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var n,s,o;this._needsAuth=!0;let t=this.config.clientTEEConnection;if(this._onboardingConnectionGeneration!=null&&t!=null&&t.connectionGeneration!==this._onboardingConnectionGeneration){_chunkXRLBGNNWcjs.a.warn("tee.signer.onboarding.reissued",{reason:"signer frame reloaded mid-onboarding, re-issuing OTP",onboardingGeneration:this._onboardingConnectionGeneration,currentGeneration:t==null?void 0:t.connectionGeneration});try{yield this.sendMessageWithOtp()}catch(a){throw(n=this._authPromise)==null||n.reject(a),a}if(!this._needsAuth){(s=this._authPromise)==null||s.resolve();return}throw new _chunkQPCZFIUVcjs.e}throw(o=this._authPromise)==null||o.reject(i),i})}_exportPrivateKey(i,t){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){yield this.ensureAuthenticated();let e=this.getJwtOrThrow(),{scheme:n,encoding:s}=this.getChainKeyParams();if(t!=null){let a=i.on("event:key-exported",d=>{i.off(a),d.status==="success"&&Promise.resolve().then(()=>t()).catch(()=>{console.error("[NCS Signer] onExport callback error")})})}let o=yield i.sendAction({event:"request:export-signer",responseEvent:"response:export-signer",data:{authData:{jwt:e,apiKey:this.config.crossmint.apiKey},data:{scheme:n,encoding:s,walletAddress:this.config.address,authId:this.getAuthId()}},options:l});if((o==null?void 0:o.status)==="error")throw _chunkXRLBGNNWcjs.a.error("export-signer: failed",{error:o.error,code:o.code}),new (0, _chunkQPCZFIUVcjs.d)(o.error||"Failed to export private key",o.code)})}};_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkXRLBGNNWcjs.a,methodName:"handleAuthRequired"})],m.prototype,"handleAuthRequired",1);var l={timeoutMs:3e4};exports.a = m; exports.b = l;