@crossmint/wallets-sdk 1.0.1 → 1.0.3
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/api/__tests__/test-utils.cjs +1 -1
- package/dist/api/__tests__/test-utils.js +1 -1
- package/dist/api/client.cjs +1 -1
- package/dist/api/client.js +1 -1
- package/dist/api/index.cjs +1 -1
- package/dist/api/index.js +1 -1
- package/dist/chains/chains.cjs +1 -1
- package/dist/chains/chains.js +1 -1
- package/dist/{chunk-MWA2XXJM.cjs → chunk-23KPZFOG.cjs} +1 -1
- package/dist/{chunk-DK7IEP4I.cjs → chunk-27J74EMS.cjs} +1 -1
- package/dist/{chunk-PQTGZOIH.cjs → chunk-2EZHDAMN.cjs} +1 -1
- package/dist/{chunk-MDHY42QE.js → chunk-3NMSHSGP.js} +1 -1
- package/dist/{chunk-2O4B6RLQ.cjs → chunk-4I3RUK4J.cjs} +1 -1
- package/dist/{chunk-4NS5CXOG.cjs → chunk-4PR5PN3Z.cjs} +2 -2
- package/dist/{chunk-VIWV4DQC.cjs → chunk-4SXMOTDH.cjs} +1 -1
- package/dist/{chunk-UNTAJ7NG.cjs → chunk-5DAPKXB7.cjs} +1 -1
- package/dist/{chunk-6S3ILDIR.cjs → chunk-5NWPCMOC.cjs} +1 -1
- package/dist/chunk-BQ5AOSHX.js +1 -0
- package/dist/{chunk-WEV53SFU.js → chunk-EFQFA33E.js} +1 -1
- package/dist/{chunk-MMWM4VZB.js → chunk-EGGND7OJ.js} +1 -1
- package/dist/{chunk-JYIA4X2R.cjs → chunk-EHN3LSAJ.cjs} +1 -1
- package/dist/{chunk-OJUTGJJV.js → chunk-EMW6MVFF.js} +1 -1
- package/dist/chunk-JXULWUYO.js +3 -0
- package/dist/{chunk-ZLITPB7O.cjs → chunk-LWTPWZZS.cjs} +1 -1
- package/dist/{chunk-OJNZEJKP.cjs → chunk-M7NL3LRE.cjs} +1 -1
- package/dist/{chunk-EXS5WGZO.cjs → chunk-MFGW7RMO.cjs} +1 -1
- package/dist/{chunk-ZXF23FGY.js → chunk-NMZLDVBQ.js} +1 -1
- package/dist/{chunk-MO5OIRRN.js → chunk-PDNXECMW.js} +1 -1
- package/dist/{chunk-N7TIQVRW.js → chunk-PQZP5ZKI.js} +1 -1
- package/dist/{chunk-YKULFPTG.js → chunk-QBXXVIRU.js} +1 -1
- package/dist/chunk-QZO3WO3R.js +1 -0
- package/dist/{chunk-FWTYIH3S.js → chunk-SJZXH2AI.js} +1 -1
- package/dist/{chunk-M5JPPZKX.cjs → chunk-TMY52Z53.cjs} +1 -1
- package/dist/{chunk-PXUDJFUQ.cjs → chunk-UJQJXFDS.cjs} +1 -1
- package/dist/{chunk-L4VOHSRP.cjs → chunk-WLC6H25S.cjs} +1 -1
- package/dist/{chunk-3ZJ2NA6W.cjs → chunk-WQTRX7MN.cjs} +1 -1
- package/dist/{chunk-4D662ZGC.js → chunk-XHLLW7MX.js} +1 -1
- package/dist/{chunk-MKQDODKI.js → chunk-XOEAILGF.js} +1 -1
- package/dist/{chunk-SSCPHOS2.js → chunk-Y3U34F7K.js} +1 -1
- package/dist/{chunk-2IMANHYJ.js → chunk-ZYB4O4OG.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/logger/index.cjs +1 -1
- package/dist/logger/index.js +1 -1
- package/dist/logger/init.cjs +1 -1
- package/dist/logger/init.js +1 -1
- package/dist/sdk.cjs +1 -1
- package/dist/sdk.js +1 -1
- package/dist/signers/index.cjs +1 -1
- package/dist/signers/index.js +1 -1
- package/dist/signers/non-custodial/index.cjs +1 -1
- package/dist/signers/non-custodial/index.js +1 -1
- package/dist/signers/non-custodial/ncs-evm-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-evm-signer.js +1 -1
- package/dist/signers/non-custodial/ncs-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-signer.js +1 -1
- package/dist/signers/non-custodial/ncs-solana-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-solana-signer.js +1 -1
- package/dist/signers/non-custodial/ncs-stellar-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-stellar-signer.js +1 -1
- package/dist/utils/constants.cjs +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/device-signers/IframeDeviceSignerKeyStorage.cjs +1 -1
- package/dist/utils/device-signers/IframeDeviceSignerKeyStorage.js +1 -1
- package/dist/utils/device-signers/index.cjs +1 -1
- package/dist/utils/device-signers/index.js +1 -1
- package/dist/wallets/__tests__/test-helpers.cjs +1 -1
- package/dist/wallets/__tests__/test-helpers.js +1 -1
- package/dist/wallets/evm.cjs +1 -1
- package/dist/wallets/evm.js +1 -1
- package/dist/wallets/solana.cjs +1 -1
- package/dist/wallets/solana.js +1 -1
- package/dist/wallets/stellar.cjs +1 -1
- package/dist/wallets/stellar.js +1 -1
- package/dist/wallets/wallet-factory.cjs +1 -1
- package/dist/wallets/wallet-factory.js +1 -1
- package/dist/wallets/wallet.cjs +1 -1
- package/dist/wallets/wallet.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-E65D5XWN.js +0 -1
- package/dist/chunk-LXLDXNTT.js +0 -3
- package/dist/chunk-UQLQFGZH.js +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as ae}from"./chunk-N4IWDL6M.js";import{a as W}from"./chunk-GOXB2RBF.js";import{b as G,c as M}from"./chunk-VADIEIDS.js";import{a as B}from"./chunk-PQZP5ZKI.js";import{b as L}from"./chunk-RBSMBO4T.js";import{a as ie}from"./chunk-PDNXECMW.js";import{f as ne}from"./chunk-EFQFA33E.js";import{B as te,d as j,e as _,j as K,n as U,q,r as V,s as z,t as Y,u as J,v as Q,w as X,x as Z,y as ee,z as re}from"./chunk-EXC7TCGL.js";import{a as s}from"./chunk-Y3U34F7K.js";import{d as H}from"./chunk-QZO3WO3R.js";import{a as C,b as I,c as x,d as n,e as E,f as S,g as d}from"./chunk-J3R36SGJ.js";import{isValidAddress as se,WithLoggerContext as P}from"@crossmint/common-sdk-base";var f,m,g,b,k,T,N,O,R,A=class{constructor(e,r){E(this,f);E(this,m);E(this,g);E(this,b);E(this,k);E(this,T,!1);E(this,N,!1);E(this,O);E(this,R,null);let{chain:t,address:i,owner:c,options:p,alias:h,recovery:l,signers:a,signer:o}=e;S(this,g,r),this.chain=t,this.address=i,this.owner=c,S(this,m,p),this.alias=h,S(this,b,l),S(this,k,a!=null?a:[]),S(this,f,o),S(this,O,this.initDefaultSigner())}get signer(){return n(this,f)}initDeviceSigner(){return d(this,null,function*(){var i;let e=(i=n(this,m))==null?void 0:i.deviceSignerKeyStorage;if(e==null||this.chain==="solana")return;let r={type:"device"};try{yield this.resolveDeviceSignerAvailability(r)}catch(c){s.error("wallet.initDeviceSigner.error",{error:c}),S(this,T,!0);return}let t=this.buildInternalSignerConfig(r);S(this,f,yield this.assembleFullSigner(t,e))})}initDefaultSigner(){return d(this,null,function*(){if(n(this,f)==null&&(yield this.initDeviceSigner(),!(n(this,f)!=null||n(this,T))))try{if(n(this,k).length===0){let e=this.buildInternalSignerConfig(n(this,b));S(this,f,yield this.assembleFullSigner(e))}else if(n(this,k).length===1){let e=this.buildInternalSignerConfig(n(this,k)[0]);S(this,f,yield this.assembleFullSigner(e))}}catch(e){s.warn("wallet.initDefaultSigner.autoAssemblyFailed",{recoveryType:n(this,b).type,signerCount:n(this,k).length,error:e})}})}static getApiClient(e){return e.apiClient}static getOptions(e){return e.options}static getRecovery(e){return n(e,b)}static getInitialSigners(e){return n(e,k)}get apiClient(){return n(this,g)}get options(){return n(this,m)}get recovery(){return n(this,b)}balances(e){return d(this,null,function*(){s.info("wallet.balances.start");let r=this.resolveChainForEnvironment(),t;switch(this.chain){case"solana":t="sol";break;case"stellar":t="xlm";break;default:t="eth";break}let i=[t,"usdc",...e!=null?e:[]],c=yield n(this,g).getBalance(this.address,{chains:[r],tokens:i});if("error"in c)throw s.error("wallet.balances.error",{error:c}),new Error(`Failed to get balances for wallet: ${JSON.stringify(c.message)}`);return s.info("wallet.balances.success"),this.transformBalanceResponse(c,t,e)})}stagingFund(e,r){return d(this,null,function*(){s.info("wallet.stagingFund.start",{amount:e,chain:r!=null?r:this.chain});let t=yield this.apiClient.fundWallet(this.address,{amount:e,token:"usdxm",chain:r!=null?r:this.chain});if("error"in t)throw s.error("wallet.stagingFund.error",{error:t}),new Error(`Failed to fund wallet: ${JSON.stringify(t.message)}`);return s.info("wallet.stagingFund.success"),t})}transformBalanceResponse(e,r,t){let i=a=>{var w,v,F,$,D;let o=(w=a.chains)==null?void 0:w[this.chain],u={};return this.chain==="solana"&&o!=null&&"mintHash"in o?u={mintHash:o.mintHash}:this.chain==="stellar"&&o!=null&&"contractId"in o?u={contractId:o.contractId}:o!=null&&"contractAddress"in o&&(u={contractAddress:o.contractAddress}),C({symbol:(v=a.symbol)!=null?v:"",name:(F=a.name)!=null?F:"",amount:($=a.amount)!=null?$:"0",decimals:a.decimals,rawAmount:(D=a.rawAmount)!=null?D:"0"},u)},c=e.find(a=>a.symbol===r),p=e.find(a=>a.symbol==="usdc"),h=e.filter(a=>{var o;return a.symbol!==r&&a.symbol!=="usdc"&&(t==null||t.includes((o=a.symbol)!=null?o:""))}),l=a=>{let o={symbol:a,name:a,amount:"0",decimals:0,rawAmount:"0"},u={};return this.chain==="solana"?u={mintHash:void 0}:this.chain==="stellar"?u={contractId:void 0}:u={contractAddress:void 0},C(C({},o),u)};return{nativeToken:c!=null?i(c):l(r),usdc:p!=null?i(p):l("usdc"),tokens:h.map(i)}}nfts(e){return d(this,null,function*(){return yield n(this,g).getNfts(I(C({},e),{chain:this.chain,address:this.address}))})}transactions(){return d(this,null,function*(){let e=yield n(this,g).getTransactions(this.walletLocator);if("error"in e)throw new Error(`Failed to get transactions: ${JSON.stringify(e.message)}`);return e})}transaction(e){return d(this,null,function*(){let r=yield n(this,g).getTransaction(this.walletLocator,e);if("error"in r)throw new Error(`Failed to get transaction: ${JSON.stringify(r.error)}`);return r})}transfers(e){return d(this,null,function*(){let r=this.resolveChainForEnvironment(),t=yield this.apiClient.getTransfers(this.walletLocator,{chain:r,tokens:e==null?void 0:e.tokens,status:e==null?void 0:e.status});if("error"in t)throw new Error(`Failed to get transfers: ${JSON.stringify(t.message)}`);return t})}send(e,r,t,i){return d(this,null,function*(){let c=this.resolveChainForEnvironment(),p=ce(e),h=de(r,c),l=Number(t);if(Number.isNaN(l)||!Number.isFinite(l)||l<=0)throw new z(`Invalid transfer amount: "${t}". Amount must be a positive number greater than zero.`);s.info("wallet.send.start",C({recipient:p,token:h,amount:t},(i==null?void 0:i.transactionType)!=null?{transactionType:i.transactionType}:{})),yield this.preAuthIfNeeded();let a=this.requireSigner(),o;(i==null?void 0:i.signer)==null?o=a.locator():typeof i.signer=="string"?o=i.signer:o=`server:${L(i.signer,this.chain,n(this,g).projectId,n(this,g).environment).derivedAddress}`;let u=C({recipient:p,amount:t,signer:o},(i==null?void 0:i.transactionType)!=null?{transactionType:i.transactionType}:{}),w=yield n(this,g).send(this.walletLocator,h,u);if("message"in w)throw s.error("wallet.send.error",{error:w}),new Y(`Failed to send token: ${JSON.stringify(w.message)}`);if((i==null?void 0:i.prepareOnly)===!0)return s.info("wallet.send.prepared",{transactionId:w.id}),{hash:void 0,explorerLink:void 0,transactionId:w.id};let v=yield this.approveTransactionAndWait(w.id);return s.info("wallet.send.success",{transactionId:w.id,hash:v.hash}),v})}approveTransaction(e){return d(this,null,function*(){return console.warn("approveTransaction is deprecated. Use approve instead. This method will be removed in the next major version."),yield this.approve(e)})}approve(e){return d(this,null,function*(){if(this.requireSigner(),s.info("wallet.approve.start",{transactionId:e.transactionId,signatureId:e.signatureId}),e.transactionId!=null){let r=yield this.approveTransactionAndWait(e.transactionId,e.options);return s.info("wallet.approve.success",{transactionId:e.transactionId}),r}if(e.signatureId!=null){let r=yield this.approveSignatureAndWait(e.signatureId,e.options);return s.info("wallet.approve.success",{signatureId:e.signatureId}),r}throw s.error("wallet.approve.error",{error:"Either transactionId or signatureId must be provided"}),new Error("Either transactionId or signatureId must be provided")})}addSigner(e,r){return d(this,null,function*(){var p,h;if(s.info("wallet.addSigner.start"),e.type==="device"&&this.chain==="solana")throw new K("Device signers are not currently supported for Solana wallets. Contact sales (https://www.crossmint.com/contact/sales) for access.");let t=typeof e=="object"&&"type"in e&&e.type==="server"?`server:${L(e,this.chain,n(this,g).projectId,n(this,g).environment).derivedAddress}`:e,i=this.signer,c=this.buildInternalSignerConfig(n(this,b));S(this,f,B(this.chain,c,(p=n(this,m))==null?void 0:p.deviceSignerKeyStorage));try{let l=typeof t=="string"||t.type==="passkey"?t:t.type==="device"&&"publicKey"in t&&t.publicKey!=null?{type:"device",publicKey:t.publicKey,name:t.name}:W(t),a=yield n(this,g).registerSigner(this.walletLocator,{signer:l,chain:this.chain==="solana"||this.chain==="stellar"?void 0:this.chain});if("error"in a)throw s.error("wallet.addSigner.error",{error:a}),new Error(`Failed to register signer: ${JSON.stringify(a.message)}`);let o=G(a,this.chain);if(this.chain==="solana"||this.chain==="stellar"){if(!("transaction"in a)||a.transaction==null)throw s.error("wallet.addSigner.error",{error:"Expected transaction in response for Solana/Stellar chain"}),new Error("Expected transaction in response for Solana/Stellar chain");let u=a.transaction.id;if(o==null)throw new Error(`No approval found for chain ${this.chain} in register signer response`);return r!=null&&r.prepareOnly?(s.info("wallet.addSigner.prepared",{transactionId:u}),I(C({},o),{transactionId:u})):(yield this.approveTransactionAndWait(u),s.info("wallet.addSigner.success",{transactionId:u}),I(C({},o),{status:"success"}))}else{if(!("chains"in a))throw s.error("wallet.addSigner.error",{error:"Expected chains in response for EVM chain"}),new Error("Expected chains in response for EVM chain");let u=(h=a.chains)==null?void 0:h[this.chain];if(o==null)throw new Error(`No approval found for chain ${this.chain} in register signer response`);let w=M(a,this.chain);if(r!=null&&r.prepareOnly){let v=(w==null?void 0:w.type)==="signature"?w.id:void 0;return s.info("wallet.addSigner.prepared",{signatureId:v}),I(C({},o),{signatureId:v})}if((w==null?void 0:w.type)==="signature")yield this.approveSignatureAndWait(w.id),s.info("wallet.addSigner.success",{signatureId:w.id});else{if((u==null?void 0:u.status)==="failed")throw new Error(`Signer registration failed for chain ${this.chain}`);s.info("wallet.addSigner.success")}return I(C({},o),{status:"success"})}}finally{S(this,f,i)}})}useSigner(e){return d(this,null,function*(){s.info("wallet.useSigner.start"),this.validateSignerInput(e),e.type==="device"?yield this.resolveDeviceSignerAvailability(e):yield this.resolveNonDeviceSigner(e);let r=this.buildInternalSignerConfig(e),t=W(e);S(this,f,yield this.assembleFullSigner(r)),s.info("wallet.useSigner.success",{signerLocator:t})})}resolveNonDeviceSigner(e){return d(this,null,function*(){if(e.type==="passkey"&&this.isPasskeyMissingId(e)&&!(yield this.tryAutoSelectPasskey(e))){if(this.isRecoverySigner(e)){S(this,T,!1);return}throw new Error("No passkey signer is registered on this wallet.")}let r=this.resolveSignerLocator(e);if(yield this.signerIsRegistered(r)){S(this,T,!1);return}if(this.isRecoverySigner(e)){S(this,T,!1);return}throw new Error(`Signer "${r}" is not registered in this wallet.`)})}tryAutoSelectPasskey(e){return d(this,null,function*(){let t=(yield this.signers()).filter(i=>i.type==="passkey");if(t.length===0)return!1;if(t.length>1)throw new Error('Multiple passkey signers are registered on this wallet. Please specify the credential id: wallet.useSigner({ type: "passkey", id: "<credential-id>" })');return e.id=t[0].locator.replace("passkey:",""),!0})}resolveSignerLocator(e){if(e.type==="server"){let{derivedAddress:r}=L(e,this.chain,n(this,g).projectId,n(this,g).environment);return`server:${r}`}return W(e)}isPasskeyMissingId(e){return e.id==null||e.id===""}signerIsRegistered(e){return d(this,null,function*(){return(yield this.signers()).some(t=>t.locator===e)})}isSignerApproved(e){return d(this,null,function*(){var t;return((t=(yield this.getSignerState(e)).signer)==null?void 0:t.status)==="success"})}needsRecovery(){return n(this,T)}recover(){return d(this,null,function*(){var p,h,l,a;if(s.info("wallet.recover.start"),n(this,f)==null&&(yield this.initDeviceSigner()),((p=n(this,f))==null?void 0:p.type)!=="device"){s.warn("wallet.recover.skipped",{reason:"Recovery is only supported for device signers"});return}if(n(this,N)){s.info("wallet.recover.skipped",{reason:"Device signer already approved (cached)"});return}let e=n(this,f),r=()=>{S(this,T,!1),S(this,N,!0)};if(e.status==="success"){s.info("wallet.recover.skipped",{reason:"Device signer already approved"}),r();return}let t=yield this.getSignerState(e.locator());if(e.status=(h=t.signer)==null?void 0:h.status,t.pendingOperation!=null){let o=n(this,f),u=this.buildInternalSignerConfig(n(this,b));S(this,f,B(this.chain,u,(l=n(this,m))==null?void 0:l.deviceSignerKeyStorage));try{t.pendingOperation.type==="signature"?yield this.approveSignatureAndWait(t.pendingOperation.id):yield this.approveTransactionAndWait(t.pendingOperation.id)}finally{S(this,f,o)}e.status="success",s.info("wallet.recover.device.success",{signerLocator:e.locator(),resumed:!0}),r();return}if(e.status==="success"){s.info("wallet.recover.skipped",{reason:"Device signer already approved"}),r();return}let i=(a=n(this,m))==null?void 0:a.deviceSignerKeyStorage;if(i==null)throw new Error("Device signer key storage is required to recover a device signer");let c=yield ae(i,this.address);try{yield this.addSigner(c)}catch(o){throw s.error("wallet.recover.device.error",{error:o}),yield i.deleteKey(this.address),o}S(this,f,yield this.assembleFullSigner({type:"device",locator:c.locator,address:this.address},i)),s.info("wallet.recover.device.success",{signerLocator:c.locator}),r()})}signers(){return d(this,null,function*(){var c,p;s.info("wallet.signers.start");let e=yield n(this,g).getWallet(this.walletLocator);if("error"in e)throw s.error("wallet.signers.error",{error:e}),new _(JSON.stringify(e));if(e.type!=="smart"||e.chainType!=="evm"&&e.chainType!=="solana"&&e.chainType!=="stellar")throw s.error("wallet.signers.error",{error:`Wallet type ${e.type} not supported`}),new j(`Wallet type ${e.type} not supported`);let r=(p=(c=e==null?void 0:e.config)==null?void 0:c.delegatedSigners)!=null?p:[],i=(yield Promise.all(r.map(h=>d(this,null,function*(){try{return(yield this.getSignerState(h.locator)).signer}catch(l){return null}})))).filter(h=>h!=null);return s.info("wallet.signers.success",{count:i.length}),i})}get walletLocator(){if(n(this,g).isServerSide)return this.address;{let e;switch(this.chain){case"stellar":e="me:stellar:smart";break;case"solana":e="me:solana:smart";break;default:e="me:evm:smart";break}let r=this.alias!=null?`:alias:${this.alias}`:"";return e+r}}requireSigner(){if(n(this,f)==null)throw n(this,k).length>1?new Error("No signer is set. This wallet has multiple signers configured. Call wallet.useSigner() to select which signer to use before signing operations."):n(this,b).type==="server"?new Error(`No signer is set. Server wallets require calling wallet.useSigner() with the server secret before signing operations.
|
|
2
|
+
Example: wallet.useSigner({ type: "server", secret: process.env.YOUR_SERVER_SECRET })`):n(this,b).type==="external-wallet"?new Error(`No signer is set. External wallet signers require calling wallet.useSigner() with the onSign callback before signing operations.
|
|
3
|
+
Example: wallet.useSigner({ type: "external-wallet", address: "0x...", onSign: async (tx) => ... })`):new Error("This wallet is read-only because no signer was provided. Operations that require signing (send, approve, addSigner, etc.) are not available.");return n(this,f)}preAuthIfNeeded(){return d(this,null,function*(){yield n(this,O),n(this,R)==null&&S(this,R,this.recover());try{yield n(this,R)}finally{S(this,R,null)}let e=this.requireSigner();e instanceof ie&&(yield e.ensureAuthenticated())})}isRecoverySigner(e){let r=n(this,b);if(r==null||r.type!==e.type||e.type==="device")return!1;if(e.type==="passkey")return!0;if(e.type==="server"&&r.type==="server"){let t=L(e,this.chain,n(this,g).projectId,n(this,g).environment).derivedAddress,i=L(r,this.chain,n(this,g).projectId,n(this,g).environment).derivedAddress;return t===i}return W(e)===W(r)}validateSignerInput(e){switch(e.type){case"email":if(!("email"in e)||e.email==null)throw new Error("Email signer requires an email address");break;case"phone":if(!("phone"in e)||e.phone==null)throw new Error("Phone signer requires a phone number");break;case"external-wallet":if(!("address"in e)||e.address==null)throw new Error("External wallet signer requires a wallet address");if(!("onSign"in e)||typeof e.onSign!="function")throw new Error("External wallet signer requires an onSign callback");break;case"passkey":case"device":case"api-key":break;default:break}}resolveDeviceSignerAvailability(e){return d(this,null,function*(){var p;let r=(p=n(this,m))==null?void 0:p.deviceSignerKeyStorage;if(r==null)throw new Error("Device signer key storage is required for device signers");let t=yield r.getKey(this.address);if(t!=null){e.locator=`device:${t}`;return}let c=(yield this.signers()).filter(h=>h.locator.startsWith("device:"));for(let h of c){let l=h.locator.replace("device:","");if(yield r.hasKey(l)){yield r.mapAddressToKey(this.address,l),e.locator=h.locator;return}}S(this,T,!0),S(this,N,!1)})}assembleFullSigner(i){return d(this,arguments,function*(e,r=(t=>(t=n(this,m))==null?void 0:t.deviceSignerKeyStorage)()){var h;let c=B(this.chain,e,r),p=yield this.getSignerState(c.locator());return c.status=(h=p.signer)==null?void 0:h.status,c})}getSignerState(e){return d(this,null,function*(){let r=null;try{r=yield n(this,g).getSigner(this.walletLocator,e)}catch(i){return{response:null,signer:null,pendingOperation:null}}if(r==null||typeof r!="object"||"error"in r)return{response:null,signer:null,pendingOperation:null};let t=G(r,this.chain);return{response:r,signer:t,pendingOperation:M(r,this.chain)}})}buildInternalSignerConfig(e){var r,t,i,c,p,h;switch(e.type){case"email":return{type:"email",email:e.email,locator:`email:${e.email}`,address:this.address,crossmint:n(this,g).crossmint,clientTEEConnection:(r=n(this,m))==null?void 0:r.clientTEEConnection,onAuthRequired:(i=(t=n(this,m))==null?void 0:t.callbacks)==null?void 0:i.onAuthRequired};case"phone":return{type:"phone",phone:e.phone,locator:`phone:${e.phone}`,address:this.address,crossmint:n(this,g).crossmint,clientTEEConnection:(c=n(this,m))==null?void 0:c.clientTEEConnection,onAuthRequired:(h=(p=n(this,m))==null?void 0:p.callbacks)==null?void 0:h.onAuthRequired};case"passkey":{let l="id"in e&&e.id?e.id:"";return{type:"passkey",id:l,locator:`passkey:${l}`,name:"name"in e?e.name:void 0,publicKey:"publicKey"in e?e.publicKey:void 0,onCreatePasskey:e.onCreatePasskey,onSignWithPasskey:e.onSignWithPasskey}}case"device":return{type:"device",locator:"locator"in e&&e.locator?e.locator:void 0,address:this.address};case"external-wallet":return I(C({},e),{locator:`external-wallet:${e.address}`});case"api-key":return{type:"api-key",locator:"api-key",address:this.address};case"server":{let{derivedKeyBytes:l,derivedAddress:a}=L(e,this.chain,n(this,g).projectId,n(this,g).environment);return{type:"server",derivedKeyBytes:l,locator:`server:${a}`,address:a}}default:throw new Error(`Unknown signer type: ${e==null?void 0:e.type}`)}}get isSolanaWallet(){return this.chain==="solana"}resolveChainForEnvironment(){let e=ne(this.chain,n(this,g).environment);return e!==this.chain&&(this.chain=e),this.chain}approveTransactionAndWait(e,r){return d(this,null,function*(){return yield this.approveTransactionInternal(e,r),yield this.sleep(1e3),yield this.waitForTransaction(e)})}approveSignatureAndWait(e,r){return d(this,null,function*(){let t=yield this.approveSignatureInternal(e,r);return!("error"in t)&&t.status==="success"&&t.outputSignature!=null?{signature:t.outputSignature,signatureId:e}:(yield this.sleep(1e3),yield this.waitForSignature(e))})}approveSignatureInternal(e,r){return d(this,null,function*(){var l,a;if(this.isSolanaWallet)throw new Error("Approving signatures is only supported for EVM smart wallets");let t=this.requireSigner(),i=yield n(this,g).getSignature(this.walletLocator,e);if("error"in i)throw new q(JSON.stringify(i));if(t.type==="api-key")return i;if((r==null?void 0:r.approval)!=null){let o=[r.approval];return yield this.executeApproveSignatureWithErrorHandling(e,o)}let c=(l=i.approvals)==null?void 0:l.pending;if(c==null)return i;let p=[...(a=r==null?void 0:r.additionalSigners)!=null?a:[],t],h=yield Promise.all(c.map(o=>d(this,null,function*(){let u=p.find(v=>v.locator()===o.signer.locator);if(u==null)throw new K(`Signer ${o.signer.locator} not found in pending approvals`);let w=yield u.signMessage(o.message);return I(C({},w),{signer:u.locator()})})));return yield this.executeApproveSignatureWithErrorHandling(e,h)})}approveTransactionInternal(e,r){return d(this,null,function*(){var l,a,o,u,w;let t=yield n(this,g).getTransaction(this.walletLocator,e);if("error"in t)throw new J(JSON.stringify(t));yield(o=(a=(l=n(this,m))==null?void 0:l.callbacks)==null?void 0:a.onTransactionStart)==null?void 0:o.call(a);let i=this.requireSigner();if(i.type==="api-key")return t;if((r==null?void 0:r.approval)!=null){let v=[r.approval];return yield this.executeApproveTransactionWithErrorHandling(e,v)}let c=(u=t.approvals)==null?void 0:u.pending;if(c==null)return t;let p=[...(w=r==null?void 0:r.additionalSigners)!=null?w:[],i],h=yield Promise.all(c.map(v=>d(this,null,function*(){let F=p.find(le=>le.locator()===v.signer.locator);if(F==null)throw new K(`Signer ${v.signer.locator} not found in pending approvals`);let $=F.type==="device",D=t.chainType==="solana"&&"transaction"in t.onChain&&!$?t.onChain.transaction:v.message,oe=yield F.signTransaction(D);return I(C({},oe),{signer:F.locator()})})));return yield this.executeApproveTransactionWithErrorHandling(e,h)})}executeApproveTransactionWithErrorHandling(e,r){return d(this,null,function*(){s.info("wallet.approve: submitting approval to API",{transactionId:e});let t=yield n(this,g).approveTransaction(this.walletLocator,e,{approvals:r});if(t.error)throw new re(JSON.stringify(t));return t})}executeApproveSignatureWithErrorHandling(e,r){return d(this,null,function*(){let t=yield n(this,g).approveSignature(this.walletLocator,e,{approvals:r});if(t.error)throw new V(JSON.stringify(t));return t})}waitForSignature(e){return d(this,null,function*(){let r=null;do if(yield new Promise(t=>setTimeout(t,H)),r=yield n(this,g).getSignature(this.walletLocator,e),"error"in r)throw new q(JSON.stringify(r));while(r===null||r.status==="pending");if(r.status==="failed")throw new U("Signature signing failed");if(!r.outputSignature)throw new q("Signature not available");return{signature:r.outputSignature,signatureId:e}})}waitForTransaction(p){return d(this,arguments,function*(e,r=6e4,{backoffMultiplier:t=1.1,maxBackoffMs:i=2e3,initialBackoffMs:c=H}={}){var u,w;s.info("wallet.approve: waiting for transaction confirmation",{transactionId:e,timeoutMs:r});let h=Date.now(),l;do{if(Date.now()-h>r)throw new Q("Transaction confirmation timeout");if(l=yield n(this,g).getTransaction(this.walletLocator,e),l.error)throw new J(JSON.stringify(l));yield this.sleep(c),c=Math.min(c*t,i)}while(l.status==="pending");if(l.status==="failed")throw new X(`Transaction sending failed: ${JSON.stringify(l.error)}`);if(l.status==="awaiting-approval")throw new Z("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let a="txHash"in l.onChain&&typeof l.onChain.txHash=="string"?l.onChain.txHash:void 0,o=(u=l.onChain.txId)!=null?u:a;if(o==null)throw new ee("Transaction hash not found on transaction response");return{hash:o,explorerLink:(w=l.onChain.explorerLink)!=null?w:"",transactionId:l.id}})}sleep(e){return d(this,null,function*(){return new Promise(r=>setTimeout(r,e))})}};f=new WeakMap,m=new WeakMap,g=new WeakMap,b=new WeakMap,k=new WeakMap,T=new WeakMap,N=new WeakMap,O=new WeakMap,R=new WeakMap,x([P({logger:s,methodName:"wallet.balances",buildContext(e){return{chain:e.chain,address:e.address}}})],A.prototype,"balances",1),x([P({logger:s,methodName:"wallet.stagingFund",buildContext(e){return{chain:e.chain,address:e.address}}})],A.prototype,"stagingFund",1),x([P({logger:s,methodName:"wallet.send",buildContext(e){return{chain:e.chain,address:e.address}}})],A.prototype,"send",1),x([P({logger:s,methodName:"wallet.approve",buildContext(e){return{chain:e.chain,address:e.address}}})],A.prototype,"approve",1),x([P({logger:s,methodName:"wallet.addSigner",buildContext(e){return{chain:e.chain,address:e.address}}})],A.prototype,"addSigner",1),x([P({logger:s,methodName:"wallet.useSigner",buildContext(e){return{chain:e.chain,address:e.address}}})],A.prototype,"useSigner",1),x([P({logger:s,methodName:"wallet.recover",buildContext(e){return{chain:e.chain,address:e.address}}})],A.prototype,"recover",1),x([P({logger:s,methodName:"wallet.signers",buildContext(e){return{chain:e.chain,address:e.address}}})],A.prototype,"signers",1);function ce(y){if(typeof y=="string"){if(!se(y))throw new te(`Invalid recipient address: "${y}". Expected a valid EVM (0x...), Solana (base58), or Stellar (G.../C...) address.`);return y}if("email"in y)return`email:${y.email}`;if("x"in y)return`x:${y.x}`;if("twitter"in y)return`twitter:${y.twitter}`;if("phone"in y)return`phoneNumber:${y.phone}`;if("userId"in y)return`userId:${y.userId}`;throw new Error("Invalid recipient locator")}function de(y,e){return se(y)?`${e}:${y}`:`${e}:${y.toLowerCase()}`}export{A as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkK5TQ4QU3cjs = require('./chunk-K5TQ4QU3.cjs');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkK5TQ4QU3cjs = require('./chunk-K5TQ4QU3.cjs');var _chunk4PR5PN3Zcjs = require('./chunk-4PR5PN3Z.cjs');var _chunkYHV3672Rcjs = require('./chunk-YHV3672R.cjs');var _chunkNX256LAHcjs = require('./chunk-NX256LAH.cjs');var _chunk3VSFHDFHcjs = require('./chunk-3VSFHDFH.cjs');var _chunk4I3RUK4Jcjs = require('./chunk-4I3RUK4J.cjs');var _chunkT3U46LK3cjs = require('./chunk-T3U46LK3.cjs');var _chunk5NWPCMOCcjs = require('./chunk-5NWPCMOC.cjs');var _chunk2GKPWQBQcjs = require('./chunk-2GKPWQBQ.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var _ox = require('ox');var D="When 'signers' is provided to a method that may fetch an existing wallet, each specified signer must exist in that wallet's configuration.",d= exports.a =class{constructor(t){this.apiClient=t}getWallet(t,e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){let a,n;if(typeof t=="string"){if(!this.apiClient.isServerSide)throw new (0, _chunkT3U46LK3cjs.g)("getWallet with walletLocator is only available on the server side. Use getWallet(args) instead.");if(e==null)throw new (0, _chunkT3U46LK3cjs.g)("Wallet configuration is required when using walletLocator: https://docs.crossmint.com/sdk-reference/wallets/type-aliases/WalletArgsFor");a=t,n=e}else{if(this.apiClient.isServerSide)throw new (0, _chunkT3U46LK3cjs.g)("getWallet on server side requires a walletLocator parameter. Use getWallet(walletLocator, args) instead.");n=t,a=this.getWalletLocator(n)}let i=_chunk2GKPWQBQcjs.b.call(void 0, _chunk2GKPWQBQcjs.a.call(void 0, {},n),{chain:_chunk4I3RUK4Jcjs.f.call(void 0, n.chain,this.apiClient.environment)});_chunk5NWPCMOCcjs.a.info("walletFactory.getWallet.start");let r=yield this.apiClient.getWallet(a);if("error"in r)throw _chunk5NWPCMOCcjs.a.warn("walletFactory.getWallet.notFound",{error:r.error}),new (0, _chunkT3U46LK3cjs.e)(JSON.stringify(r));return _chunk5NWPCMOCcjs.a.info("walletFactory.getWallet.success",{address:r.address}),yield this.createWalletInstance(r,i)})}createWallet(t){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){var o,s,g,v,W,A,k,F;let e=_chunk2GKPWQBQcjs.b.call(void 0, _chunk2GKPWQBQcjs.a.call(void 0, {},t),{chain:_chunk4I3RUK4Jcjs.f.call(void 0, t.chain,this.apiClient.environment)});if(yield(g=(s=(o=e.options)==null?void 0:o.callbacks)==null?void 0:s.onWalletCreationStart)==null?void 0:g.call(s),_chunk5NWPCMOCcjs.a.info("walletFactory.createWallet.start"),!this.apiClient.isServerSide&&e.owner!=null)throw _chunk5NWPCMOCcjs.a.error("walletFactory.createWallet.error",{error:"Owner field cannot be specified in client-side createWallet calls"}),new (0, _chunkT3U46LK3cjs.g)("Owner field cannot be specified in client-side createWallet calls. Owner is determined from JWT authentication.");let a=((v=e.options)==null?void 0:v.deviceSignerKeyStorage)!=null?this.ensureDeviceSignerInSigners(e):(W=e.signers)!=null?W:[],n=yield this.registerSigners(a,e.chain,(A=e.options)==null?void 0:A.deviceSignerKeyStorage),i;if(e.recovery.type==="passkey"&&e.recovery.id==null)i=yield this.createPasskeySigner(e.recovery);else if(e.recovery.type==="server"){let{derivedAddress:$}=_chunk3VSFHDFHcjs.b.call(void 0, e.recovery,e.chain,this.apiClient.projectId,this.apiClient.environment);i={type:"server",address:$}}else i=e.recovery;let r=yield this.apiClient.createWallet({type:"smart",chainType:this.getChainType(e.chain),config:_chunk2GKPWQBQcjs.a.call(void 0, _chunk2GKPWQBQcjs.a.call(void 0, {adminSigner:i},e.plugins?{plugins:e.plugins}:{}),n!=null?{delegatedSigners:n}:{}),owner:(k=e.owner)!=null?k:void 0,alias:(F=e.alias)!=null?F:void 0});if("error"in r)throw _chunk5NWPCMOCcjs.a.error("walletFactory.createWallet.error",{error:r.error}),new (0, _chunkT3U46LK3cjs.g)(JSON.stringify(r));return _chunk5NWPCMOCcjs.a.info("walletFactory.createWallet.success",{address:r.address}),yield this.createWalletInstance(r,e)})}createWalletInstance(t,e){var o,s;this.validateExistingWalletConfig(t,e);let a=e,n=t.config.adminSigner,i=((o=a.recovery)==null?void 0:o.type)==="server"||((s=a.recovery)==null?void 0:s.type)==="external-wallet"?a.recovery:n,r=t.config.delegatedSigners;return r!=null&&r.length===1&&(r[0].type==="server"||r[0].type==="external-wallet")&&(r=a.signers),new (0, _chunk4PR5PN3Zcjs.a)({chain:e.chain,address:t.address,owner:t.owner,options:e.options,alias:e.alias,recovery:i,signers:r!=null?r:[]},this.apiClient)}getWalletLocator(t){return`me:${this.getChainType(t.chain)}:smart`+(t.alias!=null?`:alias:${t.alias}`:"")}createPasskeySigner(t){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){var n;if(t.type!=="passkey")throw new Error("Signer is not a passkey");let e=(n=t.name)!=null?n:`Crossmint Wallet ${Date.now()}`,a=t.onCreatePasskey?yield t.onCreatePasskey(e):yield _ox.WebAuthnP256.createCredential({name:e});return{type:"passkey",id:a.id,name:e,publicKey:{x:a.publicKey.x.toString(),y:a.publicKey.y.toString()}}})}ensureDeviceSignerInSigners(t){var n,i;if(t.chain==="solana")return(n=t.signers)!=null?n:[];let e=(i=t.signers)!=null?i:[];return e.some(r=>r.type==="device")?e:[...e,{type:"device"}]}validateExistingWalletConfig(t,e){if(e.owner!=null&&t.owner!=null&&_chunkK5TQ4QU3cjs.a.call(void 0, e.owner)!==_chunkK5TQ4QU3cjs.a.call(void 0, t.owner))throw new (0, _chunkT3U46LK3cjs.g)("Wallet owner does not match existing wallet's linked user");if(e.chain==="solana"&&t.chainType!=="solana"||e.chain!=="solana"&&t.chainType==="solana"||e.chain==="stellar"&&t.chainType!=="stellar"||e.chain!=="stellar"&&t.chainType==="stellar")throw new (0, _chunkT3U46LK3cjs.g)(`Wallet chain does not match existing wallet's chain. You must use chain: ${t.chainType}.`);if(t.type!=="smart")return;let a=e;if(a.recovery!=null||a.signers!=null){let n=t.config,i=n==null?void 0:n.adminSigner;if(a.recovery!=null&&i!=null){if(a.recovery.type!==i.type)throw new (0, _chunkT3U46LK3cjs.g)("The wallet recovery signer type does not match the existing wallet's recovery signer type");_chunkK5TQ4QU3cjs.b.call(void 0, a.recovery,i)}let r=a.signers;r!=null&&this.validateSigners(t,r,e.chain)}}validateSigners(t,e,a){let n=t.config,i=n==null?void 0:n.delegatedSigners;if(e.length!==0){if(i==null||i.length===0)throw new (0, _chunkT3U46LK3cjs.g)(`${e.length} signer(s) specified, but wallet "${t.address}" has no signers. ${D}`);for(let r of e){let o=i.find(s=>{if(this.isMatchingPasskeySigner(r,s,n)||s.type==="device"&&r.type==="device")return!0;if(r.type==="server"){let{derivedAddress:g}=_chunk3VSFHDFHcjs.b.call(void 0, r,a,this.apiClient.projectId,this.apiClient.environment);return s.locator===`server:${g}`}return s.locator===_chunkNX256LAHcjs.a.call(void 0, r)});if(o==null){let s=i.map(g=>g.locator).join(", ");throw new (0, _chunkT3U46LK3cjs.g)(`Signer '${r.type}' does not exist in wallet "${t.address}". Available signers: ${s}. ${D}`)}_chunkK5TQ4QU3cjs.b.call(void 0, r,o)}}}isMatchingPasskeySigner(t,e,a){var i,r;let n=((r=(i=a.delegatedSigners)==null?void 0:i.filter(o=>o.type==="passkey").length)!=null?r:0)+(a.adminSigner.type==="passkey"?1:0);if(t.type==="passkey"){if(t.id==null&&n===1)return e.type==="passkey";if(t.id==null&&n>1)throw new (0, _chunkT3U46LK3cjs.g)("When creating a wallet with multiple passkeys, you must provide the passkey ID for each passkey.")}return!1}registerSigners(t,e,a){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){var n;return yield Promise.all((n=t==null?void 0:t.map(i=>_chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){if(i.type==="passkey")return i.id==null?{signer:yield this.createPasskeySigner(i)}:{signer:i};if(i.type==="device"){if(e==="solana")throw new (0, _chunkT3U46LK3cjs.j)("Device signers are not currently supported for Solana wallets. Contact sales (https://www.crossmint.com/contact/sales) for access.");if(i.publicKey!=null)return{signer:{type:"device",publicKey:i.publicKey,name:i.name}};if(i.locator!=null)return{signer:i.locator};if(a==null)throw new (0, _chunkT3U46LK3cjs.g)("Device signer key storage is required for device signers");let r=yield _chunkYHV3672Rcjs.a.call(void 0, a);return{signer:{type:"device",publicKey:r.publicKey,name:r.name}}}if(i.type==="server"&&e!=null){let{derivedAddress:r}=_chunk3VSFHDFHcjs.b.call(void 0, i,e,this.apiClient.projectId,this.apiClient.environment);return{signer:`server:${r}`}}return{signer:_chunkNX256LAHcjs.a.call(void 0, i)}})))!=null?n:[])})}getChainType(t){return t==="solana"?"solana":t==="stellar"?"stellar":"evm"}};_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunk5NWPCMOCcjs.a,methodName:"walletFactory.getWallet",buildContext(t,e){if(typeof e[0]=="string"){let n=e[1];return{walletLocator:e[0],chain:n==null?void 0:n.chain}}let a=e[0];return{chain:a==null?void 0:a.chain}}})],d.prototype,"getWallet",1),_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunk5NWPCMOCcjs.a,methodName:"walletFactory.createWallet",buildContext(t,e){return{chain:e[0].chain}}})],d.prototype,"createWallet",1);exports.a = d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk4PR5PN3Zcjs = require('./chunk-4PR5PN3Z.cjs');var _chunk3VSFHDFHcjs = require('./chunk-3VSFHDFH.cjs');var _chunkT3U46LK3cjs = require('./chunk-T3U46LK3.cjs');var _chunk5NWPCMOCcjs = require('./chunk-5NWPCMOC.cjs');var _chunk2GKPWQBQcjs = require('./chunk-2GKPWQBQ.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var o=class o extends _chunk4PR5PN3Zcjs.a{constructor(e){super({chain:e.chain,address:e.address,owner:e.owner,options:_chunk4PR5PN3Zcjs.a.getOptions(e),alias:e.alias,recovery:_chunk4PR5PN3Zcjs.a.getRecovery(e),signer:e.signer,signers:_chunk4PR5PN3Zcjs.a.getInitialSigners(e)},_chunk4PR5PN3Zcjs.a.getApiClient(e))}static from(e){if(!_commonsdkbase.isValidStellarAddress.call(void 0, e.address))throw new Error("Wallet is not a Stellar wallet");return new o(e)}sendTransaction(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){var a;_chunk5NWPCMOCcjs.a.info("stellarWallet.sendTransaction.start"),yield this.preAuthIfNeeded();let t=yield this.createTransaction(e);if((a=e.options)!=null&&a.prepareOnly)return _chunk5NWPCMOCcjs.a.info("stellarWallet.sendTransaction.prepared",{transactionId:t.id}),{hash:void 0,explorerLink:void 0,transactionId:t.id};let n={},r=yield this.approveTransactionAndWait(t.id,n);return _chunk5NWPCMOCcjs.a.info("stellarWallet.sendTransaction.success",{transactionId:t.id,hash:r.hash}),r})}createTransaction(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){let{contractId:t,options:n}=e,r;(n==null?void 0:n.signer)==null?r=this.requireSigner().locator():typeof n.signer=="string"?r=n.signer:r=`server:${_chunk3VSFHDFHcjs.b.call(void 0, n.signer,this.chain,this.apiClient.projectId,this.apiClient.environment).derivedAddress}`;let a;if("transaction"in e)a={type:"serialized-transaction",serializedTransaction:e.transaction,contractId:t};else{let{method:T,memo:d,args:g}=e;a={type:"contract-call",contractId:t,method:T,memo:d!=null?{type:"text",value:d}:void 0,args:g}}let c=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:a,signer:r}});if("error"in c)throw new (0, _chunkT3U46LK3cjs.t)(JSON.stringify(c));return c})}};_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunk5NWPCMOCcjs.a,methodName:"stellarWallet.sendTransaction",buildContext(e){return{chain:e.chain,address:e.address}}})],o.prototype,"sendTransaction",1);var f=o;exports.a = f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJBP52JOHcjs = require('./chunk-JBP52JOH.cjs');var _chunk5QIW67NUcjs = require('./chunk-5QIW67NU.cjs');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJBP52JOHcjs = require('./chunk-JBP52JOH.cjs');var _chunk5QIW67NUcjs = require('./chunk-5QIW67NU.cjs');var _chunk5NWPCMOCcjs = require('./chunk-5NWPCMOC.cjs');var _chunk2GKPWQBQcjs = require('./chunk-2GKPWQBQ.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var f=class{constructor(r){this.config=r;this._needsAuth=!0;this._authPromise=null;this._initializationPromise=null;typeof window!="undefined"&&(this._initializationPromise=this.initialize()),this.type=this.config.type}locator(){return this.config.locator}address(){return this.config.address}initialize(){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){try{if(this.config.clientTEEConnection==null){let r=_commonsdkbase.validateAPIKey.call(void 0, this.config.crossmint.apiKey);if(!r.isValid)throw new Error("Invalid API key");let t=new (0, _chunkJBP52JOHcjs.a)({environment:r.environment});this.config.clientTEEConnection=yield t.initialize()}}finally{this._initializationPromise=null}})}getTEEConnection(){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){if(this.config.clientTEEConnection==null){if(this._initializationPromise){if(yield this._initializationPromise,this.config.clientTEEConnection==null)throw new Error("Failed to initialize TEE connection");return this.config.clientTEEConnection}this._initializationPromise=this.initializeTEEConnection();try{yield this._initializationPromise}finally{this._initializationPromise=null}}if(this.config.clientTEEConnection==null)throw new Error("TEE connection is not initialized");return this.config.clientTEEConnection})}initializeTEEConnection(){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){_chunk5NWPCMOCcjs.a.info("TEE connection not initialized, initializing now");let r=_commonsdkbase.validateAPIKey.call(void 0, this.config.crossmint.apiKey);if(!r.isValid)throw new Error("Invalid API key");let t=new (0, _chunkJBP52JOHcjs.a)({environment:r.environment});if(this.config.clientTEEConnection=yield t.initialize(),this.config.clientTEEConnection==null)throw new Error("Failed to initialize TEE connection");_chunk5NWPCMOCcjs.a.info("TEE connection initialized successfully")})}handleAuthRequired(){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){var u;let r=yield this.getTEEConnection();if(this.config.onAuthRequired==null)throw new Error(`${this.type} signer requires the onAuthRequired callback to handle OTP verification. This callback manages the authentication flow (sending OTP and verifying user input). If using our React/React Native SDK, this is handled automatically by the provider. For other environments, implement: onAuthRequired: (needsAuth, sendOtp, verifyOtp, reject) => { /* your UI logic */ }`);_chunk5NWPCMOCcjs.a.info("get-status: sending request");let t=Date.now(),n=yield r.sendAction({event:"request:get-status",responseEvent:"response:get-status",data:{authData:{jwt:(u=this.config.crossmint.jwt)!=null?u:"",apiKey:this.config.crossmint.apiKey}},options:d}),i=Date.now()-t;if((n==null?void 0:n.status)!=="success")throw _chunk5NWPCMOCcjs.a.error("get-status: failed",{status:n==null?void 0:n.status,error:n==null?void 0:n.error,durationMs:i}),new Error(n==null?void 0:n.error);if(_chunk5NWPCMOCcjs.a.info("get-status: response received",{signerStatus:n.signerStatus,durationMs:i}),n.signerStatus==="ready"){this._needsAuth=!1;return}else this._needsAuth=!0;_chunk5NWPCMOCcjs.a.info("Auth required, initiating OTP flow",{needsAuth:this._needsAuth});let{promise:s,resolve:h,reject:c}=this.createAuthPromise();if(this._authPromise={promise:s,resolve:h,reject:c},this.config.onAuthRequired)try{yield this.config.onAuthRequired(this.config.type,this.locator(),this._needsAuth,()=>this.sendMessageWithOtp(),e=>this.verifyOtp(e),()=>_chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){_chunk5NWPCMOCcjs.a.info("Auth rejected",{authRejected:!0}),this._needsAuth=!1,this.config.onAuthRequired!=null&&(yield this.config.onAuthRequired(this.config.type,this.locator(),this._needsAuth,()=>this.sendMessageWithOtp(),e=>this.verifyOtp(e),()=>{var e;return(e=this._authPromise)==null?void 0:e.reject(new _chunk5QIW67NUcjs.a)})),c(new _chunk5QIW67NUcjs.a)}))}catch(e){_chunk5NWPCMOCcjs.a.error("handleAuthRequired error",{error:e}),c(e)}try{yield s}catch(e){throw _chunk5NWPCMOCcjs.a.error("handleAuthRequired promise error",{error:e}),e}})}ensureAuthenticated(){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){yield this.handleAuthRequired()})}getJwtOrThrow(){let r=this.config.crossmint.jwt;if(r==null)throw new Error("JWT is required");return r}createAuthPromise(){let r,t;return{promise:new Promise((i,s)=>{r=i,t=s}),resolve:r,reject:t}}sendMessageWithOtp(){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){var h,c;let r=yield this.getTEEConnection(),t=this.getAuthId();_chunk5NWPCMOCcjs.a.info("start-onboarding: sending request");let n=Date.now(),i=yield r.sendAction({event:"request:start-onboarding",responseEvent:"response:start-onboarding",data:{authData:{jwt:(h=this.config.crossmint.jwt)!=null?h:"",apiKey:this.config.crossmint.apiKey},data:{authId:t}},options:d}),s=Date.now()-n;if(_chunk5NWPCMOCcjs.a.info("start-onboarding: response received",{status:i==null?void 0:i.status,durationMs:s}),(i==null?void 0:i.status)==="success"&&i.signerStatus==="ready"){this._needsAuth=!1;return}(i==null?void 0:i.status)==="error"&&(_chunk5NWPCMOCcjs.a.error("start-onboarding: failed",{error:i.error}),(c=this._authPromise)==null||c.reject(new Error(i.error||"Failed to initiate OTP process.")))})}getAuthId(){return this.config.type==="email"?`email:${this.config.email}`:`phone:${this.config.phone}`}verifyOtp(r){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){var s,h,c,u;let t;try{let e=yield this.getTEEConnection();_chunk5NWPCMOCcjs.a.info("complete-onboarding: sending request");let E=Date.now();t=yield e.sendAction({event:"request:complete-onboarding",responseEvent:"response:complete-onboarding",data:{authData:{jwt:(s=this.config.crossmint.jwt)!=null?s:"",apiKey:this.config.crossmint.apiKey},data:{onboardingAuthentication:{encryptedOtp:r}}},options:d}),_chunk5NWPCMOCcjs.a.info("complete-onboarding: response received",{status:t==null?void 0:t.status,durationMs:Date.now()-E})}catch(e){throw _chunk5NWPCMOCcjs.a.error("complete-onboarding: error",{error:e}),this._needsAuth=!0,(h=this._authPromise)==null||h.reject(e),e}if((t==null?void 0:t.status)==="success"){this._needsAuth=!1,this.config.onAuthRequired!=null&&(yield this.config.onAuthRequired(this.config.type,this.locator(),this._needsAuth,()=>this.sendMessageWithOtp(),e=>this.verifyOtp(e),()=>{var e;return(e=this._authPromise)==null?void 0:e.reject(new _chunk5QIW67NUcjs.a)})),(c=this._authPromise)==null||c.resolve();return}_chunk5NWPCMOCcjs.a.error("complete-onboarding: OTP validation failed",{status:t==null?void 0:t.status}),this._needsAuth=!0;let n=(t==null?void 0:t.status)==="error"?t.error:"Failed to validate encrypted OTP",i=new Error(n);throw(u=this._authPromise)==null||u.reject(i),i})}_exportPrivateKey(r){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){yield this.handleAuthRequired();let t=this.getJwtOrThrow(),{scheme:n,encoding:i}=this.getChainKeyParams(),s=yield r.sendAction({event:"request:export-signer",responseEvent:"response:export-signer",data:{authData:{jwt:t,apiKey:this.config.crossmint.apiKey},data:{scheme:n,encoding:i}},options:d});if((s==null?void 0:s.status)==="error")throw new Error(s.error||"Failed to export private key")})}};_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunk5NWPCMOCcjs.a,methodName:"handleAuthRequired"})],f.prototype,"handleAuthRequired",1);var d={timeoutMs:3e4};exports.a = f; exports.b = d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v}from"./chunk-IOSADDL5.js";import{a as l}from"./chunk-
|
|
1
|
+
import{a as v}from"./chunk-IOSADDL5.js";import{a as l}from"./chunk-Y3U34F7K.js";import{c as d,g as n}from"./chunk-J3R36SGJ.js";import{getEnvironmentForKey as E,APIKeyEnvironmentPrefix as h,WithLoggerContext as u}from"@crossmint/common-sdk-base";import{WebAuthnP256 as w}from"ox";var b={[h.DEVELOPMENT]:"https://development.devicekey.store",[h.STAGING]:"https://staging.devicekey.store",[h.PRODUCTION]:"https://devicekey.store"},P=6e4,K="indexeddb-fatal",c=class extends v{constructor(e){super(e);this.iframePromise=null;this.reloading=null;this.biometricRequestHandler=null;this.biometricListener=null;let r=E(e);if(r==null)throw new Error("Unable to determine environment from API key");this.iframeUrl=b[r]}setBiometricRequestHandler(e){this.biometricRequestHandler=e}generateKey(){return n(this,arguments,function*(e={biometricPolicy:"none"}){return(yield this.rpc("generateKey",e)).publicKeyBase64})}mapAddressToKey(e,r){return n(this,null,function*(){yield this.rpc("mapAddressToKey",{address:e,publicKeyBase64:r})})}getKey(e){return n(this,null,function*(){return(yield this.rpc("getKey",{address:e})).publicKeyBase64})}hasKey(e){return n(this,null,function*(){return(yield this.rpc("hasKey",{publicKeyBase64:e})).hasKey})}signMessage(e,r){return n(this,null,function*(){return yield this.rpc("signMessage",{address:e,message:r})})}deleteKey(e){return n(this,null,function*(){yield this.rpc("deleteKey",{address:e})})}destroy(){this.biometricListener!=null&&(window.removeEventListener("message",this.biometricListener),this.biometricListener=null),this.iframePromise!=null&&(this.iframePromise.then(e=>e.remove()).catch(()=>{}),this.iframePromise=null)}rpc(e,r){return n(this,null,function*(){let i=yield this.sendRpc(e,r);if(i.fatal){l.warn(`[IframeDeviceSignerKeyStorage] Recoverable IDB error on "${e}", reloading iframe and retrying`),yield this.reloadIframe();let t=yield this.sendRpc(e,r);if(t.fatal)throw new Error(`Device signer IDB fatal error on "${e}" persisted after iframe reload`);return t.value}return i.value})}sendRpc(e,r){return n(this,null,function*(){let t=(yield this.getIframe()).contentWindow;if(t==null)throw new Error("Device signer iframe has no contentWindow");let g=crypto.randomUUID(),a=new URL(this.iframeUrl).origin;return new Promise((s,o)=>{let f=setTimeout(()=>{window.removeEventListener("message",p),o(new Error(`Device signer RPC "${e}" timed out after ${P}ms`))},P);function p(y){let m=y.data;m==null||m.id!==g||y.origin===a&&(clearTimeout(f),window.removeEventListener("message",p),m.type==="error"&&m.code===K?s({fatal:!0}):m.type==="error"?o(new Error(m.error)):s({value:m.result,fatal:!1}))}window.addEventListener("message",p),t.postMessage({type:e,id:g,payload:r},this.iframeUrl)})})}reloadIframe(){return n(this,null,function*(){if(this.reloading!=null)return this.reloading;let e=n(this,null,function*(){try{this.destroy(),yield this.getIframe()}finally{this.reloading=null}});return this.reloading=e,e})}setupBiometricListener(e){let r=new URL(this.iframeUrl).origin;this.biometricListener=i=>n(this,null,function*(){if(i.origin!==r)return;let t=i.data;if((t==null?void 0:t.type)!=="biometric-request")return;let g=e.contentWindow;if(g!=null)try{this.biometricRequestHandler!=null&&(yield this.biometricRequestHandler(t.action));let a=null;if(t.action==="createCredential"){let s=t.payload,o=yield w.createCredential({name:s.name});a={id:o.id,publicKey:{x:`0x${o.publicKey.x.toString(16)}`,y:`0x${o.publicKey.y.toString(16)}`}}}else if(t.action==="sign"){let s=t.payload,{signature:o,metadata:f}=yield w.sign({credentialId:s.credentialId,challenge:s.challenge});a={signature:{r:`0x${o.r.toString(16)}`,s:`0x${o.s.toString(16)}`},metadata:f}}g.postMessage({type:"biometric-response",id:t.id,result:a},this.iframeUrl)}catch(a){let s=a instanceof Error?a.message:"Unknown biometric error";g.postMessage({type:"biometric-response",id:t.id,error:s},this.iframeUrl)}}),window.addEventListener("message",this.biometricListener)}getIframe(){return this.iframePromise==null&&(this.iframePromise=this.createIframe().catch(e=>{throw this.iframePromise=null,e})),this.iframePromise}createIframe(){let e=document.createElement("iframe");return e.src=this.iframeUrl,Object.assign(e.style,{position:"absolute",opacity:"0",pointerEvents:"none",width:"0",height:"0",border:"none",top:"-9999px",left:"-9999px"}),new Promise((r,i)=>{e.onload=()=>{this.setupBiometricListener(e),r(e)},e.onerror=()=>i(new Error("Failed to load device signer iframe")),document.body.appendChild(e)})}getDeviceName(){var t;if(typeof navigator=="undefined")return"Unknown Device";let e=navigator.userAgent,r=this.parseDevice(e),i=this.parseBrowser(e);return r!=null&&i!=null?`${i} on ${r}`:(t=r!=null?r:i)!=null?t:"Unknown Device"}parseDevice(e){return/iPad/.test(e)?"iPad":/iPhone/.test(e)?"iPhone":/Macintosh|Mac OS X/.test(e)?"Mac":/Windows/.test(e)?"Windows":/Android/.test(e)?"Android":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"ChromeOS":null}parseBrowser(e){return/Edg\//.test(e)?"Edge":/OPR\/|Opera/.test(e)?"Opera":typeof navigator!="undefined"&&"brave"in navigator?"Brave":/Chrome\//.test(e)?"Chrome":/Safari\//.test(e)&&!/Chrome\//.test(e)?"Safari":/Firefox\//.test(e)?"Firefox":null}};d([u({logger:l,methodName:"deviceSignerKeyStorage.generateKey"})],c.prototype,"generateKey",1),d([u({logger:l,methodName:"deviceSignerKeyStorage.mapAddressToKey"})],c.prototype,"mapAddressToKey",1),d([u({logger:l,methodName:"deviceSignerKeyStorage.getKey"})],c.prototype,"getKey",1),d([u({logger:l,methodName:"deviceSignerKeyStorage.hasKey"})],c.prototype,"hasKey",1),d([u({logger:l,methodName:"deviceSignerKeyStorage.signMessage"})],c.prototype,"signMessage",1),d([u({logger:l,methodName:"deviceSignerKeyStorage.deleteKey"})],c.prototype,"deleteKey",1);export{c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g}from"./chunk-O6VBO7KG.js";import{a as l}from"./chunk-WCGUGIGJ.js";import{a as o}from"./chunk-
|
|
1
|
+
import{a as g}from"./chunk-O6VBO7KG.js";import{a as l}from"./chunk-WCGUGIGJ.js";import{a as o}from"./chunk-Y3U34F7K.js";import{c as m,g as a}from"./chunk-J3R36SGJ.js";import{validateAPIKey as p,WithLoggerContext as w}from"@crossmint/common-sdk-base";var f=class{constructor(r){this.config=r;this._needsAuth=!0;this._authPromise=null;this._initializationPromise=null;typeof window!="undefined"&&(this._initializationPromise=this.initialize()),this.type=this.config.type}locator(){return this.config.locator}address(){return this.config.address}initialize(){return a(this,null,function*(){try{if(this.config.clientTEEConnection==null){let r=p(this.config.crossmint.apiKey);if(!r.isValid)throw new Error("Invalid API key");let t=new g({environment:r.environment});this.config.clientTEEConnection=yield t.initialize()}}finally{this._initializationPromise=null}})}getTEEConnection(){return a(this,null,function*(){if(this.config.clientTEEConnection==null){if(this._initializationPromise){if(yield this._initializationPromise,this.config.clientTEEConnection==null)throw new Error("Failed to initialize TEE connection");return this.config.clientTEEConnection}this._initializationPromise=this.initializeTEEConnection();try{yield this._initializationPromise}finally{this._initializationPromise=null}}if(this.config.clientTEEConnection==null)throw new Error("TEE connection is not initialized");return this.config.clientTEEConnection})}initializeTEEConnection(){return a(this,null,function*(){o.info("TEE connection not initialized, initializing now");let r=p(this.config.crossmint.apiKey);if(!r.isValid)throw new Error("Invalid API key");let t=new g({environment:r.environment});if(this.config.clientTEEConnection=yield t.initialize(),this.config.clientTEEConnection==null)throw new Error("Failed to initialize TEE connection");o.info("TEE connection initialized successfully")})}handleAuthRequired(){return a(this,null,function*(){var u;let r=yield this.getTEEConnection();if(this.config.onAuthRequired==null)throw new Error(`${this.type} signer requires the onAuthRequired callback to handle OTP verification. This callback manages the authentication flow (sending OTP and verifying user input). If using our React/React Native SDK, this is handled automatically by the provider. For other environments, implement: onAuthRequired: (needsAuth, sendOtp, verifyOtp, reject) => { /* your UI logic */ }`);o.info("get-status: sending request");let t=Date.now(),n=yield r.sendAction({event:"request:get-status",responseEvent:"response:get-status",data:{authData:{jwt:(u=this.config.crossmint.jwt)!=null?u:"",apiKey:this.config.crossmint.apiKey}},options:d}),i=Date.now()-t;if((n==null?void 0:n.status)!=="success")throw o.error("get-status: failed",{status:n==null?void 0:n.status,error:n==null?void 0:n.error,durationMs:i}),new Error(n==null?void 0:n.error);if(o.info("get-status: response received",{signerStatus:n.signerStatus,durationMs:i}),n.signerStatus==="ready"){this._needsAuth=!1;return}else this._needsAuth=!0;o.info("Auth required, initiating OTP flow",{needsAuth:this._needsAuth});let{promise:s,resolve:h,reject:c}=this.createAuthPromise();if(this._authPromise={promise:s,resolve:h,reject:c},this.config.onAuthRequired)try{yield this.config.onAuthRequired(this.config.type,this.locator(),this._needsAuth,()=>this.sendMessageWithOtp(),e=>this.verifyOtp(e),()=>a(this,null,function*(){o.info("Auth rejected",{authRejected:!0}),this._needsAuth=!1,this.config.onAuthRequired!=null&&(yield this.config.onAuthRequired(this.config.type,this.locator(),this._needsAuth,()=>this.sendMessageWithOtp(),e=>this.verifyOtp(e),()=>{var e;return(e=this._authPromise)==null?void 0:e.reject(new l)})),c(new l)}))}catch(e){o.error("handleAuthRequired error",{error:e}),c(e)}try{yield s}catch(e){throw o.error("handleAuthRequired promise error",{error:e}),e}})}ensureAuthenticated(){return a(this,null,function*(){yield this.handleAuthRequired()})}getJwtOrThrow(){let r=this.config.crossmint.jwt;if(r==null)throw new Error("JWT is required");return r}createAuthPromise(){let r,t;return{promise:new Promise((i,s)=>{r=i,t=s}),resolve:r,reject:t}}sendMessageWithOtp(){return a(this,null,function*(){var h,c;let r=yield this.getTEEConnection(),t=this.getAuthId();o.info("start-onboarding: sending request");let n=Date.now(),i=yield r.sendAction({event:"request:start-onboarding",responseEvent:"response:start-onboarding",data:{authData:{jwt:(h=this.config.crossmint.jwt)!=null?h:"",apiKey:this.config.crossmint.apiKey},data:{authId:t}},options:d}),s=Date.now()-n;if(o.info("start-onboarding: response received",{status:i==null?void 0:i.status,durationMs:s}),(i==null?void 0:i.status)==="success"&&i.signerStatus==="ready"){this._needsAuth=!1;return}(i==null?void 0:i.status)==="error"&&(o.error("start-onboarding: failed",{error:i.error}),(c=this._authPromise)==null||c.reject(new Error(i.error||"Failed to initiate OTP process.")))})}getAuthId(){return this.config.type==="email"?`email:${this.config.email}`:`phone:${this.config.phone}`}verifyOtp(r){return a(this,null,function*(){var s,h,c,u;let t;try{let e=yield this.getTEEConnection();o.info("complete-onboarding: sending request");let E=Date.now();t=yield e.sendAction({event:"request:complete-onboarding",responseEvent:"response:complete-onboarding",data:{authData:{jwt:(s=this.config.crossmint.jwt)!=null?s:"",apiKey:this.config.crossmint.apiKey},data:{onboardingAuthentication:{encryptedOtp:r}}},options:d}),o.info("complete-onboarding: response received",{status:t==null?void 0:t.status,durationMs:Date.now()-E})}catch(e){throw o.error("complete-onboarding: error",{error:e}),this._needsAuth=!0,(h=this._authPromise)==null||h.reject(e),e}if((t==null?void 0:t.status)==="success"){this._needsAuth=!1,this.config.onAuthRequired!=null&&(yield this.config.onAuthRequired(this.config.type,this.locator(),this._needsAuth,()=>this.sendMessageWithOtp(),e=>this.verifyOtp(e),()=>{var e;return(e=this._authPromise)==null?void 0:e.reject(new l)})),(c=this._authPromise)==null||c.resolve();return}o.error("complete-onboarding: OTP validation failed",{status:t==null?void 0:t.status}),this._needsAuth=!0;let n=(t==null?void 0:t.status)==="error"?t.error:"Failed to validate encrypted OTP",i=new Error(n);throw(u=this._authPromise)==null||u.reject(i),i})}_exportPrivateKey(r){return a(this,null,function*(){yield this.handleAuthRequired();let t=this.getJwtOrThrow(),{scheme:n,encoding:i}=this.getChainKeyParams(),s=yield r.sendAction({event:"request:export-signer",responseEvent:"response:export-signer",data:{authData:{jwt:t,apiKey:this.config.crossmint.apiKey},data:{scheme:n,encoding:i}},options:d});if((s==null?void 0:s.status)==="error")throw new Error(s.error||"Failed to export private key")})}};m([w({logger:o,methodName:"handleAuthRequired"})],f.prototype,"handleAuthRequired",1);var d={timeoutMs:3e4};export{f as a,d as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as S}from"./chunk-6X5JEJD7.js";import{a as l}from"./chunk-
|
|
1
|
+
import{a as S}from"./chunk-6X5JEJD7.js";import{a as l}from"./chunk-EMW6MVFF.js";import{a as i}from"./chunk-XOEAILGF.js";import{a as t}from"./chunk-SJZXH2AI.js";import{a as C}from"./chunk-EE4ITUGS.js";import{a as u}from"./chunk-CKZYSQOK.js";import{a as p}from"./chunk-QVTKTDED.js";import{a as s}from"./chunk-XS5B3TUE.js";import{a as m}from"./chunk-M335XCYO.js";import{a as g}from"./chunk-YH7G2U6V.js";import{a as o}from"./chunk-W7LJS32A.js";import{g as a}from"./chunk-EXC7TCGL.js";function V(r,e,n){switch(e.type){case"email":case"phone":return r==="solana"?new t(e):r==="stellar"?new l(e):new i(e);case"api-key":return r==="solana"?new g(e):new p(e);case"external-wallet":return r==="solana"?new o(e):r==="stellar"?new C(e):new s(e);case"server":return S(r,e);case"passkey":return new m(e);case"device":if(n==null)throw new a("Device signer key storage is required for device signers");return new u(e,n)}}export{V as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-BQ5AOSHX.js";import{a as s}from"./chunk-N4IWDL6M.js";import{a as l}from"./chunk-ZYB4O4OG.js";import{a,b as i}from"./chunk-Y3U34F7K.js";import{g as r}from"./chunk-J3R36SGJ.js";import{createCrossmint as C}from"@crossmint/common-sdk-base";import{WebAuthnP256 as p}from"ox";var o=class c{constructor(e){i(e.apiKey);let t=new l(e);this.walletFactory=new n(t),a.info("wallets.sdk.initialized")}static from(e){return new c(e)}getWallet(e,t){return r(this,null,function*(){if(typeof e=="string"){if(t==null)throw new Error("Args parameter is required when walletLocator is provided");return yield this.walletFactory.getWallet(e,t)}return yield this.walletFactory.getWallet(e)})}createWallet(e){return r(this,null,function*(){return yield this.walletFactory.createWallet(e)})}createDeviceSigner(e,t){return r(this,null,function*(){return yield s(e,t)})}createPasskeySigner(e){return r(this,null,function*(){let t=yield p.createCredential({name:e});return{type:"passkey",id:t.id,name:e,publicKey:{x:t.publicKey.x.toString(),y:t.publicKey.y.toString()}}})}};export{C as a,o as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s="@crossmint/wallets-sdk",t="1.0.3";var c="WALLETS_SDK",r=t,a=s,d=500;export{c as a,r as b,a as c,d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s,b as o}from"./chunk-
|
|
1
|
+
import{a as s,b as o}from"./chunk-PDNXECMW.js";import{a as r}from"./chunk-Y3U34F7K.js";import{g as t}from"./chunk-J3R36SGJ.js";import{VersionedTransaction as u}from"@solana/web3.js";import a from"bs58";var g=class c extends s{constructor(n){super(n)}signMessage(){return t(this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for email signer"))})}signTransaction(n){return t(this,null,function*(){var i;yield this.handleAuthRequired();let d=this.getJwtOrThrow(),m=a.decode(n),y=u.deserialize(m).message.serialize();r.info("sign: sending request",{keyType:"ed25519"});let l=Date.now(),e=yield(i=this.config.clientTEEConnection)==null?void 0:i.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:d,apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:a.encode(new Uint8Array(y)),encoding:"base58"}},options:o});if(r.info("sign: response received",{status:e==null?void 0:e.status,durationMs:Date.now()-l}),(e==null?void 0:e.status)==="error")throw new Error(e.error);if((e==null?void 0:e.signature)==null)throw new Error("Failed to sign transaction");return c.verifyPublicKeyFormat(e.publicKey),{signature:e.signature.bytes}})}static verifyPublicKeyFormat(n){if(n==null)throw new Error("No public key found");if(n.encoding!=="base58"||n.keyType!=="ed25519"||n.bytes==null)throw new Error("Not supported. Expected public key to be in base58 encoding and ed25519 key type. Got: "+JSON.stringify(n))}getChainKeyParams(){return{scheme:"ed25519",encoding:"base58"}}};export{g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkMFGW7RMOcjs = require('./chunk-MFGW7RMO.cjs');var _chunk5NWPCMOCcjs = require('./chunk-5NWPCMOC.cjs');var _chunk2GKPWQBQcjs = require('./chunk-2GKPWQBQ.cjs');var a=class g extends _chunkMFGW7RMOcjs.a{constructor(n){super(n)}signMessage(){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for stellar signer"))})}signTransaction(n){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){var i;yield this.handleAuthRequired();let c=this.getJwtOrThrow();_chunk5NWPCMOCcjs.a.info("sign: sending request",{keyType:"ed25519"});let d=Date.now(),e=yield(i=this.config.clientTEEConnection)==null?void 0:i.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:c,apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:n,encoding:"base64"}},options:_chunkMFGW7RMOcjs.b});if(_chunk5NWPCMOCcjs.a.info("sign: response received",{status:e==null?void 0:e.status,durationMs:Date.now()-d}),(e==null?void 0:e.status)==="error")throw new Error(e.error);if((e==null?void 0:e.signature)==null)throw new Error("Failed to sign transaction");if(g.verifyPublicKeyFormat(e.publicKey),e.signature.encoding!=="base64")throw new Error("Wrong encoding for signature. Expected base64, got "+e.signature.encoding);return{signature:e.signature.bytes}})}static verifyPublicKeyFormat(n){if(n==null)throw new Error("No public key found");if(n.encoding!=="base64"||n.keyType!=="ed25519"||n.bytes==null)throw new Error("Not supported. Expected public key to be in base64 encoding and ed25519 key type. Got: "+JSON.stringify(n))}getChainKeyParams(){return{scheme:"ed25519",encoding:"strkey"}}};exports.a = a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk4PR5PN3Zcjs = require('./chunk-4PR5PN3Z.cjs');var _chunk3VSFHDFHcjs = require('./chunk-3VSFHDFH.cjs');var _chunk6EZCCLTKcjs = require('./chunk-6EZCCLTK.cjs');var _chunkT3U46LK3cjs = require('./chunk-T3U46LK3.cjs');var _chunk5NWPCMOCcjs = require('./chunk-5NWPCMOC.cjs');var _chunk2GKPWQBQcjs = require('./chunk-2GKPWQBQ.cjs');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var _commonsdkbase = require('@crossmint/common-sdk-base');var o=class o extends _chunk4PR5PN3Zcjs.a{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,options:_chunk4PR5PN3Zcjs.a.getOptions(n),alias:n.alias,recovery:_chunk4PR5PN3Zcjs.a.getRecovery(n),signer:n.signer,signers:_chunk4PR5PN3Zcjs.a.getInitialSigners(n)},_chunk4PR5PN3Zcjs.a.getApiClient(n))}static from(n){if(!_commonsdkbase.isValidSolanaAddress.call(void 0, n.address))throw new Error("Wallet is not a Solana wallet");return new o(n)}sendTransaction(n){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){var d,p;_chunk5NWPCMOCcjs.a.info("solanaWallet.sendTransaction.start"),yield this.preAuthIfNeeded();let e=yield this.createTransaction(n);if((d=n.options)!=null&&d.prepareOnly)return _chunk5NWPCMOCcjs.a.info("solanaWallet.sendTransaction.prepared",{transactionId:e.id}),{hash:void 0,explorerLink:void 0,transactionId:e.id};let t={additionalSigners:(p=n.additionalSigners)==null?void 0:p.map(c=>new (0, _chunk6EZCCLTKcjs.a)({type:"external-wallet",address:c.publicKey.toString(),locator:`external-wallet:${c.publicKey.toString()}`,onSign:h=>(h.sign([c]),Promise.resolve(h))}))},a=yield this.approveTransactionAndWait(e.id,t);return _chunk5NWPCMOCcjs.a.info("solanaWallet.sendTransaction.success",{transactionId:e.id,hash:a.hash}),a})}createTransaction(n){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){var a;let e;((a=n.options)==null?void 0:a.signer)==null?e=this.requireSigner().locator():typeof n.options.signer=="string"?e=n.options.signer:e=`server:${_chunk3VSFHDFHcjs.b.call(void 0, n.options.signer,this.chain,this.apiClient.projectId,this.apiClient.environment).derivedAddress}`;let s;"serializedTransaction"in n?s=n.serializedTransaction:s=_bs582.default.encode(n.transaction.serialize());let t=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:s,signer:e}});if("error"in t)throw new (0, _chunkT3U46LK3cjs.t)(JSON.stringify(t));return t})}};_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunk5NWPCMOCcjs.a,methodName:"solanaWallet.sendTransaction",buildContext(n){return{chain:n.chain,address:n.address}}})],o.prototype,"sendTransaction",1);var S=o;exports.a = S;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkMFGW7RMOcjs = require('./chunk-MFGW7RMO.cjs');var _chunk5NWPCMOCcjs = require('./chunk-5NWPCMOC.cjs');var _chunk2GKPWQBQcjs = require('./chunk-2GKPWQBQ.cjs');var _web3js = require('@solana/web3.js');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var g=class c extends _chunkMFGW7RMOcjs.a{constructor(n){super(n)}signMessage(){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for email signer"))})}signTransaction(n){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){var i;yield this.handleAuthRequired();let d=this.getJwtOrThrow(),m=_bs582.default.decode(n),y=_web3js.VersionedTransaction.deserialize(m).message.serialize();_chunk5NWPCMOCcjs.a.info("sign: sending request",{keyType:"ed25519"});let l=Date.now(),e=yield(i=this.config.clientTEEConnection)==null?void 0:i.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:d,apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:_bs582.default.encode(new Uint8Array(y)),encoding:"base58"}},options:_chunkMFGW7RMOcjs.b});if(_chunk5NWPCMOCcjs.a.info("sign: response received",{status:e==null?void 0:e.status,durationMs:Date.now()-l}),(e==null?void 0:e.status)==="error")throw new Error(e.error);if((e==null?void 0:e.signature)==null)throw new Error("Failed to sign transaction");return c.verifyPublicKeyFormat(e.publicKey),{signature:e.signature.bytes}})}static verifyPublicKeyFormat(n){if(n==null)throw new Error("No public key found");if(n.encoding!=="base58"||n.keyType!=="ed25519"||n.bytes==null)throw new Error("Not supported. Expected public key to be in base58 encoding and ed25519 key type. Got: "+JSON.stringify(n))}getChainKeyParams(){return{scheme:"ed25519",encoding:"base58"}}};exports.a = g;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3VYGTPRFcjs = require('./chunk-3VYGTPRF.cjs');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3VYGTPRFcjs = require('./chunk-3VYGTPRF.cjs');var _chunk5NWPCMOCcjs = require('./chunk-5NWPCMOC.cjs');var _chunk2GKPWQBQcjs = require('./chunk-2GKPWQBQ.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var _ox = require('ox');var b={[_commonsdkbase.APIKeyEnvironmentPrefix.DEVELOPMENT]:"https://development.devicekey.store",[_commonsdkbase.APIKeyEnvironmentPrefix.STAGING]:"https://staging.devicekey.store",[_commonsdkbase.APIKeyEnvironmentPrefix.PRODUCTION]:"https://devicekey.store"},P=6e4,K="indexeddb-fatal",c= exports.a =class extends _chunk3VYGTPRFcjs.a{constructor(e){super(e);this.iframePromise=null;this.reloading=null;this.biometricRequestHandler=null;this.biometricListener=null;let r=_commonsdkbase.getEnvironmentForKey.call(void 0, e);if(r==null)throw new Error("Unable to determine environment from API key");this.iframeUrl=b[r]}setBiometricRequestHandler(e){this.biometricRequestHandler=e}generateKey(){return _chunk2GKPWQBQcjs.g.call(void 0, this,arguments,function*(e={biometricPolicy:"none"}){return(yield this.rpc("generateKey",e)).publicKeyBase64})}mapAddressToKey(e,r){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){yield this.rpc("mapAddressToKey",{address:e,publicKeyBase64:r})})}getKey(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){return(yield this.rpc("getKey",{address:e})).publicKeyBase64})}hasKey(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){return(yield this.rpc("hasKey",{publicKeyBase64:e})).hasKey})}signMessage(e,r){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){return yield this.rpc("signMessage",{address:e,message:r})})}deleteKey(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){yield this.rpc("deleteKey",{address:e})})}destroy(){this.biometricListener!=null&&(window.removeEventListener("message",this.biometricListener),this.biometricListener=null),this.iframePromise!=null&&(this.iframePromise.then(e=>e.remove()).catch(()=>{}),this.iframePromise=null)}rpc(e,r){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){let i=yield this.sendRpc(e,r);if(i.fatal){_chunk5NWPCMOCcjs.a.warn(`[IframeDeviceSignerKeyStorage] Recoverable IDB error on "${e}", reloading iframe and retrying`),yield this.reloadIframe();let t=yield this.sendRpc(e,r);if(t.fatal)throw new Error(`Device signer IDB fatal error on "${e}" persisted after iframe reload`);return t.value}return i.value})}sendRpc(e,r){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){let t=(yield this.getIframe()).contentWindow;if(t==null)throw new Error("Device signer iframe has no contentWindow");let g=crypto.randomUUID(),a=new URL(this.iframeUrl).origin;return new Promise((s,o)=>{let f=setTimeout(()=>{window.removeEventListener("message",p),o(new Error(`Device signer RPC "${e}" timed out after ${P}ms`))},P);function p(y){let m=y.data;m==null||m.id!==g||y.origin===a&&(clearTimeout(f),window.removeEventListener("message",p),m.type==="error"&&m.code===K?s({fatal:!0}):m.type==="error"?o(new Error(m.error)):s({value:m.result,fatal:!1}))}window.addEventListener("message",p),t.postMessage({type:e,id:g,payload:r},this.iframeUrl)})})}reloadIframe(){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){if(this.reloading!=null)return this.reloading;let e=_chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){try{this.destroy(),yield this.getIframe()}finally{this.reloading=null}});return this.reloading=e,e})}setupBiometricListener(e){let r=new URL(this.iframeUrl).origin;this.biometricListener=i=>_chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){if(i.origin!==r)return;let t=i.data;if((t==null?void 0:t.type)!=="biometric-request")return;let g=e.contentWindow;if(g!=null)try{this.biometricRequestHandler!=null&&(yield this.biometricRequestHandler(t.action));let a=null;if(t.action==="createCredential"){let s=t.payload,o=yield _ox.WebAuthnP256.createCredential({name:s.name});a={id:o.id,publicKey:{x:`0x${o.publicKey.x.toString(16)}`,y:`0x${o.publicKey.y.toString(16)}`}}}else if(t.action==="sign"){let s=t.payload,{signature:o,metadata:f}=yield _ox.WebAuthnP256.sign({credentialId:s.credentialId,challenge:s.challenge});a={signature:{r:`0x${o.r.toString(16)}`,s:`0x${o.s.toString(16)}`},metadata:f}}g.postMessage({type:"biometric-response",id:t.id,result:a},this.iframeUrl)}catch(a){let s=a instanceof Error?a.message:"Unknown biometric error";g.postMessage({type:"biometric-response",id:t.id,error:s},this.iframeUrl)}}),window.addEventListener("message",this.biometricListener)}getIframe(){return this.iframePromise==null&&(this.iframePromise=this.createIframe().catch(e=>{throw this.iframePromise=null,e})),this.iframePromise}createIframe(){let e=document.createElement("iframe");return e.src=this.iframeUrl,Object.assign(e.style,{position:"absolute",opacity:"0",pointerEvents:"none",width:"0",height:"0",border:"none",top:"-9999px",left:"-9999px"}),new Promise((r,i)=>{e.onload=()=>{this.setupBiometricListener(e),r(e)},e.onerror=()=>i(new Error("Failed to load device signer iframe")),document.body.appendChild(e)})}getDeviceName(){var t;if(typeof navigator=="undefined")return"Unknown Device";let e=navigator.userAgent,r=this.parseDevice(e),i=this.parseBrowser(e);return r!=null&&i!=null?`${i} on ${r}`:(t=r!=null?r:i)!=null?t:"Unknown Device"}parseDevice(e){return/iPad/.test(e)?"iPad":/iPhone/.test(e)?"iPhone":/Macintosh|Mac OS X/.test(e)?"Mac":/Windows/.test(e)?"Windows":/Android/.test(e)?"Android":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"ChromeOS":null}parseBrowser(e){return/Edg\//.test(e)?"Edge":/OPR\/|Opera/.test(e)?"Opera":typeof navigator!="undefined"&&"brave"in navigator?"Brave":/Chrome\//.test(e)?"Chrome":/Safari\//.test(e)&&!/Chrome\//.test(e)?"Safari":/Firefox\//.test(e)?"Firefox":null}};_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunk5NWPCMOCcjs.a,methodName:"deviceSignerKeyStorage.generateKey"})],c.prototype,"generateKey",1),_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunk5NWPCMOCcjs.a,methodName:"deviceSignerKeyStorage.mapAddressToKey"})],c.prototype,"mapAddressToKey",1),_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunk5NWPCMOCcjs.a,methodName:"deviceSignerKeyStorage.getKey"})],c.prototype,"getKey",1),_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunk5NWPCMOCcjs.a,methodName:"deviceSignerKeyStorage.hasKey"})],c.prototype,"hasKey",1),_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunk5NWPCMOCcjs.a,methodName:"deviceSignerKeyStorage.signMessage"})],c.prototype,"signMessage",1),_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunk5NWPCMOCcjs.a,methodName:"deviceSignerKeyStorage.deleteKey"})],c.prototype,"deleteKey",1);exports.a = c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
1
|
+
import{a as i}from"./chunk-JXULWUYO.js";import{b as u}from"./chunk-RBSMBO4T.js";import{t as h}from"./chunk-EXC7TCGL.js";import{a as s}from"./chunk-Y3U34F7K.js";import{c as p,g as l}from"./chunk-J3R36SGJ.js";import{isValidStellarAddress as m,WithLoggerContext as y}from"@crossmint/common-sdk-base";var o=class o extends i{constructor(e){super({chain:e.chain,address:e.address,owner:e.owner,options:i.getOptions(e),alias:e.alias,recovery:i.getRecovery(e),signer:e.signer,signers:i.getInitialSigners(e)},i.getApiClient(e))}static from(e){if(!m(e.address))throw new Error("Wallet is not a Stellar wallet");return new o(e)}sendTransaction(e){return l(this,null,function*(){var a;s.info("stellarWallet.sendTransaction.start"),yield this.preAuthIfNeeded();let t=yield this.createTransaction(e);if((a=e.options)!=null&&a.prepareOnly)return s.info("stellarWallet.sendTransaction.prepared",{transactionId:t.id}),{hash:void 0,explorerLink:void 0,transactionId:t.id};let n={},r=yield this.approveTransactionAndWait(t.id,n);return s.info("stellarWallet.sendTransaction.success",{transactionId:t.id,hash:r.hash}),r})}createTransaction(e){return l(this,null,function*(){let{contractId:t,options:n}=e,r;(n==null?void 0:n.signer)==null?r=this.requireSigner().locator():typeof n.signer=="string"?r=n.signer:r=`server:${u(n.signer,this.chain,this.apiClient.projectId,this.apiClient.environment).derivedAddress}`;let a;if("transaction"in e)a={type:"serialized-transaction",serializedTransaction:e.transaction,contractId:t};else{let{method:T,memo:d,args:g}=e;a={type:"contract-call",contractId:t,method:T,memo:d!=null?{type:"text",value:d}:void 0,args:g}}let c=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:a,signer:r}});if("error"in c)throw new h(JSON.stringify(c));return c})}};p([y({logger:s,methodName:"stellarWallet.sendTransaction",buildContext(e){return{chain:e.chain,address:e.address}}})],o.prototype,"sendTransaction",1);var f=o;export{f as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b as g}from"./chunk-
|
|
1
|
+
import{a,b as g}from"./chunk-PDNXECMW.js";import{a as s}from"./chunk-Y3U34F7K.js";import{g as t}from"./chunk-J3R36SGJ.js";import{PersonalMessage as u}from"ox";import{isHex as h,toHex as l}from"viem";var c=class p extends a{constructor(e){super(e)}signMessage(e){return t(this,null,function*(){let i=h(e)?e:l(e),r=u.getSignPayload(i);return yield this.sign(r)})}signTransaction(e){return t(this,null,function*(){return yield this.sign(e)})}sign(e){return t(this,null,function*(){var o;yield this.handleAuthRequired();let i=this.getJwtOrThrow(),r=e.replace("0x","");s.info("sign: sending request",{keyType:"secp256k1"});let y=Date.now(),n=yield(o=this.config.clientTEEConnection)==null?void 0:o.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:i,apiKey:this.config.crossmint.apiKey},data:{keyType:"secp256k1",bytes:r,encoding:"hex"}},options:g});if(s.info("sign: response received",{status:n==null?void 0:n.status,durationMs:Date.now()-y}),(n==null?void 0:n.status)==="error")throw new Error(n.error);if((n==null?void 0:n.signature)==null)throw new Error("Failed to sign transaction");return p.verifyPublicKeyFormat(n.publicKey),{signature:n.signature.bytes}})}static verifyPublicKeyFormat(e){if(e==null)throw new Error("No public key found");if(e.encoding!=="hex"||e.keyType!=="secp256k1"||e.bytes==null)throw new Error("Not supported. Expected public key to be in hex encoding and secp256k1 key type. Got: "+JSON.stringify(e))}getChainKeyParams(){return{scheme:"secp256k1",encoding:"hex"}}};export{c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as n,c as i}from"./chunk-
|
|
1
|
+
import{b as n,c as i}from"./chunk-QZO3WO3R.js";import{SdkLogger as d,BrowserDatadogSink as k,detectPlatform as g,validateAPIKey as l,ServerDatadogSink as m}from"@crossmint/common-sdk-base";var t=new d;function f(s){let o=g(),e=l(s);if(!e.isValid)throw new Error(`Invalid API key: ${e.message}`);let{environment:a,projectId:c}=e;switch(t.init({packageName:i,packageVersion:n,environment:a,projectId:c,platform:o}),o){case"browser":{let r=new k(a);t.addSink(r);break}case"react-native":break;case"server":{let r=new m(a);t.addSink(r);break}default:break}}export{t as a,f as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"./chunk-EXC7TCGL.js";import{a as n}from"./chunk-
|
|
1
|
+
import{a as o}from"./chunk-EXC7TCGL.js";import{a as n}from"./chunk-Y3U34F7K.js";import{b as p,c as l}from"./chunk-QZO3WO3R.js";import{g as t}from"./chunk-J3R36SGJ.js";import{APIKeyEnvironmentPrefix as h,APIKeyUsageOrigin as d,CrossmintApiClient as g}from"@crossmint/common-sdk-base";var c=class extends g{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:l,version:p}}});this.apiPrefix="api/2025-06-09/wallets";this.unstableApiPrefix="api/unstable/wallets"}createWallet(e){return t(this,null,function*(){let s=this.isServerSide?`${this.apiPrefix}`:`${this.apiPrefix}/me`;n.info("wallets.api.createWallet",{chainType:e.chainType,walletType:e.type});let a=yield(yield this.post(s,{body:JSON.stringify(e),headers:this.headers})).json();return"error"in a?n.error("wallets.api.createWallet.error",{error:a.error,chainType:e.chainType}):"address"in a&&n.info("wallets.api.createWallet.success",{address:a.address,chainType:e.chainType}),a})}getWallet(e){return t(this,null,function*(){n.info("wallets.api.getWallet",{locator:e});let r=yield(yield this.get(`${this.apiPrefix}/${e}`,{headers:this.headers})).json();return"error"in r?n.warn("wallets.api.getWallet.error",{locator:e,error:r.error}):"address"in r&&n.info("wallets.api.getWallet.success",{address:r.address,locator:e}),r})}createTransaction(e,s){return t(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveTransaction(e,s,r){return t(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions/${s}/approvals`,{body:JSON.stringify(r),headers:this.headers})).json()})}getTransaction(e,s){return t(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions/${s}`,{headers:this.headers})).json()})}createSignature(e,s){return t(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signatures`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveSignature(e,s,r){return t(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signatures/${s}/approvals`,{body:JSON.stringify(r),headers:this.headers})).json()})}getSignature(e,s){return t(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signatures/${s}`,{headers:this.headers})).json()})}getTransactions(e){return t(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions`,{headers:this.headers})).json()})}getNfts(e){return t(this,null,function*(){let s=new URLSearchParams;s.append("page",e.page.toString()),s.append("perPage",e.perPage.toString());let r=`${e.chain}:${e.address}`;return(yield this.get(`${this.apiPrefix}/${r}/nfts?${s.toString()}`,{headers:this.headers})).json()})}getTransfers(e,s){return t(this,null,function*(){let r=new URLSearchParams;return r.append("chain",s.chain.toString()),s.tokens!=null&&r.append("tokens",s.tokens),s.status!=null&&r.append("status",s.status),(yield this.get(`${this.unstableApiPrefix}/${e}/transfers?${r.toString()}`,{headers:this.headers})).json()})}getBalance(e,s){return t(this,null,function*(){let r=new URLSearchParams;return r.append("tokens",s.tokens.join(",")),r.append("chains",s.chains.join(",")),(yield this.get(`${this.apiPrefix}/${e}/balances?${r.toString()}`,{headers:this.headers})).json()})}fundWallet(e,s){return t(this,null,function*(){if(this.environment===h.PRODUCTION)throw new Error("Funding wallets is only supported in staging environment");return(yield this.post(`api/v1-alpha2/wallets/${e}/balances`,{body:JSON.stringify(s),headers:this.headers})).json()})}registerSigner(e,s){return t(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signers`,{body:JSON.stringify(s),headers:this.headers})).json()})}getSigner(e,s){return t(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signers/${s}`,{headers:this.headers})).json()})}send(e,s,r){return t(this,null,function*(){n.info("wallets.api.send",{walletLocator:e,tokenLocator:s,recipient:r.recipient});let i=yield(yield this.post(`${this.apiPrefix}/${e}/tokens/${s}/transfers`,{body:JSON.stringify(r),headers:this.headers})).json();return"error"in i?n.error("wallets.api.send.error",{walletLocator:e,tokenLocator:s,error:i.error}):"id"in i&&n.info("wallets.api.send.success",{walletLocator:e,transactionId:i.id}),i})}get isServerSide(){return this.parsedAPIKey.usageOrigin===d.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new o("Invalid API key");return this.parsedAPIKey.environment}get projectId(){if(!this.parsedAPIKey.isValid)throw new o("Invalid API key");return this.parsedAPIKey.projectId}get headers(){return{"Content-Type":"application/json"}}};export{c as a};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkEHN3LSAJcjs = require('./chunk-EHN3LSAJ.cjs');var _chunkUJQJXFDScjs = require('./chunk-UJQJXFDS.cjs');var _chunkM7NL3LREcjs = require('./chunk-M7NL3LRE.cjs');var _chunk2EZHDAMNcjs = require('./chunk-2EZHDAMN.cjs');require('./chunk-LWTPWZZS.cjs');require('./chunk-K5TQ4QU3.cjs');var _chunk4PR5PN3Zcjs = require('./chunk-4PR5PN3Z.cjs');require('./chunk-CUHDOBKN.cjs');var _chunkYHV3672Rcjs = require('./chunk-YHV3672R.cjs');var _chunkWQTRX7MNcjs = require('./chunk-WQTRX7MN.cjs');var _chunk3VYGTPRFcjs = require('./chunk-3VYGTPRF.cjs');require('./chunk-NX256LAH.cjs');require('./chunk-D6SLJ5C2.cjs');require('./chunk-5DAPKXB7.cjs');require('./chunk-5IC7UWND.cjs');require('./chunk-GZP2JQ6P.cjs');require('./chunk-IGRPHTXZ.cjs');require('./chunk-3VSFHDFH.cjs');require('./chunk-ENU3EKBG.cjs');require('./chunk-3SVXPFSP.cjs');require('./chunk-4DJWSV7I.cjs');require('./chunk-YF5G4U6L.cjs');require('./chunk-PO6S7UR3.cjs');require('./chunk-TMY52Z53.cjs');require('./chunk-23KPZFOG.cjs');require('./chunk-WLC6H25S.cjs');require('./chunk-MFGW7RMO.cjs');require('./chunk-JBP52JOH.cjs');require('./chunk-5FH7WFWL.cjs');require('./chunk-SPTXAOFR.cjs');var _chunk5QIW67NUcjs = require('./chunk-5QIW67NU.cjs');require('./chunk-YGL4ITFK.cjs');require('./chunk-GEY3BU62.cjs');require('./chunk-PHPBBEXU.cjs');require('./chunk-A33BEWR7.cjs');require('./chunk-OGP7B5O3.cjs');require('./chunk-IJ632UXD.cjs');require('./chunk-6EZCCLTK.cjs');require('./chunk-SCEPJO4Q.cjs');require('./chunk-6HXIZLEQ.cjs');var _chunk27J74EMScjs = require('./chunk-27J74EMS.cjs');require('./chunk-ECAM5KTH.cjs');require('./chunk-4I3RUK4J.cjs');require('./chunk-GEY574TH.cjs');require('./chunk-UE3WVHTM.cjs');require('./chunk-5X4EOJFG.cjs');require('./chunk-HRUMWG2F.cjs');require('./chunk-IR5WN6FQ.cjs');var _chunkT3U46LK3cjs = require('./chunk-T3U46LK3.cjs');require('./chunk-CCIGWTAO.cjs');require('./chunk-5NWPCMOC.cjs');require('./chunk-4SXMOTDH.cjs');require('./chunk-2GKPWQBQ.cjs');exports.CrossmintWallets = _chunk2EZHDAMNcjs.b; exports.DeviceSignerKeyStorage = _chunk3VYGTPRFcjs.a; exports.EVMWallet = _chunkEHN3LSAJcjs.a; exports.IframeDeviceSignerKeyStorage = _chunkWQTRX7MNcjs.a; exports.InvalidTransferAmountError = _chunkT3U46LK3cjs.s; exports.SolanaWallet = _chunkUJQJXFDScjs.a; exports.StellarWallet = _chunkM7NL3LREcjs.a; exports.Wallet = _chunk4PR5PN3Zcjs.a; exports.WalletNotAvailableError = _chunkT3U46LK3cjs.e; exports.WalletsApiClient = _chunk27J74EMScjs.a; exports.createCrossmint = _chunk2EZHDAMNcjs.a; exports.createDeviceSigner = _chunkYHV3672Rcjs.a; exports.isExportableSignerAdapter = _chunk5QIW67NUcjs.b;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as p}from"./chunk-
|
|
1
|
+
import{a as p}from"./chunk-EGGND7OJ.js";import{a as S}from"./chunk-3NMSHSGP.js";import{a as f}from"./chunk-XHLLW7MX.js";import{a as g,b as s}from"./chunk-QBXXVIRU.js";import"./chunk-BQ5AOSHX.js";import"./chunk-YIO5XXQ4.js";import{a as l}from"./chunk-JXULWUYO.js";import"./chunk-TOAFCAVT.js";import{a as o}from"./chunk-N4IWDL6M.js";import{a as i}from"./chunk-NMZLDVBQ.js";import{a as n}from"./chunk-IOSADDL5.js";import"./chunk-GOXB2RBF.js";import"./chunk-VADIEIDS.js";import"./chunk-PQZP5ZKI.js";import"./chunk-L52GDMSH.js";import"./chunk-6X5JEJD7.js";import"./chunk-QM3BB4E2.js";import"./chunk-RBSMBO4T.js";import"./chunk-OQZTL6ZG.js";import"./chunk-N355UETO.js";import"./chunk-3VRN3GKQ.js";import"./chunk-BITOMWYZ.js";import"./chunk-YDZRBHS3.js";import"./chunk-EMW6MVFF.js";import"./chunk-XOEAILGF.js";import"./chunk-SJZXH2AI.js";import"./chunk-PDNXECMW.js";import"./chunk-O6VBO7KG.js";import"./chunk-EM3D5Q3A.js";import"./chunk-EE4ITUGS.js";import{b as a}from"./chunk-WCGUGIGJ.js";import"./chunk-XNZLCUTY.js";import"./chunk-CKZYSQOK.js";import"./chunk-QVTKTDED.js";import"./chunk-XS5B3TUE.js";import"./chunk-M335XCYO.js";import"./chunk-YH7G2U6V.js";import"./chunk-W7LJS32A.js";import"./chunk-2YLRFJ66.js";import"./chunk-5IFDVB4Y.js";import{a as t}from"./chunk-ZYB4O4OG.js";import"./chunk-KBJA7JDT.js";import"./chunk-EFQFA33E.js";import"./chunk-S3DYQVRD.js";import"./chunk-KUP7H7X2.js";import"./chunk-FT5EVMLB.js";import"./chunk-SVIKBM3S.js";import"./chunk-KKQBZXFE.js";import{e,s as r}from"./chunk-EXC7TCGL.js";import"./chunk-455NK5LB.js";import"./chunk-Y3U34F7K.js";import"./chunk-QZO3WO3R.js";import"./chunk-J3R36SGJ.js";export{s as CrossmintWallets,n as DeviceSignerKeyStorage,p as EVMWallet,i as IframeDeviceSignerKeyStorage,r as InvalidTransferAmountError,S as SolanaWallet,f as StellarWallet,l as Wallet,e as WalletNotAvailableError,t as WalletsApiClient,g as createCrossmint,o as createDeviceSigner,a as isExportableSignerAdapter};
|
package/dist/logger/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-CCIGWTAO.cjs');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-CCIGWTAO.cjs');var _chunk5NWPCMOCcjs = require('../chunk-5NWPCMOC.cjs');require('../chunk-4SXMOTDH.cjs');require('../chunk-2GKPWQBQ.cjs');exports.initWalletsLogger = _chunk5NWPCMOCcjs.b; exports.walletsLogger = _chunk5NWPCMOCcjs.a;
|
package/dist/logger/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-455NK5LB.js";import{a,b}from"../chunk-
|
|
1
|
+
import"../chunk-455NK5LB.js";import{a,b}from"../chunk-Y3U34F7K.js";import"../chunk-QZO3WO3R.js";import"../chunk-J3R36SGJ.js";export{b as initWalletsLogger,a as walletsLogger};
|
package/dist/logger/init.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5NWPCMOCcjs = require('../chunk-5NWPCMOC.cjs');require('../chunk-4SXMOTDH.cjs');require('../chunk-2GKPWQBQ.cjs');exports.initWalletsLogger = _chunk5NWPCMOCcjs.b; exports.walletsLogger = _chunk5NWPCMOCcjs.a;
|
package/dist/logger/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-Y3U34F7K.js";import"../chunk-QZO3WO3R.js";import"../chunk-J3R36SGJ.js";export{b as initWalletsLogger,a as walletsLogger};
|
package/dist/sdk.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2EZHDAMNcjs = require('./chunk-2EZHDAMN.cjs');require('./chunk-LWTPWZZS.cjs');require('./chunk-K5TQ4QU3.cjs');require('./chunk-4PR5PN3Z.cjs');require('./chunk-CUHDOBKN.cjs');require('./chunk-YHV3672R.cjs');require('./chunk-WQTRX7MN.cjs');require('./chunk-3VYGTPRF.cjs');require('./chunk-NX256LAH.cjs');require('./chunk-D6SLJ5C2.cjs');require('./chunk-5DAPKXB7.cjs');require('./chunk-5IC7UWND.cjs');require('./chunk-GZP2JQ6P.cjs');require('./chunk-IGRPHTXZ.cjs');require('./chunk-3VSFHDFH.cjs');require('./chunk-ENU3EKBG.cjs');require('./chunk-3SVXPFSP.cjs');require('./chunk-4DJWSV7I.cjs');require('./chunk-YF5G4U6L.cjs');require('./chunk-PO6S7UR3.cjs');require('./chunk-TMY52Z53.cjs');require('./chunk-23KPZFOG.cjs');require('./chunk-WLC6H25S.cjs');require('./chunk-MFGW7RMO.cjs');require('./chunk-JBP52JOH.cjs');require('./chunk-5FH7WFWL.cjs');require('./chunk-SPTXAOFR.cjs');require('./chunk-5QIW67NU.cjs');require('./chunk-YGL4ITFK.cjs');require('./chunk-GEY3BU62.cjs');require('./chunk-PHPBBEXU.cjs');require('./chunk-A33BEWR7.cjs');require('./chunk-OGP7B5O3.cjs');require('./chunk-IJ632UXD.cjs');require('./chunk-6EZCCLTK.cjs');require('./chunk-SCEPJO4Q.cjs');require('./chunk-6HXIZLEQ.cjs');require('./chunk-27J74EMS.cjs');require('./chunk-ECAM5KTH.cjs');require('./chunk-4I3RUK4J.cjs');require('./chunk-GEY574TH.cjs');require('./chunk-UE3WVHTM.cjs');require('./chunk-5X4EOJFG.cjs');require('./chunk-HRUMWG2F.cjs');require('./chunk-IR5WN6FQ.cjs');require('./chunk-T3U46LK3.cjs');require('./chunk-CCIGWTAO.cjs');require('./chunk-5NWPCMOC.cjs');require('./chunk-4SXMOTDH.cjs');require('./chunk-2GKPWQBQ.cjs');exports.CrossmintWallets = _chunk2EZHDAMNcjs.b; exports.createCrossmint = _chunk2EZHDAMNcjs.a;
|
package/dist/sdk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-QBXXVIRU.js";import"./chunk-BQ5AOSHX.js";import"./chunk-YIO5XXQ4.js";import"./chunk-JXULWUYO.js";import"./chunk-TOAFCAVT.js";import"./chunk-N4IWDL6M.js";import"./chunk-NMZLDVBQ.js";import"./chunk-IOSADDL5.js";import"./chunk-GOXB2RBF.js";import"./chunk-VADIEIDS.js";import"./chunk-PQZP5ZKI.js";import"./chunk-L52GDMSH.js";import"./chunk-6X5JEJD7.js";import"./chunk-QM3BB4E2.js";import"./chunk-RBSMBO4T.js";import"./chunk-OQZTL6ZG.js";import"./chunk-N355UETO.js";import"./chunk-3VRN3GKQ.js";import"./chunk-BITOMWYZ.js";import"./chunk-YDZRBHS3.js";import"./chunk-EMW6MVFF.js";import"./chunk-XOEAILGF.js";import"./chunk-SJZXH2AI.js";import"./chunk-PDNXECMW.js";import"./chunk-O6VBO7KG.js";import"./chunk-EM3D5Q3A.js";import"./chunk-EE4ITUGS.js";import"./chunk-WCGUGIGJ.js";import"./chunk-XNZLCUTY.js";import"./chunk-CKZYSQOK.js";import"./chunk-QVTKTDED.js";import"./chunk-XS5B3TUE.js";import"./chunk-M335XCYO.js";import"./chunk-YH7G2U6V.js";import"./chunk-W7LJS32A.js";import"./chunk-2YLRFJ66.js";import"./chunk-5IFDVB4Y.js";import"./chunk-ZYB4O4OG.js";import"./chunk-KBJA7JDT.js";import"./chunk-EFQFA33E.js";import"./chunk-S3DYQVRD.js";import"./chunk-KUP7H7X2.js";import"./chunk-FT5EVMLB.js";import"./chunk-SVIKBM3S.js";import"./chunk-KKQBZXFE.js";import"./chunk-EXC7TCGL.js";import"./chunk-455NK5LB.js";import"./chunk-Y3U34F7K.js";import"./chunk-QZO3WO3R.js";import"./chunk-J3R36SGJ.js";export{b as CrossmintWallets,a as createCrossmint};
|
package/dist/signers/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5DAPKXB7cjs = require('../chunk-5DAPKXB7.cjs');require('../chunk-5IC7UWND.cjs');require('../chunk-GZP2JQ6P.cjs');require('../chunk-IGRPHTXZ.cjs');require('../chunk-3VSFHDFH.cjs');require('../chunk-ENU3EKBG.cjs');require('../chunk-3SVXPFSP.cjs');require('../chunk-4DJWSV7I.cjs');require('../chunk-YF5G4U6L.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-TMY52Z53.cjs');require('../chunk-23KPZFOG.cjs');require('../chunk-WLC6H25S.cjs');require('../chunk-MFGW7RMO.cjs');require('../chunk-JBP52JOH.cjs');require('../chunk-5FH7WFWL.cjs');require('../chunk-SPTXAOFR.cjs');require('../chunk-5QIW67NU.cjs');require('../chunk-YGL4ITFK.cjs');require('../chunk-GEY3BU62.cjs');require('../chunk-PHPBBEXU.cjs');require('../chunk-A33BEWR7.cjs');require('../chunk-OGP7B5O3.cjs');require('../chunk-IJ632UXD.cjs');require('../chunk-6EZCCLTK.cjs');require('../chunk-SCEPJO4Q.cjs');require('../chunk-T3U46LK3.cjs');require('../chunk-CCIGWTAO.cjs');require('../chunk-5NWPCMOC.cjs');require('../chunk-4SXMOTDH.cjs');require('../chunk-2GKPWQBQ.cjs');exports.assembleSigner = _chunk5DAPKXB7cjs.a;
|
package/dist/signers/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-PQZP5ZKI.js";import"../chunk-L52GDMSH.js";import"../chunk-6X5JEJD7.js";import"../chunk-QM3BB4E2.js";import"../chunk-RBSMBO4T.js";import"../chunk-OQZTL6ZG.js";import"../chunk-N355UETO.js";import"../chunk-3VRN3GKQ.js";import"../chunk-BITOMWYZ.js";import"../chunk-YDZRBHS3.js";import"../chunk-EMW6MVFF.js";import"../chunk-XOEAILGF.js";import"../chunk-SJZXH2AI.js";import"../chunk-PDNXECMW.js";import"../chunk-O6VBO7KG.js";import"../chunk-EM3D5Q3A.js";import"../chunk-EE4ITUGS.js";import"../chunk-WCGUGIGJ.js";import"../chunk-XNZLCUTY.js";import"../chunk-CKZYSQOK.js";import"../chunk-QVTKTDED.js";import"../chunk-XS5B3TUE.js";import"../chunk-M335XCYO.js";import"../chunk-YH7G2U6V.js";import"../chunk-W7LJS32A.js";import"../chunk-2YLRFJ66.js";import"../chunk-EXC7TCGL.js";import"../chunk-455NK5LB.js";import"../chunk-Y3U34F7K.js";import"../chunk-QZO3WO3R.js";import"../chunk-J3R36SGJ.js";export{a as assembleSigner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-PO6S7UR3.cjs');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-PO6S7UR3.cjs');var _chunkTMY52Z53cjs = require('../../chunk-TMY52Z53.cjs');var _chunk23KPZFOGcjs = require('../../chunk-23KPZFOG.cjs');var _chunkWLC6H25Scjs = require('../../chunk-WLC6H25S.cjs');var _chunkMFGW7RMOcjs = require('../../chunk-MFGW7RMO.cjs');require('../../chunk-JBP52JOH.cjs');require('../../chunk-5QIW67NU.cjs');require('../../chunk-CCIGWTAO.cjs');require('../../chunk-5NWPCMOC.cjs');require('../../chunk-4SXMOTDH.cjs');require('../../chunk-2GKPWQBQ.cjs');exports.DEFAULT_EVENT_OPTIONS = _chunkMFGW7RMOcjs.b; exports.EVMNonCustodialSigner = _chunk23KPZFOGcjs.a; exports.NonCustodialSigner = _chunkMFGW7RMOcjs.a; exports.SolanaNonCustodialSigner = _chunkWLC6H25Scjs.a; exports.StellarNonCustodialSigner = _chunkTMY52Z53cjs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-YDZRBHS3.js";import{a as e}from"../../chunk-
|
|
1
|
+
import"../../chunk-YDZRBHS3.js";import{a as e}from"../../chunk-EMW6MVFF.js";import{a as d}from"../../chunk-XOEAILGF.js";import{a as c}from"../../chunk-SJZXH2AI.js";import{a,b}from"../../chunk-PDNXECMW.js";import"../../chunk-O6VBO7KG.js";import"../../chunk-WCGUGIGJ.js";import"../../chunk-455NK5LB.js";import"../../chunk-Y3U34F7K.js";import"../../chunk-QZO3WO3R.js";import"../../chunk-J3R36SGJ.js";export{b as DEFAULT_EVENT_OPTIONS,d as EVMNonCustodialSigner,a as NonCustodialSigner,c as SolanaNonCustodialSigner,e as StellarNonCustodialSigner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk23KPZFOGcjs = require('../../chunk-23KPZFOG.cjs');require('../../chunk-MFGW7RMO.cjs');require('../../chunk-JBP52JOH.cjs');require('../../chunk-5QIW67NU.cjs');require('../../chunk-CCIGWTAO.cjs');require('../../chunk-5NWPCMOC.cjs');require('../../chunk-4SXMOTDH.cjs');require('../../chunk-2GKPWQBQ.cjs');exports.EVMNonCustodialSigner = _chunk23KPZFOGcjs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-XOEAILGF.js";import"../../chunk-PDNXECMW.js";import"../../chunk-O6VBO7KG.js";import"../../chunk-WCGUGIGJ.js";import"../../chunk-455NK5LB.js";import"../../chunk-Y3U34F7K.js";import"../../chunk-QZO3WO3R.js";import"../../chunk-J3R36SGJ.js";export{a as EVMNonCustodialSigner};
|