@gardenfi/utils 2.4.1 → 2.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +4 -4
- package/dist/index119.cjs +1 -1
- package/dist/index119.js +1 -1
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +4 -4
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +2 -2
- package/dist/index195.cjs +1 -1
- package/dist/index195.js +3 -3
- package/dist/index225.cjs +1 -1
- package/dist/index225.js +2 -2
- package/dist/index229.cjs +1 -1
- package/dist/index229.js +1 -1
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +31 -13
- package/dist/index241.cjs +1 -1
- package/dist/index241.js +3 -3
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +32 -58
- package/dist/index26.cjs +1 -16
- package/dist/index26.js +11 -113
- package/dist/index261.cjs +1 -2
- package/dist/index261.js +102 -40
- package/dist/index262.cjs +1 -1
- package/dist/index262.js +7 -2
- package/dist/index263.cjs +1 -1
- package/dist/index263.js +224 -5
- package/dist/index264.cjs +1 -1
- package/dist/index264.js +6 -10
- package/dist/index265.cjs +1 -1
- package/dist/index265.js +7 -20
- package/dist/index266.cjs +1 -1
- package/dist/index266.js +26 -8
- package/dist/index267.cjs +1 -1
- package/dist/index267.js +5 -66
- package/dist/index268.cjs +2 -1
- package/dist/index268.js +40 -64
- package/dist/index269.cjs +1 -1
- package/dist/index269.js +2 -187
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +58 -32
- package/dist/index270.cjs +1 -1
- package/dist/index270.js +8 -20
- package/dist/index271.cjs +1 -1
- package/dist/index271.js +17 -40
- package/dist/index272.cjs +1 -1
- package/dist/index272.js +8 -76
- package/dist/index273.cjs +1 -1
- package/dist/index273.js +66 -40
- package/dist/index274.cjs +1 -1
- package/dist/index274.js +64 -15
- package/dist/index275.cjs +1 -1
- package/dist/index275.js +185 -12
- package/dist/index276.cjs +1 -1
- package/dist/index276.js +21 -11
- package/dist/index277.cjs +1 -2
- package/dist/index277.js +42 -18
- package/dist/index278.cjs +1 -1
- package/dist/index278.js +75 -13
- package/dist/index279.cjs +1 -1
- package/dist/index279.js +40 -11
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +12 -26
- package/dist/index280.cjs +1 -1
- package/dist/index280.js +15 -102
- package/dist/index281.cjs +1 -1
- package/dist/index281.js +13 -6
- package/dist/index282.cjs +1 -1
- package/dist/index282.js +10 -222
- package/dist/index283.cjs +2 -1
- package/dist/index283.js +18 -6
- package/dist/index284.cjs +1 -1
- package/dist/index284.js +15 -7
- package/dist/index285.cjs +1 -1
- package/dist/index285.js +11 -26
- package/dist/index287.cjs +1 -1
- package/dist/index287.js +1 -1
- package/dist/index29.cjs +16 -1
- package/dist/index29.js +113 -7
- package/dist/index292.cjs +1 -1
- package/dist/index292.js +2 -2
- package/dist/index294.cjs +1 -1
- package/dist/index294.js +10 -138
- package/dist/index295.cjs +1 -1
- package/dist/index295.js +19 -42
- package/dist/index296.cjs +1 -1
- package/dist/index296.js +134 -73
- package/dist/index297.cjs +1 -1
- package/dist/index297.js +43 -2
- package/dist/index298.cjs +1 -1
- package/dist/index298.js +77 -10
- package/dist/index299.cjs +1 -1
- package/dist/index299.js +2 -20
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +27 -31
- package/dist/index300.cjs +1 -1
- package/dist/index300.js +698 -68
- package/dist/index301.cjs +1 -1
- package/dist/index301.js +178 -675
- package/dist/index302.cjs +1 -1
- package/dist/index302.js +67 -200
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +8 -12
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +1 -1
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +2 -2
- package/package.json +1 -1
package/dist/index10.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("tough-cookie"),g=require("fetch-cookie"),k=require("./index14.cjs"),f=require("./index15.cjs"),h=require("./index3.cjs"),n=require("./index5.cjs"),m=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("tough-cookie"),g=require("fetch-cookie"),k=require("./index14.cjs"),f=require("./index15.cjs"),h=require("./index3.cjs"),n=require("./index5.cjs"),m=require("./index28.cjs"),y=require("./index27.cjs"),C=require("./index23.cjs"),T=require("./index29.cjs"),v=require("./index25.cjs"),S=c=>c&&c.__esModule?c:{default:c},p=S(g);class u{constructor(t,i,e){if(this.url=t.endpoint("siwe"),this.walletClient=i,this.domain=(e==null?void 0:e.domain)||"app.garden.finance",this.domain.startsWith("https://")&&(this.domain=this.domain.split("https://")[1]),this.signingStatement=(e==null?void 0:e.signingStatement)??"Garden.fi",this.store=(e==null?void 0:e.store)??(typeof window<"u"?window.localStorage:new k.MemoryStorage),typeof window>"u"){const r=new w.CookieJar;this.fetchWithCookies=p.default(fetch,r)}else this.fetchWithCookies=window.fetch.bind(window)}static fromDigestKey(t,i,e){const r=m.createWalletClient({account:C.privateKeyToAccount(h.add0x(i.digestKey)),transport:y.http(),chain:v.mainnet});return new u(t,r,e)}verifyToken(t,i){try{const e=h.parseJwt(t);if(!e)return n.Ok(!1);const r=Math.floor(Date.now()/1e3)+120;return n.Ok(e.exp>r&&e.user_id.toLowerCase()===i.toLowerCase())}catch{return n.Ok(!1)}}async getToken(){var s;if(!((s=this.walletClient.account)!=null&&s.address))return n.Err("Wallet client does not have an account");const t=this.store.getItem(f.StoreKeys.AUTH_TOKEN);if(t){const o=this.verifyToken(t,this.walletClient.account.address);if(o.ok&&o.val)return n.Ok(t)}const i=await this.signStatement();if(i.error)return n.Err(i.error);let e;try{const a=await(await this.fetchWithCookies(this.url.endpoint("tokens"),{method:"POST",body:JSON.stringify({...i.val}),headers:{"Content-Type":"application/json"},credentials:"include"})).json();if(a.error||!a.result)return n.Err(a.error??"Failed to get token");e=a.result}catch(o){return n.Err("Failed to get token",o)}if(!this.verifyToken(e,this.walletClient.account.address).val)throw new Error("Token verification failed");return this.store.setItem(f.StoreKeys.AUTH_TOKEN,e),n.Ok(e)}async signStatement(){var a;if(!((a=this.walletClient.account)!=null&&a.address))return n.Err("Wallet client does not have a valid account");const t=new Date,i=new Date(t.getTime()+300*1e3);let e;try{const l=await(await this.fetchWithCookies(this.url.endpoint("challenges"),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"})).json();if(l.error||!l.result)return n.Err("Failed to get nonce");e=l.result}catch(d){return n.Err("Failed to get nonce",d)}const r=await this.walletClient.getChainId(),s=T.createSiweMessage({domain:this.domain,address:this.walletClient.account.address,statement:this.signingStatement,nonce:e,uri:"https://"+this.domain,version:"1",chainId:r,notBefore:i}),o=await this.walletClient.signMessage({account:this.walletClient.account,message:s});return n.Ok({message:s,signature:o,nonce:e})}async getAuthHeaders(){const t=await this.getToken();return t.ok?n.Ok({Authorization:h.Authorization(t.val)}):n.Err(t.error)}}exports.Siwe=u;
|
package/dist/index10.js
CHANGED
|
@@ -4,11 +4,11 @@ import { MemoryStorage as w } from "./index14.js";
|
|
|
4
4
|
import { StoreKeys as d } from "./index15.js";
|
|
5
5
|
import { add0x as g, parseJwt as k, Authorization as p } from "./index3.js";
|
|
6
6
|
import { Ok as s, Err as r } from "./index5.js";
|
|
7
|
-
import { createWalletClient as y } from "./
|
|
8
|
-
import { http as C } from "./
|
|
7
|
+
import { createWalletClient as y } from "./index28.js";
|
|
8
|
+
import { http as C } from "./index27.js";
|
|
9
9
|
import { privateKeyToAccount as T } from "./index23.js";
|
|
10
|
-
import { createSiweMessage as v } from "./
|
|
11
|
-
import { mainnet as S } from "./
|
|
10
|
+
import { createSiweMessage as v } from "./index29.js";
|
|
11
|
+
import { mainnet as S } from "./index25.js";
|
|
12
12
|
class f {
|
|
13
13
|
constructor(e, n, t) {
|
|
14
14
|
if (this.url = e.endpoint("siwe"), this.walletClient = n, this.domain = (t == null ? void 0 : t.domain) || "app.garden.finance", this.domain.startsWith("https://") && (this.domain = this.domain.split("https://")[1]), this.signingStatement = (t == null ? void 0 : t.signingStatement) ?? "Garden.fi", this.store = (t == null ? void 0 : t.store) ?? (typeof window < "u" ? window.localStorage : new w()), typeof window > "u") {
|
package/dist/index119.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("./index41.cjs"),p=require("./index50.cjs"),e=require("./index141.cjs"),I=require("./index153.cjs"),q=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("./index41.cjs"),p=require("./index50.cjs"),e=require("./index141.cjs"),I=require("./index153.cjs"),q=require("./index285.cjs"),m=require("./index219.cjs"),v=require("./index45.cjs");function N(t,E={}){return async(c,h={})=>{var i;const{dedupe:s=!1,methods:o,retryDelay:R=150,retryCount:l=3,uid:f}={...E,...h},{method:d}=c;if((i=o==null?void 0:o.exclude)!=null&&i.includes(d))throw new e.MethodNotSupportedRpcError(new Error("method not supported"),{method:d});if(o!=null&&o.include&&!o.include.includes(d))throw new e.MethodNotSupportedRpcError(new Error("method not supported"),{method:d});const y=s?I.stringToHex(`${f}.${v.stringify(c)}`):void 0;return q.withDedupe(()=>m.withRetry(async()=>{try{return await t(c)}catch(n){const r=n;switch(r.code){case e.ParseRpcError.code:throw new e.ParseRpcError(r);case e.InvalidRequestRpcError.code:throw new e.InvalidRequestRpcError(r);case e.MethodNotFoundRpcError.code:throw new e.MethodNotFoundRpcError(r,{method:c.method});case e.InvalidParamsRpcError.code:throw new e.InvalidParamsRpcError(r);case e.InternalRpcError.code:throw new e.InternalRpcError(r);case e.InvalidInputRpcError.code:throw new e.InvalidInputRpcError(r);case e.ResourceNotFoundRpcError.code:throw new e.ResourceNotFoundRpcError(r);case e.ResourceUnavailableRpcError.code:throw new e.ResourceUnavailableRpcError(r);case e.TransactionRejectedRpcError.code:throw new e.TransactionRejectedRpcError(r);case e.MethodNotSupportedRpcError.code:throw new e.MethodNotSupportedRpcError(r,{method:c.method});case e.LimitExceededRpcError.code:throw new e.LimitExceededRpcError(r);case e.JsonRpcVersionUnsupportedError.code:throw new e.JsonRpcVersionUnsupportedError(r);case e.UserRejectedRequestError.code:throw new e.UserRejectedRequestError(r);case e.UnauthorizedProviderError.code:throw new e.UnauthorizedProviderError(r);case e.UnsupportedProviderMethodError.code:throw new e.UnsupportedProviderMethodError(r);case e.ProviderDisconnectedError.code:throw new e.ProviderDisconnectedError(r);case e.ChainDisconnectedError.code:throw new e.ChainDisconnectedError(r);case e.SwitchChainError.code:throw new e.SwitchChainError(r);case e.UnsupportedNonOptionalCapabilityError.code:throw new e.UnsupportedNonOptionalCapabilityError(r);case e.UnsupportedChainIdError.code:throw new e.UnsupportedChainIdError(r);case e.DuplicateIdError.code:throw new e.DuplicateIdError(r);case e.UnknownBundleIdError.code:throw new e.UnknownBundleIdError(r);case e.BundleTooLargeError.code:throw new e.BundleTooLargeError(r);case e.AtomicReadyWalletRejectedUpgradeError.code:throw new e.AtomicReadyWalletRejectedUpgradeError(r);case e.AtomicityNotSupportedError.code:throw new e.AtomicityNotSupportedError(r);case 5e3:throw new e.UserRejectedRequestError(r);default:throw n instanceof U.BaseError?n:new e.UnknownRpcError(r)}}},{delay:({count:n,error:r})=>{var a;if(r&&r instanceof p.HttpRequestError){const u=(a=r==null?void 0:r.headers)==null?void 0:a.get("Retry-After");if(u!=null&&u.match(/\d/))return Number.parseInt(u)*1e3}return~~(1<<n)*R},retryCount:l,shouldRetry:({error:n})=>w(n)}),{enabled:s,id:y})}}function w(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===e.LimitExceededRpcError.code||t.code===e.InternalRpcError.code:t instanceof p.HttpRequestError&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}exports.buildRequest=N;exports.shouldRetry=w;
|
package/dist/index119.js
CHANGED
|
@@ -2,7 +2,7 @@ import { BaseError as z } from "./index41.js";
|
|
|
2
2
|
import { HttpRequestError as k } from "./index50.js";
|
|
3
3
|
import { MethodNotSupportedRpcError as s, UnknownRpcError as J, UserRejectedRequestError as u, AtomicityNotSupportedError as f, AtomicReadyWalletRejectedUpgradeError as E, BundleTooLargeError as l, UnknownBundleIdError as R, DuplicateIdError as m, UnsupportedChainIdError as y, UnsupportedNonOptionalCapabilityError as I, SwitchChainError as U, ChainDisconnectedError as v, ProviderDisconnectedError as b, UnsupportedProviderMethodError as N, UnauthorizedProviderError as q, JsonRpcVersionUnsupportedError as C, LimitExceededRpcError as a, TransactionRejectedRpcError as D, ResourceUnavailableRpcError as P, ResourceNotFoundRpcError as x, InvalidInputRpcError as j, InternalRpcError as i, InvalidParamsRpcError as B, MethodNotFoundRpcError as M, InvalidRequestRpcError as S, ParseRpcError as T } from "./index141.js";
|
|
4
4
|
import { stringToHex as O } from "./index153.js";
|
|
5
|
-
import { withDedupe as V } from "./
|
|
5
|
+
import { withDedupe as V } from "./index285.js";
|
|
6
6
|
import { withRetry as W } from "./index219.js";
|
|
7
7
|
import { stringify as _ } from "./index45.js";
|
|
8
8
|
function te(r, A = {}) {
|
package/dist/index16.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index5.cjs"),a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index5.cjs"),a=require("./index24.cjs"),s=require("./index25.cjs"),l=require("./index26.cjs"),b=require("./index27.cjs"),n={42161:s.mainnet,421614:a.sepolia},h=async r=>{const{chain:e}=r;if(!e)return c.Err("No chain found");const o=(u=>u in n)(e.id)?n[e.id]:e;return await i(o)},i=async r=>{const e=l.createPublicClient({chain:r,transport:b.http()});try{const t=await e.getBlockNumber();return c.Ok(Number(t))}catch(t){return c.Err("Failed to fetch evm block number",t)}};exports._fetchEVMBlockNumber=i;exports.fetchEVMBlockNumber=h;
|
package/dist/index16.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Err as c, Ok as a } from "./index5.js";
|
|
2
|
-
import { sepolia as m } from "./
|
|
3
|
-
import { mainnet as s } from "./
|
|
4
|
-
import { createPublicClient as u } from "./
|
|
5
|
-
import { http as l } from "./
|
|
2
|
+
import { sepolia as m } from "./index24.js";
|
|
3
|
+
import { mainnet as s } from "./index25.js";
|
|
4
|
+
import { createPublicClient as u } from "./index26.js";
|
|
5
|
+
import { http as l } from "./index27.js";
|
|
6
6
|
const n = {
|
|
7
7
|
42161: s,
|
|
8
8
|
421614: m
|
package/dist/index18.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index30.cjs"),u=require("./index31.cjs");class l{static async _postWithFallback(a,t){let r="";for(const n of a)try{const s=await fetch(n,{method:"POST",...t});if(s.status>=500){r=await(s.text()||s.json());continue}return await this.parse(s)}catch(s){r=o(s);continue}throw new Error(r||"All APIs failed")}static async postWithFallback(a,t){return await c(t).retry(()=>this._postWithFallback(a,t))}static async _getWithFallback(a,t){let r="";for(const n of a)try{const s=await fetch(n,t);if(s.status>=500){r=await(s.text()||s.json());continue}return await this.parse(s)}catch(s){r=o(s);continue}throw new Error(r||"All APIs failed")}static async getWithFallback(a,t){return await c(t).retry(()=>this._getWithFallback(a,t))}static async _get(a,t){return await this.parse(await fetch(a,t))}static async get(a,t){return await c(t).retry(()=>this._get(a,t))}static async _post(a,t){return await this.parse(await fetch(a,{method:"POST",...t}))}static async post(a,t){return await c(t).retry(()=>this._post(a,t))}static async parse(a){const t=await a.text();if(a.status>=200&&a.status<300)return u.safeParseJson(t);throw new Error(t)}}function o(e){return(e==null?void 0:e.message)||(e==null?void 0:e.toString())||"unknown error"}const c=e=>new i.Retry((e==null?void 0:e.retryCount)??2,(e==null?void 0:e.retryDelay)??1e3);exports.Fetcher=l;
|
package/dist/index18.js
CHANGED
package/dist/index195.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./index261.cjs"),F=require("./index262.cjs"),n=require("./index263.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const p={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")};BigInt(0);const P=BigInt(1),u=BigInt(2),h=(t,f)=>(t+f/u)/f;function G(t){const f=p.p,e=BigInt(3),a=BigInt(6),B=BigInt(11),r=BigInt(22),s=BigInt(23),i=BigInt(44),d=BigInt(88),o=t*t*t%f,c=o*o*t%f,b=n.pow2(c,e,f)*c%f,g=n.pow2(b,e,f)*c%f,_=n.pow2(g,u,f)*o%f,I=n.pow2(_,B,f)*_%f,w=n.pow2(I,r,f)*I%f,x=n.pow2(w,i,f)*w%f,k=n.pow2(x,d,f)*x%f,m=n.pow2(k,i,f)*w%f,S=n.pow2(m,e,f)*c%f,E=n.pow2(S,s,f)*I%f,v=n.pow2(E,a,f)*o%f,q=n.pow2(v,u,f);if(!l.eql(l.sqr(q),t))throw new Error("Cannot find square root");return q}const l=n.Field(p.p,void 0,void 0,{sqrt:G}),M=F.createCurve({...p,Fp:l,lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const f=p.n,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),a=-P*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),B=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),r=e,s=BigInt("0x100000000000000000000000000000000"),i=h(r*t,f),d=h(-a*t,f);let o=n.mod(t-i*e-d*B,f),c=n.mod(-i*a-d*r,f);const b=o>s,g=c>s;if(b&&(o=f-o),g&&(c=f-c),o>s||c>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:b,k1:o,k2neg:g,k2:c}}}},C.sha256);exports.secp256k1=M;
|
package/dist/index195.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { sha256 as v } from "./
|
|
2
|
-
import { createCurve as G } from "./
|
|
3
|
-
import { Field as P, mod as h, pow2 as t } from "./
|
|
1
|
+
import { sha256 as v } from "./index261.js";
|
|
2
|
+
import { createCurve as G } from "./index262.js";
|
|
3
|
+
import { Field as P, mod as h, pow2 as t } from "./index263.js";
|
|
4
4
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
5
5
|
const B = {
|
|
6
6
|
p: BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),
|
package/dist/index225.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index264.cjs"),r=require("./index265.cjs");function n(t){return e.hashSignature(r.toSignature(t))}exports.toSignatureHash=n;
|
package/dist/index225.js
CHANGED
package/dist/index229.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index261.cjs"),s=e.sha256;exports.sha256=s;
|
package/dist/index229.js
CHANGED
package/dist/index24.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index216.cjs"),a=e.defineChain({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.drpc.org"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",blockCreated:5317080}},testnet:!0});exports.sepolia=a;
|
package/dist/index24.js
CHANGED
|
@@ -1,15 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { defineChain as e } from "./index216.js";
|
|
2
|
+
const s = /* @__PURE__ */ e({
|
|
3
|
+
id: 11155111,
|
|
4
|
+
name: "Sepolia",
|
|
5
|
+
nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 },
|
|
6
|
+
rpcUrls: {
|
|
7
|
+
default: {
|
|
8
|
+
http: ["https://sepolia.drpc.org"]
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
blockExplorers: {
|
|
12
|
+
default: {
|
|
13
|
+
name: "Etherscan",
|
|
14
|
+
url: "https://sepolia.etherscan.io",
|
|
15
|
+
apiUrl: "https://api-sepolia.etherscan.io/api"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
contracts: {
|
|
19
|
+
multicall3: {
|
|
20
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
21
|
+
blockCreated: 751532
|
|
22
|
+
},
|
|
23
|
+
ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
|
|
24
|
+
ensUniversalResolver: {
|
|
25
|
+
address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",
|
|
26
|
+
blockCreated: 5317080
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
testnet: !0
|
|
30
|
+
});
|
|
13
31
|
export {
|
|
14
|
-
|
|
32
|
+
s as sepolia
|
|
15
33
|
};
|
package/dist/index241.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index273.cjs"),c=require("./index274.cjs"),o=require("./index275.cjs");function a(t){const n=c.parseStructs(t),r=[],i=t.length;for(let e=0;e<i;e++){const s=t[e];u.isStructSignature(s)||r.push(o.parseSignature(s,n))}return r}exports.parseAbi=a;
|
package/dist/index241.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isStructSignature as c } from "./
|
|
2
|
-
import { parseStructs as s } from "./
|
|
3
|
-
import { parseSignature as p } from "./
|
|
1
|
+
import { isStructSignature as c } from "./index273.js";
|
|
2
|
+
import { parseStructs as s } from "./index274.js";
|
|
3
|
+
import { parseSignature as p } from "./index275.js";
|
|
4
4
|
function a(t) {
|
|
5
5
|
const i = s(t), o = [], e = t.length;
|
|
6
6
|
for (let r = 0; r < e; r++) {
|
package/dist/index25.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index216.cjs"),t=e.defineChain({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}});exports.mainnet=t;
|
package/dist/index25.js
CHANGED
|
@@ -1,60 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
sort: (t, H) => t.id - H.id
|
|
33
|
-
}), F = async (t) => o ? E(t) : [
|
|
34
|
-
await p.request({
|
|
35
|
-
body: t
|
|
36
|
-
})
|
|
37
|
-
], [{ error: s, result: l }] = await F(i);
|
|
38
|
-
if (R)
|
|
39
|
-
return { error: s, result: l };
|
|
40
|
-
if (s)
|
|
41
|
-
throw new O({
|
|
42
|
-
body: i,
|
|
43
|
-
error: s,
|
|
44
|
-
url: r
|
|
45
|
-
});
|
|
46
|
-
return l;
|
|
47
|
-
},
|
|
48
|
-
retryCount: b,
|
|
49
|
-
retryDelay: d,
|
|
50
|
-
timeout: c,
|
|
51
|
-
type: "http"
|
|
52
|
-
}, {
|
|
53
|
-
fetchOptions: u,
|
|
54
|
-
url: r
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
}
|
|
1
|
+
import { defineChain as e } from "./index216.js";
|
|
2
|
+
const t = /* @__PURE__ */ e({
|
|
3
|
+
id: 1,
|
|
4
|
+
name: "Ethereum",
|
|
5
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
6
|
+
rpcUrls: {
|
|
7
|
+
default: {
|
|
8
|
+
http: ["https://eth.merkle.io"]
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
blockExplorers: {
|
|
12
|
+
default: {
|
|
13
|
+
name: "Etherscan",
|
|
14
|
+
url: "https://etherscan.io",
|
|
15
|
+
apiUrl: "https://api.etherscan.io/api"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
contracts: {
|
|
19
|
+
ensRegistry: {
|
|
20
|
+
address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"
|
|
21
|
+
},
|
|
22
|
+
ensUniversalResolver: {
|
|
23
|
+
address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67",
|
|
24
|
+
blockCreated: 19258213
|
|
25
|
+
},
|
|
26
|
+
multicall3: {
|
|
27
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
28
|
+
blockCreated: 14353601
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
58
32
|
export {
|
|
59
|
-
|
|
33
|
+
t as mainnet
|
|
60
34
|
};
|
package/dist/index26.cjs
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`))throw new e.SiweInvalidMessageFieldError({field:"statement",metaMessages:["- Statement must not include '\\n'.","",`Provided value: ${t}`]})}const $=M.getAddress(r.address),v=i?`${i}://${s}`:s,I=r.statement?`${r.statement}
|
|
3
|
-
`:"",S=`${v} wants you to sign in with your Ethereum account:
|
|
4
|
-
${$}
|
|
5
|
-
|
|
6
|
-
${I}`;let n=`URI: ${c}
|
|
7
|
-
Version: ${d}
|
|
8
|
-
Chain ID: ${o}
|
|
9
|
-
Nonce: ${a}
|
|
10
|
-
Issued At: ${m.toISOString()}`;if(l&&(n+=`
|
|
11
|
-
Expiration Time: ${l.toISOString()}`),f&&(n+=`
|
|
12
|
-
Not Before: ${f.toISOString()}`),w&&(n+=`
|
|
13
|
-
Request ID: ${w}`),g){let t=`
|
|
14
|
-
Resources:`;for(const u of g){if(!h.isUri(u))throw new e.SiweInvalidMessageFieldError({field:"resources",metaMessages:["- Every resource must be a RFC 3986 URI.","- See https://www.rfc-editor.org/rfc/rfc3986","",`Provided value: ${u}`]});t+=`
|
|
15
|
-
- ${u}`}n+=t}return`${S}
|
|
16
|
-
${n}`}const E=/^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(:[0-9]{1,5})?$/,F=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:[0-9]{1,5})?$/,b=/^localhost(:[0-9]{1,5})?$/,A=/^[a-zA-Z0-9]{8,}$/,P=/^([a-zA-Z][a-zA-Z0-9+-.]*)$/;exports.createSiweMessage=R;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index47.cjs"),n=require("./index55.cjs");function l(e){const{key:t="public",name:i="Public Client"}=e;return c.createClient({...e,key:t,name:i,type:"publicClient"}).extend(n.publicActions)}exports.createPublicClient=l;
|
package/dist/index26.js
CHANGED
|
@@ -1,116 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"- Chain ID must be a EIP-155 chain ID.",
|
|
12
|
-
"- See https://eips.ethereum.org/EIPS/eip-155",
|
|
13
|
-
"",
|
|
14
|
-
`Provided value: ${i}`
|
|
15
|
-
]
|
|
16
|
-
});
|
|
17
|
-
if (!(p.test(s) || M.test(s) || x.test(s)))
|
|
18
|
-
throw new e({
|
|
19
|
-
field: "domain",
|
|
20
|
-
metaMessages: [
|
|
21
|
-
"- Domain must be an RFC 3986 authority.",
|
|
22
|
-
"- See https://www.rfc-editor.org/rfc/rfc3986",
|
|
23
|
-
"",
|
|
24
|
-
`Provided value: ${s}`
|
|
25
|
-
]
|
|
26
|
-
});
|
|
27
|
-
if (!A.test(a))
|
|
28
|
-
throw new e({
|
|
29
|
-
field: "nonce",
|
|
30
|
-
metaMessages: [
|
|
31
|
-
"- Nonce must be at least 8 characters.",
|
|
32
|
-
"- Nonce must be alphanumeric.",
|
|
33
|
-
"",
|
|
34
|
-
`Provided value: ${a}`
|
|
35
|
-
]
|
|
36
|
-
});
|
|
37
|
-
if (!$(c))
|
|
38
|
-
throw new e({
|
|
39
|
-
field: "uri",
|
|
40
|
-
metaMessages: [
|
|
41
|
-
"- URI must be a RFC 3986 URI referring to the resource that is the subject of the signing.",
|
|
42
|
-
"- See https://www.rfc-editor.org/rfc/rfc3986",
|
|
43
|
-
"",
|
|
44
|
-
`Provided value: ${c}`
|
|
45
|
-
]
|
|
46
|
-
});
|
|
47
|
-
if (f !== "1")
|
|
48
|
-
throw new e({
|
|
49
|
-
field: "version",
|
|
50
|
-
metaMessages: [
|
|
51
|
-
"- Version must be '1'.",
|
|
52
|
-
"",
|
|
53
|
-
`Provided value: ${f}`
|
|
54
|
-
]
|
|
55
|
-
});
|
|
56
|
-
if (o && !P.test(o))
|
|
57
|
-
throw new e({
|
|
58
|
-
field: "scheme",
|
|
59
|
-
metaMessages: [
|
|
60
|
-
"- Scheme must be an RFC 3986 URI scheme.",
|
|
61
|
-
"- See https://www.rfc-editor.org/rfc/rfc3986#section-3.1",
|
|
62
|
-
"",
|
|
63
|
-
`Provided value: ${o}`
|
|
64
|
-
]
|
|
65
|
-
});
|
|
66
|
-
const t = n.statement;
|
|
67
|
-
if (t != null && t.includes(`
|
|
68
|
-
`))
|
|
69
|
-
throw new e({
|
|
70
|
-
field: "statement",
|
|
71
|
-
metaMessages: [
|
|
72
|
-
"- Statement must not include '\\n'.",
|
|
73
|
-
"",
|
|
74
|
-
`Provided value: ${t}`
|
|
75
|
-
]
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
const l = S(n.address), v = o ? `${o}://${s}` : s, I = n.statement ? `${n.statement}
|
|
79
|
-
` : "", R = `${v} wants you to sign in with your Ethereum account:
|
|
80
|
-
${l}
|
|
81
|
-
|
|
82
|
-
${I}`;
|
|
83
|
-
let r = `URI: ${c}
|
|
84
|
-
Version: ${f}
|
|
85
|
-
Chain ID: ${i}
|
|
86
|
-
Nonce: ${a}
|
|
87
|
-
Issued At: ${g.toISOString()}`;
|
|
88
|
-
if (u && (r += `
|
|
89
|
-
Expiration Time: ${u.toISOString()}`), m && (r += `
|
|
90
|
-
Not Before: ${m.toISOString()}`), h && (r += `
|
|
91
|
-
Request ID: ${h}`), w) {
|
|
92
|
-
let t = `
|
|
93
|
-
Resources:`;
|
|
94
|
-
for (const d of w) {
|
|
95
|
-
if (!$(d))
|
|
96
|
-
throw new e({
|
|
97
|
-
field: "resources",
|
|
98
|
-
metaMessages: [
|
|
99
|
-
"- Every resource must be a RFC 3986 URI.",
|
|
100
|
-
"- See https://www.rfc-editor.org/rfc/rfc3986",
|
|
101
|
-
"",
|
|
102
|
-
`Provided value: ${d}`
|
|
103
|
-
]
|
|
104
|
-
});
|
|
105
|
-
t += `
|
|
106
|
-
- ${d}`;
|
|
107
|
-
}
|
|
108
|
-
r += t;
|
|
109
|
-
}
|
|
110
|
-
return `${R}
|
|
111
|
-
${r}`;
|
|
1
|
+
import { createClient as n } from "./index47.js";
|
|
2
|
+
import { publicActions as c } from "./index55.js";
|
|
3
|
+
function u(t) {
|
|
4
|
+
const { key: e = "public", name: i = "Public Client" } = t;
|
|
5
|
+
return n({
|
|
6
|
+
...t,
|
|
7
|
+
key: e,
|
|
8
|
+
name: i,
|
|
9
|
+
type: "publicClient"
|
|
10
|
+
}).extend(c);
|
|
112
11
|
}
|
|
113
|
-
const p = /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(:[0-9]{1,5})?$/, M = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:[0-9]{1,5})?$/, x = /^localhost(:[0-9]{1,5})?$/, A = /^[a-zA-Z0-9]{8,}$/, P = /^([a-zA-Z][a-zA-Z0-9+-.]*)$/;
|
|
114
12
|
export {
|
|
115
|
-
|
|
13
|
+
u as createPublicClient
|
|
116
14
|
};
|
package/dist/index261.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`);super(u),Object.defineProperty(this,"details",{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,"metaMessages",{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,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),e.cause&&(this.cause=e.cause),this.details=s,this.docsPath=r,this.metaMessages=e.metaMessages,this.shortMessage=a}}exports.BaseError=t;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index298.cjs"),x=require("./index287.cjs"),_=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),f=new Uint32Array(64);class u extends e.HashMD{constructor(o=32){super(64,o,8,!1),this.A=e.SHA256_IV[0]|0,this.B=e.SHA256_IV[1]|0,this.C=e.SHA256_IV[2]|0,this.D=e.SHA256_IV[3]|0,this.E=e.SHA256_IV[4]|0,this.F=e.SHA256_IV[5]|0,this.G=e.SHA256_IV[6]|0,this.H=e.SHA256_IV[7]|0}get(){const{A:o,B:h,C:s,D:a,E:r,F:b,G:c,H:i}=this;return[o,h,s,a,r,b,c,i]}set(o,h,s,a,r,b,c,i){this.A=o|0,this.B=h|0,this.C=s|0,this.D=a|0,this.E=r|0,this.F=b|0,this.G=c|0,this.H=i|0}process(o,h){for(let t=0;t<16;t++,h+=4)f[t]=o.getUint32(h,!1);for(let t=16;t<64;t++){const H=f[t-15],d=f[t-2],S=x.rotr(H,7)^x.rotr(H,18)^H>>>3,l=x.rotr(d,17)^x.rotr(d,19)^d>>>10;f[t]=l+f[t-7]+S+f[t-16]|0}let{A:s,B:a,C:r,D:b,E:c,F:i,G:n,H:A}=this;for(let t=0;t<64;t++){const H=x.rotr(c,6)^x.rotr(c,11)^x.rotr(c,25),d=A+H+e.Chi(c,i,n)+_[t]+f[t]|0,l=(x.rotr(s,2)^x.rotr(s,13)^x.rotr(s,22))+e.Maj(s,a,r)|0;A=n,n=i,i=c,c=b+d|0,b=r,r=a,a=s,s=d+l|0}s=s+this.A|0,a=a+this.B|0,r=r+this.C|0,b=b+this.D|0,c=c+this.E|0,i=i+this.F|0,n=n+this.G|0,A=A+this.H|0,this.set(s,a,r,b,c,i,n,A)}roundClean(){x.clean(f)}destroy(){this.set(0,0,0,0,0,0,0,0),x.clean(this.buffer)}}const I=x.createHasher(()=>new u);exports.SHA256=u;exports.sha256=I;
|