@crossmint/client-sdk-smart-wallet 0.1.19 → 0.1.21
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/SmartWalletSDK.cjs +1 -0
- package/dist/SmartWalletSDK.d.cts +47 -0
- package/dist/SmartWalletSDK.d.ts +47 -0
- package/dist/SmartWalletSDK.js +1 -0
- package/dist/api/CrossmintWalletService.cjs +1 -0
- package/dist/api/CrossmintWalletService.d.cts +31 -0
- package/dist/api/CrossmintWalletService.d.ts +31 -0
- package/dist/api/CrossmintWalletService.js +1 -0
- package/dist/blockchain/chains.cjs +1 -0
- package/dist/blockchain/chains.d.cts +36 -0
- package/dist/blockchain/chains.d.ts +36 -0
- package/dist/blockchain/chains.js +1 -0
- package/dist/blockchain/rpc.cjs +1 -0
- package/dist/blockchain/rpc.d.cts +9 -0
- package/dist/blockchain/rpc.d.ts +9 -0
- package/dist/blockchain/rpc.js +1 -0
- package/dist/blockchain/transfer.cjs +1 -0
- package/dist/blockchain/transfer.d.cts +23 -0
- package/dist/blockchain/transfer.d.ts +23 -0
- package/dist/blockchain/transfer.js +1 -0
- package/dist/blockchain/wallets/EVMSmartWallet.cjs +1 -0
- package/dist/blockchain/wallets/EVMSmartWallet.d.cts +102 -0
- package/dist/blockchain/wallets/EVMSmartWallet.d.ts +102 -0
- package/dist/blockchain/wallets/EVMSmartWallet.js +1 -0
- package/dist/blockchain/wallets/SendTransactionService.cjs +1 -0
- package/dist/blockchain/wallets/SendTransactionService.d.cts +84 -0
- package/dist/blockchain/wallets/SendTransactionService.d.ts +84 -0
- package/dist/blockchain/wallets/SendTransactionService.js +1 -0
- package/dist/blockchain/wallets/account/cache.cjs +1 -0
- package/dist/blockchain/wallets/account/cache.d.cts +25 -0
- package/dist/blockchain/wallets/account/cache.d.ts +25 -0
- package/dist/blockchain/wallets/account/cache.js +1 -0
- package/dist/blockchain/wallets/account/config.cjs +1 -0
- package/dist/blockchain/wallets/account/config.d.cts +47 -0
- package/dist/blockchain/wallets/account/config.d.ts +47 -0
- package/dist/blockchain/wallets/account/config.js +1 -0
- package/dist/blockchain/wallets/account/creator.cjs +1 -0
- package/dist/blockchain/wallets/account/creator.d.cts +26 -0
- package/dist/blockchain/wallets/account/creator.d.ts +26 -0
- package/dist/blockchain/wallets/account/creator.js +1 -0
- package/dist/blockchain/wallets/account/eoa.cjs +1 -0
- package/dist/blockchain/wallets/account/eoa.d.cts +21 -0
- package/dist/blockchain/wallets/account/eoa.d.ts +21 -0
- package/dist/blockchain/wallets/account/eoa.js +1 -0
- package/dist/blockchain/wallets/account/passkey.cjs +1 -0
- package/dist/blockchain/wallets/account/passkey.d.cts +29 -0
- package/dist/blockchain/wallets/account/passkey.d.ts +29 -0
- package/dist/blockchain/wallets/account/passkey.js +1 -0
- package/dist/blockchain/wallets/account/signer.cjs +1 -0
- package/dist/blockchain/wallets/account/signer.d.cts +14 -0
- package/dist/blockchain/wallets/account/signer.d.ts +14 -0
- package/dist/blockchain/wallets/account/signer.js +1 -0
- package/dist/blockchain/wallets/account/strategy.cjs +1 -0
- package/dist/blockchain/wallets/account/strategy.d.cts +20 -0
- package/dist/blockchain/wallets/account/strategy.d.ts +20 -0
- package/dist/blockchain/wallets/account/strategy.js +0 -0
- package/dist/blockchain/wallets/clientDecorator.cjs +1 -0
- package/dist/blockchain/wallets/clientDecorator.d.cts +38 -0
- package/dist/blockchain/wallets/clientDecorator.d.ts +38 -0
- package/dist/blockchain/wallets/clientDecorator.js +1 -0
- package/dist/blockchain/wallets/index.cjs +1 -0
- package/dist/blockchain/wallets/index.d.cts +20 -0
- package/dist/blockchain/wallets/index.d.ts +20 -0
- package/dist/blockchain/wallets/index.js +1 -0
- package/dist/blockchain/wallets/paymaster.cjs +1 -0
- package/dist/blockchain/wallets/paymaster.d.cts +29 -0
- package/dist/blockchain/wallets/paymaster.d.ts +29 -0
- package/dist/blockchain/wallets/paymaster.js +1 -0
- package/dist/blockchain/wallets/service.cjs +1 -0
- package/dist/blockchain/wallets/service.d.cts +41 -0
- package/dist/blockchain/wallets/service.d.ts +41 -0
- package/dist/blockchain/wallets/service.js +1 -0
- package/dist/chunk-27US7ZBX.js +1 -0
- package/dist/chunk-2GS5TXEY.cjs +1 -0
- package/dist/chunk-2R6HK64N.cjs +1 -0
- package/dist/chunk-3F6P4HUZ.js +1 -0
- package/dist/chunk-4SPA557P.js +0 -0
- package/dist/chunk-5M3MSPHK.cjs +1 -0
- package/dist/chunk-6DE5YEO5.cjs +1 -0
- package/dist/chunk-7AVDZZGD.cjs +1 -0
- package/dist/chunk-7FXFOOQU.cjs +1 -0
- package/dist/chunk-7JAT6GQU.js +1 -0
- package/dist/chunk-ATQ4WGCW.js +1 -0
- package/dist/chunk-B3LJJZXD.cjs +2 -0
- package/dist/chunk-BJZQA5VC.js +1 -0
- package/dist/chunk-BXXREMNR.cjs +1 -0
- package/dist/chunk-C3VZY7VJ.js +1 -0
- package/dist/chunk-CPYNP4XI.js +1 -0
- package/dist/chunk-CUTQYF3F.js +1 -0
- package/dist/chunk-D4NDUT36.js +1 -0
- package/dist/chunk-DIDKPOO2.cjs +1 -0
- package/dist/chunk-ETVJGLNY.js +1 -0
- package/dist/chunk-FHNNZVNU.js +1 -0
- package/dist/chunk-FIJ3CBJ4.js +3 -0
- package/dist/chunk-G57LROTD.js +1 -0
- package/dist/chunk-GB35YMN4.cjs +1 -0
- package/dist/chunk-H4CMXNVK.js +1 -0
- package/dist/chunk-IQTGPM2U.cjs +1 -0
- package/dist/chunk-KYPTGHC6.cjs +1 -0
- package/dist/chunk-LMVY4C4Y.js +1 -0
- package/dist/chunk-M4K3IZTT.cjs +1 -0
- package/dist/chunk-NLGILHJS.js +1 -0
- package/dist/chunk-O2ACORII.cjs +1 -0
- package/dist/chunk-OCJYX5QF.cjs +1 -0
- package/dist/chunk-ODAUWGUU.cjs +1 -0
- package/dist/chunk-PBUJXVQT.js +1 -0
- package/dist/chunk-PLRQBDYS.cjs +1 -0
- package/dist/chunk-PPTSNCSQ.cjs +1 -0
- package/dist/chunk-PZ6Q22YJ.js +1 -0
- package/dist/chunk-Q44P7MO7.cjs +1 -0
- package/dist/chunk-QVB3HE6Q.js +2 -0
- package/dist/chunk-S2XBSAGM.js +1 -0
- package/dist/chunk-SCXFZMLR.cjs +1 -0
- package/dist/chunk-STH2LE35.cjs +1 -0
- package/dist/chunk-SWWOVT47.cjs +1 -0
- package/dist/chunk-TZG6MROQ.js +1 -0
- package/dist/chunk-UG47CBKR.js +1 -0
- package/dist/chunk-UPURFW46.js +1 -0
- package/dist/chunk-WDM7PN4O.js +1 -0
- package/dist/chunk-WJ6XJMRD.cjs +1 -0
- package/dist/chunk-WTPE2I2Q.cjs +1 -0
- package/dist/chunk-XHSA4YTO.cjs +3 -0
- package/dist/chunk-XJGFG3RT.cjs +1 -0
- package/dist/chunk-XP6ESWVJ.js +1 -0
- package/dist/chunk-XQ2K2K23.cjs +1 -0
- package/dist/chunk-YBHSEZMB.js +1 -0
- package/dist/chunk-YZQJV2KA.cjs +1 -0
- package/dist/chunk-Z22H3MJS.js +1 -0
- package/dist/error/index.cjs +1 -0
- package/dist/error/index.d.cts +58 -0
- package/dist/error/index.d.ts +58 -0
- package/dist/error/index.js +1 -0
- package/dist/error/processor.cjs +1 -0
- package/dist/error/processor.d.cts +25 -0
- package/dist/error/processor.d.ts +25 -0
- package/dist/error/processor.js +1 -0
- package/dist/index.cjs +1 -5
- package/dist/index.d.cts +20 -559
- package/dist/index.d.ts +20 -559
- package/dist/index.js +1 -5
- package/dist/service-DqYCir8s.d.ts +103 -0
- package/dist/service-Ir-Qho-9.d.cts +103 -0
- package/dist/services/index.cjs +1 -0
- package/dist/services/index.d.cts +2 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.js +1 -0
- package/dist/services/logger.cjs +1 -0
- package/dist/services/logger.d.cts +6 -0
- package/dist/services/logger.d.ts +6 -0
- package/dist/services/logger.js +1 -0
- package/dist/types/internal.cjs +1 -0
- package/dist/types/internal.d.cts +14 -0
- package/dist/types/internal.d.ts +14 -0
- package/dist/types/internal.js +1 -0
- package/dist/types/params.cjs +1 -0
- package/dist/types/params.d.cts +33 -0
- package/dist/types/params.d.ts +33 -0
- package/dist/types/params.js +0 -0
- package/dist/types/schema.cjs +1 -0
- package/dist/types/schema.d.cts +241 -0
- package/dist/types/schema.d.ts +241 -0
- package/dist/types/schema.js +1 -0
- package/dist/types/service.cjs +1 -0
- package/dist/types/service.d.cts +14 -0
- package/dist/types/service.d.ts +14 -0
- package/dist/types/service.js +0 -0
- package/dist/types/token.cjs +1 -0
- package/dist/types/token.d.cts +35 -0
- package/dist/types/token.d.ts +35 -0
- package/dist/types/token.js +0 -0
- package/dist/utils/api.cjs +1 -0
- package/dist/utils/api.d.cts +4 -0
- package/dist/utils/api.d.ts +4 -0
- package/dist/utils/api.js +1 -0
- package/dist/utils/blockchain.cjs +1 -0
- package/dist/utils/blockchain.d.cts +7 -0
- package/dist/utils/blockchain.d.ts +7 -0
- package/dist/utils/blockchain.js +1 -0
- package/dist/utils/constants.cjs +1 -0
- package/dist/utils/constants.d.cts +9 -0
- package/dist/utils/constants.d.ts +9 -0
- package/dist/utils/constants.js +1 -0
- package/dist/utils/environment.cjs +1 -0
- package/dist/utils/environment.d.cts +3 -0
- package/dist/utils/environment.d.ts +3 -0
- package/dist/utils/environment.js +1 -0
- package/dist/utils/helpers.cjs +1 -0
- package/dist/utils/helpers.d.cts +4 -0
- package/dist/utils/helpers.d.ts +4 -0
- package/dist/utils/helpers.js +1 -0
- package/dist/utils/signer.cjs +1 -0
- package/dist/utils/signer.d.cts +15 -0
- package/dist/utils/signer.d.ts +15 -0
- package/dist/utils/signer.js +1 -0
- package/dist/utils/test.cjs +1 -0
- package/dist/utils/test.d.cts +18 -0
- package/dist/utils/test.d.ts +18 -0
- package/dist/utils/test.js +1 -0
- package/package.json +4 -5
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,561 +1,22 @@
|
|
|
1
|
-
import { ObjectValues } from '@crossmint/common-sdk-base';
|
|
2
1
|
export { EVMBlockchainIncludingTestnet as Chain, blockchainToChainId } from '@crossmint/common-sdk-base';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
export { EVMSmartWallet } from './blockchain/wallets/EVMSmartWallet.cjs';
|
|
3
|
+
export { ExternalSigner, PasskeySigner, SmartWalletSDKInitParams, UserParams, ViemAccount, WalletParams } from './types/params.cjs';
|
|
4
|
+
export { SmartWalletChain as EVMSmartWalletChain } from './blockchain/chains.cjs';
|
|
5
|
+
export { ERC20TransferType, NFTTransferType, SFTTransferType, TransferType } from './types/token.cjs';
|
|
6
|
+
export { AdminAlreadyUsedError, AdminMismatchError, ConfigError, PasskeyIncompatibleAuthenticatorError, PasskeyMismatchError, PasskeyPromptError, PasskeyRegistrationError, SmartWalletError, SmartWalletsNotEnabledError, UserWalletAlreadyCreatedError } from './error/index.cjs';
|
|
7
|
+
export { EVMSendTransactionError, EVMSendTransactionExecutionRevertedError } from './blockchain/wallets/SendTransactionService.cjs';
|
|
7
8
|
export { CrossmintSDKError, CrossmintServiceError, JWTDecryptionError, JWTExpiredError, JWTIdentifierError, JWTInvalidError, NotAuthorizedError, SmartWalletErrorCode } from '@crossmint/client-sdk-base';
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
readonly OPTIMISM_SEPOLIA: "optimism-sepolia";
|
|
23
|
-
readonly ARBITRUM_SEPOLIA: "arbitrum-sepolia";
|
|
24
|
-
};
|
|
25
|
-
type SmartWalletChain = ObjectValues<typeof SmartWalletChain>;
|
|
26
|
-
|
|
27
|
-
type SmartWalletSDKInitParams = {
|
|
28
|
-
clientApiKey: string;
|
|
29
|
-
};
|
|
30
|
-
type UserParams = {
|
|
31
|
-
jwt: string;
|
|
32
|
-
};
|
|
33
|
-
type ViemAccount = {
|
|
34
|
-
type: "VIEM_ACCOUNT";
|
|
35
|
-
account: LocalAccount & {
|
|
36
|
-
source: "custom";
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
type PasskeySigner = {
|
|
40
|
-
type: "PASSKEY";
|
|
41
|
-
/**
|
|
42
|
-
* Displayed to the user during passkey registration or signing prompts.
|
|
43
|
-
* If not provided, a default name identifier within the JWT
|
|
44
|
-
* that is specified in the project settings (typically `sub`) will be used.
|
|
45
|
-
*/
|
|
46
|
-
passkeyName?: string;
|
|
47
|
-
onPrePasskeyRegistration?: () => Promise<void> | void;
|
|
48
|
-
onPasskeyRegistrationError?: (error: unknown) => Promise<void>;
|
|
49
|
-
onFirstTimePasskeySigning?: () => Promise<void> | void;
|
|
50
|
-
onFirstTimePasskeySigningError?: (error: unknown) => Promise<void>;
|
|
51
|
-
};
|
|
52
|
-
type ExternalSigner = EIP1193Provider | ViemAccount;
|
|
53
|
-
interface WalletParams {
|
|
54
|
-
signer: ExternalSigner | PasskeySigner;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
declare const SUPPORTED_KERNEL_VERSIONS: readonly ["0.3.1", "0.3.0", "0.2.4"];
|
|
58
|
-
declare const SUPPORTED_ENTRYPOINT_VERSIONS: readonly ["v0.6", "v0.7"];
|
|
59
|
-
|
|
60
|
-
type SupportedKernelVersion = (typeof SUPPORTED_KERNEL_VERSIONS)[number];
|
|
61
|
-
type SupportedEntryPointVersion = (typeof SUPPORTED_ENTRYPOINT_VERSIONS)[number];
|
|
62
|
-
type SmartWalletClient = SmartAccountClient<EntryPoint, HttpTransport, Chain, SmartAccount<EntryPoint>>;
|
|
63
|
-
|
|
64
|
-
declare const EOASignerDataSchema: z.ZodObject<{
|
|
65
|
-
eoaAddress: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
66
|
-
type: z.ZodLiteral<"eoa">;
|
|
67
|
-
}, "strip", z.ZodTypeAny, {
|
|
68
|
-
type: "eoa";
|
|
69
|
-
eoaAddress: `0x${string}`;
|
|
70
|
-
}, {
|
|
71
|
-
type: "eoa";
|
|
72
|
-
eoaAddress: `0x${string}`;
|
|
73
|
-
}>;
|
|
74
|
-
declare const PasskeySignerDataSchema: z.ZodObject<{
|
|
75
|
-
entryPoint: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
76
|
-
validatorAddress: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
77
|
-
pubKeyX: z.ZodString;
|
|
78
|
-
pubKeyY: z.ZodString;
|
|
79
|
-
authenticatorIdHash: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
80
|
-
authenticatorId: z.ZodString;
|
|
81
|
-
passkeyName: z.ZodString;
|
|
82
|
-
validatorContractVersion: z.ZodNativeEnum<typeof PasskeyValidatorContractVersion>;
|
|
83
|
-
domain: z.ZodString;
|
|
84
|
-
type: z.ZodLiteral<"passkeys">;
|
|
85
|
-
}, "strip", z.ZodTypeAny, {
|
|
86
|
-
type: "passkeys";
|
|
87
|
-
entryPoint: `0x${string}`;
|
|
88
|
-
domain: string;
|
|
89
|
-
validatorAddress: `0x${string}`;
|
|
90
|
-
pubKeyX: string;
|
|
91
|
-
pubKeyY: string;
|
|
92
|
-
authenticatorIdHash: `0x${string}`;
|
|
93
|
-
authenticatorId: string;
|
|
94
|
-
passkeyName: string;
|
|
95
|
-
validatorContractVersion: PasskeyValidatorContractVersion;
|
|
96
|
-
}, {
|
|
97
|
-
type: "passkeys";
|
|
98
|
-
entryPoint: `0x${string}`;
|
|
99
|
-
domain: string;
|
|
100
|
-
validatorAddress: `0x${string}`;
|
|
101
|
-
pubKeyX: string;
|
|
102
|
-
pubKeyY: string;
|
|
103
|
-
authenticatorIdHash: `0x${string}`;
|
|
104
|
-
authenticatorId: string;
|
|
105
|
-
passkeyName: string;
|
|
106
|
-
validatorContractVersion: PasskeyValidatorContractVersion;
|
|
107
|
-
}>;
|
|
108
|
-
declare const SignerDataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
109
|
-
entryPoint: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
110
|
-
validatorAddress: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
111
|
-
pubKeyX: z.ZodString;
|
|
112
|
-
pubKeyY: z.ZodString;
|
|
113
|
-
authenticatorIdHash: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
114
|
-
authenticatorId: z.ZodString;
|
|
115
|
-
passkeyName: z.ZodString;
|
|
116
|
-
validatorContractVersion: z.ZodNativeEnum<typeof PasskeyValidatorContractVersion>;
|
|
117
|
-
domain: z.ZodString;
|
|
118
|
-
type: z.ZodLiteral<"passkeys">;
|
|
119
|
-
}, "strip", z.ZodTypeAny, {
|
|
120
|
-
type: "passkeys";
|
|
121
|
-
entryPoint: `0x${string}`;
|
|
122
|
-
domain: string;
|
|
123
|
-
validatorAddress: `0x${string}`;
|
|
124
|
-
pubKeyX: string;
|
|
125
|
-
pubKeyY: string;
|
|
126
|
-
authenticatorIdHash: `0x${string}`;
|
|
127
|
-
authenticatorId: string;
|
|
128
|
-
passkeyName: string;
|
|
129
|
-
validatorContractVersion: PasskeyValidatorContractVersion;
|
|
130
|
-
}, {
|
|
131
|
-
type: "passkeys";
|
|
132
|
-
entryPoint: `0x${string}`;
|
|
133
|
-
domain: string;
|
|
134
|
-
validatorAddress: `0x${string}`;
|
|
135
|
-
pubKeyX: string;
|
|
136
|
-
pubKeyY: string;
|
|
137
|
-
authenticatorIdHash: `0x${string}`;
|
|
138
|
-
authenticatorId: string;
|
|
139
|
-
passkeyName: string;
|
|
140
|
-
validatorContractVersion: PasskeyValidatorContractVersion;
|
|
141
|
-
}>, z.ZodObject<{
|
|
142
|
-
eoaAddress: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
143
|
-
type: z.ZodLiteral<"eoa">;
|
|
144
|
-
}, "strip", z.ZodTypeAny, {
|
|
145
|
-
type: "eoa";
|
|
146
|
-
eoaAddress: `0x${string}`;
|
|
147
|
-
}, {
|
|
148
|
-
type: "eoa";
|
|
149
|
-
eoaAddress: `0x${string}`;
|
|
150
|
-
}>]>;
|
|
151
|
-
declare const SmartWalletConfigSchema: z.ZodObject<{
|
|
152
|
-
kernelVersion: z.ZodEnum<["0.3.1", "0.3.0", "0.2.4"]>;
|
|
153
|
-
entryPointVersion: z.ZodEnum<["v0.6", "v0.7"]>;
|
|
154
|
-
userId: z.ZodString;
|
|
155
|
-
signers: z.ZodArray<z.ZodObject<{
|
|
156
|
-
signerData: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
157
|
-
entryPoint: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
158
|
-
validatorAddress: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
159
|
-
pubKeyX: z.ZodString;
|
|
160
|
-
pubKeyY: z.ZodString;
|
|
161
|
-
authenticatorIdHash: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
162
|
-
authenticatorId: z.ZodString;
|
|
163
|
-
passkeyName: z.ZodString;
|
|
164
|
-
validatorContractVersion: z.ZodNativeEnum<typeof PasskeyValidatorContractVersion>;
|
|
165
|
-
domain: z.ZodString;
|
|
166
|
-
type: z.ZodLiteral<"passkeys">;
|
|
167
|
-
}, "strip", z.ZodTypeAny, {
|
|
168
|
-
type: "passkeys";
|
|
169
|
-
entryPoint: `0x${string}`;
|
|
170
|
-
domain: string;
|
|
171
|
-
validatorAddress: `0x${string}`;
|
|
172
|
-
pubKeyX: string;
|
|
173
|
-
pubKeyY: string;
|
|
174
|
-
authenticatorIdHash: `0x${string}`;
|
|
175
|
-
authenticatorId: string;
|
|
176
|
-
passkeyName: string;
|
|
177
|
-
validatorContractVersion: PasskeyValidatorContractVersion;
|
|
178
|
-
}, {
|
|
179
|
-
type: "passkeys";
|
|
180
|
-
entryPoint: `0x${string}`;
|
|
181
|
-
domain: string;
|
|
182
|
-
validatorAddress: `0x${string}`;
|
|
183
|
-
pubKeyX: string;
|
|
184
|
-
pubKeyY: string;
|
|
185
|
-
authenticatorIdHash: `0x${string}`;
|
|
186
|
-
authenticatorId: string;
|
|
187
|
-
passkeyName: string;
|
|
188
|
-
validatorContractVersion: PasskeyValidatorContractVersion;
|
|
189
|
-
}>, z.ZodObject<{
|
|
190
|
-
eoaAddress: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
191
|
-
type: z.ZodLiteral<"eoa">;
|
|
192
|
-
}, "strip", z.ZodTypeAny, {
|
|
193
|
-
type: "eoa";
|
|
194
|
-
eoaAddress: `0x${string}`;
|
|
195
|
-
}, {
|
|
196
|
-
type: "eoa";
|
|
197
|
-
eoaAddress: `0x${string}`;
|
|
198
|
-
}>]>;
|
|
199
|
-
}, "strip", z.ZodTypeAny, {
|
|
200
|
-
signerData: {
|
|
201
|
-
type: "eoa";
|
|
202
|
-
eoaAddress: `0x${string}`;
|
|
203
|
-
} | {
|
|
204
|
-
type: "passkeys";
|
|
205
|
-
entryPoint: `0x${string}`;
|
|
206
|
-
domain: string;
|
|
207
|
-
validatorAddress: `0x${string}`;
|
|
208
|
-
pubKeyX: string;
|
|
209
|
-
pubKeyY: string;
|
|
210
|
-
authenticatorIdHash: `0x${string}`;
|
|
211
|
-
authenticatorId: string;
|
|
212
|
-
passkeyName: string;
|
|
213
|
-
validatorContractVersion: PasskeyValidatorContractVersion;
|
|
214
|
-
};
|
|
215
|
-
}, {
|
|
216
|
-
signerData: {
|
|
217
|
-
type: "eoa";
|
|
218
|
-
eoaAddress: `0x${string}`;
|
|
219
|
-
} | {
|
|
220
|
-
type: "passkeys";
|
|
221
|
-
entryPoint: `0x${string}`;
|
|
222
|
-
domain: string;
|
|
223
|
-
validatorAddress: `0x${string}`;
|
|
224
|
-
pubKeyX: string;
|
|
225
|
-
pubKeyY: string;
|
|
226
|
-
authenticatorIdHash: `0x${string}`;
|
|
227
|
-
authenticatorId: string;
|
|
228
|
-
passkeyName: string;
|
|
229
|
-
validatorContractVersion: PasskeyValidatorContractVersion;
|
|
230
|
-
};
|
|
231
|
-
}>, "many">;
|
|
232
|
-
smartContractWalletAddress: z.ZodOptional<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
233
|
-
}, "strip", z.ZodTypeAny, {
|
|
234
|
-
kernelVersion: "0.2.4" | "0.3.0" | "0.3.1";
|
|
235
|
-
entryPointVersion: "v0.6" | "v0.7";
|
|
236
|
-
userId: string;
|
|
237
|
-
signers: {
|
|
238
|
-
signerData: {
|
|
239
|
-
type: "eoa";
|
|
240
|
-
eoaAddress: `0x${string}`;
|
|
241
|
-
} | {
|
|
242
|
-
type: "passkeys";
|
|
243
|
-
entryPoint: `0x${string}`;
|
|
244
|
-
domain: string;
|
|
245
|
-
validatorAddress: `0x${string}`;
|
|
246
|
-
pubKeyX: string;
|
|
247
|
-
pubKeyY: string;
|
|
248
|
-
authenticatorIdHash: `0x${string}`;
|
|
249
|
-
authenticatorId: string;
|
|
250
|
-
passkeyName: string;
|
|
251
|
-
validatorContractVersion: PasskeyValidatorContractVersion;
|
|
252
|
-
};
|
|
253
|
-
}[];
|
|
254
|
-
smartContractWalletAddress?: `0x${string}` | undefined;
|
|
255
|
-
}, {
|
|
256
|
-
kernelVersion: "0.2.4" | "0.3.0" | "0.3.1";
|
|
257
|
-
entryPointVersion: "v0.6" | "v0.7";
|
|
258
|
-
userId: string;
|
|
259
|
-
signers: {
|
|
260
|
-
signerData: {
|
|
261
|
-
type: "eoa";
|
|
262
|
-
eoaAddress: `0x${string}`;
|
|
263
|
-
} | {
|
|
264
|
-
type: "passkeys";
|
|
265
|
-
entryPoint: `0x${string}`;
|
|
266
|
-
domain: string;
|
|
267
|
-
validatorAddress: `0x${string}`;
|
|
268
|
-
pubKeyX: string;
|
|
269
|
-
pubKeyY: string;
|
|
270
|
-
authenticatorIdHash: `0x${string}`;
|
|
271
|
-
authenticatorId: string;
|
|
272
|
-
passkeyName: string;
|
|
273
|
-
validatorContractVersion: PasskeyValidatorContractVersion;
|
|
274
|
-
};
|
|
275
|
-
}[];
|
|
276
|
-
smartContractWalletAddress?: `0x${string}` | undefined;
|
|
277
|
-
}>;
|
|
278
|
-
|
|
279
|
-
type EOASignerData = z.infer<typeof EOASignerDataSchema>;
|
|
280
|
-
type PasskeySignerData = z.infer<typeof PasskeySignerDataSchema>;
|
|
281
|
-
type SmartWalletConfig = z.infer<typeof SmartWalletConfigSchema>;
|
|
282
|
-
type SignerData = z.infer<typeof SignerDataSchema>;
|
|
283
|
-
type PasskeyDisplay = Pick<PasskeySignerData, "type" | "passkeyName" | "pubKeyX" | "pubKeyY">;
|
|
284
|
-
type SignerDisplay = EOASignerData | PasskeyDisplay;
|
|
285
|
-
type StoreSmartWalletParams = {
|
|
286
|
-
type: string;
|
|
287
|
-
smartContractWalletAddress: string;
|
|
288
|
-
signerData: SignerData;
|
|
289
|
-
sessionKeySignerAddress?: string;
|
|
290
|
-
version: number;
|
|
291
|
-
baseLayer: string;
|
|
292
|
-
chainId: number;
|
|
293
|
-
entryPointVersion: SupportedEntryPointVersion;
|
|
294
|
-
kernelVersion: SupportedKernelVersion;
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
type WalletsAPIErrorCodes = "ERROR_USER_WALLET_ALREADY_CREATED" | "ERROR_ADMIN_SIGNER_ALREADY_USED" | "ERROR_PROJECT_NONCUSTODIAL_WALLETS_NOT_ENABLED";
|
|
298
|
-
declare class CrossmintWalletService extends BaseCrossmintService {
|
|
299
|
-
logger: _crossmint_client_sdk_base.SDKLogger;
|
|
300
|
-
protected apiErrorService: APIErrorService<WalletsAPIErrorCodes>;
|
|
301
|
-
idempotentCreateSmartWallet(user: UserParams, input: StoreSmartWalletParams): Promise<void>;
|
|
302
|
-
sponsorUserOperation<E extends EntryPoint>(user: UserParams, userOp: UserOperation<GetEntryPointVersion<E>>, entryPoint: E, chain: SmartWalletChain): Promise<{
|
|
303
|
-
sponsorUserOpParams: UserOperation<GetEntryPointVersion<E>>;
|
|
304
|
-
}>;
|
|
305
|
-
getSmartWalletConfig(user: UserParams, chain: SmartWalletChain): Promise<SmartWalletConfig>;
|
|
306
|
-
fetchNFTs(address: string, chain: SmartWalletChain): Promise<any>;
|
|
307
|
-
getPasskeyServerUrl(): string;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
interface EVMToken {
|
|
311
|
-
chain: SmartWalletChain;
|
|
312
|
-
contractAddress: Address;
|
|
313
|
-
}
|
|
314
|
-
interface NFTEVMToken extends EVMToken {
|
|
315
|
-
tokenId: string;
|
|
316
|
-
type: "nft";
|
|
317
|
-
}
|
|
318
|
-
interface SFTEVMToken extends EVMToken {
|
|
319
|
-
tokenId: string;
|
|
320
|
-
type: "sft";
|
|
321
|
-
}
|
|
322
|
-
interface ERC2OEVMToken extends EVMToken {
|
|
323
|
-
type: "ft";
|
|
324
|
-
}
|
|
325
|
-
type ERC20TransferType = {
|
|
326
|
-
token: ERC2OEVMToken;
|
|
327
|
-
amount: bigint;
|
|
328
|
-
};
|
|
329
|
-
type SFTTransferType = {
|
|
330
|
-
token: SFTEVMToken;
|
|
331
|
-
quantity: number;
|
|
332
|
-
};
|
|
333
|
-
type NFTTransferType = {
|
|
334
|
-
token: NFTEVMToken;
|
|
335
|
-
};
|
|
336
|
-
type TransferType = ERC20TransferType | SFTTransferType | NFTTransferType;
|
|
337
|
-
|
|
338
|
-
type TransactionServiceTransactionRequest = {
|
|
339
|
-
address: Address;
|
|
340
|
-
abi: Abi;
|
|
341
|
-
functionName: string;
|
|
342
|
-
args: any;
|
|
343
|
-
value?: bigint;
|
|
344
|
-
};
|
|
345
|
-
type SendTransactionFailureStage = "simulation" | "send" | "confirmation" | "execution";
|
|
346
|
-
/**
|
|
347
|
-
* Error thrown when a transaction fails to send.
|
|
348
|
-
* @param viemError The error thrown by the viem client. See https://viem.sh/docs/glossary/errors.html
|
|
349
|
-
*/
|
|
350
|
-
declare class EVMSendTransactionError extends CrossmintSDKError {
|
|
351
|
-
readonly viemError: BaseError;
|
|
352
|
-
readonly stage: SendTransactionFailureStage;
|
|
353
|
-
constructor(message: string, viemError: BaseError, stage: SendTransactionFailureStage, code?: string);
|
|
354
|
-
}
|
|
355
|
-
/**
|
|
356
|
-
* Error thrown when a transaction fails due to a contract execution error.
|
|
357
|
-
* @param viemError The error thrown by the viem client. See https://viem.sh/docs/glossary/errors.html
|
|
358
|
-
* @param data The name and arguments of the revert error from the provided ABI
|
|
359
|
-
* @param reason The revert error if it is a string and not an ABI error
|
|
360
|
-
* @example
|
|
361
|
-
* try {
|
|
362
|
-
* await wallet.executeContract({
|
|
363
|
-
* address: contractAddress,
|
|
364
|
-
* abi,
|
|
365
|
-
* functionName: "mintNFT",
|
|
366
|
-
* args: [recipientAddress],
|
|
367
|
-
* });
|
|
368
|
-
* } catch (e) {
|
|
369
|
-
* if (e instanceof SendTransactionExecutionRevertedError) {
|
|
370
|
-
* alert(`Transaction reverted: ${e.message}`);
|
|
371
|
-
* }
|
|
372
|
-
* throw e;
|
|
373
|
-
* }
|
|
374
|
-
*/
|
|
375
|
-
declare class EVMSendTransactionExecutionRevertedError extends EVMSendTransactionError {
|
|
376
|
-
readonly viemError: BaseError;
|
|
377
|
-
readonly txId: string | undefined;
|
|
378
|
-
readonly stage: SendTransactionFailureStage;
|
|
379
|
-
readonly data: {
|
|
380
|
-
abiItem: viem.AbiItem;
|
|
381
|
-
args: readonly unknown[] | undefined;
|
|
382
|
-
errorName: string;
|
|
383
|
-
} | undefined;
|
|
384
|
-
readonly reason: string | undefined;
|
|
385
|
-
constructor(message: string, viemError: BaseError, revertError: ContractFunctionRevertedError, txId: string | undefined, stage: SendTransactionFailureStage, data?: {
|
|
386
|
-
abiItem: viem.AbiItem;
|
|
387
|
-
args: readonly unknown[] | undefined;
|
|
388
|
-
errorName: string;
|
|
389
|
-
} | undefined, reason?: string | undefined);
|
|
390
|
-
}
|
|
391
|
-
interface SendTransactionOptions {
|
|
392
|
-
/**
|
|
393
|
-
* The number of confirmations to wait for before yielding the transaction hash.
|
|
394
|
-
*/
|
|
395
|
-
confirmations: number;
|
|
396
|
-
/**
|
|
397
|
-
* The timeout in milliseconds to wait for a transaction to confirm before throwing an error.
|
|
398
|
-
*/
|
|
399
|
-
transactionConfirmationTimeout: number;
|
|
400
|
-
}
|
|
401
|
-
declare class SendTransactionService {
|
|
402
|
-
private readonly client;
|
|
403
|
-
private readonly defaultSendTransactionOptions;
|
|
404
|
-
constructor(client: {
|
|
405
|
-
public: PublicClient;
|
|
406
|
-
wallet: SmartAccountClient<EntryPoint$1, Transport, Chain, SmartAccount<EntryPoint$1>>;
|
|
407
|
-
}, defaultSendTransactionOptions?: SendTransactionOptions);
|
|
408
|
-
sendTransaction(request: TransactionServiceTransactionRequest, config?: Partial<SendTransactionOptions>): Promise<Hex>;
|
|
409
|
-
private getConfig;
|
|
410
|
-
private handleReceipt;
|
|
411
|
-
private simulateCall;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* Smart wallet interface for EVM chains enhanced with Crossmint capabilities.
|
|
416
|
-
* Core functionality is exposed via [viem](https://viem.sh/) clients within the `client` property of the class.
|
|
417
|
-
*/
|
|
418
|
-
declare class EVMSmartWallet {
|
|
419
|
-
private readonly crossmintService;
|
|
420
|
-
private readonly sendTransactionService;
|
|
421
|
-
readonly chain: SmartWalletChain;
|
|
422
|
-
/**
|
|
423
|
-
* [viem](https://viem.sh/) clients that provide an interface for core wallet functionality.
|
|
424
|
-
*/
|
|
425
|
-
readonly client: {
|
|
426
|
-
/**
|
|
427
|
-
* An interface to interact with the smart wallet, execute transactions, sign messages, etc.
|
|
428
|
-
*/
|
|
429
|
-
wallet: SmartWalletClient;
|
|
430
|
-
/**
|
|
431
|
-
* An interface to read onchain data, fetch transactions, retrieve account balances, etc. Corresponds to public [JSON-RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/) methods.
|
|
432
|
-
*/
|
|
433
|
-
public: PublicClient;
|
|
434
|
-
};
|
|
435
|
-
constructor(client: {
|
|
436
|
-
public: PublicClient<HttpTransport>;
|
|
437
|
-
wallet: SmartWalletClient;
|
|
438
|
-
}, chain: SmartWalletChain, crossmintService: CrossmintWalletService, sendTransactionService?: SendTransactionService);
|
|
439
|
-
/**
|
|
440
|
-
* The address of the smart wallet.
|
|
441
|
-
*/
|
|
442
|
-
get address(): `0x${string}`;
|
|
443
|
-
/**
|
|
444
|
-
* Transfers tokens from the smart wallet to a specified address.
|
|
445
|
-
* @param toAddress The recipient's address.
|
|
446
|
-
* @param config The transfer configuration, including token details and amount.
|
|
447
|
-
* @returns The transaction hash.
|
|
448
|
-
* @throws {SmartWalletError} If there's a chain mismatch between this wallet and the input configuration.
|
|
449
|
-
* @throws {SendTransactionError} If the transaction fails to send. Contains the error thrown by the viem client.
|
|
450
|
-
* @throws {SendTransactionExecutionRevertedError} A subclass of SendTransactionError if the transaction fails due to a contract execution error.
|
|
451
|
-
*/
|
|
452
|
-
transferToken(toAddress: Address, config: TransferType): Promise<string>;
|
|
453
|
-
/**
|
|
454
|
-
* @returns A list of NFTs owned by the wallet.
|
|
455
|
-
*/
|
|
456
|
-
nfts(): Promise<any>;
|
|
457
|
-
/**
|
|
458
|
-
* Sends a contract call transaction and returns the hash of a confirmed transaction.
|
|
459
|
-
* @param address the address of the contract to be called
|
|
460
|
-
* @param abi the ABI of the contract - ***should be defined as a typed variable*** to enable type checking of the contract arguments, see https://viem.sh/docs/typescript#type-inference for guidance
|
|
461
|
-
* @param functionName the name of the smart contract function to be called
|
|
462
|
-
* @param args the arguments to be passed to the function
|
|
463
|
-
* @returns The transaction hash.
|
|
464
|
-
* @throws `SendTransactionError` if the transaction fails to send. Contains the error thrown by the viem client.
|
|
465
|
-
* @throws `SendTransactionExecutionRevertedError`, a subclass of `SendTransactionError` if the transaction fails due to a contract execution error.
|
|
466
|
-
*
|
|
467
|
-
* **Passing a typed ABI:**
|
|
468
|
-
* @example
|
|
469
|
-
* const abi = [{
|
|
470
|
-
* "inputs": [
|
|
471
|
-
* {
|
|
472
|
-
* "internalType": "address",
|
|
473
|
-
* "name": "recipient",
|
|
474
|
-
* "type": "address"
|
|
475
|
-
* },
|
|
476
|
-
* ],
|
|
477
|
-
* "name": "mintNFT",
|
|
478
|
-
* "outputs": [],
|
|
479
|
-
* "stateMutability": "nonpayable",
|
|
480
|
-
* "type": "function"
|
|
481
|
-
* }] as const;
|
|
482
|
-
*
|
|
483
|
-
* await wallet.executeContract({
|
|
484
|
-
* address: contractAddress,
|
|
485
|
-
* abi,
|
|
486
|
-
* functionName: "mintNFT",
|
|
487
|
-
* args: [recipientAddress],
|
|
488
|
-
* });
|
|
489
|
-
*/
|
|
490
|
-
executeContract<const TAbi extends Abi | readonly unknown[], TFunctionName extends ContractFunctionName<TAbi, "nonpayable" | "payable"> = ContractFunctionName<TAbi, "nonpayable" | "payable">, TArgs extends ContractFunctionArgs<TAbi, "nonpayable" | "payable", TFunctionName> = ContractFunctionArgs<TAbi, "nonpayable" | "payable", TFunctionName>>({ address, abi, functionName, args, value, config, }: Omit<WriteContractParameters<TAbi, TFunctionName, TArgs>, "chain" | "account"> & {
|
|
491
|
-
config?: Partial<SendTransactionOptions>;
|
|
492
|
-
}): Promise<Hex>;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
declare class SmartWalletError extends CrossmintSDKError {
|
|
496
|
-
constructor(message: string, details?: string, code?: SmartWalletErrorCode);
|
|
497
|
-
}
|
|
498
|
-
declare class AdminMismatchError extends SmartWalletError {
|
|
499
|
-
readonly required: SignerDisplay;
|
|
500
|
-
readonly used?: SignerDisplay;
|
|
501
|
-
constructor(message: string, required: SignerDisplay, used?: SignerDisplay);
|
|
502
|
-
}
|
|
503
|
-
declare class PasskeyMismatchError extends SmartWalletError {
|
|
504
|
-
readonly required: PasskeyDisplay;
|
|
505
|
-
readonly used?: PasskeyDisplay;
|
|
506
|
-
constructor(message: string, required: PasskeyDisplay, used?: PasskeyDisplay);
|
|
507
|
-
}
|
|
508
|
-
declare class UserWalletAlreadyCreatedError extends SmartWalletError {
|
|
509
|
-
readonly code: "smart-wallet:user-wallet-already-created";
|
|
510
|
-
constructor(userId: string);
|
|
511
|
-
}
|
|
512
|
-
declare class PasskeyPromptError extends SmartWalletError {
|
|
513
|
-
passkeyName: string;
|
|
514
|
-
constructor(passkeyName: string);
|
|
515
|
-
}
|
|
516
|
-
declare class PasskeyRegistrationError extends SmartWalletError {
|
|
517
|
-
passkeyName: string;
|
|
518
|
-
constructor(passkeyName: string);
|
|
519
|
-
}
|
|
520
|
-
declare class PasskeyIncompatibleAuthenticatorError extends SmartWalletError {
|
|
521
|
-
passkeyName: string;
|
|
522
|
-
constructor(passkeyName: string);
|
|
523
|
-
}
|
|
524
|
-
declare class ConfigError extends SmartWalletError {
|
|
525
|
-
constructor(message: string);
|
|
526
|
-
}
|
|
527
|
-
declare class AdminAlreadyUsedError extends ConfigError {
|
|
528
|
-
readonly code: "smart-wallet:config.admin-signer-already-used";
|
|
529
|
-
constructor();
|
|
530
|
-
}
|
|
531
|
-
declare class SmartWalletsNotEnabledError extends ConfigError {
|
|
532
|
-
readonly code: "smart-wallet:not-enabled";
|
|
533
|
-
constructor();
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
declare class SmartWalletSDK {
|
|
537
|
-
private readonly crossmintEnv;
|
|
538
|
-
private readonly smartWalletService;
|
|
539
|
-
private readonly errorProcessor;
|
|
540
|
-
private readonly logger;
|
|
541
|
-
private constructor();
|
|
542
|
-
/**
|
|
543
|
-
* Initializes the SDK with the **client side** API key obtained from the Crossmint console.
|
|
544
|
-
* @throws error if the api key is not formatted correctly.
|
|
545
|
-
*/
|
|
546
|
-
static init({ clientApiKey }: SmartWalletSDKInitParams): SmartWalletSDK;
|
|
547
|
-
/**
|
|
548
|
-
* Retrieves or creates a wallet for the specified user.
|
|
549
|
-
* The default configuration is a `PasskeySigner` with the name, which is displayed to the user during creation or signing prompts, derived from the provided jwt.
|
|
550
|
-
*
|
|
551
|
-
* Example using the default passkey signer:
|
|
552
|
-
* ```ts
|
|
553
|
-
* const wallet = await smartWalletSDK.getOrCreateWallet({ jwt: "xxx" }, "base");
|
|
554
|
-
* ```
|
|
555
|
-
*/
|
|
556
|
-
getOrCreateWallet(user: UserParams, chain: SmartWalletChain, walletParams?: WalletParams): Promise<EVMSmartWallet>;
|
|
557
|
-
private assertValidChain;
|
|
558
|
-
private validChain;
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
export { AdminAlreadyUsedError, AdminMismatchError, ConfigError, type ERC20TransferType, EVMSendTransactionError, EVMSendTransactionExecutionRevertedError, EVMSmartWallet, SmartWalletChain as EVMSmartWalletChain, type ExternalSigner, type NFTTransferType, PasskeyIncompatibleAuthenticatorError, PasskeyMismatchError, PasskeyPromptError, PasskeyRegistrationError, type PasskeySigner, type SFTTransferType, SmartWalletError, SmartWalletSDK, type SmartWalletSDKInitParams, SmartWalletsNotEnabledError, type TransferType, type UserParams, UserWalletAlreadyCreatedError, type ViemAccount, type WalletParams };
|
|
9
|
+
export { SmartWalletSDK } from './SmartWalletSDK.cjs';
|
|
10
|
+
import 'viem';
|
|
11
|
+
import './api/CrossmintWalletService.cjs';
|
|
12
|
+
import 'permissionless';
|
|
13
|
+
import 'permissionless/types/entrypoint';
|
|
14
|
+
import './service-Ir-Qho-9.cjs';
|
|
15
|
+
import 'zod';
|
|
16
|
+
import '@zerodev/sdk';
|
|
17
|
+
import 'permissionless/accounts';
|
|
18
|
+
import './types/schema.cjs';
|
|
19
|
+
import '@zerodev/passkey-validator';
|
|
20
|
+
import './utils/constants.cjs';
|
|
21
|
+
import 'viem/chains';
|
|
22
|
+
import 'permissionless/_types/types';
|