@crossmint/client-sdk-smart-wallet 0.1.21 → 0.1.23
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 +34 -1
- package/dist/SmartWalletSDK.cjs.map +1 -0
- package/dist/SmartWalletSDK.js +34 -1
- package/dist/SmartWalletSDK.js.map +1 -0
- package/dist/api/CrossmintWalletService.cjs +13 -1
- package/dist/api/CrossmintWalletService.cjs.map +1 -0
- package/dist/api/CrossmintWalletService.js +13 -1
- package/dist/api/CrossmintWalletService.js.map +1 -0
- package/dist/blockchain/chains.cjs +23 -1
- package/dist/blockchain/chains.cjs.map +1 -0
- package/dist/blockchain/chains.js +23 -1
- package/dist/blockchain/chains.js.map +1 -0
- package/dist/blockchain/rpc.cjs +11 -1
- package/dist/blockchain/rpc.cjs.map +1 -0
- package/dist/blockchain/rpc.js +11 -1
- package/dist/blockchain/rpc.js.map +1 -0
- package/dist/blockchain/transfer.cjs +7 -1
- package/dist/blockchain/transfer.cjs.map +1 -0
- package/dist/blockchain/transfer.js +7 -1
- package/dist/blockchain/transfer.js.map +1 -0
- package/dist/blockchain/wallets/EVMSmartWallet.cjs +10 -1
- package/dist/blockchain/wallets/EVMSmartWallet.cjs.map +1 -0
- package/dist/blockchain/wallets/EVMSmartWallet.js +10 -1
- package/dist/blockchain/wallets/EVMSmartWallet.js.map +1 -0
- package/dist/blockchain/wallets/SendTransactionService.cjs +11 -1
- package/dist/blockchain/wallets/SendTransactionService.cjs.map +1 -0
- package/dist/blockchain/wallets/SendTransactionService.js +11 -1
- package/dist/blockchain/wallets/SendTransactionService.js.map +1 -0
- package/dist/blockchain/wallets/account/cache.cjs +9 -1
- package/dist/blockchain/wallets/account/cache.cjs.map +1 -0
- package/dist/blockchain/wallets/account/cache.js +9 -1
- package/dist/blockchain/wallets/account/cache.js.map +1 -0
- package/dist/blockchain/wallets/account/config.cjs +9 -1
- package/dist/blockchain/wallets/account/config.cjs.map +1 -0
- package/dist/blockchain/wallets/account/config.js +9 -1
- package/dist/blockchain/wallets/account/config.js.map +1 -0
- package/dist/blockchain/wallets/account/creator.cjs +10 -1
- package/dist/blockchain/wallets/account/creator.cjs.map +1 -0
- package/dist/blockchain/wallets/account/creator.js +10 -1
- package/dist/blockchain/wallets/account/creator.js.map +1 -0
- package/dist/blockchain/wallets/account/eoa.cjs +11 -1
- package/dist/blockchain/wallets/account/eoa.cjs.map +1 -0
- package/dist/blockchain/wallets/account/eoa.js +11 -1
- package/dist/blockchain/wallets/account/eoa.js.map +1 -0
- package/dist/blockchain/wallets/account/passkey.cjs +9 -1
- package/dist/blockchain/wallets/account/passkey.cjs.map +1 -0
- package/dist/blockchain/wallets/account/passkey.js +9 -1
- package/dist/blockchain/wallets/account/passkey.js.map +1 -0
- package/dist/blockchain/wallets/account/signer.cjs +9 -1
- package/dist/blockchain/wallets/account/signer.cjs.map +1 -0
- package/dist/blockchain/wallets/account/signer.js +9 -1
- package/dist/blockchain/wallets/account/signer.js.map +1 -0
- package/dist/blockchain/wallets/account/strategy.cjs +1 -1
- package/dist/blockchain/wallets/account/strategy.cjs.map +1 -0
- package/dist/blockchain/wallets/account/strategy.js +1 -0
- package/dist/blockchain/wallets/account/strategy.js.map +1 -0
- package/dist/blockchain/wallets/clientDecorator.cjs +12 -1
- package/dist/blockchain/wallets/clientDecorator.cjs.map +1 -0
- package/dist/blockchain/wallets/clientDecorator.js +12 -1
- package/dist/blockchain/wallets/clientDecorator.js.map +1 -0
- package/dist/blockchain/wallets/index.cjs +10 -1
- package/dist/blockchain/wallets/index.cjs.map +1 -0
- package/dist/blockchain/wallets/index.js +10 -1
- package/dist/blockchain/wallets/index.js.map +1 -0
- package/dist/blockchain/wallets/paymaster.cjs +10 -1
- package/dist/blockchain/wallets/paymaster.cjs.map +1 -0
- package/dist/blockchain/wallets/paymaster.js +10 -1
- package/dist/blockchain/wallets/paymaster.js.map +1 -0
- package/dist/blockchain/wallets/service.cjs +16 -1
- package/dist/blockchain/wallets/service.cjs.map +1 -0
- package/dist/blockchain/wallets/service.js +16 -1
- package/dist/blockchain/wallets/service.js.map +1 -0
- package/dist/chunk-2HB65Y7D.js +79 -0
- package/dist/chunk-2HB65Y7D.js.map +1 -0
- package/dist/chunk-3EQHAQXO.js +112 -0
- package/dist/chunk-3EQHAQXO.js.map +1 -0
- package/dist/chunk-3R6PW6HY.js +30 -0
- package/dist/chunk-3R6PW6HY.js.map +1 -0
- package/dist/{chunk-XJGFG3RT.cjs → chunk-5MG5CIEX.cjs} +13 -1
- package/dist/chunk-5MG5CIEX.cjs.map +1 -0
- package/dist/chunk-5URMCCO6.js +9 -0
- package/dist/chunk-5URMCCO6.js.map +1 -0
- package/dist/chunk-5VHMVO22.js +39 -0
- package/dist/chunk-5VHMVO22.js.map +1 -0
- package/dist/chunk-5W4NYW72.js +44 -0
- package/dist/chunk-5W4NYW72.js.map +1 -0
- package/dist/chunk-5WVQ7J3E.cjs +369 -0
- package/dist/chunk-5WVQ7J3E.cjs.map +1 -0
- package/dist/chunk-6NJVFL2X.js +60 -0
- package/dist/chunk-6NJVFL2X.js.map +1 -0
- package/dist/chunk-77GT6B5L.cjs +79 -0
- package/dist/chunk-77GT6B5L.cjs.map +1 -0
- package/dist/chunk-7AT3QDQV.js +36 -0
- package/dist/chunk-7AT3QDQV.js.map +1 -0
- package/dist/chunk-7B2CZEJG.cjs +66 -0
- package/dist/chunk-7B2CZEJG.cjs.map +1 -0
- package/dist/chunk-7G2SBZTE.js +93 -0
- package/dist/chunk-7G2SBZTE.js.map +1 -0
- package/dist/chunk-7KTQNIAZ.cjs +112 -0
- package/dist/chunk-7KTQNIAZ.cjs.map +1 -0
- package/dist/chunk-ASIPMVRQ.js +90 -0
- package/dist/chunk-ASIPMVRQ.js.map +1 -0
- package/dist/chunk-BARW756O.js +27 -0
- package/dist/chunk-BARW756O.js.map +1 -0
- package/dist/chunk-BSFIJZ5X.js +41 -0
- package/dist/chunk-BSFIJZ5X.js.map +1 -0
- package/dist/chunk-BXSAJOIV.cjs +90 -0
- package/dist/chunk-BXSAJOIV.cjs.map +1 -0
- package/dist/chunk-C5ZRYSCP.cjs +14 -0
- package/dist/chunk-C5ZRYSCP.cjs.map +1 -0
- package/dist/chunk-DTEA33DF.cjs +59 -0
- package/dist/chunk-DTEA33DF.cjs.map +1 -0
- package/dist/chunk-DYO4HODM.cjs +36 -0
- package/dist/chunk-DYO4HODM.cjs.map +1 -0
- package/dist/chunk-EPEGJY6N.cjs +9 -0
- package/dist/chunk-EPEGJY6N.cjs.map +1 -0
- package/dist/chunk-EQSMHR77.js +30 -0
- package/dist/chunk-EQSMHR77.js.map +1 -0
- package/dist/chunk-EUQLY4SC.cjs +82 -0
- package/dist/chunk-EUQLY4SC.cjs.map +1 -0
- package/dist/chunk-FSIMJYXR.js +36 -0
- package/dist/chunk-FSIMJYXR.js.map +1 -0
- package/dist/chunk-FXGOVLZW.cjs +9 -0
- package/dist/chunk-FXGOVLZW.cjs.map +1 -0
- package/dist/chunk-GLHQIT4Q.cjs +36 -0
- package/dist/chunk-GLHQIT4Q.cjs.map +1 -0
- package/dist/chunk-IDNF4BNP.cjs +44 -0
- package/dist/chunk-IDNF4BNP.cjs.map +1 -0
- package/dist/chunk-JOB7STIS.js +9 -0
- package/dist/chunk-JOB7STIS.js.map +1 -0
- package/dist/chunk-KEY2LM72.cjs +93 -0
- package/dist/chunk-KEY2LM72.cjs.map +1 -0
- package/dist/chunk-KHROQTVY.js +1 -0
- package/dist/chunk-KHROQTVY.js.map +1 -0
- package/dist/chunk-MAID7XYG.js +14 -0
- package/dist/chunk-MAID7XYG.js.map +1 -0
- package/dist/chunk-MJZ2DXMN.cjs +123 -0
- package/dist/chunk-MJZ2DXMN.cjs.map +1 -0
- package/dist/chunk-N6DG5EZG.cjs +156 -0
- package/dist/chunk-N6DG5EZG.cjs.map +1 -0
- package/dist/chunk-NXDZHR5C.js +99 -0
- package/dist/chunk-NXDZHR5C.js.map +1 -0
- package/dist/chunk-O6IFYHDP.cjs +36 -0
- package/dist/chunk-O6IFYHDP.cjs.map +1 -0
- package/dist/chunk-OCG67QSU.cjs +41 -0
- package/dist/chunk-OCG67QSU.cjs.map +1 -0
- package/dist/chunk-OGA3YDWS.cjs +112 -0
- package/dist/chunk-OGA3YDWS.cjs.map +1 -0
- package/dist/chunk-ON4DOYVD.js +369 -0
- package/dist/chunk-ON4DOYVD.js.map +1 -0
- package/dist/chunk-OYKL3RNL.js +66 -0
- package/dist/chunk-OYKL3RNL.js.map +1 -0
- package/dist/chunk-PVFA6PBX.cjs +60 -0
- package/dist/chunk-PVFA6PBX.cjs.map +1 -0
- package/dist/chunk-QJ3BSVGV.js +36 -0
- package/dist/chunk-QJ3BSVGV.js.map +1 -0
- package/dist/chunk-RB4JSPZH.cjs +99 -0
- package/dist/chunk-RB4JSPZH.cjs.map +1 -0
- package/dist/chunk-SMDX2MXU.js +13 -0
- package/dist/chunk-SMDX2MXU.js.map +1 -0
- package/dist/chunk-TDJDKTRS.js +156 -0
- package/dist/chunk-TDJDKTRS.js.map +1 -0
- package/dist/chunk-TK3ZLI22.cjs +39 -0
- package/dist/chunk-TK3ZLI22.cjs.map +1 -0
- package/dist/chunk-TUVECZA7.cjs +22 -0
- package/dist/chunk-TUVECZA7.cjs.map +1 -0
- package/dist/chunk-U4OBHCIP.js +59 -0
- package/dist/chunk-U4OBHCIP.js.map +1 -0
- package/dist/chunk-UDDYHPSW.js +22 -0
- package/dist/chunk-UDDYHPSW.js.map +1 -0
- package/dist/chunk-UNP5V2AB.js +82 -0
- package/dist/chunk-UNP5V2AB.js.map +1 -0
- package/dist/chunk-UQKE6R5W.cjs +27 -0
- package/dist/chunk-UQKE6R5W.cjs.map +1 -0
- package/dist/chunk-UZGHOTKZ.js +112 -0
- package/dist/chunk-UZGHOTKZ.js.map +1 -0
- package/dist/chunk-XZTGDSSL.js +123 -0
- package/dist/chunk-XZTGDSSL.js.map +1 -0
- package/dist/chunk-YWCXHOSD.cjs +30 -0
- package/dist/chunk-YWCXHOSD.cjs.map +1 -0
- package/dist/chunk-ZN42AA2G.cjs +1 -0
- package/dist/chunk-ZN42AA2G.cjs.map +1 -0
- package/dist/chunk-ZOXKITU4.cjs +30 -0
- package/dist/chunk-ZOXKITU4.cjs.map +1 -0
- package/dist/error/index.cjs +25 -1
- package/dist/error/index.cjs.map +1 -0
- package/dist/error/index.js +25 -1
- package/dist/error/index.js.map +1 -0
- package/dist/error/processor.cjs +9 -1
- package/dist/error/processor.cjs.map +1 -0
- package/dist/error/processor.js +9 -1
- package/dist/error/processor.js.map +1 -0
- package/dist/index.cjs +86 -1
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +86 -1
- package/dist/index.js.map +1 -0
- package/dist/services/index.cjs +11 -1
- package/dist/services/index.cjs.map +1 -0
- package/dist/services/index.js +11 -1
- package/dist/services/index.js.map +1 -0
- package/dist/services/logger.cjs +10 -1
- package/dist/services/logger.cjs.map +1 -0
- package/dist/services/logger.js +10 -1
- package/dist/services/logger.js.map +1 -0
- package/dist/types/internal.cjs +18 -1
- package/dist/types/internal.cjs.map +1 -0
- package/dist/types/internal.js +18 -1
- package/dist/types/internal.js.map +1 -0
- package/dist/types/params.cjs +1 -1
- package/dist/types/params.cjs.map +1 -0
- package/dist/types/params.js +1 -0
- package/dist/types/params.js.map +1 -0
- package/dist/types/schema.cjs +16 -1
- package/dist/types/schema.cjs.map +1 -0
- package/dist/types/schema.js +16 -1
- package/dist/types/schema.js.map +1 -0
- package/dist/types/service.cjs +1 -1
- package/dist/types/service.cjs.map +1 -0
- package/dist/types/service.js +1 -0
- package/dist/types/service.js.map +1 -0
- package/dist/types/token.cjs +1 -1
- package/dist/types/token.cjs.map +1 -0
- package/dist/types/token.js +1 -0
- package/dist/types/token.js.map +1 -0
- package/dist/utils/api.cjs +9 -1
- package/dist/utils/api.cjs.map +1 -0
- package/dist/utils/api.js +9 -1
- package/dist/utils/api.js.map +1 -0
- package/dist/utils/blockchain.cjs +7 -1
- package/dist/utils/blockchain.cjs.map +1 -0
- package/dist/utils/blockchain.js +7 -1
- package/dist/utils/blockchain.js.map +1 -0
- package/dist/utils/constants.cjs +19 -1
- package/dist/utils/constants.cjs.map +1 -0
- package/dist/utils/constants.js +19 -1
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/environment.cjs +7 -1
- package/dist/utils/environment.cjs.map +1 -0
- package/dist/utils/environment.js +7 -1
- package/dist/utils/environment.js.map +1 -0
- package/dist/utils/helpers.cjs +9 -1
- package/dist/utils/helpers.cjs.map +1 -0
- package/dist/utils/helpers.js +9 -1
- package/dist/utils/helpers.js.map +1 -0
- package/dist/utils/signer.cjs +10 -1
- package/dist/utils/signer.cjs.map +1 -0
- package/dist/utils/signer.js +10 -1
- package/dist/utils/signer.js.map +1 -0
- package/dist/utils/test.cjs +27 -1
- package/dist/utils/test.cjs.map +1 -0
- package/dist/utils/test.js +27 -1
- package/dist/utils/test.js.map +1 -0
- package/package.json +4 -4
- package/dist/chunk-27US7ZBX.js +0 -1
- package/dist/chunk-2GS5TXEY.cjs +0 -1
- package/dist/chunk-2R6HK64N.cjs +0 -1
- package/dist/chunk-3F6P4HUZ.js +0 -1
- package/dist/chunk-4SPA557P.js +0 -0
- package/dist/chunk-5M3MSPHK.cjs +0 -1
- package/dist/chunk-6DE5YEO5.cjs +0 -1
- package/dist/chunk-7AVDZZGD.cjs +0 -1
- package/dist/chunk-7FXFOOQU.cjs +0 -1
- package/dist/chunk-7JAT6GQU.js +0 -1
- package/dist/chunk-ATQ4WGCW.js +0 -1
- package/dist/chunk-B3LJJZXD.cjs +0 -2
- package/dist/chunk-BJZQA5VC.js +0 -1
- package/dist/chunk-BXXREMNR.cjs +0 -1
- package/dist/chunk-C3VZY7VJ.js +0 -1
- package/dist/chunk-CPYNP4XI.js +0 -1
- package/dist/chunk-CUTQYF3F.js +0 -1
- package/dist/chunk-D4NDUT36.js +0 -1
- package/dist/chunk-DIDKPOO2.cjs +0 -1
- package/dist/chunk-ETVJGLNY.js +0 -1
- package/dist/chunk-FHNNZVNU.js +0 -1
- package/dist/chunk-FIJ3CBJ4.js +0 -3
- package/dist/chunk-G57LROTD.js +0 -1
- package/dist/chunk-GB35YMN4.cjs +0 -1
- package/dist/chunk-H4CMXNVK.js +0 -1
- package/dist/chunk-IQTGPM2U.cjs +0 -1
- package/dist/chunk-KYPTGHC6.cjs +0 -1
- package/dist/chunk-LMVY4C4Y.js +0 -1
- package/dist/chunk-M4K3IZTT.cjs +0 -1
- package/dist/chunk-NLGILHJS.js +0 -1
- package/dist/chunk-O2ACORII.cjs +0 -1
- package/dist/chunk-OCJYX5QF.cjs +0 -1
- package/dist/chunk-ODAUWGUU.cjs +0 -1
- package/dist/chunk-PBUJXVQT.js +0 -1
- package/dist/chunk-PLRQBDYS.cjs +0 -1
- package/dist/chunk-PPTSNCSQ.cjs +0 -1
- package/dist/chunk-PZ6Q22YJ.js +0 -1
- package/dist/chunk-Q44P7MO7.cjs +0 -1
- package/dist/chunk-QVB3HE6Q.js +0 -2
- package/dist/chunk-S2XBSAGM.js +0 -1
- package/dist/chunk-SCXFZMLR.cjs +0 -1
- package/dist/chunk-STH2LE35.cjs +0 -1
- package/dist/chunk-SWWOVT47.cjs +0 -1
- package/dist/chunk-TZG6MROQ.js +0 -1
- package/dist/chunk-UG47CBKR.js +0 -1
- package/dist/chunk-UPURFW46.js +0 -1
- package/dist/chunk-WDM7PN4O.js +0 -1
- package/dist/chunk-WJ6XJMRD.cjs +0 -1
- package/dist/chunk-WTPE2I2Q.cjs +0 -1
- package/dist/chunk-XHSA4YTO.cjs +0 -3
- package/dist/chunk-XP6ESWVJ.js +0 -1
- package/dist/chunk-XQ2K2K23.cjs +0 -1
- package/dist/chunk-YBHSEZMB.js +0 -1
- package/dist/chunk-YZQJV2KA.cjs +0 -1
- package/dist/chunk-Z22H3MJS.js +0 -1
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SendTransactionService
|
|
3
|
+
} from "./chunk-3EQHAQXO.js";
|
|
4
|
+
import {
|
|
5
|
+
transferParams
|
|
6
|
+
} from "./chunk-ON4DOYVD.js";
|
|
7
|
+
import {
|
|
8
|
+
SmartWalletError
|
|
9
|
+
} from "./chunk-ASIPMVRQ.js";
|
|
10
|
+
|
|
11
|
+
// src/blockchain/wallets/EVMSmartWallet.ts
|
|
12
|
+
var EVMSmartWallet = class {
|
|
13
|
+
constructor(client, chain, crossmintService, sendTransactionService = new SendTransactionService(client)) {
|
|
14
|
+
this.crossmintService = crossmintService;
|
|
15
|
+
this.sendTransactionService = sendTransactionService;
|
|
16
|
+
this.chain = chain;
|
|
17
|
+
this.client = client;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The address of the smart wallet.
|
|
21
|
+
*/
|
|
22
|
+
get address() {
|
|
23
|
+
return this.client.wallet.account.address;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Transfers tokens from the smart wallet to a specified address.
|
|
27
|
+
* @param toAddress The recipient's address.
|
|
28
|
+
* @param config The transfer configuration, including token details and amount.
|
|
29
|
+
* @returns The transaction hash.
|
|
30
|
+
* @throws {SmartWalletError} If there's a chain mismatch between this wallet and the input configuration.
|
|
31
|
+
* @throws {SendTransactionError} If the transaction fails to send. Contains the error thrown by the viem client.
|
|
32
|
+
* @throws {SendTransactionExecutionRevertedError} A subclass of SendTransactionError if the transaction fails due to a contract execution error.
|
|
33
|
+
*/
|
|
34
|
+
async transferToken(toAddress, config) {
|
|
35
|
+
if (this.chain !== config.token.chain) {
|
|
36
|
+
throw new SmartWalletError(
|
|
37
|
+
`Chain mismatch: Expected ${config.token.chain}, but got ${this.chain}. Ensure you are interacting with the correct blockchain.`
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
return this.executeContract(
|
|
41
|
+
transferParams({
|
|
42
|
+
contract: config.token.contractAddress,
|
|
43
|
+
to: toAddress,
|
|
44
|
+
from: this.client.wallet.account,
|
|
45
|
+
config
|
|
46
|
+
})
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @returns A list of NFTs owned by the wallet.
|
|
51
|
+
*/
|
|
52
|
+
async nfts() {
|
|
53
|
+
return this.crossmintService.fetchNFTs(this.address, this.chain);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Sends a contract call transaction and returns the hash of a confirmed transaction.
|
|
57
|
+
* @param address the address of the contract to be called
|
|
58
|
+
* @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
|
|
59
|
+
* @param functionName the name of the smart contract function to be called
|
|
60
|
+
* @param args the arguments to be passed to the function
|
|
61
|
+
* @returns The transaction hash.
|
|
62
|
+
* @throws `SendTransactionError` if the transaction fails to send. Contains the error thrown by the viem client.
|
|
63
|
+
* @throws `SendTransactionExecutionRevertedError`, a subclass of `SendTransactionError` if the transaction fails due to a contract execution error.
|
|
64
|
+
*
|
|
65
|
+
* **Passing a typed ABI:**
|
|
66
|
+
* @example
|
|
67
|
+
* const abi = [{
|
|
68
|
+
* "inputs": [
|
|
69
|
+
* {
|
|
70
|
+
* "internalType": "address",
|
|
71
|
+
* "name": "recipient",
|
|
72
|
+
* "type": "address"
|
|
73
|
+
* },
|
|
74
|
+
* ],
|
|
75
|
+
* "name": "mintNFT",
|
|
76
|
+
* "outputs": [],
|
|
77
|
+
* "stateMutability": "nonpayable",
|
|
78
|
+
* "type": "function"
|
|
79
|
+
* }] as const;
|
|
80
|
+
*
|
|
81
|
+
* await wallet.executeContract({
|
|
82
|
+
* address: contractAddress,
|
|
83
|
+
* abi,
|
|
84
|
+
* functionName: "mintNFT",
|
|
85
|
+
* args: [recipientAddress],
|
|
86
|
+
* });
|
|
87
|
+
*/
|
|
88
|
+
async executeContract({
|
|
89
|
+
address,
|
|
90
|
+
abi,
|
|
91
|
+
functionName,
|
|
92
|
+
args,
|
|
93
|
+
value,
|
|
94
|
+
config
|
|
95
|
+
}) {
|
|
96
|
+
return this.sendTransactionService.sendTransaction(
|
|
97
|
+
{
|
|
98
|
+
address,
|
|
99
|
+
abi,
|
|
100
|
+
functionName,
|
|
101
|
+
args,
|
|
102
|
+
value
|
|
103
|
+
},
|
|
104
|
+
config
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export {
|
|
110
|
+
EVMSmartWallet
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=chunk-UZGHOTKZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/blockchain/wallets/EVMSmartWallet.ts"],"sourcesContent":["import type {\n Abi,\n Address,\n ContractFunctionArgs,\n ContractFunctionName,\n Hex,\n HttpTransport,\n PublicClient,\n WriteContractParameters,\n} from \"viem\";\n\nimport type { CrossmintWalletService } from \"../../api/CrossmintWalletService\";\nimport { SmartWalletError } from \"../../error\";\nimport type { SmartWalletClient } from \"../../types/internal\";\nimport type { TransferType } from \"../../types/token\";\nimport type { SmartWalletChain } from \"../chains\";\nimport { transferParams } from \"../transfer\";\nimport { type SendTransactionOptions, SendTransactionService } from \"./SendTransactionService\";\n\n/**\n * Smart wallet interface for EVM chains enhanced with Crossmint capabilities.\n * Core functionality is exposed via [viem](https://viem.sh/) clients within the `client` property of the class.\n */\nexport class EVMSmartWallet {\n public readonly chain: SmartWalletChain;\n\n /**\n * [viem](https://viem.sh/) clients that provide an interface for core wallet functionality.\n */\n public readonly client: {\n /**\n * An interface to interact with the smart wallet, execute transactions, sign messages, etc.\n */\n wallet: SmartWalletClient;\n\n /**\n * 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.\n */\n public: PublicClient;\n };\n\n constructor(\n client: { public: PublicClient<HttpTransport>; wallet: SmartWalletClient },\n chain: SmartWalletChain,\n private readonly crossmintService: CrossmintWalletService,\n private readonly sendTransactionService = new SendTransactionService(client)\n ) {\n this.chain = chain;\n this.client = client;\n }\n\n /**\n * The address of the smart wallet.\n */\n public get address() {\n return this.client.wallet.account.address;\n }\n\n /**\n * Transfers tokens from the smart wallet to a specified address.\n * @param toAddress The recipient's address.\n * @param config The transfer configuration, including token details and amount.\n * @returns The transaction hash.\n * @throws {SmartWalletError} If there's a chain mismatch between this wallet and the input configuration.\n * @throws {SendTransactionError} If the transaction fails to send. Contains the error thrown by the viem client.\n * @throws {SendTransactionExecutionRevertedError} A subclass of SendTransactionError if the transaction fails due to a contract execution error.\n */\n public async transferToken(toAddress: Address, config: TransferType): Promise<string> {\n if (this.chain !== config.token.chain) {\n throw new SmartWalletError(\n `Chain mismatch: Expected ${config.token.chain}, but got ${this.chain}. Ensure you are interacting with the correct blockchain.`\n );\n }\n\n return this.executeContract(\n transferParams({\n contract: config.token.contractAddress,\n to: toAddress,\n from: this.client.wallet.account,\n config,\n })\n );\n }\n\n /**\n * @returns A list of NFTs owned by the wallet.\n */\n public async nfts() {\n return this.crossmintService.fetchNFTs(this.address, this.chain);\n }\n\n /**\n * Sends a contract call transaction and returns the hash of a confirmed transaction.\n * @param address the address of the contract to be called\n * @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\n * @param functionName the name of the smart contract function to be called\n * @param args the arguments to be passed to the function\n * @returns The transaction hash.\n * @throws `SendTransactionError` if the transaction fails to send. Contains the error thrown by the viem client.\n * @throws `SendTransactionExecutionRevertedError`, a subclass of `SendTransactionError` if the transaction fails due to a contract execution error.\n *\n * **Passing a typed ABI:**\n * @example\n * const abi = [{\n * \"inputs\": [\n * {\n * \"internalType\": \"address\",\n * \"name\": \"recipient\",\n * \"type\": \"address\"\n * },\n * ],\n * \"name\": \"mintNFT\",\n * \"outputs\": [],\n * \"stateMutability\": \"nonpayable\",\n * \"type\": \"function\"\n * }] as const;\n *\n * await wallet.executeContract({\n * address: contractAddress,\n * abi,\n * functionName: \"mintNFT\",\n * args: [recipientAddress],\n * });\n */\n public async executeContract<\n const TAbi extends Abi | readonly unknown[],\n TFunctionName extends ContractFunctionName<TAbi, \"nonpayable\" | \"payable\"> = ContractFunctionName<\n TAbi,\n \"nonpayable\" | \"payable\"\n >,\n TArgs extends ContractFunctionArgs<TAbi, \"nonpayable\" | \"payable\", TFunctionName> = ContractFunctionArgs<\n TAbi,\n \"nonpayable\" | \"payable\",\n TFunctionName\n >,\n >({\n address,\n abi,\n functionName,\n args,\n value,\n config,\n }: Omit<WriteContractParameters<TAbi, TFunctionName, TArgs>, \"chain\" | \"account\"> & {\n config?: Partial<SendTransactionOptions>;\n }): Promise<Hex> {\n return this.sendTransactionService.sendTransaction(\n {\n address,\n abi: abi as Abi,\n functionName,\n args,\n value,\n },\n config\n );\n }\n}\n"],"mappings":";;;;;;;;;;;AAuBO,IAAM,iBAAN,MAAqB;AAAA,EAkBxB,YACI,QACA,OACiB,kBACA,yBAAyB,IAAI,uBAAuB,MAAM,GAC7E;AAFmB;AACA;AAEjB,SAAK,QAAQ;AACb,SAAK,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA,EAKA,IAAW,UAAU;AACjB,WAAO,KAAK,OAAO,OAAO,QAAQ;AAAA,EACtC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAa,cAAc,WAAoB,QAAuC;AAClF,QAAI,KAAK,UAAU,OAAO,MAAM,OAAO;AACnC,YAAM,IAAI;AAAA,QACN,4BAA4B,OAAO,MAAM,KAAK,aAAa,KAAK,KAAK;AAAA,MACzE;AAAA,IACJ;AAEA,WAAO,KAAK;AAAA,MACR,eAAe;AAAA,QACX,UAAU,OAAO,MAAM;AAAA,QACvB,IAAI;AAAA,QACJ,MAAM,KAAK,OAAO,OAAO;AAAA,QACzB;AAAA,MACJ,CAAC;AAAA,IACL;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA,EAKA,MAAa,OAAO;AAChB,WAAO,KAAK,iBAAiB,UAAU,KAAK,SAAS,KAAK,KAAK;AAAA,EACnE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmCA,MAAa,gBAWX;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ,GAEiB;AACb,WAAO,KAAK,uBAAuB;AAAA,MAC/B;AAAA,QACI;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACJ;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AACJ;","names":[]}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PasskeyCreationStrategy
|
|
3
|
+
} from "./chunk-TDJDKTRS.js";
|
|
4
|
+
import {
|
|
5
|
+
ClientDecorator
|
|
6
|
+
} from "./chunk-7G2SBZTE.js";
|
|
7
|
+
import {
|
|
8
|
+
SmartWalletService
|
|
9
|
+
} from "./chunk-NXDZHR5C.js";
|
|
10
|
+
import {
|
|
11
|
+
AccountConfigCache
|
|
12
|
+
} from "./chunk-5W4NYW72.js";
|
|
13
|
+
import {
|
|
14
|
+
AccountConfigService
|
|
15
|
+
} from "./chunk-2HB65Y7D.js";
|
|
16
|
+
import {
|
|
17
|
+
AccountCreator
|
|
18
|
+
} from "./chunk-BSFIJZ5X.js";
|
|
19
|
+
import {
|
|
20
|
+
EOACreationStrategy
|
|
21
|
+
} from "./chunk-U4OBHCIP.js";
|
|
22
|
+
import {
|
|
23
|
+
isClient
|
|
24
|
+
} from "./chunk-5URMCCO6.js";
|
|
25
|
+
import {
|
|
26
|
+
CrossmintWalletService
|
|
27
|
+
} from "./chunk-UNP5V2AB.js";
|
|
28
|
+
import {
|
|
29
|
+
scwDatadogLogger,
|
|
30
|
+
scwLogger
|
|
31
|
+
} from "./chunk-MAID7XYG.js";
|
|
32
|
+
import {
|
|
33
|
+
isMainnetChain,
|
|
34
|
+
isTestnetChain
|
|
35
|
+
} from "./chunk-6NJVFL2X.js";
|
|
36
|
+
import {
|
|
37
|
+
ErrorProcessor
|
|
38
|
+
} from "./chunk-5VHMVO22.js";
|
|
39
|
+
import {
|
|
40
|
+
SDK_VERSION
|
|
41
|
+
} from "./chunk-UDDYHPSW.js";
|
|
42
|
+
import {
|
|
43
|
+
SmartWalletError
|
|
44
|
+
} from "./chunk-ASIPMVRQ.js";
|
|
45
|
+
|
|
46
|
+
// src/SmartWalletSDK.ts
|
|
47
|
+
import { stringify } from "viem";
|
|
48
|
+
import { validateAPIKey } from "@crossmint/common-sdk-base";
|
|
49
|
+
var SmartWalletSDK = class _SmartWalletSDK {
|
|
50
|
+
constructor(crossmintEnv, smartWalletService, errorProcessor, logger = scwLogger) {
|
|
51
|
+
this.crossmintEnv = crossmintEnv;
|
|
52
|
+
this.smartWalletService = smartWalletService;
|
|
53
|
+
this.errorProcessor = errorProcessor;
|
|
54
|
+
this.logger = logger;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Initializes the SDK with the **client side** API key obtained from the Crossmint console.
|
|
58
|
+
* @throws error if the api key is not formatted correctly.
|
|
59
|
+
*/
|
|
60
|
+
static init({ clientApiKey }) {
|
|
61
|
+
const validationResult = validateAPIKey(clientApiKey);
|
|
62
|
+
if (!validationResult.isValid) {
|
|
63
|
+
throw new Error("API key invalid");
|
|
64
|
+
}
|
|
65
|
+
const crossmintService = new CrossmintWalletService(clientApiKey);
|
|
66
|
+
const errorProcessor = new ErrorProcessor(scwDatadogLogger);
|
|
67
|
+
const accountCreator = new AccountCreator(
|
|
68
|
+
new EOACreationStrategy(),
|
|
69
|
+
new PasskeyCreationStrategy(crossmintService.getPasskeyServerUrl(), clientApiKey)
|
|
70
|
+
);
|
|
71
|
+
const accountCache = new AccountConfigCache(`smart-wallet-${SDK_VERSION}`);
|
|
72
|
+
const smartWalletService = new SmartWalletService(
|
|
73
|
+
crossmintService,
|
|
74
|
+
new AccountConfigService(crossmintService, accountCache),
|
|
75
|
+
accountCreator,
|
|
76
|
+
new ClientDecorator(errorProcessor)
|
|
77
|
+
);
|
|
78
|
+
return new _SmartWalletSDK(validationResult.environment, smartWalletService, errorProcessor);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Retrieves or creates a wallet for the specified user.
|
|
82
|
+
* 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.
|
|
83
|
+
*
|
|
84
|
+
* Example using the default passkey signer:
|
|
85
|
+
* ```ts
|
|
86
|
+
* const wallet = await smartWalletSDK.getOrCreateWallet({ jwt: "xxx" }, "base");
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
async getOrCreateWallet(user, chain, walletParams = { signer: { type: "PASSKEY" } }) {
|
|
90
|
+
if (!isClient()) {
|
|
91
|
+
throw new SmartWalletError("Smart Wallet SDK should only be used client side.");
|
|
92
|
+
}
|
|
93
|
+
this.assertValidChain(chain);
|
|
94
|
+
return await this.logger.logPerformance("GET_OR_CREATE_WALLET", async () => {
|
|
95
|
+
try {
|
|
96
|
+
return await this.smartWalletService.getOrCreate(user, chain, walletParams);
|
|
97
|
+
} catch (error) {
|
|
98
|
+
throw this.errorProcessor.map(
|
|
99
|
+
error,
|
|
100
|
+
new SmartWalletError(`Wallet creation failed: ${error.message}.`, stringify(error))
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
assertValidChain(chain) {
|
|
106
|
+
if (!this.validChain(chain)) {
|
|
107
|
+
throw new SmartWalletError(
|
|
108
|
+
`The selected chain "${chain}" is not available in "${this.crossmintEnv}". Either set a valid chain or check you're using an API key for the environment you're trying to target.`
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
validChain(chain) {
|
|
113
|
+
if (this.crossmintEnv === "development" || this.crossmintEnv === "staging") {
|
|
114
|
+
return isTestnetChain(chain);
|
|
115
|
+
}
|
|
116
|
+
return isMainnetChain(chain);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export {
|
|
121
|
+
SmartWalletSDK
|
|
122
|
+
};
|
|
123
|
+
//# sourceMappingURL=chunk-XZTGDSSL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/SmartWalletSDK.ts"],"sourcesContent":["import { stringify } from \"viem\";\n\nimport { type APIKeyEnvironmentPrefix, validateAPIKey } from \"@crossmint/common-sdk-base\";\n\nimport { CrossmintWalletService } from \"./api/CrossmintWalletService\";\nimport { type SmartWalletChain, isMainnetChain, isTestnetChain } from \"./blockchain/chains\";\nimport type { EVMSmartWallet } from \"./blockchain/wallets\";\nimport { AccountConfigCache } from \"./blockchain/wallets/account/cache\";\nimport { AccountConfigService } from \"./blockchain/wallets/account/config\";\nimport { AccountCreator } from \"./blockchain/wallets/account/creator\";\nimport { EOACreationStrategy } from \"./blockchain/wallets/account/eoa\";\nimport { PasskeyCreationStrategy } from \"./blockchain/wallets/account/passkey\";\nimport { ClientDecorator } from \"./blockchain/wallets/clientDecorator\";\nimport { SmartWalletService } from \"./blockchain/wallets/service\";\nimport { SmartWalletError } from \"./error\";\nimport { ErrorProcessor } from \"./error/processor\";\nimport { scwDatadogLogger, scwLogger } from \"./services\";\nimport type { SmartWalletSDKInitParams, UserParams, WalletParams } from \"./types/params\";\nimport { SDK_VERSION } from \"./utils/constants\";\nimport { isClient } from \"./utils/environment\";\n\nexport class SmartWalletSDK {\n private constructor(\n private readonly crossmintEnv: APIKeyEnvironmentPrefix,\n private readonly smartWalletService: SmartWalletService,\n private readonly errorProcessor: ErrorProcessor,\n private readonly logger = scwLogger\n ) {}\n\n /**\n * Initializes the SDK with the **client side** API key obtained from the Crossmint console.\n * @throws error if the api key is not formatted correctly.\n */\n static init({ clientApiKey }: SmartWalletSDKInitParams): SmartWalletSDK {\n const validationResult = validateAPIKey(clientApiKey);\n if (!validationResult.isValid) {\n throw new Error(\"API key invalid\");\n }\n\n const crossmintService = new CrossmintWalletService(clientApiKey);\n const errorProcessor = new ErrorProcessor(scwDatadogLogger);\n const accountCreator = new AccountCreator(\n new EOACreationStrategy(),\n new PasskeyCreationStrategy(crossmintService.getPasskeyServerUrl(), clientApiKey)\n );\n const accountCache = new AccountConfigCache(`smart-wallet-${SDK_VERSION}`);\n\n const smartWalletService = new SmartWalletService(\n crossmintService,\n new AccountConfigService(crossmintService, accountCache),\n accountCreator,\n new ClientDecorator(errorProcessor)\n );\n\n return new SmartWalletSDK(validationResult.environment, smartWalletService, errorProcessor);\n }\n\n /**\n * Retrieves or creates a wallet for the specified user.\n * 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.\n *\n * Example using the default passkey signer:\n * ```ts\n * const wallet = await smartWalletSDK.getOrCreateWallet({ jwt: \"xxx\" }, \"base\");\n * ```\n */\n async getOrCreateWallet(\n user: UserParams,\n chain: SmartWalletChain,\n walletParams: WalletParams = { signer: { type: \"PASSKEY\" } }\n ): Promise<EVMSmartWallet> {\n if (!isClient()) {\n throw new SmartWalletError(\"Smart Wallet SDK should only be used client side.\");\n }\n this.assertValidChain(chain);\n\n return await this.logger.logPerformance(\"GET_OR_CREATE_WALLET\", async () => {\n try {\n return await this.smartWalletService.getOrCreate(user, chain, walletParams);\n } catch (error: any) {\n throw this.errorProcessor.map(\n error,\n new SmartWalletError(`Wallet creation failed: ${error.message}.`, stringify(error))\n );\n }\n });\n }\n\n private assertValidChain(chain: SmartWalletChain) {\n if (!this.validChain(chain)) {\n throw new SmartWalletError(\n `The selected chain \"${chain}\" is not available in \"${this.crossmintEnv}\". Either set a valid chain or check you're using an API key for the environment you're trying to target.`\n );\n }\n }\n\n private validChain(chain: SmartWalletChain): boolean {\n if (this.crossmintEnv === \"development\" || this.crossmintEnv === \"staging\") {\n return isTestnetChain(chain);\n }\n\n return isMainnetChain(chain);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,iBAAiB;AAE1B,SAAuC,sBAAsB;AAmBtD,IAAM,iBAAN,MAAM,gBAAe;AAAA,EAChB,YACa,cACA,oBACA,gBACA,SAAS,WAC5B;AAJmB;AACA;AACA;AACA;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMH,OAAO,KAAK,EAAE,aAAa,GAA6C;AACpE,UAAM,mBAAmB,eAAe,YAAY;AACpD,QAAI,CAAC,iBAAiB,SAAS;AAC3B,YAAM,IAAI,MAAM,iBAAiB;AAAA,IACrC;AAEA,UAAM,mBAAmB,IAAI,uBAAuB,YAAY;AAChE,UAAM,iBAAiB,IAAI,eAAe,gBAAgB;AAC1D,UAAM,iBAAiB,IAAI;AAAA,MACvB,IAAI,oBAAoB;AAAA,MACxB,IAAI,wBAAwB,iBAAiB,oBAAoB,GAAG,YAAY;AAAA,IACpF;AACA,UAAM,eAAe,IAAI,mBAAmB,gBAAgB,WAAW,EAAE;AAEzE,UAAM,qBAAqB,IAAI;AAAA,MAC3B;AAAA,MACA,IAAI,qBAAqB,kBAAkB,YAAY;AAAA,MACvD;AAAA,MACA,IAAI,gBAAgB,cAAc;AAAA,IACtC;AAEA,WAAO,IAAI,gBAAe,iBAAiB,aAAa,oBAAoB,cAAc;AAAA,EAC9F;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAM,kBACF,MACA,OACA,eAA6B,EAAE,QAAQ,EAAE,MAAM,UAAU,EAAE,GACpC;AACvB,QAAI,CAAC,SAAS,GAAG;AACb,YAAM,IAAI,iBAAiB,mDAAmD;AAAA,IAClF;AACA,SAAK,iBAAiB,KAAK;AAE3B,WAAO,MAAM,KAAK,OAAO,eAAe,wBAAwB,YAAY;AACxE,UAAI;AACA,eAAO,MAAM,KAAK,mBAAmB,YAAY,MAAM,OAAO,YAAY;AAAA,MAC9E,SAAS,OAAY;AACjB,cAAM,KAAK,eAAe;AAAA,UACtB;AAAA,UACA,IAAI,iBAAiB,2BAA2B,MAAM,OAAO,KAAK,UAAU,KAAK,CAAC;AAAA,QACtF;AAAA,MACJ;AAAA,IACJ,CAAC;AAAA,EACL;AAAA,EAEQ,iBAAiB,OAAyB;AAC9C,QAAI,CAAC,KAAK,WAAW,KAAK,GAAG;AACzB,YAAM,IAAI;AAAA,QACN,uBAAuB,KAAK,0BAA0B,KAAK,YAAY;AAAA,MAC3E;AAAA,IACJ;AAAA,EACJ;AAAA,EAEQ,WAAW,OAAkC;AACjD,QAAI,KAAK,iBAAiB,iBAAiB,KAAK,iBAAiB,WAAW;AACxE,aAAO,eAAe,KAAK;AAAA,IAC/B;AAEA,WAAO,eAAe,KAAK;AAAA,EAC/B;AACJ;","names":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkBXSAJOIVcjs = require('./chunk-BXSAJOIV.cjs');
|
|
4
|
+
|
|
5
|
+
// src/utils/signer.ts
|
|
6
|
+
var _permissionless = require('permissionless');
|
|
7
|
+
async function createOwnerSigner({
|
|
8
|
+
walletParams
|
|
9
|
+
}) {
|
|
10
|
+
if (isEIP1193Provider(walletParams.signer)) {
|
|
11
|
+
return await _permissionless.providerToSmartAccountSigner.call(void 0, walletParams.signer);
|
|
12
|
+
} else if (isAccount(walletParams.signer)) {
|
|
13
|
+
return walletParams.signer.account;
|
|
14
|
+
} else {
|
|
15
|
+
const signer = walletParams.signer;
|
|
16
|
+
throw new (0, _chunkBXSAJOIVcjs.SmartWalletError)(`The signer type ${signer.type} is not supported`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function isEIP1193Provider(signer) {
|
|
20
|
+
return signer && typeof signer.request === "function";
|
|
21
|
+
}
|
|
22
|
+
function isAccount(signer) {
|
|
23
|
+
return signer && signer.type === "VIEM_ACCOUNT";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
exports.createOwnerSigner = createOwnerSigner; exports.isAccount = isAccount;
|
|
30
|
+
//# sourceMappingURL=chunk-YWCXHOSD.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/signer.ts"],"names":[],"mappings":";;;;;AAAA,SAAS,oCAAoC;AAa7C,eAAsB,kBAAkB;AAAA,EACpC;AACJ,GAA2E;AACvE,MAAI,kBAAkB,aAAa,MAAM,GAAG;AACxC,WAAO,MAAM,6BAA6B,aAAa,MAAM;AAAA,EACjE,WAAW,UAAU,aAAa,MAAM,GAAG;AACvC,WAAO,aAAa,OAAO;AAAA,EAC/B,OAAO;AACH,UAAM,SAAS,aAAa;AAC5B,UAAM,IAAI,iBAAiB,mBAAmB,OAAO,IAAI,mBAAmB;AAAA,EAChF;AACJ;AAEA,SAAS,kBAAkB,QAAwC;AAC/D,SAAO,UAAU,OAAO,OAAO,YAAY;AAC/C;AAEO,SAAS,UAAU,QAAoC;AAC1D,SAAO,UAAU,OAAO,SAAS;AACrC","sourcesContent":["import { providerToSmartAccountSigner } from \"permissionless\";\nimport type { SmartAccountSigner } from \"permissionless/accounts\";\nimport type { Address, EIP1193Provider } from \"viem\";\n\nimport type { SmartWalletChain } from \"../blockchain/chains\";\nimport { SmartWalletError } from \"../error\";\nimport type { ViemAccount, WalletParams } from \"../types/params\";\n\ntype CreateOwnerSignerInput = {\n chain: SmartWalletChain;\n walletParams: WalletParams;\n};\n\nexport async function createOwnerSigner({\n walletParams,\n}: CreateOwnerSignerInput): Promise<SmartAccountSigner<\"custom\", Address>> {\n if (isEIP1193Provider(walletParams.signer)) {\n return await providerToSmartAccountSigner(walletParams.signer);\n } else if (isAccount(walletParams.signer)) {\n return walletParams.signer.account;\n } else {\n const signer = walletParams.signer as any;\n throw new SmartWalletError(`The signer type ${signer.type} is not supported`);\n }\n}\n\nfunction isEIP1193Provider(signer: any): signer is EIP1193Provider {\n return signer && typeof signer.request === \"function\";\n}\n\nexport function isAccount(signer: any): signer is ViemAccount {\n return signer && signer.type === \"VIEM_ACCOUNT\";\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";//# sourceMappingURL=chunk-ZN42AA2G.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/blockchain/wallets/account/signer.ts
|
|
2
|
+
var PasskeySignerConfig = class {
|
|
3
|
+
constructor(data) {
|
|
4
|
+
this.type = "passkeys";
|
|
5
|
+
this.data = data;
|
|
6
|
+
}
|
|
7
|
+
display() {
|
|
8
|
+
return {
|
|
9
|
+
pubKeyX: this.data.pubKeyX,
|
|
10
|
+
pubKeyY: this.data.pubKeyY,
|
|
11
|
+
passkeyName: this.data.passkeyName,
|
|
12
|
+
type: this.type
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var EOASignerConfig = class {
|
|
17
|
+
constructor(data) {
|
|
18
|
+
this.type = "eoa";
|
|
19
|
+
this.data = data;
|
|
20
|
+
}
|
|
21
|
+
display() {
|
|
22
|
+
return this.data;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
exports.PasskeySignerConfig = PasskeySignerConfig; exports.EOASignerConfig = EOASignerConfig;
|
|
30
|
+
//# sourceMappingURL=chunk-ZOXKITU4.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/blockchain/wallets/account/signer.ts"],"names":[],"mappings":";AAcO,IAAM,sBAAN,MAAkD;AAAA,EAIrD,YAAY,MAAyB;AAFrC,SAAgB,OAAO;AAGnB,SAAK,OAAO;AAAA,EAChB;AAAA,EAEO,UAA0B;AAC7B,WAAO;AAAA,MACH,SAAS,KAAK,KAAK;AAAA,MACnB,SAAS,KAAK,KAAK;AAAA,MACnB,aAAa,KAAK,KAAK;AAAA,MACvB,MAAM,KAAK;AAAA,IACf;AAAA,EACJ;AACJ;AAEO,IAAM,kBAAN,MAA8C;AAAA,EAIjD,YAAY,MAAqB;AAFjC,SAAgB,OAAO;AAGnB,SAAK,OAAO;AAAA,EAChB;AAAA,EAEO,UAAU;AACb,WAAO,KAAK;AAAA,EAChB;AACJ","sourcesContent":["import type {\n EOASignerData,\n PasskeyDisplay,\n PasskeySignerData,\n SignerData,\n SignerDisplay,\n} from \"../../../types/service\";\n\nexport interface SignerConfig {\n readonly type: \"passkeys\" | \"eoa\";\n display(): SignerDisplay;\n readonly data: SignerData;\n}\n\nexport class PasskeySignerConfig implements SignerConfig {\n public readonly data: PasskeySignerData;\n public readonly type = \"passkeys\";\n\n constructor(data: PasskeySignerData) {\n this.data = data;\n }\n\n public display(): PasskeyDisplay {\n return {\n pubKeyX: this.data.pubKeyX,\n pubKeyY: this.data.pubKeyY,\n passkeyName: this.data.passkeyName,\n type: this.type,\n };\n }\n}\n\nexport class EOASignerConfig implements SignerConfig {\n public readonly data: EOASignerData;\n public readonly type = \"eoa\";\n\n constructor(data: EOASignerData) {\n this.data = data;\n }\n\n public display() {\n return this.data;\n }\n}\n"]}
|
package/dist/error/index.cjs
CHANGED
|
@@ -1 +1,25 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunkBXSAJOIVcjs = require('../chunk-BXSAJOIV.cjs');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
exports.AdminAlreadyUsedError = _chunkBXSAJOIVcjs.AdminAlreadyUsedError; exports.AdminMismatchError = _chunkBXSAJOIVcjs.AdminMismatchError; exports.ConfigError = _chunkBXSAJOIVcjs.ConfigError; exports.PasskeyIncompatibleAuthenticatorError = _chunkBXSAJOIVcjs.PasskeyIncompatibleAuthenticatorError; exports.PasskeyMismatchError = _chunkBXSAJOIVcjs.PasskeyMismatchError; exports.PasskeyPromptError = _chunkBXSAJOIVcjs.PasskeyPromptError; exports.PasskeyRegistrationError = _chunkBXSAJOIVcjs.PasskeyRegistrationError; exports.SmartWalletError = _chunkBXSAJOIVcjs.SmartWalletError; exports.SmartWalletsNotEnabledError = _chunkBXSAJOIVcjs.SmartWalletsNotEnabledError; exports.UserWalletAlreadyCreatedError = _chunkBXSAJOIVcjs.UserWalletAlreadyCreatedError;
|
|
25
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/error/index.js
CHANGED
|
@@ -1 +1,25 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import {
|
|
2
|
+
AdminAlreadyUsedError,
|
|
3
|
+
AdminMismatchError,
|
|
4
|
+
ConfigError,
|
|
5
|
+
PasskeyIncompatibleAuthenticatorError,
|
|
6
|
+
PasskeyMismatchError,
|
|
7
|
+
PasskeyPromptError,
|
|
8
|
+
PasskeyRegistrationError,
|
|
9
|
+
SmartWalletError,
|
|
10
|
+
SmartWalletsNotEnabledError,
|
|
11
|
+
UserWalletAlreadyCreatedError
|
|
12
|
+
} from "../chunk-ASIPMVRQ.js";
|
|
13
|
+
export {
|
|
14
|
+
AdminAlreadyUsedError,
|
|
15
|
+
AdminMismatchError,
|
|
16
|
+
ConfigError,
|
|
17
|
+
PasskeyIncompatibleAuthenticatorError,
|
|
18
|
+
PasskeyMismatchError,
|
|
19
|
+
PasskeyPromptError,
|
|
20
|
+
PasskeyRegistrationError,
|
|
21
|
+
SmartWalletError,
|
|
22
|
+
SmartWalletsNotEnabledError,
|
|
23
|
+
UserWalletAlreadyCreatedError
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/error/processor.cjs
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkTK3ZLI22cjs = require('../chunk-TK3ZLI22.cjs');
|
|
4
|
+
require('../chunk-TUVECZA7.cjs');
|
|
5
|
+
require('../chunk-BXSAJOIV.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.ErrorProcessor = _chunkTK3ZLI22cjs.ErrorProcessor;
|
|
9
|
+
//# sourceMappingURL=processor.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/error/processor.js
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import {
|
|
2
|
+
ErrorProcessor
|
|
3
|
+
} from "../chunk-5VHMVO22.js";
|
|
4
|
+
import "../chunk-UDDYHPSW.js";
|
|
5
|
+
import "../chunk-ASIPMVRQ.js";
|
|
6
|
+
export {
|
|
7
|
+
ErrorProcessor
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=processor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1,86 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkMJZ2DXMNcjs = require('./chunk-MJZ2DXMN.cjs');
|
|
4
|
+
require('./chunk-N6DG5EZG.cjs');
|
|
5
|
+
require('./chunk-KEY2LM72.cjs');
|
|
6
|
+
require('./chunk-RB4JSPZH.cjs');
|
|
7
|
+
require('./chunk-DYO4HODM.cjs');
|
|
8
|
+
require('./chunk-IDNF4BNP.cjs');
|
|
9
|
+
require('./chunk-77GT6B5L.cjs');
|
|
10
|
+
require('./chunk-OCG67QSU.cjs');
|
|
11
|
+
require('./chunk-DTEA33DF.cjs');
|
|
12
|
+
require('./chunk-ZOXKITU4.cjs');
|
|
13
|
+
require('./chunk-FXGOVLZW.cjs');
|
|
14
|
+
require('./chunk-EPEGJY6N.cjs');
|
|
15
|
+
require('./chunk-5MG5CIEX.cjs');
|
|
16
|
+
require('./chunk-YWCXHOSD.cjs');
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
var _chunkOGA3YDWScjs = require('./chunk-OGA3YDWS.cjs');
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
var _chunk7KTQNIAZcjs = require('./chunk-7KTQNIAZ.cjs');
|
|
24
|
+
require('./chunk-GLHQIT4Q.cjs');
|
|
25
|
+
require('./chunk-EUQLY4SC.cjs');
|
|
26
|
+
require('./chunk-ZN42AA2G.cjs');
|
|
27
|
+
require('./chunk-C5ZRYSCP.cjs');
|
|
28
|
+
require('./chunk-7B2CZEJG.cjs');
|
|
29
|
+
require('./chunk-O6IFYHDP.cjs');
|
|
30
|
+
require('./chunk-PVFA6PBX.cjs');
|
|
31
|
+
require('./chunk-UQKE6R5W.cjs');
|
|
32
|
+
require('./chunk-5WVQ7J3E.cjs');
|
|
33
|
+
require('./chunk-TK3ZLI22.cjs');
|
|
34
|
+
require('./chunk-TUVECZA7.cjs');
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
var _chunkBXSAJOIVcjs = require('./chunk-BXSAJOIV.cjs');
|
|
47
|
+
|
|
48
|
+
// src/index.ts
|
|
49
|
+
var _commonsdkbase = require('@crossmint/common-sdk-base');
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
var _clientsdkbase = require('@crossmint/client-sdk-base');
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
exports.AdminAlreadyUsedError = _chunkBXSAJOIVcjs.AdminAlreadyUsedError; exports.AdminMismatchError = _chunkBXSAJOIVcjs.AdminMismatchError; exports.Chain = _commonsdkbase.EVMBlockchainIncludingTestnet; exports.ConfigError = _chunkBXSAJOIVcjs.ConfigError; exports.CrossmintSDKError = _clientsdkbase.CrossmintSDKError; exports.CrossmintServiceError = _clientsdkbase.CrossmintServiceError; exports.EVMSendTransactionError = _chunk7KTQNIAZcjs.EVMSendTransactionError; exports.EVMSendTransactionExecutionRevertedError = _chunk7KTQNIAZcjs.EVMSendTransactionExecutionRevertedError; exports.EVMSmartWallet = _chunkOGA3YDWScjs.EVMSmartWallet; exports.JWTDecryptionError = _clientsdkbase.JWTDecryptionError; exports.JWTExpiredError = _clientsdkbase.JWTExpiredError; exports.JWTIdentifierError = _clientsdkbase.JWTIdentifierError; exports.JWTInvalidError = _clientsdkbase.JWTInvalidError; exports.NotAuthorizedError = _clientsdkbase.NotAuthorizedError; exports.PasskeyIncompatibleAuthenticatorError = _chunkBXSAJOIVcjs.PasskeyIncompatibleAuthenticatorError; exports.PasskeyMismatchError = _chunkBXSAJOIVcjs.PasskeyMismatchError; exports.PasskeyPromptError = _chunkBXSAJOIVcjs.PasskeyPromptError; exports.PasskeyRegistrationError = _chunkBXSAJOIVcjs.PasskeyRegistrationError; exports.SmartWalletError = _chunkBXSAJOIVcjs.SmartWalletError; exports.SmartWalletErrorCode = _clientsdkbase.SmartWalletErrorCode; exports.SmartWalletSDK = _chunkMJZ2DXMNcjs.SmartWalletSDK; exports.SmartWalletsNotEnabledError = _chunkBXSAJOIVcjs.SmartWalletsNotEnabledError; exports.UserWalletAlreadyCreatedError = _chunkBXSAJOIVcjs.UserWalletAlreadyCreatedError; exports.blockchainToChainId = _commonsdkbase.blockchainToChainId;
|
|
86
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,qBAAsD,qCAAa;AAmC5E;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG","sourcesContent":["export { blockchainToChainId, EVMBlockchainIncludingTestnet as Chain } from \"@crossmint/common-sdk-base\";\n\nexport { EVMSmartWallet } from \"./blockchain/wallets/EVMSmartWallet\";\n\nexport type {\n SmartWalletSDKInitParams,\n UserParams,\n ViemAccount,\n PasskeySigner,\n ExternalSigner,\n WalletParams,\n} from \"./types/params\";\n\nexport type { SmartWalletChain as EVMSmartWalletChain } from \"./blockchain/chains\";\n\nexport type { TransferType, ERC20TransferType, NFTTransferType, SFTTransferType } from \"./types/token\";\n\nexport {\n SmartWalletError,\n UserWalletAlreadyCreatedError,\n AdminAlreadyUsedError,\n AdminMismatchError,\n PasskeyMismatchError,\n PasskeyPromptError,\n PasskeyRegistrationError,\n PasskeyIncompatibleAuthenticatorError,\n ConfigError,\n SmartWalletsNotEnabledError,\n} from \"./error\";\n\nexport {\n EVMSendTransactionError,\n EVMSendTransactionExecutionRevertedError,\n} from \"./blockchain/wallets/SendTransactionService\";\n\nexport {\n SmartWalletErrorCode,\n CrossmintSDKError,\n CrossmintServiceError,\n JWTDecryptionError,\n JWTExpiredError,\n JWTIdentifierError,\n JWTInvalidError,\n NotAuthorizedError,\n} from \"@crossmint/client-sdk-base\";\n\nexport { SmartWalletSDK } from \"./SmartWalletSDK\";\n"]}
|
package/dist/index.js
CHANGED
|
@@ -1 +1,86 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
SmartWalletSDK
|
|
3
|
+
} from "./chunk-XZTGDSSL.js";
|
|
4
|
+
import "./chunk-TDJDKTRS.js";
|
|
5
|
+
import "./chunk-7G2SBZTE.js";
|
|
6
|
+
import "./chunk-NXDZHR5C.js";
|
|
7
|
+
import "./chunk-QJ3BSVGV.js";
|
|
8
|
+
import "./chunk-5W4NYW72.js";
|
|
9
|
+
import "./chunk-2HB65Y7D.js";
|
|
10
|
+
import "./chunk-BSFIJZ5X.js";
|
|
11
|
+
import "./chunk-U4OBHCIP.js";
|
|
12
|
+
import "./chunk-3R6PW6HY.js";
|
|
13
|
+
import "./chunk-JOB7STIS.js";
|
|
14
|
+
import "./chunk-5URMCCO6.js";
|
|
15
|
+
import "./chunk-SMDX2MXU.js";
|
|
16
|
+
import "./chunk-EQSMHR77.js";
|
|
17
|
+
import {
|
|
18
|
+
EVMSmartWallet
|
|
19
|
+
} from "./chunk-UZGHOTKZ.js";
|
|
20
|
+
import {
|
|
21
|
+
EVMSendTransactionError,
|
|
22
|
+
EVMSendTransactionExecutionRevertedError
|
|
23
|
+
} from "./chunk-3EQHAQXO.js";
|
|
24
|
+
import "./chunk-7AT3QDQV.js";
|
|
25
|
+
import "./chunk-UNP5V2AB.js";
|
|
26
|
+
import "./chunk-KHROQTVY.js";
|
|
27
|
+
import "./chunk-MAID7XYG.js";
|
|
28
|
+
import "./chunk-OYKL3RNL.js";
|
|
29
|
+
import "./chunk-FSIMJYXR.js";
|
|
30
|
+
import "./chunk-6NJVFL2X.js";
|
|
31
|
+
import "./chunk-BARW756O.js";
|
|
32
|
+
import "./chunk-ON4DOYVD.js";
|
|
33
|
+
import "./chunk-5VHMVO22.js";
|
|
34
|
+
import "./chunk-UDDYHPSW.js";
|
|
35
|
+
import {
|
|
36
|
+
AdminAlreadyUsedError,
|
|
37
|
+
AdminMismatchError,
|
|
38
|
+
ConfigError,
|
|
39
|
+
PasskeyIncompatibleAuthenticatorError,
|
|
40
|
+
PasskeyMismatchError,
|
|
41
|
+
PasskeyPromptError,
|
|
42
|
+
PasskeyRegistrationError,
|
|
43
|
+
SmartWalletError,
|
|
44
|
+
SmartWalletsNotEnabledError,
|
|
45
|
+
UserWalletAlreadyCreatedError
|
|
46
|
+
} from "./chunk-ASIPMVRQ.js";
|
|
47
|
+
|
|
48
|
+
// src/index.ts
|
|
49
|
+
import { blockchainToChainId, EVMBlockchainIncludingTestnet } from "@crossmint/common-sdk-base";
|
|
50
|
+
import {
|
|
51
|
+
SmartWalletErrorCode,
|
|
52
|
+
CrossmintSDKError,
|
|
53
|
+
CrossmintServiceError,
|
|
54
|
+
JWTDecryptionError,
|
|
55
|
+
JWTExpiredError,
|
|
56
|
+
JWTIdentifierError,
|
|
57
|
+
JWTInvalidError,
|
|
58
|
+
NotAuthorizedError
|
|
59
|
+
} from "@crossmint/client-sdk-base";
|
|
60
|
+
export {
|
|
61
|
+
AdminAlreadyUsedError,
|
|
62
|
+
AdminMismatchError,
|
|
63
|
+
EVMBlockchainIncludingTestnet as Chain,
|
|
64
|
+
ConfigError,
|
|
65
|
+
CrossmintSDKError,
|
|
66
|
+
CrossmintServiceError,
|
|
67
|
+
EVMSendTransactionError,
|
|
68
|
+
EVMSendTransactionExecutionRevertedError,
|
|
69
|
+
EVMSmartWallet,
|
|
70
|
+
JWTDecryptionError,
|
|
71
|
+
JWTExpiredError,
|
|
72
|
+
JWTIdentifierError,
|
|
73
|
+
JWTInvalidError,
|
|
74
|
+
NotAuthorizedError,
|
|
75
|
+
PasskeyIncompatibleAuthenticatorError,
|
|
76
|
+
PasskeyMismatchError,
|
|
77
|
+
PasskeyPromptError,
|
|
78
|
+
PasskeyRegistrationError,
|
|
79
|
+
SmartWalletError,
|
|
80
|
+
SmartWalletErrorCode,
|
|
81
|
+
SmartWalletSDK,
|
|
82
|
+
SmartWalletsNotEnabledError,
|
|
83
|
+
UserWalletAlreadyCreatedError,
|
|
84
|
+
blockchainToChainId
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { blockchainToChainId, EVMBlockchainIncludingTestnet as Chain } from \"@crossmint/common-sdk-base\";\n\nexport { EVMSmartWallet } from \"./blockchain/wallets/EVMSmartWallet\";\n\nexport type {\n SmartWalletSDKInitParams,\n UserParams,\n ViemAccount,\n PasskeySigner,\n ExternalSigner,\n WalletParams,\n} from \"./types/params\";\n\nexport type { SmartWalletChain as EVMSmartWalletChain } from \"./blockchain/chains\";\n\nexport type { TransferType, ERC20TransferType, NFTTransferType, SFTTransferType } from \"./types/token\";\n\nexport {\n SmartWalletError,\n UserWalletAlreadyCreatedError,\n AdminAlreadyUsedError,\n AdminMismatchError,\n PasskeyMismatchError,\n PasskeyPromptError,\n PasskeyRegistrationError,\n PasskeyIncompatibleAuthenticatorError,\n ConfigError,\n SmartWalletsNotEnabledError,\n} from \"./error\";\n\nexport {\n EVMSendTransactionError,\n EVMSendTransactionExecutionRevertedError,\n} from \"./blockchain/wallets/SendTransactionService\";\n\nexport {\n SmartWalletErrorCode,\n CrossmintSDKError,\n CrossmintServiceError,\n JWTDecryptionError,\n JWTExpiredError,\n JWTIdentifierError,\n JWTInvalidError,\n NotAuthorizedError,\n} from \"@crossmint/client-sdk-base\";\n\nexport { SmartWalletSDK } from \"./SmartWalletSDK\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,qBAAsD,qCAAa;AAmC5E;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;","names":[]}
|
package/dist/services/index.cjs
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-ZN42AA2G.cjs');
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkC5ZRYSCPcjs = require('../chunk-C5ZRYSCP.cjs');
|
|
6
|
+
require('../chunk-TUVECZA7.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.scwDatadogLogger = _chunkC5ZRYSCPcjs.scwDatadogLogger; exports.scwLogger = _chunkC5ZRYSCPcjs.scwLogger;
|
|
11
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|