@crossmint/wallets-sdk 0.20.2 → 0.20.5

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 (257) hide show
  1. package/package.json +1 -1
  2. package/LICENSE +0 -201
  3. package/README.md +0 -96
  4. package/dist/api/__tests__/constants.cjs +0 -31
  5. package/dist/api/__tests__/constants.d.cts +0 -96
  6. package/dist/api/__tests__/constants.d.ts +0 -96
  7. package/dist/api/__tests__/constants.js +0 -31
  8. package/dist/api/__tests__/test-utils.cjs +0 -372
  9. package/dist/api/__tests__/test-utils.d.cts +0 -99
  10. package/dist/api/__tests__/test-utils.d.ts +0 -99
  11. package/dist/api/__tests__/test-utils.js +0 -372
  12. package/dist/api/client.cjs +0 -10
  13. package/dist/api/client.d.cts +0 -42
  14. package/dist/api/client.d.ts +0 -42
  15. package/dist/api/client.js +0 -10
  16. package/dist/api/gen/client.gen.cjs +0 -7
  17. package/dist/api/gen/client.gen.d.cts +0 -16
  18. package/dist/api/gen/client.gen.d.ts +0 -16
  19. package/dist/api/gen/client.gen.js +0 -7
  20. package/dist/api/gen/index.cjs +0 -179
  21. package/dist/api/gen/index.d.cts +0 -3
  22. package/dist/api/gen/index.d.ts +0 -3
  23. package/dist/api/gen/index.js +0 -179
  24. package/dist/api/gen/sdk.gen.cjs +0 -178
  25. package/dist/api/gen/sdk.gen.d.cts +0 -611
  26. package/dist/api/gen/sdk.gen.d.ts +0 -611
  27. package/dist/api/gen/sdk.gen.js +0 -178
  28. package/dist/api/gen/types.gen.cjs +0 -1
  29. package/dist/api/gen/types.gen.d.cts +0 -13865
  30. package/dist/api/gen/types.gen.d.ts +0 -13865
  31. package/dist/api/gen/types.gen.js +0 -1
  32. package/dist/api/index.cjs +0 -12
  33. package/dist/api/index.d.cts +0 -6
  34. package/dist/api/index.d.ts +0 -6
  35. package/dist/api/index.js +0 -12
  36. package/dist/api/types.cjs +0 -1
  37. package/dist/api/types.d.cts +0 -55
  38. package/dist/api/types.d.ts +0 -55
  39. package/dist/api/types.js +0 -1
  40. package/dist/chains/chains.cjs +0 -24
  41. package/dist/chains/chains.d.cts +0 -28
  42. package/dist/chains/chains.d.ts +0 -28
  43. package/dist/chains/chains.js +0 -24
  44. package/dist/chains/definitions/arcTestnet.cjs +0 -7
  45. package/dist/chains/definitions/arcTestnet.d.cts +0 -43
  46. package/dist/chains/definitions/arcTestnet.d.ts +0 -43
  47. package/dist/chains/definitions/arcTestnet.js +0 -7
  48. package/dist/chains/definitions/story.cjs +0 -7
  49. package/dist/chains/definitions/story.d.cts +0 -49
  50. package/dist/chains/definitions/story.d.ts +0 -49
  51. package/dist/chains/definitions/story.js +0 -7
  52. package/dist/chains/definitions/storyTestnet.cjs +0 -7
  53. package/dist/chains/definitions/storyTestnet.d.cts +0 -43
  54. package/dist/chains/definitions/storyTestnet.d.ts +0 -43
  55. package/dist/chains/definitions/storyTestnet.js +0 -7
  56. package/dist/chains/definitions/tempo.cjs +0 -7
  57. package/dist/chains/definitions/tempo.d.cts +0 -39
  58. package/dist/chains/definitions/tempo.d.ts +0 -39
  59. package/dist/chains/definitions/tempo.js +0 -7
  60. package/dist/chains/definitions/tempoTestnet.cjs +0 -7
  61. package/dist/chains/definitions/tempoTestnet.d.cts +0 -39
  62. package/dist/chains/definitions/tempoTestnet.d.ts +0 -39
  63. package/dist/chains/definitions/tempoTestnet.js +0 -7
  64. package/dist/chunk-2I2OFGNL.js +0 -36
  65. package/dist/chunk-2T5HHKUI.js +0 -19
  66. package/dist/chunk-2WBSPOWU.js +0 -223
  67. package/dist/chunk-3U6UAYOV.js +0 -25
  68. package/dist/chunk-455NK5LB.js +0 -0
  69. package/dist/chunk-47R3UV3J.cjs +0 -58
  70. package/dist/chunk-47WKYTRN.js +0 -63
  71. package/dist/chunk-4GFSUI2I.cjs +0 -66
  72. package/dist/chunk-55V4VMTX.cjs +0 -25
  73. package/dist/chunk-5IFDVB4Y.js +0 -0
  74. package/dist/chunk-66UY53KP.cjs +0 -336
  75. package/dist/chunk-6FG5QXII.cjs +0 -110
  76. package/dist/chunk-6HXIZLEQ.cjs +0 -1
  77. package/dist/chunk-6UMJYMAY.js +0 -82
  78. package/dist/chunk-7GOUUPS4.js +0 -36
  79. package/dist/chunk-7TT3VUDF.cjs +0 -84
  80. package/dist/chunk-7USEVMTW.cjs +0 -21
  81. package/dist/chunk-A6E67ZZP.js +0 -237
  82. package/dist/chunk-ABMZ3ZVN.js +0 -52
  83. package/dist/chunk-ASE2FXWP.js +0 -65
  84. package/dist/chunk-BMMZIPXT.js +0 -778
  85. package/dist/chunk-CCIGWTAO.cjs +0 -1
  86. package/dist/chunk-CMBFV325.js +0 -69
  87. package/dist/chunk-COR3CNRW.cjs +0 -778
  88. package/dist/chunk-ECAM5KTH.cjs +0 -1
  89. package/dist/chunk-F7L2TZ3I.cjs +0 -21
  90. package/dist/chunk-FHMKNG62.js +0 -741
  91. package/dist/chunk-FICVKSXZ.js +0 -84
  92. package/dist/chunk-FOOISYCJ.js +0 -66
  93. package/dist/chunk-G6QJHFSY.cjs +0 -74
  94. package/dist/chunk-HTSQPZHW.cjs +0 -25
  95. package/dist/chunk-HXJ3YPAN.js +0 -110
  96. package/dist/chunk-IDKGJO2G.cjs +0 -115
  97. package/dist/chunk-IOMKHF6R.cjs +0 -44
  98. package/dist/chunk-IPO25BCU.js +0 -43
  99. package/dist/chunk-JREZWZ2S.cjs +0 -52
  100. package/dist/chunk-JSWTGW46.cjs +0 -36
  101. package/dist/chunk-JWMQALLN.js +0 -21
  102. package/dist/chunk-KBJA7JDT.js +0 -0
  103. package/dist/chunk-KQH5ZXJ4.js +0 -336
  104. package/dist/chunk-KT3CVXFG.js +0 -9
  105. package/dist/chunk-MMISP35W.js +0 -21
  106. package/dist/chunk-MRZXYVQO.cjs +0 -82
  107. package/dist/chunk-NIBKCMQ2.cjs +0 -19
  108. package/dist/chunk-PIFD6KNH.js +0 -59
  109. package/dist/chunk-PJOJIRTY.js +0 -74
  110. package/dist/chunk-PK7J3Y3L.js +0 -44
  111. package/dist/chunk-PM7BGATN.cjs +0 -237
  112. package/dist/chunk-PO6S7UR3.cjs +0 -1
  113. package/dist/chunk-POG76HDD.cjs +0 -741
  114. package/dist/chunk-PUO4QNXH.js +0 -89
  115. package/dist/chunk-Q5KNPVYI.cjs +0 -59
  116. package/dist/chunk-R4AW5ADG.cjs +0 -16
  117. package/dist/chunk-R6DH4V7S.cjs +0 -69
  118. package/dist/chunk-RBHGZDDX.cjs +0 -58
  119. package/dist/chunk-RHR6P2KP.cjs +0 -15
  120. package/dist/chunk-RYQI3RXL.cjs +0 -247
  121. package/dist/chunk-SGINWAB6.js +0 -155
  122. package/dist/chunk-T2XUADHW.js +0 -58
  123. package/dist/chunk-TYQ4YIP7.js +0 -16
  124. package/dist/chunk-U3NV7UY7.js +0 -323
  125. package/dist/chunk-UO2J2ZB2.cjs +0 -65
  126. package/dist/chunk-W7K5E64Q.js +0 -247
  127. package/dist/chunk-WDZY4PP4.cjs +0 -223
  128. package/dist/chunk-WHTECI7J.cjs +0 -89
  129. package/dist/chunk-WJUPOCKJ.js +0 -15
  130. package/dist/chunk-WWW6IGZ7.js +0 -115
  131. package/dist/chunk-XC2V34TS.cjs +0 -155
  132. package/dist/chunk-XOCC3MPK.cjs +0 -36
  133. package/dist/chunk-XPMCPXI3.cjs +0 -1
  134. package/dist/chunk-YDZRBHS3.js +0 -0
  135. package/dist/chunk-YMRXMNME.js +0 -0
  136. package/dist/chunk-ZAX22GSI.cjs +0 -323
  137. package/dist/chunk-ZBLW42YE.js +0 -25
  138. package/dist/chunk-ZNAGDENG.cjs +0 -43
  139. package/dist/chunk-ZP4ZZCIE.js +0 -58
  140. package/dist/chunk-ZT7EGOCI.cjs +0 -9
  141. package/dist/chunk-ZTEMOYS2.cjs +0 -63
  142. package/dist/index.cjs +0 -60
  143. package/dist/index.d.cts +0 -19
  144. package/dist/index.d.ts +0 -19
  145. package/dist/index.js +0 -60
  146. package/dist/logger/index.cjs +0 -11
  147. package/dist/logger/index.d.cts +0 -2
  148. package/dist/logger/index.d.ts +0 -2
  149. package/dist/logger/index.js +0 -11
  150. package/dist/logger/init.cjs +0 -10
  151. package/dist/logger/init.d.cts +0 -15
  152. package/dist/logger/init.d.ts +0 -15
  153. package/dist/logger/init.js +0 -10
  154. package/dist/sdk.cjs +0 -39
  155. package/dist/sdk.d.cts +0 -48
  156. package/dist/sdk.d.ts +0 -48
  157. package/dist/sdk.js +0 -39
  158. package/dist/signers/evm-api-key.cjs +0 -7
  159. package/dist/signers/evm-api-key.d.cts +0 -18
  160. package/dist/signers/evm-api-key.d.ts +0 -18
  161. package/dist/signers/evm-api-key.js +0 -7
  162. package/dist/signers/evm-external-wallet.cjs +0 -7
  163. package/dist/signers/evm-external-wallet.d.cts +0 -26
  164. package/dist/signers/evm-external-wallet.d.ts +0 -26
  165. package/dist/signers/evm-external-wallet.js +0 -7
  166. package/dist/signers/index.cjs +0 -24
  167. package/dist/signers/index.d.cts +0 -11
  168. package/dist/signers/index.d.ts +0 -11
  169. package/dist/signers/index.js +0 -24
  170. package/dist/signers/non-custodial/index.cjs +0 -27
  171. package/dist/signers/non-custodial/index.d.cts +0 -11
  172. package/dist/signers/non-custodial/index.d.ts +0 -11
  173. package/dist/signers/non-custodial/index.js +0 -27
  174. package/dist/signers/non-custodial/ncs-evm-signer.cjs +0 -13
  175. package/dist/signers/non-custodial/ncs-evm-signer.d.cts +0 -30
  176. package/dist/signers/non-custodial/ncs-evm-signer.d.ts +0 -30
  177. package/dist/signers/non-custodial/ncs-evm-signer.js +0 -13
  178. package/dist/signers/non-custodial/ncs-iframe-manager.cjs +0 -7
  179. package/dist/signers/non-custodial/ncs-iframe-manager.d.cts +0 -16
  180. package/dist/signers/non-custodial/ncs-iframe-manager.d.ts +0 -16
  181. package/dist/signers/non-custodial/ncs-iframe-manager.js +0 -7
  182. package/dist/signers/non-custodial/ncs-signer.cjs +0 -14
  183. package/dist/signers/non-custodial/ncs-signer.d.cts +0 -50
  184. package/dist/signers/non-custodial/ncs-signer.d.ts +0 -50
  185. package/dist/signers/non-custodial/ncs-signer.js +0 -14
  186. package/dist/signers/non-custodial/ncs-solana-signer.cjs +0 -13
  187. package/dist/signers/non-custodial/ncs-solana-signer.d.cts +0 -27
  188. package/dist/signers/non-custodial/ncs-solana-signer.d.ts +0 -27
  189. package/dist/signers/non-custodial/ncs-solana-signer.js +0 -13
  190. package/dist/signers/non-custodial/ncs-stellar-signer.cjs +0 -13
  191. package/dist/signers/non-custodial/ncs-stellar-signer.d.cts +0 -27
  192. package/dist/signers/non-custodial/ncs-stellar-signer.d.ts +0 -27
  193. package/dist/signers/non-custodial/ncs-stellar-signer.js +0 -13
  194. package/dist/signers/passkey.cjs +0 -7
  195. package/dist/signers/passkey.d.cts +0 -19
  196. package/dist/signers/passkey.d.ts +0 -19
  197. package/dist/signers/passkey.js +0 -7
  198. package/dist/signers/solana-api-key.cjs +0 -7
  199. package/dist/signers/solana-api-key.d.cts +0 -18
  200. package/dist/signers/solana-api-key.d.ts +0 -18
  201. package/dist/signers/solana-api-key.js +0 -7
  202. package/dist/signers/solana-external-wallet.cjs +0 -8
  203. package/dist/signers/solana-external-wallet.d.cts +0 -24
  204. package/dist/signers/solana-external-wallet.d.ts +0 -24
  205. package/dist/signers/solana-external-wallet.js +0 -8
  206. package/dist/signers/stellar-external-wallet.cjs +0 -7
  207. package/dist/signers/stellar-external-wallet.d.cts +0 -23
  208. package/dist/signers/stellar-external-wallet.d.ts +0 -23
  209. package/dist/signers/stellar-external-wallet.js +0 -7
  210. package/dist/signers/types.cjs +0 -9
  211. package/dist/signers/types.d.cts +0 -91
  212. package/dist/signers/types.d.ts +0 -91
  213. package/dist/signers/types.js +0 -9
  214. package/dist/utils/constants.cjs +0 -13
  215. package/dist/utils/constants.d.cts +0 -6
  216. package/dist/utils/constants.d.ts +0 -6
  217. package/dist/utils/constants.js +0 -13
  218. package/dist/utils/errors.cjs +0 -55
  219. package/dist/utils/errors.d.cts +0 -80
  220. package/dist/utils/errors.d.ts +0 -80
  221. package/dist/utils/errors.js +0 -55
  222. package/dist/utils/signer-validation.cjs +0 -10
  223. package/dist/utils/signer-validation.d.cts +0 -9
  224. package/dist/utils/signer-validation.d.ts +0 -9
  225. package/dist/utils/signer-validation.js +0 -10
  226. package/dist/wallets/__tests__/setup.cjs +0 -36
  227. package/dist/wallets/__tests__/setup.d.cts +0 -2
  228. package/dist/wallets/__tests__/setup.d.ts +0 -2
  229. package/dist/wallets/__tests__/setup.js +0 -36
  230. package/dist/wallets/__tests__/test-helpers.cjs +0 -93
  231. package/dist/wallets/__tests__/test-helpers.d.cts +0 -36
  232. package/dist/wallets/__tests__/test-helpers.d.ts +0 -36
  233. package/dist/wallets/__tests__/test-helpers.js +0 -93
  234. package/dist/wallets/evm.cjs +0 -25
  235. package/dist/wallets/evm.d.cts +0 -155
  236. package/dist/wallets/evm.d.ts +0 -155
  237. package/dist/wallets/evm.js +0 -25
  238. package/dist/wallets/solana.cjs +0 -26
  239. package/dist/wallets/solana.d.cts +0 -28
  240. package/dist/wallets/solana.d.ts +0 -28
  241. package/dist/wallets/solana.js +0 -26
  242. package/dist/wallets/stellar.cjs +0 -25
  243. package/dist/wallets/stellar.d.cts +0 -30
  244. package/dist/wallets/stellar.d.ts +0 -30
  245. package/dist/wallets/stellar.js +0 -25
  246. package/dist/wallets/types.cjs +0 -1
  247. package/dist/wallets/types.d.cts +0 -170
  248. package/dist/wallets/types.d.ts +0 -170
  249. package/dist/wallets/types.js +0 -0
  250. package/dist/wallets/wallet-factory.cjs +0 -33
  251. package/dist/wallets/wallet-factory.d.cts +0 -33
  252. package/dist/wallets/wallet-factory.d.ts +0 -33
  253. package/dist/wallets/wallet-factory.js +0 -33
  254. package/dist/wallets/wallet.cjs +0 -24
  255. package/dist/wallets/wallet.d.cts +0 -168
  256. package/dist/wallets/wallet.d.ts +0 -168
  257. package/dist/wallets/wallet.js +0 -24
@@ -1,21 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/chains/definitions/tempo.ts
2
- var _viem = require('viem');
3
- var tempo = _viem.defineChain.call(void 0, {
4
- id: 4217,
5
- name: "Tempo",
6
- nativeCurrency: void 0,
7
- rpcUrls: {
8
- default: { http: ["https://rpc.tempo.xyz"] }
9
- },
10
- blockExplorers: {
11
- default: {
12
- name: "Tempo Explorer",
13
- url: "https://explore.mainnet.tempo.xyz"
14
- }
15
- },
16
- testnet: false
17
- });
18
-
19
-
20
-
21
- exports.tempo = tempo;
@@ -1,237 +0,0 @@
1
- import {
2
- Wallet
3
- } from "./chunk-FHMKNG62.js";
4
- import {
5
- toViemChain
6
- } from "./chunk-2WBSPOWU.js";
7
- import {
8
- InvalidTypedDataError,
9
- SignatureNotCreatedError,
10
- TransactionNotCreatedError
11
- } from "./chunk-SGINWAB6.js";
12
- import {
13
- walletsLogger
14
- } from "./chunk-ABMZ3ZVN.js";
15
- import {
16
- __async,
17
- __decorateClass
18
- } from "./chunk-ASE2FXWP.js";
19
-
20
- // src/wallets/evm.ts
21
- import { createPublicClient, encodeFunctionData, http } from "viem";
22
- import { isValidEvmAddress, WithLoggerContext } from "@crossmint/common-sdk-base";
23
- var _EVMWallet = class _EVMWallet extends Wallet {
24
- constructor(wallet) {
25
- super(
26
- {
27
- chain: wallet.chain,
28
- address: wallet.address,
29
- owner: wallet.owner,
30
- signer: wallet.signer,
31
- options: Wallet.getOptions(wallet),
32
- alias: wallet.alias
33
- },
34
- Wallet.getApiClient(wallet)
35
- );
36
- }
37
- static from(wallet) {
38
- if (!isValidEvmAddress(wallet.address)) {
39
- throw new Error("Wallet is not an EVM wallet");
40
- }
41
- return new _EVMWallet(wallet);
42
- }
43
- sendTransaction(params) {
44
- return __async(this, null, function* () {
45
- var _a;
46
- walletsLogger.info("evmWallet.sendTransaction.start");
47
- yield this.preAuthIfNeeded();
48
- const builtTransaction = this.buildTransaction(params);
49
- const createdTransaction = yield this.createTransaction(builtTransaction, params.options);
50
- if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
51
- walletsLogger.info("evmWallet.sendTransaction.prepared", {
52
- transactionId: createdTransaction.id
53
- });
54
- return {
55
- hash: void 0,
56
- explorerLink: void 0,
57
- transactionId: createdTransaction.id
58
- };
59
- }
60
- const result = yield this.approveTransactionAndWait(createdTransaction.id);
61
- walletsLogger.info("evmWallet.sendTransaction.success", {
62
- transactionId: createdTransaction.id,
63
- hash: result.hash
64
- });
65
- return result;
66
- });
67
- }
68
- signMessage(params) {
69
- return __async(this, null, function* () {
70
- var _a;
71
- walletsLogger.info("evmWallet.signMessage.start");
72
- yield this.preAuthIfNeeded();
73
- const signatureCreationResponse = yield this.apiClient.createSignature(this.walletLocator, {
74
- type: "message",
75
- params: {
76
- message: params.message,
77
- signer: this.signer.locator(),
78
- chain: this.chain
79
- }
80
- });
81
- if ("error" in signatureCreationResponse) {
82
- walletsLogger.error("evmWallet.signMessage.error", { error: signatureCreationResponse });
83
- throw new SignatureNotCreatedError(JSON.stringify(signatureCreationResponse));
84
- }
85
- if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
86
- walletsLogger.info("evmWallet.signMessage.prepared", {
87
- signatureId: signatureCreationResponse.id
88
- });
89
- return {
90
- signature: void 0,
91
- signatureId: signatureCreationResponse.id
92
- };
93
- }
94
- const result = yield this.approveSignatureAndWait(signatureCreationResponse.id);
95
- walletsLogger.info("evmWallet.signMessage.success", { signatureId: signatureCreationResponse.id });
96
- return result;
97
- });
98
- }
99
- signTypedData(params) {
100
- return __async(this, null, function* () {
101
- var _a;
102
- walletsLogger.info("evmWallet.signTypedData.start");
103
- yield this.preAuthIfNeeded();
104
- const { domain, message, primaryType, types, chain } = params;
105
- if (!domain || !message || !types || !chain) {
106
- walletsLogger.error("evmWallet.signTypedData.error", { error: "Invalid typed data" });
107
- throw new InvalidTypedDataError("Invalid typed data");
108
- }
109
- const { name, version, chainId, verifyingContract, salt } = domain;
110
- if (!name || !version || !chainId || !verifyingContract) {
111
- walletsLogger.error("evmWallet.signTypedData.error", { error: "Invalid typed data domain" });
112
- throw new InvalidTypedDataError("Invalid typed data domain");
113
- }
114
- const signatureCreationResponse = yield this.apiClient.createSignature(this.walletLocator, {
115
- type: "typed-data",
116
- params: {
117
- typedData: {
118
- domain: {
119
- name,
120
- version,
121
- chainId: Number(chainId),
122
- verifyingContract,
123
- salt
124
- },
125
- message,
126
- primaryType,
127
- types
128
- },
129
- signer: this.signer.locator(),
130
- chain
131
- }
132
- });
133
- if ("error" in signatureCreationResponse) {
134
- walletsLogger.error("evmWallet.signTypedData.error", { error: signatureCreationResponse });
135
- throw new SignatureNotCreatedError(JSON.stringify(signatureCreationResponse));
136
- }
137
- if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
138
- walletsLogger.info("evmWallet.signTypedData.prepared", {
139
- signatureId: signatureCreationResponse.id
140
- });
141
- return {
142
- signature: void 0,
143
- signatureId: signatureCreationResponse.id
144
- };
145
- }
146
- const result = yield this.approveSignatureAndWait(signatureCreationResponse.id);
147
- walletsLogger.info("evmWallet.signTypedData.success", { signatureId: signatureCreationResponse.id });
148
- return result;
149
- });
150
- }
151
- /**
152
- * Get a Viem public client instance configured for this wallet's chain.
153
- * @param params - Optional transport configuration
154
- * @returns A Viem public client
155
- */
156
- getViemClient(params) {
157
- var _a;
158
- return createPublicClient({
159
- transport: (_a = params == null ? void 0 : params.transport) != null ? _a : http(),
160
- chain: toViemChain(this.chain)
161
- });
162
- }
163
- createTransaction(transaction, options) {
164
- return __async(this, null, function* () {
165
- var _a;
166
- const signer = (_a = options == null ? void 0 : options.experimental_signer) != null ? _a : this.signer.locator();
167
- const transactionCreationResponse = yield this.apiClient.createTransaction(this.walletLocator, {
168
- params: {
169
- signer,
170
- chain: this.chain,
171
- calls: [transaction]
172
- }
173
- });
174
- if ("error" in transactionCreationResponse) {
175
- throw new TransactionNotCreatedError(JSON.stringify(transactionCreationResponse));
176
- }
177
- return transactionCreationResponse;
178
- });
179
- }
180
- buildTransaction(params) {
181
- var _a, _b, _c, _d, _e;
182
- if ("transaction" in params) {
183
- return { transaction: params.transaction };
184
- }
185
- if (params.abi == null) {
186
- return {
187
- to: params.to,
188
- value: (_b = (_a = params.value) == null ? void 0 : _a.toString()) != null ? _b : "0",
189
- data: (_c = params.data) != null ? _c : "0x"
190
- };
191
- }
192
- if (!params.functionName) {
193
- throw new Error("Function name is required");
194
- }
195
- return {
196
- to: params.to,
197
- value: (_e = (_d = params.value) == null ? void 0 : _d.toString()) != null ? _e : "0",
198
- data: encodeFunctionData({
199
- abi: params.abi,
200
- functionName: params.functionName,
201
- args: params.args
202
- })
203
- };
204
- }
205
- };
206
- __decorateClass([
207
- WithLoggerContext({
208
- logger: walletsLogger,
209
- methodName: "evmWallet.sendTransaction",
210
- buildContext(thisArg) {
211
- return { chain: thisArg.chain, address: thisArg.address };
212
- }
213
- })
214
- ], _EVMWallet.prototype, "sendTransaction", 1);
215
- __decorateClass([
216
- WithLoggerContext({
217
- logger: walletsLogger,
218
- methodName: "evmWallet.signMessage",
219
- buildContext(thisArg) {
220
- return { chain: thisArg.chain, address: thisArg.address };
221
- }
222
- })
223
- ], _EVMWallet.prototype, "signMessage", 1);
224
- __decorateClass([
225
- WithLoggerContext({
226
- logger: walletsLogger,
227
- methodName: "evmWallet.signTypedData",
228
- buildContext(thisArg) {
229
- return { chain: thisArg.chain, address: thisArg.address };
230
- }
231
- })
232
- ], _EVMWallet.prototype, "signTypedData", 1);
233
- var EVMWallet = _EVMWallet;
234
-
235
- export {
236
- EVMWallet
237
- };
@@ -1,52 +0,0 @@
1
- import {
2
- SDK_NAME,
3
- SDK_VERSION
4
- } from "./chunk-TYQ4YIP7.js";
5
-
6
- // src/logger/init.ts
7
- import {
8
- SdkLogger,
9
- BrowserDatadogSink,
10
- detectPlatform,
11
- validateAPIKey,
12
- ServerDatadogSink
13
- } from "@crossmint/common-sdk-base";
14
- var walletsLogger = new SdkLogger();
15
- function initWalletsLogger(apiKey) {
16
- const platform = detectPlatform();
17
- const validationResult = validateAPIKey(apiKey);
18
- if (!validationResult.isValid) {
19
- throw new Error(`Invalid API key: ${validationResult.message}`);
20
- }
21
- const { environment, projectId } = validationResult;
22
- walletsLogger.init({
23
- packageName: SDK_NAME,
24
- packageVersion: SDK_VERSION,
25
- environment,
26
- projectId,
27
- platform
28
- });
29
- switch (platform) {
30
- case "browser": {
31
- const sink = new BrowserDatadogSink(environment);
32
- walletsLogger.addSink(sink);
33
- break;
34
- }
35
- case "react-native": {
36
- break;
37
- }
38
- case "server": {
39
- const sink = new ServerDatadogSink(environment);
40
- walletsLogger.addSink(sink);
41
- break;
42
- }
43
- default: {
44
- break;
45
- }
46
- }
47
- }
48
-
49
- export {
50
- walletsLogger,
51
- initWalletsLogger
52
- };
@@ -1,65 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
- var __typeError = (msg) => {
9
- throw TypeError(msg);
10
- };
11
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
- var __spreadValues = (a, b) => {
13
- for (var prop in b || (b = {}))
14
- if (__hasOwnProp.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- if (__getOwnPropSymbols)
17
- for (var prop of __getOwnPropSymbols(b)) {
18
- if (__propIsEnum.call(b, prop))
19
- __defNormalProp(a, prop, b[prop]);
20
- }
21
- return a;
22
- };
23
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
- var __decorateClass = (decorators, target, key, kind) => {
25
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
26
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
27
- if (decorator = decorators[i])
28
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
29
- if (kind && result) __defProp(target, key, result);
30
- return result;
31
- };
32
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
33
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
34
- var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
35
- var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
36
- var __async = (__this, __arguments, generator) => {
37
- return new Promise((resolve, reject) => {
38
- var fulfilled = (value) => {
39
- try {
40
- step(generator.next(value));
41
- } catch (e) {
42
- reject(e);
43
- }
44
- };
45
- var rejected = (value) => {
46
- try {
47
- step(generator.throw(value));
48
- } catch (e) {
49
- reject(e);
50
- }
51
- };
52
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
53
- step((generator = generator.apply(__this, __arguments)).next());
54
- });
55
- };
56
-
57
- export {
58
- __spreadValues,
59
- __spreadProps,
60
- __decorateClass,
61
- __privateGet,
62
- __privateAdd,
63
- __privateSet,
64
- __async
65
- };