@crossmint/wallets-sdk 0.18.3 → 0.18.6

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 (197) hide show
  1. package/dist/api/client.cjs +10 -1
  2. package/dist/api/client.js +10 -1
  3. package/dist/api/gen/client.gen.cjs +7 -1
  4. package/dist/api/gen/client.gen.js +7 -1
  5. package/dist/api/gen/index.cjs +179 -1
  6. package/dist/api/gen/index.js +179 -1
  7. package/dist/api/gen/sdk.gen.cjs +178 -1
  8. package/dist/api/gen/sdk.gen.js +178 -1
  9. package/dist/api/gen/types.gen.js +1 -1
  10. package/dist/api/index.cjs +12 -1
  11. package/dist/api/index.js +12 -1
  12. package/dist/api/types.js +1 -1
  13. package/dist/chains/chains.cjs +9 -1
  14. package/dist/chains/chains.js +9 -1
  15. package/dist/chains/definitions/story.cjs +7 -1
  16. package/dist/chains/definitions/story.js +7 -1
  17. package/dist/chains/definitions/storyTestnet.cjs +7 -1
  18. package/dist/chains/definitions/storyTestnet.js +7 -1
  19. package/dist/chunk-2T5HHKUI.js +19 -0
  20. package/dist/chunk-34FDYDOM.cjs +87 -0
  21. package/dist/chunk-3U6UAYOV.js +25 -0
  22. package/dist/chunk-454RYNSZ.js +80 -0
  23. package/dist/chunk-455NK5LB.js +0 -0
  24. package/dist/chunk-55V4VMTX.cjs +25 -0
  25. package/dist/chunk-5BP6CVYY.cjs +58 -0
  26. package/dist/chunk-5YR2ILEW.js +69 -0
  27. package/dist/chunk-6G7ZWCCG.js +247 -0
  28. package/dist/chunk-7ECQJFYM.cjs +63 -0
  29. package/dist/chunk-7JFVG4IY.js +59 -0
  30. package/dist/chunk-AL77JANE.js +36 -0
  31. package/dist/chunk-B6JOIWRH.cjs +289 -0
  32. package/dist/chunk-BSC55MYK.cjs +43 -0
  33. package/dist/chunk-CCIGWTAO.cjs +1 -0
  34. package/dist/chunk-CHGPNMRL.cjs +36 -0
  35. package/dist/chunk-CL44FTXR.js +289 -0
  36. package/dist/chunk-CN2GVFBU.cjs +138 -0
  37. package/dist/chunk-DQCXGBZM.js +59 -0
  38. package/dist/chunk-E3OS753T.js +175 -0
  39. package/dist/chunk-EYJQSDDI.js +43 -0
  40. package/dist/chunk-F6E3ZDRG.cjs +175 -0
  41. package/dist/chunk-FPMW7Q5O.js +55 -0
  42. package/dist/chunk-G3LEJR3P.cjs +53 -0
  43. package/dist/chunk-G5NYLGM5.cjs +55 -0
  44. package/dist/chunk-GLRDLJS5.js +92 -0
  45. package/dist/chunk-GNF2U7IX.cjs +69 -0
  46. package/dist/chunk-GQIZWD4F.cjs +301 -0
  47. package/dist/chunk-HYKMSBCT.cjs +75 -0
  48. package/dist/chunk-IVNYZDI5.cjs +73 -0
  49. package/dist/chunk-K3HFAPSV.js +73 -0
  50. package/dist/chunk-KS63YEQ4.js +138 -0
  51. package/dist/chunk-KT3CVXFG.js +9 -0
  52. package/dist/chunk-LGONZW4W.cjs +629 -0
  53. package/dist/chunk-LHYSCUKJ.cjs +16 -0
  54. package/dist/chunk-LKAO2MV2.cjs +80 -0
  55. package/dist/chunk-LLFD22UQ.cjs +36 -0
  56. package/dist/chunk-MZBFXUHT.js +63 -0
  57. package/dist/chunk-NIBKCMQ2.cjs +19 -0
  58. package/dist/chunk-OKXSUK63.js +87 -0
  59. package/dist/chunk-R2OY54EJ.cjs +59 -0
  60. package/dist/chunk-RAWKXOHR.js +53 -0
  61. package/dist/chunk-RBHGZDDX.cjs +58 -0
  62. package/dist/chunk-RHR6P2KP.cjs +15 -0
  63. package/dist/chunk-RTRDZB52.js +778 -0
  64. package/dist/chunk-S5YXROL6.js +301 -0
  65. package/dist/chunk-SGINWAB6.js +155 -0
  66. package/dist/chunk-TK3EUCQ4.cjs +59 -0
  67. package/dist/chunk-TOHXQVLS.js +58 -0
  68. package/dist/chunk-UKBWSQ7R.js +629 -0
  69. package/dist/chunk-UMGB3Q7I.cjs +92 -0
  70. package/dist/chunk-V3QJQUT7.cjs +778 -0
  71. package/dist/chunk-WC7T2CR4.js +44 -0
  72. package/dist/chunk-WJUPOCKJ.js +15 -0
  73. package/dist/chunk-WQVJM3PG.js +16 -0
  74. package/dist/chunk-XC2V34TS.cjs +155 -0
  75. package/dist/chunk-XRA5GFH3.js +75 -0
  76. package/dist/chunk-YBA7WO32.cjs +44 -0
  77. package/dist/chunk-ZP4ZZCIE.js +58 -0
  78. package/dist/chunk-ZT7EGOCI.cjs +9 -0
  79. package/dist/chunk-ZTGRDOOH.js +36 -0
  80. package/dist/chunk-ZZJ7U5G3.cjs +247 -0
  81. package/dist/index.cjs +57 -1
  82. package/dist/index.js +57 -1
  83. package/dist/logger/index.cjs +11 -0
  84. package/dist/logger/index.d.cts +2 -0
  85. package/dist/logger/index.d.ts +2 -0
  86. package/dist/logger/index.js +11 -0
  87. package/dist/logger/init.cjs +10 -0
  88. package/dist/logger/init.d.cts +15 -0
  89. package/dist/logger/init.d.ts +15 -0
  90. package/dist/logger/init.js +10 -0
  91. package/dist/sdk.cjs +33 -1
  92. package/dist/sdk.js +33 -1
  93. package/dist/signers/evm-api-key.cjs +7 -1
  94. package/dist/signers/evm-api-key.js +7 -1
  95. package/dist/signers/evm-external-wallet.cjs +7 -1
  96. package/dist/signers/evm-external-wallet.js +7 -1
  97. package/dist/signers/index.cjs +21 -1
  98. package/dist/signers/index.js +21 -1
  99. package/dist/signers/non-custodial/index.cjs +24 -1
  100. package/dist/signers/non-custodial/index.js +24 -1
  101. package/dist/signers/non-custodial/ncs-evm-signer.cjs +10 -1
  102. package/dist/signers/non-custodial/ncs-evm-signer.js +10 -1
  103. package/dist/signers/non-custodial/ncs-iframe-manager.cjs +7 -1
  104. package/dist/signers/non-custodial/ncs-iframe-manager.js +7 -1
  105. package/dist/signers/non-custodial/ncs-signer.cjs +11 -1
  106. package/dist/signers/non-custodial/ncs-signer.js +11 -1
  107. package/dist/signers/non-custodial/ncs-solana-signer.cjs +10 -1
  108. package/dist/signers/non-custodial/ncs-solana-signer.js +10 -1
  109. package/dist/signers/non-custodial/ncs-stellar-signer.cjs +10 -1
  110. package/dist/signers/non-custodial/ncs-stellar-signer.js +10 -1
  111. package/dist/signers/passkey.cjs +7 -1
  112. package/dist/signers/passkey.js +7 -1
  113. package/dist/signers/solana-api-key.cjs +7 -1
  114. package/dist/signers/solana-api-key.js +7 -1
  115. package/dist/signers/solana-external-wallet.cjs +8 -1
  116. package/dist/signers/solana-external-wallet.js +8 -1
  117. package/dist/signers/stellar-external-wallet.cjs +7 -1
  118. package/dist/signers/stellar-external-wallet.js +7 -1
  119. package/dist/signers/types.cjs +9 -1
  120. package/dist/signers/types.js +9 -1
  121. package/dist/utils/constants.cjs +13 -1
  122. package/dist/utils/constants.js +13 -1
  123. package/dist/utils/errors.cjs +55 -1
  124. package/dist/utils/errors.js +55 -1
  125. package/dist/utils/signer-validation.cjs +10 -1
  126. package/dist/utils/signer-validation.d.cts +7 -1
  127. package/dist/utils/signer-validation.d.ts +7 -1
  128. package/dist/utils/signer-validation.js +10 -1
  129. package/dist/wallets/evm.cjs +20 -1
  130. package/dist/wallets/evm.js +20 -1
  131. package/dist/wallets/solana.cjs +18 -1
  132. package/dist/wallets/solana.js +18 -1
  133. package/dist/wallets/stellar.cjs +17 -1
  134. package/dist/wallets/stellar.js +17 -1
  135. package/dist/wallets/wallet-factory.cjs +27 -1
  136. package/dist/wallets/wallet-factory.js +27 -1
  137. package/dist/wallets/wallet.cjs +16 -1
  138. package/dist/wallets/wallet.js +16 -1
  139. package/package.json +6 -5
  140. package/dist/chunk-2SHDBC47.js +0 -1
  141. package/dist/chunk-2XVV7Z43.cjs +0 -1
  142. package/dist/chunk-2YH3NVVK.cjs +0 -1
  143. package/dist/chunk-3APSOOE3.js +0 -1
  144. package/dist/chunk-3SW6AJSG.cjs +0 -1
  145. package/dist/chunk-4KXOWU5E.cjs +0 -1
  146. package/dist/chunk-5M7IRODB.js +0 -1
  147. package/dist/chunk-5QIW67NU.cjs +0 -1
  148. package/dist/chunk-6PVKL5RC.js +0 -1
  149. package/dist/chunk-7HTB7WKD.cjs +0 -1
  150. package/dist/chunk-7JIPYRKX.js +0 -1
  151. package/dist/chunk-BQZES4ST.js +0 -1
  152. package/dist/chunk-BW7YYVZE.js +0 -1
  153. package/dist/chunk-C3T63EC7.cjs +0 -1
  154. package/dist/chunk-CXTC3YDL.cjs +0 -1
  155. package/dist/chunk-DV6ZRFKV.js +0 -1
  156. package/dist/chunk-DX7VVXY5.cjs +0 -1
  157. package/dist/chunk-FATVK26C.js +0 -1
  158. package/dist/chunk-GEY574TH.cjs +0 -1
  159. package/dist/chunk-GKZFI322.js +0 -1
  160. package/dist/chunk-H4T4IXCF.js +0 -1
  161. package/dist/chunk-HJ5EDMTA.js +0 -1
  162. package/dist/chunk-HPHVJ6BA.cjs +0 -1
  163. package/dist/chunk-HQAKCIYM.js +0 -1
  164. package/dist/chunk-HRSVFJND.cjs +0 -1
  165. package/dist/chunk-IGBQEAD5.js +0 -1
  166. package/dist/chunk-IR5WN6FQ.cjs +0 -1
  167. package/dist/chunk-JUSY5XEE.js +0 -1
  168. package/dist/chunk-KFJLRIY7.js +0 -1
  169. package/dist/chunk-KKQBZXFE.js +0 -1
  170. package/dist/chunk-KO6QYKDX.cjs +0 -1
  171. package/dist/chunk-KRV3IXJU.cjs +0 -1
  172. package/dist/chunk-LW6JSI4J.js +0 -1
  173. package/dist/chunk-M2UBZY5S.cjs +0 -1
  174. package/dist/chunk-M4TOGGLV.cjs +0 -1
  175. package/dist/chunk-MQP5VZCA.cjs +0 -1
  176. package/dist/chunk-NP32UO2G.cjs +0 -1
  177. package/dist/chunk-O4FVTK7X.cjs +0 -1
  178. package/dist/chunk-P6JJHAAV.js +0 -1
  179. package/dist/chunk-PONCGT2H.cjs +0 -1
  180. package/dist/chunk-PSXRNSOE.js +0 -1
  181. package/dist/chunk-QMXG67T3.cjs +0 -1
  182. package/dist/chunk-RJZV72YF.js +0 -1
  183. package/dist/chunk-S3DYQVRD.js +0 -1
  184. package/dist/chunk-SLG7HGGL.js +0 -1
  185. package/dist/chunk-STYSP6KL.cjs +0 -1
  186. package/dist/chunk-UBOWSXW3.js +0 -1
  187. package/dist/chunk-UNBXKCNN.js +0 -1
  188. package/dist/chunk-VY634F3J.js +0 -1
  189. package/dist/chunk-WQP2FSVI.js +0 -1
  190. package/dist/chunk-WYYAPI4G.cjs +0 -1
  191. package/dist/chunk-WZFHEUWT.cjs +0 -1
  192. package/dist/chunk-XALFCQKD.cjs +0 -1
  193. package/dist/chunk-YWPTI2QO.cjs +0 -1
  194. package/dist/chunk-YWXQIFVZ.js +0 -3
  195. package/dist/chunk-YZ4HRYSL.cjs +0 -1
  196. package/dist/chunk-Z54LVUDS.js +0 -1
  197. package/dist/chunk-ZWMB3QLR.cjs +0 -3
@@ -1 +1,27 @@
1
- import{a}from"../chunk-YWXQIFVZ.js";import"../chunk-BQZES4ST.js";import"../chunk-KFJLRIY7.js";import"../chunk-UNBXKCNN.js";import"../chunk-YDZRBHS3.js";import"../chunk-VY634F3J.js";import"../chunk-H4T4IXCF.js";import"../chunk-WQP2FSVI.js";import"../chunk-HJ5EDMTA.js";import"../chunk-JUSY5XEE.js";import"../chunk-UBOWSXW3.js";import"../chunk-IGBQEAD5.js";import"../chunk-6PVKL5RC.js";import"../chunk-2SHDBC47.js";import"../chunk-P6JJHAAV.js";import"../chunk-Z54LVUDS.js";import"../chunk-PSXRNSOE.js";import"../chunk-LW6JSI4J.js";import"../chunk-3APSOOE3.js";import"../chunk-BW7YYVZE.js";export{a as WalletFactory};
1
+ import {
2
+ WalletFactory
3
+ } from "../chunk-S5YXROL6.js";
4
+ import "../chunk-ZP4ZZCIE.js";
5
+ import "../chunk-UKBWSQ7R.js";
6
+ import "../chunk-TOHXQVLS.js";
7
+ import "../chunk-YDZRBHS3.js";
8
+ import "../chunk-454RYNSZ.js";
9
+ import "../chunk-XRA5GFH3.js";
10
+ import "../chunk-K3HFAPSV.js";
11
+ import "../chunk-CL44FTXR.js";
12
+ import "../chunk-7JFVG4IY.js";
13
+ import "../chunk-AL77JANE.js";
14
+ import "../chunk-MZBFXUHT.js";
15
+ import "../chunk-EYJQSDDI.js";
16
+ import "../chunk-ZTGRDOOH.js";
17
+ import "../chunk-DQCXGBZM.js";
18
+ import "../chunk-WC7T2CR4.js";
19
+ import "../chunk-WJUPOCKJ.js";
20
+ import "../chunk-SGINWAB6.js";
21
+ import "../chunk-455NK5LB.js";
22
+ import "../chunk-RAWKXOHR.js";
23
+ import "../chunk-WQVJM3PG.js";
24
+ import "../chunk-FPMW7Q5O.js";
25
+ export {
26
+ WalletFactory
27
+ };
@@ -1 +1,16 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkM2UBZY5Scjs = require('../chunk-M2UBZY5S.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-KO6QYKDX.cjs');require('../chunk-2XVV7Z43.cjs');require('../chunk-HPHVJ6BA.cjs');require('../chunk-2YH3NVVK.cjs');require('../chunk-MQP5VZCA.cjs');require('../chunk-5QIW67NU.cjs');require('../chunk-3SW6AJSG.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-XALFCQKD.cjs');exports.Wallet = _chunkM2UBZY5Scjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkLGONZW4Wcjs = require('../chunk-LGONZW4W.cjs');
4
+ require('../chunk-PO6S7UR3.cjs');
5
+ require('../chunk-LKAO2MV2.cjs');
6
+ require('../chunk-HYKMSBCT.cjs');
7
+ require('../chunk-IVNYZDI5.cjs');
8
+ require('../chunk-B6JOIWRH.cjs');
9
+ require('../chunk-TK3EUCQ4.cjs');
10
+ require('../chunk-RHR6P2KP.cjs');
11
+ require('../chunk-XC2V34TS.cjs');
12
+ require('../chunk-LHYSCUKJ.cjs');
13
+ require('../chunk-G5NYLGM5.cjs');
14
+
15
+
16
+ exports.Wallet = _chunkLGONZW4Wcjs.Wallet;
@@ -1 +1,16 @@
1
- import{a}from"../chunk-KFJLRIY7.js";import"../chunk-YDZRBHS3.js";import"../chunk-VY634F3J.js";import"../chunk-H4T4IXCF.js";import"../chunk-WQP2FSVI.js";import"../chunk-HJ5EDMTA.js";import"../chunk-JUSY5XEE.js";import"../chunk-P6JJHAAV.js";import"../chunk-Z54LVUDS.js";import"../chunk-PSXRNSOE.js";import"../chunk-BW7YYVZE.js";export{a as Wallet};
1
+ import {
2
+ Wallet
3
+ } from "../chunk-UKBWSQ7R.js";
4
+ import "../chunk-YDZRBHS3.js";
5
+ import "../chunk-454RYNSZ.js";
6
+ import "../chunk-XRA5GFH3.js";
7
+ import "../chunk-K3HFAPSV.js";
8
+ import "../chunk-CL44FTXR.js";
9
+ import "../chunk-7JFVG4IY.js";
10
+ import "../chunk-WJUPOCKJ.js";
11
+ import "../chunk-SGINWAB6.js";
12
+ import "../chunk-WQVJM3PG.js";
13
+ import "../chunk-FPMW7Q5O.js";
14
+ export {
15
+ Wallet
16
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossmint/wallets-sdk",
3
- "version": "0.18.3",
3
+ "version": "0.18.6",
4
4
  "repository": "https://github.com/Crossmint/crossmint-sdk",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Paella Labs Inc",
@@ -18,6 +18,7 @@
18
18
  "LICENSE"
19
19
  ],
20
20
  "dependencies": {
21
+ "@datadog/browser-logs": "6.24.1",
21
22
  "@hey-api/client-fetch": "0.8.1",
22
23
  "@solana/web3.js": "1.98.1",
23
24
  "@stellar/stellar-sdk": "v14.0.0-rc.3",
@@ -26,10 +27,10 @@
26
27
  "ox": "0.6.9",
27
28
  "tweetnacl": "1.0.3",
28
29
  "viem": "2.33.1",
29
- "@crossmint/client-sdk-window": "1.0.5",
30
- "@crossmint/client-signers": "0.1.0",
31
- "@crossmint/common-sdk-auth": "1.0.59",
32
- "@crossmint/common-sdk-base": "0.9.8"
30
+ "@crossmint/client-sdk-window": "1.0.7",
31
+ "@crossmint/client-signers": "0.1.2",
32
+ "@crossmint/common-sdk-auth": "1.0.61",
33
+ "@crossmint/common-sdk-base": "0.9.10"
33
34
  },
34
35
  "devDependencies": {
35
36
  "@hey-api/openapi-ts": "0.69.2",
@@ -1 +0,0 @@
1
- import{f as e}from"./chunk-BW7YYVZE.js";var n=class{constructor(r){this.config=r;this.type="external-wallet";if(r.address==null)throw new Error("Please provide an address for the External Wallet Signer");this._address=r.address,this.onSignStellarTransaction=r.onSignStellarTransaction}address(){return this._address}locator(){return this.config.locator}signMessage(){return e(this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for stellar external wallet signer"))})}signTransaction(r){return e(this,null,function*(){return this.onSignStellarTransaction==null?yield Promise.reject(new Error("onSignStellarTransaction method is required to sign transactions with a Stellar external wallet")):{signature:yield this.onSignStellarTransaction(r)}})}};export{n as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2YH3NVVKcjs = require('./chunk-2YH3NVVK.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var s=class a extends _chunk2YH3NVVKcjs.a{constructor(n){super(n)}signMessage(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for stellar signer"))})}signTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var r;yield this.handleAuthRequired();let g=this.getJwtOrThrow(),e=yield(r=this.config.clientTEEConnection)==null?void 0:r.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:g,apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:n,encoding:"base64"}},options:_chunk2YH3NVVKcjs.b});if((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");if(a.verifyPublicKeyFormat(e.publicKey),e.signature.encoding!=="base64")throw new Error("Wrong encoding for signature. Expected base64, got "+e.signature.encoding);return{signature:e.signature.bytes}})}static verifyPublicKeyFormat(n){if(n==null)throw new Error("No public key found");if(n.encoding!=="base64"||n.keyType!=="ed25519"||n.bytes==null)throw new Error("Not supported. Expected public key to be in base64 encoding and ed25519 key type. Got: "+JSON.stringify(n))}getChainKeyParams(){return{scheme:"ed25519",encoding:"strkey"}}};exports.a = s;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkMQP5VZCAcjs = require('./chunk-MQP5VZCA.cjs');var _chunk5QIW67NUcjs = require('./chunk-5QIW67NU.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var E=class{constructor(e){this.config=e;this._needsAuth=!0;this._authPromise=null;this._initializationPromise=null;this.initialize(),this.type=this.config.type}locator(){return this.config.locator}address(){return this.config.address}initialize(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.config.clientTEEConnection==null){let e=_commonsdkbase.validateAPIKey.call(void 0, this.config.crossmint.apiKey);if(!e.isValid)throw new Error("Invalid API key");let t=new (0, _chunkMQP5VZCAcjs.a)({environment:e.environment});this.config.clientTEEConnection=yield t.initialize()}})}getTEEConnection(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.config.clientTEEConnection==null){if(this._initializationPromise)return yield this._initializationPromise,this.config.clientTEEConnection;this._initializationPromise=this.initializeTEEConnection();try{yield this._initializationPromise}finally{this._initializationPromise=null}}return this.config.clientTEEConnection})}initializeTEEConnection(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){console.warn("TEE connection is not initialized, initializing now...");let e=_commonsdkbase.validateAPIKey.call(void 0, this.config.crossmint.apiKey);if(!e.isValid)throw new Error("Invalid API key");let t=new (0, _chunkMQP5VZCAcjs.a)({environment:e.environment});if(this.config.clientTEEConnection=yield t.initialize(),this.config.clientTEEConnection==null)throw new Error("Failed to initialize TEE connection");console.log("TEE connection initialized successfully")})}handleAuthRequired(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var c,h;let e=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, sendEmailWithOtp, verifyOtp, reject) => { /* your UI logic */ }`);let t=yield e.sendAction({event:"request:get-status",responseEvent:"response:get-status",data:{authData:{jwt:(h=(c=this.config.crossmint.experimental_customAuth)==null?void 0:c.jwt)!=null?h:"",apiKey:this.config.crossmint.apiKey}},options:_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},g),{maxRetries:5})});if((t==null?void 0:t.status)!=="success")throw new Error(t==null?void 0:t.error);if(t.signerStatus==="ready"){this._needsAuth=!1;return}else this._needsAuth=!0;let{promise:i,resolve:o,reject:n}=this.createAuthPromise();if(this._authPromise={promise:i,resolve:o,reject:n},this.config.onAuthRequired)try{yield this.config.onAuthRequired(this._needsAuth,()=>this.sendMessageWithOtp(),r=>this.verifyOtp(r),()=>_chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){this._needsAuth=!1,this.config.onAuthRequired!=null&&(yield this.config.onAuthRequired(this._needsAuth,()=>this.sendMessageWithOtp(),r=>this.verifyOtp(r),()=>{var r;return(r=this._authPromise)==null?void 0:r.reject(new _chunk5QIW67NUcjs.a)})),n(new _chunk5QIW67NUcjs.a)}))}catch(r){n(r)}try{yield i}catch(r){throw r}})}ensureAuthenticated(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){yield this.handleAuthRequired()})}getJwtOrThrow(){var t;let e=(t=this.config.crossmint.experimental_customAuth)==null?void 0:t.jwt;if(e==null)throw new Error("JWT is required");return e}createAuthPromise(){let e,t;return{promise:new Promise((o,n)=>{e=o,t=n}),resolve:e,reject:t}}sendMessageWithOtp(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var o,n,c;let e=yield this.getTEEConnection(),t=this.getAuthId(),i=yield e.sendAction({event:"request:start-onboarding",responseEvent:"response:start-onboarding",data:{authData:{jwt:(n=(o=this.config.crossmint.experimental_customAuth)==null?void 0:o.jwt)!=null?n:"",apiKey:this.config.crossmint.apiKey},data:{authId:t}},options:_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},g),{maxRetries:3})});if((i==null?void 0:i.status)==="success"&&i.signerStatus==="ready"){this._needsAuth=!1;return}(i==null?void 0:i.status)==="error"&&(console.error("[sendMessageWithOtp] Failed to send OTP:",i),(c=this._authPromise)==null||c.reject(new Error(i.error||"Failed to initiate OTP process.")))})}getAuthId(){return this.config.type==="email"?`email:${this.config.email}`:`phone:${this.config.phone}`}verifyOtp(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var n,c,h,r,p;let t;try{t=yield(yield this.getTEEConnection()).sendAction({event:"request:complete-onboarding",responseEvent:"response:complete-onboarding",data:{authData:{jwt:(c=(n=this.config.crossmint.experimental_customAuth)==null?void 0:n.jwt)!=null?c:"",apiKey:this.config.crossmint.apiKey},data:{onboardingAuthentication:{encryptedOtp:e}}},options:_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},g),{maxRetries:3})})}catch(a){throw console.error("[verifyOtp] Error sending OTP validation request:",a),this._needsAuth=!0,(h=this._authPromise)==null||h.reject(a),a}if((t==null?void 0:t.status)==="success"){this._needsAuth=!1,this.config.onAuthRequired!=null&&(yield this.config.onAuthRequired(this._needsAuth,()=>this.sendMessageWithOtp(),a=>this.verifyOtp(a),()=>{var a;return(a=this._authPromise)==null?void 0:a.reject(new _chunk5QIW67NUcjs.a)})),(r=this._authPromise)==null||r.resolve();return}console.error("[verifyOtp] Failed to validate OTP:",t),this._needsAuth=!0;let i=(t==null?void 0:t.status)==="error"?t.error:"Failed to validate encrypted OTP",o=new Error(i);throw(p=this._authPromise)==null||p.reject(o),o})}_exportPrivateKey(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){yield this.handleAuthRequired();let t=this.getJwtOrThrow(),{scheme:i,encoding:o}=this.getChainKeyParams(),n=yield e.sendAction({event:"request:export-signer",responseEvent:"response:export-signer",data:{authData:{jwt:t,apiKey:this.config.crossmint.apiKey},data:{scheme:i,encoding:o}},options:g});if((n==null?void 0:n.status)==="error")throw new Error(n.error||"Failed to export private key")})}},g= exports.b ={timeoutMs:1e4,intervalMs:5e3};exports.a = E; exports.b = g;
@@ -1 +0,0 @@
1
- import{f as i}from"./chunk-BW7YYVZE.js";var n=class{constructor(e){this.config=e;this.type="external-wallet";if(e.address==null)throw new Error("Please provide an address for the External Wallet Signer");this._address=e.address,this.provider=e.provider,this.viemAccount=e.viemAccount}address(){return this._address}locator(){return this.config.locator}signMessage(e){return i(this,null,function*(){var s;if(this.provider!=null){let r=yield this.provider.request({method:"personal_sign",params:[e,this._address]});if(r==null)throw new Error("[EVMExternalWalletSigner] Failed to sign message: EIP1193 provider signMessage returned null");return{signature:r}}if(((s=this.viemAccount)==null?void 0:s.signMessage)!=null){let r=yield this.viemAccount.signMessage({message:{raw:e}});if(r==null)throw new Error("[EVMExternalWalletSigner] Failed to sign message: Viem account signMessage returned null");return{signature:r}}throw new Error("No signer provider or viem account provided")})}signTransaction(e){return i(this,null,function*(){return yield this.signMessage(e)})}};export{n as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var s="@crossmint/wallets-sdk",t="0.18.3";var p="WALLETS_SDK",r= exports.b =t,c= exports.c =s,a= exports.d =500;exports.a = p; exports.b = r; exports.c = c; exports.d = a;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var n=class{constructor(t){this.config=t;this.type="api-key"}locator(){return this.config.locator}signMessage(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield Promise.reject(new Error("API key signers do not support direct message signing - signatures are handled automatically by the backend"))})}signTransaction(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield Promise.reject(new Error("API key signers do not support direct transaction signing - transaction are handled automatically by the backend"))})}};exports.a = n;
@@ -1 +0,0 @@
1
- import{createClient as t,createConfig as e}from"@hey-api/client-fetch";var p=t(e({baseUrl:"https://staging.crossmint.com/api"}));export{p as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var n=class extends Error{constructor(){super("Authentication was rejected by the user"),this.name="AuthRejectedError"}};function t(e){return e._exportPrivateKey!==void 0}exports.a = n; exports.b = t;
@@ -1 +0,0 @@
1
- import{x as r}from"./chunk-PSXRNSOE.js";import{f as e}from"./chunk-BW7YYVZE.js";import{PublicKey as m,VersionedTransaction as h}from"@solana/web3.js";import i from"bs58";var o=class{constructor(n){this.config=n;this.type="external-wallet";if(n.address==null)throw new Error("Please provide an address for the External Wallet Signer");this._address=n.address,this.onSignTransaction=n.onSignTransaction}address(){return this._address}locator(){return this.config.locator}signMessage(){return e(this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for solana external wallet signer"))})}signTransaction(n){return e(this,null,function*(){if(this.onSignTransaction==null)return yield Promise.reject(new Error("onSignTransaction method is required to sign transactions with a Solana external wallet"));let l=i.decode(n),c=h.deserialize(l),t=yield this.onSignTransaction(c),d=new m(this._address),a=t.message.staticAccountKeys.findIndex(u=>u.equals(d));if(a===-1)throw new r("Wallet public key not found in transaction signers");let s=t.signatures[a];if(s==null)throw new r("No valid signature found in the transaction");let g=new Uint8Array(Object.values(s));return{signature:i.encode(g)}})}};export{o as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3SW6AJSGcjs = require('./chunk-3SW6AJSG.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var p=class extends _commonsdkbase.CrossmintApiClient{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:_chunk3SW6AJSGcjs.c,version:_chunk3SW6AJSGcjs.b}}});this.apiPrefix="api/2025-06-09/wallets";this.legacyApiPrefix="api/2022-06-09/wallets"}createWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let s=this.isServerSide?`${this.apiPrefix}`:`${this.apiPrefix}/me`;return(yield this.post(s,{body:JSON.stringify(e),headers:this.headers})).json()})}getWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}`,{headers:this.headers})).json()})}createTransaction(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveTransaction(e,s,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions/${s}/approvals`,{body:JSON.stringify(t),headers:this.headers})).json()})}getTransaction(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions/${s}`,{headers:this.headers})).json()})}createSignature(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signatures`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveSignature(e,s,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signatures/${s}/approvals`,{body:JSON.stringify(t),headers:this.headers})).json()})}getSignature(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signatures/${s}`,{headers:this.headers})).json()})}getTransactions(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions`,{headers:this.headers})).json()})}experimental_getNfts(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let s=new URLSearchParams;s.append("page",e.page.toString()),s.append("perPage",e.perPage.toString());let t=`${e.chain}:${e.address}`;return(yield this.get(`${this.apiPrefix}/${t}/nfts?${s.toString()}`,{headers:this.headers})).json()})}experimental_activity(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=e;this.isServerSide||(t=`me:${s.chain==="solana"?"solana-smart-wallet":"evm-smart-wallet"}`);let a=new URLSearchParams;return a.append("chain",s.chain.toString()),(yield this.get(`${this.legacyApiPrefix}/${t}/activity?${a.toString()}`,{headers:this.headers})).json()})}getBalance(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=new URLSearchParams;return t.append("tokens",s.tokens.join(",")),t.append("chains",s.chains.join(",")),(yield this.get(`${this.apiPrefix}/${e}/balances?${t.toString()}`,{headers:this.headers})).json()})}fundWallet(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.environment===_commonsdkbase.APIKeyEnvironmentPrefix.PRODUCTION)throw new Error("Funding wallets is only supported in staging environment");return(yield this.post(`api/v1-alpha2/wallets/${e}/balances`,{body:JSON.stringify(s),headers:this.headers})).json()})}registerSigner(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signers`,{body:JSON.stringify(s),headers:this.headers})).json()})}getSigner(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signers/${s}`,{headers:this.headers})).json()})}send(e,s,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/tokens/${s}/transfers`,{body:JSON.stringify(t),headers:this.headers})).json()})}get isServerSide(){return this.parsedAPIKey.usageOrigin===_commonsdkbase.APIKeyUsageOrigin.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new (0, _chunkO4FVTK7Xcjs.a)("Invalid API key");return this.parsedAPIKey.environment}get headers(){return{"Content-Type":"application/json"}}};exports.a = p;
@@ -1 +0,0 @@
1
- import{a as l}from"./chunk-5M7IRODB.js";import{a as t,b as o}from"./chunk-BW7YYVZE.js";var i=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/v1-alpha2/wallets/me{walletType}/transactions/{transactionId}/approvals"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},C=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/v1-alpha2/wallets/me{walletType}/transactions/{transactionId}"},e))},p=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/v1-alpha2/wallets/me{walletType}/transactions"},e))},W=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/v1-alpha2/wallets/me{walletType}/transactions"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},c=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/v1-alpha2/wallets/me{walletType}/signers/{signer}"},e))},u=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/v1-alpha2/wallets/me{walletType}/signers"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},V=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/v1-alpha2/wallets/me{walletType}/signatures/{signatureId}/approvals"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},w=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/v1-alpha2/wallets/me{walletType}/signatures/{signatureId}"},e))},T=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/v1-alpha2/wallets/me{walletType}/signatures"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},h=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/v1-alpha2/wallets/me{walletType}/activity"},e))},g=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/v1-alpha2/wallets/me{walletType}"},e))},E=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/v1-alpha2/wallets/me"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},S=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/v1-alpha2/wallets/{walletLocator}/transactions/{transactionId}/approvals"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},O=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/v1-alpha2/wallets/{walletLocator}/transactions/{transactionId}"},e))},d=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/v1-alpha2/wallets/{walletLocator}/transactions"},e))},G=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/v1-alpha2/wallets/{walletLocator}/transactions"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},D=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/v1-alpha2/wallets/{walletLocator}/signers/{signer}"},e))},M=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/v1-alpha2/wallets/{walletLocator}/signers"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},R=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/v1-alpha2/wallets/{walletLocator}/signatures/{signatureId}/approvals"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},b=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/v1-alpha2/wallets/{walletLocator}/signatures/{signatureId}"},e))},v=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/v1-alpha2/wallets/{walletLocator}/signatures"},e))},x=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/v1-alpha2/wallets/{walletLocator}/signatures"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},y=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/v1-alpha2/wallets/{walletLocator}/balances"},e))},A=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/v1-alpha2/wallets/{walletLocator}/balances"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},m=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/v1-alpha2/wallets/{walletLocator}/activity"},e))},f=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/v1-alpha2/wallets/{walletLocator}"},e))},L=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/v1-alpha2/wallets"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},B=e=>{var r;return((r=e==null?void 0:e.client)!=null?r:l).post(t({url:"/unstable/wallets/verify-ownership"},e))},k=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/unstable/wallets/me{walletType}/tokens/{tokenLocator}/transfers"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},q=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/unstable/wallets/me{walletLocator}/activity"},e))},j=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/unstable/wallets/{walletLocator}/tokens/{tokenLocator}/transfers"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},F=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/unstable/wallets/{walletLocator}/balances"},e))},I=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/unstable/wallets/{walletLocator}/activity"},e))},U=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2025-06-09/wallets/me{walletLocator}/transactions/{transactionId}/approvals"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},N=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2025-06-09/wallets/me{walletLocator}/transactions/{transactionId}"},e))},_=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2025-06-09/wallets/me{walletLocator}/transactions"},e))},z=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2025-06-09/wallets/me{walletLocator}/transactions"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},H=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2025-06-09/wallets/me{walletLocator}/tokens/{tokenLocator}/transfers"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},J=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2025-06-09/wallets/me{walletLocator}/signers/{signer}"},e))},K=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2025-06-09/wallets/me{walletLocator}/signers"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},P=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2025-06-09/wallets/me{walletLocator}/signatures/{signatureId}/approvals"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},Q=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2025-06-09/wallets/me{walletLocator}/signatures/{signatureId}"},e))},X=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2025-06-09/wallets/me{walletLocator}/signatures"},e))},Y=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2025-06-09/wallets/me{walletLocator}/signatures"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},Z=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2025-06-09/wallets/me{walletLocator}"},e))},$=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2025-06-09/wallets/me"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},ee=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2025-06-09/wallets/{walletLocator}/transactions/{transactionId}/approvals"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},re=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2025-06-09/wallets/{walletLocator}/transactions/{transactionId}"},e))},te=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2025-06-09/wallets/{walletLocator}/transactions"},e))},le=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2025-06-09/wallets/{walletLocator}/transactions"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},oe=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2025-06-09/wallets/{walletLocator}/tokens/{tokenLocator}/transfers"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},ae=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2025-06-09/wallets/{walletLocator}/signers/{signer}"},e))},ne=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2025-06-09/wallets/{walletLocator}/signers"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},se=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2025-06-09/wallets/{walletLocator}/signatures/{signatureId}/approvals"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},ie=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2025-06-09/wallets/{walletLocator}/signatures/{signatureId}"},e))},Ce=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2025-06-09/wallets/{walletLocator}/signatures"},e))},pe=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2025-06-09/wallets/{walletLocator}/signatures"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},We=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2025-06-09/wallets/{walletLocator}/balances"},e))},ce=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2025-06-09/wallets/{walletLocator}"},e))},ue=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2025-06-09/wallets"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},Ve=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2022-06-09/wallets/me{walletType}/transactions/{transactionId}/approvals"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},we=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2022-06-09/wallets/me{walletType}/transactions/{transactionId}"},e))},Te=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2022-06-09/wallets/me{walletType}/transactions"},e))},he=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2022-06-09/wallets/me{walletType}/transactions"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},ge=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2022-06-09/wallets/me{walletType}/signers/{signer}"},e))},Ee=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2022-06-09/wallets/me{walletType}/signers"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},Se=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2022-06-09/wallets/me{walletType}/signatures/{signatureId}/approvals"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},Oe=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2022-06-09/wallets/me{walletType}/signatures/{signatureId}"},e))},de=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2022-06-09/wallets/me{walletType}/signatures"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},Ge=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2022-06-09/wallets/me{walletType}/activity"},e))},De=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2022-06-09/wallets/me{walletType}"},e))},Me=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2022-06-09/wallets/me"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},Re=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2022-06-09/wallets/{walletLocator}/transactions/{transactionId}/approvals"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},be=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2022-06-09/wallets/{walletLocator}/transactions/{transactionId}"},e))},ve=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2022-06-09/wallets/{walletLocator}/transactions"},e))},xe=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2022-06-09/wallets/{walletLocator}/transactions"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},ye=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2022-06-09/wallets/{walletLocator}/signers/{signer}"},e))},Ae=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2022-06-09/wallets/{walletLocator}/signers"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},me=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2022-06-09/wallets/{walletLocator}/signatures/{signatureId}/approvals"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},fe=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2022-06-09/wallets/{walletLocator}/signatures/{signatureId}"},e))},Le=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2022-06-09/wallets/{walletLocator}/signatures"},e))},Be=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2022-06-09/wallets/{walletLocator}/signatures"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))},ke=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2022-06-09/wallets/{walletLocator}/activity"},e))},qe=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2022-06-09/wallets/{walletLocator}"},e))},je=e=>{var r;return((r=e.client)!=null?r:l).get(t({url:"/2022-06-09/wallets/{locator}/nfts"},e))},Fe=e=>{var r;return((r=e.client)!=null?r:l).post(o(t({url:"/2022-06-09/wallets"},e),{headers:t({"Content-Type":"application/json"},e.headers)}))};export{i as a,C as b,p as c,W as d,c as e,u as f,V as g,w as h,T as i,h as j,g as k,E as l,S as m,O as n,d as o,G as p,D as q,M as r,R as s,b as t,v as u,x as v,y as w,A as x,m as y,f as z,L as A,B,k as C,q as D,j as E,F,I as G,U as H,N as I,_ as J,z as K,H as L,J as M,K as N,P as O,Q as P,X as Q,Y as R,Z as S,$ as T,ee as U,re as V,te as W,le as X,oe as Y,ae as Z,ne as _,se as $,ie as aa,Ce as ba,pe as ca,We as da,ce as ea,ue as fa,Ve as ga,we as ha,Te as ia,he as ja,ge as ka,Ee as la,Se as ma,Oe as na,de as oa,Ge as pa,De as qa,Me as ra,Re as sa,be as ta,ve as ua,xe as va,ye as wa,Ae as xa,me as ya,fe as za,Le as Aa,Be as Ba,ke as Ca,qe as Da,je as Ea,Fe as Fa};
@@ -1 +0,0 @@
1
- import{f as l}from"./chunk-PSXRNSOE.js";import{isEmailValid as c}from"@crossmint/common-sdk-auth";var m=(n,r,o)=>`Wallet signer configuration mismatch at "${n}" - expected "${o}" from existing wallet but found "${r}"`;function u(n){let o=n.toLowerCase().split("@"),t=o[1],s=t==="googlemail.com",i=(s||t==="gmail.com")&&o[0].includes(".");return s&&(o[1]="gmail.com"),i&&(o[0]=o[0].replace(/\./g,"")),`${o[0]}@${o[1]}`}function a(n){return typeof n=="string"&&c(n)?u(n):n}function f(n,r,o=""){if(n!==r){if(n==null||r==null)throw new Error(`Cannot compare null or undefined signer configs at path: ${o}`);for(let t of Object.keys(n)){if(!(t in r))continue;let s=o?`${o}.${t}`:t,e=n[t],i=r[t];if(typeof e=="object"&&e!==null&&typeof i=="object"&&i!==null)f(e,i,s);else if(a(e)!==a(i))throw new l(m(s,e,i))}}}export{f as a};
@@ -1 +0,0 @@
1
- var o=Object.defineProperty,p=Object.defineProperties;var q=Object.getOwnPropertyDescriptors;var i=Object.getOwnPropertySymbols;var r=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;var k=a=>{throw TypeError(a)};var j=(a,b,c)=>b in a?o(a,b,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[b]=c,t=(a,b)=>{for(var c in b||(b={}))r.call(b,c)&&j(a,c,b[c]);if(i)for(var c of i(b))s.call(b,c)&&j(a,c,b[c]);return a},u=(a,b)=>p(a,q(b));var l=(a,b,c)=>b.has(a)||k("Cannot "+c);var v=(a,b,c)=>(l(a,b,"read from private field"),c?c.call(a):b.get(a)),w=(a,b,c)=>b.has(a)?k("Cannot add the same private member more than once"):b instanceof WeakSet?b.add(a):b.set(a,c),x=(a,b,c,e)=>(l(a,b,"write to private field"),e?e.call(a,c):b.set(a,c),c);var y=(a,b,c)=>new Promise((e,h)=>{var m=d=>{try{f(c.next(d))}catch(g){h(g)}},n=d=>{try{f(c.throw(d))}catch(g){h(g)}},f=d=>d.done?e(d.value):Promise.resolve(d.value).then(m,n);f((c=c.apply(a,b)).next())});export{t as a,u as b,v as c,w as d,x as e,y as f};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var n=class{constructor(r){this.config=r;this.type="external-wallet";if(r.address==null)throw new Error("Please provide an address for the External Wallet Signer");this._address=r.address,this.onSignStellarTransaction=r.onSignStellarTransaction}address(){return this._address}locator(){return this.config.locator}signMessage(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for stellar external wallet signer"))})}signTransaction(r){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return this.onSignStellarTransaction==null?yield Promise.reject(new Error("onSignStellarTransaction method is required to sign transactions with a Stellar external wallet")):{signature:yield this.onSignStellarTransaction(r)}})}};exports.a = n;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkM2UBZY5Scjs = require('./chunk-M2UBZY5S.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var d=class u extends _chunkM2UBZY5Scjs.a{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer,options:_chunkM2UBZY5Scjs.a.getOptions(n),alias:n.alias},_chunkM2UBZY5Scjs.a.getApiClient(n))}static from(n){if(!_commonsdkbase.isValidStellarAddress.call(void 0, n.address))throw new Error("Wallet is not a Stellar wallet");return new u(n)}sendTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var r;yield this.preAuthIfNeeded();let t=yield this.createTransaction(n);if((r=n.options)!=null&&r.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:t.id};let e={};return yield this.approveTransactionAndWait(t.id,e)})}createTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var c;let{contractId:t,options:e}=n,r=(c=e==null?void 0:e.experimental_signer)!=null?c:this.signer.locator(),i;if("transaction"in n)i={type:"serialized-transaction",serializedTransaction:n.transaction,contractId:t};else{let{method:h,memo:p,args:T}=n;i={type:"contract-call",contractId:t,method:h,memo:p!=null?{type:"text",value:p}:void 0,args:T}}let s=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:i,signer:r}});if("error"in s)throw new (0, _chunkO4FVTK7Xcjs.r)(JSON.stringify(s));return s})}};exports.a = d;
@@ -1 +0,0 @@
1
- import{b as n,c as i}from"./chunk-Z54LVUDS.js";import{a as o}from"./chunk-PSXRNSOE.js";import{f as r}from"./chunk-BW7YYVZE.js";import{APIKeyEnvironmentPrefix as c,APIKeyUsageOrigin as h,CrossmintApiClient as l}from"@crossmint/common-sdk-base";var p=class extends l{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:i,version:n}}});this.apiPrefix="api/2025-06-09/wallets";this.legacyApiPrefix="api/2022-06-09/wallets"}createWallet(e){return r(this,null,function*(){let s=this.isServerSide?`${this.apiPrefix}`:`${this.apiPrefix}/me`;return(yield this.post(s,{body:JSON.stringify(e),headers:this.headers})).json()})}getWallet(e){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}`,{headers:this.headers})).json()})}createTransaction(e,s){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveTransaction(e,s,t){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions/${s}/approvals`,{body:JSON.stringify(t),headers:this.headers})).json()})}getTransaction(e,s){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions/${s}`,{headers:this.headers})).json()})}createSignature(e,s){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signatures`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveSignature(e,s,t){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signatures/${s}/approvals`,{body:JSON.stringify(t),headers:this.headers})).json()})}getSignature(e,s){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signatures/${s}`,{headers:this.headers})).json()})}getTransactions(e){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions`,{headers:this.headers})).json()})}experimental_getNfts(e){return r(this,null,function*(){let s=new URLSearchParams;s.append("page",e.page.toString()),s.append("perPage",e.perPage.toString());let t=`${e.chain}:${e.address}`;return(yield this.get(`${this.apiPrefix}/${t}/nfts?${s.toString()}`,{headers:this.headers})).json()})}experimental_activity(e,s){return r(this,null,function*(){let t=e;this.isServerSide||(t=`me:${s.chain==="solana"?"solana-smart-wallet":"evm-smart-wallet"}`);let a=new URLSearchParams;return a.append("chain",s.chain.toString()),(yield this.get(`${this.legacyApiPrefix}/${t}/activity?${a.toString()}`,{headers:this.headers})).json()})}getBalance(e,s){return r(this,null,function*(){let t=new URLSearchParams;return t.append("tokens",s.tokens.join(",")),t.append("chains",s.chains.join(",")),(yield this.get(`${this.apiPrefix}/${e}/balances?${t.toString()}`,{headers:this.headers})).json()})}fundWallet(e,s){return r(this,null,function*(){if(this.environment===c.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 r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signers`,{body:JSON.stringify(s),headers:this.headers})).json()})}getSigner(e,s){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signers/${s}`,{headers:this.headers})).json()})}send(e,s,t){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/tokens/${s}/transfers`,{body:JSON.stringify(t),headers:this.headers})).json()})}get isServerSide(){return this.parsedAPIKey.usageOrigin===h.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new o("Invalid API key");return this.parsedAPIKey.environment}get headers(){return{"Content-Type":"application/json"}}};export{p as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZWMB3QLRcjs = require('./chunk-ZWMB3QLR.cjs');var _chunk7HTB7WKDcjs = require('./chunk-7HTB7WKD.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var i=class o{constructor(t){let r=new (0, _chunk7HTB7WKDcjs.a)(t);this.walletFactory=new (0, _chunkZWMB3QLRcjs.a)(r)}static from(t){return new o(t)}getOrCreateWallet(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.walletFactory.getOrCreateWallet(t)})}getWallet(t,r){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.walletFactory.getWallet(t,r)})}createWallet(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.walletFactory.createWallet(t)})}};exports.a = _commonsdkbase.createCrossmint; exports.b = i;
@@ -1 +0,0 @@
1
- import{a as c}from"./chunk-KFJLRIY7.js";import{k as p,o as d,r as y}from"./chunk-PSXRNSOE.js";import{a as f}from"./chunk-RJZV72YF.js";import{f as s}from"./chunk-BW7YYVZE.js";import{createPublicClient as S,encodeFunctionData as I,http as x}from"viem";import{isValidEvmAddress as E}from"@crossmint/common-sdk-base";var m=class w extends c{constructor(t){super({chain:t.chain,address:t.address,owner:t.owner,signer:t.signer,options:c.getOptions(t),alias:t.alias},c.getApiClient(t))}static from(t){if(!E(t.address))throw new Error("Wallet is not an EVM wallet");return new w(t)}sendTransaction(t){return s(this,null,function*(){var i;yield this.preAuthIfNeeded();let e=this.buildTransaction(t),n=yield this.createTransaction(e,t.options);return(i=t.options)!=null&&i.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:n.id}:yield this.approveTransactionAndWait(n.id)})}signMessage(t){return s(this,null,function*(){var n;yield this.preAuthIfNeeded();let e=yield this.apiClient.createSignature(this.walletLocator,{type:"message",params:{message:t.message,signer:this.signer.locator(),chain:this.chain}});if("error"in e)throw new d(JSON.stringify(e));return(n=t.options)!=null&&n.experimental_prepareOnly?{signature:void 0,signatureId:e.id}:yield this.approveSignatureAndWait(e.id)})}signTypedData(t){return s(this,null,function*(){var T;yield this.preAuthIfNeeded();let{domain:e,message:n,primaryType:i,types:a,chain:r}=t;if(!e||!n||!a||!r)throw new p("Invalid typed data");let{name:u,version:l,chainId:h,verifyingContract:g,salt:C}=e;if(!u||!l||!h||!g)throw new p("Invalid typed data domain");let o=yield this.apiClient.createSignature(this.walletLocator,{type:"typed-data",params:{typedData:{domain:{name:u,version:l,chainId:Number(h),verifyingContract:g,salt:C},message:n,primaryType:i,types:a},signer:this.signer.locator(),chain:r}});if("error"in o)throw new d(JSON.stringify(o));return(T=t.options)!=null&&T.experimental_prepareOnly?{signature:void 0,signatureId:o.id}:yield this.approveSignatureAndWait(o.id)})}getViemClient(t){var e;return S({transport:(e=t==null?void 0:t.transport)!=null?e:x(),chain:f(this.chain)})}createTransaction(t,e){return s(this,null,function*(){var a;let n=(a=e==null?void 0:e.experimental_signer)!=null?a:this.signer.locator(),i=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:n,chain:this.chain,calls:[t]}});if("error"in i)throw new y(JSON.stringify(i));return i})}buildTransaction(t){var e,n,i,a,r;if("transaction"in t)return{transaction:t.transaction};if(t.abi==null)return{to:t.to,value:(n=(e=t.value)==null?void 0:e.toString())!=null?n:"0",data:(i=t.data)!=null?i:"0x"};if(!t.functionName)throw new Error("Function name is required");return{to:t.to,value:(r=(a=t.value)==null?void 0:a.toString())!=null?r:"0",data:I({abi:t.abi,functionName:t.functionName,args:t.args})}}};export{m as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _viem = require('viem');var s=_viem.defineChain.call(void 0, {id:1513,name:"Story Testnet",nativeCurrency:{decimals:18,name:"IP",symbol:"IP"},rpcUrls:{default:{http:["https://testnet.storyrpc.io"]}},blockExplorers:{default:{name:"Story Testnet Explorer",url:"https://testnet.storyscan.xyz"}},testnet:!0});exports.a = s;
@@ -1 +0,0 @@
1
- import{a as o}from"./chunk-KFJLRIY7.js";import{a as d}from"./chunk-6PVKL5RC.js";import{r as l}from"./chunk-PSXRNSOE.js";import{f as c}from"./chunk-BW7YYVZE.js";import f from"bs58";import{isValidSolanaAddress as h}from"@crossmint/common-sdk-base";var u=class T extends o{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer,options:o.getOptions(n),alias:n.alias},o.getApiClient(n))}static from(n){if(!h(n.address))throw new Error("Wallet is not a Solana wallet");return new T(n)}sendTransaction(n){return c(this,null,function*(){var e,i;yield this.preAuthIfNeeded();let t=yield this.createTransaction(n);if((e=n.options)!=null&&e.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:t.id};let a={additionalSigners:(i=n.additionalSigners)==null?void 0:i.map(s=>new d({type:"external-wallet",address:s.publicKey.toString(),locator:`external-wallet:${s.publicKey.toString()}`,onSignTransaction:p=>(p.sign([s]),Promise.resolve(p))}))};return yield this.approveTransactionAndWait(t.id,a)})}createTransaction(n){return c(this,null,function*(){var e,i;let t=(i=(e=n.options)==null?void 0:e.experimental_signer)!=null?i:this.signer.locator(),r;"serializedTransaction"in n?r=n.serializedTransaction:r=f.encode(n.transaction.serialize());let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:r,signer:t}});if("error"in a)throw new l(JSON.stringify(a));return a})}};export{u as a};
@@ -1 +0,0 @@
1
- import{a as i,b as o}from"./chunk-HJ5EDMTA.js";import{f as t}from"./chunk-BW7YYVZE.js";var s=class a extends i{constructor(n){super(n)}signMessage(){return t(this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for stellar signer"))})}signTransaction(n){return t(this,null,function*(){var r;yield this.handleAuthRequired();let g=this.getJwtOrThrow(),e=yield(r=this.config.clientTEEConnection)==null?void 0:r.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:g,apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:n,encoding:"base64"}},options:o});if((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");if(a.verifyPublicKeyFormat(e.publicKey),e.signature.encoding!=="base64")throw new Error("Wrong encoding for signature. Expected base64, got "+e.signature.encoding);return{signature:e.signature.bytes}})}static verifyPublicKeyFormat(n){if(n==null)throw new Error("No public key found");if(n.encoding!=="base64"||n.keyType!=="ed25519"||n.bytes==null)throw new Error("Not supported. Expected public key to be in base64 encoding and ed25519 key type. Got: "+JSON.stringify(n))}getChainKeyParams(){return{scheme:"ed25519",encoding:"strkey"}}};export{s as a};
@@ -1 +0,0 @@
1
- import{a as m}from"./chunk-JUSY5XEE.js";import{a as d}from"./chunk-P6JJHAAV.js";import{a as u,b as l,f as s}from"./chunk-BW7YYVZE.js";import{validateAPIKey as f}from"@crossmint/common-sdk-base";var E=class{constructor(e){this.config=e;this._needsAuth=!0;this._authPromise=null;this._initializationPromise=null;this.initialize(),this.type=this.config.type}locator(){return this.config.locator}address(){return this.config.address}initialize(){return s(this,null,function*(){if(this.config.clientTEEConnection==null){let e=f(this.config.crossmint.apiKey);if(!e.isValid)throw new Error("Invalid API key");let t=new m({environment:e.environment});this.config.clientTEEConnection=yield t.initialize()}})}getTEEConnection(){return s(this,null,function*(){if(this.config.clientTEEConnection==null){if(this._initializationPromise)return yield this._initializationPromise,this.config.clientTEEConnection;this._initializationPromise=this.initializeTEEConnection();try{yield this._initializationPromise}finally{this._initializationPromise=null}}return this.config.clientTEEConnection})}initializeTEEConnection(){return s(this,null,function*(){console.warn("TEE connection is not initialized, initializing now...");let e=f(this.config.crossmint.apiKey);if(!e.isValid)throw new Error("Invalid API key");let t=new m({environment:e.environment});if(this.config.clientTEEConnection=yield t.initialize(),this.config.clientTEEConnection==null)throw new Error("Failed to initialize TEE connection");console.log("TEE connection initialized successfully")})}handleAuthRequired(){return s(this,null,function*(){var c,h;let e=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, sendEmailWithOtp, verifyOtp, reject) => { /* your UI logic */ }`);let t=yield e.sendAction({event:"request:get-status",responseEvent:"response:get-status",data:{authData:{jwt:(h=(c=this.config.crossmint.experimental_customAuth)==null?void 0:c.jwt)!=null?h:"",apiKey:this.config.crossmint.apiKey}},options:l(u({},g),{maxRetries:5})});if((t==null?void 0:t.status)!=="success")throw new Error(t==null?void 0:t.error);if(t.signerStatus==="ready"){this._needsAuth=!1;return}else this._needsAuth=!0;let{promise:i,resolve:o,reject:n}=this.createAuthPromise();if(this._authPromise={promise:i,resolve:o,reject:n},this.config.onAuthRequired)try{yield this.config.onAuthRequired(this._needsAuth,()=>this.sendMessageWithOtp(),r=>this.verifyOtp(r),()=>s(this,null,function*(){this._needsAuth=!1,this.config.onAuthRequired!=null&&(yield this.config.onAuthRequired(this._needsAuth,()=>this.sendMessageWithOtp(),r=>this.verifyOtp(r),()=>{var r;return(r=this._authPromise)==null?void 0:r.reject(new d)})),n(new d)}))}catch(r){n(r)}try{yield i}catch(r){throw r}})}ensureAuthenticated(){return s(this,null,function*(){yield this.handleAuthRequired()})}getJwtOrThrow(){var t;let e=(t=this.config.crossmint.experimental_customAuth)==null?void 0:t.jwt;if(e==null)throw new Error("JWT is required");return e}createAuthPromise(){let e,t;return{promise:new Promise((o,n)=>{e=o,t=n}),resolve:e,reject:t}}sendMessageWithOtp(){return s(this,null,function*(){var o,n,c;let e=yield this.getTEEConnection(),t=this.getAuthId(),i=yield e.sendAction({event:"request:start-onboarding",responseEvent:"response:start-onboarding",data:{authData:{jwt:(n=(o=this.config.crossmint.experimental_customAuth)==null?void 0:o.jwt)!=null?n:"",apiKey:this.config.crossmint.apiKey},data:{authId:t}},options:l(u({},g),{maxRetries:3})});if((i==null?void 0:i.status)==="success"&&i.signerStatus==="ready"){this._needsAuth=!1;return}(i==null?void 0:i.status)==="error"&&(console.error("[sendMessageWithOtp] Failed to send OTP:",i),(c=this._authPromise)==null||c.reject(new Error(i.error||"Failed to initiate OTP process.")))})}getAuthId(){return this.config.type==="email"?`email:${this.config.email}`:`phone:${this.config.phone}`}verifyOtp(e){return s(this,null,function*(){var n,c,h,r,p;let t;try{t=yield(yield this.getTEEConnection()).sendAction({event:"request:complete-onboarding",responseEvent:"response:complete-onboarding",data:{authData:{jwt:(c=(n=this.config.crossmint.experimental_customAuth)==null?void 0:n.jwt)!=null?c:"",apiKey:this.config.crossmint.apiKey},data:{onboardingAuthentication:{encryptedOtp:e}}},options:l(u({},g),{maxRetries:3})})}catch(a){throw console.error("[verifyOtp] Error sending OTP validation request:",a),this._needsAuth=!0,(h=this._authPromise)==null||h.reject(a),a}if((t==null?void 0:t.status)==="success"){this._needsAuth=!1,this.config.onAuthRequired!=null&&(yield this.config.onAuthRequired(this._needsAuth,()=>this.sendMessageWithOtp(),a=>this.verifyOtp(a),()=>{var a;return(a=this._authPromise)==null?void 0:a.reject(new d)})),(r=this._authPromise)==null||r.resolve();return}console.error("[verifyOtp] Failed to validate OTP:",t),this._needsAuth=!0;let i=(t==null?void 0:t.status)==="error"?t.error:"Failed to validate encrypted OTP",o=new Error(i);throw(p=this._authPromise)==null||p.reject(o),o})}_exportPrivateKey(e){return s(this,null,function*(){yield this.handleAuthRequired();let t=this.getJwtOrThrow(),{scheme:i,encoding:o}=this.getChainKeyParams(),n=yield e.sendAction({event:"request:export-signer",responseEvent:"response:export-signer",data:{authData:{jwt:t,apiKey:this.config.crossmint.apiKey},data:{scheme:i,encoding:o}},options:g});if((n==null?void 0:n.status)==="error")throw new Error(n.error||"Failed to export private key")})}},g={timeoutMs:1e4,intervalMs:5e3};export{E as a,g as b};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2YH3NVVKcjs = require('./chunk-2YH3NVVK.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _ox = require('ox');var _viem = require('viem');var g=class c extends _chunk2YH3NVVKcjs.a{constructor(e){super(e)}signMessage(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let i=_viem.isHex.call(void 0, e)?e:_viem.toHex.call(void 0, e),r=_ox.PersonalMessage.getSignPayload(i);return yield this.sign(r)})}signTransaction(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.sign(e)})}sign(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var s;yield this.handleAuthRequired();let i=this.getJwtOrThrow(),r=e.replace("0x",""),n=yield(s=this.config.clientTEEConnection)==null?void 0:s.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:i,apiKey:this.config.crossmint.apiKey},data:{keyType:"secp256k1",bytes:r,encoding:"hex"}},options:_chunk2YH3NVVKcjs.b});if((n==null?void 0:n.status)==="error")throw new Error(n.error);if((n==null?void 0:n.signature)==null)throw new Error("Failed to sign transaction");return c.verifyPublicKeyFormat(n.publicKey),{signature:n.signature.bytes}})}static verifyPublicKeyFormat(e){if(e==null)throw new Error("No public key found");if(e.encoding!=="hex"||e.keyType!=="secp256k1"||e.bytes==null)throw new Error("Not supported. Expected public key to be in hex encoding and secp256k1 key type. Got: "+JSON.stringify(e))}getChainKeyParams(){return{scheme:"secp256k1",encoding:"hex"}}};exports.a = g;
@@ -1 +0,0 @@
1
- import{a}from"./chunk-KFJLRIY7.js";import{r as l}from"./chunk-PSXRNSOE.js";import{f as o}from"./chunk-BW7YYVZE.js";import{isValidStellarAddress as f}from"@crossmint/common-sdk-base";var d=class u extends a{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer,options:a.getOptions(n),alias:n.alias},a.getApiClient(n))}static from(n){if(!f(n.address))throw new Error("Wallet is not a Stellar wallet");return new u(n)}sendTransaction(n){return o(this,null,function*(){var r;yield this.preAuthIfNeeded();let t=yield this.createTransaction(n);if((r=n.options)!=null&&r.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:t.id};let e={};return yield this.approveTransactionAndWait(t.id,e)})}createTransaction(n){return o(this,null,function*(){var c;let{contractId:t,options:e}=n,r=(c=e==null?void 0:e.experimental_signer)!=null?c:this.signer.locator(),i;if("transaction"in n)i={type:"serialized-transaction",serializedTransaction:n.transaction,contractId:t};else{let{method:h,memo:p,args:T}=n;i={type:"contract-call",contractId:t,method:h,memo:p!=null?{type:"text",value:p}:void 0,args:T}}let s=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:i,signer:r}});if("error"in s)throw new l(JSON.stringify(s));return s})}};export{d as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _web3js = require('@solana/web3.js');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var o=class{constructor(n){this.config=n;this.type="external-wallet";if(n.address==null)throw new Error("Please provide an address for the External Wallet Signer");this._address=n.address,this.onSignTransaction=n.onSignTransaction}address(){return this._address}locator(){return this.config.locator}signMessage(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for solana external wallet signer"))})}signTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.onSignTransaction==null)return yield Promise.reject(new Error("onSignTransaction method is required to sign transactions with a Solana external wallet"));let l=_bs582.default.decode(n),c=_web3js.VersionedTransaction.deserialize(l),t=yield this.onSignTransaction(c),d=new (0, _web3js.PublicKey)(this._address),a=t.message.staticAccountKeys.findIndex(u=>u.equals(d));if(a===-1)throw new (0, _chunkO4FVTK7Xcjs.x)("Wallet public key not found in transaction signers");let s=t.signatures[a];if(s==null)throw new (0, _chunkO4FVTK7Xcjs.x)("No valid signature found in the transaction");let g=new Uint8Array(Object.values(s));return{signature:_bs582.default.encode(g)}})}};exports.a = o;
@@ -1 +0,0 @@
1
- import{f as e}from"./chunk-BW7YYVZE.js";var n=class{constructor(t){this.config=t;this.type="api-key"}locator(){return this.config.locator}signMessage(){return e(this,null,function*(){return yield Promise.reject(new Error("API key signers do not support direct message signing - signatures are handled automatically by the backend"))})}signTransaction(){return e(this,null,function*(){return yield Promise.reject(new Error("API key signers do not support direct transaction signing - transaction are handled automatically by the backend"))})}};export{n as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _viem = require('viem');var r=_viem.defineChain.call(void 0, {id:1514,name:"Story",nativeCurrency:{decimals:18,name:"IP Token",symbol:"IP"},rpcUrls:{default:{http:["https://mainnet.storyrpc.io"]}},testnet:!1});exports.a = r;
@@ -1 +0,0 @@
1
- import{f as t}from"./chunk-BW7YYVZE.js";import{IFrameWindow as a,SignersWindowTransport as s}from"@crossmint/client-sdk-window";import{environmentUrlConfig as m,signerInboundEvents as d,signerOutboundEvents as h}from"@crossmint/client-signers";var i=class{constructor(e){this.config=e;this.handshakeParent=null}initialize(){return t(this,null,function*(){if(this.handshakeParent)return this.handshakeParent;let e=new URL(m[this.config.environment]);e.searchParams.set("targetOrigin",window.location.origin);let n=yield this.createInvisibleIFrame(e.toString());return this.handshakeParent=yield a.init(n,{targetOrigin:e.origin,incomingEvents:h,outgoingEvents:d},s),yield this.handshakeParent.handshakeWithChild(),this.handshakeParent})}createInvisibleIFrame(e){return t(this,null,function*(){let n=document.createElement("iframe");return n.src=e,Object.assign(n.style,{position:"absolute",opacity:"0",pointerEvents:"none",width:"0",height:"0",border:"none",top:"-9999px",left:"-9999px"}),new Promise((r,o)=>{n.onload=()=>r(n),n.onerror=()=>o(new Error("Failed to load iframe content")),document.body.appendChild(n)})})}};export{i as a};
@@ -1 +0,0 @@
1
- import{a as J}from"./chunk-HJ5EDMTA.js";import{d as O}from"./chunk-Z54LVUDS.js";import{c as W,d as L,i as E,m as N,p as x,q as I,r as _,s as P,t as k,u as F,v as $,w as B,x as R}from"./chunk-PSXRNSOE.js";import{a as f,b as A,c as u,d as b,e as C,f as l}from"./chunk-BW7YYVZE.js";import{isValidAddress as G}from"@crossmint/common-sdk-base";var y,c,H=class{constructor(e,t){b(this,y);b(this,c);let{chain:r,address:n,owner:s,signer:h,options:g,alias:i}=e;C(this,c,t),this.chain=r,this.address=n,this.owner=s,this.signer=h,C(this,y,g),this.alias=i}static getApiClient(e){return e.apiClient}static getOptions(e){return e.options}get apiClient(){return u(this,c)}get options(){return u(this,y)}experimental_apiClient(){return u(this,c)}balances(e,t){return l(this,null,function*(){let r;switch(this.chain){case"solana":r="sol";break;case"stellar":r="xlm";break;default:r="eth";break}let n=[r,"usdc",...e!=null?e:[]],s=yield u(this,c).getBalance(this.address,{chains:t!=null?t:[this.chain],tokens:n});if("error"in s)throw new Error(`Failed to get balances for wallet: ${JSON.stringify(s.message)}`);return this.transformBalanceResponse(s,r,e)})}stagingFund(e,t){return l(this,null,function*(){let r=yield this.apiClient.fundWallet(this.address,{amount:e,token:"usdxm",chain:t!=null?t:this.chain});if("error"in r)throw new Error(`Failed to fund wallet: ${JSON.stringify(r.message)}`);return r})}transformBalanceResponse(e,t,r){let n=a=>{var m,w,T,v,S;let o=(m=a.chains)==null?void 0:m[this.chain],p={};return this.chain==="solana"&&o!=null&&"mintHash"in o?p={mintHash:o.mintHash}:this.chain==="stellar"&&o!=null&&"contractId"in o?p={contractId:o.contractId}:o!=null&&"contractAddress"in o&&(p={contractAddress:o.contractAddress}),f({symbol:(w=a.symbol)!=null?w:"",name:(T=a.name)!=null?T:"",amount:(v=a.amount)!=null?v:"0",decimals:a.decimals,rawAmount:(S=a.rawAmount)!=null?S:"0"},p)},s=e.find(a=>a.symbol===t),h=e.find(a=>a.symbol==="usdc"),g=e.filter(a=>a.symbol!==t&&a.symbol!=="usdc"),i=a=>{let o={symbol:a,name:a,amount:"0",decimals:0,rawAmount:"0"},p={};return this.chain==="solana"?p={mintHash:void 0}:this.chain==="stellar"?p={contractId:void 0}:p={contractAddress:void 0},f(f({},o),p)};return{nativeToken:s!=null?n(s):i(t),usdc:h!=null?n(h):i("usdc"),tokens:g.map(n)}}experimental_nfts(e){return l(this,null,function*(){return yield u(this,c).experimental_getNfts(A(f({},e),{chain:this.chain,address:this.address}))})}experimental_transactions(){return l(this,null,function*(){let e=yield u(this,c).getTransactions(this.walletLocator);if("error"in e)throw new Error(`Failed to get transactions: ${JSON.stringify(e.message)}`);return e})}experimental_transaction(e){return l(this,null,function*(){let t=yield u(this,c).getTransaction(this.walletLocator,e);if("error"in t)throw new Error(`Failed to get transaction: ${JSON.stringify(t.error)}`);return t})}experimental_activity(){return l(this,null,function*(){let e=yield this.apiClient.experimental_activity(this.walletLocator,{chain:this.chain});if("error"in e)throw new Error(`Failed to get activity: ${JSON.stringify(e.message)}`);return e})}send(e,t,r,n){return l(this,null,function*(){yield this.preAuthIfNeeded();let s=D(e),h=M(t,this.chain),g=f({recipient:s,amount:r},(n==null?void 0:n.experimental_signer)!=null?{signer:n.experimental_signer}:{}),i=yield u(this,c).send(this.walletLocator,h,g);if("message"in i)throw new _(`Failed to send token: ${JSON.stringify(i.message)}`);return n!=null&&n.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:i.id}:yield this.approveTransactionAndWait(i.id)})}approveTransaction(e){return l(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 l(this,null,function*(){if(e.transactionId!=null)return yield this.approveTransactionAndWait(e.transactionId,e.options);if(e.signatureId!=null)return yield this.approveSignatureAndWait(e.signatureId,e.options);throw new Error("Either transactionId or signatureId must be provided")})}addDelegatedSigner(e){return l(this,null,function*(){var n,s,h;let t=yield u(this,c).registerSigner(this.walletLocator,{signer:e.signer,chain:this.chain==="solana"||this.chain==="stellar"?void 0:this.chain});if("error"in t)throw new Error(`Failed to register signer: ${JSON.stringify(t.message)}`);if(this.chain==="solana"||this.chain==="stellar"){if(!("transaction"in t)||t.transaction==null)throw new Error("Expected transaction in response for Solana/Stellar chain");let g=t.transaction.id;if((n=e.options)!=null&&n.experimental_prepareOnly)return{transactionId:g};yield this.approveTransactionAndWait(g);return}if(!("chains"in t))throw new Error("Expected chains in response for EVM chain");let r=(s=t.chains)==null?void 0:s[this.chain];if((h=e.options)!=null&&h.experimental_prepareOnly)return{signatureId:(r==null?void 0:r.status)!=="success"?r==null?void 0:r.id:void 0};if((r==null?void 0:r.status)==="awaiting-approval"){yield this.approveSignatureAndWait(r.id);return}if((r==null?void 0:r.status)==="pending"){yield this.waitForSignature(r.id);return}})}delegatedSigners(){return l(this,null,function*(){var t,r,n;let e=yield u(this,c).getWallet(this.walletLocator);if("error"in e)throw new L(JSON.stringify(e));if(e.type!=="smart"||e.chainType!=="evm"&&e.chainType!=="solana"&&e.chainType!=="stellar")throw new W(`Wallet type ${e.type} not supported`);return(n=(r=(t=e==null?void 0:e.config)==null?void 0:t.delegatedSigners)==null?void 0:r.map(s=>{let h=s.locator.indexOf(":");return{signer:`external-wallet:${h>=0?s.locator.slice(h+1):s.locator}`}}))!=null?n:[]})}get walletLocator(){if(u(this,c).isServerSide)return this.address;{let e;switch(this.chain){case"stellar":e="me:stellar:smart";break;case"solana":e="me:solana:smart";break;default:e="me:evm:smart";break}let t=this.alias!=null?`:alias:${this.alias}`:"";return e+t}}preAuthIfNeeded(){return l(this,null,function*(){this.signer instanceof J&&(yield this.signer.ensureAuthenticated())})}get isSolanaWallet(){return this.chain==="solana"}approveTransactionAndWait(e,t){return l(this,null,function*(){return yield this.approveTransactionInternal(e,t),yield this.sleep(1e3),yield this.waitForTransaction(e)})}approveSignatureAndWait(e,t){return l(this,null,function*(){let r=yield this.approveSignatureInternal(e,t);return!("error"in r)&&r.status==="success"&&r.outputSignature!=null?{signature:r.outputSignature,signatureId:e}:(yield this.sleep(1e3),yield this.waitForSignature(e))})}approveSignatureInternal(e,t){return l(this,null,function*(){var i,a;if(this.isSolanaWallet)throw new Error("Approving signatures is only supported for EVM smart wallets");let r=yield u(this,c).getSignature(this.walletLocator,e);if("error"in r)throw new x(JSON.stringify(r));if(this.signer.type==="api-key")return r;if((t==null?void 0:t.experimental_approval)!=null){let o=[t.experimental_approval];return yield this.executeApproveSignatureWithErrorHandling(e,o)}let n=(i=r.approvals)==null?void 0:i.pending;if(n==null)return r;let s=[...(a=t==null?void 0:t.additionalSigners)!=null?a:[],this.signer],g=(yield Promise.all(n.map(o=>{let p=s.find(m=>m.locator()===o.signer.locator);if(p==null)throw new E(`Signer ${o.signer} not found in pending approvals`);return p.signMessage(o.message)}))).map(o=>A(f({},o),{signer:this.signer.locator()}));return yield this.executeApproveSignatureWithErrorHandling(e,g)})}approveTransactionInternal(e,t){return l(this,null,function*(){var i,a,o,p,m;let r=yield u(this,c).getTransaction(this.walletLocator,e);if("error"in r)throw new P(JSON.stringify(r));if(yield(o=(a=(i=u(this,y))==null?void 0:i.experimental_callbacks)==null?void 0:a.onTransactionStart)==null?void 0:o.call(a),this.signer.type==="api-key")return r;if((t==null?void 0:t.experimental_approval)!=null){let w=[t.experimental_approval];return yield this.executeApproveTransactionWithErrorHandling(e,w)}let n=(p=r.approvals)==null?void 0:p.pending;if(n==null)return r;let s=[...(m=t==null?void 0:t.additionalSigners)!=null?m:[],this.signer],g=(yield Promise.all(n.map(w=>{let T=s.find(S=>S.locator()===w.signer.locator);if(T==null)throw new E(`Signer ${w.signer} not found in pending approvals`);let v=r.chainType==="solana"&&"transaction"in r.onChain?r.onChain.transaction:w.message;return T.signTransaction(v)}))).map(w=>A(f({},w),{signer:this.signer.locator()}));return yield this.executeApproveTransactionWithErrorHandling(e,g)})}executeApproveTransactionWithErrorHandling(e,t){return l(this,null,function*(){let r=yield u(this,c).approveTransaction(this.walletLocator,e,{approvals:t});if(r.error)throw new R(JSON.stringify(r));return r})}executeApproveSignatureWithErrorHandling(e,t){return l(this,null,function*(){let r=yield u(this,c).approveSignature(this.walletLocator,e,{approvals:t});if(r.error)throw new I(JSON.stringify(r));return r})}waitForSignature(e){return l(this,null,function*(){let t=null;do if(yield new Promise(r=>setTimeout(r,O)),t=yield u(this,c).getSignature(this.walletLocator,e),"error"in t)throw new x(JSON.stringify(t));while(t===null||t.status==="pending");if(t.status==="failed")throw new N("Signature signing failed");if(!t.outputSignature)throw new x("Signature not available");return{signature:t.outputSignature,signatureId:e}})}waitForTransaction(h){return l(this,arguments,function*(e,t=6e4,{backoffMultiplier:r=1.1,maxBackoffMs:n=2e3,initialBackoffMs:s=O}={}){var o;let g=Date.now(),i;do{if(Date.now()-g>t)throw new k("Transaction confirmation timeout");if(i=yield u(this,c).getTransaction(this.walletLocator,e),i.error)throw new P(JSON.stringify(i));yield this.sleep(s),s=Math.min(s*r,n)}while(i.status==="pending");if(i.status==="failed")throw new F(`Transaction sending failed: ${JSON.stringify(i.error)}`);if(i.status==="awaiting-approval")throw new $("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let a=i.onChain.txId;if(a==null)throw new B("Transaction hash not found on transaction response");return{hash:a,explorerLink:(o=i.onChain.explorerLink)!=null?o:"",transactionId:i.id}})}sleep(e){return l(this,null,function*(){return new Promise(t=>setTimeout(t,e))})}};y=new WeakMap,c=new WeakMap;function D(d){if(typeof d=="string")return d;if("email"in d)return`email:${d.email}`;if("x"in d)return`x:${d.x}`;if("twitter"in d)return`twitter:${d.twitter}`;if("phone"in d)return`phoneNumber:${d.phone}`;if("userId"in d)return`userId:${d.userId}`;throw new Error("Invalid recipient locator")}function M(d,e){return G(d)?`${e}:${d}`:`${e}:${d.toLowerCase()}`}export{H as a};
@@ -1 +0,0 @@
1
- import{defineChain as t}from"viem";var o=t({id:1514,name:"Story",nativeCurrency:{decimals:18,name:"IP Token",symbol:"IP"},rpcUrls:{default:{http:["https://mainnet.storyrpc.io"]}},testnet:!1});export{o as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk2YH3NVVKcjs = require('./chunk-2YH3NVVK.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _web3js = require('@solana/web3.js');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var a=class g extends _chunk2YH3NVVKcjs.a{constructor(e){super(e)}signMessage(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for email signer"))})}signTransaction(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var r;yield this.handleAuthRequired();let c=this.getJwtOrThrow(),d=_bs582.default.decode(e),l=_web3js.VersionedTransaction.deserialize(d).message.serialize(),n=yield(r=this.config.clientTEEConnection)==null?void 0:r.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:c,apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:_bs582.default.encode(l),encoding:"base58"}},options:_chunk2YH3NVVKcjs.b});if((n==null?void 0:n.status)==="error")throw new Error(n.error);if((n==null?void 0:n.signature)==null)throw new Error("Failed to sign transaction");return g.verifyPublicKeyFormat(n.publicKey),{signature:n.signature.bytes}})}static verifyPublicKeyFormat(e){if(e==null)throw new Error("No public key found");if(e.encoding!=="base58"||e.keyType!=="ed25519"||e.bytes==null)throw new Error("Not supported. Expected public key to be in base58 encoding and ed25519 key type. Got: "+JSON.stringify(e))}getChainKeyParams(){return{scheme:"ed25519",encoding:"base58"}}};exports.a = a;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _commonsdkauth = require('@crossmint/common-sdk-auth');var m=(n,r,o)=>`Wallet signer configuration mismatch at "${n}" - expected "${o}" from existing wallet but found "${r}"`;function u(n){let o=n.toLowerCase().split("@"),t=o[1],s=t==="googlemail.com",i=(s||t==="gmail.com")&&o[0].includes(".");return s&&(o[1]="gmail.com"),i&&(o[0]=o[0].replace(/\./g,"")),`${o[0]}@${o[1]}`}function a(n){return typeof n=="string"&&_commonsdkauth.isEmailValid.call(void 0, n)?u(n):n}function f(n,r,o=""){if(n!==r){if(n==null||r==null)throw new Error(`Cannot compare null or undefined signer configs at path: ${o}`);for(let t of Object.keys(n)){if(!(t in r))continue;let s=o?`${o}.${t}`:t,e=n[t],i=r[t];if(typeof e=="object"&&e!==null&&typeof i=="object"&&i!==null)f(e,i,s);else if(a(e)!==a(i))throw new (0, _chunkO4FVTK7Xcjs.f)(m(s,e,i))}}}exports.a = f;
@@ -1 +0,0 @@
1
- import{f as e}from"./chunk-BW7YYVZE.js";var n=class{constructor(t){this.config=t;this.type="api-key"}locator(){return this.config.locator}signMessage(){return e(this,null,function*(){return yield Promise.reject(new Error("API key signers do not support direct message signing - signatures are handled automatically by the backend"))})}signTransaction(){return e(this,null,function*(){return yield Promise.reject(new Error("API key signers do not support direct transaction signing - transaction are handled automatically by the backend"))})}};export{n as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2YH3NVVKcjs = require('./chunk-2YH3NVVK.cjs');var _chunk3SW6AJSGcjs = require('./chunk-3SW6AJSG.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var y,c,H= exports.a =class{constructor(e,t){_chunkXALFCQKDcjs.d.call(void 0, this,y);_chunkXALFCQKDcjs.d.call(void 0, this,c);let{chain:r,address:n,owner:s,signer:h,options:g,alias:i}=e;_chunkXALFCQKDcjs.e.call(void 0, this,c,t),this.chain=r,this.address=n,this.owner=s,this.signer=h,_chunkXALFCQKDcjs.e.call(void 0, this,y,g),this.alias=i}static getApiClient(e){return e.apiClient}static getOptions(e){return e.options}get apiClient(){return _chunkXALFCQKDcjs.c.call(void 0, this,c)}get options(){return _chunkXALFCQKDcjs.c.call(void 0, this,y)}experimental_apiClient(){return _chunkXALFCQKDcjs.c.call(void 0, this,c)}balances(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r;switch(this.chain){case"solana":r="sol";break;case"stellar":r="xlm";break;default:r="eth";break}let n=[r,"usdc",...e!=null?e:[]],s=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getBalance(this.address,{chains:t!=null?t:[this.chain],tokens:n});if("error"in s)throw new Error(`Failed to get balances for wallet: ${JSON.stringify(s.message)}`);return this.transformBalanceResponse(s,r,e)})}stagingFund(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=yield this.apiClient.fundWallet(this.address,{amount:e,token:"usdxm",chain:t!=null?t:this.chain});if("error"in r)throw new Error(`Failed to fund wallet: ${JSON.stringify(r.message)}`);return r})}transformBalanceResponse(e,t,r){let n=a=>{var m,w,T,v,S;let o=(m=a.chains)==null?void 0:m[this.chain],p={};return this.chain==="solana"&&o!=null&&"mintHash"in o?p={mintHash:o.mintHash}:this.chain==="stellar"&&o!=null&&"contractId"in o?p={contractId:o.contractId}:o!=null&&"contractAddress"in o&&(p={contractAddress:o.contractAddress}),_chunkXALFCQKDcjs.a.call(void 0, {symbol:(w=a.symbol)!=null?w:"",name:(T=a.name)!=null?T:"",amount:(v=a.amount)!=null?v:"0",decimals:a.decimals,rawAmount:(S=a.rawAmount)!=null?S:"0"},p)},s=e.find(a=>a.symbol===t),h=e.find(a=>a.symbol==="usdc"),g=e.filter(a=>a.symbol!==t&&a.symbol!=="usdc"),i=a=>{let o={symbol:a,name:a,amount:"0",decimals:0,rawAmount:"0"},p={};return this.chain==="solana"?p={mintHash:void 0}:this.chain==="stellar"?p={contractId:void 0}:p={contractAddress:void 0},_chunkXALFCQKDcjs.a.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},o),p)};return{nativeToken:s!=null?n(s):i(t),usdc:h!=null?n(h):i("usdc"),tokens:g.map(n)}}experimental_nfts(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield _chunkXALFCQKDcjs.c.call(void 0, this,c).experimental_getNfts(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},e),{chain:this.chain,address:this.address}))})}experimental_transactions(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let e=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getTransactions(this.walletLocator);if("error"in e)throw new Error(`Failed to get transactions: ${JSON.stringify(e.message)}`);return e})}experimental_transaction(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getTransaction(this.walletLocator,e);if("error"in t)throw new Error(`Failed to get transaction: ${JSON.stringify(t.error)}`);return t})}experimental_activity(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let e=yield this.apiClient.experimental_activity(this.walletLocator,{chain:this.chain});if("error"in e)throw new Error(`Failed to get activity: ${JSON.stringify(e.message)}`);return e})}send(e,t,r,n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){yield this.preAuthIfNeeded();let s=D(e),h=M(t,this.chain),g=_chunkXALFCQKDcjs.a.call(void 0, {recipient:s,amount:r},(n==null?void 0:n.experimental_signer)!=null?{signer:n.experimental_signer}:{}),i=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).send(this.walletLocator,h,g);if("message"in i)throw new (0, _chunkO4FVTK7Xcjs.r)(`Failed to send token: ${JSON.stringify(i.message)}`);return n!=null&&n.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:i.id}:yield this.approveTransactionAndWait(i.id)})}approveTransaction(e){return _chunkXALFCQKDcjs.f.call(void 0, 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 _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(e.transactionId!=null)return yield this.approveTransactionAndWait(e.transactionId,e.options);if(e.signatureId!=null)return yield this.approveSignatureAndWait(e.signatureId,e.options);throw new Error("Either transactionId or signatureId must be provided")})}addDelegatedSigner(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var n,s,h;let t=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).registerSigner(this.walletLocator,{signer:e.signer,chain:this.chain==="solana"||this.chain==="stellar"?void 0:this.chain});if("error"in t)throw new Error(`Failed to register signer: ${JSON.stringify(t.message)}`);if(this.chain==="solana"||this.chain==="stellar"){if(!("transaction"in t)||t.transaction==null)throw new Error("Expected transaction in response for Solana/Stellar chain");let g=t.transaction.id;if((n=e.options)!=null&&n.experimental_prepareOnly)return{transactionId:g};yield this.approveTransactionAndWait(g);return}if(!("chains"in t))throw new Error("Expected chains in response for EVM chain");let r=(s=t.chains)==null?void 0:s[this.chain];if((h=e.options)!=null&&h.experimental_prepareOnly)return{signatureId:(r==null?void 0:r.status)!=="success"?r==null?void 0:r.id:void 0};if((r==null?void 0:r.status)==="awaiting-approval"){yield this.approveSignatureAndWait(r.id);return}if((r==null?void 0:r.status)==="pending"){yield this.waitForSignature(r.id);return}})}delegatedSigners(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var t,r,n;let e=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getWallet(this.walletLocator);if("error"in e)throw new (0, _chunkO4FVTK7Xcjs.d)(JSON.stringify(e));if(e.type!=="smart"||e.chainType!=="evm"&&e.chainType!=="solana"&&e.chainType!=="stellar")throw new (0, _chunkO4FVTK7Xcjs.c)(`Wallet type ${e.type} not supported`);return(n=(r=(t=e==null?void 0:e.config)==null?void 0:t.delegatedSigners)==null?void 0:r.map(s=>{let h=s.locator.indexOf(":");return{signer:`external-wallet:${h>=0?s.locator.slice(h+1):s.locator}`}}))!=null?n:[]})}get walletLocator(){if(_chunkXALFCQKDcjs.c.call(void 0, this,c).isServerSide)return this.address;{let e;switch(this.chain){case"stellar":e="me:stellar:smart";break;case"solana":e="me:solana:smart";break;default:e="me:evm:smart";break}let t=this.alias!=null?`:alias:${this.alias}`:"";return e+t}}preAuthIfNeeded(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){this.signer instanceof _chunk2YH3NVVKcjs.a&&(yield this.signer.ensureAuthenticated())})}get isSolanaWallet(){return this.chain==="solana"}approveTransactionAndWait(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.approveTransactionInternal(e,t),yield this.sleep(1e3),yield this.waitForTransaction(e)})}approveSignatureAndWait(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=yield this.approveSignatureInternal(e,t);return!("error"in r)&&r.status==="success"&&r.outputSignature!=null?{signature:r.outputSignature,signatureId:e}:(yield this.sleep(1e3),yield this.waitForSignature(e))})}approveSignatureInternal(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i,a;if(this.isSolanaWallet)throw new Error("Approving signatures is only supported for EVM smart wallets");let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getSignature(this.walletLocator,e);if("error"in r)throw new (0, _chunkO4FVTK7Xcjs.p)(JSON.stringify(r));if(this.signer.type==="api-key")return r;if((t==null?void 0:t.experimental_approval)!=null){let o=[t.experimental_approval];return yield this.executeApproveSignatureWithErrorHandling(e,o)}let n=(i=r.approvals)==null?void 0:i.pending;if(n==null)return r;let s=[...(a=t==null?void 0:t.additionalSigners)!=null?a:[],this.signer],g=(yield Promise.all(n.map(o=>{let p=s.find(m=>m.locator()===o.signer.locator);if(p==null)throw new (0, _chunkO4FVTK7Xcjs.i)(`Signer ${o.signer} not found in pending approvals`);return p.signMessage(o.message)}))).map(o=>_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},o),{signer:this.signer.locator()}));return yield this.executeApproveSignatureWithErrorHandling(e,g)})}approveTransactionInternal(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i,a,o,p,m;let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getTransaction(this.walletLocator,e);if("error"in r)throw new (0, _chunkO4FVTK7Xcjs.s)(JSON.stringify(r));if(yield(o=(a=(i=_chunkXALFCQKDcjs.c.call(void 0, this,y))==null?void 0:i.experimental_callbacks)==null?void 0:a.onTransactionStart)==null?void 0:o.call(a),this.signer.type==="api-key")return r;if((t==null?void 0:t.experimental_approval)!=null){let w=[t.experimental_approval];return yield this.executeApproveTransactionWithErrorHandling(e,w)}let n=(p=r.approvals)==null?void 0:p.pending;if(n==null)return r;let s=[...(m=t==null?void 0:t.additionalSigners)!=null?m:[],this.signer],g=(yield Promise.all(n.map(w=>{let T=s.find(S=>S.locator()===w.signer.locator);if(T==null)throw new (0, _chunkO4FVTK7Xcjs.i)(`Signer ${w.signer} not found in pending approvals`);let v=r.chainType==="solana"&&"transaction"in r.onChain?r.onChain.transaction:w.message;return T.signTransaction(v)}))).map(w=>_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},w),{signer:this.signer.locator()}));return yield this.executeApproveTransactionWithErrorHandling(e,g)})}executeApproveTransactionWithErrorHandling(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).approveTransaction(this.walletLocator,e,{approvals:t});if(r.error)throw new (0, _chunkO4FVTK7Xcjs.x)(JSON.stringify(r));return r})}executeApproveSignatureWithErrorHandling(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).approveSignature(this.walletLocator,e,{approvals:t});if(r.error)throw new (0, _chunkO4FVTK7Xcjs.q)(JSON.stringify(r));return r})}waitForSignature(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=null;do if(yield new Promise(r=>setTimeout(r,_chunk3SW6AJSGcjs.d)),t=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getSignature(this.walletLocator,e),"error"in t)throw new (0, _chunkO4FVTK7Xcjs.p)(JSON.stringify(t));while(t===null||t.status==="pending");if(t.status==="failed")throw new (0, _chunkO4FVTK7Xcjs.m)("Signature signing failed");if(!t.outputSignature)throw new (0, _chunkO4FVTK7Xcjs.p)("Signature not available");return{signature:t.outputSignature,signatureId:e}})}waitForTransaction(h){return _chunkXALFCQKDcjs.f.call(void 0, this,arguments,function*(e,t=6e4,{backoffMultiplier:r=1.1,maxBackoffMs:n=2e3,initialBackoffMs:s=_chunk3SW6AJSGcjs.d}={}){var o;let g=Date.now(),i;do{if(Date.now()-g>t)throw new (0, _chunkO4FVTK7Xcjs.t)("Transaction confirmation timeout");if(i=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getTransaction(this.walletLocator,e),i.error)throw new (0, _chunkO4FVTK7Xcjs.s)(JSON.stringify(i));yield this.sleep(s),s=Math.min(s*r,n)}while(i.status==="pending");if(i.status==="failed")throw new (0, _chunkO4FVTK7Xcjs.u)(`Transaction sending failed: ${JSON.stringify(i.error)}`);if(i.status==="awaiting-approval")throw new (0, _chunkO4FVTK7Xcjs.v)("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let a=i.onChain.txId;if(a==null)throw new (0, _chunkO4FVTK7Xcjs.w)("Transaction hash not found on transaction response");return{hash:a,explorerLink:(o=i.onChain.explorerLink)!=null?o:"",transactionId:i.id}})}sleep(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return new Promise(t=>setTimeout(t,e))})}};y=new WeakMap,c=new WeakMap;function D(d){if(typeof d=="string")return d;if("email"in d)return`email:${d.email}`;if("x"in d)return`x:${d.x}`;if("twitter"in d)return`twitter:${d.twitter}`;if("phone"in d)return`phoneNumber:${d.phone}`;if("userId"in d)return`userId:${d.userId}`;throw new Error("Invalid recipient locator")}function M(d,e){return _commonsdkbase.isValidAddress.call(void 0, d)?`${e}:${d}`:`${e}:${d.toLowerCase()}`}exports.a = H;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var n=class{constructor(e){this.config=e;this.type="external-wallet";if(e.address==null)throw new Error("Please provide an address for the External Wallet Signer");this._address=e.address,this.provider=e.provider,this.viemAccount=e.viemAccount}address(){return this._address}locator(){return this.config.locator}signMessage(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var s;if(this.provider!=null){let r=yield this.provider.request({method:"personal_sign",params:[e,this._address]});if(r==null)throw new Error("[EVMExternalWalletSigner] Failed to sign message: EIP1193 provider signMessage returned null");return{signature:r}}if(((s=this.viemAccount)==null?void 0:s.signMessage)!=null){let r=yield this.viemAccount.signMessage({message:{raw:e}});if(r==null)throw new Error("[EVMExternalWalletSigner] Failed to sign message: Viem account signMessage returned null");return{signature:r}}throw new Error("No signer provider or viem account provided")})}signTransaction(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.signMessage(e)})}};exports.a = n;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _clientsdkwindow = require('@crossmint/client-sdk-window');var _clientsigners = require('@crossmint/client-signers');var i=class{constructor(e){this.config=e;this.handshakeParent=null}initialize(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.handshakeParent)return this.handshakeParent;let e=new URL(_clientsigners.environmentUrlConfig[this.config.environment]);e.searchParams.set("targetOrigin",window.location.origin);let n=yield this.createInvisibleIFrame(e.toString());return this.handshakeParent=yield _clientsdkwindow.IFrameWindow.init(n,{targetOrigin:e.origin,incomingEvents:_clientsigners.signerOutboundEvents,outgoingEvents:_clientsigners.signerInboundEvents},_clientsdkwindow.SignersWindowTransport),yield this.handshakeParent.handshakeWithChild(),this.handshakeParent})}createInvisibleIFrame(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let n=document.createElement("iframe");return n.src=e,Object.assign(n.style,{position:"absolute",opacity:"0",pointerEvents:"none",width:"0",height:"0",border:"none",top:"-9999px",left:"-9999px"}),new Promise((r,o)=>{n.onload=()=>r(n),n.onerror=()=>o(new Error("Failed to load iframe content")),document.body.appendChild(n)})})}};exports.a = i;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkM2UBZY5Scjs = require('./chunk-M2UBZY5S.cjs');var _chunkHRSVFJNDcjs = require('./chunk-HRSVFJND.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var _commonsdkbase = require('@crossmint/common-sdk-base');var u=class T extends _chunkM2UBZY5Scjs.a{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer,options:_chunkM2UBZY5Scjs.a.getOptions(n),alias:n.alias},_chunkM2UBZY5Scjs.a.getApiClient(n))}static from(n){if(!_commonsdkbase.isValidSolanaAddress.call(void 0, n.address))throw new Error("Wallet is not a Solana wallet");return new T(n)}sendTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var e,i;yield this.preAuthIfNeeded();let t=yield this.createTransaction(n);if((e=n.options)!=null&&e.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:t.id};let a={additionalSigners:(i=n.additionalSigners)==null?void 0:i.map(s=>new (0, _chunkHRSVFJNDcjs.a)({type:"external-wallet",address:s.publicKey.toString(),locator:`external-wallet:${s.publicKey.toString()}`,onSignTransaction:p=>(p.sign([s]),Promise.resolve(p))}))};return yield this.approveTransactionAndWait(t.id,a)})}createTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var e,i;let t=(i=(e=n.options)==null?void 0:e.experimental_signer)!=null?i:this.signer.locator(),r;"serializedTransaction"in n?r=n.serializedTransaction:r=_bs582.default.encode(n.transaction.serialize());let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:r,signer:t}});if("error"in a)throw new (0, _chunkO4FVTK7Xcjs.r)(JSON.stringify(a));return a})}};exports.a = u;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _commonsdkbase = require('@crossmint/common-sdk-base');var o=class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.API_KEY_INVALID,r)}},c= exports.b =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.ENVIRONMENT_INVALID,r)}},p= exports.c =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.WALLET_TYPE_INVALID,r)}},i= exports.d =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.WALLET_NOT_AVAILABLE,r)}},A= exports.e =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.WALLET_NOT_AVAILABLE,r)}},I= exports.f =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.WALLET_CREATION_FAILED,r)}},x= exports.g =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.WALLET_TYPE_INVALID,r)}},g= exports.h =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.SIGNER_INVALID,r)}},u= exports.i =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.SIGNER_INVALID,r)}},N= exports.j =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.MESSAGE_INVALID,r)}},E= exports.k =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.MESSAGE_INVALID,r)}},L= exports.l =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.SIGNING_FAILED,r)}},_= exports.m =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.SIGNING_FAILED,r)}},l= exports.n =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.SIGNING_FAILED,r)}},T= exports.o =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.NO_SIGNATURE,r)}},a= exports.p =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.NO_SIGNATURE,r)}},d= exports.q =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.SIGNING_FAILED,r)}},S= exports.r =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.NO_TRANSACTION,r)}},D= exports.s =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.NO_TRANSACTION,r)}},O= exports.t =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.TRANSACTION_FAILED,r)}},G= exports.u =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.TRANSACTION_FAILED,r)}},R= exports.v =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.TRANSACTION_FAILED,r)}},C= exports.w =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.TRANSACTION_FAILED,r)}},F= exports.x =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.TRANSACTION_FAILED,r)}},V= exports.y =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.TRANSACTION_FAILED,r)}};exports.a = o; exports.b = c; exports.c = p; exports.d = i; exports.e = A; exports.f = I; exports.g = x; exports.h = g; exports.i = u; exports.j = N; exports.k = E; exports.l = L; exports.m = _; exports.n = l; exports.o = T; exports.p = a; exports.q = d; exports.r = S; exports.s = D; exports.t = O; exports.u = G; exports.v = R; exports.w = C; exports.x = F; exports.y = V;
@@ -1 +0,0 @@
1
- var n=class extends Error{constructor(){super("Authentication was rejected by the user"),this.name="AuthRejectedError"}};function r(e){return e._exportPrivateKey!==void 0}export{n as a,r as b};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSTYSP6KLcjs = require('./chunk-STYSP6KL.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var s=e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/me{walletType}/transactions/{transactionId}/approvals"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},i= exports.b =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/me{walletType}/transactions/{transactionId}"},e))},C= exports.c =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/me{walletType}/transactions"},e))},p= exports.d =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/me{walletType}/transactions"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},W= exports.e =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/me{walletType}/signers/{signer}"},e))},c= exports.f =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/me{walletType}/signers"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},u= exports.g =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/me{walletType}/signatures/{signatureId}/approvals"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},V= exports.h =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/me{walletType}/signatures/{signatureId}"},e))},w= exports.i =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/me{walletType}/signatures"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},T= exports.j =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/me{walletType}/activity"},e))},h= exports.k =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/me{walletType}"},e))},g= exports.l =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/me"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},E= exports.m =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/{walletLocator}/transactions/{transactionId}/approvals"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},S= exports.n =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/{walletLocator}/transactions/{transactionId}"},e))},O= exports.o =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/{walletLocator}/transactions"},e))},d= exports.p =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/{walletLocator}/transactions"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},G= exports.q =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/{walletLocator}/signers/{signer}"},e))},D= exports.r =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/{walletLocator}/signers"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},M= exports.s =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/{walletLocator}/signatures/{signatureId}/approvals"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},R= exports.t =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/{walletLocator}/signatures/{signatureId}"},e))},b= exports.u =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/{walletLocator}/signatures"},e))},v= exports.v =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/{walletLocator}/signatures"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},x= exports.w =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/{walletLocator}/balances"},e))},y= exports.x =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/{walletLocator}/balances"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},A= exports.y =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/{walletLocator}/activity"},e))},m= exports.z =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets/{walletLocator}"},e))},f= exports.A =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/v1-alpha2/wallets"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},L= exports.B =e=>{var r;return((r=e==null?void 0:e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.a.call(void 0, {url:"/unstable/wallets/verify-ownership"},e))},B= exports.C =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/unstable/wallets/me{walletType}/tokens/{tokenLocator}/transfers"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},k= exports.D =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/unstable/wallets/me{walletLocator}/activity"},e))},q= exports.E =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/unstable/wallets/{walletLocator}/tokens/{tokenLocator}/transfers"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},j= exports.F =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/unstable/wallets/{walletLocator}/balances"},e))},F= exports.G =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/unstable/wallets/{walletLocator}/activity"},e))},I= exports.H =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/me{walletLocator}/transactions/{transactionId}/approvals"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},U= exports.I =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/me{walletLocator}/transactions/{transactionId}"},e))},N= exports.J =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/me{walletLocator}/transactions"},e))},_= exports.K =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/me{walletLocator}/transactions"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},z= exports.L =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/me{walletLocator}/tokens/{tokenLocator}/transfers"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},H= exports.M =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/me{walletLocator}/signers/{signer}"},e))},J= exports.N =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/me{walletLocator}/signers"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},K= exports.O =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/me{walletLocator}/signatures/{signatureId}/approvals"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},P= exports.P =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/me{walletLocator}/signatures/{signatureId}"},e))},Q= exports.Q =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/me{walletLocator}/signatures"},e))},X= exports.R =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/me{walletLocator}/signatures"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},Y= exports.S =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/me{walletLocator}"},e))},Z= exports.T =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/me"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},$= exports.U =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/{walletLocator}/transactions/{transactionId}/approvals"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},ee= exports.V =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/{walletLocator}/transactions/{transactionId}"},e))},re= exports.W =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/{walletLocator}/transactions"},e))},te= exports.X =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/{walletLocator}/transactions"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},le= exports.Y =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/{walletLocator}/tokens/{tokenLocator}/transfers"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},oe= exports.Z =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/{walletLocator}/signers/{signer}"},e))},ae= exports._ =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/{walletLocator}/signers"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},ne= exports.$ =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/{walletLocator}/signatures/{signatureId}/approvals"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},se= exports.aa =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/{walletLocator}/signatures/{signatureId}"},e))},ie= exports.ba =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/{walletLocator}/signatures"},e))},Ce= exports.ca =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/{walletLocator}/signatures"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},pe= exports.da =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/{walletLocator}/balances"},e))},We= exports.ea =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets/{walletLocator}"},e))},ce= exports.fa =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2025-06-09/wallets"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},ue= exports.ga =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/me{walletType}/transactions/{transactionId}/approvals"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},Ve= exports.ha =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/me{walletType}/transactions/{transactionId}"},e))},we= exports.ia =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/me{walletType}/transactions"},e))},Te= exports.ja =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/me{walletType}/transactions"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},he= exports.ka =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/me{walletType}/signers/{signer}"},e))},ge= exports.la =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/me{walletType}/signers"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},Ee= exports.ma =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/me{walletType}/signatures/{signatureId}/approvals"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},Se= exports.na =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/me{walletType}/signatures/{signatureId}"},e))},Oe= exports.oa =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/me{walletType}/signatures"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},de= exports.pa =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/me{walletType}/activity"},e))},Ge= exports.qa =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/me{walletType}"},e))},De= exports.ra =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/me"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},Me= exports.sa =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/{walletLocator}/transactions/{transactionId}/approvals"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},Re= exports.ta =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/{walletLocator}/transactions/{transactionId}"},e))},be= exports.ua =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/{walletLocator}/transactions"},e))},ve= exports.va =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/{walletLocator}/transactions"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},xe= exports.wa =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/{walletLocator}/signers/{signer}"},e))},ye= exports.xa =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/{walletLocator}/signers"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},Ae= exports.ya =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/{walletLocator}/signatures/{signatureId}/approvals"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},me= exports.za =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/{walletLocator}/signatures/{signatureId}"},e))},fe= exports.Aa =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/{walletLocator}/signatures"},e))},Le= exports.Ba =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/{walletLocator}/signatures"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))},Be= exports.Ca =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/{walletLocator}/activity"},e))},ke= exports.Da =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/{walletLocator}"},e))},qe= exports.Ea =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).get(_chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets/{locator}/nfts"},e))},je= exports.Fa =e=>{var r;return((r=e.client)!=null?r:_chunkSTYSP6KLcjs.a).post(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {url:"/2022-06-09/wallets"},e),{headers:_chunkXALFCQKDcjs.a.call(void 0, {"Content-Type":"application/json"},e.headers)}))};exports.a = s; exports.b = i; exports.c = C; exports.d = p; exports.e = W; exports.f = c; exports.g = u; exports.h = V; exports.i = w; exports.j = T; exports.k = h; exports.l = g; exports.m = E; exports.n = S; exports.o = O; exports.p = d; exports.q = G; exports.r = D; exports.s = M; exports.t = R; exports.u = b; exports.v = v; exports.w = x; exports.x = y; exports.y = A; exports.z = m; exports.A = f; exports.B = L; exports.C = B; exports.D = k; exports.E = q; exports.F = j; exports.G = F; exports.H = I; exports.I = U; exports.J = N; exports.K = _; exports.L = z; exports.M = H; exports.N = J; exports.O = K; exports.P = P; exports.Q = Q; exports.R = X; exports.S = Y; exports.T = Z; exports.U = $; exports.V = ee; exports.W = re; exports.X = te; exports.Y = le; exports.Z = oe; exports._ = ae; exports.$ = ne; exports.aa = se; exports.ba = ie; exports.ca = Ce; exports.da = pe; exports.ea = We; exports.fa = ce; exports.ga = ue; exports.ha = Ve; exports.ia = we; exports.ja = Te; exports.ka = he; exports.la = ge; exports.ma = Ee; exports.na = Se; exports.oa = Oe; exports.pa = de; exports.qa = Ge; exports.ra = De; exports.sa = Me; exports.ta = Re; exports.ua = be; exports.va = ve; exports.wa = xe; exports.xa = ye; exports.ya = Ae; exports.za = me; exports.Aa = fe; exports.Ba = Le; exports.Ca = Be; exports.Da = ke; exports.Ea = qe; exports.Fa = je;
@@ -1 +0,0 @@
1
- import{CrossmintSDKError as t,WalletErrorCode as e}from"@crossmint/common-sdk-base";var o=class extends t{constructor(s,r){super(s,e.API_KEY_INVALID,r)}},c=class extends t{constructor(s,r){super(s,e.ENVIRONMENT_INVALID,r)}},p=class extends t{constructor(s,r){super(s,e.WALLET_TYPE_INVALID,r)}},i=class extends t{constructor(s,r){super(s,e.WALLET_NOT_AVAILABLE,r)}},A=class extends t{constructor(s,r){super(s,e.WALLET_NOT_AVAILABLE,r)}},I=class extends t{constructor(s,r){super(s,e.WALLET_CREATION_FAILED,r)}},x=class extends t{constructor(s,r){super(s,e.WALLET_TYPE_INVALID,r)}},g=class extends t{constructor(s,r){super(s,e.SIGNER_INVALID,r)}},u=class extends t{constructor(s,r){super(s,e.SIGNER_INVALID,r)}},N=class extends t{constructor(s,r){super(s,e.MESSAGE_INVALID,r)}},E=class extends t{constructor(s,r){super(s,e.MESSAGE_INVALID,r)}},L=class extends t{constructor(s,r){super(s,e.SIGNING_FAILED,r)}},_=class extends t{constructor(s,r){super(s,e.SIGNING_FAILED,r)}},l=class extends t{constructor(s,r){super(s,e.SIGNING_FAILED,r)}},T=class extends t{constructor(s,r){super(s,e.NO_SIGNATURE,r)}},a=class extends t{constructor(s,r){super(s,e.NO_SIGNATURE,r)}},d=class extends t{constructor(s,r){super(s,e.SIGNING_FAILED,r)}},S=class extends t{constructor(s,r){super(s,e.NO_TRANSACTION,r)}},D=class extends t{constructor(s,r){super(s,e.NO_TRANSACTION,r)}},O=class extends t{constructor(s,r){super(s,e.TRANSACTION_FAILED,r)}},G=class extends t{constructor(s,r){super(s,e.TRANSACTION_FAILED,r)}},R=class extends t{constructor(s,r){super(s,e.TRANSACTION_FAILED,r)}},C=class extends t{constructor(s,r){super(s,e.TRANSACTION_FAILED,r)}},F=class extends t{constructor(s,r){super(s,e.TRANSACTION_FAILED,r)}},V=class extends t{constructor(s,r){super(s,e.TRANSACTION_FAILED,r)}};export{o as a,c as b,p as c,i as d,A as e,I as f,x as g,g as h,u as i,N as j,E as k,L as l,_ as m,l as n,T as o,a as p,d as q,S as r,D as s,O as t,G as u,R as v,C as w,F as x,V as y};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkM2UBZY5Scjs = require('./chunk-M2UBZY5S.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkWZFHEUWTcjs = require('./chunk-WZFHEUWT.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _viem = require('viem');var _commonsdkbase = require('@crossmint/common-sdk-base');var m=class w extends _chunkM2UBZY5Scjs.a{constructor(t){super({chain:t.chain,address:t.address,owner:t.owner,signer:t.signer,options:_chunkM2UBZY5Scjs.a.getOptions(t),alias:t.alias},_chunkM2UBZY5Scjs.a.getApiClient(t))}static from(t){if(!_commonsdkbase.isValidEvmAddress.call(void 0, t.address))throw new Error("Wallet is not an EVM wallet");return new w(t)}sendTransaction(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i;yield this.preAuthIfNeeded();let e=this.buildTransaction(t),n=yield this.createTransaction(e,t.options);return(i=t.options)!=null&&i.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:n.id}:yield this.approveTransactionAndWait(n.id)})}signMessage(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var n;yield this.preAuthIfNeeded();let e=yield this.apiClient.createSignature(this.walletLocator,{type:"message",params:{message:t.message,signer:this.signer.locator(),chain:this.chain}});if("error"in e)throw new (0, _chunkO4FVTK7Xcjs.o)(JSON.stringify(e));return(n=t.options)!=null&&n.experimental_prepareOnly?{signature:void 0,signatureId:e.id}:yield this.approveSignatureAndWait(e.id)})}signTypedData(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var T;yield this.preAuthIfNeeded();let{domain:e,message:n,primaryType:i,types:a,chain:r}=t;if(!e||!n||!a||!r)throw new (0, _chunkO4FVTK7Xcjs.k)("Invalid typed data");let{name:u,version:l,chainId:h,verifyingContract:g,salt:C}=e;if(!u||!l||!h||!g)throw new (0, _chunkO4FVTK7Xcjs.k)("Invalid typed data domain");let o=yield this.apiClient.createSignature(this.walletLocator,{type:"typed-data",params:{typedData:{domain:{name:u,version:l,chainId:Number(h),verifyingContract:g,salt:C},message:n,primaryType:i,types:a},signer:this.signer.locator(),chain:r}});if("error"in o)throw new (0, _chunkO4FVTK7Xcjs.o)(JSON.stringify(o));return(T=t.options)!=null&&T.experimental_prepareOnly?{signature:void 0,signatureId:o.id}:yield this.approveSignatureAndWait(o.id)})}getViemClient(t){var e;return _viem.createPublicClient.call(void 0, {transport:(e=t==null?void 0:t.transport)!=null?e:_viem.http.call(void 0, ),chain:_chunkWZFHEUWTcjs.a.call(void 0, this.chain)})}createTransaction(t,e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var a;let n=(a=e==null?void 0:e.experimental_signer)!=null?a:this.signer.locator(),i=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:n,chain:this.chain,calls:[t]}});if("error"in i)throw new (0, _chunkO4FVTK7Xcjs.r)(JSON.stringify(i));return i})}buildTransaction(t){var e,n,i,a,r;if("transaction"in t)return{transaction:t.transaction};if(t.abi==null)return{to:t.to,value:(n=(e=t.value)==null?void 0:e.toString())!=null?n:"0",data:(i=t.data)!=null?i:"0x"};if(!t.functionName)throw new Error("Function name is required");return{to:t.to,value:(r=(a=t.value)==null?void 0:a.toString())!=null?r:"0",data:_viem.encodeFunctionData.call(void 0, {abi:t.abi,functionName:t.functionName,args:t.args})}}};exports.a = m;
@@ -1 +0,0 @@
1
- import{a}from"./chunk-KKQBZXFE.js";import{a as r}from"./chunk-S3DYQVRD.js";import{BlockchainIncludingTestnet as e}from"@crossmint/common-sdk-base";import{baseSepolia as E,base as n,polygonAmoy as S,polygon as T,optimismSepolia as A,optimism as s,arbitrumSepolia as o,arbitrum as O,arbitrumNova as I,modeTestnet as i,mode as L,bsc as _,shape as c,zora as C,zoraSepolia as M,sepolia as p,flowMainnet as l,flowTestnet as P,plume as R,plumeTestnet as m}from"viem/chains";var V=[e.ABSTRACT_TESTNET,e.ARBITRUM_SEPOLIA,e.BASE_SEPOLIA,e.CURTIS,e.ETHEREUM_SEPOLIA,e.FLOW_TESTNET,e.MANTLE_SEPOLIA,e.MODE_SEPOLIA,e.OPTIMISM_SEPOLIA,e.PLUME_TESTNET,e.POLYGON_AMOY,e.SCROLL_SEPOLIA,e.SEI_ATLANTIC_2_TESTNET,e.STORY_TESTNET,e.WORLD_CHAIN_SEPOLIA,e.ZORA_SEPOLIA],W=[e.ABSTRACT,e.APECHAIN,e.ARBITRUM,e.ARBITRUMNOVA,e.BASE,e.BSC,e.FLOW,e.MANTLE,e.MODE,e.OPTIMISM,e.PLUME,e.POLYGON,e.SCROLL,e.SEI_PACIFIC_1,e.SHAPE,e.STORY,e.WORLDCHAIN,e.ZORA];function H(t){switch(t){case e.BASE_SEPOLIA:return E;case e.BASE:return n;case e.POLYGON_AMOY:return S;case e.POLYGON:return T;case e.OPTIMISM_SEPOLIA:return A;case e.OPTIMISM:return s;case e.ARBITRUM_SEPOLIA:return o;case e.ARBITRUM:return O;case e.ARBITRUMNOVA:return I;case e.STORY_TESTNET:return r;case e.STORY:return a;case e.MODE_SEPOLIA:return i;case e.MODE:return L;case e.BSC:return _;case e.SHAPE:return c;case e.ZORA:return C;case e.ZORA_SEPOLIA:return M;case e.ETHEREUM_SEPOLIA:return p;case e.FLOW:return l;case e.FLOW_TESTNET:return P;case e.PLUME_TESTNET:return m;case e.PLUME:return R;case e.ABSTRACT:case e.ABSTRACT_TESTNET:case e.APECHAIN:case e.MANTLE:case e.MANTLE_SEPOLIA:case e.SCROLL:case e.SCROLL_SEPOLIA:case e.SEI_PACIFIC_1:case e.SEI_ATLANTIC_2_TESTNET:case e.CURTIS:case e.WORLDCHAIN:case e.WORLD_CHAIN_SEPOLIA:throw new Error(`Chain ${t} is not yet supported in toViemChain function. Please add the appropriate viem chain definition.`);default:throw new Error(`Unknown chain: ${t}`)}}export{H as a};
@@ -1 +0,0 @@
1
- import{defineChain as t}from"viem";var n=t({id:1513,name:"Story Testnet",nativeCurrency:{decimals:18,name:"IP",symbol:"IP"},rpcUrls:{default:{http:["https://testnet.storyrpc.io"]}},blockExplorers:{default:{name:"Story Testnet Explorer",url:"https://testnet.storyscan.xyz"}},testnet:!0});export{n as a};
@@ -1 +0,0 @@
1
- import{a as l}from"./chunk-YWXQIFVZ.js";import{a}from"./chunk-DV6ZRFKV.js";import{f as e}from"./chunk-BW7YYVZE.js";import{createCrossmint as p}from"@crossmint/common-sdk-base";var i=class o{constructor(t){let r=new a(t);this.walletFactory=new l(r)}static from(t){return new o(t)}getOrCreateWallet(t){return e(this,null,function*(){return yield this.walletFactory.getOrCreateWallet(t)})}getWallet(t,r){return e(this,null,function*(){return yield this.walletFactory.getWallet(t,r)})}createWallet(t){return e(this,null,function*(){return yield this.walletFactory.createWallet(t)})}};export{p as a,i as b};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _clientfetch = require('@hey-api/client-fetch');var o=_clientfetch.createClient.call(void 0, _clientfetch.createConfig.call(void 0, {baseUrl:"https://staging.crossmint.com/api"}));exports.a = o;
@@ -1 +0,0 @@
1
- import{f as i}from"./chunk-BW7YYVZE.js";import{WebAuthnP256 as e}from"ox";var n=class{constructor(t){this.config=t;this.type="passkey";this.id=t.id}locator(){return this.config.locator}signMessage(t){return i(this,null,function*(){if(this.config.onSignWithPasskey)return yield this.config.onSignWithPasskey(t);let{signature:s,metadata:r}=yield e.sign({credentialId:this.id,challenge:t});return{signature:{r:`0x${s.r.toString(16)}`,s:`0x${s.s.toString(16)}`},metadata:r}})}signTransaction(t){return i(this,null,function*(){return yield this.signMessage(t)})}};export{n as a};
@@ -1 +0,0 @@
1
- import{a as n}from"./chunk-VY634F3J.js";import{a}from"./chunk-H4T4IXCF.js";import{a as t}from"./chunk-WQP2FSVI.js";import{a as o}from"./chunk-UBOWSXW3.js";import{a as m}from"./chunk-IGBQEAD5.js";import{a as l}from"./chunk-6PVKL5RC.js";import{a as p}from"./chunk-2SHDBC47.js";import{a as s}from"./chunk-LW6JSI4J.js";import{a as i}from"./chunk-3APSOOE3.js";function d(r,e){switch(e.type){case"email":case"phone":return r==="solana"?new n(e):r==="stellar"?new a(e):new t(e);case"api-key":return r==="solana"?new m(e):new s(e);case"external-wallet":return r==="solana"?new l(e):r==="stellar"?new p(e):new i(e);case"passkey":return new o(e)}}export{d as a};
@@ -1 +0,0 @@
1
- import{a as i,b as s}from"./chunk-HJ5EDMTA.js";import{f as t}from"./chunk-BW7YYVZE.js";import{VersionedTransaction as m}from"@solana/web3.js";import o from"bs58";var a=class g extends i{constructor(e){super(e)}signMessage(){return t(this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for email signer"))})}signTransaction(e){return t(this,null,function*(){var r;yield this.handleAuthRequired();let c=this.getJwtOrThrow(),d=o.decode(e),l=m.deserialize(d).message.serialize(),n=yield(r=this.config.clientTEEConnection)==null?void 0:r.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:c,apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:o.encode(l),encoding:"base58"}},options:s});if((n==null?void 0:n.status)==="error")throw new Error(n.error);if((n==null?void 0:n.signature)==null)throw new Error("Failed to sign transaction");return g.verifyPublicKeyFormat(n.publicKey),{signature:n.signature.bytes}})}static verifyPublicKeyFormat(e){if(e==null)throw new Error("No public key found");if(e.encoding!=="base58"||e.keyType!=="ed25519"||e.bytes==null)throw new Error("Not supported. Expected public key to be in base58 encoding and ed25519 key type. Got: "+JSON.stringify(e))}getChainKeyParams(){return{scheme:"ed25519",encoding:"base58"}}};export{a};
@@ -1 +0,0 @@
1
- import{a as o,b as a}from"./chunk-HJ5EDMTA.js";import{f as t}from"./chunk-BW7YYVZE.js";import{PersonalMessage as p}from"ox";import{isHex as y,toHex as h}from"viem";var g=class c extends o{constructor(e){super(e)}signMessage(e){return t(this,null,function*(){let i=y(e)?e:h(e),r=p.getSignPayload(i);return yield this.sign(r)})}signTransaction(e){return t(this,null,function*(){return yield this.sign(e)})}sign(e){return t(this,null,function*(){var s;yield this.handleAuthRequired();let i=this.getJwtOrThrow(),r=e.replace("0x",""),n=yield(s=this.config.clientTEEConnection)==null?void 0:s.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:i,apiKey:this.config.crossmint.apiKey},data:{keyType:"secp256k1",bytes:r,encoding:"hex"}},options:a});if((n==null?void 0:n.status)==="error")throw new Error(n.error);if((n==null?void 0:n.signature)==null)throw new Error("Failed to sign transaction");return c.verifyPublicKeyFormat(n.publicKey),{signature:n.signature.bytes}})}static verifyPublicKeyFormat(e){if(e==null)throw new Error("No public key found");if(e.encoding!=="hex"||e.keyType!=="secp256k1"||e.bytes==null)throw new Error("Not supported. Expected public key to be in hex encoding and secp256k1 key type. Got: "+JSON.stringify(e))}getChainKeyParams(){return{scheme:"secp256k1",encoding:"hex"}}};export{g as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKO6QYKDXcjs = require('./chunk-KO6QYKDX.cjs');var _chunk2XVV7Z43cjs = require('./chunk-2XVV7Z43.cjs');var _chunkHPHVJ6BAcjs = require('./chunk-HPHVJ6BA.cjs');var _chunkYWPTI2QOcjs = require('./chunk-YWPTI2QO.cjs');var _chunk4KXOWU5Ecjs = require('./chunk-4KXOWU5E.cjs');var _chunkHRSVFJNDcjs = require('./chunk-HRSVFJND.cjs');var _chunkC3T63EC7cjs = require('./chunk-C3T63EC7.cjs');var _chunkYZ4HRYSLcjs = require('./chunk-YZ4HRYSL.cjs');var _chunkM4TOGGLVcjs = require('./chunk-M4TOGGLV.cjs');function E(r,e){switch(e.type){case"email":case"phone":return r==="solana"?new (0, _chunkKO6QYKDXcjs.a)(e):r==="stellar"?new (0, _chunk2XVV7Z43cjs.a)(e):new (0, _chunkHPHVJ6BAcjs.a)(e);case"api-key":return r==="solana"?new (0, _chunk4KXOWU5Ecjs.a)(e):new (0, _chunkYZ4HRYSLcjs.a)(e);case"external-wallet":return r==="solana"?new (0, _chunkHRSVFJNDcjs.a)(e):r==="stellar"?new (0, _chunkC3T63EC7cjs.a)(e):new (0, _chunkM4TOGGLVcjs.a)(e);case"passkey":return new (0, _chunkYWPTI2QOcjs.a)(e)}}exports.a = E;