@crossmint/wallets-sdk 0.10.8 → 0.10.9

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 (75) hide show
  1. package/README.md +38 -114
  2. package/dist/api/client.cjs +1 -1
  3. package/dist/api/client.js +1 -1
  4. package/dist/api/gen/index.cjs +1 -1
  5. package/dist/api/gen/index.js +1 -1
  6. package/dist/api/index.cjs +1 -1
  7. package/dist/api/index.js +1 -1
  8. package/dist/{chunk-J67J2N7M.js → chunk-2LOGLK6Y.js} +1 -1
  9. package/dist/{chunk-SN3LCVYC.js → chunk-36Z3WOLW.js} +1 -1
  10. package/dist/chunk-3KB2VQVH.js +1 -0
  11. package/dist/{chunk-EV4AUN33.cjs → chunk-5HBL6I5V.cjs} +1 -1
  12. package/dist/{chunk-AC4TCW3L.cjs → chunk-5IM7I7EX.cjs} +1 -1
  13. package/dist/chunk-5XUQSU22.js +1 -0
  14. package/dist/{chunk-GIDUQBAX.cjs → chunk-63KMVANB.cjs} +1 -1
  15. package/dist/{chunk-EJSIN53L.cjs → chunk-6DVCB4VI.cjs} +1 -1
  16. package/dist/{chunk-A6ZBW2VA.js → chunk-6YFK33UZ.js} +1 -1
  17. package/dist/{chunk-NKUDWDSH.cjs → chunk-AHG6IQT7.cjs} +1 -1
  18. package/dist/{chunk-VEKXBWC5.js → chunk-C7GUSH3M.js} +1 -1
  19. package/dist/chunk-CGAFBZHZ.cjs +1 -0
  20. package/dist/{chunk-QNBRYCK7.js → chunk-CTZE2MXB.js} +1 -1
  21. package/dist/{chunk-3L6EVBXA.cjs → chunk-FBNQVPXQ.cjs} +1 -1
  22. package/dist/chunk-GEEQGXHO.cjs +1 -0
  23. package/dist/{chunk-APQSPTH3.js → chunk-KBBVSGHP.js} +1 -1
  24. package/dist/chunk-MHBF3VBC.js +1 -0
  25. package/dist/{chunk-4BJMFWAY.cjs → chunk-MPTRSUNX.cjs} +1 -1
  26. package/dist/{chunk-7JAILZE2.cjs → chunk-NGODR2AA.cjs} +1 -1
  27. package/dist/{chunk-IZGS2VHO.js → chunk-PHIPQLW2.js} +1 -1
  28. package/dist/{chunk-UPTOMSKW.js → chunk-RSM6MX6W.js} +1 -1
  29. package/dist/{chunk-TDNPEWFY.cjs → chunk-UMX5PW5P.cjs} +1 -1
  30. package/dist/index.cjs +1 -1
  31. package/dist/index.d.cts +7 -9
  32. package/dist/index.d.ts +7 -9
  33. package/dist/index.js +1 -1
  34. package/dist/sdk.cjs +1 -1
  35. package/dist/sdk.d.cts +7 -8
  36. package/dist/sdk.d.ts +7 -8
  37. package/dist/sdk.js +1 -1
  38. package/dist/signers/email/email-signer-api-client.cjs +1 -1
  39. package/dist/signers/email/email-signer-api-client.js +1 -1
  40. package/dist/signers/email/evm-email-signer.cjs +1 -1
  41. package/dist/signers/email/evm-email-signer.js +1 -1
  42. package/dist/signers/email/index.cjs +1 -1
  43. package/dist/signers/email/index.js +1 -1
  44. package/dist/signers/email/solana-email-signer.cjs +1 -1
  45. package/dist/signers/email/solana-email-signer.js +1 -1
  46. package/dist/signers/index.cjs +1 -1
  47. package/dist/signers/index.js +1 -1
  48. package/dist/utils/constants.cjs +1 -1
  49. package/dist/utils/constants.js +1 -1
  50. package/dist/wallets/evm.cjs +1 -1
  51. package/dist/wallets/evm.d.cts +1 -1
  52. package/dist/wallets/evm.d.ts +1 -1
  53. package/dist/wallets/evm.js +1 -1
  54. package/dist/wallets/solana.cjs +1 -1
  55. package/dist/wallets/solana.js +1 -1
  56. package/dist/wallets/types.cjs +1 -1
  57. package/dist/wallets/types.d.cts +13 -3
  58. package/dist/wallets/types.d.ts +13 -3
  59. package/dist/wallets/types.js +0 -1
  60. package/dist/wallets/wallet-factory.cjs +1 -1
  61. package/dist/wallets/wallet-factory.d.cts +3 -9
  62. package/dist/wallets/wallet-factory.d.ts +3 -9
  63. package/dist/wallets/wallet-factory.js +1 -1
  64. package/dist/wallets/wallet.cjs +1 -1
  65. package/dist/wallets/wallet.d.cts +2 -2
  66. package/dist/wallets/wallet.d.ts +2 -2
  67. package/dist/wallets/wallet.js +1 -1
  68. package/package.json +1 -1
  69. package/dist/chunk-424EIRNB.js +0 -1
  70. package/dist/chunk-4UVSDKGY.cjs +0 -1
  71. package/dist/chunk-LURBQMOO.js +0 -1
  72. package/dist/chunk-MHKWLGN5.cjs +0 -1
  73. package/dist/chunk-NUERDBYD.cjs +0 -1
  74. package/dist/chunk-PJUVPRKB.js +0 -0
  75. package/dist/chunk-S3IXONDB.js +0 -1
package/README.md CHANGED
@@ -1,162 +1,86 @@
1
1
  # Wallets SDK
2
2
 
3
- A Typescript SDK to interact with Crossmint Wallets. This SDK enables developers to create and manage smart contract wallets that support both traditional keypair-based signing and passkey authentication across Solana and EVM chains.
3
+ A Typescript SDK to interact with Crossmint Wallets. This SDK enables developers to easily create and manage wallets on Solana and EVM chains.
4
4
 
5
- - **Multi-chain**: supports Solana and EVM chains
6
- - **Multiple signer types**: passkeys, ECDSA keypairs, delegated signers
7
- - **Smart** and **MPC** wallets
8
- - **User** (client-side) wallets and **agent** (server-side) wallets
9
- - **Familiar API**: follows `viem` and `web3.js` conventions
5
+ Get a Crossmint client API key from [here](https://docs.crossmint.com/introduction/platform/api-keys/client-side) and add it to your `.env` file. Make sure your API key has all scopes for `Wallet API`, and `Users`.
10
6
 
11
7
  ## Installation
12
8
 
13
- ```sh
14
- npm install @crossmint/wallets-sdk
15
- # or
16
- pnpm add @crossmint/wallets-sdk
9
+ ```bash
10
+ pnpm install @crossmint/wallets-sdk
17
11
  ```
18
12
 
19
- ## Quick Start
13
+ ## Usage
20
14
 
21
15
  ```ts
22
16
  import { CrossmintWallets, createCrossmint } from "@crossmint/wallets-sdk";
23
17
 
24
18
  const crossmint = createCrossmint({
25
- apiKey: "<YOUR_API_KEY>",
26
- jwt: "<USER_TOKEN>", // Not needed for server wallets
19
+ apiKey: "<your-client-OR-server-api-key>",
20
+ jwt: "<your-jwt>", // required for client-side calls, optional for server-side calls
27
21
  });
28
22
  const crossmintWallets = CrossmintWallets.from(crossmint);
29
23
  const wallet = await crossmintWallets.getOrCreateWallet({
30
- chain: "base-sepolia",
24
+ chain: "<your-chain>",
31
25
  signer: {
32
- type: "passkey",
26
+ type: "email",
27
+ email: "<your-email>",
33
28
  },
34
29
  });
35
30
 
36
- const address = wallet.address;
31
+ console.log(wallet.address);
37
32
  ```
38
33
 
39
- ## Solana Examples
40
-
41
- ### Wallet Creation
42
-
43
- #### Smart Wallets
34
+ ### Get wallet balances
44
35
 
45
36
  ```ts
46
- import { Keypair } from "@solana/web3.js";
37
+ const balances = await wallet.balances();
47
38
 
48
- const keypair = Keypair.generate();
49
- const wallet = await crossmintWallets.getOrCreateWallet({
50
- chain: "solana",
51
- signer: {
52
- type: "external-wallet",
53
- address: keypair.publicKey.toBase58(),
54
- onSignTransaction: async (transaction: VersionedTransaction) => {
55
- return await keypair.signTransaction(transaction);
56
- },
57
- },
58
- });
39
+ console.log(balances.nativeToken.amount);
40
+ console.log(balances.usdc.amount);
59
41
  ```
60
42
 
61
- ### Sending Transactions
43
+ ### Transfer
62
44
 
63
45
  ```ts
64
- import {
65
- Connection,
66
- PublicKey,
67
- TransactionInstruction,
68
- TransactionMessage,
69
- VersionedTransaction,
70
- } from "@solana/web3.js";
71
-
72
- const connection = new Connection("https://api.devnet.solana.com");
73
- const memoInstruction = new TransactionInstruction({
74
- keys: [
75
- {
76
- pubkey: new PublicKey(wallet.address),
77
- isSigner: true,
78
- isWritable: true,
79
- },
80
- ],
81
- data: Buffer.from("Hello from Crossmint SDK", "utf-8"),
82
- programId: new PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),
83
- });
84
-
85
- const blockhash = (await connection.getLatestBlockhash()).blockhash;
86
- const newMessage = new TransactionMessage({
87
- payerKey: new PublicKey(wallet.address),
88
- recentBlockhash: blockhash,
89
- instructions: [memoInstruction],
90
- });
91
-
92
- const transaction = new VersionedTransaction(newMessage.compileToV0Message());
46
+ const transaction = await wallet.send(recipient, "usdc", "100");
93
47
 
94
- const txHash = await wallet.sendTransaction({
95
- transaction,
96
- });
48
+ console.log(transaction.explorerLink);
97
49
  ```
98
50
 
99
- ### Delegated Signers
51
+ ### Get wallet activity
100
52
 
101
53
  ```ts
102
- const newSigner = Keypair.generate();
103
- await wallet.addDelegatedSigner(keypair.publicKey.toBase58());
104
- const txHash = await wallet.sendTransaction({
105
- transaction,
106
- delegatedSigner: {
107
- type: "solana-keypair",
108
- address: keypair.publicKey.toBase58(),
109
- signer: newSigner,
110
- },
111
- });
54
+ const activity = await wallet.experimental_activity();
55
+
56
+ console.log(activity.events);
112
57
  ```
113
58
 
114
- ## EVM Examples
59
+ ### Delegated signers
115
60
 
116
- ### Wallet Creation
61
+ ```ts
62
+ // Add a delegated signer
63
+ await wallet.addDelegatedSigner({ signer: "<signer-address>" });
117
64
 
118
- #### Passkey Smart Wallets
65
+ const signers = await wallet.delegatedSigners();
119
66
 
120
- ```ts
121
- const wallet = await crossmintWallets.getOrCreateWallet({
122
- chain: "base-sepolia",
123
- signer: {
124
- type: "passkey",
125
- name: "My Wallet",
126
- },
127
- });
67
+ console.log(signers);
128
68
  ```
129
69
 
130
- #### Keypair Smart Wallets
70
+ ### Create custom transactions
131
71
 
132
72
  ```ts
133
- import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
73
+ import { SolanaWallet, EVMWallet } from "@crossmint/wallets-sdk";
134
74
 
135
- const account = privateKeyToAccount(generatePrivateKey());
136
- const wallet = await crossmintWallets.getOrCreateWallet({
137
- chain: "base-sepolia",
138
- signer: {
139
- type: "external-wallet",
140
- address: account.address,
141
- viemAccount: account,
142
- },
143
- });
144
- ```
75
+ // Solana
76
+ const solanaWallet = SolanaWallet.from(wallet);
77
+ const solTx = await solanaWallet.sendTransaction({ transaction: "<serialized-or-non-serialized-transaction>" });
145
78
 
146
- ### Sending Transactions
79
+ console.log(solTx.explorerLink);
147
80
 
148
- ```ts
149
- const transaction = await wallet.sendTransaction({
150
- to: "0x0000000000000000000000000000000000000042",
151
- data: "0xdeadbeef",
152
- value: BigInt(0),
153
- });
154
- ```
81
+ // EVM
82
+ const evmWallet = EVMWallet.from(wallet);
83
+ const evmTx = await evmWallet.sendTransaction({ transaction: "<serialized-or-non-serialized-transaction>" });
155
84
 
156
- ### Signing Messages
157
-
158
- ```ts
159
- const signature = await wallet.signMessage({
160
- message: "Hello from Crossmint SDK",
161
- });
85
+ console.log(evmTx.explorerLink);
162
86
  ```
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkEV4AUN33cjs = require('../chunk-EV4AUN33.cjs');require('../chunk-NKUDWDSH.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-XALFCQKD.cjs');exports.ApiClient = _chunkEV4AUN33cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5HBL6I5Vcjs = require('../chunk-5HBL6I5V.cjs');require('../chunk-AHG6IQT7.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-XALFCQKD.cjs');exports.ApiClient = _chunk5HBL6I5Vcjs.a;
@@ -1 +1 @@
1
- import{a}from"../chunk-SN3LCVYC.js";import"../chunk-LURBQMOO.js";import"../chunk-7ENJXL4H.js";import"../chunk-BW7YYVZE.js";export{a as ApiClient};
1
+ import{a}from"../chunk-36Z3WOLW.js";import"../chunk-3KB2VQVH.js";import"../chunk-7ENJXL4H.js";import"../chunk-BW7YYVZE.js";export{a as ApiClient};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-XPMCPXI3.cjs');var _chunkHTEW2JRCcjs = require('../../chunk-HTEW2JRC.cjs');require('../../chunk-STYSP6KL.cjs');require('../../chunk-XALFCQKD.cjs');exports.balanceControllerFundWallet2 = _chunkHTEW2JRCcjs.y; exports.balanceControllerGetBalanceForLocator2 = _chunkHTEW2JRCcjs.x; exports.balanceUnstableControllerGetBalanceForLocator2 = _chunkHTEW2JRCcjs.E; exports.fetchContentFromWallet = _chunkHTEW2JRCcjs.w; exports.walletsSendTokenControllerSendMeToken2 = _chunkHTEW2JRCcjs.C; exports.walletsSendTokenControllerSendToken2 = _chunkHTEW2JRCcjs.D; exports.walletsV1ControllerCreateDelegatedSigner4 = _chunkHTEW2JRCcjs.W; exports.walletsV1ControllerCreateDelegatedSigner5 = _chunkHTEW2JRCcjs.r; exports.walletsV1ControllerCreateMeDelegatedSigner4 = _chunkHTEW2JRCcjs.K; exports.walletsV1ControllerCreateMeDelegatedSigner5 = _chunkHTEW2JRCcjs.f; exports.walletsV1ControllerCreateMeSignatureRequest4 = _chunkHTEW2JRCcjs.N; exports.walletsV1ControllerCreateMeSignatureRequest5 = _chunkHTEW2JRCcjs.i; exports.walletsV1ControllerCreateMeTransaction4 = _chunkHTEW2JRCcjs.I; exports.walletsV1ControllerCreateMeTransaction5 = _chunkHTEW2JRCcjs.d; exports.walletsV1ControllerCreateMeWallet4 = _chunkHTEW2JRCcjs.Q; exports.walletsV1ControllerCreateMeWallet5 = _chunkHTEW2JRCcjs.l; exports.walletsV1ControllerCreateSignatureRequest4 = _chunkHTEW2JRCcjs._; exports.walletsV1ControllerCreateSignatureRequest5 = _chunkHTEW2JRCcjs.v; exports.walletsV1ControllerCreateTransaction4 = _chunkHTEW2JRCcjs.U; exports.walletsV1ControllerCreateTransaction5 = _chunkHTEW2JRCcjs.p; exports.walletsV1ControllerCreateWallet4 = _chunkHTEW2JRCcjs.ba; exports.walletsV1ControllerCreateWallet5 = _chunkHTEW2JRCcjs.B; exports.walletsV1ControllerGetAllSignatures4 = _chunkHTEW2JRCcjs.Z; exports.walletsV1ControllerGetAllSignatures5 = _chunkHTEW2JRCcjs.u; exports.walletsV1ControllerGetDelegatedSigner4 = _chunkHTEW2JRCcjs.V; exports.walletsV1ControllerGetDelegatedSigner5 = _chunkHTEW2JRCcjs.q; exports.walletsV1ControllerGetMeDelegatedSigner4 = _chunkHTEW2JRCcjs.J; exports.walletsV1ControllerGetMeDelegatedSigner5 = _chunkHTEW2JRCcjs.e; exports.walletsV1ControllerGetMeSignature4 = _chunkHTEW2JRCcjs.M; exports.walletsV1ControllerGetMeSignature5 = _chunkHTEW2JRCcjs.h; exports.walletsV1ControllerGetMeTransaction4 = _chunkHTEW2JRCcjs.G; exports.walletsV1ControllerGetMeTransaction5 = _chunkHTEW2JRCcjs.b; exports.walletsV1ControllerGetMeTransactionsWithoutChain4 = _chunkHTEW2JRCcjs.H; exports.walletsV1ControllerGetMeTransactionsWithoutChain5 = _chunkHTEW2JRCcjs.c; exports.walletsV1ControllerGetMeWallet4 = _chunkHTEW2JRCcjs.P; exports.walletsV1ControllerGetMeWallet5 = _chunkHTEW2JRCcjs.k; exports.walletsV1ControllerGetMeWalletActivity4 = _chunkHTEW2JRCcjs.O; exports.walletsV1ControllerGetMeWalletActivity5 = _chunkHTEW2JRCcjs.j; exports.walletsV1ControllerGetSignature4 = _chunkHTEW2JRCcjs.Y; exports.walletsV1ControllerGetSignature5 = _chunkHTEW2JRCcjs.t; exports.walletsV1ControllerGetTransaction4 = _chunkHTEW2JRCcjs.S; exports.walletsV1ControllerGetTransaction5 = _chunkHTEW2JRCcjs.n; exports.walletsV1ControllerGetTransactionsWithoutChain4 = _chunkHTEW2JRCcjs.T; exports.walletsV1ControllerGetTransactionsWithoutChain5 = _chunkHTEW2JRCcjs.o; exports.walletsV1ControllerGetWalletActivity4 = _chunkHTEW2JRCcjs.$; exports.walletsV1ControllerGetWalletActivity5 = _chunkHTEW2JRCcjs.z; exports.walletsV1ControllerGetWalletByLocator4 = _chunkHTEW2JRCcjs.aa; exports.walletsV1ControllerGetWalletByLocator5 = _chunkHTEW2JRCcjs.A; exports.walletsV1ControllerSubmitApprovals4 = _chunkHTEW2JRCcjs.R; exports.walletsV1ControllerSubmitApprovals5 = _chunkHTEW2JRCcjs.m; exports.walletsV1ControllerSubmitMeApprovals4 = _chunkHTEW2JRCcjs.F; exports.walletsV1ControllerSubmitMeApprovals5 = _chunkHTEW2JRCcjs.a; exports.walletsV1ControllerSubmitMeSignatureApprovals4 = _chunkHTEW2JRCcjs.L; exports.walletsV1ControllerSubmitMeSignatureApprovals5 = _chunkHTEW2JRCcjs.g; exports.walletsV1ControllerSubmitSignatureApprovals4 = _chunkHTEW2JRCcjs.X; exports.walletsV1ControllerSubmitSignatureApprovals5 = _chunkHTEW2JRCcjs.s;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHTEW2JRCcjs = require('../../chunk-HTEW2JRC.cjs');require('../../chunk-STYSP6KL.cjs');require('../../chunk-XPMCPXI3.cjs');require('../../chunk-XALFCQKD.cjs');exports.balanceControllerFundWallet2 = _chunkHTEW2JRCcjs.y; exports.balanceControllerGetBalanceForLocator2 = _chunkHTEW2JRCcjs.x; exports.balanceUnstableControllerGetBalanceForLocator2 = _chunkHTEW2JRCcjs.E; exports.fetchContentFromWallet = _chunkHTEW2JRCcjs.w; exports.walletsSendTokenControllerSendMeToken2 = _chunkHTEW2JRCcjs.C; exports.walletsSendTokenControllerSendToken2 = _chunkHTEW2JRCcjs.D; exports.walletsV1ControllerCreateDelegatedSigner4 = _chunkHTEW2JRCcjs.W; exports.walletsV1ControllerCreateDelegatedSigner5 = _chunkHTEW2JRCcjs.r; exports.walletsV1ControllerCreateMeDelegatedSigner4 = _chunkHTEW2JRCcjs.K; exports.walletsV1ControllerCreateMeDelegatedSigner5 = _chunkHTEW2JRCcjs.f; exports.walletsV1ControllerCreateMeSignatureRequest4 = _chunkHTEW2JRCcjs.N; exports.walletsV1ControllerCreateMeSignatureRequest5 = _chunkHTEW2JRCcjs.i; exports.walletsV1ControllerCreateMeTransaction4 = _chunkHTEW2JRCcjs.I; exports.walletsV1ControllerCreateMeTransaction5 = _chunkHTEW2JRCcjs.d; exports.walletsV1ControllerCreateMeWallet4 = _chunkHTEW2JRCcjs.Q; exports.walletsV1ControllerCreateMeWallet5 = _chunkHTEW2JRCcjs.l; exports.walletsV1ControllerCreateSignatureRequest4 = _chunkHTEW2JRCcjs._; exports.walletsV1ControllerCreateSignatureRequest5 = _chunkHTEW2JRCcjs.v; exports.walletsV1ControllerCreateTransaction4 = _chunkHTEW2JRCcjs.U; exports.walletsV1ControllerCreateTransaction5 = _chunkHTEW2JRCcjs.p; exports.walletsV1ControllerCreateWallet4 = _chunkHTEW2JRCcjs.ba; exports.walletsV1ControllerCreateWallet5 = _chunkHTEW2JRCcjs.B; exports.walletsV1ControllerGetAllSignatures4 = _chunkHTEW2JRCcjs.Z; exports.walletsV1ControllerGetAllSignatures5 = _chunkHTEW2JRCcjs.u; exports.walletsV1ControllerGetDelegatedSigner4 = _chunkHTEW2JRCcjs.V; exports.walletsV1ControllerGetDelegatedSigner5 = _chunkHTEW2JRCcjs.q; exports.walletsV1ControllerGetMeDelegatedSigner4 = _chunkHTEW2JRCcjs.J; exports.walletsV1ControllerGetMeDelegatedSigner5 = _chunkHTEW2JRCcjs.e; exports.walletsV1ControllerGetMeSignature4 = _chunkHTEW2JRCcjs.M; exports.walletsV1ControllerGetMeSignature5 = _chunkHTEW2JRCcjs.h; exports.walletsV1ControllerGetMeTransaction4 = _chunkHTEW2JRCcjs.G; exports.walletsV1ControllerGetMeTransaction5 = _chunkHTEW2JRCcjs.b; exports.walletsV1ControllerGetMeTransactionsWithoutChain4 = _chunkHTEW2JRCcjs.H; exports.walletsV1ControllerGetMeTransactionsWithoutChain5 = _chunkHTEW2JRCcjs.c; exports.walletsV1ControllerGetMeWallet4 = _chunkHTEW2JRCcjs.P; exports.walletsV1ControllerGetMeWallet5 = _chunkHTEW2JRCcjs.k; exports.walletsV1ControllerGetMeWalletActivity4 = _chunkHTEW2JRCcjs.O; exports.walletsV1ControllerGetMeWalletActivity5 = _chunkHTEW2JRCcjs.j; exports.walletsV1ControllerGetSignature4 = _chunkHTEW2JRCcjs.Y; exports.walletsV1ControllerGetSignature5 = _chunkHTEW2JRCcjs.t; exports.walletsV1ControllerGetTransaction4 = _chunkHTEW2JRCcjs.S; exports.walletsV1ControllerGetTransaction5 = _chunkHTEW2JRCcjs.n; exports.walletsV1ControllerGetTransactionsWithoutChain4 = _chunkHTEW2JRCcjs.T; exports.walletsV1ControllerGetTransactionsWithoutChain5 = _chunkHTEW2JRCcjs.o; exports.walletsV1ControllerGetWalletActivity4 = _chunkHTEW2JRCcjs.$; exports.walletsV1ControllerGetWalletActivity5 = _chunkHTEW2JRCcjs.z; exports.walletsV1ControllerGetWalletByLocator4 = _chunkHTEW2JRCcjs.aa; exports.walletsV1ControllerGetWalletByLocator5 = _chunkHTEW2JRCcjs.A; exports.walletsV1ControllerSubmitApprovals4 = _chunkHTEW2JRCcjs.R; exports.walletsV1ControllerSubmitApprovals5 = _chunkHTEW2JRCcjs.m; exports.walletsV1ControllerSubmitMeApprovals4 = _chunkHTEW2JRCcjs.F; exports.walletsV1ControllerSubmitMeApprovals5 = _chunkHTEW2JRCcjs.a; exports.walletsV1ControllerSubmitMeSignatureApprovals4 = _chunkHTEW2JRCcjs.L; exports.walletsV1ControllerSubmitMeSignatureApprovals5 = _chunkHTEW2JRCcjs.g; exports.walletsV1ControllerSubmitSignatureApprovals4 = _chunkHTEW2JRCcjs.X; exports.walletsV1ControllerSubmitSignatureApprovals5 = _chunkHTEW2JRCcjs.s;
@@ -1 +1 @@
1
- import"../../chunk-YMRXMNME.js";import{$,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,_,a as o,aa as oo,b as r,ba as ro,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c,l as d,m as g,n as h,o as i,p as j,q as k,r as l,s as n,t as q,u as s,v as u,w as v,x as w,y,z}from"../../chunk-Q3WOEBKN.js";import"../../chunk-5M7IRODB.js";import"../../chunk-BW7YYVZE.js";export{y as balanceControllerFundWallet2,w as balanceControllerGetBalanceForLocator2,E as balanceUnstableControllerGetBalanceForLocator2,v as fetchContentFromWallet,C as walletsSendTokenControllerSendMeToken2,D as walletsSendTokenControllerSendToken2,W as walletsV1ControllerCreateDelegatedSigner4,l as walletsV1ControllerCreateDelegatedSigner5,K as walletsV1ControllerCreateMeDelegatedSigner4,p as walletsV1ControllerCreateMeDelegatedSigner5,N as walletsV1ControllerCreateMeSignatureRequest4,a as walletsV1ControllerCreateMeSignatureRequest5,I as walletsV1ControllerCreateMeTransaction4,f as walletsV1ControllerCreateMeTransaction5,Q as walletsV1ControllerCreateMeWallet4,d as walletsV1ControllerCreateMeWallet5,_ as walletsV1ControllerCreateSignatureRequest4,u as walletsV1ControllerCreateSignatureRequest5,U as walletsV1ControllerCreateTransaction4,j as walletsV1ControllerCreateTransaction5,ro as walletsV1ControllerCreateWallet4,B as walletsV1ControllerCreateWallet5,Z as walletsV1ControllerGetAllSignatures4,s as walletsV1ControllerGetAllSignatures5,V as walletsV1ControllerGetDelegatedSigner4,k as walletsV1ControllerGetDelegatedSigner5,J as walletsV1ControllerGetMeDelegatedSigner4,m as walletsV1ControllerGetMeDelegatedSigner5,M as walletsV1ControllerGetMeSignature4,x as walletsV1ControllerGetMeSignature5,G as walletsV1ControllerGetMeTransaction4,r as walletsV1ControllerGetMeTransaction5,H as walletsV1ControllerGetMeTransactionsWithoutChain4,e as walletsV1ControllerGetMeTransactionsWithoutChain5,P as walletsV1ControllerGetMeWallet4,c as walletsV1ControllerGetMeWallet5,O as walletsV1ControllerGetMeWalletActivity4,b as walletsV1ControllerGetMeWalletActivity5,Y as walletsV1ControllerGetSignature4,q as walletsV1ControllerGetSignature5,S as walletsV1ControllerGetTransaction4,h as walletsV1ControllerGetTransaction5,T as walletsV1ControllerGetTransactionsWithoutChain4,i as walletsV1ControllerGetTransactionsWithoutChain5,$ as walletsV1ControllerGetWalletActivity4,z as walletsV1ControllerGetWalletActivity5,oo as walletsV1ControllerGetWalletByLocator4,A as walletsV1ControllerGetWalletByLocator5,R as walletsV1ControllerSubmitApprovals4,g as walletsV1ControllerSubmitApprovals5,F as walletsV1ControllerSubmitMeApprovals4,o as walletsV1ControllerSubmitMeApprovals5,L as walletsV1ControllerSubmitMeSignatureApprovals4,t as walletsV1ControllerSubmitMeSignatureApprovals5,X as walletsV1ControllerSubmitSignatureApprovals4,n as walletsV1ControllerSubmitSignatureApprovals5};
1
+ import{$,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,_,a as o,aa as oo,b as r,ba as ro,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c,l as d,m as g,n as h,o as i,p as j,q as k,r as l,s as n,t as q,u as s,v as u,w as v,x as w,y,z}from"../../chunk-Q3WOEBKN.js";import"../../chunk-5M7IRODB.js";import"../../chunk-YMRXMNME.js";import"../../chunk-BW7YYVZE.js";export{y as balanceControllerFundWallet2,w as balanceControllerGetBalanceForLocator2,E as balanceUnstableControllerGetBalanceForLocator2,v as fetchContentFromWallet,C as walletsSendTokenControllerSendMeToken2,D as walletsSendTokenControllerSendToken2,W as walletsV1ControllerCreateDelegatedSigner4,l as walletsV1ControllerCreateDelegatedSigner5,K as walletsV1ControllerCreateMeDelegatedSigner4,p as walletsV1ControllerCreateMeDelegatedSigner5,N as walletsV1ControllerCreateMeSignatureRequest4,a as walletsV1ControllerCreateMeSignatureRequest5,I as walletsV1ControllerCreateMeTransaction4,f as walletsV1ControllerCreateMeTransaction5,Q as walletsV1ControllerCreateMeWallet4,d as walletsV1ControllerCreateMeWallet5,_ as walletsV1ControllerCreateSignatureRequest4,u as walletsV1ControllerCreateSignatureRequest5,U as walletsV1ControllerCreateTransaction4,j as walletsV1ControllerCreateTransaction5,ro as walletsV1ControllerCreateWallet4,B as walletsV1ControllerCreateWallet5,Z as walletsV1ControllerGetAllSignatures4,s as walletsV1ControllerGetAllSignatures5,V as walletsV1ControllerGetDelegatedSigner4,k as walletsV1ControllerGetDelegatedSigner5,J as walletsV1ControllerGetMeDelegatedSigner4,m as walletsV1ControllerGetMeDelegatedSigner5,M as walletsV1ControllerGetMeSignature4,x as walletsV1ControllerGetMeSignature5,G as walletsV1ControllerGetMeTransaction4,r as walletsV1ControllerGetMeTransaction5,H as walletsV1ControllerGetMeTransactionsWithoutChain4,e as walletsV1ControllerGetMeTransactionsWithoutChain5,P as walletsV1ControllerGetMeWallet4,c as walletsV1ControllerGetMeWallet5,O as walletsV1ControllerGetMeWalletActivity4,b as walletsV1ControllerGetMeWalletActivity5,Y as walletsV1ControllerGetSignature4,q as walletsV1ControllerGetSignature5,S as walletsV1ControllerGetTransaction4,h as walletsV1ControllerGetTransaction5,T as walletsV1ControllerGetTransactionsWithoutChain4,i as walletsV1ControllerGetTransactionsWithoutChain5,$ as walletsV1ControllerGetWalletActivity4,z as walletsV1ControllerGetWalletActivity5,oo as walletsV1ControllerGetWalletByLocator4,A as walletsV1ControllerGetWalletByLocator5,R as walletsV1ControllerSubmitApprovals4,g as walletsV1ControllerSubmitApprovals5,F as walletsV1ControllerSubmitMeApprovals4,o as walletsV1ControllerSubmitMeApprovals5,L as walletsV1ControllerSubmitMeSignatureApprovals4,t as walletsV1ControllerSubmitMeSignatureApprovals5,X as walletsV1ControllerSubmitSignatureApprovals4,n as walletsV1ControllerSubmitSignatureApprovals5};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-6HXIZLEQ.cjs');var _chunkEV4AUN33cjs = require('../chunk-EV4AUN33.cjs');require('../chunk-NKUDWDSH.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-ECAM5KTH.cjs');require('../chunk-XALFCQKD.cjs');exports.ApiClient = _chunkEV4AUN33cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-6HXIZLEQ.cjs');var _chunk5HBL6I5Vcjs = require('../chunk-5HBL6I5V.cjs');require('../chunk-AHG6IQT7.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-ECAM5KTH.cjs');require('../chunk-XALFCQKD.cjs');exports.ApiClient = _chunk5HBL6I5Vcjs.a;
package/dist/api/index.js CHANGED
@@ -1 +1 @@
1
- import"../chunk-5IFDVB4Y.js";import{a}from"../chunk-SN3LCVYC.js";import"../chunk-LURBQMOO.js";import"../chunk-7ENJXL4H.js";import"../chunk-KBJA7JDT.js";import"../chunk-BW7YYVZE.js";export{a as ApiClient};
1
+ import"../chunk-5IFDVB4Y.js";import{a}from"../chunk-36Z3WOLW.js";import"../chunk-3KB2VQVH.js";import"../chunk-7ENJXL4H.js";import"../chunk-KBJA7JDT.js";import"../chunk-BW7YYVZE.js";export{a as ApiClient};
@@ -1 +1 @@
1
- import{a as r}from"./chunk-424EIRNB.js";import{a as l}from"./chunk-T3ICQDFS.js";import{q as c}from"./chunk-7ENJXL4H.js";import{f as e}from"./chunk-BW7YYVZE.js";import m from"bs58";import{isValidSolanaAddress as T}from"@crossmint/common-sdk-base";var d=class u extends r{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer},r.getApiClient(n))}static from(n){if(!T(n.address))throw new Error("Wallet is not a Solana wallet");return new u(n)}sendTransaction(n){return e(this,null,function*(){var i,o;let t=yield this.createTransaction(n);if((i=n.options)!=null&&i.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:t.id};let a=(o=n.additionalSigners)==null?void 0:o.map(s=>new l({type:"external-wallet",address:s.publicKey.toString(),onSignTransaction:p=>(p.sign([s]),Promise.resolve(p))}));return yield this.approveAndWait(t.id,a)})}createTransaction(t){return e(this,arguments,function*({transaction:n}){let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:m.encode(n.serialize())}});if(a.error)throw new c(JSON.stringify(a));return a})}};export{d as a};
1
+ import{a as r}from"./chunk-5XUQSU22.js";import{a as l}from"./chunk-T3ICQDFS.js";import{q as c}from"./chunk-7ENJXL4H.js";import{f as e}from"./chunk-BW7YYVZE.js";import m from"bs58";import{isValidSolanaAddress as T}from"@crossmint/common-sdk-base";var d=class u extends r{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer},r.getApiClient(n))}static from(n){if(!T(n.address))throw new Error("Wallet is not a Solana wallet");return new u(n)}sendTransaction(n){return e(this,null,function*(){var i,o;let t=yield this.createTransaction(n);if((i=n.options)!=null&&i.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:t.id};let a=(o=n.additionalSigners)==null?void 0:o.map(s=>new l({type:"external-wallet",address:s.publicKey.toString(),onSignTransaction:p=>(p.sign([s]),Promise.resolve(p))}));return yield this.approveAndWait(t.id,a)})}createTransaction(t){return e(this,arguments,function*({transaction:n}){let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:m.encode(n.serialize())}});if(a.error)throw new c(JSON.stringify(a));return a})}};export{d as a};
@@ -1 +1 @@
1
- import{b as n,c as i}from"./chunk-LURBQMOO.js";import{a as o}from"./chunk-7ENJXL4H.js";import{f as r}from"./chunk-BW7YYVZE.js";import{APIKeyUsageOrigin as c,CrossmintApiClient as h}from"@crossmint/common-sdk-base";var p=class extends h{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:i,version:n}}});this.apiPrefix="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=new URLSearchParams;return t.append("chain",s.chain.toString()),(yield this.get(`${this.apiPrefix}/${e}/activity?${t.toString()}`,{headers:this.headers})).json()})}getBalance(e,s){return r(this,null,function*(){let t=new URLSearchParams;return t.append("tokenLocators",s.tokens.join(",")),t.append("chains",s.chains.join(",")),(yield this.get(`api/unstable/wallets/${e}/balances?${t.toString()}`,{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(`api/unstable/wallets/${e}/tokens/${s}/transfers`,{body:JSON.stringify(t),headers:this.headers})).json()})}get isServerSide(){return this.parsedAPIKey.usageOrigin===c.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
+ import{b as n,c as i}from"./chunk-3KB2VQVH.js";import{a as o}from"./chunk-7ENJXL4H.js";import{f as r}from"./chunk-BW7YYVZE.js";import{APIKeyUsageOrigin as c,CrossmintApiClient as h}from"@crossmint/common-sdk-base";var p=class extends h{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:i,version:n}}});this.apiPrefix="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=new URLSearchParams;return t.append("chain",s.chain.toString()),(yield this.get(`${this.apiPrefix}/${e}/activity?${t.toString()}`,{headers:this.headers})).json()})}getBalance(e,s){return r(this,null,function*(){let t=new URLSearchParams;return t.append("tokenLocators",s.tokens.join(",")),t.append("chains",s.chains.join(",")),(yield this.get(`api/unstable/wallets/${e}/balances?${t.toString()}`,{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(`api/unstable/wallets/${e}/tokens/${s}/transfers`,{body:JSON.stringify(t),headers:this.headers})).json()})}get isServerSide(){return this.parsedAPIKey.usageOrigin===c.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};
@@ -0,0 +1 @@
1
+ var s="@crossmint/wallets-sdk",t="0.10.9";var c="WALLETS_SDK",r=t,d=s,a=500;export{c as a,r as b,d as c,a as d};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNKUDWDSHcjs = require('./chunk-NKUDWDSH.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.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:_chunkNKUDWDSHcjs.c,version:_chunkNKUDWDSHcjs.b}}});this.apiPrefix="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=new URLSearchParams;return t.append("chain",s.chain.toString()),(yield this.get(`${this.apiPrefix}/${e}/activity?${t.toString()}`,{headers:this.headers})).json()})}getBalance(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=new URLSearchParams;return t.append("tokenLocators",s.tokens.join(",")),t.append("chains",s.chains.join(",")),(yield this.get(`api/unstable/wallets/${e}/balances?${t.toString()}`,{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(`api/unstable/wallets/${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, _chunkCT2UGJELcjs.a)("Invalid API key");return this.parsedAPIKey.environment}get headers(){return{"Content-Type":"application/json"}}};exports.a = p;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkAHG6IQT7cjs = require('./chunk-AHG6IQT7.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.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:_chunkAHG6IQT7cjs.c,version:_chunkAHG6IQT7cjs.b}}});this.apiPrefix="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=new URLSearchParams;return t.append("chain",s.chain.toString()),(yield this.get(`${this.apiPrefix}/${e}/activity?${t.toString()}`,{headers:this.headers})).json()})}getBalance(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=new URLSearchParams;return t.append("tokenLocators",s.tokens.join(",")),t.append("chains",s.chains.join(",")),(yield this.get(`api/unstable/wallets/${e}/balances?${t.toString()}`,{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(`api/unstable/wallets/${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, _chunkCT2UGJELcjs.a)("Invalid API key");return this.parsedAPIKey.environment}get headers(){return{"Content-Type":"application/json"}}};exports.a = p;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTDNPEWFYcjs = require('./chunk-TDNPEWFY.cjs');var _chunk7JAILZE2cjs = require('./chunk-7JAILZE2.cjs');var _chunkDYRSQN7Xcjs = require('./chunk-DYRSQN7X.cjs');var _chunkNVJN7LPYcjs = require('./chunk-NVJN7LPY.cjs');var _chunkAFYBD7FIcjs = require('./chunk-AFYBD7FI.cjs');var _chunkYO6BJ2DIcjs = require('./chunk-YO6BJ2DI.cjs');var _chunkDIZVZP5Pcjs = require('./chunk-DIZVZP5P.cjs');function E(r,e){switch(e.type){case"email":return r==="solana"?new (0, _chunkTDNPEWFYcjs.a)(e):new (0, _chunk7JAILZE2cjs.a)(e);case"api-key":return r==="solana"?new (0, _chunkNVJN7LPYcjs.a)(e):new (0, _chunkYO6BJ2DIcjs.a)(e);case"external-wallet":return r==="solana"?new (0, _chunkAFYBD7FIcjs.a)(e):new (0, _chunkDIZVZP5Pcjs.a)(e);case"passkey":return new (0, _chunkDYRSQN7Xcjs.a)(e)}}exports.a = E;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkUMX5PW5Pcjs = require('./chunk-UMX5PW5P.cjs');var _chunkNGODR2AAcjs = require('./chunk-NGODR2AA.cjs');var _chunkDYRSQN7Xcjs = require('./chunk-DYRSQN7X.cjs');var _chunkNVJN7LPYcjs = require('./chunk-NVJN7LPY.cjs');var _chunkAFYBD7FIcjs = require('./chunk-AFYBD7FI.cjs');var _chunkYO6BJ2DIcjs = require('./chunk-YO6BJ2DI.cjs');var _chunkDIZVZP5Pcjs = require('./chunk-DIZVZP5P.cjs');function E(r,e){switch(e.type){case"email":return r==="solana"?new (0, _chunkUMX5PW5Pcjs.a)(e):new (0, _chunkNGODR2AAcjs.a)(e);case"api-key":return r==="solana"?new (0, _chunkNVJN7LPYcjs.a)(e):new (0, _chunkYO6BJ2DIcjs.a)(e);case"external-wallet":return r==="solana"?new (0, _chunkAFYBD7FIcjs.a)(e):new (0, _chunkDIZVZP5Pcjs.a)(e);case"passkey":return new (0, _chunkDYRSQN7Xcjs.a)(e)}}exports.a = E;
@@ -0,0 +1 @@
1
+ import{d as C}from"./chunk-3KB2VQVH.js";import{c as O,d as N,i as A,m as E,p as L,q as $,r as x,s as W,t as B,u as P,v as _,w as F}from"./chunk-7ENJXL4H.js";import{a as T,b,c as p,d as S,e as v,f as u}from"./chunk-BW7YYVZE.js";import{isValidAddress as J}from"@crossmint/common-sdk-base";var f,c,I=class{constructor(t,e){S(this,f);S(this,c);let{chain:n,address:i,owner:a,signer:r,options:d}=t;v(this,c,e),this.chain=n,this.address=i,this.owner=a,this.signer=r,v(this,f,d)}static getApiClient(t){return t.apiClient}static getOptions(t){return t.options}get apiClient(){return p(this,c)}get options(){return p(this,f)}balances(t,e){return u(this,null,function*(){let n=this.chain==="solana"?"sol":"eth",i=[n,"usdc",...t!=null?t:[]],a=yield p(this,c).getBalance(this.address,{chains:e!=null?e:[this.chain],tokens:i.map(r=>r.toLowerCase())});if("error"in a)throw new Error(`Failed to get balances for wallet: ${JSON.stringify(a.message)}`);return this.transformBalanceResponse(a,n,t)})}transformBalanceResponse(t,e,n){let i=s=>{var w,m,y;let g,h=(w=s.forChain)==null?void 0:w[this.chain];return h&&"contractAddress"in h&&(g=h.contractAddress),{symbol:s.token,name:s.token,amount:(m=s.amount)!=null?m:"0",contractAddress:g,decimals:s.decimals,rawAmount:(y=s.rawAmount)!=null?y:"0"}},a=t.find(s=>s.token===e||s.token.toLowerCase().includes(e)),r=t.find(s=>s.token.toLowerCase().includes("usdc")),d=t.filter(s=>{let g=s.token.toLowerCase();return!g.includes(e)&&!g.includes("usdc")&&(n==null?void 0:n.some(h=>g.includes(h.toLowerCase())))}),o=s=>({symbol:s,name:s,amount:"0",contractAddress:void 0,decimals:0,rawAmount:"0"});return{nativeToken:a!=null?i(a):o(e),usdc:r!=null?i(r):o("usdc"),tokens:d.map(i)}}experimental_nfts(t){return u(this,null,function*(){return yield p(this,c).experimental_getNfts(b(T({},t),{chain:this.chain,address:this.address}))})}experimental_transactions(){return u(this,null,function*(){return yield p(this,c).getTransactions(this.walletLocator)})}experimental_activity(){return u(this,null,function*(){let t=yield this.apiClient.experimental_activity(this.walletLocator,{chain:this.chain});if("error"in t)throw new Error(`Failed to get activity: ${JSON.stringify(t.message)}`);return t})}send(t,e,n,i){return u(this,null,function*(){let a=G(t),r=R(e,this.chain),d={recipient:a,amount:n},o=yield p(this,c).send(this.walletLocator,r,d);if("message"in o)throw new $(`Failed to send token: ${JSON.stringify(o.message)}`);return i!=null&&i.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:o.id}:yield this.approveAndWait(o.id)})}addDelegatedSigner(e){return u(this,arguments,function*({signer:t}){var i,a;let n=yield p(this,c).registerSigner(this.walletLocator,{signer:t,chain:this.chain==="solana"?void 0:this.chain});if("error"in n)throw new Error(`Failed to register signer: ${JSON.stringify(n.message)}`);if("transaction"in n){let r=n.transaction.id;yield this.approveAndWait(r)}else{let r=(i=n.chains)==null?void 0:i[this.chain];if((r==null?void 0:r.status)==="awaiting-approval"){let d=((a=r.approvals)==null?void 0:a.pending)||[];yield this.approveSignature(d,r.id),yield this.waitForSignature(r.id);return}if((r==null?void 0:r.status)==="pending"){yield this.waitForSignature(r.id);return}}})}delegatedSigners(){return u(this,null,function*(){var e,n,i;let t=yield p(this,c).getWallet(this.walletLocator);if("error"in t)throw new N(JSON.stringify(t));if(t.type!=="solana-smart-wallet"&&t.type!=="evm-smart-wallet")throw new O(`Wallet type ${t.type} not supported`);return(i=(n=(e=t==null?void 0:t.config)==null?void 0:e.delegatedSigners)==null?void 0:n.map(a=>{let r=a.locator.indexOf(":");return{signer:`external-wallet:${r>=0?a.locator.slice(r+1):a.locator}`}}))!=null?i:[]})}get walletLocator(){return p(this,c).isServerSide?this.address:`me:${this.isSolanaWallet?"solana-smart-wallet":"evm-smart-wallet"}`}get isSolanaWallet(){return this.chain==="solana"}approveAndWait(t,e){return u(this,null,function*(){return yield this.approveTransaction(t,e),yield this.sleep(1e3),yield this.waitForTransaction(t)})}approveTransaction(t,e){return u(this,null,function*(){var o,s,g,h;let n=yield p(this,c).getTransaction(this.walletLocator,t);if(n.error)throw new x(JSON.stringify(n));if(yield(g=(s=(o=p(this,f))==null?void 0:o.experimental_callbacks)==null?void 0:s.onTransactionStart)==null?void 0:g.call(s),this.signer.type==="api-key")return n;let i=(h=n.approvals)==null?void 0:h.pending;if(i==null)return n;let a=[...e!=null?e:[],this.signer],r=yield Promise.all(i.map(w=>{let m=a.find(k=>k.locator()===w.signer);if(m==null)throw new A(`Signer ${w.signer} not found in pending approvals`);let y=n.walletType==="solana-smart-wallet"?n.onChain.transaction:w.message;return m.signTransaction(y)})),d=yield p(this,c).approveTransaction(this.walletLocator,n.id,{approvals:r.map(w=>T({signer:this.signer.locator()},w))});if(d.error)throw new F(JSON.stringify(d));return d})}approveSignature(t,e){return u(this,null,function*(){if(this.isSolanaWallet)throw new Error("Approving signatures is only supported for EVM smart wallets");let n=t.find(a=>a.signer===this.signer.locator());if(!n)throw new A(`Signer ${this.signer.locator()} not found in pending approvals`);let i=yield this.signer.signMessage(n.message);return yield p(this,c).approveSignature(this.walletLocator,e,{approvals:[T({signer:this.signer.locator()},i)]}),i})}waitForSignature(t){return u(this,null,function*(){let e=null;do if(yield new Promise(n=>setTimeout(n,C)),e=yield p(this,c).getSignature(this.walletLocator,t),"error"in e)throw new L(JSON.stringify(e));while(e===null||e.status==="pending");if(e.status==="failed")throw new E("Signature signing failed");if(!e.outputSignature)throw new L("Signature not available");return e.outputSignature})}waitForTransaction(r){return u(this,arguments,function*(t,e=6e4,{backoffMultiplier:n=1.1,maxBackoffMs:i=2e3,initialBackoffMs:a=C}={}){var g;let d=Date.now(),o;do{if(Date.now()-d>e)throw new W("Transaction confirmation timeout");if(o=yield p(this,c).getTransaction(this.walletLocator,t),o.error)throw new x(JSON.stringify(o));yield this.sleep(a),a=Math.min(a*n,i)}while(o.status==="pending");if(o.status==="failed")throw new B(`Transaction sending failed: ${JSON.stringify(o.error)}`);if(o.status==="awaiting-approval")throw new P("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let s=o.onChain.txId;if(s==null)throw new _("Transaction hash not found on transaction response");return{hash:s,explorerLink:(g=o.onChain.explorerLink)!=null?g:"",transactionId:o.id}})}sleep(t){return u(this,null,function*(){return new Promise(e=>setTimeout(e,t))})}};f=new WeakMap,c=new WeakMap;function G(l){if(typeof l=="string")return l;if("email"in l)return`email:${l.email}`;if("x"in l)return`x:${l.x}`;if("twitter"in l)return`twitter:${l.twitter}`;if("phone"in l)return`phoneNumber:${l.phone}`;if("userId"in l)return`userId:${l.userId}`;throw new Error("Invalid recipient locator")}function R(l,t){return J(l)?`${t}:${l}`:`${t}:${l.toLowerCase()}`}export{I as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkNUERDBYDcjs = require('./chunk-NUERDBYD.cjs');var _chunkAFYBD7FIcjs = require('./chunk-AFYBD7FI.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var _commonsdkbase = require('@crossmint/common-sdk-base');var d=class u extends _chunkNUERDBYDcjs.a{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer},_chunkNUERDBYDcjs.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 u(n)}sendTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i,o;let t=yield this.createTransaction(n);if((i=n.options)!=null&&i.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:t.id};let a=(o=n.additionalSigners)==null?void 0:o.map(s=>new (0, _chunkAFYBD7FIcjs.a)({type:"external-wallet",address:s.publicKey.toString(),onSignTransaction:p=>(p.sign([s]),Promise.resolve(p))}));return yield this.approveAndWait(t.id,a)})}createTransaction(t){return _chunkXALFCQKDcjs.f.call(void 0, this,arguments,function*({transaction:n}){let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:_bs582.default.encode(n.serialize())}});if(a.error)throw new (0, _chunkCT2UGJELcjs.q)(JSON.stringify(a));return a})}};exports.a = d;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkGEEQGXHOcjs = require('./chunk-GEEQGXHO.cjs');var _chunkAFYBD7FIcjs = require('./chunk-AFYBD7FI.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var _commonsdkbase = require('@crossmint/common-sdk-base');var d=class u extends _chunkGEEQGXHOcjs.a{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer},_chunkGEEQGXHOcjs.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 u(n)}sendTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i,o;let t=yield this.createTransaction(n);if((i=n.options)!=null&&i.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:t.id};let a=(o=n.additionalSigners)==null?void 0:o.map(s=>new (0, _chunkAFYBD7FIcjs.a)({type:"external-wallet",address:s.publicKey.toString(),onSignTransaction:p=>(p.sign([s]),Promise.resolve(p))}));return yield this.approveAndWait(t.id,a)})}createTransaction(t){return _chunkXALFCQKDcjs.f.call(void 0, this,arguments,function*({transaction:n}){let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:_bs582.default.encode(n.serialize())}});if(a.error)throw new (0, _chunkCT2UGJELcjs.q)(JSON.stringify(a));return a})}};exports.a = d;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNUERDBYDcjs = require('./chunk-NUERDBYD.cjs');var _chunkAC4TCW3Lcjs = require('./chunk-AC4TCW3L.cjs');var _chunkTDNPEWFYcjs = require('./chunk-TDNPEWFY.cjs');var _chunk7JAILZE2cjs = require('./chunk-7JAILZE2.cjs');var _chunkRD5PG4M6cjs = require('./chunk-RD5PG4M6.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _ox = require('ox');var _commonsdkbase = require('@crossmint/common-sdk-base');var g=class{constructor(e){this.apiClient=e}getOrCreateWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.apiClient.isServerSide)throw new (0, _chunkCT2UGJELcjs.f)("getOrCreateWallet is not supported on server side");let i=yield this.apiClient.getWallet(`me:${e.chain==="solana"?"solana-smart-wallet":"evm-smart-wallet"}`);return i&&!("error"in i)?(yield this.validateWalletConfig(i,e),this.createWalletInstance(i,e)):this.createWallet(e)})}getWallet(e,i){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(!this.apiClient.isServerSide)throw new (0, _chunkCT2UGJELcjs.f)("getWallet is not supported on client side, use getOrCreateWallet instead");let t=yield this.apiClient.getWallet(e);if("error"in t)throw new (0, _chunkCT2UGJELcjs.d)(JSON.stringify(t));return this.createWalletInstance(t,i)})}createWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var n,a,r,o,p;yield(r=(a=(n=e.options)==null?void 0:n.experimental_callbacks)==null?void 0:a.onWalletCreationStart)==null?void 0:r.call(a);let i;e.chain==="solana"?i={type:"solana-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(o=e.owner)!=null?o:void 0}:i={type:"evm-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(p=e.owner)!=null?p:void 0};let t=yield this.apiClient.createWallet(i);if("error"in t)throw new (0, _chunkCT2UGJELcjs.f)(JSON.stringify(t));return this.createWalletInstance(t,e)})}createWalletInstance(e,i){let t=this.toInternalSignerConfig(e,i.signer,i.options);return new (0, _chunkNUERDBYDcjs.a)({chain:i.chain,address:e.address,owner:e.linkedUser,signer:_chunkAC4TCW3Lcjs.a.call(void 0, i.chain,t),options:i.options},this.apiClient)}toInternalSignerConfig(e,i,t){var n,a;if(i==null)throw new (0, _chunkCT2UGJELcjs.f)("Signer is required to create a wallet");switch(i.type){case"api-key":{let r;switch(e.type){case"solana-smart-wallet":r=e.config.adminSigner.address;break;case"evm-smart-wallet":e.config.adminSigner.type==="evm-fireblocks-custodial"&&(r=e.config.adminSigner.address);break}if(r==null)throw new (0, _chunkCT2UGJELcjs.f)("Wallet signer 'api-key' has no address");return{type:"api-key",address:r}}case"external-wallet":return i;case"passkey":if(e.type==="evm-smart-wallet"&&e.config.adminSigner.type==="evm-passkey")return{type:"passkey",id:e.config.adminSigner.id,name:e.config.adminSigner.name,onCreatePasskey:i.onCreatePasskey,onSignWithPasskey:i.onSignWithPasskey};throw new (0, _chunkCT2UGJELcjs.f)("Passkey signer is not supported for this wallet type");case"email":{if(!(e.type==="solana-smart-wallet"&&e.config.adminSigner.type==="solana-keypair"||e.type==="evm-smart-wallet"&&e.config.adminSigner.type==="evm-keypair"))throw new (0, _chunkCT2UGJELcjs.f)("Wallet signer 'email' has no address");let r=e.config.adminSigner.address;return{type:"email",email:(a=i.email)!=null?a:(n=this.apiClient.crossmint.experimental_customAuth)==null?void 0:n.email,signerAddress:r,crossmint:this.apiClient.crossmint,onAuthRequired:i.onAuthRequired,clientTEEConnection:t==null?void 0:t.clientTEEConnection}}default:throw new Error("Invalid signer type")}}configureSigner(e,i){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var t;if((i==null?void 0:i.type)==="passkey"){let n=(t=i.name)!=null?t:`Crossmint Wallet ${Date.now()}`,a=i.onCreatePasskey?yield i.onCreatePasskey(n):yield _ox.WebAuthnP256.createCredential({name:n});return{type:"evm-passkey",id:a.id,name:n,publicKey:{x:a.publicKey.x.toString(),y:a.publicKey.y.toString()}}}return yield this.toExternalSignerConfig(e,i)})}toExternalSignerConfig(e,i,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var n,a;if(!i||i.type==="api-key")return{type:e==="solana"?"solana-fireblocks-custodial":"evm-fireblocks-custodial"};if(i.type==="external-wallet")return{type:e==="solana"?"solana-keypair":"evm-keypair",address:i.address};if(i.type==="passkey"&&t!=null){if((t==null?void 0:t.type)!=="evm-smart-wallet"||t.config.adminSigner.type!=="evm-passkey")throw new (0, _chunkCT2UGJELcjs.f)("Passkey signer is not supported for this wallet type");return{type:"evm-passkey",id:t.config.adminSigner.id,name:t.config.adminSigner.name,publicKey:{x:t.config.adminSigner.publicKey.x,y:t.config.adminSigner.publicKey.y}}}if(i.type==="email"){let r=(a=i.email)!=null?a:(n=this.apiClient.crossmint.experimental_customAuth)==null?void 0:n.email;if(r==null)throw new Error("Email is required to create a wallet with email signer");if(e==="solana")return{type:"solana-keypair",address:yield _chunkTDNPEWFYcjs.a.pregenerateSigner(r,this.apiClient.crossmint)};if(_commonsdkbase.isEVMBlockchain.call(void 0, e))return{type:"evm-keypair",address:yield _chunk7JAILZE2cjs.a.pregenerateSigner(r,this.apiClient.crossmint)}}throw new Error("Invalid signer type")})}validateWalletConfig(e,i){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(i.owner!=null&&e.linkedUser!=null&&i.owner!==e.linkedUser)throw new (0, _chunkCT2UGJELcjs.f)("Wallet owner does not match existing wallet's linked user");if(e.type!=="solana-smart-wallet"&&e.type!=="evm-smart-wallet")return;let t=yield this.toExternalSignerConfig(i.chain,i.signer,e),n=e.config.adminSigner;if(t&&n){if(t.type!==n.type)throw new (0, _chunkCT2UGJELcjs.f)("The wallet signer type provided in the wallet config does not match the existing wallet's adminSigner type");_chunkRD5PG4M6cjs.a.call(void 0, t,n)}})}};exports.a = g;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGEEQGXHOcjs = require('./chunk-GEEQGXHO.cjs');var _chunk5IM7I7EXcjs = require('./chunk-5IM7I7EX.cjs');var _chunkUMX5PW5Pcjs = require('./chunk-UMX5PW5P.cjs');var _chunkNGODR2AAcjs = require('./chunk-NGODR2AA.cjs');var _chunkRD5PG4M6cjs = require('./chunk-RD5PG4M6.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _ox = require('ox');var _commonsdkbase = require('@crossmint/common-sdk-base');var h=class{constructor(e){this.apiClient=e}getOrCreateWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.apiClient.isServerSide)throw new (0, _chunkCT2UGJELcjs.f)("getOrCreateWallet is not supported on server side");let i=yield this.apiClient.getWallet(`me:${e.chain==="solana"?"solana-smart-wallet":"evm-smart-wallet"}`);return i&&!("error"in i)?(yield this.validateWalletConfig(i,e),this.createWalletInstance(i,e)):this.createWallet(e)})}getWallet(e,i){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(!this.apiClient.isServerSide)throw new (0, _chunkCT2UGJELcjs.f)("getWallet is not supported on client side, use getOrCreateWallet instead");let t=yield this.apiClient.getWallet(e);if("error"in t)throw new (0, _chunkCT2UGJELcjs.d)(JSON.stringify(t));return this.createWalletInstance(t,i)})}createWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var n,a,r,o,m;yield(r=(a=(n=e.options)==null?void 0:n.experimental_callbacks)==null?void 0:a.onWalletCreationStart)==null?void 0:r.call(a);let i;e.chain==="solana"?i={type:"solana-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(o=e.owner)!=null?o:void 0}:i={type:"evm-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(m=e.owner)!=null?m:void 0};let t=yield this.apiClient.createWallet(i);if("error"in t)throw new (0, _chunkCT2UGJELcjs.f)(JSON.stringify(t));return this.createWalletInstance(t,e)})}createWalletInstance(e,i){let t=this.toInternalSignerConfig(e,i.signer,i.options);return new (0, _chunkGEEQGXHOcjs.a)({chain:i.chain,address:e.address,owner:e.linkedUser,signer:_chunk5IM7I7EXcjs.a.call(void 0, i.chain,t),options:i.options},this.apiClient)}toInternalSignerConfig(e,i,t){var n,a;if(i==null)throw new (0, _chunkCT2UGJELcjs.f)("Signer is required to create a wallet");switch(i.type){case"api-key":{let r;switch(e.type){case"solana-smart-wallet":r=e.config.adminSigner.address;break;case"evm-smart-wallet":e.config.adminSigner.type==="evm-fireblocks-custodial"&&(r=e.config.adminSigner.address);break}if(r==null)throw new (0, _chunkCT2UGJELcjs.f)("Wallet signer 'api-key' has no address");return{type:"api-key",address:r}}case"external-wallet":return i;case"passkey":if(e.type==="evm-smart-wallet"&&e.config.adminSigner.type==="evm-passkey")return{type:"passkey",id:e.config.adminSigner.id,name:e.config.adminSigner.name,onCreatePasskey:i.onCreatePasskey,onSignWithPasskey:i.onSignWithPasskey};throw new (0, _chunkCT2UGJELcjs.f)("Passkey signer is not supported for this wallet type");case"email":{if(!(e.type==="solana-smart-wallet"&&e.config.adminSigner.type==="solana-keypair"||e.type==="evm-smart-wallet"&&e.config.adminSigner.type==="evm-keypair"))throw new (0, _chunkCT2UGJELcjs.f)("Wallet signer 'email' has no address");let r=e.config.adminSigner.address;return{type:"email",email:(a=i.email)!=null?a:(n=this.apiClient.crossmint.experimental_customAuth)==null?void 0:n.email,signerAddress:r,crossmint:this.apiClient.crossmint,onAuthRequired:i.onAuthRequired,clientTEEConnection:t==null?void 0:t.clientTEEConnection}}default:throw new Error("Invalid signer type")}}configureSigner(e,i){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var t;if((i==null?void 0:i.type)==="passkey"){let n=(t=i.name)!=null?t:`Crossmint Wallet ${Date.now()}`,a=i.onCreatePasskey?yield i.onCreatePasskey(n):yield _ox.WebAuthnP256.createCredential({name:n});return{type:"evm-passkey",id:a.id,name:n,publicKey:{x:a.publicKey.x.toString(),y:a.publicKey.y.toString()}}}return yield this.toExternalSignerConfig(e,i)})}toExternalSignerConfig(e,i,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var n,a;if(!i||i.type==="api-key")return{type:e==="solana"?"solana-fireblocks-custodial":"evm-fireblocks-custodial"};if(i.type==="external-wallet")return{type:e==="solana"?"solana-keypair":"evm-keypair",address:i.address};if(i.type==="passkey"&&t!=null){if((t==null?void 0:t.type)!=="evm-smart-wallet"||t.config.adminSigner.type!=="evm-passkey")throw new (0, _chunkCT2UGJELcjs.f)("Passkey signer is not supported for this wallet type");return{type:"evm-passkey",id:t.config.adminSigner.id,name:t.config.adminSigner.name,publicKey:{x:t.config.adminSigner.publicKey.x,y:t.config.adminSigner.publicKey.y}}}if(i.type==="email"){let r=(a=i.email)!=null?a:(n=this.apiClient.crossmint.experimental_customAuth)==null?void 0:n.email;if(r==null)throw new Error("Email is required to create a wallet with email signer");if(e==="solana")return{type:"solana-keypair",address:yield _chunkUMX5PW5Pcjs.a.pregenerateSigner(r,this.apiClient.crossmint)};if(_commonsdkbase.isEVMBlockchain.call(void 0, e))return{type:"evm-keypair",address:yield _chunkNGODR2AAcjs.a.pregenerateSigner(r,this.apiClient.crossmint)}}throw new Error("Invalid signer type")})}validateWalletConfig(e,i){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(i.owner!=null&&e.linkedUser!=null&&i.owner!==e.linkedUser)throw new (0, _chunkCT2UGJELcjs.f)("Wallet owner does not match existing wallet's linked user");if(e.type!=="solana-smart-wallet"&&e.type!=="evm-smart-wallet")return;let t=yield this.toExternalSignerConfig(i.chain,i.signer,e),n=e.config.adminSigner;if(t&&n){if(t.type!==n.type)throw new (0, _chunkCT2UGJELcjs.f)("The wallet signer type provided in the wallet config does not match the existing wallet's adminSigner type");_chunkRD5PG4M6cjs.a.call(void 0, t,n)}})}};exports.a = h;
@@ -1 +1 @@
1
- import{a as g}from"./chunk-IZGS2VHO.js";import{a,b as c}from"./chunk-7KHMZPZO.js";import{f as s}from"./chunk-BW7YYVZE.js";import{Address as y,PublicKey as l,PersonalMessage as m}from"ox";import{isHex as d,toHex as h}from"viem";var p=class u extends a{constructor(e){super(e)}locator(){return`evm-keypair:${this.config.signerAddress}`}signMessage(e){return s(this,null,function*(){let t=d(e)?e:h(e),n=m.getSignPayload(t);return yield this.sign(n)})}signTransaction(e){return s(this,null,function*(){return yield this.sign(e)})}sign(e){return s(this,null,function*(){var i;yield this.handleAuthRequired();let t=this.getJwtOrThrow(),n=e.replace("0x",""),r=yield(i=this.config.clientTEEConnection)==null?void 0:i.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:t,apiKey:this.config.crossmint.apiKey},data:{keyType:"secp256k1",bytes:n,encoding:"hex"}},options:c});if((r==null?void 0:r.status)==="error")throw new Error(r.error);if((r==null?void 0:r.signature)==null)throw new Error("Failed to sign transaction");return u.verifyPublicKeyFormat(r.publicKey),{signature:r.signature.bytes}})}static pregenerateSigner(e,t){return s(this,null,function*(){var r;let n=e!=null?e:(r=t.experimental_customAuth)==null?void 0:r.email;if(n==null)throw new Error("Email is required to pregenerate a signer");try{let o=(yield new g(t).pregenerateSigner(n,"secp256k1")).publicKey;return this.verifyPublicKeyFormat(o),this.publicKeyToEvmAddress(o.bytes)}catch(i){throw console.error("[EvmEmailSigner] Failed to pregenerate signer:",i),i}})}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))}static publicKeyToEvmAddress(e){let t=l.from(`0x${e}`);return y.fromPublicKey(t,{checksum:!0})}};export{p as a};
1
+ import{a as g}from"./chunk-PHIPQLW2.js";import{a,b as c}from"./chunk-7KHMZPZO.js";import{f as s}from"./chunk-BW7YYVZE.js";import{Address as y,PublicKey as l,PersonalMessage as m}from"ox";import{isHex as d,toHex as h}from"viem";var p=class u extends a{constructor(e){super(e)}locator(){return`evm-keypair:${this.config.signerAddress}`}signMessage(e){return s(this,null,function*(){let t=d(e)?e:h(e),n=m.getSignPayload(t);return yield this.sign(n)})}signTransaction(e){return s(this,null,function*(){return yield this.sign(e)})}sign(e){return s(this,null,function*(){var i;yield this.handleAuthRequired();let t=this.getJwtOrThrow(),n=e.replace("0x",""),r=yield(i=this.config.clientTEEConnection)==null?void 0:i.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:t,apiKey:this.config.crossmint.apiKey},data:{keyType:"secp256k1",bytes:n,encoding:"hex"}},options:c});if((r==null?void 0:r.status)==="error")throw new Error(r.error);if((r==null?void 0:r.signature)==null)throw new Error("Failed to sign transaction");return u.verifyPublicKeyFormat(r.publicKey),{signature:r.signature.bytes}})}static pregenerateSigner(e,t){return s(this,null,function*(){var r;let n=e!=null?e:(r=t.experimental_customAuth)==null?void 0:r.email;if(n==null)throw new Error("Email is required to pregenerate a signer");try{let o=(yield new g(t).pregenerateSigner(n,"secp256k1")).publicKey;return this.verifyPublicKeyFormat(o),this.publicKeyToEvmAddress(o.bytes)}catch(i){throw console.error("[EvmEmailSigner] Failed to pregenerate signer:",i),i}})}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))}static publicKeyToEvmAddress(e){let t=l.from(`0x${e}`);return y.fromPublicKey(t,{checksum:!0})}};export{p as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var s="@crossmint/wallets-sdk",t="0.10.8";var p="WALLETS_SDK",c= exports.b =t,r= exports.c =s,d= exports.d =500;exports.a = p; exports.b = c; exports.c = r; exports.d = d;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var s="@crossmint/wallets-sdk",t="0.10.9";var p="WALLETS_SDK",c= exports.b =t,r= exports.c =s,d= exports.d =500;exports.a = p; exports.b = c; exports.c = r; exports.d = d;
@@ -1 +1 @@
1
- import{a as c}from"./chunk-424EIRNB.js";import{a as C}from"./chunk-QNBRYCK7.js";import{a as d}from"./chunk-UPTOMSKW.js";import{a as y}from"./chunk-A6ZBW2VA.js";import{a as f}from"./chunk-FUUYGB4K.js";import{d as m,f as s}from"./chunk-7ENJXL4H.js";import{f as l}from"./chunk-BW7YYVZE.js";import{WebAuthnP256 as h}from"ox";import{isEVMBlockchain as u}from"@crossmint/common-sdk-base";var g=class{constructor(e){this.apiClient=e}getOrCreateWallet(e){return l(this,null,function*(){if(this.apiClient.isServerSide)throw new s("getOrCreateWallet is not supported on server side");let i=yield this.apiClient.getWallet(`me:${e.chain==="solana"?"solana-smart-wallet":"evm-smart-wallet"}`);return i&&!("error"in i)?(yield this.validateWalletConfig(i,e),this.createWalletInstance(i,e)):this.createWallet(e)})}getWallet(e,i){return l(this,null,function*(){if(!this.apiClient.isServerSide)throw new s("getWallet is not supported on client side, use getOrCreateWallet instead");let t=yield this.apiClient.getWallet(e);if("error"in t)throw new m(JSON.stringify(t));return this.createWalletInstance(t,i)})}createWallet(e){return l(this,null,function*(){var n,a,r,o,p;yield(r=(a=(n=e.options)==null?void 0:n.experimental_callbacks)==null?void 0:a.onWalletCreationStart)==null?void 0:r.call(a);let i;e.chain==="solana"?i={type:"solana-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(o=e.owner)!=null?o:void 0}:i={type:"evm-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(p=e.owner)!=null?p:void 0};let t=yield this.apiClient.createWallet(i);if("error"in t)throw new s(JSON.stringify(t));return this.createWalletInstance(t,e)})}createWalletInstance(e,i){let t=this.toInternalSignerConfig(e,i.signer,i.options);return new c({chain:i.chain,address:e.address,owner:e.linkedUser,signer:C(i.chain,t),options:i.options},this.apiClient)}toInternalSignerConfig(e,i,t){var n,a;if(i==null)throw new s("Signer is required to create a wallet");switch(i.type){case"api-key":{let r;switch(e.type){case"solana-smart-wallet":r=e.config.adminSigner.address;break;case"evm-smart-wallet":e.config.adminSigner.type==="evm-fireblocks-custodial"&&(r=e.config.adminSigner.address);break}if(r==null)throw new s("Wallet signer 'api-key' has no address");return{type:"api-key",address:r}}case"external-wallet":return i;case"passkey":if(e.type==="evm-smart-wallet"&&e.config.adminSigner.type==="evm-passkey")return{type:"passkey",id:e.config.adminSigner.id,name:e.config.adminSigner.name,onCreatePasskey:i.onCreatePasskey,onSignWithPasskey:i.onSignWithPasskey};throw new s("Passkey signer is not supported for this wallet type");case"email":{if(!(e.type==="solana-smart-wallet"&&e.config.adminSigner.type==="solana-keypair"||e.type==="evm-smart-wallet"&&e.config.adminSigner.type==="evm-keypair"))throw new s("Wallet signer 'email' has no address");let r=e.config.adminSigner.address;return{type:"email",email:(a=i.email)!=null?a:(n=this.apiClient.crossmint.experimental_customAuth)==null?void 0:n.email,signerAddress:r,crossmint:this.apiClient.crossmint,onAuthRequired:i.onAuthRequired,clientTEEConnection:t==null?void 0:t.clientTEEConnection}}default:throw new Error("Invalid signer type")}}configureSigner(e,i){return l(this,null,function*(){var t;if((i==null?void 0:i.type)==="passkey"){let n=(t=i.name)!=null?t:`Crossmint Wallet ${Date.now()}`,a=i.onCreatePasskey?yield i.onCreatePasskey(n):yield h.createCredential({name:n});return{type:"evm-passkey",id:a.id,name:n,publicKey:{x:a.publicKey.x.toString(),y:a.publicKey.y.toString()}}}return yield this.toExternalSignerConfig(e,i)})}toExternalSignerConfig(e,i,t){return l(this,null,function*(){var n,a;if(!i||i.type==="api-key")return{type:e==="solana"?"solana-fireblocks-custodial":"evm-fireblocks-custodial"};if(i.type==="external-wallet")return{type:e==="solana"?"solana-keypair":"evm-keypair",address:i.address};if(i.type==="passkey"&&t!=null){if((t==null?void 0:t.type)!=="evm-smart-wallet"||t.config.adminSigner.type!=="evm-passkey")throw new s("Passkey signer is not supported for this wallet type");return{type:"evm-passkey",id:t.config.adminSigner.id,name:t.config.adminSigner.name,publicKey:{x:t.config.adminSigner.publicKey.x,y:t.config.adminSigner.publicKey.y}}}if(i.type==="email"){let r=(a=i.email)!=null?a:(n=this.apiClient.crossmint.experimental_customAuth)==null?void 0:n.email;if(r==null)throw new Error("Email is required to create a wallet with email signer");if(e==="solana")return{type:"solana-keypair",address:yield d.pregenerateSigner(r,this.apiClient.crossmint)};if(u(e))return{type:"evm-keypair",address:yield y.pregenerateSigner(r,this.apiClient.crossmint)}}throw new Error("Invalid signer type")})}validateWalletConfig(e,i){return l(this,null,function*(){if(i.owner!=null&&e.linkedUser!=null&&i.owner!==e.linkedUser)throw new s("Wallet owner does not match existing wallet's linked user");if(e.type!=="solana-smart-wallet"&&e.type!=="evm-smart-wallet")return;let t=yield this.toExternalSignerConfig(i.chain,i.signer,e),n=e.config.adminSigner;if(t&&n){if(t.type!==n.type)throw new s("The wallet signer type provided in the wallet config does not match the existing wallet's adminSigner type");f(t,n)}})}};export{g as a};
1
+ import{a as p}from"./chunk-5XUQSU22.js";import{a as f}from"./chunk-CTZE2MXB.js";import{a as d}from"./chunk-RSM6MX6W.js";import{a as y}from"./chunk-6YFK33UZ.js";import{a as C}from"./chunk-FUUYGB4K.js";import{d as c,f as s}from"./chunk-7ENJXL4H.js";import{f as l}from"./chunk-BW7YYVZE.js";import{WebAuthnP256 as g}from"ox";import{isEVMBlockchain as u}from"@crossmint/common-sdk-base";var h=class{constructor(e){this.apiClient=e}getOrCreateWallet(e){return l(this,null,function*(){if(this.apiClient.isServerSide)throw new s("getOrCreateWallet is not supported on server side");let i=yield this.apiClient.getWallet(`me:${e.chain==="solana"?"solana-smart-wallet":"evm-smart-wallet"}`);return i&&!("error"in i)?(yield this.validateWalletConfig(i,e),this.createWalletInstance(i,e)):this.createWallet(e)})}getWallet(e,i){return l(this,null,function*(){if(!this.apiClient.isServerSide)throw new s("getWallet is not supported on client side, use getOrCreateWallet instead");let t=yield this.apiClient.getWallet(e);if("error"in t)throw new c(JSON.stringify(t));return this.createWalletInstance(t,i)})}createWallet(e){return l(this,null,function*(){var n,a,r,o,m;yield(r=(a=(n=e.options)==null?void 0:n.experimental_callbacks)==null?void 0:a.onWalletCreationStart)==null?void 0:r.call(a);let i;e.chain==="solana"?i={type:"solana-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(o=e.owner)!=null?o:void 0}:i={type:"evm-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(m=e.owner)!=null?m:void 0};let t=yield this.apiClient.createWallet(i);if("error"in t)throw new s(JSON.stringify(t));return this.createWalletInstance(t,e)})}createWalletInstance(e,i){let t=this.toInternalSignerConfig(e,i.signer,i.options);return new p({chain:i.chain,address:e.address,owner:e.linkedUser,signer:f(i.chain,t),options:i.options},this.apiClient)}toInternalSignerConfig(e,i,t){var n,a;if(i==null)throw new s("Signer is required to create a wallet");switch(i.type){case"api-key":{let r;switch(e.type){case"solana-smart-wallet":r=e.config.adminSigner.address;break;case"evm-smart-wallet":e.config.adminSigner.type==="evm-fireblocks-custodial"&&(r=e.config.adminSigner.address);break}if(r==null)throw new s("Wallet signer 'api-key' has no address");return{type:"api-key",address:r}}case"external-wallet":return i;case"passkey":if(e.type==="evm-smart-wallet"&&e.config.adminSigner.type==="evm-passkey")return{type:"passkey",id:e.config.adminSigner.id,name:e.config.adminSigner.name,onCreatePasskey:i.onCreatePasskey,onSignWithPasskey:i.onSignWithPasskey};throw new s("Passkey signer is not supported for this wallet type");case"email":{if(!(e.type==="solana-smart-wallet"&&e.config.adminSigner.type==="solana-keypair"||e.type==="evm-smart-wallet"&&e.config.adminSigner.type==="evm-keypair"))throw new s("Wallet signer 'email' has no address");let r=e.config.adminSigner.address;return{type:"email",email:(a=i.email)!=null?a:(n=this.apiClient.crossmint.experimental_customAuth)==null?void 0:n.email,signerAddress:r,crossmint:this.apiClient.crossmint,onAuthRequired:i.onAuthRequired,clientTEEConnection:t==null?void 0:t.clientTEEConnection}}default:throw new Error("Invalid signer type")}}configureSigner(e,i){return l(this,null,function*(){var t;if((i==null?void 0:i.type)==="passkey"){let n=(t=i.name)!=null?t:`Crossmint Wallet ${Date.now()}`,a=i.onCreatePasskey?yield i.onCreatePasskey(n):yield g.createCredential({name:n});return{type:"evm-passkey",id:a.id,name:n,publicKey:{x:a.publicKey.x.toString(),y:a.publicKey.y.toString()}}}return yield this.toExternalSignerConfig(e,i)})}toExternalSignerConfig(e,i,t){return l(this,null,function*(){var n,a;if(!i||i.type==="api-key")return{type:e==="solana"?"solana-fireblocks-custodial":"evm-fireblocks-custodial"};if(i.type==="external-wallet")return{type:e==="solana"?"solana-keypair":"evm-keypair",address:i.address};if(i.type==="passkey"&&t!=null){if((t==null?void 0:t.type)!=="evm-smart-wallet"||t.config.adminSigner.type!=="evm-passkey")throw new s("Passkey signer is not supported for this wallet type");return{type:"evm-passkey",id:t.config.adminSigner.id,name:t.config.adminSigner.name,publicKey:{x:t.config.adminSigner.publicKey.x,y:t.config.adminSigner.publicKey.y}}}if(i.type==="email"){let r=(a=i.email)!=null?a:(n=this.apiClient.crossmint.experimental_customAuth)==null?void 0:n.email;if(r==null)throw new Error("Email is required to create a wallet with email signer");if(e==="solana")return{type:"solana-keypair",address:yield d.pregenerateSigner(r,this.apiClient.crossmint)};if(u(e))return{type:"evm-keypair",address:yield y.pregenerateSigner(r,this.apiClient.crossmint)}}throw new Error("Invalid signer type")})}validateWalletConfig(e,i){return l(this,null,function*(){if(i.owner!=null&&e.linkedUser!=null&&i.owner!==e.linkedUser)throw new s("Wallet owner does not match existing wallet's linked user");if(e.type!=="solana-smart-wallet"&&e.type!=="evm-smart-wallet")return;let t=yield this.toExternalSignerConfig(i.chain,i.signer,e),n=e.config.adminSigner;if(t&&n){if(t.type!==n.type)throw new s("The wallet signer type provided in the wallet config does not match the existing wallet's adminSigner type");C(t,n)}})}};export{h as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGEEQGXHOcjs = require('./chunk-GEEQGXHO.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunk6VJEBYPNcjs = require('./chunk-6VJEBYPN.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _viem = require('viem');var _commonsdkbase = require('@crossmint/common-sdk-base');var w=class C extends _chunkGEEQGXHOcjs.a{constructor(t){super({chain:t.chain,address:t.address,owner:t.owner,signer:t.signer,options:_chunkGEEQGXHOcjs.a.getOptions(t)},_chunkGEEQGXHOcjs.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 C(t)}sendTransaction(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var e;let n=this.buildTransaction(t),a=yield this.createTransaction(n);return(e=t.options)!=null&&e.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:a.id}:yield this.approveAndWait(a.id)})}signMessage(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i;let n=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-message",params:{message:t,signer:this.signer.locator(),chain:this.chain}});if("error"in n)throw new (0, _chunkCT2UGJELcjs.o)(JSON.stringify(n));let a=n.id,e=((i=n.approvals)==null?void 0:i.pending)||[];return yield this.approveSignature(e,a),yield this.waitForSignature(a)})}signTypedData(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var m;let{domain:n,message:a,primaryType:e,types:i,chain:r}=t;if(!n||!a||!i||!r)throw new (0, _chunkCT2UGJELcjs.k)("Invalid typed data");let{name:u,version:l,chainId:h,verifyingContract:y,salt:v}=n;if(!u||!l||!h||!y)throw new (0, _chunkCT2UGJELcjs.k)("Invalid typed data domain");let s=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-typed-data",params:{typedData:{domain:{name:u,version:l,chainId:Number(h),verifyingContract:y,salt:v},message:a,primaryType:e,types:i},signer:this.signer.locator(),chain:r,isSmartWalletSignature:!1}});if("error"in s)throw new (0, _chunkCT2UGJELcjs.o)(JSON.stringify(s));let g=s.id,D=((m=s.approvals)==null?void 0:m.pending)||[];return yield this.approveSignature(D,g),yield this.waitForSignature(g)})}getViemClient(t){var n;return _viem.createPublicClient.call(void 0, {transport:(n=t==null?void 0:t.transport)!=null?n:_viem.http.call(void 0, ),chain:_chunk6VJEBYPNcjs.a.call(void 0, this.chain)})}createTransaction(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let n=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:this.signer.locator(),chain:this.chain,calls:[t]}});if("error"in n)throw new (0, _chunkCT2UGJELcjs.q)(JSON.stringify(n));return n})}buildTransaction(t){var n,a,e,i,r;if("transaction"in t)return{transaction:t.transaction};if(t.abi==null)return{to:t.to,value:(a=(n=t.value)==null?void 0:n.toString())!=null?a:"0",data:(e=t.data)!=null?e:"0x"};if(!t.functionName)throw new Error("Function name is required");return{to:t.to,value:(r=(i=t.value)==null?void 0:i.toString())!=null?r:"0",data:_viem.encodeFunctionData.call(void 0, {abi:t.abi,functionName:t.functionName,args:t.args})}}};exports.a = w;
@@ -1 +1 @@
1
- import{a as n}from"./chunk-UPTOMSKW.js";import{a}from"./chunk-A6ZBW2VA.js";import{a as l}from"./chunk-OV4CFQ36.js";import{a as m}from"./chunk-77QBSFHG.js";import{a as t}from"./chunk-T3ICQDFS.js";import{a as o}from"./chunk-2KK65AC6.js";import{a as i}from"./chunk-QTSZSHKK.js";function x(r,e){switch(e.type){case"email":return r==="solana"?new n(e):new a(e);case"api-key":return r==="solana"?new m(e):new o(e);case"external-wallet":return r==="solana"?new t(e):new i(e);case"passkey":return new l(e)}}export{x as a};
1
+ import{a as n}from"./chunk-RSM6MX6W.js";import{a}from"./chunk-6YFK33UZ.js";import{a as l}from"./chunk-OV4CFQ36.js";import{a as m}from"./chunk-77QBSFHG.js";import{a as t}from"./chunk-T3ICQDFS.js";import{a as o}from"./chunk-2KK65AC6.js";import{a as i}from"./chunk-QTSZSHKK.js";function x(r,e){switch(e.type){case"email":return r==="solana"?new n(e):new a(e);case"api-key":return r==="solana"?new m(e):new o(e);case"external-wallet":return r==="solana"?new t(e):new i(e);case"passkey":return new l(e)}}export{x as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkEJSIN53Lcjs = require('./chunk-EJSIN53L.cjs');var _chunkEV4AUN33cjs = require('./chunk-EV4AUN33.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var i=class o{constructor(t){let r=new (0, _chunkEV4AUN33cjs.a)(t);this.walletFactory=new (0, _chunkEJSIN53Lcjs.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
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6DVCB4VIcjs = require('./chunk-6DVCB4VI.cjs');var _chunk5HBL6I5Vcjs = require('./chunk-5HBL6I5V.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var i=class o{constructor(t){let r=new (0, _chunk5HBL6I5Vcjs.a)(t);this.walletFactory=new (0, _chunk6DVCB4VIcjs.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;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkAHG6IQT7cjs = require('./chunk-AHG6IQT7.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var f,c,I= exports.a =class{constructor(t,e){_chunkXALFCQKDcjs.d.call(void 0, this,f);_chunkXALFCQKDcjs.d.call(void 0, this,c);let{chain:n,address:i,owner:a,signer:r,options:d}=t;_chunkXALFCQKDcjs.e.call(void 0, this,c,e),this.chain=n,this.address=i,this.owner=a,this.signer=r,_chunkXALFCQKDcjs.e.call(void 0, this,f,d)}static getApiClient(t){return t.apiClient}static getOptions(t){return t.options}get apiClient(){return _chunkXALFCQKDcjs.c.call(void 0, this,c)}get options(){return _chunkXALFCQKDcjs.c.call(void 0, this,f)}balances(t,e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let n=this.chain==="solana"?"sol":"eth",i=[n,"usdc",...t!=null?t:[]],a=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getBalance(this.address,{chains:e!=null?e:[this.chain],tokens:i.map(r=>r.toLowerCase())});if("error"in a)throw new Error(`Failed to get balances for wallet: ${JSON.stringify(a.message)}`);return this.transformBalanceResponse(a,n,t)})}transformBalanceResponse(t,e,n){let i=s=>{var w,m,y;let g,h=(w=s.forChain)==null?void 0:w[this.chain];return h&&"contractAddress"in h&&(g=h.contractAddress),{symbol:s.token,name:s.token,amount:(m=s.amount)!=null?m:"0",contractAddress:g,decimals:s.decimals,rawAmount:(y=s.rawAmount)!=null?y:"0"}},a=t.find(s=>s.token===e||s.token.toLowerCase().includes(e)),r=t.find(s=>s.token.toLowerCase().includes("usdc")),d=t.filter(s=>{let g=s.token.toLowerCase();return!g.includes(e)&&!g.includes("usdc")&&(n==null?void 0:n.some(h=>g.includes(h.toLowerCase())))}),o=s=>({symbol:s,name:s,amount:"0",contractAddress:void 0,decimals:0,rawAmount:"0"});return{nativeToken:a!=null?i(a):o(e),usdc:r!=null?i(r):o("usdc"),tokens:d.map(i)}}experimental_nfts(t){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, {},t),{chain:this.chain,address:this.address}))})}experimental_transactions(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getTransactions(this.walletLocator)})}experimental_activity(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=yield this.apiClient.experimental_activity(this.walletLocator,{chain:this.chain});if("error"in t)throw new Error(`Failed to get activity: ${JSON.stringify(t.message)}`);return t})}send(t,e,n,i){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let a=G(t),r=R(e,this.chain),d={recipient:a,amount:n},o=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).send(this.walletLocator,r,d);if("message"in o)throw new (0, _chunkCT2UGJELcjs.q)(`Failed to send token: ${JSON.stringify(o.message)}`);return i!=null&&i.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:o.id}:yield this.approveAndWait(o.id)})}addDelegatedSigner(e){return _chunkXALFCQKDcjs.f.call(void 0, this,arguments,function*({signer:t}){var i,a;let n=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).registerSigner(this.walletLocator,{signer:t,chain:this.chain==="solana"?void 0:this.chain});if("error"in n)throw new Error(`Failed to register signer: ${JSON.stringify(n.message)}`);if("transaction"in n){let r=n.transaction.id;yield this.approveAndWait(r)}else{let r=(i=n.chains)==null?void 0:i[this.chain];if((r==null?void 0:r.status)==="awaiting-approval"){let d=((a=r.approvals)==null?void 0:a.pending)||[];yield this.approveSignature(d,r.id),yield this.waitForSignature(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 e,n,i;let t=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getWallet(this.walletLocator);if("error"in t)throw new (0, _chunkCT2UGJELcjs.d)(JSON.stringify(t));if(t.type!=="solana-smart-wallet"&&t.type!=="evm-smart-wallet")throw new (0, _chunkCT2UGJELcjs.c)(`Wallet type ${t.type} not supported`);return(i=(n=(e=t==null?void 0:t.config)==null?void 0:e.delegatedSigners)==null?void 0:n.map(a=>{let r=a.locator.indexOf(":");return{signer:`external-wallet:${r>=0?a.locator.slice(r+1):a.locator}`}}))!=null?i:[]})}get walletLocator(){return _chunkXALFCQKDcjs.c.call(void 0, this,c).isServerSide?this.address:`me:${this.isSolanaWallet?"solana-smart-wallet":"evm-smart-wallet"}`}get isSolanaWallet(){return this.chain==="solana"}approveAndWait(t,e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.approveTransaction(t,e),yield this.sleep(1e3),yield this.waitForTransaction(t)})}approveTransaction(t,e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var o,s,g,h;let n=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getTransaction(this.walletLocator,t);if(n.error)throw new (0, _chunkCT2UGJELcjs.r)(JSON.stringify(n));if(yield(g=(s=(o=_chunkXALFCQKDcjs.c.call(void 0, this,f))==null?void 0:o.experimental_callbacks)==null?void 0:s.onTransactionStart)==null?void 0:g.call(s),this.signer.type==="api-key")return n;let i=(h=n.approvals)==null?void 0:h.pending;if(i==null)return n;let a=[...e!=null?e:[],this.signer],r=yield Promise.all(i.map(w=>{let m=a.find(k=>k.locator()===w.signer);if(m==null)throw new (0, _chunkCT2UGJELcjs.i)(`Signer ${w.signer} not found in pending approvals`);let y=n.walletType==="solana-smart-wallet"?n.onChain.transaction:w.message;return m.signTransaction(y)})),d=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).approveTransaction(this.walletLocator,n.id,{approvals:r.map(w=>_chunkXALFCQKDcjs.a.call(void 0, {signer:this.signer.locator()},w))});if(d.error)throw new (0, _chunkCT2UGJELcjs.w)(JSON.stringify(d));return d})}approveSignature(t,e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.isSolanaWallet)throw new Error("Approving signatures is only supported for EVM smart wallets");let n=t.find(a=>a.signer===this.signer.locator());if(!n)throw new (0, _chunkCT2UGJELcjs.i)(`Signer ${this.signer.locator()} not found in pending approvals`);let i=yield this.signer.signMessage(n.message);return yield _chunkXALFCQKDcjs.c.call(void 0, this,c).approveSignature(this.walletLocator,e,{approvals:[_chunkXALFCQKDcjs.a.call(void 0, {signer:this.signer.locator()},i)]}),i})}waitForSignature(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let e=null;do if(yield new Promise(n=>setTimeout(n,_chunkAHG6IQT7cjs.d)),e=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getSignature(this.walletLocator,t),"error"in e)throw new (0, _chunkCT2UGJELcjs.p)(JSON.stringify(e));while(e===null||e.status==="pending");if(e.status==="failed")throw new (0, _chunkCT2UGJELcjs.m)("Signature signing failed");if(!e.outputSignature)throw new (0, _chunkCT2UGJELcjs.p)("Signature not available");return e.outputSignature})}waitForTransaction(r){return _chunkXALFCQKDcjs.f.call(void 0, this,arguments,function*(t,e=6e4,{backoffMultiplier:n=1.1,maxBackoffMs:i=2e3,initialBackoffMs:a=_chunkAHG6IQT7cjs.d}={}){var g;let d=Date.now(),o;do{if(Date.now()-d>e)throw new (0, _chunkCT2UGJELcjs.s)("Transaction confirmation timeout");if(o=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getTransaction(this.walletLocator,t),o.error)throw new (0, _chunkCT2UGJELcjs.r)(JSON.stringify(o));yield this.sleep(a),a=Math.min(a*n,i)}while(o.status==="pending");if(o.status==="failed")throw new (0, _chunkCT2UGJELcjs.t)(`Transaction sending failed: ${JSON.stringify(o.error)}`);if(o.status==="awaiting-approval")throw new (0, _chunkCT2UGJELcjs.u)("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let s=o.onChain.txId;if(s==null)throw new (0, _chunkCT2UGJELcjs.v)("Transaction hash not found on transaction response");return{hash:s,explorerLink:(g=o.onChain.explorerLink)!=null?g:"",transactionId:o.id}})}sleep(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return new Promise(e=>setTimeout(e,t))})}};f=new WeakMap,c=new WeakMap;function G(l){if(typeof l=="string")return l;if("email"in l)return`email:${l.email}`;if("x"in l)return`x:${l.x}`;if("twitter"in l)return`twitter:${l.twitter}`;if("phone"in l)return`phoneNumber:${l.phone}`;if("userId"in l)return`userId:${l.userId}`;throw new Error("Invalid recipient locator")}function R(l,t){return _commonsdkbase.isValidAddress.call(void 0, l)?`${t}:${l}`:`${t}:${l.toLowerCase()}`}exports.a = I;
@@ -1 +1 @@
1
- import{a as l}from"./chunk-VEKXBWC5.js";import{a}from"./chunk-SN3LCVYC.js";import{f as e}from"./chunk-BW7YYVZE.js";import{createCrossmint as C}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{C as a,i as b};
1
+ import{a as l}from"./chunk-C7GUSH3M.js";import{a}from"./chunk-36Z3WOLW.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};
@@ -0,0 +1 @@
1
+ import{a as p}from"./chunk-5XUQSU22.js";import{k as c,o as d,q as T}from"./chunk-7ENJXL4H.js";import{a as f}from"./chunk-BJDS5BJG.js";import{f as o}from"./chunk-BW7YYVZE.js";import{createPublicClient as E,encodeFunctionData as S,http as V}from"viem";import{isValidEvmAddress as M}from"@crossmint/common-sdk-base";var w=class C extends p{constructor(t){super({chain:t.chain,address:t.address,owner:t.owner,signer:t.signer,options:p.getOptions(t)},p.getApiClient(t))}static from(t){if(!M(t.address))throw new Error("Wallet is not an EVM wallet");return new C(t)}sendTransaction(t){return o(this,null,function*(){var e;let n=this.buildTransaction(t),a=yield this.createTransaction(n);return(e=t.options)!=null&&e.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:a.id}:yield this.approveAndWait(a.id)})}signMessage(t){return o(this,null,function*(){var i;let n=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-message",params:{message:t,signer:this.signer.locator(),chain:this.chain}});if("error"in n)throw new d(JSON.stringify(n));let a=n.id,e=((i=n.approvals)==null?void 0:i.pending)||[];return yield this.approveSignature(e,a),yield this.waitForSignature(a)})}signTypedData(t){return o(this,null,function*(){var m;let{domain:n,message:a,primaryType:e,types:i,chain:r}=t;if(!n||!a||!i||!r)throw new c("Invalid typed data");let{name:u,version:l,chainId:h,verifyingContract:y,salt:v}=n;if(!u||!l||!h||!y)throw new c("Invalid typed data domain");let s=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-typed-data",params:{typedData:{domain:{name:u,version:l,chainId:Number(h),verifyingContract:y,salt:v},message:a,primaryType:e,types:i},signer:this.signer.locator(),chain:r,isSmartWalletSignature:!1}});if("error"in s)throw new d(JSON.stringify(s));let g=s.id,D=((m=s.approvals)==null?void 0:m.pending)||[];return yield this.approveSignature(D,g),yield this.waitForSignature(g)})}getViemClient(t){var n;return E({transport:(n=t==null?void 0:t.transport)!=null?n:V(),chain:f(this.chain)})}createTransaction(t){return o(this,null,function*(){let n=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:this.signer.locator(),chain:this.chain,calls:[t]}});if("error"in n)throw new T(JSON.stringify(n));return n})}buildTransaction(t){var n,a,e,i,r;if("transaction"in t)return{transaction:t.transaction};if(t.abi==null)return{to:t.to,value:(a=(n=t.value)==null?void 0:n.toString())!=null?a:"0",data:(e=t.data)!=null?e:"0x"};if(!t.functionName)throw new Error("Function name is required");return{to:t.to,value:(r=(i=t.value)==null?void 0:i.toString())!=null?r:"0",data:S({abi:t.abi,functionName:t.functionName,args:t.args})}}};export{w as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNKUDWDSHcjs = require('./chunk-NKUDWDSH.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var o=class extends _commonsdkbase.CrossmintApiClient{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:_chunkNKUDWDSHcjs.c,version:_chunkNKUDWDSHcjs.b}}});this.apiPrefix="api/v1/signers"}pregenerateSigner(e,a){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=yield this.post(`${this.apiPrefix}/derive-public-key`,{body:JSON.stringify({authId:`email:${e}`,keyType:a}),headers:this.headers});if(!r.ok){let p=yield r.text();throw new Error(`Failed to fetch public key: ${r.status} ${p}`)}return yield r.json()})}get isServerSide(){return this.parsedAPIKey.usageOrigin===_commonsdkbase.APIKeyUsageOrigin.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new (0, _chunkCT2UGJELcjs.a)("Invalid API key");return this.parsedAPIKey.environment}get headers(){return{"Content-Type":"application/json"}}};exports.a = o;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkAHG6IQT7cjs = require('./chunk-AHG6IQT7.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var o=class extends _commonsdkbase.CrossmintApiClient{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:_chunkAHG6IQT7cjs.c,version:_chunkAHG6IQT7cjs.b}}});this.apiPrefix="api/v1/signers"}pregenerateSigner(e,a){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=yield this.post(`${this.apiPrefix}/derive-public-key`,{body:JSON.stringify({authId:`email:${e}`,keyType:a}),headers:this.headers});if(!r.ok){let p=yield r.text();throw new Error(`Failed to fetch public key: ${r.status} ${p}`)}return yield r.json()})}get isServerSide(){return this.parsedAPIKey.usageOrigin===_commonsdkbase.APIKeyUsageOrigin.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new (0, _chunkCT2UGJELcjs.a)("Invalid API key");return this.parsedAPIKey.environment}get headers(){return{"Content-Type":"application/json"}}};exports.a = o;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk4BJMFWAYcjs = require('./chunk-4BJMFWAY.cjs');var _chunkNWOKSI3Vcjs = require('./chunk-NWOKSI3V.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _ox = require('ox');var _viem = require('viem');var p=class u extends _chunkNWOKSI3Vcjs.a{constructor(e){super(e)}locator(){return`evm-keypair:${this.config.signerAddress}`}signMessage(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=_viem.isHex.call(void 0, e)?e:_viem.toHex.call(void 0, e),n=_ox.PersonalMessage.getSignPayload(t);return yield this.sign(n)})}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 i;yield this.handleAuthRequired();let t=this.getJwtOrThrow(),n=e.replace("0x",""),r=yield(i=this.config.clientTEEConnection)==null?void 0:i.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:t,apiKey:this.config.crossmint.apiKey},data:{keyType:"secp256k1",bytes:n,encoding:"hex"}},options:_chunkNWOKSI3Vcjs.b});if((r==null?void 0:r.status)==="error")throw new Error(r.error);if((r==null?void 0:r.signature)==null)throw new Error("Failed to sign transaction");return u.verifyPublicKeyFormat(r.publicKey),{signature:r.signature.bytes}})}static pregenerateSigner(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var r;let n=e!=null?e:(r=t.experimental_customAuth)==null?void 0:r.email;if(n==null)throw new Error("Email is required to pregenerate a signer");try{let o=(yield new (0, _chunk4BJMFWAYcjs.a)(t).pregenerateSigner(n,"secp256k1")).publicKey;return this.verifyPublicKeyFormat(o),this.publicKeyToEvmAddress(o.bytes)}catch(i){throw console.error("[EvmEmailSigner] Failed to pregenerate signer:",i),i}})}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))}static publicKeyToEvmAddress(e){let t=_ox.PublicKey.from(`0x${e}`);return _ox.Address.fromPublicKey(t,{checksum:!0})}};exports.a = p;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkMPTRSUNXcjs = require('./chunk-MPTRSUNX.cjs');var _chunkNWOKSI3Vcjs = require('./chunk-NWOKSI3V.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _ox = require('ox');var _viem = require('viem');var p=class u extends _chunkNWOKSI3Vcjs.a{constructor(e){super(e)}locator(){return`evm-keypair:${this.config.signerAddress}`}signMessage(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=_viem.isHex.call(void 0, e)?e:_viem.toHex.call(void 0, e),n=_ox.PersonalMessage.getSignPayload(t);return yield this.sign(n)})}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 i;yield this.handleAuthRequired();let t=this.getJwtOrThrow(),n=e.replace("0x",""),r=yield(i=this.config.clientTEEConnection)==null?void 0:i.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:t,apiKey:this.config.crossmint.apiKey},data:{keyType:"secp256k1",bytes:n,encoding:"hex"}},options:_chunkNWOKSI3Vcjs.b});if((r==null?void 0:r.status)==="error")throw new Error(r.error);if((r==null?void 0:r.signature)==null)throw new Error("Failed to sign transaction");return u.verifyPublicKeyFormat(r.publicKey),{signature:r.signature.bytes}})}static pregenerateSigner(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var r;let n=e!=null?e:(r=t.experimental_customAuth)==null?void 0:r.email;if(n==null)throw new Error("Email is required to pregenerate a signer");try{let o=(yield new (0, _chunkMPTRSUNXcjs.a)(t).pregenerateSigner(n,"secp256k1")).publicKey;return this.verifyPublicKeyFormat(o),this.publicKeyToEvmAddress(o.bytes)}catch(i){throw console.error("[EvmEmailSigner] Failed to pregenerate signer:",i),i}})}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))}static publicKeyToEvmAddress(e){let t=_ox.PublicKey.from(`0x${e}`);return _ox.Address.fromPublicKey(t,{checksum:!0})}};exports.a = p;
@@ -1 +1 @@
1
- import{b as i,c as s}from"./chunk-LURBQMOO.js";import{a as n}from"./chunk-7ENJXL4H.js";import{f as t}from"./chunk-BW7YYVZE.js";import{APIKeyUsageOrigin as d,CrossmintApiClient as y}from"@crossmint/common-sdk-base";var o=class extends y{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:s,version:i}}});this.apiPrefix="api/v1/signers"}pregenerateSigner(e,a){return t(this,null,function*(){let r=yield this.post(`${this.apiPrefix}/derive-public-key`,{body:JSON.stringify({authId:`email:${e}`,keyType:a}),headers:this.headers});if(!r.ok){let p=yield r.text();throw new Error(`Failed to fetch public key: ${r.status} ${p}`)}return yield r.json()})}get isServerSide(){return this.parsedAPIKey.usageOrigin===d.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new n("Invalid API key");return this.parsedAPIKey.environment}get headers(){return{"Content-Type":"application/json"}}};export{o as a};
1
+ import{b as i,c as s}from"./chunk-3KB2VQVH.js";import{a as n}from"./chunk-7ENJXL4H.js";import{f as t}from"./chunk-BW7YYVZE.js";import{APIKeyUsageOrigin as d,CrossmintApiClient as y}from"@crossmint/common-sdk-base";var o=class extends y{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:s,version:i}}});this.apiPrefix="api/v1/signers"}pregenerateSigner(e,a){return t(this,null,function*(){let r=yield this.post(`${this.apiPrefix}/derive-public-key`,{body:JSON.stringify({authId:`email:${e}`,keyType:a}),headers:this.headers});if(!r.ok){let p=yield r.text();throw new Error(`Failed to fetch public key: ${r.status} ${p}`)}return yield r.json()})}get isServerSide(){return this.parsedAPIKey.usageOrigin===d.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new n("Invalid API key");return this.parsedAPIKey.environment}get headers(){return{"Content-Type":"application/json"}}};export{o as a};
@@ -1 +1 @@
1
- import{a as d}from"./chunk-IZGS2VHO.js";import{a as c,b as g}from"./chunk-7KHMZPZO.js";import{f as s}from"./chunk-BW7YYVZE.js";import{VersionedTransaction as y}from"@solana/web3.js";import l from"bs58";var m=class p extends c{constructor(e){super(e)}locator(){return`solana-keypair:${this.config.signerAddress}`}signMessage(){return s(this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for email signer"))})}signTransaction(e){return s(this,null,function*(){var a;yield this.handleAuthRequired();let n=this.getJwtOrThrow(),i=l.decode(e),t=y.deserialize(i).message.serialize(),r=yield(a=this.config.clientTEEConnection)==null?void 0:a.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:n,apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:l.encode(t),encoding:"base58"}},options:g});if((r==null?void 0:r.status)==="error")throw new Error(r.error);if((r==null?void 0:r.signature)==null)throw new Error("Failed to sign transaction");return p.verifyPublicKeyFormat(r.publicKey),{signature:r.signature.bytes}})}static pregenerateSigner(e,n){return s(this,null,function*(){var o;let i=e!=null?e:(o=n.experimental_customAuth)==null?void 0:o.email;if(i==null)throw new Error("Email is required to pregenerate a signer");try{let r=(yield new d(n).pregenerateSigner(i,"ed25519")).publicKey;return this.verifyPublicKeyFormat(r),r.bytes}catch(t){throw console.error("[EmailSigner] Failed to pregenerate signer:",t),t}})}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))}};export{m as a};
1
+ import{a as d}from"./chunk-PHIPQLW2.js";import{a as c,b as g}from"./chunk-7KHMZPZO.js";import{f as s}from"./chunk-BW7YYVZE.js";import{VersionedTransaction as y}from"@solana/web3.js";import l from"bs58";var m=class p extends c{constructor(e){super(e)}locator(){return`solana-keypair:${this.config.signerAddress}`}signMessage(){return s(this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for email signer"))})}signTransaction(e){return s(this,null,function*(){var a;yield this.handleAuthRequired();let n=this.getJwtOrThrow(),i=l.decode(e),t=y.deserialize(i).message.serialize(),r=yield(a=this.config.clientTEEConnection)==null?void 0:a.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:n,apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:l.encode(t),encoding:"base58"}},options:g});if((r==null?void 0:r.status)==="error")throw new Error(r.error);if((r==null?void 0:r.signature)==null)throw new Error("Failed to sign transaction");return p.verifyPublicKeyFormat(r.publicKey),{signature:r.signature.bytes}})}static pregenerateSigner(e,n){return s(this,null,function*(){var o;let i=e!=null?e:(o=n.experimental_customAuth)==null?void 0:o.email;if(i==null)throw new Error("Email is required to pregenerate a signer");try{let r=(yield new d(n).pregenerateSigner(i,"ed25519")).publicKey;return this.verifyPublicKeyFormat(r),r.bytes}catch(t){throw console.error("[EmailSigner] Failed to pregenerate signer:",t),t}})}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))}};export{m as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk4BJMFWAYcjs = require('./chunk-4BJMFWAY.cjs');var _chunkNWOKSI3Vcjs = require('./chunk-NWOKSI3V.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _web3js = require('@solana/web3.js');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var m=class p extends _chunkNWOKSI3Vcjs.a{constructor(e){super(e)}locator(){return`solana-keypair:${this.config.signerAddress}`}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 a;yield this.handleAuthRequired();let n=this.getJwtOrThrow(),i=_bs582.default.decode(e),t=_web3js.VersionedTransaction.deserialize(i).message.serialize(),r=yield(a=this.config.clientTEEConnection)==null?void 0:a.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:n,apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:_bs582.default.encode(t),encoding:"base58"}},options:_chunkNWOKSI3Vcjs.b});if((r==null?void 0:r.status)==="error")throw new Error(r.error);if((r==null?void 0:r.signature)==null)throw new Error("Failed to sign transaction");return p.verifyPublicKeyFormat(r.publicKey),{signature:r.signature.bytes}})}static pregenerateSigner(e,n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var o;let i=e!=null?e:(o=n.experimental_customAuth)==null?void 0:o.email;if(i==null)throw new Error("Email is required to pregenerate a signer");try{let r=(yield new (0, _chunk4BJMFWAYcjs.a)(n).pregenerateSigner(i,"ed25519")).publicKey;return this.verifyPublicKeyFormat(r),r.bytes}catch(t){throw console.error("[EmailSigner] Failed to pregenerate signer:",t),t}})}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))}};exports.a = m;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkMPTRSUNXcjs = require('./chunk-MPTRSUNX.cjs');var _chunkNWOKSI3Vcjs = require('./chunk-NWOKSI3V.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _web3js = require('@solana/web3.js');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var m=class p extends _chunkNWOKSI3Vcjs.a{constructor(e){super(e)}locator(){return`solana-keypair:${this.config.signerAddress}`}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 a;yield this.handleAuthRequired();let n=this.getJwtOrThrow(),i=_bs582.default.decode(e),t=_web3js.VersionedTransaction.deserialize(i).message.serialize(),r=yield(a=this.config.clientTEEConnection)==null?void 0:a.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:n,apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:_bs582.default.encode(t),encoding:"base58"}},options:_chunkNWOKSI3Vcjs.b});if((r==null?void 0:r.status)==="error")throw new Error(r.error);if((r==null?void 0:r.signature)==null)throw new Error("Failed to sign transaction");return p.verifyPublicKeyFormat(r.publicKey),{signature:r.signature.bytes}})}static pregenerateSigner(e,n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var o;let i=e!=null?e:(o=n.experimental_customAuth)==null?void 0:o.email;if(i==null)throw new Error("Email is required to pregenerate a signer");try{let r=(yield new (0, _chunkMPTRSUNXcjs.a)(n).pregenerateSigner(i,"ed25519")).publicKey;return this.verifyPublicKeyFormat(r),r.bytes}catch(t){throw console.error("[EmailSigner] Failed to pregenerate signer:",t),t}})}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))}};exports.a = m;
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk4UVSDKGYcjs = require('./chunk-4UVSDKGY.cjs');var _chunkGIDUQBAXcjs = require('./chunk-GIDUQBAX.cjs');require('./chunk-MHKWLGN5.cjs');var _chunk3L6EVBXAcjs = require('./chunk-3L6EVBXA.cjs');var _chunkEJSIN53Lcjs = require('./chunk-EJSIN53L.cjs');var _chunkNUERDBYDcjs = require('./chunk-NUERDBYD.cjs');require('./chunk-AC4TCW3L.cjs');require('./chunk-VMEGMTOD.cjs');require('./chunk-TDNPEWFY.cjs');require('./chunk-7JAILZE2.cjs');require('./chunk-4BJMFWAY.cjs');require('./chunk-NWOKSI3V.cjs');require('./chunk-FWMSAG7V.cjs');require('./chunk-DYRSQN7X.cjs');require('./chunk-NVJN7LPY.cjs');require('./chunk-AFYBD7FI.cjs');var _chunkZSWIQU3Ucjs = require('./chunk-ZSWIQU3U.cjs');require('./chunk-RD5PG4M6.cjs');require('./chunk-6HXIZLEQ.cjs');require('./chunk-EV4AUN33.cjs');require('./chunk-NKUDWDSH.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');require('./chunk-ECAM5KTH.cjs');var _chunk6VJEBYPNcjs = require('./chunk-6VJEBYPN.cjs');require('./chunk-IR5WN6FQ.cjs');require('./chunk-GEY574TH.cjs');require('./chunk-YO6BJ2DI.cjs');require('./chunk-DIZVZP5P.cjs');require('./chunk-XALFCQKD.cjs');exports.AuthRejectedError = _chunkZSWIQU3Ucjs.a; exports.CrossmintWallets = _chunk3L6EVBXAcjs.b; exports.EVMWallet = _chunk4UVSDKGYcjs.a; exports.InvalidApiKeyError = _chunkCT2UGJELcjs.a; exports.InvalidEnvironmentError = _chunkCT2UGJELcjs.b; exports.InvalidMessageFormatError = _chunkCT2UGJELcjs.j; exports.InvalidSignerError = _chunkCT2UGJELcjs.i; exports.InvalidTypedDataError = _chunkCT2UGJELcjs.k; exports.InvalidWalletConfigError = _chunkCT2UGJELcjs.e; exports.MessageSigningNotSupportedError = _chunkCT2UGJELcjs.n; exports.PendingApprovalsError = _chunkCT2UGJELcjs.x; exports.SignatureNotAvailableError = _chunkCT2UGJELcjs.p; exports.SignatureNotCreatedError = _chunkCT2UGJELcjs.o; exports.SignatureNotFoundError = _chunkCT2UGJELcjs.l; exports.SignerTypeMismatchError = _chunkCT2UGJELcjs.h; exports.SigningFailedError = _chunkCT2UGJELcjs.m; exports.SolanaWallet = _chunkGIDUQBAXcjs.a; exports.TransactionAwaitingApprovalError = _chunkCT2UGJELcjs.u; exports.TransactionConfirmationTimeoutError = _chunkCT2UGJELcjs.s; exports.TransactionFailedError = _chunkCT2UGJELcjs.w; exports.TransactionHashNotFoundError = _chunkCT2UGJELcjs.v; exports.TransactionNotAvailableError = _chunkCT2UGJELcjs.r; exports.TransactionNotCreatedError = _chunkCT2UGJELcjs.q; exports.TransactionSendingFailedError = _chunkCT2UGJELcjs.t; exports.Wallet = _chunkNUERDBYDcjs.a; exports.WalletCreationError = _chunkCT2UGJELcjs.f; exports.WalletFactory = _chunkEJSIN53Lcjs.a; exports.WalletNotAvailableError = _chunkCT2UGJELcjs.d; exports.WalletTypeMismatchError = _chunkCT2UGJELcjs.g; exports.WalletTypeNotSupportedError = _chunkCT2UGJELcjs.c; exports.createCrossmint = _chunk3L6EVBXAcjs.a; exports.toViemChain = _chunk6VJEBYPNcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkCGAFBZHZcjs = require('./chunk-CGAFBZHZ.cjs');var _chunk63KMVANBcjs = require('./chunk-63KMVANB.cjs');var _chunkFBNQVPXQcjs = require('./chunk-FBNQVPXQ.cjs');require('./chunk-6DVCB4VI.cjs');var _chunkGEEQGXHOcjs = require('./chunk-GEEQGXHO.cjs');require('./chunk-5IM7I7EX.cjs');require('./chunk-VMEGMTOD.cjs');require('./chunk-UMX5PW5P.cjs');require('./chunk-NGODR2AA.cjs');require('./chunk-MPTRSUNX.cjs');require('./chunk-NWOKSI3V.cjs');require('./chunk-FWMSAG7V.cjs');require('./chunk-DYRSQN7X.cjs');require('./chunk-NVJN7LPY.cjs');require('./chunk-AFYBD7FI.cjs');require('./chunk-ZSWIQU3U.cjs');require('./chunk-RD5PG4M6.cjs');require('./chunk-6HXIZLEQ.cjs');var _chunk5HBL6I5Vcjs = require('./chunk-5HBL6I5V.cjs');require('./chunk-AHG6IQT7.cjs');require('./chunk-CT2UGJEL.cjs');require('./chunk-ECAM5KTH.cjs');require('./chunk-6VJEBYPN.cjs');require('./chunk-IR5WN6FQ.cjs');require('./chunk-GEY574TH.cjs');require('./chunk-YO6BJ2DI.cjs');require('./chunk-DIZVZP5P.cjs');require('./chunk-XALFCQKD.cjs');exports.CrossmintWallets = _chunkFBNQVPXQcjs.b; exports.EVMWallet = _chunkCGAFBZHZcjs.a; exports.SolanaWallet = _chunk63KMVANBcjs.a; exports.Wallet = _chunkGEEQGXHOcjs.a; exports.WalletsApiClient = _chunk5HBL6I5Vcjs.a; exports.createCrossmint = _chunkFBNQVPXQcjs.a;