@crossmint/wallets-sdk 1.11.0 → 1.12.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 (247) 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-6IV3GB5W.js → chunk-2277DKO3.js} +1 -1
  36. package/dist/chunk-26DL7XRG.js +1 -0
  37. package/dist/{chunk-SGP5B33N.js → chunk-3SHAB7GH.js} +1 -1
  38. package/dist/{chunk-AUDTBFZ4.cjs → chunk-3WJUXFU2.cjs} +1 -1
  39. package/dist/{chunk-OV256XVK.cjs → chunk-44ICOOCJ.cjs} +1 -1
  40. package/dist/{chunk-TJBIBZMF.js → chunk-4ILFMPNK.js} +1 -1
  41. package/dist/{chunk-KZ7LB6ZV.js → chunk-53JN7AMK.js} +1 -1
  42. package/dist/{chunk-P4EW7S5I.cjs → chunk-5BRX4CFK.cjs} +1 -1
  43. package/dist/chunk-5VUIA6TB.cjs +1 -0
  44. package/dist/{chunk-WO4ZWJT6.js → chunk-BDCQ4HVW.js} +1 -1
  45. package/dist/{chunk-UPSASDJP.cjs → chunk-BM6GYJSE.cjs} +1 -1
  46. package/dist/{chunk-KSN4TWLX.js → chunk-CB3YEJ7F.js} +1 -1
  47. package/dist/chunk-ECHVBCCM.js +1 -0
  48. package/dist/{chunk-NUIG3XY3.cjs → chunk-FJYRJSKU.cjs} +1 -1
  49. package/dist/{chunk-PEY3R7XG.cjs → chunk-GIYB3U37.cjs} +1 -1
  50. package/dist/chunk-HSLCNCPW.cjs +1 -0
  51. package/dist/{chunk-UF5HZQUO.cjs → chunk-IX5TSD73.cjs} +1 -1
  52. package/dist/{chunk-IDRQPLGQ.cjs → chunk-J2C3XP4Z.cjs} +1 -1
  53. package/dist/{chunk-6GZQZEGQ.cjs → chunk-J5CHOVJL.cjs} +1 -1
  54. package/dist/{chunk-3A424HCV.js → chunk-JEKHYLBB.js} +1 -1
  55. package/dist/{chunk-3N7PKPCH.cjs → chunk-JJVNOMYX.cjs} +1 -1
  56. package/dist/{chunk-F3NUWFQW.js → chunk-KJNGLQC7.js} +1 -1
  57. package/dist/{chunk-P7KLEZYV.cjs → chunk-L5X5RA7E.cjs} +1 -1
  58. package/dist/{chunk-6ZAGINES.cjs → chunk-LJNSIXGN.cjs} +1 -1
  59. package/dist/{chunk-VCX2M3JY.cjs → chunk-LKEPKOKU.cjs} +1 -1
  60. package/dist/{chunk-EFBUJ2BS.js → chunk-M3IEG5GA.js} +1 -1
  61. package/dist/{chunk-SNBCG5HR.cjs → chunk-MGQGQXRP.cjs} +1 -1
  62. package/dist/{chunk-7SGXWFCJ.cjs → chunk-MYIY3CX7.cjs} +1 -1
  63. package/dist/{chunk-MHKIVDKZ.cjs → chunk-N7DIMQBP.cjs} +1 -1
  64. package/dist/{chunk-URQQBUUX.js → chunk-N7Z3C5RJ.js} +1 -1
  65. package/dist/{chunk-Q3LD5CYJ.cjs → chunk-NL4MRKYW.cjs} +1 -1
  66. package/dist/{chunk-6U5MZQQP.js → chunk-NUGL76QG.js} +1 -1
  67. package/dist/{chunk-WTJC5QBH.cjs → chunk-OHTCLNE3.cjs} +1 -1
  68. package/dist/{chunk-RFWY44CJ.js → chunk-OQN2SFDC.js} +1 -1
  69. package/dist/{chunk-HIHX5FRO.js → chunk-OUZECW5T.js} +1 -1
  70. package/dist/{chunk-65BIFI5E.cjs → chunk-P3SMYLDM.cjs} +1 -1
  71. package/dist/{chunk-7O3W4JAP.cjs → chunk-PSK7FYV7.cjs} +1 -1
  72. package/dist/{chunk-TY33CSCI.js → chunk-QVE2LOBH.js} +1 -1
  73. package/dist/chunk-S3PBSOOZ.cjs +1 -0
  74. package/dist/chunk-SCEZVF7J.js +1 -0
  75. package/dist/{chunk-ZUBX7T2L.js → chunk-SZXFHFA5.js} +1 -1
  76. package/dist/{chunk-F3CW7X6C.js → chunk-T2R4SPKJ.js} +1 -1
  77. package/dist/{chunk-3TZJ6D4G.js → chunk-TZGYISF7.js} +1 -1
  78. package/dist/{chunk-C2LCF6GA.js → chunk-UTZP5A65.js} +1 -1
  79. package/dist/chunk-W36RYDND.js +1 -0
  80. package/dist/chunk-WOQNCBUX.cjs +1 -0
  81. package/dist/{chunk-N7SKSCSW.js → chunk-WQDLMGEG.js} +1 -1
  82. package/dist/{chunk-677M3EWV.cjs → chunk-WTLEFDHS.cjs} +1 -1
  83. package/dist/{chunk-3CEGPUJH.js → chunk-XHANQPKI.js} +1 -1
  84. package/dist/{chunk-HE4BTHTY.cjs → chunk-XN7S5JJY.cjs} +1 -1
  85. package/dist/{chunk-EGX2IXWU.js → chunk-YRX44YXB.js} +1 -1
  86. package/dist/{chunk-KVGWACFA.js → chunk-ZF4ENDFP.js} +1 -1
  87. package/dist/index.cjs +1 -1
  88. package/dist/index.d.cts +1 -1
  89. package/dist/index.d.ts +1 -1
  90. package/dist/index.js +1 -1
  91. package/dist/logger/index.cjs +1 -1
  92. package/dist/logger/index.js +1 -1
  93. package/dist/logger/init.cjs +1 -1
  94. package/dist/logger/init.js +1 -1
  95. package/dist/sdk.cjs +1 -1
  96. package/dist/sdk.d.cts +1 -1
  97. package/dist/sdk.d.ts +1 -1
  98. package/dist/sdk.js +1 -1
  99. package/dist/signers/descriptors/api-key.d.cts +1 -1
  100. package/dist/signers/descriptors/api-key.d.ts +1 -1
  101. package/dist/signers/descriptors/device.d.cts +1 -1
  102. package/dist/signers/descriptors/device.d.ts +1 -1
  103. package/dist/signers/descriptors/email.d.cts +1 -1
  104. package/dist/signers/descriptors/email.d.ts +1 -1
  105. package/dist/signers/descriptors/external-wallet.d.cts +1 -1
  106. package/dist/signers/descriptors/external-wallet.d.ts +1 -1
  107. package/dist/signers/descriptors/index.cjs +1 -1
  108. package/dist/signers/descriptors/index.d.cts +1 -1
  109. package/dist/signers/descriptors/index.d.ts +1 -1
  110. package/dist/signers/descriptors/index.js +1 -1
  111. package/dist/signers/descriptors/passkey.d.cts +1 -1
  112. package/dist/signers/descriptors/passkey.d.ts +1 -1
  113. package/dist/signers/descriptors/phone.cjs +1 -1
  114. package/dist/signers/descriptors/phone.d.cts +1 -1
  115. package/dist/signers/descriptors/phone.d.ts +1 -1
  116. package/dist/signers/descriptors/phone.js +1 -1
  117. package/dist/signers/descriptors/server.d.cts +1 -1
  118. package/dist/signers/descriptors/server.d.ts +1 -1
  119. package/dist/signers/descriptors/types.d.cts +1 -1
  120. package/dist/signers/descriptors/types.d.ts +1 -1
  121. package/dist/signers/device.d.cts +1 -1
  122. package/dist/signers/device.d.ts +1 -1
  123. package/dist/signers/evm-api-key.d.cts +1 -1
  124. package/dist/signers/evm-api-key.d.ts +1 -1
  125. package/dist/signers/evm-external-wallet.d.cts +1 -1
  126. package/dist/signers/evm-external-wallet.d.ts +1 -1
  127. package/dist/signers/external-wallet-signer.d.cts +1 -1
  128. package/dist/signers/external-wallet-signer.d.ts +1 -1
  129. package/dist/signers/index.cjs +1 -1
  130. package/dist/signers/index.d.cts +1 -1
  131. package/dist/signers/index.d.ts +1 -1
  132. package/dist/signers/index.js +1 -1
  133. package/dist/signers/non-custodial/index.cjs +1 -1
  134. package/dist/signers/non-custodial/index.d.cts +1 -1
  135. package/dist/signers/non-custodial/index.d.ts +1 -1
  136. package/dist/signers/non-custodial/index.js +1 -1
  137. package/dist/signers/non-custodial/ncs-evm-signer.cjs +1 -1
  138. package/dist/signers/non-custodial/ncs-evm-signer.d.cts +1 -1
  139. package/dist/signers/non-custodial/ncs-evm-signer.d.ts +1 -1
  140. package/dist/signers/non-custodial/ncs-evm-signer.js +1 -1
  141. package/dist/signers/non-custodial/ncs-signer.cjs +1 -1
  142. package/dist/signers/non-custodial/ncs-signer.d.cts +1 -1
  143. package/dist/signers/non-custodial/ncs-signer.d.ts +1 -1
  144. package/dist/signers/non-custodial/ncs-signer.js +1 -1
  145. package/dist/signers/non-custodial/ncs-solana-signer.cjs +1 -1
  146. package/dist/signers/non-custodial/ncs-solana-signer.d.cts +1 -1
  147. package/dist/signers/non-custodial/ncs-solana-signer.d.ts +1 -1
  148. package/dist/signers/non-custodial/ncs-solana-signer.js +1 -1
  149. package/dist/signers/non-custodial/ncs-stellar-signer.cjs +1 -1
  150. package/dist/signers/non-custodial/ncs-stellar-signer.d.cts +1 -1
  151. package/dist/signers/non-custodial/ncs-stellar-signer.d.ts +1 -1
  152. package/dist/signers/non-custodial/ncs-stellar-signer.js +1 -1
  153. package/dist/signers/passkey.d.cts +1 -1
  154. package/dist/signers/passkey.d.ts +1 -1
  155. package/dist/signers/server/assemble-server-signer.d.cts +1 -1
  156. package/dist/signers/server/assemble-server-signer.d.ts +1 -1
  157. package/dist/signers/server/evm-server-signer.d.cts +1 -1
  158. package/dist/signers/server/evm-server-signer.d.ts +1 -1
  159. package/dist/signers/server/helpers/derive-server-signer.d.cts +1 -1
  160. package/dist/signers/server/helpers/derive-server-signer.d.ts +1 -1
  161. package/dist/signers/server/helpers/index.d.cts +1 -1
  162. package/dist/signers/server/helpers/index.d.ts +1 -1
  163. package/dist/signers/server/index.d.cts +1 -1
  164. package/dist/signers/server/index.d.ts +1 -1
  165. package/dist/signers/server/resolver.d.cts +1 -1
  166. package/dist/signers/server/resolver.d.ts +1 -1
  167. package/dist/signers/server/solana-server-signer.d.cts +1 -1
  168. package/dist/signers/server/solana-server-signer.d.ts +1 -1
  169. package/dist/signers/server/stellar-server-signer.d.cts +1 -1
  170. package/dist/signers/server/stellar-server-signer.d.ts +1 -1
  171. package/dist/signers/solana-api-key.d.cts +1 -1
  172. package/dist/signers/solana-api-key.d.ts +1 -1
  173. package/dist/signers/solana-external-wallet.d.cts +1 -1
  174. package/dist/signers/solana-external-wallet.d.ts +1 -1
  175. package/dist/signers/stellar-external-wallet.d.cts +1 -1
  176. package/dist/signers/stellar-external-wallet.d.ts +1 -1
  177. package/dist/signers/types.d.cts +1 -1
  178. package/dist/signers/types.d.ts +1 -1
  179. package/dist/{types-4EOfiBxs.d.cts → types-86FbKjRz.d.cts} +1 -0
  180. package/dist/{types-DfpYAsst.d.ts → types-BcjKqQz3.d.ts} +1 -0
  181. package/dist/utils/constants.cjs +1 -1
  182. package/dist/utils/constants.js +1 -1
  183. package/dist/utils/device-signers/IframeDeviceSignerKeyStorage.cjs +1 -1
  184. package/dist/utils/device-signers/IframeDeviceSignerKeyStorage.js +1 -1
  185. package/dist/utils/device-signers/createDeviceSigner.d.cts +1 -1
  186. package/dist/utils/device-signers/createDeviceSigner.d.ts +1 -1
  187. package/dist/utils/device-signers/index.cjs +1 -1
  188. package/dist/utils/device-signers/index.d.cts +1 -1
  189. package/dist/utils/device-signers/index.d.ts +1 -1
  190. package/dist/utils/device-signers/index.js +1 -1
  191. package/dist/utils/locators.d.cts +1 -1
  192. package/dist/utils/locators.d.ts +1 -1
  193. package/dist/utils/signer-locator.d.cts +1 -1
  194. package/dist/utils/signer-locator.d.ts +1 -1
  195. package/dist/utils/signer-mapping.d.cts +1 -1
  196. package/dist/utils/signer-mapping.d.ts +1 -1
  197. package/dist/wallets/__tests__/test-helpers.cjs +1 -1
  198. package/dist/wallets/__tests__/test-helpers.d.cts +1 -1
  199. package/dist/wallets/__tests__/test-helpers.d.ts +1 -1
  200. package/dist/wallets/__tests__/test-helpers.js +1 -1
  201. package/dist/wallets/evm.cjs +1 -1
  202. package/dist/wallets/evm.d.cts +1 -1
  203. package/dist/wallets/evm.d.ts +1 -1
  204. package/dist/wallets/evm.js +1 -1
  205. package/dist/wallets/services/balance-formatter.cjs +1 -1
  206. package/dist/wallets/services/balance-formatter.d.cts +1 -1
  207. package/dist/wallets/services/balance-formatter.d.ts +1 -1
  208. package/dist/wallets/services/balance-formatter.js +1 -1
  209. package/dist/wallets/services/device-recovery-service.cjs +1 -1
  210. package/dist/wallets/services/device-recovery-service.d.cts +1 -1
  211. package/dist/wallets/services/device-recovery-service.d.ts +1 -1
  212. package/dist/wallets/services/device-recovery-service.js +1 -1
  213. package/dist/wallets/services/operation-poller.cjs +1 -1
  214. package/dist/wallets/services/operation-poller.d.cts +1 -1
  215. package/dist/wallets/services/operation-poller.d.ts +1 -1
  216. package/dist/wallets/services/operation-poller.js +1 -1
  217. package/dist/wallets/services/signer-manager.cjs +1 -1
  218. package/dist/wallets/services/signer-manager.d.cts +1 -1
  219. package/dist/wallets/services/signer-manager.d.ts +1 -1
  220. package/dist/wallets/services/signer-manager.js +1 -1
  221. package/dist/wallets/solana.cjs +1 -1
  222. package/dist/wallets/solana.d.cts +1 -1
  223. package/dist/wallets/solana.d.ts +1 -1
  224. package/dist/wallets/solana.js +1 -1
  225. package/dist/wallets/stellar.cjs +1 -1
  226. package/dist/wallets/stellar.d.cts +1 -1
  227. package/dist/wallets/stellar.d.ts +1 -1
  228. package/dist/wallets/stellar.js +1 -1
  229. package/dist/wallets/types.d.cts +1 -1
  230. package/dist/wallets/types.d.ts +1 -1
  231. package/dist/wallets/wallet-factory.cjs +1 -1
  232. package/dist/wallets/wallet-factory.d.cts +2 -1
  233. package/dist/wallets/wallet-factory.d.ts +2 -1
  234. package/dist/wallets/wallet-factory.js +1 -1
  235. package/dist/wallets/wallet.cjs +1 -1
  236. package/dist/wallets/wallet.d.cts +1 -1
  237. package/dist/wallets/wallet.d.ts +1 -1
  238. package/dist/wallets/wallet.js +1 -1
  239. package/package.json +3 -3
  240. package/dist/chunk-B5U3A75U.cjs +0 -1
  241. package/dist/chunk-EAU5Z5O5.cjs +0 -1
  242. package/dist/chunk-NUBGDLR2.js +0 -1
  243. package/dist/chunk-PMQQEVKL.cjs +0 -1
  244. package/dist/chunk-VFJ7NZBI.js +0 -1
  245. package/dist/chunk-VPJBVKHY.js +0 -1
  246. package/dist/chunk-W6APCBJW.cjs +0 -1
  247. package/dist/chunk-XEWCMK3Z.js +0 -1
@@ -1 +1 @@
1
- import{a as o}from"./chunk-7FEY62ID.js";import{a}from"./chunk-TJBIBZMF.js";import{b as p,c}from"./chunk-NUBGDLR2.js";import{h as t}from"./chunk-NU7VF7MC.js";import{APIKeyEnvironmentPrefix as d,APIKeyUsageOrigin as g,CrossmintApiClient as P}from"@crossmint/common-sdk-base";var h=class extends P{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:c,version:p}}});this.apiPrefix="api/2025-06-09/wallets";this.unstableApiPrefix="api/unstable/wallets"}createWallet(e){return t(this,null,function*(){let s=this.isServerSide?`${this.apiPrefix}`:`${this.apiPrefix}/me`;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?a.error("wallets.api.createWallet.error",{error:n.error,chainType:e.chainType}):"address"in n&&a.info("wallets.api.createWallet.success",{address:n.address,chainType:e.chainType}),n})}getWallet(e){return t(this,null,function*(){a.info("wallets.api.getWallet",{locator:e});let r=yield(yield this.get(`${this.apiPrefix}/${e}`,{headers:this.headers})).json();return"error"in r?a.warn("wallets.api.getWallet.error",{locator:e,error:r.error}):"address"in r&&a.info("wallets.api.getWallet.success",{address:r.address,locator:e}),r})}createTransaction(e,s){return t(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveTransaction(e,s,r){return t(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 t(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions/${s}`,{headers:this.headers})).json()})}createSignature(e,s){return t(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signatures`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveSignature(e,s,r){return t(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 t(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signatures/${s}`,{headers:this.headers})).json()})}getTransactions(e){return t(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions`,{headers:this.headers})).json()})}getNfts(e){return t(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 t(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 t(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 t(this,null,function*(){if(this.environment===d.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 t(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signers`,{body:JSON.stringify(s),headers:this.headers})).json()})}removeSigner(e,s,r){return t(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 t(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 t(this,null,function*(){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?a.error("wallets.api.send.error",{walletLocator:e,tokenLocator:s,error:i.error}):"id"in i&&a.info("wallets.api.send.success",{walletLocator:e,transactionId:i.id}),i})}get isServerSide(){return this.parsedAPIKey.usageOrigin===g.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new o("Invalid API key");return this.parsedAPIKey.environment}get projectId(){if(!this.parsedAPIKey.isValid)throw new o("Invalid API key");return this.parsedAPIKey.projectId}get headers(){return{"Content-Type":"application/json"}}};export{h as a};
1
+ import{a as o}from"./chunk-7FEY62ID.js";import{a}from"./chunk-4ILFMPNK.js";import{b as p,c}from"./chunk-SCEZVF7J.js";import{h as t}from"./chunk-NU7VF7MC.js";import{APIKeyEnvironmentPrefix as d,APIKeyUsageOrigin as g,CrossmintApiClient as P}from"@crossmint/common-sdk-base";var h=class extends P{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:c,version:p}}});this.apiPrefix="api/2025-06-09/wallets";this.unstableApiPrefix="api/unstable/wallets"}createWallet(e){return t(this,null,function*(){let s=this.isServerSide?`${this.apiPrefix}`:`${this.apiPrefix}/me`;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?a.error("wallets.api.createWallet.error",{error:n.error,chainType:e.chainType}):"address"in n&&a.info("wallets.api.createWallet.success",{address:n.address,chainType:e.chainType}),n})}getWallet(e){return t(this,null,function*(){a.info("wallets.api.getWallet",{locator:e});let r=yield(yield this.get(`${this.apiPrefix}/${e}`,{headers:this.headers})).json();return"error"in r?a.warn("wallets.api.getWallet.error",{locator:e,error:r.error}):"address"in r&&a.info("wallets.api.getWallet.success",{address:r.address,locator:e}),r})}createTransaction(e,s){return t(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveTransaction(e,s,r){return t(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 t(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions/${s}`,{headers:this.headers})).json()})}createSignature(e,s){return t(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signatures`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveSignature(e,s,r){return t(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 t(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signatures/${s}`,{headers:this.headers})).json()})}getTransactions(e){return t(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions`,{headers:this.headers})).json()})}getNfts(e){return t(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 t(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 t(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 t(this,null,function*(){if(this.environment===d.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 t(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signers`,{body:JSON.stringify(s),headers:this.headers})).json()})}removeSigner(e,s,r){return t(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 t(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 t(this,null,function*(){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?a.error("wallets.api.send.error",{walletLocator:e,tokenLocator:s,error:i.error}):"id"in i&&a.info("wallets.api.send.success",{walletLocator:e,transactionId:i.id}),i})}get isServerSide(){return this.parsedAPIKey.usageOrigin===g.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new o("Invalid API key");return this.parsedAPIKey.environment}get projectId(){if(!this.parsedAPIKey.isValid)throw new o("Invalid API key");return this.parsedAPIKey.projectId}get headers(){return{"Content-Type":"application/json"}}};export{h as a};
@@ -1 +1 @@
1
- import{a as m}from"./chunk-EGX2IXWU.js";import{a as C}from"./chunk-OQZTL6ZG.js";import{a as u}from"./chunk-NU7VF7MC.js";function d(s,n){var e,l,r,i,a;let t=(e=s.chains)==null?void 0:e[n],o=m(n).balanceTokenFields(t);return u({symbol:(l=s.symbol)!=null?l:"",name:(r=s.name)!=null?r:"",amount:(i=s.amount)!=null?i:"0",decimals:s.decimals,rawAmount:(a=s.rawAmount)!=null?a:"0"},o)}function h(s,n){let t={symbol:s,name:s,amount:"0",decimals:0,rawAmount:"0"},o=m(n).emptyBalanceTokenFields();return u(u({},t),o)}function B(s,n,t){var r,i,a,f,p;if(n==null)return!0;let o=((r=s.symbol)!=null?r:"").toLowerCase();if(n.has(o))return!0;let e=(i=s.chains)==null?void 0:i[t];if(e==null)return!1;let l=C(t);if(l==="solana"&&"mintHash"in e){let c=(a=e.mintHash)==null?void 0:a.toLowerCase();return c!=null&&(n.has(c)||n.has(`solana:${c}`))}if(l==="stellar"&&"contractId"in e){let c=(f=e.contractId)==null?void 0:f.toLowerCase();return c!=null&&(n.has(c)||n.has(`stellar:${c}`))}if("contractAddress"in e){let c=(p=e.contractAddress)==null?void 0:p.toLowerCase();return c!=null&&(n.has(c)||n.has(`${t}:${c}`))}return!1}function g(s,n,t,o){let e=s.find(a=>a.symbol===t),l=s.find(a=>a.symbol==="usdc"),r=o!=null?new Set(o.map(a=>a.toLowerCase())):null,i=s.filter(a=>a.symbol!==t&&a.symbol!=="usdc"&&B(a,r,n));return{nativeToken:e!=null?d(e,n):h(t,n),usdc:l!=null?d(l,n):h("usdc",n),tokens:i.map(a=>d(a,n))}}export{g as a};
1
+ import{a as m}from"./chunk-YRX44YXB.js";import{a as C}from"./chunk-OQZTL6ZG.js";import{a as u}from"./chunk-NU7VF7MC.js";function d(s,n){var e,l,r,i,a;let t=(e=s.chains)==null?void 0:e[n],o=m(n).balanceTokenFields(t);return u({symbol:(l=s.symbol)!=null?l:"",name:(r=s.name)!=null?r:"",amount:(i=s.amount)!=null?i:"0",decimals:s.decimals,rawAmount:(a=s.rawAmount)!=null?a:"0"},o)}function h(s,n){let t={symbol:s,name:s,amount:"0",decimals:0,rawAmount:"0"},o=m(n).emptyBalanceTokenFields();return u(u({},t),o)}function B(s,n,t){var r,i,a,f,p;if(n==null)return!0;let o=((r=s.symbol)!=null?r:"").toLowerCase();if(n.has(o))return!0;let e=(i=s.chains)==null?void 0:i[t];if(e==null)return!1;let l=C(t);if(l==="solana"&&"mintHash"in e){let c=(a=e.mintHash)==null?void 0:a.toLowerCase();return c!=null&&(n.has(c)||n.has(`solana:${c}`))}if(l==="stellar"&&"contractId"in e){let c=(f=e.contractId)==null?void 0:f.toLowerCase();return c!=null&&(n.has(c)||n.has(`stellar:${c}`))}if("contractAddress"in e){let c=(p=e.contractAddress)==null?void 0:p.toLowerCase();return c!=null&&(n.has(c)||n.has(`${t}:${c}`))}return!1}function g(s,n,t,o){let e=s.find(a=>a.symbol===t),l=s.find(a=>a.symbol==="usdc"),r=o!=null?new Set(o.map(a=>a.toLowerCase())):null,i=s.filter(a=>a.symbol!==t&&a.symbol!=="usdc"&&B(a,r,n));return{nativeToken:e!=null?d(e,n):h(t,n),usdc:l!=null?d(l,n):h("usdc",n),tokens:i.map(a=>d(a,n))}}export{g as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkIDRQPLGQcjs = require('./chunk-IDRQPLGQ.cjs');var _chunkFQZXBS7Lcjs = require('./chunk-FQZXBS7L.cjs');var _chunkXZ4NKVEBcjs = require('./chunk-XZ4NKVEB.cjs');var _chunk7O3W4JAPcjs = require('./chunk-7O3W4JAP.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var _commonsdkbase = require('@crossmint/common-sdk-base');var o=class o extends _chunkIDRQPLGQcjs.a{constructor(e){super({chain:e.chain,address:e.address,owner:e.owner,options:_chunkIDRQPLGQcjs.a.getOptions(e),alias:e.alias,recovery:_chunkIDRQPLGQcjs.a.getRecovery(e),apiRecoveryServerSignerAddress:_chunkIDRQPLGQcjs.a.getApiRecoveryServerSignerAddress(e),apiDelegatedServerSignerAddresses:_chunkIDRQPLGQcjs.a.getApiDelegatedServerSignerAddresses(e),signer:e.signer,signers:_chunkIDRQPLGQcjs.a.getInitialSigners(e)},_chunkIDRQPLGQcjs.a.getApiClient(e))}static from(e){if(!_commonsdkbase.isValidSolanaAddress.call(void 0, e.address))throw new Error("Wallet is not a Solana wallet");return new o(e)}sendTransaction(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var l,p;_chunk7O3W4JAPcjs.a.info("solanaWallet.sendTransaction.start"),yield this.preAuthIfNeeded();let n=yield this.createTransaction(e);if((l=e.options)!=null&&l.prepareOnly)return _chunk7O3W4JAPcjs.a.info("solanaWallet.sendTransaction.prepared",{transactionId:n.id}),{hash:void 0,explorerLink:void 0,transactionId:n.id};let i={additionalSigners:(p=e.additionalSigners)==null?void 0:p.map(d=>new (0, _chunkFQZXBS7Lcjs.a)({type:"external-wallet",address:d.publicKey.toString(),locator:`external-wallet:${d.publicKey.toString()}`,onSign:g=>(g.sign([d]),Promise.resolve(g))}))},a=yield this.approveTransactionAndWait(n.id,i);return _chunk7O3W4JAPcjs.a.info("solanaWallet.sendTransaction.success",{transactionId:n.id,hash:a.hash}),a})}createTransaction(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var a;let n;((a=e.options)==null?void 0:a.signer)==null?n=this.signerManager.require().locator():typeof e.options.signer=="string"?n=e.options.signer:n=this.resolveServerSignerApiLocator(e.options.signer);let s;"serializedTransaction"in e?s=e.serializedTransaction:s=_bs582.default.encode(e.transaction.serialize());let i=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:s,signer:n}});if("error"in i)throw new (0, _chunkXZ4NKVEBcjs.z)(JSON.stringify(i));return i})}};_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunk7O3W4JAPcjs.a,methodName:"solanaWallet.sendTransaction",buildContext(e){return{chain:e.chain,address:e.address}}})],o.prototype,"sendTransaction",1);var f=o;exports.a = f;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkJ2C3XP4Zcjs = require('./chunk-J2C3XP4Z.cjs');var _chunkFQZXBS7Lcjs = require('./chunk-FQZXBS7L.cjs');var _chunkXZ4NKVEBcjs = require('./chunk-XZ4NKVEB.cjs');var _chunkPSK7FYV7cjs = require('./chunk-PSK7FYV7.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var _commonsdkbase = require('@crossmint/common-sdk-base');var o=class o extends _chunkJ2C3XP4Zcjs.a{constructor(e){super({chain:e.chain,address:e.address,owner:e.owner,options:_chunkJ2C3XP4Zcjs.a.getOptions(e),alias:e.alias,recovery:_chunkJ2C3XP4Zcjs.a.getRecovery(e),apiRecoveryServerSignerAddress:_chunkJ2C3XP4Zcjs.a.getApiRecoveryServerSignerAddress(e),apiDelegatedServerSignerAddresses:_chunkJ2C3XP4Zcjs.a.getApiDelegatedServerSignerAddresses(e),signer:e.signer,signers:_chunkJ2C3XP4Zcjs.a.getInitialSigners(e)},_chunkJ2C3XP4Zcjs.a.getApiClient(e))}static from(e){if(!_commonsdkbase.isValidSolanaAddress.call(void 0, e.address))throw new Error("Wallet is not a Solana wallet");return new o(e)}sendTransaction(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var l,p;_chunkPSK7FYV7cjs.a.info("solanaWallet.sendTransaction.start"),yield this.preAuthIfNeeded();let n=yield this.createTransaction(e);if((l=e.options)!=null&&l.prepareOnly)return _chunkPSK7FYV7cjs.a.info("solanaWallet.sendTransaction.prepared",{transactionId:n.id}),{hash:void 0,explorerLink:void 0,transactionId:n.id};let i={additionalSigners:(p=e.additionalSigners)==null?void 0:p.map(d=>new (0, _chunkFQZXBS7Lcjs.a)({type:"external-wallet",address:d.publicKey.toString(),locator:`external-wallet:${d.publicKey.toString()}`,onSign:g=>(g.sign([d]),Promise.resolve(g))}))},a=yield this.approveTransactionAndWait(n.id,i);return _chunkPSK7FYV7cjs.a.info("solanaWallet.sendTransaction.success",{transactionId:n.id,hash:a.hash}),a})}createTransaction(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var a;let n;((a=e.options)==null?void 0:a.signer)==null?n=this.signerManager.require().locator():typeof e.options.signer=="string"?n=e.options.signer:n=this.resolveServerSignerApiLocator(e.options.signer);let s;"serializedTransaction"in e?s=e.serializedTransaction:s=_bs582.default.encode(e.transaction.serialize());let i=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:s,signer:n}});if("error"in i)throw new (0, _chunkXZ4NKVEBcjs.z)(JSON.stringify(i));return i})}};_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkPSK7FYV7cjs.a,methodName:"solanaWallet.sendTransaction",buildContext(e){return{chain:e.chain,address:e.address}}})],o.prototype,"sendTransaction",1);var f=o;exports.a = f;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6ZAGINEScjs = require('./chunk-6ZAGINES.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var t=new _commonsdkbase.SdkLogger;function v(s){let o=_commonsdkbase.detectPlatform.call(void 0, ),e=_commonsdkbase.validateAPIKey.call(void 0, s);if(!e.isValid)throw new Error(`Invalid API key: ${e.message}`);let{environment:a,projectId:c}=e;switch(t.init({packageName:_chunk6ZAGINEScjs.c,packageVersion:_chunk6ZAGINEScjs.b,environment:a,projectId:c,platform:o}),o){case"browser":{let r=new (0, _commonsdkbase.BrowserDatadogSink)(a);t.addSink(r);break}case"react-native":break;case"server":{let r=new (0, _commonsdkbase.ServerDatadogSink)(a);t.addSink(r);break}default:break}}exports.a = t; exports.b = v;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkLJNSIXGNcjs = require('./chunk-LJNSIXGN.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var t=new _commonsdkbase.SdkLogger;function v(s){let o=_commonsdkbase.detectPlatform.call(void 0, ),e=_commonsdkbase.validateAPIKey.call(void 0, s);if(!e.isValid)throw new Error(`Invalid API key: ${e.message}`);let{environment:a,projectId:c}=e;switch(t.init({packageName:_chunkLJNSIXGNcjs.c,packageVersion:_chunkLJNSIXGNcjs.b,environment:a,projectId:c,platform:o}),o){case"browser":{let r=new (0, _commonsdkbase.BrowserDatadogSink)(a);t.addSink(r);break}case"react-native":break;case"server":{let r=new (0, _commonsdkbase.ServerDatadogSink)(a);t.addSink(r);break}default:break}}exports.a = t; exports.b = v;
@@ -1 +1 @@
1
- import{a as e}from"./chunk-TJBIBZMF.js";var s={nativeToken:"sol",walletLocatorPrefix:"me:solana:smart",supportsSignatures:!1,addSignerChain(n){},extractAddSignerOperation(n,r,a){if(!("transaction"in n)||n.transaction==null)throw e.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&&"mintHash"in n?{mintHash:n.mintHash}:n!=null&&"contractAddress"in n?{contractAddress:n.contractAddress}:{}},emptyBalanceTokenFields(){return{mintHash:void 0}}};export{s as a};
1
+ import{a as e}from"./chunk-4ILFMPNK.js";var s={nativeToken:"sol",walletLocatorPrefix:"me:solana:smart",supportsSignatures:!1,addSignerChain(n){},extractAddSignerOperation(n,r,a){if(!("transaction"in n)||n.transaction==null)throw e.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&&"mintHash"in n?{mintHash:n.mintHash}:n!=null&&"contractAddress"in n?{contractAddress:n.contractAddress}:{}},emptyBalanceTokenFields(){return{mintHash:void 0}}};export{s as a};
@@ -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 _chunkPSK7FYV7cjs = require('./chunk-PSK7FYV7.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var m=class{constructor(n){this.config=n;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 n=_commonsdkbase.validateAPIKey.call(void 0, this.config.crossmint.apiKey);if(!n.isValid)throw new Error("Invalid API key");let t=new (0, _chunkATIC4ENGcjs.a)({environment:n.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*(){_chunkPSK7FYV7cjs.a.info("TEE connection not initialized, initializing now");let n=_commonsdkbase.validateAPIKey.call(void 0, this.config.crossmint.apiKey);if(!n.isValid)throw new Error("Invalid API key");let t=new (0, _chunkATIC4ENGcjs.a)({environment:n.environment});if(this.config.clientTEEConnection=yield t.initialize(),this.config.clientTEEConnection==null)throw new Error("Failed to initialize TEE connection");_chunkPSK7FYV7cjs.a.info("TEE connection initialized successfully")})}handleAuthRequired(){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var d;let n=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 */ }`);_chunkPSK7FYV7cjs.a.info("get-status: sending request");let t=Date.now(),e=yield n.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}),s=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 _chunkPSK7FYV7cjs.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:s}),new (0, _chunkQPCZFIUVcjs.c)(c,p)}if(_chunkPSK7FYV7cjs.a.info("get-status: response received",{signerStatus:e.signerStatus,durationMs:s}),e.signerStatus==="ready"){this._needsAuth=!1;return}else this._needsAuth=!0;_chunkPSK7FYV7cjs.a.info("Auth required, initiating OTP flow",{needsAuth:this._needsAuth});let{promise:i,resolve:a,reject:r}=this.createAuthPromise();if(this._authPromise={promise:i,resolve:a,reject:r},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*(){_chunkPSK7FYV7cjs.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)})),r(new _chunkQPCZFIUVcjs.a)}))}catch(c){_chunkPSK7FYV7cjs.a.error("handleAuthRequired error",{error:c}),r(c)}try{yield i}catch(c){throw _chunkPSK7FYV7cjs.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 n=this.config.crossmint.jwt;if(n==null)throw new Error("JWT is required");return n}createAuthPromise(){let n,t;return{promise:new Promise((s,i)=>{n=s,t=i}),resolve:n,reject:t}}sendMessageWithOtp(){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var r;let n=yield this.getTEEConnection(),t=this.getAuthId();_chunkPSK7FYV7cjs.a.info("start-onboarding: sending request");let e=Date.now(),s=this.config.type==="phone"?this.config.channel:void 0,i=yield n.sendAction({event:"request:start-onboarding",responseEvent:"response:start-onboarding",data:{authData:{jwt:(r=this.config.crossmint.jwt)!=null?r:"",apiKey:this.config.crossmint.apiKey},data:_chunkDSIFRRBScjs.a.call(void 0, {authId:t},s!=null?{channel:s}:{})},options:l}),a=Date.now()-e;if(this._onboardingConnectionGeneration=n.connectionGeneration,_chunkPSK7FYV7cjs.a.info("start-onboarding: response received",{status:i==null?void 0:i.status,durationMs:a}),(i==null?void 0:i.status)==="success"&&i.signerStatus==="ready"){this._needsAuth=!1;return}if((i==null?void 0:i.status)==="error")throw _chunkPSK7FYV7cjs.a.error("start-onboarding: failed",{error:i.error,code:i.code}),new (0, _chunkQPCZFIUVcjs.b)(i.error||"Failed to initiate OTP process.",i.code)})}getAuthId(){return this.config.type==="email"?`email:${this.config.email}`:`phone:${this.config.phone}`}verifyOtp(n){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var i,a;let t;try{let r=yield this.getTEEConnection();_chunkPSK7FYV7cjs.a.info("complete-onboarding: sending request");let d=Date.now();t=yield r.sendAction({event:"request:complete-onboarding",responseEvent:"response:complete-onboarding",data:{authData:{jwt:(i=this.config.crossmint.jwt)!=null?i:"",apiKey:this.config.crossmint.apiKey},data:{onboardingAuthentication:{encryptedOtp:n}}},options:l}),_chunkPSK7FYV7cjs.a.info("complete-onboarding: response received",{status:t==null?void 0:t.status,durationMs:Date.now()-d})}catch(r){return _chunkPSK7FYV7cjs.a.error("complete-onboarding: error",{error:r}),yield this.handleOnboardingVerificationFailure(r)}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(),r=>this.verifyOtp(r),()=>{var r;return(r=this._authPromise)==null?void 0:r.reject(new _chunkQPCZFIUVcjs.a)})),(a=this._authPromise)==null||a.resolve();return}_chunkPSK7FYV7cjs.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",s=(t==null?void 0:t.status)==="error"?t.code:void 0;return yield this.handleOnboardingVerificationFailure(new (0, _chunkQPCZFIUVcjs.b)(e,s))})}handleOnboardingVerificationFailure(n){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var s,i,a;this._needsAuth=!0;let t=this.config.clientTEEConnection;if(this._onboardingConnectionGeneration!=null&&t!=null&&t.connectionGeneration!==this._onboardingConnectionGeneration){_chunkPSK7FYV7cjs.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(r){throw(s=this._authPromise)==null||s.reject(r),r}if(!this._needsAuth){(i=this._authPromise)==null||i.resolve();return}throw new _chunkQPCZFIUVcjs.e}throw(a=this._authPromise)==null||a.reject(n),n})}_exportPrivateKey(n,t){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){yield this.ensureAuthenticated();let e=this.getJwtOrThrow(),{scheme:s,encoding:i}=this.getChainKeyParams();if(t!=null){let r=n.on("event:key-exported",d=>{n.off(r),d.status==="success"&&Promise.resolve().then(()=>t()).catch(()=>{console.error("[NCS Signer] onExport callback error")})})}let a=yield n.sendAction({event:"request:export-signer",responseEvent:"response:export-signer",data:{authData:{jwt:e,apiKey:this.config.crossmint.apiKey},data:{scheme:s,encoding:i,walletAddress:this.config.address,authId:this.getAuthId()}},options:l});if((a==null?void 0:a.status)==="error")throw _chunkPSK7FYV7cjs.a.error("export-signer: failed",{error:a.error,code:a.code}),new (0, _chunkQPCZFIUVcjs.d)(a.error||"Failed to export private key",a.code)})}};_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkPSK7FYV7cjs.a,methodName:"handleAuthRequired"})],m.prototype,"handleAuthRequired",1);var l={timeoutMs:3e4};exports.a = m; exports.b = l;
@@ -0,0 +1 @@
1
+ var s="@crossmint/wallets-sdk",t="1.12.0";var c="WALLETS_SDK",r=t,a=s,d=200;export{c as a,r as b,a as c,d};
@@ -1 +1 @@
1
- import{a as e}from"./chunk-TJBIBZMF.js";var d={nativeToken:"xlm",walletLocatorPrefix:"me:stellar:smart",supportsSignatures:!1,addSignerChain(n){},extractAddSignerOperation(n,r,t){if(!("transaction"in n)||n.transaction==null)throw e.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}}};export{d as a};
1
+ import{a as e}from"./chunk-4ILFMPNK.js";var d={nativeToken:"xlm",walletLocatorPrefix:"me:stellar:smart",supportsSignatures:!1,addSignerChain(n){},extractAddSignerOperation(n,r,t){if(!("transaction"in n)||n.transaction==null)throw e.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}}};export{d as a};
@@ -1 +1 @@
1
- import{a as A}from"./chunk-3A424HCV.js";import{a as R}from"./chunk-SGP5B33N.js";import{f as m}from"./chunk-DCKFFFPG.js";import{b,c as x}from"./chunk-B4GYB3XY.js";import{a as w}from"./chunk-TJBIBZMF.js";import{d as r,e as o,f as s,h as p}from"./chunk-NU7VF7MC.js";var a,n,d,l,S,C,u,h,v,y,F=class{constructor(e){o(this,a);o(this,n);o(this,d);o(this,l);o(this,S);o(this,C);o(this,u);o(this,h);o(this,v);o(this,y);s(this,d,e.apiClient),s(this,l,e.options),s(this,S,e.chain),s(this,C,e.walletAddress),s(this,u,e.walletLocator),s(this,h,e.serverSignerResolver),s(this,n,e.recovery),s(this,v,e.initialSigners),s(this,y,e.signers),s(this,a,e.signer)}get activeSigner(){return r(this,a)}setActiveSigner(e){s(this,a,e)}get recovery(){return r(this,n)}descriptorContext(){var e,i,t,g,c;return{chain:r(this,S),walletAddress:r(this,C),crossmint:r(this,d).crossmint,clientTEEConnection:(e=r(this,l))==null?void 0:e.clientTEEConnection,resetSignerFrame:(i=r(this,l))==null?void 0:i.resetSignerFrame,onAuthRequired:(g=(t=r(this,l))==null?void 0:t.callbacks)==null?void 0:g.onAuthRequired,deviceSignerKeyStorage:(c=r(this,l))==null?void 0:c.deviceSignerKeyStorage,serverSigners:r(this,h)}}adoptRecoveryConfig(e){s(this,n,e)}stripSecretFromRecovery(){let e=r(this,h).resolvedRecoveryAddress;r(this,n)!=null&&r(this,n).type==="server"&&!m(r(this,n))&&e!=null&&s(this,n,{type:"server",address:e})}assemble(e,i){return p(this,null,function*(){var g,c;let t=R(r(this,S),e,(g=r(this,l))==null?void 0:g.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(r(this,a)==null){if(r(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 e=A(r(this,n).type),i=e.signerUnavailableReason();throw i!=null?new Error(i):e.canAutoAssemble(r(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 r(this,a)}withRecoverySigner(e){return p(this,null,function*(){var f;let i=r(this,a);if(m(r(this,n))&&!r(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=A(r(this,n).type),g=this.descriptorContext();if(r(this,n)!=null&&r(this,n).type==="external-wallet"&&!t.canAutoAssemble(r(this,n),g))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(r(this,n),g);s(this,a,R(r(this,S),c,(f=r(this,l))==null?void 0:f.deviceSignerKeyStorage));try{return yield e()}finally{s(this,a,i)}})}getSignerState(e){return p(this,null,function*(){let i=null;try{i=yield r(this,d).getSigner(r(this,u).call(this),e)}catch(g){return w.warn("wallet.signers.getSignerState.fetchFailed",{signerLocator:e,error:g}),{response:null,signer:null,pendingOperation:null}}if(i==null||typeof i!="object"||"error"in i)return w.warn("wallet.signers.getSignerState.errorResponse",{signerLocator:e,response:i}),{response:null,signer:null,pendingOperation:null};let t=b(i,r(this,S));return{response:i,signer:t,pendingOperation:x(i,r(this,S))}})}signerIsRegistered(e){return p(this,null,function*(){return(yield r(this,y).call(this)).some(t=>t.locator===e)})}isSignerApproved(e){return p(this,null,function*(){var t;let i=yield this.getSignerState(e);return this.isApprovedSignerStatus((t=i.signer)==null?void 0:t.status)})}isApprovedSignerStatus(e){return e==="success"||e==="active"}};a=new WeakMap,n=new WeakMap,d=new WeakMap,l=new WeakMap,S=new WeakMap,C=new WeakMap,u=new WeakMap,h=new WeakMap,v=new WeakMap,y=new WeakMap;export{F as a};
1
+ import{a as A}from"./chunk-JEKHYLBB.js";import{a as R}from"./chunk-3SHAB7GH.js";import{f as m}from"./chunk-DCKFFFPG.js";import{b,c as x}from"./chunk-B4GYB3XY.js";import{a as w}from"./chunk-4ILFMPNK.js";import{d as r,e as o,f as s,h as p}from"./chunk-NU7VF7MC.js";var a,n,d,l,S,C,u,h,v,y,F=class{constructor(e){o(this,a);o(this,n);o(this,d);o(this,l);o(this,S);o(this,C);o(this,u);o(this,h);o(this,v);o(this,y);s(this,d,e.apiClient),s(this,l,e.options),s(this,S,e.chain),s(this,C,e.walletAddress),s(this,u,e.walletLocator),s(this,h,e.serverSignerResolver),s(this,n,e.recovery),s(this,v,e.initialSigners),s(this,y,e.signers),s(this,a,e.signer)}get activeSigner(){return r(this,a)}setActiveSigner(e){s(this,a,e)}get recovery(){return r(this,n)}descriptorContext(){var e,i,t,g,c;return{chain:r(this,S),walletAddress:r(this,C),crossmint:r(this,d).crossmint,clientTEEConnection:(e=r(this,l))==null?void 0:e.clientTEEConnection,resetSignerFrame:(i=r(this,l))==null?void 0:i.resetSignerFrame,onAuthRequired:(g=(t=r(this,l))==null?void 0:t.callbacks)==null?void 0:g.onAuthRequired,deviceSignerKeyStorage:(c=r(this,l))==null?void 0:c.deviceSignerKeyStorage,serverSigners:r(this,h)}}adoptRecoveryConfig(e){s(this,n,e)}stripSecretFromRecovery(){let e=r(this,h).resolvedRecoveryAddress;r(this,n)!=null&&r(this,n).type==="server"&&!m(r(this,n))&&e!=null&&s(this,n,{type:"server",address:e})}assemble(e,i){return p(this,null,function*(){var g,c;let t=R(r(this,S),e,(g=r(this,l))==null?void 0:g.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(r(this,a)==null){if(r(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 e=A(r(this,n).type),i=e.signerUnavailableReason();throw i!=null?new Error(i):e.canAutoAssemble(r(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 r(this,a)}withRecoverySigner(e){return p(this,null,function*(){var f;let i=r(this,a);if(m(r(this,n))&&!r(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=A(r(this,n).type),g=this.descriptorContext();if(r(this,n)!=null&&r(this,n).type==="external-wallet"&&!t.canAutoAssemble(r(this,n),g))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(r(this,n),g);s(this,a,R(r(this,S),c,(f=r(this,l))==null?void 0:f.deviceSignerKeyStorage));try{return yield e()}finally{s(this,a,i)}})}getSignerState(e){return p(this,null,function*(){let i=null;try{i=yield r(this,d).getSigner(r(this,u).call(this),e)}catch(g){return w.warn("wallet.signers.getSignerState.fetchFailed",{signerLocator:e,error:g}),{response:null,signer:null,pendingOperation:null}}if(i==null||typeof i!="object"||"error"in i)return w.warn("wallet.signers.getSignerState.errorResponse",{signerLocator:e,response:i}),{response:null,signer:null,pendingOperation:null};let t=b(i,r(this,S));return{response:i,signer:t,pendingOperation:x(i,r(this,S))}})}signerIsRegistered(e){return p(this,null,function*(){return(yield r(this,y).call(this)).some(t=>t.locator===e)})}isSignerApproved(e){return p(this,null,function*(){var t;let i=yield this.getSignerState(e);return this.isApprovedSignerStatus((t=i.signer)==null?void 0:t.status)})}isApprovedSignerStatus(e){return e==="success"||e==="active"}};a=new WeakMap,n=new WeakMap,d=new WeakMap,l=new WeakMap,S=new WeakMap,C=new WeakMap,u=new WeakMap,h=new WeakMap,v=new WeakMap,y=new WeakMap;export{F as a};
@@ -1 +1 @@
1
- import{a as ge}from"./chunk-KSN4TWLX.js";import{a as de,b as pe}from"./chunk-6IV3GB5W.js";import{a as ce}from"./chunk-F3CW7X6C.js";import{a as le}from"./chunk-HIHX5FRO.js";import{a as se}from"./chunk-OMTJMVSG.js";import{a as L}from"./chunk-3A424HCV.js";import{a as $}from"./chunk-VCOKK7C2.js";import{a as ae,b as oe}from"./chunk-ARQVCU6M.js";import{a as ne}from"./chunk-XEWCMK3Z.js";import{f as _}from"./chunk-DCKFFFPG.js";import{a as te,b as ie}from"./chunk-EGX2IXWU.js";import{b as re}from"./chunk-B4GYB3XY.js";import{f as ee}from"./chunk-URQQBUUX.js";import{A as Y,F as Z,I as k,d as U,e as H,j as J,l as j,m as B,n as V,v as z,w as Q,y as K,z as X}from"./chunk-7FEY62ID.js";import{a as s}from"./chunk-TJBIBZMF.js";import{a as w,b as D,c as P,d as i,e as A,f as T,g as W,h as o}from"./chunk-NU7VF7MC.js";import{WithLoggerContext as E}from"@crossmint/common-sdk-base";var N,c,b,x,l,S,F,O,I,C,he,ue,q,G,R=class{constructor(e,r){A(this,C);A(this,N);A(this,c);A(this,b);A(this,x);A(this,l);A(this,S);A(this,F,[]);A(this,O);A(this,I,null);let{chain:t,address:n,owner:a,options:h,alias:u,recovery:d,apiRecoveryServerSignerAddress:g,apiDelegatedServerSignerAddresses:p,signers:y,signer:v}=e;T(this,c,r),this.chain=t,this.address=n,this.owner=a,T(this,N,h),this.alias=u;let m=null;g!=null?m=g:d.type==="server"&&_(d)&&(m=d.address),T(this,F,p!=null?p:[]),T(this,b,y!=null?y:[]),T(this,x,new se({chain:t,projectId:i(this,c).projectId,environment:i(this,c).environment,apiRecoveryAddress:m,apiDelegatedAddresses:i(this,F),knownOnChainAddresses:()=>[...i(this,b).filter(f=>f.type==="server"&&_(f)).map(f=>f.address),...i(this,F)]})),T(this,l,new ce({apiClient:r,options:h,chain:t,walletAddress:this.address,walletLocator:()=>this.walletLocator,serverSignerResolver:i(this,x),recovery:d,initialSigners:i(this,b),signers:()=>this.signers(),signer:v})),T(this,S,new ge({chain:t,walletAddress:this.address,options:h,signerManager:i(this,l),serverSignerResolver:i(this,x),signers:()=>this.signers(),addSigner:f=>this.addSigner(f),removeSigner:f=>this.removeSigner({type:"device",locator:f}),approveSignature:f=>this.approveSignatureAndWait(f),approveTransaction:f=>this.approveTransactionAndWait(f)})),T(this,O,this.initDefaultSigner())}get signer(){return i(this,l).activeSigner}waitForInit(){return o(this,null,function*(){yield i(this,O)})}initDefaultSigner(){return o(this,null,function*(){if(i(this,l).activeSigner!=null||(yield i(this,S).initDeviceSigner(),i(this,l).activeSigner!=null||i(this,S).needsRecovery))return;let e=i(this,b).length===0?i(this,l).recovery:i(this,b).length===1?i(this,b)[0]:null;if(e==null)return;let r=L(e.type),t=i(this,l).descriptorContext();if(!r.canAutoAssemble(e,t))return;let n=e===i(this,l).recovery;try{let a=r.buildInternalConfig(e,t);i(this,l).setActiveSigner(yield i(this,l).assemble(a,{isAdminSigner:n}))}catch(a){s.warn("wallet.initDefaultSigner.autoAssemblyFailed",{recoveryType:i(this,l).recovery.type,signerCount:i(this,b).length,error:a})}})}static getApiClient(e){return e.apiClient}static getOptions(e){return e.options}static getRecovery(e){return i(e,l).recovery}static getInitialSigners(e){return i(e,b)}static getApiRecoveryServerSignerAddress(e){var r;return(r=i(e,x).apiRecoveryAddress)!=null?r:void 0}static getApiDelegatedServerSignerAddresses(e){return i(e,F)}get apiClient(){return i(this,c)}get options(){return i(this,N)}get chainAdapter(){return te(this.chain)}resolveServerSignerApiLocator(e){return i(this,x).apiLocator(e)}get recovery(){return i(this,l).recovery}balances(e){return o(this,null,function*(){s.info("wallet.balances.start");let r=this.resolveChainForEnvironment(),t=this.chainAdapter.nativeToken,n=[t,"usdc",...e!=null?e:[]],a=yield i(this,c).getBalance(this.address,{chains:[r],tokens:n});if("error"in a)throw s.error("wallet.balances.error",{error:a}),new Error(`Failed to get balances for wallet: ${JSON.stringify(a.message)}`);return s.info("wallet.balances.success"),le(a,this.chain,t,e)})}stagingFund(e,r){return o(this,null,function*(){s.info("wallet.stagingFund.start",{amount:e,chain:r!=null?r:this.chain});let t=yield this.apiClient.fundWallet(this.address,{amount:e,token:"usdxm",chain:r!=null?r:this.chain});if("error"in t)throw s.error("wallet.stagingFund.error",{error:t}),new Error(`Failed to fund wallet: ${JSON.stringify(t.message)}`);return s.info("wallet.stagingFund.success"),t})}nfts(e){return o(this,null,function*(){let r=this.resolveChainForEnvironment(),t=yield i(this,c).getNfts(D(w({},e),{chain:r,address:this.address}));if(t!=null&&typeof t=="object"&&"error"in t)throw s.error("wallet.nfts.error",{error:t}),new Error(`Failed to get nfts: ${JSON.stringify(t.message)}`);return t})}transactions(){return o(this,null,function*(){let e=yield i(this,c).getTransactions(this.walletLocator);if("error"in e)throw new Error(`Failed to get transactions: ${JSON.stringify(e.message)}`);return e})}transaction(e){return o(this,null,function*(){let r=yield i(this,c).getTransaction(this.walletLocator,e);if("error"in r)throw new Error(`Failed to get transaction: ${JSON.stringify(r.message)}`);return r})}transfers(e){return o(this,null,function*(){let r=this.resolveChainForEnvironment(),t=yield this.apiClient.getTransfers(this.walletLocator,{chain:r,tokens:e.tokens,status:e.status});if("error"in t)throw new Error(`Failed to get transfers: ${JSON.stringify(t.message)}`);return t})}send(e,r,t,n){return o(this,null,function*(){let a=Number(t);if(Number.isNaN(a)||!Number.isFinite(a)||a<=0)throw new K(`Invalid transfer amount: "${t}". Amount must be a positive number greater than zero.`);let h=ae(e),u=this.resolveChainForEnvironment(),d=oe(r,u);s.info("wallet.send.start",w({recipient:h,token:d,amount:t},(n==null?void 0:n.transactionType)!=null?{transactionType:n.transactionType}:{})),yield this.preAuthIfNeeded();let g=i(this,l).require(),p;(n==null?void 0:n.signer)==null?p=g.locator():typeof n.signer=="string"?p=n.signer:p=this.resolveServerSignerApiLocator(n.signer);let y=w({recipient:h,amount:t,signer:p},(n==null?void 0:n.transactionType)!=null?{transactionType:n.transactionType}:{}),v=yield i(this,c).send(this.walletLocator,d,y);if("message"in v)throw s.error("wallet.send.error",{error:v}),new X(`Failed to send token: ${JSON.stringify(v.message)}`);if((n==null?void 0:n.prepareOnly)===!0)return s.info("wallet.send.prepared",{transactionId:v.id}),{hash:void 0,explorerLink:void 0,transactionId:v.id};let m=yield this.approveTransactionAndWait(v.id);return s.info("wallet.send.success",{transactionId:v.id,hash:m.hash}),m})}approveTransaction(e){return o(this,null,function*(){return console.warn("approveTransaction is deprecated. Use approve instead. This method will be removed in the next major version."),yield this.approve(e)})}approve(e){return o(this,null,function*(){if(s.info("wallet.approve.start",{transactionId:e.transactionId,signatureId:e.signatureId}),yield this.preAuthIfNeeded(),e.transactionId!=null){let r=yield this.approveTransactionAndWait(e.transactionId,e.options);return s.info("wallet.approve.success",{transactionId:e.transactionId}),r}if(e.signatureId!=null){let r=yield this.approveSignatureAndWait(e.signatureId,e.options);return s.info("wallet.approve.success",{signatureId:e.signatureId}),r}throw s.error("wallet.approve.error",{error:"Either transactionId or signatureId must be provided"}),new Error("Either transactionId or signatureId must be provided")})}addSigner(e,r){return o(this,null,function*(){s.info("wallet.addSigner.start");let t=typeof e=="object"&&"type"in e&&e.type==="server"?this.resolveServerSignerApiLocator(e):e;return i(this,l).withRecoverySigner(()=>o(this,null,function*(){var v;let n=typeof t=="string"?t:$(t),a=yield i(this,l).getSignerState(n);if(a.signer!=null){if(i(this,l).isApprovedSignerStatus(a.signer.status))return(r==null?void 0:r.scopes)!=null&&s.warn("wallet.addSigner.scopesIgnored",{reason:"signer already approved",signerLocator:n}),s.info("wallet.addSigner.alreadyApproved"),this.completeSignerRegistration(a.signer,null,r);if(a.pendingOperation!=null){if((r==null?void 0:r.scopes)!=null)throw new Error("Cannot apply scopes when resuming a pending signer registration. Remove the pending signer and register it again with the desired scopes.");return s.info("wallet.addSigner.resuming",{operationType:a.pendingOperation.type,operationId:a.pendingOperation.id}),this.completeSignerRegistration(a.signer,a.pendingOperation,r)}}let h=typeof t=="string"?t:L(t.type).addSignerPayload(t,i(this,l).descriptorContext()),d=this.chain!=="solana"&&this.chain!=="stellar"?(v=r==null?void 0:r.deployImmediately)!=null?v:!0:void 0,g=yield i(this,c).registerSigner(this.walletLocator,w(w({signer:h,chain:this.chainAdapter.addSignerChain(this.chain)},(r==null?void 0:r.scopes)!=null&&{scopes:r.scopes}),d!=null&&{deployImmediately:d}));if("error"in g)throw s.error("wallet.addSigner.error",{error:g}),g.code===j?new B(g.message):new J(`Failed to register signer: ${JSON.stringify(g.message)}`);let p=re(g,this.chain);if(p==null)throw new Error(`No approval found for chain ${this.chain} in register signer response`);let y=this.chainAdapter.extractAddSignerOperation(g,this.chain,{locator:n,type:e.type});return this.completeSignerRegistration(p,y,r)}))})}completeSignerRegistration(e,r,t){return o(this,null,function*(){if(t!=null&&t.prepareOnly){if(r==null)return w({},e);switch(r.type){case"transaction":{let n={transactionId:r.id};return s.info("wallet.addSigner.prepared",n),w(w({},e),n)}case"signature":{let n={signatureId:r.id};return s.info("wallet.addSigner.prepared",n),w(w({},e),n)}default:{let n=r.type;throw new Error(`Unknown pending operation type: ${n}`)}}}if(r!=null)switch(r.type){case"transaction":yield this.approveTransactionAndWait(r.id),s.info("wallet.addSigner.success",{transactionId:r.id});break;case"signature":yield this.approveSignatureAndWait(r.id),s.info("wallet.addSigner.success",{signatureId:r.id});break;default:{let n=r.type;throw new Error(`Unknown pending operation type: ${n}`)}}else s.info("wallet.addSigner.success");return D(w({},e),{status:"success"})})}removeSigner(e,r){return o(this,null,function*(){let t=this.resolveSignerLocator(e);return s.info("wallet.removeSigner.start",{signerLocator:t}),i(this,l).withRecoverySigner(()=>o(this,null,function*(){let n=yield i(this,c).removeSigner(this.walletLocator,t,{chain:this.chainAdapter.addSignerChain(this.chain)});if("error"in n)throw s.error("wallet.removeSigner.error",{error:n}),new Error(`Failed to remove signer: ${JSON.stringify(n)}`);let a=n.id;return r!=null&&r.prepareOnly?(s.info("wallet.removeSigner.prepared",{transactionId:a}),{transactionId:a,status:void 0}):(yield this.approveTransactionAndWait(a),s.info("wallet.removeSigner.success",{transactionId:a}),{transactionId:a,status:"success"})}))})}useSigner(e){return o(this,null,function*(){s.info("wallet.useSigner.start"),e.type==="server"&&i(this,x).resetDelegatedCache(),L(e.type).validateConfig(e);let r=!1;e.type==="device"?yield i(this,S).resolveAvailability(e):r=yield this.resolveNonDeviceSigner(e);let t=L(e.type).buildInternalConfig(e,i(this,l).descriptorContext()),n=$(e);i(this,l).setActiveSigner(yield i(this,l).assemble(t,{isAdminSigner:r})),s.info("wallet.useSigner.success",{signerLocator:n})})}resolveNonDeviceSigner(e){return o(this,null,function*(){if(e.type!=="passkey"&&e.type!=="server"&&this.isRecoverySigner(e))return i(this,S).onSignerSelected(),!0;if(e.type==="passkey"&&this.isPasskeyMissingId(e)&&!(yield this.tryAutoSelectPasskey(e))){if(this.isRecoverySigner(e))return i(this,S).onSignerSelected(),!0;throw new Error("No passkey signer is registered on this wallet.")}if(e.type==="server")return this.resolveServerSigner(e);let r=this.resolveSignerLocator(e);if(yield this.signerIsRegistered(r))return i(this,S).onSignerSelected(),!1;if(this.isRecoverySigner(e))return i(this,S).onSignerSelected(),!0;throw new Error(`Signer "${r}" is not registered in this wallet.`)})}resolveServerSigner(e){return o(this,null,function*(){let t=(yield this.signers()).map(a=>a.locator),n=i(this,x).resolveForUseSigner(e,t,()=>this.isRecoverySigner(e));switch(n.kind){case"delegated":return i(this,S).onSignerSelected(),!1;case"recovery":return i(this,l).stripSecretFromRecovery(),i(this,S).onSignerSelected(),!0;case"unregistered":throw new Error(n.message)}})}tryAutoSelectPasskey(e){return o(this,null,function*(){let t=(yield this.signers()).filter(n=>n.type==="passkey");if(t.length===0)return!1;if(t.length>1)throw new Error('Multiple passkey signers are registered on this wallet. Please specify the credential id: wallet.useSigner({ type: "passkey", id: "<credential-id>" })');return e.id=t[0].locator.replace("passkey:",""),!0})}resolveSignerLocator(e){return e.type==="server"?this.resolveServerSignerApiLocator(e):$(e)}isPasskeyMissingId(e){return e.id==null||e.id===""}signerIsRegistered(e){return o(this,null,function*(){return i(this,l).signerIsRegistered(e)})}isSignerApproved(e){return o(this,null,function*(){return i(this,l).isSignerApproved(e)})}needsRecovery(){return i(this,S).needsRecovery}recover(){return o(this,null,function*(){yield i(this,S).recover()})}signers(){return o(this,null,function*(){var a,h;s.info("wallet.signers.start");let e=yield i(this,c).getWallet(this.walletLocator);if("error"in e)throw s.error("wallet.signers.error",{error:e}),new H(JSON.stringify(e));if(!fe(e)){let u=e.type!=="smart"?`Wallet type ${e.type} not supported`:`Wallet chain type ${e.chainType} not supported`;throw s.error("wallet.signers.error",{error:u}),new U(u)}let r=(h=(a=e==null?void 0:e.config)==null?void 0:a.delegatedSigners)!=null?h:[],n=(yield Promise.all(r.map(u=>o(this,null,function*(){try{return(yield i(this,l).getSignerState(u.locator)).signer}catch(d){return s.warn("wallet.signers.mapSigner.failed",{locator:u.locator,error:d}),null}})))).filter(u=>u!=null);return s.info("wallet.signers.success",{count:n.length}),n})}get walletLocator(){if(i(this,c).isServerSide)return this.address;{let e=this.chainAdapter.walletLocatorPrefix,r=this.alias!=null?`:alias:${this.alias}`:"";return e+r}}get signerManager(){return i(this,l)}preAuthIfNeeded(){return o(this,null,function*(){yield i(this,O),i(this,I)==null&&T(this,I,this.recover());try{yield i(this,I)}finally{T(this,I,null)}let e=i(this,l).require();e instanceof ne&&(yield e.ensureAuthenticated())})}isRecoverySigner(e){let r=i(this,l).recovery;if(r==null||r.type!==e.type)return!1;let t=L(e.type);return t.matchesRecovery(e,r,i(this,l).descriptorContext())?(t.adoptsRecoveryConfigOnMatch&&i(this,l).adoptRecoveryConfig(e),!0):!1}resolveChainForEnvironment(){let e=ee(this.chain,i(this,c).environment);return e!==this.chain&&(this.chain=e),this.chain}approveTransactionAndWait(e,r){return o(this,null,function*(){return yield this.approveTransactionInternal(e,r),yield this.sleep(1e3),yield this.waitForTransaction(e)})}approveSignatureAndWait(e,r){return o(this,null,function*(){let t=yield this.approveSignatureInternal(e,r);return!("error"in t)&&t.status==="success"&&t.outputSignature!=null?{signature:t.outputSignature,signatureId:e}:(yield this.sleep(1e3),yield this.waitForSignature(e))})}approveSignatureInternal(e,r){return o(this,null,function*(){var d,g;if(!this.chainAdapter.supportsSignatures)throw new Error("Approving signatures is only supported for EVM smart wallets");let t=i(this,l).require(),n=yield i(this,c).getSignature(this.walletLocator,e);if("error"in n)throw k(n),new z(JSON.stringify(n));if(t.type==="api-key")return n;if((r==null?void 0:r.approval)!=null){let p=[r.approval];return yield this.executeApproveSignatureWithErrorHandling(e,p)}let a=(d=n.approvals)==null?void 0:d.pending;if(a==null||a.length===0)return n;let h=[...(g=r==null?void 0:r.additionalSigners)!=null?g:[],t],u=yield W(this,C,G).call(this,W(this,C,q).call(this,a),h,(p,y)=>p.signMessage(y.message));return yield this.executeApproveSignatureWithErrorHandling(e,u)})}approveTransactionInternal(e,r){return o(this,null,function*(){var d,g,p,y,v;let t=yield i(this,c).getTransaction(this.walletLocator,e);if("error"in t)throw k(t),new Y(JSON.stringify(t));yield(p=(g=(d=i(this,N))==null?void 0:d.callbacks)==null?void 0:g.onTransactionStart)==null?void 0:p.call(g);let n=i(this,l).require();if(n.type==="api-key")return t;if((r==null?void 0:r.approval)!=null){let m=[r.approval];return yield this.executeApproveTransactionWithErrorHandling(e,m)}let a=(y=t.approvals)==null?void 0:y.pending;if(a==null||a.length===0)return t;let h=[...(v=r==null?void 0:r.additionalSigners)!=null?v:[],n],u=yield W(this,C,G).call(this,W(this,C,q).call(this,a),h,(m,f)=>{let Se=m.type==="device",ve=t.chainType==="solana"&&"transaction"in t.onChain&&!Se?t.onChain.transaction:f.message;return m.signTransaction(ve)});return yield this.executeApproveTransactionWithErrorHandling(e,u)})}executeApproveTransactionWithErrorHandling(e,r){return o(this,null,function*(){s.info("wallet.approve: submitting approval to API",{transactionId:e});let t=yield i(this,c).approveTransaction(this.walletLocator,e,{approvals:r});if(t.error)throw k(t),new Z(JSON.stringify(t));return t})}executeApproveSignatureWithErrorHandling(e,r){return o(this,null,function*(){let t=yield i(this,c).approveSignature(this.walletLocator,e,{approvals:r});if(t.error)throw k(t),new Q(JSON.stringify(t));return t})}waitForSignature(e){return o(this,null,function*(){return yield pe(i(this,c),this.walletLocator,e)})}waitForTransaction(n){return o(this,arguments,function*(e,r=6e4,t={}){return yield de(i(this,c),this.walletLocator,e,w({timeoutMs:r},t))})}sleep(e){return o(this,null,function*(){return new Promise(r=>setTimeout(r,e))})}};N=new WeakMap,c=new WeakMap,b=new WeakMap,x=new WeakMap,l=new WeakMap,S=new WeakMap,F=new WeakMap,O=new WeakMap,I=new WeakMap,C=new WeakSet,he=function(e){return o(this,null,function*(){let r=yield i(this,S).tryResolveLocallyAvailableSigner(e);return r!=null&&s.info("wallet.approve.deviceSignerRecoveredViaFallback",{signerLocator:e}),r})},ue=function(e,r){return o(this,null,function*(){var n;let t=e.find(a=>a.locator()===r);if(t==null&&(t=(n=yield W(this,C,he).call(this,r))!=null?n:void 0),t==null)throw new J(`Signer ${r} not found in pending approvals`);return t})},q=function(e){return e.map(r=>{if(r.signer.type==="quorum")throw new V(`This wallet requires approval from a quorum signer (${r.signer.locator}), which is not yet supported by this SDK version`);return r})},G=function(e,r,t){return o(this,null,function*(){return yield Promise.all(e.map(n=>o(this,null,function*(){let a=yield W(this,C,ue).call(this,r,n.signer.locator),h=yield t(a,n);return D(w({},h),{signer:a.locator()})})))})},P([E({logger:s,methodName:"wallet.balances",buildContext(e){return{chain:e.chain,address:e.address}}})],R.prototype,"balances",1),P([E({logger:s,methodName:"wallet.stagingFund",buildContext(e){return{chain:e.chain,address:e.address}}})],R.prototype,"stagingFund",1),P([E({logger:s,methodName:"wallet.send",buildContext(e){return{chain:e.chain,address:e.address}}})],R.prototype,"send",1),P([E({logger:s,methodName:"wallet.approve",buildContext(e){return{chain:e.chain,address:e.address}}})],R.prototype,"approve",1),P([E({logger:s,methodName:"wallet.addSigner",buildContext(e){return{chain:e.chain,address:e.address}}})],R.prototype,"addSigner",1),P([E({logger:s,methodName:"wallet.removeSigner",buildContext(e){return{chain:e.chain,address:e.address}}})],R.prototype,"removeSigner",1),P([E({logger:s,methodName:"wallet.useSigner",buildContext(e){return{chain:e.chain,address:e.address}}})],R.prototype,"useSigner",1),P([E({logger:s,methodName:"wallet.recover",buildContext(e){return{chain:e.chain,address:e.address}}})],R.prototype,"recover",1),P([E({logger:s,methodName:"wallet.signers",buildContext(e){return{chain:e.chain,address:e.address}}})],R.prototype,"signers",1);function fe(M){return M.type==="smart"&&ie(M.chainType)}export{R as a};
1
+ import{a as ge}from"./chunk-CB3YEJ7F.js";import{a as de,b as pe}from"./chunk-2277DKO3.js";import{a as ce}from"./chunk-T2R4SPKJ.js";import{a as le}from"./chunk-OUZECW5T.js";import{a as se}from"./chunk-OMTJMVSG.js";import{a as L}from"./chunk-JEKHYLBB.js";import{a as $}from"./chunk-VCOKK7C2.js";import{a as ae,b as oe}from"./chunk-ARQVCU6M.js";import{a as ne}from"./chunk-26DL7XRG.js";import{f as _}from"./chunk-DCKFFFPG.js";import{a as te,b as ie}from"./chunk-YRX44YXB.js";import{b as re}from"./chunk-B4GYB3XY.js";import{f as ee}from"./chunk-N7Z3C5RJ.js";import{A as Y,F as Z,I as k,d as U,e as H,j as J,l as j,m as B,n as V,v as z,w as Q,y as K,z as X}from"./chunk-7FEY62ID.js";import{a as s}from"./chunk-4ILFMPNK.js";import{a as w,b as D,c as P,d as i,e as A,f as T,g as W,h as o}from"./chunk-NU7VF7MC.js";import{WithLoggerContext as E}from"@crossmint/common-sdk-base";var N,c,b,x,l,S,F,O,I,C,he,ue,q,G,R=class{constructor(e,r){A(this,C);A(this,N);A(this,c);A(this,b);A(this,x);A(this,l);A(this,S);A(this,F,[]);A(this,O);A(this,I,null);let{chain:t,address:n,owner:a,options:h,alias:u,recovery:d,apiRecoveryServerSignerAddress:g,apiDelegatedServerSignerAddresses:p,signers:y,signer:v}=e;T(this,c,r),this.chain=t,this.address=n,this.owner=a,T(this,N,h),this.alias=u;let m=null;g!=null?m=g:d.type==="server"&&_(d)&&(m=d.address),T(this,F,p!=null?p:[]),T(this,b,y!=null?y:[]),T(this,x,new se({chain:t,projectId:i(this,c).projectId,environment:i(this,c).environment,apiRecoveryAddress:m,apiDelegatedAddresses:i(this,F),knownOnChainAddresses:()=>[...i(this,b).filter(f=>f.type==="server"&&_(f)).map(f=>f.address),...i(this,F)]})),T(this,l,new ce({apiClient:r,options:h,chain:t,walletAddress:this.address,walletLocator:()=>this.walletLocator,serverSignerResolver:i(this,x),recovery:d,initialSigners:i(this,b),signers:()=>this.signers(),signer:v})),T(this,S,new ge({chain:t,walletAddress:this.address,options:h,signerManager:i(this,l),serverSignerResolver:i(this,x),signers:()=>this.signers(),addSigner:f=>this.addSigner(f),removeSigner:f=>this.removeSigner({type:"device",locator:f}),approveSignature:f=>this.approveSignatureAndWait(f),approveTransaction:f=>this.approveTransactionAndWait(f)})),T(this,O,this.initDefaultSigner())}get signer(){return i(this,l).activeSigner}waitForInit(){return o(this,null,function*(){yield i(this,O)})}initDefaultSigner(){return o(this,null,function*(){if(i(this,l).activeSigner!=null||(yield i(this,S).initDeviceSigner(),i(this,l).activeSigner!=null||i(this,S).needsRecovery))return;let e=i(this,b).length===0?i(this,l).recovery:i(this,b).length===1?i(this,b)[0]:null;if(e==null)return;let r=L(e.type),t=i(this,l).descriptorContext();if(!r.canAutoAssemble(e,t))return;let n=e===i(this,l).recovery;try{let a=r.buildInternalConfig(e,t);i(this,l).setActiveSigner(yield i(this,l).assemble(a,{isAdminSigner:n}))}catch(a){s.warn("wallet.initDefaultSigner.autoAssemblyFailed",{recoveryType:i(this,l).recovery.type,signerCount:i(this,b).length,error:a})}})}static getApiClient(e){return e.apiClient}static getOptions(e){return e.options}static getRecovery(e){return i(e,l).recovery}static getInitialSigners(e){return i(e,b)}static getApiRecoveryServerSignerAddress(e){var r;return(r=i(e,x).apiRecoveryAddress)!=null?r:void 0}static getApiDelegatedServerSignerAddresses(e){return i(e,F)}get apiClient(){return i(this,c)}get options(){return i(this,N)}get chainAdapter(){return te(this.chain)}resolveServerSignerApiLocator(e){return i(this,x).apiLocator(e)}get recovery(){return i(this,l).recovery}balances(e){return o(this,null,function*(){s.info("wallet.balances.start");let r=this.resolveChainForEnvironment(),t=this.chainAdapter.nativeToken,n=[t,"usdc",...e!=null?e:[]],a=yield i(this,c).getBalance(this.address,{chains:[r],tokens:n});if("error"in a)throw s.error("wallet.balances.error",{error:a}),new Error(`Failed to get balances for wallet: ${JSON.stringify(a.message)}`);return s.info("wallet.balances.success"),le(a,this.chain,t,e)})}stagingFund(e,r){return o(this,null,function*(){s.info("wallet.stagingFund.start",{amount:e,chain:r!=null?r:this.chain});let t=yield this.apiClient.fundWallet(this.address,{amount:e,token:"usdxm",chain:r!=null?r:this.chain});if("error"in t)throw s.error("wallet.stagingFund.error",{error:t}),new Error(`Failed to fund wallet: ${JSON.stringify(t.message)}`);return s.info("wallet.stagingFund.success"),t})}nfts(e){return o(this,null,function*(){let r=this.resolveChainForEnvironment(),t=yield i(this,c).getNfts(D(w({},e),{chain:r,address:this.address}));if(t!=null&&typeof t=="object"&&"error"in t)throw s.error("wallet.nfts.error",{error:t}),new Error(`Failed to get nfts: ${JSON.stringify(t.message)}`);return t})}transactions(){return o(this,null,function*(){let e=yield i(this,c).getTransactions(this.walletLocator);if("error"in e)throw new Error(`Failed to get transactions: ${JSON.stringify(e.message)}`);return e})}transaction(e){return o(this,null,function*(){let r=yield i(this,c).getTransaction(this.walletLocator,e);if("error"in r)throw new Error(`Failed to get transaction: ${JSON.stringify(r.message)}`);return r})}transfers(e){return o(this,null,function*(){let r=this.resolveChainForEnvironment(),t=yield this.apiClient.getTransfers(this.walletLocator,{chain:r,tokens:e.tokens,status:e.status});if("error"in t)throw new Error(`Failed to get transfers: ${JSON.stringify(t.message)}`);return t})}send(e,r,t,n){return o(this,null,function*(){let a=Number(t);if(Number.isNaN(a)||!Number.isFinite(a)||a<=0)throw new K(`Invalid transfer amount: "${t}". Amount must be a positive number greater than zero.`);let h=ae(e),u=this.resolveChainForEnvironment(),d=oe(r,u);s.info("wallet.send.start",w({recipient:h,token:d,amount:t},(n==null?void 0:n.transactionType)!=null?{transactionType:n.transactionType}:{})),yield this.preAuthIfNeeded();let g=i(this,l).require(),p;(n==null?void 0:n.signer)==null?p=g.locator():typeof n.signer=="string"?p=n.signer:p=this.resolveServerSignerApiLocator(n.signer);let y=w({recipient:h,amount:t,signer:p},(n==null?void 0:n.transactionType)!=null?{transactionType:n.transactionType}:{}),v=yield i(this,c).send(this.walletLocator,d,y);if("message"in v)throw s.error("wallet.send.error",{error:v}),new X(`Failed to send token: ${JSON.stringify(v.message)}`);if((n==null?void 0:n.prepareOnly)===!0)return s.info("wallet.send.prepared",{transactionId:v.id}),{hash:void 0,explorerLink:void 0,transactionId:v.id};let m=yield this.approveTransactionAndWait(v.id);return s.info("wallet.send.success",{transactionId:v.id,hash:m.hash}),m})}approveTransaction(e){return o(this,null,function*(){return console.warn("approveTransaction is deprecated. Use approve instead. This method will be removed in the next major version."),yield this.approve(e)})}approve(e){return o(this,null,function*(){if(s.info("wallet.approve.start",{transactionId:e.transactionId,signatureId:e.signatureId}),yield this.preAuthIfNeeded(),e.transactionId!=null){let r=yield this.approveTransactionAndWait(e.transactionId,e.options);return s.info("wallet.approve.success",{transactionId:e.transactionId}),r}if(e.signatureId!=null){let r=yield this.approveSignatureAndWait(e.signatureId,e.options);return s.info("wallet.approve.success",{signatureId:e.signatureId}),r}throw s.error("wallet.approve.error",{error:"Either transactionId or signatureId must be provided"}),new Error("Either transactionId or signatureId must be provided")})}addSigner(e,r){return o(this,null,function*(){s.info("wallet.addSigner.start");let t=typeof e=="object"&&"type"in e&&e.type==="server"?this.resolveServerSignerApiLocator(e):e;return i(this,l).withRecoverySigner(()=>o(this,null,function*(){var v;let n=typeof t=="string"?t:$(t),a=yield i(this,l).getSignerState(n);if(a.signer!=null){if(i(this,l).isApprovedSignerStatus(a.signer.status))return(r==null?void 0:r.scopes)!=null&&s.warn("wallet.addSigner.scopesIgnored",{reason:"signer already approved",signerLocator:n}),s.info("wallet.addSigner.alreadyApproved"),this.completeSignerRegistration(a.signer,null,r);if(a.pendingOperation!=null){if((r==null?void 0:r.scopes)!=null)throw new Error("Cannot apply scopes when resuming a pending signer registration. Remove the pending signer and register it again with the desired scopes.");return s.info("wallet.addSigner.resuming",{operationType:a.pendingOperation.type,operationId:a.pendingOperation.id}),this.completeSignerRegistration(a.signer,a.pendingOperation,r)}}let h=typeof t=="string"?t:L(t.type).addSignerPayload(t,i(this,l).descriptorContext()),d=this.chain!=="solana"&&this.chain!=="stellar"?(v=r==null?void 0:r.deployImmediately)!=null?v:!0:void 0,g=yield i(this,c).registerSigner(this.walletLocator,w(w({signer:h,chain:this.chainAdapter.addSignerChain(this.chain)},(r==null?void 0:r.scopes)!=null&&{scopes:r.scopes}),d!=null&&{deployImmediately:d}));if("error"in g)throw s.error("wallet.addSigner.error",{error:g}),g.code===j?new B(g.message):new J(`Failed to register signer: ${JSON.stringify(g.message)}`);let p=re(g,this.chain);if(p==null)throw new Error(`No approval found for chain ${this.chain} in register signer response`);let y=this.chainAdapter.extractAddSignerOperation(g,this.chain,{locator:n,type:e.type});return this.completeSignerRegistration(p,y,r)}))})}completeSignerRegistration(e,r,t){return o(this,null,function*(){if(t!=null&&t.prepareOnly){if(r==null)return w({},e);switch(r.type){case"transaction":{let n={transactionId:r.id};return s.info("wallet.addSigner.prepared",n),w(w({},e),n)}case"signature":{let n={signatureId:r.id};return s.info("wallet.addSigner.prepared",n),w(w({},e),n)}default:{let n=r.type;throw new Error(`Unknown pending operation type: ${n}`)}}}if(r!=null)switch(r.type){case"transaction":yield this.approveTransactionAndWait(r.id),s.info("wallet.addSigner.success",{transactionId:r.id});break;case"signature":yield this.approveSignatureAndWait(r.id),s.info("wallet.addSigner.success",{signatureId:r.id});break;default:{let n=r.type;throw new Error(`Unknown pending operation type: ${n}`)}}else s.info("wallet.addSigner.success");return D(w({},e),{status:"success"})})}removeSigner(e,r){return o(this,null,function*(){let t=this.resolveSignerLocator(e);return s.info("wallet.removeSigner.start",{signerLocator:t}),i(this,l).withRecoverySigner(()=>o(this,null,function*(){let n=yield i(this,c).removeSigner(this.walletLocator,t,{chain:this.chainAdapter.addSignerChain(this.chain)});if("error"in n)throw s.error("wallet.removeSigner.error",{error:n}),new Error(`Failed to remove signer: ${JSON.stringify(n)}`);let a=n.id;return r!=null&&r.prepareOnly?(s.info("wallet.removeSigner.prepared",{transactionId:a}),{transactionId:a,status:void 0}):(yield this.approveTransactionAndWait(a),s.info("wallet.removeSigner.success",{transactionId:a}),{transactionId:a,status:"success"})}))})}useSigner(e){return o(this,null,function*(){s.info("wallet.useSigner.start"),e.type==="server"&&i(this,x).resetDelegatedCache(),L(e.type).validateConfig(e);let r=!1;e.type==="device"?yield i(this,S).resolveAvailability(e):r=yield this.resolveNonDeviceSigner(e);let t=L(e.type).buildInternalConfig(e,i(this,l).descriptorContext()),n=$(e);i(this,l).setActiveSigner(yield i(this,l).assemble(t,{isAdminSigner:r})),s.info("wallet.useSigner.success",{signerLocator:n})})}resolveNonDeviceSigner(e){return o(this,null,function*(){if(e.type!=="passkey"&&e.type!=="server"&&this.isRecoverySigner(e))return i(this,S).onSignerSelected(),!0;if(e.type==="passkey"&&this.isPasskeyMissingId(e)&&!(yield this.tryAutoSelectPasskey(e))){if(this.isRecoverySigner(e))return i(this,S).onSignerSelected(),!0;throw new Error("No passkey signer is registered on this wallet.")}if(e.type==="server")return this.resolveServerSigner(e);let r=this.resolveSignerLocator(e);if(yield this.signerIsRegistered(r))return i(this,S).onSignerSelected(),!1;if(this.isRecoverySigner(e))return i(this,S).onSignerSelected(),!0;throw new Error(`Signer "${r}" is not registered in this wallet.`)})}resolveServerSigner(e){return o(this,null,function*(){let t=(yield this.signers()).map(a=>a.locator),n=i(this,x).resolveForUseSigner(e,t,()=>this.isRecoverySigner(e));switch(n.kind){case"delegated":return i(this,S).onSignerSelected(),!1;case"recovery":return i(this,l).stripSecretFromRecovery(),i(this,S).onSignerSelected(),!0;case"unregistered":throw new Error(n.message)}})}tryAutoSelectPasskey(e){return o(this,null,function*(){let t=(yield this.signers()).filter(n=>n.type==="passkey");if(t.length===0)return!1;if(t.length>1)throw new Error('Multiple passkey signers are registered on this wallet. Please specify the credential id: wallet.useSigner({ type: "passkey", id: "<credential-id>" })');return e.id=t[0].locator.replace("passkey:",""),!0})}resolveSignerLocator(e){return e.type==="server"?this.resolveServerSignerApiLocator(e):$(e)}isPasskeyMissingId(e){return e.id==null||e.id===""}signerIsRegistered(e){return o(this,null,function*(){return i(this,l).signerIsRegistered(e)})}isSignerApproved(e){return o(this,null,function*(){return i(this,l).isSignerApproved(e)})}needsRecovery(){return i(this,S).needsRecovery}recover(){return o(this,null,function*(){yield i(this,S).recover()})}signers(){return o(this,null,function*(){var a,h;s.info("wallet.signers.start");let e=yield i(this,c).getWallet(this.walletLocator);if("error"in e)throw s.error("wallet.signers.error",{error:e}),new H(JSON.stringify(e));if(!fe(e)){let u=e.type!=="smart"?`Wallet type ${e.type} not supported`:`Wallet chain type ${e.chainType} not supported`;throw s.error("wallet.signers.error",{error:u}),new U(u)}let r=(h=(a=e==null?void 0:e.config)==null?void 0:a.delegatedSigners)!=null?h:[],n=(yield Promise.all(r.map(u=>o(this,null,function*(){try{return(yield i(this,l).getSignerState(u.locator)).signer}catch(d){return s.warn("wallet.signers.mapSigner.failed",{locator:u.locator,error:d}),null}})))).filter(u=>u!=null);return s.info("wallet.signers.success",{count:n.length}),n})}get walletLocator(){if(i(this,c).isServerSide)return this.address;{let e=this.chainAdapter.walletLocatorPrefix,r=this.alias!=null?`:alias:${this.alias}`:"";return e+r}}get signerManager(){return i(this,l)}preAuthIfNeeded(){return o(this,null,function*(){yield i(this,O),i(this,I)==null&&T(this,I,this.recover());try{yield i(this,I)}finally{T(this,I,null)}let e=i(this,l).require();e instanceof ne&&(yield e.ensureAuthenticated())})}isRecoverySigner(e){let r=i(this,l).recovery;if(r==null||r.type!==e.type)return!1;let t=L(e.type);return t.matchesRecovery(e,r,i(this,l).descriptorContext())?(t.adoptsRecoveryConfigOnMatch&&i(this,l).adoptRecoveryConfig(e),!0):!1}resolveChainForEnvironment(){let e=ee(this.chain,i(this,c).environment);return e!==this.chain&&(this.chain=e),this.chain}approveTransactionAndWait(e,r){return o(this,null,function*(){return yield this.approveTransactionInternal(e,r),yield this.sleep(1e3),yield this.waitForTransaction(e)})}approveSignatureAndWait(e,r){return o(this,null,function*(){let t=yield this.approveSignatureInternal(e,r);return!("error"in t)&&t.status==="success"&&t.outputSignature!=null?{signature:t.outputSignature,signatureId:e}:(yield this.sleep(1e3),yield this.waitForSignature(e))})}approveSignatureInternal(e,r){return o(this,null,function*(){var d,g;if(!this.chainAdapter.supportsSignatures)throw new Error("Approving signatures is only supported for EVM smart wallets");let t=i(this,l).require(),n=yield i(this,c).getSignature(this.walletLocator,e);if("error"in n)throw k(n),new z(JSON.stringify(n));if(t.type==="api-key")return n;if((r==null?void 0:r.approval)!=null){let p=[r.approval];return yield this.executeApproveSignatureWithErrorHandling(e,p)}let a=(d=n.approvals)==null?void 0:d.pending;if(a==null||a.length===0)return n;let h=[...(g=r==null?void 0:r.additionalSigners)!=null?g:[],t],u=yield W(this,C,G).call(this,W(this,C,q).call(this,a),h,(p,y)=>p.signMessage(y.message));return yield this.executeApproveSignatureWithErrorHandling(e,u)})}approveTransactionInternal(e,r){return o(this,null,function*(){var d,g,p,y,v;let t=yield i(this,c).getTransaction(this.walletLocator,e);if("error"in t)throw k(t),new Y(JSON.stringify(t));yield(p=(g=(d=i(this,N))==null?void 0:d.callbacks)==null?void 0:g.onTransactionStart)==null?void 0:p.call(g);let n=i(this,l).require();if(n.type==="api-key")return t;if((r==null?void 0:r.approval)!=null){let m=[r.approval];return yield this.executeApproveTransactionWithErrorHandling(e,m)}let a=(y=t.approvals)==null?void 0:y.pending;if(a==null||a.length===0)return t;let h=[...(v=r==null?void 0:r.additionalSigners)!=null?v:[],n],u=yield W(this,C,G).call(this,W(this,C,q).call(this,a),h,(m,f)=>{let Se=m.type==="device",ve=t.chainType==="solana"&&"transaction"in t.onChain&&!Se?t.onChain.transaction:f.message;return m.signTransaction(ve)});return yield this.executeApproveTransactionWithErrorHandling(e,u)})}executeApproveTransactionWithErrorHandling(e,r){return o(this,null,function*(){s.info("wallet.approve: submitting approval to API",{transactionId:e});let t=yield i(this,c).approveTransaction(this.walletLocator,e,{approvals:r});if(t.error)throw k(t),new Z(JSON.stringify(t));return t})}executeApproveSignatureWithErrorHandling(e,r){return o(this,null,function*(){let t=yield i(this,c).approveSignature(this.walletLocator,e,{approvals:r});if(t.error)throw k(t),new Q(JSON.stringify(t));return t})}waitForSignature(e){return o(this,null,function*(){return yield pe(i(this,c),this.walletLocator,e)})}waitForTransaction(n){return o(this,arguments,function*(e,r=6e4,t={}){return yield de(i(this,c),this.walletLocator,e,w({timeoutMs:r},t))})}sleep(e){return o(this,null,function*(){return new Promise(r=>setTimeout(r,e))})}};N=new WeakMap,c=new WeakMap,b=new WeakMap,x=new WeakMap,l=new WeakMap,S=new WeakMap,F=new WeakMap,O=new WeakMap,I=new WeakMap,C=new WeakSet,he=function(e){return o(this,null,function*(){let r=yield i(this,S).tryResolveLocallyAvailableSigner(e);return r!=null&&s.info("wallet.approve.deviceSignerRecoveredViaFallback",{signerLocator:e}),r})},ue=function(e,r){return o(this,null,function*(){var n;let t=e.find(a=>a.locator()===r);if(t==null&&(t=(n=yield W(this,C,he).call(this,r))!=null?n:void 0),t==null)throw new J(`Signer ${r} not found in pending approvals`);return t})},q=function(e){return e.map(r=>{if(r.signer.type==="quorum")throw new V(`This wallet requires approval from a quorum signer (${r.signer.locator}), which is not yet supported by this SDK version`);return r})},G=function(e,r,t){return o(this,null,function*(){return yield Promise.all(e.map(n=>o(this,null,function*(){let a=yield W(this,C,ue).call(this,r,n.signer.locator),h=yield t(a,n);return D(w({},h),{signer:a.locator()})})))})},P([E({logger:s,methodName:"wallet.balances",buildContext(e){return{chain:e.chain,address:e.address}}})],R.prototype,"balances",1),P([E({logger:s,methodName:"wallet.stagingFund",buildContext(e){return{chain:e.chain,address:e.address}}})],R.prototype,"stagingFund",1),P([E({logger:s,methodName:"wallet.send",buildContext(e){return{chain:e.chain,address:e.address}}})],R.prototype,"send",1),P([E({logger:s,methodName:"wallet.approve",buildContext(e){return{chain:e.chain,address:e.address}}})],R.prototype,"approve",1),P([E({logger:s,methodName:"wallet.addSigner",buildContext(e){return{chain:e.chain,address:e.address}}})],R.prototype,"addSigner",1),P([E({logger:s,methodName:"wallet.removeSigner",buildContext(e){return{chain:e.chain,address:e.address}}})],R.prototype,"removeSigner",1),P([E({logger:s,methodName:"wallet.useSigner",buildContext(e){return{chain:e.chain,address:e.address}}})],R.prototype,"useSigner",1),P([E({logger:s,methodName:"wallet.recover",buildContext(e){return{chain:e.chain,address:e.address}}})],R.prototype,"recover",1),P([E({logger:s,methodName:"wallet.signers",buildContext(e){return{chain:e.chain,address:e.address}}})],R.prototype,"signers",1);function fe(M){return M.type==="smart"&&ie(M.chainType)}export{R as a};
@@ -1 +1 @@
1
- import{a as o}from"./chunk-3TZJ6D4G.js";import{a as W}from"./chunk-URQQBUUX.js";import{q as l,u as f,z as w}from"./chunk-7FEY62ID.js";import{a as n}from"./chunk-TJBIBZMF.js";import{c as u,h as p}from"./chunk-NU7VF7MC.js";import{createPublicClient as O,encodeFunctionData as x,http as E}from"viem";import{isValidEvmAddress as A,WithLoggerContext as h}from"@crossmint/common-sdk-base";var c=class c extends o{constructor(e){super({chain:e.chain,address:e.address,owner:e.owner,options:o.getOptions(e),alias:e.alias,recovery:o.getRecovery(e),apiRecoveryServerSignerAddress:o.getApiRecoveryServerSignerAddress(e),apiDelegatedServerSignerAddresses:o.getApiDelegatedServerSignerAddresses(e),signer:e.signer,signers:o.getInitialSigners(e)},o.getApiClient(e))}static from(e){if(!A(e.address))throw new Error("Wallet is not an EVM wallet");return new c(e)}sendTransaction(e){return p(this,null,function*(){var i;n.info("evmWallet.sendTransaction.start"),yield this.preAuthIfNeeded();let t=this.buildTransaction(e),r=yield this.createTransaction(t,e.options);if((i=e.options)!=null&&i.prepareOnly)return n.info("evmWallet.sendTransaction.prepared",{transactionId:r.id}),{hash:void 0,explorerLink:void 0,transactionId:r.id};let a=yield this.approveTransactionAndWait(r.id);return n.info("evmWallet.sendTransaction.success",{transactionId:r.id,hash:a.hash}),a})}signMessage(e){return p(this,null,function*(){var i;n.info("evmWallet.signMessage.start"),yield this.preAuthIfNeeded();let t=this.signerManager.require(),r=yield this.apiClient.createSignature(this.walletLocator,{type:"message",params:{message:e.message,signer:t.locator(),chain:this.chain}});if("error"in r)throw n.error("evmWallet.signMessage.error",{error:r}),new f(JSON.stringify(r));if((i=e.options)!=null&&i.prepareOnly)return n.info("evmWallet.signMessage.prepared",{signatureId:r.id}),{signature:void 0,signatureId:r.id};let a=yield this.approveSignatureAndWait(r.id);return n.info("evmWallet.signMessage.success",{signatureId:r.id}),a})}signTypedData(e){return p(this,null,function*(){var C;n.info("evmWallet.signTypedData.start"),yield this.preAuthIfNeeded();let t=this.signerManager.require(),{domain:r,message:a,primaryType:i,types:g,chain:T}=e;if(!r||!a||!g||!T)throw n.error("evmWallet.signTypedData.error",{error:"Invalid typed data"}),new l("Invalid typed data");let{name:m,version:v,chainId:S,verifyingContract:I,salt:b}=r;if(!m||!v||!S||!I)throw n.error("evmWallet.signTypedData.error",{error:"Invalid typed data domain"}),new l("Invalid typed data domain");let d=yield this.apiClient.createSignature(this.walletLocator,{type:"typed-data",params:{typedData:{domain:{name:m,version:v,chainId:Number(S),verifyingContract:I,salt:b},message:y(a),primaryType:i,types:g},signer:t.locator(),chain:T}});if("error"in d)throw n.error("evmWallet.signTypedData.error",{error:d}),new f(JSON.stringify(d));if((C=e.options)!=null&&C.prepareOnly)return n.info("evmWallet.signTypedData.prepared",{signatureId:d.id}),{signature:void 0,signatureId:d.id};let D=yield this.approveSignatureAndWait(d.id);return n.info("evmWallet.signTypedData.success",{signatureId:d.id}),D})}getViemClient(e){var t;return O({transport:(t=e==null?void 0:e.transport)!=null?t:E(),chain:W(this.chain)})}createTransaction(e,t){return p(this,null,function*(){let r;(t==null?void 0:t.signer)==null?r=this.signerManager.require().locator():typeof t.signer=="string"?r=t.signer:r=this.resolveServerSignerApiLocator(t.signer);let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:r,chain:this.chain,calls:[e]}});if("error"in a)throw new w(JSON.stringify(a));return a})}buildTransaction(e){var t,r,a,i,g;if("transaction"in e)return{transaction:e.transaction};if(e.abi==null)return{to:e.to,value:(r=(t=e.value)==null?void 0:t.toString())!=null?r:"0",data:(a=e.data)!=null?a:"0x"};if(!e.functionName)throw new Error("Function name is required");return{to:e.to,value:(g=(i=e.value)==null?void 0:i.toString())!=null?g:"0",data:x({abi:e.abi,functionName:e.functionName,args:e.args})}}};u([h({logger:n,methodName:"evmWallet.sendTransaction",buildContext(e){return{chain:e.chain,address:e.address}}})],c.prototype,"sendTransaction",1),u([h({logger:n,methodName:"evmWallet.signMessage",buildContext(e){return{chain:e.chain,address:e.address}}})],c.prototype,"signMessage",1),u([h({logger:n,methodName:"evmWallet.signTypedData",buildContext(e){return{chain:e.chain,address:e.address}}})],c.prototype,"signTypedData",1);var M=c;function y(s){return typeof s=="bigint"?s.toString():Array.isArray(s)?s.map(y):s!==null&&typeof s=="object"?Object.fromEntries(Object.entries(s).map(([e,t])=>[e,y(t)])):s}export{M as a};
1
+ import{a as o}from"./chunk-TZGYISF7.js";import{a as W}from"./chunk-N7Z3C5RJ.js";import{q as l,u as f,z as w}from"./chunk-7FEY62ID.js";import{a as n}from"./chunk-4ILFMPNK.js";import{c as u,h as p}from"./chunk-NU7VF7MC.js";import{createPublicClient as O,encodeFunctionData as x,http as E}from"viem";import{isValidEvmAddress as A,WithLoggerContext as h}from"@crossmint/common-sdk-base";var c=class c extends o{constructor(e){super({chain:e.chain,address:e.address,owner:e.owner,options:o.getOptions(e),alias:e.alias,recovery:o.getRecovery(e),apiRecoveryServerSignerAddress:o.getApiRecoveryServerSignerAddress(e),apiDelegatedServerSignerAddresses:o.getApiDelegatedServerSignerAddresses(e),signer:e.signer,signers:o.getInitialSigners(e)},o.getApiClient(e))}static from(e){if(!A(e.address))throw new Error("Wallet is not an EVM wallet");return new c(e)}sendTransaction(e){return p(this,null,function*(){var i;n.info("evmWallet.sendTransaction.start"),yield this.preAuthIfNeeded();let t=this.buildTransaction(e),r=yield this.createTransaction(t,e.options);if((i=e.options)!=null&&i.prepareOnly)return n.info("evmWallet.sendTransaction.prepared",{transactionId:r.id}),{hash:void 0,explorerLink:void 0,transactionId:r.id};let a=yield this.approveTransactionAndWait(r.id);return n.info("evmWallet.sendTransaction.success",{transactionId:r.id,hash:a.hash}),a})}signMessage(e){return p(this,null,function*(){var i;n.info("evmWallet.signMessage.start"),yield this.preAuthIfNeeded();let t=this.signerManager.require(),r=yield this.apiClient.createSignature(this.walletLocator,{type:"message",params:{message:e.message,signer:t.locator(),chain:this.chain}});if("error"in r)throw n.error("evmWallet.signMessage.error",{error:r}),new f(JSON.stringify(r));if((i=e.options)!=null&&i.prepareOnly)return n.info("evmWallet.signMessage.prepared",{signatureId:r.id}),{signature:void 0,signatureId:r.id};let a=yield this.approveSignatureAndWait(r.id);return n.info("evmWallet.signMessage.success",{signatureId:r.id}),a})}signTypedData(e){return p(this,null,function*(){var C;n.info("evmWallet.signTypedData.start"),yield this.preAuthIfNeeded();let t=this.signerManager.require(),{domain:r,message:a,primaryType:i,types:g,chain:T}=e;if(!r||!a||!g||!T)throw n.error("evmWallet.signTypedData.error",{error:"Invalid typed data"}),new l("Invalid typed data");let{name:m,version:v,chainId:S,verifyingContract:I,salt:b}=r;if(!m||!v||!S||!I)throw n.error("evmWallet.signTypedData.error",{error:"Invalid typed data domain"}),new l("Invalid typed data domain");let d=yield this.apiClient.createSignature(this.walletLocator,{type:"typed-data",params:{typedData:{domain:{name:m,version:v,chainId:Number(S),verifyingContract:I,salt:b},message:y(a),primaryType:i,types:g},signer:t.locator(),chain:T}});if("error"in d)throw n.error("evmWallet.signTypedData.error",{error:d}),new f(JSON.stringify(d));if((C=e.options)!=null&&C.prepareOnly)return n.info("evmWallet.signTypedData.prepared",{signatureId:d.id}),{signature:void 0,signatureId:d.id};let D=yield this.approveSignatureAndWait(d.id);return n.info("evmWallet.signTypedData.success",{signatureId:d.id}),D})}getViemClient(e){var t;return O({transport:(t=e==null?void 0:e.transport)!=null?t:E(),chain:W(this.chain)})}createTransaction(e,t){return p(this,null,function*(){let r;(t==null?void 0:t.signer)==null?r=this.signerManager.require().locator():typeof t.signer=="string"?r=t.signer:r=this.resolveServerSignerApiLocator(t.signer);let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:r,chain:this.chain,calls:[e]}});if("error"in a)throw new w(JSON.stringify(a));return a})}buildTransaction(e){var t,r,a,i,g;if("transaction"in e)return{transaction:e.transaction};if(e.abi==null)return{to:e.to,value:(r=(t=e.value)==null?void 0:t.toString())!=null?r:"0",data:(a=e.data)!=null?a:"0x"};if(!e.functionName)throw new Error("Function name is required");return{to:e.to,value:(g=(i=e.value)==null?void 0:i.toString())!=null?g:"0",data:x({abi:e.abi,functionName:e.functionName,args:e.args})}}};u([h({logger:n,methodName:"evmWallet.sendTransaction",buildContext(e){return{chain:e.chain,address:e.address}}})],c.prototype,"sendTransaction",1),u([h({logger:n,methodName:"evmWallet.signMessage",buildContext(e){return{chain:e.chain,address:e.address}}})],c.prototype,"signMessage",1),u([h({logger:n,methodName:"evmWallet.signTypedData",buildContext(e){return{chain:e.chain,address:e.address}}})],c.prototype,"signTypedData",1);var M=c;function y(s){return typeof s=="bigint"?s.toString():Array.isArray(s)?s.map(y):s!==null&&typeof s=="object"?Object.fromEntries(Object.entries(s).map(([e,t])=>[e,y(t)])):s}export{M as a};
@@ -0,0 +1 @@
1
+ import{a as r}from"./chunk-VCOKK7C2.js";var g={type:"phone",validateConfig(n){if(!("phone"in n)||n.phone==null)throw new Error("Phone signer requires a phone number")},buildInternalConfig(n,e){let i=n;return{type:"phone",phone:i.phone,channel:i.channel,locator:`phone:${i.phone}`,address:e.walletAddress,crossmint:e.crossmint,clientTEEConnection:e.clientTEEConnection,resetSignerFrame:e.resetSignerFrame,onAuthRequired:e.onAuthRequired}},canAutoAssemble(){return!0},addSignerPayload(n){return r(n)},matchesRecovery(n,e){return r(n)===r(e)},adoptsRecoveryConfigOnMatch:!0,signerUnavailableReason:()=>null};export{g as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkW6L7J3KLcjs = require('./chunk-W6L7J3KL.cjs');var t={type:"phone",validateConfig(n){if(!("phone"in n)||n.phone==null)throw new Error("Phone signer requires a phone number")},buildInternalConfig(n,e){let i=n;return{type:"phone",phone:i.phone,channel:i.channel,locator:`phone:${i.phone}`,address:e.walletAddress,crossmint:e.crossmint,clientTEEConnection:e.clientTEEConnection,resetSignerFrame:e.resetSignerFrame,onAuthRequired:e.onAuthRequired}},canAutoAssemble(){return!0},addSignerPayload(n){return _chunkW6L7J3KLcjs.a.call(void 0, n)},matchesRecovery(n,e){return _chunkW6L7J3KLcjs.a.call(void 0, n)===_chunkW6L7J3KLcjs.a.call(void 0, e)},adoptsRecoveryConfigOnMatch:!0,signerUnavailableReason:()=>null};exports.a = t;
@@ -1 +1 @@
1
- import{a as r}from"./chunk-3TZJ6D4G.js";import{a as h}from"./chunk-3QKB6K3J.js";import{z as S}from"./chunk-7FEY62ID.js";import{a as t}from"./chunk-TJBIBZMF.js";import{c as u,h as c}from"./chunk-NU7VF7MC.js";import T from"bs58";import{isValidSolanaAddress as y,WithLoggerContext as m}from"@crossmint/common-sdk-base";var o=class o extends r{constructor(e){super({chain:e.chain,address:e.address,owner:e.owner,options:r.getOptions(e),alias:e.alias,recovery:r.getRecovery(e),apiRecoveryServerSignerAddress:r.getApiRecoveryServerSignerAddress(e),apiDelegatedServerSignerAddresses:r.getApiDelegatedServerSignerAddresses(e),signer:e.signer,signers:r.getInitialSigners(e)},r.getApiClient(e))}static from(e){if(!y(e.address))throw new Error("Wallet is not a Solana wallet");return new o(e)}sendTransaction(e){return c(this,null,function*(){var l,p;t.info("solanaWallet.sendTransaction.start"),yield this.preAuthIfNeeded();let n=yield this.createTransaction(e);if((l=e.options)!=null&&l.prepareOnly)return t.info("solanaWallet.sendTransaction.prepared",{transactionId:n.id}),{hash:void 0,explorerLink:void 0,transactionId:n.id};let i={additionalSigners:(p=e.additionalSigners)==null?void 0:p.map(d=>new h({type:"external-wallet",address:d.publicKey.toString(),locator:`external-wallet:${d.publicKey.toString()}`,onSign:g=>(g.sign([d]),Promise.resolve(g))}))},a=yield this.approveTransactionAndWait(n.id,i);return t.info("solanaWallet.sendTransaction.success",{transactionId:n.id,hash:a.hash}),a})}createTransaction(e){return c(this,null,function*(){var a;let n;((a=e.options)==null?void 0:a.signer)==null?n=this.signerManager.require().locator():typeof e.options.signer=="string"?n=e.options.signer:n=this.resolveServerSignerApiLocator(e.options.signer);let s;"serializedTransaction"in e?s=e.serializedTransaction:s=T.encode(e.transaction.serialize());let i=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:s,signer:n}});if("error"in i)throw new S(JSON.stringify(i));return i})}};u([m({logger:t,methodName:"solanaWallet.sendTransaction",buildContext(e){return{chain:e.chain,address:e.address}}})],o.prototype,"sendTransaction",1);var f=o;export{f as a};
1
+ import{a as r}from"./chunk-TZGYISF7.js";import{a as h}from"./chunk-3QKB6K3J.js";import{z as S}from"./chunk-7FEY62ID.js";import{a as t}from"./chunk-4ILFMPNK.js";import{c as u,h as c}from"./chunk-NU7VF7MC.js";import T from"bs58";import{isValidSolanaAddress as y,WithLoggerContext as m}from"@crossmint/common-sdk-base";var o=class o extends r{constructor(e){super({chain:e.chain,address:e.address,owner:e.owner,options:r.getOptions(e),alias:e.alias,recovery:r.getRecovery(e),apiRecoveryServerSignerAddress:r.getApiRecoveryServerSignerAddress(e),apiDelegatedServerSignerAddresses:r.getApiDelegatedServerSignerAddresses(e),signer:e.signer,signers:r.getInitialSigners(e)},r.getApiClient(e))}static from(e){if(!y(e.address))throw new Error("Wallet is not a Solana wallet");return new o(e)}sendTransaction(e){return c(this,null,function*(){var l,p;t.info("solanaWallet.sendTransaction.start"),yield this.preAuthIfNeeded();let n=yield this.createTransaction(e);if((l=e.options)!=null&&l.prepareOnly)return t.info("solanaWallet.sendTransaction.prepared",{transactionId:n.id}),{hash:void 0,explorerLink:void 0,transactionId:n.id};let i={additionalSigners:(p=e.additionalSigners)==null?void 0:p.map(d=>new h({type:"external-wallet",address:d.publicKey.toString(),locator:`external-wallet:${d.publicKey.toString()}`,onSign:g=>(g.sign([d]),Promise.resolve(g))}))},a=yield this.approveTransactionAndWait(n.id,i);return t.info("solanaWallet.sendTransaction.success",{transactionId:n.id,hash:a.hash}),a})}createTransaction(e){return c(this,null,function*(){var a;let n;((a=e.options)==null?void 0:a.signer)==null?n=this.signerManager.require().locator():typeof e.options.signer=="string"?n=e.options.signer:n=this.resolveServerSignerApiLocator(e.options.signer);let s;"serializedTransaction"in e?s=e.serializedTransaction:s=T.encode(e.transaction.serialize());let i=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:s,signer:n}});if("error"in i)throw new S(JSON.stringify(i));return i})}};u([m({logger:t,methodName:"solanaWallet.sendTransaction",buildContext(e){return{chain:e.chain,address:e.address}}})],o.prototype,"sendTransaction",1);var f=o;export{f as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkW6APCBJWcjs = require('./chunk-W6APCBJW.cjs');var _chunkENU3EKBGcjs = require('./chunk-ENU3EKBG.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');function d(s,n){var e,l,r,i,a;let t=(e=s.chains)==null?void 0:e[n],o=_chunkW6APCBJWcjs.a.call(void 0, n).balanceTokenFields(t);return _chunkDSIFRRBScjs.a.call(void 0, {symbol:(l=s.symbol)!=null?l:"",name:(r=s.name)!=null?r:"",amount:(i=s.amount)!=null?i:"0",decimals:s.decimals,rawAmount:(a=s.rawAmount)!=null?a:"0"},o)}function h(s,n){let t={symbol:s,name:s,amount:"0",decimals:0,rawAmount:"0"},o=_chunkW6APCBJWcjs.a.call(void 0, n).emptyBalanceTokenFields();return _chunkDSIFRRBScjs.a.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {},t),o)}function B(s,n,t){var r,i,a,f,p;if(n==null)return!0;let o=((r=s.symbol)!=null?r:"").toLowerCase();if(n.has(o))return!0;let e=(i=s.chains)==null?void 0:i[t];if(e==null)return!1;let l=_chunkENU3EKBGcjs.a.call(void 0, t);if(l==="solana"&&"mintHash"in e){let c=(a=e.mintHash)==null?void 0:a.toLowerCase();return c!=null&&(n.has(c)||n.has(`solana:${c}`))}if(l==="stellar"&&"contractId"in e){let c=(f=e.contractId)==null?void 0:f.toLowerCase();return c!=null&&(n.has(c)||n.has(`stellar:${c}`))}if("contractAddress"in e){let c=(p=e.contractAddress)==null?void 0:p.toLowerCase();return c!=null&&(n.has(c)||n.has(`${t}:${c}`))}return!1}function T(s,n,t,o){let e=s.find(a=>a.symbol===t),l=s.find(a=>a.symbol==="usdc"),r=o!=null?new Set(o.map(a=>a.toLowerCase())):null,i=s.filter(a=>a.symbol!==t&&a.symbol!=="usdc"&&B(a,r,n));return{nativeToken:e!=null?d(e,n):h(t,n),usdc:l!=null?d(l,n):h("usdc",n),tokens:i.map(a=>d(a,n))}}exports.a = T;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5VUIA6TBcjs = require('./chunk-5VUIA6TB.cjs');var _chunkENU3EKBGcjs = require('./chunk-ENU3EKBG.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');function d(s,n){var e,l,r,i,a;let t=(e=s.chains)==null?void 0:e[n],o=_chunk5VUIA6TBcjs.a.call(void 0, n).balanceTokenFields(t);return _chunkDSIFRRBScjs.a.call(void 0, {symbol:(l=s.symbol)!=null?l:"",name:(r=s.name)!=null?r:"",amount:(i=s.amount)!=null?i:"0",decimals:s.decimals,rawAmount:(a=s.rawAmount)!=null?a:"0"},o)}function h(s,n){let t={symbol:s,name:s,amount:"0",decimals:0,rawAmount:"0"},o=_chunk5VUIA6TBcjs.a.call(void 0, n).emptyBalanceTokenFields();return _chunkDSIFRRBScjs.a.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {},t),o)}function B(s,n,t){var r,i,a,f,p;if(n==null)return!0;let o=((r=s.symbol)!=null?r:"").toLowerCase();if(n.has(o))return!0;let e=(i=s.chains)==null?void 0:i[t];if(e==null)return!1;let l=_chunkENU3EKBGcjs.a.call(void 0, t);if(l==="solana"&&"mintHash"in e){let c=(a=e.mintHash)==null?void 0:a.toLowerCase();return c!=null&&(n.has(c)||n.has(`solana:${c}`))}if(l==="stellar"&&"contractId"in e){let c=(f=e.contractId)==null?void 0:f.toLowerCase();return c!=null&&(n.has(c)||n.has(`stellar:${c}`))}if("contractAddress"in e){let c=(p=e.contractAddress)==null?void 0:p.toLowerCase();return c!=null&&(n.has(c)||n.has(`${t}:${c}`))}return!1}function T(s,n,t,o){let e=s.find(a=>a.symbol===t),l=s.find(a=>a.symbol==="usdc"),r=o!=null?new Set(o.map(a=>a.toLowerCase())):null,i=s.filter(a=>a.symbol!==t&&a.symbol!=="usdc"&&B(a,r,n));return{nativeToken:e!=null?d(e,n):h(t,n),usdc:l!=null?d(l,n):h("usdc",n),tokens:i.map(a=>d(a,n))}}exports.a = T;
@@ -1 +1 @@
1
- import{a as s,b as o}from"./chunk-XEWCMK3Z.js";import{a as r}from"./chunk-TJBIBZMF.js";import{h as t}from"./chunk-NU7VF7MC.js";import{VersionedTransaction as u}from"@solana/web3.js";import a from"bs58";var g=class c extends s{constructor(n){super(n)}signMessage(){return t(this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for email signer"))})}signTransaction(n){return t(this,null,function*(){var i;yield this.handleAuthRequired();let d=this.getJwtOrThrow(),m=a.decode(n),y=u.deserialize(m).message.serialize();r.info("sign: sending request",{keyType:"ed25519"});let l=Date.now(),e=yield(i=this.config.clientTEEConnection)==null?void 0:i.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:d,apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:a.encode(new Uint8Array(y)),encoding:"base58"}},options:o});if(r.info("sign: response received",{status:e==null?void 0:e.status,durationMs:Date.now()-l}),(e==null?void 0:e.status)==="error")throw new Error(e.error);if((e==null?void 0:e.signature)==null)throw new Error("Failed to sign transaction");return c.verifyPublicKeyFormat(e.publicKey),{signature:e.signature.bytes}})}static verifyPublicKeyFormat(n){if(n==null)throw new Error("No public key found");if(n.encoding!=="base58"||n.keyType!=="ed25519"||n.bytes==null)throw new Error("Not supported. Expected public key to be in base58 encoding and ed25519 key type. Got: "+JSON.stringify(n))}getChainKeyParams(){return{scheme:"ed25519",encoding:"base58"}}};export{g as a};
1
+ import{a as s,b as o}from"./chunk-26DL7XRG.js";import{a as r}from"./chunk-4ILFMPNK.js";import{h as t}from"./chunk-NU7VF7MC.js";import{VersionedTransaction as u}from"@solana/web3.js";import a from"bs58";var g=class c extends s{constructor(n){super(n)}signMessage(){return t(this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for email signer"))})}signTransaction(n){return t(this,null,function*(){var i;yield this.handleAuthRequired();let d=this.getJwtOrThrow(),m=a.decode(n),y=u.deserialize(m).message.serialize();r.info("sign: sending request",{keyType:"ed25519"});let l=Date.now(),e=yield(i=this.config.clientTEEConnection)==null?void 0:i.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:d,apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:a.encode(new Uint8Array(y)),encoding:"base58"}},options:o});if(r.info("sign: response received",{status:e==null?void 0:e.status,durationMs:Date.now()-l}),(e==null?void 0:e.status)==="error")throw new Error(e.error);if((e==null?void 0:e.signature)==null)throw new Error("Failed to sign transaction");return c.verifyPublicKeyFormat(e.publicKey),{signature:e.signature.bytes}})}static verifyPublicKeyFormat(n){if(n==null)throw new Error("No public key found");if(n.encoding!=="base58"||n.keyType!=="ed25519"||n.bytes==null)throw new Error("Not supported. Expected public key to be in base58 encoding and ed25519 key type. Got: "+JSON.stringify(n))}getChainKeyParams(){return{scheme:"ed25519",encoding:"base58"}}};export{g as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGSNFNRH2cjs = require('./chunk-GSNFNRH2.cjs');var _chunk3VYGTPRFcjs = require('./chunk-3VYGTPRF.cjs');var _chunkXZ4NKVEBcjs = require('./chunk-XZ4NKVEB.cjs');var _chunk7O3W4JAPcjs = require('./chunk-7O3W4JAP.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var _ox = require('ox');var R={[_commonsdkbase.APIKeyEnvironmentPrefix.DEVELOPMENT]:"https://development.devicekey.store",[_commonsdkbase.APIKeyEnvironmentPrefix.STAGING]:"https://staging.devicekey.store",[_commonsdkbase.APIKeyEnvironmentPrefix.PRODUCTION]:"https://devicekey.store"},E=6e4,L="indexeddb-fatal",c= exports.a =class extends _chunk3VYGTPRFcjs.a{constructor(e){super(e);this.iframePromise=null;this.reloading=null;this.biometricRequestHandler=null;this.biometricListener=null;if(typeof window!="undefined"&&!_chunkGSNFNRH2cjs.a.call(void 0, ))throw new (0, _chunkXZ4NKVEBcjs.o)("Device signer requires a browser with third-party storage partitioning (Chrome \u2265 115, Firefox \u2265 103, or Safari). Without storage partitioning, different embedders of the same iframe can share IndexedDB, allowing cross-site key access. See https://developer.chrome.com/blog/storage-partitioning");let r=_commonsdkbase.getEnvironmentForKey.call(void 0, e);if(r==null)throw new Error("Unable to determine environment from API key");this.iframeUrl=R[r]}setBiometricRequestHandler(e){this.biometricRequestHandler=e}generateKey(){return _chunkDSIFRRBScjs.h.call(void 0, this,arguments,function*(e={biometricPolicy:"none"}){return(yield this.rpc("generateKey",e)).publicKeyBase64})}mapAddressToKey(e,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){yield this.rpc("mapAddressToKey",{address:e,publicKeyBase64:r})})}getKey(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.rpc("getKey",{address:e})).publicKeyBase64})}hasKey(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.rpc("hasKey",{publicKeyBase64:e})).hasKey})}signMessage(e,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return yield this.rpc("signMessage",{address:e,message:r})})}deleteKey(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){yield this.rpc("deleteKey",{address:e})})}destroy(){this.biometricListener!=null&&(window.removeEventListener("message",this.biometricListener),this.biometricListener=null),this.iframePromise!=null&&(this.iframePromise.then(e=>e.remove()).catch(()=>{}),this.iframePromise=null)}rpc(e,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let i=yield this.sendRpc(e,r);if(i.fatal){_chunk7O3W4JAPcjs.a.warn(`[IframeDeviceSignerKeyStorage] Recoverable IDB error on "${e}", reloading iframe and retrying`),yield this.reloadIframe();let t=yield this.sendRpc(e,r);if(t.fatal)throw new Error(`Device signer IDB fatal error on "${e}" persisted after iframe reload`);return t.value}return i.value})}sendRpc(e,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let t=(yield this.getIframe()).contentWindow;if(t==null)throw new Error("Device signer iframe has no contentWindow");let g=crypto.randomUUID(),a=new URL(this.iframeUrl).origin;return new Promise((s,o)=>{let f=setTimeout(()=>{window.removeEventListener("message",p),o(new Error(`Device signer RPC "${e}" timed out after ${E}ms`))},E);function p(y){let d=y.data;d==null||d.id!==g||y.origin===a&&(clearTimeout(f),window.removeEventListener("message",p),d.type==="error"&&d.code===L?s({fatal:!0}):d.type==="error"?o(new Error(d.error)):s({value:d.result,fatal:!1}))}window.addEventListener("message",p),t.postMessage({type:e,id:g,payload:r},this.iframeUrl)})})}reloadIframe(){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){if(this.reloading!=null)return this.reloading;let e=_chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){try{this.destroy(),yield this.getIframe()}finally{this.reloading=null}});return this.reloading=e,e})}setupBiometricListener(e){let r=new URL(this.iframeUrl).origin;this.biometricListener=i=>_chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){if(i.origin!==r)return;let t=i.data;if((t==null?void 0:t.type)!=="biometric-request")return;let g=e.contentWindow;if(g!=null)try{this.biometricRequestHandler!=null&&(yield this.biometricRequestHandler(t.action));let a=null;if(t.action==="createCredential"){let s=t.payload,o=yield _ox.WebAuthnP256.createCredential({name:s.name});a={id:o.id,publicKey:{x:`0x${o.publicKey.x.toString(16)}`,y:`0x${o.publicKey.y.toString(16)}`}}}else if(t.action==="sign"){let s=t.payload,{signature:o,metadata:f}=yield _ox.WebAuthnP256.sign({credentialId:s.credentialId,challenge:s.challenge});a={signature:{r:`0x${o.r.toString(16)}`,s:`0x${o.s.toString(16)}`},metadata:f}}g.postMessage({type:"biometric-response",id:t.id,result:a},this.iframeUrl)}catch(a){let s=a instanceof Error?a.message:"Unknown biometric error";g.postMessage({type:"biometric-response",id:t.id,error:s},this.iframeUrl)}}),window.addEventListener("message",this.biometricListener)}getIframe(){return this.iframePromise==null&&(this.iframePromise=this.createIframe().catch(e=>{throw this.iframePromise=null,e})),this.iframePromise}createIframe(){let e=document.createElement("iframe");return e.src=this.iframeUrl,Object.assign(e.style,{position:"absolute",opacity:"0",pointerEvents:"none",width:"0",height:"0",border:"none",top:"-9999px",left:"-9999px"}),new Promise((r,i)=>{e.onload=()=>{this.setupBiometricListener(e),r(e)},e.onerror=()=>i(new Error("Failed to load device signer iframe")),document.body.appendChild(e)})}getDeviceName(){var t;if(typeof navigator=="undefined")return"Unknown Device";let e=navigator.userAgent,r=this.parseDevice(e),i=this.parseBrowser(e);return r!=null&&i!=null?`${i} on ${r}`:(t=r!=null?r:i)!=null?t:"Unknown Device"}parseDevice(e){return/iPad/.test(e)?"iPad":/iPhone/.test(e)?"iPhone":/Macintosh|Mac OS X/.test(e)?"Mac":/Windows/.test(e)?"Windows":/Android/.test(e)?"Android":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"ChromeOS":null}parseBrowser(e){return/Edg\//.test(e)?"Edge":/OPR\/|Opera/.test(e)?"Opera":typeof navigator!="undefined"&&"brave"in navigator?"Brave":/Chrome\//.test(e)?"Chrome":/Safari\//.test(e)&&!/Chrome\//.test(e)?"Safari":/Firefox\//.test(e)?"Firefox":null}};_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunk7O3W4JAPcjs.a,methodName:"deviceSignerKeyStorage.generateKey"})],c.prototype,"generateKey",1),_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunk7O3W4JAPcjs.a,methodName:"deviceSignerKeyStorage.mapAddressToKey"})],c.prototype,"mapAddressToKey",1),_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunk7O3W4JAPcjs.a,methodName:"deviceSignerKeyStorage.getKey"})],c.prototype,"getKey",1),_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunk7O3W4JAPcjs.a,methodName:"deviceSignerKeyStorage.hasKey"})],c.prototype,"hasKey",1),_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunk7O3W4JAPcjs.a,methodName:"deviceSignerKeyStorage.signMessage"})],c.prototype,"signMessage",1),_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunk7O3W4JAPcjs.a,methodName:"deviceSignerKeyStorage.deleteKey"})],c.prototype,"deleteKey",1);exports.a = c;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGSNFNRH2cjs = require('./chunk-GSNFNRH2.cjs');var _chunk3VYGTPRFcjs = require('./chunk-3VYGTPRF.cjs');var _chunkXZ4NKVEBcjs = require('./chunk-XZ4NKVEB.cjs');var _chunkPSK7FYV7cjs = require('./chunk-PSK7FYV7.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var _ox = require('ox');var R={[_commonsdkbase.APIKeyEnvironmentPrefix.DEVELOPMENT]:"https://development.devicekey.store",[_commonsdkbase.APIKeyEnvironmentPrefix.STAGING]:"https://staging.devicekey.store",[_commonsdkbase.APIKeyEnvironmentPrefix.PRODUCTION]:"https://devicekey.store"},E=6e4,L="indexeddb-fatal",c= exports.a =class extends _chunk3VYGTPRFcjs.a{constructor(e){super(e);this.iframePromise=null;this.reloading=null;this.biometricRequestHandler=null;this.biometricListener=null;if(typeof window!="undefined"&&!_chunkGSNFNRH2cjs.a.call(void 0, ))throw new (0, _chunkXZ4NKVEBcjs.o)("Device signer requires a browser with third-party storage partitioning (Chrome \u2265 115, Firefox \u2265 103, or Safari). Without storage partitioning, different embedders of the same iframe can share IndexedDB, allowing cross-site key access. See https://developer.chrome.com/blog/storage-partitioning");let r=_commonsdkbase.getEnvironmentForKey.call(void 0, e);if(r==null)throw new Error("Unable to determine environment from API key");this.iframeUrl=R[r]}setBiometricRequestHandler(e){this.biometricRequestHandler=e}generateKey(){return _chunkDSIFRRBScjs.h.call(void 0, this,arguments,function*(e={biometricPolicy:"none"}){return(yield this.rpc("generateKey",e)).publicKeyBase64})}mapAddressToKey(e,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){yield this.rpc("mapAddressToKey",{address:e,publicKeyBase64:r})})}getKey(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.rpc("getKey",{address:e})).publicKeyBase64})}hasKey(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.rpc("hasKey",{publicKeyBase64:e})).hasKey})}signMessage(e,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return yield this.rpc("signMessage",{address:e,message:r})})}deleteKey(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){yield this.rpc("deleteKey",{address:e})})}destroy(){this.biometricListener!=null&&(window.removeEventListener("message",this.biometricListener),this.biometricListener=null),this.iframePromise!=null&&(this.iframePromise.then(e=>e.remove()).catch(()=>{}),this.iframePromise=null)}rpc(e,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let i=yield this.sendRpc(e,r);if(i.fatal){_chunkPSK7FYV7cjs.a.warn(`[IframeDeviceSignerKeyStorage] Recoverable IDB error on "${e}", reloading iframe and retrying`),yield this.reloadIframe();let t=yield this.sendRpc(e,r);if(t.fatal)throw new Error(`Device signer IDB fatal error on "${e}" persisted after iframe reload`);return t.value}return i.value})}sendRpc(e,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let t=(yield this.getIframe()).contentWindow;if(t==null)throw new Error("Device signer iframe has no contentWindow");let g=crypto.randomUUID(),a=new URL(this.iframeUrl).origin;return new Promise((s,o)=>{let f=setTimeout(()=>{window.removeEventListener("message",p),o(new Error(`Device signer RPC "${e}" timed out after ${E}ms`))},E);function p(y){let d=y.data;d==null||d.id!==g||y.origin===a&&(clearTimeout(f),window.removeEventListener("message",p),d.type==="error"&&d.code===L?s({fatal:!0}):d.type==="error"?o(new Error(d.error)):s({value:d.result,fatal:!1}))}window.addEventListener("message",p),t.postMessage({type:e,id:g,payload:r},this.iframeUrl)})})}reloadIframe(){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){if(this.reloading!=null)return this.reloading;let e=_chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){try{this.destroy(),yield this.getIframe()}finally{this.reloading=null}});return this.reloading=e,e})}setupBiometricListener(e){let r=new URL(this.iframeUrl).origin;this.biometricListener=i=>_chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){if(i.origin!==r)return;let t=i.data;if((t==null?void 0:t.type)!=="biometric-request")return;let g=e.contentWindow;if(g!=null)try{this.biometricRequestHandler!=null&&(yield this.biometricRequestHandler(t.action));let a=null;if(t.action==="createCredential"){let s=t.payload,o=yield _ox.WebAuthnP256.createCredential({name:s.name});a={id:o.id,publicKey:{x:`0x${o.publicKey.x.toString(16)}`,y:`0x${o.publicKey.y.toString(16)}`}}}else if(t.action==="sign"){let s=t.payload,{signature:o,metadata:f}=yield _ox.WebAuthnP256.sign({credentialId:s.credentialId,challenge:s.challenge});a={signature:{r:`0x${o.r.toString(16)}`,s:`0x${o.s.toString(16)}`},metadata:f}}g.postMessage({type:"biometric-response",id:t.id,result:a},this.iframeUrl)}catch(a){let s=a instanceof Error?a.message:"Unknown biometric error";g.postMessage({type:"biometric-response",id:t.id,error:s},this.iframeUrl)}}),window.addEventListener("message",this.biometricListener)}getIframe(){return this.iframePromise==null&&(this.iframePromise=this.createIframe().catch(e=>{throw this.iframePromise=null,e})),this.iframePromise}createIframe(){let e=document.createElement("iframe");return e.src=this.iframeUrl,Object.assign(e.style,{position:"absolute",opacity:"0",pointerEvents:"none",width:"0",height:"0",border:"none",top:"-9999px",left:"-9999px"}),new Promise((r,i)=>{e.onload=()=>{this.setupBiometricListener(e),r(e)},e.onerror=()=>i(new Error("Failed to load device signer iframe")),document.body.appendChild(e)})}getDeviceName(){var t;if(typeof navigator=="undefined")return"Unknown Device";let e=navigator.userAgent,r=this.parseDevice(e),i=this.parseBrowser(e);return r!=null&&i!=null?`${i} on ${r}`:(t=r!=null?r:i)!=null?t:"Unknown Device"}parseDevice(e){return/iPad/.test(e)?"iPad":/iPhone/.test(e)?"iPhone":/Macintosh|Mac OS X/.test(e)?"Mac":/Windows/.test(e)?"Windows":/Android/.test(e)?"Android":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"ChromeOS":null}parseBrowser(e){return/Edg\//.test(e)?"Edge":/OPR\/|Opera/.test(e)?"Opera":typeof navigator!="undefined"&&"brave"in navigator?"Brave":/Chrome\//.test(e)?"Chrome":/Safari\//.test(e)&&!/Chrome\//.test(e)?"Safari":/Firefox\//.test(e)?"Firefox":null}};_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkPSK7FYV7cjs.a,methodName:"deviceSignerKeyStorage.generateKey"})],c.prototype,"generateKey",1),_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkPSK7FYV7cjs.a,methodName:"deviceSignerKeyStorage.mapAddressToKey"})],c.prototype,"mapAddressToKey",1),_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkPSK7FYV7cjs.a,methodName:"deviceSignerKeyStorage.getKey"})],c.prototype,"getKey",1),_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkPSK7FYV7cjs.a,methodName:"deviceSignerKeyStorage.hasKey"})],c.prototype,"hasKey",1),_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkPSK7FYV7cjs.a,methodName:"deviceSignerKeyStorage.signMessage"})],c.prototype,"signMessage",1),_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkPSK7FYV7cjs.a,methodName:"deviceSignerKeyStorage.deleteKey"})],c.prototype,"deleteKey",1);exports.a = c;
@@ -1 +1 @@
1
- import{a}from"./chunk-EFBUJ2BS.js";import{a as r}from"./chunk-TY33CSCI.js";import{a as t}from"./chunk-ZUBX7T2L.js";import{a as n}from"./chunk-OQZTL6ZG.js";var i={evm:a,solana:r,stellar:t};function g(e){return i[n(e)]}function m(e){return Object.prototype.hasOwnProperty.call(i,e)}export{g as a,m as b};
1
+ import{a}from"./chunk-M3IEG5GA.js";import{a as r}from"./chunk-QVE2LOBH.js";import{a as t}from"./chunk-SZXFHFA5.js";import{a as n}from"./chunk-OQZTL6ZG.js";var i={evm:a,solana:r,stellar:t};function g(e){return i[n(e)]}function m(e){return Object.prototype.hasOwnProperty.call(i,e)}export{g as a,m as b};
@@ -1 +1 @@
1
- import{a as n}from"./chunk-VPJBVKHY.js";import{a as s}from"./chunk-5LNDUSMZ.js";import{a as l}from"./chunk-RFWY44CJ.js";import{a,b as i}from"./chunk-TJBIBZMF.js";import{h as r}from"./chunk-NU7VF7MC.js";import{createCrossmint as C}from"@crossmint/common-sdk-base";import{WebAuthnP256 as p}from"ox";var o=class c{constructor(e){i(e.apiKey);let t=new l(e);this.walletFactory=new n(t),a.info("wallets.sdk.initialized")}static from(e){return new c(e)}getWallet(e,t){return r(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 r(this,null,function*(){return yield this.walletFactory.createWallet(e)})}createDeviceSigner(e,t){return r(this,null,function*(){return yield s(e,t)})}createPasskeySigner(e){return r(this,null,function*(){let t=yield p.createCredential({name:e});return{type:"passkey",id:t.id,name:e,publicKey:{x:t.publicKey.x.toString(),y:t.publicKey.y.toString()}}})}};export{C as a,o as b};
1
+ import{a as n}from"./chunk-ECHVBCCM.js";import{a as s}from"./chunk-5LNDUSMZ.js";import{a as l}from"./chunk-OQN2SFDC.js";import{a,b as i}from"./chunk-4ILFMPNK.js";import{h as r}from"./chunk-NU7VF7MC.js";import{createCrossmint as C}from"@crossmint/common-sdk-base";import{WebAuthnP256 as p}from"ox";var o=class c{constructor(e){i(e.apiKey);let t=new l(e);this.walletFactory=new n(t),a.info("wallets.sdk.initialized")}static from(e){return new c(e)}getWallet(e,t){return r(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 r(this,null,function*(){return yield this.walletFactory.createWallet(e)})}createDeviceSigner(e,t){return r(this,null,function*(){return yield s(e,t)})}createPasskeySigner(e){return r(this,null,function*(){let t=yield p.createCredential({name:e});return{type:"passkey",id:t.id,name:e,publicKey:{x:t.publicKey.x.toString(),y:t.publicKey.y.toString()}}})}};export{C as a,o as b};
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-YRZHJB2T.cjs');var _chunkYEHBDKR3cjs = require('./chunk-YEHBDKR3.cjs');var _chunkMHKIVDKZcjs = require('./chunk-MHKIVDKZ.cjs');var _chunk65BIFI5Ecjs = require('./chunk-65BIFI5E.cjs');var _chunkUPSASDJPcjs = require('./chunk-UPSASDJP.cjs');var _chunk3N7PKPCHcjs = require('./chunk-3N7PKPCH.cjs');require('./chunk-EAU5Z5O5.cjs');var _chunkIDRQPLGQcjs = require('./chunk-IDRQPLGQ.cjs');require('./chunk-AUDTBFZ4.cjs');require('./chunk-7SGXWFCJ.cjs');require('./chunk-NUIG3XY3.cjs');require('./chunk-CUHDOBKN.cjs');var _chunkGMU3ZYLScjs = require('./chunk-GMU3ZYLS.cjs');require('./chunk-677M3EWV.cjs');require('./chunk-I3H3U7XW.cjs');var _chunkHE4BTHTYcjs = require('./chunk-HE4BTHTY.cjs');require('./chunk-GSNFNRH2.cjs');var _chunk3VYGTPRFcjs = require('./chunk-3VYGTPRF.cjs');require('./chunk-OV256XVK.cjs');require('./chunk-IW4FVUP5.cjs');require('./chunk-GUFTPTSI.cjs');require('./chunk-EBQT52SL.cjs');require('./chunk-JEJYT3WD.cjs');require('./chunk-MIPKK2GZ.cjs');require('./chunk-UWX7ID4X.cjs');require('./chunk-B5U3A75U.cjs');require('./chunk-W6L7J3KL.cjs');require('./chunk-7SOKSLRQ.cjs');require('./chunk-UP5EGWNN.cjs');require('./chunk-Q3LD5CYJ.cjs');require('./chunk-5IC7UWND.cjs');require('./chunk-KULR5B4O.cjs');require('./chunk-IGRPHTXZ.cjs');require('./chunk-Q66YRLSW.cjs');require('./chunk-VMDJJX7P.cjs');require('./chunk-HJH2S644.cjs');require('./chunk-AK3REMFI.cjs');require('./chunk-PO6S7UR3.cjs');require('./chunk-VCX2M3JY.cjs');require('./chunk-P7KLEZYV.cjs');require('./chunk-PEY3R7XG.cjs');require('./chunk-PMQQEVKL.cjs');require('./chunk-ATIC4ENG.cjs');require('./chunk-2YZQ4YYU.cjs');require('./chunk-5FH7WFWL.cjs');require('./chunk-FQZXBS7L.cjs');require('./chunk-5FVDLMWW.cjs');var _chunkQPCZFIUVcjs = require('./chunk-QPCZFIUV.cjs');require('./chunk-LWA3SX6Z.cjs');require('./chunk-XWQC6G7N.cjs');require('./chunk-R4SBFRTM.cjs');require('./chunk-HYWIWJ6H.cjs');require('./chunk-SCEPJO4Q.cjs');require('./chunk-LMHH6ODX.cjs');require('./chunk-CDHMNLZ6.cjs');require('./chunk-6HXIZLEQ.cjs');var _chunk6GZQZEGQcjs = require('./chunk-6GZQZEGQ.cjs');require('./chunk-ECAM5KTH.cjs');require('./chunk-W6APCBJW.cjs');require('./chunk-UF5HZQUO.cjs');require('./chunk-SNBCG5HR.cjs');require('./chunk-P4EW7S5I.cjs');require('./chunk-JNKTRQPS.cjs');require('./chunk-ENU3EKBG.cjs');require('./chunk-WTJC5QBH.cjs');require('./chunk-5X4EOJFG.cjs');require('./chunk-HRUMWG2F.cjs');require('./chunk-IR5WN6FQ.cjs');require('./chunk-GEY574TH.cjs');require('./chunk-UE3WVHTM.cjs');var _chunkXZ4NKVEBcjs = require('./chunk-XZ4NKVEB.cjs');require('./chunk-CCIGWTAO.cjs');require('./chunk-7O3W4JAP.cjs');require('./chunk-6ZAGINES.cjs');require('./chunk-DSIFRRBS.cjs');exports.AuthRejectedError = _chunkQPCZFIUVcjs.a; exports.CrossmintWallets = _chunk3N7PKPCHcjs.b; exports.DeviceSignerKeyStorage = _chunk3VYGTPRFcjs.a; exports.EVMWallet = _chunkMHKIVDKZcjs.a; exports.IframeDeviceSignerKeyStorage = _chunkHE4BTHTYcjs.a; exports.InvalidTransferAmountError = _chunkXZ4NKVEBcjs.y; exports.JWTDecryptionError = _chunkXZ4NKVEBcjs.M; exports.JWTExpiredError = _chunkXZ4NKVEBcjs.K; exports.JWTIdentifierError = _chunkXZ4NKVEBcjs.N; exports.JWTInvalidError = _chunkXZ4NKVEBcjs.L; exports.KeyExportError = _chunkQPCZFIUVcjs.d; exports.NotAuthorizedError = _chunkXZ4NKVEBcjs.J; exports.OnboardingSessionExpiredError = _chunkQPCZFIUVcjs.e; exports.OtpValidationError = _chunkQPCZFIUVcjs.b; exports.QuorumSignerNotSupportedError = _chunkXZ4NKVEBcjs.n; exports.SignerStatusError = _chunkQPCZFIUVcjs.c; exports.SolanaWallet = _chunk65BIFI5Ecjs.a; exports.StellarWallet = _chunkUPSASDJPcjs.a; exports.UnsupportedBrowserError = _chunkXZ4NKVEBcjs.o; exports.Wallet = _chunkIDRQPLGQcjs.a; exports.WalletNotAvailableError = _chunkXZ4NKVEBcjs.e; exports.WalletsApiClient = _chunk6GZQZEGQcjs.a; exports.createCrossmint = _chunk3N7PKPCHcjs.a; exports.createDeviceSigner = _chunkGMU3ZYLScjs.a; exports.createServerSigner = _chunkYEHBDKR3cjs.a; exports.isExportableSignerAdapter = _chunkQPCZFIUVcjs.g;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-YRZHJB2T.cjs');var _chunkYEHBDKR3cjs = require('./chunk-YEHBDKR3.cjs');var _chunkN7DIMQBPcjs = require('./chunk-N7DIMQBP.cjs');var _chunkP3SMYLDMcjs = require('./chunk-P3SMYLDM.cjs');var _chunkBM6GYJSEcjs = require('./chunk-BM6GYJSE.cjs');var _chunkJJVNOMYXcjs = require('./chunk-JJVNOMYX.cjs');require('./chunk-HSLCNCPW.cjs');var _chunkJ2C3XP4Zcjs = require('./chunk-J2C3XP4Z.cjs');require('./chunk-3WJUXFU2.cjs');require('./chunk-MYIY3CX7.cjs');require('./chunk-FJYRJSKU.cjs');require('./chunk-CUHDOBKN.cjs');var _chunkGMU3ZYLScjs = require('./chunk-GMU3ZYLS.cjs');require('./chunk-WTLEFDHS.cjs');require('./chunk-I3H3U7XW.cjs');var _chunkXN7S5JJYcjs = require('./chunk-XN7S5JJY.cjs');require('./chunk-GSNFNRH2.cjs');var _chunk3VYGTPRFcjs = require('./chunk-3VYGTPRF.cjs');require('./chunk-44ICOOCJ.cjs');require('./chunk-IW4FVUP5.cjs');require('./chunk-GUFTPTSI.cjs');require('./chunk-EBQT52SL.cjs');require('./chunk-JEJYT3WD.cjs');require('./chunk-MIPKK2GZ.cjs');require('./chunk-UWX7ID4X.cjs');require('./chunk-WOQNCBUX.cjs');require('./chunk-W6L7J3KL.cjs');require('./chunk-7SOKSLRQ.cjs');require('./chunk-UP5EGWNN.cjs');require('./chunk-NL4MRKYW.cjs');require('./chunk-5IC7UWND.cjs');require('./chunk-KULR5B4O.cjs');require('./chunk-IGRPHTXZ.cjs');require('./chunk-Q66YRLSW.cjs');require('./chunk-VMDJJX7P.cjs');require('./chunk-HJH2S644.cjs');require('./chunk-AK3REMFI.cjs');require('./chunk-PO6S7UR3.cjs');require('./chunk-LKEPKOKU.cjs');require('./chunk-L5X5RA7E.cjs');require('./chunk-GIYB3U37.cjs');require('./chunk-S3PBSOOZ.cjs');require('./chunk-ATIC4ENG.cjs');require('./chunk-2YZQ4YYU.cjs');require('./chunk-5FH7WFWL.cjs');require('./chunk-FQZXBS7L.cjs');require('./chunk-5FVDLMWW.cjs');var _chunkQPCZFIUVcjs = require('./chunk-QPCZFIUV.cjs');require('./chunk-LWA3SX6Z.cjs');require('./chunk-XWQC6G7N.cjs');require('./chunk-R4SBFRTM.cjs');require('./chunk-HYWIWJ6H.cjs');require('./chunk-SCEPJO4Q.cjs');require('./chunk-LMHH6ODX.cjs');require('./chunk-CDHMNLZ6.cjs');require('./chunk-6HXIZLEQ.cjs');var _chunkJ5CHOVJLcjs = require('./chunk-J5CHOVJL.cjs');require('./chunk-ECAM5KTH.cjs');require('./chunk-5VUIA6TB.cjs');require('./chunk-IX5TSD73.cjs');require('./chunk-MGQGQXRP.cjs');require('./chunk-5BRX4CFK.cjs');require('./chunk-JNKTRQPS.cjs');require('./chunk-ENU3EKBG.cjs');require('./chunk-OHTCLNE3.cjs');require('./chunk-5X4EOJFG.cjs');require('./chunk-HRUMWG2F.cjs');require('./chunk-IR5WN6FQ.cjs');require('./chunk-GEY574TH.cjs');require('./chunk-UE3WVHTM.cjs');var _chunkXZ4NKVEBcjs = require('./chunk-XZ4NKVEB.cjs');require('./chunk-CCIGWTAO.cjs');require('./chunk-PSK7FYV7.cjs');require('./chunk-LJNSIXGN.cjs');require('./chunk-DSIFRRBS.cjs');exports.AuthRejectedError = _chunkQPCZFIUVcjs.a; exports.CrossmintWallets = _chunkJJVNOMYXcjs.b; exports.DeviceSignerKeyStorage = _chunk3VYGTPRFcjs.a; exports.EVMWallet = _chunkN7DIMQBPcjs.a; exports.IframeDeviceSignerKeyStorage = _chunkXN7S5JJYcjs.a; exports.InvalidTransferAmountError = _chunkXZ4NKVEBcjs.y; exports.JWTDecryptionError = _chunkXZ4NKVEBcjs.M; exports.JWTExpiredError = _chunkXZ4NKVEBcjs.K; exports.JWTIdentifierError = _chunkXZ4NKVEBcjs.N; exports.JWTInvalidError = _chunkXZ4NKVEBcjs.L; exports.KeyExportError = _chunkQPCZFIUVcjs.d; exports.NotAuthorizedError = _chunkXZ4NKVEBcjs.J; exports.OnboardingSessionExpiredError = _chunkQPCZFIUVcjs.e; exports.OtpValidationError = _chunkQPCZFIUVcjs.b; exports.QuorumSignerNotSupportedError = _chunkXZ4NKVEBcjs.n; exports.SignerStatusError = _chunkQPCZFIUVcjs.c; exports.SolanaWallet = _chunkP3SMYLDMcjs.a; exports.StellarWallet = _chunkBM6GYJSEcjs.a; exports.UnsupportedBrowserError = _chunkXZ4NKVEBcjs.o; exports.Wallet = _chunkJ2C3XP4Zcjs.a; exports.WalletNotAvailableError = _chunkXZ4NKVEBcjs.e; exports.WalletsApiClient = _chunkJ5CHOVJLcjs.a; exports.createCrossmint = _chunkJJVNOMYXcjs.a; exports.createDeviceSigner = _chunkGMU3ZYLScjs.a; exports.createServerSigner = _chunkYEHBDKR3cjs.a; exports.isExportableSignerAdapter = _chunkQPCZFIUVcjs.g;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { CrossmintWallets } from './sdk.cjs';
2
2
  export { InvalidTransferAmountError, QuorumSignerNotSupportedError, UnsupportedBrowserError, WalletNotAvailableError } from './utils/errors.cjs';
3
3
  export { ApiClient as WalletsApiClient } from './api/client.cjs';
4
- export { A as AddSignerOptions, a as ApiKeySignerLocator, b as ApproveOptions, c as ApproveParams, d as AuthRejectedError, B as Balances, C as Callbacks, e as ClientSideWalletArgsFor, f as ClientSideWalletCreateArgs, D as DeviceSignerConfig, g as DeviceSignerLocator, E as EVMTransactionInput, h as EmailSignerConfig, i as EmailSignerLocator, j as ExportSignerTEEConnection, k as ExportableSignerAdapter, l as ExternalWalletRegistrationConfig, m as ExternalWalletSignerConfigForChain, n as ExternalWalletSignerLocator, K as KeyExportError, O as OnboardingSessionExpiredError, o as OtpValidationError, P as PasskeySignerLocator, p as PhoneSignerConfig, q as PhoneSignerLocator, R as RegisterSignerPasskeyParams, r as RemoveSignerOptions, S as Scope, s as ServerSignerConfig, t as Signature, u as Signer, v as SignerAdapter, w as SignerConfigForChain, x as SignerLocator, y as SignerStatus, z as SignerStatusError, F as SolanaTransactionInput, T as Transaction, G as TransferScope, H as Transfers, W as WalletArgsFor, I as WalletCreateArgs, J as WalletOptions, L as WalletPlugin, M as isExportableSignerAdapter } from './types-4EOfiBxs.cjs';
4
+ export { A as AddSignerOptions, a as ApiKeySignerLocator, b as ApproveOptions, c as ApproveParams, d as AuthRejectedError, B as Balances, C as Callbacks, e as ClientSideWalletArgsFor, f as ClientSideWalletCreateArgs, D as DeviceSignerConfig, g as DeviceSignerLocator, E as EVMTransactionInput, h as EmailSignerConfig, i as EmailSignerLocator, j as ExportSignerTEEConnection, k as ExportableSignerAdapter, l as ExternalWalletRegistrationConfig, m as ExternalWalletSignerConfigForChain, n as ExternalWalletSignerLocator, K as KeyExportError, O as OnboardingSessionExpiredError, o as OtpValidationError, P as PasskeySignerLocator, p as PhoneSignerConfig, q as PhoneSignerLocator, R as RegisterSignerPasskeyParams, r as RemoveSignerOptions, S as Scope, s as ServerSignerConfig, t as Signature, u as Signer, v as SignerAdapter, w as SignerConfigForChain, x as SignerLocator, y as SignerStatus, z as SignerStatusError, F as SolanaTransactionInput, T as Transaction, G as TransferScope, H as Transfers, W as WalletArgsFor, I as WalletCreateArgs, J as WalletOptions, L as WalletPlugin, M as isExportableSignerAdapter } from './types-86FbKjRz.cjs';
5
5
  export { Wallet } from './wallets/wallet.cjs';
6
6
  export { SolanaWallet } from './wallets/solana.cjs';
7
7
  export { EVMWallet } from './wallets/evm.cjs';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { CrossmintWallets } from './sdk.js';
2
2
  export { InvalidTransferAmountError, QuorumSignerNotSupportedError, UnsupportedBrowserError, WalletNotAvailableError } from './utils/errors.js';
3
3
  export { ApiClient as WalletsApiClient } from './api/client.js';
4
- export { A as AddSignerOptions, a as ApiKeySignerLocator, b as ApproveOptions, c as ApproveParams, d as AuthRejectedError, B as Balances, C as Callbacks, e as ClientSideWalletArgsFor, f as ClientSideWalletCreateArgs, D as DeviceSignerConfig, g as DeviceSignerLocator, E as EVMTransactionInput, h as EmailSignerConfig, i as EmailSignerLocator, j as ExportSignerTEEConnection, k as ExportableSignerAdapter, l as ExternalWalletRegistrationConfig, m as ExternalWalletSignerConfigForChain, n as ExternalWalletSignerLocator, K as KeyExportError, O as OnboardingSessionExpiredError, o as OtpValidationError, P as PasskeySignerLocator, p as PhoneSignerConfig, q as PhoneSignerLocator, R as RegisterSignerPasskeyParams, r as RemoveSignerOptions, S as Scope, s as ServerSignerConfig, t as Signature, u as Signer, v as SignerAdapter, w as SignerConfigForChain, x as SignerLocator, y as SignerStatus, z as SignerStatusError, F as SolanaTransactionInput, T as Transaction, G as TransferScope, H as Transfers, W as WalletArgsFor, I as WalletCreateArgs, J as WalletOptions, L as WalletPlugin, M as isExportableSignerAdapter } from './types-DfpYAsst.js';
4
+ export { A as AddSignerOptions, a as ApiKeySignerLocator, b as ApproveOptions, c as ApproveParams, d as AuthRejectedError, B as Balances, C as Callbacks, e as ClientSideWalletArgsFor, f as ClientSideWalletCreateArgs, D as DeviceSignerConfig, g as DeviceSignerLocator, E as EVMTransactionInput, h as EmailSignerConfig, i as EmailSignerLocator, j as ExportSignerTEEConnection, k as ExportableSignerAdapter, l as ExternalWalletRegistrationConfig, m as ExternalWalletSignerConfigForChain, n as ExternalWalletSignerLocator, K as KeyExportError, O as OnboardingSessionExpiredError, o as OtpValidationError, P as PasskeySignerLocator, p as PhoneSignerConfig, q as PhoneSignerLocator, R as RegisterSignerPasskeyParams, r as RemoveSignerOptions, S as Scope, s as ServerSignerConfig, t as Signature, u as Signer, v as SignerAdapter, w as SignerConfigForChain, x as SignerLocator, y as SignerStatus, z as SignerStatusError, F as SolanaTransactionInput, T as Transaction, G as TransferScope, H as Transfers, W as WalletArgsFor, I as WalletCreateArgs, J as WalletOptions, L as WalletPlugin, M as isExportableSignerAdapter } from './types-BcjKqQz3.js';
5
5
  export { Wallet } from './wallets/wallet.js';
6
6
  export { SolanaWallet } from './wallets/solana.js';
7
7
  export { EVMWallet } from './wallets/evm.js';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import"./chunk-DTGCFFNW.js";import{a as T}from"./chunk-WTIV4TTS.js";import{a as u}from"./chunk-C2LCF6GA.js";import{a as A}from"./chunk-N7SKSCSW.js";import{a as h}from"./chunk-KZ7LB6ZV.js";import{a as v,b as y}from"./chunk-KVGWACFA.js";import"./chunk-VPJBVKHY.js";import{a as d}from"./chunk-3TZJ6D4G.js";import"./chunk-KSN4TWLX.js";import"./chunk-6IV3GB5W.js";import"./chunk-F3CW7X6C.js";import"./chunk-TOAFCAVT.js";import{a as W}from"./chunk-5LNDUSMZ.js";import"./chunk-HIHX5FRO.js";import"./chunk-OMTJMVSG.js";import{a as C}from"./chunk-WO4ZWJT6.js";import"./chunk-NZXYWQE5.js";import{a as x}from"./chunk-IOSADDL5.js";import"./chunk-3A424HCV.js";import"./chunk-OEMMPPUX.js";import"./chunk-5HMRFOCH.js";import"./chunk-OE6CWWFM.js";import"./chunk-7BW7B47N.js";import"./chunk-VTTD4HPY.js";import"./chunk-TM45QNB3.js";import"./chunk-VFJ7NZBI.js";import"./chunk-VCOKK7C2.js";import"./chunk-STRSYJNY.js";import"./chunk-ARQVCU6M.js";import"./chunk-SGP5B33N.js";import"./chunk-L52GDMSH.js";import"./chunk-SEOBV6KR.js";import"./chunk-QM3BB4E2.js";import"./chunk-TSJUK3ED.js";import"./chunk-277G6KNG.js";import"./chunk-IQ3QQ4M6.js";import"./chunk-GA7EPR4Z.js";import"./chunk-YDZRBHS3.js";import"./chunk-F3NUWFQW.js";import"./chunk-3CEGPUJH.js";import"./chunk-6U5MZQQP.js";import"./chunk-XEWCMK3Z.js";import"./chunk-IHMMTMFG.js";import"./chunk-E3H6RZHM.js";import"./chunk-EM3D5Q3A.js";import"./chunk-3QKB6K3J.js";import"./chunk-K7BPGUFU.js";import{a as p,b as s,c as E,d as f,e as c,g as m}from"./chunk-DCKFFFPG.js";import"./chunk-FJPAMX7L.js";import"./chunk-MN2BGRRJ.js";import"./chunk-FQ5F3VYJ.js";import"./chunk-HAQMNZO5.js";import"./chunk-2YLRFJ66.js";import"./chunk-TMOWGJ5Z.js";import"./chunk-MLROTECD.js";import"./chunk-5IFDVB4Y.js";import{a as S}from"./chunk-RFWY44CJ.js";import"./chunk-KBJA7JDT.js";import"./chunk-EGX2IXWU.js";import"./chunk-EFBUJ2BS.js";import"./chunk-TY33CSCI.js";import"./chunk-ZUBX7T2L.js";import"./chunk-B4GYB3XY.js";import"./chunk-OQZTL6ZG.js";import"./chunk-URQQBUUX.js";import"./chunk-FT5EVMLB.js";import"./chunk-SVIKBM3S.js";import"./chunk-KKQBZXFE.js";import"./chunk-S3DYQVRD.js";import"./chunk-KUP7H7X2.js";import{J as n,K as i,L as a,M as l,N as g,e as r,n as e,o as t,y as o}from"./chunk-7FEY62ID.js";import"./chunk-455NK5LB.js";import"./chunk-TJBIBZMF.js";import"./chunk-NUBGDLR2.js";import"./chunk-NU7VF7MC.js";export{p as AuthRejectedError,y as CrossmintWallets,x as DeviceSignerKeyStorage,u as EVMWallet,C as IframeDeviceSignerKeyStorage,o as InvalidTransferAmountError,l as JWTDecryptionError,i as JWTExpiredError,g as JWTIdentifierError,a as JWTInvalidError,f as KeyExportError,n as NotAuthorizedError,c as OnboardingSessionExpiredError,s as OtpValidationError,e as QuorumSignerNotSupportedError,E as SignerStatusError,A as SolanaWallet,h as StellarWallet,t as UnsupportedBrowserError,d as Wallet,r as WalletNotAvailableError,S as WalletsApiClient,v as createCrossmint,W as createDeviceSigner,T as createServerSigner,m as isExportableSignerAdapter};
1
+ import"./chunk-DTGCFFNW.js";import{a as T}from"./chunk-WTIV4TTS.js";import{a as u}from"./chunk-UTZP5A65.js";import{a as A}from"./chunk-WQDLMGEG.js";import{a as h}from"./chunk-53JN7AMK.js";import{a as v,b as y}from"./chunk-ZF4ENDFP.js";import"./chunk-ECHVBCCM.js";import{a as d}from"./chunk-TZGYISF7.js";import"./chunk-CB3YEJ7F.js";import"./chunk-2277DKO3.js";import"./chunk-T2R4SPKJ.js";import"./chunk-TOAFCAVT.js";import{a as W}from"./chunk-5LNDUSMZ.js";import"./chunk-OUZECW5T.js";import"./chunk-OMTJMVSG.js";import{a as C}from"./chunk-BDCQ4HVW.js";import"./chunk-NZXYWQE5.js";import{a as x}from"./chunk-IOSADDL5.js";import"./chunk-JEKHYLBB.js";import"./chunk-OEMMPPUX.js";import"./chunk-5HMRFOCH.js";import"./chunk-OE6CWWFM.js";import"./chunk-7BW7B47N.js";import"./chunk-VTTD4HPY.js";import"./chunk-TM45QNB3.js";import"./chunk-W36RYDND.js";import"./chunk-VCOKK7C2.js";import"./chunk-STRSYJNY.js";import"./chunk-ARQVCU6M.js";import"./chunk-3SHAB7GH.js";import"./chunk-L52GDMSH.js";import"./chunk-SEOBV6KR.js";import"./chunk-QM3BB4E2.js";import"./chunk-TSJUK3ED.js";import"./chunk-277G6KNG.js";import"./chunk-IQ3QQ4M6.js";import"./chunk-GA7EPR4Z.js";import"./chunk-YDZRBHS3.js";import"./chunk-KJNGLQC7.js";import"./chunk-XHANQPKI.js";import"./chunk-NUGL76QG.js";import"./chunk-26DL7XRG.js";import"./chunk-IHMMTMFG.js";import"./chunk-E3H6RZHM.js";import"./chunk-EM3D5Q3A.js";import"./chunk-3QKB6K3J.js";import"./chunk-K7BPGUFU.js";import{a as p,b as s,c as E,d as f,e as c,g as m}from"./chunk-DCKFFFPG.js";import"./chunk-FJPAMX7L.js";import"./chunk-MN2BGRRJ.js";import"./chunk-FQ5F3VYJ.js";import"./chunk-HAQMNZO5.js";import"./chunk-2YLRFJ66.js";import"./chunk-TMOWGJ5Z.js";import"./chunk-MLROTECD.js";import"./chunk-5IFDVB4Y.js";import{a as S}from"./chunk-OQN2SFDC.js";import"./chunk-KBJA7JDT.js";import"./chunk-YRX44YXB.js";import"./chunk-M3IEG5GA.js";import"./chunk-QVE2LOBH.js";import"./chunk-SZXFHFA5.js";import"./chunk-B4GYB3XY.js";import"./chunk-OQZTL6ZG.js";import"./chunk-N7Z3C5RJ.js";import"./chunk-FT5EVMLB.js";import"./chunk-SVIKBM3S.js";import"./chunk-KKQBZXFE.js";import"./chunk-S3DYQVRD.js";import"./chunk-KUP7H7X2.js";import{J as n,K as i,L as a,M as l,N as g,e as r,n as e,o as t,y as o}from"./chunk-7FEY62ID.js";import"./chunk-455NK5LB.js";import"./chunk-4ILFMPNK.js";import"./chunk-SCEZVF7J.js";import"./chunk-NU7VF7MC.js";export{p as AuthRejectedError,y as CrossmintWallets,x as DeviceSignerKeyStorage,u as EVMWallet,C as IframeDeviceSignerKeyStorage,o as InvalidTransferAmountError,l as JWTDecryptionError,i as JWTExpiredError,g as JWTIdentifierError,a as JWTInvalidError,f as KeyExportError,n as NotAuthorizedError,c as OnboardingSessionExpiredError,s as OtpValidationError,e as QuorumSignerNotSupportedError,E as SignerStatusError,A as SolanaWallet,h as StellarWallet,t as UnsupportedBrowserError,d as Wallet,r as WalletNotAvailableError,S as WalletsApiClient,v as createCrossmint,W as createDeviceSigner,T as createServerSigner,m as isExportableSignerAdapter};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-CCIGWTAO.cjs');var _chunk7O3W4JAPcjs = require('../chunk-7O3W4JAP.cjs');require('../chunk-6ZAGINES.cjs');require('../chunk-DSIFRRBS.cjs');exports.initWalletsLogger = _chunk7O3W4JAPcjs.b; exports.walletsLogger = _chunk7O3W4JAPcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-CCIGWTAO.cjs');var _chunkPSK7FYV7cjs = require('../chunk-PSK7FYV7.cjs');require('../chunk-LJNSIXGN.cjs');require('../chunk-DSIFRRBS.cjs');exports.initWalletsLogger = _chunkPSK7FYV7cjs.b; exports.walletsLogger = _chunkPSK7FYV7cjs.a;
@@ -1 +1 @@
1
- import"../chunk-455NK5LB.js";import{a,b}from"../chunk-TJBIBZMF.js";import"../chunk-NUBGDLR2.js";import"../chunk-NU7VF7MC.js";export{b as initWalletsLogger,a as walletsLogger};
1
+ import"../chunk-455NK5LB.js";import{a,b}from"../chunk-4ILFMPNK.js";import"../chunk-SCEZVF7J.js";import"../chunk-NU7VF7MC.js";export{b as initWalletsLogger,a as walletsLogger};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7O3W4JAPcjs = require('../chunk-7O3W4JAP.cjs');require('../chunk-6ZAGINES.cjs');require('../chunk-DSIFRRBS.cjs');exports.initWalletsLogger = _chunk7O3W4JAPcjs.b; exports.walletsLogger = _chunk7O3W4JAPcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkPSK7FYV7cjs = require('../chunk-PSK7FYV7.cjs');require('../chunk-LJNSIXGN.cjs');require('../chunk-DSIFRRBS.cjs');exports.initWalletsLogger = _chunkPSK7FYV7cjs.b; exports.walletsLogger = _chunkPSK7FYV7cjs.a;
@@ -1 +1 @@
1
- import{a,b}from"../chunk-TJBIBZMF.js";import"../chunk-NUBGDLR2.js";import"../chunk-NU7VF7MC.js";export{b as initWalletsLogger,a as walletsLogger};
1
+ import{a,b}from"../chunk-4ILFMPNK.js";import"../chunk-SCEZVF7J.js";import"../chunk-NU7VF7MC.js";export{b as initWalletsLogger,a as walletsLogger};
package/dist/sdk.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3N7PKPCHcjs = require('./chunk-3N7PKPCH.cjs');require('./chunk-EAU5Z5O5.cjs');require('./chunk-IDRQPLGQ.cjs');require('./chunk-AUDTBFZ4.cjs');require('./chunk-7SGXWFCJ.cjs');require('./chunk-NUIG3XY3.cjs');require('./chunk-CUHDOBKN.cjs');require('./chunk-GMU3ZYLS.cjs');require('./chunk-677M3EWV.cjs');require('./chunk-I3H3U7XW.cjs');require('./chunk-HE4BTHTY.cjs');require('./chunk-GSNFNRH2.cjs');require('./chunk-3VYGTPRF.cjs');require('./chunk-OV256XVK.cjs');require('./chunk-IW4FVUP5.cjs');require('./chunk-GUFTPTSI.cjs');require('./chunk-EBQT52SL.cjs');require('./chunk-JEJYT3WD.cjs');require('./chunk-MIPKK2GZ.cjs');require('./chunk-UWX7ID4X.cjs');require('./chunk-B5U3A75U.cjs');require('./chunk-W6L7J3KL.cjs');require('./chunk-7SOKSLRQ.cjs');require('./chunk-UP5EGWNN.cjs');require('./chunk-Q3LD5CYJ.cjs');require('./chunk-5IC7UWND.cjs');require('./chunk-KULR5B4O.cjs');require('./chunk-IGRPHTXZ.cjs');require('./chunk-Q66YRLSW.cjs');require('./chunk-VMDJJX7P.cjs');require('./chunk-HJH2S644.cjs');require('./chunk-AK3REMFI.cjs');require('./chunk-PO6S7UR3.cjs');require('./chunk-VCX2M3JY.cjs');require('./chunk-P7KLEZYV.cjs');require('./chunk-PEY3R7XG.cjs');require('./chunk-PMQQEVKL.cjs');require('./chunk-ATIC4ENG.cjs');require('./chunk-2YZQ4YYU.cjs');require('./chunk-5FH7WFWL.cjs');require('./chunk-FQZXBS7L.cjs');require('./chunk-5FVDLMWW.cjs');require('./chunk-QPCZFIUV.cjs');require('./chunk-LWA3SX6Z.cjs');require('./chunk-XWQC6G7N.cjs');require('./chunk-R4SBFRTM.cjs');require('./chunk-HYWIWJ6H.cjs');require('./chunk-SCEPJO4Q.cjs');require('./chunk-LMHH6ODX.cjs');require('./chunk-CDHMNLZ6.cjs');require('./chunk-6HXIZLEQ.cjs');require('./chunk-6GZQZEGQ.cjs');require('./chunk-ECAM5KTH.cjs');require('./chunk-W6APCBJW.cjs');require('./chunk-UF5HZQUO.cjs');require('./chunk-SNBCG5HR.cjs');require('./chunk-P4EW7S5I.cjs');require('./chunk-JNKTRQPS.cjs');require('./chunk-ENU3EKBG.cjs');require('./chunk-WTJC5QBH.cjs');require('./chunk-5X4EOJFG.cjs');require('./chunk-HRUMWG2F.cjs');require('./chunk-IR5WN6FQ.cjs');require('./chunk-GEY574TH.cjs');require('./chunk-UE3WVHTM.cjs');require('./chunk-XZ4NKVEB.cjs');require('./chunk-CCIGWTAO.cjs');require('./chunk-7O3W4JAP.cjs');require('./chunk-6ZAGINES.cjs');require('./chunk-DSIFRRBS.cjs');exports.CrossmintWallets = _chunk3N7PKPCHcjs.b; exports.createCrossmint = _chunk3N7PKPCHcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJJVNOMYXcjs = require('./chunk-JJVNOMYX.cjs');require('./chunk-HSLCNCPW.cjs');require('./chunk-J2C3XP4Z.cjs');require('./chunk-3WJUXFU2.cjs');require('./chunk-MYIY3CX7.cjs');require('./chunk-FJYRJSKU.cjs');require('./chunk-CUHDOBKN.cjs');require('./chunk-GMU3ZYLS.cjs');require('./chunk-WTLEFDHS.cjs');require('./chunk-I3H3U7XW.cjs');require('./chunk-XN7S5JJY.cjs');require('./chunk-GSNFNRH2.cjs');require('./chunk-3VYGTPRF.cjs');require('./chunk-44ICOOCJ.cjs');require('./chunk-IW4FVUP5.cjs');require('./chunk-GUFTPTSI.cjs');require('./chunk-EBQT52SL.cjs');require('./chunk-JEJYT3WD.cjs');require('./chunk-MIPKK2GZ.cjs');require('./chunk-UWX7ID4X.cjs');require('./chunk-WOQNCBUX.cjs');require('./chunk-W6L7J3KL.cjs');require('./chunk-7SOKSLRQ.cjs');require('./chunk-UP5EGWNN.cjs');require('./chunk-NL4MRKYW.cjs');require('./chunk-5IC7UWND.cjs');require('./chunk-KULR5B4O.cjs');require('./chunk-IGRPHTXZ.cjs');require('./chunk-Q66YRLSW.cjs');require('./chunk-VMDJJX7P.cjs');require('./chunk-HJH2S644.cjs');require('./chunk-AK3REMFI.cjs');require('./chunk-PO6S7UR3.cjs');require('./chunk-LKEPKOKU.cjs');require('./chunk-L5X5RA7E.cjs');require('./chunk-GIYB3U37.cjs');require('./chunk-S3PBSOOZ.cjs');require('./chunk-ATIC4ENG.cjs');require('./chunk-2YZQ4YYU.cjs');require('./chunk-5FH7WFWL.cjs');require('./chunk-FQZXBS7L.cjs');require('./chunk-5FVDLMWW.cjs');require('./chunk-QPCZFIUV.cjs');require('./chunk-LWA3SX6Z.cjs');require('./chunk-XWQC6G7N.cjs');require('./chunk-R4SBFRTM.cjs');require('./chunk-HYWIWJ6H.cjs');require('./chunk-SCEPJO4Q.cjs');require('./chunk-LMHH6ODX.cjs');require('./chunk-CDHMNLZ6.cjs');require('./chunk-6HXIZLEQ.cjs');require('./chunk-J5CHOVJL.cjs');require('./chunk-ECAM5KTH.cjs');require('./chunk-5VUIA6TB.cjs');require('./chunk-IX5TSD73.cjs');require('./chunk-MGQGQXRP.cjs');require('./chunk-5BRX4CFK.cjs');require('./chunk-JNKTRQPS.cjs');require('./chunk-ENU3EKBG.cjs');require('./chunk-OHTCLNE3.cjs');require('./chunk-5X4EOJFG.cjs');require('./chunk-HRUMWG2F.cjs');require('./chunk-IR5WN6FQ.cjs');require('./chunk-GEY574TH.cjs');require('./chunk-UE3WVHTM.cjs');require('./chunk-XZ4NKVEB.cjs');require('./chunk-CCIGWTAO.cjs');require('./chunk-PSK7FYV7.cjs');require('./chunk-LJNSIXGN.cjs');require('./chunk-DSIFRRBS.cjs');exports.CrossmintWallets = _chunkJJVNOMYXcjs.b; exports.createCrossmint = _chunkJJVNOMYXcjs.a;
package/dist/sdk.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Crossmint } from '@crossmint/common-sdk-base';
2
2
  export { Crossmint, createCrossmint } from '@crossmint/common-sdk-base';
3
- import { W as WalletArgsFor, I as WalletCreateArgs, D as DeviceSignerConfig, R as RegisterSignerPasskeyParams } from './types-4EOfiBxs.cjs';
3
+ import { W as WalletArgsFor, I as WalletCreateArgs, D as DeviceSignerConfig, R as RegisterSignerPasskeyParams } from './types-86FbKjRz.cjs';
4
4
  import { Chain } from './chains/chains.cjs';
5
5
  import { Wallet } from './wallets/wallet.cjs';
6
6
  import { DeviceSignerKeyStorage } from './utils/device-signers/DeviceSignerKeyStorage.cjs';
package/dist/sdk.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Crossmint } from '@crossmint/common-sdk-base';
2
2
  export { Crossmint, createCrossmint } from '@crossmint/common-sdk-base';
3
- import { W as WalletArgsFor, I as WalletCreateArgs, D as DeviceSignerConfig, R as RegisterSignerPasskeyParams } from './types-DfpYAsst.js';
3
+ import { W as WalletArgsFor, I as WalletCreateArgs, D as DeviceSignerConfig, R as RegisterSignerPasskeyParams } from './types-BcjKqQz3.js';
4
4
  import { Chain } from './chains/chains.js';
5
5
  import { Wallet } from './wallets/wallet.js';
6
6
  import { DeviceSignerKeyStorage } from './utils/device-signers/DeviceSignerKeyStorage.js';
package/dist/sdk.js CHANGED
@@ -1 +1 @@
1
- import{a,b}from"./chunk-KVGWACFA.js";import"./chunk-VPJBVKHY.js";import"./chunk-3TZJ6D4G.js";import"./chunk-KSN4TWLX.js";import"./chunk-6IV3GB5W.js";import"./chunk-F3CW7X6C.js";import"./chunk-TOAFCAVT.js";import"./chunk-5LNDUSMZ.js";import"./chunk-HIHX5FRO.js";import"./chunk-OMTJMVSG.js";import"./chunk-WO4ZWJT6.js";import"./chunk-NZXYWQE5.js";import"./chunk-IOSADDL5.js";import"./chunk-3A424HCV.js";import"./chunk-OEMMPPUX.js";import"./chunk-5HMRFOCH.js";import"./chunk-OE6CWWFM.js";import"./chunk-7BW7B47N.js";import"./chunk-VTTD4HPY.js";import"./chunk-TM45QNB3.js";import"./chunk-VFJ7NZBI.js";import"./chunk-VCOKK7C2.js";import"./chunk-STRSYJNY.js";import"./chunk-ARQVCU6M.js";import"./chunk-SGP5B33N.js";import"./chunk-L52GDMSH.js";import"./chunk-SEOBV6KR.js";import"./chunk-QM3BB4E2.js";import"./chunk-TSJUK3ED.js";import"./chunk-277G6KNG.js";import"./chunk-IQ3QQ4M6.js";import"./chunk-GA7EPR4Z.js";import"./chunk-YDZRBHS3.js";import"./chunk-F3NUWFQW.js";import"./chunk-3CEGPUJH.js";import"./chunk-6U5MZQQP.js";import"./chunk-XEWCMK3Z.js";import"./chunk-IHMMTMFG.js";import"./chunk-E3H6RZHM.js";import"./chunk-EM3D5Q3A.js";import"./chunk-3QKB6K3J.js";import"./chunk-K7BPGUFU.js";import"./chunk-DCKFFFPG.js";import"./chunk-FJPAMX7L.js";import"./chunk-MN2BGRRJ.js";import"./chunk-FQ5F3VYJ.js";import"./chunk-HAQMNZO5.js";import"./chunk-2YLRFJ66.js";import"./chunk-TMOWGJ5Z.js";import"./chunk-MLROTECD.js";import"./chunk-5IFDVB4Y.js";import"./chunk-RFWY44CJ.js";import"./chunk-KBJA7JDT.js";import"./chunk-EGX2IXWU.js";import"./chunk-EFBUJ2BS.js";import"./chunk-TY33CSCI.js";import"./chunk-ZUBX7T2L.js";import"./chunk-B4GYB3XY.js";import"./chunk-OQZTL6ZG.js";import"./chunk-URQQBUUX.js";import"./chunk-FT5EVMLB.js";import"./chunk-SVIKBM3S.js";import"./chunk-KKQBZXFE.js";import"./chunk-S3DYQVRD.js";import"./chunk-KUP7H7X2.js";import"./chunk-7FEY62ID.js";import"./chunk-455NK5LB.js";import"./chunk-TJBIBZMF.js";import"./chunk-NUBGDLR2.js";import"./chunk-NU7VF7MC.js";export{b as CrossmintWallets,a as createCrossmint};
1
+ import{a,b}from"./chunk-ZF4ENDFP.js";import"./chunk-ECHVBCCM.js";import"./chunk-TZGYISF7.js";import"./chunk-CB3YEJ7F.js";import"./chunk-2277DKO3.js";import"./chunk-T2R4SPKJ.js";import"./chunk-TOAFCAVT.js";import"./chunk-5LNDUSMZ.js";import"./chunk-OUZECW5T.js";import"./chunk-OMTJMVSG.js";import"./chunk-BDCQ4HVW.js";import"./chunk-NZXYWQE5.js";import"./chunk-IOSADDL5.js";import"./chunk-JEKHYLBB.js";import"./chunk-OEMMPPUX.js";import"./chunk-5HMRFOCH.js";import"./chunk-OE6CWWFM.js";import"./chunk-7BW7B47N.js";import"./chunk-VTTD4HPY.js";import"./chunk-TM45QNB3.js";import"./chunk-W36RYDND.js";import"./chunk-VCOKK7C2.js";import"./chunk-STRSYJNY.js";import"./chunk-ARQVCU6M.js";import"./chunk-3SHAB7GH.js";import"./chunk-L52GDMSH.js";import"./chunk-SEOBV6KR.js";import"./chunk-QM3BB4E2.js";import"./chunk-TSJUK3ED.js";import"./chunk-277G6KNG.js";import"./chunk-IQ3QQ4M6.js";import"./chunk-GA7EPR4Z.js";import"./chunk-YDZRBHS3.js";import"./chunk-KJNGLQC7.js";import"./chunk-XHANQPKI.js";import"./chunk-NUGL76QG.js";import"./chunk-26DL7XRG.js";import"./chunk-IHMMTMFG.js";import"./chunk-E3H6RZHM.js";import"./chunk-EM3D5Q3A.js";import"./chunk-3QKB6K3J.js";import"./chunk-K7BPGUFU.js";import"./chunk-DCKFFFPG.js";import"./chunk-FJPAMX7L.js";import"./chunk-MN2BGRRJ.js";import"./chunk-FQ5F3VYJ.js";import"./chunk-HAQMNZO5.js";import"./chunk-2YLRFJ66.js";import"./chunk-TMOWGJ5Z.js";import"./chunk-MLROTECD.js";import"./chunk-5IFDVB4Y.js";import"./chunk-OQN2SFDC.js";import"./chunk-KBJA7JDT.js";import"./chunk-YRX44YXB.js";import"./chunk-M3IEG5GA.js";import"./chunk-QVE2LOBH.js";import"./chunk-SZXFHFA5.js";import"./chunk-B4GYB3XY.js";import"./chunk-OQZTL6ZG.js";import"./chunk-N7Z3C5RJ.js";import"./chunk-FT5EVMLB.js";import"./chunk-SVIKBM3S.js";import"./chunk-KKQBZXFE.js";import"./chunk-S3DYQVRD.js";import"./chunk-KUP7H7X2.js";import"./chunk-7FEY62ID.js";import"./chunk-455NK5LB.js";import"./chunk-4ILFMPNK.js";import"./chunk-SCEZVF7J.js";import"./chunk-NU7VF7MC.js";export{b as CrossmintWallets,a as createCrossmint};
@@ -2,7 +2,7 @@ import { SignerDescriptor } from './types.cjs';
2
2
  import '@crossmint/client-sdk-window';
3
3
  import '@crossmint/client-signers';
4
4
  import '@crossmint/common-sdk-base';
5
- import '../../types-4EOfiBxs.cjs';
5
+ import '../../types-86FbKjRz.cjs';
6
6
  import 'viem';
7
7
  import '../../api/gen/types.gen.cjs';
8
8
  import 'ox';
@@ -2,7 +2,7 @@ import { SignerDescriptor } from './types.js';
2
2
  import '@crossmint/client-sdk-window';
3
3
  import '@crossmint/client-signers';
4
4
  import '@crossmint/common-sdk-base';
5
- import '../../types-DfpYAsst.js';
5
+ import '../../types-BcjKqQz3.js';
6
6
  import 'viem';
7
7
  import '../../api/gen/types.gen.js';
8
8
  import 'ox';
@@ -2,7 +2,7 @@ import { SignerDescriptor } from './types.cjs';
2
2
  import '@crossmint/client-sdk-window';
3
3
  import '@crossmint/client-signers';
4
4
  import '@crossmint/common-sdk-base';
5
- import '../../types-4EOfiBxs.cjs';
5
+ import '../../types-86FbKjRz.cjs';
6
6
  import 'viem';
7
7
  import '../../api/gen/types.gen.cjs';
8
8
  import 'ox';
@@ -2,7 +2,7 @@ import { SignerDescriptor } from './types.js';
2
2
  import '@crossmint/client-sdk-window';
3
3
  import '@crossmint/client-signers';
4
4
  import '@crossmint/common-sdk-base';
5
- import '../../types-DfpYAsst.js';
5
+ import '../../types-BcjKqQz3.js';
6
6
  import 'viem';
7
7
  import '../../api/gen/types.gen.js';
8
8
  import 'ox';