@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
@@ -0,0 +1,44 @@
1
+ import {
2
+ __async
3
+ } from "./chunk-FPMW7Q5O.js";
4
+
5
+ // src/signers/stellar-external-wallet.ts
6
+ var StellarExternalWalletSigner = class {
7
+ constructor(config) {
8
+ this.config = config;
9
+ this.type = "external-wallet";
10
+ if (config.address == null) {
11
+ throw new Error("Please provide an address for the External Wallet Signer");
12
+ }
13
+ this._address = config.address;
14
+ this.onSignStellarTransaction = config.onSignStellarTransaction;
15
+ }
16
+ address() {
17
+ return this._address;
18
+ }
19
+ locator() {
20
+ return this.config.locator;
21
+ }
22
+ signMessage() {
23
+ return __async(this, null, function* () {
24
+ return yield Promise.reject(new Error("signMessage method not implemented for stellar external wallet signer"));
25
+ });
26
+ }
27
+ signTransaction(payload) {
28
+ return __async(this, null, function* () {
29
+ if (this.onSignStellarTransaction == null) {
30
+ return yield Promise.reject(
31
+ new Error(
32
+ "onSignStellarTransaction method is required to sign transactions with a Stellar external wallet"
33
+ )
34
+ );
35
+ }
36
+ const signedTx = yield this.onSignStellarTransaction(payload);
37
+ return { signature: signedTx };
38
+ });
39
+ }
40
+ };
41
+
42
+ export {
43
+ StellarExternalWalletSigner
44
+ };
@@ -0,0 +1,15 @@
1
+ // src/signers/types.ts
2
+ var AuthRejectedError = class extends Error {
3
+ constructor() {
4
+ super("Authentication was rejected by the user");
5
+ this.name = "AuthRejectedError";
6
+ }
7
+ };
8
+ function isExportableSigner(signer) {
9
+ return signer._exportPrivateKey !== void 0;
10
+ }
11
+
12
+ export {
13
+ AuthRejectedError,
14
+ isExportableSigner
15
+ };
@@ -0,0 +1,16 @@
1
+ // package.json
2
+ var name = "@crossmint/wallets-sdk";
3
+ var version = "0.18.6";
4
+
5
+ // src/utils/constants.ts
6
+ var WALLETS_SERVICE = "WALLETS_SDK";
7
+ var SDK_VERSION = version;
8
+ var SDK_NAME = name;
9
+ var STATUS_POLLING_INTERVAL_MS = 500;
10
+
11
+ export {
12
+ WALLETS_SERVICE,
13
+ SDK_VERSION,
14
+ SDK_NAME,
15
+ STATUS_POLLING_INTERVAL_MS
16
+ };
@@ -0,0 +1,155 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/utils/errors.ts
2
+ var _commonsdkbase = require('@crossmint/common-sdk-base');
3
+ var InvalidApiKeyError = class extends _commonsdkbase.CrossmintSDKError {
4
+ constructor(message, details) {
5
+ super(message, _commonsdkbase.WalletErrorCode.API_KEY_INVALID, details);
6
+ }
7
+ };
8
+ var InvalidEnvironmentError = class extends _commonsdkbase.CrossmintSDKError {
9
+ constructor(message, details) {
10
+ super(message, _commonsdkbase.WalletErrorCode.ENVIRONMENT_INVALID, details);
11
+ }
12
+ };
13
+ var WalletTypeNotSupportedError = class extends _commonsdkbase.CrossmintSDKError {
14
+ constructor(message, details) {
15
+ super(message, _commonsdkbase.WalletErrorCode.WALLET_TYPE_INVALID, details);
16
+ }
17
+ };
18
+ var WalletNotAvailableError = class extends _commonsdkbase.CrossmintSDKError {
19
+ constructor(message, details) {
20
+ super(message, _commonsdkbase.WalletErrorCode.WALLET_NOT_AVAILABLE, details);
21
+ }
22
+ };
23
+ var InvalidWalletConfigError = class extends _commonsdkbase.CrossmintSDKError {
24
+ constructor(message, details) {
25
+ super(message, _commonsdkbase.WalletErrorCode.WALLET_NOT_AVAILABLE, details);
26
+ }
27
+ };
28
+ var WalletCreationError = class extends _commonsdkbase.CrossmintSDKError {
29
+ constructor(message, details) {
30
+ super(message, _commonsdkbase.WalletErrorCode.WALLET_CREATION_FAILED, details);
31
+ }
32
+ };
33
+ var WalletTypeMismatchError = class extends _commonsdkbase.CrossmintSDKError {
34
+ constructor(message, details) {
35
+ super(message, _commonsdkbase.WalletErrorCode.WALLET_TYPE_INVALID, details);
36
+ }
37
+ };
38
+ var SignerTypeMismatchError = class extends _commonsdkbase.CrossmintSDKError {
39
+ constructor(message, details) {
40
+ super(message, _commonsdkbase.WalletErrorCode.SIGNER_INVALID, details);
41
+ }
42
+ };
43
+ var InvalidSignerError = class extends _commonsdkbase.CrossmintSDKError {
44
+ constructor(message, details) {
45
+ super(message, _commonsdkbase.WalletErrorCode.SIGNER_INVALID, details);
46
+ }
47
+ };
48
+ var InvalidMessageFormatError = class extends _commonsdkbase.CrossmintSDKError {
49
+ constructor(message, details) {
50
+ super(message, _commonsdkbase.WalletErrorCode.MESSAGE_INVALID, details);
51
+ }
52
+ };
53
+ var InvalidTypedDataError = class extends _commonsdkbase.CrossmintSDKError {
54
+ constructor(message, details) {
55
+ super(message, _commonsdkbase.WalletErrorCode.MESSAGE_INVALID, details);
56
+ }
57
+ };
58
+ var SignatureNotFoundError = class extends _commonsdkbase.CrossmintSDKError {
59
+ constructor(message, details) {
60
+ super(message, _commonsdkbase.WalletErrorCode.SIGNING_FAILED, details);
61
+ }
62
+ };
63
+ var SigningFailedError = class extends _commonsdkbase.CrossmintSDKError {
64
+ constructor(message, details) {
65
+ super(message, _commonsdkbase.WalletErrorCode.SIGNING_FAILED, details);
66
+ }
67
+ };
68
+ var MessageSigningNotSupportedError = class extends _commonsdkbase.CrossmintSDKError {
69
+ constructor(message, details) {
70
+ super(message, _commonsdkbase.WalletErrorCode.SIGNING_FAILED, details);
71
+ }
72
+ };
73
+ var SignatureNotCreatedError = class extends _commonsdkbase.CrossmintSDKError {
74
+ constructor(message, details) {
75
+ super(message, _commonsdkbase.WalletErrorCode.NO_SIGNATURE, details);
76
+ }
77
+ };
78
+ var SignatureNotAvailableError = class extends _commonsdkbase.CrossmintSDKError {
79
+ constructor(message, details) {
80
+ super(message, _commonsdkbase.WalletErrorCode.NO_SIGNATURE, details);
81
+ }
82
+ };
83
+ var SignatureFailedError = class extends _commonsdkbase.CrossmintSDKError {
84
+ constructor(message, details) {
85
+ super(message, _commonsdkbase.WalletErrorCode.SIGNING_FAILED, details);
86
+ }
87
+ };
88
+ var TransactionNotCreatedError = class extends _commonsdkbase.CrossmintSDKError {
89
+ constructor(message, details) {
90
+ super(message, _commonsdkbase.WalletErrorCode.NO_TRANSACTION, details);
91
+ }
92
+ };
93
+ var TransactionNotAvailableError = class extends _commonsdkbase.CrossmintSDKError {
94
+ constructor(message, details) {
95
+ super(message, _commonsdkbase.WalletErrorCode.NO_TRANSACTION, details);
96
+ }
97
+ };
98
+ var TransactionConfirmationTimeoutError = class extends _commonsdkbase.CrossmintSDKError {
99
+ constructor(message, details) {
100
+ super(message, _commonsdkbase.WalletErrorCode.TRANSACTION_FAILED, details);
101
+ }
102
+ };
103
+ var TransactionSendingFailedError = class extends _commonsdkbase.CrossmintSDKError {
104
+ constructor(message, details) {
105
+ super(message, _commonsdkbase.WalletErrorCode.TRANSACTION_FAILED, details);
106
+ }
107
+ };
108
+ var TransactionAwaitingApprovalError = class extends _commonsdkbase.CrossmintSDKError {
109
+ constructor(message, details) {
110
+ super(message, _commonsdkbase.WalletErrorCode.TRANSACTION_FAILED, details);
111
+ }
112
+ };
113
+ var TransactionHashNotFoundError = class extends _commonsdkbase.CrossmintSDKError {
114
+ constructor(message, details) {
115
+ super(message, _commonsdkbase.WalletErrorCode.TRANSACTION_FAILED, details);
116
+ }
117
+ };
118
+ var TransactionFailedError = class extends _commonsdkbase.CrossmintSDKError {
119
+ constructor(message, details) {
120
+ super(message, _commonsdkbase.WalletErrorCode.TRANSACTION_FAILED, details);
121
+ }
122
+ };
123
+ var PendingApprovalsError = class extends _commonsdkbase.CrossmintSDKError {
124
+ constructor(message, details) {
125
+ super(message, _commonsdkbase.WalletErrorCode.TRANSACTION_FAILED, details);
126
+ }
127
+ };
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+ exports.InvalidApiKeyError = InvalidApiKeyError; exports.InvalidEnvironmentError = InvalidEnvironmentError; exports.WalletTypeNotSupportedError = WalletTypeNotSupportedError; exports.WalletNotAvailableError = WalletNotAvailableError; exports.InvalidWalletConfigError = InvalidWalletConfigError; exports.WalletCreationError = WalletCreationError; exports.WalletTypeMismatchError = WalletTypeMismatchError; exports.SignerTypeMismatchError = SignerTypeMismatchError; exports.InvalidSignerError = InvalidSignerError; exports.InvalidMessageFormatError = InvalidMessageFormatError; exports.InvalidTypedDataError = InvalidTypedDataError; exports.SignatureNotFoundError = SignatureNotFoundError; exports.SigningFailedError = SigningFailedError; exports.MessageSigningNotSupportedError = MessageSigningNotSupportedError; exports.SignatureNotCreatedError = SignatureNotCreatedError; exports.SignatureNotAvailableError = SignatureNotAvailableError; exports.SignatureFailedError = SignatureFailedError; exports.TransactionNotCreatedError = TransactionNotCreatedError; exports.TransactionNotAvailableError = TransactionNotAvailableError; exports.TransactionConfirmationTimeoutError = TransactionConfirmationTimeoutError; exports.TransactionSendingFailedError = TransactionSendingFailedError; exports.TransactionAwaitingApprovalError = TransactionAwaitingApprovalError; exports.TransactionHashNotFoundError = TransactionHashNotFoundError; exports.TransactionFailedError = TransactionFailedError; exports.PendingApprovalsError = PendingApprovalsError;
@@ -0,0 +1,75 @@
1
+ import {
2
+ DEFAULT_EVENT_OPTIONS,
3
+ NonCustodialSigner
4
+ } from "./chunk-CL44FTXR.js";
5
+ import {
6
+ __async
7
+ } from "./chunk-FPMW7Q5O.js";
8
+
9
+ // src/signers/non-custodial/ncs-solana-signer.ts
10
+ import { VersionedTransaction } from "@solana/web3.js";
11
+ import base58 from "bs58";
12
+ var SolanaNonCustodialSigner = class _SolanaNonCustodialSigner extends NonCustodialSigner {
13
+ constructor(config) {
14
+ super(config);
15
+ }
16
+ signMessage() {
17
+ return __async(this, null, function* () {
18
+ return yield Promise.reject(new Error("signMessage method not implemented for email signer"));
19
+ });
20
+ }
21
+ signTransaction(transaction) {
22
+ return __async(this, null, function* () {
23
+ var _a;
24
+ yield this.handleAuthRequired();
25
+ const jwt = this.getJwtOrThrow();
26
+ const transactionBytes = base58.decode(transaction);
27
+ const deserializedTransaction = VersionedTransaction.deserialize(transactionBytes);
28
+ const messageData = deserializedTransaction.message.serialize();
29
+ const res = yield (_a = this.config.clientTEEConnection) == null ? void 0 : _a.sendAction({
30
+ event: "request:sign",
31
+ responseEvent: "response:sign",
32
+ data: {
33
+ authData: {
34
+ jwt,
35
+ apiKey: this.config.crossmint.apiKey
36
+ },
37
+ data: {
38
+ keyType: "ed25519",
39
+ bytes: base58.encode(messageData),
40
+ encoding: "base58"
41
+ }
42
+ },
43
+ options: DEFAULT_EVENT_OPTIONS
44
+ });
45
+ if ((res == null ? void 0 : res.status) === "error") {
46
+ throw new Error(res.error);
47
+ }
48
+ if ((res == null ? void 0 : res.signature) == null) {
49
+ throw new Error("Failed to sign transaction");
50
+ }
51
+ _SolanaNonCustodialSigner.verifyPublicKeyFormat(res.publicKey);
52
+ return { signature: res.signature.bytes };
53
+ });
54
+ }
55
+ static verifyPublicKeyFormat(publicKey) {
56
+ if (publicKey == null) {
57
+ throw new Error("No public key found");
58
+ }
59
+ if (publicKey.encoding !== "base58" || publicKey.keyType !== "ed25519" || publicKey.bytes == null) {
60
+ throw new Error(
61
+ "Not supported. Expected public key to be in base58 encoding and ed25519 key type. Got: " + JSON.stringify(publicKey)
62
+ );
63
+ }
64
+ }
65
+ getChainKeyParams() {
66
+ return {
67
+ scheme: "ed25519",
68
+ encoding: "base58"
69
+ };
70
+ }
71
+ };
72
+
73
+ export {
74
+ SolanaNonCustodialSigner
75
+ };
@@ -0,0 +1,44 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkG5NYLGM5cjs = require('./chunk-G5NYLGM5.cjs');
4
+
5
+ // src/signers/stellar-external-wallet.ts
6
+ var StellarExternalWalletSigner = class {
7
+ constructor(config) {
8
+ this.config = config;
9
+ this.type = "external-wallet";
10
+ if (config.address == null) {
11
+ throw new Error("Please provide an address for the External Wallet Signer");
12
+ }
13
+ this._address = config.address;
14
+ this.onSignStellarTransaction = config.onSignStellarTransaction;
15
+ }
16
+ address() {
17
+ return this._address;
18
+ }
19
+ locator() {
20
+ return this.config.locator;
21
+ }
22
+ signMessage() {
23
+ return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
24
+ return yield Promise.reject(new Error("signMessage method not implemented for stellar external wallet signer"));
25
+ });
26
+ }
27
+ signTransaction(payload) {
28
+ return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
29
+ if (this.onSignStellarTransaction == null) {
30
+ return yield Promise.reject(
31
+ new Error(
32
+ "onSignStellarTransaction method is required to sign transactions with a Stellar external wallet"
33
+ )
34
+ );
35
+ }
36
+ const signedTx = yield this.onSignStellarTransaction(payload);
37
+ return { signature: signedTx };
38
+ });
39
+ }
40
+ };
41
+
42
+
43
+
44
+ exports.StellarExternalWalletSigner = StellarExternalWalletSigner;
@@ -0,0 +1,58 @@
1
+ import {
2
+ WalletCreationError
3
+ } from "./chunk-SGINWAB6.js";
4
+
5
+ // src/utils/signer-validation.ts
6
+ import { isEmailValid } from "@crossmint/common-sdk-auth";
7
+ var signerConfigMismatchErrorMessage = (fieldPath, newValue, existingValue) => `Wallet signer configuration mismatch at "${fieldPath}" - expected "${existingValue}" from existing wallet but found "${newValue}"`;
8
+ function normalizeEmail(email) {
9
+ const lowerCaseEmail = email.toLowerCase();
10
+ const emailParts = lowerCaseEmail.split("@");
11
+ const domain = emailParts[1];
12
+ const isGoogleMailDomain = domain === "googlemail.com";
13
+ const isGmail = isGoogleMailDomain || domain === "gmail.com";
14
+ const isGmailAndHasDots = isGmail && emailParts[0].includes(".");
15
+ if (isGoogleMailDomain) {
16
+ emailParts[1] = "gmail.com";
17
+ }
18
+ if (isGmailAndHasDots) {
19
+ emailParts[0] = emailParts[0].replace(/\./g, "");
20
+ }
21
+ return `${emailParts[0]}@${emailParts[1]}`;
22
+ }
23
+ function normalizeValueForComparison(value) {
24
+ if (typeof value === "string" && isEmailValid(value)) {
25
+ return normalizeEmail(value);
26
+ }
27
+ return value;
28
+ }
29
+ function compareSignerConfigs(newSignerConfig, existingSignerConfig, path = "") {
30
+ if (newSignerConfig === existingSignerConfig) {
31
+ return;
32
+ }
33
+ if (newSignerConfig == null || existingSignerConfig == null) {
34
+ throw new Error(`Cannot compare null or undefined signer configs at path: ${path}`);
35
+ }
36
+ for (const key of Object.keys(newSignerConfig)) {
37
+ if (!(key in existingSignerConfig)) {
38
+ continue;
39
+ }
40
+ const fieldPath = path ? `${path}.${key}` : key;
41
+ const newValue = newSignerConfig[key];
42
+ const existingValue = existingSignerConfig[key];
43
+ if (typeof newValue === "object" && newValue !== null && typeof existingValue === "object" && existingValue !== null) {
44
+ compareSignerConfigs(
45
+ newValue,
46
+ existingValue,
47
+ fieldPath
48
+ );
49
+ } else if (normalizeValueForComparison(newValue) !== normalizeValueForComparison(existingValue)) {
50
+ throw new WalletCreationError(signerConfigMismatchErrorMessage(fieldPath, newValue, existingValue));
51
+ }
52
+ }
53
+ }
54
+
55
+ export {
56
+ normalizeValueForComparison,
57
+ compareSignerConfigs
58
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/api/gen/client.gen.ts
2
+ var _clientfetch = require('@hey-api/client-fetch');
3
+ var client = _clientfetch.createClient.call(void 0, _clientfetch.createConfig.call(void 0, {
4
+ baseUrl: "https://staging.crossmint.com/api"
5
+ }));
6
+
7
+
8
+
9
+ exports.client = client;
@@ -0,0 +1,36 @@
1
+ import {
2
+ __async
3
+ } from "./chunk-FPMW7Q5O.js";
4
+
5
+ // src/signers/solana-api-key.ts
6
+ var SolanaApiKeySigner = class {
7
+ constructor(config) {
8
+ this.config = config;
9
+ this.type = "api-key";
10
+ }
11
+ locator() {
12
+ return this.config.locator;
13
+ }
14
+ signMessage() {
15
+ return __async(this, null, function* () {
16
+ return yield Promise.reject(
17
+ new Error(
18
+ "API key signers do not support direct message signing - signatures are handled automatically by the backend"
19
+ )
20
+ );
21
+ });
22
+ }
23
+ signTransaction() {
24
+ return __async(this, null, function* () {
25
+ return yield Promise.reject(
26
+ new Error(
27
+ "API key signers do not support direct transaction signing - transaction are handled automatically by the backend"
28
+ )
29
+ );
30
+ });
31
+ }
32
+ };
33
+
34
+ export {
35
+ SolanaApiKeySigner
36
+ };