@crossmint/client-sdk-smart-wallet 0.1.35 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +293 -0
- package/dist/abi/entryPoint.cjs +1 -0
- package/dist/abi/entryPoint.d.cts +777 -0
- package/dist/abi/entryPoint.d.ts +777 -0
- package/dist/abi/entryPoint.js +1 -0
- package/dist/abi/erc1155.cjs +1 -0
- package/dist/abi/erc1155.d.cts +254 -0
- package/dist/abi/erc1155.d.ts +254 -0
- package/dist/abi/erc1155.js +1 -0
- package/dist/abi/erc20.cjs +1 -0
- package/dist/abi/erc20.d.cts +170 -0
- package/dist/abi/erc20.d.ts +170 -0
- package/dist/abi/erc20.js +1 -0
- package/dist/abi/erc721.cjs +1 -0
- package/dist/abi/erc721.d.cts +247 -0
- package/dist/abi/erc721.d.ts +247 -0
- package/dist/abi/erc721.js +1 -0
- package/dist/apiService-D4DIxjMr.d.ts +136 -0
- package/dist/apiService-Dum8A8_6.d.cts +136 -0
- package/dist/apiService.cjs +1 -0
- package/dist/apiService.d.cts +9 -0
- package/dist/apiService.d.ts +9 -0
- package/dist/apiService.js +1 -0
- package/dist/{chunk-IUIBQFWY.cjs → chunk-23IWY6XV.cjs} +1 -1
- package/dist/chunk-2MQHIAJE.js +1 -0
- package/dist/chunk-4PMBBA3O.cjs +1 -0
- package/dist/chunk-5T3HB4Y6.js +1 -0
- package/dist/chunk-73LUJQGU.cjs +1 -0
- package/dist/chunk-75JNTS3U.js +1 -0
- package/dist/chunk-AS5VIM5V.cjs +1 -0
- package/dist/chunk-BCWZIVSQ.js +1 -0
- package/dist/{chunk-SODH64MG.cjs → chunk-D33JIUOQ.cjs} +1 -1
- package/dist/chunk-DB2QM3HB.js +1 -0
- package/dist/chunk-EMZ5NAG2.cjs +1 -0
- package/dist/chunk-GGKMZPIA.js +1 -0
- package/dist/chunk-I5RZI2HB.js +1 -0
- package/dist/chunk-J5SRLI35.cjs +1 -0
- package/dist/chunk-KXYDJTZS.cjs +1 -0
- package/dist/{chunk-I22LKNPM.js → chunk-LJ43A5BN.js} +1 -1
- package/dist/chunk-LPLLPZFU.cjs +1 -0
- package/dist/chunk-MLTT5BGD.cjs +1 -0
- package/dist/chunk-NXTHA2ZL.js +1 -0
- package/dist/chunk-OWZ3LXVG.js +1 -0
- package/dist/chunk-Q23CHZRT.cjs +1 -0
- package/dist/chunk-Q6YGAHDR.cjs +1 -0
- package/dist/chunk-SVGKSKZD.cjs +1 -0
- package/dist/chunk-T5PL4ATW.js +1 -0
- package/dist/chunk-U2JMKBCC.cjs +1 -0
- package/dist/chunk-UBRUUSMF.js +1 -0
- package/dist/chunk-VEZ3PQGX.js +1 -0
- package/dist/chunk-Z3KARJF5.js +1 -0
- package/dist/error/index.cjs +1 -1
- package/dist/error/index.d.cts +25 -43
- package/dist/error/index.d.ts +25 -43
- package/dist/error/index.js +1 -1
- package/dist/error/processor.cjs +1 -1
- package/dist/error/processor.d.cts +0 -13
- package/dist/error/processor.d.ts +0 -13
- package/dist/error/processor.js +1 -1
- package/dist/evm/chains/definitions/story-testnet.cjs +1 -0
- package/dist/evm/chains/definitions/story-testnet.js +1 -0
- package/dist/evm/chains/definitions/story.cjs +1 -0
- package/dist/evm/chains/definitions/story.js +1 -0
- package/dist/evm/chains/index.cjs +1 -0
- package/dist/{blockchain/chains.d.cts → evm/chains/index.d.cts} +4 -7
- package/dist/{blockchain/chains.d.ts → evm/chains/index.d.ts} +4 -7
- package/dist/evm/chains/index.js +1 -0
- package/dist/evm/rpc.cjs +1 -0
- package/dist/{blockchain → evm}/rpc.d.cts +4 -3
- package/dist/{blockchain → evm}/rpc.d.ts +4 -3
- package/dist/evm/rpc.js +1 -0
- package/dist/evm/smartWalletClient.d.cts +59 -0
- package/dist/evm/smartWalletClient.d.ts +59 -0
- package/dist/evm/transfer.cjs +1 -0
- package/dist/evm/transfer.d.cts +8 -0
- package/dist/evm/transfer.d.ts +8 -0
- package/dist/evm/transfer.js +1 -0
- package/dist/evm/wallet.cjs +1 -0
- package/dist/evm/wallet.d.cts +9 -0
- package/dist/evm/wallet.d.ts +9 -0
- package/dist/evm/wallet.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +9 -20
- package/dist/index.d.ts +9 -20
- package/dist/index.js +1 -1
- package/dist/sdk.cjs +1 -0
- package/dist/{SmartWalletSDK.d.ts → sdk.d.cts} +18 -21
- package/dist/{SmartWalletSDK.d.cts → sdk.d.ts} +18 -21
- package/dist/sdk.js +1 -0
- package/dist/services/index.cjs +1 -1
- package/dist/services/index.js +1 -1
- package/dist/services/logger.cjs +1 -1
- package/dist/services/logger.js +1 -1
- package/dist/smartWalletService.cjs +1 -0
- package/dist/smartWalletService.d.cts +9 -0
- package/dist/smartWalletService.d.ts +9 -0
- package/dist/smartWalletService.js +1 -0
- package/dist/types/api.d.cts +195 -0
- package/dist/types/api.d.ts +195 -0
- package/dist/types/transfer.d.cts +46 -0
- package/dist/types/transfer.d.ts +46 -0
- package/dist/utils/constants.cjs +1 -1
- package/dist/utils/constants.d.cts +5 -6
- package/dist/utils/constants.d.ts +5 -6
- package/dist/utils/constants.js +1 -1
- package/dist/utils/index.cjs +1 -0
- package/dist/utils/index.d.cts +3 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +1 -0
- package/package.json +3 -8
- package/dist/SmartWalletSDK.cjs +0 -1
- package/dist/SmartWalletSDK.js +0 -1
- package/dist/api/CrossmintWalletService.cjs +0 -1
- package/dist/api/CrossmintWalletService.d.cts +0 -31
- package/dist/api/CrossmintWalletService.d.ts +0 -31
- package/dist/api/CrossmintWalletService.js +0 -1
- package/dist/blockchain/chains.cjs +0 -1
- package/dist/blockchain/chains.js +0 -1
- package/dist/blockchain/rpc.cjs +0 -1
- package/dist/blockchain/rpc.js +0 -1
- package/dist/blockchain/transfer.cjs +0 -1
- package/dist/blockchain/transfer.d.cts +0 -23
- package/dist/blockchain/transfer.d.ts +0 -23
- package/dist/blockchain/transfer.js +0 -1
- package/dist/blockchain/wallets/EVMSmartWallet.cjs +0 -1
- package/dist/blockchain/wallets/EVMSmartWallet.d.cts +0 -102
- package/dist/blockchain/wallets/EVMSmartWallet.d.ts +0 -102
- package/dist/blockchain/wallets/EVMSmartWallet.js +0 -1
- package/dist/blockchain/wallets/SendTransactionService.cjs +0 -1
- package/dist/blockchain/wallets/SendTransactionService.d.cts +0 -84
- package/dist/blockchain/wallets/SendTransactionService.d.ts +0 -84
- package/dist/blockchain/wallets/SendTransactionService.js +0 -1
- package/dist/blockchain/wallets/account/cache.cjs +0 -1
- package/dist/blockchain/wallets/account/cache.d.cts +0 -25
- package/dist/blockchain/wallets/account/cache.d.ts +0 -25
- package/dist/blockchain/wallets/account/cache.js +0 -1
- package/dist/blockchain/wallets/account/config.cjs +0 -1
- package/dist/blockchain/wallets/account/config.d.cts +0 -47
- package/dist/blockchain/wallets/account/config.d.ts +0 -47
- package/dist/blockchain/wallets/account/config.js +0 -1
- package/dist/blockchain/wallets/account/creator.cjs +0 -1
- package/dist/blockchain/wallets/account/creator.d.cts +0 -26
- package/dist/blockchain/wallets/account/creator.d.ts +0 -26
- package/dist/blockchain/wallets/account/creator.js +0 -1
- package/dist/blockchain/wallets/account/eoa.cjs +0 -1
- package/dist/blockchain/wallets/account/eoa.d.cts +0 -21
- package/dist/blockchain/wallets/account/eoa.d.ts +0 -21
- package/dist/blockchain/wallets/account/eoa.js +0 -1
- package/dist/blockchain/wallets/account/passkey.cjs +0 -1
- package/dist/blockchain/wallets/account/passkey.d.cts +0 -29
- package/dist/blockchain/wallets/account/passkey.d.ts +0 -29
- package/dist/blockchain/wallets/account/passkey.js +0 -1
- package/dist/blockchain/wallets/account/signer.cjs +0 -1
- package/dist/blockchain/wallets/account/signer.d.cts +0 -14
- package/dist/blockchain/wallets/account/signer.d.ts +0 -14
- package/dist/blockchain/wallets/account/signer.js +0 -1
- package/dist/blockchain/wallets/account/strategy.d.cts +0 -20
- package/dist/blockchain/wallets/account/strategy.d.ts +0 -20
- package/dist/blockchain/wallets/clientDecorator.cjs +0 -1
- package/dist/blockchain/wallets/clientDecorator.d.cts +0 -38
- package/dist/blockchain/wallets/clientDecorator.d.ts +0 -38
- package/dist/blockchain/wallets/clientDecorator.js +0 -1
- package/dist/blockchain/wallets/definitions/story-testnet.cjs +0 -1
- package/dist/blockchain/wallets/definitions/story-testnet.js +0 -1
- package/dist/blockchain/wallets/definitions/story.cjs +0 -1
- package/dist/blockchain/wallets/definitions/story.js +0 -1
- package/dist/blockchain/wallets/index.cjs +0 -1
- package/dist/blockchain/wallets/index.d.cts +0 -20
- package/dist/blockchain/wallets/index.d.ts +0 -20
- package/dist/blockchain/wallets/index.js +0 -1
- package/dist/blockchain/wallets/paymaster.cjs +0 -1
- package/dist/blockchain/wallets/paymaster.d.cts +0 -29
- package/dist/blockchain/wallets/paymaster.d.ts +0 -29
- package/dist/blockchain/wallets/paymaster.js +0 -1
- package/dist/blockchain/wallets/service.cjs +0 -1
- package/dist/blockchain/wallets/service.d.cts +0 -41
- package/dist/blockchain/wallets/service.d.ts +0 -41
- package/dist/blockchain/wallets/service.js +0 -1
- package/dist/chunk-2R6HK64N.cjs +0 -1
- package/dist/chunk-3F6P4HUZ.js +0 -1
- package/dist/chunk-5FGSZZCU.js +0 -1
- package/dist/chunk-74J3L7KP.js +0 -1
- package/dist/chunk-76TIESKQ.cjs +0 -2
- package/dist/chunk-7AVDZZGD.cjs +0 -1
- package/dist/chunk-7COIRB4M.js +0 -1
- package/dist/chunk-ATQ4WGCW.js +0 -1
- package/dist/chunk-BJZQA5VC.js +0 -1
- package/dist/chunk-C3VZY7VJ.js +0 -1
- package/dist/chunk-CUTQYF3F.js +0 -1
- package/dist/chunk-D4NDUT36.js +0 -1
- package/dist/chunk-DHZVUAQA.js +0 -1
- package/dist/chunk-DIDKPOO2.cjs +0 -1
- package/dist/chunk-ERDSL6AZ.cjs +0 -1
- package/dist/chunk-ETVJGLNY.js +0 -1
- package/dist/chunk-FHNNZVNU.js +0 -1
- package/dist/chunk-GB35YMN4.cjs +0 -1
- package/dist/chunk-GVRCHWHG.js +0 -1
- package/dist/chunk-H4CMXNVK.js +0 -1
- package/dist/chunk-HN42GEK5.cjs +0 -3
- package/dist/chunk-ICKMQEHA.cjs +0 -1
- package/dist/chunk-IQTGPM2U.cjs +0 -1
- package/dist/chunk-KREX6Z32.js +0 -1
- package/dist/chunk-KYPTGHC6.cjs +0 -1
- package/dist/chunk-M4K3IZTT.cjs +0 -1
- package/dist/chunk-MECWQ5TQ.cjs +0 -1
- package/dist/chunk-MLZJIYAZ.js +0 -1
- package/dist/chunk-N64VSC3H.cjs +0 -1
- package/dist/chunk-NLGILHJS.js +0 -1
- package/dist/chunk-NQUKI27M.cjs +0 -1
- package/dist/chunk-O2ACORII.cjs +0 -1
- package/dist/chunk-OC3YNPRX.js +0 -3
- package/dist/chunk-OXRLBURF.js +0 -1
- package/dist/chunk-P5PDYDCW.js +0 -1
- package/dist/chunk-PZ6Q22YJ.js +0 -1
- package/dist/chunk-QBGECKSZ.cjs +0 -1
- package/dist/chunk-QQEJPZKN.cjs +0 -1
- package/dist/chunk-RLVETRLF.cjs +0 -1
- 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-UG47CBKR.js +0 -1
- package/dist/chunk-UL4HKRLD.js +0 -1
- package/dist/chunk-UPURFW46.js +0 -1
- package/dist/chunk-WJ6XJMRD.cjs +0 -1
- package/dist/chunk-XI4CDQWT.cjs +0 -1
- package/dist/chunk-XJGFG3RT.cjs +0 -1
- package/dist/chunk-XQ2K2K23.cjs +0 -1
- package/dist/chunk-YYGR7VFT.js +0 -2
- package/dist/service-DqYCir8s.d.ts +0 -103
- package/dist/service-Ir-Qho-9.d.cts +0 -103
- package/dist/types/internal.cjs +0 -1
- package/dist/types/internal.d.cts +0 -14
- package/dist/types/internal.d.ts +0 -14
- package/dist/types/internal.js +0 -1
- package/dist/types/params.d.cts +0 -33
- package/dist/types/params.d.ts +0 -33
- package/dist/types/schema.cjs +0 -1
- package/dist/types/schema.d.cts +0 -241
- package/dist/types/schema.d.ts +0 -241
- package/dist/types/schema.js +0 -1
- package/dist/types/service.d.cts +0 -14
- package/dist/types/service.d.ts +0 -14
- package/dist/types/token.cjs +0 -1
- package/dist/types/token.d.cts +0 -35
- package/dist/types/token.d.ts +0 -35
- package/dist/types/token.js +0 -0
- package/dist/utils/api.cjs +0 -1
- package/dist/utils/api.d.cts +0 -4
- package/dist/utils/api.d.ts +0 -4
- package/dist/utils/api.js +0 -1
- package/dist/utils/blockchain.cjs +0 -1
- package/dist/utils/blockchain.d.cts +0 -7
- package/dist/utils/blockchain.d.ts +0 -7
- package/dist/utils/blockchain.js +0 -1
- package/dist/utils/environment.cjs +0 -1
- package/dist/utils/environment.d.cts +0 -3
- package/dist/utils/environment.d.ts +0 -3
- package/dist/utils/environment.js +0 -1
- package/dist/utils/helpers.cjs +0 -1
- package/dist/utils/helpers.d.cts +0 -4
- package/dist/utils/helpers.d.ts +0 -4
- package/dist/utils/helpers.js +0 -1
- package/dist/utils/signer.cjs +0 -1
- package/dist/utils/signer.d.cts +0 -15
- package/dist/utils/signer.d.ts +0 -15
- package/dist/utils/signer.js +0 -1
- package/dist/utils/test.cjs +0 -1
- package/dist/utils/test.d.cts +0 -18
- package/dist/utils/test.d.ts +0 -18
- package/dist/utils/test.js +0 -1
- /package/dist/{chunk-HQXF6VHP.cjs → chunk-5URY3C2T.cjs} +0 -0
- /package/dist/{chunk-DYVHPARQ.js → chunk-KVFFSUF4.js} +0 -0
- /package/dist/{chunk-GPZ7PHS6.cjs → chunk-MFUN74KH.cjs} +0 -0
- /package/dist/{chunk-NT7LBRZQ.js → chunk-XLACPZJJ.js} +0 -0
- /package/dist/{blockchain/wallets → evm/chains}/definitions/story-testnet.d.cts +0 -0
- /package/dist/{blockchain/wallets → evm/chains}/definitions/story-testnet.d.ts +0 -0
- /package/dist/{blockchain/wallets → evm/chains}/definitions/story.d.cts +0 -0
- /package/dist/{blockchain/wallets → evm/chains}/definitions/story.d.ts +0 -0
- /package/dist/{blockchain/wallets/account/strategy.cjs → evm/smartWalletClient.cjs} +0 -0
- /package/dist/{blockchain/wallets/account/strategy.js → evm/smartWalletClient.js} +0 -0
- /package/dist/types/{params.cjs → api.cjs} +0 -0
- /package/dist/types/{params.js → api.js} +0 -0
- /package/dist/types/{service.cjs → transfer.cjs} +0 -0
- /package/dist/types/{service.js → transfer.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as f}from"./chunk-OWZ3LXVG.js";import"./chunk-5T3HB4Y6.js";import"./chunk-4SPA557P.js";import"./chunk-LJ43A5BN.js";import"./chunk-BCWZIVSQ.js";import"./chunk-Z3KARJF5.js";import"./chunk-2MQHIAJE.js";import"./chunk-75JNTS3U.js";import"./chunk-VEZ3PQGX.js";import"./chunk-XLACPZJJ.js";import"./chunk-KVFFSUF4.js";import{a as E}from"./chunk-DB2QM3HB.js";import{a as r,b as a,c as e,d as t,e as n,f as o,g as i,h as l,i as s,j as p,k as m,l as T}from"./chunk-UBRUUSMF.js";import"./chunk-NXTHA2ZL.js";import"./chunk-T5PL4ATW.js";import"./chunk-GGKMZPIA.js";import"./chunk-I5RZI2HB.js";import{blockchainToChainId as h,EVMBlockchainIncludingTestnet as x}from"@crossmint/common-sdk-base";export{x as Chain,E as EVMSmartWallet,a as InvalidApiKeyError,t as InvalidChainError,o as InvalidMessageFormatError,n as InvalidTransferChainError,l as InvalidTypedDataError,i as MessageSigningError,r as SmartWalletError,f as SmartWalletSDK,p as TransactionApprovalError,m as TransactionFailedError,T as TransactionNotFoundError,s as TypedDataSigningError,e as WalletCreationError,h as blockchainToChainId};
|
package/dist/sdk.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQ6YGAHDRcjs = require('./chunk-Q6YGAHDR.cjs');require('./chunk-D33JIUOQ.cjs');require('./chunk-ODAUWGUU.cjs');require('./chunk-Q23CHZRT.cjs');require('./chunk-SVGKSKZD.cjs');require('./chunk-U2JMKBCC.cjs');require('./chunk-AS5VIM5V.cjs');require('./chunk-23IWY6XV.cjs');require('./chunk-MLTT5BGD.cjs');require('./chunk-5URY3C2T.cjs');require('./chunk-MFUN74KH.cjs');require('./chunk-LPLLPZFU.cjs');require('./chunk-73LUJQGU.cjs');require('./chunk-4PMBBA3O.cjs');require('./chunk-EMZ5NAG2.cjs');require('./chunk-KXYDJTZS.cjs');require('./chunk-J5SRLI35.cjs');exports.SmartWalletSDK = _chunkQ6YGAHDRcjs.a;
|
|
@@ -1,24 +1,16 @@
|
|
|
1
|
-
import { SmartWalletChain } from './
|
|
2
|
-
import { EVMSmartWallet } from './
|
|
3
|
-
import { SmartWalletSDKInitParams, UserParams, WalletParams } from './types/params.js';
|
|
4
|
-
import 'viem/chains';
|
|
1
|
+
import { SmartWalletChain } from './evm/chains/index.cjs';
|
|
2
|
+
import { U as UserParams, W as WalletParams, a as EVMSmartWallet, P as PasskeySigner } from './apiService-Dum8A8_6.cjs';
|
|
5
3
|
import '@crossmint/common-sdk-base';
|
|
6
4
|
import 'viem';
|
|
7
|
-
import './api/CrossmintWalletService.js';
|
|
8
5
|
import '@crossmint/client-sdk-base';
|
|
9
|
-
import '
|
|
10
|
-
import '
|
|
11
|
-
import './
|
|
12
|
-
import '
|
|
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';
|
|
6
|
+
import 'ox';
|
|
7
|
+
import './types/api.cjs';
|
|
8
|
+
import './types/transfer.cjs';
|
|
9
|
+
import './evm/smartWalletClient.cjs';
|
|
21
10
|
|
|
11
|
+
interface SmartWalletSDKInitParams {
|
|
12
|
+
clientApiKey: string;
|
|
13
|
+
}
|
|
22
14
|
declare class SmartWalletSDK {
|
|
23
15
|
private readonly crossmintEnv;
|
|
24
16
|
private readonly smartWalletService;
|
|
@@ -27,9 +19,9 @@ declare class SmartWalletSDK {
|
|
|
27
19
|
private constructor();
|
|
28
20
|
/**
|
|
29
21
|
* Initializes the SDK with the **client side** API key obtained from the Crossmint console.
|
|
30
|
-
* @throws
|
|
22
|
+
* @throws {InvalidApiKeyError} if the api key is not formatted correctly.
|
|
31
23
|
*/
|
|
32
|
-
static init(
|
|
24
|
+
static init(params: SmartWalletSDKInitParams): SmartWalletSDK;
|
|
33
25
|
/**
|
|
34
26
|
* Retrieves or creates a wallet for the specified user.
|
|
35
27
|
* 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.
|
|
@@ -38,10 +30,15 @@ declare class SmartWalletSDK {
|
|
|
38
30
|
* ```ts
|
|
39
31
|
* const wallet = await smartWalletSDK.getOrCreateWallet({ jwt: "xxx" }, "base");
|
|
40
32
|
* ```
|
|
33
|
+
*
|
|
34
|
+
* @throws {SmartWalletError} if the SDK is used server side.
|
|
35
|
+
* @throws {InvalidChainError} if the chain is not valid.
|
|
36
|
+
* @throws {WalletCreationError} if the wallet creation fails.
|
|
41
37
|
*/
|
|
42
|
-
getOrCreateWallet(user: UserParams, chain: SmartWalletChain, walletParams
|
|
38
|
+
getOrCreateWallet(user: UserParams, chain: SmartWalletChain, walletParams: WalletParams): Promise<EVMSmartWallet>;
|
|
39
|
+
createPasskeySigner(name: string): Promise<PasskeySigner>;
|
|
43
40
|
private assertValidChain;
|
|
44
41
|
private validChain;
|
|
45
42
|
}
|
|
46
43
|
|
|
47
|
-
export { SmartWalletSDK };
|
|
44
|
+
export { SmartWalletSDK, type SmartWalletSDKInitParams };
|
|
@@ -1,24 +1,16 @@
|
|
|
1
|
-
import { SmartWalletChain } from './
|
|
2
|
-
import { EVMSmartWallet } from './
|
|
3
|
-
import { SmartWalletSDKInitParams, UserParams, WalletParams } from './types/params.cjs';
|
|
4
|
-
import 'viem/chains';
|
|
1
|
+
import { SmartWalletChain } from './evm/chains/index.js';
|
|
2
|
+
import { U as UserParams, W as WalletParams, a as EVMSmartWallet, P as PasskeySigner } from './apiService-D4DIxjMr.js';
|
|
5
3
|
import '@crossmint/common-sdk-base';
|
|
6
4
|
import 'viem';
|
|
7
|
-
import './api/CrossmintWalletService.cjs';
|
|
8
5
|
import '@crossmint/client-sdk-base';
|
|
9
|
-
import '
|
|
10
|
-
import '
|
|
11
|
-
import './
|
|
12
|
-
import '
|
|
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';
|
|
6
|
+
import 'ox';
|
|
7
|
+
import './types/api.js';
|
|
8
|
+
import './types/transfer.js';
|
|
9
|
+
import './evm/smartWalletClient.js';
|
|
21
10
|
|
|
11
|
+
interface SmartWalletSDKInitParams {
|
|
12
|
+
clientApiKey: string;
|
|
13
|
+
}
|
|
22
14
|
declare class SmartWalletSDK {
|
|
23
15
|
private readonly crossmintEnv;
|
|
24
16
|
private readonly smartWalletService;
|
|
@@ -27,9 +19,9 @@ declare class SmartWalletSDK {
|
|
|
27
19
|
private constructor();
|
|
28
20
|
/**
|
|
29
21
|
* Initializes the SDK with the **client side** API key obtained from the Crossmint console.
|
|
30
|
-
* @throws
|
|
22
|
+
* @throws {InvalidApiKeyError} if the api key is not formatted correctly.
|
|
31
23
|
*/
|
|
32
|
-
static init(
|
|
24
|
+
static init(params: SmartWalletSDKInitParams): SmartWalletSDK;
|
|
33
25
|
/**
|
|
34
26
|
* Retrieves or creates a wallet for the specified user.
|
|
35
27
|
* 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.
|
|
@@ -38,10 +30,15 @@ declare class SmartWalletSDK {
|
|
|
38
30
|
* ```ts
|
|
39
31
|
* const wallet = await smartWalletSDK.getOrCreateWallet({ jwt: "xxx" }, "base");
|
|
40
32
|
* ```
|
|
33
|
+
*
|
|
34
|
+
* @throws {SmartWalletError} if the SDK is used server side.
|
|
35
|
+
* @throws {InvalidChainError} if the chain is not valid.
|
|
36
|
+
* @throws {WalletCreationError} if the wallet creation fails.
|
|
41
37
|
*/
|
|
42
|
-
getOrCreateWallet(user: UserParams, chain: SmartWalletChain, walletParams
|
|
38
|
+
getOrCreateWallet(user: UserParams, chain: SmartWalletChain, walletParams: WalletParams): Promise<EVMSmartWallet>;
|
|
39
|
+
createPasskeySigner(name: string): Promise<PasskeySigner>;
|
|
43
40
|
private assertValidChain;
|
|
44
41
|
private validChain;
|
|
45
42
|
}
|
|
46
43
|
|
|
47
|
-
export { SmartWalletSDK };
|
|
44
|
+
export { SmartWalletSDK, type SmartWalletSDKInitParams };
|
package/dist/sdk.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-OWZ3LXVG.js";import"./chunk-5T3HB4Y6.js";import"./chunk-4SPA557P.js";import"./chunk-LJ43A5BN.js";import"./chunk-BCWZIVSQ.js";import"./chunk-Z3KARJF5.js";import"./chunk-2MQHIAJE.js";import"./chunk-75JNTS3U.js";import"./chunk-VEZ3PQGX.js";import"./chunk-XLACPZJJ.js";import"./chunk-KVFFSUF4.js";import"./chunk-DB2QM3HB.js";import"./chunk-UBRUUSMF.js";import"./chunk-NXTHA2ZL.js";import"./chunk-T5PL4ATW.js";import"./chunk-GGKMZPIA.js";import"./chunk-I5RZI2HB.js";export{a as SmartWalletSDK};
|
package/dist/services/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-ODAUWGUU.cjs');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-ODAUWGUU.cjs');var _chunkQ23CHZRTcjs = require('../chunk-Q23CHZRT.cjs');require('../chunk-EMZ5NAG2.cjs');exports.scwDatadogLogger = _chunkQ23CHZRTcjs.b; exports.scwLogger = _chunkQ23CHZRTcjs.a;
|
package/dist/services/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-4SPA557P.js";import{a,b}from"../chunk-
|
|
1
|
+
import"../chunk-4SPA557P.js";import{a,b}from"../chunk-LJ43A5BN.js";import"../chunk-T5PL4ATW.js";export{b as scwDatadogLogger,a as scwLogger};
|
package/dist/services/logger.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQ23CHZRTcjs = require('../chunk-Q23CHZRT.cjs');require('../chunk-EMZ5NAG2.cjs');exports.scwDatadogLogger = _chunkQ23CHZRTcjs.b; exports.scwLogger = _chunkQ23CHZRTcjs.a;
|
package/dist/services/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-LJ43A5BN.js";import"../chunk-T5PL4ATW.js";export{b as scwDatadogLogger,a as scwLogger};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkU2JMKBCCcjs = require('./chunk-U2JMKBCC.cjs');require('./chunk-AS5VIM5V.cjs');require('./chunk-23IWY6XV.cjs');require('./chunk-MLTT5BGD.cjs');require('./chunk-5URY3C2T.cjs');require('./chunk-MFUN74KH.cjs');require('./chunk-LPLLPZFU.cjs');require('./chunk-73LUJQGU.cjs');require('./chunk-4PMBBA3O.cjs');require('./chunk-EMZ5NAG2.cjs');require('./chunk-KXYDJTZS.cjs');require('./chunk-J5SRLI35.cjs');exports.SmartWalletService = _chunkU2JMKBCCcjs.a;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import 'viem';
|
|
2
|
+
import 'ox';
|
|
3
|
+
export { E as ExternalSigner, P as PasskeySigner, S as SmartWalletService, U as UserParams, V as ViemAccount, W as WalletParams } from './apiService-Dum8A8_6.cjs';
|
|
4
|
+
import './evm/chains/index.cjs';
|
|
5
|
+
import '@crossmint/common-sdk-base';
|
|
6
|
+
import '@crossmint/client-sdk-base';
|
|
7
|
+
import './types/api.cjs';
|
|
8
|
+
import './types/transfer.cjs';
|
|
9
|
+
import './evm/smartWalletClient.cjs';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import 'viem';
|
|
2
|
+
import 'ox';
|
|
3
|
+
export { E as ExternalSigner, P as PasskeySigner, S as SmartWalletService, U as UserParams, V as ViemAccount, W as WalletParams } from './apiService-D4DIxjMr.js';
|
|
4
|
+
import './evm/chains/index.js';
|
|
5
|
+
import '@crossmint/common-sdk-base';
|
|
6
|
+
import '@crossmint/client-sdk-base';
|
|
7
|
+
import './types/api.js';
|
|
8
|
+
import './types/transfer.js';
|
|
9
|
+
import './evm/smartWalletClient.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-Z3KARJF5.js";import"./chunk-2MQHIAJE.js";import"./chunk-75JNTS3U.js";import"./chunk-VEZ3PQGX.js";import"./chunk-XLACPZJJ.js";import"./chunk-KVFFSUF4.js";import"./chunk-DB2QM3HB.js";import"./chunk-UBRUUSMF.js";import"./chunk-NXTHA2ZL.js";import"./chunk-T5PL4ATW.js";import"./chunk-GGKMZPIA.js";import"./chunk-I5RZI2HB.js";export{a as SmartWalletService};
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { BlockchainIncludingTestnet } from '@crossmint/common-sdk-base';
|
|
2
|
+
import { Address, Hex, TypedDataDomain, TypedData } from 'viem';
|
|
3
|
+
import { SmartWalletChain } from '../evm/chains/index.cjs';
|
|
4
|
+
|
|
5
|
+
type Signer = `evm-keypair:${Address}` | `evm-passkey:${string}`;
|
|
6
|
+
interface CreateWalletParams {
|
|
7
|
+
type: "evm-smart-wallet";
|
|
8
|
+
config: {
|
|
9
|
+
adminSigner: {
|
|
10
|
+
type: "evm-keypair";
|
|
11
|
+
address: Address;
|
|
12
|
+
} | {
|
|
13
|
+
type: "evm-passkey";
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
publicKey: {
|
|
17
|
+
x: Hex;
|
|
18
|
+
y: Hex;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
interface CreateWalletResponse {
|
|
24
|
+
type: "evm-smart-wallet";
|
|
25
|
+
linkedUser: string;
|
|
26
|
+
address: Address;
|
|
27
|
+
config: {
|
|
28
|
+
adminSigner: {
|
|
29
|
+
type: "evm-keypair";
|
|
30
|
+
locator: `evm-keypair:${Address}`;
|
|
31
|
+
address: Address;
|
|
32
|
+
} | {
|
|
33
|
+
type: "evm-passkey";
|
|
34
|
+
locator: `evm-passkey:${string}`;
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
publicKey: {
|
|
38
|
+
x: Hex;
|
|
39
|
+
y: Hex;
|
|
40
|
+
};
|
|
41
|
+
validatorContractVersion: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
interface TransactionCall {
|
|
46
|
+
to: Address;
|
|
47
|
+
value: string;
|
|
48
|
+
data: Hex;
|
|
49
|
+
}
|
|
50
|
+
interface CreateTransactionParams {
|
|
51
|
+
params: {
|
|
52
|
+
signer: Signer;
|
|
53
|
+
chain: SmartWalletChain;
|
|
54
|
+
calls: TransactionCall[];
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
interface TransactionResponse {
|
|
58
|
+
id: string;
|
|
59
|
+
walletType: "evm-smart-wallet";
|
|
60
|
+
status: "awaiting-approval" | "pending" | "failed" | "success";
|
|
61
|
+
approvals: {
|
|
62
|
+
pending: {
|
|
63
|
+
message: Hex;
|
|
64
|
+
signer: Signer;
|
|
65
|
+
}[];
|
|
66
|
+
submitted: {
|
|
67
|
+
message: Hex;
|
|
68
|
+
signature: Hex;
|
|
69
|
+
signer: Signer;
|
|
70
|
+
}[];
|
|
71
|
+
};
|
|
72
|
+
onChain: {
|
|
73
|
+
userOperationHash: Hex;
|
|
74
|
+
txId?: Hex;
|
|
75
|
+
};
|
|
76
|
+
error?: {
|
|
77
|
+
message: string;
|
|
78
|
+
reason: "execution_reverted";
|
|
79
|
+
revert: {
|
|
80
|
+
type: "contract_call" | "wallet_authorization" | "wallet_deployment";
|
|
81
|
+
reason: string;
|
|
82
|
+
reasonData?: string;
|
|
83
|
+
explorerLink?: string;
|
|
84
|
+
simulationLink?: string;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
type Approval = {
|
|
89
|
+
signer: `evm-keypair:${Address}`;
|
|
90
|
+
signature: Hex;
|
|
91
|
+
} | {
|
|
92
|
+
signer: `evm-passkey:${string}`;
|
|
93
|
+
signature: {
|
|
94
|
+
r: Hex;
|
|
95
|
+
s: Hex;
|
|
96
|
+
};
|
|
97
|
+
metadata: {
|
|
98
|
+
authenticatorData: Hex;
|
|
99
|
+
challengeIndex: number;
|
|
100
|
+
clientDataJSON: string;
|
|
101
|
+
typeIndex: number;
|
|
102
|
+
userVerificationRequired: boolean;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
interface ApproveTransactionParams {
|
|
106
|
+
approvals: Approval[];
|
|
107
|
+
}
|
|
108
|
+
type CreateSignatureParams = {
|
|
109
|
+
type: "evm-message";
|
|
110
|
+
params: {
|
|
111
|
+
message: string;
|
|
112
|
+
signer: Signer;
|
|
113
|
+
chain: SmartWalletChain;
|
|
114
|
+
};
|
|
115
|
+
} | {
|
|
116
|
+
type: "evm-typed-data";
|
|
117
|
+
params: {
|
|
118
|
+
chain: SmartWalletChain;
|
|
119
|
+
signer: Signer;
|
|
120
|
+
isSmartWalletSignature: boolean;
|
|
121
|
+
typedData: {
|
|
122
|
+
domain: TypedDataDomain;
|
|
123
|
+
message: Record<string, unknown>;
|
|
124
|
+
primaryType: string;
|
|
125
|
+
types: TypedData;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
interface SignatureResponseBase {
|
|
130
|
+
id: string;
|
|
131
|
+
walletType: "evm-smart-wallet";
|
|
132
|
+
status: "awaiting-approval" | "pending" | "failed" | "success";
|
|
133
|
+
approvals: {
|
|
134
|
+
pending: {
|
|
135
|
+
signer: Signer;
|
|
136
|
+
message: Hex;
|
|
137
|
+
}[];
|
|
138
|
+
submitted: {
|
|
139
|
+
signer: Signer;
|
|
140
|
+
signature: Hex;
|
|
141
|
+
message: Hex;
|
|
142
|
+
}[];
|
|
143
|
+
};
|
|
144
|
+
createdAt: string;
|
|
145
|
+
}
|
|
146
|
+
interface ApproveSignatureParams {
|
|
147
|
+
approvals: Approval[];
|
|
148
|
+
}
|
|
149
|
+
interface SignatureResponseMessage extends SignatureResponseBase {
|
|
150
|
+
type: "evm-message";
|
|
151
|
+
params: {
|
|
152
|
+
message: string;
|
|
153
|
+
signer: Signer;
|
|
154
|
+
chain: SmartWalletChain;
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
interface SignatureResponseTypedData extends SignatureResponseBase {
|
|
158
|
+
type: "evm-typed-data";
|
|
159
|
+
params: {
|
|
160
|
+
chain: SmartWalletChain;
|
|
161
|
+
signer: Signer;
|
|
162
|
+
isSmartWalletSignature: boolean;
|
|
163
|
+
typedData: {
|
|
164
|
+
domain: TypedDataDomain;
|
|
165
|
+
message: Record<string, unknown>;
|
|
166
|
+
primaryType: string;
|
|
167
|
+
types: Record<string, unknown>;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
type SignatureResponse = SignatureResponseMessage | SignatureResponseTypedData;
|
|
172
|
+
type NftResponse = {
|
|
173
|
+
chain: BlockchainIncludingTestnet;
|
|
174
|
+
contractAddress: Address;
|
|
175
|
+
tokenId: string;
|
|
176
|
+
metadata: {
|
|
177
|
+
attributes: {
|
|
178
|
+
display_type: string | null;
|
|
179
|
+
trait_type: string;
|
|
180
|
+
value: string;
|
|
181
|
+
}[];
|
|
182
|
+
collection: unknown;
|
|
183
|
+
description: string;
|
|
184
|
+
image: string;
|
|
185
|
+
animation_url: string | null;
|
|
186
|
+
name: string;
|
|
187
|
+
};
|
|
188
|
+
subscription?: {
|
|
189
|
+
expiresAt: string;
|
|
190
|
+
};
|
|
191
|
+
locator: string;
|
|
192
|
+
tokenStandard: string;
|
|
193
|
+
}[];
|
|
194
|
+
|
|
195
|
+
export type { ApproveSignatureParams, ApproveTransactionParams, CreateSignatureParams, CreateTransactionParams, CreateWalletParams, CreateWalletResponse, NftResponse, SignatureResponse, SignatureResponseMessage, SignatureResponseTypedData, Signer, TransactionResponse };
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { BlockchainIncludingTestnet } from '@crossmint/common-sdk-base';
|
|
2
|
+
import { Address, Hex, TypedDataDomain, TypedData } from 'viem';
|
|
3
|
+
import { SmartWalletChain } from '../evm/chains/index.js';
|
|
4
|
+
|
|
5
|
+
type Signer = `evm-keypair:${Address}` | `evm-passkey:${string}`;
|
|
6
|
+
interface CreateWalletParams {
|
|
7
|
+
type: "evm-smart-wallet";
|
|
8
|
+
config: {
|
|
9
|
+
adminSigner: {
|
|
10
|
+
type: "evm-keypair";
|
|
11
|
+
address: Address;
|
|
12
|
+
} | {
|
|
13
|
+
type: "evm-passkey";
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
publicKey: {
|
|
17
|
+
x: Hex;
|
|
18
|
+
y: Hex;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
interface CreateWalletResponse {
|
|
24
|
+
type: "evm-smart-wallet";
|
|
25
|
+
linkedUser: string;
|
|
26
|
+
address: Address;
|
|
27
|
+
config: {
|
|
28
|
+
adminSigner: {
|
|
29
|
+
type: "evm-keypair";
|
|
30
|
+
locator: `evm-keypair:${Address}`;
|
|
31
|
+
address: Address;
|
|
32
|
+
} | {
|
|
33
|
+
type: "evm-passkey";
|
|
34
|
+
locator: `evm-passkey:${string}`;
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
publicKey: {
|
|
38
|
+
x: Hex;
|
|
39
|
+
y: Hex;
|
|
40
|
+
};
|
|
41
|
+
validatorContractVersion: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
interface TransactionCall {
|
|
46
|
+
to: Address;
|
|
47
|
+
value: string;
|
|
48
|
+
data: Hex;
|
|
49
|
+
}
|
|
50
|
+
interface CreateTransactionParams {
|
|
51
|
+
params: {
|
|
52
|
+
signer: Signer;
|
|
53
|
+
chain: SmartWalletChain;
|
|
54
|
+
calls: TransactionCall[];
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
interface TransactionResponse {
|
|
58
|
+
id: string;
|
|
59
|
+
walletType: "evm-smart-wallet";
|
|
60
|
+
status: "awaiting-approval" | "pending" | "failed" | "success";
|
|
61
|
+
approvals: {
|
|
62
|
+
pending: {
|
|
63
|
+
message: Hex;
|
|
64
|
+
signer: Signer;
|
|
65
|
+
}[];
|
|
66
|
+
submitted: {
|
|
67
|
+
message: Hex;
|
|
68
|
+
signature: Hex;
|
|
69
|
+
signer: Signer;
|
|
70
|
+
}[];
|
|
71
|
+
};
|
|
72
|
+
onChain: {
|
|
73
|
+
userOperationHash: Hex;
|
|
74
|
+
txId?: Hex;
|
|
75
|
+
};
|
|
76
|
+
error?: {
|
|
77
|
+
message: string;
|
|
78
|
+
reason: "execution_reverted";
|
|
79
|
+
revert: {
|
|
80
|
+
type: "contract_call" | "wallet_authorization" | "wallet_deployment";
|
|
81
|
+
reason: string;
|
|
82
|
+
reasonData?: string;
|
|
83
|
+
explorerLink?: string;
|
|
84
|
+
simulationLink?: string;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
type Approval = {
|
|
89
|
+
signer: `evm-keypair:${Address}`;
|
|
90
|
+
signature: Hex;
|
|
91
|
+
} | {
|
|
92
|
+
signer: `evm-passkey:${string}`;
|
|
93
|
+
signature: {
|
|
94
|
+
r: Hex;
|
|
95
|
+
s: Hex;
|
|
96
|
+
};
|
|
97
|
+
metadata: {
|
|
98
|
+
authenticatorData: Hex;
|
|
99
|
+
challengeIndex: number;
|
|
100
|
+
clientDataJSON: string;
|
|
101
|
+
typeIndex: number;
|
|
102
|
+
userVerificationRequired: boolean;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
interface ApproveTransactionParams {
|
|
106
|
+
approvals: Approval[];
|
|
107
|
+
}
|
|
108
|
+
type CreateSignatureParams = {
|
|
109
|
+
type: "evm-message";
|
|
110
|
+
params: {
|
|
111
|
+
message: string;
|
|
112
|
+
signer: Signer;
|
|
113
|
+
chain: SmartWalletChain;
|
|
114
|
+
};
|
|
115
|
+
} | {
|
|
116
|
+
type: "evm-typed-data";
|
|
117
|
+
params: {
|
|
118
|
+
chain: SmartWalletChain;
|
|
119
|
+
signer: Signer;
|
|
120
|
+
isSmartWalletSignature: boolean;
|
|
121
|
+
typedData: {
|
|
122
|
+
domain: TypedDataDomain;
|
|
123
|
+
message: Record<string, unknown>;
|
|
124
|
+
primaryType: string;
|
|
125
|
+
types: TypedData;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
interface SignatureResponseBase {
|
|
130
|
+
id: string;
|
|
131
|
+
walletType: "evm-smart-wallet";
|
|
132
|
+
status: "awaiting-approval" | "pending" | "failed" | "success";
|
|
133
|
+
approvals: {
|
|
134
|
+
pending: {
|
|
135
|
+
signer: Signer;
|
|
136
|
+
message: Hex;
|
|
137
|
+
}[];
|
|
138
|
+
submitted: {
|
|
139
|
+
signer: Signer;
|
|
140
|
+
signature: Hex;
|
|
141
|
+
message: Hex;
|
|
142
|
+
}[];
|
|
143
|
+
};
|
|
144
|
+
createdAt: string;
|
|
145
|
+
}
|
|
146
|
+
interface ApproveSignatureParams {
|
|
147
|
+
approvals: Approval[];
|
|
148
|
+
}
|
|
149
|
+
interface SignatureResponseMessage extends SignatureResponseBase {
|
|
150
|
+
type: "evm-message";
|
|
151
|
+
params: {
|
|
152
|
+
message: string;
|
|
153
|
+
signer: Signer;
|
|
154
|
+
chain: SmartWalletChain;
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
interface SignatureResponseTypedData extends SignatureResponseBase {
|
|
158
|
+
type: "evm-typed-data";
|
|
159
|
+
params: {
|
|
160
|
+
chain: SmartWalletChain;
|
|
161
|
+
signer: Signer;
|
|
162
|
+
isSmartWalletSignature: boolean;
|
|
163
|
+
typedData: {
|
|
164
|
+
domain: TypedDataDomain;
|
|
165
|
+
message: Record<string, unknown>;
|
|
166
|
+
primaryType: string;
|
|
167
|
+
types: Record<string, unknown>;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
type SignatureResponse = SignatureResponseMessage | SignatureResponseTypedData;
|
|
172
|
+
type NftResponse = {
|
|
173
|
+
chain: BlockchainIncludingTestnet;
|
|
174
|
+
contractAddress: Address;
|
|
175
|
+
tokenId: string;
|
|
176
|
+
metadata: {
|
|
177
|
+
attributes: {
|
|
178
|
+
display_type: string | null;
|
|
179
|
+
trait_type: string;
|
|
180
|
+
value: string;
|
|
181
|
+
}[];
|
|
182
|
+
collection: unknown;
|
|
183
|
+
description: string;
|
|
184
|
+
image: string;
|
|
185
|
+
animation_url: string | null;
|
|
186
|
+
name: string;
|
|
187
|
+
};
|
|
188
|
+
subscription?: {
|
|
189
|
+
expiresAt: string;
|
|
190
|
+
};
|
|
191
|
+
locator: string;
|
|
192
|
+
tokenStandard: string;
|
|
193
|
+
}[];
|
|
194
|
+
|
|
195
|
+
export type { ApproveSignatureParams, ApproveTransactionParams, CreateSignatureParams, CreateTransactionParams, CreateWalletParams, CreateWalletResponse, NftResponse, SignatureResponse, SignatureResponseMessage, SignatureResponseTypedData, Signer, TransactionResponse };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Address, Abi } from 'viem';
|
|
2
|
+
import { SmartWalletChain } from '../evm/chains/index.cjs';
|
|
3
|
+
import '@crossmint/common-sdk-base';
|
|
4
|
+
|
|
5
|
+
interface EVMToken {
|
|
6
|
+
chain: SmartWalletChain;
|
|
7
|
+
contractAddress: Address;
|
|
8
|
+
}
|
|
9
|
+
interface NFTEVMToken extends EVMToken {
|
|
10
|
+
tokenId: string;
|
|
11
|
+
type: "nft";
|
|
12
|
+
}
|
|
13
|
+
interface SFTEVMToken extends EVMToken {
|
|
14
|
+
tokenId: string;
|
|
15
|
+
type: "sft";
|
|
16
|
+
}
|
|
17
|
+
interface ERC2OEVMToken extends EVMToken {
|
|
18
|
+
type: "ft";
|
|
19
|
+
}
|
|
20
|
+
interface ERC20TransferType {
|
|
21
|
+
token: ERC2OEVMToken;
|
|
22
|
+
amount: bigint;
|
|
23
|
+
}
|
|
24
|
+
interface SFTTransferType {
|
|
25
|
+
token: SFTEVMToken;
|
|
26
|
+
quantity: number;
|
|
27
|
+
}
|
|
28
|
+
interface NFTTransferType {
|
|
29
|
+
token: NFTEVMToken;
|
|
30
|
+
}
|
|
31
|
+
type TransferType = ERC20TransferType | SFTTransferType | NFTTransferType;
|
|
32
|
+
interface TransferInputParams {
|
|
33
|
+
from: Address;
|
|
34
|
+
contract: Address;
|
|
35
|
+
to: Address;
|
|
36
|
+
config: TransferType;
|
|
37
|
+
}
|
|
38
|
+
interface TransferSimulationParams {
|
|
39
|
+
address: Address;
|
|
40
|
+
abi: Abi;
|
|
41
|
+
functionName: string;
|
|
42
|
+
args: unknown[];
|
|
43
|
+
tokenId?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type { ERC20TransferType, NFTTransferType, SFTTransferType, TransferInputParams, TransferSimulationParams, TransferType };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Address, Abi } from 'viem';
|
|
2
|
+
import { SmartWalletChain } from '../evm/chains/index.js';
|
|
3
|
+
import '@crossmint/common-sdk-base';
|
|
4
|
+
|
|
5
|
+
interface EVMToken {
|
|
6
|
+
chain: SmartWalletChain;
|
|
7
|
+
contractAddress: Address;
|
|
8
|
+
}
|
|
9
|
+
interface NFTEVMToken extends EVMToken {
|
|
10
|
+
tokenId: string;
|
|
11
|
+
type: "nft";
|
|
12
|
+
}
|
|
13
|
+
interface SFTEVMToken extends EVMToken {
|
|
14
|
+
tokenId: string;
|
|
15
|
+
type: "sft";
|
|
16
|
+
}
|
|
17
|
+
interface ERC2OEVMToken extends EVMToken {
|
|
18
|
+
type: "ft";
|
|
19
|
+
}
|
|
20
|
+
interface ERC20TransferType {
|
|
21
|
+
token: ERC2OEVMToken;
|
|
22
|
+
amount: bigint;
|
|
23
|
+
}
|
|
24
|
+
interface SFTTransferType {
|
|
25
|
+
token: SFTEVMToken;
|
|
26
|
+
quantity: number;
|
|
27
|
+
}
|
|
28
|
+
interface NFTTransferType {
|
|
29
|
+
token: NFTEVMToken;
|
|
30
|
+
}
|
|
31
|
+
type TransferType = ERC20TransferType | SFTTransferType | NFTTransferType;
|
|
32
|
+
interface TransferInputParams {
|
|
33
|
+
from: Address;
|
|
34
|
+
contract: Address;
|
|
35
|
+
to: Address;
|
|
36
|
+
config: TransferType;
|
|
37
|
+
}
|
|
38
|
+
interface TransferSimulationParams {
|
|
39
|
+
address: Address;
|
|
40
|
+
abi: Abi;
|
|
41
|
+
functionName: string;
|
|
42
|
+
args: unknown[];
|
|
43
|
+
tokenId?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type { ERC20TransferType, NFTTransferType, SFTTransferType, TransferInputParams, TransferSimulationParams, TransferType };
|