@crossmint/wallets-sdk 0.16.2 → 0.18.0
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.
- package/dist/api/client.cjs +1 -1
- package/dist/api/client.js +1 -1
- package/dist/api/index.cjs +1 -1
- package/dist/api/index.js +1 -1
- package/dist/chunk-26IAM7ID.js +3 -0
- package/dist/{chunk-RIZWHXCB.cjs → chunk-2XVV7Z43.cjs} +1 -1
- package/dist/{chunk-OW67X6EC.cjs → chunk-2YH3NVVK.cjs} +1 -1
- package/dist/chunk-5D4EGVG6.cjs +1 -0
- package/dist/{chunk-YDEWMACN.js → chunk-5G6JZ2P4.js} +1 -1
- package/dist/chunk-5QIW67NU.cjs +1 -0
- package/dist/chunk-7QSXW5GQ.js +1 -0
- package/dist/chunk-7QY4M232.cjs +1 -0
- package/dist/chunk-BQZES4ST.js +1 -0
- package/dist/{chunk-OLCZFWKH.cjs → chunk-DUPLYVUD.cjs} +1 -1
- package/dist/chunk-FOSTI2VM.cjs +1 -0
- package/dist/chunk-H3T7K4MG.cjs +3 -0
- package/dist/{chunk-R3JAO27Z.js → chunk-H4T4IXCF.js} +1 -1
- package/dist/{chunk-V22Y23TM.js → chunk-HJ5EDMTA.js} +1 -1
- package/dist/chunk-HPHVJ6BA.cjs +1 -0
- package/dist/chunk-IWSZUMTC.js +1 -0
- package/dist/{chunk-JWMWUVDK.cjs → chunk-JU74KWSY.cjs} +1 -1
- package/dist/chunk-K6PCO4LF.cjs +1 -0
- package/dist/{chunk-6BVOLSQ3.cjs → chunk-KO6QYKDX.cjs} +1 -1
- package/dist/chunk-KRV3IXJU.cjs +1 -0
- package/dist/chunk-O3ESESNR.js +1 -0
- package/dist/chunk-P6JJHAAV.js +1 -0
- package/dist/{chunk-NM7Y5JRD.cjs → chunk-QCWNERNJ.cjs} +1 -1
- package/dist/chunk-T526WFJB.js +1 -0
- package/dist/{chunk-IOGQFRQQ.js → chunk-UNBXKCNN.js} +1 -1
- package/dist/{chunk-EVNUDPPW.js → chunk-UPQJFPD6.js} +1 -1
- package/dist/{chunk-5XRYJ3JS.js → chunk-VY634F3J.js} +1 -1
- package/dist/chunk-WQP2FSVI.js +1 -0
- package/dist/{chunk-HAP32ODU.cjs → chunk-WYYAPI4G.cjs} +1 -1
- package/dist/chunk-ZZ4BKHSP.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/sdk.cjs +1 -1
- package/dist/sdk.js +1 -1
- package/dist/signers/index.cjs +1 -1
- package/dist/signers/index.js +1 -1
- package/dist/signers/non-custodial/index.cjs +1 -1
- package/dist/signers/non-custodial/index.js +1 -1
- package/dist/signers/non-custodial/ncs-evm-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-evm-signer.d.cts +4 -0
- package/dist/signers/non-custodial/ncs-evm-signer.d.ts +4 -0
- package/dist/signers/non-custodial/ncs-evm-signer.js +1 -1
- package/dist/signers/non-custodial/ncs-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-signer.d.cts +14 -1
- package/dist/signers/non-custodial/ncs-signer.d.ts +14 -1
- package/dist/signers/non-custodial/ncs-signer.js +1 -1
- package/dist/signers/non-custodial/ncs-solana-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-solana-signer.d.cts +4 -0
- package/dist/signers/non-custodial/ncs-solana-signer.d.ts +4 -0
- package/dist/signers/non-custodial/ncs-solana-signer.js +1 -1
- package/dist/signers/non-custodial/ncs-stellar-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-stellar-signer.d.cts +4 -0
- package/dist/signers/non-custodial/ncs-stellar-signer.d.ts +4 -0
- package/dist/signers/non-custodial/ncs-stellar-signer.js +1 -1
- package/dist/signers/types.cjs +1 -1
- package/dist/signers/types.d.cts +7 -2
- package/dist/signers/types.d.ts +7 -2
- package/dist/signers/types.js +1 -1
- package/dist/utils/constants.cjs +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/signer-validation.cjs +1 -1
- package/dist/utils/signer-validation.js +1 -1
- package/dist/wallets/evm.cjs +1 -1
- package/dist/wallets/evm.js +1 -1
- package/dist/wallets/solana.cjs +1 -1
- package/dist/wallets/solana.js +1 -1
- package/dist/wallets/stellar.cjs +1 -1
- package/dist/wallets/stellar.js +1 -1
- package/dist/wallets/types.d.cts +1 -0
- package/dist/wallets/types.d.ts +1 -0
- package/dist/wallets/wallet-factory.cjs +1 -1
- package/dist/wallets/wallet-factory.d.cts +1 -0
- package/dist/wallets/wallet-factory.d.ts +1 -0
- package/dist/wallets/wallet-factory.js +1 -1
- package/dist/wallets/wallet.cjs +1 -1
- package/dist/wallets/wallet.d.cts +2 -0
- package/dist/wallets/wallet.d.ts +2 -0
- package/dist/wallets/wallet.js +1 -1
- package/package.json +2 -1
- package/dist/chunk-23BRREJG.cjs +0 -1
- package/dist/chunk-6W3GRV4R.js +0 -1
- package/dist/chunk-BHGNJYYE.js +0 -1
- package/dist/chunk-FFCUFPLT.cjs +0 -1
- package/dist/chunk-GMPSYWQ2.js +0 -1
- package/dist/chunk-GSTYVHP5.cjs +0 -1
- package/dist/chunk-LDV2PXAM.js +0 -1
- package/dist/chunk-M4ELAV7U.js +0 -1
- package/dist/chunk-NYTVCLEC.cjs +0 -1
- package/dist/chunk-OHS5BRYO.js +0 -3
- package/dist/chunk-S2DXLOBL.js +0 -1
- package/dist/chunk-S3JEOTZR.js +0 -1
- package/dist/chunk-UNQMKW7D.cjs +0 -1
- package/dist/chunk-WPSU4D5A.cjs +0 -1
- package/dist/chunk-XKIM42AR.cjs +0 -3
- package/dist/chunk-XKLBVV54.js +0 -1
- package/dist/chunk-ZSWIQU3U.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Signer, EmailInternalSignerConfig, PhoneInternalSignerConfig, BaseSignResult } from '../types.cjs';
|
|
1
|
+
import { Signer, EmailInternalSignerConfig, PhoneInternalSignerConfig, BaseSignResult, ExportSignerTEEConnection } from '../types.cjs';
|
|
2
2
|
import 'ox';
|
|
3
3
|
import '@crossmint/client-sdk-window';
|
|
4
4
|
import '@crossmint/client-signers';
|
|
@@ -29,6 +29,19 @@ declare abstract class NonCustodialSigner implements Signer {
|
|
|
29
29
|
private sendMessageWithOtp;
|
|
30
30
|
private getAuthId;
|
|
31
31
|
private verifyOtp;
|
|
32
|
+
/**
|
|
33
|
+
* Export the private key for this signer
|
|
34
|
+
* @throws {Error} If signer is not authenticated
|
|
35
|
+
*/
|
|
36
|
+
_exportPrivateKey(exportTEEConnection: ExportSignerTEEConnection): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Get the appropriate scheme and encoding based on the chain
|
|
39
|
+
* Must be implemented by concrete classes
|
|
40
|
+
*/
|
|
41
|
+
protected abstract getChainKeyParams(): {
|
|
42
|
+
scheme: "secp256k1" | "ed25519";
|
|
43
|
+
encoding: "base58" | "hex" | "strkey";
|
|
44
|
+
};
|
|
32
45
|
}
|
|
33
46
|
declare const DEFAULT_EVENT_OPTIONS: {
|
|
34
47
|
timeoutMs: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Signer, EmailInternalSignerConfig, PhoneInternalSignerConfig, BaseSignResult } from '../types.js';
|
|
1
|
+
import { Signer, EmailInternalSignerConfig, PhoneInternalSignerConfig, BaseSignResult, ExportSignerTEEConnection } from '../types.js';
|
|
2
2
|
import 'ox';
|
|
3
3
|
import '@crossmint/client-sdk-window';
|
|
4
4
|
import '@crossmint/client-signers';
|
|
@@ -29,6 +29,19 @@ declare abstract class NonCustodialSigner implements Signer {
|
|
|
29
29
|
private sendMessageWithOtp;
|
|
30
30
|
private getAuthId;
|
|
31
31
|
private verifyOtp;
|
|
32
|
+
/**
|
|
33
|
+
* Export the private key for this signer
|
|
34
|
+
* @throws {Error} If signer is not authenticated
|
|
35
|
+
*/
|
|
36
|
+
_exportPrivateKey(exportTEEConnection: ExportSignerTEEConnection): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Get the appropriate scheme and encoding based on the chain
|
|
39
|
+
* Must be implemented by concrete classes
|
|
40
|
+
*/
|
|
41
|
+
protected abstract getChainKeyParams(): {
|
|
42
|
+
scheme: "secp256k1" | "ed25519";
|
|
43
|
+
encoding: "base58" | "hex" | "strkey";
|
|
44
|
+
};
|
|
32
45
|
}
|
|
33
46
|
declare const DEFAULT_EVENT_OPTIONS: {
|
|
34
47
|
timeoutMs: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../../chunk-
|
|
1
|
+
import{a,b}from"../../chunk-HJ5EDMTA.js";import"../../chunk-JUSY5XEE.js";import"../../chunk-P6JJHAAV.js";import"../../chunk-BW7YYVZE.js";export{b as DEFAULT_EVENT_OPTIONS,a as NonCustodialSigner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKO6QYKDXcjs = require('../../chunk-KO6QYKDX.cjs');require('../../chunk-2YH3NVVK.cjs');require('../../chunk-MQP5VZCA.cjs');require('../../chunk-5QIW67NU.cjs');require('../../chunk-XALFCQKD.cjs');exports.SolanaNonCustodialSigner = _chunkKO6QYKDXcjs.a;
|
|
@@ -18,6 +18,10 @@ declare class SolanaNonCustodialSigner extends NonCustodialSigner {
|
|
|
18
18
|
keyType: string;
|
|
19
19
|
bytes: string;
|
|
20
20
|
} | null): void;
|
|
21
|
+
protected getChainKeyParams(): {
|
|
22
|
+
scheme: "ed25519";
|
|
23
|
+
encoding: "base58";
|
|
24
|
+
};
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
export { SolanaNonCustodialSigner };
|
|
@@ -18,6 +18,10 @@ declare class SolanaNonCustodialSigner extends NonCustodialSigner {
|
|
|
18
18
|
keyType: string;
|
|
19
19
|
bytes: string;
|
|
20
20
|
} | null): void;
|
|
21
|
+
protected getChainKeyParams(): {
|
|
22
|
+
scheme: "ed25519";
|
|
23
|
+
encoding: "base58";
|
|
24
|
+
};
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
export { SolanaNonCustodialSigner };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-VY634F3J.js";import"../../chunk-HJ5EDMTA.js";import"../../chunk-JUSY5XEE.js";import"../../chunk-P6JJHAAV.js";import"../../chunk-BW7YYVZE.js";export{a as SolanaNonCustodialSigner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2XVV7Z43cjs = require('../../chunk-2XVV7Z43.cjs');require('../../chunk-2YH3NVVK.cjs');require('../../chunk-MQP5VZCA.cjs');require('../../chunk-5QIW67NU.cjs');require('../../chunk-XALFCQKD.cjs');exports.StellarNonCustodialSigner = _chunk2XVV7Z43cjs.a;
|
|
@@ -18,6 +18,10 @@ declare class StellarNonCustodialSigner extends NonCustodialSigner {
|
|
|
18
18
|
keyType: string;
|
|
19
19
|
bytes: string;
|
|
20
20
|
} | null): void;
|
|
21
|
+
protected getChainKeyParams(): {
|
|
22
|
+
scheme: "ed25519";
|
|
23
|
+
encoding: "strkey";
|
|
24
|
+
};
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
export { StellarNonCustodialSigner };
|
|
@@ -18,6 +18,10 @@ declare class StellarNonCustodialSigner extends NonCustodialSigner {
|
|
|
18
18
|
keyType: string;
|
|
19
19
|
bytes: string;
|
|
20
20
|
} | null): void;
|
|
21
|
+
protected getChainKeyParams(): {
|
|
22
|
+
scheme: "ed25519";
|
|
23
|
+
encoding: "strkey";
|
|
24
|
+
};
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
export { StellarNonCustodialSigner };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-H4T4IXCF.js";import"../../chunk-HJ5EDMTA.js";import"../../chunk-JUSY5XEE.js";import"../../chunk-P6JJHAAV.js";import"../../chunk-BW7YYVZE.js";export{a as StellarNonCustodialSigner};
|
package/dist/signers/types.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5QIW67NUcjs = require('../chunk-5QIW67NU.cjs');require('../chunk-XALFCQKD.cjs');exports.AuthRejectedError = _chunk5QIW67NUcjs.a; exports.isExportableSigner = _chunk5QIW67NUcjs.b;
|
package/dist/signers/types.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WebAuthnP256 } from 'ox';
|
|
2
2
|
import { HandshakeParent } from '@crossmint/client-sdk-window';
|
|
3
|
-
import { signerOutboundEvents, signerInboundEvents } from '@crossmint/client-signers';
|
|
3
|
+
import { exportSignerOutboundEvents, exportSignerInboundEvents, signerOutboundEvents, signerInboundEvents } from '@crossmint/client-signers';
|
|
4
4
|
import { SolanaExternalWalletSignerConfig, StellarExternalWalletSignerConfig, EvmExternalWalletSignerConfig, Crossmint } from '@crossmint/common-sdk-base';
|
|
5
5
|
export { EvmExternalWalletSignerConfig, GenericEIP1193Provider, SolanaExternalWalletSignerConfig, StellarExternalWalletSignerConfig } from '@crossmint/common-sdk-base';
|
|
6
6
|
import { Chain, SolanaChain, StellarChain } from '../chains/chains.cjs';
|
|
@@ -82,5 +82,10 @@ interface Signer<T extends keyof SignResultMap = keyof SignResultMap> {
|
|
|
82
82
|
signMessage(message: string): Promise<SignResultMap[T]>;
|
|
83
83
|
signTransaction(transaction: string): Promise<SignResultMap[T]>;
|
|
84
84
|
}
|
|
85
|
+
interface ExportableSigner extends Signer {
|
|
86
|
+
_exportPrivateKey: (exportTEEConnection: ExportSignerTEEConnection) => Promise<void>;
|
|
87
|
+
}
|
|
88
|
+
declare function isExportableSigner(signer: Signer): signer is ExportableSigner;
|
|
89
|
+
type ExportSignerTEEConnection = HandshakeParent<typeof exportSignerOutboundEvents, typeof exportSignerInboundEvents>;
|
|
85
90
|
|
|
86
|
-
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 };
|
|
91
|
+
export { type ApiKeyInternalSignerConfig, type ApiKeySignerConfig, AuthRejectedError, type BaseSignResult, type BaseSignerConfig, type EmailInternalSignerConfig, type EmailSignerConfig, type ExportSignerTEEConnection, type ExportableSigner, type ExternalWalletInternalSignerConfig, type ExternalWalletSignerConfigForChain, type InternalSignerConfig, type NonCustodialSignerType, type PasskeyInternalSignerConfig, type PasskeySignResult, type PasskeySignerConfig, type PhoneInternalSignerConfig, type PhoneSignerConfig, type Signer, type SignerConfigForChain, isExportableSigner };
|
package/dist/signers/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WebAuthnP256 } from 'ox';
|
|
2
2
|
import { HandshakeParent } from '@crossmint/client-sdk-window';
|
|
3
|
-
import { signerOutboundEvents, signerInboundEvents } from '@crossmint/client-signers';
|
|
3
|
+
import { exportSignerOutboundEvents, exportSignerInboundEvents, signerOutboundEvents, signerInboundEvents } from '@crossmint/client-signers';
|
|
4
4
|
import { SolanaExternalWalletSignerConfig, StellarExternalWalletSignerConfig, EvmExternalWalletSignerConfig, Crossmint } from '@crossmint/common-sdk-base';
|
|
5
5
|
export { EvmExternalWalletSignerConfig, GenericEIP1193Provider, SolanaExternalWalletSignerConfig, StellarExternalWalletSignerConfig } from '@crossmint/common-sdk-base';
|
|
6
6
|
import { Chain, SolanaChain, StellarChain } from '../chains/chains.js';
|
|
@@ -82,5 +82,10 @@ interface Signer<T extends keyof SignResultMap = keyof SignResultMap> {
|
|
|
82
82
|
signMessage(message: string): Promise<SignResultMap[T]>;
|
|
83
83
|
signTransaction(transaction: string): Promise<SignResultMap[T]>;
|
|
84
84
|
}
|
|
85
|
+
interface ExportableSigner extends Signer {
|
|
86
|
+
_exportPrivateKey: (exportTEEConnection: ExportSignerTEEConnection) => Promise<void>;
|
|
87
|
+
}
|
|
88
|
+
declare function isExportableSigner(signer: Signer): signer is ExportableSigner;
|
|
89
|
+
type ExportSignerTEEConnection = HandshakeParent<typeof exportSignerOutboundEvents, typeof exportSignerInboundEvents>;
|
|
85
90
|
|
|
86
|
-
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 };
|
|
91
|
+
export { type ApiKeyInternalSignerConfig, type ApiKeySignerConfig, AuthRejectedError, type BaseSignResult, type BaseSignerConfig, type EmailInternalSignerConfig, type EmailSignerConfig, type ExportSignerTEEConnection, type ExportableSigner, type ExternalWalletInternalSignerConfig, type ExternalWalletSignerConfigForChain, type InternalSignerConfig, type NonCustodialSignerType, type PasskeyInternalSignerConfig, type PasskeySignResult, type PasskeySignerConfig, type PhoneInternalSignerConfig, type PhoneSignerConfig, type Signer, type SignerConfigForChain, isExportableSigner };
|
package/dist/signers/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-P6JJHAAV.js";import"../chunk-BW7YYVZE.js";export{a as AuthRejectedError,b as isExportableSigner};
|
package/dist/utils/constants.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQCWNERNJcjs = require('../chunk-QCWNERNJ.cjs');require('../chunk-XALFCQKD.cjs');exports.SDK_NAME = _chunkQCWNERNJcjs.c; exports.SDK_VERSION = _chunkQCWNERNJcjs.b; exports.STATUS_POLLING_INTERVAL_MS = _chunkQCWNERNJcjs.d; exports.WALLETS_SERVICE = _chunkQCWNERNJcjs.a;
|
package/dist/utils/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"../chunk-
|
|
1
|
+
import{a,b,c,d}from"../chunk-ZZ4BKHSP.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
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKRV3IXJUcjs = require('../chunk-KRV3IXJU.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-XALFCQKD.cjs');exports.compareSignerConfigs = _chunkKRV3IXJUcjs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-BQZES4ST.js";import"../chunk-PSXRNSOE.js";import"../chunk-BW7YYVZE.js";export{a as compareSignerConfigs};
|
package/dist/wallets/evm.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7QY4M232cjs = require('../chunk-7QY4M232.cjs');require('../chunk-5D4EGVG6.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-KO6QYKDX.cjs');require('../chunk-2XVV7Z43.cjs');require('../chunk-HPHVJ6BA.cjs');require('../chunk-2YH3NVVK.cjs');require('../chunk-MQP5VZCA.cjs');require('../chunk-5QIW67NU.cjs');require('../chunk-QCWNERNJ.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-WZFHEUWT.cjs');require('../chunk-IR5WN6FQ.cjs');require('../chunk-GEY574TH.cjs');require('../chunk-XALFCQKD.cjs');exports.EVMWallet = _chunk7QY4M232cjs.a;
|
package/dist/wallets/evm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-7QSXW5GQ.js";import"../chunk-IWSZUMTC.js";import"../chunk-YDZRBHS3.js";import"../chunk-VY634F3J.js";import"../chunk-H4T4IXCF.js";import"../chunk-WQP2FSVI.js";import"../chunk-HJ5EDMTA.js";import"../chunk-JUSY5XEE.js";import"../chunk-P6JJHAAV.js";import"../chunk-ZZ4BKHSP.js";import"../chunk-PSXRNSOE.js";import"../chunk-RJZV72YF.js";import"../chunk-KKQBZXFE.js";import"../chunk-S3DYQVRD.js";import"../chunk-BW7YYVZE.js";export{a as EVMWallet};
|
package/dist/wallets/solana.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkK6PCO4LFcjs = require('../chunk-K6PCO4LF.cjs');require('../chunk-5D4EGVG6.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-KO6QYKDX.cjs');require('../chunk-2XVV7Z43.cjs');require('../chunk-HPHVJ6BA.cjs');require('../chunk-2YH3NVVK.cjs');require('../chunk-MQP5VZCA.cjs');require('../chunk-HRSVFJND.cjs');require('../chunk-5QIW67NU.cjs');require('../chunk-QCWNERNJ.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-XALFCQKD.cjs');exports.SolanaWallet = _chunkK6PCO4LFcjs.a;
|
package/dist/wallets/solana.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-O3ESESNR.js";import"../chunk-IWSZUMTC.js";import"../chunk-YDZRBHS3.js";import"../chunk-VY634F3J.js";import"../chunk-H4T4IXCF.js";import"../chunk-WQP2FSVI.js";import"../chunk-HJ5EDMTA.js";import"../chunk-JUSY5XEE.js";import"../chunk-6PVKL5RC.js";import"../chunk-P6JJHAAV.js";import"../chunk-ZZ4BKHSP.js";import"../chunk-PSXRNSOE.js";import"../chunk-BW7YYVZE.js";export{a as SolanaWallet};
|
package/dist/wallets/stellar.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFOSTI2VMcjs = require('../chunk-FOSTI2VM.cjs');require('../chunk-5D4EGVG6.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-KO6QYKDX.cjs');require('../chunk-2XVV7Z43.cjs');require('../chunk-HPHVJ6BA.cjs');require('../chunk-2YH3NVVK.cjs');require('../chunk-MQP5VZCA.cjs');require('../chunk-5QIW67NU.cjs');require('../chunk-QCWNERNJ.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-XALFCQKD.cjs');exports.StellarWallet = _chunkFOSTI2VMcjs.a;
|
package/dist/wallets/stellar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-T526WFJB.js";import"../chunk-IWSZUMTC.js";import"../chunk-YDZRBHS3.js";import"../chunk-VY634F3J.js";import"../chunk-H4T4IXCF.js";import"../chunk-WQP2FSVI.js";import"../chunk-HJ5EDMTA.js";import"../chunk-JUSY5XEE.js";import"../chunk-P6JJHAAV.js";import"../chunk-ZZ4BKHSP.js";import"../chunk-PSXRNSOE.js";import"../chunk-BW7YYVZE.js";export{a as StellarWallet};
|
package/dist/wallets/types.d.cts
CHANGED
package/dist/wallets/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkH3T7K4MGcjs = require('../chunk-H3T7K4MG.cjs');require('../chunk-KRV3IXJU.cjs');require('../chunk-5D4EGVG6.cjs');require('../chunk-WYYAPI4G.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-KO6QYKDX.cjs');require('../chunk-2XVV7Z43.cjs');require('../chunk-HPHVJ6BA.cjs');require('../chunk-2YH3NVVK.cjs');require('../chunk-MQP5VZCA.cjs');require('../chunk-YWPTI2QO.cjs');require('../chunk-4KXOWU5E.cjs');require('../chunk-HRSVFJND.cjs');require('../chunk-C3T63EC7.cjs');require('../chunk-5QIW67NU.cjs');require('../chunk-QCWNERNJ.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-YZ4HRYSL.cjs');require('../chunk-M4TOGGLV.cjs');require('../chunk-XALFCQKD.cjs');exports.WalletFactory = _chunkH3T7K4MGcjs.a;
|
|
@@ -21,6 +21,7 @@ declare class WalletFactory {
|
|
|
21
21
|
createWallet<C extends Chain>(args: WalletArgsFor<C>): Promise<Wallet<C>>;
|
|
22
22
|
private createWalletInstance;
|
|
23
23
|
private toInternalSignerConfig;
|
|
24
|
+
private getWalletLocator;
|
|
24
25
|
private createPasskeyAdminSigner;
|
|
25
26
|
private mutateSignerFromCustomAuth;
|
|
26
27
|
private validateExistingWalletConfig;
|
|
@@ -21,6 +21,7 @@ declare class WalletFactory {
|
|
|
21
21
|
createWallet<C extends Chain>(args: WalletArgsFor<C>): Promise<Wallet<C>>;
|
|
22
22
|
private createWalletInstance;
|
|
23
23
|
private toInternalSignerConfig;
|
|
24
|
+
private getWalletLocator;
|
|
24
25
|
private createPasskeyAdminSigner;
|
|
25
26
|
private mutateSignerFromCustomAuth;
|
|
26
27
|
private validateExistingWalletConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-26IAM7ID.js";import"../chunk-BQZES4ST.js";import"../chunk-IWSZUMTC.js";import"../chunk-UNBXKCNN.js";import"../chunk-YDZRBHS3.js";import"../chunk-VY634F3J.js";import"../chunk-H4T4IXCF.js";import"../chunk-WQP2FSVI.js";import"../chunk-HJ5EDMTA.js";import"../chunk-JUSY5XEE.js";import"../chunk-UBOWSXW3.js";import"../chunk-IGBQEAD5.js";import"../chunk-6PVKL5RC.js";import"../chunk-2SHDBC47.js";import"../chunk-P6JJHAAV.js";import"../chunk-ZZ4BKHSP.js";import"../chunk-PSXRNSOE.js";import"../chunk-LW6JSI4J.js";import"../chunk-3APSOOE3.js";import"../chunk-BW7YYVZE.js";export{a as WalletFactory};
|
package/dist/wallets/wallet.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5D4EGVG6cjs = require('../chunk-5D4EGVG6.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-KO6QYKDX.cjs');require('../chunk-2XVV7Z43.cjs');require('../chunk-HPHVJ6BA.cjs');require('../chunk-2YH3NVVK.cjs');require('../chunk-MQP5VZCA.cjs');require('../chunk-5QIW67NU.cjs');require('../chunk-QCWNERNJ.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-XALFCQKD.cjs');exports.Wallet = _chunk5D4EGVG6cjs.a;
|
|
@@ -16,6 +16,7 @@ type WalletContructorType<C extends Chain> = {
|
|
|
16
16
|
chain: C;
|
|
17
17
|
address: string;
|
|
18
18
|
owner?: string;
|
|
19
|
+
alias?: string;
|
|
19
20
|
signer: Signer;
|
|
20
21
|
options?: WalletOptions;
|
|
21
22
|
};
|
|
@@ -24,6 +25,7 @@ declare class Wallet<C extends Chain> {
|
|
|
24
25
|
chain: C;
|
|
25
26
|
address: string;
|
|
26
27
|
owner?: string;
|
|
28
|
+
alias?: string;
|
|
27
29
|
signer: Signer;
|
|
28
30
|
constructor(args: WalletContructorType<C>, apiClient: ApiClient);
|
|
29
31
|
protected static getApiClient<C extends Chain>(wallet: Wallet<C>): ApiClient;
|
package/dist/wallets/wallet.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ type WalletContructorType<C extends Chain> = {
|
|
|
16
16
|
chain: C;
|
|
17
17
|
address: string;
|
|
18
18
|
owner?: string;
|
|
19
|
+
alias?: string;
|
|
19
20
|
signer: Signer;
|
|
20
21
|
options?: WalletOptions;
|
|
21
22
|
};
|
|
@@ -24,6 +25,7 @@ declare class Wallet<C extends Chain> {
|
|
|
24
25
|
chain: C;
|
|
25
26
|
address: string;
|
|
26
27
|
owner?: string;
|
|
28
|
+
alias?: string;
|
|
27
29
|
signer: Signer;
|
|
28
30
|
constructor(args: WalletContructorType<C>, apiClient: ApiClient);
|
|
29
31
|
protected static getApiClient<C extends Chain>(wallet: Wallet<C>): ApiClient;
|
package/dist/wallets/wallet.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-IWSZUMTC.js";import"../chunk-YDZRBHS3.js";import"../chunk-VY634F3J.js";import"../chunk-H4T4IXCF.js";import"../chunk-WQP2FSVI.js";import"../chunk-HJ5EDMTA.js";import"../chunk-JUSY5XEE.js";import"../chunk-P6JJHAAV.js";import"../chunk-ZZ4BKHSP.js";import"../chunk-PSXRNSOE.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.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"repository": "https://github.com/Crossmint/crossmint-sdk",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Paella Labs Inc",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"viem": "2.33.1",
|
|
29
29
|
"@crossmint/client-sdk-window": "1.0.5",
|
|
30
30
|
"@crossmint/client-signers": "0.0.20",
|
|
31
|
+
"@crossmint/common-sdk-auth": "1.0.57",
|
|
31
32
|
"@crossmint/common-sdk-base": "0.9.7"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
package/dist/chunk-23BRREJG.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var u=(n,o,t)=>`Wallet signer configuration mismatch at "${n}" - expected "${t}" from existing wallet but found "${o}"`;function a(n,o,t=""){if(n!==o){if(n==null||o==null)throw new Error(`Cannot compare null or undefined signer configs at path: ${t}`);for(let r of Object.keys(n)){if(!(r in o))continue;let c=t?`${t}.${r}`:r,e=n[r],s=o[r];if(typeof e=="object"&&e!==null&&typeof s=="object"&&s!==null)a(e,s,c);else if(e!==s)throw new (0, _chunkO4FVTK7Xcjs.f)(u(c,e,s))}}}exports.a = a;
|
package/dist/chunk-6W3GRV4R.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as o,b as a}from"./chunk-V22Y23TM.js";import{f as t}from"./chunk-BW7YYVZE.js";import{PersonalMessage as p}from"ox";import{isHex as y,toHex as l}from"viem";var g=class c extends o{constructor(n){super(n)}signMessage(n){return t(this,null,function*(){let i=y(n)?n:l(n),r=p.getSignPayload(i);return yield this.sign(r)})}signTransaction(n){return t(this,null,function*(){return yield this.sign(n)})}sign(n){return t(this,null,function*(){var s;yield this.handleAuthRequired();let i=this.getJwtOrThrow(),r=n.replace("0x",""),e=yield(s=this.config.clientTEEConnection)==null?void 0:s.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:i,apiKey:this.config.crossmint.apiKey},data:{keyType:"secp256k1",bytes:r,encoding:"hex"}},options:a});if((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(n){if(n==null)throw new Error("No public key found");if(n.encoding!=="hex"||n.keyType!=="secp256k1"||n.bytes==null)throw new Error("Not supported. Expected public key to be in hex encoding and secp256k1 key type. Got: "+JSON.stringify(n))}};export{g as a};
|
package/dist/chunk-BHGNJYYE.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as l}from"./chunk-PSXRNSOE.js";var u=(n,o,t)=>`Wallet signer configuration mismatch at "${n}" - expected "${t}" from existing wallet but found "${o}"`;function a(n,o,t=""){if(n!==o){if(n==null||o==null)throw new Error(`Cannot compare null or undefined signer configs at path: ${t}`);for(let r of Object.keys(n)){if(!(r in o))continue;let c=t?`${t}.${r}`:r,e=n[r],s=o[r];if(typeof e=="object"&&e!==null&&typeof s=="object"&&s!==null)a(e,s,c);else if(e!==s)throw new l(u(c,e,s))}}}export{a};
|
package/dist/chunk-FFCUFPLT.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkGSTYVHP5cjs = require('./chunk-GSTYVHP5.cjs');var _chunkHRSVFJNDcjs = require('./chunk-HRSVFJND.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var _commonsdkbase = require('@crossmint/common-sdk-base');var u=class T extends _chunkGSTYVHP5cjs.a{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer,options:_chunkGSTYVHP5cjs.a.getOptions(n)},_chunkGSTYVHP5cjs.a.getApiClient(n))}static from(n){if(!_commonsdkbase.isValidSolanaAddress.call(void 0, n.address))throw new Error("Wallet is not a Solana wallet");return new T(n)}sendTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var a,t;yield this.preAuthIfNeeded();let i=yield this.createTransaction(n);if((a=n.options)!=null&&a.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:i.id};let e={additionalSigners:(t=n.additionalSigners)==null?void 0:t.map(s=>new (0, _chunkHRSVFJNDcjs.a)({type:"external-wallet",address:s.publicKey.toString(),locator:`external-wallet:${s.publicKey.toString()}`,onSignTransaction:p=>(p.sign([s]),Promise.resolve(p))}))};return yield this.approveTransactionAndWait(i.id,e)})}createTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var a,t;let i=(t=(a=n.options)==null?void 0:a.experimental_signer)!=null?t:this.signer.locator(),r;"serializedTransaction"in n?r=n.serializedTransaction:r=_bs582.default.encode(n.transaction.serialize());let e=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:r,signer:i}});if("error"in e)throw new (0, _chunkO4FVTK7Xcjs.r)(JSON.stringify(e));return e})}};exports.a = u;
|
package/dist/chunk-GMPSYWQ2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./chunk-S3JEOTZR.js";import{a as d}from"./chunk-6PVKL5RC.js";import{r as l}from"./chunk-PSXRNSOE.js";import{f as c}from"./chunk-BW7YYVZE.js";import f from"bs58";import{isValidSolanaAddress as h}from"@crossmint/common-sdk-base";var u=class T extends o{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer,options:o.getOptions(n)},o.getApiClient(n))}static from(n){if(!h(n.address))throw new Error("Wallet is not a Solana wallet");return new T(n)}sendTransaction(n){return c(this,null,function*(){var a,t;yield this.preAuthIfNeeded();let i=yield this.createTransaction(n);if((a=n.options)!=null&&a.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:i.id};let e={additionalSigners:(t=n.additionalSigners)==null?void 0:t.map(s=>new d({type:"external-wallet",address:s.publicKey.toString(),locator:`external-wallet:${s.publicKey.toString()}`,onSignTransaction:p=>(p.sign([s]),Promise.resolve(p))}))};return yield this.approveTransactionAndWait(i.id,e)})}createTransaction(n){return c(this,null,function*(){var a,t;let i=(t=(a=n.options)==null?void 0:a.experimental_signer)!=null?t:this.signer.locator(),r;"serializedTransaction"in n?r=n.serializedTransaction:r=f.encode(n.transaction.serialize());let e=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:r,signer:i}});if("error"in e)throw new l(JSON.stringify(e));return e})}};export{u as a};
|
package/dist/chunk-GSTYVHP5.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOW67X6ECcjs = require('./chunk-OW67X6EC.cjs');var _chunkNM7Y5JRDcjs = require('./chunk-NM7Y5JRD.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var T,c,H= exports.a =class{constructor(e,r){_chunkXALFCQKDcjs.d.call(void 0, this,T);_chunkXALFCQKDcjs.d.call(void 0, this,c);let{chain:t,address:n,owner:i,signer:h,options:g}=e;_chunkXALFCQKDcjs.e.call(void 0, this,c,r),this.chain=t,this.address=n,this.owner=i,this.signer=h,_chunkXALFCQKDcjs.e.call(void 0, this,T,g)}static getApiClient(e){return e.apiClient}static getOptions(e){return e.options}get apiClient(){return _chunkXALFCQKDcjs.c.call(void 0, this,c)}get options(){return _chunkXALFCQKDcjs.c.call(void 0, this,T)}experimental_apiClient(){return _chunkXALFCQKDcjs.c.call(void 0, this,c)}balances(e,r){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t;switch(this.chain){case"solana":t="sol";break;case"stellar":t="xlm";break;default:t="eth";break}let n=[t,"usdc",...e!=null?e:[]],i=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getBalance(this.address,{chains:r!=null?r:[this.chain],tokens:n});if("error"in i)throw new Error(`Failed to get balances for wallet: ${JSON.stringify(i.message)}`);return this.transformBalanceResponse(i,t,e)})}transformBalanceResponse(e,r,t){let n=a=>{var m,f,v,y,S;let s=(m=a.chains)==null?void 0:m[this.chain],p={};return this.chain==="solana"&&s!=null&&"mintHash"in s?p={mintHash:s.mintHash}:this.chain==="stellar"&&s!=null&&"contractId"in s?p={contractId:s.contractId}:s!=null&&"contractAddress"in s&&(p={contractAddress:s.contractAddress}),_chunkXALFCQKDcjs.a.call(void 0, {symbol:(f=a.symbol)!=null?f:"",name:(v=a.name)!=null?v:"",amount:(y=a.amount)!=null?y:"0",decimals:a.decimals,rawAmount:(S=a.rawAmount)!=null?S:"0"},p)},i=e.find(a=>a.symbol===r),h=e.find(a=>a.symbol==="usdc"),g=e.filter(a=>a.symbol!==r&&a.symbol!=="usdc"),o=a=>{let s={symbol:a,name:a,amount:"0",decimals:0,rawAmount:"0"},p={};return this.chain==="solana"?p={mintHash:void 0}:this.chain==="stellar"?p={contractId:void 0}:p={contractAddress:void 0},_chunkXALFCQKDcjs.a.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},s),p)};return{nativeToken:i!=null?n(i):o(r),usdc:h!=null?n(h):o("usdc"),tokens:g.map(n)}}experimental_nfts(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield _chunkXALFCQKDcjs.c.call(void 0, this,c).experimental_getNfts(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},e),{chain:this.chain,address:this.address}))})}experimental_transactions(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let e=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getTransactions(this.walletLocator);if("error"in e)throw new Error(`Failed to get transactions: ${JSON.stringify(e.message)}`);return e})}experimental_transaction(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getTransaction(this.walletLocator,e);if("error"in r)throw new Error(`Failed to get transaction: ${JSON.stringify(r.error)}`);return r})}experimental_activity(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let e=yield this.apiClient.experimental_activity(this.walletLocator,{chain:this.chain});if("error"in e)throw new Error(`Failed to get activity: ${JSON.stringify(e.message)}`);return e})}send(e,r,t,n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){yield this.preAuthIfNeeded();let i=D(e),h=M(r,this.chain),g=_chunkXALFCQKDcjs.a.call(void 0, {recipient:i,amount:t},(n==null?void 0:n.experimental_signer)!=null?{signer:n.experimental_signer}:{}),o=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).send(this.walletLocator,h,g);if("message"in o)throw new (0, _chunkO4FVTK7Xcjs.r)(`Failed to send token: ${JSON.stringify(o.message)}`);return n!=null&&n.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:o.id}:yield this.approveTransactionAndWait(o.id)})}approveTransaction(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return console.warn("approveTransaction is deprecated. Use approve instead. This method will be removed in the next major version."),yield this.approve(e)})}approve(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(e.transactionId!=null)return yield this.approveTransactionAndWait(e.transactionId,e.options);if(e.signatureId!=null)return yield this.approveSignatureAndWait(e.signatureId,e.options);throw new Error("Either transactionId or signatureId must be provided")})}addDelegatedSigner(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var n,i,h;let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).registerSigner(this.walletLocator,{signer:e.signer,chain:this.chain==="solana"||this.chain==="stellar"?void 0:this.chain});if("error"in r)throw new Error(`Failed to register signer: ${JSON.stringify(r.message)}`);if(this.chain==="solana"||this.chain==="stellar"){if(!("transaction"in r)||r.transaction==null)throw new Error("Expected transaction in response for Solana/Stellar chain");let g=r.transaction.id;if((n=e.options)!=null&&n.experimental_prepareOnly)return{transactionId:g};yield this.approveTransactionAndWait(g);return}if(!("chains"in r))throw new Error("Expected chains in response for EVM chain");let t=(i=r.chains)==null?void 0:i[this.chain];if((h=e.options)!=null&&h.experimental_prepareOnly)return{signatureId:(t==null?void 0:t.status)!=="success"?t==null?void 0:t.id:void 0};if((t==null?void 0:t.status)==="awaiting-approval"){yield this.approveSignatureAndWait(t.id);return}if((t==null?void 0:t.status)==="pending"){yield this.waitForSignature(t.id);return}})}delegatedSigners(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var r,t,n;let e=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getWallet(this.walletLocator);if("error"in e)throw new (0, _chunkO4FVTK7Xcjs.d)(JSON.stringify(e));if(e.type!=="smart"||e.chainType!=="evm"&&e.chainType!=="solana"&&e.chainType!=="stellar")throw new (0, _chunkO4FVTK7Xcjs.c)(`Wallet type ${e.type} not supported`);return(n=(t=(r=e==null?void 0:e.config)==null?void 0:r.delegatedSigners)==null?void 0:t.map(i=>{let h=i.locator.indexOf(":");return{signer:`external-wallet:${h>=0?i.locator.slice(h+1):i.locator}`}}))!=null?n:[]})}get walletLocator(){return _chunkXALFCQKDcjs.c.call(void 0, this,c).isServerSide?this.address:this.chain==="stellar"?"me:stellar:smart":this.chain==="solana"?"me:solana:smart":"me:evm:smart"}preAuthIfNeeded(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){this.signer instanceof _chunkOW67X6ECcjs.a&&(yield this.signer.ensureAuthenticated())})}get isSolanaWallet(){return this.chain==="solana"}approveTransactionAndWait(e,r){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.approveTransactionInternal(e,r),yield this.sleep(1e3),yield this.waitForTransaction(e)})}approveSignatureAndWait(e,r){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=yield this.approveSignatureInternal(e,r);return!("error"in t)&&t.status==="success"&&t.outputSignature!=null?{signature:t.outputSignature,signatureId:e}:(yield this.sleep(1e3),yield this.waitForSignature(e))})}approveSignatureInternal(e,r){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var o,a;if(this.isSolanaWallet)throw new Error("Approving signatures is only supported for EVM smart wallets");let t=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getSignature(this.walletLocator,e);if("error"in t)throw new (0, _chunkO4FVTK7Xcjs.p)(JSON.stringify(t));if(this.signer.type==="api-key")return t;if((r==null?void 0:r.experimental_approval)!=null){let s=[r.experimental_approval];return yield this.executeApproveSignatureWithErrorHandling(e,s)}let n=(o=t.approvals)==null?void 0:o.pending;if(n==null)return t;let i=[...(a=r==null?void 0:r.additionalSigners)!=null?a:[],this.signer],g=(yield Promise.all(n.map(s=>{let p=i.find(m=>m.locator()===s.signer.locator);if(p==null)throw new (0, _chunkO4FVTK7Xcjs.i)(`Signer ${s.signer} not found in pending approvals`);return p.signMessage(s.message)}))).map(s=>_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},s),{signer:this.signer.locator()}));return yield this.executeApproveSignatureWithErrorHandling(e,g)})}approveTransactionInternal(e,r){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var o,a,s,p,m;let t=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getTransaction(this.walletLocator,e);if("error"in t)throw new (0, _chunkO4FVTK7Xcjs.s)(JSON.stringify(t));if(yield(s=(a=(o=_chunkXALFCQKDcjs.c.call(void 0, this,T))==null?void 0:o.experimental_callbacks)==null?void 0:a.onTransactionStart)==null?void 0:s.call(a),this.signer.type==="api-key")return t;if((r==null?void 0:r.experimental_approval)!=null){let f=[r.experimental_approval];return yield this.executeApproveTransactionWithErrorHandling(e,f)}let n=(p=t.approvals)==null?void 0:p.pending;if(n==null)return t;let i=[...(m=r==null?void 0:r.additionalSigners)!=null?m:[],this.signer],g=(yield Promise.all(n.map(f=>{let v=i.find(S=>S.locator()===f.signer.locator);if(v==null)throw new (0, _chunkO4FVTK7Xcjs.i)(`Signer ${f.signer} not found in pending approvals`);let y=t.chainType==="solana"&&"transaction"in t.onChain?t.onChain.transaction:f.message;return v.signTransaction(y)}))).map(f=>_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},f),{signer:this.signer.locator()}));return yield this.executeApproveTransactionWithErrorHandling(e,g)})}executeApproveTransactionWithErrorHandling(e,r){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).approveTransaction(this.walletLocator,e,{approvals:r});if(t.error)throw new (0, _chunkO4FVTK7Xcjs.x)(JSON.stringify(t));return t})}executeApproveSignatureWithErrorHandling(e,r){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).approveSignature(this.walletLocator,e,{approvals:r});if(t.error)throw new (0, _chunkO4FVTK7Xcjs.q)(JSON.stringify(t));return t})}waitForSignature(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=null;do if(yield new Promise(t=>setTimeout(t,_chunkNM7Y5JRDcjs.d)),r=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getSignature(this.walletLocator,e),"error"in r)throw new (0, _chunkO4FVTK7Xcjs.p)(JSON.stringify(r));while(r===null||r.status==="pending");if(r.status==="failed")throw new (0, _chunkO4FVTK7Xcjs.m)("Signature signing failed");if(!r.outputSignature)throw new (0, _chunkO4FVTK7Xcjs.p)("Signature not available");return{signature:r.outputSignature,signatureId:e}})}waitForTransaction(h){return _chunkXALFCQKDcjs.f.call(void 0, this,arguments,function*(e,r=6e4,{backoffMultiplier:t=1.1,maxBackoffMs:n=2e3,initialBackoffMs:i=_chunkNM7Y5JRDcjs.d}={}){var s;let g=Date.now(),o;do{if(Date.now()-g>r)throw new (0, _chunkO4FVTK7Xcjs.t)("Transaction confirmation timeout");if(o=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getTransaction(this.walletLocator,e),o.error)throw new (0, _chunkO4FVTK7Xcjs.s)(JSON.stringify(o));yield this.sleep(i),i=Math.min(i*t,n)}while(o.status==="pending");if(o.status==="failed")throw new (0, _chunkO4FVTK7Xcjs.u)(`Transaction sending failed: ${JSON.stringify(o.error)}`);if(o.status==="awaiting-approval")throw new (0, _chunkO4FVTK7Xcjs.v)("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let a=o.onChain.txId;if(a==null)throw new (0, _chunkO4FVTK7Xcjs.w)("Transaction hash not found on transaction response");return{hash:a,explorerLink:(s=o.onChain.explorerLink)!=null?s:"",transactionId:o.id}})}sleep(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return new Promise(r=>setTimeout(r,e))})}};T=new WeakMap,c=new WeakMap;function D(d){if(typeof d=="string")return d;if("email"in d)return`email:${d.email}`;if("x"in d)return`x:${d.x}`;if("twitter"in d)return`twitter:${d.twitter}`;if("phone"in d)return`phoneNumber:${d.phone}`;if("userId"in d)return`userId:${d.userId}`;throw new Error("Invalid recipient locator")}function M(d,e){return _commonsdkbase.isValidAddress.call(void 0, d)?`${e}:${d}`:`${e}:${d.toLowerCase()}`}exports.a = H;
|
package/dist/chunk-LDV2PXAM.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as c}from"./chunk-S3JEOTZR.js";import{k as p,o as d,r as y}from"./chunk-PSXRNSOE.js";import{a as f}from"./chunk-RJZV72YF.js";import{f as s}from"./chunk-BW7YYVZE.js";import{createPublicClient as S,encodeFunctionData as I,http as x}from"viem";import{isValidEvmAddress as E}from"@crossmint/common-sdk-base";var m=class w extends c{constructor(t){super({chain:t.chain,address:t.address,owner:t.owner,signer:t.signer,options:c.getOptions(t)},c.getApiClient(t))}static from(t){if(!E(t.address))throw new Error("Wallet is not an EVM wallet");return new w(t)}sendTransaction(t){return s(this,null,function*(){var i;yield this.preAuthIfNeeded();let e=this.buildTransaction(t),n=yield this.createTransaction(e,t.options);return(i=t.options)!=null&&i.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:n.id}:yield this.approveTransactionAndWait(n.id)})}signMessage(t){return s(this,null,function*(){var n;yield this.preAuthIfNeeded();let e=yield this.apiClient.createSignature(this.walletLocator,{type:"message",params:{message:t.message,signer:this.signer.locator(),chain:this.chain}});if("error"in e)throw new d(JSON.stringify(e));return(n=t.options)!=null&&n.experimental_prepareOnly?{signature:void 0,signatureId:e.id}:yield this.approveSignatureAndWait(e.id)})}signTypedData(t){return s(this,null,function*(){var T;yield this.preAuthIfNeeded();let{domain:e,message:n,primaryType:i,types:a,chain:r}=t;if(!e||!n||!a||!r)throw new p("Invalid typed data");let{name:u,version:l,chainId:h,verifyingContract:g,salt:C}=e;if(!u||!l||!h||!g)throw new p("Invalid typed data domain");let o=yield this.apiClient.createSignature(this.walletLocator,{type:"typed-data",params:{typedData:{domain:{name:u,version:l,chainId:Number(h),verifyingContract:g,salt:C},message:n,primaryType:i,types:a},signer:this.signer.locator(),chain:r}});if("error"in o)throw new d(JSON.stringify(o));return(T=t.options)!=null&&T.experimental_prepareOnly?{signature:void 0,signatureId:o.id}:yield this.approveSignatureAndWait(o.id)})}getViemClient(t){var e;return S({transport:(e=t==null?void 0:t.transport)!=null?e:x(),chain:f(this.chain)})}createTransaction(t,e){return s(this,null,function*(){var a;let n=(a=e==null?void 0:e.experimental_signer)!=null?a:this.signer.locator(),i=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:n,chain:this.chain,calls:[t]}});if("error"in i)throw new y(JSON.stringify(i));return i})}buildTransaction(t){var e,n,i,a,r;if("transaction"in t)return{transaction:t.transaction};if(t.abi==null)return{to:t.to,value:(n=(e=t.value)==null?void 0:e.toString())!=null?n:"0",data:(i=t.data)!=null?i:"0x"};if(!t.functionName)throw new Error("Function name is required");return{to:t.to,value:(r=(a=t.value)==null?void 0:a.toString())!=null?r:"0",data:I({abi:t.abi,functionName:t.functionName,args:t.args})}}};export{m as a};
|
package/dist/chunk-M4ELAV7U.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=class extends Error{constructor(){super("Authentication was rejected by the user"),this.name="AuthRejectedError"}};export{e as a};
|
package/dist/chunk-NYTVCLEC.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOW67X6ECcjs = require('./chunk-OW67X6EC.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _ox = require('ox');var _viem = require('viem');var g=class c extends _chunkOW67X6ECcjs.a{constructor(n){super(n)}signMessage(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let i=_viem.isHex.call(void 0, n)?n:_viem.toHex.call(void 0, n),r=_ox.PersonalMessage.getSignPayload(i);return yield this.sign(r)})}signTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.sign(n)})}sign(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var s;yield this.handleAuthRequired();let i=this.getJwtOrThrow(),r=n.replace("0x",""),e=yield(s=this.config.clientTEEConnection)==null?void 0:s.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:i,apiKey:this.config.crossmint.apiKey},data:{keyType:"secp256k1",bytes:r,encoding:"hex"}},options:_chunkOW67X6ECcjs.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(n){if(n==null)throw new Error("No public key found");if(n.encoding!=="hex"||n.keyType!=="secp256k1"||n.bytes==null)throw new Error("Not supported. Expected public key to be in hex encoding and secp256k1 key type. Got: "+JSON.stringify(n))}};exports.a = g;
|
package/dist/chunk-OHS5BRYO.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as S}from"./chunk-BHGNJYYE.js";import{a as C}from"./chunk-S3JEOTZR.js";import{a as f}from"./chunk-IOGQFRQQ.js";import{d as y,f as r}from"./chunk-PSXRNSOE.js";import{a as s,f as c}from"./chunk-BW7YYVZE.js";import{WebAuthnP256 as W}from"ox";var u="When 'delegatedSigners' is provided to a method that may fetch an existing wallet, each specified delegated signer must exist in that wallet's configuration.",w=class{constructor(e){this.apiClient=e}getOrCreateWallet(e){return c(this,null,function*(){if(this.apiClient.isServerSide)throw new r(`getOrCreateWallet can only be called from client-side code.
|
|
2
|
-
- Make sure you're running this in the browser (or another client environment), not on your server.
|
|
3
|
-
- Use your Crossmint Client API Key (not a server key).`);let n=yield this.apiClient.getWallet(`me:${this.getChainType(e.chain)}:smart`);return n!=null&&!("error"in n)?this.createWalletInstance(n,e):this.createWallet(e)})}getWallet(e,n){return c(this,null,function*(){if(!this.apiClient.isServerSide)throw new r("getWallet is not supported on client side, use getOrCreateWallet instead");let i=yield this.apiClient.getWallet(e);if("error"in i)throw new y(JSON.stringify(i));return this.createWalletInstance(i,n)})}createWallet(e){return c(this,null,function*(){var t,a,l,o;yield(l=(a=(t=e.options)==null?void 0:t.experimental_callbacks)==null?void 0:a.onWalletCreationStart)==null?void 0:l.call(a),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:this.getChainType(e.chain),config:s(s({adminSigner:n},e!=null&&e.plugins?{plugins:e.plugins}:{}),e.delegatedSigners!=null?{delegatedSigners:e.delegatedSigners}:{}),owner:(o=e.owner)!=null?o:void 0});if("error"in i)throw new r(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:f(n.chain,i),options:n.options},this.apiClient)}toInternalSignerConfig(e,n,i){var t,a,l,o,d,m;if(!(e.chainType==="evm"||e.chainType==="solana"||e.chainType==="stellar"))throw new r(`Wallet type ${e.chainType} is not supported`);if(n==null&&((t=e.config)==null?void 0:t.adminSigner)==null)throw new r("Signer is required to create a wallet");switch(n.type){case"api-key":{if(((a=e.config)==null?void 0:a.adminSigner.type)!=="api-key")throw new r("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(((l=e.config)==null?void 0:l.adminSigner.type)!=="external-wallet")throw new r("External wallet signer does not match the wallet's signer type");return s(s({},e.config.adminSigner),n);case"passkey":if(((o=e.config)==null?void 0:o.adminSigner.type)!=="passkey")throw new r("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(((d=e.config)==null?void 0:d.adminSigner.type)!=="email")throw new r("Email signer does not match the wallet's signer type");let{locator:g,email:h,address:p}=e.config.adminSigner;return{type:"email",email:h,locator:g,address:p,crossmint:this.apiClient.crossmint,onAuthRequired:n.onAuthRequired,clientTEEConnection:i==null?void 0:i.clientTEEConnection}}case"phone":{if(((m=e.config)==null?void 0:m.adminSigner.type)!=="phone")throw new r("Phone signer does not match the wallet's signer type");let{locator:g,phone:h,address:p}=e.config.adminSigner;return{type:"phone",phone:h,locator:g,address:p,crossmint:this.apiClient.crossmint,onAuthRequired:n.onAuthRequired,clientTEEConnection:i==null?void 0:i.clientTEEConnection}}default:throw new Error("Invalid signer type")}}createPasskeyAdminSigner(e){return c(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 W.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,a;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==="phone"&&(i==null?void 0:i.phone)!=null&&(e.signer.phone=(a=e.signer.phone)!=null?a:i.phone),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 a;if(this.mutateSignerFromCustomAuth(n),n.owner!=null&&e.owner!=null&&n.owner!==e.owner)throw new r("Wallet owner does not match existing wallet's linked user");if(n.chain==="solana"&&e.chainType!=="solana"||n.chain!=="solana"&&e.chainType==="solana"||n.chain==="stellar"&&e.chainType!=="stellar"||n.chain!=="stellar"&&e.chainType==="stellar")throw new r(`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=(a=e==null?void 0:e.config)==null?void 0:a.adminSigner;if(i!=null&&t!=null){if(i.type!==t.type)throw new r("The wallet signer type provided in the wallet config does not match the existing wallet's adminSigner type");S(i,t)}n.delegatedSigners!=null&&this.validateDelegatedSigners(e,n.delegatedSigners)}validateDelegatedSigners(e,n){var t;let i=(t=e==null?void 0:e.config)==null?void 0:t.delegatedSigners;if(n.length!==0){if(i==null||i.length===0)throw new r(`${n.length} delegated signer(s) specified, but wallet "${e.address}" has no delegated signers. ${u}`);for(let a of n)if(i.find(o=>o.locator===a.signer)==null){let o=i.map(d=>d.locator).join(", ");throw new r(`Delegated signer '${a.signer}' does not exist in wallet "${e.address}". Available delegated signers: ${o}. ${u}`)}}}getChainType(e){return e==="solana"?"solana":e==="stellar"?"stellar":"evm"}};export{w as a};
|
package/dist/chunk-S2DXLOBL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var s="@crossmint/wallets-sdk",t="0.16.2";var r="WALLETS_SDK",c=t,a=s,d=500;export{r as a,c as b,a as c,d};
|
package/dist/chunk-S3JEOTZR.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as J}from"./chunk-V22Y23TM.js";import{d as O}from"./chunk-S2DXLOBL.js";import{c as W,d as L,i as E,m as N,p as x,q as I,r as _,s as P,t as $,u as k,v as F,w as B,x as R}from"./chunk-PSXRNSOE.js";import{a as w,b as A,c as u,d as C,e as b,f as l}from"./chunk-BW7YYVZE.js";import{isValidAddress as G}from"@crossmint/common-sdk-base";var T,c,H=class{constructor(e,r){C(this,T);C(this,c);let{chain:t,address:n,owner:i,signer:h,options:g}=e;b(this,c,r),this.chain=t,this.address=n,this.owner=i,this.signer=h,b(this,T,g)}static getApiClient(e){return e.apiClient}static getOptions(e){return e.options}get apiClient(){return u(this,c)}get options(){return u(this,T)}experimental_apiClient(){return u(this,c)}balances(e,r){return l(this,null,function*(){let t;switch(this.chain){case"solana":t="sol";break;case"stellar":t="xlm";break;default:t="eth";break}let n=[t,"usdc",...e!=null?e:[]],i=yield u(this,c).getBalance(this.address,{chains:r!=null?r:[this.chain],tokens:n});if("error"in i)throw new Error(`Failed to get balances for wallet: ${JSON.stringify(i.message)}`);return this.transformBalanceResponse(i,t,e)})}transformBalanceResponse(e,r,t){let n=a=>{var m,f,v,y,S;let s=(m=a.chains)==null?void 0:m[this.chain],p={};return this.chain==="solana"&&s!=null&&"mintHash"in s?p={mintHash:s.mintHash}:this.chain==="stellar"&&s!=null&&"contractId"in s?p={contractId:s.contractId}:s!=null&&"contractAddress"in s&&(p={contractAddress:s.contractAddress}),w({symbol:(f=a.symbol)!=null?f:"",name:(v=a.name)!=null?v:"",amount:(y=a.amount)!=null?y:"0",decimals:a.decimals,rawAmount:(S=a.rawAmount)!=null?S:"0"},p)},i=e.find(a=>a.symbol===r),h=e.find(a=>a.symbol==="usdc"),g=e.filter(a=>a.symbol!==r&&a.symbol!=="usdc"),o=a=>{let s={symbol:a,name:a,amount:"0",decimals:0,rawAmount:"0"},p={};return this.chain==="solana"?p={mintHash:void 0}:this.chain==="stellar"?p={contractId:void 0}:p={contractAddress:void 0},w(w({},s),p)};return{nativeToken:i!=null?n(i):o(r),usdc:h!=null?n(h):o("usdc"),tokens:g.map(n)}}experimental_nfts(e){return l(this,null,function*(){return yield u(this,c).experimental_getNfts(A(w({},e),{chain:this.chain,address:this.address}))})}experimental_transactions(){return l(this,null,function*(){let e=yield u(this,c).getTransactions(this.walletLocator);if("error"in e)throw new Error(`Failed to get transactions: ${JSON.stringify(e.message)}`);return e})}experimental_transaction(e){return l(this,null,function*(){let r=yield u(this,c).getTransaction(this.walletLocator,e);if("error"in r)throw new Error(`Failed to get transaction: ${JSON.stringify(r.error)}`);return r})}experimental_activity(){return l(this,null,function*(){let e=yield this.apiClient.experimental_activity(this.walletLocator,{chain:this.chain});if("error"in e)throw new Error(`Failed to get activity: ${JSON.stringify(e.message)}`);return e})}send(e,r,t,n){return l(this,null,function*(){yield this.preAuthIfNeeded();let i=D(e),h=M(r,this.chain),g=w({recipient:i,amount:t},(n==null?void 0:n.experimental_signer)!=null?{signer:n.experimental_signer}:{}),o=yield u(this,c).send(this.walletLocator,h,g);if("message"in o)throw new _(`Failed to send token: ${JSON.stringify(o.message)}`);return n!=null&&n.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:o.id}:yield this.approveTransactionAndWait(o.id)})}approveTransaction(e){return l(this,null,function*(){return console.warn("approveTransaction is deprecated. Use approve instead. This method will be removed in the next major version."),yield this.approve(e)})}approve(e){return l(this,null,function*(){if(e.transactionId!=null)return yield this.approveTransactionAndWait(e.transactionId,e.options);if(e.signatureId!=null)return yield this.approveSignatureAndWait(e.signatureId,e.options);throw new Error("Either transactionId or signatureId must be provided")})}addDelegatedSigner(e){return l(this,null,function*(){var n,i,h;let r=yield u(this,c).registerSigner(this.walletLocator,{signer:e.signer,chain:this.chain==="solana"||this.chain==="stellar"?void 0:this.chain});if("error"in r)throw new Error(`Failed to register signer: ${JSON.stringify(r.message)}`);if(this.chain==="solana"||this.chain==="stellar"){if(!("transaction"in r)||r.transaction==null)throw new Error("Expected transaction in response for Solana/Stellar chain");let g=r.transaction.id;if((n=e.options)!=null&&n.experimental_prepareOnly)return{transactionId:g};yield this.approveTransactionAndWait(g);return}if(!("chains"in r))throw new Error("Expected chains in response for EVM chain");let t=(i=r.chains)==null?void 0:i[this.chain];if((h=e.options)!=null&&h.experimental_prepareOnly)return{signatureId:(t==null?void 0:t.status)!=="success"?t==null?void 0:t.id:void 0};if((t==null?void 0:t.status)==="awaiting-approval"){yield this.approveSignatureAndWait(t.id);return}if((t==null?void 0:t.status)==="pending"){yield this.waitForSignature(t.id);return}})}delegatedSigners(){return l(this,null,function*(){var r,t,n;let e=yield u(this,c).getWallet(this.walletLocator);if("error"in e)throw new L(JSON.stringify(e));if(e.type!=="smart"||e.chainType!=="evm"&&e.chainType!=="solana"&&e.chainType!=="stellar")throw new W(`Wallet type ${e.type} not supported`);return(n=(t=(r=e==null?void 0:e.config)==null?void 0:r.delegatedSigners)==null?void 0:t.map(i=>{let h=i.locator.indexOf(":");return{signer:`external-wallet:${h>=0?i.locator.slice(h+1):i.locator}`}}))!=null?n:[]})}get walletLocator(){return u(this,c).isServerSide?this.address:this.chain==="stellar"?"me:stellar:smart":this.chain==="solana"?"me:solana:smart":"me:evm:smart"}preAuthIfNeeded(){return l(this,null,function*(){this.signer instanceof J&&(yield this.signer.ensureAuthenticated())})}get isSolanaWallet(){return this.chain==="solana"}approveTransactionAndWait(e,r){return l(this,null,function*(){return yield this.approveTransactionInternal(e,r),yield this.sleep(1e3),yield this.waitForTransaction(e)})}approveSignatureAndWait(e,r){return l(this,null,function*(){let t=yield this.approveSignatureInternal(e,r);return!("error"in t)&&t.status==="success"&&t.outputSignature!=null?{signature:t.outputSignature,signatureId:e}:(yield this.sleep(1e3),yield this.waitForSignature(e))})}approveSignatureInternal(e,r){return l(this,null,function*(){var o,a;if(this.isSolanaWallet)throw new Error("Approving signatures is only supported for EVM smart wallets");let t=yield u(this,c).getSignature(this.walletLocator,e);if("error"in t)throw new x(JSON.stringify(t));if(this.signer.type==="api-key")return t;if((r==null?void 0:r.experimental_approval)!=null){let s=[r.experimental_approval];return yield this.executeApproveSignatureWithErrorHandling(e,s)}let n=(o=t.approvals)==null?void 0:o.pending;if(n==null)return t;let i=[...(a=r==null?void 0:r.additionalSigners)!=null?a:[],this.signer],g=(yield Promise.all(n.map(s=>{let p=i.find(m=>m.locator()===s.signer.locator);if(p==null)throw new E(`Signer ${s.signer} not found in pending approvals`);return p.signMessage(s.message)}))).map(s=>A(w({},s),{signer:this.signer.locator()}));return yield this.executeApproveSignatureWithErrorHandling(e,g)})}approveTransactionInternal(e,r){return l(this,null,function*(){var o,a,s,p,m;let t=yield u(this,c).getTransaction(this.walletLocator,e);if("error"in t)throw new P(JSON.stringify(t));if(yield(s=(a=(o=u(this,T))==null?void 0:o.experimental_callbacks)==null?void 0:a.onTransactionStart)==null?void 0:s.call(a),this.signer.type==="api-key")return t;if((r==null?void 0:r.experimental_approval)!=null){let f=[r.experimental_approval];return yield this.executeApproveTransactionWithErrorHandling(e,f)}let n=(p=t.approvals)==null?void 0:p.pending;if(n==null)return t;let i=[...(m=r==null?void 0:r.additionalSigners)!=null?m:[],this.signer],g=(yield Promise.all(n.map(f=>{let v=i.find(S=>S.locator()===f.signer.locator);if(v==null)throw new E(`Signer ${f.signer} not found in pending approvals`);let y=t.chainType==="solana"&&"transaction"in t.onChain?t.onChain.transaction:f.message;return v.signTransaction(y)}))).map(f=>A(w({},f),{signer:this.signer.locator()}));return yield this.executeApproveTransactionWithErrorHandling(e,g)})}executeApproveTransactionWithErrorHandling(e,r){return l(this,null,function*(){let t=yield u(this,c).approveTransaction(this.walletLocator,e,{approvals:r});if(t.error)throw new R(JSON.stringify(t));return t})}executeApproveSignatureWithErrorHandling(e,r){return l(this,null,function*(){let t=yield u(this,c).approveSignature(this.walletLocator,e,{approvals:r});if(t.error)throw new I(JSON.stringify(t));return t})}waitForSignature(e){return l(this,null,function*(){let r=null;do if(yield new Promise(t=>setTimeout(t,O)),r=yield u(this,c).getSignature(this.walletLocator,e),"error"in r)throw new x(JSON.stringify(r));while(r===null||r.status==="pending");if(r.status==="failed")throw new N("Signature signing failed");if(!r.outputSignature)throw new x("Signature not available");return{signature:r.outputSignature,signatureId:e}})}waitForTransaction(h){return l(this,arguments,function*(e,r=6e4,{backoffMultiplier:t=1.1,maxBackoffMs:n=2e3,initialBackoffMs:i=O}={}){var s;let g=Date.now(),o;do{if(Date.now()-g>r)throw new $("Transaction confirmation timeout");if(o=yield u(this,c).getTransaction(this.walletLocator,e),o.error)throw new P(JSON.stringify(o));yield this.sleep(i),i=Math.min(i*t,n)}while(o.status==="pending");if(o.status==="failed")throw new k(`Transaction sending failed: ${JSON.stringify(o.error)}`);if(o.status==="awaiting-approval")throw new F("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let a=o.onChain.txId;if(a==null)throw new B("Transaction hash not found on transaction response");return{hash:a,explorerLink:(s=o.onChain.explorerLink)!=null?s:"",transactionId:o.id}})}sleep(e){return l(this,null,function*(){return new Promise(r=>setTimeout(r,e))})}};T=new WeakMap,c=new WeakMap;function D(d){if(typeof d=="string")return d;if("email"in d)return`email:${d.email}`;if("x"in d)return`x:${d.x}`;if("twitter"in d)return`twitter:${d.twitter}`;if("phone"in d)return`phoneNumber:${d.phone}`;if("userId"in d)return`userId:${d.userId}`;throw new Error("Invalid recipient locator")}function M(d,e){return G(d)?`${e}:${d}`:`${e}:${d.toLowerCase()}`}export{H as a};
|
package/dist/chunk-UNQMKW7D.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGSTYVHP5cjs = require('./chunk-GSTYVHP5.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkWZFHEUWTcjs = require('./chunk-WZFHEUWT.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _viem = require('viem');var _commonsdkbase = require('@crossmint/common-sdk-base');var m=class w extends _chunkGSTYVHP5cjs.a{constructor(t){super({chain:t.chain,address:t.address,owner:t.owner,signer:t.signer,options:_chunkGSTYVHP5cjs.a.getOptions(t)},_chunkGSTYVHP5cjs.a.getApiClient(t))}static from(t){if(!_commonsdkbase.isValidEvmAddress.call(void 0, t.address))throw new Error("Wallet is not an EVM wallet");return new w(t)}sendTransaction(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i;yield this.preAuthIfNeeded();let e=this.buildTransaction(t),n=yield this.createTransaction(e,t.options);return(i=t.options)!=null&&i.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:n.id}:yield this.approveTransactionAndWait(n.id)})}signMessage(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var n;yield this.preAuthIfNeeded();let e=yield this.apiClient.createSignature(this.walletLocator,{type:"message",params:{message:t.message,signer:this.signer.locator(),chain:this.chain}});if("error"in e)throw new (0, _chunkO4FVTK7Xcjs.o)(JSON.stringify(e));return(n=t.options)!=null&&n.experimental_prepareOnly?{signature:void 0,signatureId:e.id}:yield this.approveSignatureAndWait(e.id)})}signTypedData(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var T;yield this.preAuthIfNeeded();let{domain:e,message:n,primaryType:i,types:a,chain:r}=t;if(!e||!n||!a||!r)throw new (0, _chunkO4FVTK7Xcjs.k)("Invalid typed data");let{name:u,version:l,chainId:h,verifyingContract:g,salt:C}=e;if(!u||!l||!h||!g)throw new (0, _chunkO4FVTK7Xcjs.k)("Invalid typed data domain");let o=yield this.apiClient.createSignature(this.walletLocator,{type:"typed-data",params:{typedData:{domain:{name:u,version:l,chainId:Number(h),verifyingContract:g,salt:C},message:n,primaryType:i,types:a},signer:this.signer.locator(),chain:r}});if("error"in o)throw new (0, _chunkO4FVTK7Xcjs.o)(JSON.stringify(o));return(T=t.options)!=null&&T.experimental_prepareOnly?{signature:void 0,signatureId:o.id}:yield this.approveSignatureAndWait(o.id)})}getViemClient(t){var e;return _viem.createPublicClient.call(void 0, {transport:(e=t==null?void 0:t.transport)!=null?e:_viem.http.call(void 0, ),chain:_chunkWZFHEUWTcjs.a.call(void 0, this.chain)})}createTransaction(t,e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var a;let n=(a=e==null?void 0:e.experimental_signer)!=null?a:this.signer.locator(),i=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:n,chain:this.chain,calls:[t]}});if("error"in i)throw new (0, _chunkO4FVTK7Xcjs.r)(JSON.stringify(i));return i})}buildTransaction(t){var e,n,i,a,r;if("transaction"in t)return{transaction:t.transaction};if(t.abi==null)return{to:t.to,value:(n=(e=t.value)==null?void 0:e.toString())!=null?n:"0",data:(i=t.data)!=null?i:"0x"};if(!t.functionName)throw new Error("Function name is required");return{to:t.to,value:(r=(a=t.value)==null?void 0:a.toString())!=null?r:"0",data:_viem.encodeFunctionData.call(void 0, {abi:t.abi,functionName:t.functionName,args:t.args})}}};exports.a = m;
|
package/dist/chunk-WPSU4D5A.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGSTYVHP5cjs = require('./chunk-GSTYVHP5.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var d=class u extends _chunkGSTYVHP5cjs.a{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer,options:_chunkGSTYVHP5cjs.a.getOptions(n)},_chunkGSTYVHP5cjs.a.getApiClient(n))}static from(n){if(!_commonsdkbase.isValidStellarAddress.call(void 0, n.address))throw new Error("Wallet is not a Stellar wallet");return new u(n)}sendTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var r;yield this.preAuthIfNeeded();let t=yield this.createTransaction(n);if((r=n.options)!=null&&r.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:t.id};let e={};return yield this.approveTransactionAndWait(t.id,e)})}createTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var c;let{contractId:t,options:e}=n,r=(c=e==null?void 0:e.experimental_signer)!=null?c:this.signer.locator(),i;if("transaction"in n)i={type:"serialized-transaction",serializedTransaction:n.transaction,contractId:t};else{let{method:h,memo:p,args:T}=n;i={type:"contract-call",contractId:t,method:h,memo:p!=null?{type:"text",value:p}:void 0,args:T}}let s=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:i,signer:r}});if("error"in s)throw new (0, _chunkO4FVTK7Xcjs.r)(JSON.stringify(s));return s})}};exports.a = d;
|
package/dist/chunk-XKIM42AR.cjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk23BRREJGcjs = require('./chunk-23BRREJG.cjs');var _chunkGSTYVHP5cjs = require('./chunk-GSTYVHP5.cjs');var _chunkHAP32ODUcjs = require('./chunk-HAP32ODU.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _ox = require('ox');var u="When 'delegatedSigners' is provided to a method that may fetch an existing wallet, each specified delegated signer must exist in that wallet's configuration.",w= exports.a =class{constructor(e){this.apiClient=e}getOrCreateWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.apiClient.isServerSide)throw new (0, _chunkO4FVTK7Xcjs.f)(`getOrCreateWallet can only be called from client-side code.
|
|
2
|
-
- Make sure you're running this in the browser (or another client environment), not on your server.
|
|
3
|
-
- Use your Crossmint Client API Key (not a server key).`);let n=yield this.apiClient.getWallet(`me:${this.getChainType(e.chain)}: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, _chunkO4FVTK7Xcjs.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, _chunkO4FVTK7Xcjs.d)(JSON.stringify(i));return this.createWalletInstance(i,n)})}createWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var t,a,l,o;yield(l=(a=(t=e.options)==null?void 0:t.experimental_callbacks)==null?void 0:a.onWalletCreationStart)==null?void 0:l.call(a),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:this.getChainType(e.chain),config:_chunkXALFCQKDcjs.a.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {adminSigner:n},e!=null&&e.plugins?{plugins:e.plugins}:{}),e.delegatedSigners!=null?{delegatedSigners:e.delegatedSigners}:{}),owner:(o=e.owner)!=null?o:void 0});if("error"in i)throw new (0, _chunkO4FVTK7Xcjs.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, _chunkGSTYVHP5cjs.a)({chain:n.chain,address:e.address,owner:e.owner,signer:_chunkHAP32ODUcjs.a.call(void 0, n.chain,i),options:n.options},this.apiClient)}toInternalSignerConfig(e,n,i){var t,a,l,o,d,m;if(!(e.chainType==="evm"||e.chainType==="solana"||e.chainType==="stellar"))throw new (0, _chunkO4FVTK7Xcjs.f)(`Wallet type ${e.chainType} is not supported`);if(n==null&&((t=e.config)==null?void 0:t.adminSigner)==null)throw new (0, _chunkO4FVTK7Xcjs.f)("Signer is required to create a wallet");switch(n.type){case"api-key":{if(((a=e.config)==null?void 0:a.adminSigner.type)!=="api-key")throw new (0, _chunkO4FVTK7Xcjs.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(((l=e.config)==null?void 0:l.adminSigner.type)!=="external-wallet")throw new (0, _chunkO4FVTK7Xcjs.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(((o=e.config)==null?void 0:o.adminSigner.type)!=="passkey")throw new (0, _chunkO4FVTK7Xcjs.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(((d=e.config)==null?void 0:d.adminSigner.type)!=="email")throw new (0, _chunkO4FVTK7Xcjs.f)("Email signer does not match the wallet's signer type");let{locator:g,email:h,address:p}=e.config.adminSigner;return{type:"email",email:h,locator:g,address:p,crossmint:this.apiClient.crossmint,onAuthRequired:n.onAuthRequired,clientTEEConnection:i==null?void 0:i.clientTEEConnection}}case"phone":{if(((m=e.config)==null?void 0:m.adminSigner.type)!=="phone")throw new (0, _chunkO4FVTK7Xcjs.f)("Phone signer does not match the wallet's signer type");let{locator:g,phone:h,address:p}=e.config.adminSigner;return{type:"phone",phone:h,locator:g,address:p,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,a;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==="phone"&&(i==null?void 0:i.phone)!=null&&(e.signer.phone=(a=e.signer.phone)!=null?a:i.phone),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 a;if(this.mutateSignerFromCustomAuth(n),n.owner!=null&&e.owner!=null&&n.owner!==e.owner)throw new (0, _chunkO4FVTK7Xcjs.f)("Wallet owner does not match existing wallet's linked user");if(n.chain==="solana"&&e.chainType!=="solana"||n.chain!=="solana"&&e.chainType==="solana"||n.chain==="stellar"&&e.chainType!=="stellar"||n.chain!=="stellar"&&e.chainType==="stellar")throw new (0, _chunkO4FVTK7Xcjs.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=(a=e==null?void 0:e.config)==null?void 0:a.adminSigner;if(i!=null&&t!=null){if(i.type!==t.type)throw new (0, _chunkO4FVTK7Xcjs.f)("The wallet signer type provided in the wallet config does not match the existing wallet's adminSigner type");_chunk23BRREJGcjs.a.call(void 0, i,t)}n.delegatedSigners!=null&&this.validateDelegatedSigners(e,n.delegatedSigners)}validateDelegatedSigners(e,n){var t;let i=(t=e==null?void 0:e.config)==null?void 0:t.delegatedSigners;if(n.length!==0){if(i==null||i.length===0)throw new (0, _chunkO4FVTK7Xcjs.f)(`${n.length} delegated signer(s) specified, but wallet "${e.address}" has no delegated signers. ${u}`);for(let a of n)if(i.find(o=>o.locator===a.signer)==null){let o=i.map(d=>d.locator).join(", ");throw new (0, _chunkO4FVTK7Xcjs.f)(`Delegated signer '${a.signer}' does not exist in wallet "${e.address}". Available delegated signers: ${o}. ${u}`)}}}getChainType(e){return e==="solana"?"solana":e==="stellar"?"stellar":"evm"}};exports.a = w;
|
package/dist/chunk-XKLBVV54.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-S3JEOTZR.js";import{r as l}from"./chunk-PSXRNSOE.js";import{f as o}from"./chunk-BW7YYVZE.js";import{isValidStellarAddress as f}from"@crossmint/common-sdk-base";var d=class u extends a{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer,options:a.getOptions(n)},a.getApiClient(n))}static from(n){if(!f(n.address))throw new Error("Wallet is not a Stellar wallet");return new u(n)}sendTransaction(n){return o(this,null,function*(){var r;yield this.preAuthIfNeeded();let t=yield this.createTransaction(n);if((r=n.options)!=null&&r.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:t.id};let e={};return yield this.approveTransactionAndWait(t.id,e)})}createTransaction(n){return o(this,null,function*(){var c;let{contractId:t,options:e}=n,r=(c=e==null?void 0:e.experimental_signer)!=null?c:this.signer.locator(),i;if("transaction"in n)i={type:"serialized-transaction",serializedTransaction:n.transaction,contractId:t};else{let{method:h,memo:p,args:T}=n;i={type:"contract-call",contractId:t,method:h,memo:p!=null?{type:"text",value:p}:void 0,args:T}}let s=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:i,signer:r}});if("error"in s)throw new l(JSON.stringify(s));return s})}};export{d as a};
|
package/dist/chunk-ZSWIQU3U.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var e=class extends Error{constructor(){super("Authentication was rejected by the user"),this.name="AuthRejectedError"}};exports.a = e;
|