@gardenfi/utils 2.1.3-beta.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/dist/index102.cjs +1 -1
  2. package/dist/index102.js +8 -12
  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 +26 -38
  7. package/dist/index108.cjs +1 -1
  8. package/dist/index108.js +43 -45
  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/index189.cjs +1 -1
  22. package/dist/index189.js +2 -2
  23. package/dist/index191.cjs +1 -1
  24. package/dist/index191.js +15 -19
  25. package/dist/index22.cjs +1 -1
  26. package/dist/index22.js +6 -6
  27. package/dist/index23.cjs +1 -1
  28. package/dist/index23.js +13 -31
  29. package/dist/index230.cjs +1 -1
  30. package/dist/index230.js +10 -25
  31. package/dist/index231.cjs +1 -1
  32. package/dist/index231.js +16 -13
  33. package/dist/index232.cjs +1 -1
  34. package/dist/index232.js +21 -14
  35. package/dist/index233.cjs +1 -1
  36. package/dist/index233.js +2 -6
  37. package/dist/index234.cjs +1 -1
  38. package/dist/index234.js +12 -12
  39. package/dist/index235.cjs +1 -1
  40. package/dist/index235.js +12 -10
  41. package/dist/index236.cjs +1 -1
  42. package/dist/index236.js +46 -15
  43. package/dist/index237.cjs +1 -1
  44. package/dist/index237.js +11 -10
  45. package/dist/index238.cjs +1 -1
  46. package/dist/index238.js +7 -16
  47. package/dist/index239.cjs +1 -1
  48. package/dist/index239.js +8 -21
  49. package/dist/index24.cjs +1 -1
  50. package/dist/index24.js +58 -32
  51. package/dist/index240.cjs +1 -1
  52. package/dist/index240.js +13 -30
  53. package/dist/index241.cjs +1 -1
  54. package/dist/index241.js +15 -2
  55. package/dist/index242.cjs +1 -1
  56. package/dist/index242.js +9 -13
  57. package/dist/index243.cjs +1 -1
  58. package/dist/index243.js +30 -12
  59. package/dist/index244.cjs +1 -1
  60. package/dist/index244.js +24 -47
  61. package/dist/index245.cjs +1 -1
  62. package/dist/index245.js +12 -11
  63. package/dist/index246.cjs +1 -1
  64. package/dist/index246.js +24 -7
  65. package/dist/index247.cjs +2 -1
  66. package/dist/index247.js +24 -9
  67. package/dist/index248.cjs +1 -1
  68. package/dist/index248.js +10 -10
  69. package/dist/index249.cjs +1 -1
  70. package/dist/index249.js +15 -14
  71. package/dist/index25.cjs +16 -1
  72. package/dist/index25.js +113 -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/index26.cjs +1 -1
  90. package/dist/index26.js +32 -58
  91. package/dist/index266.cjs +1 -1
  92. package/dist/index266.js +1 -1
  93. package/dist/index27.cjs +1 -1
  94. package/dist/index27.js +31 -13
  95. package/dist/index275.cjs +1 -1
  96. package/dist/index275.js +6 -7
  97. package/dist/index277.cjs +1 -1
  98. package/dist/index277.js +2 -2
  99. package/dist/index278.cjs +1 -1
  100. package/dist/index278.js +1 -1
  101. package/dist/index28.cjs +1 -16
  102. package/dist/index28.js +11 -113
  103. package/dist/index284.cjs +1 -1
  104. package/dist/index284.js +1 -1
  105. package/dist/index286.cjs +1 -1
  106. package/dist/index286.js +3 -40
  107. package/dist/index287.cjs +1 -1
  108. package/dist/index287.js +141 -2
  109. package/dist/index288.cjs +1 -1
  110. package/dist/index288.js +148 -199
  111. package/dist/index289.cjs +1 -1
  112. package/dist/index289.js +9 -3
  113. package/dist/index290.cjs +1 -1
  114. package/dist/index290.js +103 -130
  115. package/dist/index291.cjs +2 -1
  116. package/dist/index291.js +102 -123
  117. package/dist/index292.cjs +1 -1
  118. package/dist/index292.js +11 -9
  119. package/dist/index293.cjs +1 -1
  120. package/dist/index293.js +18 -112
  121. package/dist/index294.cjs +1 -2
  122. package/dist/index294.js +24 -130
  123. package/dist/index295.cjs +1 -1
  124. package/dist/index295.js +37 -10
  125. package/dist/index296.cjs +1 -1
  126. package/dist/index296.js +68 -19
  127. package/dist/index297.cjs +1 -1
  128. package/dist/index297.js +2 -69
  129. package/dist/index298.cjs +1 -1
  130. package/dist/index298.js +39 -641
  131. package/dist/index299.cjs +1 -1
  132. package/dist/index299.js +620 -150
  133. package/dist/index3.cjs +1 -1
  134. package/dist/index3.js +1 -1
  135. package/dist/index30.cjs +1 -1
  136. package/dist/index30.js +1 -1
  137. package/dist/index300.cjs +1 -2
  138. package/dist/index300.js +203 -63
  139. package/dist/index301.cjs +1 -1
  140. package/dist/index301.js +172 -4
  141. package/dist/index302.cjs +2 -1
  142. package/dist/index302.js +65 -39
  143. package/dist/index303.cjs +1 -1
  144. package/dist/index303.js +4 -7
  145. package/dist/index304.cjs +1 -1
  146. package/dist/index304.js +38 -60
  147. package/dist/index305.cjs +1 -1
  148. package/dist/index305.js +7 -77
  149. package/dist/index306.cjs +1 -1
  150. package/dist/index306.js +63 -4
  151. package/dist/index307.cjs +1 -1
  152. package/dist/index307.js +64 -181
  153. package/dist/index308.cjs +1 -1
  154. package/dist/index308.js +4 -64
  155. package/dist/index309.cjs +1 -1
  156. package/dist/index309.js +194 -44
  157. package/dist/index310.cjs +1 -1
  158. package/dist/index310.js +18 -4
  159. package/dist/index311.cjs +1 -1
  160. package/dist/index311.js +58 -99
  161. package/dist/index312.cjs +1 -1
  162. package/dist/index312.js +45 -5
  163. package/dist/index313.cjs +1 -1
  164. package/dist/index313.js +5 -2
  165. package/dist/index314.cjs +1 -1
  166. package/dist/index314.js +103 -18
  167. package/dist/index315.cjs +1 -1
  168. package/dist/index315.js +5 -72
  169. package/dist/index316.cjs +1 -1
  170. package/dist/index316.js +2 -22
  171. package/dist/index317.cjs +1 -0
  172. package/dist/index317.js +24 -0
  173. package/dist/index36.cjs +1 -1
  174. package/dist/index36.js +1 -1
  175. package/dist/index53.cjs +1 -1
  176. package/dist/index53.js +2 -2
  177. package/dist/index54.cjs +1 -1
  178. package/dist/index54.js +1 -1
  179. package/dist/index55.cjs +1 -1
  180. package/dist/index55.js +2 -2
  181. package/dist/index56.cjs +1 -1
  182. package/dist/index56.js +1 -1
  183. package/dist/index57.cjs +1 -1
  184. package/dist/index57.js +2 -2
  185. package/dist/index58.cjs +1 -1
  186. package/dist/index58.js +111 -114
  187. package/dist/index59.cjs +1 -1
  188. package/dist/index59.js +11 -11
  189. package/dist/index60.cjs +1 -1
  190. package/dist/index60.js +1 -1
  191. package/dist/index61.cjs +1 -1
  192. package/dist/index61.js +1 -1
  193. package/dist/index62.cjs +1 -1
  194. package/dist/index62.js +1 -1
  195. package/dist/index64.cjs +1 -1
  196. package/dist/index64.js +26 -26
  197. package/dist/index66.cjs +1 -1
  198. package/dist/index66.js +3 -3
  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 +8 -8
  203. package/dist/index79.cjs +1 -1
  204. package/dist/index79.js +1 -1
  205. package/dist/index83.cjs +1 -1
  206. package/dist/index83.js +3 -8
  207. package/dist/index85.cjs +1 -1
  208. package/dist/index85.js +19 -19
  209. package/dist/index86.cjs +1 -1
  210. package/dist/index86.js +2 -2
  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/index9.cjs +1 -1
  216. package/dist/index9.js +4 -4
  217. package/dist/index92.cjs +1 -1
  218. package/dist/index92.js +27 -27
  219. package/dist/index95.cjs +1 -1
  220. package/dist/index95.js +1 -1
  221. package/dist/index98.cjs +1 -1
  222. package/dist/index98.js +1 -1
  223. package/dist/src/lib/utils.d.ts +1 -2
  224. package/package.json +1 -1
package/dist/index102.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index45.cjs"),p=require("./index150.cjs");async function f(s,c={}){const{account:n=s.account,chainId:t}=c,e=n?l.parseAccount(n):void 0,o=t?[e==null?void 0:e.address,[p.numberToHex(t)]]:[e==null?void 0:e.address],u=await s.request({method:"wallet_getCapabilities",params:o}),a={};for(const[r,b]of Object.entries(u)){a[Number(r)]={};for(let[i,d]of Object.entries(b))i==="addSubAccount"&&(i="unstable_addSubAccount"),a[Number(r)][i]=d}return typeof t=="number"?a[t]:a}exports.getCapabilities=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index45.cjs");async function b(a,c={}){const{account:i=a.account,chainId:s}=c,e=i?u.parseAccount(i):void 0,n=await a.request({method:"wallet_getCapabilities",params:[e==null?void 0:e.address]}),t={};for(const[o,r]of Object.entries(n))t[Number(o)]=r;return typeof s=="number"?t[s]:t}exports.getCapabilities=b;
package/dist/index102.js CHANGED
@@ -1,17 +1,13 @@
1
1
  import { parseAccount as p } from "./index45.js";
2
- import { numberToHex as f } from "./index150.js";
3
- async function h(s, n = {}) {
4
- const { account: o = s.account, chainId: t } = n, e = o ? p(o) : void 0, c = t ? [e == null ? void 0 : e.address, [f(t)]] : [e == null ? void 0 : e.address], b = await s.request({
2
+ async function b(a, n = {}) {
3
+ const { account: i = a.account, chainId: s } = n, e = i ? p(i) : void 0, o = await a.request({
5
4
  method: "wallet_getCapabilities",
6
- params: c
7
- }), a = {};
8
- for (const [r, u] of Object.entries(b)) {
9
- a[Number(r)] = {};
10
- for (let [i, d] of Object.entries(u))
11
- i === "addSubAccount" && (i = "unstable_addSubAccount"), a[Number(r)][i] = d;
12
- }
13
- return typeof t == "number" ? a[t] : a;
5
+ params: [e == null ? void 0 : e.address]
6
+ }), t = {};
7
+ for (const [c, r] of Object.entries(o))
8
+ t[Number(c)] = r;
9
+ return typeof s == "number" ? t[s] : t;
14
10
  }
15
11
  export {
16
- h as getCapabilities
12
+ b as getCapabilities
17
13
  };
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("./index247.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 "./index247.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 h=require("./index45.cjs"),m=require("./index247.cjs"),b=require("./index177.cjs"),r=require("./index150.cjs"),p=require("./index248.cjs");async function g(a,t){const{account:c=a.account,capabilities:i,chain:s=a.chain,forceAtomic:u=!1,id:d,version:l="2.0.0"}=t;if(typeof c>"u")throw new m.AccountNotFoundError({docsPath:"/experimental/eip5792/sendCalls"});const o=c?h.parseAccount(c):null,f=t.calls.map(e=>{const n=e;return{data:n.abi?b.encodeFunctionData({abi:n.abi,functionName:n.functionName,args:n.args}):n.data,to:n.to,value:n.value?r.numberToHex(n.value):void 0}});try{const e=await a.request({method:"wallet_sendCalls",params:[{atomicRequired:u,calls:f,capabilities:i,chainId:r.numberToHex(s.id),from:o==null?void 0:o.address,id:d,version:l}]},{retryCount:0});return typeof e=="string"?{id:e}:e}catch(e){throw p.getTransactionError(e,{...t,account:o,chain:t.chain})}}exports.sendCalls=g;
package/dist/index107.js CHANGED
@@ -1,62 +1,50 @@
1
1
  import { parseAccount as m } from "./index45.js";
2
- import { AccountNotFoundError as l } from "./index254.js";
2
+ import { AccountNotFoundError as p } from "./index247.js";
3
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;
4
+ import { numberToHex as c } from "./index150.js";
5
+ import { getTransactionError as b } from "./index248.js";
6
+ async function A(r, n) {
7
+ const { account: e = r.account, capabilities: i, chain: s = r.chain, forceAtomic: u = !1, id: d, version: l = "2.0.0" } = n;
8
8
  if (typeof e > "u")
9
- throw new l({
10
- docsPath: "/docs/actions/wallet/sendCalls"
9
+ throw new p({
10
+ docsPath: "/experimental/eip5792/sendCalls"
11
11
  });
12
- const a = e ? m(e) : null, f = n.calls.map((r) => {
13
- const t = r;
12
+ const a = e ? m(e) : null, f = n.calls.map((t) => {
13
+ const o = t;
14
14
  return {
15
- data: t.abi ? h({
16
- abi: t.abi,
17
- functionName: t.functionName,
18
- args: t.args
19
- }) : t.data,
20
- to: t.to,
21
- value: t.value ? u(t.value) : void 0
15
+ data: o.abi ? h({
16
+ abi: o.abi,
17
+ functionName: o.functionName,
18
+ args: o.args
19
+ }) : o.data,
20
+ to: o.to,
21
+ value: o.value ? c(o.value) : void 0
22
22
  };
23
23
  });
24
24
  try {
25
- const r = await o.request({
25
+ const t = await r.request({
26
26
  method: "wallet_sendCalls",
27
27
  params: [
28
28
  {
29
- atomicRequired: s,
29
+ atomicRequired: u,
30
30
  calls: f,
31
- capabilities: y(n.capabilities),
32
- chainId: u(c.id),
31
+ capabilities: i,
32
+ chainId: c(s.id),
33
33
  from: a == null ? void 0 : a.address,
34
- id: i,
35
- version: d
34
+ id: d,
35
+ version: l
36
36
  }
37
37
  ]
38
38
  }, { retryCount: 0 });
39
- return typeof r == "string" ? { id: r } : r;
40
- } catch (r) {
41
- throw p(r, {
39
+ return typeof t == "string" ? { id: t } : t;
40
+ } catch (t) {
41
+ throw b(t, {
42
42
  ...n,
43
43
  account: a,
44
44
  chain: n.chain
45
45
  });
46
46
  }
47
47
  }
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
48
  export {
61
- q as sendCalls
49
+ A as sendCalls
62
50
  };
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 _=require("./index45.cjs"),u=require("./index247.cjs"),G=require("./index38.cjs"),O=require("./index239.cjs"),j=require("./index212.cjs"),B=require("./index248.cjs"),U=require("./index235.cjs"),W=require("./index184.cjs"),l=require("./index29.cjs"),k=require("./index220.cjs"),D=require("./index197.cjs"),H=require("./index71.cjs"),x=require("./index96.cjs"),J=require("./index97.cjs"),f=new k.LruMap(128);async function K(t,e){var P,M,z,I;const{account:d=t.account,chain:n=t.chain,accessList:w,authorizationList:s,blobs:q,data:m,gas:T,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:R,maxPriorityFeePerGas:A,nonce:E,value:C,...N}=e;if(typeof d>"u")throw new u.AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransaction"});const r=d?_.parseAccount(d):null;try{D.assertRequest(e);const a=await(async()=>{if(e.to)return e.to;if(e.to!==null&&s&&s.length>0)return await O.recoverAuthorizationAddress({authorization:s[0]}).catch(()=>{throw new G.BaseError("`to` is required. Could not infer from `authorizationList`.")})})();if((r==null?void 0:r.type)==="json-rpc"||r===null){let i;n!==null&&(i=await l.getAction(t,H.getChainId,"getChainId")({}),j.assertCurrentChain({currentChainId:i,chain:n}));const c=(z=(M=(P=t.chain)==null?void 0:P.formatters)==null?void 0:M.transactionRequest)==null?void 0:z.format,b=(c||W.formatTransactionRequest)({...U.extract(N,{format:c}),accessList:w,authorizationList:s,blobs:q,chainId:i,data:m,from:r==null?void 0:r.address,gas:T,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:R,maxPriorityFeePerGas:A,nonce:E,to:a,value:C}),F=f.get(t.uid),L=F?"wallet_sendTransaction":"eth_sendTransaction";try{return await t.request({method:L,params:[b]},{retryCount:0})}catch(v){if(F===!1)throw v;const o=v;if(o.name==="InvalidInputRpcError"||o.name==="InvalidParamsRpcError"||o.name==="MethodNotFoundRpcError"||o.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[b]},{retryCount:0}).then(p=>(f.set(t.uid,!0),p)).catch(p=>{const h=p;throw h.name==="MethodNotFoundRpcError"||h.name==="MethodNotSupportedRpcError"?(f.set(t.uid,!1),o):h});throw o}}if((r==null?void 0:r.type)==="local"){const i=await l.getAction(t,x.prepareTransactionRequest,"prepareTransactionRequest")({account:r,accessList:w,authorizationList:s,blobs:q,chain:n,data:m,gas:T,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:R,maxPriorityFeePerGas:A,nonce:E,nonceManager:r.nonceManager,parameters:[...x.defaultParameters,"sidecars"],value:C,...N,to:a}),c=(I=n==null?void 0:n.serializers)==null?void 0:I.transaction,S=await r.signTransaction(i,{serializer:c});return await l.getAction(t,J.sendRawTransaction,"sendRawTransaction")({serializedTransaction:S})}throw(r==null?void 0:r.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:r==null?void 0:r.type})}catch(a){throw a instanceof u.AccountTypeNotSupportedError?a:B.getTransactionError(a,{...e,account:r,chain:e.chain||void 0})}}exports.sendTransaction=K;
package/dist/index108.js CHANGED
@@ -1,47 +1,47 @@
1
- import { parseAccount as _ } from "./index45.js";
2
- import { AccountNotFoundError as G, AccountTypeNotSupportedError as p } from "./index254.js";
3
- import { BaseError as B } from "./index38.js";
4
- import { recoverAuthorizationAddress as O } from "./index247.js";
5
- import { assertCurrentChain as U } from "./index212.js";
6
- import { getTransactionError as W } from "./index255.js";
7
- import { extract as j } from "./index243.js";
8
- import { formatTransactionRequest as k } from "./index184.js";
1
+ import { parseAccount as S } from "./index45.js";
2
+ import { AccountNotFoundError as _, AccountTypeNotSupportedError as p } from "./index247.js";
3
+ import { BaseError as G } from "./index38.js";
4
+ import { recoverAuthorizationAddress as B } from "./index239.js";
5
+ import { assertCurrentChain as O } from "./index212.js";
6
+ import { getTransactionError as U } from "./index248.js";
7
+ import { extract as W } from "./index235.js";
8
+ import { formatTransactionRequest as j } from "./index184.js";
9
9
  import { getAction as f } from "./index29.js";
10
- import { LruMap as D } from "./index220.js";
11
- import { assertRequest as H } from "./index197.js";
12
- import { getChainId as J } from "./index71.js";
13
- import { prepareTransactionRequest as K, defaultParameters as Q } from "./index96.js";
14
- import { sendRawTransaction as V } from "./index97.js";
15
- const h = new D(128);
16
- async function mr(t, o) {
17
- var z, A, F, I;
18
- const { account: d = t.account, chain: e = t.chain, accessList: w, authorizationList: s, blobs: l, data: y, gas: T, gasPrice: g, maxFeePerBlobGas: R, maxFeePerGas: E, maxPriorityFeePerGas: q, nonce: P, type: C, value: N, ...M } = o;
10
+ import { LruMap as k } from "./index220.js";
11
+ import { assertRequest as D } from "./index197.js";
12
+ import { getChainId as H } from "./index71.js";
13
+ import { prepareTransactionRequest as J, defaultParameters as K } from "./index96.js";
14
+ import { sendRawTransaction as Q } from "./index97.js";
15
+ const h = new k(128);
16
+ async function dr(t, o) {
17
+ var M, z, A, F;
18
+ const { account: d = t.account, chain: e = t.chain, accessList: w, authorizationList: s, blobs: l, data: y, gas: T, gasPrice: g, maxFeePerBlobGas: R, maxFeePerGas: E, maxPriorityFeePerGas: q, nonce: P, value: C, ...N } = o;
19
19
  if (typeof d > "u")
20
- throw new G({
20
+ throw new _({
21
21
  docsPath: "/docs/actions/wallet/sendTransaction"
22
22
  });
23
- const r = d ? _(d) : null;
23
+ const r = d ? S(d) : null;
24
24
  try {
25
- H(o);
25
+ D(o);
26
26
  const a = await (async () => {
27
27
  if (o.to)
28
28
  return o.to;
29
29
  if (o.to !== null && s && s.length > 0)
30
- return await O({
30
+ return await B({
31
31
  authorization: s[0]
32
32
  }).catch(() => {
33
- throw new B("`to` is required. Could not infer from `authorizationList`.");
33
+ throw new G("`to` is required. Could not infer from `authorizationList`.");
34
34
  });
35
35
  })();
36
36
  if ((r == null ? void 0 : r.type) === "json-rpc" || r === null) {
37
37
  let i;
38
- e !== null && (i = await f(t, J, "getChainId")({}), U({
38
+ e !== null && (i = await f(t, H, "getChainId")({}), O({
39
39
  currentChainId: i,
40
40
  chain: e
41
41
  }));
42
- const c = (F = (A = (z = t.chain) == null ? void 0 : z.formatters) == null ? void 0 : A.transactionRequest) == null ? void 0 : F.format, b = (c || k)({
42
+ const c = (A = (z = (M = t.chain) == null ? void 0 : M.formatters) == null ? void 0 : z.transactionRequest) == null ? void 0 : A.format, x = (c || j)({
43
43
  // Pick out extra data that might exist on the chain's transaction request type.
44
- ...j(M, { format: c }),
44
+ ...W(N, { format: c }),
45
45
  accessList: w,
46
46
  authorizationList: s,
47
47
  blobs: l,
@@ -55,22 +55,21 @@ async function mr(t, o) {
55
55
  maxPriorityFeePerGas: q,
56
56
  nonce: P,
57
57
  to: a,
58
- type: C,
59
- value: N
60
- }), v = h.get(t.uid), S = v ? "wallet_sendTransaction" : "eth_sendTransaction";
58
+ value: C
59
+ }), b = h.get(t.uid), L = b ? "wallet_sendTransaction" : "eth_sendTransaction";
61
60
  try {
62
61
  return await t.request({
63
- method: S,
64
- params: [b]
62
+ method: L,
63
+ params: [x]
65
64
  }, { retryCount: 0 });
66
- } catch (L) {
67
- if (v === !1)
68
- throw L;
69
- const n = L;
65
+ } catch (v) {
66
+ if (b === !1)
67
+ throw v;
68
+ const n = v;
70
69
  if (n.name === "InvalidInputRpcError" || n.name === "InvalidParamsRpcError" || n.name === "MethodNotFoundRpcError" || n.name === "MethodNotSupportedRpcError")
71
70
  return await t.request({
72
71
  method: "wallet_sendTransaction",
73
- params: [b]
72
+ params: [x]
74
73
  }, { retryCount: 0 }).then((m) => (h.set(t.uid, !0), m)).catch((m) => {
75
74
  const u = m;
76
75
  throw u.name === "MethodNotFoundRpcError" || u.name === "MethodNotSupportedRpcError" ? (h.set(t.uid, !1), n) : u;
@@ -79,7 +78,7 @@ async function mr(t, o) {
79
78
  }
80
79
  }
81
80
  if ((r == null ? void 0 : r.type) === "local") {
82
- const i = await f(t, K, "prepareTransactionRequest")({
81
+ const i = await f(t, J, "prepareTransactionRequest")({
83
82
  account: r,
84
83
  accessList: w,
85
84
  authorizationList: s,
@@ -93,16 +92,15 @@ async function mr(t, o) {
93
92
  maxPriorityFeePerGas: q,
94
93
  nonce: P,
95
94
  nonceManager: r.nonceManager,
96
- parameters: [...Q, "sidecars"],
97
- type: C,
98
- value: N,
99
- ...M,
95
+ parameters: [...K, "sidecars"],
96
+ value: C,
97
+ ...N,
100
98
  to: a
101
- }), c = (I = e == null ? void 0 : e.serializers) == null ? void 0 : I.transaction, x = await r.signTransaction(i, {
99
+ }), c = (F = e == null ? void 0 : e.serializers) == null ? void 0 : F.transaction, I = await r.signTransaction(i, {
102
100
  serializer: c
103
101
  });
104
- return await f(t, V, "sendRawTransaction")({
105
- serializedTransaction: x
102
+ return await f(t, Q, "sendRawTransaction")({
103
+ serializedTransaction: I
106
104
  });
107
105
  }
108
106
  throw (r == null ? void 0 : r.type) === "smart" ? new p({
@@ -116,7 +114,7 @@ async function mr(t, o) {
116
114
  type: r == null ? void 0 : r.type
117
115
  });
118
116
  } catch (a) {
119
- throw a instanceof p ? a : W(a, {
117
+ throw a instanceof p ? a : U(a, {
120
118
  ...o,
121
119
  account: r,
122
120
  chain: o.chain || void 0
@@ -124,5 +122,5 @@ async function mr(t, o) {
124
122
  }
125
123
  }
126
124
  export {
127
- mr as sendTransaction
125
+ dr as sendTransaction
128
126
  };
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("./index247.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 "./index247.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("./index247.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 "./index247.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("./index247.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 "./index247.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("./index247.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 "./index247.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.28.0";exports.version=e;
package/dist/index125.js CHANGED
@@ -1,4 +1,4 @@
1
- const o = "2.29.2";
1
+ const o = "2.28.0";
2
2
  export {
3
3
  o as version
4
4
  };
package/dist/index15.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index17.cjs"),a=require("./index23.cjs"),s=require("./index24.cjs"),l=require("./index25.cjs"),b=require("./index26.cjs"),n={42161:s.mainnet,421614:a.sepolia},h=async e=>{const{chain:t}=e;if(!t)return r.Err("No chain found");const o=(u=>u in n)(t.id)?n[t.id]:t;return await i(o)},i=async e=>{const t=l.createPublicClient({chain:e,transport:b.http()});try{const c=await t.getBlockNumber();return r.Ok(Number(c))}catch(c){return r.Err("Failed to fetch evm block number",c)}},m=async e=>{try{const t=await e.getLatestTip();return r.Ok(t)}catch(t){return r.Err("Failed to fetch bitcoin block number",t)}};exports._fetchEVMBlockNumber=i;exports.fetchBitcoinBlockNumber=m;exports.fetchEVMBlockNumber=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index17.cjs"),a=require("./index27.cjs"),s=require("./index26.cjs"),l=require("./index28.cjs"),b=require("./index24.cjs"),n={42161:s.mainnet,421614:a.sepolia},h=async e=>{const{chain:t}=e;if(!t)return r.Err("No chain found");const o=(u=>u in n)(t.id)?n[t.id]:t;return await i(o)},i=async e=>{const t=l.createPublicClient({chain:e,transport:b.http()});try{const c=await t.getBlockNumber();return r.Ok(Number(c))}catch(c){return r.Err("Failed to fetch evm block number",c)}},m=async e=>{try{const t=await e.getLatestTip();return r.Ok(t)}catch(t){return r.Err("Failed to fetch bitcoin block number",t)}};exports._fetchEVMBlockNumber=i;exports.fetchBitcoinBlockNumber=m;exports.fetchEVMBlockNumber=h;
package/dist/index15.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Ok as n, Err as c } from "./index17.js";
2
- import { sepolia as m } from "./index23.js";
3
- import { mainnet as s } from "./index24.js";
4
- import { createPublicClient as u } from "./index25.js";
5
- import { http as b } from "./index26.js";
2
+ import { sepolia as m } from "./index27.js";
3
+ import { mainnet as s } from "./index26.js";
4
+ import { createPublicClient as u } from "./index28.js";
5
+ import { http as b } from "./index24.js";
6
6
  const e = {
7
7
  42161: s,
8
8
  421614: m
package/dist/index189.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index190.cjs"),o=require("./index191.cjs");async function s({hash:e,signature:r}){return c.publicKeyToAddress(await o.recoverPublicKey({hash:e,signature:r}))}exports.recoverAddress=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index190.cjs"),s=require("./index191.cjs");async function o({hash:e,signature:r}){return c.publicKeyToAddress(await s.recoverPublicKey({hash:e,signature:r}))}exports.recoverAddress=o;
package/dist/index189.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { publicKeyToAddress as o } from "./index190.js";
2
2
  import { recoverPublicKey as c } from "./index191.js";
3
- async function s({ hash: r, signature: e }) {
3
+ async function t({ hash: r, signature: e }) {
4
4
  return o(await c({ hash: r, signature: e }));
5
5
  }
6
6
  export {
7
- s as recoverAddress
7
+ t as recoverAddress
8
8
  };
package/dist/index191.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index185.cjs"),d=require("./index124.cjs"),o=require("./index182.cjs"),c=require("./index150.cjs");async function g({hash:e,signature:r}){const u=n.isHex(e)?e:c.toHex(e),{secp256k1:i}=await Promise.resolve().then(()=>require("./index192.cjs"));return`0x${(()=>{if(typeof r=="object"&&"r"in r&&"s"in r){const{r:v,s:y,v:b,yParity:f}=r,a=Number(f??b),H=s(a);return new i.Signature(o.hexToBigInt(v),o.hexToBigInt(y)).addRecoveryBit(H)}const t=n.isHex(r)?r:c.toHex(r);if(d.size(t)!==65)throw new Error("invalid signature length");const l=o.hexToNumber(`0x${t.slice(130)}`),x=s(l);return i.Signature.fromCompact(t.substring(2,130)).addRecoveryBit(x)})().recoverPublicKey(u.substring(2)).toHex(!1)}`}function s(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}exports.recoverPublicKey=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index185.cjs"),t=require("./index182.cjs"),n=require("./index150.cjs");async function d({hash:e,signature:r}){const u=i.isHex(e)?e:n.toHex(e),{secp256k1:o}=await Promise.resolve().then(()=>require("./index192.cjs"));return`0x${(()=>{if(typeof r=="object"&&"r"in r&&"s"in r){const{r:l,s:v,v:b,yParity:f}=r,H=Number(f??b),a=s(H);return new o.Signature(t.hexToBigInt(l),t.hexToBigInt(v)).addRecoveryBit(a)}const c=i.isHex(r)?r:n.toHex(r),x=t.hexToNumber(`0x${c.slice(130)}`),y=s(x);return o.Signature.fromCompact(c.substring(2,130)).addRecoveryBit(y)})().recoverPublicKey(u.substring(2)).toHex(!1)}`}function s(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}exports.recoverPublicKey=d;
package/dist/index191.js CHANGED
@@ -1,27 +1,23 @@
1
- import { isHex as i } from "./index185.js";
2
- import { size as b } from "./index124.js";
3
- import { hexToBigInt as n, hexToNumber as d } from "./index182.js";
4
- import { toHex as c } from "./index150.js";
5
- async function R({ hash: r, signature: e }) {
6
- const u = i(r) ? r : c(r), { secp256k1: t } = await import("./index192.js");
1
+ import { isHex as c } from "./index185.js";
2
+ import { hexToBigInt as n, hexToNumber as a } from "./index182.js";
3
+ import { toHex as i } from "./index150.js";
4
+ async function R({ hash: e, signature: r }) {
5
+ const u = c(e) ? e : i(e), { secp256k1: o } = await import("./index192.js");
7
6
  return `0x${(() => {
8
- if (typeof e == "object" && "r" in e && "s" in e) {
9
- const { r: p, s: v, v: y, yParity: l } = e, x = Number(l ?? y), a = s(x);
10
- return new t.Signature(n(p), n(v)).addRecoveryBit(a);
7
+ if (typeof r == "object" && "r" in r && "s" in r) {
8
+ const { r: y, s: p, v, yParity: x } = r, b = Number(x ?? v), l = s(b);
9
+ return new o.Signature(n(y), n(p)).addRecoveryBit(l);
11
10
  }
12
- const o = i(e) ? e : c(e);
13
- if (b(o) !== 65)
14
- throw new Error("invalid signature length");
15
- const f = d(`0x${o.slice(130)}`), m = s(f);
16
- return t.Signature.fromCompact(o.substring(2, 130)).addRecoveryBit(m);
11
+ const t = c(r) ? r : i(r), f = a(`0x${t.slice(130)}`), m = s(f);
12
+ return o.Signature.fromCompact(t.substring(2, 130)).addRecoveryBit(m);
17
13
  })().recoverPublicKey(u.substring(2)).toHex(!1)}`;
18
14
  }
19
- function s(r) {
20
- if (r === 0 || r === 1)
21
- return r;
22
- if (r === 27)
15
+ function s(e) {
16
+ if (e === 0 || e === 1)
17
+ return e;
18
+ if (e === 27)
23
19
  return 0;
24
- if (r === 28)
20
+ if (e === 28)
25
21
  return 1;
26
22
  throw new Error("Invalid yParityOrV value");
27
23
  }
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/index23.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index213.cjs"),a=e.defineChain({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.drpc.org"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",blockCreated:5317080}},testnet:!0});exports.sepolia=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index44.cjs"),c=require("./index98.cjs");function r(e){const{key:t="wallet",name:l="Wallet Client",transport:n}=e;return i.createClient({...e,key:t,name:l,transport:n,type:"walletClient"}).extend(c.walletActions)}exports.createWalletClient=r;
package/dist/index23.js CHANGED
@@ -1,33 +1,15 @@
1
- import { defineChain as e } from "./index213.js";
2
- const s = /* @__PURE__ */ e({
3
- id: 11155111,
4
- name: "Sepolia",
5
- nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 },
6
- rpcUrls: {
7
- default: {
8
- http: ["https://sepolia.drpc.org"]
9
- }
10
- },
11
- blockExplorers: {
12
- default: {
13
- name: "Etherscan",
14
- url: "https://sepolia.etherscan.io",
15
- apiUrl: "https://api-sepolia.etherscan.io/api"
16
- }
17
- },
18
- contracts: {
19
- multicall3: {
20
- address: "0xca11bde05977b3631167028862be2a173976ca11",
21
- blockCreated: 751532
22
- },
23
- ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
24
- ensUniversalResolver: {
25
- address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",
26
- blockCreated: 5317080
27
- }
28
- },
29
- testnet: !0
30
- });
1
+ import { createClient as i } from "./index44.js";
2
+ import { walletActions as o } from "./index98.js";
3
+ function m(t) {
4
+ const { key: e = "wallet", name: l = "Wallet Client", transport: n } = t;
5
+ return i({
6
+ ...t,
7
+ key: e,
8
+ name: l,
9
+ transport: n,
10
+ type: "walletClient"
11
+ }).extend(o);
12
+ }
31
13
  export {
32
- s as sepolia
14
+ m as createWalletClient
33
15
  };
package/dist/index230.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index145.cjs"),t=require("./index171.cjs");function i(s){if(typeof s=="string"){if(!t.isAddress(s,{strict:!1}))throw new n.InvalidAddressError({address:s});return{address:s,type:"json-rpc"}}if(!t.isAddress(s.address,{strict:!1}))throw new n.InvalidAddressError({address:s.address});return{address:s.address,nonceManager:s.nonceManager,sign:s.sign,signAuthorization:s.signAuthorization,signMessage:s.signMessage,signTransaction:s.signTransaction,signTypedData:s.signTypedData,source:"custom",type:"local"}}exports.toAccount=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index128.cjs"),f=require("./index38.cjs"),i=require("./index127.cjs");function v(e,l){var t,o,n,a,s,u;if(!(e instanceof f.BaseError))return!1;const r=e.walk(c=>c instanceof i.ContractFunctionRevertedError);return r instanceof i.ContractFunctionRevertedError?!!(((t=r.data)==null?void 0:t.errorName)==="ResolverNotFound"||((o=r.data)==null?void 0:o.errorName)==="ResolverWildcardNotSupported"||((n=r.data)==null?void 0:n.errorName)==="ResolverNotContract"||((a=r.data)==null?void 0:a.errorName)==="ResolverError"||((s=r.data)==null?void 0:s.errorName)==="HttpError"||(u=r.reason)!=null&&u.includes("Wildcard on non-extended resolvers is not supported")||l==="reverse"&&r.reason===d.panicReasons[50]):!1}exports.isNullUniversalResolverError=v;