@crossmint/wallets-sdk 0.10.7 → 0.10.8
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/gen/types.gen.d.cts +3 -1
- package/dist/api/gen/types.gen.d.ts +3 -1
- package/dist/api/index.cjs +1 -1
- package/dist/api/index.js +1 -1
- package/dist/{chunk-S4BVVCCI.cjs → chunk-3L6EVBXA.cjs} +1 -1
- package/dist/chunk-424EIRNB.js +1 -0
- package/dist/{chunk-4SOUJYEZ.cjs → chunk-4BJMFWAY.cjs} +1 -1
- package/dist/chunk-4UVSDKGY.cjs +1 -0
- package/dist/{chunk-MWG57IBW.cjs → chunk-7JAILZE2.cjs} +1 -1
- package/dist/{chunk-Q4AUF52K.js → chunk-7KHMZPZO.js} +1 -1
- package/dist/{chunk-RQLYLJLG.js → chunk-A6ZBW2VA.js} +1 -1
- package/dist/{chunk-7XGEKCEC.cjs → chunk-AC4TCW3L.cjs} +1 -1
- package/dist/{chunk-Y4JKM3NU.js → chunk-APQSPTH3.js} +1 -1
- package/dist/chunk-EJSIN53L.cjs +1 -0
- package/dist/{chunk-X3I2D4JM.cjs → chunk-EV4AUN33.cjs} +1 -1
- package/dist/chunk-FWMSAG7V.cjs +1 -0
- package/dist/chunk-GIDUQBAX.cjs +1 -0
- package/dist/{chunk-KT3YIMGI.js → chunk-IZGS2VHO.js} +1 -1
- package/dist/chunk-J67J2N7M.js +1 -0
- package/dist/chunk-LURBQMOO.js +1 -0
- package/dist/{chunk-KHTMC3YP.cjs → chunk-NKUDWDSH.cjs} +1 -1
- package/dist/chunk-NUERDBYD.cjs +1 -0
- package/dist/{chunk-EFV6LYBX.cjs → chunk-NWOKSI3V.cjs} +1 -1
- package/dist/chunk-PPTGFYIV.js +1 -0
- package/dist/{chunk-4Y3GRDSC.js → chunk-QNBRYCK7.js} +1 -1
- package/dist/chunk-S3IXONDB.js +1 -0
- package/dist/{chunk-6OI4IYFQ.js → chunk-SN3LCVYC.js} +1 -1
- package/dist/{chunk-YRRIQQ37.cjs → chunk-TDNPEWFY.cjs} +1 -1
- package/dist/{chunk-PCATIT6D.js → chunk-UPTOMSKW.js} +1 -1
- package/dist/chunk-VEKXBWC5.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/sdk.cjs +1 -1
- package/dist/sdk.d.cts +1 -0
- package/dist/sdk.d.ts +1 -0
- package/dist/sdk.js +1 -1
- package/dist/signers/email/email-iframe-manager.cjs +1 -1
- package/dist/signers/email/email-iframe-manager.js +1 -1
- package/dist/signers/email/email-signer-api-client.cjs +1 -1
- package/dist/signers/email/email-signer-api-client.js +1 -1
- package/dist/signers/email/email-signer.cjs +1 -1
- package/dist/signers/email/email-signer.js +1 -1
- package/dist/signers/email/evm-email-signer.cjs +1 -1
- package/dist/signers/email/evm-email-signer.js +1 -1
- package/dist/signers/email/index.cjs +1 -1
- package/dist/signers/email/index.js +1 -1
- package/dist/signers/email/solana-email-signer.cjs +1 -1
- package/dist/signers/email/solana-email-signer.js +1 -1
- package/dist/signers/index.cjs +1 -1
- package/dist/signers/index.js +1 -1
- package/dist/utils/constants.cjs +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/wallets/evm.cjs +1 -1
- package/dist/wallets/evm.d.cts +6 -1
- package/dist/wallets/evm.d.ts +6 -1
- package/dist/wallets/evm.js +1 -1
- package/dist/wallets/solana.cjs +1 -1
- package/dist/wallets/solana.d.cts +8 -2
- package/dist/wallets/solana.d.ts +8 -2
- package/dist/wallets/solana.js +1 -1
- package/dist/wallets/types.d.cts +30 -7
- package/dist/wallets/types.d.ts +30 -7
- 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 +11 -3
- package/dist/wallets/wallet.d.ts +11 -3
- package/dist/wallets/wallet.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-3BJP6F4A.cjs +0 -1
- package/dist/chunk-4ZGDFV6E.cjs +0 -1
- package/dist/chunk-DBRGHBUB.js +0 -1
- package/dist/chunk-EOBI2HWM.js +0 -1
- package/dist/chunk-GK2NFDT2.js +0 -1
- package/dist/chunk-IWRAIG3I.js +0 -1
- package/dist/chunk-IWXXXIDH.cjs +0 -1
- package/dist/chunk-MGEPGAO4.cjs +0 -1
- package/dist/chunk-MIR5F4R2.js +0 -1
- package/dist/chunk-PDL3XF5M.js +0 -1
- package/dist/chunk-ZWDS66FS.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-UPTOMSKW.js";import"../../chunk-IZGS2VHO.js";import"../../chunk-7KHMZPZO.js";import"../../chunk-PPTGFYIV.js";import"../../chunk-M4ELAV7U.js";import"../../chunk-LURBQMOO.js";import"../../chunk-7ENJXL4H.js";import"../../chunk-BW7YYVZE.js";export{a as SolanaEmailSigner};
|
package/dist/signers/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkAC4TCW3Lcjs = require('../chunk-AC4TCW3L.cjs');require('../chunk-VMEGMTOD.cjs');require('../chunk-TDNPEWFY.cjs');require('../chunk-7JAILZE2.cjs');require('../chunk-4BJMFWAY.cjs');require('../chunk-NWOKSI3V.cjs');require('../chunk-FWMSAG7V.cjs');require('../chunk-DYRSQN7X.cjs');require('../chunk-NVJN7LPY.cjs');require('../chunk-AFYBD7FI.cjs');require('../chunk-ZSWIQU3U.cjs');require('../chunk-NKUDWDSH.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-YO6BJ2DI.cjs');require('../chunk-DIZVZP5P.cjs');require('../chunk-XALFCQKD.cjs');exports.assembleSigner = _chunkAC4TCW3Lcjs.a;
|
package/dist/signers/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-QNBRYCK7.js";import"../chunk-TN6YXWPL.js";import"../chunk-UPTOMSKW.js";import"../chunk-A6ZBW2VA.js";import"../chunk-IZGS2VHO.js";import"../chunk-7KHMZPZO.js";import"../chunk-PPTGFYIV.js";import"../chunk-OV4CFQ36.js";import"../chunk-77QBSFHG.js";import"../chunk-T3ICQDFS.js";import"../chunk-M4ELAV7U.js";import"../chunk-LURBQMOO.js";import"../chunk-7ENJXL4H.js";import"../chunk-2KK65AC6.js";import"../chunk-QTSZSHKK.js";import"../chunk-BW7YYVZE.js";export{a as assembleSigner};
|
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 _chunkNKUDWDSHcjs = require('../chunk-NKUDWDSH.cjs');require('../chunk-XALFCQKD.cjs');exports.SDK_NAME = _chunkNKUDWDSHcjs.c; exports.SDK_VERSION = _chunkNKUDWDSHcjs.b; exports.STATUS_POLLING_INTERVAL_MS = _chunkNKUDWDSHcjs.d; exports.WALLETS_SERVICE = _chunkNKUDWDSHcjs.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-LURBQMOO.js";import"../chunk-BW7YYVZE.js";export{c as SDK_NAME,b as SDK_VERSION,d as STATUS_POLLING_INTERVAL_MS,a as WALLETS_SERVICE};
|
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 _chunk4UVSDKGYcjs = require('../chunk-4UVSDKGY.cjs');require('../chunk-NUERDBYD.cjs');require('../chunk-NKUDWDSH.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-6VJEBYPN.cjs');require('../chunk-IR5WN6FQ.cjs');require('../chunk-GEY574TH.cjs');require('../chunk-XALFCQKD.cjs');exports.EVMWallet = _chunk4UVSDKGYcjs.a;
|
package/dist/wallets/evm.d.cts
CHANGED
|
@@ -10,6 +10,7 @@ import { Wallet } from './wallet.cjs';
|
|
|
10
10
|
import '@solana/web3.js';
|
|
11
11
|
import '@crossmint/client-sdk-window';
|
|
12
12
|
import '@crossmint/client-signers';
|
|
13
|
+
import 'abitype';
|
|
13
14
|
import '../api/types.cjs';
|
|
14
15
|
import '../api/gen/types.gen.cjs';
|
|
15
16
|
import '../signers/types.cjs';
|
|
@@ -20,7 +21,9 @@ import '../api/client.cjs';
|
|
|
20
21
|
declare class EVMWallet extends Wallet<EVMChain> {
|
|
21
22
|
constructor(wallet: Wallet<EVMChain>);
|
|
22
23
|
static from(wallet: Wallet<Chain>): EVMWallet;
|
|
23
|
-
sendTransaction(params:
|
|
24
|
+
sendTransaction<T extends EVMTransactionInput>(params: T): Promise<Transaction<T["options"] extends {
|
|
25
|
+
experimental_prepareOnly: true;
|
|
26
|
+
} ? true : false>>;
|
|
24
27
|
signMessage(message: string): Promise<string>;
|
|
25
28
|
createTypedDataSignature<const typedData extends TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(params: TypedDataDefinition<typedData, primaryType> & {
|
|
26
29
|
chain: EVMSmartWalletChain;
|
|
@@ -129,6 +132,8 @@ declare class EVMWallet extends Wallet<EVMChain> {
|
|
|
129
132
|
uid?: undefined;
|
|
130
133
|
} ? viem.PublicActions<HttpTransport, viem.Chain> : unknown)>;
|
|
131
134
|
};
|
|
135
|
+
private createTransaction;
|
|
136
|
+
private buildTransaction;
|
|
132
137
|
}
|
|
133
138
|
|
|
134
139
|
export { EVMWallet };
|
package/dist/wallets/evm.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { Wallet } from './wallet.js';
|
|
|
10
10
|
import '@solana/web3.js';
|
|
11
11
|
import '@crossmint/client-sdk-window';
|
|
12
12
|
import '@crossmint/client-signers';
|
|
13
|
+
import 'abitype';
|
|
13
14
|
import '../api/types.js';
|
|
14
15
|
import '../api/gen/types.gen.js';
|
|
15
16
|
import '../signers/types.js';
|
|
@@ -20,7 +21,9 @@ import '../api/client.js';
|
|
|
20
21
|
declare class EVMWallet extends Wallet<EVMChain> {
|
|
21
22
|
constructor(wallet: Wallet<EVMChain>);
|
|
22
23
|
static from(wallet: Wallet<Chain>): EVMWallet;
|
|
23
|
-
sendTransaction(params:
|
|
24
|
+
sendTransaction<T extends EVMTransactionInput>(params: T): Promise<Transaction<T["options"] extends {
|
|
25
|
+
experimental_prepareOnly: true;
|
|
26
|
+
} ? true : false>>;
|
|
24
27
|
signMessage(message: string): Promise<string>;
|
|
25
28
|
createTypedDataSignature<const typedData extends TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(params: TypedDataDefinition<typedData, primaryType> & {
|
|
26
29
|
chain: EVMSmartWalletChain;
|
|
@@ -129,6 +132,8 @@ declare class EVMWallet extends Wallet<EVMChain> {
|
|
|
129
132
|
uid?: undefined;
|
|
130
133
|
} ? viem.PublicActions<HttpTransport, viem.Chain> : unknown)>;
|
|
131
134
|
};
|
|
135
|
+
private createTransaction;
|
|
136
|
+
private buildTransaction;
|
|
132
137
|
}
|
|
133
138
|
|
|
134
139
|
export { EVMWallet };
|
package/dist/wallets/evm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-S3IXONDB.js";import"../chunk-424EIRNB.js";import"../chunk-LURBQMOO.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};
|
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 _chunkGIDUQBAXcjs = require('../chunk-GIDUQBAX.cjs');require('../chunk-NUERDBYD.cjs');require('../chunk-AFYBD7FI.cjs');require('../chunk-NKUDWDSH.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-XALFCQKD.cjs');exports.SolanaWallet = _chunkGIDUQBAXcjs.a;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { SolanaChain, Chain } from '../chains/chains.cjs';
|
|
2
|
-
import { SolanaTransactionInput, Transaction } from './types.cjs';
|
|
2
|
+
import { TransactionInputOptions, SolanaTransactionInput, Transaction } from './types.cjs';
|
|
3
3
|
import { Wallet } from './wallet.cjs';
|
|
4
4
|
import 'viem';
|
|
5
5
|
import '@solana/web3.js';
|
|
6
6
|
import '@crossmint/client-sdk-window';
|
|
7
7
|
import '@crossmint/client-signers';
|
|
8
|
+
import 'abitype';
|
|
8
9
|
import '../api/types.cjs';
|
|
9
10
|
import '../api/gen/types.gen.cjs';
|
|
10
11
|
import '../signers/types.cjs';
|
|
@@ -15,7 +16,12 @@ import '../api/client.cjs';
|
|
|
15
16
|
declare class SolanaWallet extends Wallet<SolanaChain> {
|
|
16
17
|
constructor(wallet: Wallet<SolanaChain>);
|
|
17
18
|
static from(wallet: Wallet<Chain>): SolanaWallet;
|
|
18
|
-
sendTransaction
|
|
19
|
+
sendTransaction<T extends TransactionInputOptions | undefined = undefined>(params: SolanaTransactionInput & {
|
|
20
|
+
options?: T;
|
|
21
|
+
}): Promise<Transaction<T extends {
|
|
22
|
+
experimental_prepareOnly: true;
|
|
23
|
+
} ? true : false>>;
|
|
24
|
+
private createTransaction;
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
export { SolanaWallet };
|
package/dist/wallets/solana.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { SolanaChain, Chain } from '../chains/chains.js';
|
|
2
|
-
import { SolanaTransactionInput, Transaction } from './types.js';
|
|
2
|
+
import { TransactionInputOptions, SolanaTransactionInput, Transaction } from './types.js';
|
|
3
3
|
import { Wallet } from './wallet.js';
|
|
4
4
|
import 'viem';
|
|
5
5
|
import '@solana/web3.js';
|
|
6
6
|
import '@crossmint/client-sdk-window';
|
|
7
7
|
import '@crossmint/client-signers';
|
|
8
|
+
import 'abitype';
|
|
8
9
|
import '../api/types.js';
|
|
9
10
|
import '../api/gen/types.gen.js';
|
|
10
11
|
import '../signers/types.js';
|
|
@@ -15,7 +16,12 @@ import '../api/client.js';
|
|
|
15
16
|
declare class SolanaWallet extends Wallet<SolanaChain> {
|
|
16
17
|
constructor(wallet: Wallet<SolanaChain>);
|
|
17
18
|
static from(wallet: Wallet<Chain>): SolanaWallet;
|
|
18
|
-
sendTransaction
|
|
19
|
+
sendTransaction<T extends TransactionInputOptions | undefined = undefined>(params: SolanaTransactionInput & {
|
|
20
|
+
options?: T;
|
|
21
|
+
}): Promise<Transaction<T extends {
|
|
22
|
+
experimental_prepareOnly: true;
|
|
23
|
+
} ? true : false>>;
|
|
24
|
+
private createTransaction;
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
export { SolanaWallet };
|
package/dist/wallets/solana.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-J67J2N7M.js";import"../chunk-424EIRNB.js";import"../chunk-T3ICQDFS.js";import"../chunk-LURBQMOO.js";import"../chunk-7ENJXL4H.js";import"../chunk-BW7YYVZE.js";export{a as SolanaWallet};
|
package/dist/wallets/types.d.cts
CHANGED
|
@@ -1,22 +1,40 @@
|
|
|
1
1
|
import { VersionedTransaction, Keypair } from '@solana/web3.js';
|
|
2
2
|
import { HandshakeParent } from '@crossmint/client-sdk-window';
|
|
3
3
|
import { signerOutboundEvents, signerInboundEvents } from '@crossmint/client-signers';
|
|
4
|
+
import { Abi } from 'abitype';
|
|
4
5
|
import { CreateTransactionSuccessResponse } from '../api/types.cjs';
|
|
5
6
|
export { Activity } from '../api/types.cjs';
|
|
6
|
-
import { EVMSmartWalletChain } from '../chains/chains.cjs';
|
|
7
7
|
import 'viem';
|
|
8
8
|
import '../api/gen/types.gen.cjs';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
type TransactionInputOptions = {
|
|
11
|
+
experimental_prepareOnly?: boolean;
|
|
12
|
+
};
|
|
13
|
+
type EVMTransactionInputBase = {
|
|
14
|
+
options?: TransactionInputOptions;
|
|
15
|
+
};
|
|
16
|
+
type EVMTransactionInput = EVMTransactionInputBase & ({
|
|
11
17
|
to: string;
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
functionName?: string;
|
|
19
|
+
args?: unknown[];
|
|
14
20
|
value?: bigint;
|
|
15
|
-
|
|
21
|
+
abi?: Abi;
|
|
22
|
+
data?: `0x${string}`;
|
|
23
|
+
} | {
|
|
24
|
+
transaction: string;
|
|
25
|
+
});
|
|
16
26
|
interface SolanaTransactionInput {
|
|
17
27
|
transaction: VersionedTransaction;
|
|
18
28
|
additionalSigners?: Keypair[];
|
|
29
|
+
options?: TransactionInputOptions;
|
|
19
30
|
}
|
|
31
|
+
type FormattedEVMTransaction = {
|
|
32
|
+
to: string;
|
|
33
|
+
value: string;
|
|
34
|
+
data: string;
|
|
35
|
+
} | {
|
|
36
|
+
transaction: string;
|
|
37
|
+
};
|
|
20
38
|
type DelegatedSigner = {
|
|
21
39
|
signer: string;
|
|
22
40
|
};
|
|
@@ -53,9 +71,14 @@ type UserLocator = {
|
|
|
53
71
|
} | {
|
|
54
72
|
userId: string;
|
|
55
73
|
};
|
|
56
|
-
type Transaction = {
|
|
74
|
+
type Transaction<TPrepareOnly extends boolean = false> = TPrepareOnly extends true ? {
|
|
75
|
+
hash?: string;
|
|
76
|
+
explorerLink?: string;
|
|
77
|
+
transactionId: string;
|
|
78
|
+
} : {
|
|
57
79
|
hash: string;
|
|
58
80
|
explorerLink: string;
|
|
81
|
+
transactionId: string;
|
|
59
82
|
};
|
|
60
83
|
|
|
61
|
-
export type { Balances, Callbacks, DelegatedSigner, EVMTransactionInput, PendingApproval, SolanaTransactionInput, TokenBalance, Transaction, UserLocator, WalletOptions };
|
|
84
|
+
export type { Balances, Callbacks, DelegatedSigner, EVMTransactionInput, FormattedEVMTransaction, PendingApproval, SolanaTransactionInput, TokenBalance, Transaction, TransactionInputOptions, UserLocator, WalletOptions };
|
package/dist/wallets/types.d.ts
CHANGED
|
@@ -1,22 +1,40 @@
|
|
|
1
1
|
import { VersionedTransaction, Keypair } from '@solana/web3.js';
|
|
2
2
|
import { HandshakeParent } from '@crossmint/client-sdk-window';
|
|
3
3
|
import { signerOutboundEvents, signerInboundEvents } from '@crossmint/client-signers';
|
|
4
|
+
import { Abi } from 'abitype';
|
|
4
5
|
import { CreateTransactionSuccessResponse } from '../api/types.js';
|
|
5
6
|
export { Activity } from '../api/types.js';
|
|
6
|
-
import { EVMSmartWalletChain } from '../chains/chains.js';
|
|
7
7
|
import 'viem';
|
|
8
8
|
import '../api/gen/types.gen.js';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
type TransactionInputOptions = {
|
|
11
|
+
experimental_prepareOnly?: boolean;
|
|
12
|
+
};
|
|
13
|
+
type EVMTransactionInputBase = {
|
|
14
|
+
options?: TransactionInputOptions;
|
|
15
|
+
};
|
|
16
|
+
type EVMTransactionInput = EVMTransactionInputBase & ({
|
|
11
17
|
to: string;
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
functionName?: string;
|
|
19
|
+
args?: unknown[];
|
|
14
20
|
value?: bigint;
|
|
15
|
-
|
|
21
|
+
abi?: Abi;
|
|
22
|
+
data?: `0x${string}`;
|
|
23
|
+
} | {
|
|
24
|
+
transaction: string;
|
|
25
|
+
});
|
|
16
26
|
interface SolanaTransactionInput {
|
|
17
27
|
transaction: VersionedTransaction;
|
|
18
28
|
additionalSigners?: Keypair[];
|
|
29
|
+
options?: TransactionInputOptions;
|
|
19
30
|
}
|
|
31
|
+
type FormattedEVMTransaction = {
|
|
32
|
+
to: string;
|
|
33
|
+
value: string;
|
|
34
|
+
data: string;
|
|
35
|
+
} | {
|
|
36
|
+
transaction: string;
|
|
37
|
+
};
|
|
20
38
|
type DelegatedSigner = {
|
|
21
39
|
signer: string;
|
|
22
40
|
};
|
|
@@ -53,9 +71,14 @@ type UserLocator = {
|
|
|
53
71
|
} | {
|
|
54
72
|
userId: string;
|
|
55
73
|
};
|
|
56
|
-
type Transaction = {
|
|
74
|
+
type Transaction<TPrepareOnly extends boolean = false> = TPrepareOnly extends true ? {
|
|
75
|
+
hash?: string;
|
|
76
|
+
explorerLink?: string;
|
|
77
|
+
transactionId: string;
|
|
78
|
+
} : {
|
|
57
79
|
hash: string;
|
|
58
80
|
explorerLink: string;
|
|
81
|
+
transactionId: string;
|
|
59
82
|
};
|
|
60
83
|
|
|
61
|
-
export type { Balances, Callbacks, DelegatedSigner, EVMTransactionInput, PendingApproval, SolanaTransactionInput, TokenBalance, Transaction, UserLocator, WalletOptions };
|
|
84
|
+
export type { Balances, Callbacks, DelegatedSigner, EVMTransactionInput, FormattedEVMTransaction, PendingApproval, SolanaTransactionInput, TokenBalance, Transaction, TransactionInputOptions, UserLocator, WalletOptions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkEJSIN53Lcjs = require('../chunk-EJSIN53L.cjs');require('../chunk-NUERDBYD.cjs');require('../chunk-AC4TCW3L.cjs');require('../chunk-VMEGMTOD.cjs');require('../chunk-TDNPEWFY.cjs');require('../chunk-7JAILZE2.cjs');require('../chunk-4BJMFWAY.cjs');require('../chunk-NWOKSI3V.cjs');require('../chunk-FWMSAG7V.cjs');require('../chunk-DYRSQN7X.cjs');require('../chunk-NVJN7LPY.cjs');require('../chunk-AFYBD7FI.cjs');require('../chunk-ZSWIQU3U.cjs');require('../chunk-RD5PG4M6.cjs');require('../chunk-NKUDWDSH.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-YO6BJ2DI.cjs');require('../chunk-DIZVZP5P.cjs');require('../chunk-XALFCQKD.cjs');exports.WalletFactory = _chunkEJSIN53Lcjs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-VEKXBWC5.js";import"../chunk-424EIRNB.js";import"../chunk-QNBRYCK7.js";import"../chunk-TN6YXWPL.js";import"../chunk-UPTOMSKW.js";import"../chunk-A6ZBW2VA.js";import"../chunk-IZGS2VHO.js";import"../chunk-7KHMZPZO.js";import"../chunk-PPTGFYIV.js";import"../chunk-OV4CFQ36.js";import"../chunk-77QBSFHG.js";import"../chunk-T3ICQDFS.js";import"../chunk-M4ELAV7U.js";import"../chunk-FUUYGB4K.js";import"../chunk-LURBQMOO.js";import"../chunk-7ENJXL4H.js";import"../chunk-2KK65AC6.js";import"../chunk-QTSZSHKK.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 _chunkNUERDBYDcjs = require('../chunk-NUERDBYD.cjs');require('../chunk-NKUDWDSH.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-XALFCQKD.cjs');exports.Wallet = _chunkNUERDBYDcjs.a;
|
|
@@ -2,7 +2,7 @@ import { Signer, PasskeySignResult, BaseSignResult } from '../signers/types.cjs'
|
|
|
2
2
|
import { WalletsV1Alpha2TransactionResponseDto } from '../api/gen/types.gen.cjs';
|
|
3
3
|
import { ApiClient } from '../api/client.cjs';
|
|
4
4
|
import { GetNftsResponse, GetTransactionsResponse, Activity } from '../api/types.cjs';
|
|
5
|
-
import { WalletOptions, Balances, UserLocator, Transaction, DelegatedSigner, PendingApproval } from './types.cjs';
|
|
5
|
+
import { WalletOptions, Balances, TransactionInputOptions, UserLocator, Transaction, DelegatedSigner, PendingApproval } from './types.cjs';
|
|
6
6
|
import { Chain } from '../chains/chains.cjs';
|
|
7
7
|
import 'ox';
|
|
8
8
|
import '@crossmint/client-sdk-window';
|
|
@@ -10,6 +10,7 @@ import '@crossmint/client-signers';
|
|
|
10
10
|
import '@crossmint/common-sdk-base';
|
|
11
11
|
import 'viem';
|
|
12
12
|
import '@solana/web3.js';
|
|
13
|
+
import 'abitype';
|
|
13
14
|
|
|
14
15
|
type WalletContructorType<C extends Chain> = {
|
|
15
16
|
chain: C;
|
|
@@ -72,9 +73,12 @@ declare class Wallet<C extends Chain> {
|
|
|
72
73
|
* @param {string | UserLocator} to - The recipient (address or user locator)
|
|
73
74
|
* @param {string} token - The token (address or currency symbol)
|
|
74
75
|
* @param {string} amount - The amount to send (decimal units)
|
|
76
|
+
* @param {TransactionInputOptions} options - The options for the transaction
|
|
75
77
|
* @returns {Transaction} The transaction
|
|
76
78
|
*/
|
|
77
|
-
send(to: string | UserLocator, token: string, amount: string): Promise<Transaction
|
|
79
|
+
send<T extends TransactionInputOptions | undefined = undefined>(to: string | UserLocator, token: string, amount: string, options?: T): Promise<Transaction<T extends {
|
|
80
|
+
experimental_prepareOnly: true;
|
|
81
|
+
} ? true : false>>;
|
|
78
82
|
/**
|
|
79
83
|
* Add a delegated signer to the wallet
|
|
80
84
|
* @param signer - The signer
|
|
@@ -86,7 +90,11 @@ declare class Wallet<C extends Chain> {
|
|
|
86
90
|
delegatedSigners(): Promise<DelegatedSigner[]>;
|
|
87
91
|
protected get walletLocator(): string;
|
|
88
92
|
protected get isSolanaWallet(): boolean;
|
|
89
|
-
protected approveAndWait(transactionId: string, additionalSigners?: Signer[]): Promise<
|
|
93
|
+
protected approveAndWait(transactionId: string, additionalSigners?: Signer[]): Promise<{
|
|
94
|
+
hash: string;
|
|
95
|
+
explorerLink: string;
|
|
96
|
+
transactionId: string;
|
|
97
|
+
}>;
|
|
90
98
|
protected approveTransaction(transactionId: string, additionalSigners?: Signer[]): Promise<WalletsV1Alpha2TransactionResponseDto>;
|
|
91
99
|
protected approveSignature(pendingApprovals: Array<PendingApproval>, signatureId: string): Promise<PasskeySignResult | BaseSignResult>;
|
|
92
100
|
protected waitForSignature(signatureId: string): Promise<string>;
|
package/dist/wallets/wallet.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Signer, PasskeySignResult, BaseSignResult } from '../signers/types.js';
|
|
|
2
2
|
import { WalletsV1Alpha2TransactionResponseDto } from '../api/gen/types.gen.js';
|
|
3
3
|
import { ApiClient } from '../api/client.js';
|
|
4
4
|
import { GetNftsResponse, GetTransactionsResponse, Activity } from '../api/types.js';
|
|
5
|
-
import { WalletOptions, Balances, UserLocator, Transaction, DelegatedSigner, PendingApproval } from './types.js';
|
|
5
|
+
import { WalletOptions, Balances, TransactionInputOptions, UserLocator, Transaction, DelegatedSigner, PendingApproval } from './types.js';
|
|
6
6
|
import { Chain } from '../chains/chains.js';
|
|
7
7
|
import 'ox';
|
|
8
8
|
import '@crossmint/client-sdk-window';
|
|
@@ -10,6 +10,7 @@ import '@crossmint/client-signers';
|
|
|
10
10
|
import '@crossmint/common-sdk-base';
|
|
11
11
|
import 'viem';
|
|
12
12
|
import '@solana/web3.js';
|
|
13
|
+
import 'abitype';
|
|
13
14
|
|
|
14
15
|
type WalletContructorType<C extends Chain> = {
|
|
15
16
|
chain: C;
|
|
@@ -72,9 +73,12 @@ declare class Wallet<C extends Chain> {
|
|
|
72
73
|
* @param {string | UserLocator} to - The recipient (address or user locator)
|
|
73
74
|
* @param {string} token - The token (address or currency symbol)
|
|
74
75
|
* @param {string} amount - The amount to send (decimal units)
|
|
76
|
+
* @param {TransactionInputOptions} options - The options for the transaction
|
|
75
77
|
* @returns {Transaction} The transaction
|
|
76
78
|
*/
|
|
77
|
-
send(to: string | UserLocator, token: string, amount: string): Promise<Transaction
|
|
79
|
+
send<T extends TransactionInputOptions | undefined = undefined>(to: string | UserLocator, token: string, amount: string, options?: T): Promise<Transaction<T extends {
|
|
80
|
+
experimental_prepareOnly: true;
|
|
81
|
+
} ? true : false>>;
|
|
78
82
|
/**
|
|
79
83
|
* Add a delegated signer to the wallet
|
|
80
84
|
* @param signer - The signer
|
|
@@ -86,7 +90,11 @@ declare class Wallet<C extends Chain> {
|
|
|
86
90
|
delegatedSigners(): Promise<DelegatedSigner[]>;
|
|
87
91
|
protected get walletLocator(): string;
|
|
88
92
|
protected get isSolanaWallet(): boolean;
|
|
89
|
-
protected approveAndWait(transactionId: string, additionalSigners?: Signer[]): Promise<
|
|
93
|
+
protected approveAndWait(transactionId: string, additionalSigners?: Signer[]): Promise<{
|
|
94
|
+
hash: string;
|
|
95
|
+
explorerLink: string;
|
|
96
|
+
transactionId: string;
|
|
97
|
+
}>;
|
|
90
98
|
protected approveTransaction(transactionId: string, additionalSigners?: Signer[]): Promise<WalletsV1Alpha2TransactionResponseDto>;
|
|
91
99
|
protected approveSignature(pendingApprovals: Array<PendingApproval>, signatureId: string): Promise<PasskeySignResult | BaseSignResult>;
|
|
92
100
|
protected waitForSignature(signatureId: string): Promise<string>;
|
package/dist/wallets/wallet.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-424EIRNB.js";import"../chunk-LURBQMOO.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.
|
|
3
|
+
"version": "0.10.8",
|
|
4
4
|
"repository": "https://github.com/Crossmint/crossmint-sdk",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Paella Labs Inc",
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@hey-api/client-fetch": "0.8.1",
|
|
22
22
|
"@solana/web3.js": "1.98.0",
|
|
23
|
+
"abitype": "1.0.8",
|
|
23
24
|
"bs58": "5.0.0",
|
|
24
25
|
"ox": "0.6.9",
|
|
25
26
|
"tweetnacl": "1.0.3",
|
|
26
27
|
"viem": "2.23.6",
|
|
27
|
-
"@crossmint/common-sdk-auth": "1.0.39",
|
|
28
|
-
"@crossmint/common-sdk-base": "0.8.2",
|
|
29
28
|
"@crossmint/client-sdk-window": "1.0.0",
|
|
30
|
-
"@crossmint/client-signers": "0.0.18"
|
|
29
|
+
"@crossmint/client-signers": "0.0.18",
|
|
30
|
+
"@crossmint/common-sdk-base": "0.8.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@hey-api/openapi-ts": "0.69.2",
|
package/dist/chunk-3BJP6F4A.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 _chunkIWXXXIDHcjs = require('./chunk-IWXXXIDH.cjs');var _chunkAFYBD7FIcjs = require('./chunk-AFYBD7FI.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var _commonsdkbase = require('@crossmint/common-sdk-base');var p=class l extends _chunkIWXXXIDHcjs.a{constructor(a){super({chain:a.chain,address:a.address,owner:a.owner,signer:a.signer},_chunkIWXXXIDHcjs.a.getApiClient(a))}static from(a){if(!_commonsdkbase.isValidSolanaAddress.call(void 0, a.address))throw new Error("Wallet is not a Solana wallet");return new l(a)}sendTransaction(b){return _chunkXALFCQKDcjs.f.call(void 0, this,arguments,function*({transaction:a,additionalSigners:r}){let m={transaction:_bs582.default.encode(a.serialize())},n=yield this.apiClient.createTransaction(this.walletLocator,{params:m});if(n.error)throw new (0, _chunkCT2UGJELcjs.q)(JSON.stringify(n));let h=r==null?void 0:r.map(o=>new (0, _chunkAFYBD7FIcjs.a)({type:"external-wallet",address:o.publicKey.toString(),onSignTransaction:e=>(e.sign([o]),Promise.resolve(e))}));return yield this.approveAndWait(n.id,h)})}};exports.a = p;
|
package/dist/chunk-4ZGDFV6E.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkIWXXXIDHcjs = require('./chunk-IWXXXIDH.cjs');var _chunk7XGEKCECcjs = require('./chunk-7XGEKCEC.cjs');var _chunkYRRIQQ37cjs = require('./chunk-YRRIQQ37.cjs');var _chunkMWG57IBWcjs = require('./chunk-MWG57IBW.cjs');var _chunkRD5PG4M6cjs = require('./chunk-RD5PG4M6.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _ox = require('ox');var _commonsdkbase = require('@crossmint/common-sdk-base');var g=class{constructor(e){this.apiClient=e}getOrCreateWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.apiClient.isServerSide)throw new (0, _chunkCT2UGJELcjs.f)("getOrCreateWallet is not supported on server side");let i=yield this.apiClient.getWallet(`me:${e.chain==="solana"?"solana-smart-wallet":"evm-smart-wallet"}`);return i&&!("error"in i)?(yield this.validateWalletConfig(i,e),this.createWalletInstance(i,e)):this.createWallet(e)})}getWallet(e,i){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(!this.apiClient.isServerSide)throw new (0, _chunkCT2UGJELcjs.f)("getWallet is not supported on client side, use getOrCreateWallet instead");let t=yield this.apiClient.getWallet(e);if("error"in t)throw new (0, _chunkCT2UGJELcjs.d)(JSON.stringify(t));return this.createWalletInstance(t,i)})}createWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var n,a,r,o,p;yield(r=(a=(n=e.options)==null?void 0:n.experimental_callbacks)==null?void 0:a.onWalletCreationStart)==null?void 0:r.call(a);let i;e.chain==="solana"?i={type:"solana-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(o=e.owner)!=null?o:void 0}:i={type:"evm-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(p=e.owner)!=null?p:void 0};let t=yield this.apiClient.createWallet(i);if("error"in t)throw new (0, _chunkCT2UGJELcjs.f)(JSON.stringify(t));return this.createWalletInstance(t,e)})}createWalletInstance(e,i){let t=this.toInternalSignerConfig(e,i.signer,i.options);return new (0, _chunkIWXXXIDHcjs.a)({chain:i.chain,address:e.address,signer:_chunk7XGEKCECcjs.a.call(void 0, i.chain,t),options:i.options},this.apiClient)}toInternalSignerConfig(e,i,t){var n,a;if(i==null)throw new (0, _chunkCT2UGJELcjs.f)("Signer is required to create a wallet");switch(i.type){case"api-key":{let r;switch(e.type){case"solana-smart-wallet":r=e.config.adminSigner.address;break;case"evm-smart-wallet":e.config.adminSigner.type==="evm-fireblocks-custodial"&&(r=e.config.adminSigner.address);break}if(r==null)throw new (0, _chunkCT2UGJELcjs.f)("Wallet signer 'api-key' has no address");return{type:"api-key",address:r}}case"external-wallet":return i;case"passkey":if(e.type==="evm-smart-wallet"&&e.config.adminSigner.type==="evm-passkey")return{type:"passkey",id:e.config.adminSigner.id,name:e.config.adminSigner.name,onCreatePasskey:i.onCreatePasskey,onSignWithPasskey:i.onSignWithPasskey};throw new (0, _chunkCT2UGJELcjs.f)("Passkey signer is not supported for this wallet type");case"email":{if(!(e.type==="solana-smart-wallet"&&e.config.adminSigner.type==="solana-keypair"||e.type==="evm-smart-wallet"&&e.config.adminSigner.type==="evm-keypair"))throw new (0, _chunkCT2UGJELcjs.f)("Wallet signer 'email' has no address");let r=e.config.adminSigner.address;return{type:"email",email:(a=i.email)!=null?a:(n=this.apiClient.crossmint.experimental_customAuth)==null?void 0:n.email,signerAddress:r,crossmint:this.apiClient.crossmint,onAuthRequired:i.onAuthRequired,clientTEEConnection:t==null?void 0:t.clientTEEConnection}}default:throw new Error("Invalid signer type")}}configureSigner(e,i){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var t;if((i==null?void 0:i.type)==="passkey"){let n=(t=i.name)!=null?t:`Crossmint Wallet ${Date.now()}`,a=i.onCreatePasskey?yield i.onCreatePasskey(n):yield _ox.WebAuthnP256.createCredential({name:n});return{type:"evm-passkey",id:a.id,name:n,publicKey:{x:a.publicKey.x.toString(),y:a.publicKey.y.toString()}}}return yield this.toExternalSignerConfig(e,i)})}toExternalSignerConfig(e,i,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var n,a;if(!i||i.type==="api-key")return{type:e==="solana"?"solana-fireblocks-custodial":"evm-fireblocks-custodial"};if(i.type==="external-wallet")return{type:e==="solana"?"solana-keypair":"evm-keypair",address:i.address};if(i.type==="passkey"&&t!=null){if((t==null?void 0:t.type)!=="evm-smart-wallet"||t.config.adminSigner.type!=="evm-passkey")throw new (0, _chunkCT2UGJELcjs.f)("Passkey signer is not supported for this wallet type");return{type:"evm-passkey",id:t.config.adminSigner.id,name:t.config.adminSigner.name,publicKey:{x:t.config.adminSigner.publicKey.x,y:t.config.adminSigner.publicKey.y}}}if(i.type==="email"){let r=(a=i.email)!=null?a:(n=this.apiClient.crossmint.experimental_customAuth)==null?void 0:n.email;if(r==null)throw new Error("Email is required to create a wallet with email signer");if(e==="solana")return{type:"solana-keypair",address:yield _chunkYRRIQQ37cjs.a.pregenerateSigner(r,this.apiClient.crossmint)};if(_commonsdkbase.isEVMBlockchain.call(void 0, e))return{type:"evm-keypair",address:yield _chunkMWG57IBWcjs.a.pregenerateSigner(r,this.apiClient.crossmint)}}throw new Error("Invalid signer type")})}validateWalletConfig(e,i){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(i.owner!=null&&e.linkedUser!=null&&i.owner!==e.linkedUser)throw new (0, _chunkCT2UGJELcjs.f)("Wallet owner does not match existing wallet's linked user");if(e.type!=="solana-smart-wallet"&&e.type!=="evm-smart-wallet")return;let t=yield this.toExternalSignerConfig(i.chain,i.signer,e),n=e.config.adminSigner;if(t&&n){if(t.type!==n.type)throw new (0, _chunkCT2UGJELcjs.f)("The wallet signer type provided in the wallet config does not match the existing wallet's adminSigner type");_chunkRD5PG4M6cjs.a.call(void 0, t,n)}})}};exports.a = g;
|
package/dist/chunk-DBRGHBUB.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as s}from"./chunk-EOBI2HWM.js";import{k as p,o as c,q as f}from"./chunk-7ENJXL4H.js";import{a as w}from"./chunk-BJDS5BJG.js";import{f as r}from"./chunk-BW7YYVZE.js";import{createPublicClient as S,http as E}from"viem";import{isValidEvmAddress as V}from"@crossmint/common-sdk-base";var C=class T extends s{constructor(t){super({chain:t.chain,address:t.address,owner:t.owner,signer:t.signer,options:s.getOptions(t)},s.getApiClient(t))}static from(t){if(!V(t.address))throw new Error("Wallet is not an EVM wallet");return new T(t)}sendTransaction(t){return r(this,null,function*(){var i;let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:this.signer.locator(),chain:this.chain,calls:[{to:t.to,value:t.value?t.value.toString():"0",data:(i=t.data)!=null?i:"0x"}]}});if("error"in a)throw new f(JSON.stringify(a));return yield this.approveAndWait(a.id)})}signMessage(t){return r(this,null,function*(){var n;let a=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-message",params:{message:t,signer:this.signer.locator(),chain:this.chain}});if("error"in a)throw new c(JSON.stringify(a));let i=a.id,o=((n=a.approvals)==null?void 0:n.pending)||[];return yield this.approveSignature(o,i),yield this.waitForSignature(i)})}createTypedDataSignature(t){return r(this,null,function*(){var u;let{domain:a,message:i,primaryType:o,types:n,chain:d}=t;if(!a||!i||!n||!d)throw new p("Invalid typed data");let{name:h,version:g,chainId:y,verifyingContract:l,salt:v}=a;if(!h||!g||!y||!l)throw new p("Invalid typed data domain");let e=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-typed-data",params:{typedData:{domain:{name:h,version:g,chainId:Number(y),verifyingContract:l,salt:v},message:i,primaryType:o,types:n},signer:this.signer.locator(),chain:d,isSmartWalletSignature:!1}});if("error"in e)throw new c(JSON.stringify(e));let m=e.id,D=((u=e.approvals)==null?void 0:u.pending)||[];return yield this.approveSignature(D,m),yield this.waitForSignature(m)})}getViemClient(t){var a;return S({transport:(a=t==null?void 0:t.transport)!=null?a:E(),chain:w(this.chain)})}};export{C as a};
|
package/dist/chunk-EOBI2HWM.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as C}from"./chunk-IWRAIG3I.js";import{c as E,d as $,i as A,m as N,p as L,q as O,r as x,s as W,t as B,u as P,v as F,w as k}from"./chunk-7ENJXL4H.js";import{a as S,b,c,d as v,e as T,f as u}from"./chunk-BW7YYVZE.js";import{getEnvironmentForKey as J,isValidAddress as G}from"@crossmint/common-sdk-base";var m,l,_=class{constructor({chain:t,address:e,owner:r,signer:a,options:i},n){v(this,m);v(this,l);T(this,l,n),this.chain=t,this.address=e,this.owner=r,this.signer=a,T(this,m,i)}static getApiClient(t){return t.apiClient}static getOptions(t){return t.options}get apiClient(){return c(this,l)}get options(){return c(this,m)}balances(t,e){return u(this,null,function*(){let r=this.chain==="solana"?"sol":"eth",a=[r,"usdc",...t!=null?t:[]],i=yield c(this,l).getBalance(this.address,{chains:e!=null?e:[this.chain],tokens:a.map(n=>n.toLowerCase())});if("error"in i)throw new Error(`Failed to get balances for wallet: ${JSON.stringify(i.message)}`);return this.transformBalanceResponse(i,r,t)})}transformBalanceResponse(t,e,r){let a=s=>{var w,f,y;let d,h=(w=s.forChain)==null?void 0:w[this.chain];return h&&"contractAddress"in h&&(d=h.contractAddress),{symbol:s.token,name:s.token,amount:(f=s.amount)!=null?f:"0",contractAddress:d,decimals:s.decimals,rawAmount:(y=s.rawAmount)!=null?y:"0"}},i=t.find(s=>s.token===e||s.token.toLowerCase().includes(e)),n=t.find(s=>s.token.toLowerCase().includes("usdc")),g=t.filter(s=>{let d=s.token.toLowerCase();return!d.includes(e)&&!d.includes("usdc")&&(r==null?void 0:r.some(h=>d.includes(h.toLowerCase())))}),p=s=>({symbol:s,name:s,amount:"0",contractAddress:void 0,decimals:0,rawAmount:"0"});return{nativeToken:i!=null?a(i):p(e),usdc:n!=null?a(n):p("usdc"),tokens:g.map(a)}}experimental_nfts(t){return u(this,null,function*(){return yield c(this,l).experimental_getNfts(b(S({},t),{chain:this.chain,address:this.address}))})}experimental_transactions(){return u(this,null,function*(){return yield c(this,l).getTransactions(this.walletLocator)})}experimental_activity(){return u(this,null,function*(){let t=yield this.apiClient.experimental_activity(this.walletLocator,{chain:this.chain});if("error"in t)throw new Error(`Failed to get activity: ${JSON.stringify(t.message)}`);return t})}send(t,e,r){return u(this,null,function*(){let a=M(t),i=U(e,this.chain),n={recipient:a,amount:r},g=yield c(this,l).send(this.walletLocator,i,n);if("message"in g)throw new O(`Failed to send token: ${JSON.stringify(g.message)}`);return yield this.approveAndWait(g.id)})}addDelegatedSigner(e){return u(this,arguments,function*({signer:t}){var a,i;let r=yield c(this,l).registerSigner(this.walletLocator,{signer:t,chain:this.chain==="solana"?void 0:this.chain});if("error"in r)throw new Error(`Failed to register signer: ${JSON.stringify(r.message)}`);if("transaction"in r){let n=r.transaction.id;yield this.approveAndWait(n)}else{let n=(a=r.chains)==null?void 0:a[this.chain];if((n==null?void 0:n.status)==="awaiting-approval"){let g=((i=n.approvals)==null?void 0:i.pending)||[];yield this.approveSignature(g,n.id),yield this.waitForSignature(n.id);return}if((n==null?void 0:n.status)==="pending"){yield this.waitForSignature(n.id);return}}})}delegatedSigners(){return u(this,null,function*(){var e,r,a;let t=yield c(this,l).getWallet(this.walletLocator);if("error"in t)throw new $(JSON.stringify(t));if(t.type!=="solana-smart-wallet"&&t.type!=="evm-smart-wallet")throw new E(`Wallet type ${t.type} not supported`);return(a=(r=(e=t==null?void 0:t.config)==null?void 0:e.delegatedSigners)==null?void 0:r.map(i=>{let n=i.locator.indexOf(":");return{signer:`external-wallet:${n>=0?i.locator.slice(n+1):i.locator}`}}))!=null?a:[]})}get walletLocator(){return c(this,l).isServerSide?this.address:`me:${this.isSolanaWallet?"solana-smart-wallet":"evm-smart-wallet"}`}get isSolanaWallet(){return this.chain==="solana"}approveAndWait(t,e){return u(this,null,function*(){return yield this.approveTransaction(t,e),yield this.sleep(1e3),yield this.waitForTransaction(t)})}approveTransaction(t,e){return u(this,null,function*(){var p,s,d,h;let r=yield c(this,l).getTransaction(this.walletLocator,t);if(r.error)throw new x(JSON.stringify(r));if(yield(d=(s=(p=c(this,m))==null?void 0:p.experimental_callbacks)==null?void 0:s.onTransactionStart)==null?void 0:d.call(s),this.signer.type==="api-key")return r;let a=(h=r.approvals)==null?void 0:h.pending;if(a==null)return r;let i=[...e!=null?e:[],this.signer],n=yield Promise.all(a.map(w=>{let f=i.find(I=>I.locator()===w.signer);if(f==null)throw new A(`Signer ${w.signer} not found in pending approvals`);let y=r.walletType==="solana-smart-wallet"?r.onChain.transaction:w.message;return f.signTransaction(y)})),g=yield c(this,l).approveTransaction(this.walletLocator,r.id,{approvals:n.map(w=>S({signer:this.signer.locator()},w))});if(g.error)throw new k(JSON.stringify(g));return g})}approveSignature(t,e){return u(this,null,function*(){if(this.isSolanaWallet)throw new Error("Approving signatures is only supported for EVM smart wallets");let r=t.find(i=>i.signer===this.signer.locator());if(!r)throw new A(`Signer ${this.signer.locator()} not found in pending approvals`);let a=yield this.signer.signMessage(r.message);return yield c(this,l).approveSignature(this.walletLocator,e,{approvals:[S({signer:this.signer.locator()},a)]}),a})}waitForSignature(t){return u(this,null,function*(){let e=null;do if(yield new Promise(r=>setTimeout(r,C)),e=yield c(this,l).getSignature(this.walletLocator,t),"error"in e)throw new L(JSON.stringify(e));while(e===null||e.status==="pending");if(e.status==="failed")throw new N("Signature signing failed");if(!e.outputSignature)throw new L("Signature not available");return e.outputSignature})}waitForTransaction(n){return u(this,arguments,function*(t,e=6e4,{backoffMultiplier:r=1.1,maxBackoffMs:a=2e3,initialBackoffMs:i=C}={}){let g=Date.now(),p;do{if(Date.now()-g>e)throw new W("Transaction confirmation timeout");if(p=yield c(this,l).getTransaction(this.walletLocator,t),p.error)throw new x(JSON.stringify(p));yield this.sleep(i),i=Math.min(i*r,a)}while(p.status==="pending");if(p.status==="failed")throw new B(`Transaction sending failed: ${JSON.stringify(p.error)}`);if(p.status==="awaiting-approval")throw new P("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let s=p.onChain.txId;if(s==null)throw new F("Transaction hash not found on transaction response");return{hash:s,explorerLink:R(p,this.apiClient.crossmint.apiKey)}})}sleep(t){return u(this,null,function*(){return new Promise(e=>setTimeout(e,t))})}};m=new WeakMap,l=new WeakMap;function R(o,t){let e;if(o.walletType==="evm-smart-wallet")e=o.onChain.explorerLink;else if(o.walletType==="solana-smart-wallet"){let r=new URLSearchParams;J(t)!=="production"&&r.append("cluster","devnet"),e=`https://explorer.solana.com/tx/${o.onChain.txId}?${r.toString()}`}return(e==null||e==="")&&(e="Explorer link not available"),e}function M(o){if(typeof o=="string")return o;if("email"in o)return`email:${o.email}`;if("x"in o)return`x:${o.x}`;if("twitter"in o)return`twitter:${o.twitter}`;if("phone"in o)return`phoneNumber:${o.phone}`;if("userId"in o)return`userId:${o.userId}`;throw new Error("Invalid recipient locator")}function U(o,t){return G(o)?`${t}:${o}`:`${t}:${o.toLowerCase()}`}export{_ as a};
|
package/dist/chunk-GK2NFDT2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as t}from"./chunk-EOBI2HWM.js";import{a as c}from"./chunk-T3ICQDFS.js";import{q as s}from"./chunk-7ENJXL4H.js";import{f as i}from"./chunk-BW7YYVZE.js";import d from"bs58";import{isValidSolanaAddress as f}from"@crossmint/common-sdk-base";var p=class l extends t{constructor(a){super({chain:a.chain,address:a.address,owner:a.owner,signer:a.signer},t.getApiClient(a))}static from(a){if(!f(a.address))throw new Error("Wallet is not a Solana wallet");return new l(a)}sendTransaction(A){return i(this,arguments,function*({transaction:a,additionalSigners:r}){let m={transaction:d.encode(a.serialize())},n=yield this.apiClient.createTransaction(this.walletLocator,{params:m});if(n.error)throw new s(JSON.stringify(n));let h=r==null?void 0:r.map(o=>new c({type:"external-wallet",address:o.publicKey.toString(),onSignTransaction:e=>(e.sign([o]),Promise.resolve(e))}));return yield this.approveAndWait(n.id,h)})}};export{p as a};
|
package/dist/chunk-IWRAIG3I.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var s="@crossmint/wallets-sdk",t="0.10.7";var c="WALLETS_SDK",r=t,d=s,a=500;export{c as a,r as b,d as c,a as d};
|
package/dist/chunk-IWXXXIDH.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKHTMC3YPcjs = require('./chunk-KHTMC3YP.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var m,l,_= exports.a =class{constructor({chain:t,address:e,owner:r,signer:a,options:i},n){_chunkXALFCQKDcjs.d.call(void 0, this,m);_chunkXALFCQKDcjs.d.call(void 0, this,l);_chunkXALFCQKDcjs.e.call(void 0, this,l,n),this.chain=t,this.address=e,this.owner=r,this.signer=a,_chunkXALFCQKDcjs.e.call(void 0, this,m,i)}static getApiClient(t){return t.apiClient}static getOptions(t){return t.options}get apiClient(){return _chunkXALFCQKDcjs.c.call(void 0, this,l)}get options(){return _chunkXALFCQKDcjs.c.call(void 0, this,m)}balances(t,e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=this.chain==="solana"?"sol":"eth",a=[r,"usdc",...t!=null?t:[]],i=yield _chunkXALFCQKDcjs.c.call(void 0, this,l).getBalance(this.address,{chains:e!=null?e:[this.chain],tokens:a.map(n=>n.toLowerCase())});if("error"in i)throw new Error(`Failed to get balances for wallet: ${JSON.stringify(i.message)}`);return this.transformBalanceResponse(i,r,t)})}transformBalanceResponse(t,e,r){let a=s=>{var w,f,y;let d,h=(w=s.forChain)==null?void 0:w[this.chain];return h&&"contractAddress"in h&&(d=h.contractAddress),{symbol:s.token,name:s.token,amount:(f=s.amount)!=null?f:"0",contractAddress:d,decimals:s.decimals,rawAmount:(y=s.rawAmount)!=null?y:"0"}},i=t.find(s=>s.token===e||s.token.toLowerCase().includes(e)),n=t.find(s=>s.token.toLowerCase().includes("usdc")),g=t.filter(s=>{let d=s.token.toLowerCase();return!d.includes(e)&&!d.includes("usdc")&&(r==null?void 0:r.some(h=>d.includes(h.toLowerCase())))}),p=s=>({symbol:s,name:s,amount:"0",contractAddress:void 0,decimals:0,rawAmount:"0"});return{nativeToken:i!=null?a(i):p(e),usdc:n!=null?a(n):p("usdc"),tokens:g.map(a)}}experimental_nfts(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield _chunkXALFCQKDcjs.c.call(void 0, this,l).experimental_getNfts(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},t),{chain:this.chain,address:this.address}))})}experimental_transactions(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield _chunkXALFCQKDcjs.c.call(void 0, this,l).getTransactions(this.walletLocator)})}experimental_activity(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=yield this.apiClient.experimental_activity(this.walletLocator,{chain:this.chain});if("error"in t)throw new Error(`Failed to get activity: ${JSON.stringify(t.message)}`);return t})}send(t,e,r){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let a=M(t),i=U(e,this.chain),n={recipient:a,amount:r},g=yield _chunkXALFCQKDcjs.c.call(void 0, this,l).send(this.walletLocator,i,n);if("message"in g)throw new (0, _chunkCT2UGJELcjs.q)(`Failed to send token: ${JSON.stringify(g.message)}`);return yield this.approveAndWait(g.id)})}addDelegatedSigner(e){return _chunkXALFCQKDcjs.f.call(void 0, this,arguments,function*({signer:t}){var a,i;let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,l).registerSigner(this.walletLocator,{signer:t,chain:this.chain==="solana"?void 0:this.chain});if("error"in r)throw new Error(`Failed to register signer: ${JSON.stringify(r.message)}`);if("transaction"in r){let n=r.transaction.id;yield this.approveAndWait(n)}else{let n=(a=r.chains)==null?void 0:a[this.chain];if((n==null?void 0:n.status)==="awaiting-approval"){let g=((i=n.approvals)==null?void 0:i.pending)||[];yield this.approveSignature(g,n.id),yield this.waitForSignature(n.id);return}if((n==null?void 0:n.status)==="pending"){yield this.waitForSignature(n.id);return}}})}delegatedSigners(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var e,r,a;let t=yield _chunkXALFCQKDcjs.c.call(void 0, this,l).getWallet(this.walletLocator);if("error"in t)throw new (0, _chunkCT2UGJELcjs.d)(JSON.stringify(t));if(t.type!=="solana-smart-wallet"&&t.type!=="evm-smart-wallet")throw new (0, _chunkCT2UGJELcjs.c)(`Wallet type ${t.type} not supported`);return(a=(r=(e=t==null?void 0:t.config)==null?void 0:e.delegatedSigners)==null?void 0:r.map(i=>{let n=i.locator.indexOf(":");return{signer:`external-wallet:${n>=0?i.locator.slice(n+1):i.locator}`}}))!=null?a:[]})}get walletLocator(){return _chunkXALFCQKDcjs.c.call(void 0, this,l).isServerSide?this.address:`me:${this.isSolanaWallet?"solana-smart-wallet":"evm-smart-wallet"}`}get isSolanaWallet(){return this.chain==="solana"}approveAndWait(t,e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.approveTransaction(t,e),yield this.sleep(1e3),yield this.waitForTransaction(t)})}approveTransaction(t,e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var p,s,d,h;let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,l).getTransaction(this.walletLocator,t);if(r.error)throw new (0, _chunkCT2UGJELcjs.r)(JSON.stringify(r));if(yield(d=(s=(p=_chunkXALFCQKDcjs.c.call(void 0, this,m))==null?void 0:p.experimental_callbacks)==null?void 0:s.onTransactionStart)==null?void 0:d.call(s),this.signer.type==="api-key")return r;let a=(h=r.approvals)==null?void 0:h.pending;if(a==null)return r;let i=[...e!=null?e:[],this.signer],n=yield Promise.all(a.map(w=>{let f=i.find(I=>I.locator()===w.signer);if(f==null)throw new (0, _chunkCT2UGJELcjs.i)(`Signer ${w.signer} not found in pending approvals`);let y=r.walletType==="solana-smart-wallet"?r.onChain.transaction:w.message;return f.signTransaction(y)})),g=yield _chunkXALFCQKDcjs.c.call(void 0, this,l).approveTransaction(this.walletLocator,r.id,{approvals:n.map(w=>_chunkXALFCQKDcjs.a.call(void 0, {signer:this.signer.locator()},w))});if(g.error)throw new (0, _chunkCT2UGJELcjs.w)(JSON.stringify(g));return g})}approveSignature(t,e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.isSolanaWallet)throw new Error("Approving signatures is only supported for EVM smart wallets");let r=t.find(i=>i.signer===this.signer.locator());if(!r)throw new (0, _chunkCT2UGJELcjs.i)(`Signer ${this.signer.locator()} not found in pending approvals`);let a=yield this.signer.signMessage(r.message);return yield _chunkXALFCQKDcjs.c.call(void 0, this,l).approveSignature(this.walletLocator,e,{approvals:[_chunkXALFCQKDcjs.a.call(void 0, {signer:this.signer.locator()},a)]}),a})}waitForSignature(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let e=null;do if(yield new Promise(r=>setTimeout(r,_chunkKHTMC3YPcjs.d)),e=yield _chunkXALFCQKDcjs.c.call(void 0, this,l).getSignature(this.walletLocator,t),"error"in e)throw new (0, _chunkCT2UGJELcjs.p)(JSON.stringify(e));while(e===null||e.status==="pending");if(e.status==="failed")throw new (0, _chunkCT2UGJELcjs.m)("Signature signing failed");if(!e.outputSignature)throw new (0, _chunkCT2UGJELcjs.p)("Signature not available");return e.outputSignature})}waitForTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,arguments,function*(t,e=6e4,{backoffMultiplier:r=1.1,maxBackoffMs:a=2e3,initialBackoffMs:i=_chunkKHTMC3YPcjs.d}={}){let g=Date.now(),p;do{if(Date.now()-g>e)throw new (0, _chunkCT2UGJELcjs.s)("Transaction confirmation timeout");if(p=yield _chunkXALFCQKDcjs.c.call(void 0, this,l).getTransaction(this.walletLocator,t),p.error)throw new (0, _chunkCT2UGJELcjs.r)(JSON.stringify(p));yield this.sleep(i),i=Math.min(i*r,a)}while(p.status==="pending");if(p.status==="failed")throw new (0, _chunkCT2UGJELcjs.t)(`Transaction sending failed: ${JSON.stringify(p.error)}`);if(p.status==="awaiting-approval")throw new (0, _chunkCT2UGJELcjs.u)("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let s=p.onChain.txId;if(s==null)throw new (0, _chunkCT2UGJELcjs.v)("Transaction hash not found on transaction response");return{hash:s,explorerLink:R(p,this.apiClient.crossmint.apiKey)}})}sleep(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return new Promise(e=>setTimeout(e,t))})}};m=new WeakMap,l=new WeakMap;function R(o,t){let e;if(o.walletType==="evm-smart-wallet")e=o.onChain.explorerLink;else if(o.walletType==="solana-smart-wallet"){let r=new URLSearchParams;_commonsdkbase.getEnvironmentForKey.call(void 0, t)!=="production"&&r.append("cluster","devnet"),e=`https://explorer.solana.com/tx/${o.onChain.txId}?${r.toString()}`}return(e==null||e==="")&&(e="Explorer link not available"),e}function M(o){if(typeof o=="string")return o;if("email"in o)return`email:${o.email}`;if("x"in o)return`x:${o.x}`;if("twitter"in o)return`twitter:${o.twitter}`;if("phone"in o)return`phoneNumber:${o.phone}`;if("userId"in o)return`userId:${o.userId}`;throw new Error("Invalid recipient locator")}function U(o,t){return _commonsdkbase.isValidAddress.call(void 0, o)?`${t}:${o}`:`${t}:${o.toLowerCase()}`}exports.a = _;
|
package/dist/chunk-MGEPGAO4.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkIWXXXIDHcjs = require('./chunk-IWXXXIDH.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunk6VJEBYPNcjs = require('./chunk-6VJEBYPN.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _viem = require('viem');var _commonsdkbase = require('@crossmint/common-sdk-base');var C=class T extends _chunkIWXXXIDHcjs.a{constructor(t){super({chain:t.chain,address:t.address,owner:t.owner,signer:t.signer,options:_chunkIWXXXIDHcjs.a.getOptions(t)},_chunkIWXXXIDHcjs.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 T(t)}sendTransaction(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i;let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:this.signer.locator(),chain:this.chain,calls:[{to:t.to,value:t.value?t.value.toString():"0",data:(i=t.data)!=null?i:"0x"}]}});if("error"in a)throw new (0, _chunkCT2UGJELcjs.q)(JSON.stringify(a));return yield this.approveAndWait(a.id)})}signMessage(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var n;let a=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-message",params:{message:t,signer:this.signer.locator(),chain:this.chain}});if("error"in a)throw new (0, _chunkCT2UGJELcjs.o)(JSON.stringify(a));let i=a.id,o=((n=a.approvals)==null?void 0:n.pending)||[];return yield this.approveSignature(o,i),yield this.waitForSignature(i)})}createTypedDataSignature(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var u;let{domain:a,message:i,primaryType:o,types:n,chain:d}=t;if(!a||!i||!n||!d)throw new (0, _chunkCT2UGJELcjs.k)("Invalid typed data");let{name:h,version:g,chainId:y,verifyingContract:l,salt:v}=a;if(!h||!g||!y||!l)throw new (0, _chunkCT2UGJELcjs.k)("Invalid typed data domain");let e=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-typed-data",params:{typedData:{domain:{name:h,version:g,chainId:Number(y),verifyingContract:l,salt:v},message:i,primaryType:o,types:n},signer:this.signer.locator(),chain:d,isSmartWalletSignature:!1}});if("error"in e)throw new (0, _chunkCT2UGJELcjs.o)(JSON.stringify(e));let m=e.id,D=((u=e.approvals)==null?void 0:u.pending)||[];return yield this.approveSignature(D,m),yield this.waitForSignature(m)})}getViemClient(t){var a;return _viem.createPublicClient.call(void 0, {transport:(a=t==null?void 0:t.transport)!=null?a:_viem.http.call(void 0, ),chain:_chunk6VJEBYPNcjs.a.call(void 0, this.chain)})}};exports.a = C;
|
package/dist/chunk-MIR5F4R2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as c}from"./chunk-EOBI2HWM.js";import{a as C}from"./chunk-4Y3GRDSC.js";import{a as d}from"./chunk-PCATIT6D.js";import{a as y}from"./chunk-RQLYLJLG.js";import{a as f}from"./chunk-FUUYGB4K.js";import{d as m,f as s}from"./chunk-7ENJXL4H.js";import{f as l}from"./chunk-BW7YYVZE.js";import{WebAuthnP256 as h}from"ox";import{isEVMBlockchain as u}from"@crossmint/common-sdk-base";var g=class{constructor(e){this.apiClient=e}getOrCreateWallet(e){return l(this,null,function*(){if(this.apiClient.isServerSide)throw new s("getOrCreateWallet is not supported on server side");let i=yield this.apiClient.getWallet(`me:${e.chain==="solana"?"solana-smart-wallet":"evm-smart-wallet"}`);return i&&!("error"in i)?(yield this.validateWalletConfig(i,e),this.createWalletInstance(i,e)):this.createWallet(e)})}getWallet(e,i){return l(this,null,function*(){if(!this.apiClient.isServerSide)throw new s("getWallet is not supported on client side, use getOrCreateWallet instead");let t=yield this.apiClient.getWallet(e);if("error"in t)throw new m(JSON.stringify(t));return this.createWalletInstance(t,i)})}createWallet(e){return l(this,null,function*(){var n,a,r,o,p;yield(r=(a=(n=e.options)==null?void 0:n.experimental_callbacks)==null?void 0:a.onWalletCreationStart)==null?void 0:r.call(a);let i;e.chain==="solana"?i={type:"solana-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(o=e.owner)!=null?o:void 0}:i={type:"evm-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(p=e.owner)!=null?p:void 0};let t=yield this.apiClient.createWallet(i);if("error"in t)throw new s(JSON.stringify(t));return this.createWalletInstance(t,e)})}createWalletInstance(e,i){let t=this.toInternalSignerConfig(e,i.signer,i.options);return new c({chain:i.chain,address:e.address,signer:C(i.chain,t),options:i.options},this.apiClient)}toInternalSignerConfig(e,i,t){var n,a;if(i==null)throw new s("Signer is required to create a wallet");switch(i.type){case"api-key":{let r;switch(e.type){case"solana-smart-wallet":r=e.config.adminSigner.address;break;case"evm-smart-wallet":e.config.adminSigner.type==="evm-fireblocks-custodial"&&(r=e.config.adminSigner.address);break}if(r==null)throw new s("Wallet signer 'api-key' has no address");return{type:"api-key",address:r}}case"external-wallet":return i;case"passkey":if(e.type==="evm-smart-wallet"&&e.config.adminSigner.type==="evm-passkey")return{type:"passkey",id:e.config.adminSigner.id,name:e.config.adminSigner.name,onCreatePasskey:i.onCreatePasskey,onSignWithPasskey:i.onSignWithPasskey};throw new s("Passkey signer is not supported for this wallet type");case"email":{if(!(e.type==="solana-smart-wallet"&&e.config.adminSigner.type==="solana-keypair"||e.type==="evm-smart-wallet"&&e.config.adminSigner.type==="evm-keypair"))throw new s("Wallet signer 'email' has no address");let r=e.config.adminSigner.address;return{type:"email",email:(a=i.email)!=null?a:(n=this.apiClient.crossmint.experimental_customAuth)==null?void 0:n.email,signerAddress:r,crossmint:this.apiClient.crossmint,onAuthRequired:i.onAuthRequired,clientTEEConnection:t==null?void 0:t.clientTEEConnection}}default:throw new Error("Invalid signer type")}}configureSigner(e,i){return l(this,null,function*(){var t;if((i==null?void 0:i.type)==="passkey"){let n=(t=i.name)!=null?t:`Crossmint Wallet ${Date.now()}`,a=i.onCreatePasskey?yield i.onCreatePasskey(n):yield h.createCredential({name:n});return{type:"evm-passkey",id:a.id,name:n,publicKey:{x:a.publicKey.x.toString(),y:a.publicKey.y.toString()}}}return yield this.toExternalSignerConfig(e,i)})}toExternalSignerConfig(e,i,t){return l(this,null,function*(){var n,a;if(!i||i.type==="api-key")return{type:e==="solana"?"solana-fireblocks-custodial":"evm-fireblocks-custodial"};if(i.type==="external-wallet")return{type:e==="solana"?"solana-keypair":"evm-keypair",address:i.address};if(i.type==="passkey"&&t!=null){if((t==null?void 0:t.type)!=="evm-smart-wallet"||t.config.adminSigner.type!=="evm-passkey")throw new s("Passkey signer is not supported for this wallet type");return{type:"evm-passkey",id:t.config.adminSigner.id,name:t.config.adminSigner.name,publicKey:{x:t.config.adminSigner.publicKey.x,y:t.config.adminSigner.publicKey.y}}}if(i.type==="email"){let r=(a=i.email)!=null?a:(n=this.apiClient.crossmint.experimental_customAuth)==null?void 0:n.email;if(r==null)throw new Error("Email is required to create a wallet with email signer");if(e==="solana")return{type:"solana-keypair",address:yield d.pregenerateSigner(r,this.apiClient.crossmint)};if(u(e))return{type:"evm-keypair",address:yield y.pregenerateSigner(r,this.apiClient.crossmint)}}throw new Error("Invalid signer type")})}validateWalletConfig(e,i){return l(this,null,function*(){if(i.owner!=null&&e.linkedUser!=null&&i.owner!==e.linkedUser)throw new s("Wallet owner does not match existing wallet's linked user");if(e.type!=="solana-smart-wallet"&&e.type!=="evm-smart-wallet")return;let t=yield this.toExternalSignerConfig(i.chain,i.signer,e),n=e.config.adminSigner;if(t&&n){if(t.type!==n.type)throw new s("The wallet signer type provided in the wallet config does not match the existing wallet's adminSigner type");f(t,n)}})}};export{g as a};
|
package/dist/chunk-PDL3XF5M.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as t}from"./chunk-BW7YYVZE.js";import{IFrameWindow as a}from"@crossmint/client-sdk-window";import{environmentUrlConfig as s,signerInboundEvents as m,signerOutboundEvents as h}from"@crossmint/client-signers";var i=class{constructor(n){this.config=n;this.handshakeParent=null}initialize(){return t(this,null,function*(){if(this.handshakeParent)return this.handshakeParent;let n=new URL(s[this.config.environment]),e=yield this.createInvisibleIFrame(n.toString());return this.handshakeParent=yield a.init(e,{targetOrigin:n.origin,incomingEvents:h,outgoingEvents:m}),yield this.handshakeParent.handshakeWithChild(),this.handshakeParent})}createInvisibleIFrame(n){return t(this,null,function*(){let e=document.createElement("iframe");return e.src=n,Object.assign(e.style,{position:"absolute",opacity:"0",pointerEvents:"none",width:"0",height:"0",border:"none",top:"-9999px",left:"-9999px"}),new Promise((r,o)=>{e.onload=()=>r(e),e.onerror=()=>o(new Error("Failed to load iframe content")),document.body.appendChild(e)})})}};export{i as a};
|
package/dist/chunk-ZWDS66FS.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _clientsdkwindow = require('@crossmint/client-sdk-window');var _clientsigners = require('@crossmint/client-signers');var i=class{constructor(n){this.config=n;this.handshakeParent=null}initialize(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.handshakeParent)return this.handshakeParent;let n=new URL(_clientsigners.environmentUrlConfig[this.config.environment]),e=yield this.createInvisibleIFrame(n.toString());return this.handshakeParent=yield _clientsdkwindow.IFrameWindow.init(e,{targetOrigin:n.origin,incomingEvents:_clientsigners.signerOutboundEvents,outgoingEvents:_clientsigners.signerInboundEvents}),yield this.handshakeParent.handshakeWithChild(),this.handshakeParent})}createInvisibleIFrame(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let e=document.createElement("iframe");return e.src=n,Object.assign(e.style,{position:"absolute",opacity:"0",pointerEvents:"none",width:"0",height:"0",border:"none",top:"-9999px",left:"-9999px"}),new Promise((r,o)=>{e.onload=()=>r(e),e.onerror=()=>o(new Error("Failed to load iframe content")),document.body.appendChild(e)})})}};exports.a = i;
|