@crossmint/client-sdk-smart-wallet 0.1.18 → 0.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/dist/SmartWalletSDK.cjs +1 -0
  2. package/dist/SmartWalletSDK.d.cts +47 -0
  3. package/dist/SmartWalletSDK.d.ts +47 -0
  4. package/dist/SmartWalletSDK.js +1 -0
  5. package/dist/api/CrossmintWalletService.cjs +1 -0
  6. package/dist/api/CrossmintWalletService.d.cts +31 -0
  7. package/dist/api/CrossmintWalletService.d.ts +31 -0
  8. package/dist/api/CrossmintWalletService.js +1 -0
  9. package/dist/blockchain/chains.cjs +1 -0
  10. package/dist/blockchain/chains.d.cts +36 -0
  11. package/dist/blockchain/chains.d.ts +36 -0
  12. package/dist/blockchain/chains.js +1 -0
  13. package/dist/blockchain/rpc.cjs +1 -0
  14. package/dist/blockchain/rpc.d.cts +9 -0
  15. package/dist/blockchain/rpc.d.ts +9 -0
  16. package/dist/blockchain/rpc.js +1 -0
  17. package/dist/blockchain/transfer.cjs +1 -0
  18. package/dist/blockchain/transfer.d.cts +23 -0
  19. package/dist/blockchain/transfer.d.ts +23 -0
  20. package/dist/blockchain/transfer.js +1 -0
  21. package/dist/blockchain/wallets/EVMSmartWallet.cjs +1 -0
  22. package/dist/blockchain/wallets/EVMSmartWallet.d.cts +102 -0
  23. package/dist/blockchain/wallets/EVMSmartWallet.d.ts +102 -0
  24. package/dist/blockchain/wallets/EVMSmartWallet.js +1 -0
  25. package/dist/blockchain/wallets/SendTransactionService.cjs +1 -0
  26. package/dist/blockchain/wallets/SendTransactionService.d.cts +84 -0
  27. package/dist/blockchain/wallets/SendTransactionService.d.ts +84 -0
  28. package/dist/blockchain/wallets/SendTransactionService.js +1 -0
  29. package/dist/blockchain/wallets/account/cache.cjs +1 -0
  30. package/dist/blockchain/wallets/account/cache.d.cts +25 -0
  31. package/dist/blockchain/wallets/account/cache.d.ts +25 -0
  32. package/dist/blockchain/wallets/account/cache.js +1 -0
  33. package/dist/blockchain/wallets/account/config.cjs +1 -0
  34. package/dist/blockchain/wallets/account/config.d.cts +47 -0
  35. package/dist/blockchain/wallets/account/config.d.ts +47 -0
  36. package/dist/blockchain/wallets/account/config.js +1 -0
  37. package/dist/blockchain/wallets/account/creator.cjs +1 -0
  38. package/dist/blockchain/wallets/account/creator.d.cts +26 -0
  39. package/dist/blockchain/wallets/account/creator.d.ts +26 -0
  40. package/dist/blockchain/wallets/account/creator.js +1 -0
  41. package/dist/blockchain/wallets/account/eoa.cjs +1 -0
  42. package/dist/blockchain/wallets/account/eoa.d.cts +21 -0
  43. package/dist/blockchain/wallets/account/eoa.d.ts +21 -0
  44. package/dist/blockchain/wallets/account/eoa.js +1 -0
  45. package/dist/blockchain/wallets/account/passkey.cjs +1 -0
  46. package/dist/blockchain/wallets/account/passkey.d.cts +29 -0
  47. package/dist/blockchain/wallets/account/passkey.d.ts +29 -0
  48. package/dist/blockchain/wallets/account/passkey.js +1 -0
  49. package/dist/blockchain/wallets/account/signer.cjs +1 -0
  50. package/dist/blockchain/wallets/account/signer.d.cts +14 -0
  51. package/dist/blockchain/wallets/account/signer.d.ts +14 -0
  52. package/dist/blockchain/wallets/account/signer.js +1 -0
  53. package/dist/blockchain/wallets/account/strategy.cjs +1 -0
  54. package/dist/blockchain/wallets/account/strategy.d.cts +20 -0
  55. package/dist/blockchain/wallets/account/strategy.d.ts +20 -0
  56. package/dist/blockchain/wallets/account/strategy.js +0 -0
  57. package/dist/blockchain/wallets/clientDecorator.cjs +1 -0
  58. package/dist/blockchain/wallets/clientDecorator.d.cts +38 -0
  59. package/dist/blockchain/wallets/clientDecorator.d.ts +38 -0
  60. package/dist/blockchain/wallets/clientDecorator.js +1 -0
  61. package/dist/blockchain/wallets/index.cjs +1 -0
  62. package/dist/blockchain/wallets/index.d.cts +20 -0
  63. package/dist/blockchain/wallets/index.d.ts +20 -0
  64. package/dist/blockchain/wallets/index.js +1 -0
  65. package/dist/blockchain/wallets/paymaster.cjs +1 -0
  66. package/dist/blockchain/wallets/paymaster.d.cts +29 -0
  67. package/dist/blockchain/wallets/paymaster.d.ts +29 -0
  68. package/dist/blockchain/wallets/paymaster.js +1 -0
  69. package/dist/blockchain/wallets/service.cjs +1 -0
  70. package/dist/blockchain/wallets/service.d.cts +41 -0
  71. package/dist/blockchain/wallets/service.d.ts +41 -0
  72. package/dist/blockchain/wallets/service.js +1 -0
  73. package/dist/chunk-2GS5TXEY.cjs +1 -0
  74. package/dist/chunk-2R6HK64N.cjs +1 -0
  75. package/dist/chunk-3F6P4HUZ.js +1 -0
  76. package/dist/chunk-4SPA557P.js +0 -0
  77. package/dist/chunk-6EPE3ZZK.cjs +1 -0
  78. package/dist/chunk-7AVDZZGD.cjs +1 -0
  79. package/dist/chunk-7FXFOOQU.cjs +1 -0
  80. package/dist/chunk-7LPFDWNT.cjs +1 -0
  81. package/dist/chunk-ATQ4WGCW.js +1 -0
  82. package/dist/chunk-BIVRVBDQ.js +2 -0
  83. package/dist/chunk-BJZQA5VC.js +1 -0
  84. package/dist/chunk-BQWCBNJ2.js +3 -0
  85. package/dist/chunk-C3VZY7VJ.js +1 -0
  86. package/dist/chunk-CUTQYF3F.js +1 -0
  87. package/dist/chunk-D4NDUT36.js +1 -0
  88. package/dist/chunk-DIDKPOO2.cjs +1 -0
  89. package/dist/chunk-EAOSAOUJ.js +1 -0
  90. package/dist/chunk-ETVJGLNY.js +1 -0
  91. package/dist/chunk-FHNNZVNU.js +1 -0
  92. package/dist/chunk-FUC6ULBW.cjs +1 -0
  93. package/dist/chunk-GB35YMN4.cjs +1 -0
  94. package/dist/chunk-GU4S3QTE.js +1 -0
  95. package/dist/chunk-H4CMXNVK.js +1 -0
  96. package/dist/chunk-HHDTWWT5.cjs +1 -0
  97. package/dist/chunk-IQTGPM2U.cjs +1 -0
  98. package/dist/chunk-K6WSBV7E.js +1 -0
  99. package/dist/chunk-KCV4GYG5.js +1 -0
  100. package/dist/chunk-KEUAQQOQ.js +1 -0
  101. package/dist/chunk-KYPTGHC6.cjs +1 -0
  102. package/dist/chunk-LSYXLN6B.js +1 -0
  103. package/dist/chunk-M4K3IZTT.cjs +1 -0
  104. package/dist/chunk-MSLQMIMT.cjs +2 -0
  105. package/dist/chunk-MSV3QZJH.js +1 -0
  106. package/dist/chunk-N7PD7VXW.cjs +1 -0
  107. package/dist/chunk-NLGILHJS.js +1 -0
  108. package/dist/chunk-NWYLIMLV.js +1 -0
  109. package/dist/chunk-O2ACORII.cjs +1 -0
  110. package/dist/chunk-ODAUWGUU.cjs +1 -0
  111. package/dist/chunk-P43ZATVK.cjs +3 -0
  112. package/dist/chunk-PZ6Q22YJ.js +1 -0
  113. package/dist/chunk-S2XBSAGM.js +1 -0
  114. package/dist/chunk-SCXFZMLR.cjs +1 -0
  115. package/dist/chunk-STH2LE35.cjs +1 -0
  116. package/dist/chunk-STWM66DG.cjs +1 -0
  117. package/dist/chunk-SWWOVT47.cjs +1 -0
  118. package/dist/chunk-TDLURLVK.cjs +1 -0
  119. package/dist/chunk-TZG6MROQ.js +1 -0
  120. package/dist/chunk-UG47CBKR.js +1 -0
  121. package/dist/chunk-UPURFW46.js +1 -0
  122. package/dist/chunk-WJ6XJMRD.cjs +1 -0
  123. package/dist/chunk-XJGFG3RT.cjs +1 -0
  124. package/dist/chunk-XLEK44PY.cjs +1 -0
  125. package/dist/chunk-XQ2K2K23.cjs +1 -0
  126. package/dist/chunk-Y4WIOBW4.js +1 -0
  127. package/dist/chunk-Y7EYJ7VO.cjs +1 -0
  128. package/dist/chunk-YBHSEZMB.js +1 -0
  129. package/dist/error/index.cjs +1 -0
  130. package/dist/error/index.d.cts +58 -0
  131. package/dist/error/index.d.ts +58 -0
  132. package/dist/error/index.js +1 -0
  133. package/dist/error/processor.cjs +1 -0
  134. package/dist/error/processor.d.cts +25 -0
  135. package/dist/error/processor.d.ts +25 -0
  136. package/dist/error/processor.js +1 -0
  137. package/dist/index.cjs +1 -5
  138. package/dist/index.d.cts +20 -555
  139. package/dist/index.d.ts +20 -555
  140. package/dist/index.js +1 -5
  141. package/dist/service-DqYCir8s.d.ts +103 -0
  142. package/dist/service-Ir-Qho-9.d.cts +103 -0
  143. package/dist/services/index.cjs +1 -0
  144. package/dist/services/index.d.cts +2 -0
  145. package/dist/services/index.d.ts +2 -0
  146. package/dist/services/index.js +1 -0
  147. package/dist/services/logger.cjs +1 -0
  148. package/dist/services/logger.d.cts +6 -0
  149. package/dist/services/logger.d.ts +6 -0
  150. package/dist/services/logger.js +1 -0
  151. package/dist/types/internal.cjs +1 -0
  152. package/dist/types/internal.d.cts +14 -0
  153. package/dist/types/internal.d.ts +14 -0
  154. package/dist/types/internal.js +1 -0
  155. package/dist/types/params.cjs +1 -0
  156. package/dist/types/params.d.cts +33 -0
  157. package/dist/types/params.d.ts +33 -0
  158. package/dist/types/params.js +0 -0
  159. package/dist/types/schema.cjs +1 -0
  160. package/dist/types/schema.d.cts +241 -0
  161. package/dist/types/schema.d.ts +241 -0
  162. package/dist/types/schema.js +1 -0
  163. package/dist/types/service.cjs +1 -0
  164. package/dist/types/service.d.cts +14 -0
  165. package/dist/types/service.d.ts +14 -0
  166. package/dist/types/service.js +0 -0
  167. package/dist/types/token.cjs +1 -0
  168. package/dist/types/token.d.cts +35 -0
  169. package/dist/types/token.d.ts +35 -0
  170. package/dist/types/token.js +0 -0
  171. package/dist/utils/api.cjs +1 -0
  172. package/dist/utils/api.d.cts +4 -0
  173. package/dist/utils/api.d.ts +4 -0
  174. package/dist/utils/api.js +1 -0
  175. package/dist/utils/blockchain.cjs +1 -0
  176. package/dist/utils/blockchain.d.cts +7 -0
  177. package/dist/utils/blockchain.d.ts +7 -0
  178. package/dist/utils/blockchain.js +1 -0
  179. package/dist/utils/constants.cjs +1 -0
  180. package/dist/utils/constants.d.cts +9 -0
  181. package/dist/utils/constants.d.ts +9 -0
  182. package/dist/utils/constants.js +1 -0
  183. package/dist/utils/environment.cjs +1 -0
  184. package/dist/utils/environment.d.cts +3 -0
  185. package/dist/utils/environment.d.ts +3 -0
  186. package/dist/utils/environment.js +1 -0
  187. package/dist/utils/helpers.cjs +1 -0
  188. package/dist/utils/helpers.d.cts +4 -0
  189. package/dist/utils/helpers.d.ts +4 -0
  190. package/dist/utils/helpers.js +1 -0
  191. package/dist/utils/signer.cjs +1 -0
  192. package/dist/utils/signer.d.cts +15 -0
  193. package/dist/utils/signer.d.ts +15 -0
  194. package/dist/utils/signer.js +1 -0
  195. package/dist/utils/test.cjs +1 -0
  196. package/dist/utils/test.d.cts +18 -0
  197. package/dist/utils/test.d.ts +18 -0
  198. package/dist/utils/test.js +1 -0
  199. package/package.json +4 -5
  200. package/src/blockchain/wallets/account/passkey.ts +27 -3
  201. package/src/types/params.ts +4 -0
  202. package/dist/index.cjs.map +0 -1
  203. package/dist/index.js.map +0 -1
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTDLURLVKcjs = require('./chunk-TDLURLVK.cjs');require('./chunk-SCXFZMLR.cjs');require('./chunk-HHDTWWT5.cjs');require('./chunk-7LPFDWNT.cjs');require('./chunk-IQTGPM2U.cjs');require('./chunk-6EPE3ZZK.cjs');require('./chunk-O2ACORII.cjs');require('./chunk-P43ZATVK.cjs');require('./chunk-2R6HK64N.cjs');require('./chunk-GB35YMN4.cjs');require('./chunk-WJ6XJMRD.cjs');require('./chunk-STH2LE35.cjs');require('./chunk-XJGFG3RT.cjs');require('./chunk-DIDKPOO2.cjs');require('./chunk-SWWOVT47.cjs');require('./chunk-7AVDZZGD.cjs');require('./chunk-STWM66DG.cjs');require('./chunk-MSLQMIMT.cjs');require('./chunk-ODAUWGUU.cjs');require('./chunk-N7PD7VXW.cjs');require('./chunk-FUC6ULBW.cjs');require('./chunk-XQ2K2K23.cjs');require('./chunk-2GS5TXEY.cjs');require('./chunk-7FXFOOQU.cjs');require('./chunk-KYPTGHC6.cjs');require('./chunk-Y7EYJ7VO.cjs');require('./chunk-XLEK44PY.cjs');require('./chunk-M4K3IZTT.cjs');exports.SmartWalletSDK = _chunkTDLURLVKcjs.a;
@@ -0,0 +1,47 @@
1
+ import { SmartWalletChain } from './blockchain/chains.cjs';
2
+ import { EVMSmartWallet } from './blockchain/wallets/EVMSmartWallet.cjs';
3
+ import { SmartWalletSDKInitParams, UserParams, WalletParams } from './types/params.cjs';
4
+ import 'viem/chains';
5
+ import '@crossmint/common-sdk-base';
6
+ import 'viem';
7
+ import './api/CrossmintWalletService.cjs';
8
+ import '@crossmint/client-sdk-base';
9
+ import 'permissionless';
10
+ import 'permissionless/types/entrypoint';
11
+ import './service-Ir-Qho-9.cjs';
12
+ import 'zod';
13
+ import '@zerodev/sdk';
14
+ import 'permissionless/accounts';
15
+ import './types/schema.cjs';
16
+ import '@zerodev/passkey-validator';
17
+ import './utils/constants.cjs';
18
+ import './types/token.cjs';
19
+ import './blockchain/wallets/SendTransactionService.cjs';
20
+ import 'permissionless/_types/types';
21
+
22
+ declare class SmartWalletSDK {
23
+ private readonly crossmintEnv;
24
+ private readonly smartWalletService;
25
+ private readonly errorProcessor;
26
+ private readonly logger;
27
+ private constructor();
28
+ /**
29
+ * Initializes the SDK with the **client side** API key obtained from the Crossmint console.
30
+ * @throws error if the api key is not formatted correctly.
31
+ */
32
+ static init({ clientApiKey }: SmartWalletSDKInitParams): SmartWalletSDK;
33
+ /**
34
+ * Retrieves or creates a wallet for the specified user.
35
+ * 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.
36
+ *
37
+ * Example using the default passkey signer:
38
+ * ```ts
39
+ * const wallet = await smartWalletSDK.getOrCreateWallet({ jwt: "xxx" }, "base");
40
+ * ```
41
+ */
42
+ getOrCreateWallet(user: UserParams, chain: SmartWalletChain, walletParams?: WalletParams): Promise<EVMSmartWallet>;
43
+ private assertValidChain;
44
+ private validChain;
45
+ }
46
+
47
+ export { SmartWalletSDK };
@@ -0,0 +1,47 @@
1
+ import { SmartWalletChain } from './blockchain/chains.js';
2
+ import { EVMSmartWallet } from './blockchain/wallets/EVMSmartWallet.js';
3
+ import { SmartWalletSDKInitParams, UserParams, WalletParams } from './types/params.js';
4
+ import 'viem/chains';
5
+ import '@crossmint/common-sdk-base';
6
+ import 'viem';
7
+ import './api/CrossmintWalletService.js';
8
+ import '@crossmint/client-sdk-base';
9
+ import 'permissionless';
10
+ import 'permissionless/types/entrypoint';
11
+ import './service-DqYCir8s.js';
12
+ import 'zod';
13
+ import '@zerodev/sdk';
14
+ import 'permissionless/accounts';
15
+ import './types/schema.js';
16
+ import '@zerodev/passkey-validator';
17
+ import './utils/constants.js';
18
+ import './types/token.js';
19
+ import './blockchain/wallets/SendTransactionService.js';
20
+ import 'permissionless/_types/types';
21
+
22
+ declare class SmartWalletSDK {
23
+ private readonly crossmintEnv;
24
+ private readonly smartWalletService;
25
+ private readonly errorProcessor;
26
+ private readonly logger;
27
+ private constructor();
28
+ /**
29
+ * Initializes the SDK with the **client side** API key obtained from the Crossmint console.
30
+ * @throws error if the api key is not formatted correctly.
31
+ */
32
+ static init({ clientApiKey }: SmartWalletSDKInitParams): SmartWalletSDK;
33
+ /**
34
+ * Retrieves or creates a wallet for the specified user.
35
+ * 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.
36
+ *
37
+ * Example using the default passkey signer:
38
+ * ```ts
39
+ * const wallet = await smartWalletSDK.getOrCreateWallet({ jwt: "xxx" }, "base");
40
+ * ```
41
+ */
42
+ getOrCreateWallet(user: UserParams, chain: SmartWalletChain, walletParams?: WalletParams): Promise<EVMSmartWallet>;
43
+ private assertValidChain;
44
+ private validChain;
45
+ }
46
+
47
+ export { SmartWalletSDK };
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-LSYXLN6B.js";import"./chunk-H4CMXNVK.js";import"./chunk-NWYLIMLV.js";import"./chunk-KCV4GYG5.js";import"./chunk-NLGILHJS.js";import"./chunk-KEUAQQOQ.js";import"./chunk-ATQ4WGCW.js";import"./chunk-BQWCBNJ2.js";import"./chunk-UG47CBKR.js";import"./chunk-BJZQA5VC.js";import"./chunk-C3VZY7VJ.js";import"./chunk-D4NDUT36.js";import"./chunk-CUTQYF3F.js";import"./chunk-FHNNZVNU.js";import"./chunk-ETVJGLNY.js";import"./chunk-S2XBSAGM.js";import"./chunk-GU4S3QTE.js";import"./chunk-BIVRVBDQ.js";import"./chunk-4SPA557P.js";import"./chunk-Y4WIOBW4.js";import"./chunk-K6WSBV7E.js";import"./chunk-PZ6Q22YJ.js";import"./chunk-YBHSEZMB.js";import"./chunk-TZG6MROQ.js";import"./chunk-3F6P4HUZ.js";import"./chunk-MSV3QZJH.js";import"./chunk-EAOSAOUJ.js";import"./chunk-UPURFW46.js";export{a as SmartWalletSDK};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkMSLQMIMTcjs = require('../chunk-MSLQMIMT.cjs');require('../chunk-ODAUWGUU.cjs');require('../chunk-N7PD7VXW.cjs');require('../chunk-FUC6ULBW.cjs');require('../chunk-XQ2K2K23.cjs');require('../chunk-XLEK44PY.cjs');require('../chunk-M4K3IZTT.cjs');exports.CrossmintWalletService = _chunkMSLQMIMTcjs.a;
@@ -0,0 +1,31 @@
1
+ import * as _crossmint_client_sdk_base from '@crossmint/client-sdk-base';
2
+ import { BaseCrossmintService, APIErrorService } from '@crossmint/client-sdk-base';
3
+ import { UserOperation } from 'permissionless';
4
+ import { EntryPoint, GetEntryPointVersion } from 'permissionless/types/entrypoint';
5
+ import { SmartWalletChain } from '../blockchain/chains.cjs';
6
+ import { UserParams } from '../types/params.cjs';
7
+ import { e as StoreSmartWalletParams, S as SmartWalletConfig } from '../service-Ir-Qho-9.cjs';
8
+ import 'viem/chains';
9
+ import '@crossmint/common-sdk-base';
10
+ import 'viem';
11
+ import 'zod';
12
+ import '@zerodev/sdk';
13
+ import 'permissionless/accounts';
14
+ import '../types/schema.cjs';
15
+ import '@zerodev/passkey-validator';
16
+ import '../utils/constants.cjs';
17
+
18
+ type WalletsAPIErrorCodes = "ERROR_USER_WALLET_ALREADY_CREATED" | "ERROR_ADMIN_SIGNER_ALREADY_USED" | "ERROR_PROJECT_NONCUSTODIAL_WALLETS_NOT_ENABLED";
19
+ declare class CrossmintWalletService extends BaseCrossmintService {
20
+ logger: _crossmint_client_sdk_base.SDKLogger;
21
+ protected apiErrorService: APIErrorService<WalletsAPIErrorCodes>;
22
+ idempotentCreateSmartWallet(user: UserParams, input: StoreSmartWalletParams): Promise<void>;
23
+ sponsorUserOperation<E extends EntryPoint>(user: UserParams, userOp: UserOperation<GetEntryPointVersion<E>>, entryPoint: E, chain: SmartWalletChain): Promise<{
24
+ sponsorUserOpParams: UserOperation<GetEntryPointVersion<E>>;
25
+ }>;
26
+ getSmartWalletConfig(user: UserParams, chain: SmartWalletChain): Promise<SmartWalletConfig>;
27
+ fetchNFTs(address: string, chain: SmartWalletChain): Promise<any>;
28
+ getPasskeyServerUrl(): string;
29
+ }
30
+
31
+ export { CrossmintWalletService };
@@ -0,0 +1,31 @@
1
+ import * as _crossmint_client_sdk_base from '@crossmint/client-sdk-base';
2
+ import { BaseCrossmintService, APIErrorService } from '@crossmint/client-sdk-base';
3
+ import { UserOperation } from 'permissionless';
4
+ import { EntryPoint, GetEntryPointVersion } from 'permissionless/types/entrypoint';
5
+ import { SmartWalletChain } from '../blockchain/chains.js';
6
+ import { UserParams } from '../types/params.js';
7
+ import { e as StoreSmartWalletParams, S as SmartWalletConfig } from '../service-DqYCir8s.js';
8
+ import 'viem/chains';
9
+ import '@crossmint/common-sdk-base';
10
+ import 'viem';
11
+ import 'zod';
12
+ import '@zerodev/sdk';
13
+ import 'permissionless/accounts';
14
+ import '../types/schema.js';
15
+ import '@zerodev/passkey-validator';
16
+ import '../utils/constants.js';
17
+
18
+ type WalletsAPIErrorCodes = "ERROR_USER_WALLET_ALREADY_CREATED" | "ERROR_ADMIN_SIGNER_ALREADY_USED" | "ERROR_PROJECT_NONCUSTODIAL_WALLETS_NOT_ENABLED";
19
+ declare class CrossmintWalletService extends BaseCrossmintService {
20
+ logger: _crossmint_client_sdk_base.SDKLogger;
21
+ protected apiErrorService: APIErrorService<WalletsAPIErrorCodes>;
22
+ idempotentCreateSmartWallet(user: UserParams, input: StoreSmartWalletParams): Promise<void>;
23
+ sponsorUserOperation<E extends EntryPoint>(user: UserParams, userOp: UserOperation<GetEntryPointVersion<E>>, entryPoint: E, chain: SmartWalletChain): Promise<{
24
+ sponsorUserOpParams: UserOperation<GetEntryPointVersion<E>>;
25
+ }>;
26
+ getSmartWalletConfig(user: UserParams, chain: SmartWalletChain): Promise<SmartWalletConfig>;
27
+ fetchNFTs(address: string, chain: SmartWalletChain): Promise<any>;
28
+ getPasskeyServerUrl(): string;
29
+ }
30
+
31
+ export { CrossmintWalletService };
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-BIVRVBDQ.js";import"../chunk-4SPA557P.js";import"../chunk-Y4WIOBW4.js";import"../chunk-K6WSBV7E.js";import"../chunk-PZ6Q22YJ.js";import"../chunk-EAOSAOUJ.js";import"../chunk-UPURFW46.js";export{a as CrossmintWalletService};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2GS5TXEYcjs = require('../chunk-2GS5TXEY.cjs');exports.SMART_WALLET_CHAINS = _chunk2GS5TXEYcjs.f; exports.SMART_WALLET_MAINNETS = _chunk2GS5TXEYcjs.d; exports.SMART_WALLET_TESTNETS = _chunk2GS5TXEYcjs.b; exports.SmartWalletChain = _chunk2GS5TXEYcjs.e; exports.SmartWalletMainnet = _chunk2GS5TXEYcjs.c; exports.SmartWalletTestnet = _chunk2GS5TXEYcjs.a; exports.isMainnetChain = _chunk2GS5TXEYcjs.h; exports.isTestnetChain = _chunk2GS5TXEYcjs.g; exports.viemNetworks = _chunk2GS5TXEYcjs.i;
@@ -0,0 +1,36 @@
1
+ import { Chain } from 'viem/chains';
2
+ import { ObjectValues } from '@crossmint/common-sdk-base';
3
+
4
+ declare const SmartWalletTestnet: {
5
+ readonly BASE_SEPOLIA: "base-sepolia";
6
+ readonly POLYGON_AMOY: "polygon-amoy";
7
+ readonly OPTIMISM_SEPOLIA: "optimism-sepolia";
8
+ readonly ARBITRUM_SEPOLIA: "arbitrum-sepolia";
9
+ };
10
+ type SmartWalletTestnet = ObjectValues<typeof SmartWalletTestnet>;
11
+ declare const SMART_WALLET_TESTNETS: readonly ("base-sepolia" | "polygon-amoy" | "optimism-sepolia" | "arbitrum-sepolia")[];
12
+ declare const SmartWalletMainnet: {
13
+ readonly BASE: "base";
14
+ readonly POLYGON: "polygon";
15
+ readonly OPTIMISM: "optimism";
16
+ readonly ARBITRUM: "arbitrum";
17
+ };
18
+ type SmartWalletMainnet = ObjectValues<typeof SmartWalletMainnet>;
19
+ declare const SMART_WALLET_MAINNETS: readonly ("base" | "polygon" | "optimism" | "arbitrum")[];
20
+ declare const SmartWalletChain: {
21
+ readonly BASE: "base";
22
+ readonly POLYGON: "polygon";
23
+ readonly OPTIMISM: "optimism";
24
+ readonly ARBITRUM: "arbitrum";
25
+ readonly BASE_SEPOLIA: "base-sepolia";
26
+ readonly POLYGON_AMOY: "polygon-amoy";
27
+ readonly OPTIMISM_SEPOLIA: "optimism-sepolia";
28
+ readonly ARBITRUM_SEPOLIA: "arbitrum-sepolia";
29
+ };
30
+ type SmartWalletChain = ObjectValues<typeof SmartWalletChain>;
31
+ declare const SMART_WALLET_CHAINS: readonly ("base-sepolia" | "polygon-amoy" | "optimism-sepolia" | "arbitrum-sepolia" | "base" | "polygon" | "optimism" | "arbitrum")[];
32
+ declare function isTestnetChain(chain: SmartWalletChain): chain is SmartWalletTestnet;
33
+ declare function isMainnetChain(chain: SmartWalletChain): chain is SmartWalletMainnet;
34
+ declare const viemNetworks: Record<SmartWalletChain, Chain>;
35
+
36
+ export { SMART_WALLET_CHAINS, SMART_WALLET_MAINNETS, SMART_WALLET_TESTNETS, SmartWalletChain, SmartWalletMainnet, SmartWalletTestnet, isMainnetChain, isTestnetChain, viemNetworks };
@@ -0,0 +1,36 @@
1
+ import { Chain } from 'viem/chains';
2
+ import { ObjectValues } from '@crossmint/common-sdk-base';
3
+
4
+ declare const SmartWalletTestnet: {
5
+ readonly BASE_SEPOLIA: "base-sepolia";
6
+ readonly POLYGON_AMOY: "polygon-amoy";
7
+ readonly OPTIMISM_SEPOLIA: "optimism-sepolia";
8
+ readonly ARBITRUM_SEPOLIA: "arbitrum-sepolia";
9
+ };
10
+ type SmartWalletTestnet = ObjectValues<typeof SmartWalletTestnet>;
11
+ declare const SMART_WALLET_TESTNETS: readonly ("base-sepolia" | "polygon-amoy" | "optimism-sepolia" | "arbitrum-sepolia")[];
12
+ declare const SmartWalletMainnet: {
13
+ readonly BASE: "base";
14
+ readonly POLYGON: "polygon";
15
+ readonly OPTIMISM: "optimism";
16
+ readonly ARBITRUM: "arbitrum";
17
+ };
18
+ type SmartWalletMainnet = ObjectValues<typeof SmartWalletMainnet>;
19
+ declare const SMART_WALLET_MAINNETS: readonly ("base" | "polygon" | "optimism" | "arbitrum")[];
20
+ declare const SmartWalletChain: {
21
+ readonly BASE: "base";
22
+ readonly POLYGON: "polygon";
23
+ readonly OPTIMISM: "optimism";
24
+ readonly ARBITRUM: "arbitrum";
25
+ readonly BASE_SEPOLIA: "base-sepolia";
26
+ readonly POLYGON_AMOY: "polygon-amoy";
27
+ readonly OPTIMISM_SEPOLIA: "optimism-sepolia";
28
+ readonly ARBITRUM_SEPOLIA: "arbitrum-sepolia";
29
+ };
30
+ type SmartWalletChain = ObjectValues<typeof SmartWalletChain>;
31
+ declare const SMART_WALLET_CHAINS: readonly ("base-sepolia" | "polygon-amoy" | "optimism-sepolia" | "arbitrum-sepolia" | "base" | "polygon" | "optimism" | "arbitrum")[];
32
+ declare function isTestnetChain(chain: SmartWalletChain): chain is SmartWalletTestnet;
33
+ declare function isMainnetChain(chain: SmartWalletChain): chain is SmartWalletMainnet;
34
+ declare const viemNetworks: Record<SmartWalletChain, Chain>;
35
+
36
+ export { SMART_WALLET_CHAINS, SMART_WALLET_MAINNETS, SMART_WALLET_TESTNETS, SmartWalletChain, SmartWalletMainnet, SmartWalletTestnet, isMainnetChain, isTestnetChain, viemNetworks };
@@ -0,0 +1 @@
1
+ import{a,b,c,d,e,f,g,h,i}from"../chunk-YBHSEZMB.js";export{f as SMART_WALLET_CHAINS,d as SMART_WALLET_MAINNETS,b as SMART_WALLET_TESTNETS,e as SmartWalletChain,c as SmartWalletMainnet,a as SmartWalletTestnet,h as isMainnetChain,g as isTestnetChain,i as viemNetworks};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7FXFOOQUcjs = require('../chunk-7FXFOOQU.cjs');exports.ALCHEMY_RPC_SUBDOMAIN = _chunk7FXFOOQUcjs.a; exports.getAlchemyRPC = _chunk7FXFOOQUcjs.b; exports.getPimlicoBundlerRPC = _chunk7FXFOOQUcjs.c;
@@ -0,0 +1,9 @@
1
+ import { SmartWalletChain } from './chains.cjs';
2
+ import 'viem/chains';
3
+ import '@crossmint/common-sdk-base';
4
+
5
+ declare const ALCHEMY_RPC_SUBDOMAIN: Record<SmartWalletChain, string>;
6
+ declare function getAlchemyRPC(chain: SmartWalletChain): string;
7
+ declare function getPimlicoBundlerRPC(chain: SmartWalletChain): string;
8
+
9
+ export { ALCHEMY_RPC_SUBDOMAIN, getAlchemyRPC, getPimlicoBundlerRPC };
@@ -0,0 +1,9 @@
1
+ import { SmartWalletChain } from './chains.js';
2
+ import 'viem/chains';
3
+ import '@crossmint/common-sdk-base';
4
+
5
+ declare const ALCHEMY_RPC_SUBDOMAIN: Record<SmartWalletChain, string>;
6
+ declare function getAlchemyRPC(chain: SmartWalletChain): string;
7
+ declare function getPimlicoBundlerRPC(chain: SmartWalletChain): string;
8
+
9
+ export { ALCHEMY_RPC_SUBDOMAIN, getAlchemyRPC, getPimlicoBundlerRPC };
@@ -0,0 +1 @@
1
+ import{a,b,c}from"../chunk-TZG6MROQ.js";export{a as ALCHEMY_RPC_SUBDOMAIN,b as getAlchemyRPC,c as getPimlicoBundlerRPC};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKYPTGHC6cjs = require('../chunk-KYPTGHC6.cjs');exports.transferParams = _chunkKYPTGHC6cjs.a;
@@ -0,0 +1,23 @@
1
+ import { Account, Address, Abi } from 'viem';
2
+ import { TransferType } from '../types/token.cjs';
3
+ import './chains.cjs';
4
+ import 'viem/chains';
5
+ import '@crossmint/common-sdk-base';
6
+
7
+ type TransferInputParams = {
8
+ from: Account;
9
+ contract: Address;
10
+ to: Address;
11
+ config: TransferType;
12
+ };
13
+ type TransferSimulationParams = {
14
+ account: Account;
15
+ address: Address;
16
+ abi: Abi;
17
+ functionName: string;
18
+ args: any[];
19
+ tokenId?: string;
20
+ };
21
+ declare function transferParams({ contract, config, from, to }: TransferInputParams): TransferSimulationParams;
22
+
23
+ export { transferParams };
@@ -0,0 +1,23 @@
1
+ import { Account, Address, Abi } from 'viem';
2
+ import { TransferType } from '../types/token.js';
3
+ import './chains.js';
4
+ import 'viem/chains';
5
+ import '@crossmint/common-sdk-base';
6
+
7
+ type TransferInputParams = {
8
+ from: Account;
9
+ contract: Address;
10
+ to: Address;
11
+ config: TransferType;
12
+ };
13
+ type TransferSimulationParams = {
14
+ account: Account;
15
+ address: Address;
16
+ abi: Abi;
17
+ functionName: string;
18
+ args: any[];
19
+ tokenId?: string;
20
+ };
21
+ declare function transferParams({ contract, config, from, to }: TransferInputParams): TransferSimulationParams;
22
+
23
+ export { transferParams };
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-3F6P4HUZ.js";export{a as transferParams};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSWWOVT47cjs = require('../../chunk-SWWOVT47.cjs');require('../../chunk-7AVDZZGD.cjs');require('../../chunk-KYPTGHC6.cjs');require('../../chunk-M4K3IZTT.cjs');exports.EVMSmartWallet = _chunkSWWOVT47cjs.a;
@@ -0,0 +1,102 @@
1
+ import { PublicClient, HttpTransport, Address, Abi, ContractFunctionName, ContractFunctionArgs, WriteContractParameters, Hex } from 'viem';
2
+ import { CrossmintWalletService } from '../../api/CrossmintWalletService.cjs';
3
+ import { g as SmartWalletClient } from '../../service-Ir-Qho-9.cjs';
4
+ import { TransferType } from '../../types/token.cjs';
5
+ import { SmartWalletChain } from '../chains.cjs';
6
+ import { SendTransactionService, SendTransactionOptions } from './SendTransactionService.cjs';
7
+ import '@crossmint/client-sdk-base';
8
+ import 'permissionless';
9
+ import 'permissionless/types/entrypoint';
10
+ import '../../types/params.cjs';
11
+ import 'viem/chains';
12
+ import '@crossmint/common-sdk-base';
13
+ import 'zod';
14
+ import '@zerodev/sdk';
15
+ import 'permissionless/accounts';
16
+ import '../../types/schema.cjs';
17
+ import '@zerodev/passkey-validator';
18
+ import '../../utils/constants.cjs';
19
+ import 'permissionless/_types/types';
20
+
21
+ /**
22
+ * Smart wallet interface for EVM chains enhanced with Crossmint capabilities.
23
+ * Core functionality is exposed via [viem](https://viem.sh/) clients within the `client` property of the class.
24
+ */
25
+ declare class EVMSmartWallet {
26
+ private readonly crossmintService;
27
+ private readonly sendTransactionService;
28
+ readonly chain: SmartWalletChain;
29
+ /**
30
+ * [viem](https://viem.sh/) clients that provide an interface for core wallet functionality.
31
+ */
32
+ readonly client: {
33
+ /**
34
+ * An interface to interact with the smart wallet, execute transactions, sign messages, etc.
35
+ */
36
+ wallet: SmartWalletClient;
37
+ /**
38
+ * 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.
39
+ */
40
+ public: PublicClient;
41
+ };
42
+ constructor(client: {
43
+ public: PublicClient<HttpTransport>;
44
+ wallet: SmartWalletClient;
45
+ }, chain: SmartWalletChain, crossmintService: CrossmintWalletService, sendTransactionService?: SendTransactionService);
46
+ /**
47
+ * The address of the smart wallet.
48
+ */
49
+ get address(): `0x${string}`;
50
+ /**
51
+ * Transfers tokens from the smart wallet to a specified address.
52
+ * @param toAddress The recipient's address.
53
+ * @param config The transfer configuration, including token details and amount.
54
+ * @returns The transaction hash.
55
+ * @throws {SmartWalletError} If there's a chain mismatch between this wallet and the input configuration.
56
+ * @throws {SendTransactionError} If the transaction fails to send. Contains the error thrown by the viem client.
57
+ * @throws {SendTransactionExecutionRevertedError} A subclass of SendTransactionError if the transaction fails due to a contract execution error.
58
+ */
59
+ transferToken(toAddress: Address, config: TransferType): Promise<string>;
60
+ /**
61
+ * @returns A list of NFTs owned by the wallet.
62
+ */
63
+ nfts(): Promise<any>;
64
+ /**
65
+ * Sends a contract call transaction and returns the hash of a confirmed transaction.
66
+ * @param address the address of the contract to be called
67
+ * @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
68
+ * @param functionName the name of the smart contract function to be called
69
+ * @param args the arguments to be passed to the function
70
+ * @returns The transaction hash.
71
+ * @throws `SendTransactionError` if the transaction fails to send. Contains the error thrown by the viem client.
72
+ * @throws `SendTransactionExecutionRevertedError`, a subclass of `SendTransactionError` if the transaction fails due to a contract execution error.
73
+ *
74
+ * **Passing a typed ABI:**
75
+ * @example
76
+ * const abi = [{
77
+ * "inputs": [
78
+ * {
79
+ * "internalType": "address",
80
+ * "name": "recipient",
81
+ * "type": "address"
82
+ * },
83
+ * ],
84
+ * "name": "mintNFT",
85
+ * "outputs": [],
86
+ * "stateMutability": "nonpayable",
87
+ * "type": "function"
88
+ * }] as const;
89
+ *
90
+ * await wallet.executeContract({
91
+ * address: contractAddress,
92
+ * abi,
93
+ * functionName: "mintNFT",
94
+ * args: [recipientAddress],
95
+ * });
96
+ */
97
+ 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"> & {
98
+ config?: Partial<SendTransactionOptions>;
99
+ }): Promise<Hex>;
100
+ }
101
+
102
+ export { EVMSmartWallet };
@@ -0,0 +1,102 @@
1
+ import { PublicClient, HttpTransport, Address, Abi, ContractFunctionName, ContractFunctionArgs, WriteContractParameters, Hex } from 'viem';
2
+ import { CrossmintWalletService } from '../../api/CrossmintWalletService.js';
3
+ import { g as SmartWalletClient } from '../../service-DqYCir8s.js';
4
+ import { TransferType } from '../../types/token.js';
5
+ import { SmartWalletChain } from '../chains.js';
6
+ import { SendTransactionService, SendTransactionOptions } from './SendTransactionService.js';
7
+ import '@crossmint/client-sdk-base';
8
+ import 'permissionless';
9
+ import 'permissionless/types/entrypoint';
10
+ import '../../types/params.js';
11
+ import 'viem/chains';
12
+ import '@crossmint/common-sdk-base';
13
+ import 'zod';
14
+ import '@zerodev/sdk';
15
+ import 'permissionless/accounts';
16
+ import '../../types/schema.js';
17
+ import '@zerodev/passkey-validator';
18
+ import '../../utils/constants.js';
19
+ import 'permissionless/_types/types';
20
+
21
+ /**
22
+ * Smart wallet interface for EVM chains enhanced with Crossmint capabilities.
23
+ * Core functionality is exposed via [viem](https://viem.sh/) clients within the `client` property of the class.
24
+ */
25
+ declare class EVMSmartWallet {
26
+ private readonly crossmintService;
27
+ private readonly sendTransactionService;
28
+ readonly chain: SmartWalletChain;
29
+ /**
30
+ * [viem](https://viem.sh/) clients that provide an interface for core wallet functionality.
31
+ */
32
+ readonly client: {
33
+ /**
34
+ * An interface to interact with the smart wallet, execute transactions, sign messages, etc.
35
+ */
36
+ wallet: SmartWalletClient;
37
+ /**
38
+ * 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.
39
+ */
40
+ public: PublicClient;
41
+ };
42
+ constructor(client: {
43
+ public: PublicClient<HttpTransport>;
44
+ wallet: SmartWalletClient;
45
+ }, chain: SmartWalletChain, crossmintService: CrossmintWalletService, sendTransactionService?: SendTransactionService);
46
+ /**
47
+ * The address of the smart wallet.
48
+ */
49
+ get address(): `0x${string}`;
50
+ /**
51
+ * Transfers tokens from the smart wallet to a specified address.
52
+ * @param toAddress The recipient's address.
53
+ * @param config The transfer configuration, including token details and amount.
54
+ * @returns The transaction hash.
55
+ * @throws {SmartWalletError} If there's a chain mismatch between this wallet and the input configuration.
56
+ * @throws {SendTransactionError} If the transaction fails to send. Contains the error thrown by the viem client.
57
+ * @throws {SendTransactionExecutionRevertedError} A subclass of SendTransactionError if the transaction fails due to a contract execution error.
58
+ */
59
+ transferToken(toAddress: Address, config: TransferType): Promise<string>;
60
+ /**
61
+ * @returns A list of NFTs owned by the wallet.
62
+ */
63
+ nfts(): Promise<any>;
64
+ /**
65
+ * Sends a contract call transaction and returns the hash of a confirmed transaction.
66
+ * @param address the address of the contract to be called
67
+ * @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
68
+ * @param functionName the name of the smart contract function to be called
69
+ * @param args the arguments to be passed to the function
70
+ * @returns The transaction hash.
71
+ * @throws `SendTransactionError` if the transaction fails to send. Contains the error thrown by the viem client.
72
+ * @throws `SendTransactionExecutionRevertedError`, a subclass of `SendTransactionError` if the transaction fails due to a contract execution error.
73
+ *
74
+ * **Passing a typed ABI:**
75
+ * @example
76
+ * const abi = [{
77
+ * "inputs": [
78
+ * {
79
+ * "internalType": "address",
80
+ * "name": "recipient",
81
+ * "type": "address"
82
+ * },
83
+ * ],
84
+ * "name": "mintNFT",
85
+ * "outputs": [],
86
+ * "stateMutability": "nonpayable",
87
+ * "type": "function"
88
+ * }] as const;
89
+ *
90
+ * await wallet.executeContract({
91
+ * address: contractAddress,
92
+ * abi,
93
+ * functionName: "mintNFT",
94
+ * args: [recipientAddress],
95
+ * });
96
+ */
97
+ 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"> & {
98
+ config?: Partial<SendTransactionOptions>;
99
+ }): Promise<Hex>;
100
+ }
101
+
102
+ export { EVMSmartWallet };
@@ -0,0 +1 @@
1
+ import{a}from"../../chunk-ETVJGLNY.js";import"../../chunk-S2XBSAGM.js";import"../../chunk-3F6P4HUZ.js";import"../../chunk-UPURFW46.js";export{a as EVMSmartWallet};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7AVDZZGDcjs = require('../../chunk-7AVDZZGD.cjs');exports.EVMSendTransactionError = _chunk7AVDZZGDcjs.a; exports.EVMSendTransactionExecutionRevertedError = _chunk7AVDZZGDcjs.b; exports.SendTransactionService = _chunk7AVDZZGDcjs.c;
@@ -0,0 +1,84 @@
1
+ import * as viem from 'viem';
2
+ import { Address, Abi, BaseError, ContractFunctionRevertedError, PublicClient, Transport, Chain, Hex } from 'viem';
3
+ import { SmartAccountClient } from 'permissionless';
4
+ import { EntryPoint } from 'permissionless/_types/types';
5
+ import { SmartAccount } from 'permissionless/accounts';
6
+ import { CrossmintSDKError } from '@crossmint/client-sdk-base';
7
+
8
+ type TransactionServiceTransactionRequest = {
9
+ address: Address;
10
+ abi: Abi;
11
+ functionName: string;
12
+ args: any;
13
+ value?: bigint;
14
+ };
15
+ type SendTransactionFailureStage = "simulation" | "send" | "confirmation" | "execution";
16
+ /**
17
+ * Error thrown when a transaction fails to send.
18
+ * @param viemError The error thrown by the viem client. See https://viem.sh/docs/glossary/errors.html
19
+ */
20
+ declare class EVMSendTransactionError extends CrossmintSDKError {
21
+ readonly viemError: BaseError;
22
+ readonly stage: SendTransactionFailureStage;
23
+ constructor(message: string, viemError: BaseError, stage: SendTransactionFailureStage, code?: string);
24
+ }
25
+ /**
26
+ * Error thrown when a transaction fails due to a contract execution error.
27
+ * @param viemError The error thrown by the viem client. See https://viem.sh/docs/glossary/errors.html
28
+ * @param data The name and arguments of the revert error from the provided ABI
29
+ * @param reason The revert error if it is a string and not an ABI error
30
+ * @example
31
+ * try {
32
+ * await wallet.executeContract({
33
+ * address: contractAddress,
34
+ * abi,
35
+ * functionName: "mintNFT",
36
+ * args: [recipientAddress],
37
+ * });
38
+ * } catch (e) {
39
+ * if (e instanceof SendTransactionExecutionRevertedError) {
40
+ * alert(`Transaction reverted: ${e.message}`);
41
+ * }
42
+ * throw e;
43
+ * }
44
+ */
45
+ declare class EVMSendTransactionExecutionRevertedError extends EVMSendTransactionError {
46
+ readonly viemError: BaseError;
47
+ readonly txId: string | undefined;
48
+ readonly stage: SendTransactionFailureStage;
49
+ readonly data: {
50
+ abiItem: viem.AbiItem;
51
+ args: readonly unknown[] | undefined;
52
+ errorName: string;
53
+ } | undefined;
54
+ readonly reason: string | undefined;
55
+ constructor(message: string, viemError: BaseError, revertError: ContractFunctionRevertedError, txId: string | undefined, stage: SendTransactionFailureStage, data?: {
56
+ abiItem: viem.AbiItem;
57
+ args: readonly unknown[] | undefined;
58
+ errorName: string;
59
+ } | undefined, reason?: string | undefined);
60
+ }
61
+ interface SendTransactionOptions {
62
+ /**
63
+ * The number of confirmations to wait for before yielding the transaction hash.
64
+ */
65
+ confirmations: number;
66
+ /**
67
+ * The timeout in milliseconds to wait for a transaction to confirm before throwing an error.
68
+ */
69
+ transactionConfirmationTimeout: number;
70
+ }
71
+ declare class SendTransactionService {
72
+ private readonly client;
73
+ private readonly defaultSendTransactionOptions;
74
+ constructor(client: {
75
+ public: PublicClient;
76
+ wallet: SmartAccountClient<EntryPoint, Transport, Chain, SmartAccount<EntryPoint>>;
77
+ }, defaultSendTransactionOptions?: SendTransactionOptions);
78
+ sendTransaction(request: TransactionServiceTransactionRequest, config?: Partial<SendTransactionOptions>): Promise<Hex>;
79
+ private getConfig;
80
+ private handleReceipt;
81
+ private simulateCall;
82
+ }
83
+
84
+ export { EVMSendTransactionError, EVMSendTransactionExecutionRevertedError, type SendTransactionFailureStage, type SendTransactionOptions, SendTransactionService, type TransactionServiceTransactionRequest };