@crossmint/wallets-sdk 0.10.14 → 0.10.15

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 (95) hide show
  1. package/dist/api/client.cjs +1 -1
  2. package/dist/api/client.js +1 -1
  3. package/dist/api/gen/types.gen.d.cts +13 -0
  4. package/dist/api/gen/types.gen.d.ts +13 -0
  5. package/dist/api/index.cjs +1 -1
  6. package/dist/api/index.js +1 -1
  7. package/dist/{chunk-DAMUOJ6Q.js → chunk-2I26U7NK.js} +1 -1
  8. package/dist/chunk-3HZJR6A3.cjs +1 -0
  9. package/dist/chunk-4FM7WA5H.js +1 -0
  10. package/dist/{chunk-EXY25K62.cjs → chunk-5KA7SYRH.cjs} +1 -1
  11. package/dist/chunk-5U4PVNPM.js +1 -0
  12. package/dist/{chunk-OFA3KGPB.cjs → chunk-7JFXS23U.cjs} +1 -1
  13. package/dist/chunk-7L2MNVVS.cjs +1 -0
  14. package/dist/{chunk-FGGK2EJD.js → chunk-AEZDU2JM.js} +1 -1
  15. package/dist/{chunk-ZMPR4ZA2.cjs → chunk-BCOGNFY7.cjs} +1 -1
  16. package/dist/{chunk-QCMQO4YZ.cjs → chunk-BOJW3SWK.cjs} +1 -1
  17. package/dist/chunk-EQRZJV6Q.js +1 -0
  18. package/dist/chunk-IQB4HWD3.cjs +1 -0
  19. package/dist/{chunk-JBLEX3DQ.js → chunk-JGHXHURY.js} +1 -1
  20. package/dist/{chunk-KZJILO3X.js → chunk-KQJXLOUT.js} +1 -1
  21. package/dist/chunk-MLOSILO2.cjs +1 -0
  22. package/dist/{chunk-XE47PVB5.cjs → chunk-NVGWQJBW.cjs} +1 -1
  23. package/dist/chunk-OEEB24PA.js +1 -0
  24. package/dist/{chunk-2ZWL2W3E.js → chunk-SGL7VVQD.js} +1 -1
  25. package/dist/chunk-U3KINSXQ.js +1 -0
  26. package/dist/{chunk-JCXMSLR4.cjs → chunk-VOVPHLO5.cjs} +1 -1
  27. package/dist/{chunk-SYTKQKL7.cjs → chunk-VWPHXUTU.cjs} +1 -1
  28. package/dist/chunk-YNIO2LU5.js +1 -0
  29. package/dist/index.cjs +1 -1
  30. package/dist/index.d.cts +1 -1
  31. package/dist/index.d.ts +1 -1
  32. package/dist/index.js +1 -1
  33. package/dist/sdk.cjs +1 -1
  34. package/dist/sdk.js +1 -1
  35. package/dist/signers/index.cjs +1 -1
  36. package/dist/signers/index.js +1 -1
  37. package/dist/signers/non-custodial/index.cjs +1 -0
  38. package/dist/signers/non-custodial/index.d.cts +10 -0
  39. package/dist/signers/non-custodial/index.d.ts +10 -0
  40. package/dist/signers/non-custodial/index.js +1 -0
  41. package/dist/signers/non-custodial/ncs-evm-signer.cjs +1 -0
  42. package/dist/signers/{email/evm-email-signer.d.cts → non-custodial/ncs-evm-signer.d.cts} +5 -6
  43. package/dist/signers/{email/evm-email-signer.d.ts → non-custodial/ncs-evm-signer.d.ts} +5 -6
  44. package/dist/signers/non-custodial/ncs-evm-signer.js +1 -0
  45. package/dist/signers/non-custodial/ncs-iframe-manager.cjs +1 -0
  46. package/dist/signers/{email/email-iframe-manager.d.cts → non-custodial/ncs-iframe-manager.d.cts} +2 -2
  47. package/dist/signers/{email/email-iframe-manager.d.ts → non-custodial/ncs-iframe-manager.d.ts} +2 -2
  48. package/dist/signers/non-custodial/ncs-iframe-manager.js +1 -0
  49. package/dist/signers/non-custodial/ncs-signer.cjs +1 -0
  50. package/dist/signers/{email/email-signer.d.cts → non-custodial/ncs-signer.d.cts} +8 -7
  51. package/dist/signers/{email/email-signer.d.ts → non-custodial/ncs-signer.d.ts} +8 -7
  52. package/dist/signers/non-custodial/ncs-signer.js +1 -0
  53. package/dist/signers/non-custodial/ncs-solana-signer.cjs +1 -0
  54. package/dist/signers/{email/solana-email-signer.d.cts → non-custodial/ncs-solana-signer.d.cts} +5 -5
  55. package/dist/signers/{email/solana-email-signer.d.ts → non-custodial/ncs-solana-signer.d.ts} +5 -5
  56. package/dist/signers/non-custodial/ncs-solana-signer.js +1 -0
  57. package/dist/signers/types.d.cts +13 -4
  58. package/dist/signers/types.d.ts +13 -4
  59. package/dist/utils/constants.cjs +1 -1
  60. package/dist/utils/constants.js +1 -1
  61. package/dist/wallets/evm.cjs +1 -1
  62. package/dist/wallets/evm.js +1 -1
  63. package/dist/wallets/solana.cjs +1 -1
  64. package/dist/wallets/solana.js +1 -1
  65. package/dist/wallets/wallet-factory.cjs +1 -1
  66. package/dist/wallets/wallet-factory.js +1 -1
  67. package/dist/wallets/wallet.cjs +1 -1
  68. package/dist/wallets/wallet.js +1 -1
  69. package/package.json +3 -3
  70. package/dist/chunk-7KHMZPZO.js +0 -1
  71. package/dist/chunk-BPUDXO56.js +0 -1
  72. package/dist/chunk-KH5LXU3K.cjs +0 -1
  73. package/dist/chunk-LMDBWVPC.js +0 -1
  74. package/dist/chunk-NCS4FTLK.js +0 -1
  75. package/dist/chunk-NWOKSI3V.cjs +0 -1
  76. package/dist/chunk-SHDM6MXU.js +0 -1
  77. package/dist/chunk-SLEKIJXX.cjs +0 -1
  78. package/dist/chunk-UKJYMCUP.js +0 -1
  79. package/dist/chunk-YBRPY7QN.cjs +0 -1
  80. package/dist/signers/email/email-iframe-manager.cjs +0 -1
  81. package/dist/signers/email/email-iframe-manager.js +0 -1
  82. package/dist/signers/email/email-signer.cjs +0 -1
  83. package/dist/signers/email/email-signer.js +0 -1
  84. package/dist/signers/email/evm-email-signer.cjs +0 -1
  85. package/dist/signers/email/evm-email-signer.js +0 -1
  86. package/dist/signers/email/index.cjs +0 -1
  87. package/dist/signers/email/index.d.cts +0 -10
  88. package/dist/signers/email/index.d.ts +0 -10
  89. package/dist/signers/email/index.js +0 -1
  90. package/dist/signers/email/solana-email-signer.cjs +0 -1
  91. package/dist/signers/email/solana-email-signer.js +0 -1
  92. /package/dist/{chunk-VMEGMTOD.cjs → chunk-3ABHUDKX.cjs} +0 -0
  93. /package/dist/{chunk-TN6YXWPL.js → chunk-7AFCY47Q.js} +0 -0
  94. /package/dist/{chunk-FWMSAG7V.cjs → chunk-U4S6GWMK.cjs} +0 -0
  95. /package/dist/{chunk-PPTGFYIV.js → chunk-Y5NVCPZ2.js} +0 -0
@@ -0,0 +1 @@
1
+ import{a}from"../../chunk-Y5NVCPZ2.js";import"../../chunk-BW7YYVZE.js";export{a as NcsIframeManager};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkMLOSILO2cjs = require('../../chunk-MLOSILO2.cjs');require('../../chunk-U4S6GWMK.cjs');require('../../chunk-ZSWIQU3U.cjs');require('../../chunk-XALFCQKD.cjs');exports.DEFAULT_EVENT_OPTIONS = _chunkMLOSILO2cjs.b; exports.NonCustodialSigner = _chunkMLOSILO2cjs.a;
@@ -1,4 +1,4 @@
1
- import { Signer, EmailInternalSignerConfig, BaseSignResult } from '../types.cjs';
1
+ import { Signer, EmailInternalSignerConfig, PhoneInternalSignerConfig, BaseSignResult } from '../types.cjs';
2
2
  import 'ox';
3
3
  import '@crossmint/client-sdk-window';
4
4
  import '@crossmint/client-signers';
@@ -6,12 +6,12 @@ import '@crossmint/common-sdk-base';
6
6
  import '../../chains/chains.cjs';
7
7
  import 'viem';
8
8
 
9
- declare abstract class EmailSigner implements Signer {
10
- protected config: EmailInternalSignerConfig;
11
- type: "email";
9
+ declare abstract class NonCustodialSigner implements Signer {
10
+ protected config: EmailInternalSignerConfig | PhoneInternalSignerConfig;
11
+ readonly type: "email" | "phone";
12
12
  private _needsAuth;
13
13
  private _authPromise;
14
- constructor(config: EmailInternalSignerConfig);
14
+ constructor(config: EmailInternalSignerConfig | PhoneInternalSignerConfig);
15
15
  abstract locator(): string;
16
16
  abstract signMessage(message: string): Promise<BaseSignResult>;
17
17
  private initialize;
@@ -21,7 +21,8 @@ declare abstract class EmailSigner implements Signer {
21
21
  protected handleAuthRequired(): Promise<void>;
22
22
  protected getJwtOrThrow(): string;
23
23
  private createAuthPromise;
24
- private sendEmailWithOtp;
24
+ private sendMessageWithOtp;
25
+ private getAuthId;
25
26
  private verifyOtp;
26
27
  }
27
28
  declare const DEFAULT_EVENT_OPTIONS: {
@@ -29,4 +30,4 @@ declare const DEFAULT_EVENT_OPTIONS: {
29
30
  intervalMs: number;
30
31
  };
31
32
 
32
- export { DEFAULT_EVENT_OPTIONS, EmailSigner };
33
+ export { DEFAULT_EVENT_OPTIONS, NonCustodialSigner };
@@ -1,4 +1,4 @@
1
- import { Signer, EmailInternalSignerConfig, BaseSignResult } from '../types.js';
1
+ import { Signer, EmailInternalSignerConfig, PhoneInternalSignerConfig, BaseSignResult } from '../types.js';
2
2
  import 'ox';
3
3
  import '@crossmint/client-sdk-window';
4
4
  import '@crossmint/client-signers';
@@ -6,12 +6,12 @@ import '@crossmint/common-sdk-base';
6
6
  import '../../chains/chains.js';
7
7
  import 'viem';
8
8
 
9
- declare abstract class EmailSigner implements Signer {
10
- protected config: EmailInternalSignerConfig;
11
- type: "email";
9
+ declare abstract class NonCustodialSigner implements Signer {
10
+ protected config: EmailInternalSignerConfig | PhoneInternalSignerConfig;
11
+ readonly type: "email" | "phone";
12
12
  private _needsAuth;
13
13
  private _authPromise;
14
- constructor(config: EmailInternalSignerConfig);
14
+ constructor(config: EmailInternalSignerConfig | PhoneInternalSignerConfig);
15
15
  abstract locator(): string;
16
16
  abstract signMessage(message: string): Promise<BaseSignResult>;
17
17
  private initialize;
@@ -21,7 +21,8 @@ declare abstract class EmailSigner implements Signer {
21
21
  protected handleAuthRequired(): Promise<void>;
22
22
  protected getJwtOrThrow(): string;
23
23
  private createAuthPromise;
24
- private sendEmailWithOtp;
24
+ private sendMessageWithOtp;
25
+ private getAuthId;
25
26
  private verifyOtp;
26
27
  }
27
28
  declare const DEFAULT_EVENT_OPTIONS: {
@@ -29,4 +30,4 @@ declare const DEFAULT_EVENT_OPTIONS: {
29
30
  intervalMs: number;
30
31
  };
31
32
 
32
- export { DEFAULT_EVENT_OPTIONS, EmailSigner };
33
+ export { DEFAULT_EVENT_OPTIONS, NonCustodialSigner };
@@ -0,0 +1 @@
1
+ import{a,b}from"../../chunk-YNIO2LU5.js";import"../../chunk-Y5NVCPZ2.js";import"../../chunk-M4ELAV7U.js";import"../../chunk-BW7YYVZE.js";export{b as DEFAULT_EVENT_OPTIONS,a as NonCustodialSigner};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5KA7SYRHcjs = require('../../chunk-5KA7SYRH.cjs');require('../../chunk-MLOSILO2.cjs');require('../../chunk-U4S6GWMK.cjs');require('../../chunk-ZSWIQU3U.cjs');require('../../chunk-XALFCQKD.cjs');exports.SolanaNonCustodialSigner = _chunk5KA7SYRHcjs.a;
@@ -1,5 +1,5 @@
1
- import { EmailInternalSignerConfig } from '../types.cjs';
2
- import { EmailSigner } from './email-signer.cjs';
1
+ import { EmailInternalSignerConfig, PhoneInternalSignerConfig } from '../types.cjs';
2
+ import { NonCustodialSigner } from './ncs-signer.cjs';
3
3
  import 'ox';
4
4
  import '@crossmint/client-sdk-window';
5
5
  import '@crossmint/client-signers';
@@ -7,8 +7,8 @@ import '@crossmint/common-sdk-base';
7
7
  import '../../chains/chains.cjs';
8
8
  import 'viem';
9
9
 
10
- declare class SolanaEmailSigner extends EmailSigner {
11
- constructor(config: EmailInternalSignerConfig);
10
+ declare class SolanaNonCustodialSigner extends NonCustodialSigner {
11
+ constructor(config: EmailInternalSignerConfig | PhoneInternalSignerConfig);
12
12
  locator(): string;
13
13
  signMessage(): Promise<never>;
14
14
  signTransaction(transaction: string): Promise<{
@@ -21,4 +21,4 @@ declare class SolanaEmailSigner extends EmailSigner {
21
21
  } | null): void;
22
22
  }
23
23
 
24
- export { SolanaEmailSigner };
24
+ export { SolanaNonCustodialSigner };
@@ -1,5 +1,5 @@
1
- import { EmailInternalSignerConfig } from '../types.js';
2
- import { EmailSigner } from './email-signer.js';
1
+ import { EmailInternalSignerConfig, PhoneInternalSignerConfig } from '../types.js';
2
+ import { NonCustodialSigner } from './ncs-signer.js';
3
3
  import 'ox';
4
4
  import '@crossmint/client-sdk-window';
5
5
  import '@crossmint/client-signers';
@@ -7,8 +7,8 @@ import '@crossmint/common-sdk-base';
7
7
  import '../../chains/chains.js';
8
8
  import 'viem';
9
9
 
10
- declare class SolanaEmailSigner extends EmailSigner {
11
- constructor(config: EmailInternalSignerConfig);
10
+ declare class SolanaNonCustodialSigner extends NonCustodialSigner {
11
+ constructor(config: EmailInternalSignerConfig | PhoneInternalSignerConfig);
12
12
  locator(): string;
13
13
  signMessage(): Promise<never>;
14
14
  signTransaction(transaction: string): Promise<{
@@ -21,4 +21,4 @@ declare class SolanaEmailSigner extends EmailSigner {
21
21
  } | null): void;
22
22
  }
23
23
 
24
- export { SolanaEmailSigner };
24
+ export { SolanaNonCustodialSigner };
@@ -0,0 +1 @@
1
+ import{a}from"../../chunk-U3KINSXQ.js";import"../../chunk-YNIO2LU5.js";import"../../chunk-Y5NVCPZ2.js";import"../../chunk-M4ELAV7U.js";import"../../chunk-BW7YYVZE.js";export{a as SolanaNonCustodialSigner};
@@ -14,6 +14,12 @@ type EmailSignerConfig = {
14
14
  email?: string;
15
15
  onAuthRequired?: (needsAuth: boolean, sendEmailWithOtp: () => Promise<void>, verifyOtp: (otp: string) => Promise<void>, reject: () => void) => Promise<void>;
16
16
  };
17
+ type PhoneSignerConfig = {
18
+ type: "phone";
19
+ phone?: string;
20
+ onAuthRequired?: (needsAuth: boolean, sendOtp: () => Promise<void>, verifyOtp: (otp: string) => Promise<void>, reject: () => void) => Promise<void>;
21
+ };
22
+ type NonCustodialSignerType = PhoneSignerConfig["type"] | EmailSignerConfig["type"];
17
23
  type ExternalWalletSignerConfigForChain<C extends Chain> = C extends SolanaChain ? SolanaExternalWalletSignerConfig : EvmExternalWalletSignerConfig;
18
24
  type ApiKeySignerConfig = {
19
25
  type: "api-key";
@@ -31,11 +37,13 @@ type PasskeySignerConfig = {
31
37
  }>;
32
38
  onSignWithPasskey?: (message: string) => Promise<PasskeySignResult>;
33
39
  };
34
- type EmailInternalSignerConfig = EmailSignerConfig & {
40
+ type BaseInternalSignerConfig = {
35
41
  locator: string;
36
42
  crossmint: Crossmint;
37
43
  clientTEEConnection?: HandshakeParent<typeof signerOutboundEvents, typeof signerInboundEvents>;
38
44
  };
45
+ type EmailInternalSignerConfig = EmailSignerConfig & BaseInternalSignerConfig;
46
+ type PhoneInternalSignerConfig = PhoneSignerConfig & BaseInternalSignerConfig;
39
47
  type PasskeyInternalSignerConfig = PasskeySignerConfig & {
40
48
  locator: string;
41
49
  id: string;
@@ -47,7 +55,7 @@ type ApiKeyInternalSignerConfig = ApiKeySignerConfig & {
47
55
  type ExternalWalletInternalSignerConfig<C extends Chain> = ExternalWalletSignerConfigForChain<C> & {
48
56
  locator: string;
49
57
  };
50
- type InternalSignerConfig<C extends Chain> = EmailInternalSignerConfig | PasskeyInternalSignerConfig | ApiKeyInternalSignerConfig | ExternalWalletInternalSignerConfig<C>;
58
+ type InternalSignerConfig<C extends Chain> = EmailInternalSignerConfig | PhoneInternalSignerConfig | PasskeyInternalSignerConfig | ApiKeyInternalSignerConfig | ExternalWalletInternalSignerConfig<C>;
51
59
  type BaseSignResult = {
52
60
  signature: string;
53
61
  };
@@ -58,9 +66,10 @@ type PasskeySignResult = {
58
66
  };
59
67
  metadata: WebAuthnP256.SignMetadata;
60
68
  };
61
- type SignerConfigForChain<C extends Chain> = C extends SolanaChain ? EmailSignerConfig | BaseSignerConfig<C> : EmailSignerConfig | PasskeySignerConfig | BaseSignerConfig<C>;
69
+ type SignerConfigForChain<C extends Chain> = C extends SolanaChain ? EmailSignerConfig | PhoneSignerConfig | BaseSignerConfig<C> : EmailSignerConfig | PhoneSignerConfig | PasskeySignerConfig | BaseSignerConfig<C>;
62
70
  type SignResultMap = {
63
71
  email: BaseSignResult;
72
+ phone: BaseSignResult;
64
73
  "api-key": BaseSignResult;
65
74
  "external-wallet": BaseSignResult;
66
75
  passkey: PasskeySignResult;
@@ -72,4 +81,4 @@ interface Signer<T extends keyof SignResultMap = keyof SignResultMap> {
72
81
  signTransaction(transaction: string): Promise<SignResultMap[T]>;
73
82
  }
74
83
 
75
- export { type ApiKeyInternalSignerConfig, type ApiKeySignerConfig, AuthRejectedError, type BaseSignResult, type BaseSignerConfig, type EmailInternalSignerConfig, type EmailSignerConfig, type ExternalWalletInternalSignerConfig, type ExternalWalletSignerConfigForChain, type InternalSignerConfig, type PasskeyInternalSignerConfig, type PasskeySignResult, type PasskeySignerConfig, type Signer, type SignerConfigForChain };
84
+ export { type ApiKeyInternalSignerConfig, type ApiKeySignerConfig, AuthRejectedError, type BaseSignResult, type BaseSignerConfig, type EmailInternalSignerConfig, type EmailSignerConfig, type ExternalWalletInternalSignerConfig, type ExternalWalletSignerConfigForChain, type InternalSignerConfig, type NonCustodialSignerType, type PasskeyInternalSignerConfig, type PasskeySignResult, type PasskeySignerConfig, type PhoneInternalSignerConfig, type PhoneSignerConfig, type Signer, type SignerConfigForChain };
@@ -14,6 +14,12 @@ type EmailSignerConfig = {
14
14
  email?: string;
15
15
  onAuthRequired?: (needsAuth: boolean, sendEmailWithOtp: () => Promise<void>, verifyOtp: (otp: string) => Promise<void>, reject: () => void) => Promise<void>;
16
16
  };
17
+ type PhoneSignerConfig = {
18
+ type: "phone";
19
+ phone?: string;
20
+ onAuthRequired?: (needsAuth: boolean, sendOtp: () => Promise<void>, verifyOtp: (otp: string) => Promise<void>, reject: () => void) => Promise<void>;
21
+ };
22
+ type NonCustodialSignerType = PhoneSignerConfig["type"] | EmailSignerConfig["type"];
17
23
  type ExternalWalletSignerConfigForChain<C extends Chain> = C extends SolanaChain ? SolanaExternalWalletSignerConfig : EvmExternalWalletSignerConfig;
18
24
  type ApiKeySignerConfig = {
19
25
  type: "api-key";
@@ -31,11 +37,13 @@ type PasskeySignerConfig = {
31
37
  }>;
32
38
  onSignWithPasskey?: (message: string) => Promise<PasskeySignResult>;
33
39
  };
34
- type EmailInternalSignerConfig = EmailSignerConfig & {
40
+ type BaseInternalSignerConfig = {
35
41
  locator: string;
36
42
  crossmint: Crossmint;
37
43
  clientTEEConnection?: HandshakeParent<typeof signerOutboundEvents, typeof signerInboundEvents>;
38
44
  };
45
+ type EmailInternalSignerConfig = EmailSignerConfig & BaseInternalSignerConfig;
46
+ type PhoneInternalSignerConfig = PhoneSignerConfig & BaseInternalSignerConfig;
39
47
  type PasskeyInternalSignerConfig = PasskeySignerConfig & {
40
48
  locator: string;
41
49
  id: string;
@@ -47,7 +55,7 @@ type ApiKeyInternalSignerConfig = ApiKeySignerConfig & {
47
55
  type ExternalWalletInternalSignerConfig<C extends Chain> = ExternalWalletSignerConfigForChain<C> & {
48
56
  locator: string;
49
57
  };
50
- type InternalSignerConfig<C extends Chain> = EmailInternalSignerConfig | PasskeyInternalSignerConfig | ApiKeyInternalSignerConfig | ExternalWalletInternalSignerConfig<C>;
58
+ type InternalSignerConfig<C extends Chain> = EmailInternalSignerConfig | PhoneInternalSignerConfig | PasskeyInternalSignerConfig | ApiKeyInternalSignerConfig | ExternalWalletInternalSignerConfig<C>;
51
59
  type BaseSignResult = {
52
60
  signature: string;
53
61
  };
@@ -58,9 +66,10 @@ type PasskeySignResult = {
58
66
  };
59
67
  metadata: WebAuthnP256.SignMetadata;
60
68
  };
61
- type SignerConfigForChain<C extends Chain> = C extends SolanaChain ? EmailSignerConfig | BaseSignerConfig<C> : EmailSignerConfig | PasskeySignerConfig | BaseSignerConfig<C>;
69
+ type SignerConfigForChain<C extends Chain> = C extends SolanaChain ? EmailSignerConfig | PhoneSignerConfig | BaseSignerConfig<C> : EmailSignerConfig | PhoneSignerConfig | PasskeySignerConfig | BaseSignerConfig<C>;
62
70
  type SignResultMap = {
63
71
  email: BaseSignResult;
72
+ phone: BaseSignResult;
64
73
  "api-key": BaseSignResult;
65
74
  "external-wallet": BaseSignResult;
66
75
  passkey: PasskeySignResult;
@@ -72,4 +81,4 @@ interface Signer<T extends keyof SignResultMap = keyof SignResultMap> {
72
81
  signTransaction(transaction: string): Promise<SignResultMap[T]>;
73
82
  }
74
83
 
75
- export { type ApiKeyInternalSignerConfig, type ApiKeySignerConfig, AuthRejectedError, type BaseSignResult, type BaseSignerConfig, type EmailInternalSignerConfig, type EmailSignerConfig, type ExternalWalletInternalSignerConfig, type ExternalWalletSignerConfigForChain, type InternalSignerConfig, type PasskeyInternalSignerConfig, type PasskeySignResult, type PasskeySignerConfig, type Signer, type SignerConfigForChain };
84
+ export { type ApiKeyInternalSignerConfig, type ApiKeySignerConfig, AuthRejectedError, type BaseSignResult, type BaseSignerConfig, type EmailInternalSignerConfig, type EmailSignerConfig, type ExternalWalletInternalSignerConfig, type ExternalWalletSignerConfigForChain, type InternalSignerConfig, type NonCustodialSignerType, type PasskeyInternalSignerConfig, type PasskeySignResult, type PasskeySignerConfig, type PhoneInternalSignerConfig, type PhoneSignerConfig, type Signer, type SignerConfigForChain };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZMPR4ZA2cjs = require('../chunk-ZMPR4ZA2.cjs');require('../chunk-XALFCQKD.cjs');exports.SDK_NAME = _chunkZMPR4ZA2cjs.c; exports.SDK_VERSION = _chunkZMPR4ZA2cjs.b; exports.STATUS_POLLING_INTERVAL_MS = _chunkZMPR4ZA2cjs.d; exports.WALLETS_SERVICE = _chunkZMPR4ZA2cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBCOGNFY7cjs = require('../chunk-BCOGNFY7.cjs');require('../chunk-XALFCQKD.cjs');exports.SDK_NAME = _chunkBCOGNFY7cjs.c; exports.SDK_VERSION = _chunkBCOGNFY7cjs.b; exports.STATUS_POLLING_INTERVAL_MS = _chunkBCOGNFY7cjs.d; exports.WALLETS_SERVICE = _chunkBCOGNFY7cjs.a;
@@ -1 +1 @@
1
- import{a,b,c,d}from"../chunk-UKJYMCUP.js";import"../chunk-BW7YYVZE.js";export{c as SDK_NAME,b as SDK_VERSION,d as STATUS_POLLING_INTERVAL_MS,a as WALLETS_SERVICE};
1
+ import{a,b,c,d}from"../chunk-EQRZJV6Q.js";import"../chunk-BW7YYVZE.js";export{c as SDK_NAME,b as SDK_VERSION,d as STATUS_POLLING_INTERVAL_MS,a as WALLETS_SERVICE};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQCMQO4YZcjs = require('../chunk-QCMQO4YZ.cjs');require('../chunk-JCXMSLR4.cjs');require('../chunk-ZMPR4ZA2.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-6VJEBYPN.cjs');require('../chunk-IR5WN6FQ.cjs');require('../chunk-GEY574TH.cjs');require('../chunk-XALFCQKD.cjs');exports.EVMWallet = _chunkQCMQO4YZcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBOJW3SWKcjs = require('../chunk-BOJW3SWK.cjs');require('../chunk-VOVPHLO5.cjs');require('../chunk-BCOGNFY7.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-6VJEBYPN.cjs');require('../chunk-IR5WN6FQ.cjs');require('../chunk-GEY574TH.cjs');require('../chunk-XALFCQKD.cjs');exports.EVMWallet = _chunkBOJW3SWKcjs.a;
@@ -1 +1 @@
1
- import{a}from"../chunk-FGGK2EJD.js";import"../chunk-JBLEX3DQ.js";import"../chunk-UKJYMCUP.js";import"../chunk-7ENJXL4H.js";import"../chunk-BJDS5BJG.js";import"../chunk-KKQBZXFE.js";import"../chunk-S3DYQVRD.js";import"../chunk-BW7YYVZE.js";export{a as EVMWallet};
1
+ import{a}from"../chunk-AEZDU2JM.js";import"../chunk-JGHXHURY.js";import"../chunk-EQRZJV6Q.js";import"../chunk-7ENJXL4H.js";import"../chunk-BJDS5BJG.js";import"../chunk-KKQBZXFE.js";import"../chunk-S3DYQVRD.js";import"../chunk-BW7YYVZE.js";export{a as EVMWallet};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOFA3KGPBcjs = require('../chunk-OFA3KGPB.cjs');require('../chunk-JCXMSLR4.cjs');require('../chunk-YTAW674L.cjs');require('../chunk-ZMPR4ZA2.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-XALFCQKD.cjs');exports.SolanaWallet = _chunkOFA3KGPBcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7JFXS23Ucjs = require('../chunk-7JFXS23U.cjs');require('../chunk-VOVPHLO5.cjs');require('../chunk-YTAW674L.cjs');require('../chunk-BCOGNFY7.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-XALFCQKD.cjs');exports.SolanaWallet = _chunk7JFXS23Ucjs.a;
@@ -1 +1 @@
1
- import{a}from"../chunk-2ZWL2W3E.js";import"../chunk-JBLEX3DQ.js";import"../chunk-SCS4UDW7.js";import"../chunk-UKJYMCUP.js";import"../chunk-7ENJXL4H.js";import"../chunk-BW7YYVZE.js";export{a as SolanaWallet};
1
+ import{a}from"../chunk-SGL7VVQD.js";import"../chunk-JGHXHURY.js";import"../chunk-SCS4UDW7.js";import"../chunk-EQRZJV6Q.js";import"../chunk-7ENJXL4H.js";import"../chunk-BW7YYVZE.js";export{a as SolanaWallet};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYBRPY7QNcjs = require('../chunk-YBRPY7QN.cjs');require('../chunk-JCXMSLR4.cjs');require('../chunk-SLEKIJXX.cjs');require('../chunk-VMEGMTOD.cjs');require('../chunk-KH5LXU3K.cjs');require('../chunk-EXY25K62.cjs');require('../chunk-NWOKSI3V.cjs');require('../chunk-FWMSAG7V.cjs');require('../chunk-YWPTI2QO.cjs');require('../chunk-4KXOWU5E.cjs');require('../chunk-YTAW674L.cjs');require('../chunk-ZSWIQU3U.cjs');require('../chunk-RFK6N7LC.cjs');require('../chunk-ZMPR4ZA2.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-YZ4HRYSL.cjs');require('../chunk-BULGM35W.cjs');require('../chunk-XALFCQKD.cjs');exports.WalletFactory = _chunkYBRPY7QNcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7L2MNVVScjs = require('../chunk-7L2MNVVS.cjs');require('../chunk-VOVPHLO5.cjs');require('../chunk-IQB4HWD3.cjs');require('../chunk-3ABHUDKX.cjs');require('../chunk-3HZJR6A3.cjs');require('../chunk-5KA7SYRH.cjs');require('../chunk-MLOSILO2.cjs');require('../chunk-U4S6GWMK.cjs');require('../chunk-YWPTI2QO.cjs');require('../chunk-4KXOWU5E.cjs');require('../chunk-YTAW674L.cjs');require('../chunk-ZSWIQU3U.cjs');require('../chunk-RFK6N7LC.cjs');require('../chunk-BCOGNFY7.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-YZ4HRYSL.cjs');require('../chunk-BULGM35W.cjs');require('../chunk-XALFCQKD.cjs');exports.WalletFactory = _chunk7L2MNVVScjs.a;
@@ -1 +1 @@
1
- import{a}from"../chunk-NCS4FTLK.js";import"../chunk-JBLEX3DQ.js";import"../chunk-SHDM6MXU.js";import"../chunk-TN6YXWPL.js";import"../chunk-LMDBWVPC.js";import"../chunk-BPUDXO56.js";import"../chunk-7KHMZPZO.js";import"../chunk-PPTGFYIV.js";import"../chunk-UBOWSXW3.js";import"../chunk-IGBQEAD5.js";import"../chunk-SCS4UDW7.js";import"../chunk-M4ELAV7U.js";import"../chunk-IJMFCZIY.js";import"../chunk-UKJYMCUP.js";import"../chunk-7ENJXL4H.js";import"../chunk-LW6JSI4J.js";import"../chunk-5S6YZJHE.js";import"../chunk-BW7YYVZE.js";export{a as WalletFactory};
1
+ import{a}from"../chunk-OEEB24PA.js";import"../chunk-JGHXHURY.js";import"../chunk-5U4PVNPM.js";import"../chunk-7AFCY47Q.js";import"../chunk-4FM7WA5H.js";import"../chunk-U3KINSXQ.js";import"../chunk-YNIO2LU5.js";import"../chunk-Y5NVCPZ2.js";import"../chunk-UBOWSXW3.js";import"../chunk-IGBQEAD5.js";import"../chunk-SCS4UDW7.js";import"../chunk-M4ELAV7U.js";import"../chunk-IJMFCZIY.js";import"../chunk-EQRZJV6Q.js";import"../chunk-7ENJXL4H.js";import"../chunk-LW6JSI4J.js";import"../chunk-5S6YZJHE.js";import"../chunk-BW7YYVZE.js";export{a as WalletFactory};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJCXMSLR4cjs = require('../chunk-JCXMSLR4.cjs');require('../chunk-ZMPR4ZA2.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-XALFCQKD.cjs');exports.Wallet = _chunkJCXMSLR4cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkVOVPHLO5cjs = require('../chunk-VOVPHLO5.cjs');require('../chunk-BCOGNFY7.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-XALFCQKD.cjs');exports.Wallet = _chunkVOVPHLO5cjs.a;
@@ -1 +1 @@
1
- import{a}from"../chunk-JBLEX3DQ.js";import"../chunk-UKJYMCUP.js";import"../chunk-7ENJXL4H.js";import"../chunk-BW7YYVZE.js";export{a as Wallet};
1
+ import{a}from"../chunk-JGHXHURY.js";import"../chunk-EQRZJV6Q.js";import"../chunk-7ENJXL4H.js";import"../chunk-BW7YYVZE.js";export{a as Wallet};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossmint/wallets-sdk",
3
- "version": "0.10.14",
3
+ "version": "0.10.15",
4
4
  "repository": "https://github.com/Crossmint/crossmint-sdk",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Paella Labs Inc",
@@ -26,8 +26,8 @@
26
26
  "tweetnacl": "1.0.3",
27
27
  "viem": "2.23.6",
28
28
  "@crossmint/client-sdk-window": "1.0.2",
29
- "@crossmint/common-sdk-base": "0.8.4",
30
- "@crossmint/client-signers": "0.0.18"
29
+ "@crossmint/client-signers": "0.0.18",
30
+ "@crossmint/common-sdk-base": "0.8.5"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@hey-api/openapi-ts": "0.69.2",
@@ -1 +0,0 @@
1
- import{a as u}from"./chunk-PPTGFYIV.js";import{a as l}from"./chunk-M4ELAV7U.js";import{f as c}from"./chunk-BW7YYVZE.js";import{validateAPIKey as p}from"@crossmint/common-sdk-base";var d=class{constructor(t){this.config=t;this.type="email";this._needsAuth=!0;this._authPromise=null;this.initialize()}initialize(){return c(this,null,function*(){if(this.config.clientTEEConnection==null){let t=p(this.config.crossmint.apiKey);if(!t.isValid)throw new Error("Invalid API key");let r=new u({environment:t.environment});this.config.clientTEEConnection=yield r.initialize()}})}handleAuthRequired(){return c(this,null,function*(){var o,s,a;if(this.config.clientTEEConnection==null)throw new Error("Handshake parent not initialized");let t=yield(a=this.config.clientTEEConnection)==null?void 0:a.sendAction({event:"request:get-status",responseEvent:"response:get-status",data:{authData:{jwt:(s=(o=this.config.crossmint.experimental_customAuth)==null?void 0:o.jwt)!=null?s:"",apiKey:this.config.crossmint.apiKey}},options:h});if((t==null?void 0:t.status)!=="success")throw new Error(t==null?void 0:t.error);if(t.signerStatus==="ready"){this._needsAuth=!1;return}let{promise:r,resolve:i,reject:n}=this.createAuthPromise();if(this._authPromise={promise:r,resolve:i,reject:n},this.config.onAuthRequired)try{yield this.config.onAuthRequired(this._needsAuth,()=>this.sendEmailWithOtp(),e=>this.verifyOtp(e),()=>n(new l))}catch(e){n(e)}try{yield r}catch(e){throw e}})}getJwtOrThrow(){var r;let t=(r=this.config.crossmint.experimental_customAuth)==null?void 0:r.jwt;if(t==null)throw new Error("JWT is required");return t}createAuthPromise(){let t,r;return{promise:new Promise((n,o)=>{t=n,r=o}),resolve:t,reject:r}}sendEmailWithOtp(){return c(this,null,function*(){var n,o,s;if(this.config.clientTEEConnection==null)throw new Error("Handshake parent not initialized");let t=this.config.clientTEEConnection,r=`email:${this.config.email}`,i=yield t.sendAction({event:"request:start-onboarding",responseEvent:"response:start-onboarding",data:{authData:{jwt:(o=(n=this.config.crossmint.experimental_customAuth)==null?void 0:n.jwt)!=null?o:"",apiKey:this.config.crossmint.apiKey},data:{authId:r}},options:h});if((i==null?void 0:i.status)==="success"&&i.signerStatus==="ready"){this._needsAuth=!1;return}(i==null?void 0:i.status)==="error"&&(console.error("[sendEmailWithOtp] Failed to send OTP:",i),(s=this._authPromise)==null||s.reject(new Error(i.error||"Failed to initiate OTP process.")))})}verifyOtp(t){return c(this,null,function*(){var i,n,o,s,a;if(this.config.clientTEEConnection==null)throw new Error("Handshake parent not initialized");let r=this.config.clientTEEConnection;try{let e=yield r.sendAction({event:"request:complete-onboarding",responseEvent:"response:complete-onboarding",data:{authData:{jwt:(n=(i=this.config.crossmint.experimental_customAuth)==null?void 0:i.jwt)!=null?n:"",apiKey:this.config.crossmint.apiKey},data:{onboardingAuthentication:{encryptedOtp:t}}},options:h});if((e==null?void 0:e.status)==="success"){this._needsAuth=!1,(o=this._authPromise)==null||o.resolve();return}console.error("[verifyOtp] Failed to validate OTP:",e),this._needsAuth=!0;let m=(e==null?void 0:e.status)==="error"?e.error:"Failed to validate encrypted OTP";(s=this._authPromise)==null||s.reject(new Error(m))}catch(e){throw console.error("[verifyOtp] Error sending OTP validation request:",e),this._needsAuth=!0,(a=this._authPromise)==null||a.reject(e),e}})}},h={timeoutMs:1e4,intervalMs:5e3};export{d as a,h as b};
@@ -1 +0,0 @@
1
- import{a as i,b as s}from"./chunk-7KHMZPZO.js";import{f as n}from"./chunk-BW7YYVZE.js";import{VersionedTransaction as y}from"@solana/web3.js";import o from"bs58";var a=class c extends i{constructor(e){super(e)}locator(){return this.config.locator}signMessage(){return n(this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for email signer"))})}signTransaction(e){return n(this,null,function*(){var r;yield this.handleAuthRequired();let g=this.getJwtOrThrow(),d=o.decode(e),l=y.deserialize(d).message.serialize(),t=yield(r=this.config.clientTEEConnection)==null?void 0:r.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:g,apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:o.encode(l),encoding:"base58"}},options:s});if((t==null?void 0:t.status)==="error")throw new Error(t.error);if((t==null?void 0:t.signature)==null)throw new Error("Failed to sign transaction");return c.verifyPublicKeyFormat(t.publicKey),{signature:t.signature.bytes}})}static verifyPublicKeyFormat(e){if(e==null)throw new Error("No public key found");if(e.encoding!=="base58"||e.keyType!=="ed25519"||e.bytes==null)throw new Error("Not supported. Expected public key to be in base58 encoding and ed25519 key type. Got: "+JSON.stringify(e))}};export{a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNWOKSI3Vcjs = require('./chunk-NWOKSI3V.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _ox = require('ox');var _viem = require('viem');var g=class c extends _chunkNWOKSI3Vcjs.a{constructor(t){super(t)}locator(){return this.config.locator}signMessage(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let n=_viem.isHex.call(void 0, t)?t:_viem.toHex.call(void 0, t),i=_ox.PersonalMessage.getSignPayload(n);return yield this.sign(i)})}signTransaction(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.sign(t)})}sign(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var s;yield this.handleAuthRequired();let n=this.getJwtOrThrow(),i=t.replace("0x",""),e=yield(s=this.config.clientTEEConnection)==null?void 0:s.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:n,apiKey:this.config.crossmint.apiKey},data:{keyType:"secp256k1",bytes:i,encoding:"hex"}},options:_chunkNWOKSI3Vcjs.b});if((e==null?void 0:e.status)==="error")throw new Error(e.error);if((e==null?void 0:e.signature)==null)throw new Error("Failed to sign transaction");return c.verifyPublicKeyFormat(e.publicKey),{signature:e.signature.bytes}})}static verifyPublicKeyFormat(t){if(t==null)throw new Error("No public key found");if(t.encoding!=="hex"||t.keyType!=="secp256k1"||t.bytes==null)throw new Error("Not supported. Expected public key to be in hex encoding and secp256k1 key type. Got: "+JSON.stringify(t))}static publicKeyToEvmAddress(t){let n=_ox.PublicKey.from(`0x${t}`);return _ox.Address.fromPublicKey(n,{checksum:!0})}};exports.a = g;
@@ -1 +0,0 @@
1
- import{a as o,b as a}from"./chunk-7KHMZPZO.js";import{f as r}from"./chunk-BW7YYVZE.js";import{Address as u,PublicKey as y,PersonalMessage as p}from"ox";import{isHex as l,toHex as d}from"viem";var g=class c extends o{constructor(t){super(t)}locator(){return this.config.locator}signMessage(t){return r(this,null,function*(){let n=l(t)?t:d(t),i=p.getSignPayload(n);return yield this.sign(i)})}signTransaction(t){return r(this,null,function*(){return yield this.sign(t)})}sign(t){return r(this,null,function*(){var s;yield this.handleAuthRequired();let n=this.getJwtOrThrow(),i=t.replace("0x",""),e=yield(s=this.config.clientTEEConnection)==null?void 0:s.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:n,apiKey:this.config.crossmint.apiKey},data:{keyType:"secp256k1",bytes:i,encoding:"hex"}},options:a});if((e==null?void 0:e.status)==="error")throw new Error(e.error);if((e==null?void 0:e.signature)==null)throw new Error("Failed to sign transaction");return c.verifyPublicKeyFormat(e.publicKey),{signature:e.signature.bytes}})}static verifyPublicKeyFormat(t){if(t==null)throw new Error("No public key found");if(t.encoding!=="hex"||t.keyType!=="secp256k1"||t.bytes==null)throw new Error("Not supported. Expected public key to be in hex encoding and secp256k1 key type. Got: "+JSON.stringify(t))}static publicKeyToEvmAddress(t){let n=y.from(`0x${t}`);return u.fromPublicKey(n,{checksum:!0})}};export{g as a};
@@ -1 +0,0 @@
1
- import{a as C}from"./chunk-JBLEX3DQ.js";import{a as g}from"./chunk-SHDM6MXU.js";import{a as p}from"./chunk-IJMFCZIY.js";import{d as h,f as a}from"./chunk-7ENJXL4H.js";import{a as c,f as l}from"./chunk-BW7YYVZE.js";import{WebAuthnP256 as S}from"ox";var d=class{constructor(e){this.apiClient=e}getOrCreateWallet(e){return l(this,null,function*(){if(this.apiClient.isServerSide)throw new a("getOrCreateWallet is not supported on server side");let n=yield this.apiClient.getWallet(`me:${e.chain==="solana"?"solana":"evm"}:smart`);return n!=null&&!("error"in n)?this.createWalletInstance(n,e):this.createWallet(e)})}getWallet(e,n){return l(this,null,function*(){if(!this.apiClient.isServerSide)throw new a("getWallet is not supported on client side, use getOrCreateWallet instead");let i=yield this.apiClient.getWallet(e);if("error"in i)throw new h(JSON.stringify(i));return this.createWalletInstance(i,n)})}createWallet(e){return l(this,null,function*(){var t,r,o,s;yield(o=(r=(t=e.options)==null?void 0:t.experimental_callbacks)==null?void 0:r.onWalletCreationStart)==null?void 0:o.call(r),this.mutateSignerFromCustomAuth(e,!0);let n=e.signer.type==="passkey"?yield this.createPasskeyAdminSigner(e.signer):e.signer,i=yield this.apiClient.createWallet({type:"smart",chainType:e.chain==="solana"?"solana":"evm",config:{adminSigner:n},owner:(s=e.owner)!=null?s:void 0});if("error"in i)throw new a(JSON.stringify(i));return this.createWalletInstance(i,e)})}createWalletInstance(e,n){this.validateExistingWalletConfig(e,n);let i=this.toInternalSignerConfig(e,n.signer,n.options);return new C({chain:n.chain,address:e.address,owner:e.owner,signer:g(n.chain,i),options:n.options},this.apiClient)}toInternalSignerConfig(e,n,i){var t,r,o,s,m;if(!(e.chainType==="evm"||e.chainType==="solana"))throw new a(`Wallet type ${e.chainType} is not supported`);if(n==null&&((t=e.config)==null?void 0:t.adminSigner)==null)throw new a("Signer is required to create a wallet");switch(n.type){case"api-key":{if(((r=e.config)==null?void 0:r.adminSigner.type)!=="api-key")throw new a("API key signer does not match the wallet's signer type");return{type:"api-key",address:e.config.adminSigner.address,locator:e.config.adminSigner.locator}}case"external-wallet":if(((o=e.config)==null?void 0:o.adminSigner.type)!=="external-wallet")throw new a("External wallet signer does not match the wallet's signer type");return c(c({},e.config.adminSigner),n);case"passkey":if(((s=e.config)==null?void 0:s.adminSigner.type)!=="passkey")throw new a("Passkey signer does not match the wallet's signer type");return{type:"passkey",id:e.config.adminSigner.id,name:e.config.adminSigner.name,locator:e.config.adminSigner.locator,onCreatePasskey:n.onCreatePasskey,onSignWithPasskey:n.onSignWithPasskey};case"email":{if(((m=e.config)==null?void 0:m.adminSigner.type)!=="email")throw new a("Email signer does not match the wallet's signer type");let{locator:y,email:f}=e.config.adminSigner;return{type:"email",email:f,locator:y,crossmint:this.apiClient.crossmint,onAuthRequired:n.onAuthRequired,clientTEEConnection:i==null?void 0:i.clientTEEConnection}}default:throw new Error("Invalid signer type")}}createPasskeyAdminSigner(e){return l(this,null,function*(){var t;if(e.type!=="passkey")throw new Error("Signer is not a passkey");let n=(t=e.name)!=null?t:`Crossmint Wallet ${Date.now()}`,i=e.onCreatePasskey?yield e.onCreatePasskey(n):yield S.createCredential({name:n});return{type:"passkey",id:i.id,name:n,publicKey:{x:i.publicKey.x.toString(),y:i.publicKey.y.toString()}}})}mutateSignerFromCustomAuth(e,n=!1){var t;let{experimental_customAuth:i}=this.apiClient.crossmint;e.signer.type==="email"&&(i==null?void 0:i.email)!=null&&(e.signer.email=(t=e.signer.email)!=null?t:i.email),e.signer.type==="external-wallet"&&(i==null?void 0:i.externalWalletSigner)!=null&&(e.signer=n?{type:"external-wallet",address:i.externalWalletSigner.address}:i.externalWalletSigner)}validateExistingWalletConfig(e,n){var r;if(this.mutateSignerFromCustomAuth(n),n.owner!=null&&e.owner!=null&&n.owner!==e.owner)throw new a("Wallet owner does not match existing wallet's linked user");if(n.chain==="solana"&&e.chainType!=="solana"||n.chain!=="solana"&&e.chainType==="solana")throw new a(`Wallet chain does not match existing wallet's chain. You must use chain: ${e.chainType}.`);if(e.type!=="smart")return;let i=n.signer,t=(r=e==null?void 0:e.config)==null?void 0:r.adminSigner;if(i!=null&&t!=null){if(i.type!==t.type)throw new a("The wallet signer type provided in the wallet config does not match the existing wallet's adminSigner type");p(i,t)}}};export{d as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFWMSAG7Vcjs = require('./chunk-FWMSAG7V.cjs');var _chunkZSWIQU3Ucjs = require('./chunk-ZSWIQU3U.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var d=class{constructor(t){this.config=t;this.type="email";this._needsAuth=!0;this._authPromise=null;this.initialize()}initialize(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.config.clientTEEConnection==null){let t=_commonsdkbase.validateAPIKey.call(void 0, this.config.crossmint.apiKey);if(!t.isValid)throw new Error("Invalid API key");let r=new (0, _chunkFWMSAG7Vcjs.a)({environment:t.environment});this.config.clientTEEConnection=yield r.initialize()}})}handleAuthRequired(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var o,s,a;if(this.config.clientTEEConnection==null)throw new Error("Handshake parent not initialized");let t=yield(a=this.config.clientTEEConnection)==null?void 0:a.sendAction({event:"request:get-status",responseEvent:"response:get-status",data:{authData:{jwt:(s=(o=this.config.crossmint.experimental_customAuth)==null?void 0:o.jwt)!=null?s:"",apiKey:this.config.crossmint.apiKey}},options:h});if((t==null?void 0:t.status)!=="success")throw new Error(t==null?void 0:t.error);if(t.signerStatus==="ready"){this._needsAuth=!1;return}let{promise:r,resolve:i,reject:n}=this.createAuthPromise();if(this._authPromise={promise:r,resolve:i,reject:n},this.config.onAuthRequired)try{yield this.config.onAuthRequired(this._needsAuth,()=>this.sendEmailWithOtp(),e=>this.verifyOtp(e),()=>n(new _chunkZSWIQU3Ucjs.a))}catch(e){n(e)}try{yield r}catch(e){throw e}})}getJwtOrThrow(){var r;let t=(r=this.config.crossmint.experimental_customAuth)==null?void 0:r.jwt;if(t==null)throw new Error("JWT is required");return t}createAuthPromise(){let t,r;return{promise:new Promise((n,o)=>{t=n,r=o}),resolve:t,reject:r}}sendEmailWithOtp(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var n,o,s;if(this.config.clientTEEConnection==null)throw new Error("Handshake parent not initialized");let t=this.config.clientTEEConnection,r=`email:${this.config.email}`,i=yield t.sendAction({event:"request:start-onboarding",responseEvent:"response:start-onboarding",data:{authData:{jwt:(o=(n=this.config.crossmint.experimental_customAuth)==null?void 0:n.jwt)!=null?o:"",apiKey:this.config.crossmint.apiKey},data:{authId:r}},options:h});if((i==null?void 0:i.status)==="success"&&i.signerStatus==="ready"){this._needsAuth=!1;return}(i==null?void 0:i.status)==="error"&&(console.error("[sendEmailWithOtp] Failed to send OTP:",i),(s=this._authPromise)==null||s.reject(new Error(i.error||"Failed to initiate OTP process.")))})}verifyOtp(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i,n,o,s,a;if(this.config.clientTEEConnection==null)throw new Error("Handshake parent not initialized");let r=this.config.clientTEEConnection;try{let e=yield r.sendAction({event:"request:complete-onboarding",responseEvent:"response:complete-onboarding",data:{authData:{jwt:(n=(i=this.config.crossmint.experimental_customAuth)==null?void 0:i.jwt)!=null?n:"",apiKey:this.config.crossmint.apiKey},data:{onboardingAuthentication:{encryptedOtp:t}}},options:h});if((e==null?void 0:e.status)==="success"){this._needsAuth=!1,(o=this._authPromise)==null||o.resolve();return}console.error("[verifyOtp] Failed to validate OTP:",e),this._needsAuth=!0;let m=(e==null?void 0:e.status)==="error"?e.error:"Failed to validate encrypted OTP";(s=this._authPromise)==null||s.reject(new Error(m))}catch(e){throw console.error("[verifyOtp] Error sending OTP validation request:",e),this._needsAuth=!0,(a=this._authPromise)==null||a.reject(e),e}})}},h= exports.b ={timeoutMs:1e4,intervalMs:5e3};exports.a = d; exports.b = h;
@@ -1 +0,0 @@
1
- import{a}from"./chunk-LMDBWVPC.js";import{a as n}from"./chunk-BPUDXO56.js";import{a as l}from"./chunk-UBOWSXW3.js";import{a as o}from"./chunk-IGBQEAD5.js";import{a as t}from"./chunk-SCS4UDW7.js";import{a as m}from"./chunk-LW6JSI4J.js";import{a as i}from"./chunk-5S6YZJHE.js";function u(r,e){switch(e.type){case"email":return r==="solana"?new n(e):new a(e);case"api-key":return r==="solana"?new o(e):new m(e);case"external-wallet":return r==="solana"?new t(e):new i(e);case"passkey":return new l(e)}}export{u as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKH5LXU3Kcjs = require('./chunk-KH5LXU3K.cjs');var _chunkEXY25K62cjs = require('./chunk-EXY25K62.cjs');var _chunkYWPTI2QOcjs = require('./chunk-YWPTI2QO.cjs');var _chunk4KXOWU5Ecjs = require('./chunk-4KXOWU5E.cjs');var _chunkYTAW674Lcjs = require('./chunk-YTAW674L.cjs');var _chunkYZ4HRYSLcjs = require('./chunk-YZ4HRYSL.cjs');var _chunkBULGM35Wcjs = require('./chunk-BULGM35W.cjs');function E(r,e){switch(e.type){case"email":return r==="solana"?new (0, _chunkEXY25K62cjs.a)(e):new (0, _chunkKH5LXU3Kcjs.a)(e);case"api-key":return r==="solana"?new (0, _chunk4KXOWU5Ecjs.a)(e):new (0, _chunkYZ4HRYSLcjs.a)(e);case"external-wallet":return r==="solana"?new (0, _chunkYTAW674Lcjs.a)(e):new (0, _chunkBULGM35Wcjs.a)(e);case"passkey":return new (0, _chunkYWPTI2QOcjs.a)(e)}}exports.a = E;
@@ -1 +0,0 @@
1
- var s="@crossmint/wallets-sdk",t="0.10.14";var c="WALLETS_SDK",r=t,d=s,a=500;export{c as a,r as b,d as c,a as d};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJCXMSLR4cjs = require('./chunk-JCXMSLR4.cjs');var _chunkSLEKIJXXcjs = require('./chunk-SLEKIJXX.cjs');var _chunkRFK6N7LCcjs = require('./chunk-RFK6N7LC.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _ox = require('ox');var d=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 n=yield this.apiClient.getWallet(`me:${e.chain==="solana"?"solana":"evm"}:smart`);return n!=null&&!("error"in n)?this.createWalletInstance(n,e):this.createWallet(e)})}getWallet(e,n){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 i=yield this.apiClient.getWallet(e);if("error"in i)throw new (0, _chunkCT2UGJELcjs.d)(JSON.stringify(i));return this.createWalletInstance(i,n)})}createWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var t,r,o,s;yield(o=(r=(t=e.options)==null?void 0:t.experimental_callbacks)==null?void 0:r.onWalletCreationStart)==null?void 0:o.call(r),this.mutateSignerFromCustomAuth(e,!0);let n=e.signer.type==="passkey"?yield this.createPasskeyAdminSigner(e.signer):e.signer,i=yield this.apiClient.createWallet({type:"smart",chainType:e.chain==="solana"?"solana":"evm",config:{adminSigner:n},owner:(s=e.owner)!=null?s:void 0});if("error"in i)throw new (0, _chunkCT2UGJELcjs.f)(JSON.stringify(i));return this.createWalletInstance(i,e)})}createWalletInstance(e,n){this.validateExistingWalletConfig(e,n);let i=this.toInternalSignerConfig(e,n.signer,n.options);return new (0, _chunkJCXMSLR4cjs.a)({chain:n.chain,address:e.address,owner:e.owner,signer:_chunkSLEKIJXXcjs.a.call(void 0, n.chain,i),options:n.options},this.apiClient)}toInternalSignerConfig(e,n,i){var t,r,o,s,m;if(!(e.chainType==="evm"||e.chainType==="solana"))throw new (0, _chunkCT2UGJELcjs.f)(`Wallet type ${e.chainType} is not supported`);if(n==null&&((t=e.config)==null?void 0:t.adminSigner)==null)throw new (0, _chunkCT2UGJELcjs.f)("Signer is required to create a wallet");switch(n.type){case"api-key":{if(((r=e.config)==null?void 0:r.adminSigner.type)!=="api-key")throw new (0, _chunkCT2UGJELcjs.f)("API key signer does not match the wallet's signer type");return{type:"api-key",address:e.config.adminSigner.address,locator:e.config.adminSigner.locator}}case"external-wallet":if(((o=e.config)==null?void 0:o.adminSigner.type)!=="external-wallet")throw new (0, _chunkCT2UGJELcjs.f)("External wallet signer does not match the wallet's signer type");return _chunkXALFCQKDcjs.a.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},e.config.adminSigner),n);case"passkey":if(((s=e.config)==null?void 0:s.adminSigner.type)!=="passkey")throw new (0, _chunkCT2UGJELcjs.f)("Passkey signer does not match the wallet's signer type");return{type:"passkey",id:e.config.adminSigner.id,name:e.config.adminSigner.name,locator:e.config.adminSigner.locator,onCreatePasskey:n.onCreatePasskey,onSignWithPasskey:n.onSignWithPasskey};case"email":{if(((m=e.config)==null?void 0:m.adminSigner.type)!=="email")throw new (0, _chunkCT2UGJELcjs.f)("Email signer does not match the wallet's signer type");let{locator:y,email:f}=e.config.adminSigner;return{type:"email",email:f,locator:y,crossmint:this.apiClient.crossmint,onAuthRequired:n.onAuthRequired,clientTEEConnection:i==null?void 0:i.clientTEEConnection}}default:throw new Error("Invalid signer type")}}createPasskeyAdminSigner(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var t;if(e.type!=="passkey")throw new Error("Signer is not a passkey");let n=(t=e.name)!=null?t:`Crossmint Wallet ${Date.now()}`,i=e.onCreatePasskey?yield e.onCreatePasskey(n):yield _ox.WebAuthnP256.createCredential({name:n});return{type:"passkey",id:i.id,name:n,publicKey:{x:i.publicKey.x.toString(),y:i.publicKey.y.toString()}}})}mutateSignerFromCustomAuth(e,n=!1){var t;let{experimental_customAuth:i}=this.apiClient.crossmint;e.signer.type==="email"&&(i==null?void 0:i.email)!=null&&(e.signer.email=(t=e.signer.email)!=null?t:i.email),e.signer.type==="external-wallet"&&(i==null?void 0:i.externalWalletSigner)!=null&&(e.signer=n?{type:"external-wallet",address:i.externalWalletSigner.address}:i.externalWalletSigner)}validateExistingWalletConfig(e,n){var r;if(this.mutateSignerFromCustomAuth(n),n.owner!=null&&e.owner!=null&&n.owner!==e.owner)throw new (0, _chunkCT2UGJELcjs.f)("Wallet owner does not match existing wallet's linked user");if(n.chain==="solana"&&e.chainType!=="solana"||n.chain!=="solana"&&e.chainType==="solana")throw new (0, _chunkCT2UGJELcjs.f)(`Wallet chain does not match existing wallet's chain. You must use chain: ${e.chainType}.`);if(e.type!=="smart")return;let i=n.signer,t=(r=e==null?void 0:e.config)==null?void 0:r.adminSigner;if(i!=null&&t!=null){if(i.type!==t.type)throw new (0, _chunkCT2UGJELcjs.f)("The wallet signer type provided in the wallet config does not match the existing wallet's adminSigner type");_chunkRFK6N7LCcjs.a.call(void 0, i,t)}}};exports.a = d;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFWMSAG7Vcjs = require('../../chunk-FWMSAG7V.cjs');require('../../chunk-XALFCQKD.cjs');exports.EmailIframeManager = _chunkFWMSAG7Vcjs.a;
@@ -1 +0,0 @@
1
- import{a}from"../../chunk-PPTGFYIV.js";import"../../chunk-BW7YYVZE.js";export{a as EmailIframeManager};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNWOKSI3Vcjs = require('../../chunk-NWOKSI3V.cjs');require('../../chunk-FWMSAG7V.cjs');require('../../chunk-ZSWIQU3U.cjs');require('../../chunk-XALFCQKD.cjs');exports.DEFAULT_EVENT_OPTIONS = _chunkNWOKSI3Vcjs.b; exports.EmailSigner = _chunkNWOKSI3Vcjs.a;
@@ -1 +0,0 @@
1
- import{a,b}from"../../chunk-7KHMZPZO.js";import"../../chunk-PPTGFYIV.js";import"../../chunk-M4ELAV7U.js";import"../../chunk-BW7YYVZE.js";export{b as DEFAULT_EVENT_OPTIONS,a as EmailSigner};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKH5LXU3Kcjs = require('../../chunk-KH5LXU3K.cjs');require('../../chunk-NWOKSI3V.cjs');require('../../chunk-FWMSAG7V.cjs');require('../../chunk-ZSWIQU3U.cjs');require('../../chunk-XALFCQKD.cjs');exports.EvmEmailSigner = _chunkKH5LXU3Kcjs.a;
@@ -1 +0,0 @@
1
- import{a}from"../../chunk-LMDBWVPC.js";import"../../chunk-7KHMZPZO.js";import"../../chunk-PPTGFYIV.js";import"../../chunk-M4ELAV7U.js";import"../../chunk-BW7YYVZE.js";export{a as EvmEmailSigner};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-VMEGMTOD.cjs');var _chunkKH5LXU3Kcjs = require('../../chunk-KH5LXU3K.cjs');var _chunkEXY25K62cjs = require('../../chunk-EXY25K62.cjs');var _chunkNWOKSI3Vcjs = require('../../chunk-NWOKSI3V.cjs');require('../../chunk-FWMSAG7V.cjs');require('../../chunk-ZSWIQU3U.cjs');require('../../chunk-XALFCQKD.cjs');exports.DEFAULT_EVENT_OPTIONS = _chunkNWOKSI3Vcjs.b; exports.EmailSigner = _chunkNWOKSI3Vcjs.a; exports.EvmEmailSigner = _chunkKH5LXU3Kcjs.a; exports.SolanaEmailSigner = _chunkEXY25K62cjs.a;
@@ -1,10 +0,0 @@
1
- export { DEFAULT_EVENT_OPTIONS, EmailSigner } from './email-signer.cjs';
2
- export { SolanaEmailSigner } from './solana-email-signer.cjs';
3
- export { EvmEmailSigner } from './evm-email-signer.cjs';
4
- import '../types.cjs';
5
- import 'ox';
6
- import '@crossmint/client-sdk-window';
7
- import '@crossmint/client-signers';
8
- import '@crossmint/common-sdk-base';
9
- import '../../chains/chains.cjs';
10
- import 'viem';
@@ -1,10 +0,0 @@
1
- export { DEFAULT_EVENT_OPTIONS, EmailSigner } from './email-signer.js';
2
- export { SolanaEmailSigner } from './solana-email-signer.js';
3
- export { EvmEmailSigner } from './evm-email-signer.js';
4
- import '../types.js';
5
- import 'ox';
6
- import '@crossmint/client-sdk-window';
7
- import '@crossmint/client-signers';
8
- import '@crossmint/common-sdk-base';
9
- import '../../chains/chains.js';
10
- import 'viem';
@@ -1 +0,0 @@
1
- import"../../chunk-TN6YXWPL.js";import{a as d}from"../../chunk-LMDBWVPC.js";import{a as c}from"../../chunk-BPUDXO56.js";import{a,b}from"../../chunk-7KHMZPZO.js";import"../../chunk-PPTGFYIV.js";import"../../chunk-M4ELAV7U.js";import"../../chunk-BW7YYVZE.js";export{b as DEFAULT_EVENT_OPTIONS,a as EmailSigner,d as EvmEmailSigner,c as SolanaEmailSigner};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkEXY25K62cjs = require('../../chunk-EXY25K62.cjs');require('../../chunk-NWOKSI3V.cjs');require('../../chunk-FWMSAG7V.cjs');require('../../chunk-ZSWIQU3U.cjs');require('../../chunk-XALFCQKD.cjs');exports.SolanaEmailSigner = _chunkEXY25K62cjs.a;
@@ -1 +0,0 @@
1
- import{a}from"../../chunk-BPUDXO56.js";import"../../chunk-7KHMZPZO.js";import"../../chunk-PPTGFYIV.js";import"../../chunk-M4ELAV7U.js";import"../../chunk-BW7YYVZE.js";export{a as SolanaEmailSigner};
File without changes
File without changes
File without changes
File without changes