PageSourceSearch

https://zkhackberlin-kinkyswap.vercel.app/_next/static/chunks/393.35a4f7cc8e9c07e7.js

js zkhackberlin-kinkyswap.vercel.app collected 2026-10-03 08:05:51 UTC 10,430 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[393],{80393:function(t,e,a){a.d(e,{Eip1193Account:function(){return M}});var r=a(6218),n=a(4795),s=a(59933),i=a(85608),o=a(4181),c=a(33657);class l extends Error{constructor(t,e={}){const a=(()=>{if(e.cause instanceof l){if(e.cause.details)return e.cause.details;if(e.cause.shortMessage)return e.cause.shortMessage}return e.cause&&"details"in e.cause&&"string"==typeof e.cause.details?e.cause.details:e.cause?.message?e.cause.message:e.details})(),r=e.cause instanceof l&&e.cause.docsPath||e.docsPath,n=`https://oxlib.sh${r??""}`;super([t||"An error occurred.",...e.metaMessages?["",...e.metaMessages]:[],...a||r?["",a?`Details: ${a}`:void 0,r?`See: ${n}`:void 0]:[]].filter(t=>"string"==typeof t).join("\n"),e.cause?{cause:e.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"[email protected]"}),this.cause=e.cause,this.details=a,this.docs=n,this.docsPath=r,this.shortMessage=t}walk(t){return u(this,t)}}function u(t,e){return e?.(t)?t:t&&"object"==typeof t&&"cause"in t&&t.cause?u(t.cause,e):e?null:t}function d(t,e){if(m(t)>e)throw new h({givenSize:m(t),maxSize:e})}function f(t,e={}){const{signed:a,size:r}=e,n=BigInt(t);let s;r?s=a?(1n<<8n*BigInt(r)-1n)-1n:2n**(8n*BigInt(r))-1n:"number"==typeof t&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i="bigint"==typeof s&&a?-s-1n:0;if(s&&n>s||n<i){const e="bigint"==typeof t?"n":"";throw new w({max:s?`${s}${e}`:void 0,min:`${i}${e}`,signed:a,size:r,value:`${t}${e}`})}const o=`0x${(a&&n<0?(1n<<BigInt(8*r))+BigInt(n):n).toString(16)}`;return r?g(o,r):o}function g(t,e){return function(t,e={}){const{dir:a,size:r=32}=e;if(0===r)return t;const n=t.replace("0x","");if(n.length>2*r)throw new y({size:Math.ceil(n.length/2),targetSize:r,type:"Hex"});return`0x${n["right"===a?"padEnd":"padStart"](2*r,"0")}`}(t,{dir:"left",size:e})}function m(t){return Math.ceil((t.length-2)/2)}function p(t,e={}){const{signed:a,size:r}=e;return Number(a||r?function(t,e={}){const{signed:a}=e;e.size&&d(t,e.size);const r=BigInt(t);if(!a)return r;const n=(t.length-2)/2,s=(1n<<8n*BigInt(n))-1n;return r<=s>>1n?r:r-s-1n}(t,e):t)}class w extends l{constructor({max:t,min:e,signed:a,size:r,value:n}){super(`Number \`${n}\` is not in safe${r?` ${8*r}-bit`:""}${a?" signed":" unsigned"} integer range ${t?`(\`${e}\` to \`${t}\`)`:`(above \`${e}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class h extends l{constructor({givenSize:t,maxSize:e}){super(`Size cannot exceed \`${e}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class y extends l{constructor({size:t,targetSize:e,type:a}){super(`${a.charAt(0).toUpperCase()}${a.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}var b=a(46059);function S(t){return{to:t.to.toString(),selector:t.selector.toString(),args:t.args.map(t=>t.toString())}}async function v(t,e){const{AztecAddress:r,FunctionSelector:n,Fr:s}=await Promise.resolve().then(a.bind(a,6218)),i=r.fromString(e.to),o=n.fromString(e.selector),c=e.args.map(t=>s.fromHexString(t)),l=await z(t,i,o);return{to:i,selector:o,args:c,name:l.name,type:l.functionType,isStatic:l.isStatic,returnTypes:l.returnTypes}}async function z(t,e,r){const{FunctionSelector:n,getAllFunctionAbis:s}=await Promise.resolve().then(a.bind(a,6218)),i=await t.getContractMetadata(e);if(!i.contractInstance)throw new Error(`no contract instance found for ${e}`);const o=await t.getContractClassMetadata(i.contractInstance.currentContractClassId,!0);if(!o.artifact)throw new Error(`no contract artifact found for ${e}`);const c=(await Promise.all(s(o.artifact).map(async t=>(await n.fromNameAndParameters(t.name,t.parameters)).equals(r)?t:void 0))).find(t=>null!=t);if(!c)throw new Error(`no function artifact found for ${e}`);return c}async function C({contracts:t,artifactStrategy:e}){return await Promise.all(t.map(async t=>{return{address:t.address.toString(),instance:t.instance?(a=t.instance,{version:f(a.version),salt:a.salt.toString(),deployer:a.deployer.toString(),originalContractClassId:a.originalContractClassId.toString(),currentContractClassId:a.currentContractClassId.toString(),initializationHash:a.initializationHash.toString(),publicKeys:a.publicKeys.toString()}):void 0,artifact:t.artifact?await e.serializeArtifact(t.artifact):void 0};var a}))}async function x(t){const{AztecAddress:e}=await Promise.resolve().then(a.bind(a,6218));return{address:e.fromString(t.address),instance:t.instance?await P(t.instance):void 0,artifact:t.artifact?await $(t.artifact):void 0}}async function P(t){const{AztecAddress:e,Fr:r,PublicKeys:n}=await Promise.resolve().then(a.bind(a,6218));return{version:p(t.version),salt:r.fromString(t.salt),deployer:e.fromString(t.deployer),originalContractClassId:r.fromString(t.originalContractClassId),currentContractClassId:r.fromString(t.currentContractClassId),initializationHash:r.fromString(t.initializationHash),publicKeys:n.fromString(t.publicKeys)}}const A=new Map;async function $(t){if("url"===t.type){let e=A.get(t.url);e||(e=(0,b.WY)({method:"GET",url:t.url}),A.set(t.url,e));t={type:"literal",literal:await e}}const{ContractArtifactSchema:e}=await Promise.resolve().then(a.bind(a,85608));return e.parse(t.literal)}function I(t,e,n,o){function l(t){const e=n.find(e=>e.getAddress().toString()===t);return(0,c.assert)(e,`no account found for ${t}`),e}return{async request(c){c=JSON.parse(JSON.stringify(c));const u={aztec_sendTransaction:async n=>{const i=l(n.from);await T(t,e,n.registerContracts??[]);const c=await Promise.all(n.calls.map(t=>v(e,t))),u=await Promise.all(n.authWitnesses.map(async t=>({caller:r.AztecAddress.fromString(t.caller),action:await v(e,t.action)}))),d=await Promise.all(u.map(t=>i.createAuthWit(t))),f=new s.X(c,d,await async function(t){const{Capsule:e,Fr:r,AztecAddress:n}=await Promise.resolve().then(a.bind(a,6218));return t.map(t=>new e(n.fromString(t.contract),r.fromString(t.storageSlot),t.data.map(t=>r.fromString(t))))}(n.capsules??[])),g=await i.createTxExecutionRequest(f,await E(i,o),{}),m=await i.simulateTx(g,!0),p=await i.proveTx(g,m.privateExecutionResult);return(await new r.a5(i,i.sendTx(p.toTx())).getTxHash()).toString()},aztec_call:async a=>{const n=l(a.from);await T(t,e,a.registerContracts??[]);const c=await Promise.all(a.calls.map(t=>v(e,t))),{indexedCalls:u,unconstrained:d}=c.reduce((t,e,a)=>(e.type===i.xZ.UTILITY?t.unconstrained.push([e,a]):t.indexedCalls.push([e,a,e.type===i.xZ.PRIVATE?t.privateIndex++:t.publicIndex++]),t),{indexedCalls:[],unconstrained:[],publicIndex:0,privateIndex:0}),f=d.map(async([t,a])=>{const r=await z(e,t.to,t.selector);return[await n.simulateUtility(t.name,t.args.map((t,e)=>
1(0,i._f)([r.parameters[e].type],[t])),t.to,[],n.getAddress()),a]});let g;if(0!==u.length){const t=new s.X(u.map(([t])=>t),[],[]),e=await n.createTxExecutionRequest(t,await E(n,o),{});g=n.simulateTx(e,!0,void 0,!1)}const[m,p]=await Promise.all([Promise.all(f),g]),w=[];for(const[t,e]of m){let a=c[e].returnTypes;1===a.length&&"tuple"===a[0]?.kind&&(a=a[0].fields);const n=a.map((t,e)=>({type:t,name:`result${e}`,visibility:"public"})),s=(0,r._K)({parameters:n},Array.isArray(t)?t:[t]);w[e]=s}if(p)for(const[t,e,a]of u){const r=t.type==i.xZ.PRIVATE?p.getPrivateReturnValues()?.nested?.[a]?.values:p.getPublicReturnValues()[a]?.values;w[e]=r??[]}return w.map(t=>t.map(t=>t.toString()))},aztec_requestAccounts:async()=>n.map(t=>t.getAddress().toString()),aztec_accounts:async()=>n.map(t=>t.getAddress().toString()),wallet_watchAssets:async()=>{}};let d=await u[c.method](...c.params);return d=JSON.parse(JSON.stringify(d)),d}}}async function E(t,e){return e??=new r.zQ(t.getAddress()),{gasSettings:o.$0.default({maxFeesPerGas:await t.getCurrentBaseFees()}),paymentMethod:e}}async function T(t,e,a){await Promise.all(a.map(async a=>{const r=a.address.toLowerCase();if(T.wasRegistered.has(r))return;const n=await x(a),s=n.instance??await t.getContract(n.address);if(!s)throw new Error(`no contract instance found for ${n.address}`);const i=n.artifact??(await e.getContractClassMetadata(s.currentContractClassId,!0)).artifact;if(!i)throw new Error(`no contract artifact found for ${n.address}`);const o={instance:{...s,address:n.address},artifact:i};await e.registerContract(o),T.wasRegistered.add(r)}))}T.wasRegistered=new Set;a(81189),a(33288);var O=a(2010);a(11971),a(18871);a(64437);a(98743);(0,i.Bp)(O);var _=a(38176);a(73933),a(82598);(0,i.Bp)(_);class M{address;aztecNode;artifactStrategy;provider;constructor(t,e,a,r){this.address=t,this.aztecNode=a,this.artifactStrategy=r,this.provider=e}getAddress(){return this.address}sendTransaction(t){const e=(async()=>{const e=await t;return this.provider.request({method:"aztec_sendTransaction",params:[{from:this.address.toString(),calls:e.calls.map(S),authWitnesses:(e?.authWitnesses??[]).map(t=>({caller:t.caller.toString(),action:S(t.action)})),capsules:(a=e?.capsules??[],a.map(t=>({contract:t.contractAddress.toString(),storageSlot:t.storageSlot.toString(),data:t.data.map(t=>t.toString())}))),registerContracts:await C({contracts:e?.registerContracts??[],artifactStrategy:this.artifactStrategy})}]});var a})().then(t=>r.f1.fromString(t));return new r.a5(this.aztecNode,e)}async simulateTransaction(t){return(await this.provider.request({method:"aztec_call",params:[{from:this.address.toString(),calls:t.calls.map(t=>S(t)),registerContracts:await C({contracts:t.registerContracts??[],artifactStrategy:this.artifactStrategy})}]})).map(t=>t.map(t=>new r.Fr(BigInt(t))))}static fromAztec(t,e,a,r){const s=I(e,a,[t],r),i=new n.ns;return new this(t.getAddress(),s,e,i)}}}}]);

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.