@gardenfi/utils 2.5.3-beta.2 → 2.5.3-beta.4
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/index100.cjs +1 -1
- package/dist/index100.js +3 -14
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +26 -3
- package/dist/index102.cjs +2 -1
- package/dist/index102.js +23 -25
- package/dist/index103.cjs +1 -2
- package/dist/index103.js +9 -24
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +8 -9
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +10 -8
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +11 -10
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +13 -11
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +14 -13
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +4 -14
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +6 -4
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +18 -6
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +13 -18
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +6 -13
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +7 -6
- package/dist/index115.cjs +1 -1
- package/dist/index115.js +21 -7
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +7 -21
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +21 -7
- package/dist/index118.cjs +1 -1
- package/dist/index118.js +16 -20
- package/dist/index119.cjs +1 -1
- package/dist/index119.js +38 -15
- package/dist/index120.cjs +1 -1
- package/dist/index120.js +19 -38
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +79 -20
- package/dist/index122.cjs +1 -1
- package/dist/index122.js +10 -79
- package/dist/index123.cjs +1 -1
- package/dist/index123.js +57 -10
- package/dist/index124.cjs +1 -1
- package/dist/index124.js +12 -57
- package/dist/index125.cjs +1 -1
- package/dist/index125.js +8 -13
- package/dist/index126.cjs +1 -1
- package/dist/index126.js +20 -8
- package/dist/index127.cjs +1 -1
- package/dist/index127.js +6 -20
- package/dist/index128.cjs +1 -1
- package/dist/index128.js +35 -6
- package/dist/index129.cjs +1 -1
- package/dist/index129.js +31 -34
- package/dist/index130.cjs +1 -1
- package/dist/index130.js +8 -31
- package/dist/index131.cjs +1 -1
- package/dist/index131.js +50 -9
- package/dist/index132.cjs +1 -1
- package/dist/index132.js +17 -48
- package/dist/index133.cjs +1 -1
- package/dist/index133.js +105 -18
- package/dist/index134.cjs +1 -1
- package/dist/index134.js +67 -105
- package/dist/index135.cjs +1 -1
- package/dist/index135.js +7 -66
- package/dist/index136.cjs +1 -1
- package/dist/index136.js +71 -9
- package/dist/index137.cjs +2 -1
- package/dist/index137.js +3 -72
- package/dist/index138.cjs +1 -2
- package/dist/index138.js +9 -3
- package/dist/index139.cjs +1 -1
- package/dist/index139.js +14 -9
- package/dist/index140.cjs +1 -1
- package/dist/index140.js +4 -13
- package/dist/index141.cjs +1 -1
- package/dist/index141.js +12 -4
- package/dist/index142.cjs +1 -1
- package/dist/index142.js +2 -13
- package/dist/index143.cjs +1 -1
- package/dist/index143.js +32 -2
- package/dist/index144.cjs +1 -1
- package/dist/index144.js +22 -32
- package/dist/index145.cjs +1 -1
- package/dist/index145.js +5 -21
- package/dist/index146.cjs +1 -1
- package/dist/index146.js +5 -5
- package/dist/index147.cjs +1 -1
- package/dist/index147.js +4 -4
- package/dist/index148.cjs +9 -1
- package/dist/index148.js +35 -5
- package/dist/index149.cjs +1 -9
- package/dist/index149.js +3 -36
- package/dist/index150.cjs +1 -1
- package/dist/index150.js +19 -3
- package/dist/index151.cjs +1 -1
- package/dist/index151.js +13 -11
- package/dist/index152.cjs +1 -1
- package/dist/index152.js +33 -18
- package/dist/index153.cjs +1 -1
- package/dist/index153.js +6 -33
- package/dist/index154.cjs +4 -1
- package/dist/index154.js +192 -6
- package/dist/index155.cjs +1 -4
- package/dist/index155.js +17 -184
- package/dist/index156.cjs +1 -1
- package/dist/index156.js +153 -19
- package/dist/index157.cjs +1 -1
- package/dist/index157.js +124 -158
- package/dist/index158.cjs +1 -1
- package/dist/index158.js +27 -127
- package/dist/index159.cjs +1 -1
- package/dist/index159.js +52 -24
- package/dist/index160.cjs +1 -1
- package/dist/index160.js +191 -55
- package/dist/index161.cjs +1 -1
- package/dist/index161.js +4 -192
- package/dist/index162.cjs +1 -1
- package/dist/index162.js +21 -4
- package/dist/index163.cjs +1 -1
- package/dist/index163.js +3 -21
- package/dist/index164.cjs +1 -1
- package/dist/index164.js +17 -3
- package/dist/index165.cjs +1 -1
- package/dist/index165.js +11 -16
- package/dist/index166.cjs +1 -1
- package/dist/index166.js +34 -11
- package/dist/index167.cjs +1 -1
- package/dist/index167.js +3 -35
- package/dist/index168.cjs +1 -1
- package/dist/index168.js +28 -3
- package/dist/index169.cjs +1 -1
- package/dist/index169.js +8 -27
- package/dist/index170.cjs +1 -1
- package/dist/index170.js +25 -8
- package/dist/index171.cjs +1 -1
- package/dist/index171.js +23 -20
- package/dist/index172.cjs +1 -1
- package/dist/index172.js +3 -28
- package/dist/index173.cjs +1 -1
- package/dist/index173.js +6 -3
- package/dist/index174.cjs +1 -1
- package/dist/index174.js +6 -6
- package/dist/index175.cjs +1 -1
- package/dist/index175.js +32 -6
- package/dist/index176.cjs +1 -1
- package/dist/index176.js +5 -33
- package/dist/index177.cjs +1 -1
- package/dist/index177.js +38 -5
- package/dist/index178.cjs +1 -1
- package/dist/index178.js +39 -27
- package/dist/index179.cjs +1 -1
- package/dist/index179.js +31 -48
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +5 -5
- package/dist/index180.cjs +1 -1
- package/dist/index180.js +8 -32
- package/dist/index181.cjs +1 -1
- package/dist/index181.js +40 -6
- package/dist/index182.cjs +1 -1
- package/dist/index182.js +48 -39
- package/dist/index183.cjs +1 -1
- package/dist/index183.js +102 -49
- package/dist/index184.cjs +1 -1
- package/dist/index184.js +3 -105
- package/dist/index185.cjs +1 -1
- package/dist/index185.js +6 -3
- package/dist/index186.cjs +1 -1
- package/dist/index186.js +3 -5
- package/dist/index187.cjs +1 -1
- package/dist/index187.js +17 -3
- package/dist/index188.cjs +1 -1
- package/dist/index188.js +5 -17
- package/dist/index189.cjs +1 -1
- package/dist/index189.js +8 -5
- package/dist/index190.cjs +1 -1
- package/dist/index190.js +103 -8
- package/dist/index191.cjs +1 -1
- package/dist/index191.js +5 -103
- package/dist/index192.cjs +1 -1
- package/dist/index192.js +6 -5
- package/dist/index193.cjs +1 -1
- package/dist/index193.js +27 -6
- package/dist/index194.cjs +1 -1
- package/dist/index194.js +34 -27
- package/dist/index195.cjs +1 -1
- package/dist/index195.js +13 -34
- package/dist/index196.cjs +1 -1
- package/dist/index196.js +78 -13
- package/dist/index197.cjs +1 -1
- package/dist/index197.js +2 -79
- package/dist/index198.cjs +1 -1
- package/dist/index198.js +19 -2
- package/dist/index199.cjs +1 -1
- package/dist/index199.js +170 -17
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +2 -2
- package/dist/index200.cjs +1 -1
- package/dist/index200.js +16 -170
- package/dist/index201.cjs +1 -1
- package/dist/index201.js +10 -17
- package/dist/index202.cjs +1 -1
- package/dist/index202.js +25 -10
- package/dist/index203.cjs +1 -1
- package/dist/index203.js +17 -24
- package/dist/index204.cjs +1 -1
- package/dist/index204.js +15 -18
- package/dist/index205.cjs +1 -1
- package/dist/index205.js +5 -15
- package/dist/index206.cjs +1 -1
- package/dist/index206.js +13 -5
- package/dist/index207.cjs +1 -1
- package/dist/index207.js +9 -12
- package/dist/index208.cjs +1 -1
- package/dist/index208.js +16 -10
- package/dist/index209.cjs +1 -1
- package/dist/index209.js +24 -16
- package/dist/index210.cjs +1 -1
- package/dist/index210.js +46 -24
- package/dist/index211.cjs +1 -1
- package/dist/index211.js +9 -46
- package/dist/index212.cjs +2 -1
- package/dist/index212.js +41 -9
- package/dist/index213.cjs +1 -2
- package/dist/index213.js +2 -42
- package/dist/index214.cjs +1 -1
- package/dist/index214.js +6 -2
- package/dist/index215.cjs +1 -1
- package/dist/index215.js +10 -5
- package/dist/index216.cjs +1 -1
- package/dist/index216.js +18 -9
- package/dist/index217.cjs +1 -1
- package/dist/index217.js +8 -19
- package/dist/index218.cjs +1 -1
- package/dist/index218.js +66 -8
- package/dist/index219.cjs +1 -1
- package/dist/index219.js +64 -65
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +8 -8
- package/dist/index220.cjs +1 -1
- package/dist/index220.js +183 -60
- package/dist/index221.cjs +1 -1
- package/dist/index221.js +25 -185
- package/dist/index222.cjs +1 -1
- package/dist/index222.js +61 -13
- package/dist/index223.cjs +1 -1
- package/dist/index223.js +18 -54
- package/dist/index224.cjs +1 -1
- package/dist/index224.js +10 -34
- package/dist/index225.cjs +1 -1
- package/dist/index225.js +7 -10
- package/dist/index226.cjs +1 -1
- package/dist/index226.js +11 -13
- package/dist/index227.cjs +1 -1
- package/dist/index227.js +12 -11
- package/dist/index228.cjs +1 -1
- package/dist/index228.js +19 -12
- package/dist/index229.cjs +1 -1
- package/dist/index229.js +108 -6
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +2 -2
- package/dist/index230.cjs +1 -1
- package/dist/index230.js +7 -7
- package/dist/index231.cjs +1 -1
- package/dist/index231.js +7 -20
- package/dist/index232.cjs +1 -1
- package/dist/index232.js +101 -106
- package/dist/index233.cjs +1 -1
- package/dist/index233.js +24 -101
- package/dist/index234.cjs +1 -1
- package/dist/index234.js +16 -26
- package/dist/index235.cjs +1 -1
- package/dist/index235.js +211 -13
- package/dist/index236.cjs +1 -1
- package/dist/index236.js +41 -213
- package/dist/index237.cjs +1 -1
- package/dist/index237.js +66 -30
- package/dist/index238.cjs +1 -1
- package/dist/index238.js +2 -79
- package/dist/index239.cjs +1 -1
- package/dist/index239.js +12 -2
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +4 -4
- package/dist/index240.cjs +1 -1
- package/dist/index240.js +19 -11
- package/dist/index241.cjs +2 -1
- package/dist/index241.js +65 -18
- package/dist/index242.cjs +1 -2
- package/dist/index242.js +14 -66
- package/dist/index243.cjs +1 -1
- package/dist/index243.js +68 -14
- package/dist/index244.cjs +1 -1
- package/dist/index244.js +657 -68
- package/dist/index245.cjs +1 -1
- package/dist/index245.js +196 -647
- package/dist/index246.cjs +1 -1
- package/dist/index246.js +172 -201
- package/dist/index247.cjs +1 -1
- package/dist/index247.js +4 -177
- package/dist/index248.cjs +1 -1
- package/dist/index248.js +2 -5
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +3 -3
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +1 -1
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +9 -9
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +2 -2
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +1 -1
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +11 -11
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +3 -3
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +3 -3
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +3 -3
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +3 -3
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +2 -2
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +1 -1
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +4 -4
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +4 -4
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +3 -3
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +8 -8
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +3 -3
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +51 -74
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +1 -1
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +1 -1
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +2 -2
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +2 -2
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +3 -3
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +7 -7
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +23 -8
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +7 -23
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +21 -7
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +8 -21
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +31 -8
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +7 -31
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +16 -7
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +73 -16
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +34 -72
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +15 -34
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +65 -16
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +11 -65
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +14 -11
- package/dist/index78.cjs +3 -1
- package/dist/index78.js +95 -14
- package/dist/index79.cjs +1 -3
- package/dist/index79.js +24 -95
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +33 -24
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +41 -30
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +6 -44
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +151 -6
- package/dist/index84.cjs +20 -1
- package/dist/index84.js +325 -150
- package/dist/index85.cjs +3 -20
- package/dist/index85.js +383 -258
- package/dist/index86.cjs +1 -3
- package/dist/index86.js +64 -451
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +36 -63
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +14 -36
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +2 -16
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +17 -2
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +10 -16
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +125 -10
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +5 -125
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +21 -5
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +45 -21
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +37 -44
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +6 -38
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +88 -6
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +13 -87
- package/package.json +2 -2
- package/dist/index249.cjs +0 -1
- package/dist/index249.js +0 -4
package/dist/index63.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index152.cjs"),i=require("./index154.cjs"),u=require("./index209.cjs");function a(e,{docsPath:o,...r}){const n=(()=>{const t=u.getNodeError(e,r);return t instanceof i.UnknownNodeError?e:t})();return new s.EstimateGasExecutionError(n,{docsPath:o,...r})}exports.getEstimateGasError=a;
|
package/dist/index63.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EstimateGasExecutionError as i } from "./
|
|
2
|
-
import { UnknownNodeError as m } from "./
|
|
3
|
-
import { getNodeError as s } from "./
|
|
1
|
+
import { EstimateGasExecutionError as i } from "./index152.js";
|
|
2
|
+
import { UnknownNodeError as m } from "./index154.js";
|
|
3
|
+
import { getNodeError as s } from "./index209.js";
|
|
4
4
|
function a(r, { docsPath: e, ...o }) {
|
|
5
5
|
const n = (() => {
|
|
6
6
|
const t = s(r, o);
|
package/dist/index64.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./index32.cjs"),h=require("./index57.cjs"),x=require("./index56.cjs"),I=require("./index60.cjs"),C=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./index32.cjs"),h=require("./index57.cjs"),x=require("./index56.cjs"),I=require("./index60.cjs"),C=require("./index77.cjs"),q=require("./index58.cjs"),A=require("./index104.cjs"),H=require("./index105.cjs"),B=require("./index106.cjs"),V=require("./index107.cjs"),p=require("./index55.cjs"),_=require("./index48.cjs"),S=require("./index108.cjs"),E=require("./index70.cjs"),w=["blobVersionedHashes","chainId","fees","gas","nonce","type"],b=new Map;async function M(n,a){const{account:l=n.account,blobs:c,chain:d,gas:G,kzg:m,nonce:T,nonceManager:P,parameters:o=w,type:F}=a,i=l&&k.parseAccount(l),e={...a,...i?{from:i==null?void 0:i.address}:{}};let u;async function y(){return u||(u=await p.getAction(n,I.getBlock,"getBlock")({blockTag:"latest"}),u)}let f;async function g(){return f||(d?d.id:typeof a.chainId<"u"?a.chainId:(f=await p.getAction(n,E.getChainId,"getChainId")({}),f))}if(o.includes("nonce")&&typeof T>"u"&&i)if(P){const t=await g();e.nonce=await P.consume({address:i.address,chainId:t,client:n})}else e.nonce=await p.getAction(n,C.getTransactionCount,"getTransactionCount")({address:i.address,blockTag:"pending"});if((o.includes("blobVersionedHashes")||o.includes("sidecars"))&&c&&m){const t=A.blobsToCommitments({blobs:c,kzg:m});if(o.includes("blobVersionedHashes")){const s=B.commitmentsToVersionedHashes({commitments:t,to:"hex"});e.blobVersionedHashes=s}if(o.includes("sidecars")){const s=H.blobsToProofs({blobs:c,commitments:t,kzg:m}),r=V.toBlobSidecars({blobs:c,commitments:t,proofs:s,to:"hex"});e.sidecars=r}}if(o.includes("chainId")&&(e.chainId=await g()),(o.includes("fees")||o.includes("type"))&&typeof F>"u")try{e.type=S.getTransactionType(e)}catch{let t=b.get(n.uid);if(typeof t>"u"){const s=await y();t=typeof(s==null?void 0:s.baseFeePerGas)=="bigint",b.set(n.uid,t)}e.type=t?"eip1559":"legacy"}if(o.includes("fees"))if(e.type!=="legacy"&&e.type!=="eip2930"){if(typeof e.maxFeePerGas>"u"||typeof e.maxPriorityFeePerGas>"u"){const t=await y(),{maxFeePerGas:s,maxPriorityFeePerGas:r}=await h.internal_estimateFeesPerGas(n,{block:t,chain:d,request:e});if(typeof a.maxPriorityFeePerGas>"u"&&a.maxFeePerGas&&a.maxFeePerGas<r)throw new q.MaxFeePerGasTooLowError({maxPriorityFeePerGas:r});e.maxPriorityFeePerGas=r,e.maxFeePerGas=s}}else{if(typeof a.maxFeePerGas<"u"||typeof a.maxPriorityFeePerGas<"u")throw new q.Eip1559FeesNotSupportedError;if(typeof a.gasPrice>"u"){const t=await y(),{gasPrice:s}=await h.internal_estimateFeesPerGas(n,{block:t,chain:d,request:e,type:"legacy"});e.gasPrice=s}}return o.includes("gas")&&typeof G>"u"&&(e.gas=await p.getAction(n,x.estimateGas,"estimateGas")({...e,account:i&&{address:i.address,type:"json-rpc"}})),_.assertRequest(e),delete e.parameters,e}exports.defaultParameters=w;exports.eip1559NetworkCache=b;exports.prepareTransactionRequest=M;
|
package/dist/index64.js
CHANGED
|
@@ -2,16 +2,16 @@ import { parseAccount as F } from "./index32.js";
|
|
|
2
2
|
import { internal_estimateFeesPerGas as b } from "./index57.js";
|
|
3
3
|
import { estimateGas as k } from "./index56.js";
|
|
4
4
|
import { getBlock as I } from "./index60.js";
|
|
5
|
-
import { getTransactionCount as T } from "./
|
|
5
|
+
import { getTransactionCount as T } from "./index77.js";
|
|
6
6
|
import { MaxFeePerGasTooLowError as C, Eip1559FeesNotSupportedError as H } from "./index58.js";
|
|
7
|
-
import { blobsToCommitments as q } from "./
|
|
8
|
-
import { blobsToProofs as V } from "./
|
|
9
|
-
import { commitmentsToVersionedHashes as _ } from "./
|
|
10
|
-
import { toBlobSidecars as B } from "./
|
|
7
|
+
import { blobsToCommitments as q } from "./index104.js";
|
|
8
|
+
import { blobsToProofs as V } from "./index105.js";
|
|
9
|
+
import { commitmentsToVersionedHashes as _ } from "./index106.js";
|
|
10
|
+
import { toBlobSidecars as B } from "./index107.js";
|
|
11
11
|
import { getAction as p } from "./index55.js";
|
|
12
12
|
import { assertRequest as E } from "./index48.js";
|
|
13
|
-
import { getTransactionType as M } from "./
|
|
14
|
-
import { getChainId as N } from "./
|
|
13
|
+
import { getTransactionType as M } from "./index108.js";
|
|
14
|
+
import { getChainId as N } from "./index70.js";
|
|
15
15
|
const A = [
|
|
16
16
|
"blobVersionedHashes",
|
|
17
17
|
"chainId",
|
package/dist/index65.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 z=require("./index151.cjs"),r=require("./index140.cjs");function o(e,{size:n}){if(r.size(e)>n)throw new z.SizeOverflowError({givenSize:r.size(e),maxSize:n})}function s(e,n={}){const{signed:u}=n;n.size&&o(e,{size:n.size});const i=BigInt(e);if(!u)return i;const t=(e.length-2)/2,c=(1n<<BigInt(t)*8n-1n)-1n;return i<=c?i:i-BigInt(`0x${"f".padStart(t*2,"f")}`)-1n}function f(e,n={}){return Number(s(e,n))}exports.assertSize=o;exports.hexToBigInt=s;exports.hexToNumber=f;
|
package/dist/index65.js
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { SizeOverflowError as u } from "./index151.js";
|
|
2
|
+
import { size as t } from "./index140.js";
|
|
3
|
+
function s(n, { size: i }) {
|
|
4
|
+
if (t(n) > i)
|
|
5
|
+
throw new u({
|
|
6
|
+
givenSize: t(n),
|
|
7
|
+
maxSize: i
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
function z(n, i = {}) {
|
|
11
|
+
const { signed: o } = i;
|
|
12
|
+
i.size && s(n, { size: i.size });
|
|
13
|
+
const e = BigInt(n);
|
|
14
|
+
if (!o)
|
|
15
|
+
return e;
|
|
16
|
+
const r = (n.length - 2) / 2, f = (1n << BigInt(r) * 8n - 1n) - 1n;
|
|
17
|
+
return e <= f ? e : e - BigInt(`0x${"f".padStart(r * 2, "f")}`) - 1n;
|
|
18
|
+
}
|
|
19
|
+
function g(n, i = {}) {
|
|
20
|
+
return Number(z(n, i));
|
|
8
21
|
}
|
|
9
22
|
export {
|
|
10
|
-
|
|
23
|
+
s as assertSize,
|
|
24
|
+
z as hexToBigInt,
|
|
25
|
+
g as hexToNumber
|
|
11
26
|
};
|
package/dist/index66.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 t=require("./index35.cjs");class n extends t.BaseError{constructor({blockHash:r,blockNumber:e}){let o="Block";r&&(o=`Block at hash "${r}"`),e&&(o=`Block at number "${e}"`),super(`${o} could not be found.`,{name:"BlockNotFoundError"})}}exports.BlockNotFoundError=n;
|
package/dist/index66.js
CHANGED
|
@@ -1,26 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
maxSize: i
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
function z(n, i = {}) {
|
|
11
|
-
const { signed: o } = i;
|
|
12
|
-
i.size && s(n, { size: i.size });
|
|
13
|
-
const e = BigInt(n);
|
|
14
|
-
if (!o)
|
|
15
|
-
return e;
|
|
16
|
-
const r = (n.length - 2) / 2, f = (1n << BigInt(r) * 8n - 1n) - 1n;
|
|
17
|
-
return e <= f ? e : e - BigInt(`0x${"f".padStart(r * 2, "f")}`) - 1n;
|
|
18
|
-
}
|
|
19
|
-
function g(n, i = {}) {
|
|
20
|
-
return Number(z(n, i));
|
|
1
|
+
import { BaseError as e } from "./index35.js";
|
|
2
|
+
class d extends e {
|
|
3
|
+
constructor({ blockHash: r, blockNumber: t }) {
|
|
4
|
+
let o = "Block";
|
|
5
|
+
r && (o = `Block at hash "${r}"`), t && (o = `Block at number "${t}"`), super(`${o} could not be found.`, { name: "BlockNotFoundError" });
|
|
6
|
+
}
|
|
21
7
|
}
|
|
22
8
|
export {
|
|
23
|
-
|
|
24
|
-
z as hexToBigInt,
|
|
25
|
-
g as hexToNumber
|
|
9
|
+
d as BlockNotFoundError
|
|
26
10
|
};
|
package/dist/index67.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index182.cjs");function i(e){const s=(e.transactions??[]).map(n=>typeof n=="string"?n:t.formatTransaction(n));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:s,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}exports.formatBlock=i;
|
package/dist/index67.js
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { formatTransaction as i } from "./index182.js";
|
|
2
|
+
function a(e) {
|
|
3
|
+
const s = (e.transactions ?? []).map((n) => typeof n == "string" ? n : i(n));
|
|
4
|
+
return {
|
|
5
|
+
...e,
|
|
6
|
+
baseFeePerGas: e.baseFeePerGas ? BigInt(e.baseFeePerGas) : null,
|
|
7
|
+
blobGasUsed: e.blobGasUsed ? BigInt(e.blobGasUsed) : void 0,
|
|
8
|
+
difficulty: e.difficulty ? BigInt(e.difficulty) : void 0,
|
|
9
|
+
excessBlobGas: e.excessBlobGas ? BigInt(e.excessBlobGas) : void 0,
|
|
10
|
+
gasLimit: e.gasLimit ? BigInt(e.gasLimit) : void 0,
|
|
11
|
+
gasUsed: e.gasUsed ? BigInt(e.gasUsed) : void 0,
|
|
12
|
+
hash: e.hash ? e.hash : null,
|
|
13
|
+
logsBloom: e.logsBloom ? e.logsBloom : null,
|
|
14
|
+
nonce: e.nonce ? e.nonce : null,
|
|
15
|
+
number: e.number ? BigInt(e.number) : null,
|
|
16
|
+
size: e.size ? BigInt(e.size) : void 0,
|
|
17
|
+
timestamp: e.timestamp ? BigInt(e.timestamp) : void 0,
|
|
18
|
+
transactions: s,
|
|
19
|
+
totalDifficulty: e.totalDifficulty ? BigInt(e.totalDifficulty) : null
|
|
20
|
+
};
|
|
7
21
|
}
|
|
8
22
|
export {
|
|
9
|
-
|
|
23
|
+
a as formatBlock
|
|
10
24
|
};
|
package/dist/index68.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 o=require("./index69.cjs"),r=e=>`blockNumber.${e}`;async function u(e,{cacheTime:c=e.cacheTime}={}){const t=await o.withCache(()=>e.request({method:"eth_blockNumber"}),{cacheKey:r(e.uid),cacheTime:c});return BigInt(t)}exports.getBlockNumber=u;
|
package/dist/index68.js
CHANGED
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
difficulty: e.difficulty ? BigInt(e.difficulty) : void 0,
|
|
9
|
-
excessBlobGas: e.excessBlobGas ? BigInt(e.excessBlobGas) : void 0,
|
|
10
|
-
gasLimit: e.gasLimit ? BigInt(e.gasLimit) : void 0,
|
|
11
|
-
gasUsed: e.gasUsed ? BigInt(e.gasUsed) : void 0,
|
|
12
|
-
hash: e.hash ? e.hash : null,
|
|
13
|
-
logsBloom: e.logsBloom ? e.logsBloom : null,
|
|
14
|
-
nonce: e.nonce ? e.nonce : null,
|
|
15
|
-
number: e.number ? BigInt(e.number) : null,
|
|
16
|
-
size: e.size ? BigInt(e.size) : void 0,
|
|
17
|
-
timestamp: e.timestamp ? BigInt(e.timestamp) : void 0,
|
|
18
|
-
transactions: s,
|
|
19
|
-
totalDifficulty: e.totalDifficulty ? BigInt(e.totalDifficulty) : null
|
|
20
|
-
};
|
|
1
|
+
import { withCache as t } from "./index69.js";
|
|
2
|
+
const r = (e) => `blockNumber.${e}`;
|
|
3
|
+
async function u(e, { cacheTime: c = e.cacheTime } = {}) {
|
|
4
|
+
const o = await t(() => e.request({
|
|
5
|
+
method: "eth_blockNumber"
|
|
6
|
+
}), { cacheKey: r(e.uid), cacheTime: c });
|
|
7
|
+
return BigInt(o);
|
|
21
8
|
}
|
|
22
9
|
export {
|
|
23
|
-
|
|
10
|
+
u as getBlockNumber
|
|
24
11
|
};
|
package/dist/index69.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=new Map,i=new Map;function p(o){const a=(s,t)=>({clear:()=>t.delete(s),get:()=>t.get(s),set:n=>t.set(s,n)}),r=a(o,c),e=a(o,i);return{clear:()=>{r.clear(),e.clear()},promise:r,response:e}}async function l(o,{cacheKey:a,cacheTime:r=Number.POSITIVE_INFINITY}){const e=p(a),s=e.response.get();if(s&&r>0&&Date.now()-s.created.getTime()<r)return s.data;let t=e.promise.get();t||(t=o(),e.promise.set(t));try{const n=await t;return e.response.set({created:new Date,data:n}),n}finally{e.promise.clear()}}exports.getCache=p;exports.promiseCache=c;exports.responseCache=i;exports.withCache=l;
|
package/dist/index69.js
CHANGED
|
@@ -1,11 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
const i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
|
|
2
|
+
function p(o) {
|
|
3
|
+
const a = (s, t) => ({
|
|
4
|
+
clear: () => t.delete(s),
|
|
5
|
+
get: () => t.get(s),
|
|
6
|
+
set: (r) => t.set(s, r)
|
|
7
|
+
}), n = a(o, i), e = a(o, c);
|
|
8
|
+
return {
|
|
9
|
+
clear: () => {
|
|
10
|
+
n.clear(), e.clear();
|
|
11
|
+
},
|
|
12
|
+
promise: n,
|
|
13
|
+
response: e
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
async function l(o, { cacheKey: a, cacheTime: n = Number.POSITIVE_INFINITY }) {
|
|
17
|
+
const e = p(a), s = e.response.get();
|
|
18
|
+
if (s && n > 0 && Date.now() - s.created.getTime() < n)
|
|
19
|
+
return s.data;
|
|
20
|
+
let t = e.promise.get();
|
|
21
|
+
t || (t = o(), e.promise.set(t));
|
|
22
|
+
try {
|
|
23
|
+
const r = await t;
|
|
24
|
+
return e.response.set({ created: /* @__PURE__ */ new Date(), data: r }), r;
|
|
25
|
+
} finally {
|
|
26
|
+
e.promise.clear();
|
|
27
|
+
}
|
|
8
28
|
}
|
|
9
29
|
export {
|
|
10
|
-
|
|
30
|
+
p as getCache,
|
|
31
|
+
i as promiseCache,
|
|
32
|
+
c as responseCache,
|
|
33
|
+
l as withCache
|
|
11
34
|
};
|
package/dist/index70.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 n=require("./index65.cjs");async function r(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return n.hexToNumber(t)}exports.getChainId=r;
|
package/dist/index70.js
CHANGED
|
@@ -1,34 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}), n = a(o, i), e = a(o, c);
|
|
8
|
-
return {
|
|
9
|
-
clear: () => {
|
|
10
|
-
n.clear(), e.clear();
|
|
11
|
-
},
|
|
12
|
-
promise: n,
|
|
13
|
-
response: e
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
async function l(o, { cacheKey: a, cacheTime: n = Number.POSITIVE_INFINITY }) {
|
|
17
|
-
const e = p(a), s = e.response.get();
|
|
18
|
-
if (s && n > 0 && Date.now() - s.created.getTime() < n)
|
|
19
|
-
return s.data;
|
|
20
|
-
let t = e.promise.get();
|
|
21
|
-
t || (t = o(), e.promise.set(t));
|
|
22
|
-
try {
|
|
23
|
-
const r = await t;
|
|
24
|
-
return e.response.set({ created: /* @__PURE__ */ new Date(), data: r }), r;
|
|
25
|
-
} finally {
|
|
26
|
-
e.promise.clear();
|
|
27
|
-
}
|
|
1
|
+
import { hexToNumber as n } from "./index65.js";
|
|
2
|
+
async function o(e) {
|
|
3
|
+
const t = await e.request({
|
|
4
|
+
method: "eth_chainId"
|
|
5
|
+
}, { dedupe: !0 });
|
|
6
|
+
return n(t);
|
|
28
7
|
}
|
|
29
8
|
export {
|
|
30
|
-
|
|
31
|
-
i as promiseCache,
|
|
32
|
-
c as responseCache,
|
|
33
|
-
l as withCache
|
|
9
|
+
o as getChainId
|
|
34
10
|
};
|
package/dist/index71.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 v=require("./index72.cjs"),b=require("./index55.cjs"),f=require("./index73.cjs");async function m(o,s){const{abi:e,address:r,args:c,blockHash:i,eventName:t,fromBlock:g,toBlock:a,strict:u}=s,n=t?v.getAbiItem({abi:e,name:t}):void 0,d=n?void 0:e.filter(l=>l.type==="event");return b.getAction(o,f.getLogs,"getLogs")({address:r,args:c,blockHash:i,event:n,events:d,fromBlock:g,toBlock:a,strict:u})}exports.getContractEvents=m;
|
package/dist/index71.js
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}, {
|
|
6
|
-
return n(
|
|
1
|
+
import { getAbiItem as p } from "./index72.js";
|
|
2
|
+
import { getAction as v } from "./index55.js";
|
|
3
|
+
import { getLogs as l } from "./index73.js";
|
|
4
|
+
async function y(n, r) {
|
|
5
|
+
const { abi: t, address: s, args: c, blockHash: i, eventName: e, fromBlock: m, toBlock: a, strict: f } = r, o = e ? p({ abi: t, name: e }) : void 0, g = o ? void 0 : t.filter((d) => d.type === "event");
|
|
6
|
+
return v(n, l, "getLogs")({
|
|
7
|
+
address: s,
|
|
8
|
+
args: c,
|
|
9
|
+
blockHash: i,
|
|
10
|
+
event: o,
|
|
11
|
+
events: g,
|
|
12
|
+
fromBlock: m,
|
|
13
|
+
toBlock: a,
|
|
14
|
+
strict: f
|
|
15
|
+
});
|
|
7
16
|
}
|
|
8
17
|
export {
|
|
9
|
-
|
|
18
|
+
y as getContractEvents
|
|
10
19
|
};
|
package/dist/index72.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 y=require("./index84.cjs"),g=require("./index172.cjs"),p=require("./index165.cjs"),m=require("./index163.cjs"),b=require("./index161.cjs");function A(i){const{abi:o,args:n=[],name:t}=i,u=g.isHex(t,{strict:!1}),s=o.filter(e=>u?e.type==="function"?b.toFunctionSelector(e)===t:e.type==="event"?m.toEventSelector(e)===t:!1:"name"in e&&e.name===t);if(s.length===0)return;if(s.length===1)return s[0];let r;for(const e of s){if(!("inputs"in e))continue;if(!n||n.length===0){if(!e.inputs||e.inputs.length===0)return e;continue}if(!e.inputs||e.inputs.length===0||e.inputs.length!==n.length)continue;if(n.every((c,d)=>{const a="inputs"in e&&e.inputs[d];return a?f(c,a):!1})){if(r&&"inputs"in r&&r.inputs){const c=l(e.inputs,r.inputs,n);if(c)throw new y.AbiItemAmbiguityError({abiItem:e,type:c[0]},{abiItem:r,type:c[1]})}r=e}}return r||s[0]}function f(i,o){const n=typeof i,t=o.type;switch(t){case"address":return p.isAddress(i,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return t==="tuple"&&"components"in o?Object.values(o.components).every((u,s)=>f(Object.values(i)[s],u)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(t)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(t)?n==="string"||i instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(t)?Array.isArray(i)&&i.every(u=>f(u,{...o,type:t.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function l(i,o,n){for(const t in i){const u=i[t],s=o[t];if(u.type==="tuple"&&s.type==="tuple"&&"components"in u&&"components"in s)return l(u.components,s.components,n[t]);const r=[u.type,s.type];if(r.includes("address")&&r.includes("bytes20")?!0:r.includes("address")&&r.includes("string")?p.isAddress(n[t],{strict:!1}):r.includes("address")&&r.includes("bytes")?p.isAddress(n[t],{strict:!1}):!1)return r}}exports.getAbiItem=A;exports.getAmbiguousTypes=l;exports.isArgOfType=f;
|
package/dist/index72.js
CHANGED
|
@@ -1,19 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { AbiItemAmbiguityError as y } from "./index84.js";
|
|
2
|
+
import { isHex as d } from "./index172.js";
|
|
3
|
+
import { isAddress as f } from "./index165.js";
|
|
4
|
+
import { toEventSelector as g } from "./index163.js";
|
|
5
|
+
import { toFunctionSelector as b } from "./index161.js";
|
|
6
|
+
function x(s) {
|
|
7
|
+
const { abi: o, args: n = [], name: e } = s, u = d(e, { strict: !1 }), i = o.filter((t) => u ? t.type === "function" ? b(t) === e : t.type === "event" ? g(t) === e : !1 : "name" in t && t.name === e);
|
|
8
|
+
if (i.length === 0)
|
|
9
|
+
return;
|
|
10
|
+
if (i.length === 1)
|
|
11
|
+
return i[0];
|
|
12
|
+
let r;
|
|
13
|
+
for (const t of i) {
|
|
14
|
+
if (!("inputs" in t))
|
|
15
|
+
continue;
|
|
16
|
+
if (!n || n.length === 0) {
|
|
17
|
+
if (!t.inputs || t.inputs.length === 0)
|
|
18
|
+
return t;
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
if (!t.inputs || t.inputs.length === 0 || t.inputs.length !== n.length)
|
|
22
|
+
continue;
|
|
23
|
+
if (n.every((c, m) => {
|
|
24
|
+
const l = "inputs" in t && t.inputs[m];
|
|
25
|
+
return l ? p(c, l) : !1;
|
|
26
|
+
})) {
|
|
27
|
+
if (r && "inputs" in r && r.inputs) {
|
|
28
|
+
const c = a(t.inputs, r.inputs, n);
|
|
29
|
+
if (c)
|
|
30
|
+
throw new y({
|
|
31
|
+
abiItem: t,
|
|
32
|
+
type: c[0]
|
|
33
|
+
}, {
|
|
34
|
+
abiItem: r,
|
|
35
|
+
type: c[1]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
r = t;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return r || i[0];
|
|
42
|
+
}
|
|
43
|
+
function p(s, o) {
|
|
44
|
+
const n = typeof s, e = o.type;
|
|
45
|
+
switch (e) {
|
|
46
|
+
case "address":
|
|
47
|
+
return f(s, { strict: !1 });
|
|
48
|
+
case "bool":
|
|
49
|
+
return n === "boolean";
|
|
50
|
+
case "function":
|
|
51
|
+
return n === "string";
|
|
52
|
+
case "string":
|
|
53
|
+
return n === "string";
|
|
54
|
+
default:
|
|
55
|
+
return e === "tuple" && "components" in o ? Object.values(o.components).every((u, i) => p(Object.values(s)[i], u)) : /^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(e) ? n === "number" || n === "bigint" : /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(e) ? n === "string" || s instanceof Uint8Array : /[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(e) ? Array.isArray(s) && s.every((u) => p(u, {
|
|
56
|
+
...o,
|
|
57
|
+
// Pop off `[]` or `[M]` from end of type
|
|
58
|
+
type: e.replace(/(\[[0-9]{0,}\])$/, "")
|
|
59
|
+
})) : !1;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function a(s, o, n) {
|
|
63
|
+
for (const e in s) {
|
|
64
|
+
const u = s[e], i = o[e];
|
|
65
|
+
if (u.type === "tuple" && i.type === "tuple" && "components" in u && "components" in i)
|
|
66
|
+
return a(u.components, i.components, n[e]);
|
|
67
|
+
const r = [u.type, i.type];
|
|
68
|
+
if (r.includes("address") && r.includes("bytes20") ? !0 : r.includes("address") && r.includes("string") ? f(n[e], { strict: !1 }) : r.includes("address") && r.includes("bytes") ? f(n[e], { strict: !1 }) : !1)
|
|
69
|
+
return r;
|
|
70
|
+
}
|
|
16
71
|
}
|
|
17
72
|
export {
|
|
18
|
-
|
|
73
|
+
x as getAbiItem,
|
|
74
|
+
a as getAmbiguousTypes,
|
|
75
|
+
p as isArgOfType
|
|
19
76
|
};
|
package/dist/index73.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 l=require("./index51.cjs"),q=require("./index75.cjs"),m=require("./index42.cjs"),y=require("./index76.cjs");async function T(i,{address:a,blockHash:g,fromBlock:o,toBlock:s,event:n,events:c,args:u,strict:L}={}){const b=L??!1,t=c??(n?[n]:void 0);let e=[];t&&(e=[t.flatMap(p=>l.encodeEventTopics({abi:[p],eventName:p.name,args:c?void 0:u}))],n&&(e=e[0]));let r;g?r=await i.request({method:"eth_getLogs",params:[{address:a,topics:e,blockHash:g}]}):r=await i.request({method:"eth_getLogs",params:[{address:a,topics:e,fromBlock:typeof o=="bigint"?m.numberToHex(o):o,toBlock:typeof s=="bigint"?m.numberToHex(s):s}]});const d=r.map(f=>y.formatLog(f));return t?q.parseEventLogs({abi:t,args:u,logs:d,strict:b}):d}exports.getLogs=T;
|
package/dist/index73.js
CHANGED
|
@@ -1,76 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return l ? p(c, l) : !1;
|
|
26
|
-
})) {
|
|
27
|
-
if (r && "inputs" in r && r.inputs) {
|
|
28
|
-
const c = a(t.inputs, r.inputs, n);
|
|
29
|
-
if (c)
|
|
30
|
-
throw new y({
|
|
31
|
-
abiItem: t,
|
|
32
|
-
type: c[0]
|
|
33
|
-
}, {
|
|
34
|
-
abiItem: r,
|
|
35
|
-
type: c[1]
|
|
36
|
-
});
|
|
1
|
+
import { encodeEventTopics as h } from "./index51.js";
|
|
2
|
+
import { parseEventLogs as l } from "./index75.js";
|
|
3
|
+
import { numberToHex as u } from "./index42.js";
|
|
4
|
+
import { formatLog as y } from "./index76.js";
|
|
5
|
+
async function T(n, { address: a, blockHash: m, fromBlock: o, toBlock: i, event: r, events: f, args: g, strict: L } = {}) {
|
|
6
|
+
const b = L ?? !1, e = f ?? (r ? [r] : void 0);
|
|
7
|
+
let t = [];
|
|
8
|
+
e && (t = [e.flatMap((c) => h({
|
|
9
|
+
abi: [c],
|
|
10
|
+
eventName: c.name,
|
|
11
|
+
args: f ? void 0 : g
|
|
12
|
+
}))], r && (t = t[0]));
|
|
13
|
+
let s;
|
|
14
|
+
m ? s = await n.request({
|
|
15
|
+
method: "eth_getLogs",
|
|
16
|
+
params: [{ address: a, topics: t, blockHash: m }]
|
|
17
|
+
}) : s = await n.request({
|
|
18
|
+
method: "eth_getLogs",
|
|
19
|
+
params: [
|
|
20
|
+
{
|
|
21
|
+
address: a,
|
|
22
|
+
topics: t,
|
|
23
|
+
fromBlock: typeof o == "bigint" ? u(o) : o,
|
|
24
|
+
toBlock: typeof i == "bigint" ? u(i) : i
|
|
37
25
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return f(s, { strict: !1 });
|
|
48
|
-
case "bool":
|
|
49
|
-
return n === "boolean";
|
|
50
|
-
case "function":
|
|
51
|
-
return n === "string";
|
|
52
|
-
case "string":
|
|
53
|
-
return n === "string";
|
|
54
|
-
default:
|
|
55
|
-
return e === "tuple" && "components" in o ? Object.values(o.components).every((u, i) => p(Object.values(s)[i], u)) : /^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(e) ? n === "number" || n === "bigint" : /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(e) ? n === "string" || s instanceof Uint8Array : /[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(e) ? Array.isArray(s) && s.every((u) => p(u, {
|
|
56
|
-
...o,
|
|
57
|
-
// Pop off `[]` or `[M]` from end of type
|
|
58
|
-
type: e.replace(/(\[[0-9]{0,}\])$/, "")
|
|
59
|
-
})) : !1;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function a(s, o, n) {
|
|
63
|
-
for (const e in s) {
|
|
64
|
-
const u = s[e], i = o[e];
|
|
65
|
-
if (u.type === "tuple" && i.type === "tuple" && "components" in u && "components" in i)
|
|
66
|
-
return a(u.components, i.components, n[e]);
|
|
67
|
-
const r = [u.type, i.type];
|
|
68
|
-
if (r.includes("address") && r.includes("bytes20") ? !0 : r.includes("address") && r.includes("string") ? f(n[e], { strict: !1 }) : r.includes("address") && r.includes("bytes") ? f(n[e], { strict: !1 }) : !1)
|
|
69
|
-
return r;
|
|
70
|
-
}
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
const p = s.map((d) => y(d));
|
|
29
|
+
return e ? l({
|
|
30
|
+
abi: e,
|
|
31
|
+
args: g,
|
|
32
|
+
logs: p,
|
|
33
|
+
strict: b
|
|
34
|
+
}) : p;
|
|
71
35
|
}
|
|
72
36
|
export {
|
|
73
|
-
|
|
74
|
-
a as getAmbiguousTypes,
|
|
75
|
-
p as isArgOfType
|
|
37
|
+
T as getLogs
|
|
76
38
|
};
|
package/dist/index74.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 r=require("./index75.cjs"),a=require("./index76.cjs");async function i(g,{filter:t}){const n="strict"in t&&t.strict,e=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof e[0]=="string")return e;const s=e.map(o=>a.formatLog(o));return!("abi"in t)||!t.abi?s:r.parseEventLogs({abi:t.abi,logs:s,strict:n})}exports.getFilterChanges=i;
|