@gardenfi/swap 0.0.2-beta.1 → 0.0.2-beta.2

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 (179) hide show
  1. package/dist/index104.cjs +1 -1
  2. package/dist/index104.js +4 -4
  3. package/dist/index106.cjs +1 -1
  4. package/dist/index106.js +3 -3
  5. package/dist/index107.cjs +1 -1
  6. package/dist/index107.js +3 -3
  7. package/dist/index116.cjs +1 -1
  8. package/dist/index116.js +1 -1
  9. package/dist/index117.cjs +1 -1
  10. package/dist/index117.js +1 -1
  11. package/dist/index120.cjs +1 -1
  12. package/dist/index120.js +2 -2
  13. package/dist/index121.cjs +1 -1
  14. package/dist/index121.js +7 -7
  15. package/dist/index132.cjs +1 -1
  16. package/dist/index132.js +1 -1
  17. package/dist/index133.cjs +1 -1
  18. package/dist/index133.js +1 -1
  19. package/dist/index134.cjs +1 -1
  20. package/dist/index134.js +1 -1
  21. package/dist/index135.cjs +1 -1
  22. package/dist/index135.js +1 -1
  23. package/dist/index138.cjs +1 -1
  24. package/dist/index138.js +2 -2
  25. package/dist/index161.cjs +1 -1
  26. package/dist/index161.js +2 -2
  27. package/dist/index167.cjs +1 -1
  28. package/dist/index167.js +2 -2
  29. package/dist/index168.cjs +1 -1
  30. package/dist/index168.js +2 -2
  31. package/dist/index169.cjs +1 -1
  32. package/dist/index169.js +2 -2
  33. package/dist/index170.cjs +1 -1
  34. package/dist/index170.js +2 -2
  35. package/dist/index171.cjs +1 -1
  36. package/dist/index171.js +2 -2
  37. package/dist/index172.cjs +1 -1
  38. package/dist/index172.js +2 -2
  39. package/dist/index181.cjs +1 -1
  40. package/dist/index181.js +1 -1
  41. package/dist/index272.cjs +1 -1
  42. package/dist/index272.js +174 -9
  43. package/dist/index273.cjs +2 -1
  44. package/dist/index273.js +91 -30
  45. package/dist/index274.cjs +1 -1
  46. package/dist/index274.js +41 -2
  47. package/dist/index275.cjs +1 -1
  48. package/dist/index275.js +4 -47
  49. package/dist/index276.cjs +1 -1
  50. package/dist/index276.js +9 -11
  51. package/dist/index277.cjs +1 -1
  52. package/dist/index277.js +30 -174
  53. package/dist/index278.cjs +1 -2
  54. package/dist/index278.js +2 -92
  55. package/dist/index279.cjs +1 -1
  56. package/dist/index279.js +45 -38
  57. package/dist/index280.cjs +1 -1
  58. package/dist/index280.js +11 -4
  59. package/dist/index281.cjs +1 -1
  60. package/dist/index281.js +3 -3
  61. package/dist/index299.cjs +1 -1
  62. package/dist/index299.js +7 -37
  63. package/dist/index300.cjs +1 -1
  64. package/dist/index300.js +36 -14
  65. package/dist/index301.cjs +1 -1
  66. package/dist/index301.js +15 -8
  67. package/dist/index302.cjs +1 -1
  68. package/dist/index302.js +43 -8
  69. package/dist/index303.cjs +1 -1
  70. package/dist/index303.js +317 -39
  71. package/dist/index304.cjs +1 -1
  72. package/dist/index304.js +586 -301
  73. package/dist/index305.cjs +1 -1
  74. package/dist/index305.js +107 -603
  75. package/dist/index306.cjs +1 -1
  76. package/dist/index306.js +168 -110
  77. package/dist/index307.cjs +1 -1
  78. package/dist/index307.js +299 -165
  79. package/dist/index308.cjs +1 -1
  80. package/dist/index308.js +92 -300
  81. package/dist/index309.cjs +1 -1
  82. package/dist/index309.js +56 -93
  83. package/dist/index310.cjs +1 -1
  84. package/dist/index310.js +52 -55
  85. package/dist/index311.cjs +1 -1
  86. package/dist/index311.js +42 -51
  87. package/dist/index312.cjs +1 -1
  88. package/dist/index312.js +14 -43
  89. package/dist/index313.cjs +1 -1
  90. package/dist/index313.js +317 -15
  91. package/dist/index314.cjs +1 -1
  92. package/dist/index314.js +53 -311
  93. package/dist/index315.cjs +1 -1
  94. package/dist/index315.js +19 -59
  95. package/dist/index316.cjs +1 -1
  96. package/dist/index316.js +29 -19
  97. package/dist/index317.cjs +1 -1
  98. package/dist/index317.js +3 -29
  99. package/dist/index318.cjs +7 -1
  100. package/dist/index318.js +237 -3
  101. package/dist/index319.cjs +1 -7
  102. package/dist/index319.js +48 -238
  103. package/dist/index320.cjs +1 -1
  104. package/dist/index320.js +213 -48
  105. package/dist/index321.cjs +1 -1
  106. package/dist/index321.js +75 -206
  107. package/dist/index322.cjs +1 -1
  108. package/dist/index322.js +26 -78
  109. package/dist/index323.cjs +1 -1
  110. package/dist/index323.js +73 -26
  111. package/dist/index324.cjs +1 -1
  112. package/dist/index324.js +7 -75
  113. package/dist/index326.cjs +1 -1
  114. package/dist/index326.js +1 -1
  115. package/dist/index327.cjs +1 -1
  116. package/dist/index327.js +1 -1
  117. package/dist/index333.cjs +1 -1
  118. package/dist/index333.js +2 -2
  119. package/dist/index334.cjs +1 -1
  120. package/dist/index334.js +2 -2
  121. package/dist/index346.cjs +1 -1
  122. package/dist/index346.js +1 -1
  123. package/dist/index347.cjs +1 -1
  124. package/dist/index347.js +1 -1
  125. package/dist/index348.cjs +1 -1
  126. package/dist/index348.js +3 -3
  127. package/dist/index349.cjs +2 -1
  128. package/dist/index349.js +193 -4
  129. package/dist/index350.cjs +1 -2
  130. package/dist/index350.js +52 -168
  131. package/dist/index351.cjs +1 -1
  132. package/dist/index351.js +331 -65
  133. package/dist/index352.cjs +1 -1
  134. package/dist/index352.js +149 -332
  135. package/dist/index353.cjs +1 -1
  136. package/dist/index353.js +5 -161
  137. package/dist/index354.cjs +1 -1
  138. package/dist/index354.js +5 -5
  139. package/dist/index357.cjs +1 -1
  140. package/dist/index357.js +205 -8
  141. package/dist/index359.cjs +1 -1
  142. package/dist/index359.js +8 -205
  143. package/dist/index363.cjs +1 -1
  144. package/dist/index363.js +1 -1
  145. package/dist/index364.cjs +1 -1
  146. package/dist/index364.js +1 -1
  147. package/dist/index365.cjs +1 -1
  148. package/dist/index365.js +73 -3
  149. package/dist/index366.cjs +1 -1
  150. package/dist/index366.js +29 -138
  151. package/dist/index367.cjs +1 -1
  152. package/dist/index367.js +5 -73
  153. package/dist/index368.cjs +1 -1
  154. package/dist/index368.js +2 -30
  155. package/dist/index369.cjs +1 -1
  156. package/dist/index369.js +140 -5
  157. package/dist/index370.cjs +1 -1
  158. package/dist/index370.js +1 -1
  159. package/dist/index373.cjs +1 -1
  160. package/dist/index373.js +1 -1
  161. package/dist/index374.cjs +1 -1
  162. package/dist/index374.js +1 -1
  163. package/dist/index375.cjs +1 -1
  164. package/dist/index375.js +2 -2
  165. package/dist/index379.cjs +1 -1
  166. package/dist/index379.js +1 -1
  167. package/dist/index380.cjs +1 -1
  168. package/dist/index380.js +1 -1
  169. package/dist/index381.cjs +1 -1
  170. package/dist/index381.js +22 -2
  171. package/dist/index382.cjs +1 -1
  172. package/dist/index382.js +2 -22
  173. package/dist/index385.cjs +1 -1
  174. package/dist/index385.js +2 -2
  175. package/dist/index77.cjs +1 -1
  176. package/dist/index77.js +13 -13
  177. package/dist/index99.cjs +1 -1
  178. package/dist/index99.js +1 -1
  179. package/package.json +5 -5
package/dist/index277.js CHANGED
@@ -1,177 +1,33 @@
1
- import { BaseError as o } from "./index278.js";
2
- import { assertStartOffset as x, assertEndOffset as $, pad as b, assertSize as f } from "./index279.js";
3
- import { stringify as p } from "./index280.js";
4
- const y = /* @__PURE__ */ new TextEncoder(), h = /* @__PURE__ */ Array.from({ length: 256 }, (e, r) => r.toString(16).padStart(2, "0"));
5
- function z(e, r = {}) {
6
- const { strict: t = !1 } = r;
7
- if (!e)
8
- throw new d(e);
9
- if (typeof e != "string")
10
- throw new d(e);
11
- if (t && !/^0x[0-9a-fA-F]*$/.test(e))
12
- throw new g(e);
13
- if (!e.startsWith("0x"))
14
- throw new g(e);
15
- }
16
- function A(...e) {
17
- return `0x${e.reduce((r, t) => r + t.replace("0x", ""), "")}`;
18
- }
19
- function N(e) {
20
- return e instanceof Uint8Array ? c(e) : Array.isArray(e) ? c(new Uint8Array(e)) : e;
21
- }
22
- function P(e, r = {}) {
23
- const t = `0x${Number(e)}`;
24
- return typeof r.size == "number" ? (f(t, r.size), m(t, r.size)) : t;
25
- }
26
- function c(e, r = {}) {
27
- let t = "";
28
- for (let s = 0; s < e.length; s++)
29
- t += h[e[s]];
30
- const n = `0x${t}`;
31
- return typeof r.size == "number" ? (f(n, r.size), w(n, r.size)) : n;
32
- }
33
- function V(e, r = {}) {
34
- const { signed: t, size: n } = r, s = BigInt(e);
35
- let i;
36
- n ? t ? i = (1n << BigInt(n) * 8n - 1n) - 1n : i = 2n ** (BigInt(n) * 8n) - 1n : typeof e == "number" && (i = BigInt(Number.MAX_SAFE_INTEGER));
37
- const u = typeof i == "bigint" && t ? -i - 1n : 0;
38
- if (i && s > i || s < u) {
39
- const a = typeof e == "bigint" ? "n" : "";
40
- throw new O({
41
- max: i ? `${i}${a}` : void 0,
42
- min: `${u}${a}`,
43
- signed: t,
44
- size: n,
45
- value: `${e}${a}`
46
- });
47
- }
48
- const l = `0x${(t && s < 0 ? BigInt.asUintN(n * 8, BigInt(s)) : s).toString(16)}`;
49
- return n ? m(l, n) : l;
50
- }
51
- function j(e, r = {}) {
52
- return c(y.encode(e), r);
53
- }
54
- function m(e, r) {
55
- return b(e, { dir: "left", size: r });
56
- }
57
- function w(e, r) {
58
- return b(e, { dir: "right", size: r });
59
- }
60
- function _(e, r, t, n = {}) {
61
- const { strict: s } = n;
62
- x(e, r);
63
- const i = `0x${e.replace("0x", "").slice((r ?? 0) * 2, (t ?? e.length) * 2)}`;
64
- return s && $(i, r, t), i;
65
- }
66
- function v(e) {
67
- return Math.ceil((e.length - 2) / 2);
68
- }
69
- function E(e, r = {}) {
70
- const { signed: t } = r;
71
- r.size && f(e, r.size);
72
- const n = BigInt(e);
73
- if (!t)
74
- return n;
75
- const s = (e.length - 2) / 2, i = (1n << BigInt(s) * 8n) - 1n, u = i >> 1n;
76
- return n <= u ? n : n - i - 1n;
77
- }
78
- function M(e, r = {}) {
79
- const { signed: t, size: n } = r;
80
- return Number(!t && !n ? e : E(e, r));
81
- }
82
- function R(e, r = {}) {
83
- const { strict: t = !1 } = r;
84
- try {
85
- return z(e, { strict: t }), !0;
86
- } catch {
87
- return !1;
88
- }
89
- }
90
- class O extends o {
91
- constructor({ max: r, min: t, signed: n, size: s, value: i }) {
92
- super(`Number \`${i}\` is not in safe${s ? ` ${s * 8}-bit` : ""}${n ? " signed" : " unsigned"} integer range ${r ? `(\`${t}\` to \`${r}\`)` : `(above \`${t}\`)`}`), Object.defineProperty(this, "name", {
93
- enumerable: !0,
94
- configurable: !0,
95
- writable: !0,
96
- value: "Hex.IntegerOutOfRangeError"
97
- });
98
- }
99
- }
100
- class d extends o {
101
- constructor(r) {
102
- super(`Value \`${typeof r == "object" ? p(r) : r}\` of type \`${typeof r}\` is an invalid hex type.`, {
103
- metaMessages: ['Hex types must be represented as `"0x${string}"`.']
104
- }), Object.defineProperty(this, "name", {
105
- enumerable: !0,
106
- configurable: !0,
107
- writable: !0,
108
- value: "Hex.InvalidHexTypeError"
109
- });
110
- }
111
- }
112
- class g extends o {
113
- constructor(r) {
114
- super(`Value \`${r}\` is an invalid hex value.`, {
115
- metaMessages: [
116
- 'Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).'
117
- ]
118
- }), Object.defineProperty(this, "name", {
119
- enumerable: !0,
120
- configurable: !0,
121
- writable: !0,
122
- value: "Hex.InvalidHexValueError"
123
- });
124
- }
125
- }
126
- class T extends o {
127
- constructor({ givenSize: r, maxSize: t }) {
128
- super(`Size cannot exceed \`${t}\` bytes. Given size: \`${r}\` bytes.`), Object.defineProperty(this, "name", {
129
- enumerable: !0,
130
- configurable: !0,
131
- writable: !0,
132
- value: "Hex.SizeOverflowError"
133
- });
134
- }
135
- }
136
- class U extends o {
137
- constructor({ offset: r, position: t, size: n }) {
138
- super(`Slice ${t === "start" ? "starting" : "ending"} at offset \`${r}\` is out-of-bounds (size: \`${n}\`).`), Object.defineProperty(this, "name", {
139
- enumerable: !0,
140
- configurable: !0,
141
- writable: !0,
142
- value: "Hex.SliceOffsetOutOfBoundsError"
143
- });
144
- }
145
- }
146
- class F extends o {
147
- constructor({ size: r, targetSize: t, type: n }) {
148
- super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${r}\`) exceeds padding size (\`${t}\`).`), Object.defineProperty(this, "name", {
149
- enumerable: !0,
150
- configurable: !0,
151
- writable: !0,
152
- value: "Hex.SizeExceedsPaddingSizeError"
153
- });
154
- }
1
+ import { fromNumber as a } from "./index272.js";
2
+ import { toRpc as e } from "./index359.js";
3
+ function n(t) {
4
+ return {
5
+ ...typeof t.baseFeePerGas == "bigint" && {
6
+ baseFeePerGas: a(t.baseFeePerGas)
7
+ },
8
+ ...typeof t.blobBaseFee == "bigint" && {
9
+ blobBaseFee: a(t.blobBaseFee)
10
+ },
11
+ ...typeof t.feeRecipient == "string" && {
12
+ feeRecipient: t.feeRecipient
13
+ },
14
+ ...typeof t.gasLimit == "bigint" && {
15
+ gasLimit: a(t.gasLimit)
16
+ },
17
+ ...typeof t.number == "bigint" && {
18
+ number: a(t.number)
19
+ },
20
+ ...typeof t.prevRandao == "bigint" && {
21
+ prevRandao: a(t.prevRandao)
22
+ },
23
+ ...typeof t.time == "bigint" && {
24
+ time: a(t.time)
25
+ },
26
+ ...t.withdrawals && {
27
+ withdrawals: t.withdrawals.map(e)
28
+ }
29
+ };
155
30
  }
156
31
  export {
157
- O as IntegerOutOfRangeError,
158
- d as InvalidHexTypeError,
159
- g as InvalidHexValueError,
160
- F as SizeExceedsPaddingSizeError,
161
- T as SizeOverflowError,
162
- U as SliceOffsetOutOfBoundsError,
163
- z as assert,
164
- A as concat,
165
- N as from,
166
- P as fromBoolean,
167
- c as fromBytes,
168
- V as fromNumber,
169
- j as fromString,
170
- m as padLeft,
171
- w as padRight,
172
- v as size,
173
- _ as slice,
174
- E as toBigInt,
175
- M as toNumber,
176
- R as validate
32
+ n as toRpc
177
33
  };
package/dist/index278.cjs CHANGED
@@ -1,2 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index349.cjs");class r extends Error{static setStaticOptions(t){r.prototype.docsOrigin=t.docsOrigin,r.prototype.showVersion=t.showVersion,r.prototype.version=t.version}constructor(t,e={}){const i=(()=>{var a;if(e.cause instanceof r){if(e.cause.details)return e.cause.details;if(e.cause.shortMessage)return e.cause.shortMessage}return e.cause&&"details"in e.cause&&typeof e.cause.details=="string"?e.cause.details:(a=e.cause)!=null&&a.message?e.cause.message:e.details})(),u=e.cause instanceof r&&e.cause.docsPath||e.docsPath,n=e.docsOrigin??r.prototype.docsOrigin,l=`${n}${u??""}`,c=!!(e.version??r.prototype.showVersion),o=e.version??r.prototype.version,b=[t||"An error occurred.",...e.metaMessages?["",...e.metaMessages]:[],...i||u||c?["",i?`Details: ${i}`:void 0,u?`See: ${l}`:void 0,c?`Version: ${o}`:void 0]:[]].filter(a=>typeof a=="string").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,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{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,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{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,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=e.cause,this.details=i,this.docs=l,this.docsOrigin=n,this.docsPath=u,this.shortMessage=t,this.showVersion=c,this.version=o}walk(t){return d(this,t)}}Object.defineProperty(r,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${f.getVersion()}`}});r.setStaticOptions(r.defaultStaticOptions);function d(s,t){return t!=null&&t(s)?s:s&&typeof s=="object"&&"cause"in s&&s.cause?d(s.cause,t):t?null:s}exports.BaseError=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0x82ad56cb";exports.aggregate3Signature=e;
package/dist/index278.js CHANGED
@@ -1,94 +1,4 @@
1
- import { getVersion as f } from "./index349.js";
2
- class r extends Error {
3
- static setStaticOptions(t) {
4
- r.prototype.docsOrigin = t.docsOrigin, r.prototype.showVersion = t.showVersion, r.prototype.version = t.version;
5
- }
6
- constructor(t, e = {}) {
7
- const i = (() => {
8
- var a;
9
- if (e.cause instanceof r) {
10
- if (e.cause.details)
11
- return e.cause.details;
12
- if (e.cause.shortMessage)
13
- return e.cause.shortMessage;
14
- }
15
- return e.cause && "details" in e.cause && typeof e.cause.details == "string" ? e.cause.details : (a = e.cause) != null && a.message ? e.cause.message : e.details;
16
- })(), u = e.cause instanceof r && e.cause.docsPath || e.docsPath, n = e.docsOrigin ?? r.prototype.docsOrigin, l = `${n}${u ?? ""}`, c = !!(e.version ?? r.prototype.showVersion), o = e.version ?? r.prototype.version, b = [
17
- t || "An error occurred.",
18
- ...e.metaMessages ? ["", ...e.metaMessages] : [],
19
- ...i || u || c ? [
20
- "",
21
- i ? `Details: ${i}` : void 0,
22
- u ? `See: ${l}` : void 0,
23
- c ? `Version: ${o}` : void 0
24
- ] : []
25
- ].filter((a) => typeof a == "string").join(`
26
- `);
27
- super(b, e.cause ? { cause: e.cause } : void 0), Object.defineProperty(this, "details", {
28
- enumerable: !0,
29
- configurable: !0,
30
- writable: !0,
31
- value: void 0
32
- }), Object.defineProperty(this, "docs", {
33
- enumerable: !0,
34
- configurable: !0,
35
- writable: !0,
36
- value: void 0
37
- }), Object.defineProperty(this, "docsOrigin", {
38
- enumerable: !0,
39
- configurable: !0,
40
- writable: !0,
41
- value: void 0
42
- }), Object.defineProperty(this, "docsPath", {
43
- enumerable: !0,
44
- configurable: !0,
45
- writable: !0,
46
- value: void 0
47
- }), Object.defineProperty(this, "shortMessage", {
48
- enumerable: !0,
49
- configurable: !0,
50
- writable: !0,
51
- value: void 0
52
- }), Object.defineProperty(this, "showVersion", {
53
- enumerable: !0,
54
- configurable: !0,
55
- writable: !0,
56
- value: void 0
57
- }), Object.defineProperty(this, "version", {
58
- enumerable: !0,
59
- configurable: !0,
60
- writable: !0,
61
- value: void 0
62
- }), Object.defineProperty(this, "cause", {
63
- enumerable: !0,
64
- configurable: !0,
65
- writable: !0,
66
- value: void 0
67
- }), Object.defineProperty(this, "name", {
68
- enumerable: !0,
69
- configurable: !0,
70
- writable: !0,
71
- value: "BaseError"
72
- }), this.cause = e.cause, this.details = i, this.docs = l, this.docsOrigin = n, this.docsPath = u, this.shortMessage = t, this.showVersion = c, this.version = o;
73
- }
74
- walk(t) {
75
- return d(this, t);
76
- }
77
- }
78
- Object.defineProperty(r, "defaultStaticOptions", {
79
- enumerable: !0,
80
- configurable: !0,
81
- writable: !0,
82
- value: {
83
- docsOrigin: "https://oxlib.sh",
84
- showVersion: !1,
85
- version: `ox@${f()}`
86
- }
87
- });
88
- r.setStaticOptions(r.defaultStaticOptions);
89
- function d(s, t) {
90
- return t != null && t(s) ? s : s && typeof s == "object" && "cause" in s && s.cause ? d(s.cause, t) : t ? null : s;
91
- }
1
+ const a = "0x82ad56cb";
92
2
  export {
93
- r as BaseError
3
+ a as aggregate3Signature
94
4
  };
package/dist/index279.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index277.cjs");function n(t,e){if(i.size(t)>e)throw new i.SizeOverflowError({givenSize:i.size(t),maxSize:e})}function o(t,e){if(typeof e=="number"&&e>0&&e>i.size(t)-1)throw new i.SliceOffsetOutOfBoundsError({offset:e,position:"start",size:i.size(t)})}function z(t,e,r){if(typeof e=="number"&&typeof r=="number"&&i.size(t)!==r-e)throw new i.SliceOffsetOutOfBoundsError({offset:r,position:"end",size:i.size(t)})}function a(t,e={}){const{dir:r,size:s=32}=e;if(s===0)return t;const f=t.replace("0x","");if(f.length>s*2)throw new i.SizeExceedsPaddingSizeError({size:Math.ceil(f.length/2),targetSize:s,type:"Hex"});return`0x${f[r==="right"?"padEnd":"padStart"](s*2,"0")}`}exports.assertEndOffset=z;exports.assertSize=n;exports.assertStartOffset=o;exports.pad=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index78.cjs"),a=require("./index201.cjs"),f=require("./index198.cjs"),S=require("./index79.cjs"),c=require("./index81.cjs");function d(r){if(!(!r||r.length===0))return r.reduce((t,{slot:e,value:n})=>{if(e.length!==66)throw new a.InvalidBytesLengthError({size:e.length,targetSize:66,type:"hex"});if(n.length!==66)throw new a.InvalidBytesLengthError({size:n.length,targetSize:66,type:"hex"});return t[e]=n,t},{})}function u(r){const{balance:t,nonce:e,state:n,stateDiff:s,code:o}=r,i={};if(o!==void 0&&(i.code=o),t!==void 0&&(i.balance=c.numberToHex(t)),e!==void 0&&(i.nonce=c.numberToHex(e)),n!==void 0&&(i.state=d(n)),s!==void 0){if(i.state)throw new f.StateAssignmentConflictError;i.stateDiff=d(s)}return i}function h(r){if(!r)return;const t={};for(const{address:e,...n}of r){if(!S.isAddress(e,{strict:!1}))throw new l.InvalidAddressError({address:e});if(t[e])throw new f.AccountStateConflictError({address:e});t[e]=u(n)}return t}exports.serializeAccountStateOverride=u;exports.serializeStateMapping=d;exports.serializeStateOverride=h;
package/dist/index279.js CHANGED
@@ -1,43 +1,50 @@
1
- import { size as i, SliceOffsetOutOfBoundsError as f, SizeExceedsPaddingSizeError as s, SizeOverflowError as p } from "./index277.js";
2
- function c(t, e) {
3
- if (i(t) > e)
4
- throw new p({
5
- givenSize: i(t),
6
- maxSize: e
7
- });
1
+ import { InvalidAddressError as a } from "./index78.js";
2
+ import { InvalidBytesLengthError as d } from "./index201.js";
3
+ import { AccountStateConflictError as u, StateAssignmentConflictError as h } from "./index198.js";
4
+ import { isAddress as l } from "./index79.js";
5
+ import { numberToHex as c } from "./index81.js";
6
+ function s(r) {
7
+ if (!(!r || r.length === 0))
8
+ return r.reduce((t, { slot: e, value: n }) => {
9
+ if (e.length !== 66)
10
+ throw new d({
11
+ size: e.length,
12
+ targetSize: 66,
13
+ type: "hex"
14
+ });
15
+ if (n.length !== 66)
16
+ throw new d({
17
+ size: n.length,
18
+ targetSize: 66,
19
+ type: "hex"
20
+ });
21
+ return t[e] = n, t;
22
+ }, {});
8
23
  }
9
- function S(t, e) {
10
- if (typeof e == "number" && e > 0 && e > i(t) - 1)
11
- throw new f({
12
- offset: e,
13
- position: "start",
14
- size: i(t)
15
- });
24
+ function m(r) {
25
+ const { balance: t, nonce: e, state: n, stateDiff: o, code: f } = r, i = {};
26
+ if (f !== void 0 && (i.code = f), t !== void 0 && (i.balance = c(t)), e !== void 0 && (i.nonce = c(e)), n !== void 0 && (i.state = s(n)), o !== void 0) {
27
+ if (i.state)
28
+ throw new h();
29
+ i.stateDiff = s(o);
30
+ }
31
+ return i;
16
32
  }
17
- function d(t, e, r) {
18
- if (typeof e == "number" && typeof r == "number" && i(t) !== r - e)
19
- throw new f({
20
- offset: r,
21
- position: "end",
22
- size: i(t)
23
- });
24
- }
25
- function u(t, e = {}) {
26
- const { dir: r, size: n = 32 } = e;
27
- if (n === 0)
28
- return t;
29
- const o = t.replace("0x", "");
30
- if (o.length > n * 2)
31
- throw new s({
32
- size: Math.ceil(o.length / 2),
33
- targetSize: n,
34
- type: "Hex"
35
- });
36
- return `0x${o[r === "right" ? "padEnd" : "padStart"](n * 2, "0")}`;
33
+ function A(r) {
34
+ if (!r)
35
+ return;
36
+ const t = {};
37
+ for (const { address: e, ...n } of r) {
38
+ if (!l(e, { strict: !1 }))
39
+ throw new a({ address: e });
40
+ if (t[e])
41
+ throw new u({ address: e });
42
+ t[e] = m(n);
43
+ }
44
+ return t;
37
45
  }
38
46
  export {
39
- d as assertEndOffset,
40
- c as assertSize,
41
- S as assertStartOffset,
42
- u as pad
47
+ m as serializeAccountStateOverride,
48
+ s as serializeStateMapping,
49
+ A as serializeStateOverride
43
50
  };
package/dist/index280.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n="#__bigint";function e(i,f,r){return JSON.stringify(i,(g,t)=>typeof t=="bigint"?t.toString()+n:t,r)}exports.stringify=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index289.cjs"),c=require("./index290.cjs"),o=require("./index291.cjs");function a(t){const n=c.parseStructs(t),r=[],i=t.length;for(let e=0;e<i;e++){const s=t[e];u.isStructSignature(s)||r.push(o.parseSignature(s,n))}return r}exports.parseAbi=a;
package/dist/index280.js CHANGED
@@ -1,7 +1,14 @@
1
- const r = "#__bigint";
2
- function g(i, f, n) {
3
- return JSON.stringify(i, (e, t) => typeof t == "bigint" ? t.toString() + r : t, n);
1
+ import { isStructSignature as c } from "./index289.js";
2
+ import { parseStructs as s } from "./index290.js";
3
+ import { parseSignature as p } from "./index291.js";
4
+ function a(t) {
5
+ const i = s(t), o = [], e = t.length;
6
+ for (let r = 0; r < e; r++) {
7
+ const n = t[r];
8
+ c(n) || o.push(p(n, i));
9
+ }
10
+ return o;
4
11
  }
5
12
  export {
6
- g as stringify
13
+ a as parseAbi
7
14
  };
package/dist/index281.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index278.cjs"),o=require("./index277.cjs"),h=require("./index280.cjs"),y=require("./index282.cjs");function c(r,e={}){const{recovered:t}=e;if(typeof r.r>"u")throw new a({signature:r});if(typeof r.s>"u")throw new a({signature:r});if(t&&typeof r.yParity>"u")throw new a({signature:r});if(r.r<0n||r.r>y.maxUint256)throw new P({value:r.r});if(r.s<0n||r.s>y.maxUint256)throw new w({value:r.s});if(typeof r.yParity=="number"&&r.yParity!==0&&r.yParity!==1)throw new s({value:r.yParity})}function d(r){return l(o.fromBytes(r))}function l(r){if(r.length!==130&&r.length!==132)throw new p({signature:r});const e=BigInt(o.slice(r,0,32)),t=BigInt(o.slice(r,32,64)),n=(()=>{const f=+`0x${r.slice(130)}`;if(!Number.isNaN(f))try{return u(f)}catch{throw new s({value:f})}})();return typeof n>"u"?{r:e,s:t}:{r:e,s:t,yParity:n}}function I(r){if(!(typeof r.r>"u")&&!(typeof r.s>"u"))return v(r)}function v(r){const e=typeof r=="string"?l(r):r instanceof Uint8Array?d(r):typeof r.r=="string"?m(r):r.v?b(r):{r:r.r,s:r.s,...typeof r.yParity<"u"?{yParity:r.yParity}:{}};return c(e),e}function b(r){return{r:r.r,s:r.s,yParity:u(r.v)}}function m(r){const e=(()=>{const t=r.v?Number(r.v):void 0;let n=r.yParity?Number(r.yParity):void 0;if(typeof t=="number"&&typeof n!="number"&&(n=u(t)),typeof n!="number")throw new s({value:r.yParity});return n})();return{r:BigInt(r.r),s:BigInt(r.s),yParity:e}}function u(r){if(r===0||r===27)return 0;if(r===1||r===28)return 1;if(r>=35)return r%2===0?1:0;throw new E({value:r})}class p extends i.BaseError{constructor({signature:e}){super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${o.size(o.from(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class a extends i.BaseError{constructor({signature:e}){super(`Signature \`${h.stringify(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class P extends i.BaseError{constructor({value:e}){super(`Value \`${e}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class w extends i.BaseError{constructor({value:e}){super(`Value \`${e}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class s extends i.BaseError{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class E extends i.BaseError{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}exports.InvalidRError=P;exports.InvalidSError=w;exports.InvalidSerializedSizeError=p;exports.InvalidVError=E;exports.InvalidYParityError=s;exports.MissingPropertiesError=a;exports.assert=c;exports.extract=I;exports.from=v;exports.fromBytes=d;exports.fromHex=l;exports.fromLegacy=b;exports.fromRpc=m;exports.vToYParity=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index273.cjs"),o=require("./index272.cjs"),h=require("./index275.cjs"),y=require("./index282.cjs");function c(r,e={}){const{recovered:t}=e;if(typeof r.r>"u")throw new a({signature:r});if(typeof r.s>"u")throw new a({signature:r});if(t&&typeof r.yParity>"u")throw new a({signature:r});if(r.r<0n||r.r>y.maxUint256)throw new P({value:r.r});if(r.s<0n||r.s>y.maxUint256)throw new w({value:r.s});if(typeof r.yParity=="number"&&r.yParity!==0&&r.yParity!==1)throw new s({value:r.yParity})}function d(r){return l(o.fromBytes(r))}function l(r){if(r.length!==130&&r.length!==132)throw new p({signature:r});const e=BigInt(o.slice(r,0,32)),t=BigInt(o.slice(r,32,64)),n=(()=>{const f=+`0x${r.slice(130)}`;if(!Number.isNaN(f))try{return u(f)}catch{throw new s({value:f})}})();return typeof n>"u"?{r:e,s:t}:{r:e,s:t,yParity:n}}function I(r){if(!(typeof r.r>"u")&&!(typeof r.s>"u"))return v(r)}function v(r){const e=typeof r=="string"?l(r):r instanceof Uint8Array?d(r):typeof r.r=="string"?m(r):r.v?b(r):{r:r.r,s:r.s,...typeof r.yParity<"u"?{yParity:r.yParity}:{}};return c(e),e}function b(r){return{r:r.r,s:r.s,yParity:u(r.v)}}function m(r){const e=(()=>{const t=r.v?Number(r.v):void 0;let n=r.yParity?Number(r.yParity):void 0;if(typeof t=="number"&&typeof n!="number"&&(n=u(t)),typeof n!="number")throw new s({value:r.yParity});return n})();return{r:BigInt(r.r),s:BigInt(r.s),yParity:e}}function u(r){if(r===0||r===27)return 0;if(r===1||r===28)return 1;if(r>=35)return r%2===0?1:0;throw new E({value:r})}class p extends i.BaseError{constructor({signature:e}){super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${o.size(o.from(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class a extends i.BaseError{constructor({signature:e}){super(`Signature \`${h.stringify(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class P extends i.BaseError{constructor({value:e}){super(`Value \`${e}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class w extends i.BaseError{constructor({value:e}){super(`Value \`${e}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class s extends i.BaseError{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class E extends i.BaseError{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}exports.InvalidRError=P;exports.InvalidSError=w;exports.InvalidSerializedSizeError=p;exports.InvalidVError=E;exports.InvalidYParityError=s;exports.MissingPropertiesError=a;exports.assert=c;exports.extract=I;exports.from=v;exports.fromBytes=d;exports.fromHex=l;exports.fromLegacy=b;exports.fromRpc=m;exports.vToYParity=u;
package/dist/index281.js CHANGED
@@ -1,6 +1,6 @@
1
- import { BaseError as i } from "./index278.js";
2
- import { slice as y, fromBytes as c, size as d, from as m } from "./index277.js";
3
- import { stringify as p } from "./index280.js";
1
+ import { BaseError as i } from "./index273.js";
2
+ import { slice as y, fromBytes as c, size as d, from as m } from "./index272.js";
3
+ import { stringify as p } from "./index275.js";
4
4
  import { maxUint256 as s } from "./index282.js";
5
5
  function b(e, r = {}) {
6
6
  const { recovered: t } = r;
package/dist/index299.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=new Map,r=new Map;let b=0;function w(s,a,C){const o=++b,c=()=>i.get(s)||[],m=()=>{const t=c();i.set(s,t.filter(n=>n.id!==o))},f=()=>{const t=c();if(!t.some(e=>e.id===o))return;const n=r.get(s);if(t.length===1&&n){const e=n();e instanceof Promise&&e.catch(()=>{})}m()},l=c();if(i.set(s,[...l,{id:o,fns:a}]),l&&l.length>0)return f;const u={};for(const t in a)u[t]=(...n)=>{var p,g;const e=c();if(e.length!==0)for(const y of e)(g=(p=y.fns)[t])==null||g.call(p,...n)};const h=C(u);return typeof h=="function"&&r.set(s,h),f}exports.cleanupCache=r;exports.listenersCache=i;exports.observe=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function p(e,{method:u}){var s,o;const r={};return e.transport.type==="fallback"&&((o=(s=e.transport).onResponse)==null||o.call(s,({method:t,response:a,status:c,transport:n})=>{c==="success"&&u===t&&(r[a]=n.request)})),t=>r[t]||e.request}exports.createFilterRequestScope=p;
package/dist/index299.js CHANGED
@@ -1,40 +1,10 @@
1
- const f = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
2
- let k = 0;
3
- function y(s, l, m) {
4
- const i = ++k, c = () => f.get(s) || [], w = () => {
5
- const n = c();
6
- f.set(s, n.filter((e) => e.id !== i));
7
- }, r = () => {
8
- const n = c();
9
- if (!n.some((t) => t.id === i))
10
- return;
11
- const e = g.get(s);
12
- if (n.length === 1 && e) {
13
- const t = e();
14
- t instanceof Promise && t.catch(() => {
15
- });
16
- }
17
- w();
18
- }, o = c();
19
- if (f.set(s, [
20
- ...o,
21
- { id: i, fns: l }
22
- ]), o && o.length > 0)
23
- return r;
24
- const u = {};
25
- for (const n in l)
26
- u[n] = (...e) => {
27
- var p, h;
28
- const t = c();
29
- if (t.length !== 0)
30
- for (const C of t)
31
- (h = (p = C.fns)[n]) == null || h.call(p, ...e);
32
- };
33
- const a = m(u);
34
- return typeof a == "function" && g.set(s, a), r;
1
+ function c(e, { method: p }) {
2
+ var r, o;
3
+ const t = {};
4
+ return e.transport.type === "fallback" && ((o = (r = e.transport).onResponse) == null || o.call(r, ({ method: s, response: n, status: u, transport: a }) => {
5
+ u === "success" && p === s && (t[n] = a.request);
6
+ })), (s) => t[s] || e.request;
35
7
  }
36
8
  export {
37
- g as cleanupCache,
38
- f as listenersCache,
39
- y as observe
9
+ c as createFilterRequestScope
40
10
  };
package/dist/index300.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index252.cjs");function s(o,{emitOnBegin:w,initialWaitTime:t,interval:c}){let l=!0;const a=()=>l=!1;return(async()=>{let e;w&&(e=await o({unpoll:a}));const r=await(t==null?void 0:t(e))??c;await u.wait(r);const n=async()=>{l&&(await o({unpoll:a}),await u.wait(c),n())};n()})(),a}exports.poll=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=new Map,r=new Map;let b=0;function w(s,a,C){const o=++b,c=()=>i.get(s)||[],m=()=>{const t=c();i.set(s,t.filter(n=>n.id!==o))},f=()=>{const t=c();if(!t.some(e=>e.id===o))return;const n=r.get(s);if(t.length===1&&n){const e=n();e instanceof Promise&&e.catch(()=>{})}m()},l=c();if(i.set(s,[...l,{id:o,fns:a}]),l&&l.length>0)return f;const u={};for(const t in a)u[t]=(...n)=>{var p,g;const e=c();if(e.length!==0)for(const y of e)(g=(p=y.fns)[t])==null||g.call(p,...n)};const h=C(u);return typeof h=="function"&&r.set(s,h),f}exports.cleanupCache=r;exports.listenersCache=i;exports.observe=w;
package/dist/index300.js CHANGED
@@ -1,18 +1,40 @@
1
- import { wait as r } from "./index252.js";
2
- function e(o, { emitOnBegin: s, initialWaitTime: t, interval: c }) {
3
- let w = !0;
4
- const a = () => w = !1;
5
- return (async () => {
6
- let n;
7
- s && (n = await o({ unpoll: a }));
8
- const u = await (t == null ? void 0 : t(n)) ?? c;
9
- await r(u);
10
- const l = async () => {
11
- w && (await o({ unpoll: a }), await r(c), l());
1
+ const f = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
2
+ let k = 0;
3
+ function y(s, l, m) {
4
+ const i = ++k, c = () => f.get(s) || [], w = () => {
5
+ const n = c();
6
+ f.set(s, n.filter((e) => e.id !== i));
7
+ }, r = () => {
8
+ const n = c();
9
+ if (!n.some((t) => t.id === i))
10
+ return;
11
+ const e = g.get(s);
12
+ if (n.length === 1 && e) {
13
+ const t = e();
14
+ t instanceof Promise && t.catch(() => {
15
+ });
16
+ }
17
+ w();
18
+ }, o = c();
19
+ if (f.set(s, [
20
+ ...o,
21
+ { id: i, fns: l }
22
+ ]), o && o.length > 0)
23
+ return r;
24
+ const u = {};
25
+ for (const n in l)
26
+ u[n] = (...e) => {
27
+ var p, h;
28
+ const t = c();
29
+ if (t.length !== 0)
30
+ for (const C of t)
31
+ (h = (p = C.fns)[n]) == null || h.call(p, ...e);
12
32
  };
13
- l();
14
- })(), a;
33
+ const a = m(u);
34
+ return typeof a == "function" && g.set(s, a), r;
15
35
  }
16
36
  export {
17
- e as poll
37
+ g as cleanupCache,
38
+ f as listenersCache,
39
+ y as observe
18
40
  };
package/dist/index301.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 u=require("./index252.cjs");function s(o,{emitOnBegin:w,initialWaitTime:t,interval:c}){let l=!0;const a=()=>l=!1;return(async()=>{let e;w&&(e=await o({unpoll:a}));const r=await(t==null?void 0:t(e))??c;await u.wait(r);const n=async()=>{l&&(await o({unpoll:a}),await u.wait(c),n())};n()})(),a}exports.poll=s;
package/dist/index301.js CHANGED
@@ -1,11 +1,18 @@
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 { wait as r } from "./index252.js";
2
+ function e(o, { emitOnBegin: s, initialWaitTime: t, interval: c }) {
3
+ let w = !0;
4
+ const a = () => w = !1;
5
+ return (async () => {
6
+ let n;
7
+ s && (n = await o({ unpoll: a }));
8
+ const u = await (t == null ? void 0 : t(n)) ?? c;
9
+ await r(u);
10
+ const l = async () => {
11
+ w && (await o({ unpoll: a }), await r(c), l());
12
+ };
13
+ l();
14
+ })(), a;
8
15
  }
9
16
  export {
10
- i as withResolvers
17
+ e as poll
11
18
  };
package/dist/index302.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function p(e,{method:u}){var s,o;const r={};return e.transport.type==="fallback"&&((o=(s=e.transport).onResponse)==null||o.call(s,({method:t,response:a,status:c,transport:n})=>{c==="success"&&u===t&&(r[a]=n.request)})),t=>r[t]||e.request}exports.createFilterRequestScope=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var d=i=>{throw TypeError(i)},p=(i,t,e)=>t.has(i)||d("Cannot "+e),r=(i,t,e)=>(p(i,t,"read from private field"),t.get(i)),o=(i,t,e)=>t.has(i)?d("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e),l=(i,t,e,a)=>(p(i,t,"write to private field"),t.set(i,e),e),h,s;const u=class f{constructor({prefix:t,cache:e}={}){o(this,h),o(this,s),l(this,h,t??[]),l(this,s,e??new Map)}read(t,e){const a=[r(this,h),...t].join(":");if(r(this,s).has(a))return r(this,s).get(a);const n=e();return r(this,s).set(a,n),typeof n=="object"&&n!==null&&"then"in n?Promise.resolve(n).then(c=>(r(this,s).set(a,c),c)).catch(c=>{throw r(this,s).delete(a),c}):n}readSync(t,e){const a=[r(this,h),...t].join(":");if(r(this,s).has(a))return r(this,s).get(a);const n=e();return r(this,s).set(a,n),n}clear(t){const e=[...r(this,h),...t??[]].join(":");if(!e){r(this,s).clear();return}for(const a of r(this,s).keys())a.startsWith(e)&&r(this,s).delete(a)}scope(t){return new f({prefix:[...r(this,h),...Array.isArray(t)?t:[t]],cache:r(this,s)})}};h=new WeakMap;s=new WeakMap;let y=u;exports.ClientCache=y;