1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1837],{34557:function(t,e,a){a.d(e,{$:function(){return c}});var n=a(69921),r=a(36826),o=a(72932),s=a(13550),i=a(89361);async function c(t,e){async function a(e){if(e.endsWith(i.ny.slice(2))){let a=(0,r.f)((0,n.p5)(e,-64,-32)),s=(0,n.p5)(e,0,-64).slice(2).match(/.{1,64}/g),c=await Promise.all(s.map(e=>i.rC.slice(2)!==e?t.request({method:"eth_getTransactionReceipt",params:[`0x${e}`]},{dedupe:!0}):void 0)),u=c.some(t=>null===t)?100:c.every(t=>t?.status==="0x1")?200:c.every(t=>t?.status==="0x0")?500:600;return{atomic:!1,chainId:(0,o.ly)(a),receipts:c.filter(Boolean),status:u,version:"2.0.0"}}return t.request({method:"wallet_getCallsStatus",params:[e]})}let{atomic:c=!1,chainId:u,receipts:d,version:l="2.0.0",...h}=await a(e.id),[f,w]=(()=>{let t=h.status;return t>=100&&t<200?["pending",t]:t>=200&&t<300?["success",t]:t>=300&&t<700?["failure",t]:"CONFIRMED"===t?["success",200]:"PENDING"===t?["pending",100]:[void 0,t]})();return{...h,atomic:c,chainId:u?(0,o.ly)(u):void 0,receipts:d?.map(t=>({...t,blockNumber:o.y_(t.blockNumber),gasUsed:o.y_(t.gasUsed),status:s.ew[t.status]}))??[],statusCode:w,status:f,version:l}}},89239:function(t,e,a){a.d(e,{x:function(){return u}});var n=a(19775),r=a(65704),o=a(93637),s=a(82645),i=a(12363),c=a(16689);async function u(t,e){let{account:a=t.account,chainId:u,nonce:d}=e;if(!a)throw new r.o({docsPath:"/docs/eip7702/prepareAuthorization"});let l=(0,n.T)(a),h=(()=>
1{if(e.executor)return"self"===e.executor?e.executor:(0,n.T)(e.executor)})(),f={address:e.contractAddress??e.address,chainId:u,nonce:d};return void 0===f.chainId&&(f.chainId=t.chain?.id??await (0,s.s)(t,i.L,"getChainId")({})),void 0===f.nonce&&(f.nonce=await (0,s.s)(t,c.K,"getTransactionCount")({address:l.address,blockTag:"pending"}),("self"===h||h?.address&&(0,o.E)(h.address,l.address))&&(f.nonce+=1)),f}},89361:function(t,e,a){a.d(e,{ny:function(){return h},rC:function(){return f},s_:function(){return w}});var n=a(19775),r=a(81544),o=a(77014),s=a(17283),i=a(89256),c=a(72932),u=a(59455),d=a(93606),l=a(41709);let h="0x5792579257925792579257925792579257925792579257925792579257925792",f=(0,u.eC)(0,{size:32});async function w(t,e){let{account:a=t.account,chain:w=t.chain,experimental_fallback:p,experimental_fallbackDelay:m=32,forceAtomic:y=!1,id:g,version:C="2.0.0"}=e,v=a?(0,n.T)(a):null,T=e.capabilities;t.dataSuffix&&!e.capabilities?.dataSuffix&&(T="string"==typeof t.dataSuffix?{...e.capabilities,dataSuffix:{value:t.dataSuffix,optional:!0}}:{...e.capabilities,dataSuffix:{value:t.dataSuffix.value,...t.dataSuffix.required?{}:{optional:!0}}});let b=e.calls.map(t=>{let e=t.abi?(0,s.R)({abi:t.abi,functionName:t.functionName,args:t.args}):t.data;return{data:t.dataSuffix&&e?(0,i.zo)([e,t.dataSuffix]):e,to:t.to,value:t.value?(0,u.eC)(t.value):void 0}});try{let e=await t.request({method:"wallet_sendCalls",params:[{atomicRequired:y,calls:b,capabilities:T,chainId:(0,u.eC)(w.id),from:v?.address,id:g,version:C}]},{retryCount:0});if("string"==typeof e)return{id:e};return e}catch(a){if(p&&("MethodNotFoundRpcError"===a.name||"MethodNotSupportedRpcError"===a.name||"UnknownRpcError"===a.name||a.details.toLowerCase().includes("does not exist / is not available")||a.details.toLowerCase().includes("missing or invalid. request()")||a.details.toLowerCase().includes("did not match any variant of untagged enum")||a.details.toLowerCase().includes("account upgraded to unsupported contract")||a.details.toLowerCase().includes("eip-7702 not supported")||a.details.toLowerCase().includes("unsupported wc_ method")||a.details.toLowerCase().includes("feature toggled misconfigured")||a.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(T&&Object.values(T).some(t=>!t.optional)){let t="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new o.vl(new r.G(t,{details:t}))}if(y&&b.length>1){let t="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new o.r0(new r.G(t,{details:t}))}let e=[];for(let a of b){let n=(0,l.T)(t,{account:v,chain:w,data:a.data,to:a.to,value:a.value?(0,c.y_)(a.value):void 0});e.push(n),m>0&&await new Promise(t=>setTimeout(t,m))}let a=await Promise.allSettled(e);if(a.every(t=>"rejected"===t.status))throw a[0].reason;let n=a.map(t=>"fulfilled"===t.status?t.value:f);return{id:(0,i.zo)([...n,(0,u.eC)(w.id,{size:32}),h])}}throw(0,d.$)(a,{...e,account:v,chain:e.chain})}}},41709:function(t,e,a){a.d(e,{T:function(){return C}});var n=a(19775),r=a(65704),o=a(81544),s=a(63936),i=a(40402),c=a(89256),u=a(93606),d=a(70878),l=a(92614),h=a(82645),f=a(82061),w=a(54605),p=a(12363),m=a(34467),y=a(9769);let g=new f.k(128);async function C(t,e){let{account:a=t.account,assertChainId:f=!0,chain:C=t.chain,accessList:v,authorizationList:T,blobs:b,data:x,dataSuffix:S="string"==typeof t.dataSuffix?t.dataSuffix:t.dataSuffix?.value,gas:q,gasPrice:_,maxFeePerBlobGas:R,maxFeePerGas:E,maxPriorityFeePerGas:A,nonce:P,type:z,value:N,...I}=e;if(void 0===a)throw new r.o({docsPath:"/docs/actions/wallet/sendTransaction"});let M=a?(0,n.T)(a):null;try{(0,w.F)(e);let a=await (async()=>e.to?e.to:null!==e.to&&T&&T.length>0?await (0,s.z)({authorization:T[0]}).catch(()=>{throw new o.G("`to` is required. Could not infer from `authorizationList`.")}):void 0)();if(M?.type==="json-rpc"||null===M){let e;null!==C&&(e=await (0,h.s)(t,p.L,"getChainId")({}),f&&(0,i.q)({currentChainId:e,chain:C}));let n=t.chain?.formatters?.transactionRequest?.format,r=(n||l.tG)({...(0,d.K)(I,{format:n}),accessList:v,account:M,authorizationList:T,blobs:b,chainId:e,data:x?(0,c.zo)([x,S??"0x"]):x,gas:q,gasPrice:_,maxFeePerBlobGas:R,maxFeePerGas:E,maxPriorityFeePerGas:A,nonce:P,to:a,type:z,value:N},"sendTransaction"),o=g.get(t.uid);try{return await t.request({method:o?"wallet_sendTransaction":"eth_sendTransaction",params:[r]},{retryCount:0})}catch(e){if(!1===o)throw e;if("InvalidInputRpcError"===e.name||"InvalidParamsRpcError"===e.name||"MethodNotFoundRpcError"===e.name||"MethodNotSupportedRpcError"===e.name)return await t.request({method:"wallet_sendTransaction",params:[r]},{retryCount:0}).then(e=>(g.set(t.uid,!0),e)).catch(a=>{if("MethodNotFoundRpcError"===a.name||"MethodNotSupportedRpcError"===a.name)throw g.set(t.uid,!1),e;throw a});throw e}}if(M?.type==="local"){let e=await (0,h.s)(t,m.ZE,"prepareTransactionRequest")({account:M,accessList:v,authorizationList:T,blobs:b,chain:C,data:x?(0,c.zo)([x,S??"0x"]):x,gas:q,gasPrice:_,maxFeePerBlobGas:R,maxFeePerGas:E,maxPriorityFeePerGas:A,nonce:P,nonceManager:M.nonceManager,parameters:[...m.QZ,"sidecars"],type:z,value:N,...I,to:a}),n=C?.serializers?.transaction,r=await M.signTransaction(e,{serializer:n});return await (0,h.s)(t,y.p,"sendRawTransaction")({serializedTransaction:r})}if(M?.type==="smart")throw new r.Y({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new r.Y({docsPath:"/docs/actions/wallet/sendTransaction",type:M?.type})}catch(t){if(t instanceof r.Y)throw t;throw(0,u.$)(t,{...e,account:M,chain:e.chain||void 0})}}},48202:function(t,e,a){a.d(e,{O:function(){return l}});var n=a(19775),r=a(65704),o=a(40402),s=a(59455),i=a(92614),c=a(82645),u=a(54605),d=a(12363);async function l(t,e){let{account:a=t.account,chain:l=t.chain,...h}=e;if(!a)throw new r.o({docsPath:"/docs/actions/wallet/signTransaction"});let f=(0,n.T)(a);(0,u.F)({account:f,...e});let w=await (0,c.s)(t,d.L,"getChainId")({});null!==l&&(0,o.q)({currentChainId:w,chain:l});let p=l?.formatters||t.chain?.formatters,m=p?.transactionRequest?.format||i.tG;return f.signTransaction?f.signTransaction({...h,chainId:w},{serializer:t.chain?.serializers?.transaction}):await t.request({method:"eth_signTransaction",params:[{...m({...h,account:f},"signTransaction"),chainId:(0,s.eC)(w),from:f.address}]},{retryCount:0})}},69133:function(t,e,a){a.d(e,{x:function(){return s}});var n=a(19775),r=a(65704),o=a(99493);async function s(t,e){let{account:a=t.account,domain:s,message:i,primaryType:c}=e;if(!a)throw new r.o({docsPath:"/docs/actions/wallet/signTypedData"});let u=(0,n.T)(a),d={EIP712Domain:(0,o.cj)({domain:s}),...e.types};if((0,o.iC)({domain:s,message:i,primaryType:c,types:d}),u.signTypedData)return u.signTypedData({domain:s,message:i,primaryType:c,types:d});let l=(0,o.H6)({domain:s,message:i,primaryType:c,types:d});return t.request({method:"eth_signTypedData_v4",params:[u.address,l]},{retryCount:0})}},88027:function(t,e,a){a.d(e,{l:function(){return h}});var n=a(81544);class r extends n.G{constructor(t){super(`Call bundle failed with status: ${t.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=t}}var o=a(82645),s=a(36478),i=a(41495),c=a(56921),u=a(49287),d=a(31853),l=a(34557);async function h(t,e){let a;let{id:n,pollingInterval:h=t.pollingInterval,status:w=({statusCode:t})=>200===t||t>=300,retryCount:p=4,retryDelay:m=({count:t})=>200*~~(1<<t),timeout:y=6e4,throwOnFailure:g=!1}=e,C=(0,d.P)(["waitForCallsStatus",t.uid,n]),{promise:v,resolve:T,reject:b}=(0,c.n)(),x=(0,s.N7)(C,{resolve:T,reject:b},e=>{let s=(0,i.$)(async()=>{let i=t=>{clearTimeout(a),s(),t(),x()};try{let a=await (0,u.J)(async()=>{let e=await (0,o.s)(t,l.$,"getCallsStatus")({id:n});if(g&&"failure"===e.status)throw new r(e);return e},{retryCount:p,delay:m});if(!w(a))return;i(()=>e.resolve(a))}catch(t){i(()=>e.reject(t))}},{interval:h,emitOnBegin:!0});return s});return a=y?setTimeout(()=>{x(),clearTimeout(a),b(new f({id:n}))},y):void 0,await v}class f extends n.G{constructor({id:t}){super(`Timed out while waiting for call bundle with id "${t}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}},50825:function(t,e,a){a.d(e,{n:function(){return u}});var n=a(19775),r=a(65704),o=a(17283),s=a(34180),i=a(82645),c=a(41709);async function u(t,e){return u.internal(t,c.T,"sendTransaction",e)}!function(t){async function e(t,e,a,c){let{abi:u,account:d=t.account,address:l,args:h,functionName:f,...w}=c;if(void 0===d)throw new r.o({docsPath:"/docs/contract/writeContract"});let p=d?(0,n.T)(d):null,m=(0,o.R)({abi:u,args:h,functionName:f});try{return await (0,i.s)(t,e,a)({data:m,to:l,account:p,...w})}catch(t){throw(0,s.S)(t,{abi:u,address:l,args:h,docsPath:"/docs/contract/writeContract",functionName:f,sender:p?.address})}}t.internal=e}(u||(u={}))},74798:function(t,e,a){a.d(e,{v:function(){return J}});var n=a(332),r=a(12363),o=a(59455);async function s(t,{chain:e}){let{id:a,name:n,nativeCurrency:r,rpcUrls:s,blockExplorers:i}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:(0,o.eC)(a),chainName:n,nativeCurrency:r,rpcUrls:s.default.http,blockExplorerUrls:i?Object.values(i).map(({url:t})=>t):void 0}]},{dedupe:!0,retryCount:0})}var i=a(23010),c=a(41709),u=a(31669);async function d(t){return t.account?.type==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(t=>(0,u.x)(t))}var l=a(34557),h=a(19775);async function f(t,e={}){let{account:a=t.account,chainId:n}=e,r=a?(0,h.T)(a):void 0,s=n?[r?.address,[(0,o.eC)(n)]]:[r?.address],i=await t.request({method:"wallet_getCapabilities",params:s}),c={};for(let[t,e]of Object.entries(i))for(let[a,n]of(c[Number(t)]={},Object.entries(e)))"addSubAccount"===a&&(a="unstable_addSubAccount"),c[Number(t)][a]=n;return"number"==typeof n?c[n]:c}async function w(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}var p=a(89239),m=a(34467);async function y(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(t=>(0,u.K)(t))}async function g(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}var C=a(89361),v=a(82645),T=a(88027);async function b(t,e){let{chain:a=t.chain}=e,n=e.timeout??Math.max((a?.blockTime??0)*3,5e3),r=await (0,v.s)(t,C.s_,"sendCalls")(e);return await (0,v.s)(t,T.l,"waitForCallsStatus")({...e,id:r.id,timeout:n})}var x=a(9769),S=a(85631),q=a(65704),_=a(81544),R=a(63228),E=a(63936),A=a(40402),P=a(89256),z=a(93606),N=a(70878),I=a(92614),M=a(82061),k=a(54605),F=a(67348);let L=new M.k(128);async function O(t,e){let{account:a=t.account,assertChainId:n=!0,chain:o=t.chain,accessList:s,authorizationList:i,blobs:c,data:u,dataSuffix:d="string"==typeof t.dataSuffix?t.dataSuffix:t.dataSuffix?.value,gas:l,gasPrice:f,maxFeePerBlobGas:w,maxFeePerGas:p,maxPriorityFeePerGas:y,nonce:g,pollingInterval:C,throwOnReceiptRevert:T,type:b,value:x,...M}=e,O=e.timeout??Math.max((o?.blockTime??0)*3,5e3);if(void 0===a)throw new q.o({docsPath:"/docs/actions/wallet/sendTransactionSync"});let j=a?(0,h.T)(a):null;try{(0,k.F)(e);let a=await (async()=>e.to?e.to:null!==e.to&&i&&i.length>0?await (0,E.z)({authorization:i[0]}).catch(()=>{throw new _.G("`to` is required. Could not infer from `authorizationList`.")}):void 0)();if(j?.type==="json-rpc"||null===j){let e;null!==o&&(e=await (0,v.s)(t,r.L,"getChainId")({}),n&&(0,A.q)({currentChainId:e,chain:o}));let h=t.chain?.formatters?.transactionRequest?.format,m=(h||I.tG)({...(0,N.K)(M,{format:h}),accessList:s,account:j,authorizationList:i,blobs:c,chainId:e,data:u?(0,P.zo)([u,d??"0x"]):u,gas:l,gasPrice:f,maxFeePerBlobGas:w,maxFeePerGas:p,maxPriorityFeePerGas:y,nonce:g,to:a,type:b,value:x},"sendTransaction"),S=L.get(t.uid),q=S?"wallet_sendTransaction":"eth_sendTransaction",_=await (async()=>{try{return await t.request({method:q,params:[m]},{retryCount:0})}catch(e){if(!1===S)throw e;if("InvalidInputRpcError"===e.name||"InvalidParamsRpcError"===e.name||"MethodNotFoundRpcError"===e.name||"MethodNotSupportedRpcError"===e.name)return await t.request({method:"wallet_sendTransaction",params:[m]},{retryCount:0}).then(e=>(L.set(t.uid,!0),e)).catch(a=>{if("MethodNotFoundRpcError"===a.name||"MethodNotSupportedRpcError"===a.name)throw L.set(t.uid,!1),e;throw a});throw e}})(),E=await (0,v.s)(t,F.e,"waitForTransactionReceipt")({checkReplacement:!1,hash:_,pollingInterval:C,timeout:O});
1if(T&&"reverted"===E.status)throw new R.A3({receipt:E});return E}if(j?.type==="local"){let n=await (0,v.s)(t,m.ZE,"prepareTransactionRequest")({account:j,accessList:s,authorizationList:i,blobs:c,chain:o,data:u?(0,P.zo)([u,d??"0x"]):u,gas:l,gasPrice:f,maxFeePerBlobGas:w,maxFeePerGas:p,maxPriorityFeePerGas:y,nonce:g,nonceManager:j.nonceManager,parameters:[...m.QZ,"sidecars"],type:b,value:x,...M,to:a}),r=o?.serializers?.transaction,h=await j.signTransaction(n,{serializer:r});return await (0,v.s)(t,S.s,"sendRawTransactionSync")({serializedTransaction:h,throwOnReceiptRevert:T,timeout:e.timeout})}if(j?.type==="smart")throw new q.Y({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new q.Y({docsPath:"/docs/actions/wallet/sendTransactionSync",type:j?.type})}catch(t){if(t instanceof q.Y)throw t;throw(0,z.$)(t,{...e,account:j,chain:e.chain||void 0})}}async function j(t,e){let{id:a}=e;await t.request({method:"wallet_showCallsStatus",params:[a]})}async function G(t,e){let{account:a=t.account}=e;if(!a)throw new q.o({docsPath:"/docs/eip7702/signAuthorization"});let n=(0,h.T)(a);if(!n.signAuthorization)throw new q.Y({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});let r=await (0,p.x)(t,e);return n.signAuthorization(r)}async function $(t,{account:e=t.account,message:a}){if(!e)throw new q.o({docsPath:"/docs/actions/wallet/signMessage"});let n=(0,h.T)(e);if(n.signMessage)return n.signMessage({message:a});let r="string"==typeof a?(0,o.$G)(a):a.raw instanceof Uint8Array?(0,o.NC)(a.raw):a.raw;return t.request({method:"personal_sign",params:[r,n.address]},{retryCount:0})}var U=a(48202),Y=a(69133);async function D(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,o.eC)(e)}]},{retryCount:0})}async function Z(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}var B=a(50825);async function K(t,e){return B.n.internal(t,O,"sendTransactionSync",e)}function J(t){return{addChain:e=>s(t,e),deployContract:e=>(function(t,e){let{abi:a,args:n,bytecode:r,...o}=e,s=(0,i.w)({abi:a,args:n,bytecode:r});return(0,c.T)(t,{...o,...o.authorizationList?{to:null}:{},data:s})})(t,e),fillTransaction:e=>(0,n.b)(t,e),getAddresses:()=>d(t),getCallsStatus:e=>(0,l.$)(t,e),getCapabilities:e=>f(t,e),getChainId:()=>(0,r.L)(t),getPermissions:()=>w(t),prepareAuthorization:e=>(0,p.x)(t,e),prepareTransactionRequest:e=>(0,m.ZE)(t,e),requestAddresses:()=>y(t),requestPermissions:e=>g(t,e),sendCalls:e=>(0,C.s_)(t,e),sendCallsSync:e=>b(t,e),sendRawTransaction:e=>(0,x.p)(t,e),sendRawTransactionSync:e=>(0,S.s)(t,e),sendTransaction:e=>(0,c.T)(t,e),sendTransactionSync:e=>O(t,e),showCallsStatus:e=>j(t,e),signAuthorization:e=>G(t,e),signMessage:e=>$(t,e),signTransaction:e=>(0,U.O)(t,e),signTypedData:e=>(0,Y.x)(t,e),switchChain:e=>D(t,e),waitForCallsStatus:e=>(0,T.l)(t,e),watchAsset:e=>Z(t,e),writeContract:e=>(0,B.n)(t,e),writeContractSync:e=>K(t,e)}}},65704:function(t,e,a){a.d(e,{Y:function(){return o},o:function(){return r}});var n=a(81544);class r extends n.G{constructor({docsPath:t}={}){super("Could not find an Account to execute with this Action.\nPlease provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client.",{docsPath:t,docsSlug:"account",name:"AccountNotFoundError"})}}class o extends n.G{constructor({docsPath:t,metaMessages:e,type:a}){super(`Account type "${a}" is not supported.`,{docsPath:t,metaMessages:e,name:"AccountTypeNotSupportedError"})}}},40402:function(t,e,a){a.d(e,{q:function(){return r}});var n=a(35586);function r({chain:t,currentChainId:e}){if(!t)throw new n.Bk;if(e!==t.id)throw new n.Yl({chain:t,currentChainId:e})}},90328:function(t,e,a){a.d(e,{a:function(){return n}});function n(t){let e={formatters:void 0,fees:void 0,serializers:void 0,...t};return Object.assign(e,{extend:function t(e){return a=>{let n="function"==typeof a?a(e):a,r={...e,...n};return Object.assign(r,{extend:t(r)})}}(e)})}}}]); 2//# sourceMappingURL=1837-e9ea25379c8f7618.js.map
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.