@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
package/dist/chunk-FHNNZVNU.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-UPURFW46.js";import{providerToSmartAccountSigner as n}from"permissionless";async function m({walletParams:r}){if(i(r.signer))return await n(r.signer);if(o(r.signer))return r.signer.account;{let t=r.signer;throw new e(`The signer type ${t.type} is not supported`)}}function i(r){return r&&typeof r.request=="function"}function o(r){return r&&r.type==="VIEM_ACCOUNT"}export{m as a,o as b};
|
package/dist/chunk-FIJ3CBJ4.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{c as i,d as s,f as n}from"./chunk-XP6ESWVJ.js";import{b as a,h as t}from"./chunk-UPURFW46.js";var o=class{constructor(e,r){this.eoaStrategy=e;this.passkeyStrategy=r}get(e){if(s(e))return this.passkeyStrategy.create(e);if(n(e))return this.eoaStrategy.create(e);if(e.existing==null)throw new t(`Unsupported wallet params:
|
|
2
|
-
${e.walletParams}`);let r=e.existing.signerConfig.display(),y=i(e.walletParams)?"passkey":"eoa";throw new a(`Cannot create wallet with ${y} signer for user ${e.user.id}', they already have a wallet with signer:
|
|
3
|
-
'${JSON.stringify(r,null,2)}'`,r)}};export{o as a};
|
package/dist/chunk-G57LROTD.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as l}from"./chunk-CPYNP4XI.js";import{keccak256 as o,toHex as i}from"viem";var s=class{constructor(e){this.keyPrefix=e}set(e,t){localStorage.setItem(this.key(e),JSON.stringify(t))}get(e){let t=this.key(e),r=localStorage.getItem(t);if(r==null)return null;let a=l.safeParse(JSON.parse(r));return a.success?a.data:(localStorage.removeItem(t),null)}clear(){for(let e=0;e<localStorage.length;e++){let t=localStorage.key(e);t&&t.startsWith(this.keyPrefix)&&(localStorage.removeItem(t),e--)}}key(e){return`${this.keyPrefix}-${o(i(e.jwt))}`}};export{s as a};
|
package/dist/chunk-GB35YMN4.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var e=class{constructor(a){this.type="passkeys";this.data=a}display(){return{pubKeyX:this.data.pubKeyX,pubKeyY:this.data.pubKeyY,passkeyName:this.data.passkeyName,type:this.type}}},t= exports.b =class{constructor(a){this.type="eoa";this.data=a}display(){return this.data}};exports.a = e; exports.b = t;
|
package/dist/chunk-H4CMXNVK.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as P}from"./chunk-BJZQA5VC.js";import{c as u,e as p,f as l,g as m}from"./chunk-UPURFW46.js";import{PasskeyValidatorContractVersion as S,WebAuthnMode as h,toPasskeyValidator as A}from"@zerodev/passkey-validator";import{createKernelAccount as E}from"@zerodev/sdk";import{toWebAuthnKey as w}from"@zerodev/webauthn-key";var f=class{constructor(e,t){this.passkeyServerUrl=e;this.apiKey=t}async create({user:e,publicClient:t,walletParams:r,entryPoint:c,kernelVersion:i,existing:a}){let n=r.signer.passkeyName??e.id;if(a!=null&&a.signerConfig.data.passkeyName!==n)throw new u(`User '${e.id}' has an existing wallet created with a passkey named '${a.signerConfig.data.passkeyName}', this does match input passkey name '${n}'.`,a.signerConfig.display());try{a==null&&r.signer.onPrePasskeyRegistration!=null&&await r.signer.onPrePasskeyRegistration();let s=await this.getPasskey(e,n,a?.signerConfig.data),g=S.V0_0_2,d=a==null?g:a.signerConfig.data.validatorContractVersion,y=await A(t,{webAuthnKey:s,entryPoint:c,validatorContractVersion:d,kernelVersion:i}),k=await E(t,{plugins:{sudo:y},entryPoint:c,kernelVersion:i,deployedAccountAddress:a?.address});return{signerConfig:this.getSignerConfig(y,d,n),account:this.decorate(k,n,r)}}catch(s){throw r.signer.onPasskeyRegistrationError!=null&&r.signer.onPasskeyRegistrationError(s),this.mapError(s,n)}}async getPasskey(e,t,r){return r!=null?{pubX:BigInt(r.pubKeyX),pubY:BigInt(r.pubKeyY),authenticatorId:r.authenticatorId,authenticatorIdHash:r.authenticatorIdHash}:w({passkeyName:t,passkeyServerUrl:this.passkeyServerUrl,mode:h.Register,passkeyServerHeaders:this.createPasskeysServerHeaders(e)})}getSignerConfig(e,t,r){return new P({...V(e.getSerializedData()),passkeyName:r,validatorContractVersion:t,domain:window.location.hostname,type:"passkeys"})}createPasskeysServerHeaders(e){return{"x-api-key":this.apiKey,Authorization:`Bearer ${e.jwt}`}}mapError(e,t){return e.code===0&&e.name==="DataError"?new m(t):e.message==="Registration not verified"?new l(t):e.code==="ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY"&&e.name==="NotAllowedError"?new p(t):e}decorate(e,t,r){return new Proxy(e,{get:(c,i,a)=>{let n=Reflect.get(c,i,a);if(typeof n!="function"||typeof i!="string"||!v(i))return n;let s=r.signer;return async(...g)=>{g?.[0]?.factoryData!=null&&i==="signUserOperation"&&s.type==="PASSKEY"&&s.onFirstTimePasskeySigning!=null&&await s.onFirstTimePasskeySigning();try{return await n.call(c,...g)}catch(y){throw s.onFirstTimePasskeySigningError!=null&&await s.onFirstTimePasskeySigningError(y),this.mapError(y,t)}}}})}},C=["signMessage","signTypedData","signUserOperation","signTransaction"];function v(o){return C.includes(o)}var V=o=>{let e=b(o),t=new TextDecoder().decode(e);return JSON.parse(t)};function b(o){let e=atob(o);return Uint8Array.from(e,t=>t.codePointAt(0))}export{f as a};
|
package/dist/chunk-IQTGPM2U.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWJ6XJMRDcjs = require('./chunk-WJ6XJMRD.cjs');function p(r){return!_chunkWJ6XJMRDcjs.a.call(void 0, r)}function c({bundlerClient:r,entryPoint:t,chain:i,walletService:s,user:n}){return{middleware:{gasPrice:async()=>(await r.getUserOperationGasPrice()).fast,sponsorUserOperation:async({userOperation:a})=>{let{sponsorUserOpParams:o}=await s.sponsorUserOperation(n,a,t,i);return o}}}}exports.a = p; exports.b = c;
|
package/dist/chunk-KYPTGHC6.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _viem = require('viem');var s=[{inputs:[{internalType:"string",name:"uri_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}];function l({contract:t,config:e,from:n,to:a}){switch(e.token.type){case"ft":return{account:n,address:t,abi:_viem.erc20Abi,functionName:"transfer",args:[a,e.amount]};case"sft":return{account:n,address:t,abi:s,functionName:"safeTransferFrom",args:[n.address,a,e.token.tokenId,e.quantity,"0x00"],tokenId:e.token.tokenId};case"nft":return{account:n,address:t,abi:_viem.erc721Abi,functionName:"safeTransferFrom",args:[n.address,a,e.token.tokenId],tokenId:e.token.tokenId}}}exports.a = l;
|
package/dist/chunk-LMVY4C4Y.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as f,b as S}from"./chunk-NLGILHJS.js";import{a as d}from"./chunk-ETVJGLNY.js";import{i as C}from"./chunk-YBHSEZMB.js";import{b as y,c as u}from"./chunk-TZG6MROQ.js";import{a as m,b as p}from"./chunk-WDM7PN4O.js";import{ENTRYPOINT_ADDRESS_V06 as W,ENTRYPOINT_ADDRESS_V07 as A,createSmartAccountClient as E}from"permissionless";import{createPimlicoBundlerClient as h}from"permissionless/clients/pimlico";import{createPublicClient as D,http as P}from"viem";import{blockchainToChainId as R}from"@crossmint/common-sdk-base";var v=class{constructor(r,t,i,e){this.crossmintService=r;this.accountConfigService=t;this.accountCreator=i;this.clientDecorator=e}async getOrCreate(r,t,i){let{config:{entryPointVersion:e,kernelVersion:o,existing:n,userWithId:a},cached:g}=await this.accountConfigService.get(r,t),c=D({transport:P(y(t))}),{account:s,signerConfig:l}=await this.accountCreator.get({chain:t,walletParams:i,publicClient:c,user:a,entryPoint:e==="v0.6"?W:A,kernelVersion:o,existing:n});return n==null&&await this.crossmintService.idempotentCreateSmartWallet(r,{type:m,smartContractWalletAddress:s.address,signerData:l.data,version:p,baseLayer:"evm",chainId:R(t),entryPointVersion:e,kernelVersion:o}),g||this.accountConfigService.cache({entryPointVersion:e,kernelVersion:o,user:a,existing:{address:s.address,signerConfig:l}}),new d({wallet:this.smartAccountClient(t,s,r),public:c},t,this.crossmintService)}smartAccountClient(r,t,i){let e=P(u(r)),o={chain:C[r],entryPoint:t.entryPoint},n=h({...o,transport:e}),a=E({account:t,bundlerTransport:e,...o,...f(r)&&S({bundlerClient:n,entryPoint:t.entryPoint,chain:r,walletService:this.crossmintService,user:i})});return this.clientDecorator.decorate({crossmintChain:r,smartAccountClient:a})}};export{v as a};
|
package/dist/chunk-M4K3IZTT.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _clientsdkbase = require('@crossmint/client-sdk-base');var r=class extends _clientsdkbase.CrossmintSDKError{constructor(e,i,n=_clientsdkbase.SmartWalletErrorCode.UNCATEGORIZED){super(e,n,i)}},a= exports.b =class extends r{constructor(e,i,n){super(e,_clientsdkbase.SmartWalletErrorCode.ADMIN_MISMATCH),this.required=i,this.used=n}},p= exports.c =class extends r{constructor(e,i,n){super(e,_clientsdkbase.SmartWalletErrorCode.PASSKEY_MISMATCH),this.required=i,this.used=n}},l= exports.d =class extends r{constructor(i){super(`The user with userId ${i.toString()} already has a wallet created for this project`);this.code=_clientsdkbase.SmartWalletErrorCode.USER_WALLET_ALREADY_CREATED}},c= exports.e =class extends r{constructor(e){super(`Prompt was either cancelled or timed out for passkey ${e}`,void 0,_clientsdkbase.SmartWalletErrorCode.PASSKEY_PROMPT),this.passkeyName=e}},u= exports.f =class extends r{constructor(e){super(`Registration for passkey ${e} failed, either the registration took too long, or passkey signature vaildation failed.`,void 0,_clientsdkbase.SmartWalletErrorCode.PASSKEY_REGISTRATION),this.passkeyName=e}},d= exports.g =class extends r{constructor(e){super(`User selected authenticator for passkey ${e} is not compatible with Crossmint's Smart Wallets.`,void 0,_clientsdkbase.SmartWalletErrorCode.PASSKEY_INCOMPATIBLE_AUTHENTICATOR),this.passkeyName=e}},o= exports.h =class extends r{constructor(e){super(e,void 0,_clientsdkbase.SmartWalletErrorCode.WALLET_CONFIG)}},y= exports.i =class extends o{constructor(){super("This signer was already used to create another wallet. Please use a different signer.");this.code=_clientsdkbase.SmartWalletErrorCode.ADMIN_SIGNER_ALREADY_USED}},S= exports.j =class extends o{constructor(){super("Smart wallets are not enabled for this project. They can be enabled on the project settings page in the developer console.");this.code=_clientsdkbase.SmartWalletErrorCode.SMART_WALLETS_NOT_ENABLED}};exports.a = r; exports.b = a; exports.c = p; exports.d = l; exports.e = c; exports.f = u; exports.g = d; exports.h = o; exports.i = y; exports.j = S;
|
package/dist/chunk-NLGILHJS.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-C3VZY7VJ.js";function c(r){return!e(r)}function y({bundlerClient:r,entryPoint:t,chain:i,walletService:s,user:n}){return{middleware:{gasPrice:async()=>(await r.getUserOperationGasPrice()).fast,sponsorUserOperation:async({userOperation:a})=>{let{sponsorUserOpParams:o}=await s.sponsorUserOperation(n,a,t,i);return o}}}}export{c as a,y as b};
|
package/dist/chunk-O2ACORII.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGB35YMN4cjs = require('./chunk-GB35YMN4.cjs');var _chunkM4K3IZTTcjs = require('./chunk-M4K3IZTT.cjs');var p=class{constructor(t,e){this.crossmintService=t;this.configCache=e}async get(t,e){let i=this.configCache.get(t);if(i!=null)return{config:this.validateAndFormat(t,i),cached:!0};let r=await this.crossmintService.getSmartWalletConfig(t,e);return{config:this.validateAndFormat(t,r),cached:!1}}cache({entryPointVersion:t,kernelVersion:e,user:i,existing:r}){this.configCache.clear(),this.configCache.set(i,{entryPointVersion:t,kernelVersion:e,userId:i.id,signers:[{signerData:r.signerConfig.data}],smartContractWalletAddress:r.address})}validateAndFormat(t,{entryPointVersion:e,kernelVersion:i,signers:r,smartContractWalletAddress:n,userId:s}){if(e==="v0.7"&&i.startsWith("0.2")||e==="v0.6"&&i.startsWith("0.3"))throw new (0, _chunkM4K3IZTTcjs.a)(`Unsupported combination: entryPoint ${e} and kernel version ${i}. Please contact support`);let g=r.map(f=>f.signerData),a=this.getSigner(g);if(n!=null&&a==null||a!=null&&n==null)throw new (0, _chunkM4K3IZTTcjs.a)("Either both signer and address must be present, or both must be null");return a==null||n==null?{entryPointVersion:e,kernelVersion:i,userWithId:{...t,id:s}}:{entryPointVersion:e,kernelVersion:i,userWithId:{...t,id:s},existing:{signerConfig:a,address:n}}}getSigner(t){if(t.length===0)return;let e=t[0];if(e.type==="eoa")return new (0, _chunkGB35YMN4cjs.b)(e);if(e.type==="passkeys")return new (0, _chunkGB35YMN4cjs.a)(e)}};exports.a = p;
|
package/dist/chunk-OCJYX5QF.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5M3MSPHKcjs = require('./chunk-5M3MSPHK.cjs');var _chunkM4K3IZTTcjs = require('./chunk-M4K3IZTT.cjs');var _viem = require('viem');var r=class{constructor(n){this.logger=n}map(n,t){return this.record(n),n instanceof _chunkM4K3IZTTcjs.a||n instanceof _viem.BaseError?n:t}record(n){let t=n instanceof Error?n.message:String(n);this.logger.error(`Smart Wallet SDK Error: ${t}`,{stack:n instanceof Error?n.stack:void 0,name:n instanceof Error?n.name:"UnknownError",details:_viem.stringify.call(void 0, n),domain:window.location.hostname,sdk_version:_chunk5M3MSPHKcjs.d})}};exports.a = r;
|
package/dist/chunk-ODAUWGUU.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/dist/chunk-PBUJXVQT.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as d}from"./chunk-C3VZY7VJ.js";import{a as m}from"./chunk-Z22H3MJS.js";import{a as l}from"./chunk-UPURFW46.js";import{stringify as y}from"viem";var h=["sendTransaction","writeContract","sendUserOperation"],g=["signMessage","signTypedData"];function c(a){return h.includes(a)}function p(a){return g.includes(a)}var u=class{constructor(o,t=m){this.errorProcessor=o;this.logger=t}decorate({crossmintChain:o,smartAccountClient:t}){return new Proxy(t,{get:(n,e,s)=>{let r=Reflect.get(n,e,s);return typeof r!="function"||typeof e!="string"||!(p(e)||c(e))?r:(...i)=>this.logger.logPerformance(`CrossmintSmartWallet.${e}`,()=>this.execute(n,e,r,i,o))}})}async execute(o,t,n,e,s){try{this.logger.log(`[CrossmintSmartWallet.${t}] - params: ${y(e)}`);let r=c(t)?this.processTxnArgs(t,s,e):e;return await n.call(o,...r)}catch(r){let i=c(t)?"signing":"sending transaction";throw this.errorProcessor.map(r,new l(`Error ${i}: ${r.message}`,y(r)))}}processTxnArgs(o,t,n){if(o==="sendUserOperation"){let[{userOperation:s,middleware:r,account:i}]=n;return[{middleware:r,account:i,userOperation:this.addGelatoBundlerProperties(t,s)},...n.slice(1)]}let[e]=n;return[this.addGelatoBundlerProperties(t,e),...n.slice(1)]}addGelatoBundlerProperties(o,t){return d(o)?{...t,maxFeePerGas:"0x0",maxPriorityFeePerGas:"0x0"}:t}};export{u as a};
|
package/dist/chunk-PLRQBDYS.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5M3MSPHKcjs = require('./chunk-5M3MSPHK.cjs');var _clientsdkbase = require('@crossmint/client-sdk-base');var s=new (0, _clientsdkbase.SDKLogger)(_chunk5M3MSPHKcjs.c),w= exports.b =new (0, _clientsdkbase.SDKLogger)(_chunk5M3MSPHKcjs.c,_clientsdkbase.getBrowserLogger.call(void 0, _chunk5M3MSPHKcjs.c,{onlyDatadog:!0}));exports.a = s; exports.b = w;
|
package/dist/chunk-PPTSNCSQ.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkIQTGPM2Ucjs = require('./chunk-IQTGPM2U.cjs');var _chunkSWWOVT47cjs = require('./chunk-SWWOVT47.cjs');var _chunk2GS5TXEYcjs = require('./chunk-2GS5TXEY.cjs');var _chunk7FXFOOQUcjs = require('./chunk-7FXFOOQU.cjs');var _chunk5M3MSPHKcjs = require('./chunk-5M3MSPHK.cjs');var _permissionless = require('permissionless');var _pimlico = require('permissionless/clients/pimlico');var _viem = require('viem');var _commonsdkbase = require('@crossmint/common-sdk-base');var v=class{constructor(r,t,i,e){this.crossmintService=r;this.accountConfigService=t;this.accountCreator=i;this.clientDecorator=e}async getOrCreate(r,t,i){let{config:{entryPointVersion:e,kernelVersion:o,existing:n,userWithId:a},cached:g}=await this.accountConfigService.get(r,t),c=_viem.createPublicClient.call(void 0, {transport:_viem.http.call(void 0, _chunk7FXFOOQUcjs.b.call(void 0, t))}),{account:s,signerConfig:l}=await this.accountCreator.get({chain:t,walletParams:i,publicClient:c,user:a,entryPoint:e==="v0.6"?_permissionless.ENTRYPOINT_ADDRESS_V06:_permissionless.ENTRYPOINT_ADDRESS_V07,kernelVersion:o,existing:n});return n==null&&await this.crossmintService.idempotentCreateSmartWallet(r,{type:_chunk5M3MSPHKcjs.a,smartContractWalletAddress:s.address,signerData:l.data,version:_chunk5M3MSPHKcjs.b,baseLayer:"evm",chainId:_commonsdkbase.blockchainToChainId.call(void 0, t),entryPointVersion:e,kernelVersion:o}),g||this.accountConfigService.cache({entryPointVersion:e,kernelVersion:o,user:a,existing:{address:s.address,signerConfig:l}}),new (0, _chunkSWWOVT47cjs.a)({wallet:this.smartAccountClient(t,s,r),public:c},t,this.crossmintService)}smartAccountClient(r,t,i){let e=_viem.http.call(void 0, _chunk7FXFOOQUcjs.c.call(void 0, r)),o={chain:_chunk2GS5TXEYcjs.i[r],entryPoint:t.entryPoint},n=_pimlico.createPimlicoBundlerClient.call(void 0, {...o,transport:e}),a=_permissionless.createSmartAccountClient.call(void 0, {account:t,bundlerTransport:e,...o,..._chunkIQTGPM2Ucjs.a.call(void 0, r)&&_chunkIQTGPM2Ucjs.b.call(void 0, {bundlerClient:n,entryPoint:t.entryPoint,chain:r,walletService:this.crossmintService,user:i})});return this.clientDecorator.decorate({crossmintChain:r,smartAccountClient:a})}};exports.a = v;
|
package/dist/chunk-PZ6Q22YJ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{toHex as p}from"viem";function n(r,e){let t=e(r);return t.replace?t.value:Array.isArray(r)?r.map(i=>n(i,e)):r!==null&&typeof r=="object"?Object.fromEntries(Object.entries(r).map(([i,o])=>[i,n(o,e)])):t.value}function s(r){return n(r,e=>typeof e=="bigint"?{value:p(e),replace:!0}:{value:e,replace:!1})}function f(r){return n(r,e=>e!=null&&typeof e=="object"&&"__xm_serializedType"in e&&"value"in e&&e.__xm_serializedType==="bigint"&&typeof e.value=="string"?{value:BigInt(e.value),replace:!0}:{value:e,replace:!1})}export{s as a,f as b};
|
package/dist/chunk-Q44P7MO7.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBXXREMNRcjs = require('./chunk-BXXREMNR.cjs');var _viem = require('viem');var s=class{constructor(e){this.keyPrefix=e}set(e,t){localStorage.setItem(this.key(e),JSON.stringify(t))}get(e){let t=this.key(e),r=localStorage.getItem(t);if(r==null)return null;let a=_chunkBXXREMNRcjs.e.safeParse(JSON.parse(r));return a.success?a.data:(localStorage.removeItem(t),null)}clear(){for(let e=0;e<localStorage.length;e++){let t=localStorage.key(e);t&&t.startsWith(this.keyPrefix)&&(localStorage.removeItem(t),e--)}}key(e){return`${this.keyPrefix}-${_viem.keccak256.call(void 0, _viem.toHex.call(void 0, e.jwt))}`}};exports.a = s;
|
package/dist/chunk-QVB3HE6Q.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as m}from"./chunk-Z22H3MJS.js";import{e as l}from"./chunk-CPYNP4XI.js";import{a as p,b as E}from"./chunk-PZ6Q22YJ.js";import{e as s}from"./chunk-WDM7PN4O.js";import{d as a,i as n,j as i}from"./chunk-UPURFW46.js";import{APIErrorService as A,BaseCrossmintService as R,CrossmintServiceError as f}from"@crossmint/client-sdk-base";import{blockchainToChainId as h}from"@crossmint/common-sdk-base";var c=class extends R{constructor(){super(...arguments);this.logger=m;this.apiErrorService=new A({ERROR_USER_WALLET_ALREADY_CREATED:({userId:r})=>new a(r),ERROR_ADMIN_SIGNER_ALREADY_USED:()=>new n,ERROR_PROJECT_NONCUSTODIAL_WALLETS_NOT_ENABLED:()=>new i})}async idempotentCreateSmartWallet(r,t){await this.fetchCrossmintAPI(`${s}/sdk/smart-wallet`,{method:"PUT",body:JSON.stringify(t)},"Error creating abstract wallet. Please contact support",r.jwt)}async sponsorUserOperation(r,t,o,e){let S=h(e),P=await this.fetchCrossmintAPI(`${s}/sdk/paymaster`,{method:"POST",body:JSON.stringify({userOp:p(t),entryPoint:o,chainId:S})},"Error sponsoring user operation. Please contact support",r.jwt);return E(P)}async getSmartWalletConfig(r,t){let o=await this.fetchCrossmintAPI(`${s}/sdk/smart-wallet/config?chain=${t}`,{method:"GET"},"Error getting smart wallet version configuration. Please contact support",r.jwt),e=l.safeParse(o);if(!e.success)throw new f(`Invalid smart wallet config, please contact support. Details below:
|
|
2
|
-
${e.error.toString()}`);return e.data}async fetchNFTs(r,t){return this.fetchCrossmintAPI(`v1-alpha1/wallets/${t}:${r}/nfts`,{method:"GET"},`Error fetching NFTs for wallet: ${r}`)}getPasskeyServerUrl(){return this.crossmintBaseUrl+"api/internal/passkeys"}};export{c as a};
|
package/dist/chunk-S2XBSAGM.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{BaseError as l,ContractFunctionRevertedError as s}from"viem";import{CrossmintSDKError as d,WalletErrorCode as m}from"@crossmint/client-sdk-base";var o=class extends d{constructor(a,r,i,e=m.SEND_TRANSACTION_FAILED){super(a,e);this.viemError=r;this.stage=i}},c=class extends o{constructor(a,r,i,e,n,h=i.data,f=i.reason){super(a,r,n,m.SEND_TRANSACTION_EXECUTION_REVERTED);this.viemError=r;this.txId=e;this.stage=n;this.data=h;this.reason=f}},p=class{constructor(t,a={confirmations:2,transactionConfirmationTimeout:3e4}){this.client=t;this.defaultSendTransactionOptions=a}async sendTransaction(t,a={}){let{confirmations:r,transactionConfirmationTimeout:i}=this.getConfig(a);await this.simulateCall(t,void 0,"simulation");let e;try{e=await this.client.wallet.writeContract({...t,account:this.client.wallet.account,chain:this.client.wallet.chain})}catch(n){throw n instanceof l?new o(n.message,n,"send"):n}try{let n=await this.client.public.waitForTransactionReceipt({hash:e,confirmations:r,timeout:i});return await this.handleReceipt(n,t)}catch(n){throw n instanceof l?new o(n.message,n,"confirmation"):n}}getConfig(t){return{...this.defaultSendTransactionOptions,...t}}async handleReceipt(t,a){if(t.status==="reverted")throw await this.simulateCall(a,t.transactionHash,"execution"),new c("Transaction reverted but unable to detect the reason",new s({abi:a.abi,functionName:a.functionName}),new s({abi:a.abi,functionName:a.functionName}),t.transactionHash,"execution");return t.transactionHash}async simulateCall(t,a,r){try{await this.client.public.simulateContract({...t,account:this.client.wallet.account.address,chain:this.client.public.chain})}catch(i){if(i instanceof l){let e=i.walk(n=>n instanceof s);throw e instanceof s?new c(e.message,i,e,a,r):new o(i.message,i,r)}throw i}}};export{o as a,c as b,p as c};
|
package/dist/chunk-SCXFZMLR.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkGB35YMN4cjs = require('./chunk-GB35YMN4.cjs');var _chunkM4K3IZTTcjs = require('./chunk-M4K3IZTT.cjs');var _passkeyvalidator = require('@zerodev/passkey-validator');var _sdk = require('@zerodev/sdk');var _webauthnkey = require('@zerodev/webauthn-key');var f=class{constructor(e,t){this.passkeyServerUrl=e;this.apiKey=t}async create({user:e,publicClient:t,walletParams:r,entryPoint:c,kernelVersion:i,existing:a}){let n=_nullishCoalesce(r.signer.passkeyName, () => (e.id));if(a!=null&&a.signerConfig.data.passkeyName!==n)throw new (0, _chunkM4K3IZTTcjs.c)(`User '${e.id}' has an existing wallet created with a passkey named '${a.signerConfig.data.passkeyName}', this does match input passkey name '${n}'.`,a.signerConfig.display());try{a==null&&r.signer.onPrePasskeyRegistration!=null&&await r.signer.onPrePasskeyRegistration();let s=await this.getPasskey(e,n,_optionalChain([a, 'optionalAccess', _ => _.signerConfig, 'access', _2 => _2.data])),g=_passkeyvalidator.PasskeyValidatorContractVersion.V0_0_2,d=a==null?g:a.signerConfig.data.validatorContractVersion,y=await _passkeyvalidator.toPasskeyValidator.call(void 0, t,{webAuthnKey:s,entryPoint:c,validatorContractVersion:d,kernelVersion:i}),k=await _sdk.createKernelAccount.call(void 0, t,{plugins:{sudo:y},entryPoint:c,kernelVersion:i,deployedAccountAddress:_optionalChain([a, 'optionalAccess', _3 => _3.address])});return{signerConfig:this.getSignerConfig(y,d,n),account:this.decorate(k,n,r)}}catch(s){throw r.signer.onPasskeyRegistrationError!=null&&r.signer.onPasskeyRegistrationError(s),this.mapError(s,n)}}async getPasskey(e,t,r){return r!=null?{pubX:BigInt(r.pubKeyX),pubY:BigInt(r.pubKeyY),authenticatorId:r.authenticatorId,authenticatorIdHash:r.authenticatorIdHash}:_webauthnkey.toWebAuthnKey.call(void 0, {passkeyName:t,passkeyServerUrl:this.passkeyServerUrl,mode:_passkeyvalidator.WebAuthnMode.Register,passkeyServerHeaders:this.createPasskeysServerHeaders(e)})}getSignerConfig(e,t,r){return new (0, _chunkGB35YMN4cjs.a)({...V(e.getSerializedData()),passkeyName:r,validatorContractVersion:t,domain:window.location.hostname,type:"passkeys"})}createPasskeysServerHeaders(e){return{"x-api-key":this.apiKey,Authorization:`Bearer ${e.jwt}`}}mapError(e,t){return e.code===0&&e.name==="DataError"?new (0, _chunkM4K3IZTTcjs.g)(t):e.message==="Registration not verified"?new (0, _chunkM4K3IZTTcjs.f)(t):e.code==="ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY"&&e.name==="NotAllowedError"?new (0, _chunkM4K3IZTTcjs.e)(t):e}decorate(e,t,r){return new Proxy(e,{get:(c,i,a)=>{let n=Reflect.get(c,i,a);if(typeof n!="function"||typeof i!="string"||!v(i))return n;let s=r.signer;return async(...g)=>{_optionalChain([g, 'optionalAccess', _4 => _4[0], 'optionalAccess', _5 => _5.factoryData])!=null&&i==="signUserOperation"&&s.type==="PASSKEY"&&s.onFirstTimePasskeySigning!=null&&await s.onFirstTimePasskeySigning();try{return await n.call(c,...g)}catch(y){throw s.onFirstTimePasskeySigningError!=null&&await s.onFirstTimePasskeySigningError(y),this.mapError(y,t)}}}})}},C=["signMessage","signTypedData","signUserOperation","signTransaction"];function v(o){return C.includes(o)}var V=o=>{let e=b(o),t=new TextDecoder().decode(e);return JSON.parse(t)};function b(o){let e=atob(o);return Uint8Array.from(e,t=>t.codePointAt(0))}exports.a = f;
|
package/dist/chunk-STH2LE35.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});function e(){return typeof window<"u"}exports.a = e;
|
package/dist/chunk-SWWOVT47.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7AVDZZGDcjs = require('./chunk-7AVDZZGD.cjs');var _chunkKYPTGHC6cjs = require('./chunk-KYPTGHC6.cjs');var _chunkM4K3IZTTcjs = require('./chunk-M4K3IZTT.cjs');var o=class{constructor(e,t,n,a=new (0, _chunk7AVDZZGDcjs.c)(e)){this.crossmintService=n;this.sendTransactionService=a;this.chain=t,this.client=e}get address(){return this.client.wallet.account.address}async transferToken(e,t){if(this.chain!==t.token.chain)throw new (0, _chunkM4K3IZTTcjs.a)(`Chain mismatch: Expected ${t.token.chain}, but got ${this.chain}. Ensure you are interacting with the correct blockchain.`);return this.executeContract(_chunkKYPTGHC6cjs.a.call(void 0, {contract:t.token.contractAddress,to:e,from:this.client.wallet.account,config:t}))}async nfts(){return this.crossmintService.fetchNFTs(this.address,this.chain)}async executeContract({address:e,abi:t,functionName:n,args:a,value:s,config:l}){return this.sendTransactionService.sendTransaction({address:e,abi:t,functionName:n,args:a,value:s},l)}};exports.a = o;
|
package/dist/chunk-TZG6MROQ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{blockchainToChainId as a}from"@crossmint/common-sdk-base";var i="-7M6vRDBDknwvMxnqah_jbcieWg0qad9",o="pim_9dKmQPxiTCvtbUNF7XFBbA",n={polygon:"polygon-mainnet","polygon-amoy":"polygon-amoy",base:"base-mainnet","base-sepolia":"base-sepolia",optimism:"opt-mainnet","optimism-sepolia":"opt-sepolia",arbitrum:"arb-mainnet","arbitrum-sepolia":"arb-sepolia"};function r(t){return`https://${n[t]}.g.alchemy.com/v2/${i}`}function l(t){return`https://api.pimlico.io/v2/${a(t)}/rpc?apikey=${o}`}export{n as a,r as b,l as c};
|
package/dist/chunk-UG47CBKR.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as s}from"./chunk-BJZQA5VC.js";import{b as d}from"./chunk-CUTQYF3F.js";import{a as i}from"./chunk-FHNNZVNU.js";import{b as n}from"./chunk-UPURFW46.js";import{signerToEcdsaValidator as f}from"@zerodev/ecdsa-validator";import{createKernelAccount as u}from"@zerodev/sdk";var c=class{async create({chain:m,publicClient:o,entryPoint:a,walletParams:g,kernelVersion:t,user:p,existing:e}){let r=await i({chain:m,walletParams:g});if(e!=null&&!d(r.address,e.signerConfig.data.eoaAddress))throw new n(`User '${p.id}' has an existing wallet with an eoa signer '${e.signerConfig.data.eoaAddress}', this does not match input eoa signer '${r.address}'.`,e.signerConfig.display(),{type:"eoa",eoaAddress:e.signerConfig.data.eoaAddress});let A=await f(o,{signer:r,entryPoint:a,kernelVersion:t});return{account:await u(o,{plugins:{sudo:A},index:0n,entryPoint:a,kernelVersion:t,deployedAccountAddress:e?.address}),signerConfig:new s({eoaAddress:r.address,type:"eoa"})}}};export{c as a};
|
package/dist/chunk-UPURFW46.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{CrossmintSDKError as g,SmartWalletErrorCode as s}from"@crossmint/client-sdk-base";var r=class extends g{constructor(e,i,n=s.UNCATEGORIZED){super(e,n,i)}},a=class extends r{constructor(e,i,n){super(e,s.ADMIN_MISMATCH),this.required=i,this.used=n}},p=class extends r{constructor(e,i,n){super(e,s.PASSKEY_MISMATCH),this.required=i,this.used=n}},l=class extends r{constructor(i){super(`The user with userId ${i.toString()} already has a wallet created for this project`);this.code=s.USER_WALLET_ALREADY_CREATED}},c=class extends r{constructor(e){super(`Prompt was either cancelled or timed out for passkey ${e}`,void 0,s.PASSKEY_PROMPT),this.passkeyName=e}},u=class extends r{constructor(e){super(`Registration for passkey ${e} failed, either the registration took too long, or passkey signature vaildation failed.`,void 0,s.PASSKEY_REGISTRATION),this.passkeyName=e}},d=class extends r{constructor(e){super(`User selected authenticator for passkey ${e} is not compatible with Crossmint's Smart Wallets.`,void 0,s.PASSKEY_INCOMPATIBLE_AUTHENTICATOR),this.passkeyName=e}},o=class extends r{constructor(e){super(e,void 0,s.WALLET_CONFIG)}},y=class extends o{constructor(){super("This signer was already used to create another wallet. Please use a different signer.");this.code=s.ADMIN_SIGNER_ALREADY_USED}},S=class extends o{constructor(){super("Smart wallets are not enabled for this project. They can be enabled on the project settings page in the developer console.");this.code=s.SMART_WALLETS_NOT_ENABLED}};export{r as a,a as b,p as c,l as d,c as e,u as f,d as g,o as h,y as i,S as j};
|
package/dist/chunk-WDM7PN4O.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e="0.1.21";var n="ZeroDev",d=0,c="SCW_SDK",p=e,a="2024-06-09",m=["0.3.1","0.3.0","0.2.4"],E=["v0.6","v0.7"];export{n as a,d as b,c,p as d,a as e,m as f,E as g};
|
package/dist/chunk-WJ6XJMRD.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});function e(a){return!1}exports.a = e;
|
package/dist/chunk-WTPE2I2Q.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWJ6XJMRDcjs = require('./chunk-WJ6XJMRD.cjs');var _chunkPLRQBDYScjs = require('./chunk-PLRQBDYS.cjs');var _chunkM4K3IZTTcjs = require('./chunk-M4K3IZTT.cjs');var _viem = require('viem');var h=["sendTransaction","writeContract","sendUserOperation"],g=["signMessage","signTypedData"];function c(a){return h.includes(a)}function p(a){return g.includes(a)}var u=class{constructor(o,t=_chunkPLRQBDYScjs.a){this.errorProcessor=o;this.logger=t}decorate({crossmintChain:o,smartAccountClient:t}){return new Proxy(t,{get:(n,e,s)=>{let r=Reflect.get(n,e,s);return typeof r!="function"||typeof e!="string"||!(p(e)||c(e))?r:(...i)=>this.logger.logPerformance(`CrossmintSmartWallet.${e}`,()=>this.execute(n,e,r,i,o))}})}async execute(o,t,n,e,s){try{this.logger.log(`[CrossmintSmartWallet.${t}] - params: ${_viem.stringify.call(void 0, e)}`);let r=c(t)?this.processTxnArgs(t,s,e):e;return await n.call(o,...r)}catch(r){let i=c(t)?"signing":"sending transaction";throw this.errorProcessor.map(r,new (0, _chunkM4K3IZTTcjs.a)(`Error ${i}: ${r.message}`,_viem.stringify.call(void 0, r)))}}processTxnArgs(o,t,n){if(o==="sendUserOperation"){let[{userOperation:s,middleware:r,account:i}]=n;return[{middleware:r,account:i,userOperation:this.addGelatoBundlerProperties(t,s)},...n.slice(1)]}let[e]=n;return[this.addGelatoBundlerProperties(t,e),...n.slice(1)]}addGelatoBundlerProperties(o,t){return _chunkWJ6XJMRDcjs.a.call(void 0, o)?{...t,maxFeePerGas:"0x0",maxPriorityFeePerGas:"0x0"}:t}};exports.a = u;
|
package/dist/chunk-XHSA4YTO.cjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6DE5YEO5cjs = require('./chunk-6DE5YEO5.cjs');var _chunkM4K3IZTTcjs = require('./chunk-M4K3IZTT.cjs');var o=class{constructor(e,r){this.eoaStrategy=e;this.passkeyStrategy=r}get(e){if(_chunk6DE5YEO5cjs.d.call(void 0, e))return this.passkeyStrategy.create(e);if(_chunk6DE5YEO5cjs.f.call(void 0, e))return this.eoaStrategy.create(e);if(e.existing==null)throw new (0, _chunkM4K3IZTTcjs.h)(`Unsupported wallet params:
|
|
2
|
-
${e.walletParams}`);let r=e.existing.signerConfig.display(),y=_chunk6DE5YEO5cjs.c.call(void 0, e.walletParams)?"passkey":"eoa";throw new (0, _chunkM4K3IZTTcjs.b)(`Cannot create wallet with ${y} signer for user ${e.user.id}', they already have a wallet with signer:
|
|
3
|
-
'${JSON.stringify(r,null,2)}'`,r)}};exports.a = o;
|
package/dist/chunk-XP6ESWVJ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as n,g as r}from"./chunk-WDM7PN4O.js";function p(e){return n.includes(e)}function g(e){return r.includes(e)}function i(e){return"signer"in e&&"type"in e.signer&&e.signer.type==="PASSKEY"}function P(e){let t=e.existing==null||e.existing.signerConfig.type==="passkeys";return i(e.walletParams)&&t}function s(e){return"signer"in e&&("type"in e.signer&&e.signer.type==="VIEM_ACCOUNT"||"request"in e.signer&&typeof e.signer.request=="function")}function C(e){let t=e.existing==null||e.existing.signerConfig.type==="eoa";return s(e.walletParams)&&t}export{p as a,g as b,i as c,P as d,s as e,C as f};
|
package/dist/chunk-XQ2K2K23.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _viem = require('viem');function n(r,e){let t=e(r);return t.replace?t.value:Array.isArray(r)?r.map(i=>n(i,e)):r!==null&&typeof r=="object"?Object.fromEntries(Object.entries(r).map(([i,o])=>[i,n(o,e)])):t.value}function c(r){return n(r,e=>typeof e=="bigint"?{value:_viem.toHex.call(void 0, e),replace:!0}:{value:e,replace:!1})}function s(r){return n(r,e=>e!=null&&typeof e=="object"&&"__xm_serializedType"in e&&"value"in e&&e.__xm_serializedType==="bigint"&&typeof e.value=="string"?{value:BigInt(e.value),replace:!0}:{value:e,replace:!1})}exports.a = c; exports.b = s;
|
package/dist/chunk-YBHSEZMB.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{arbitrum as i,arbitrumSepolia as l,base as s,baseSepolia as r,optimism as S,optimismSepolia as p,polygon as m,polygonAmoy as c}from"viem/chains";import{BlockchainIncludingTestnet as t,objectValues as a}from"@crossmint/common-sdk-base";var n={BASE_SEPOLIA:t.BASE_SEPOLIA,POLYGON_AMOY:t.POLYGON_AMOY,OPTIMISM_SEPOLIA:t.OPTIMISM_SEPOLIA,ARBITRUM_SEPOLIA:t.ARBITRUM_SEPOLIA},A=a(n),o={BASE:t.BASE,POLYGON:t.POLYGON,OPTIMISM:t.OPTIMISM,ARBITRUM:t.ARBITRUM},O=a(o),T={...n,...o},y=a(T);function E(e){return A.includes(e)}function L(e){return O.includes(e)}var h={polygon:m,"polygon-amoy":c,base:s,"base-sepolia":r,optimism:S,"optimism-sepolia":p,arbitrum:i,"arbitrum-sepolia":l};export{n as a,A as b,o as c,O as d,T as e,y as f,E as g,L as h,h as i};
|
package/dist/chunk-YZQJV2KA.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSCXFZMLRcjs = require('./chunk-SCXFZMLR.cjs');var _chunkWTPE2I2Qcjs = require('./chunk-WTPE2I2Q.cjs');var _chunkPPTSNCSQcjs = require('./chunk-PPTSNCSQ.cjs');var _chunkQ44P7MO7cjs = require('./chunk-Q44P7MO7.cjs');var _chunkO2ACORIIcjs = require('./chunk-O2ACORII.cjs');var _chunkXHSA4YTOcjs = require('./chunk-XHSA4YTO.cjs');var _chunk2R6HK64Ncjs = require('./chunk-2R6HK64N.cjs');var _chunkSTH2LE35cjs = require('./chunk-STH2LE35.cjs');var _chunkB3LJJZXDcjs = require('./chunk-B3LJJZXD.cjs');var _chunkPLRQBDYScjs = require('./chunk-PLRQBDYS.cjs');var _chunk2GS5TXEYcjs = require('./chunk-2GS5TXEY.cjs');var _chunkOCJYX5QFcjs = require('./chunk-OCJYX5QF.cjs');var _chunk5M3MSPHKcjs = require('./chunk-5M3MSPHK.cjs');var _chunkM4K3IZTTcjs = require('./chunk-M4K3IZTT.cjs');var _viem = require('viem');var _commonsdkbase = require('@crossmint/common-sdk-base');var P=class W{constructor(r,t,a,e=_chunkPLRQBDYScjs.a){this.crossmintEnv=r;this.smartWalletService=t;this.errorProcessor=a;this.logger=e}static init({clientApiKey:r}){let t=_commonsdkbase.validateAPIKey.call(void 0, r);if(!t.isValid)throw new Error("API key invalid");let a=new (0, _chunkB3LJJZXDcjs.a)(r),e=new (0, _chunkOCJYX5QFcjs.a)(_chunkPLRQBDYScjs.b),d=new (0, _chunkXHSA4YTOcjs.a)(new _chunk2R6HK64Ncjs.a,new (0, _chunkSCXFZMLRcjs.a)(a.getPasskeyServerUrl(),r)),E=new (0, _chunkQ44P7MO7cjs.a)(`smart-wallet-${_chunk5M3MSPHKcjs.d}`),u=new (0, _chunkPPTSNCSQcjs.a)(a,new (0, _chunkO2ACORIIcjs.a)(a,E),d,new (0, _chunkWTPE2I2Qcjs.a)(e));return new W(t.environment,u,e)}async getOrCreateWallet(r,t,a={signer:{type:"PASSKEY"}}){if(!_chunkSTH2LE35cjs.a.call(void 0, ))throw new (0, _chunkM4K3IZTTcjs.a)("Smart Wallet SDK should only be used client side.");return this.assertValidChain(t),await this.logger.logPerformance("GET_OR_CREATE_WALLET",async()=>{try{return await this.smartWalletService.getOrCreate(r,t,a)}catch(e){throw this.errorProcessor.map(e,new (0, _chunkM4K3IZTTcjs.a)(`Wallet creation failed: ${e.message}.`,_viem.stringify.call(void 0, e)))}})}assertValidChain(r){if(!this.validChain(r))throw new (0, _chunkM4K3IZTTcjs.a)(`The selected chain "${r}" 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.`)}validChain(r){return this.crossmintEnv==="development"||this.crossmintEnv==="staging"?_chunk2GS5TXEYcjs.g.call(void 0, r):_chunk2GS5TXEYcjs.h.call(void 0, r)}};exports.a = P;
|
package/dist/chunk-Z22H3MJS.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as o}from"./chunk-WDM7PN4O.js";import{SDKLogger as r,getBrowserLogger as e}from"@crossmint/client-sdk-base";var w=new r(o),a=new r(o,e(o,{onlyDatadog:!0}));export{w as a,a as b};
|