PageSourceSearch

https://www.fables.fi/assets/wallet-balances-CxgBAEux.js

js fables.fi collected 2026-10-08 12:26:37 UTC 2,143 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/rpc-TdhwHNqu.js","assets/index-BcFRVaGh.js","assets/index-Dz1thzAh.css","assets/isAddress-CMHTStph.js","assets/sha3-DjX1lxKK.js"])))=>i.map(i=>d[i]);
2import{R as h,am as f,aF as k,ds as _,bY as b}from"./index-BcFRVaGh.js";import{c as y,l as S,f as C,d as v}from"./lens-BQYcSQwP.js";import{u as L}from"./rpc-TdhwHNqu.js";import{l as B,a as O}from"./scale-CJ0TJdNG.js";import{f as A}from"./Value-C5qJFhF5.js";import"./isAddress-CMHTStph.js";import"./sha3-DjX1lxKK.js";function w(r,o){return A(r,o)}async function U(r,o){const u=o.map(a=>{const t=h(a);return{currency0:t.currency0,currency1:t.currency1,fee:t.fee,tickSpacing:t.tickSpacing,hooks:t.hooks}}),d=[...new Set(u.flatMap(a=>[a.currency0.toLowerCase(),a.currency1.toLowerCase()]))],p=d.filter(a=>!f(a)&&a!==k.address.toLowerCase()),c=S,m=C,i=await L([y(c,"walletState",[r,u,P]),y(m,"tokenStates",[p])]),[n]=v(c,"walletState",i[0]),[e]=v(m,"tokenStates",i[1]);B(e);const l=new Map(e.map(a=>[a.token.toLowerCase(),O(a)])),s={};for(const a of d){if(f(a)){s[a]=w(n.nativeBalance,18);continue}const t=n.tokens.find(E=>E.token.toLowerCase()===a);if(t===void 0)throw new Error(`balance unreadable: ${a}`);s[a]=w(t.balance*(l.get(a)??_)/_,Number(t.decimals))}return s}const P="0x0000000000000000000000000000000000000000";async function M(r,o){const{multicall:u,nativeBalance:d}=await b(async()=>{const{multicall:e,nativeBalance:l}=await import("./rpc-TdhwHNqu.js").then(s=>s.B);return{multicall:e,nativeBalance:l}},__vite__mapDeps([0,1,2,3,4])),{erc20Abi:p}=await b(async()=>{const{erc20Abi:e}=await import("./erc20-CrBdlsmB.js");return{erc20Abi:e}},[]),c=o.filter(e=>!f(e.address)),[m,i]=await Promise.all([u(c.map(e=>({address:e.address,abi:p,functionName:"balanceOf",args:[r]}))),o.some(e=>f(e.address))?d(r):Promise.resolve(null)]),n={};if(c.forEach((e,l)=>{const s=m[l];if(!s?.ok)throw new Error(`balance unreadable: ${e.address}`);n[e.address.toLowerCase()]=w(s.value,e.decimals)}),i!==null)for(const e of o)f(e.address)&&(n[e.address.toLowerCase()]=w(i,18));return n}export{M as fetchErc20Balances,U as fetchTokenBalances};

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.