@gardenfi/utils 2.0.4 → 2.0.6

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 (237) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +33 -24
  3. package/dist/index10.cjs +1 -1
  4. package/dist/index10.js +24 -32
  5. package/dist/index100.cjs +1 -0
  6. package/dist/index100.js +130 -0
  7. package/dist/index101.cjs +1 -0
  8. package/dist/index101.js +115 -0
  9. package/dist/index102.cjs +1 -0
  10. package/dist/index102.js +81 -0
  11. package/dist/index103.cjs +1 -0
  12. package/dist/index103.js +4 -0
  13. package/dist/index104.cjs +1 -0
  14. package/dist/index104.js +20 -0
  15. package/dist/index105.cjs +1 -0
  16. package/dist/index105.js +21 -0
  17. package/dist/index106.cjs +1 -0
  18. package/dist/index106.js +19 -0
  19. package/dist/index107.cjs +1 -0
  20. package/dist/index107.js +226 -0
  21. package/dist/index108.cjs +2 -0
  22. package/dist/index108.js +5 -0
  23. package/dist/index109.cjs +1 -0
  24. package/dist/index109.js +37 -0
  25. package/dist/index11.cjs +1 -1
  26. package/dist/index11.js +136 -14
  27. package/dist/index110.cjs +1 -0
  28. package/dist/index110.js +21 -0
  29. package/dist/index111.cjs +1 -0
  30. package/dist/index111.js +72 -0
  31. package/dist/index112.cjs +1 -0
  32. package/dist/index112.js +70 -0
  33. package/dist/index113.cjs +1 -0
  34. package/dist/index113.js +4 -0
  35. package/dist/index114.cjs +1 -0
  36. package/dist/index114.js +43 -0
  37. package/dist/index115.cjs +1 -0
  38. package/dist/index115.js +646 -0
  39. package/dist/index116.cjs +1 -0
  40. package/dist/index116.js +234 -0
  41. package/dist/index117.cjs +1 -0
  42. package/dist/index117.js +175 -0
  43. package/dist/index12.cjs +1 -1
  44. package/dist/index12.js +9 -182
  45. package/dist/index13.cjs +1 -1
  46. package/dist/index13.js +2 -94
  47. package/dist/index14.cjs +1 -16
  48. package/dist/index14.js +32 -112
  49. package/dist/index15.cjs +1 -1
  50. package/dist/index15.js +18 -31
  51. package/dist/index16.cjs +1 -1
  52. package/dist/index16.js +188 -31
  53. package/dist/index17.cjs +1 -1
  54. package/dist/index17.js +93 -17
  55. package/dist/index18.cjs +1 -1
  56. package/dist/index18.js +35 -7
  57. package/dist/index19.cjs +1 -1
  58. package/dist/index19.js +31 -20
  59. package/dist/index20.cjs +16 -1
  60. package/dist/index20.js +113 -21
  61. package/dist/index21.cjs +1 -1
  62. package/dist/index21.js +31 -9
  63. package/dist/index22.cjs +1 -1
  64. package/dist/index22.js +17 -31
  65. package/dist/index23.cjs +1 -1
  66. package/dist/index23.js +7 -26
  67. package/dist/index24.cjs +1 -1
  68. package/dist/index24.js +41 -19
  69. package/dist/index25.cjs +1 -1
  70. package/dist/index25.js +19 -49
  71. package/dist/index26.cjs +1 -1
  72. package/dist/index26.js +8 -12
  73. package/dist/index27.cjs +1 -1
  74. package/dist/index27.js +30 -23
  75. package/dist/index28.cjs +1 -1
  76. package/dist/index28.js +25 -74
  77. package/dist/index29.cjs +2 -1
  78. package/dist/index29.js +62 -20
  79. package/dist/index3.cjs +1 -1
  80. package/dist/index3.js +30 -7
  81. package/dist/index30.cjs +1 -1
  82. package/dist/index30.js +51 -7
  83. package/dist/index31.cjs +1 -1
  84. package/dist/index31.js +12 -32
  85. package/dist/index32.cjs +1 -1
  86. package/dist/index32.js +24 -15
  87. package/dist/index33.cjs +1 -1
  88. package/dist/index33.js +76 -2
  89. package/dist/index34.cjs +1 -1
  90. package/dist/index34.js +23 -8
  91. package/dist/index35.cjs +1 -1
  92. package/dist/index35.js +7 -20
  93. package/dist/index36.cjs +1 -1
  94. package/dist/index36.js +32 -12
  95. package/dist/index37.cjs +1 -1
  96. package/dist/index37.js +15 -34
  97. package/dist/index38.cjs +1 -2
  98. package/dist/index38.js +2 -60
  99. package/dist/index39.cjs +1 -1
  100. package/dist/index39.js +9 -2
  101. package/dist/index4.cjs +1 -1
  102. package/dist/index4.js +2 -2
  103. package/dist/index40.cjs +1 -1
  104. package/dist/index40.js +20 -4
  105. package/dist/index41.cjs +1 -1
  106. package/dist/index41.js +12 -11
  107. package/dist/index42.cjs +1 -1
  108. package/dist/index42.js +34 -3
  109. package/dist/index43.cjs +2 -1
  110. package/dist/index43.js +58 -20
  111. package/dist/index44.cjs +1 -1
  112. package/dist/index44.js +2 -13
  113. package/dist/index45.cjs +1 -1
  114. package/dist/index45.js +5 -54
  115. package/dist/index46.cjs +1 -1
  116. package/dist/index46.js +6 -6
  117. package/dist/index47.cjs +1 -1
  118. package/dist/index47.js +4 -21
  119. package/dist/index48.cjs +1 -1
  120. package/dist/index48.js +11 -11
  121. package/dist/index49.cjs +5 -1
  122. package/dist/index49.js +56 -3
  123. package/dist/index50.cjs +2 -1
  124. package/dist/index50.js +32 -9
  125. package/dist/index51.cjs +1 -1
  126. package/dist/index51.js +5 -19
  127. package/dist/index52.cjs +1 -1
  128. package/dist/index52.js +3 -6
  129. package/dist/index53.cjs +1 -1
  130. package/dist/index53.js +21 -8
  131. package/dist/index54.cjs +1 -1
  132. package/dist/index54.js +11 -103
  133. package/dist/index55.cjs +1 -1
  134. package/dist/index55.js +51 -24
  135. package/dist/index56.cjs +1 -1
  136. package/dist/index56.js +8 -18
  137. package/dist/index57.cjs +1 -1
  138. package/dist/index57.js +20 -37
  139. package/dist/index58.cjs +1 -0
  140. package/dist/index58.js +14 -0
  141. package/dist/index59.cjs +1 -0
  142. package/dist/index59.js +11 -0
  143. package/dist/index60.cjs +1 -0
  144. package/dist/index60.js +13 -0
  145. package/dist/index61.cjs +1 -0
  146. package/dist/index61.js +14 -0
  147. package/dist/index62.cjs +1 -0
  148. package/dist/index62.js +9 -0
  149. package/dist/index63.cjs +1 -0
  150. package/dist/index63.js +16 -0
  151. package/dist/index64.cjs +1 -0
  152. package/dist/index64.js +35 -0
  153. package/dist/index65.cjs +1 -0
  154. package/dist/index65.js +17 -0
  155. package/dist/index66.cjs +1 -0
  156. package/dist/index66.js +67 -0
  157. package/dist/index67.cjs +1 -0
  158. package/dist/index67.js +30 -0
  159. package/dist/index68.cjs +1 -0
  160. package/dist/index68.js +5 -0
  161. package/dist/index69.cjs +1 -0
  162. package/dist/index69.js +6 -0
  163. package/dist/index7.cjs +1 -1
  164. package/dist/index7.js +2 -109
  165. package/dist/index70.cjs +1 -0
  166. package/dist/index70.js +16 -0
  167. package/dist/index71.cjs +1 -0
  168. package/dist/index71.js +44 -0
  169. package/dist/index72.cjs +1 -0
  170. package/dist/index72.js +8 -0
  171. package/dist/index73.cjs +1 -0
  172. package/dist/index73.js +11 -0
  173. package/dist/index74.cjs +1 -0
  174. package/dist/index74.js +106 -0
  175. package/dist/index75.cjs +1 -0
  176. package/dist/index75.js +194 -0
  177. package/dist/index76.cjs +1 -0
  178. package/dist/index76.js +21 -0
  179. package/dist/index77.cjs +1 -0
  180. package/dist/index77.js +14 -0
  181. package/dist/index78.cjs +1 -0
  182. package/dist/index78.js +22 -0
  183. package/dist/index79.cjs +1 -0
  184. package/dist/index79.js +15 -0
  185. package/dist/index8.cjs +1 -1
  186. package/dist/index8.js +95 -10
  187. package/dist/index80.cjs +1 -0
  188. package/dist/index80.js +28 -0
  189. package/dist/index81.cjs +1 -0
  190. package/dist/index81.js +9 -0
  191. package/dist/index82.cjs +1 -0
  192. package/dist/index82.js +16 -0
  193. package/dist/index83.cjs +1 -0
  194. package/dist/index83.js +18 -0
  195. package/dist/index84.cjs +1 -0
  196. package/dist/index84.js +8 -0
  197. package/dist/index85.cjs +1 -0
  198. package/dist/index85.js +16 -0
  199. package/dist/index86.cjs +1 -0
  200. package/dist/index86.js +13 -0
  201. package/dist/index87.cjs +1 -0
  202. package/dist/index87.js +19 -0
  203. package/dist/index88.cjs +1 -0
  204. package/dist/index88.js +174 -0
  205. package/dist/index89.cjs +1 -0
  206. package/dist/index89.js +41 -0
  207. package/dist/index9.cjs +1 -1
  208. package/dist/index9.js +44 -2
  209. package/dist/index90.cjs +1 -0
  210. package/dist/index90.js +11 -0
  211. package/dist/index91.cjs +1 -0
  212. package/dist/index91.js +7 -0
  213. package/dist/index92.cjs +1 -0
  214. package/dist/index92.js +13 -0
  215. package/dist/index93.cjs +1 -0
  216. package/dist/index93.js +4 -0
  217. package/dist/index94.cjs +1 -0
  218. package/dist/index94.js +107 -0
  219. package/dist/index95.cjs +1 -0
  220. package/dist/index95.js +45 -0
  221. package/dist/index96.cjs +1 -0
  222. package/dist/index96.js +23 -0
  223. package/dist/index97.cjs +1 -0
  224. package/dist/index97.js +9 -0
  225. package/dist/index98.cjs +1 -0
  226. package/dist/index98.js +7 -0
  227. package/dist/index99.cjs +1 -0
  228. package/dist/index99.js +40 -0
  229. package/dist/src/lib/auth/apikey/apikey.d.ts +12 -0
  230. package/dist/src/lib/auth/auth.types.d.ts +21 -8
  231. package/dist/src/lib/auth/index.d.ts +5 -1
  232. package/dist/src/lib/auth/passkey/passkey.d.ts +10 -0
  233. package/dist/src/lib/auth/passkey/passkey.types.d.ts +17 -0
  234. package/dist/src/lib/auth/passkey/passkeyLogin.d.ts +37 -0
  235. package/dist/src/lib/auth/{siwe.d.ts → siwe/siwe.d.ts} +4 -15
  236. package/dist/src/lib/utils.d.ts +3 -0
  237. package/package.json +2 -1
package/dist/index32.js CHANGED
@@ -1,18 +1,27 @@
1
- import { wait as l } from "./index42.js";
2
- function f(o, { emitOnBegin: r, initialWaitTime: t, interval: c }) {
3
- let n = !0;
4
- const a = () => n = !1;
5
- return (async () => {
6
- let w;
7
- r && (w = await o({ unpoll: a }));
8
- const s = await (t == null ? void 0 : t(w)) ?? c;
9
- await l(s);
10
- const u = async () => {
11
- n && (await o({ unpoll: a }), await l(c), u());
12
- };
13
- u();
14
- })(), a;
1
+ import { hexToNumber as b } from "./index34.js";
2
+ import { formatLog as d } from "./index48.js";
3
+ import { transactionType as m } from "./index30.js";
4
+ const f = {
5
+ "0x0": "reverted",
6
+ "0x1": "success"
7
+ };
8
+ function r(l) {
9
+ const u = {
10
+ ...l,
11
+ blockNumber: l.blockNumber ? BigInt(l.blockNumber) : null,
12
+ contractAddress: l.contractAddress ? l.contractAddress : null,
13
+ cumulativeGasUsed: l.cumulativeGasUsed ? BigInt(l.cumulativeGasUsed) : null,
14
+ effectiveGasPrice: l.effectiveGasPrice ? BigInt(l.effectiveGasPrice) : null,
15
+ gasUsed: l.gasUsed ? BigInt(l.gasUsed) : null,
16
+ logs: l.logs ? l.logs.map((s) => d(s)) : null,
17
+ to: l.to ? l.to : null,
18
+ transactionIndex: l.transactionIndex ? b(l.transactionIndex) : null,
19
+ status: l.status ? f[l.status] : null,
20
+ type: l.type ? m[l.type] || l.type : null
21
+ };
22
+ return l.blobGasPrice && (u.blobGasPrice = BigInt(l.blobGasPrice)), l.blobGasUsed && (u.blobGasUsed = BigInt(l.blobGasUsed)), u;
15
23
  }
16
24
  export {
17
- f as poll
25
+ r as formatTransactionReceipt,
26
+ f as receiptStatuses
18
27
  };
package/dist/index33.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=(e,n,i)=>JSON.stringify(e,(o,t)=>typeof t=="bigint"?t.toString():t,i);exports.stringify=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./index34.cjs"),d=require("./index35.cjs"),y=require("./index36.cjs"),h=require("./index37.cjs"),B=require("./index38.cjs"),m=require("./index26.cjs");function q(t,{emitOnBegin:b=!1,emitMissed:l=!1,onBlockNumber:p,onError:a,poll:k,pollingInterval:i=t.pollingInterval}){const g=typeof k<"u"?k:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket");let r;return g?(()=>{const f=B.stringify(["watchBlockNumber",t.uid,b,l,i]);return y.observe(f,{onBlockNumber:p,onError:a},o=>h.poll(async()=>{var c;try{const e=await d.getAction(t,m.getBlockNumber,"getBlockNumber")({cacheTime:0});if(r){if(e===r)return;if(e-r>1&&l)for(let s=r+1n;s<e;s++)o.onBlockNumber(s,r),r=s}(!r||e>r)&&(o.onBlockNumber(e,r),r=e)}catch(e){(c=o.onError)==null||c.call(o,e)}},{emitOnBegin:b,interval:i}))})():(()=>{const f=B.stringify(["watchBlockNumber",t.uid,b,l]);return y.observe(f,{onBlockNumber:p,onError:a},o=>{let c=!0,e=()=>c=!1;return(async()=>{try{const s=(()=>{if(t.transport.type==="fallback"){const n=t.transport.transports.find(u=>u.config.type==="webSocket");return n?n.value:t.transport}return t.transport})(),{unsubscribe:v}=await s.subscribe({params:["newHeads"],onData(n){var N;if(!c)return;const u=w.hexToBigInt((N=n.result)==null?void 0:N.number);o.onBlockNumber(u,r),r=u},onError(n){var u;(u=o.onError)==null||u.call(o,n)}});e=v,c||e()}catch(s){a==null||a(s)}})(),()=>e()})})()}exports.watchBlockNumber=q;
package/dist/index33.js CHANGED
@@ -1,4 +1,78 @@
1
- const g = (r, n, i) => JSON.stringify(r, (e, t) => typeof t == "bigint" ? t.toString() : t, i);
1
+ import { hexToBigInt as h } from "./index34.js";
2
+ import { getAction as v } from "./index35.js";
3
+ import { observe as i } from "./index36.js";
4
+ import { poll as d } from "./index37.js";
5
+ import { stringify as y } from "./index38.js";
6
+ import { getBlockNumber as g } from "./index26.js";
7
+ function j(t, { emitOnBegin: b = !1, emitMissed: f = !1, onBlockNumber: p, onError: n, poll: k, pollingInterval: m = t.pollingInterval }) {
8
+ const B = typeof k < "u" ? k : !(t.transport.type === "webSocket" || t.transport.type === "fallback" && t.transport.transports[0].config.type === "webSocket");
9
+ let r;
10
+ return B ? (() => {
11
+ const l = y([
12
+ "watchBlockNumber",
13
+ t.uid,
14
+ b,
15
+ f,
16
+ m
17
+ ]);
18
+ return i(l, { onBlockNumber: p, onError: n }, (e) => d(async () => {
19
+ var a;
20
+ try {
21
+ const o = await v(t, g, "getBlockNumber")({ cacheTime: 0 });
22
+ if (r) {
23
+ if (o === r)
24
+ return;
25
+ if (o - r > 1 && f)
26
+ for (let s = r + 1n; s < o; s++)
27
+ e.onBlockNumber(s, r), r = s;
28
+ }
29
+ (!r || o > r) && (e.onBlockNumber(o, r), r = o);
30
+ } catch (o) {
31
+ (a = e.onError) == null || a.call(e, o);
32
+ }
33
+ }, {
34
+ emitOnBegin: b,
35
+ interval: m
36
+ }));
37
+ })() : (() => {
38
+ const l = y([
39
+ "watchBlockNumber",
40
+ t.uid,
41
+ b,
42
+ f
43
+ ]);
44
+ return i(l, { onBlockNumber: p, onError: n }, (e) => {
45
+ let a = !0, o = () => a = !1;
46
+ return (async () => {
47
+ try {
48
+ const s = (() => {
49
+ if (t.transport.type === "fallback") {
50
+ const c = t.transport.transports.find((u) => u.config.type === "webSocket");
51
+ return c ? c.value : t.transport;
52
+ }
53
+ return t.transport;
54
+ })(), { unsubscribe: w } = await s.subscribe({
55
+ params: ["newHeads"],
56
+ onData(c) {
57
+ var N;
58
+ if (!a)
59
+ return;
60
+ const u = h((N = c.result) == null ? void 0 : N.number);
61
+ e.onBlockNumber(u, r), r = u;
62
+ },
63
+ onError(c) {
64
+ var u;
65
+ (u = e.onError) == null || u.call(e, c);
66
+ }
67
+ });
68
+ o = w, a || o();
69
+ } catch (s) {
70
+ n == null || n(s);
71
+ }
72
+ })(), () => o();
73
+ });
74
+ })();
75
+ }
2
76
  export {
3
- g as stringify
77
+ j as watchBlockNumber
4
78
  };
package/dist/index34.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}exports.withResolvers=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("./index41.cjs"),r=require("./index47.cjs");function o(e,{size:n}){if(r.size(e)>n)throw new z.SizeOverflowError({givenSize:r.size(e),maxSize:n})}function s(e,n={}){const{signed:u}=n;n.size&&o(e,{size:n.size});const i=BigInt(e);if(!u)return i;const t=(e.length-2)/2,c=(1n<<BigInt(t)*8n-1n)-1n;return i<=c?i:i-BigInt(`0x${"f".padStart(t*2,"f")}`)-1n}function f(e,n={}){return Number(s(e,n))}exports.assertSize=o;exports.hexToBigInt=s;exports.hexToNumber=f;
package/dist/index34.js CHANGED
@@ -1,11 +1,26 @@
1
- function i() {
2
- let e = () => {
3
- }, n = () => {
4
- };
5
- return { promise: new Promise((r, o) => {
6
- e = r, n = o;
7
- }), resolve: e, reject: n };
1
+ import { SizeOverflowError as u } from "./index41.js";
2
+ import { size as t } from "./index47.js";
3
+ function s(n, { size: i }) {
4
+ if (t(n) > i)
5
+ throw new u({
6
+ givenSize: t(n),
7
+ maxSize: i
8
+ });
9
+ }
10
+ function z(n, i = {}) {
11
+ const { signed: o } = i;
12
+ i.size && s(n, { size: i.size });
13
+ const e = BigInt(n);
14
+ if (!o)
15
+ return e;
16
+ const r = (n.length - 2) / 2, f = (1n << BigInt(r) * 8n - 1n) - 1n;
17
+ return e <= f ? e : e - BigInt(`0x${"f".padStart(r * 2, "f")}`) - 1n;
18
+ }
19
+ function g(n, i = {}) {
20
+ return Number(z(n, i));
8
21
  }
9
22
  export {
10
- i as withResolvers
23
+ s as assertSize,
24
+ z as hexToBigInt,
25
+ g as hexToNumber
11
26
  };
package/dist/index35.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index42.cjs");function f(n,{delay:e=100,retryCount:o=2,shouldRetry:c=()=>!0}={}){return new Promise((s,y)=>{const a=async({count:r=0}={})=>{const w=async({error:t})=>{const i=typeof e=="function"?e({count:r,error:t}):e;i&&await u.wait(i),a({count:r+1})};try{const t=await n();s(t)}catch(t){if(r<o&&await c({count:r,error:t}))return w({error:t});y(t)}};a()})}exports.withRetry=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(t,e,o){const i=t[e.name];if(typeof i=="function")return i;const n=t[o];return typeof n=="function"?n:c=>e(t,c)}exports.getAction=r;
package/dist/index35.js CHANGED
@@ -1,23 +1,10 @@
1
- import { wait as w } from "./index42.js";
2
- function p(n, { delay: e = 100, retryCount: o = 2, shouldRetry: c = () => !0 } = {}) {
3
- return new Promise((s, y) => {
4
- const a = async ({ count: r = 0 } = {}) => {
5
- const f = async ({ error: t }) => {
6
- const i = typeof e == "function" ? e({ count: r, error: t }) : e;
7
- i && await w(i), a({ count: r + 1 });
8
- };
9
- try {
10
- const t = await n();
11
- s(t);
12
- } catch (t) {
13
- if (r < o && await c({ count: r, error: t }))
14
- return f({ error: t });
15
- y(t);
16
- }
17
- };
18
- a();
19
- });
1
+ function f(t, n, c) {
2
+ const i = t[n.name];
3
+ if (typeof i == "function")
4
+ return i;
5
+ const o = t[c];
6
+ return typeof o == "function" ? o : (e) => n(t, e);
20
7
  }
21
8
  export {
22
- p as withRetry
9
+ f as getAction
23
10
  };
package/dist/index36.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index38.cjs");class i extends n.BaseError{constructor({max:e,min:r,signed:s,size:t,value:a}){super(`Number "${a}" is not in safe ${t?`${t*8}-bit ${s?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}}class u extends n.BaseError{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}exports.IntegerOutOfRangeError=i;exports.SizeOverflowError=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=new Map,r=new Map;let m=0;function w(n,u,C){const o=++m,s=()=>i.get(n)||[],y=()=>{const t=s();i.set(n,t.filter(e=>e.id!==o))},a=()=>{const t=s();if(!t.some(c=>c.id===o))return;const e=r.get(n);t.length===1&&e&&e(),y()},l=s();if(i.set(n,[...l,{id:o,fns:u}]),l&&l.length>0)return a;const f={};for(const t in u)f[t]=(...e)=>{var h,p;const c=s();if(c.length!==0)for(const b of c)(p=(h=b.fns)[t])==null||p.call(h,...e)};const g=C(f);return typeof g=="function"&&r.set(n,g),a}exports.cleanupCache=r;exports.listenersCache=i;exports.observe=w;
package/dist/index36.js CHANGED
@@ -1,15 +1,35 @@
1
- import { BaseError as t } from "./index38.js";
2
- class $ extends t {
3
- constructor({ max: e, min: r, signed: s, size: n, value: a }) {
4
- super(`Number "${a}" is not in safe ${n ? `${n * 8}-bit ${s ? "signed" : "unsigned"} ` : ""}integer range ${e ? `(${r} to ${e})` : `(above ${r})`}`, { name: "IntegerOutOfRangeError" });
5
- }
6
- }
7
- class c extends t {
8
- constructor({ givenSize: e, maxSize: r }) {
9
- super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`, { name: "SizeOverflowError" });
10
- }
1
+ const l = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map();
2
+ let m = 0;
3
+ function y(e, f, w) {
4
+ const i = ++m, s = () => l.get(e) || [], C = () => {
5
+ const n = s();
6
+ l.set(e, n.filter((t) => t.id !== i));
7
+ }, r = () => {
8
+ const n = s();
9
+ if (!n.some((c) => c.id === i))
10
+ return;
11
+ const t = h.get(e);
12
+ n.length === 1 && t && t(), C();
13
+ }, o = s();
14
+ if (l.set(e, [
15
+ ...o,
16
+ { id: i, fns: f }
17
+ ]), o && o.length > 0)
18
+ return r;
19
+ const u = {};
20
+ for (const n in f)
21
+ u[n] = (...t) => {
22
+ var p, g;
23
+ const c = s();
24
+ if (c.length !== 0)
25
+ for (const k of c)
26
+ (g = (p = k.fns)[n]) == null || g.call(p, ...t);
27
+ };
28
+ const a = w(u);
29
+ return typeof a == "function" && h.set(e, a), r;
11
30
  }
12
31
  export {
13
- $ as IntegerOutOfRangeError,
14
- c as SizeOverflowError
32
+ h as cleanupCache,
33
+ l as listenersCache,
34
+ y as observe
15
35
  };
package/dist/index37.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index52.cjs");function p(e,{dir:n,size:t=32}={}){return typeof e=="string"?o(e,{dir:n,size:t}):l(e,{dir:n,size:t})}function o(e,{dir:n,size:t=32}={}){if(t===null)return e;const r=e.replace("0x","");if(r.length>t*2)throw new i.SizeExceedsPaddingSizeError({size:Math.ceil(r.length/2),targetSize:t,type:"hex"});return`0x${r[n==="right"?"padEnd":"padStart"](t*2,"0")}`}function l(e,{dir:n,size:t=32}={}){if(t===null)return e;if(e.length>t)throw new i.SizeExceedsPaddingSizeError({size:e.length,targetSize:t,type:"bytes"});const r=new Uint8Array(t);for(let a=0;a<t;a++){const d=n==="right";r[d?a:t-a-1]=e[d?a:e.length-a-1]}return r}exports.pad=p;exports.padBytes=l;exports.padHex=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index52.cjs");function s(o,{emitOnBegin:w,initialWaitTime:t,interval:c}){let e=!0;const a=()=>e=!1;return(async()=>{let n;w&&(n=await o({unpoll:a}));const r=await(t==null?void 0:t(n))??c;await u.wait(r);const l=async()=>{e&&(await o({unpoll:a}),await u.wait(c),l())};l()})(),a}exports.poll=s;
package/dist/index37.js CHANGED
@@ -1,37 +1,18 @@
1
- import { SizeExceedsPaddingSizeError as d } from "./index52.js";
2
- function f(n, { dir: r, size: t = 32 } = {}) {
3
- return typeof n == "string" ? p(n, { dir: r, size: t }) : i(n, { dir: r, size: t });
4
- }
5
- function p(n, { dir: r, size: t = 32 } = {}) {
6
- if (t === null)
7
- return n;
8
- const e = n.replace("0x", "");
9
- if (e.length > t * 2)
10
- throw new d({
11
- size: Math.ceil(e.length / 2),
12
- targetSize: t,
13
- type: "hex"
14
- });
15
- return `0x${e[r === "right" ? "padEnd" : "padStart"](t * 2, "0")}`;
16
- }
17
- function i(n, { dir: r, size: t = 32 } = {}) {
18
- if (t === null)
19
- return n;
20
- if (n.length > t)
21
- throw new d({
22
- size: n.length,
23
- targetSize: t,
24
- type: "bytes"
25
- });
26
- const e = new Uint8Array(t);
27
- for (let a = 0; a < t; a++) {
28
- const o = r === "right";
29
- e[o ? a : t - a - 1] = n[o ? a : n.length - a - 1];
30
- }
31
- return e;
1
+ import { wait as l } from "./index52.js";
2
+ function f(o, { emitOnBegin: r, initialWaitTime: t, interval: c }) {
3
+ let n = !0;
4
+ const a = () => n = !1;
5
+ return (async () => {
6
+ let w;
7
+ r && (w = await o({ unpoll: a }));
8
+ const s = await (t == null ? void 0 : t(w)) ?? c;
9
+ await l(s);
10
+ const u = async () => {
11
+ n && (await o({ unpoll: a }), await l(c), u());
12
+ };
13
+ u();
14
+ })(), a;
32
15
  }
33
16
  export {
34
- f as pad,
35
- i as padBytes,
36
- p as padHex
17
+ f as poll
37
18
  };
package/dist/index38.cjs CHANGED
@@ -1,2 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index39.cjs");let i={getDocsUrl:({docsBaseUrl:s,docsPath:t="",docsSlug:e})=>t?`${s??"https://viem.sh"}${t}${e?`#${e}`:""}`:void 0,version:`viem@${l.version}`};class u extends Error{constructor(t,e={}){var o;const r=(()=>{var c;return e.cause instanceof u?e.cause.details:(c=e.cause)!=null&&c.message?e.cause.message:e.details})(),n=e.cause instanceof u&&e.cause.docsPath||e.docsPath,a=(o=i.getDocsUrl)==null?void 0:o.call(i,{...e,docsPath:n}),b=[t||"An error occurred.","",...e.metaMessages?[...e.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...i.version?[`Version: ${i.version}`]:[]].join(`
2
- `);super(b,e.cause?{cause:e.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=n,this.metaMessages=e.metaMessages,this.name=e.name??this.name,this.shortMessage=t,this.version=l.version}walk(t){return d(this,t)}}function d(s,t){return t!=null&&t(s)?s:s&&typeof s=="object"&&"cause"in s&&s.cause!==void 0?d(s.cause,t):t?null:s}exports.BaseError=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=(e,n,i)=>JSON.stringify(e,(o,t)=>typeof t=="bigint"?t.toString():t,i);exports.stringify=r;
package/dist/index38.js CHANGED
@@ -1,62 +1,4 @@
1
- import { version as l } from "./index39.js";
2
- let i = {
3
- getDocsUrl: ({ docsBaseUrl: s, docsPath: t = "", docsSlug: e }) => t ? `${s ?? "https://viem.sh"}${t}${e ? `#${e}` : ""}` : void 0,
4
- version: `viem@${l}`
5
- };
6
- class r extends Error {
7
- constructor(t, e = {}) {
8
- var o;
9
- const u = (() => {
10
- var c;
11
- return e.cause instanceof r ? e.cause.details : (c = e.cause) != null && c.message ? e.cause.message : e.details;
12
- })(), a = e.cause instanceof r && e.cause.docsPath || e.docsPath, n = (o = i.getDocsUrl) == null ? void 0 : o.call(i, { ...e, docsPath: a }), b = [
13
- t || "An error occurred.",
14
- "",
15
- ...e.metaMessages ? [...e.metaMessages, ""] : [],
16
- ...n ? [`Docs: ${n}`] : [],
17
- ...u ? [`Details: ${u}`] : [],
18
- ...i.version ? [`Version: ${i.version}`] : []
19
- ].join(`
20
- `);
21
- super(b, e.cause ? { cause: e.cause } : void 0), Object.defineProperty(this, "details", {
22
- enumerable: !0,
23
- configurable: !0,
24
- writable: !0,
25
- value: void 0
26
- }), Object.defineProperty(this, "docsPath", {
27
- enumerable: !0,
28
- configurable: !0,
29
- writable: !0,
30
- value: void 0
31
- }), Object.defineProperty(this, "metaMessages", {
32
- enumerable: !0,
33
- configurable: !0,
34
- writable: !0,
35
- value: void 0
36
- }), Object.defineProperty(this, "shortMessage", {
37
- enumerable: !0,
38
- configurable: !0,
39
- writable: !0,
40
- value: void 0
41
- }), Object.defineProperty(this, "version", {
42
- enumerable: !0,
43
- configurable: !0,
44
- writable: !0,
45
- value: void 0
46
- }), Object.defineProperty(this, "name", {
47
- enumerable: !0,
48
- configurable: !0,
49
- writable: !0,
50
- value: "BaseError"
51
- }), this.details = u, this.docsPath = a, this.metaMessages = e.metaMessages, this.name = e.name ?? this.name, this.shortMessage = t, this.version = l;
52
- }
53
- walk(t) {
54
- return d(this, t);
55
- }
56
- }
57
- function d(s, t) {
58
- return t != null && t(s) ? s : s && typeof s == "object" && "cause" in s && s.cause !== void 0 ? d(s.cause, t) : t ? null : s;
59
- }
1
+ const g = (r, n, i) => JSON.stringify(r, (e, t) => typeof t == "bigint" ? t.toString() : t, i);
60
2
  export {
61
- r as BaseError
3
+ g as stringify
62
4
  };
package/dist/index39.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="2.22.23";exports.version=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}exports.withResolvers=i;
package/dist/index39.js CHANGED
@@ -1,4 +1,11 @@
1
- const o = "2.22.23";
1
+ function i() {
2
+ let e = () => {
3
+ }, n = () => {
4
+ };
5
+ return { promise: new Promise((r, o) => {
6
+ e = r, n = o;
7
+ }), resolve: e, reject: n };
8
+ }
2
9
  export {
3
- o as version
10
+ i as withResolvers
4
11
  };
package/dist/index4.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index12.cjs"),a=require("viem"),e=require("./index3.cjs"),p=require("./index13.cjs"),d=async(s,u,o,r)=>{if(!r.account)return c.Err("No account found");const n=a.getContract({address:e.with0x(u),abi:a.erc20Abi,client:r});try{const t=await n.read.allowance([e.with0x(r.account.address),e.with0x(o)]);if(BigInt(t)<BigInt(s)){const i=await n.write.approve([e.with0x(o),a.maxUint256],{account:r.account,chain:r.chain});return(await p.waitForTransactionReceipt(r,{hash:i})).status!=="success"?c.Err("Failed to approve"):c.Ok(i)}return c.Ok("Already approved")}catch(t){return c.Err("Failed to approve: "+t)}};exports.checkAllowanceAndApprove=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index16.cjs"),a=require("viem"),e=require("./index3.cjs"),p=require("./index17.cjs"),d=async(s,u,o,r)=>{if(!r.account)return c.Err("No account found");const n=a.getContract({address:e.with0x(u),abi:a.erc20Abi,client:r});try{const t=await n.read.allowance([e.with0x(r.account.address),e.with0x(o)]);if(BigInt(t)<BigInt(s)){const i=await n.write.approve([e.with0x(o),a.maxUint256],{account:r.account,chain:r.chain});return(await p.waitForTransactionReceipt(r,{hash:i})).status!=="success"?c.Err("Failed to approve"):c.Ok(i)}return c.Ok("Already approved")}catch(t){return c.Err("Failed to approve: "+t)}};exports.checkAllowanceAndApprove=d;
package/dist/index4.js CHANGED
@@ -1,7 +1,7 @@
1
- import { Err as c, Ok as i } from "./index12.js";
1
+ import { Err as c, Ok as i } from "./index16.js";
2
2
  import { getContract as u, erc20Abi as d, maxUint256 as m } from "viem";
3
3
  import { with0x as a } from "./index3.js";
4
- import { waitForTransactionReceipt as f } from "./index13.js";
4
+ import { waitForTransactionReceipt as f } from "./index17.js";
5
5
  const g = async (p, s, t, r) => {
6
6
  if (!r.account) return c("No account found");
7
7
  const n = u({
package/dist/index40.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index49.cjs");function i(e){return t.isHex(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}exports.size=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index52.cjs");function f(n,{delay:e=100,retryCount:o=2,shouldRetry:c=()=>!0}={}){return new Promise((s,y)=>{const a=async({count:r=0}={})=>{const w=async({error:t})=>{const i=typeof e=="function"?e({count:r,error:t}):e;i&&await u.wait(i),a({count:r+1})};try{const t=await n();s(t)}catch(t){if(r<o&&await c({count:r,error:t}))return w({error:t});y(t)}};a()})}exports.withRetry=f;
package/dist/index40.js CHANGED
@@ -1,7 +1,23 @@
1
- import { isHex as r } from "./index49.js";
2
- function i(t) {
3
- return r(t, { strict: !1 }) ? Math.ceil((t.length - 2) / 2) : t.length;
1
+ import { wait as w } from "./index52.js";
2
+ function p(n, { delay: e = 100, retryCount: o = 2, shouldRetry: c = () => !0 } = {}) {
3
+ return new Promise((s, y) => {
4
+ const a = async ({ count: r = 0 } = {}) => {
5
+ const f = async ({ error: t }) => {
6
+ const i = typeof e == "function" ? e({ count: r, error: t }) : e;
7
+ i && await w(i), a({ count: r + 1 });
8
+ };
9
+ try {
10
+ const t = await n();
11
+ s(t);
12
+ } catch (t) {
13
+ if (r < o && await c({ count: r, error: t }))
14
+ return f({ error: t });
15
+ y(t);
16
+ }
17
+ };
18
+ a();
19
+ });
4
20
  }
5
21
  export {
6
- i as size
22
+ p as withRetry
7
23
  };
package/dist/index41.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(n,{args:a,eventName:t}={}){return{...n,blockHash:n.blockHash?n.blockHash:null,blockNumber:n.blockNumber?BigInt(n.blockNumber):null,logIndex:n.logIndex?Number(n.logIndex):null,transactionHash:n.transactionHash?n.transactionHash:null,transactionIndex:n.transactionIndex?Number(n.transactionIndex):null,...t?{args:a,eventName:t}:{}}}exports.formatLog=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index43.cjs");class i extends n.BaseError{constructor({max:e,min:r,signed:s,size:t,value:a}){super(`Number "${a}" is not in safe ${t?`${t*8}-bit ${s?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}}class u extends n.BaseError{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}exports.IntegerOutOfRangeError=i;exports.SizeOverflowError=u;
package/dist/index41.js CHANGED
@@ -1,14 +1,15 @@
1
- function r(n, { args: t, eventName: a } = {}) {
2
- return {
3
- ...n,
4
- blockHash: n.blockHash ? n.blockHash : null,
5
- blockNumber: n.blockNumber ? BigInt(n.blockNumber) : null,
6
- logIndex: n.logIndex ? Number(n.logIndex) : null,
7
- transactionHash: n.transactionHash ? n.transactionHash : null,
8
- transactionIndex: n.transactionIndex ? Number(n.transactionIndex) : null,
9
- ...a ? { args: t, eventName: a } : {}
10
- };
1
+ import { BaseError as t } from "./index43.js";
2
+ class $ extends t {
3
+ constructor({ max: e, min: r, signed: s, size: n, value: a }) {
4
+ super(`Number "${a}" is not in safe ${n ? `${n * 8}-bit ${s ? "signed" : "unsigned"} ` : ""}integer range ${e ? `(${r} to ${e})` : `(above ${r})`}`, { name: "IntegerOutOfRangeError" });
5
+ }
6
+ }
7
+ class c extends t {
8
+ constructor({ givenSize: e, maxSize: r }) {
9
+ super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`, { name: "SizeOverflowError" });
10
+ }
11
11
  }
12
12
  export {
13
- r as formatLog
13
+ $ as IntegerOutOfRangeError,
14
+ c as SizeOverflowError
14
15
  };
package/dist/index42.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function i(e){return new Promise(t=>setTimeout(t,e))}exports.wait=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index79.cjs");function p(e,{dir:n,size:t=32}={}){return typeof e=="string"?o(e,{dir:n,size:t}):l(e,{dir:n,size:t})}function o(e,{dir:n,size:t=32}={}){if(t===null)return e;const r=e.replace("0x","");if(r.length>t*2)throw new i.SizeExceedsPaddingSizeError({size:Math.ceil(r.length/2),targetSize:t,type:"hex"});return`0x${r[n==="right"?"padEnd":"padStart"](t*2,"0")}`}function l(e,{dir:n,size:t=32}={}){if(t===null)return e;if(e.length>t)throw new i.SizeExceedsPaddingSizeError({size:e.length,targetSize:t,type:"bytes"});const r=new Uint8Array(t);for(let a=0;a<t;a++){const d=n==="right";r[d?a:t-a-1]=e[d?a:e.length-a-1]}return r}exports.pad=p;exports.padBytes=l;exports.padHex=o;
package/dist/index42.js CHANGED
@@ -1,6 +1,37 @@
1
- async function n(e) {
2
- return new Promise((t) => setTimeout(t, e));
1
+ import { SizeExceedsPaddingSizeError as d } from "./index79.js";
2
+ function f(n, { dir: r, size: t = 32 } = {}) {
3
+ return typeof n == "string" ? p(n, { dir: r, size: t }) : i(n, { dir: r, size: t });
4
+ }
5
+ function p(n, { dir: r, size: t = 32 } = {}) {
6
+ if (t === null)
7
+ return n;
8
+ const e = n.replace("0x", "");
9
+ if (e.length > t * 2)
10
+ throw new d({
11
+ size: Math.ceil(e.length / 2),
12
+ targetSize: t,
13
+ type: "hex"
14
+ });
15
+ return `0x${e[r === "right" ? "padEnd" : "padStart"](t * 2, "0")}`;
16
+ }
17
+ function i(n, { dir: r, size: t = 32 } = {}) {
18
+ if (t === null)
19
+ return n;
20
+ if (n.length > t)
21
+ throw new d({
22
+ size: n.length,
23
+ targetSize: t,
24
+ type: "bytes"
25
+ });
26
+ const e = new Uint8Array(t);
27
+ for (let a = 0; a < t; a++) {
28
+ const o = r === "right";
29
+ e[o ? a : t - a - 1] = n[o ? a : n.length - a - 1];
30
+ }
31
+ return e;
3
32
  }
4
33
  export {
5
- n as wait
34
+ f as pad,
35
+ i as padBytes,
36
+ p as padHex
6
37
  };
package/dist/index43.cjs CHANGED
@@ -1 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index44.cjs"),f=require("./index45.cjs"),a=require("./index46.cjs"),l=require("./index47.cjs"),A=require("./index48.cjs"),o=new l.LruMap(8192);function u(s,t){if(o.has(`${s}.${t}`))return o.get(`${s}.${t}`);const c=s.substring(2).toLowerCase(),n=a.keccak256(f.stringToBytes(c)),r=c.split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&r[e]&&(r[e]=r[e].toUpperCase()),(n[e>>1]&15)>=8&&r[e+1]&&(r[e+1]=r[e+1].toUpperCase());const i=`0x${r.join("")}`;return o.set(`${s}.${t}`,i),i}function g(s,t){if(!A.isAddress(s,{strict:!1}))throw new d.InvalidAddressError({address:s});return u(s,t)}exports.checksumAddress=u;exports.getAddress=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index44.cjs");let i={getDocsUrl:({docsBaseUrl:s,docsPath:t="",docsSlug:e})=>t?`${s??"https://viem.sh"}${t}${e?`#${e}`:""}`:void 0,version:`viem@${l.version}`};class u extends Error{constructor(t,e={}){var o;const r=(()=>{var c;return e.cause instanceof u?e.cause.details:(c=e.cause)!=null&&c.message?e.cause.message:e.details})(),n=e.cause instanceof u&&e.cause.docsPath||e.docsPath,a=(o=i.getDocsUrl)==null?void 0:o.call(i,{...e,docsPath:n}),b=[t||"An error occurred.","",...e.metaMessages?[...e.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...i.version?[`Version: ${i.version}`]:[]].join(`
2
+ `);super(b,e.cause?{cause:e.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=n,this.metaMessages=e.metaMessages,this.name=e.name??this.name,this.shortMessage=t,this.version=l.version}walk(t){return d(this,t)}}function d(s,t){return t!=null&&t(s)?s:s&&typeof s=="object"&&"cause"in s&&s.cause!==void 0?d(s.cause,t):t?null:s}exports.BaseError=u;