@gardenfi/utils 2.1.3-beta.1 → 2.1.3-beta.2
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/index104.cjs +1 -1
- package/dist/index104.js +1 -1
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +2 -2
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +4 -4
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +1 -1
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +1 -1
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +1 -1
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +1 -1
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +6 -6
- package/dist/index230.cjs +1 -1
- package/dist/index230.js +25 -10
- package/dist/index231.cjs +1 -1
- package/dist/index231.js +13 -16
- package/dist/index232.cjs +1 -1
- package/dist/index232.js +14 -21
- package/dist/index233.cjs +1 -1
- package/dist/index233.js +5 -30
- package/dist/index234.cjs +1 -1
- package/dist/index234.js +14 -2
- package/dist/index235.cjs +1 -1
- package/dist/index235.js +9 -12
- package/dist/index236.cjs +1 -1
- package/dist/index236.js +16 -12
- package/dist/index237.cjs +1 -1
- package/dist/index237.js +10 -47
- package/dist/index238.cjs +1 -1
- package/dist/index238.js +15 -10
- package/dist/index239.cjs +1 -1
- package/dist/index239.js +22 -7
- package/dist/index240.cjs +1 -1
- package/dist/index240.js +30 -9
- package/dist/index241.cjs +1 -1
- package/dist/index241.js +2 -14
- package/dist/index242.cjs +1 -1
- package/dist/index242.js +13 -14
- package/dist/index243.cjs +1 -1
- package/dist/index243.js +12 -9
- package/dist/index244.cjs +1 -1
- package/dist/index244.js +47 -24
- package/dist/index245.cjs +1 -1
- package/dist/index245.js +11 -12
- package/dist/index246.cjs +1 -1
- package/dist/index246.js +7 -24
- package/dist/index247.cjs +1 -2
- package/dist/index247.js +9 -24
- package/dist/index248.cjs +1 -1
- package/dist/index248.js +10 -10
- package/dist/index249.cjs +1 -1
- package/dist/index249.js +14 -15
- package/dist/index250.cjs +1 -1
- package/dist/index250.js +9 -52
- package/dist/index251.cjs +1 -1
- package/dist/index251.js +24 -25
- package/dist/index252.cjs +1 -1
- package/dist/index252.js +12 -13
- package/dist/index253.cjs +1 -1
- package/dist/index253.js +24 -15
- package/dist/index254.cjs +2 -1
- package/dist/index254.js +24 -5
- package/dist/index255.cjs +1 -1
- package/dist/index255.js +12 -12
- package/dist/index256.cjs +1 -1
- package/dist/index256.js +15 -10
- package/dist/index257.cjs +1 -1
- package/dist/index257.js +52 -16
- package/dist/index266.cjs +1 -1
- package/dist/index266.js +1 -1
- package/dist/index277.cjs +1 -1
- package/dist/index277.js +1 -1
- package/dist/index278.cjs +1 -1
- package/dist/index278.js +1 -1
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +2 -2
- package/dist/index284.cjs +1 -1
- package/dist/index284.js +1 -1
- package/dist/index286.cjs +1 -1
- package/dist/index286.js +40 -3
- package/dist/index287.cjs +1 -1
- package/dist/index287.js +2 -141
- package/dist/index288.cjs +1 -1
- package/dist/index288.js +199 -148
- package/dist/index289.cjs +1 -1
- package/dist/index289.js +3 -9
- package/dist/index290.cjs +1 -1
- package/dist/index290.js +130 -103
- package/dist/index291.cjs +1 -2
- package/dist/index291.js +123 -102
- package/dist/index292.cjs +1 -1
- package/dist/index292.js +9 -40
- package/dist/index293.cjs +1 -1
- package/dist/index293.js +114 -2
- package/dist/index294.cjs +2 -1
- package/dist/index294.js +125 -197
- package/dist/index295.cjs +1 -1
- package/dist/index295.js +11 -68
- package/dist/index296.cjs +1 -1
- package/dist/index296.js +19 -11
- package/dist/index297.cjs +1 -1
- package/dist/index297.js +68 -19
- package/dist/index298.cjs +1 -1
- package/dist/index298.js +1 -1
- package/dist/index299.cjs +1 -1
- package/dist/index299.js +1 -1
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +1 -1
- package/dist/index302.cjs +1 -1
- package/dist/index302.js +1 -1
- package/dist/index303.cjs +1 -1
- package/dist/index303.js +1 -1
- package/dist/index307.cjs +1 -1
- package/dist/index307.js +2 -2
- package/dist/index308.cjs +1 -1
- package/dist/index308.js +1 -1
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +1 -1
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +2 -2
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +1 -1
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +2 -2
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +1 -1
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +2 -2
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +6 -6
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +2 -2
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +1 -1
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +1 -1
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +1 -1
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +4 -4
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +1 -1
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +1 -1
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +1 -1
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +3 -3
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +2 -2
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +1 -1
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +1 -1
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +1 -1
- package/package.json +1 -1
package/dist/index73.js
CHANGED
package/dist/index74.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index150.cjs"),a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index150.cjs"),a=require("./index250.cjs");async function y(r,{blockCount:i,blockNumber:e,blockTag:n="latest",rewardPercentiles:s}){const t=typeof e=="bigint"?o.numberToHex(e):void 0,u=await r.request({method:"eth_feeHistory",params:[o.numberToHex(i),t||n,s]},{dedupe:!!t});return a.formatFeeHistory(u)}exports.getFeeHistory=y;
|
package/dist/index74.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { numberToHex as o } from "./index150.js";
|
|
2
|
-
import { formatFeeHistory as f } from "./
|
|
2
|
+
import { formatFeeHistory as f } from "./index250.js";
|
|
3
3
|
async function u(r, { blockCount: i, blockNumber: e, blockTag: n = "latest", rewardPercentiles: s }) {
|
|
4
4
|
const t = typeof e == "bigint" ? o(e) : void 0, a = await r.request({
|
|
5
5
|
method: "eth_feeHistory",
|
package/dist/index79.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index150.cjs"),u=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index150.cjs"),u=require("./index256.cjs");async function i(o,{address:t,blockNumber:e,blockTag:r,storageKeys:n}){const a=r??"latest",c=e!==void 0?s.numberToHex(e):void 0,f=await o.request({method:"eth_getProof",params:[t,n,c||a]});return u.formatProof(f)}exports.getProof=i;
|
package/dist/index79.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { numberToHex as c } from "./index150.js";
|
|
2
|
-
import { formatProof as s } from "./
|
|
2
|
+
import { formatProof as s } from "./index256.js";
|
|
3
3
|
async function d(t, { address: e, blockNumber: o, blockTag: r, storageKeys: n }) {
|
|
4
4
|
const f = r ?? "latest", a = o !== void 0 ? c(o) : void 0, m = await t.request({
|
|
5
5
|
method: "eth_getProof",
|
package/dist/index85.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./index240.cjs"),D=require("./index45.cjs"),F=require("./index122.cjs"),C=require("./index127.cjs"),H=require("./index143.cjs"),S=require("./index170.cjs"),A=require("./index177.cjs"),U=require("./index150.cjs"),j=require("./index221.cjs"),z=require("./index251.cjs"),I=require("./index155.cjs"),L=require("./index157.cjs"),M=require("./index184.cjs"),P=require("./index244.cjs"),V=require("./index197.cjs");async function Z(v,O){const{blockNumber:m,blockTag:w="latest",blocks:q,returnFullTransactions:N,traceTransfers:R,validation:x}=O;try{const c=[];for(const t of q){const l=t.blockOverrides?B.toRpc(t.blockOverrides):void 0,e=t.calls.map(n=>{const r=n,o=r.account?D.parseAccount(r.account):void 0,u={...r,data:r.abi?A.encodeFunctionData(r):r.data,from:r.from??(o==null?void 0:o.address)};return V.assertRequest(u),M.formatTransactionRequest(u)}),f=t.stateOverrides?P.serializeStateOverride(t.stateOverrides):void 0;c.push({blockOverrides:l,calls:e,stateOverrides:f})}const a=(typeof m=="bigint"?U.numberToHex(m):void 0)||w;return(await v.request({method:"eth_simulateV1",params:[{blockStateCalls:c,returnFullTransactions:N,traceTransfers:R,validation:x},a]})).map((t,l)=>({...I.formatBlock(t),calls:t.calls.map((e,f)=>{var g,k;const{abi:n,args:r,functionName:o,to:u}=q[l].calls[f],b=((g=e.error)==null?void 0:g.data)??e.returnData,E=BigInt(e.gasUsed),h=(k=e.logs)==null?void 0:k.map(s=>L.formatLog(s)),i=e.status==="0x1"?"success":"failure",T=n&&i==="success"&&b!=="0x"?S.decodeFunctionResult({abi:n,data:b,functionName:o}):null,y=(()=>{var p;if(i==="success")return;let s;if(((p=e.error)==null?void 0:p.data)==="0x"?s=new F.AbiDecodingZeroDataError:e.error&&(s=new C.RawContractError(e.error)),!!s)return j.getContractError(s,{abi:n??[],address:u,args:r,functionName:o??"<unknown>"})})();return{data:b,gasUsed:E,logs:h,status:i,...i==="success"?{result:T}:{error:y}}})}))}catch(c){const d=c,a=z.getNodeError(d,{});throw a instanceof H.UnknownNodeError?d:a}}exports.simulateBlocks=Z;
|
package/dist/index85.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toRpc as y } from "./
|
|
1
|
+
import { toRpc as y } from "./index240.js";
|
|
2
2
|
import { parseAccount as B } from "./index45.js";
|
|
3
3
|
import { AbiDecodingZeroDataError as C } from "./index122.js";
|
|
4
4
|
import { RawContractError as F } from "./index127.js";
|
|
@@ -7,11 +7,11 @@ import { decodeFunctionResult as U } from "./index170.js";
|
|
|
7
7
|
import { encodeFunctionData as A } from "./index177.js";
|
|
8
8
|
import { numberToHex as S } from "./index150.js";
|
|
9
9
|
import { getContractError as z } from "./index221.js";
|
|
10
|
-
import { getNodeError as I } from "./
|
|
10
|
+
import { getNodeError as I } from "./index251.js";
|
|
11
11
|
import { formatBlock as L } from "./index155.js";
|
|
12
12
|
import { formatLog as V } from "./index157.js";
|
|
13
13
|
import { formatTransactionRequest as Z } from "./index184.js";
|
|
14
|
-
import { serializeStateOverride as _ } from "./
|
|
14
|
+
import { serializeStateOverride as _ } from "./index244.js";
|
|
15
15
|
import { assertRequest as j } from "./index197.js";
|
|
16
16
|
async function ar(w, x) {
|
|
17
17
|
const { blockNumber: p, blockTag: N = "latest", blocks: b, returnFullTransactions: O, traceTransfers: h, validation: E } = x;
|
package/dist/index86.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("./index252.cjs"),a=require("./index253.cjs"),Q=require("./index45.cjs"),n=require("./index117.cjs"),W=require("./index118.cjs"),X=require("./index38.cjs"),Y=require("./index177.cjs"),Z=require("./index59.cjs"),$=require("./index85.cjs"),k=require("./index182.cjs"),_="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function ss(q,o){const{blockNumber:C,blockTag:v,calls:N,stateOverrides:d,traceAssetChanges:f,traceTransfers:T,validation:w}=o,t=o.account?Q.parseAccount(o.account):void 0;if(f&&!t)throw new X.BaseError("`account` is required when `traceAssetChanges` is true");const B=t?z.encode(z.from("constructor(bytes, bytes)"),{bytecode:W.deploylessCallViaBytecodeBytecode,args:[_,a.encodeData(a.from("function getBalance(address)"),[t.address])]}):void 0,c=f?await Promise.all(o.calls.map(async s=>{if(!s.data&&!s.abi)return;const{accessList:e}=await Z.createAccessList(q,{account:t.address,...s,data:s.abi?Y.encodeFunctionData(s):s.data});return e.map(({address:r,storageKeys:i})=>i.length>0?r:null)})).then(s=>s.flat().filter(Boolean)):[],P=d==null?void 0:d.map(s=>s.address===(t==null?void 0:t.address)?{...s,nonce:0}:s),l=await $.simulateBlocks(q,{blockNumber:C,blockTag:v,blocks:[...f?[{calls:[{data:B}],stateOverrides:d},{calls:c.map((s,e)=>({abi:[a.from("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[t.address],to:s,from:n.zeroAddress,nonce:e})),stateOverrides:[{address:n.zeroAddress,nonce:0}]}]:[],{calls:[...N,{}].map((s,e)=>({...s,from:t==null?void 0:t.address,nonce:e})),stateOverrides:P},...f?[{calls:[{data:B}]},{calls:c.map((s,e)=>({abi:[a.from("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[t.address],to:s,from:n.zeroAddress,nonce:e})),stateOverrides:[{address:n.zeroAddress,nonce:0}]},{calls:c.map((s,e)=>({to:s,abi:[a.from("function decimals() returns (uint256)")],functionName:"decimals",from:n.zeroAddress,nonce:e})),stateOverrides:[{address:n.zeroAddress,nonce:0}]},{calls:c.map((s,e)=>({to:s,abi:[a.from("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:n.zeroAddress,nonce:e})),stateOverrides:[{address:n.zeroAddress,nonce:0}]},{calls:c.map((s,e)=>({to:s,abi:[a.from("function symbol() returns (string)")],functionName:"symbol",from:n.zeroAddress,nonce:e})),stateOverrides:[{address:n.zeroAddress,nonce:0}]}]:[]],traceTransfers:T,validation:w}),I=f?l[2]:l[0],[u,b,,m,g,p,A,y]=f?l:[],{calls:D,...F}=I,L=D.slice(0,-1)??[],R=(u==null?void 0:u.calls)??[],S=(b==null?void 0:b.calls)??[],U=[...R,...S].map(s=>s.status==="success"?k.hexToBigInt(s.data):null),E=(m==null?void 0:m.calls)??[],H=(g==null?void 0:g.calls)??[],j=[...E,...H].map(s=>s.status==="success"?k.hexToBigInt(s.data):null),x=((p==null?void 0:p.calls)??[]).map(s=>s.status==="success"?s.result:null),M=((y==null?void 0:y.calls)??[]).map(s=>s.status==="success"?s.result:null),V=((A==null?void 0:A.calls)??[]).map(s=>s.status==="success"?s.result:null),h=[];for(const[s,e]of j.entries()){const r=U[s];if(typeof e!="bigint"||typeof r!="bigint")continue;const i=x[s-1],G=M[s-1],J=V[s-1],O=s===0?{address:n.ethAddress,decimals:18,symbol:"ETH"}:{address:c[s-1],decimals:J||i?Number(i??1):void 0,symbol:G??void 0};h.some(K=>K.token.address===O.address)||h.push({token:O,value:{pre:r,post:e,diff:e-r}})}return{assetChanges:h,block:F,results:L}}exports.simulateCalls=ss;
|
package/dist/index86.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { encode as K, from as M } from "./
|
|
2
|
-
import { encodeData as Q, from as c } from "./
|
|
1
|
+
import { encode as K, from as M } from "./index252.js";
|
|
2
|
+
import { encodeData as Q, from as c } from "./index253.js";
|
|
3
3
|
import { parseAccount as W } from "./index45.js";
|
|
4
4
|
import { zeroAddress as t, ethAddress as X } from "./index117.js";
|
|
5
5
|
import { deploylessCallViaBytecodeBytecode as Y } from "./index118.js";
|
package/dist/index88.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index223.cjs"),y=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index223.cjs"),y=require("./index257.cjs");async function f(e,{address:s,message:a,factory:r,factoryData:t,signature:i,...o}){const c=n.hashMessage(a);return y.verifyHash(e,{address:s,factory:r,factoryData:t,hash:c,signature:i,...o})}exports.verifyMessage=f;
|
package/dist/index88.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { hashMessage as h } from "./index223.js";
|
|
2
|
-
import { verifyHash as i } from "./
|
|
2
|
+
import { verifyHash as i } from "./index257.js";
|
|
3
3
|
async function m(r, { address: a, message: o, factory: s, factoryData: t, signature: e, ...f }) {
|
|
4
4
|
const c = h(o);
|
|
5
5
|
return i(r, {
|
package/dist/index89.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index187.cjs"),h=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index187.cjs"),h=require("./index257.cjs");async function p(a,e){const{address:t,factory:r,factoryData:s,signature:y,message:o,primaryType:c,types:i,domain:n,...f}=e,d=u.hashTypedData({message:o,primaryType:c,types:i,domain:n});return h.verifyHash(a,{address:t,factory:r,factoryData:s,hash:d,signature:y,...f})}exports.verifyTypedData=p;
|
package/dist/index89.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { hashTypedData as m } from "./index187.js";
|
|
2
|
-
import { verifyHash as d } from "./
|
|
2
|
+
import { verifyHash as d } from "./index257.js";
|
|
3
3
|
async function D(a, t) {
|
|
4
4
|
const { address: r, factory: e, factoryData: o, signature: s, message: y, primaryType: c, types: f, domain: i, ...n } = t, p = m({ message: y, primaryType: c, types: f, domain: i });
|
|
5
5
|
return d(a, {
|
package/dist/index95.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index223.cjs"),f=require("./index274.cjs"),h=require("./index275.cjs"),M=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index223.cjs"),f=require("./index274.cjs"),h=require("./index275.cjs"),M=require("./index257.cjs");async function S(a,r){const{address:i,domain:t,message:s,nonce:n,scheme:d,signature:c,time:o=new Date,...g}=r,e=f.parseSiweMessage(s);if(!e.address||!h.validateSiweMessage({address:i,domain:t,message:e,nonce:n,scheme:d,time:o}))return!1;const u=l.hashMessage(s);return M.verifyHash(a,{address:e.address,hash:u,signature:c,...g})}exports.verifySiweMessage=S;
|
package/dist/index95.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { hashMessage as g } from "./index223.js";
|
|
2
2
|
import { parseSiweMessage as l } from "./index274.js";
|
|
3
3
|
import { validateSiweMessage as p } from "./index275.js";
|
|
4
|
-
import { verifyHash as h } from "./
|
|
4
|
+
import { verifyHash as h } from "./index257.js";
|
|
5
5
|
async function S(a, r) {
|
|
6
6
|
const { address: i, domain: t, message: s, nonce: o, scheme: n, signature: d, time: m = /* @__PURE__ */ new Date(), ...f } = r, e = l(s);
|
|
7
7
|
if (!e.address || !p({
|