@gardenfi/utils 2.1.3-beta.5 → 2.1.3-beta.7

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.
Files changed (212) hide show
  1. package/dist/index102.cjs +1 -1
  2. package/dist/index102.js +12 -8
  3. package/dist/index104.cjs +1 -1
  4. package/dist/index104.js +1 -1
  5. package/dist/index107.cjs +1 -1
  6. package/dist/index107.js +76 -35
  7. package/dist/index108.cjs +1 -1
  8. package/dist/index108.js +45 -43
  9. package/dist/index110.cjs +1 -1
  10. package/dist/index110.js +1 -1
  11. package/dist/index111.cjs +1 -1
  12. package/dist/index111.js +1 -1
  13. package/dist/index112.cjs +1 -1
  14. package/dist/index112.js +1 -1
  15. package/dist/index113.cjs +1 -1
  16. package/dist/index113.js +1 -1
  17. package/dist/index125.cjs +1 -1
  18. package/dist/index125.js +1 -1
  19. package/dist/index15.cjs +1 -1
  20. package/dist/index15.js +4 -4
  21. package/dist/index166.cjs +1 -1
  22. package/dist/index166.js +36 -34
  23. package/dist/index189.cjs +1 -1
  24. package/dist/index189.js +2 -2
  25. package/dist/index191.cjs +1 -1
  26. package/dist/index191.js +19 -15
  27. package/dist/index192.cjs +1 -1
  28. package/dist/index192.js +15 -18
  29. package/dist/index222.cjs +1 -1
  30. package/dist/index222.js +2 -2
  31. package/dist/index225.cjs +1 -1
  32. package/dist/index225.js +43 -43
  33. package/dist/index226.cjs +1 -1
  34. package/dist/index226.js +3 -113
  35. package/dist/index23.cjs +1 -1
  36. package/dist/index23.js +13 -31
  37. package/dist/index231.cjs +1 -1
  38. package/dist/index231.js +1 -1
  39. package/dist/index232.cjs +1 -1
  40. package/dist/index232.js +1 -1
  41. package/dist/index233.cjs +1 -1
  42. package/dist/index233.js +31 -2
  43. package/dist/index234.cjs +1 -1
  44. package/dist/index234.js +2 -14
  45. package/dist/index235.cjs +1 -1
  46. package/dist/index235.js +13 -12
  47. package/dist/index236.cjs +1 -1
  48. package/dist/index236.js +10 -45
  49. package/dist/index237.cjs +1 -1
  50. package/dist/index237.js +46 -10
  51. package/dist/index238.cjs +1 -1
  52. package/dist/index238.js +11 -7
  53. package/dist/index239.cjs +1 -1
  54. package/dist/index239.js +7 -9
  55. package/dist/index24.cjs +1 -1
  56. package/dist/index24.js +58 -32
  57. package/dist/index240.cjs +1 -1
  58. package/dist/index240.js +8 -12
  59. package/dist/index241.cjs +1 -1
  60. package/dist/index241.js +13 -14
  61. package/dist/index242.cjs +1 -1
  62. package/dist/index242.js +14 -9
  63. package/dist/index243.cjs +1 -1
  64. package/dist/index243.js +7 -28
  65. package/dist/index245.cjs +1 -1
  66. package/dist/index245.js +3 -3
  67. package/dist/index246.cjs +1 -1
  68. package/dist/index246.js +3 -3
  69. package/dist/index247.cjs +1 -2
  70. package/dist/index247.js +13 -24
  71. package/dist/index248.cjs +1 -1
  72. package/dist/index248.js +15 -13
  73. package/dist/index249.cjs +2 -1
  74. package/dist/index249.js +23 -14
  75. package/dist/index25.cjs +16 -1
  76. package/dist/index25.js +113 -11
  77. package/dist/index26.cjs +1 -1
  78. package/dist/index26.js +32 -58
  79. package/dist/index27.cjs +1 -1
  80. package/dist/index27.js +31 -13
  81. package/dist/index275.cjs +1 -1
  82. package/dist/index275.js +7 -6
  83. package/dist/index277.cjs +1 -1
  84. package/dist/index277.js +103 -16
  85. package/dist/index278.cjs +1 -1
  86. package/dist/index278.js +13 -220
  87. package/dist/index279.cjs +1 -1
  88. package/dist/index279.js +214 -6
  89. package/dist/index28.cjs +1 -16
  90. package/dist/index28.js +11 -113
  91. package/dist/index280.cjs +1 -1
  92. package/dist/index280.js +7 -7
  93. package/dist/index281.cjs +1 -1
  94. package/dist/index281.js +7 -27
  95. package/dist/index282.cjs +1 -1
  96. package/dist/index282.js +26 -34
  97. package/dist/index283.cjs +1 -1
  98. package/dist/index283.js +13 -12
  99. package/dist/index284.cjs +1 -1
  100. package/dist/index284.js +89 -51
  101. package/dist/index285.cjs +1 -1
  102. package/dist/index285.js +3 -67
  103. package/dist/index286.cjs +1 -1
  104. package/dist/index286.js +140 -3
  105. package/dist/index287.cjs +1 -1
  106. package/dist/index287.js +143 -128
  107. package/dist/index288.cjs +1 -1
  108. package/dist/index288.js +9 -155
  109. package/dist/index289.cjs +1 -1
  110. package/dist/index289.js +111 -7
  111. package/dist/index290.cjs +2 -1
  112. package/dist/index290.js +116 -95
  113. package/dist/index291.cjs +1 -2
  114. package/dist/index291.js +8 -131
  115. package/dist/index292.cjs +1 -1
  116. package/dist/index292.js +18 -27
  117. package/dist/index293.cjs +1 -1
  118. package/dist/index293.js +39 -35
  119. package/dist/index294.cjs +1 -1
  120. package/dist/index294.js +77 -10
  121. package/dist/index295.cjs +1 -1
  122. package/dist/index295.js +2 -20
  123. package/dist/index297.cjs +1 -1
  124. package/dist/index297.js +658 -2
  125. package/dist/index298.cjs +1 -1
  126. package/dist/index298.js +203 -37
  127. package/dist/index299.cjs +1 -1
  128. package/dist/index299.js +155 -620
  129. package/dist/index3.cjs +1 -1
  130. package/dist/index3.js +1 -1
  131. package/dist/index30.cjs +1 -1
  132. package/dist/index30.js +1 -1
  133. package/dist/index300.cjs +2 -1
  134. package/dist/index300.js +63 -203
  135. package/dist/index301.cjs +1 -1
  136. package/dist/index301.js +4 -172
  137. package/dist/index302.cjs +1 -2
  138. package/dist/index302.js +39 -65
  139. package/dist/index303.cjs +1 -1
  140. package/dist/index303.js +7 -4
  141. package/dist/index304.cjs +1 -1
  142. package/dist/index304.js +60 -38
  143. package/dist/index305.cjs +1 -1
  144. package/dist/index305.js +77 -7
  145. package/dist/index306.cjs +1 -1
  146. package/dist/index306.js +4 -63
  147. package/dist/index307.cjs +1 -1
  148. package/dist/index307.js +181 -64
  149. package/dist/index308.cjs +1 -1
  150. package/dist/index308.js +64 -4
  151. package/dist/index309.cjs +1 -1
  152. package/dist/index309.js +44 -194
  153. package/dist/index310.cjs +1 -1
  154. package/dist/index310.js +4 -18
  155. package/dist/index311.cjs +1 -1
  156. package/dist/index311.js +5 -64
  157. package/dist/index312.cjs +1 -1
  158. package/dist/index312.js +2 -45
  159. package/dist/index313.cjs +1 -1
  160. package/dist/index313.js +21 -4
  161. package/dist/index36.cjs +1 -1
  162. package/dist/index36.js +1 -1
  163. package/dist/index4.cjs +1 -1
  164. package/dist/index4.js +0 -4
  165. package/dist/index43.cjs +1 -1
  166. package/dist/index43.js +40 -21
  167. package/dist/index44.cjs +1 -1
  168. package/dist/index44.js +24 -24
  169. package/dist/index58.cjs +1 -1
  170. package/dist/index58.js +111 -107
  171. package/dist/index59.cjs +1 -1
  172. package/dist/index59.js +11 -11
  173. package/dist/index60.cjs +1 -1
  174. package/dist/index60.js +1 -1
  175. package/dist/index61.cjs +1 -1
  176. package/dist/index61.js +1 -1
  177. package/dist/index62.cjs +1 -1
  178. package/dist/index62.js +1 -1
  179. package/dist/index64.cjs +1 -1
  180. package/dist/index64.js +26 -26
  181. package/dist/index66.cjs +1 -1
  182. package/dist/index66.js +3 -3
  183. package/dist/index73.cjs +1 -1
  184. package/dist/index73.js +1 -1
  185. package/dist/index74.cjs +1 -1
  186. package/dist/index74.js +8 -8
  187. package/dist/index79.cjs +1 -1
  188. package/dist/index79.js +1 -1
  189. package/dist/index83.cjs +1 -1
  190. package/dist/index83.js +8 -3
  191. package/dist/index84.cjs +1 -1
  192. package/dist/index84.js +53 -51
  193. package/dist/index85.cjs +1 -1
  194. package/dist/index85.js +18 -18
  195. package/dist/index9.cjs +1 -1
  196. package/dist/index9.js +4 -4
  197. package/dist/index90.cjs +1 -1
  198. package/dist/index90.js +44 -42
  199. package/dist/index92.cjs +1 -1
  200. package/dist/index92.js +39 -39
  201. package/dist/index98.cjs +1 -1
  202. package/dist/index98.js +1 -1
  203. package/dist/src/lib/utils.d.ts +2 -1
  204. package/package.json +1 -1
  205. package/dist/index314.cjs +0 -1
  206. package/dist/index314.js +0 -107
  207. package/dist/index315.cjs +0 -1
  208. package/dist/index315.js +0 -7
  209. package/dist/index316.cjs +0 -1
  210. package/dist/index316.js +0 -4
  211. package/dist/index317.cjs +0 -1
  212. package/dist/index317.js +0 -24
package/dist/index44.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./index45.cjs"),C=require("./index46.cjs");function O(n){const{batch:r,cacheTime:d=n.pollingInterval??4e3,ccipRead:l,key:a="base",name:b="Base Client",pollingInterval:t=4e3,type:g="base"}=n,c=n.chain,f=n.account?q.parseAccount(n.account):void 0,{config:y,request:h,value:p}=n.transport({chain:c,pollingInterval:t}),v={...y,...p},e={account:f,batch:r,cacheTime:d,ccipRead:l,chain:c,key:a,name:b,pollingInterval:t,request:h,transport:v,type:g,uid:C.uid()};function o(i){return x=>{const u=x(i);for(const j in e)delete u[j];const s={...i,...u};return Object.assign(s,{extend:o(s)})}}return Object.assign(e,{extend:o(e)})}exports.createClient=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./index45.cjs"),j=require("./index46.cjs");function q(n){const{batch:u,chain:t,ccipRead:a,key:r="base",name:d="Base Client",type:b="base"}=n,f=(t==null?void 0:t.blockTime)??12e3,g=Math.min(Math.max(Math.floor(f/2),500),4e3),e=n.pollingInterval??g,h=n.cacheTime??e,v=n.account?M.parseAccount(n.account):void 0,{config:x,request:y,value:T}=n.transport({chain:t,pollingInterval:e}),k={...x,...T},c={account:v,batch:u,cacheTime:h,ccipRead:a,chain:t,key:r,name:d,pollingInterval:e,request:y,transport:k,type:b,uid:j.uid()};function o(i){return m=>{const l=m(i);for(const p in c)delete l[p];const s={...i,...l};return Object.assign(s,{extend:o(s)})}}return Object.assign(c,{extend:o(c)})}exports.createClient=q;
package/dist/index44.js CHANGED
@@ -1,33 +1,33 @@
1
- import { parseAccount as k } from "./index45.js";
2
- import { uid as m } from "./index46.js";
1
+ import { parseAccount as I } from "./index45.js";
2
+ import { uid as M } from "./index46.js";
3
3
  function O(n) {
4
- const { batch: d, cacheTime: l = n.pollingInterval ?? 4e3, ccipRead: r, key: a = "base", name: f = "Base Client", pollingInterval: c = 4e3, type: b = "base" } = n, e = n.chain, g = n.account ? k(n.account) : void 0, { config: p, request: x, value: h } = n.transport({
5
- chain: e,
6
- pollingInterval: c
7
- }), v = { ...p, ...h }, t = {
8
- account: g,
9
- batch: d,
10
- cacheTime: l,
11
- ccipRead: r,
12
- chain: e,
13
- key: a,
14
- name: f,
15
- pollingInterval: c,
16
- request: x,
4
+ const { batch: u, chain: t, ccipRead: a, key: d = "base", name: r = "Base Client", type: f = "base" } = n, b = (t == null ? void 0 : t.blockTime) ?? 12e3, m = Math.min(Math.max(Math.floor(b / 2), 500), 4e3), e = n.pollingInterval ?? m, g = n.cacheTime ?? e, x = n.account ? I(n.account) : void 0, { config: h, request: p, value: k } = n.transport({
5
+ chain: t,
6
+ pollingInterval: e
7
+ }), v = { ...h, ...k }, c = {
8
+ account: x,
9
+ batch: u,
10
+ cacheTime: g,
11
+ ccipRead: a,
12
+ chain: t,
13
+ key: d,
14
+ name: r,
15
+ pollingInterval: e,
16
+ request: p,
17
17
  transport: v,
18
- type: b,
19
- uid: m()
18
+ type: f,
19
+ uid: M()
20
20
  };
21
21
  function o(i) {
22
- return (y) => {
23
- const s = y(i);
24
- for (const j in t)
25
- delete s[j];
26
- const u = { ...i, ...s };
27
- return Object.assign(u, { extend: o(u) });
22
+ return (T) => {
23
+ const l = T(i);
24
+ for (const y in c)
25
+ delete l[y];
26
+ const s = { ...i, ...l };
27
+ return Object.assign(s, { extend: o(s) });
28
28
  };
29
29
  }
30
- return Object.assign(t, { extend: o(t) });
30
+ return Object.assign(c, { extend: o(c) });
31
31
  }
32
32
  export {
33
33
  O as createClient
package/dist/index58.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const J=require("./index45.cjs"),_=require("./index21.cjs"),K=require("./index233.cjs"),j=require("./index118.cjs"),A=require("./index38.cjs"),E=require("./index139.cjs"),z=require("./index127.cjs"),Q=require("./index170.cjs"),$=require("./index174.cjs"),U=require("./index177.cjs"),X=require("./index214.cjs"),G=require("./index150.cjs"),Y=require("./index234.cjs"),Z=require("./index235.cjs"),ee=require("./index184.cjs"),te=require("./index49.cjs"),ae=require("./index236.cjs"),re=require("./index197.cjs"),L=require("./index237.cjs");async function oe(e,t){var P,H,O,T;const{account:a=e.account,batch:s=!!((P=e.batch)!=null&&P.multicall),blockNumber:r,blockTag:m="latest",accessList:D,blobs:x,code:i,data:n,factory:l,factoryData:u,gas:k,gasPrice:d,maxFeePerBlobGas:v,maxFeePerGas:p,maxPriorityFeePerGas:f,nonce:b,to:o,value:h,stateOverride:g,...W}=t,q=a?J.parseAccount(a):void 0;if(i&&(l||u))throw new A.BaseError("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(i&&o)throw new A.BaseError("Cannot provide both `code` & `to` as parameters.");const N=i&&n,R=l&&u&&o&&n,S=N||R,I=N?se({code:i,data:n}):R?ie({data:n,factory:l,factoryData:u,to:o}):n;try{re.assertRequest(t);const c=(r?G.numberToHex(r):void 0)||m,y=ae.serializeStateOverride(g),C=(T=(O=(H=e.chain)==null?void 0:H.formatters)==null?void 0:O.transactionRequest)==null?void 0:T.format,w=(C||ee.formatTransactionRequest)({...Z.extract(W,{format:C}),from:q==null?void 0:q.address,accessList:D,blobs:x,data:I,gas:k,gasPrice:d,maxFeePerBlobGas:v,maxFeePerGas:p,maxPriorityFeePerGas:f,nonce:b,to:S?void 0:o,value:h});if(s&&ce({request:w})&&!y)try{return await ne(e,{...w,blockNumber:r,blockTag:m})}catch(F){if(!(F instanceof E.ClientChainNotConfiguredError)&&!(F instanceof E.ChainDoesNotSupportContract))throw F}const V=await e.request({method:"eth_call",params:y?[w,c,y]:[w,c]});return V==="0x"?{data:void 0}:{data:V}}catch(B){const c=M(B),{offchainLookup:y,offchainLookupSignature:C}=await Promise.resolve().then(()=>require("./index201.cjs"));if(e.ccipRead!==!1&&(c==null?void 0:c.slice(0,10))===C&&o)return{data:await y(e,{data:c,to:o})};throw S&&(c==null?void 0:c.slice(0,10))==="0x101bb98d"?new z.CounterfactualDeploymentFailedError({factory:l}):Y.getCallError(B,{...t,account:q,chain:e.chain})}}function ce({request:e}){const{data:t,to:a,...s}=e;return!(!t||t.startsWith(K.aggregate3Signature)||!a||Object.values(s).filter(r=>typeof r<"u").length>0)}async function ne(e,t){var p;const{batchSize:a=1024,wait:s=0}=typeof((p=e.batch)==null?void 0:p.multicall)=="object"?e.batch.multicall:{},{blockNumber:r,blockTag:m="latest",data:D,multicallAddress:x,to:i}=t;let n=x;if(!n){if(!e.chain)throw new E.ClientChainNotConfiguredError;n=X.getChainContractAddress({blockNumber:r,chain:e.chain,contract:"multicall3"})}const u=(r?G.numberToHex(r):void 0)||m,{schedule:k}=te.createBatchScheduler({id:`${e.uid}.${u}`,wait:s,shouldSplitBatch(f){return f.reduce((o,{data:h})=>o+(h.length-2),0)>a*2},fn:async f=>{const b=f.map(g=>({allowFailure:!0,callData:g.data,target:g.to})),o=U.encodeFunctionData({abi:_.multicall3Abi,args:[b],functionName:"aggregate3"}),h=await e.request({method:"eth_call",params:[{data:o,to:n},u]});return Q.decodeFunctionResult({abi:_.multicall3Abi,args:[b],functionName:"aggregate3",data:h||"0x"})}}),[{returnData:d,success:v}]=await k({data:D,to:i});if(!v)throw new z.RawContractError({data:d});return d==="0x"?{data:void 0}:{data:d}}function se(e){const{code:t,data:a}=e;return $.encodeDeployData({abi:L.parseAbi(["constructor(bytes, bytes)"]),bytecode:j.deploylessCallViaBytecodeBytecode,args:[t,a]})}function ie(e){const{data:t,factory:a,factoryData:s,to:r}=e;return $.encodeDeployData({abi:L.parseAbi(["constructor(address, bytes, address, bytes)"]),bytecode:j.deploylessCallViaFactoryBytecode,args:[r,t,a,s]})}function M(e){var a;if(!(e instanceof A.BaseError))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(a=t.data)==null?void 0:a.data:t.data}exports.call=oe;exports.getRevertErrorData=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("./index233.cjs"),Y=require("./index45.cjs"),z=require("./index21.cjs"),Z=require("./index234.cjs"),j=require("./index118.cjs"),A=require("./index38.cjs"),R=require("./index139.cjs"),L=require("./index127.cjs"),ee=require("./index170.cjs"),$=require("./index174.cjs"),te=require("./index177.cjs"),ae=require("./index214.cjs"),G=require("./index150.cjs"),re=require("./index235.cjs"),oe=require("./index236.cjs"),ce=require("./index184.cjs"),ne=require("./index49.cjs"),se=require("./index237.cjs"),ie=require("./index197.cjs"),M=require("./index238.cjs");async function ue(e,t){var O,P,H,T;const{account:a=e.account,authorizationList:i,batch:r=!!((O=e.batch)!=null&&O.multicall),blockNumber:h,blockTag:C="latest",accessList:k,blobs:v,blockOverrides:f,code:y,data:n,factory:b,factoryData:u,gas:x,gasPrice:w,maxFeePerBlobGas:m,maxFeePerGas:p,maxPriorityFeePerGas:g,nonce:q,to:o,value:I,stateOverride:J,...K}=t,D=a?Y.parseAccount(a):void 0;if(y&&(b||u))throw new A.BaseError("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(y&&o)throw new A.BaseError("Cannot provide both `code` & `to` as parameters.");const E=y&&n,N=b&&u&&o&&n,S=E||N,Q=E?fe({code:y,data:n}):N?be({data:n,factory:b,factoryData:u,to:o}):n;try{ie.assertRequest(t);const c=(typeof h=="bigint"?G.numberToHex(h):void 0)||C,l=f?X.toRpc(f):void 0,d=se.serializeStateOverride(J),V=(T=(H=(P=e.chain)==null?void 0:P.formatters)==null?void 0:H.transactionRequest)==null?void 0:T.format,F=(V||ce.formatTransactionRequest)({...oe.extract(K,{format:V}),from:D==null?void 0:D.address,accessList:k,authorizationList:i,blobs:v,data:Q,gas:x,gasPrice:w,maxFeePerBlobGas:m,maxFeePerGas:p,maxPriorityFeePerGas:g,nonce:q,to:S?void 0:o,value:I});if(r&&le({request:F})&&!d&&!l)try{return await de(e,{...F,blockNumber:h,blockTag:C})}catch(s){if(!(s instanceof R.ClientChainNotConfiguredError)&&!(s instanceof R.ChainDoesNotSupportContract))throw s}const U=(()=>{const s=[F,c];return d&&l?[...s,d,l]:d?[...s,d]:l?[...s,{},l]:s})(),_=await e.request({method:"eth_call",params:U});return _==="0x"?{data:void 0}:{data:_}}catch(B){const c=W(B),{offchainLookup:l,offchainLookupSignature:d}=await Promise.resolve().then(()=>require("./index201.cjs"));if(e.ccipRead!==!1&&(c==null?void 0:c.slice(0,10))===d&&o)return{data:await l(e,{data:c,to:o})};throw S&&(c==null?void 0:c.slice(0,10))==="0x101bb98d"?new L.CounterfactualDeploymentFailedError({factory:b}):re.getCallError(B,{...t,account:D,chain:e.chain})}}function le({request:e}){const{data:t,to:a,...i}=e;return!(!t||t.startsWith(Z.aggregate3Signature)||!a||Object.values(i).filter(r=>typeof r<"u").length>0)}async function de(e,t){var w;const{batchSize:a=1024,wait:i=0}=typeof((w=e.batch)==null?void 0:w.multicall)=="object"?e.batch.multicall:{},{blockNumber:r,blockTag:h="latest",data:C,multicallAddress:k,to:v}=t;let f=k;if(!f){if(!e.chain)throw new R.ClientChainNotConfiguredError;f=ae.getChainContractAddress({blockNumber:r,chain:e.chain,contract:"multicall3"})}const n=(typeof r=="bigint"?G.numberToHex(r):void 0)||h,{schedule:b}=ne.createBatchScheduler({id:`${e.uid}.${n}`,wait:i,shouldSplitBatch(m){return m.reduce((g,{data:q})=>g+(q.length-2),0)>a*2},fn:async m=>{const p=m.map(o=>({allowFailure:!0,callData:o.data,target:o.to})),g=te.encodeFunctionData({abi:z.multicall3Abi,args:[p],functionName:"aggregate3"}),q=await e.request({method:"eth_call",params:[{data:g,to:f},n]});return ee.decodeFunctionResult({abi:z.multicall3Abi,args:[p],functionName:"aggregate3",data:q||"0x"})}}),[{returnData:u,success:x}]=await b({data:C,to:v});if(!x)throw new L.RawContractError({data:u});return u==="0x"?{data:void 0}:{data:u}}function fe(e){const{code:t,data:a}=e;return $.encodeDeployData({abi:M.parseAbi(["constructor(bytes, bytes)"]),bytecode:j.deploylessCallViaBytecodeBytecode,args:[t,a]})}function be(e){const{data:t,factory:a,factoryData:i,to:r}=e;return $.encodeDeployData({abi:M.parseAbi(["constructor(address, bytes, address, bytes)"]),bytecode:j.deploylessCallViaFactoryBytecode,args:[r,t,a,i]})}function W(e){var a;if(!(e instanceof A.BaseError))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(a=t.data)==null?void 0:a.data:t.data}exports.call=ue;exports.getRevertErrorData=W;
package/dist/index58.js CHANGED
@@ -1,165 +1,169 @@
1
- import { parseAccount as $ } from "./index45.js";
2
- import { multicall3Abi as z } from "./index21.js";
3
- import { aggregate3Signature as W } from "./index233.js";
4
- import { deploylessCallViaBytecodeBytecode as I, deploylessCallViaFactoryBytecode as J } from "./index118.js";
5
- import { BaseError as S } from "./index38.js";
6
- import { ClientChainNotConfiguredError as O, ChainDoesNotSupportContract as K } from "./index139.js";
7
- import { CounterfactualDeploymentFailedError as Q, RawContractError as U } from "./index127.js";
8
- import { decodeFunctionResult as X } from "./index170.js";
1
+ import { toRpc as K } from "./index233.js";
2
+ import { parseAccount as Q } from "./index45.js";
3
+ import { multicall3Abi as H } from "./index21.js";
4
+ import { aggregate3Signature as U } from "./index234.js";
5
+ import { deploylessCallViaBytecodeBytecode as X, deploylessCallViaFactoryBytecode as Y } from "./index118.js";
6
+ import { BaseError as R } from "./index38.js";
7
+ import { ClientChainNotConfiguredError as L, ChainDoesNotSupportContract as Z } from "./index139.js";
8
+ import { CounterfactualDeploymentFailedError as tt, RawContractError as at } from "./index127.js";
9
+ import { decodeFunctionResult as et } from "./index170.js";
9
10
  import { encodeDeployData as T } from "./index174.js";
10
- import { encodeFunctionData as Y } from "./index177.js";
11
- import { getChainContractAddress as Z } from "./index214.js";
11
+ import { encodeFunctionData as rt } from "./index177.js";
12
+ import { getChainContractAddress as ot } from "./index214.js";
12
13
  import { numberToHex as j } from "./index150.js";
13
- import { getCallError as tt } from "./index234.js";
14
- import { extract as at } from "./index235.js";
15
- import { formatTransactionRequest as et } from "./index184.js";
16
- import { createBatchScheduler as ot } from "./index49.js";
17
- import { serializeStateOverride as rt } from "./index236.js";
18
- import { assertRequest as ct } from "./index197.js";
19
- import { parseAbi as G } from "./index237.js";
20
- async function qt(t, a) {
21
- var E, P, V, _;
22
- const { account: e = t.account, batch: s = !!((E = t.batch) != null && E.multicall), blockNumber: o, blockTag: h = "latest", accessList: x, blobs: k, code: i, data: n, factory: d, factoryData: l, gas: F, gasPrice: u, maxFeePerBlobGas: B, maxFeePerGas: y, maxPriorityFeePerGas: f, nonce: m, to: r, value: p, stateOverride: g, ...L } = a, w = e ? $(e) : void 0;
23
- if (i && (d || l))
24
- throw new S("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
25
- if (i && r)
26
- throw new S("Cannot provide both `code` & `to` as parameters.");
27
- const A = i && n, R = d && l && r && n, q = A || R, M = A ? it({
28
- code: i,
14
+ import { getCallError as ct } from "./index235.js";
15
+ import { extract as nt } from "./index236.js";
16
+ import { formatTransactionRequest as st } from "./index184.js";
17
+ import { createBatchScheduler as it } from "./index49.js";
18
+ import { serializeStateOverride as lt } from "./index237.js";
19
+ import { assertRequest as ut } from "./index197.js";
20
+ import { parseAbi as G } from "./index238.js";
21
+ async function zt(t, a) {
22
+ var E, O, P, V;
23
+ const { account: e = t.account, authorizationList: i, batch: r = !!((E = t.batch) != null && E.multicall), blockNumber: p, blockTag: C = "latest", accessList: x, blobs: B, blockOverrides: f, code: b, data: n, factory: m, factoryData: l, gas: F, gasPrice: k, maxFeePerBlobGas: h, maxFeePerGas: y, maxPriorityFeePerGas: g, nonce: w, to: o, value: M, stateOverride: $, ...W } = a, D = e ? Q(e) : void 0;
24
+ if (b && (m || l))
25
+ throw new R("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
26
+ if (b && o)
27
+ throw new R("Cannot provide both `code` & `to` as parameters.");
28
+ const S = b && n, A = m && l && o && n, q = S || A, I = S ? mt({
29
+ code: b,
29
30
  data: n
30
- }) : R ? lt({
31
+ }) : A ? pt({
31
32
  data: n,
32
- factory: d,
33
+ factory: m,
33
34
  factoryData: l,
34
- to: r
35
+ to: o
35
36
  }) : n;
36
37
  try {
37
- ct(a);
38
- const c = (o ? j(o) : void 0) || h, b = rt(g), C = (_ = (V = (P = t.chain) == null ? void 0 : P.formatters) == null ? void 0 : V.transactionRequest) == null ? void 0 : _.format, D = (C || et)({
38
+ ut(a);
39
+ const c = (typeof p == "bigint" ? j(p) : void 0) || C, u = f ? K(f) : void 0, d = lt($), _ = (V = (P = (O = t.chain) == null ? void 0 : O.formatters) == null ? void 0 : P.transactionRequest) == null ? void 0 : V.format, N = (_ || st)({
39
40
  // Pick out extra data that might exist on the chain's transaction request type.
40
- ...at(L, { format: C }),
41
- from: w == null ? void 0 : w.address,
41
+ ...nt(W, { format: _ }),
42
+ from: D == null ? void 0 : D.address,
42
43
  accessList: x,
43
- blobs: k,
44
- data: M,
44
+ authorizationList: i,
45
+ blobs: B,
46
+ data: I,
45
47
  gas: F,
46
- gasPrice: u,
47
- maxFeePerBlobGas: B,
48
+ gasPrice: k,
49
+ maxFeePerBlobGas: h,
48
50
  maxFeePerGas: y,
49
- maxPriorityFeePerGas: f,
50
- nonce: m,
51
- to: q ? void 0 : r,
52
- value: p
51
+ maxPriorityFeePerGas: g,
52
+ nonce: w,
53
+ to: q ? void 0 : o,
54
+ value: M
53
55
  });
54
- if (s && nt({ request: D }) && !b)
56
+ if (r && dt({ request: N }) && !d && !u)
55
57
  try {
56
- return await st(t, {
57
- ...D,
58
- blockNumber: o,
59
- blockTag: h
58
+ return await ft(t, {
59
+ ...N,
60
+ blockNumber: p,
61
+ blockTag: C
60
62
  });
61
- } catch (v) {
62
- if (!(v instanceof O) && !(v instanceof K))
63
- throw v;
63
+ } catch (s) {
64
+ if (!(s instanceof L) && !(s instanceof Z))
65
+ throw s;
64
66
  }
65
- const H = await t.request({
67
+ const J = (() => {
68
+ const s = [
69
+ N,
70
+ c
71
+ ];
72
+ return d && u ? [...s, d, u] : d ? [...s, d] : u ? [...s, {}, u] : s;
73
+ })(), z = await t.request({
66
74
  method: "eth_call",
67
- params: b ? [
68
- D,
69
- c,
70
- b
71
- ] : [D, c]
75
+ params: J
72
76
  });
73
- return H === "0x" ? { data: void 0 } : { data: H };
74
- } catch (N) {
75
- const c = dt(N), { offchainLookup: b, offchainLookupSignature: C } = await import("./index201.js");
76
- if (t.ccipRead !== !1 && (c == null ? void 0 : c.slice(0, 10)) === C && r)
77
- return { data: await b(t, { data: c, to: r }) };
78
- throw q && (c == null ? void 0 : c.slice(0, 10)) === "0x101bb98d" ? new Q({ factory: d }) : tt(N, {
77
+ return z === "0x" ? { data: void 0 } : { data: z };
78
+ } catch (v) {
79
+ const c = bt(v), { offchainLookup: u, offchainLookupSignature: d } = await import("./index201.js");
80
+ if (t.ccipRead !== !1 && (c == null ? void 0 : c.slice(0, 10)) === d && o)
81
+ return { data: await u(t, { data: c, to: o }) };
82
+ throw q && (c == null ? void 0 : c.slice(0, 10)) === "0x101bb98d" ? new tt({ factory: m }) : ct(v, {
79
83
  ...a,
80
- account: w,
84
+ account: D,
81
85
  chain: t.chain
82
86
  });
83
87
  }
84
88
  }
85
- function nt({ request: t }) {
86
- const { data: a, to: e, ...s } = t;
87
- return !(!a || a.startsWith(W) || !e || Object.values(s).filter((o) => typeof o < "u").length > 0);
89
+ function dt({ request: t }) {
90
+ const { data: a, to: e, ...i } = t;
91
+ return !(!a || a.startsWith(U) || !e || Object.values(i).filter((r) => typeof r < "u").length > 0);
88
92
  }
89
- async function st(t, a) {
90
- var y;
91
- const { batchSize: e = 1024, wait: s = 0 } = typeof ((y = t.batch) == null ? void 0 : y.multicall) == "object" ? t.batch.multicall : {}, { blockNumber: o, blockTag: h = "latest", data: x, multicallAddress: k, to: i } = a;
92
- let n = k;
93
- if (!n) {
93
+ async function ft(t, a) {
94
+ var k;
95
+ const { batchSize: e = 1024, wait: i = 0 } = typeof ((k = t.batch) == null ? void 0 : k.multicall) == "object" ? t.batch.multicall : {}, { blockNumber: r, blockTag: p = "latest", data: C, multicallAddress: x, to: B } = a;
96
+ let f = x;
97
+ if (!f) {
94
98
  if (!t.chain)
95
- throw new O();
96
- n = Z({
97
- blockNumber: o,
99
+ throw new L();
100
+ f = ot({
101
+ blockNumber: r,
98
102
  chain: t.chain,
99
103
  contract: "multicall3"
100
104
  });
101
105
  }
102
- const l = (o ? j(o) : void 0) || h, { schedule: F } = ot({
103
- id: `${t.uid}.${l}`,
104
- wait: s,
105
- shouldSplitBatch(f) {
106
- return f.reduce((r, { data: p }) => r + (p.length - 2), 0) > e * 2;
106
+ const n = (typeof r == "bigint" ? j(r) : void 0) || p, { schedule: m } = it({
107
+ id: `${t.uid}.${n}`,
108
+ wait: i,
109
+ shouldSplitBatch(h) {
110
+ return h.reduce((g, { data: w }) => g + (w.length - 2), 0) > e * 2;
107
111
  },
108
- fn: async (f) => {
109
- const m = f.map((g) => ({
112
+ fn: async (h) => {
113
+ const y = h.map((o) => ({
110
114
  allowFailure: !0,
111
- callData: g.data,
112
- target: g.to
113
- })), r = Y({
114
- abi: z,
115
- args: [m],
115
+ callData: o.data,
116
+ target: o.to
117
+ })), g = rt({
118
+ abi: H,
119
+ args: [y],
116
120
  functionName: "aggregate3"
117
- }), p = await t.request({
121
+ }), w = await t.request({
118
122
  method: "eth_call",
119
123
  params: [
120
124
  {
121
- data: r,
122
- to: n
125
+ data: g,
126
+ to: f
123
127
  },
124
- l
128
+ n
125
129
  ]
126
130
  });
127
- return X({
128
- abi: z,
129
- args: [m],
131
+ return et({
132
+ abi: H,
133
+ args: [y],
130
134
  functionName: "aggregate3",
131
- data: p || "0x"
135
+ data: w || "0x"
132
136
  });
133
137
  }
134
- }), [{ returnData: u, success: B }] = await F({ data: x, to: i });
135
- if (!B)
136
- throw new U({ data: u });
137
- return u === "0x" ? { data: void 0 } : { data: u };
138
+ }), [{ returnData: l, success: F }] = await m({ data: C, to: B });
139
+ if (!F)
140
+ throw new at({ data: l });
141
+ return l === "0x" ? { data: void 0 } : { data: l };
138
142
  }
139
- function it(t) {
143
+ function mt(t) {
140
144
  const { code: a, data: e } = t;
141
145
  return T({
142
146
  abi: G(["constructor(bytes, bytes)"]),
143
- bytecode: I,
147
+ bytecode: X,
144
148
  args: [a, e]
145
149
  });
146
150
  }
147
- function lt(t) {
148
- const { data: a, factory: e, factoryData: s, to: o } = t;
151
+ function pt(t) {
152
+ const { data: a, factory: e, factoryData: i, to: r } = t;
149
153
  return T({
150
154
  abi: G(["constructor(address, bytes, address, bytes)"]),
151
- bytecode: J,
152
- args: [o, a, e, s]
155
+ bytecode: Y,
156
+ args: [r, a, e, i]
153
157
  });
154
158
  }
155
- function dt(t) {
159
+ function bt(t) {
156
160
  var e;
157
- if (!(t instanceof S))
161
+ if (!(t instanceof R))
158
162
  return;
159
163
  const a = t.walk();
160
164
  return typeof (a == null ? void 0 : a.data) == "object" ? (e = a.data) == null ? void 0 : e.data : a.data;
161
165
  }
162
166
  export {
163
- qt as call,
164
- dt as getRevertErrorData
167
+ zt as call,
168
+ bt as getRevertErrorData
165
169
  };
package/dist/index59.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("./index45.cjs"),R=require("./index150.cjs"),F=require("./index234.cjs"),H=require("./index235.cjs"),T=require("./index184.cjs"),G=require("./index197.cjs");async function N(e,s){var c,o,n;const{account:r=e.account,blockNumber:a,blockTag:b="latest",blobs:l,data:q,gas:d,gasPrice:f,maxFeePerBlobGas:x,maxFeePerGas:g,maxPriorityFeePerGas:h,to:P,value:k,...p}=s,t=r?L.parseAccount(r):void 0;try{G.assertRequest(s);const y=(a?R.numberToHex(a):void 0)||b,i=(n=(o=(c=e.chain)==null?void 0:c.formatters)==null?void 0:o.transactionRequest)==null?void 0:n.format,A=(i||T.formatTransactionRequest)({...H.extract(p,{format:i}),from:t==null?void 0:t.address,blobs:l,data:q,gas:d,gasPrice:f,maxFeePerBlobGas:x,maxFeePerGas:g,maxPriorityFeePerGas:h,to:P,value:k}),m=await e.request({method:"eth_createAccessList",params:[A,y]});return{accessList:m.accessList,gasUsed:BigInt(m.gasUsed)}}catch(u){throw F.getCallError(u,{...s,account:t,chain:e.chain})}}exports.createAccessList=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("./index45.cjs"),R=require("./index150.cjs"),F=require("./index235.cjs"),H=require("./index236.cjs"),T=require("./index184.cjs"),G=require("./index197.cjs");async function N(e,s){var c,o,n;const{account:r=e.account,blockNumber:a,blockTag:b="latest",blobs:l,data:q,gas:d,gasPrice:f,maxFeePerBlobGas:g,maxFeePerGas:x,maxPriorityFeePerGas:h,to:p,value:y,...P}=s,t=r?L.parseAccount(r):void 0;try{G.assertRequest(s);const k=(typeof a=="bigint"?R.numberToHex(a):void 0)||b,i=(n=(o=(c=e.chain)==null?void 0:c.formatters)==null?void 0:o.transactionRequest)==null?void 0:n.format,A=(i||T.formatTransactionRequest)({...H.extract(P,{format:i}),from:t==null?void 0:t.address,blobs:l,data:q,gas:d,gasPrice:f,maxFeePerBlobGas:g,maxFeePerGas:x,maxPriorityFeePerGas:h,to:p,value:y}),m=await e.request({method:"eth_createAccessList",params:[A,k]});return{accessList:m.accessList,gasUsed:BigInt(m.gasUsed)}}catch(u){throw F.getCallError(u,{...s,account:t,chain:e.chain})}}exports.createAccessList=N;
package/dist/index59.js CHANGED
@@ -1,34 +1,34 @@
1
- import { parseAccount as y } from "./index45.js";
1
+ import { parseAccount as L } from "./index45.js";
2
2
  import { numberToHex as A } from "./index150.js";
3
- import { getCallError as G } from "./index234.js";
4
- import { extract as H } from "./index235.js";
3
+ import { getCallError as G } from "./index235.js";
4
+ import { extract as H } from "./index236.js";
5
5
  import { formatTransactionRequest as N } from "./index184.js";
6
6
  import { assertRequest as R } from "./index197.js";
7
7
  async function E(t, r) {
8
8
  var a, c, m;
9
- const { account: o = t.account, blockNumber: s, blockTag: f = "latest", blobs: b, data: d, gas: p, gasPrice: h, maxFeePerBlobGas: l, maxFeePerGas: x, maxPriorityFeePerGas: g, to: k, value: q, ...P } = r, e = o ? y(o) : void 0;
9
+ const { account: o = t.account, blockNumber: s, blockTag: u = "latest", blobs: b, data: p, gas: d, gasPrice: h, maxFeePerBlobGas: l, maxFeePerGas: x, maxPriorityFeePerGas: g, to: k, value: q, ...P } = r, e = o ? L(o) : void 0;
10
10
  try {
11
11
  R(r);
12
- const F = (s ? A(s) : void 0) || f, i = (m = (c = (a = t.chain) == null ? void 0 : a.formatters) == null ? void 0 : c.transactionRequest) == null ? void 0 : m.format, L = (i || N)({
12
+ const y = (typeof s == "bigint" ? A(s) : void 0) || u, i = (m = (c = (a = t.chain) == null ? void 0 : a.formatters) == null ? void 0 : c.transactionRequest) == null ? void 0 : m.format, F = (i || N)({
13
13
  // Pick out extra data that might exist on the chain's transaction request type.
14
14
  ...H(P, { format: i }),
15
15
  from: e == null ? void 0 : e.address,
16
16
  blobs: b,
17
- data: d,
18
- gas: p,
17
+ data: p,
18
+ gas: d,
19
19
  gasPrice: h,
20
20
  maxFeePerBlobGas: l,
21
21
  maxFeePerGas: x,
22
22
  maxPriorityFeePerGas: g,
23
23
  to: k,
24
24
  value: q
25
- }), u = await t.request({
25
+ }), f = await t.request({
26
26
  method: "eth_createAccessList",
27
- params: [L, F]
27
+ params: [F, y]
28
28
  });
29
29
  return {
30
- accessList: u.accessList,
31
- gasUsed: BigInt(u.gasUsed)
30
+ accessList: f.accessList,
31
+ gasUsed: BigInt(f.gasUsed)
32
32
  };
33
33
  } catch (n) {
34
34
  throw G(n, {
package/dist/index60.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index238.cjs");async function o(e){const r=c.createFilterRequestScope(e,{method:"eth_newBlockFilter"}),t=await e.request({method:"eth_newBlockFilter"});return{id:t,request:r(t),type:"block"}}exports.createBlockFilter=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index239.cjs");async function o(e){const r=c.createFilterRequestScope(e,{method:"eth_newBlockFilter"}),t=await e.request({method:"eth_newBlockFilter"});return{id:t,request:r(t),type:"block"}}exports.createBlockFilter=o;
package/dist/index60.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createFilterRequestScope as r } from "./index238.js";
1
+ import { createFilterRequestScope as r } from "./index239.js";
2
2
  async function i(e) {
3
3
  const o = r(e, {
4
4
  method: "eth_newBlockFilter"
package/dist/index61.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index176.cjs"),u=require("./index150.cjs"),q=require("./index238.cjs");async function f(o,{address:d,args:s,event:e,events:p,fromBlock:n,strict:b,toBlock:i}={}){const r=p??(e?[e]:void 0),l=q.createFilterRequestScope(o,{method:"eth_newFilter"});let t=[];r&&(t=[r.flatMap(a=>m.encodeEventTopics({abi:[a],eventName:a.name,args:s}))],e&&(t=t[0]));const c=await o.request({method:"eth_newFilter",params:[{address:d,fromBlock:typeof n=="bigint"?u.numberToHex(n):n,toBlock:typeof i=="bigint"?u.numberToHex(i):i,...t.length?{topics:t}:{}}]});return{abi:r,args:s,eventName:e?e.name:void 0,fromBlock:n,id:c,request:l(c),strict:!!b,toBlock:i,type:"event"}}exports.createEventFilter=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index176.cjs"),u=require("./index150.cjs"),q=require("./index239.cjs");async function f(o,{address:d,args:s,event:e,events:p,fromBlock:n,strict:b,toBlock:i}={}){const r=p??(e?[e]:void 0),l=q.createFilterRequestScope(o,{method:"eth_newFilter"});let t=[];r&&(t=[r.flatMap(a=>m.encodeEventTopics({abi:[a],eventName:a.name,args:s}))],e&&(t=t[0]));const c=await o.request({method:"eth_newFilter",params:[{address:d,fromBlock:typeof n=="bigint"?u.numberToHex(n):n,toBlock:typeof i=="bigint"?u.numberToHex(i):i,...t.length?{topics:t}:{}}]});return{abi:r,args:s,eventName:e?e.name:void 0,fromBlock:n,id:c,request:l(c),strict:!!b,toBlock:i,type:"event"}}exports.createEventFilter=f;
package/dist/index61.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { encodeEventTopics as b } from "./index176.js";
2
2
  import { numberToHex as m } from "./index150.js";
3
- import { createFilterRequestScope as h } from "./index238.js";
3
+ import { createFilterRequestScope as h } from "./index239.js";
4
4
  async function l(r, { address: p, args: a, event: e, events: c, fromBlock: n, strict: f, toBlock: i } = {}) {
5
5
  const o = c ?? (e ? [e] : void 0), u = h(r, {
6
6
  method: "eth_newFilter"
package/dist/index62.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index238.cjs");async function i(e){const n=r.createFilterRequestScope(e,{method:"eth_newPendingTransactionFilter"}),t=await e.request({method:"eth_newPendingTransactionFilter"});return{id:t,request:n(t),type:"transaction"}}exports.createPendingTransactionFilter=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index239.cjs");async function i(e){const n=r.createFilterRequestScope(e,{method:"eth_newPendingTransactionFilter"}),t=await e.request({method:"eth_newPendingTransactionFilter"});return{id:t,request:n(t),type:"transaction"}}exports.createPendingTransactionFilter=i;
package/dist/index62.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createFilterRequestScope as r } from "./index238.js";
1
+ import { createFilterRequestScope as r } from "./index239.js";
2
2
  async function a(e) {
3
3
  const n = r(e, {
4
4
  method: "eth_newPendingTransactionFilter"
package/dist/index64.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("./index45.cjs"),N=require("./index38.cjs"),_=require("./index239.cjs"),G=require("./index150.cjs"),I=require("./index240.cjs"),V=require("./index235.cjs"),j=require("./index184.cjs"),C=require("./index236.cjs"),M=require("./index197.cjs"),$=require("./index96.cjs"),D=require("./index66.cjs");async function J(r,n){var m,q,f;const{account:d=r.account}=n,e=d?L.parseAccount(d):void 0;try{let x=function(u){const{block:o,request:t,rpcStateOverride:s}=u;return r.request({method:"eth_estimateGas",params:s?[t,o??"latest",s]:o?[t,o]:[t]})};const{accessList:i,authorizationList:a,blobs:y,blobVersionedHashes:z,blockNumber:l,blockTag:H,data:b,gas:O,gasPrice:P,maxFeePerBlobGas:R,maxFeePerGas:T,maxPriorityFeePerGas:k,nonce:A,value:B,stateOverride:E,...c}=await $.prepareTransactionRequest(r,{...n,parameters:(e==null?void 0:e.type)==="local"?void 0:["blobVersionedHashes"]}),h=(l?G.numberToHex(l):void 0)||H,p=C.serializeStateOverride(E),S=await(async()=>{if(c.to)return c.to;if(a&&a.length>0)return await _.recoverAuthorizationAddress({authorization:a[0]}).catch(()=>{throw new N.BaseError("`to` is required. Could not infer from `authorizationList`")})})();M.assertRequest(n);const v=(f=(q=(m=r.chain)==null?void 0:m.formatters)==null?void 0:q.transactionRequest)==null?void 0:f.format,w=(v||j.formatTransactionRequest)({...V.extract(c,{format:v}),from:e==null?void 0:e.address,accessList:i,authorizationList:a,blobs:y,blobVersionedHashes:z,data:b,gas:O,gasPrice:P,maxFeePerBlobGas:R,maxFeePerGas:T,maxPriorityFeePerGas:k,nonce:A,to:S,value:B});let g=BigInt(await x({block:h,request:w,rpcStateOverride:p}));if(a){const u=await D.getBalance(r,{address:w.from}),o=await Promise.all(a.map(async t=>{const{address:s}=t,F=await x({block:h,request:{authorizationList:void 0,data:b,from:e==null?void 0:e.address,to:s,value:G.numberToHex(u)},rpcStateOverride:p}).catch(()=>100000n);return 2n*BigInt(F)}));g+=o.reduce((t,s)=>t+s,0n)}return g}catch(i){throw I.getEstimateGasError(i,{...n,account:e,chain:r.chain})}}exports.estimateGas=J;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("./index45.cjs"),N=require("./index38.cjs"),_=require("./index240.cjs"),y=require("./index150.cjs"),I=require("./index241.cjs"),V=require("./index236.cjs"),j=require("./index184.cjs"),C=require("./index237.cjs"),M=require("./index197.cjs"),$=require("./index96.cjs"),D=require("./index66.cjs");async function J(r,n){var m,f,q;const{account:d=r.account}=n,e=d?L.parseAccount(d):void 0;try{let w=function(u){const{block:o,request:t,rpcStateOverride:s}=u;return r.request({method:"eth_estimateGas",params:s?[t,o??"latest",s]:o?[t,o]:[t]})};const{accessList:i,authorizationList:a,blobs:G,blobVersionedHashes:z,blockNumber:b,blockTag:H,data:l,gas:O,gasPrice:P,maxFeePerBlobGas:R,maxFeePerGas:T,maxPriorityFeePerGas:k,nonce:A,value:B,stateOverride:E,...c}=await $.prepareTransactionRequest(r,{...n,parameters:(e==null?void 0:e.type)==="local"?void 0:["blobVersionedHashes"]}),h=(typeof b=="bigint"?y.numberToHex(b):void 0)||H,p=C.serializeStateOverride(E),S=await(async()=>{if(c.to)return c.to;if(a&&a.length>0)return await _.recoverAuthorizationAddress({authorization:a[0]}).catch(()=>{throw new N.BaseError("`to` is required. Could not infer from `authorizationList`")})})();M.assertRequest(n);const v=(q=(f=(m=r.chain)==null?void 0:m.formatters)==null?void 0:f.transactionRequest)==null?void 0:q.format,g=(v||j.formatTransactionRequest)({...V.extract(c,{format:v}),from:e==null?void 0:e.address,accessList:i,authorizationList:a,blobs:G,blobVersionedHashes:z,data:l,gas:O,gasPrice:P,maxFeePerBlobGas:R,maxFeePerGas:T,maxPriorityFeePerGas:k,nonce:A,to:S,value:B});let x=BigInt(await w({block:h,request:g,rpcStateOverride:p}));if(a){const u=await D.getBalance(r,{address:g.from}),o=await Promise.all(a.map(async t=>{const{address:s}=t,F=await w({block:h,request:{authorizationList:void 0,data:l,from:e==null?void 0:e.address,to:s,value:y.numberToHex(u)},rpcStateOverride:p}).catch(()=>100000n);return 2n*BigInt(F)}));x+=o.reduce((t,s)=>t+s,0n)}return x}catch(i){throw I.getEstimateGasError(i,{...n,account:e,chain:r.chain})}}exports.estimateGas=J;
package/dist/index64.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { parseAccount as N } from "./index45.js";
2
2
  import { BaseError as S } from "./index38.js";
3
- import { recoverAuthorizationAddress as _ } from "./index239.js";
4
- import { numberToHex as k } from "./index150.js";
5
- import { getEstimateGasError as I } from "./index240.js";
6
- import { extract as V } from "./index235.js";
3
+ import { recoverAuthorizationAddress as _ } from "./index240.js";
4
+ import { numberToHex as G } from "./index150.js";
5
+ import { getEstimateGasError as I } from "./index241.js";
6
+ import { extract as V } from "./index236.js";
7
7
  import { formatTransactionRequest as C } from "./index184.js";
8
- import { serializeStateOverride as j } from "./index236.js";
8
+ import { serializeStateOverride as j } from "./index237.js";
9
9
  import { assertRequest as D } from "./index197.js";
10
10
  import { prepareTransactionRequest as J } from "./index96.js";
11
11
  import { getBalance as K } from "./index66.js";
@@ -14,25 +14,25 @@ async function st(r, i) {
14
14
  const { account: u = r.account } = i, t = u ? N(u) : void 0;
15
15
  try {
16
16
  let x = function(c) {
17
- const { block: s, request: e, rpcStateOverride: o } = c;
17
+ const { block: s, request: e, rpcStateOverride: a } = c;
18
18
  return r.request({
19
19
  method: "eth_estimateGas",
20
- params: o ? [e, s ?? "latest", o] : s ? [e, s] : [e]
20
+ params: a ? [e, s ?? "latest", a] : s ? [e, s] : [e]
21
21
  });
22
22
  };
23
- const { accessList: n, authorizationList: a, blobs: y, blobVersionedHashes: z, blockNumber: h, blockTag: P, data: l, gas: g, gasPrice: B, maxFeePerBlobGas: H, maxFeePerGas: F, maxPriorityFeePerGas: L, nonce: O, value: R, stateOverride: T, ...m } = await J(r, {
23
+ const { accessList: n, authorizationList: o, blobs: g, blobVersionedHashes: k, blockNumber: h, blockTag: z, data: b, gas: P, gasPrice: B, maxFeePerBlobGas: H, maxFeePerGas: F, maxPriorityFeePerGas: L, nonce: O, value: R, stateOverride: T, ...m } = await J(r, {
24
24
  ...i,
25
25
  parameters: (
26
26
  // Some RPC Providers do not compute versioned hashes from blobs. We will need
27
27
  // to compute them.
28
28
  (t == null ? void 0 : t.type) === "local" ? void 0 : ["blobVersionedHashes"]
29
29
  )
30
- }), b = (h ? k(h) : void 0) || P, w = j(T), A = await (async () => {
30
+ }), l = (typeof h == "bigint" ? G(h) : void 0) || z, w = j(T), A = await (async () => {
31
31
  if (m.to)
32
32
  return m.to;
33
- if (a && a.length > 0)
33
+ if (o && o.length > 0)
34
34
  return await _({
35
- authorization: a[0]
35
+ authorization: o[0]
36
36
  }).catch(() => {
37
37
  throw new S("`to` is required. Could not infer from `authorizationList`");
38
38
  });
@@ -43,11 +43,11 @@ async function st(r, i) {
43
43
  ...V(m, { format: q }),
44
44
  from: t == null ? void 0 : t.address,
45
45
  accessList: n,
46
- authorizationList: a,
47
- blobs: y,
48
- blobVersionedHashes: z,
49
- data: l,
50
- gas: g,
46
+ authorizationList: o,
47
+ blobs: g,
48
+ blobVersionedHashes: k,
49
+ data: b,
50
+ gas: P,
51
51
  gasPrice: B,
52
52
  maxFeePerBlobGas: H,
53
53
  maxFeePerGas: F,
@@ -56,25 +56,25 @@ async function st(r, i) {
56
56
  to: A,
57
57
  value: R
58
58
  });
59
- let G = BigInt(await x({ block: b, request: v, rpcStateOverride: w }));
60
- if (a) {
61
- const c = await K(r, { address: v.from }), s = await Promise.all(a.map(async (e) => {
62
- const { address: o } = e, E = await x({
63
- block: b,
59
+ let y = BigInt(await x({ block: l, request: v, rpcStateOverride: w }));
60
+ if (o) {
61
+ const c = await K(r, { address: v.from }), s = await Promise.all(o.map(async (e) => {
62
+ const { address: a } = e, E = await x({
63
+ block: l,
64
64
  request: {
65
65
  authorizationList: void 0,
66
- data: l,
66
+ data: b,
67
67
  from: t == null ? void 0 : t.address,
68
- to: o,
69
- value: k(c)
68
+ to: a,
69
+ value: G(c)
70
70
  },
71
71
  rpcStateOverride: w
72
72
  }).catch(() => 100000n);
73
73
  return 2n * BigInt(E);
74
74
  }));
75
- G += s.reduce((e, o) => e + o, 0n);
75
+ y += s.reduce((e, a) => e + a, 0n);
76
76
  }
77
- return G;
77
+ return y;
78
78
  } catch (n) {
79
79
  throw I(n, {
80
80
  ...i,
package/dist/index66.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index150.cjs");async function s(t,{address:n,blockNumber:e,blockTag:a="latest"}){const c=e?r.numberToHex(e):void 0,o=await t.request({method:"eth_getBalance",params:[n,c||a]});return BigInt(o)}exports.getBalance=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index150.cjs");async function i(t,{address:n,blockNumber:e,blockTag:a="latest"}){const o=typeof e=="bigint"?r.numberToHex(e):void 0,c=await t.request({method:"eth_getBalance",params:[n,o||a]});return BigInt(c)}exports.getBalance=i;
package/dist/index66.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { numberToHex as c } from "./index150.js";
2
- async function i(t, { address: n, blockNumber: e, blockTag: a = "latest" }) {
3
- const o = e ? c(e) : void 0, r = await t.request({
2
+ async function s(t, { address: n, blockNumber: e, blockTag: a = "latest" }) {
3
+ const o = typeof e == "bigint" ? c(e) : void 0, r = await t.request({
4
4
  method: "eth_getBalance",
5
5
  params: [n, o || a]
6
6
  });
7
7
  return BigInt(r);
8
8
  }
9
9
  export {
10
- i as getBalance
10
+ s as getBalance
11
11
  };
package/dist/index73.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index241.cjs"),d=require("./index29.cjs"),f=require("./index33.cjs");async function g(a,i){const{address:n,factory:r,factoryData:o}=i;try{const[e,t,c,s,u,m,y]=await d.getAction(a,f.readContract,"readContract")({abi:l,address:n,functionName:"eip712Domain",factory:r,factoryData:o});return{domain:{name:t,version:c,chainId:Number(s),verifyingContract:u,salt:m},extensions:y,fields:e}}catch(e){const t=e;throw t.name==="ContractFunctionExecutionError"&&t.cause.name==="ContractFunctionZeroDataError"?new p.Eip712DomainNotFoundError({address:n}):t}}const l=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];exports.getEip712Domain=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index242.cjs"),d=require("./index29.cjs"),f=require("./index33.cjs");async function g(a,i){const{address:n,factory:r,factoryData:o}=i;try{const[e,t,c,s,u,m,y]=await d.getAction(a,f.readContract,"readContract")({abi:l,address:n,functionName:"eip712Domain",factory:r,factoryData:o});return{domain:{name:t,version:c,chainId:Number(s),verifyingContract:u,salt:m},extensions:y,fields:e}}catch(e){const t=e;throw t.name==="ContractFunctionExecutionError"&&t.cause.name==="ContractFunctionZeroDataError"?new p.Eip712DomainNotFoundError({address:n}):t}}const l=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];exports.getEip712Domain=g;