PageSourceSearch

https://app.shodai.network/agreements/assets/vendor-dynamic-labs-waas-evm-CK8aYW4e.js

js shodai.network collected 2026-10-09 21:20:54 UTC 15,629 bytes, 1 lines download raw bytes

1import{a as b}from"./vendor-dynamic-labs-assert-package-version-CC14YHLa.js";import{e as E,f as N,h as U,V as x}from"./vendor-dynamic-labs-ethereum-core-NAR9-L8L.js";import{L as D}from"./vendor-dynamic-labs-logger-Dx7QYBXP.js";import{e as A,T as I}from"./vendor-dynamic-labs-sdk-api-core-BF-Eoriv.js";import{D as y}from"./vendor-dynamic-labs-utils-DD6YsGFV.js";import{w as M,W as P}from"./vendor-dynamic-labs-waas-BeE6xnwv.js";import{d as V}from"./vendor-dynamic-labs-wallet-connector-core-Dpjk1DJ7.js";import{aa as O,O as z,a8 as K,aW as j,aX as G,aY as R}from"./vendor-chain-D0rutnox.js";(function(){try{var m=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};m.SENTRY_RELEASE={id:"b301269b"};var e=new m.Error().stack;e&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[e]="7f4d6c5c-2e2f-4ea1-9634-4ac3c7287978",m._sentryDebugIdIdentifier="sentry-dbid-7f4d6c5c-2e2f-4ea1-9634-4ac3c7287978")}catch{}})();var q="4.90.0";function o(m,e,t,i){function s(n){return n instanceof t?n:new t(function(r){r(n)})}return new(t||(t=Promise))(function(n,r){function a(d){try{l(i.next(d))}catch(u){r(u)}}function c(d){try{l(i.throw(d))}catch(u){r(u)}}function l(d){d.done?n(d.value):s(d.value).then(a,c)}l((i=i.apply(m,e||[])).next())})}const T=new D("DynamicWaasConnector");class w extends M(U){isUnsupportedChainId(e){return e!==void 0&&this.unsupportedChainIds.has(Number(e))}get supportedEvmNetworks(){return this.evmNetworks.filter(e=>!this.isUnsupportedChainId(e.chainId))}getEnabledNetworks(){return this.supportedEvmNetworks}constructor(e){super(e),this.name="Dynamic Waas",this.logger=T,this.overrideKey="dynamicwaas",this.isEmbeddedWallet=!0,this.unsupportedChainIds=new Set([4217,42429,42431]),this._selectedChainId=this.getLastUsedChainId(),this.__exportHandler=new P}getLastUsedChainId(){var e;if(T.logVerboseTroubleshootingMessage("[DynamicWaasEVMConnector] getLastUsedChainId",{evmNetworks:this.evmNetworks,lastUsedChainId:this.lastUsedChainId}),this.lastUsedChainId)return this.lastUsedChainId;if(!((e=this.supportedEvmNetworks)===null||e===void 0)&&e.length)return this.supportedEvmNetworks[0].chainId}set verifiedCredentials(e){this._verifiedCredentials=e}get verifiedCredentials(){return this._verifiedCredentials}set verifiedCredential(e){this._verifiedCredential=e}get verifiedCredential(){return this._verifiedCredential}setVerifiedCredentials(e){const t=e==null?void 0:e.reduce((n,r)=>{if(r.walletName==="dynamicwaas"&&r.chain==="eip155"){const a=e.find(d=>d.signerRefId===r.id),c=a==null?void 0:a.id,l=a==null?void 0:a.address;n.push(Object.assign(Object.assign({},r),{smartWalletRefAddress:l,smartWalletRefId:c}))}return n},[]),[i]=t;JSON.stringify(this.verifiedCredentials)!==JSON.stringify(t)&&(this.verifiedCredential=i,this.verifiedCredentials=t)}set lastUsedChainId(e){e===void 0?localStorage.removeItem(w.lastUsedChainIdStorageKey):localStorage.setItem(w.lastUsedChainIdStorageKey,e.toString()),this._selectedChainId=e}get lastUsedChainId(){var e,t;const i=localStorage.getItem(w.lastUsedChainIdStorageKey);if(i)try{const s=parseInt(i);if(isNaN(s))return;if(this.isUnsupportedChainId(s)){const r=(e=this.supportedEvmNetworks[0])===null||e===void 0?void 0:e.chainId;return r&&(this.lastUsedChainId=r),r}if(!this.supportedEvmNetworks.some(r=>r.chainId===s)){const r=(t=this.supportedEvmNetworks[0])===null||t===void 0?void 0:t.chainId;return r&&(this.lastUsedChainId=r),r}return s}catch(s){T.error(s);return}}get currentChainId(){var e,t;const i=this._selectedChainId&&!this.isUnsupportedChainId(this._selectedChainId)?this._selectedChainId:void 0;return i??((t=(e=this.supportedEvmNetworks)===null||e===void 0?void 0:e[0])===null||t===void 0?void 0:t.chainId)}getNetwork(){return o(this,void 0,void 0,function*(){return this.currentChainId})}getEvmNetworkByChainId(e){return this.supportedEvmNetworks.find(t=>t.chainId===e)}currentEvmNetwork(){const e=this.currentChainId;if(e)return this.getEvmNetworkByChainId(e)}switchNetwork(e){return o(this,arguments,void 0,function*({networkChainId:t}){var i;if(!t)return;let s=t;if(typeof t=="string"&&(s=parseInt(t)),this.isUnsupportedChainId(s)){const n=(i=this.supportedEvmNetworks[0])===null||i===void 0?void 0:i.chainId;if(!n)return;s=n}
1this.lastUsedChainId=s,this._selectedChainId=s,this.emit("chainChange",{chain:s.toString()})})}getRpcUrl(e){var t;return((t=e.privateCustomerRpcUrls)===null||t===void 0?void 0:t[0])||e.rpcUrls[0]}validateActiveWallet(e){return o(this,void 0,void 0,function*(){var t,i;const n=yield(yield this.getWaasWalletClient()).getWallet({accountAddress:e,authToken:(t=this.getAuthToken)===null||t===void 0?void 0:t.call(this),signedSessionId:""});if(!n)throw new y("Account not found");V(n.accountAddress,((i=this.getActiveAccount())===null||i===void 0?void 0:i.address)||"",this.connectedChain)||this.setActiveAccount(n.accountAddress)})}getActiveAccountAddress(){return o(this,void 0,void 0,function*(){var e;return(e=this.getActiveAccount())===null||e===void 0?void 0:e.address})}getViemAccountCustomSource(e){return o(this,arguments,void 0,function*({accountAddress:t}){var i;const s=yield this.getWaasWalletClient(),n=yield(i=this.getSignedSessionId)===null||i===void 0?void 0:i.call(this);if(!n)throw new y("Signed session ID is required");return{address:t,signAuthorization:r=>o(this,void 0,void 0,function*(){const a=this.generateTraceId(),c=Date.now();this.instrument("[signAuthorization] start",{accountAddress:t,chainName:"EVM",key:"signAuthorization-start",startTime:c,time:0,traceId:a});const l=yield this.getPasswordIfNeeded({accountAddress:t});return this.instrumentAsync({context:{chainName:"EVM",startTime:c,traceId:a},fn:()=>o(this,void 0,void 0,function*(){return this.signAuthorization(r,l)}),operation:"signAuthorization",resource:"client.signAuthorization"})}),signMessage:r=>o(this,[r],void 0,function*({message:a}){var c,l;const d=this.generateTraceId(),u=Date.now();this.instrument("[signMessage] start",{accountAddress:t,chainName:"EVM",key:"signMessage-start",startTime:u,time:0,traceId:d});const g=yield(c=this.getMfaToken)===null||c===void 0?void 0:c.call(this,{mfaAction:A.WalletWaasSign}),f=yield(l=this.getElevatedAccessToken)===null||l===void 0?void 0:l.call(this,{scope:I.Walletsign}),h=yield this.getPasswordIfNeeded({accountAddress:t});return yield this.instrumentAsync({context:{chainName:"EVM",startTime:u,traceId:d},fn:()=>o(this,void 0,void 0,function*(){var p;return s.signMessage({accountAddress:t,authToken:(p=this.getAuthToken)===null||p===void 0?void 0:p.call(this),elevatedAccessToken:f,message:a,mfaToken:g,password:h,signedSessionId:n,traceContext:{startTime:u,traceId:d}})}),operation:"signMessage",resource:"client.signMessage"})}),signTransaction:r=>o(this,void 0,void 0,function*(){var a,c;const l=this.generateTraceId(),d=Date.now();this.instrument("[signTransaction] start",{accountAddress:t,chainName:"EVM",key:"signTransaction-start",startTime:d,time:0,traceId:l});const u=yield(a=this.getMfaToken)===null||a===void 0?void 0:a.call(this,{mfaAction:A.WalletWaasSign}),g=yield(c=this.getElevatedAccessToken)===null||c===void 0?void 0:c.call(this,{scope:I.Walletsign}),f=yield this.getPasswordIfNeeded({accountAddress:t}),{currentChainId:h}=this,v=h!==void 0?Object.assign(Object.assign({},r),{chainId:h}):r;return yield this.instrumentAsync({context:{chainName:"EVM",startTime:d,traceId:l},fn:()=>o(this,void 0,void 0,function*(){var C;return s.signTransaction(Object.assign(Object.assign({authToken:(C=this.getAuthToken)===null||C===void 0?void 0:C.call(this)},h!==void 0&&{chainId:h.toString()}),{elevatedAccessToken:g,mfaToken:u,password:f,senderAddress:t,signedSessionId:n,traceContext:{startTime:d,traceId:l},transaction:z(v)}))}),operation:"signTransaction",resource:"client.signTransaction"})}),signTypedData:r=>o(this,void 0,void 0,function*(){var a,c;const l=this.generateTraceId(),d=Date.now();this.instrument("[signTypedData] start",{accountAddress:t,chainName:"EVM",key:"signTypedData-start",startTime:d,time:0,traceId:l});const u=yield(a=this.getMfaToken)===null||a===void 0?void 0:a.call(this,{mfaAction:A.WalletWaasSign}),g=yield(c=this.getElevatedAccessToken)===null||c===void 0?void 0:c.call(this,{scope:I.Walletsign}),f=yield this.getPasswordIfNeeded({accountAddress:t});return yield this.instrumentAsync({context:{chainName:"EVM",startTime:d,traceId:l},fn:()=>o(this,void 0,void 0,function*(){var v;return s.signTypedData({accountAddress:t,authToken:(v=this.getAuthToken)===null||v===void 0?void 0:v.call(this),elevatedAccessToken:g,mfaToken:u,password:f,signedSessionId:n,traceContext:{startTime:d,traceId:l},typedData:r})}),operation:"signTypedData",resource:"client.signTypedData"})})}})}getViemAccount(e){return o(this,arguments,void 0,function*({accountAddress:t}){const i=yield this.getViemAccountCustomSource({accountAddress:t});return K(i)})}getWalletClient(e){var t;const i=(t=this.getActiveAccount())===null||t===void 0?void 0:t.address;if(!i)return this.getPublicClient();const s=e?this.getEvmNetworkByChainId(parseInt(e)):this.currentEvmNetwork();if(!s)throw new Error("EVM network not found");const n=this.getRpcUrl(s);return E({account:()=>o(this,void 0,void 0,function*(){return this.getViemAccount({accountAddress:i})}),address:i,chain:N(s),transport:O(n,this.providersConfig.httpTransportConfig),walletConnector:this,walletUiUtils:this.walletUiUtils})}signMessage(e){var t;return(t=this.getWalletClient())===null||t===void 0?void 0:t.signMessage({message:e})}signMessageWithContext(e){return o(this,arguments,void 0,function*({message:t,context:i}){var s,n,r,a,c;const l=yield this.getWaasWalletClient(),d=yield(s=this.getSignedSessionId)===null||s===void 0?void 0:s.call(this);if(!d)throw new y("Signed session ID is required");const u=(n=this.getActiveAccount())===null||n===void 0?void 0:n.address,g=yield(r=this.getMfaToken)===null||r===void 0?void 0:r.call(this,{mfaAction:A.WalletWaasSign}),f=yield(a=this.getElevatedAccessToken)===null||a===void 0?void 0:a.call(this,{scope:I.Walletsign}),h=yield this.getPasswordIfNeeded({accountAddress:u}),v=this.generateTraceId(),p=Date.now();
1return this.instrument("[signMessageWithContext] start",{key:"signMessageWithContext-start",startTime:p,time:0,traceId:v}),l.signMessage({accountAddress:u,authToken:(c=this.getAuthToken)===null||c===void 0?void 0:c.call(this),context:i,elevatedAccessToken:f,message:t,mfaToken:g,password:h,signedSessionId:d,traceContext:{startTime:p,traceId:v}})})}getSigner(){return o(this,void 0,void 0,function*(){return this.getWalletClient()})}getWalletClientByAddress({accountAddress:e}){return this.setActiveAccount(e),this.getWalletClient()}exportClientKeyshares(e){const t=Object.create(null,{exportClientKeyshares:{get:()=>super.exportClientKeyshares}});return o(this,arguments,void 0,function*({accountAddress:i,password:s}){if(!i)throw new Error("Account address is required");return this.setActiveAccount(i),t.exportClientKeyshares.call(this,{accountAddress:i,password:s})})}backupKeySharesToGoogleDrive(e){const t=Object.create(null,{backupKeySharesToGoogleDrive:{get:()=>super.backupKeySharesToGoogleDrive}});return o(this,arguments,void 0,function*({accountAddress:i,password:s,googleDriveAccessToken:n}){if(!i)throw new Error("Account address is required");return this.setActiveAccount(i),t.backupKeySharesToGoogleDrive.call(this,{accountAddress:i,googleDriveAccessToken:n,password:s})})}refreshWalletAccountShares(e){const t=Object.create(null,{refreshWalletAccountShares:{get:()=>super.refreshWalletAccountShares}});return o(this,arguments,void 0,function*({accountAddress:i,password:s}){if(!i)throw new Error("Account address is required");return this.setActiveAccount(i),t.refreshWalletAccountShares.call(this,{accountAddress:i,password:s})})}reshareWalletAccountShares(e){const t=Object.create(null,{reshareWalletAccountShares:{get:()=>super.reshareWalletAccountShares}});return o(this,arguments,void 0,function*({accountAddress:i,password:s,thresholdSignatureScheme:n}){if(!i)throw new Error("Account address is required");return this.setActiveAccount(i),t.reshareWalletAccountShares.call(this,{accountAddress:i,password:s,thresholdSignatureScheme:n})})}updatePassword(e){const t=Object.create(null,{updatePassword:{get:()=>super.updatePassword}});return o(this,arguments,void 0,function*({accountAddress:i,existingPassword:s,newPassword:n}){if(!i)throw new Error("Account address is required");return this.setActiveAccount(i),t.updatePassword.call(this,{accountAddress:i,existingPassword:s,newPassword:n})})}createUiTransaction(e){return o(this,void 0,void 0,function*(){yield this.validateActiveWallet(e);const t=this.getWalletClient(),i=yield this.getPublicClient(),s=yield i==null?void 0:i.getTransactionCount({address:e});if(!i||!t)throw new y("No public client available");return new x({account:e,onSubmit:n=>o(this,void 0,void 0,function*(){return n.nonNativeAddress?t.writeContract({abi:j,account:t.account,address:n.nonNativeAddress,args:[n.to,n.nonNativeValue],functionName:"transfer",maxFeePerGas:n.maxFeePerGas,maxPriorityFeePerGas:n.maxPriorityFeePerGas,nonce:s}):t.sendTransaction({account:t.account,data:"0x",maxFeePerGas:n.maxFeePerGas,maxPriorityFeePerGas:n.maxPriorityFeePerGas,to:n.to,value:n.value})}),publicClient:i,transaction:{}})})}getConnectedAccounts(){return o(this,void 0,void 0,function*(){var e;const i=(this.verifiedCredentials||[]).map(s=>s==null?void 0:s.address).filter(s=>typeof s=="string");return i.length>0&&(!((e=this.verifiedCredential)===null||e===void 0)&&e.address)&&this.setActiveAccount(this.verifiedCredential.address),i})}getAddress(){return o(this,void 0,void 0,function*(){var e;const t=this.getActiveAccount();if(!t||!t.address){if(!((e=this.verifiedCredential)===null||e===void 0)&&e.address){const{address:i}=this.verifiedCredential;return this.setActiveAccount(i),i}throw new y("No active wallet address found")}return t.address})}signAuthorization(e,t){return o(this,void 0,void 0,function*(){var i,s,n,r;const{address:a,nonce:c,chainId:l}=e;if(!a)throw new Error("Contract address not found");const[d,u]=yield Promise.all([this.getSigner(),this.getPublicClient()]);if(!d||!u)throw new Error("Required clients not found");const{address:g}=d.account,f=yield this.getWaasWalletClient(),h=yield(i=this.getSignedSessionId)===null||i===void 0?void 0:i.call(this);if(!h)throw new y("Signed session ID is required");const v=yield(s=this.getMfaToken)===null||s===void 0?void 0:s.call(this,{mfaAction:A.WalletWaasSign}),p=yield(n=this.getElevatedAccessToken)===null||n===void 0?void 0:n.call(this,{scope:I.Walletsign}),C=this.generateTraceId(),S=Date.now();this.instrument("[signAuthorization] start",{key:"signAuthorization-start",startTime:S,time:0,traceId:C});const W={address:a,chainId:l,nonce:c},_=yield f.signRawMessage({accountAddress:g,authToken:(r=this.getAuthToken)===null||r===void 0?void 0:r.call(this),context:{eip7702Auth:W},elevatedAccessToken:p,message:G(W).slice(2),mfaToken:v,password:t,signedSessionId:h,traceContext:{startTime:S,traceId:C}}),k=R(_);return{address:a,chainId:l,nonce:c,r:k.r,s:k.s,v:k.v,yParity:k.yParity}})}isAtomicSupported(e){return o(this,void 0,void 0,function*(){return T.debug("[DynamicWaasEVMConnector] isAtomicSupported - not supported",{chainId:e}),!1})}isPaymasterServiceSupported(e){return o(this,void 0,void 0,function*(){return T.debug("[DynamicWaasEVMConnector] isPaymasterServiceSupported - not supported",{chainId:e}),!1})}isSignAuthorizationSupported(){return!0}}
1w.lastUsedChainIdStorageKey="dynamic-waas-evm-last-used-chain-id";const Z=()=>[w];b("@dynamic-labs/waas-evm",q);export{Z as D};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.