PageSourceSearch

https://realmint.io/assets/createWalletClient-Dfwig8Yk.js

js realmint.io collected 2026-10-05 07:11:26 UTC 8,358 bytes, 1 lines download raw bytes

1import{co as R,bE as ut,es as Q,bk as dt,eu as y,bY as ht,ez as p,eA as T,b7 as V,eI as pt,B as ft,eB as S,b6 as X,bV as Y,bn as J,eJ as wt,en as lt,eK as yt,eL as K,eM as Z,eN as mt,eO as $,eP as A,et as gt,cM as Ct,cS as Tt,c3 as bt,cX as qt,cF as At,eQ as tt,eR as St,eS as Rt,bq as Pt}from"./usePrivy-DyyEMsbu-ASy2XScR.js";import{s as at,w as st,p as et,g as It}from"./prepareAuthorization-CD0gH-WB.js";async function zt(a,{chain:t}){const{id:s,name:n,nativeCurrency:e,rpcUrls:o,blockExplorers:i}=t;await a.request({method:"wallet_addEthereumChain",params:[{chainId:R(s),chainName:n,nativeCurrency:e,rpcUrls:o.default.http,blockExplorerUrls:i?Object.values(i).map(({url:c})=>c):void 0}]},{dedupe:!0,retryCount:0})}function _t(a,t){const{abi:s,args:n,bytecode:e,...o}=t,i=ut({abi:s,args:n,bytecode:e});return Q(a,{...o,...o.authorizationList?{to:null}:{},data:i})}async function Mt(a){var s;return((s=a.account)==null?void 0:s.type)==="local"?[a.account.address]:(await a.request({method:"eth_accounts"},{dedupe:!0})).map(n=>dt(n))}async function xt(a,t={}){const{account:s=a.account,chainId:n}=t,e=s?y(s):void 0,o=n?[e==null?void 0:e.address,[R(n)]]:[e==null?void 0:e.address],i=await a.request({method:"wallet_getCapabilities",params:o}),c={};for(const[u,d]of Object.entries(i)){c[Number(u)]={};for(let[h,f]of Object.entries(d))h==="addSubAccount"&&(h="unstable_addSubAccount"),c[Number(u)][h]=f}return typeof n=="number"?c[n]:c}async function Et(a){return await a.request({method:"wallet_getPermissions"},{dedupe:!0})}async function vt(a){return(await a.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(s=>ht(s))}async function Ft(a,t){return a.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})}async function Nt(a,t){const{chain:s=a.chain}=t,n=t.timeout??Math.max(((s==null?void 0:s.blockTime)??0)*3,5e3),e=await p(a,at,"sendCalls")(t);return await p(a,st,"waitForCallsStatus")({...t,id:e.id,timeout:n})}const E=new lt(128);async function nt(a,t){var O,L,U,j,B,W;const{account:s=a.account,assertChainId:n=!0,chain:e=a.chain,accessList:o,authorizationList:i,blobs:c,data:u,dataSuffix:d=typeof a.dataSuffix=="string"?a.dataSuffix:(O=a.dataSuffix)==null?void 0:O.value,gas:h,gasPrice:f,maxFeePerBlobGas:m,maxFeePerGas:v,maxPriorityFeePerGas:F,nonce:P,pollingInterval:rt,throwOnReceiptRevert:N,type:D,value:k,...I}=t,ot=t.timeout??Math.max(((e==null?void 0:e.blockTime)??0)*3,5e3);if(typeof s>"u")throw new T({docsPath:"/docs/actions/wallet/sendTransactionSync"});const r=s?y(s):null;let z;try{V(t);const w=await(async()=>{if(t.to)return t.to;if(t.to!==null&&i&&i.length>0)return await pt({authorization:i[0]}).catch(()=>{throw new ft("`to` is required. Could not infer from `authorizationList`.")})})();if((r==null?void 0:r.type)==="json-rpc"||r===null){let g;e!==null&&(g=await p(a,S,"getChainId")({}),n&&X({currentChainId:g,chain:e}));const b=(j=(U=(L=a.chain)==null?void 0:L.formatters)==null?void 0:U.transactionRequest)==null?void 0:j.format,C=(b||Y)({...wt(I,{format:b}),accessList:o,account:r,authorizationList:i,blobs:c,chainId:g,data:d?J([u??"0x",d]):u,gas:h,gasPrice:f,maxFeePerBlobGas:m,maxFeePerGas:v,maxPriorityFeePerGas:F,nonce:P,to:w,type:D,value:k},"sendTransaction"),q=E.get(a.uid),it=q?"wallet_sendTransaction":"eth_sendTransaction",ct=await(async()=>{try{return await a.request({method:it,params:[C]},{retryCount:0})}
1catch(H){if(q===!1)throw H;const l=H;if(l.name==="InvalidInputRpcError"||l.name==="InvalidParamsRpcError"||l.name==="MethodNotFoundRpcError"||l.name==="MethodNotSupportedRpcError")return await a.request({method:"wallet_sendTransaction",params:[C]},{retryCount:0}).then(M=>(E.set(a.uid,!0),M)).catch(M=>{const x=M;throw x.name==="MethodNotFoundRpcError"||x.name==="MethodNotSupportedRpcError"?(E.set(a.uid,!1),l):x});throw l}})(),_=await p(a,yt,"waitForTransactionReceipt")({checkReplacement:!1,hash:ct,pollingInterval:rt,timeout:ot});if(N&&_.status==="reverted")throw new K({receipt:_});return _}if((r==null?void 0:r.type)==="local"){if(r.nonceManager&&typeof P>"u"){const C=I.chainId,q=await(async()=>typeof C=="number"?C:e?e.id:p(a,S,"getChainId")({}))();z={address:r.address,chainId:q}}const g=await p(a,Z,"prepareTransactionRequest")({account:r,accessList:o,authorizationList:i,blobs:c,chain:e,data:d?J([u??"0x",d]):u,gas:h,gasPrice:f,maxFeePerBlobGas:m,maxFeePerGas:v,maxPriorityFeePerGas:F,nonce:P,nonceManager:r.nonceManager,parameters:[...mt,"sidecars"],type:D,value:k,...I,to:w}),b=(B=e==null?void 0:e.serializers)==null?void 0:B.transaction,G=await r.signTransaction(g,{serializer:b});return await p(a,$,"sendRawTransactionSync")({serializedTransaction:G,throwOnReceiptRevert:N,timeout:t.timeout})}throw(r==null?void 0:r.type)==="smart"?new A({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new A({docsPath:"/docs/actions/wallet/sendTransactionSync",type:r==null?void 0:r.type})}catch(w){throw w instanceof A?w:(z&&!(w instanceof K)&&((W=r==null?void 0:r.nonceManager)==null||W.reset(z)),gt(w,{...t,account:r,chain:t.chain||void 0}))}}async function Dt(a,t){const{id:s}=t;await a.request({method:"wallet_showCallsStatus",params:[s]})}async function kt(a,t){const{account:s=a.account}=t;if(!s)throw new T({docsPath:"/docs/eip7702/signAuthorization"});const n=y(s);if(!n.signAuthorization)throw new A({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});const e=await et(a,t);return n.signAuthorization(e)}async function Ot(a,{account:t=a.account,message:s}){if(!t)throw new T({docsPath:"/docs/actions/wallet/signMessage"});const n=y(t);if(n.signMessage)return n.signMessage({message:s});const e=typeof s=="string"?Ct(s):s.raw instanceof Uint8Array?Tt(s.raw):s.raw;return a.request({method:"personal_sign",params:[e,n.address]},{retryCount:0})}async function Lt(a,t){var d,h,f,m;const{account:s=a.account,chain:n=a.chain,...e}=t;if(!s)throw new T({docsPath:"/docs/actions/wallet/signTransaction"});const o=y(s);V({account:o,...t});const i=await p(a,S,"getChainId")({});n!==null&&X({currentChainId:i,chain:n});const c=(n==null?void 0:n.formatters)||((d=a.chain)==null?void 0:d.formatters),u=((h=c==null?void 0:c.transactionRequest)==null?void 0:h.format)||Y;return o.signTransaction?o.signTransaction({...e,account:o,chainId:i},{serializer:(m=(f=a.chain)==null?void 0:f.serializers)==null?void 0:m.transaction}):await a.request({method:"eth_signTransaction",params:[{...u({...e,account:o},"signTransaction"),chainId:R(i),from:o.address}]},{retryCount:0})}async function Ut(a,t){const{account:s=a.account,domain:n,message:e,primaryType:o}=t;if(!s)throw new T({docsPath:"/docs/actions/wallet/signTypedData"});const i=y(s),c={EIP712Domain:bt({domain:n}),...t.types};if(qt({domain:n,message:e,primaryType:o,types:c}),i.signTypedData)return i.signTypedData({domain:n,message:e,primaryType:o,types:c});const u=At({domain:n,message:e,primaryType:o,types:c});return a.request({method:"eth_signTypedData_v4",params:[i.address,u]},{retryCount:0})}async function jt(a,{id:t}){await a.request({method:"wallet_switchEthereumChain",params:[{chainId:R(t)}]},{retryCount:0})}async function Bt(a,t){return await a.request({method:"wallet_watchAsset",params:t},{retryCount:0})}async function Wt(a,t){return tt.internal(a,nt,"sendTransactionSync",t)}function Gt(a){return{addChain:t=>zt(a,t),deployContract:t=>_t(a,t),fillTransaction:t=>Rt(a,t),getAddresses:()=>Mt(a),getCallsStatus:t=>It(a,t),getCapabilities:t=>xt(a,t),getChainId:()=>S(a),getPermissions:()=>Et(a),prepareAuthorization:t=>et(a,t),prepareTransactionRequest:t=>Z(a,t),requestAddresses:()=>vt(a),requestPermissions:t=>Ft(a,t),sendCalls:t=>at(a,t),sendCallsSync:t=>
1Nt(a,t),sendRawTransaction:t=>St(a,t),sendRawTransactionSync:t=>$(a,t),sendTransaction:t=>Q(a,t),sendTransactionSync:t=>nt(a,t),showCallsStatus:t=>Dt(a,t),signAuthorization:t=>kt(a,t),signMessage:t=>Ot(a,t),signTransaction:t=>Lt(a,t),signTypedData:t=>Ut(a,t),switchChain:t=>jt(a,t),waitForCallsStatus:t=>st(a,t),watchAsset:t=>Bt(a,t),writeContract:t=>tt(a,t),writeContractSync:t=>Wt(a,t)}}function Kt(a){const{key:t="wallet",name:s="Wallet Client",transport:n}=a;return Pt({...a,key:t,name:s,transport:n,type:"walletClient"}).extend(Gt)}export{Lt as a,Kt as c,Ut as s,Gt as w};

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.