@gardenfi/utils 2.1.3-beta.2 → 2.1.3-beta.21

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 (233) hide show
  1. package/dist/index104.cjs +1 -1
  2. package/dist/index104.js +1 -1
  3. package/dist/index107.cjs +1 -1
  4. package/dist/index107.js +75 -46
  5. package/dist/index108.cjs +1 -1
  6. package/dist/index108.js +4 -4
  7. package/dist/index110.cjs +1 -1
  8. package/dist/index110.js +1 -1
  9. package/dist/index111.cjs +1 -1
  10. package/dist/index111.js +1 -1
  11. package/dist/index112.cjs +1 -1
  12. package/dist/index112.js +1 -1
  13. package/dist/index113.cjs +1 -1
  14. package/dist/index113.js +1 -1
  15. package/dist/index125.cjs +1 -1
  16. package/dist/index125.js +1 -1
  17. package/dist/index166.cjs +1 -1
  18. package/dist/index166.js +36 -34
  19. package/dist/index192.cjs +1 -1
  20. package/dist/index192.js +27 -25
  21. package/dist/index203.cjs +1 -1
  22. package/dist/index203.js +16 -16
  23. package/dist/index22.cjs +1 -1
  24. package/dist/index22.js +6 -6
  25. package/dist/index222.cjs +1 -1
  26. package/dist/index222.js +2 -2
  27. package/dist/index225.cjs +1 -1
  28. package/dist/index225.js +43 -43
  29. package/dist/index226.cjs +1 -1
  30. package/dist/index226.js +3 -113
  31. package/dist/index228.cjs +1 -1
  32. package/dist/index228.js +14 -14
  33. package/dist/index230.cjs +1 -1
  34. package/dist/index230.js +10 -25
  35. package/dist/index231.cjs +1 -1
  36. package/dist/index231.js +16 -13
  37. package/dist/index232.cjs +1 -1
  38. package/dist/index232.js +21 -14
  39. package/dist/index233.cjs +1 -1
  40. package/dist/index233.js +30 -5
  41. package/dist/index234.cjs +1 -1
  42. package/dist/index234.js +2 -14
  43. package/dist/index235.cjs +1 -1
  44. package/dist/index235.js +12 -9
  45. package/dist/index236.cjs +1 -1
  46. package/dist/index236.js +12 -16
  47. package/dist/index237.cjs +1 -1
  48. package/dist/index237.js +47 -10
  49. package/dist/index238.cjs +1 -1
  50. package/dist/index238.js +10 -15
  51. package/dist/index239.cjs +1 -1
  52. package/dist/index239.js +7 -22
  53. package/dist/index240.cjs +1 -1
  54. package/dist/index240.js +9 -30
  55. package/dist/index241.cjs +1 -1
  56. package/dist/index241.js +14 -2
  57. package/dist/index242.cjs +1 -1
  58. package/dist/index242.js +14 -13
  59. package/dist/index243.cjs +1 -1
  60. package/dist/index243.js +9 -12
  61. package/dist/index244.cjs +1 -1
  62. package/dist/index244.js +24 -47
  63. package/dist/index245.cjs +1 -1
  64. package/dist/index245.js +12 -11
  65. package/dist/index246.cjs +1 -1
  66. package/dist/index246.js +24 -7
  67. package/dist/index247.cjs +1 -1
  68. package/dist/index247.js +12 -8
  69. package/dist/index248.cjs +1 -1
  70. package/dist/index248.js +15 -13
  71. package/dist/index249.cjs +2 -1
  72. package/dist/index249.js +21 -11
  73. package/dist/index250.cjs +1 -1
  74. package/dist/index250.js +52 -9
  75. package/dist/index251.cjs +1 -1
  76. package/dist/index251.js +25 -24
  77. package/dist/index252.cjs +1 -1
  78. package/dist/index252.js +13 -12
  79. package/dist/index253.cjs +1 -1
  80. package/dist/index253.js +15 -24
  81. package/dist/index254.cjs +1 -2
  82. package/dist/index254.js +5 -24
  83. package/dist/index255.cjs +1 -1
  84. package/dist/index255.js +12 -12
  85. package/dist/index256.cjs +1 -1
  86. package/dist/index256.js +10 -15
  87. package/dist/index257.cjs +1 -1
  88. package/dist/index257.js +16 -52
  89. package/dist/index266.cjs +1 -1
  90. package/dist/index266.js +1 -1
  91. package/dist/index277.cjs +1 -1
  92. package/dist/index277.js +103 -16
  93. package/dist/index278.cjs +1 -1
  94. package/dist/index278.js +5 -222
  95. package/dist/index279.cjs +1 -1
  96. package/dist/index279.js +224 -6
  97. package/dist/index28.cjs +1 -1
  98. package/dist/index28.js +2 -2
  99. package/dist/index280.cjs +1 -1
  100. package/dist/index280.js +7 -7
  101. package/dist/index281.cjs +1 -1
  102. package/dist/index281.js +7 -27
  103. package/dist/index282.cjs +1 -1
  104. package/dist/index282.js +26 -34
  105. package/dist/index283.cjs +1 -1
  106. package/dist/index283.js +13 -12
  107. package/dist/index284.cjs +1 -1
  108. package/dist/index284.js +124 -48
  109. package/dist/index285.cjs +1 -1
  110. package/dist/index285.js +3 -67
  111. package/dist/index286.cjs +1 -1
  112. package/dist/index286.js +137 -37
  113. package/dist/index287.cjs +1 -1
  114. package/dist/index287.js +156 -2
  115. package/dist/index288.cjs +1 -1
  116. package/dist/index288.js +8 -205
  117. package/dist/index289.cjs +1 -1
  118. package/dist/index289.js +113 -3
  119. package/dist/index290.cjs +2 -1
  120. package/dist/index290.js +122 -128
  121. package/dist/index291.cjs +1 -1
  122. package/dist/index291.js +137 -153
  123. package/dist/index292.cjs +1 -1
  124. package/dist/index292.js +42 -9
  125. package/dist/index293.cjs +1 -1
  126. package/dist/index293.js +72 -107
  127. package/dist/index294.cjs +1 -2
  128. package/dist/index294.js +2 -135
  129. package/dist/index295.cjs +1 -1
  130. package/dist/index295.js +68 -11
  131. package/dist/index296.cjs +1 -1
  132. package/dist/index296.js +696 -17
  133. package/dist/index297.cjs +1 -1
  134. package/dist/index297.js +200 -67
  135. package/dist/index298.cjs +2 -1
  136. package/dist/index298.js +63 -639
  137. package/dist/index299.cjs +1 -1
  138. package/dist/index299.js +4 -172
  139. package/dist/index30.cjs +1 -1
  140. package/dist/index30.js +1 -1
  141. package/dist/index300.cjs +1 -2
  142. package/dist/index300.js +39 -65
  143. package/dist/index301.cjs +1 -1
  144. package/dist/index301.js +7 -4
  145. package/dist/index302.cjs +1 -1
  146. package/dist/index302.js +60 -38
  147. package/dist/index303.cjs +1 -1
  148. package/dist/index303.js +77 -7
  149. package/dist/index304.cjs +1 -1
  150. package/dist/index304.js +4 -63
  151. package/dist/index305.cjs +1 -1
  152. package/dist/index305.js +181 -64
  153. package/dist/index306.cjs +1 -1
  154. package/dist/index306.js +12 -4
  155. package/dist/index307.cjs +1 -1
  156. package/dist/index307.js +19 -194
  157. package/dist/index308.cjs +1 -1
  158. package/dist/index308.js +3 -3
  159. package/dist/index310.cjs +1 -1
  160. package/dist/index310.js +1 -1
  161. package/dist/index311.cjs +1 -1
  162. package/dist/index311.js +5 -105
  163. package/dist/index312.cjs +1 -1
  164. package/dist/index312.js +2 -5
  165. package/dist/index313.cjs +1 -1
  166. package/dist/index313.js +22 -2
  167. package/dist/index35.cjs +1 -1
  168. package/dist/index35.js +41 -41
  169. package/dist/index36.cjs +1 -1
  170. package/dist/index36.js +1 -1
  171. package/dist/index39.cjs +1 -1
  172. package/dist/index39.js +29 -24
  173. package/dist/index43.cjs +1 -1
  174. package/dist/index43.js +40 -21
  175. package/dist/index44.cjs +1 -1
  176. package/dist/index44.js +24 -24
  177. package/dist/index53.cjs +1 -1
  178. package/dist/index53.js +2 -2
  179. package/dist/index54.cjs +1 -1
  180. package/dist/index54.js +1 -1
  181. package/dist/index55.cjs +1 -1
  182. package/dist/index55.js +2 -2
  183. package/dist/index56.cjs +1 -1
  184. package/dist/index56.js +1 -1
  185. package/dist/index57.cjs +1 -1
  186. package/dist/index57.js +2 -2
  187. package/dist/index58.cjs +1 -1
  188. package/dist/index58.js +98 -97
  189. package/dist/index59.cjs +1 -1
  190. package/dist/index59.js +2 -2
  191. package/dist/index60.cjs +1 -1
  192. package/dist/index60.js +1 -1
  193. package/dist/index61.cjs +1 -1
  194. package/dist/index61.js +1 -1
  195. package/dist/index62.cjs +1 -1
  196. package/dist/index62.js +1 -1
  197. package/dist/index64.cjs +1 -1
  198. package/dist/index64.js +4 -4
  199. package/dist/index73.cjs +1 -1
  200. package/dist/index73.js +1 -1
  201. package/dist/index74.cjs +1 -1
  202. package/dist/index74.js +1 -1
  203. package/dist/index79.cjs +1 -1
  204. package/dist/index79.js +1 -1
  205. package/dist/index84.cjs +1 -1
  206. package/dist/index84.js +53 -51
  207. package/dist/index85.cjs +1 -1
  208. package/dist/index85.js +56 -55
  209. package/dist/index86.cjs +1 -1
  210. package/dist/index86.js +55 -59
  211. package/dist/index88.cjs +1 -1
  212. package/dist/index88.js +1 -1
  213. package/dist/index89.cjs +1 -1
  214. package/dist/index89.js +1 -1
  215. package/dist/index90.cjs +1 -1
  216. package/dist/index90.js +44 -42
  217. package/dist/index91.cjs +1 -1
  218. package/dist/index91.js +41 -41
  219. package/dist/index92.cjs +1 -1
  220. package/dist/index92.js +35 -34
  221. package/dist/index93.cjs +1 -1
  222. package/dist/index93.js +28 -28
  223. package/dist/index94.cjs +1 -1
  224. package/dist/index94.js +26 -26
  225. package/dist/index95.cjs +1 -1
  226. package/dist/index95.js +1 -1
  227. package/package.json +1 -1
  228. package/dist/index314.cjs +0 -1
  229. package/dist/index314.js +0 -22
  230. package/dist/index315.cjs +0 -1
  231. package/dist/index315.js +0 -74
  232. package/dist/index316.cjs +0 -1
  233. package/dist/index316.js +0 -24
package/dist/index104.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index45.cjs"),f=require("./index254.cjs"),g=require("./index181.cjs"),s=require("./index29.cjs"),h=require("./index71.cjs"),A=require("./index83.cjs");async function p(o,n){var i;const{account:c=o.account,chainId:u,nonce:a}=n;if(!c)throw new f.AccountNotFoundError({docsPath:"/docs/eip7702/prepareAuthorization"});const r=d.parseAccount(c),t=(()=>{if(n.executor)return n.executor==="self"?n.executor:d.parseAccount(n.executor)})(),e={address:n.contractAddress??n.address,chainId:u,nonce:a};return typeof e.chainId>"u"&&(e.chainId=((i=o.chain)==null?void 0:i.id)??await s.getAction(o,h.getChainId,"getChainId")({})),typeof e.nonce>"u"&&(e.nonce=await s.getAction(o,A.getTransactionCount,"getTransactionCount")({address:r.address,blockTag:"pending"}),(t==="self"||t!=null&&t.address&&g.isAddressEqual(t.address,r.address))&&(e.nonce+=1)),e}exports.prepareAuthorization=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index45.cjs"),f=require("./index249.cjs"),g=require("./index181.cjs"),s=require("./index29.cjs"),h=require("./index71.cjs"),A=require("./index83.cjs");async function p(o,n){var i;const{account:c=o.account,chainId:u,nonce:a}=n;if(!c)throw new f.AccountNotFoundError({docsPath:"/docs/eip7702/prepareAuthorization"});const r=d.parseAccount(c),t=(()=>{if(n.executor)return n.executor==="self"?n.executor:d.parseAccount(n.executor)})(),e={address:n.contractAddress??n.address,chainId:u,nonce:a};return typeof e.chainId>"u"&&(e.chainId=((i=o.chain)==null?void 0:i.id)??await s.getAction(o,h.getChainId,"getChainId")({})),typeof e.nonce>"u"&&(e.nonce=await s.getAction(o,A.getTransactionCount,"getTransactionCount")({address:r.address,blockTag:"pending"}),(t==="self"||t!=null&&t.address&&g.isAddressEqual(t.address,r.address))&&(e.nonce+=1)),e}exports.prepareAuthorization=p;
package/dist/index104.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { parseAccount as e } from "./index45.js";
2
- import { AccountNotFoundError as f } from "./index254.js";
2
+ import { AccountNotFoundError as f } from "./index249.js";
3
3
  import { isAddressEqual as h } from "./index181.js";
4
4
  import { getAction as a } from "./index29.js";
5
5
  import { getChainId as p } from "./index71.js";
package/dist/index107.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index45.cjs"),m=require("./index254.cjs"),h=require("./index177.cjs"),s=require("./index150.cjs"),y=require("./index255.cjs");async function q(e,n){const{account:r=e.account,chain:a=e.chain,forceAtomic:u=!1,id:i,version:d="2.0.0"}=n;if(typeof r>"u")throw new m.AccountNotFoundError({docsPath:"/docs/actions/wallet/sendCalls"});const c=r?f.parseAccount(r):null,l=n.calls.map(o=>{const t=o;return{data:t.abi?h.encodeFunctionData({abi:t.abi,functionName:t.functionName,args:t.args}):t.data,to:t.to,value:t.value?s.numberToHex(t.value):void 0}});try{const o=await e.request({method:"wallet_sendCalls",params:[{atomicRequired:u,calls:l,capabilities:v(n.capabilities),chainId:s.numberToHex(a.id),from:c==null?void 0:c.address,id:i,version:d}]},{retryCount:0});return typeof o=="string"?{id:o}:o}catch(o){throw y.getTransactionError(o,{...n,account:c,chain:n.chain})}}function v(e){const n=e!=null&&e.paymasterService?Object.entries(e.paymasterService).reduce((r,[a,u])=>({...r??{},[s.numberToHex(Number(a))]:u}),{}):void 0;return{...e,...n?{paymasterService:n}:{}}}exports.sendCalls=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./index45.cjs"),h=require("./index38.cjs"),w=require("./index138.cjs"),N=require("./index177.cjs"),g=require("./index154.cjs"),M=require("./index182.cjs"),c=require("./index150.cjs"),S=require("./index247.cjs"),_=require("./index108.cjs"),T="0x5792579257925792579257925792579257925792579257925792579257925792",v=c.numberToHex(0,{size:32});async function H(i,s){const{account:f=i.account,capabilities:l,chain:u=i.chain,experimental_fallback:x,experimental_fallbackDelay:m=32,forceAtomic:b=!1,id:y,version:C="2.0.0"}=s,r=f?k.parseAccount(f):null,d=s.calls.map(a=>{const e=a,o=e.abi?N.encodeFunctionData({abi:e.abi,functionName:e.functionName,args:e.args}):e.data;return{data:e.dataSuffix&&o?g.concat([o,e.dataSuffix]):o,to:e.to,value:e.value?c.numberToHex(e.value):void 0}});try{const a=await i.request({method:"wallet_sendCalls",params:[{atomicRequired:b,calls:d,capabilities:l,chainId:c.numberToHex(u.id),from:r==null?void 0:r.address,id:y,version:C}]},{retryCount:0});return typeof a=="string"?{id:a}:a}catch(a){const e=a;if(x&&(e.name==="MethodNotFoundRpcError"||e.name==="MethodNotSupportedRpcError"||e.name==="UnknownRpcError"||e.details.toLowerCase().includes("does not exist / is not available")||e.details.toLowerCase().includes("missing or invalid. request()")||e.details.toLowerCase().includes("did not match any variant of untagged enum")||e.details.toLowerCase().includes("account upgraded to unsupported contract")||e.details.toLowerCase().includes("eip-7702 not supported")||e.details.toLowerCase().includes("unsupported wc_ method"))){if(l&&Object.values(l).some(n=>!n.optional)){const n="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new w.UnsupportedNonOptionalCapabilityError(new h.BaseError(n,{details:n}))}if(b&&d.length>1){const t="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new w.AtomicityNotSupportedError(new h.BaseError(t,{details:t}))}const o=[];for(const t of d){const n=_.sendTransaction(i,{account:r,chain:u,data:t.data,to:t.to,value:t.value?M.hexToBigInt(t.value):void 0});o.push(n),m>0&&await new Promise(E=>setTimeout(E,m))}const p=await Promise.allSettled(o);if(p.every(t=>t.status==="rejected"))throw p[0].reason;const q=p.map(t=>t.status==="fulfilled"?t.value:v);return{id:g.concat([...q,c.numberToHex(u.id,{size:32}),T])}}throw S.getTransactionError(a,{...s,account:r,chain:s.chain})}}exports.fallbackMagicIdentifier=T;exports.fallbackTransactionErrorMagicIdentifier=v;exports.sendCalls=H;
package/dist/index107.js CHANGED
@@ -1,62 +1,91 @@
1
- import { parseAccount as m } from "./index45.js";
2
- import { AccountNotFoundError as l } from "./index254.js";
3
- import { encodeFunctionData as h } from "./index177.js";
4
- import { numberToHex as u } from "./index150.js";
5
- import { getTransactionError as p } from "./index255.js";
6
- async function q(o, n) {
7
- const { account: e = o.account, chain: c = o.chain, forceAtomic: s = !1, id: i, version: d = "2.0.0" } = n;
8
- if (typeof e > "u")
9
- throw new l({
10
- docsPath: "/docs/actions/wallet/sendCalls"
11
- });
12
- const a = e ? m(e) : null, f = n.calls.map((r) => {
13
- const t = r;
1
+ import { parseAccount as E } from "./index45.js";
2
+ import { BaseError as w } from "./index38.js";
3
+ import { UnsupportedNonOptionalCapabilityError as N, AtomicityNotSupportedError as T } from "./index138.js";
4
+ import { encodeFunctionData as k } from "./index177.js";
5
+ import { concat as b } from "./index154.js";
6
+ import { hexToBigInt as _ } from "./index182.js";
7
+ import { numberToHex as c } from "./index150.js";
8
+ import { getTransactionError as L } from "./index247.js";
9
+ import { sendTransaction as S } from "./index108.js";
10
+ const A = "0x5792579257925792579257925792579257925792579257925792579257925792", I = c(0, {
11
+ size: 32
12
+ });
13
+ async function P(i, s) {
14
+ const { account: f = i.account, capabilities: l, chain: d = i.chain, experimental_fallback: g, experimental_fallbackDelay: m = 32, forceAtomic: h = !1, id: v, version: C = "2.0.0" } = s, r = f ? E(f) : null, u = s.calls.map((a) => {
15
+ const t = a, e = t.abi ? k({
16
+ abi: t.abi,
17
+ functionName: t.functionName,
18
+ args: t.args
19
+ }) : t.data;
14
20
  return {
15
- data: t.abi ? h({
16
- abi: t.abi,
17
- functionName: t.functionName,
18
- args: t.args
19
- }) : t.data,
21
+ data: t.dataSuffix && e ? b([e, t.dataSuffix]) : e,
20
22
  to: t.to,
21
- value: t.value ? u(t.value) : void 0
23
+ value: t.value ? c(t.value) : void 0
22
24
  };
23
25
  });
24
26
  try {
25
- const r = await o.request({
27
+ const a = await i.request({
26
28
  method: "wallet_sendCalls",
27
29
  params: [
28
30
  {
29
- atomicRequired: s,
30
- calls: f,
31
- capabilities: y(n.capabilities),
32
- chainId: u(c.id),
33
- from: a == null ? void 0 : a.address,
34
- id: i,
35
- version: d
31
+ atomicRequired: h,
32
+ calls: u,
33
+ capabilities: l,
34
+ chainId: c(d.id),
35
+ from: r == null ? void 0 : r.address,
36
+ id: v,
37
+ version: C
36
38
  }
37
39
  ]
38
40
  }, { retryCount: 0 });
39
- return typeof r == "string" ? { id: r } : r;
40
- } catch (r) {
41
- throw p(r, {
42
- ...n,
43
- account: a,
44
- chain: n.chain
41
+ return typeof a == "string" ? { id: a } : a;
42
+ } catch (a) {
43
+ const t = a;
44
+ if (g && (t.name === "MethodNotFoundRpcError" || t.name === "MethodNotSupportedRpcError" || t.name === "UnknownRpcError" || t.details.toLowerCase().includes("does not exist / is not available") || t.details.toLowerCase().includes("missing or invalid. request()") || t.details.toLowerCase().includes("did not match any variant of untagged enum") || t.details.toLowerCase().includes("account upgraded to unsupported contract") || t.details.toLowerCase().includes("eip-7702 not supported") || t.details.toLowerCase().includes("unsupported wc_ method"))) {
45
+ if (l && Object.values(l).some((n) => !n.optional)) {
46
+ const n = "non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";
47
+ throw new N(new w(n, {
48
+ details: n
49
+ }));
50
+ }
51
+ if (h && u.length > 1) {
52
+ const o = "`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";
53
+ throw new T(new w(o, {
54
+ details: o
55
+ }));
56
+ }
57
+ const e = [];
58
+ for (const o of u) {
59
+ const n = S(i, {
60
+ account: r,
61
+ chain: d,
62
+ data: o.data,
63
+ to: o.to,
64
+ value: o.value ? _(o.value) : void 0
65
+ });
66
+ e.push(n), m > 0 && await new Promise((x) => setTimeout(x, m));
67
+ }
68
+ const p = await Promise.allSettled(e);
69
+ if (p.every((o) => o.status === "rejected"))
70
+ throw p[0].reason;
71
+ const y = p.map((o) => o.status === "fulfilled" ? o.value : I);
72
+ return {
73
+ id: b([
74
+ ...y,
75
+ c(d.id, { size: 32 }),
76
+ A
77
+ ])
78
+ };
79
+ }
80
+ throw L(a, {
81
+ ...s,
82
+ account: r,
83
+ chain: s.chain
45
84
  });
46
85
  }
47
86
  }
48
- function y(o) {
49
- const n = o != null && o.paymasterService ? Object.entries(o.paymasterService).reduce((e, [c, s]) => ({
50
- ...e ?? {},
51
- [u(Number(c))]: s
52
- }), {}) : void 0;
53
- return {
54
- ...o,
55
- ...n ? {
56
- paymasterService: n
57
- } : {}
58
- };
59
- }
60
87
  export {
61
- q as sendCalls
88
+ A as fallbackMagicIdentifier,
89
+ I as fallbackTransactionErrorMagicIdentifier,
90
+ P as sendCalls
62
91
  };
package/dist/index108.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("./index45.cjs"),u=require("./index254.cjs"),O=require("./index38.cjs"),j=require("./index247.cjs"),B=require("./index212.cjs"),U=require("./index255.cjs"),W=require("./index243.cjs"),k=require("./index184.cjs"),l=require("./index29.cjs"),D=require("./index220.cjs"),H=require("./index197.cjs"),J=require("./index71.cjs"),L=require("./index96.cjs"),K=require("./index97.cjs"),f=new D.LruMap(128);async function Q(r,e){var M,z,I,S;const{account:d=r.account,chain:n=r.chain,accessList:w,authorizationList:s,blobs:q,data:m,gas:T,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:R,maxPriorityFeePerGas:A,nonce:E,type:C,value:N,...P}=e;if(typeof d>"u")throw new u.AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransaction"});const t=d?G.parseAccount(d):null;try{H.assertRequest(e);const a=await(async()=>{if(e.to)return e.to;if(e.to!==null&&s&&s.length>0)return await j.recoverAuthorizationAddress({authorization:s[0]}).catch(()=>{throw new O.BaseError("`to` is required. Could not infer from `authorizationList`.")})})();if((t==null?void 0:t.type)==="json-rpc"||t===null){let i;n!==null&&(i=await l.getAction(r,J.getChainId,"getChainId")({}),B.assertCurrentChain({currentChainId:i,chain:n}));const c=(I=(z=(M=r.chain)==null?void 0:M.formatters)==null?void 0:z.transactionRequest)==null?void 0:I.format,F=(c||k.formatTransactionRequest)({...W.extract(P,{format:c}),accessList:w,authorizationList:s,blobs:q,chainId:i,data:m,from:t==null?void 0:t.address,gas:T,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:R,maxPriorityFeePerGas:A,nonce:E,to:a,type:C,value:N}),v=f.get(r.uid),_=v?"wallet_sendTransaction":"eth_sendTransaction";try{return await r.request({method:_,params:[F]},{retryCount:0})}catch(x){if(v===!1)throw x;const o=x;if(o.name==="InvalidInputRpcError"||o.name==="InvalidParamsRpcError"||o.name==="MethodNotFoundRpcError"||o.name==="MethodNotSupportedRpcError")return await r.request({method:"wallet_sendTransaction",params:[F]},{retryCount:0}).then(p=>(f.set(r.uid,!0),p)).catch(p=>{const h=p;throw h.name==="MethodNotFoundRpcError"||h.name==="MethodNotSupportedRpcError"?(f.set(r.uid,!1),o):h});throw o}}if((t==null?void 0:t.type)==="local"){const i=await l.getAction(r,L.prepareTransactionRequest,"prepareTransactionRequest")({account:t,accessList:w,authorizationList:s,blobs:q,chain:n,data:m,gas:T,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:R,maxPriorityFeePerGas:A,nonce:E,nonceManager:t.nonceManager,parameters:[...L.defaultParameters,"sidecars"],type:C,value:N,...P,to:a}),c=(S=n==null?void 0:n.serializers)==null?void 0:S.transaction,b=await t.signTransaction(i,{serializer:c});return await l.getAction(r,K.sendRawTransaction,"sendRawTransaction")({serializedTransaction:b})}throw(t==null?void 0:t.type)==="smart"?new u.AccountTypeNotSupportedError({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new u.AccountTypeNotSupportedError({docsPath:"/docs/actions/wallet/sendTransaction",type:t==null?void 0:t.type})}catch(a){throw a instanceof u.AccountTypeNotSupportedError?a:U.getTransactionError(a,{...e,account:t,chain:e.chain||void 0})}}exports.sendTransaction=Q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("./index45.cjs"),u=require("./index249.cjs"),O=require("./index38.cjs"),j=require("./index240.cjs"),B=require("./index212.cjs"),U=require("./index247.cjs"),W=require("./index236.cjs"),k=require("./index184.cjs"),l=require("./index29.cjs"),D=require("./index220.cjs"),H=require("./index197.cjs"),J=require("./index71.cjs"),L=require("./index96.cjs"),K=require("./index97.cjs"),f=new D.LruMap(128);async function Q(r,e){var M,z,I,S;const{account:d=r.account,chain:n=r.chain,accessList:w,authorizationList:s,blobs:q,data:m,gas:T,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:R,maxPriorityFeePerGas:A,nonce:E,type:C,value:N,...P}=e;if(typeof d>"u")throw new u.AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransaction"});const t=d?G.parseAccount(d):null;try{H.assertRequest(e);const a=await(async()=>{if(e.to)return e.to;if(e.to!==null&&s&&s.length>0)return await j.recoverAuthorizationAddress({authorization:s[0]}).catch(()=>{throw new O.BaseError("`to` is required. Could not infer from `authorizationList`.")})})();if((t==null?void 0:t.type)==="json-rpc"||t===null){let i;n!==null&&(i=await l.getAction(r,J.getChainId,"getChainId")({}),B.assertCurrentChain({currentChainId:i,chain:n}));const c=(I=(z=(M=r.chain)==null?void 0:M.formatters)==null?void 0:z.transactionRequest)==null?void 0:I.format,F=(c||k.formatTransactionRequest)({...W.extract(P,{format:c}),accessList:w,authorizationList:s,blobs:q,chainId:i,data:m,from:t==null?void 0:t.address,gas:T,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:R,maxPriorityFeePerGas:A,nonce:E,to:a,type:C,value:N}),v=f.get(r.uid),_=v?"wallet_sendTransaction":"eth_sendTransaction";try{return await r.request({method:_,params:[F]},{retryCount:0})}catch(x){if(v===!1)throw x;const o=x;if(o.name==="InvalidInputRpcError"||o.name==="InvalidParamsRpcError"||o.name==="MethodNotFoundRpcError"||o.name==="MethodNotSupportedRpcError")return await r.request({method:"wallet_sendTransaction",params:[F]},{retryCount:0}).then(p=>(f.set(r.uid,!0),p)).catch(p=>{const h=p;throw h.name==="MethodNotFoundRpcError"||h.name==="MethodNotSupportedRpcError"?(f.set(r.uid,!1),o):h});throw o}}if((t==null?void 0:t.type)==="local"){const i=await l.getAction(r,L.prepareTransactionRequest,"prepareTransactionRequest")({account:t,accessList:w,authorizationList:s,blobs:q,chain:n,data:m,gas:T,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:R,maxPriorityFeePerGas:A,nonce:E,nonceManager:t.nonceManager,parameters:[...L.defaultParameters,"sidecars"],type:C,value:N,...P,to:a}),c=(S=n==null?void 0:n.serializers)==null?void 0:S.transaction,b=await t.signTransaction(i,{serializer:c});return await l.getAction(r,K.sendRawTransaction,"sendRawTransaction")({serializedTransaction:b})}throw(t==null?void 0:t.type)==="smart"?new u.AccountTypeNotSupportedError({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new u.AccountTypeNotSupportedError({docsPath:"/docs/actions/wallet/sendTransaction",type:t==null?void 0:t.type})}catch(a){throw a instanceof u.AccountTypeNotSupportedError?a:U.getTransactionError(a,{...e,account:t,chain:e.chain||void 0})}}exports.sendTransaction=Q;
package/dist/index108.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { parseAccount as _ } from "./index45.js";
2
- import { AccountNotFoundError as G, AccountTypeNotSupportedError as p } from "./index254.js";
2
+ import { AccountNotFoundError as G, AccountTypeNotSupportedError as p } from "./index249.js";
3
3
  import { BaseError as B } from "./index38.js";
4
- import { recoverAuthorizationAddress as O } from "./index247.js";
4
+ import { recoverAuthorizationAddress as O } from "./index240.js";
5
5
  import { assertCurrentChain as U } from "./index212.js";
6
- import { getTransactionError as W } from "./index255.js";
7
- import { extract as j } from "./index243.js";
6
+ import { getTransactionError as W } from "./index247.js";
7
+ import { extract as j } from "./index236.js";
8
8
  import { formatTransactionRequest as k } from "./index184.js";
9
9
  import { getAction as f } from "./index29.js";
10
10
  import { LruMap as D } from "./index220.js";
package/dist/index110.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index45.cjs"),r=require("./index254.cjs"),e=require("./index104.cjs");async function a(t,n){const{account:i=t.account}=n;if(!i)throw new r.AccountNotFoundError({docsPath:"/docs/eip7702/signAuthorization"});const o=u.parseAccount(i);if(!o.signAuthorization)throw new r.AccountTypeNotSupportedError({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:o.type});const c=await e.prepareAuthorization(t,n);return o.signAuthorization(c)}exports.signAuthorization=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index45.cjs"),r=require("./index249.cjs"),e=require("./index104.cjs");async function a(t,n){const{account:i=t.account}=n;if(!i)throw new r.AccountNotFoundError({docsPath:"/docs/eip7702/signAuthorization"});const o=u.parseAccount(i);if(!o.signAuthorization)throw new r.AccountTypeNotSupportedError({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:o.type});const c=await e.prepareAuthorization(t,n);return o.signAuthorization(c)}exports.signAuthorization=a;
package/dist/index110.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { parseAccount as c } from "./index45.js";
2
- import { AccountNotFoundError as u, AccountTypeNotSupportedError as a } from "./index254.js";
2
+ import { AccountNotFoundError as u, AccountTypeNotSupportedError as a } from "./index249.js";
3
3
  import { prepareAuthorization as s } from "./index104.js";
4
4
  async function A(t, n) {
5
5
  const { account: i = t.account } = n;
package/dist/index111.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index45.cjs"),a=require("./index254.cjs"),o=require("./index150.cjs");async function i(n,{account:e=n.account,message:r}){if(!e)throw new a.AccountNotFoundError({docsPath:"/docs/actions/wallet/signMessage"});const t=c.parseAccount(e);if(t.signMessage)return t.signMessage({message:r});const s=typeof r=="string"?o.stringToHex(r):r.raw instanceof Uint8Array?o.toHex(r.raw):r.raw;return n.request({method:"personal_sign",params:[s,t.address]},{retryCount:0})}exports.signMessage=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index45.cjs"),a=require("./index249.cjs"),o=require("./index150.cjs");async function i(n,{account:e=n.account,message:r}){if(!e)throw new a.AccountNotFoundError({docsPath:"/docs/actions/wallet/signMessage"});const t=c.parseAccount(e);if(t.signMessage)return t.signMessage({message:r});const s=typeof r=="string"?o.stringToHex(r):r.raw instanceof Uint8Array?o.toHex(r.raw):r.raw;return n.request({method:"personal_sign",params:[s,t.address]},{retryCount:0})}exports.signMessage=i;
package/dist/index111.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { parseAccount as e } from "./index45.js";
2
- import { AccountNotFoundError as i } from "./index254.js";
2
+ import { AccountNotFoundError as i } from "./index249.js";
3
3
  import { stringToHex as a, toHex as c } from "./index150.js";
4
4
  async function g(n, { account: o = n.account, message: r }) {
5
5
  if (!o)
package/dist/index112.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index45.cjs"),f=require("./index254.cjs"),C=require("./index212.cjs"),T=require("./index150.cjs"),m=require("./index184.cjs"),I=require("./index29.cjs"),w=require("./index197.cjs"),A=require("./index71.cjs");async function R(t,s){var i,u,d,h;const{account:o=t.account,chain:n=t.chain,...c}=s;if(!o)throw new f.AccountNotFoundError({docsPath:"/docs/actions/wallet/signTransaction"});const r=g.parseAccount(o);w.assertRequest({account:r,...s});const a=await I.getAction(t,A.getChainId,"getChainId")({});n!==null&&C.assertCurrentChain({currentChainId:a,chain:n});const e=(n==null?void 0:n.formatters)||((i=t.chain)==null?void 0:i.formatters),q=((u=e==null?void 0:e.transactionRequest)==null?void 0:u.format)||m.formatTransactionRequest;return r.signTransaction?r.signTransaction({...c,chainId:a},{serializer:(h=(d=t.chain)==null?void 0:d.serializers)==null?void 0:h.transaction}):await t.request({method:"eth_signTransaction",params:[{...q(c),chainId:T.numberToHex(a),from:r.address}]},{retryCount:0})}exports.signTransaction=R;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index45.cjs"),f=require("./index249.cjs"),C=require("./index212.cjs"),T=require("./index150.cjs"),m=require("./index184.cjs"),I=require("./index29.cjs"),w=require("./index197.cjs"),A=require("./index71.cjs");async function R(t,s){var i,u,d,h;const{account:o=t.account,chain:n=t.chain,...c}=s;if(!o)throw new f.AccountNotFoundError({docsPath:"/docs/actions/wallet/signTransaction"});const r=g.parseAccount(o);w.assertRequest({account:r,...s});const a=await I.getAction(t,A.getChainId,"getChainId")({});n!==null&&C.assertCurrentChain({currentChainId:a,chain:n});const e=(n==null?void 0:n.formatters)||((i=t.chain)==null?void 0:i.formatters),q=((u=e==null?void 0:e.transactionRequest)==null?void 0:u.format)||m.formatTransactionRequest;return r.signTransaction?r.signTransaction({...c,chainId:a},{serializer:(h=(d=t.chain)==null?void 0:d.serializers)==null?void 0:h.transaction}):await t.request({method:"eth_signTransaction",params:[{...q(c),chainId:T.numberToHex(a),from:r.address}]},{retryCount:0})}exports.signTransaction=R;
package/dist/index112.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { parseAccount as d } from "./index45.js";
2
- import { AccountNotFoundError as p } from "./index254.js";
2
+ import { AccountNotFoundError as p } from "./index249.js";
3
3
  import { assertCurrentChain as g } from "./index212.js";
4
4
  import { numberToHex as T } from "./index150.js";
5
5
  import { formatTransactionRequest as C } from "./index184.js";
package/dist/index113.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index45.cjs"),y=require("./index254.cjs"),s=require("./index188.cjs");async function p(c,r){const{account:i=c.account,domain:t,message:a,primaryType:e}=r;if(!i)throw new y.AccountNotFoundError({docsPath:"/docs/actions/wallet/signTypedData"});const n=u.parseAccount(i),o={EIP712Domain:s.getTypesForEIP712Domain({domain:t}),...r.types};if(s.validateTypedData({domain:t,message:a,primaryType:e,types:o}),n.signTypedData)return n.signTypedData({domain:t,message:a,primaryType:e,types:o});const d=s.serializeTypedData({domain:t,message:a,primaryType:e,types:o});return c.request({method:"eth_signTypedData_v4",params:[n.address,d]},{retryCount:0})}exports.signTypedData=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index45.cjs"),y=require("./index249.cjs"),s=require("./index188.cjs");async function p(c,r){const{account:i=c.account,domain:t,message:a,primaryType:e}=r;if(!i)throw new y.AccountNotFoundError({docsPath:"/docs/actions/wallet/signTypedData"});const n=u.parseAccount(i),o={EIP712Domain:s.getTypesForEIP712Domain({domain:t}),...r.types};if(s.validateTypedData({domain:t,message:a,primaryType:e,types:o}),n.signTypedData)return n.signTypedData({domain:t,message:a,primaryType:e,types:o});const d=s.serializeTypedData({domain:t,message:a,primaryType:e,types:o});return c.request({method:"eth_signTypedData_v4",params:[n.address,d]},{retryCount:0})}exports.signTypedData=p;
package/dist/index113.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { parseAccount as p } from "./index45.js";
2
- import { AccountNotFoundError as d } from "./index254.js";
2
+ import { AccountNotFoundError as d } from "./index249.js";
3
3
  import { getTypesForEIP712Domain as y, validateTypedData as m, serializeTypedData as u } from "./index188.js";
4
4
  async function f(r, s) {
5
5
  const { account: c = r.account, domain: t, message: a, primaryType: o } = s;
package/dist/index125.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="2.29.2";exports.version=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="2.31.6";exports.version=e;
package/dist/index125.js CHANGED
@@ -1,4 +1,4 @@
1
- const o = "2.29.2";
1
+ const o = "2.31.6";
2
2
  export {
3
3
  o as version
4
4
  };
package/dist/index166.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index122.cjs"),y=require("./index124.cjs"),A=require("./index167.cjs"),D=require("./index168.cjs"),b=require("./index158.cjs"),S=require("./index123.cjs"),h="/docs/contract/decodeEventLog";function q(n){const{abi:r,data:i,strict:p,topics:v}=n,m=p??!0,[u,...E]=v;if(!u)throw new a.AbiEventSignatureEmptyTopicsError({docsPath:h});const o=r.length===1?r[0]:r.find(e=>e.type==="event"&&u===A.toEventSelector(S.formatAbiItem(e)));if(!(o&&"name"in o)||o.type!=="event")throw new a.AbiEventSignatureNotFoundError(u,{docsPath:h});const{name:w,inputs:d}=o,f=d==null?void 0:d.some(e=>!("name"in e&&e.name));let c=f?[]:{};const g=d.filter(e=>"indexed"in e&&e.indexed);for(let e=0;e<g.length;e++){const t=g[e],l=E[e];if(!l)throw new a.DecodeLogTopicsMismatch({abiItem:o,param:t});c[f?e:t.name||e]=I({param:t,value:l})}const s=d.filter(e=>!("indexed"in e&&e.indexed));if(s.length>0){if(i&&i!=="0x")try{const e=b.decodeAbiParameters(s,i);if(e)if(f)c=[...c,...e];else for(let t=0;t<s.length;t++)c[s[t].name]=e[t]}catch(e){if(m)throw e instanceof a.AbiDecodingDataSizeTooSmallError||e instanceof D.PositionOutOfBoundsError?new a.DecodeLogDataMismatch({abiItem:o,data:i,params:s,size:y.size(i)}):e}else if(m)throw new a.DecodeLogDataMismatch({abiItem:o,data:"0x",params:s,size:0})}return{eventName:w,args:Object.values(c).length>0?c:void 0}}function I({param:n,value:r}){return n.type==="string"||n.type==="bytes"||n.type==="tuple"||n.type.match(/^(.*)\[(\d+)?\]$/)?r:(b.decodeAbiParameters([n],r)||[])[0]}exports.decodeEventLog=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index122.cjs"),A=require("./index124.cjs"),D=require("./index167.cjs"),S=require("./index168.cjs"),b=require("./index158.cjs"),I=require("./index123.cjs"),p="/docs/contract/decodeEventLog";function q(n){const{abi:d,data:i,strict:v,topics:E}=n,m=v??!0,[f,...w]=E;if(!f)throw new a.AbiEventSignatureEmptyTopicsError({docsPath:p});const o=d.find(e=>e.type==="event"&&f===D.toEventSelector(I.formatAbiItem(e)));if(!(o&&"name"in o)||o.type!=="event")throw new a.AbiEventSignatureNotFoundError(f,{docsPath:p});const{name:y,inputs:r}=o,u=r==null?void 0:r.some(e=>!("name"in e&&e.name)),c=u?[]:{},g=r.map((e,t)=>[e,t]).filter(([e])=>"indexed"in e&&e.indexed);for(let e=0;e<g.length;e++){const[t,l]=g[e],h=w[e];if(!h)throw new a.DecodeLogTopicsMismatch({abiItem:o,param:t});c[u?l:t.name||l]=L({param:t,value:h})}const s=r.filter(e=>!("indexed"in e&&e.indexed));if(s.length>0){if(i&&i!=="0x")try{const e=b.decodeAbiParameters(s,i);if(e)if(u)for(let t=0;t<r.length;t++)c[t]=c[t]??e.shift();else for(let t=0;t<s.length;t++)c[s[t].name]=e[t]}catch(e){if(m)throw e instanceof a.AbiDecodingDataSizeTooSmallError||e instanceof S.PositionOutOfBoundsError?new a.DecodeLogDataMismatch({abiItem:o,data:i,params:s,size:A.size(i)}):e}else if(m)throw new a.DecodeLogDataMismatch({abiItem:o,data:"0x",params:s,size:0})}return{eventName:y,args:Object.values(c).length>0?c:void 0}}function L({param:n,value:d}){return n.type==="string"||n.type==="bytes"||n.type==="tuple"||n.type.match(/^(.*)\[(\d+)?\]$/)?d:(b.decodeAbiParameters([n],d)||[])[0]}exports.decodeEventLog=q;
package/dist/index166.js CHANGED
@@ -1,65 +1,67 @@
1
- import { AbiEventSignatureEmptyTopicsError as y, AbiEventSignatureNotFoundError as A, DecodeLogTopicsMismatch as D, AbiDecodingDataSizeTooSmallError as x, DecodeLogDataMismatch as u } from "./index122.js";
2
- import { size as I } from "./index124.js";
3
- import { toEventSelector as S } from "./index167.js";
4
- import { PositionOutOfBoundsError as T } from "./index168.js";
5
- import { decodeAbiParameters as h } from "./index158.js";
6
- import { formatAbiItem as z } from "./index123.js";
7
- const l = "/docs/contract/decodeEventLog";
8
- function F(n) {
9
- const { abi: i, data: r, strict: w, topics: E } = n, m = w ?? !0, [a, ...b] = E;
1
+ import { AbiEventSignatureEmptyTopicsError as A, AbiEventSignatureNotFoundError as x, DecodeLogTopicsMismatch as D, AbiDecodingDataSizeTooSmallError as I, DecodeLogDataMismatch as l } from "./index122.js";
2
+ import { size as S } from "./index124.js";
3
+ import { toEventSelector as T } from "./index167.js";
4
+ import { PositionOutOfBoundsError as z } from "./index168.js";
5
+ import { decodeAbiParameters as w } from "./index158.js";
6
+ import { formatAbiItem as L } from "./index123.js";
7
+ const u = "/docs/contract/decodeEventLog";
8
+ function U(o) {
9
+ const { abi: d, data: i, strict: E, topics: b } = o, m = E ?? !0, [a, ...v] = b;
10
10
  if (!a)
11
- throw new y({ docsPath: l });
12
- const o = i.length === 1 ? i[0] : i.find((e) => e.type === "event" && a === S(z(e)));
13
- if (!(o && "name" in o) || o.type !== "event")
14
- throw new A(a, { docsPath: l });
15
- const { name: v, inputs: d } = o, f = d == null ? void 0 : d.some((e) => !("name" in e && e.name));
16
- let c = f ? [] : {};
17
- const p = d.filter((e) => "indexed" in e && e.indexed);
11
+ throw new A({ docsPath: u });
12
+ const n = d.find((e) => e.type === "event" && a === T(L(e)));
13
+ if (!(n && "name" in n) || n.type !== "event")
14
+ throw new x(a, { docsPath: u });
15
+ const { name: y, inputs: r } = n, f = r == null ? void 0 : r.some((e) => !("name" in e && e.name)), c = f ? [] : {}, p = r.map((e, t) => [e, t]).filter(([e]) => "indexed" in e && e.indexed);
18
16
  for (let e = 0; e < p.length; e++) {
19
- const t = p[e], g = b[e];
20
- if (!g)
17
+ const [t, g] = p[e], h = v[e];
18
+ if (!h)
21
19
  throw new D({
22
- abiItem: o,
20
+ abiItem: n,
23
21
  param: t
24
22
  });
25
- c[f ? e : t.name || e] = L({ param: t, value: g });
23
+ c[f ? g : t.name || g] = O({
24
+ param: t,
25
+ value: h
26
+ });
26
27
  }
27
- const s = d.filter((e) => !("indexed" in e && e.indexed));
28
+ const s = r.filter((e) => !("indexed" in e && e.indexed));
28
29
  if (s.length > 0) {
29
- if (r && r !== "0x")
30
+ if (i && i !== "0x")
30
31
  try {
31
- const e = h(s, r);
32
+ const e = w(s, i);
32
33
  if (e)
33
34
  if (f)
34
- c = [...c, ...e];
35
+ for (let t = 0; t < r.length; t++)
36
+ c[t] = c[t] ?? e.shift();
35
37
  else
36
38
  for (let t = 0; t < s.length; t++)
37
39
  c[s[t].name] = e[t];
38
40
  } catch (e) {
39
41
  if (m)
40
- throw e instanceof x || e instanceof T ? new u({
41
- abiItem: o,
42
- data: r,
42
+ throw e instanceof I || e instanceof z ? new l({
43
+ abiItem: n,
44
+ data: i,
43
45
  params: s,
44
- size: I(r)
46
+ size: S(i)
45
47
  }) : e;
46
48
  }
47
49
  else if (m)
48
- throw new u({
49
- abiItem: o,
50
+ throw new l({
51
+ abiItem: n,
50
52
  data: "0x",
51
53
  params: s,
52
54
  size: 0
53
55
  });
54
56
  }
55
57
  return {
56
- eventName: v,
58
+ eventName: y,
57
59
  args: Object.values(c).length > 0 ? c : void 0
58
60
  };
59
61
  }
60
- function L({ param: n, value: i }) {
61
- return n.type === "string" || n.type === "bytes" || n.type === "tuple" || n.type.match(/^(.*)\[(\d+)?\]$/) ? i : (h([n], i) || [])[0];
62
+ function O({ param: o, value: d }) {
63
+ return o.type === "string" || o.type === "bytes" || o.type === "tuple" || o.type.match(/^(.*)\[(\d+)?\]$/) ? d : (w([o], d) || [])[0];
62
64
  }
63
65
  export {
64
- F as decodeEventLog
66
+ U as decodeEventLog
65
67
  };
package/dist/index192.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("./index277.cjs"),n=require("./index278.cjs"),C=require("./index226.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const k=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),x=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),G=BigInt(1),w=BigInt(2),h=(t,f)=>(t+f/w)/f;function M(t){const f=k,e=BigInt(3),r=BigInt(6),p=BigInt(11),a=BigInt(22),s=BigInt(23),i=BigInt(44),d=BigInt(88),o=t*t*t%f,c=o*o*t%f,g=n.pow2(c,e,f)*c%f,b=n.pow2(g,e,f)*c%f,l=n.pow2(b,w,f)*o%f,B=n.pow2(l,p,f)*l%f,I=n.pow2(B,a,f)*B%f,_=n.pow2(I,i,f)*I%f,P=n.pow2(_,d,f)*_%f,S=n.pow2(P,i,f)*I%f,v=n.pow2(S,e,f)*c%f,E=n.pow2(v,s,f)*B%f,F=n.pow2(E,r,f)*o%f,q=n.pow2(F,w,f);if(!u.eql(u.sqr(q),t))throw new Error("Cannot find square root");return q}const u=n.Field(k,void 0,void 0,{sqrt:M}),m=j.createCurve({a:BigInt(0),b:BigInt(7),Fp:u,n:x,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const f=x,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-G*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),p=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=e,s=BigInt("0x100000000000000000000000000000000"),i=h(a*t,f),d=h(-r*t,f);let o=n.mod(t-i*e-d*p,f),c=n.mod(-i*r-d*a,f);const g=o>s,b=c>s;if(g&&(o=f-o),b&&(c=f-c),o>s||c>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:g,k1:o,k2neg:b,k2:c}}}},C.sha256);BigInt(0);m.ProjectivePoint;exports.secp256k1=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./index277.cjs"),F=require("./index278.cjs"),n=require("./index279.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const p={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")};BigInt(0);const P=BigInt(1),u=BigInt(2),h=(t,f)=>(t+f/u)/f;function G(t){const f=p.p,e=BigInt(3),a=BigInt(6),B=BigInt(11),r=BigInt(22),s=BigInt(23),i=BigInt(44),d=BigInt(88),o=t*t*t%f,c=o*o*t%f,b=n.pow2(c,e,f)*c%f,g=n.pow2(b,e,f)*c%f,_=n.pow2(g,u,f)*o%f,I=n.pow2(_,B,f)*_%f,w=n.pow2(I,r,f)*I%f,x=n.pow2(w,i,f)*w%f,k=n.pow2(x,d,f)*x%f,m=n.pow2(k,i,f)*w%f,S=n.pow2(m,e,f)*c%f,E=n.pow2(S,s,f)*I%f,v=n.pow2(E,a,f)*o%f,q=n.pow2(v,u,f);if(!l.eql(l.sqr(q),t))throw new Error("Cannot find square root");return q}const l=n.Field(p.p,void 0,void 0,{sqrt:G}),M=F.createCurve({...p,Fp:l,lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const f=p.n,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),a=-P*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),B=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),r=e,s=BigInt("0x100000000000000000000000000000000"),i=h(r*t,f),d=h(-a*t,f);let o=n.mod(t-i*e-d*B,f),c=n.mod(-i*a-d*r,f);const b=o>s,g=c>s;if(b&&(o=f-o),g&&(c=f-c),o>s||c>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:b,k1:o,k2neg:g,k2:c}}}},C.sha256);exports.secp256k1=M;
package/dist/index192.js CHANGED
@@ -1,40 +1,42 @@
1
- import { createCurve as C } from "./index277.js";
2
- import { Field as G, mod as k, pow2 as t } from "./index278.js";
3
- import { sha256 as N } from "./index226.js";
1
+ import { sha256 as v } from "./index277.js";
2
+ import { createCurve as G } from "./index278.js";
3
+ import { Field as P, mod as h, pow2 as t } from "./index279.js";
4
4
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
5
- const q = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"), w = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"), j = BigInt(1), _ = BigInt(2), h = (n, f) => (n + f / _) / f;
6
- function M(n) {
7
- const f = q, e = BigInt(3), r = BigInt(6), I = BigInt(11), a = BigInt(22), s = BigInt(23), i = BigInt(44), g = BigInt(88), o = n * n * n % f, c = o * o * n % f, d = t(c, e, f) * c % f, B = t(d, e, f) * c % f, m = t(B, _, f) * o % f, b = t(m, I, f) * m % f, p = t(b, a, f) * b % f, x = t(p, i, f) * p % f, P = t(x, g, f) * x % f, v = t(P, i, f) * p % f, E = t(v, e, f) * c % f, F = t(E, s, f) * b % f, S = t(F, r, f) * o % f, u = t(S, _, f);
8
- if (!l.eql(l.sqr(u), n))
9
- throw new Error("Cannot find square root");
10
- return u;
11
- }
12
- const l = G(q, void 0, void 0, { sqrt: M }), O = C({
5
+ const B = {
6
+ p: BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),
7
+ n: BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),
8
+ h: BigInt(1),
13
9
  a: BigInt(0),
14
10
  b: BigInt(7),
11
+ Gx: BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),
12
+ Gy: BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")
13
+ };
14
+ BigInt(0);
15
+ const M = BigInt(1), x = BigInt(2), k = (n, f) => (n + f / x) / f;
16
+ function N(n) {
17
+ const f = B.p, e = BigInt(3), a = BigInt(6), I = BigInt(11), b = BigInt(22), s = BigInt(23), i = BigInt(44), r = BigInt(88), c = n * n * n % f, o = c * c * n % f, d = t(o, e, f) * o % f, g = t(d, e, f) * o % f, m = t(g, x, f) * c % f, p = t(m, I, f) * m % f, _ = t(p, b, f) * p % f, u = t(_, i, f) * _ % f, q = t(u, r, f) * u % f, E = t(q, i, f) * _ % f, C = t(E, e, f) * o % f, F = t(C, s, f) * p % f, S = t(F, a, f) * c % f, w = t(S, x, f);
18
+ if (!l.eql(l.sqr(w), n))
19
+ throw new Error("Cannot find square root");
20
+ return w;
21
+ }
22
+ const l = P(B.p, void 0, void 0, { sqrt: N }), V = G({
23
+ ...B,
15
24
  Fp: l,
16
- n: w,
17
- Gx: BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),
18
- Gy: BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),
19
- h: BigInt(1),
20
- // Cofactor
21
25
  lowS: !0,
22
26
  // Allow only low-S signatures by default in sign() and verify()
23
27
  endo: {
24
28
  // Endomorphism, see above
25
29
  beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),
26
30
  splitScalar: (n) => {
27
- const f = w, e = BigInt("0x3086d221a7d46bcde86c90e49284eb15"), r = -j * BigInt("0xe4437ed6010e88286f547fa90abfe4c3"), I = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"), a = e, s = BigInt("0x100000000000000000000000000000000"), i = h(a * n, f), g = h(-r * n, f);
28
- let o = k(n - i * e - g * I, f), c = k(-i * r - g * a, f);
29
- const d = o > s, B = c > s;
30
- if (d && (o = f - o), B && (c = f - c), o > s || c > s)
31
+ const f = B.n, e = BigInt("0x3086d221a7d46bcde86c90e49284eb15"), a = -M * BigInt("0xe4437ed6010e88286f547fa90abfe4c3"), I = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"), b = e, s = BigInt("0x100000000000000000000000000000000"), i = k(b * n, f), r = k(-a * n, f);
32
+ let c = h(n - i * e - r * I, f), o = h(-i * a - r * b, f);
33
+ const d = c > s, g = o > s;
34
+ if (d && (c = f - c), g && (o = f - o), c > s || o > s)
31
35
  throw new Error("splitScalar: Endomorphism failed, k=" + n);
32
- return { k1neg: d, k1: o, k2neg: B, k2: c };
36
+ return { k1neg: d, k1: c, k2neg: g, k2: o };
33
37
  }
34
38
  }
35
- }, N);
36
- BigInt(0);
37
- O.ProjectivePoint;
39
+ }, v);
38
40
  export {
39
- O as secp256k1
41
+ V as secp256k1
40
42
  };
package/dist/index203.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index21.cjs"),y=require("./index128.cjs"),d=require("./index169.cjs"),c=require("./index175.cjs"),b=require("./index179.cjs"),h="x-batch-gateway:true";async function q(e){const{data:o,ccipRequest:n}=e,{args:[u]}=d.decodeFunctionData({abi:r.batchGatewayAbi,data:o}),a=[],s=[];return await Promise.all(u.map(async(i,t)=>{try{s[t]=await n(i),a[t]=!1}catch(l){a[t]=!0,s[t]=g(l)}})),b.encodeFunctionResult({abi:r.batchGatewayAbi,functionName:"query",result:[a,s]})}function g(e){return e.name==="HttpRequestError"&&e.status?c.encodeErrorResult({abi:r.batchGatewayAbi,errorName:"HttpError",args:[e.status,e.shortMessage]}):c.encodeErrorResult({abi:[y.solidityError],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}exports.localBatchGatewayRequest=q;exports.localBatchGatewayUrl=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index21.cjs"),y=require("./index128.cjs"),h=require("./index169.cjs"),n=require("./index175.cjs"),w=require("./index179.cjs"),u="x-batch-gateway:true";async function i(t){const{data:l,ccipRequest:o}=t,{args:[d]}=h.decodeFunctionData({abi:c.batchGatewayAbi,data:l}),a=[],s=[];return await Promise.all(d.map(async(r,e)=>{try{s[e]=r.urls.includes(u)?await i({data:r.data,ccipRequest:o}):await o(r),a[e]=!1}catch(b){a[e]=!0,s[e]=g(b)}})),w.encodeFunctionResult({abi:c.batchGatewayAbi,functionName:"query",result:[a,s]})}function g(t){return t.name==="HttpRequestError"&&t.status?n.encodeErrorResult({abi:c.batchGatewayAbi,errorName:"HttpError",args:[t.status,t.shortMessage]}):n.encodeErrorResult({abi:[y.solidityError],errorName:"Error",args:["shortMessage"in t?t.shortMessage:t.message]})}exports.localBatchGatewayRequest=i;exports.localBatchGatewayUrl=u;
package/dist/index203.js CHANGED
@@ -1,35 +1,35 @@
1
- import { batchGatewayAbi as s } from "./index21.js";
1
+ import { batchGatewayAbi as o } from "./index21.js";
2
2
  import { solidityError as l } from "./index128.js";
3
3
  import { decodeFunctionData as f } from "./index169.js";
4
- import { encodeErrorResult as o } from "./index175.js";
4
+ import { encodeErrorResult as n } from "./index175.js";
5
5
  import { encodeFunctionResult as p } from "./index179.js";
6
- const E = "x-batch-gateway:true";
7
- async function q(t) {
8
- const { data: c, ccipRequest: n } = t, { args: [i] } = f({ abi: s, data: c }), e = [], r = [];
9
- return await Promise.all(i.map(async (u, a) => {
6
+ const d = "x-batch-gateway:true";
7
+ async function g(t) {
8
+ const { data: i, ccipRequest: c } = t, { args: [u] } = f({ abi: o, data: i }), e = [], s = [];
9
+ return await Promise.all(u.map(async (r, a) => {
10
10
  try {
11
- r[a] = await n(u), e[a] = !1;
11
+ s[a] = r.urls.includes(d) ? await g({ data: r.data, ccipRequest: c }) : await c(r), e[a] = !1;
12
12
  } catch (m) {
13
- e[a] = !0, r[a] = y(m);
13
+ e[a] = !0, s[a] = h(m);
14
14
  }
15
15
  })), p({
16
- abi: s,
16
+ abi: o,
17
17
  functionName: "query",
18
- result: [e, r]
18
+ result: [e, s]
19
19
  });
20
20
  }
21
- function y(t) {
22
- return t.name === "HttpRequestError" && t.status ? o({
23
- abi: s,
21
+ function h(t) {
22
+ return t.name === "HttpRequestError" && t.status ? n({
23
+ abi: o,
24
24
  errorName: "HttpError",
25
25
  args: [t.status, t.shortMessage]
26
- }) : o({
26
+ }) : n({
27
27
  abi: [l],
28
28
  errorName: "Error",
29
29
  args: ["shortMessage" in t ? t.shortMessage : t.message]
30
30
  });
31
31
  }
32
32
  export {
33
- q as localBatchGatewayRequest,
34
- E as localBatchGatewayUrl
33
+ g as localBatchGatewayRequest,
34
+ d as localBatchGatewayUrl
35
35
  };
package/dist/index22.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index192.cjs"),u=require("./index150.cjs"),a=require("./index230.cjs"),g=require("./index190.cjs"),y=require("./index231.cjs"),d=require("./index232.cjs"),T=require("./index233.cjs"),l=require("./index234.cjs"),q=require("./index235.cjs");function A(s,t={}){const{nonceManager:c}=t,e=u.toHex(i.secp256k1.getPublicKey(s.slice(2),!1)),o=g.publicKeyToAddress(e);return{...a.toAccount({address:o,nonceManager:c,async sign({hash:n}){return y.sign({hash:n,privateKey:s,to:"hex"})},async signAuthorization(n){return d.signAuthorization({...n,privateKey:s})},async signMessage({message:n}){return T.signMessage({message:n,privateKey:s})},async signTransaction(n,{serializer:r}={}){return l.signTransaction({privateKey:s,transaction:n,serializer:r})},async signTypedData(n){return q.signTypedData({...n,privateKey:s})}}),publicKey:e,source:"privateKey"}}exports.privateKeyToAccount=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index192.cjs"),u=require("./index150.cjs"),a=require("./index251.cjs"),g=require("./index190.cjs"),y=require("./index252.cjs"),d=require("./index253.cjs"),T=require("./index254.cjs"),l=require("./index255.cjs"),q=require("./index256.cjs");function A(s,t={}){const{nonceManager:c}=t,e=u.toHex(i.secp256k1.getPublicKey(s.slice(2),!1)),o=g.publicKeyToAddress(e);return{...a.toAccount({address:o,nonceManager:c,async sign({hash:n}){return y.sign({hash:n,privateKey:s,to:"hex"})},async signAuthorization(n){return d.signAuthorization({...n,privateKey:s})},async signMessage({message:n}){return T.signMessage({message:n,privateKey:s})},async signTransaction(n,{serializer:r}={}){return l.signTransaction({privateKey:s,transaction:n,serializer:r})},async signTypedData(n){return q.signTypedData({...n,privateKey:s})}}),publicKey:e,source:"privateKey"}}exports.privateKeyToAccount=A;
package/dist/index22.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { secp256k1 as e } from "./index192.js";
2
2
  import { toHex as a } from "./index150.js";
3
- import { toAccount as m } from "./index230.js";
3
+ import { toAccount as m } from "./index251.js";
4
4
  import { publicKeyToAddress as u } from "./index190.js";
5
- import { sign as g } from "./index231.js";
6
- import { signAuthorization as p } from "./index232.js";
7
- import { signMessage as f } from "./index233.js";
8
- import { signTransaction as y } from "./index234.js";
9
- import { signTypedData as d } from "./index235.js";
5
+ import { sign as g } from "./index252.js";
6
+ import { signAuthorization as p } from "./index253.js";
7
+ import { signMessage as f } from "./index254.js";
8
+ import { signTransaction as y } from "./index255.js";
9
+ import { signTypedData as d } from "./index256.js";
10
10
  function H(n, t = {}) {
11
11
  const { nonceManager: s } = t, r = a(e.getPublicKey(n.slice(2), !1)), c = u(r);
12
12
  return {
package/dist/index222.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index279.cjs"),r=require("./index280.cjs");function n(t){return e.hashSignature(r.toSignature(t))}exports.toSignatureHash=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index280.cjs"),r=require("./index281.cjs");function n(t){return e.hashSignature(r.toSignature(t))}exports.toSignatureHash=n;
package/dist/index222.js CHANGED
@@ -1,5 +1,5 @@
1
- import { hashSignature as t } from "./index279.js";
2
- import { toSignature as o } from "./index280.js";
1
+ import { hashSignature as t } from "./index280.js";
2
+ import { toSignature as o } from "./index281.js";
3
3
  function a(r) {
4
4
  return t(o(r));
5
5
  }