@pufferfinance/puffer-sdk 1.4.1 → 1.5.0

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 (202) hide show
  1. package/dist/api/puffer-client-helpers.cjs +2 -0
  2. package/dist/api/puffer-client-helpers.cjs.map +1 -0
  3. package/dist/api/puffer-client-helpers.d.ts +0 -1
  4. package/dist/api/puffer-client-helpers.js +142 -0
  5. package/dist/api/puffer-client-helpers.js.map +1 -0
  6. package/dist/api/puffer-client.cjs +2 -0
  7. package/dist/api/puffer-client.cjs.map +1 -0
  8. package/dist/api/puffer-client.d.ts +6 -1
  9. package/dist/api/puffer-client.js +97 -0
  10. package/dist/api/puffer-client.js.map +1 -0
  11. package/dist/{ccip-DVMkohQx.js → ccip-D4klNwCt.js} +28 -27
  12. package/dist/{ccip-DVMkohQx.js.map → ccip-D4klNwCt.js.map} +1 -1
  13. package/dist/ccip-DLDqFodf.cjs +2 -0
  14. package/dist/{ccip-BlCTKpsk.cjs.map → ccip-DLDqFodf.cjs.map} +1 -1
  15. package/dist/chains/constants.cjs +2 -0
  16. package/dist/chains/constants.cjs.map +1 -0
  17. package/dist/chains/constants.d.ts +3 -2
  18. package/dist/chains/constants.js +6 -0
  19. package/dist/chains/constants.js.map +1 -0
  20. package/dist/constants-BvU-JhfL.cjs +9 -0
  21. package/dist/constants-BvU-JhfL.cjs.map +1 -0
  22. package/dist/constants-rWWWhxR_.js +2099 -0
  23. package/dist/constants-rWWWhxR_.js.map +1 -0
  24. package/dist/contracts/abis/holesky/PufferDepositor.cjs +2 -0
  25. package/dist/contracts/abis/holesky/PufferDepositor.cjs.map +1 -0
  26. package/dist/contracts/abis/holesky/PufferDepositor.js +377 -0
  27. package/dist/contracts/abis/holesky/PufferDepositor.js.map +1 -0
  28. package/dist/contracts/abis/holesky/PufferVaultV2.cjs +2 -0
  29. package/dist/contracts/abis/holesky/PufferVaultV2.cjs.map +1 -0
  30. package/dist/contracts/abis/holesky/PufferVaultV2.js +1787 -0
  31. package/dist/contracts/abis/holesky/PufferVaultV2.js.map +1 -0
  32. package/dist/contracts/abis/l1-reward-manager-abis.cjs +2 -0
  33. package/dist/contracts/abis/l1-reward-manager-abis.cjs.map +1 -0
  34. package/dist/contracts/abis/l1-reward-manager-abis.d.ts +527 -0
  35. package/dist/contracts/abis/l1-reward-manager-abis.js +9 -0
  36. package/dist/contracts/abis/l1-reward-manager-abis.js.map +1 -0
  37. package/dist/contracts/abis/l2-reward-manager-abis.cjs +2 -0
  38. package/dist/contracts/abis/l2-reward-manager-abis.cjs.map +1 -0
  39. package/dist/contracts/abis/l2-reward-manager-abis.d.ts +685 -0
  40. package/dist/contracts/abis/l2-reward-manager-abis.js +9 -0
  41. package/dist/contracts/abis/l2-reward-manager-abis.js.map +1 -0
  42. package/dist/contracts/abis/mainnet/ERC20Permit.cjs +2 -0
  43. package/dist/contracts/abis/mainnet/ERC20Permit.cjs.map +1 -0
  44. package/dist/contracts/abis/mainnet/ERC20Permit.js +524 -0
  45. package/dist/contracts/abis/mainnet/ERC20Permit.js.map +1 -0
  46. package/dist/contracts/abis/mainnet/L1RewardManager.cjs +2 -0
  47. package/dist/contracts/abis/mainnet/L1RewardManager.cjs.map +1 -0
  48. package/dist/contracts/abis/mainnet/L1RewardManager.d.ts +523 -0
  49. package/dist/contracts/abis/mainnet/L1RewardManager.js +447 -0
  50. package/dist/contracts/abis/mainnet/L1RewardManager.js.map +1 -0
  51. package/dist/contracts/abis/mainnet/L2RewardManager.cjs +2 -0
  52. package/dist/contracts/abis/mainnet/L2RewardManager.cjs.map +1 -0
  53. package/dist/contracts/abis/mainnet/L2RewardManager.d.ts +681 -0
  54. package/dist/contracts/abis/mainnet/L2RewardManager.js +538 -0
  55. package/dist/contracts/abis/mainnet/L2RewardManager.js.map +1 -0
  56. package/dist/contracts/abis/mainnet/PufLocker.cjs +2 -0
  57. package/dist/contracts/abis/mainnet/PufLocker.cjs.map +1 -0
  58. package/dist/contracts/abis/mainnet/PufLocker.js +362 -0
  59. package/dist/contracts/abis/mainnet/PufLocker.js.map +1 -0
  60. package/dist/contracts/abis/mainnet/PufToken.cjs +2 -0
  61. package/dist/contracts/abis/mainnet/PufToken.cjs.map +1 -0
  62. package/dist/contracts/abis/mainnet/PufToken.js +883 -0
  63. package/dist/contracts/abis/mainnet/PufToken.js.map +1 -0
  64. package/dist/contracts/abis/mainnet/PufferDepositor.cjs +2 -0
  65. package/dist/contracts/abis/mainnet/PufferDepositor.cjs.map +1 -0
  66. package/dist/contracts/abis/mainnet/PufferDepositor.js +377 -0
  67. package/dist/contracts/abis/mainnet/PufferDepositor.js.map +1 -0
  68. package/dist/contracts/abis/mainnet/PufferL2Depositor.cjs +2 -0
  69. package/dist/contracts/abis/mainnet/PufferL2Depositor.cjs.map +1 -0
  70. package/dist/contracts/abis/mainnet/PufferL2Depositor.js +300 -0
  71. package/dist/contracts/abis/mainnet/PufferL2Depositor.js.map +1 -0
  72. package/dist/contracts/abis/mainnet/PufferVaultV2.cjs +2 -0
  73. package/dist/contracts/abis/mainnet/PufferVaultV2.cjs.map +1 -0
  74. package/dist/contracts/abis/mainnet/PufferVaultV2.js +1864 -0
  75. package/dist/contracts/abis/mainnet/PufferVaultV2.js.map +1 -0
  76. package/dist/contracts/abis/puf-locker-abis.cjs +2 -0
  77. package/dist/contracts/abis/puf-locker-abis.cjs.map +1 -0
  78. package/dist/contracts/abis/puf-locker-abis.js +10 -0
  79. package/dist/contracts/abis/puf-locker-abis.js.map +1 -0
  80. package/dist/contracts/abis/puf-token-abis.cjs +2 -0
  81. package/dist/contracts/abis/puf-token-abis.cjs.map +1 -0
  82. package/dist/contracts/abis/puf-token-abis.js +10 -0
  83. package/dist/contracts/abis/puf-token-abis.js.map +1 -0
  84. package/dist/contracts/abis/puffer-depositor-abis.cjs +2 -0
  85. package/dist/contracts/abis/puffer-depositor-abis.cjs.map +1 -0
  86. package/dist/contracts/abis/puffer-depositor-abis.js +20 -0
  87. package/dist/contracts/abis/puffer-depositor-abis.js.map +1 -0
  88. package/dist/contracts/abis/puffer-vault-abis.cjs +2 -0
  89. package/dist/contracts/abis/puffer-vault-abis.cjs.map +1 -0
  90. package/dist/contracts/abis/puffer-vault-abis.js +15 -0
  91. package/dist/contracts/abis/puffer-vault-abis.js.map +1 -0
  92. package/dist/contracts/abis/tokens-abis.cjs +2 -0
  93. package/dist/contracts/abis/tokens-abis.cjs.map +1 -0
  94. package/dist/contracts/abis/tokens-abis.js +6 -0
  95. package/dist/contracts/abis/tokens-abis.js.map +1 -0
  96. package/dist/contracts/addresses.cjs +2 -0
  97. package/dist/contracts/addresses.cjs.map +1 -0
  98. package/dist/contracts/addresses.d.ts +23 -0
  99. package/dist/contracts/addresses.js +27 -0
  100. package/dist/contracts/addresses.js.map +1 -0
  101. package/dist/contracts/handlers/erc20-permit-handler.cjs +2 -0
  102. package/dist/contracts/handlers/erc20-permit-handler.cjs.map +1 -0
  103. package/dist/contracts/handlers/erc20-permit-handler.d.ts +579 -579
  104. package/dist/contracts/handlers/erc20-permit-handler.js +124 -0
  105. package/dist/contracts/handlers/erc20-permit-handler.js.map +1 -0
  106. package/dist/contracts/handlers/l1-reward-manager-handler.cjs +2 -0
  107. package/dist/contracts/handlers/l1-reward-manager-handler.cjs.map +1 -0
  108. package/dist/contracts/handlers/l1-reward-manager-handler.d.ts +6693 -0
  109. package/dist/contracts/handlers/l1-reward-manager-handler.js +68 -0
  110. package/dist/contracts/handlers/l1-reward-manager-handler.js.map +1 -0
  111. package/dist/contracts/handlers/l2-reward-manager-handler.cjs +2 -0
  112. package/dist/contracts/handlers/l2-reward-manager-handler.cjs.map +1 -0
  113. package/dist/contracts/handlers/l2-reward-manager-handler.d.ts +6912 -0
  114. package/dist/contracts/handlers/l2-reward-manager-handler.js +137 -0
  115. package/dist/contracts/handlers/l2-reward-manager-handler.js.map +1 -0
  116. package/dist/contracts/handlers/puf-locker-handler.cjs +2 -0
  117. package/dist/contracts/handlers/puf-locker-handler.cjs.map +1 -0
  118. package/dist/contracts/handlers/puf-locker-handler.d.ts +579 -579
  119. package/dist/contracts/handlers/puf-locker-handler.js +168 -0
  120. package/dist/contracts/handlers/puf-locker-handler.js.map +1 -0
  121. package/dist/contracts/handlers/puf-token-handler.cjs +2 -0
  122. package/dist/contracts/handlers/puf-token-handler.cjs.map +1 -0
  123. package/dist/contracts/handlers/puf-token-handler.d.ts +579 -579
  124. package/dist/contracts/handlers/puf-token-handler.js +174 -0
  125. package/dist/contracts/handlers/puf-token-handler.js.map +1 -0
  126. package/dist/contracts/handlers/puffer-depositor-handler.cjs +2 -0
  127. package/dist/contracts/handlers/puffer-depositor-handler.cjs.map +1 -0
  128. package/dist/contracts/handlers/puffer-depositor-handler.d.ts +579 -579
  129. package/dist/contracts/handlers/puffer-depositor-handler.js +113 -0
  130. package/dist/contracts/handlers/puffer-depositor-handler.js.map +1 -0
  131. package/dist/contracts/handlers/puffer-l2-depositor-handler.cjs +2 -0
  132. package/dist/contracts/handlers/puffer-l2-depositor-handler.cjs.map +1 -0
  133. package/dist/contracts/handlers/puffer-l2-depositor-handler.d.ts +579 -579
  134. package/dist/contracts/handlers/puffer-l2-depositor-handler.js +112 -0
  135. package/dist/contracts/handlers/puffer-l2-depositor-handler.js.map +1 -0
  136. package/dist/contracts/handlers/puffer-vault-handler.cjs +2 -0
  137. package/dist/contracts/handlers/puffer-vault-handler.cjs.map +1 -0
  138. package/dist/contracts/handlers/puffer-vault-handler.d.ts +579 -579
  139. package/dist/contracts/handlers/puffer-vault-handler.js +185 -0
  140. package/dist/contracts/handlers/puffer-vault-handler.js.map +1 -0
  141. package/dist/contracts/tokens.cjs +2 -0
  142. package/dist/contracts/tokens.cjs.map +1 -0
  143. package/dist/contracts/tokens.d.ts +0 -1
  144. package/dist/contracts/tokens.js +134 -0
  145. package/dist/contracts/tokens.js.map +1 -0
  146. package/dist/createWalletClient-Bmopj8MM.cjs +4 -0
  147. package/dist/createWalletClient-Bmopj8MM.cjs.map +1 -0
  148. package/dist/createWalletClient-DKcpswHR.js +2007 -0
  149. package/dist/createWalletClient-DKcpswHR.js.map +1 -0
  150. package/dist/errors/base-error.cjs +3 -0
  151. package/dist/errors/base-error.cjs.map +1 -0
  152. package/dist/errors/base-error.d.ts +0 -1
  153. package/dist/errors/base-error.js +23 -0
  154. package/dist/errors/base-error.js.map +1 -0
  155. package/dist/errors/types.cjs +2 -0
  156. package/dist/errors/types.cjs.map +1 -0
  157. package/dist/errors/types.js +2 -0
  158. package/dist/errors/types.js.map +1 -0
  159. package/dist/errors/validation-errors.cjs +2 -0
  160. package/dist/errors/validation-errors.cjs.map +1 -0
  161. package/dist/errors/validation-errors.d.ts +2 -1
  162. package/dist/errors/validation-errors.js +10 -0
  163. package/dist/errors/validation-errors.js.map +1 -0
  164. package/dist/getContract-B3Spz0SO.js +115 -0
  165. package/dist/getContract-B3Spz0SO.js.map +1 -0
  166. package/dist/getContract-MrPLx6gp.cjs +2 -0
  167. package/dist/getContract-MrPLx6gp.cjs.map +1 -0
  168. package/dist/main.cjs +1 -1
  169. package/dist/main.js +14 -10
  170. package/dist/main.js.map +1 -1
  171. package/dist/secp256k1-BLbXMlpX.js +1172 -0
  172. package/dist/secp256k1-BLbXMlpX.js.map +1 -0
  173. package/dist/secp256k1-CFnFaJ0H.cjs +2 -0
  174. package/dist/secp256k1-CFnFaJ0H.cjs.map +1 -0
  175. package/dist/utils/time.cjs +2 -0
  176. package/dist/utils/time.cjs.map +1 -0
  177. package/dist/utils/time.js +5 -0
  178. package/dist/utils/time.js.map +1 -0
  179. package/dist/utils/types.cjs +2 -0
  180. package/dist/utils/types.cjs.map +1 -0
  181. package/dist/utils/types.js +2 -0
  182. package/dist/utils/types.js.map +1 -0
  183. package/dist/utils/version.cjs +2 -0
  184. package/dist/utils/version.cjs.map +1 -0
  185. package/dist/utils/version.js +5 -0
  186. package/dist/utils/version.js.map +1 -0
  187. package/dist/writeContract-BBHpAss8.cjs +32 -0
  188. package/dist/writeContract-BBHpAss8.cjs.map +1 -0
  189. package/dist/writeContract-RluxM31W.js +3833 -0
  190. package/dist/writeContract-RluxM31W.js.map +1 -0
  191. package/package.json +22 -11
  192. package/dist/ccip-BlCTKpsk.cjs +0 -2
  193. package/dist/contracts/handlers/erc20-permit-handler.test.d.ts +0 -1
  194. package/dist/contracts/handlers/puf-locker-handler.test.d.ts +0 -1
  195. package/dist/contracts/handlers/puf-token-handler.test.d.ts +0 -1
  196. package/dist/contracts/handlers/puffer-depositor-handler.test.d.ts +0 -1
  197. package/dist/contracts/handlers/puffer-l2-depositor-handler.test.d.ts +0 -1
  198. package/dist/contracts/handlers/puffer-vault-handler.test.d.ts +0 -1
  199. package/dist/main-D1-cuLnV.cjs +0 -41
  200. package/dist/main-D1-cuLnV.cjs.map +0 -1
  201. package/dist/main-DGqGYUs0.js +0 -16003
  202. package/dist/main-DGqGYUs0.js.map +0 -1
@@ -0,0 +1,2099 @@
1
+ function k(e, { strict: t = !0 } = {}) {
2
+ return !e || typeof e != "string" ? !1 : t ? /^0x[0-9a-fA-F]*$/.test(e) : e.startsWith("0x");
3
+ }
4
+ function P(e) {
5
+ return k(e, { strict: !1 }) ? Math.ceil((e.length - 2) / 2) : e.length;
6
+ }
7
+ const tt = "2.18.8", Rn = (e) => e, Dn = (e) => e, nt = () => `viem@${tt}`;
8
+ class c extends Error {
9
+ constructor(t, n = {}) {
10
+ var a;
11
+ const s = n.cause instanceof c ? n.cause.details : (a = n.cause) != null && a.message ? n.cause.message : n.details, r = n.cause instanceof c && n.cause.docsPath || n.docsPath, i = nt(), o = [
12
+ t || "An error occurred.",
13
+ "",
14
+ ...n.metaMessages ? [...n.metaMessages, ""] : [],
15
+ ...r ? [
16
+ `Docs: ${n.docsBaseUrl ?? "https://viem.sh"}${r}${n.docsSlug ? `#${n.docsSlug}` : ""}`
17
+ ] : [],
18
+ ...s ? [`Details: ${s}`] : [],
19
+ `Version: ${i}`
20
+ ].join(`
21
+ `);
22
+ super(o, n.cause ? { cause: n.cause } : void 0), Object.defineProperty(this, "details", {
23
+ enumerable: !0,
24
+ configurable: !0,
25
+ writable: !0,
26
+ value: void 0
27
+ }), Object.defineProperty(this, "docsPath", {
28
+ enumerable: !0,
29
+ configurable: !0,
30
+ writable: !0,
31
+ value: void 0
32
+ }), Object.defineProperty(this, "metaMessages", {
33
+ enumerable: !0,
34
+ configurable: !0,
35
+ writable: !0,
36
+ value: void 0
37
+ }), Object.defineProperty(this, "shortMessage", {
38
+ enumerable: !0,
39
+ configurable: !0,
40
+ writable: !0,
41
+ value: void 0
42
+ }), Object.defineProperty(this, "version", {
43
+ enumerable: !0,
44
+ configurable: !0,
45
+ writable: !0,
46
+ value: void 0
47
+ }), Object.defineProperty(this, "name", {
48
+ enumerable: !0,
49
+ configurable: !0,
50
+ writable: !0,
51
+ value: "ViemError"
52
+ }), this.details = s, this.docsPath = r, this.metaMessages = n.metaMessages, this.shortMessage = t, this.version = i;
53
+ }
54
+ walk(t) {
55
+ return we(this, t);
56
+ }
57
+ }
58
+ function we(e, t) {
59
+ return t != null && t(e) ? e : e && typeof e == "object" && "cause" in e ? we(e.cause, t) : t ? null : e;
60
+ }
61
+ class Pe extends c {
62
+ constructor({ offset: t, position: n, size: s }) {
63
+ super(`Slice ${n === "start" ? "starting" : "ending"} at offset "${t}" is out-of-bounds (size: ${s}).`), Object.defineProperty(this, "name", {
64
+ enumerable: !0,
65
+ configurable: !0,
66
+ writable: !0,
67
+ value: "SliceOffsetOutOfBoundsError"
68
+ });
69
+ }
70
+ }
71
+ class ve extends c {
72
+ constructor({ size: t, targetSize: n, type: s }) {
73
+ super(`${s.charAt(0).toUpperCase()}${s.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`), Object.defineProperty(this, "name", {
74
+ enumerable: !0,
75
+ configurable: !0,
76
+ writable: !0,
77
+ value: "SizeExceedsPaddingSizeError"
78
+ });
79
+ }
80
+ }
81
+ class Kn extends c {
82
+ constructor({ size: t, targetSize: n, type: s }) {
83
+ super(`${s.charAt(0).toUpperCase()}${s.slice(1).toLowerCase()} is expected to be ${n} ${s} long, but is ${t} ${s} long.`), Object.defineProperty(this, "name", {
84
+ enumerable: !0,
85
+ configurable: !0,
86
+ writable: !0,
87
+ value: "InvalidBytesLengthError"
88
+ });
89
+ }
90
+ }
91
+ function z(e, { dir: t, size: n = 32 } = {}) {
92
+ return typeof e == "string" ? st(e, { dir: t, size: n }) : rt(e, { dir: t, size: n });
93
+ }
94
+ function st(e, { dir: t, size: n = 32 } = {}) {
95
+ if (n === null)
96
+ return e;
97
+ const s = e.replace("0x", "");
98
+ if (s.length > n * 2)
99
+ throw new ve({
100
+ size: Math.ceil(s.length / 2),
101
+ targetSize: n,
102
+ type: "hex"
103
+ });
104
+ return `0x${s[t === "right" ? "padEnd" : "padStart"](n * 2, "0")}`;
105
+ }
106
+ function rt(e, { dir: t, size: n = 32 } = {}) {
107
+ if (n === null)
108
+ return e;
109
+ if (e.length > n)
110
+ throw new ve({
111
+ size: e.length,
112
+ targetSize: n,
113
+ type: "bytes"
114
+ });
115
+ const s = new Uint8Array(n);
116
+ for (let r = 0; r < n; r++) {
117
+ const i = t === "right";
118
+ s[i ? r : n - r - 1] = e[i ? r : e.length - r - 1];
119
+ }
120
+ return s;
121
+ }
122
+ class it extends c {
123
+ constructor({ max: t, min: n, signed: s, size: r, value: i }) {
124
+ super(`Number "${i}" is not in safe ${r ? `${r * 8}-bit ${s ? "signed" : "unsigned"} ` : ""}integer range ${t ? `(${n} to ${t})` : `(above ${n})`}`), Object.defineProperty(this, "name", {
125
+ enumerable: !0,
126
+ configurable: !0,
127
+ writable: !0,
128
+ value: "IntegerOutOfRangeError"
129
+ });
130
+ }
131
+ }
132
+ class Wn extends c {
133
+ constructor(t) {
134
+ super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`), Object.defineProperty(this, "name", {
135
+ enumerable: !0,
136
+ configurable: !0,
137
+ writable: !0,
138
+ value: "InvalidBytesBooleanError"
139
+ });
140
+ }
141
+ }
142
+ class ot extends c {
143
+ constructor({ givenSize: t, maxSize: n }) {
144
+ super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`), Object.defineProperty(this, "name", {
145
+ enumerable: !0,
146
+ configurable: !0,
147
+ writable: !0,
148
+ value: "SizeOverflowError"
149
+ });
150
+ }
151
+ }
152
+ function V(e, { dir: t = "left" } = {}) {
153
+ let n = typeof e == "string" ? e.replace("0x", "") : e, s = 0;
154
+ for (let r = 0; r < n.length - 1 && n[t === "left" ? r : n.length - r - 1].toString() === "0"; r++)
155
+ s++;
156
+ return n = t === "left" ? n.slice(s) : n.slice(0, n.length - s), typeof e == "string" ? (n.length === 1 && t === "right" && (n = `${n}0`), `0x${n.length % 2 === 1 ? `0${n}` : n}`) : n;
157
+ }
158
+ function A(e, { size: t }) {
159
+ if (P(e) > t)
160
+ throw new ot({
161
+ givenSize: P(e),
162
+ maxSize: t
163
+ });
164
+ }
165
+ function C(e, t = {}) {
166
+ const { signed: n } = t;
167
+ t.size && A(e, { size: t.size });
168
+ const s = BigInt(e);
169
+ if (!n)
170
+ return s;
171
+ const r = (e.length - 2) / 2, i = (1n << BigInt(r) * 8n - 1n) - 1n;
172
+ return s <= i ? s : s - BigInt(`0x${"f".padStart(r * 2, "f")}`) - 1n;
173
+ }
174
+ function _(e, t = {}) {
175
+ return Number(C(e, t));
176
+ }
177
+ const at = /* @__PURE__ */ Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
178
+ function d(e, t = {}) {
179
+ return typeof e == "number" || typeof e == "bigint" ? Ee(e, t) : typeof e == "string" ? lt(e, t) : typeof e == "boolean" ? ut(e, t) : v(e, t);
180
+ }
181
+ function ut(e, t = {}) {
182
+ const n = `0x${Number(e)}`;
183
+ return typeof t.size == "number" ? (A(n, { size: t.size }), z(n, { size: t.size })) : n;
184
+ }
185
+ function v(e, t = {}) {
186
+ let n = "";
187
+ for (let r = 0; r < e.length; r++)
188
+ n += at[e[r]];
189
+ const s = `0x${n}`;
190
+ return typeof t.size == "number" ? (A(s, { size: t.size }), z(s, { dir: "right", size: t.size })) : s;
191
+ }
192
+ function Ee(e, t = {}) {
193
+ const { signed: n, size: s } = t, r = BigInt(e);
194
+ let i;
195
+ s ? n ? i = (1n << BigInt(s) * 8n - 1n) - 1n : i = 2n ** (BigInt(s) * 8n) - 1n : typeof e == "number" && (i = BigInt(Number.MAX_SAFE_INTEGER));
196
+ const o = typeof i == "bigint" && n ? -i - 1n : 0;
197
+ if (i && r > i || r < o) {
198
+ const u = typeof e == "bigint" ? "n" : "";
199
+ throw new it({
200
+ max: i ? `${i}${u}` : void 0,
201
+ min: `${o}${u}`,
202
+ signed: n,
203
+ size: s,
204
+ value: `${e}${u}`
205
+ });
206
+ }
207
+ const a = `0x${(n && r < 0 ? (1n << BigInt(s * 8)) + BigInt(r) : r).toString(16)}`;
208
+ return s ? z(a, { size: s }) : a;
209
+ }
210
+ const ct = /* @__PURE__ */ new TextEncoder();
211
+ function lt(e, t = {}) {
212
+ const n = ct.encode(e);
213
+ return v(n, t);
214
+ }
215
+ const ft = /* @__PURE__ */ new TextEncoder();
216
+ function Be(e, t = {}) {
217
+ return typeof e == "number" || typeof e == "bigint" ? ht(e, t) : typeof e == "boolean" ? dt(e, t) : k(e) ? I(e, t) : Ie(e, t);
218
+ }
219
+ function dt(e, t = {}) {
220
+ const n = new Uint8Array(1);
221
+ return n[0] = Number(e), typeof t.size == "number" ? (A(n, { size: t.size }), z(n, { size: t.size })) : n;
222
+ }
223
+ const m = {
224
+ zero: 48,
225
+ nine: 57,
226
+ A: 65,
227
+ F: 70,
228
+ a: 97,
229
+ f: 102
230
+ };
231
+ function le(e) {
232
+ if (e >= m.zero && e <= m.nine)
233
+ return e - m.zero;
234
+ if (e >= m.A && e <= m.F)
235
+ return e - (m.A - 10);
236
+ if (e >= m.a && e <= m.f)
237
+ return e - (m.a - 10);
238
+ }
239
+ function I(e, t = {}) {
240
+ let n = e;
241
+ t.size && (A(n, { size: t.size }), n = z(n, { dir: "right", size: t.size }));
242
+ let s = n.slice(2);
243
+ s.length % 2 && (s = `0${s}`);
244
+ const r = s.length / 2, i = new Uint8Array(r);
245
+ for (let o = 0, a = 0; o < r; o++) {
246
+ const u = le(s.charCodeAt(a++)), l = le(s.charCodeAt(a++));
247
+ if (u === void 0 || l === void 0)
248
+ throw new c(`Invalid byte sequence ("${s[a - 2]}${s[a - 1]}" in "${s}").`);
249
+ i[o] = u * 16 + l;
250
+ }
251
+ return i;
252
+ }
253
+ function ht(e, t) {
254
+ const n = Ee(e, t);
255
+ return I(n);
256
+ }
257
+ function Ie(e, t = {}) {
258
+ const n = ft.encode(e);
259
+ return typeof t.size == "number" ? (A(n, { size: t.size }), z(n, { dir: "right", size: t.size })) : n;
260
+ }
261
+ function R(e) {
262
+ if (!Number.isSafeInteger(e) || e < 0)
263
+ throw new Error(`positive integer expected, not ${e}`);
264
+ }
265
+ function bt(e) {
266
+ return e instanceof Uint8Array || e != null && typeof e == "object" && e.constructor.name === "Uint8Array";
267
+ }
268
+ function K(e, ...t) {
269
+ if (!bt(e))
270
+ throw new Error("Uint8Array expected");
271
+ if (t.length > 0 && !t.includes(e.length))
272
+ throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`);
273
+ }
274
+ function Xn(e) {
275
+ if (typeof e != "function" || typeof e.create != "function")
276
+ throw new Error("Hash should be wrapped by utils.wrapConstructor");
277
+ R(e.outputLen), R(e.blockLen);
278
+ }
279
+ function D(e, t = !0) {
280
+ if (e.destroyed)
281
+ throw new Error("Hash instance has been destroyed");
282
+ if (t && e.finished)
283
+ throw new Error("Hash#digest() has already been called");
284
+ }
285
+ function $e(e, t) {
286
+ K(e);
287
+ const n = t.outputLen;
288
+ if (e.length < n)
289
+ throw new Error(`digestInto() expects output buffer of length at least ${n}`);
290
+ }
291
+ const N = /* @__PURE__ */ BigInt(2 ** 32 - 1), fe = /* @__PURE__ */ BigInt(32);
292
+ function pt(e, t = !1) {
293
+ return t ? { h: Number(e & N), l: Number(e >> fe & N) } : { h: Number(e >> fe & N) | 0, l: Number(e & N) | 0 };
294
+ }
295
+ function gt(e, t = !1) {
296
+ let n = new Uint32Array(e.length), s = new Uint32Array(e.length);
297
+ for (let r = 0; r < e.length; r++) {
298
+ const { h: i, l: o } = pt(e[r], t);
299
+ [n[r], s[r]] = [i, o];
300
+ }
301
+ return [n, s];
302
+ }
303
+ const mt = (e, t, n) => e << n | t >>> 32 - n, xt = (e, t, n) => t << n | e >>> 32 - n, yt = (e, t, n) => t << n - 32 | e >>> 64 - n, wt = (e, t, n) => e << n - 32 | t >>> 64 - n, q = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
304
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
305
+ const Pt = (e) => new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4)), Y = (e) => new DataView(e.buffer, e.byteOffset, e.byteLength), g = (e, t) => e << 32 - t | e >>> t, de = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68, vt = (e) => e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
306
+ function he(e) {
307
+ for (let t = 0; t < e.length; t++)
308
+ e[t] = vt(e[t]);
309
+ }
310
+ function Et(e) {
311
+ if (typeof e != "string")
312
+ throw new Error(`utf8ToBytes expected string, got ${typeof e}`);
313
+ return new Uint8Array(new TextEncoder().encode(e));
314
+ }
315
+ function Z(e) {
316
+ return typeof e == "string" && (e = Et(e)), K(e), e;
317
+ }
318
+ function qn(...e) {
319
+ let t = 0;
320
+ for (let s = 0; s < e.length; s++) {
321
+ const r = e[s];
322
+ K(r), t += r.length;
323
+ }
324
+ const n = new Uint8Array(t);
325
+ for (let s = 0, r = 0; s < e.length; s++) {
326
+ const i = e[s];
327
+ n.set(i, r), r += i.length;
328
+ }
329
+ return n;
330
+ }
331
+ class Te {
332
+ // Safe version that clones internal state
333
+ clone() {
334
+ return this._cloneInto();
335
+ }
336
+ }
337
+ function Ue(e) {
338
+ const t = (s) => e().update(Z(s)).digest(), n = e();
339
+ return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = () => e(), t;
340
+ }
341
+ function Yn(e = 32) {
342
+ if (q && typeof q.getRandomValues == "function")
343
+ return q.getRandomValues(new Uint8Array(e));
344
+ throw new Error("crypto.getRandomValues must be defined");
345
+ }
346
+ const Ce = [], Oe = [], ze = [], Bt = /* @__PURE__ */ BigInt(0), S = /* @__PURE__ */ BigInt(1), It = /* @__PURE__ */ BigInt(2), $t = /* @__PURE__ */ BigInt(7), Tt = /* @__PURE__ */ BigInt(256), Ut = /* @__PURE__ */ BigInt(113);
347
+ for (let e = 0, t = S, n = 1, s = 0; e < 24; e++) {
348
+ [n, s] = [s, (2 * n + 3 * s) % 5], Ce.push(2 * (5 * s + n)), Oe.push((e + 1) * (e + 2) / 2 % 64);
349
+ let r = Bt;
350
+ for (let i = 0; i < 7; i++)
351
+ t = (t << S ^ (t >> $t) * Ut) % Tt, t & It && (r ^= S << (S << /* @__PURE__ */ BigInt(i)) - S);
352
+ ze.push(r);
353
+ }
354
+ const [Ct, Ot] = /* @__PURE__ */ gt(ze, !0), be = (e, t, n) => n > 32 ? yt(e, t, n) : mt(e, t, n), pe = (e, t, n) => n > 32 ? wt(e, t, n) : xt(e, t, n);
355
+ function zt(e, t = 24) {
356
+ const n = new Uint32Array(10);
357
+ for (let s = 24 - t; s < 24; s++) {
358
+ for (let o = 0; o < 10; o++)
359
+ n[o] = e[o] ^ e[o + 10] ^ e[o + 20] ^ e[o + 30] ^ e[o + 40];
360
+ for (let o = 0; o < 10; o += 2) {
361
+ const a = (o + 8) % 10, u = (o + 2) % 10, l = n[u], h = n[u + 1], f = be(l, h, 1) ^ n[a], p = pe(l, h, 1) ^ n[a + 1];
362
+ for (let b = 0; b < 50; b += 10)
363
+ e[o + b] ^= f, e[o + b + 1] ^= p;
364
+ }
365
+ let r = e[2], i = e[3];
366
+ for (let o = 0; o < 24; o++) {
367
+ const a = Oe[o], u = be(r, i, a), l = pe(r, i, a), h = Ce[o];
368
+ r = e[h], i = e[h + 1], e[h] = u, e[h + 1] = l;
369
+ }
370
+ for (let o = 0; o < 50; o += 10) {
371
+ for (let a = 0; a < 10; a++)
372
+ n[a] = e[o + a];
373
+ for (let a = 0; a < 10; a++)
374
+ e[o + a] ^= ~n[(a + 2) % 10] & n[(a + 4) % 10];
375
+ }
376
+ e[0] ^= Ct[s], e[1] ^= Ot[s];
377
+ }
378
+ n.fill(0);
379
+ }
380
+ class ee extends Te {
381
+ // NOTE: we accept arguments in bytes instead of bits here.
382
+ constructor(t, n, s, r = !1, i = 24) {
383
+ if (super(), this.blockLen = t, this.suffix = n, this.outputLen = s, this.enableXOF = r, this.rounds = i, this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, R(s), 0 >= this.blockLen || this.blockLen >= 200)
384
+ throw new Error("Sha3 supports only keccak-f1600 function");
385
+ this.state = new Uint8Array(200), this.state32 = Pt(this.state);
386
+ }
387
+ keccak() {
388
+ de || he(this.state32), zt(this.state32, this.rounds), de || he(this.state32), this.posOut = 0, this.pos = 0;
389
+ }
390
+ update(t) {
391
+ D(this);
392
+ const { blockLen: n, state: s } = this;
393
+ t = Z(t);
394
+ const r = t.length;
395
+ for (let i = 0; i < r; ) {
396
+ const o = Math.min(n - this.pos, r - i);
397
+ for (let a = 0; a < o; a++)
398
+ s[this.pos++] ^= t[i++];
399
+ this.pos === n && this.keccak();
400
+ }
401
+ return this;
402
+ }
403
+ finish() {
404
+ if (this.finished)
405
+ return;
406
+ this.finished = !0;
407
+ const { state: t, suffix: n, pos: s, blockLen: r } = this;
408
+ t[s] ^= n, n & 128 && s === r - 1 && this.keccak(), t[r - 1] ^= 128, this.keccak();
409
+ }
410
+ writeInto(t) {
411
+ D(this, !1), K(t), this.finish();
412
+ const n = this.state, { blockLen: s } = this;
413
+ for (let r = 0, i = t.length; r < i; ) {
414
+ this.posOut >= s && this.keccak();
415
+ const o = Math.min(s - this.posOut, i - r);
416
+ t.set(n.subarray(this.posOut, this.posOut + o), r), this.posOut += o, r += o;
417
+ }
418
+ return t;
419
+ }
420
+ xofInto(t) {
421
+ if (!this.enableXOF)
422
+ throw new Error("XOF is not possible for this instance");
423
+ return this.writeInto(t);
424
+ }
425
+ xof(t) {
426
+ return R(t), this.xofInto(new Uint8Array(t));
427
+ }
428
+ digestInto(t) {
429
+ if ($e(t, this), this.finished)
430
+ throw new Error("digest() was already called");
431
+ return this.writeInto(t), this.destroy(), t;
432
+ }
433
+ digest() {
434
+ return this.digestInto(new Uint8Array(this.outputLen));
435
+ }
436
+ destroy() {
437
+ this.destroyed = !0, this.state.fill(0);
438
+ }
439
+ _cloneInto(t) {
440
+ const { blockLen: n, suffix: s, outputLen: r, rounds: i, enableXOF: o } = this;
441
+ return t || (t = new ee(n, s, r, o, i)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = i, t.suffix = s, t.outputLen = r, t.enableXOF = o, t.destroyed = this.destroyed, t;
442
+ }
443
+ }
444
+ const At = (e, t, n) => Ue(() => new ee(t, e, n)), Ft = /* @__PURE__ */ At(1, 136, 256 / 8);
445
+ function Lt(e, t) {
446
+ const n = t || "hex", s = Ft(k(e, { strict: !1 }) ? Be(e) : e);
447
+ return n === "bytes" ? s : d(s);
448
+ }
449
+ class $ extends c {
450
+ constructor({ address: t }) {
451
+ super(`Address "${t}" is invalid.`, {
452
+ metaMessages: [
453
+ "- Address must be a hex value of 20 bytes (40 hex characters).",
454
+ "- Address must match its checksum counterpart."
455
+ ]
456
+ }), Object.defineProperty(this, "name", {
457
+ enumerable: !0,
458
+ configurable: !0,
459
+ writable: !0,
460
+ value: "InvalidAddressError"
461
+ });
462
+ }
463
+ }
464
+ class Ae extends Map {
465
+ constructor(t) {
466
+ super(), Object.defineProperty(this, "maxSize", {
467
+ enumerable: !0,
468
+ configurable: !0,
469
+ writable: !0,
470
+ value: void 0
471
+ }), this.maxSize = t;
472
+ }
473
+ set(t, n) {
474
+ return super.set(t, n), this.maxSize && this.size > this.maxSize && this.delete(this.keys().next().value), this;
475
+ }
476
+ }
477
+ const J = /* @__PURE__ */ new Ae(8192);
478
+ function Fe(e, t) {
479
+ if (J.has(`${e}.${t}`))
480
+ return J.get(`${e}.${t}`);
481
+ const n = e.substring(2).toLowerCase(), s = Lt(Ie(n), "bytes"), r = n.split("");
482
+ for (let o = 0; o < 40; o += 2)
483
+ s[o >> 1] >> 4 >= 8 && r[o] && (r[o] = r[o].toUpperCase()), (s[o >> 1] & 15) >= 8 && r[o + 1] && (r[o + 1] = r[o + 1].toUpperCase());
484
+ const i = `0x${r.join("")}`;
485
+ return J.set(`${e}.${t}`, i), i;
486
+ }
487
+ function Jn(e, t) {
488
+ if (!T(e, { strict: !1 }))
489
+ throw new $({ address: e });
490
+ return Fe(e, t);
491
+ }
492
+ const St = /^0x[a-fA-F0-9]{40}$/, Q = /* @__PURE__ */ new Ae(8192);
493
+ function T(e, t) {
494
+ const { strict: n = !0 } = t ?? {}, s = `${e}.${n}`;
495
+ if (Q.has(s))
496
+ return Q.get(s);
497
+ const r = St.test(e) ? e.toLowerCase() === e ? !0 : n ? Fe(e) === e : !0 : !1;
498
+ return Q.set(s, r), r;
499
+ }
500
+ function Qn(e) {
501
+ return typeof e[0] == "string" ? j(e) : Gt(e);
502
+ }
503
+ function Gt(e) {
504
+ let t = 0;
505
+ for (const r of e)
506
+ t += r.length;
507
+ const n = new Uint8Array(t);
508
+ let s = 0;
509
+ for (const r of e)
510
+ n.set(r, s), s += r.length;
511
+ return n;
512
+ }
513
+ function j(e) {
514
+ return `0x${e.reduce((t, n) => t + n.replace("0x", ""), "")}`;
515
+ }
516
+ function kt(e, t, n, { strict: s } = {}) {
517
+ return k(e, { strict: !1 }) ? Ht(e, t, n, {
518
+ strict: s
519
+ }) : jt(e, t, n, {
520
+ strict: s
521
+ });
522
+ }
523
+ function Le(e, t) {
524
+ if (typeof t == "number" && t > 0 && t > P(e) - 1)
525
+ throw new Pe({
526
+ offset: t,
527
+ position: "start",
528
+ size: P(e)
529
+ });
530
+ }
531
+ function Se(e, t, n) {
532
+ if (typeof t == "number" && typeof n == "number" && P(e) !== n - t)
533
+ throw new Pe({
534
+ offset: n,
535
+ position: "end",
536
+ size: P(e)
537
+ });
538
+ }
539
+ function jt(e, t, n, { strict: s } = {}) {
540
+ Le(e, t);
541
+ const r = e.slice(t, n);
542
+ return s && Se(r, t, n), r;
543
+ }
544
+ function Ht(e, t, n, { strict: s } = {}) {
545
+ Le(e, t);
546
+ const r = `0x${e.replace("0x", "").slice((t ?? 0) * 2, (n ?? e.length) * 2)}`;
547
+ return s && Se(r, t, n), r;
548
+ }
549
+ class ge extends c {
550
+ constructor({ offset: t }) {
551
+ super(`Offset \`${t}\` cannot be negative.`), Object.defineProperty(this, "name", {
552
+ enumerable: !0,
553
+ configurable: !0,
554
+ writable: !0,
555
+ value: "NegativeOffsetError"
556
+ });
557
+ }
558
+ }
559
+ class Nt extends c {
560
+ constructor({ length: t, position: n }) {
561
+ super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`), Object.defineProperty(this, "name", {
562
+ enumerable: !0,
563
+ configurable: !0,
564
+ writable: !0,
565
+ value: "PositionOutOfBoundsError"
566
+ });
567
+ }
568
+ }
569
+ class Mt extends c {
570
+ constructor({ count: t, limit: n }) {
571
+ super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`), Object.defineProperty(this, "name", {
572
+ enumerable: !0,
573
+ configurable: !0,
574
+ writable: !0,
575
+ value: "RecursiveReadLimitExceededError"
576
+ });
577
+ }
578
+ }
579
+ const Vt = {
580
+ bytes: new Uint8Array(),
581
+ dataView: new DataView(new ArrayBuffer(0)),
582
+ position: 0,
583
+ positionReadCount: /* @__PURE__ */ new Map(),
584
+ recursiveReadCount: 0,
585
+ recursiveReadLimit: Number.POSITIVE_INFINITY,
586
+ assertReadLimit() {
587
+ if (this.recursiveReadCount >= this.recursiveReadLimit)
588
+ throw new Mt({
589
+ count: this.recursiveReadCount + 1,
590
+ limit: this.recursiveReadLimit
591
+ });
592
+ },
593
+ assertPosition(e) {
594
+ if (e < 0 || e > this.bytes.length - 1)
595
+ throw new Nt({
596
+ length: this.bytes.length,
597
+ position: e
598
+ });
599
+ },
600
+ decrementPosition(e) {
601
+ if (e < 0)
602
+ throw new ge({ offset: e });
603
+ const t = this.position - e;
604
+ this.assertPosition(t), this.position = t;
605
+ },
606
+ getReadCount(e) {
607
+ return this.positionReadCount.get(e || this.position) || 0;
608
+ },
609
+ incrementPosition(e) {
610
+ if (e < 0)
611
+ throw new ge({ offset: e });
612
+ const t = this.position + e;
613
+ this.assertPosition(t), this.position = t;
614
+ },
615
+ inspectByte(e) {
616
+ const t = e ?? this.position;
617
+ return this.assertPosition(t), this.bytes[t];
618
+ },
619
+ inspectBytes(e, t) {
620
+ const n = t ?? this.position;
621
+ return this.assertPosition(n + e - 1), this.bytes.subarray(n, n + e);
622
+ },
623
+ inspectUint8(e) {
624
+ const t = e ?? this.position;
625
+ return this.assertPosition(t), this.bytes[t];
626
+ },
627
+ inspectUint16(e) {
628
+ const t = e ?? this.position;
629
+ return this.assertPosition(t + 1), this.dataView.getUint16(t);
630
+ },
631
+ inspectUint24(e) {
632
+ const t = e ?? this.position;
633
+ return this.assertPosition(t + 2), (this.dataView.getUint16(t) << 8) + this.dataView.getUint8(t + 2);
634
+ },
635
+ inspectUint32(e) {
636
+ const t = e ?? this.position;
637
+ return this.assertPosition(t + 3), this.dataView.getUint32(t);
638
+ },
639
+ pushByte(e) {
640
+ this.assertPosition(this.position), this.bytes[this.position] = e, this.position++;
641
+ },
642
+ pushBytes(e) {
643
+ this.assertPosition(this.position + e.length - 1), this.bytes.set(e, this.position), this.position += e.length;
644
+ },
645
+ pushUint8(e) {
646
+ this.assertPosition(this.position), this.bytes[this.position] = e, this.position++;
647
+ },
648
+ pushUint16(e) {
649
+ this.assertPosition(this.position + 1), this.dataView.setUint16(this.position, e), this.position += 2;
650
+ },
651
+ pushUint24(e) {
652
+ this.assertPosition(this.position + 2), this.dataView.setUint16(this.position, e >> 8), this.dataView.setUint8(this.position + 2, e & 255), this.position += 3;
653
+ },
654
+ pushUint32(e) {
655
+ this.assertPosition(this.position + 3), this.dataView.setUint32(this.position, e), this.position += 4;
656
+ },
657
+ readByte() {
658
+ this.assertReadLimit(), this._touch();
659
+ const e = this.inspectByte();
660
+ return this.position++, e;
661
+ },
662
+ readBytes(e, t) {
663
+ this.assertReadLimit(), this._touch();
664
+ const n = this.inspectBytes(e);
665
+ return this.position += t ?? e, n;
666
+ },
667
+ readUint8() {
668
+ this.assertReadLimit(), this._touch();
669
+ const e = this.inspectUint8();
670
+ return this.position += 1, e;
671
+ },
672
+ readUint16() {
673
+ this.assertReadLimit(), this._touch();
674
+ const e = this.inspectUint16();
675
+ return this.position += 2, e;
676
+ },
677
+ readUint24() {
678
+ this.assertReadLimit(), this._touch();
679
+ const e = this.inspectUint24();
680
+ return this.position += 3, e;
681
+ },
682
+ readUint32() {
683
+ this.assertReadLimit(), this._touch();
684
+ const e = this.inspectUint32();
685
+ return this.position += 4, e;
686
+ },
687
+ get remaining() {
688
+ return this.bytes.length - this.position;
689
+ },
690
+ setPosition(e) {
691
+ const t = this.position;
692
+ return this.assertPosition(e), this.position = e, () => this.position = t;
693
+ },
694
+ _touch() {
695
+ if (this.recursiveReadLimit === Number.POSITIVE_INFINITY)
696
+ return;
697
+ const e = this.getReadCount();
698
+ this.positionReadCount.set(this.position, e + 1), e > 0 && this.recursiveReadCount++;
699
+ }
700
+ };
701
+ function Ge(e, { recursiveReadLimit: t = 8192 } = {}) {
702
+ const n = Object.create(Vt);
703
+ return n.bytes = e, n.dataView = new DataView(e.buffer, e.byteOffset, e.byteLength), n.positionReadCount = /* @__PURE__ */ new Map(), n.recursiveReadLimit = t, n;
704
+ }
705
+ const _t = {
706
+ gwei: 9,
707
+ wei: 18
708
+ }, Rt = {
709
+ ether: -9,
710
+ wei: 9
711
+ };
712
+ function ke(e, t) {
713
+ let n = e.toString();
714
+ const s = n.startsWith("-");
715
+ s && (n = n.slice(1)), n = n.padStart(t, "0");
716
+ let [r, i] = [
717
+ n.slice(0, n.length - t),
718
+ n.slice(n.length - t)
719
+ ];
720
+ return i = i.replace(/(0+)$/, ""), `${s ? "-" : ""}${r || "0"}${i ? `.${i}` : ""}`;
721
+ }
722
+ function Dt(e, t = "wei") {
723
+ return ke(e, _t[t]);
724
+ }
725
+ function B(e, t = "wei") {
726
+ return ke(e, Rt[t]);
727
+ }
728
+ function je(e) {
729
+ const t = Object.entries(e).map(([s, r]) => r === void 0 || r === !1 ? null : [s, r]).filter(Boolean), n = t.reduce((s, [r]) => Math.max(s, r.length), 0);
730
+ return t.map(([s, r]) => ` ${`${s}:`.padEnd(n + 1)} ${r}`).join(`
731
+ `);
732
+ }
733
+ class Zn extends c {
734
+ constructor() {
735
+ super([
736
+ "Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.",
737
+ "Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."
738
+ ].join(`
739
+ `)), Object.defineProperty(this, "name", {
740
+ enumerable: !0,
741
+ configurable: !0,
742
+ writable: !0,
743
+ value: "FeeConflictError"
744
+ });
745
+ }
746
+ }
747
+ class Kt extends c {
748
+ constructor({ v: t }) {
749
+ super(`Invalid \`v\` value "${t}". Expected 27 or 28.`), Object.defineProperty(this, "name", {
750
+ enumerable: !0,
751
+ configurable: !0,
752
+ writable: !0,
753
+ value: "InvalidLegacyVError"
754
+ });
755
+ }
756
+ }
757
+ class Wt extends c {
758
+ constructor({ transaction: t }) {
759
+ super("Cannot infer a transaction type from provided transaction.", {
760
+ metaMessages: [
761
+ "Provided Transaction:",
762
+ "{",
763
+ je(t),
764
+ "}",
765
+ "",
766
+ "To infer the type, either provide:",
767
+ "- a `type` to the Transaction, or",
768
+ "- an EIP-1559 Transaction with `maxFeePerGas`, or",
769
+ "- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
770
+ "- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or",
771
+ "- a Legacy Transaction with `gasPrice`"
772
+ ]
773
+ }), Object.defineProperty(this, "name", {
774
+ enumerable: !0,
775
+ configurable: !0,
776
+ writable: !0,
777
+ value: "InvalidSerializableTransactionError"
778
+ });
779
+ }
780
+ }
781
+ class Xt extends c {
782
+ constructor({ storageKey: t }) {
783
+ super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length - 2) / 2)} bytes.`), Object.defineProperty(this, "name", {
784
+ enumerable: !0,
785
+ configurable: !0,
786
+ writable: !0,
787
+ value: "InvalidStorageKeySizeError"
788
+ });
789
+ }
790
+ }
791
+ class es extends c {
792
+ constructor(t, { account: n, docsPath: s, chain: r, data: i, gas: o, gasPrice: a, maxFeePerGas: u, maxPriorityFeePerGas: l, nonce: h, to: f, value: p }) {
793
+ var x;
794
+ const b = je({
795
+ chain: r && `${r == null ? void 0 : r.name} (id: ${r == null ? void 0 : r.id})`,
796
+ from: n == null ? void 0 : n.address,
797
+ to: f,
798
+ value: typeof p < "u" && `${Dt(p)} ${((x = r == null ? void 0 : r.nativeCurrency) == null ? void 0 : x.symbol) || "ETH"}`,
799
+ data: i,
800
+ gas: o,
801
+ gasPrice: typeof a < "u" && `${B(a)} gwei`,
802
+ maxFeePerGas: typeof u < "u" && `${B(u)} gwei`,
803
+ maxPriorityFeePerGas: typeof l < "u" && `${B(l)} gwei`,
804
+ nonce: h
805
+ });
806
+ super(t.shortMessage, {
807
+ cause: t,
808
+ docsPath: s,
809
+ metaMessages: [
810
+ ...t.metaMessages ? [...t.metaMessages, " "] : [],
811
+ "Request Arguments:",
812
+ b
813
+ ].filter(Boolean)
814
+ }), Object.defineProperty(this, "cause", {
815
+ enumerable: !0,
816
+ configurable: !0,
817
+ writable: !0,
818
+ value: void 0
819
+ }), Object.defineProperty(this, "name", {
820
+ enumerable: !0,
821
+ configurable: !0,
822
+ writable: !0,
823
+ value: "TransactionExecutionError"
824
+ }), this.cause = t;
825
+ }
826
+ }
827
+ class ts extends c {
828
+ constructor({ blockHash: t, blockNumber: n, blockTag: s, hash: r, index: i }) {
829
+ let o = "Transaction";
830
+ s && i !== void 0 && (o = `Transaction at block time "${s}" at index "${i}"`), t && i !== void 0 && (o = `Transaction at block hash "${t}" at index "${i}"`), n && i !== void 0 && (o = `Transaction at block number "${n}" at index "${i}"`), r && (o = `Transaction with hash "${r}"`), super(`${o} could not be found.`), Object.defineProperty(this, "name", {
831
+ enumerable: !0,
832
+ configurable: !0,
833
+ writable: !0,
834
+ value: "TransactionNotFoundError"
835
+ });
836
+ }
837
+ }
838
+ class ns extends c {
839
+ constructor({ hash: t }) {
840
+ super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`), Object.defineProperty(this, "name", {
841
+ enumerable: !0,
842
+ configurable: !0,
843
+ writable: !0,
844
+ value: "TransactionReceiptNotFoundError"
845
+ });
846
+ }
847
+ }
848
+ class ss extends c {
849
+ constructor({ hash: t }) {
850
+ super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`), Object.defineProperty(this, "name", {
851
+ enumerable: !0,
852
+ configurable: !0,
853
+ writable: !0,
854
+ value: "WaitForTransactionReceiptTimeoutError"
855
+ });
856
+ }
857
+ }
858
+ class He extends c {
859
+ constructor({ cause: t, message: n } = {}) {
860
+ var r;
861
+ const s = (r = n == null ? void 0 : n.replace("execution reverted: ", "")) == null ? void 0 : r.replace("execution reverted", "");
862
+ super(`Execution reverted ${s ? `with reason: ${s}` : "for an unknown reason"}.`, {
863
+ cause: t
864
+ }), Object.defineProperty(this, "name", {
865
+ enumerable: !0,
866
+ configurable: !0,
867
+ writable: !0,
868
+ value: "ExecutionRevertedError"
869
+ });
870
+ }
871
+ }
872
+ Object.defineProperty(He, "code", {
873
+ enumerable: !0,
874
+ configurable: !0,
875
+ writable: !0,
876
+ value: 3
877
+ });
878
+ Object.defineProperty(He, "nodeMessage", {
879
+ enumerable: !0,
880
+ configurable: !0,
881
+ writable: !0,
882
+ value: /execution reverted/
883
+ });
884
+ class W extends c {
885
+ constructor({ cause: t, maxFeePerGas: n } = {}) {
886
+ super(`The fee cap (\`maxFeePerGas\`${n ? ` = ${B(n)} gwei` : ""}) cannot be higher than the maximum allowed value (2^256-1).`, {
887
+ cause: t
888
+ }), Object.defineProperty(this, "name", {
889
+ enumerable: !0,
890
+ configurable: !0,
891
+ writable: !0,
892
+ value: "FeeCapTooHigh"
893
+ });
894
+ }
895
+ }
896
+ Object.defineProperty(W, "nodeMessage", {
897
+ enumerable: !0,
898
+ configurable: !0,
899
+ writable: !0,
900
+ value: /max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/
901
+ });
902
+ class qt extends c {
903
+ constructor({ cause: t, maxFeePerGas: n } = {}) {
904
+ super(`The fee cap (\`maxFeePerGas\`${n ? ` = ${B(n)}` : ""} gwei) cannot be lower than the block base fee.`, {
905
+ cause: t
906
+ }), Object.defineProperty(this, "name", {
907
+ enumerable: !0,
908
+ configurable: !0,
909
+ writable: !0,
910
+ value: "FeeCapTooLow"
911
+ });
912
+ }
913
+ }
914
+ Object.defineProperty(qt, "nodeMessage", {
915
+ enumerable: !0,
916
+ configurable: !0,
917
+ writable: !0,
918
+ value: /max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/
919
+ });
920
+ class Yt extends c {
921
+ constructor({ cause: t, nonce: n } = {}) {
922
+ super(`Nonce provided for the transaction ${n ? `(${n}) ` : ""}is higher than the next one expected.`, { cause: t }), Object.defineProperty(this, "name", {
923
+ enumerable: !0,
924
+ configurable: !0,
925
+ writable: !0,
926
+ value: "NonceTooHighError"
927
+ });
928
+ }
929
+ }
930
+ Object.defineProperty(Yt, "nodeMessage", {
931
+ enumerable: !0,
932
+ configurable: !0,
933
+ writable: !0,
934
+ value: /nonce too high/
935
+ });
936
+ class Jt extends c {
937
+ constructor({ cause: t, nonce: n } = {}) {
938
+ super([
939
+ `Nonce provided for the transaction ${n ? `(${n}) ` : ""}is lower than the current nonce of the account.`,
940
+ "Try increasing the nonce or find the latest nonce with `getTransactionCount`."
941
+ ].join(`
942
+ `), { cause: t }), Object.defineProperty(this, "name", {
943
+ enumerable: !0,
944
+ configurable: !0,
945
+ writable: !0,
946
+ value: "NonceTooLowError"
947
+ });
948
+ }
949
+ }
950
+ Object.defineProperty(Jt, "nodeMessage", {
951
+ enumerable: !0,
952
+ configurable: !0,
953
+ writable: !0,
954
+ value: /nonce too low|transaction already imported|already known/
955
+ });
956
+ class Qt extends c {
957
+ constructor({ cause: t, nonce: n } = {}) {
958
+ super(`Nonce provided for the transaction ${n ? `(${n}) ` : ""}exceeds the maximum allowed nonce.`, { cause: t }), Object.defineProperty(this, "name", {
959
+ enumerable: !0,
960
+ configurable: !0,
961
+ writable: !0,
962
+ value: "NonceMaxValueError"
963
+ });
964
+ }
965
+ }
966
+ Object.defineProperty(Qt, "nodeMessage", {
967
+ enumerable: !0,
968
+ configurable: !0,
969
+ writable: !0,
970
+ value: /nonce has max value/
971
+ });
972
+ class Zt extends c {
973
+ constructor({ cause: t } = {}) {
974
+ super([
975
+ "The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."
976
+ ].join(`
977
+ `), {
978
+ cause: t,
979
+ metaMessages: [
980
+ "This error could arise when the account does not have enough funds to:",
981
+ " - pay for the total gas fee,",
982
+ " - pay for the value to send.",
983
+ " ",
984
+ "The cost of the transaction is calculated as `gas * gas fee + value`, where:",
985
+ " - `gas` is the amount of gas needed for transaction to execute,",
986
+ " - `gas fee` is the gas fee,",
987
+ " - `value` is the amount of ether to send to the recipient."
988
+ ]
989
+ }), Object.defineProperty(this, "name", {
990
+ enumerable: !0,
991
+ configurable: !0,
992
+ writable: !0,
993
+ value: "InsufficientFundsError"
994
+ });
995
+ }
996
+ }
997
+ Object.defineProperty(Zt, "nodeMessage", {
998
+ enumerable: !0,
999
+ configurable: !0,
1000
+ writable: !0,
1001
+ value: /insufficient funds/
1002
+ });
1003
+ class en extends c {
1004
+ constructor({ cause: t, gas: n } = {}) {
1005
+ super(`The amount of gas ${n ? `(${n}) ` : ""}provided for the transaction exceeds the limit allowed for the block.`, {
1006
+ cause: t
1007
+ }), Object.defineProperty(this, "name", {
1008
+ enumerable: !0,
1009
+ configurable: !0,
1010
+ writable: !0,
1011
+ value: "IntrinsicGasTooHighError"
1012
+ });
1013
+ }
1014
+ }
1015
+ Object.defineProperty(en, "nodeMessage", {
1016
+ enumerable: !0,
1017
+ configurable: !0,
1018
+ writable: !0,
1019
+ value: /intrinsic gas too high|gas limit reached/
1020
+ });
1021
+ class tn extends c {
1022
+ constructor({ cause: t, gas: n } = {}) {
1023
+ super(`The amount of gas ${n ? `(${n}) ` : ""}provided for the transaction is too low.`, {
1024
+ cause: t
1025
+ }), Object.defineProperty(this, "name", {
1026
+ enumerable: !0,
1027
+ configurable: !0,
1028
+ writable: !0,
1029
+ value: "IntrinsicGasTooLowError"
1030
+ });
1031
+ }
1032
+ }
1033
+ Object.defineProperty(tn, "nodeMessage", {
1034
+ enumerable: !0,
1035
+ configurable: !0,
1036
+ writable: !0,
1037
+ value: /intrinsic gas too low/
1038
+ });
1039
+ class nn extends c {
1040
+ constructor({ cause: t }) {
1041
+ super("The transaction type is not supported for this chain.", {
1042
+ cause: t
1043
+ }), Object.defineProperty(this, "name", {
1044
+ enumerable: !0,
1045
+ configurable: !0,
1046
+ writable: !0,
1047
+ value: "TransactionTypeNotSupportedError"
1048
+ });
1049
+ }
1050
+ }
1051
+ Object.defineProperty(nn, "nodeMessage", {
1052
+ enumerable: !0,
1053
+ configurable: !0,
1054
+ writable: !0,
1055
+ value: /transaction type not valid/
1056
+ });
1057
+ class Ne extends c {
1058
+ constructor({ cause: t, maxPriorityFeePerGas: n, maxFeePerGas: s } = {}) {
1059
+ super([
1060
+ `The provided tip (\`maxPriorityFeePerGas\`${n ? ` = ${B(n)} gwei` : ""}) cannot be higher than the fee cap (\`maxFeePerGas\`${s ? ` = ${B(s)} gwei` : ""}).`
1061
+ ].join(`
1062
+ `), {
1063
+ cause: t
1064
+ }), Object.defineProperty(this, "name", {
1065
+ enumerable: !0,
1066
+ configurable: !0,
1067
+ writable: !0,
1068
+ value: "TipAboveFeeCapError"
1069
+ });
1070
+ }
1071
+ }
1072
+ Object.defineProperty(Ne, "nodeMessage", {
1073
+ enumerable: !0,
1074
+ configurable: !0,
1075
+ writable: !0,
1076
+ value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/
1077
+ });
1078
+ class rs extends c {
1079
+ constructor({ cause: t }) {
1080
+ super(`An error occurred while executing: ${t == null ? void 0 : t.shortMessage}`, {
1081
+ cause: t
1082
+ }), Object.defineProperty(this, "name", {
1083
+ enumerable: !0,
1084
+ configurable: !0,
1085
+ writable: !0,
1086
+ value: "UnknownNodeError"
1087
+ });
1088
+ }
1089
+ }
1090
+ function te(e, t) {
1091
+ return ({ exclude: n, format: s }) => ({
1092
+ exclude: n,
1093
+ format: (r) => {
1094
+ const i = t(r);
1095
+ if (n)
1096
+ for (const o of n)
1097
+ delete i[o];
1098
+ return {
1099
+ ...i,
1100
+ ...s(r)
1101
+ };
1102
+ },
1103
+ type: e
1104
+ });
1105
+ }
1106
+ const Me = {
1107
+ "0x0": "legacy",
1108
+ "0x1": "eip2930",
1109
+ "0x2": "eip1559",
1110
+ "0x3": "eip4844"
1111
+ };
1112
+ function ne(e) {
1113
+ const t = {
1114
+ ...e,
1115
+ blockHash: e.blockHash ? e.blockHash : null,
1116
+ blockNumber: e.blockNumber ? BigInt(e.blockNumber) : null,
1117
+ chainId: e.chainId ? _(e.chainId) : void 0,
1118
+ gas: e.gas ? BigInt(e.gas) : void 0,
1119
+ gasPrice: e.gasPrice ? BigInt(e.gasPrice) : void 0,
1120
+ maxFeePerBlobGas: e.maxFeePerBlobGas ? BigInt(e.maxFeePerBlobGas) : void 0,
1121
+ maxFeePerGas: e.maxFeePerGas ? BigInt(e.maxFeePerGas) : void 0,
1122
+ maxPriorityFeePerGas: e.maxPriorityFeePerGas ? BigInt(e.maxPriorityFeePerGas) : void 0,
1123
+ nonce: e.nonce ? _(e.nonce) : void 0,
1124
+ to: e.to ? e.to : null,
1125
+ transactionIndex: e.transactionIndex ? Number(e.transactionIndex) : null,
1126
+ type: e.type ? Me[e.type] : void 0,
1127
+ typeHex: e.type ? e.type : void 0,
1128
+ value: e.value ? BigInt(e.value) : void 0,
1129
+ v: e.v ? BigInt(e.v) : void 0
1130
+ };
1131
+ return t.yParity = (() => {
1132
+ if (e.yParity)
1133
+ return Number(e.yParity);
1134
+ if (typeof t.v == "bigint") {
1135
+ if (t.v === 0n || t.v === 27n)
1136
+ return 0;
1137
+ if (t.v === 1n || t.v === 28n)
1138
+ return 1;
1139
+ if (t.v >= 35n)
1140
+ return t.v % 2n === 0n ? 1 : 0;
1141
+ }
1142
+ })(), t.type === "legacy" && (delete t.accessList, delete t.maxFeePerBlobGas, delete t.maxFeePerGas, delete t.maxPriorityFeePerGas, delete t.yParity), t.type === "eip2930" && (delete t.maxFeePerBlobGas, delete t.maxFeePerGas, delete t.maxPriorityFeePerGas), t.type === "eip1559" && delete t.maxFeePerBlobGas, t;
1143
+ }
1144
+ const sn = /* @__PURE__ */ te("transaction", ne);
1145
+ function rn(e) {
1146
+ var n;
1147
+ const t = (n = e.transactions) == null ? void 0 : n.map((s) => typeof s == "string" ? s : ne(s));
1148
+ return {
1149
+ ...e,
1150
+ baseFeePerGas: e.baseFeePerGas ? BigInt(e.baseFeePerGas) : null,
1151
+ blobGasUsed: e.blobGasUsed ? BigInt(e.blobGasUsed) : void 0,
1152
+ difficulty: e.difficulty ? BigInt(e.difficulty) : void 0,
1153
+ excessBlobGas: e.excessBlobGas ? BigInt(e.excessBlobGas) : void 0,
1154
+ gasLimit: e.gasLimit ? BigInt(e.gasLimit) : void 0,
1155
+ gasUsed: e.gasUsed ? BigInt(e.gasUsed) : void 0,
1156
+ hash: e.hash ? e.hash : null,
1157
+ logsBloom: e.logsBloom ? e.logsBloom : null,
1158
+ nonce: e.nonce ? e.nonce : null,
1159
+ number: e.number ? BigInt(e.number) : null,
1160
+ size: e.size ? BigInt(e.size) : void 0,
1161
+ timestamp: e.timestamp ? BigInt(e.timestamp) : void 0,
1162
+ transactions: t,
1163
+ totalDifficulty: e.totalDifficulty ? BigInt(e.totalDifficulty) : null
1164
+ };
1165
+ }
1166
+ const on = /* @__PURE__ */ te("block", rn);
1167
+ function Ve(e) {
1168
+ const { kzg: t } = e, n = e.to ?? (typeof e.blobs[0] == "string" ? "hex" : "bytes"), s = typeof e.blobs[0] == "string" ? e.blobs.map((i) => I(i)) : e.blobs, r = [];
1169
+ for (const i of s)
1170
+ r.push(Uint8Array.from(t.blobToKzgCommitment(i)));
1171
+ return n === "bytes" ? r : r.map((i) => v(i));
1172
+ }
1173
+ function _e(e) {
1174
+ const { kzg: t } = e, n = e.to ?? (typeof e.blobs[0] == "string" ? "hex" : "bytes"), s = typeof e.blobs[0] == "string" ? e.blobs.map((o) => I(o)) : e.blobs, r = typeof e.commitments[0] == "string" ? e.commitments.map((o) => I(o)) : e.commitments, i = [];
1175
+ for (let o = 0; o < s.length; o++) {
1176
+ const a = s[o], u = r[o];
1177
+ i.push(Uint8Array.from(t.computeBlobKzgProof(a, u)));
1178
+ }
1179
+ return n === "bytes" ? i : i.map((o) => v(o));
1180
+ }
1181
+ function an(e, t, n, s) {
1182
+ if (typeof e.setBigUint64 == "function")
1183
+ return e.setBigUint64(t, n, s);
1184
+ const r = BigInt(32), i = BigInt(4294967295), o = Number(n >> r & i), a = Number(n & i), u = s ? 4 : 0, l = s ? 0 : 4;
1185
+ e.setUint32(t + u, o, s), e.setUint32(t + l, a, s);
1186
+ }
1187
+ const un = (e, t, n) => e & t ^ ~e & n, cn = (e, t, n) => e & t ^ e & n ^ t & n;
1188
+ class ln extends Te {
1189
+ constructor(t, n, s, r) {
1190
+ super(), this.blockLen = t, this.outputLen = n, this.padOffset = s, this.isLE = r, this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.buffer = new Uint8Array(t), this.view = Y(this.buffer);
1191
+ }
1192
+ update(t) {
1193
+ D(this);
1194
+ const { view: n, buffer: s, blockLen: r } = this;
1195
+ t = Z(t);
1196
+ const i = t.length;
1197
+ for (let o = 0; o < i; ) {
1198
+ const a = Math.min(r - this.pos, i - o);
1199
+ if (a === r) {
1200
+ const u = Y(t);
1201
+ for (; r <= i - o; o += r)
1202
+ this.process(u, o);
1203
+ continue;
1204
+ }
1205
+ s.set(t.subarray(o, o + a), this.pos), this.pos += a, o += a, this.pos === r && (this.process(n, 0), this.pos = 0);
1206
+ }
1207
+ return this.length += t.length, this.roundClean(), this;
1208
+ }
1209
+ digestInto(t) {
1210
+ D(this), $e(t, this), this.finished = !0;
1211
+ const { buffer: n, view: s, blockLen: r, isLE: i } = this;
1212
+ let { pos: o } = this;
1213
+ n[o++] = 128, this.buffer.subarray(o).fill(0), this.padOffset > r - o && (this.process(s, 0), o = 0);
1214
+ for (let f = o; f < r; f++)
1215
+ n[f] = 0;
1216
+ an(s, r - 8, BigInt(this.length * 8), i), this.process(s, 0);
1217
+ const a = Y(t), u = this.outputLen;
1218
+ if (u % 4)
1219
+ throw new Error("_sha2: outputLen should be aligned to 32bit");
1220
+ const l = u / 4, h = this.get();
1221
+ if (l > h.length)
1222
+ throw new Error("_sha2: outputLen bigger than state");
1223
+ for (let f = 0; f < l; f++)
1224
+ a.setUint32(4 * f, h[f], i);
1225
+ }
1226
+ digest() {
1227
+ const { buffer: t, outputLen: n } = this;
1228
+ this.digestInto(t);
1229
+ const s = t.slice(0, n);
1230
+ return this.destroy(), s;
1231
+ }
1232
+ _cloneInto(t) {
1233
+ t || (t = new this.constructor()), t.set(...this.get());
1234
+ const { blockLen: n, buffer: s, length: r, finished: i, destroyed: o, pos: a } = this;
1235
+ return t.length = r, t.pos = a, t.finished = i, t.destroyed = o, r % n && t.buffer.set(s), t;
1236
+ }
1237
+ }
1238
+ const fn = /* @__PURE__ */ new Uint32Array([
1239
+ 1116352408,
1240
+ 1899447441,
1241
+ 3049323471,
1242
+ 3921009573,
1243
+ 961987163,
1244
+ 1508970993,
1245
+ 2453635748,
1246
+ 2870763221,
1247
+ 3624381080,
1248
+ 310598401,
1249
+ 607225278,
1250
+ 1426881987,
1251
+ 1925078388,
1252
+ 2162078206,
1253
+ 2614888103,
1254
+ 3248222580,
1255
+ 3835390401,
1256
+ 4022224774,
1257
+ 264347078,
1258
+ 604807628,
1259
+ 770255983,
1260
+ 1249150122,
1261
+ 1555081692,
1262
+ 1996064986,
1263
+ 2554220882,
1264
+ 2821834349,
1265
+ 2952996808,
1266
+ 3210313671,
1267
+ 3336571891,
1268
+ 3584528711,
1269
+ 113926993,
1270
+ 338241895,
1271
+ 666307205,
1272
+ 773529912,
1273
+ 1294757372,
1274
+ 1396182291,
1275
+ 1695183700,
1276
+ 1986661051,
1277
+ 2177026350,
1278
+ 2456956037,
1279
+ 2730485921,
1280
+ 2820302411,
1281
+ 3259730800,
1282
+ 3345764771,
1283
+ 3516065817,
1284
+ 3600352804,
1285
+ 4094571909,
1286
+ 275423344,
1287
+ 430227734,
1288
+ 506948616,
1289
+ 659060556,
1290
+ 883997877,
1291
+ 958139571,
1292
+ 1322822218,
1293
+ 1537002063,
1294
+ 1747873779,
1295
+ 1955562222,
1296
+ 2024104815,
1297
+ 2227730452,
1298
+ 2361852424,
1299
+ 2428436474,
1300
+ 2756734187,
1301
+ 3204031479,
1302
+ 3329325298
1303
+ ]), y = /* @__PURE__ */ new Uint32Array([
1304
+ 1779033703,
1305
+ 3144134277,
1306
+ 1013904242,
1307
+ 2773480762,
1308
+ 1359893119,
1309
+ 2600822924,
1310
+ 528734635,
1311
+ 1541459225
1312
+ ]), w = /* @__PURE__ */ new Uint32Array(64);
1313
+ class dn extends ln {
1314
+ constructor() {
1315
+ super(64, 32, 8, !1), this.A = y[0] | 0, this.B = y[1] | 0, this.C = y[2] | 0, this.D = y[3] | 0, this.E = y[4] | 0, this.F = y[5] | 0, this.G = y[6] | 0, this.H = y[7] | 0;
1316
+ }
1317
+ get() {
1318
+ const { A: t, B: n, C: s, D: r, E: i, F: o, G: a, H: u } = this;
1319
+ return [t, n, s, r, i, o, a, u];
1320
+ }
1321
+ // prettier-ignore
1322
+ set(t, n, s, r, i, o, a, u) {
1323
+ this.A = t | 0, this.B = n | 0, this.C = s | 0, this.D = r | 0, this.E = i | 0, this.F = o | 0, this.G = a | 0, this.H = u | 0;
1324
+ }
1325
+ process(t, n) {
1326
+ for (let f = 0; f < 16; f++, n += 4)
1327
+ w[f] = t.getUint32(n, !1);
1328
+ for (let f = 16; f < 64; f++) {
1329
+ const p = w[f - 15], b = w[f - 2], x = g(p, 7) ^ g(p, 18) ^ p >>> 3, U = g(b, 17) ^ g(b, 19) ^ b >>> 10;
1330
+ w[f] = U + w[f - 7] + x + w[f - 16] | 0;
1331
+ }
1332
+ let { A: s, B: r, C: i, D: o, E: a, F: u, G: l, H: h } = this;
1333
+ for (let f = 0; f < 64; f++) {
1334
+ const p = g(a, 6) ^ g(a, 11) ^ g(a, 25), b = h + p + un(a, u, l) + fn[f] + w[f] | 0, U = (g(s, 2) ^ g(s, 13) ^ g(s, 22)) + cn(s, r, i) | 0;
1335
+ h = l, l = u, u = a, a = o + b | 0, o = i, i = r, r = s, s = b + U | 0;
1336
+ }
1337
+ s = s + this.A | 0, r = r + this.B | 0, i = i + this.C | 0, o = o + this.D | 0, a = a + this.E | 0, u = u + this.F | 0, l = l + this.G | 0, h = h + this.H | 0, this.set(s, r, i, o, a, u, l, h);
1338
+ }
1339
+ roundClean() {
1340
+ w.fill(0);
1341
+ }
1342
+ destroy() {
1343
+ this.set(0, 0, 0, 0, 0, 0, 0, 0), this.buffer.fill(0);
1344
+ }
1345
+ }
1346
+ const hn = /* @__PURE__ */ Ue(() => new dn());
1347
+ function bn(e, t) {
1348
+ return hn(k(e, { strict: !1 }) ? Be(e) : e);
1349
+ }
1350
+ function pn(e) {
1351
+ const { commitment: t, version: n = 1 } = e, s = e.to ?? (typeof t == "string" ? "hex" : "bytes"), r = bn(t);
1352
+ return r.set([n], 0), s === "bytes" ? r : v(r);
1353
+ }
1354
+ function gn(e) {
1355
+ const { commitments: t, version: n } = e, s = e.to ?? (typeof t[0] == "string" ? "hex" : "bytes"), r = [];
1356
+ for (const i of t)
1357
+ r.push(pn({
1358
+ commitment: i,
1359
+ to: s,
1360
+ version: n
1361
+ }));
1362
+ return r;
1363
+ }
1364
+ const me = 6, Re = 32, se = 4096, De = Re * se, xe = De * me - // terminator byte (0x80).
1365
+ 1 - // zero byte (0x00) appended to each field element.
1366
+ 1 * se * me, Ke = 1;
1367
+ class mn extends c {
1368
+ constructor({ maxSize: t, size: n }) {
1369
+ super("Blob size is too large.", {
1370
+ metaMessages: [`Max: ${t} bytes`, `Given: ${n} bytes`]
1371
+ }), Object.defineProperty(this, "name", {
1372
+ enumerable: !0,
1373
+ configurable: !0,
1374
+ writable: !0,
1375
+ value: "BlobSizeTooLargeError"
1376
+ });
1377
+ }
1378
+ }
1379
+ class We extends c {
1380
+ constructor() {
1381
+ super("Blob data must not be empty."), Object.defineProperty(this, "name", {
1382
+ enumerable: !0,
1383
+ configurable: !0,
1384
+ writable: !0,
1385
+ value: "EmptyBlobError"
1386
+ });
1387
+ }
1388
+ }
1389
+ class xn extends c {
1390
+ constructor({ hash: t, size: n }) {
1391
+ super(`Versioned hash "${t}" size is invalid.`, {
1392
+ metaMessages: ["Expected: 32", `Received: ${n}`]
1393
+ }), Object.defineProperty(this, "name", {
1394
+ enumerable: !0,
1395
+ configurable: !0,
1396
+ writable: !0,
1397
+ value: "InvalidVersionedHashSizeError"
1398
+ });
1399
+ }
1400
+ }
1401
+ class yn extends c {
1402
+ constructor({ hash: t, version: n }) {
1403
+ super(`Versioned hash "${t}" version is invalid.`, {
1404
+ metaMessages: [
1405
+ `Expected: ${Ke}`,
1406
+ `Received: ${n}`
1407
+ ]
1408
+ }), Object.defineProperty(this, "name", {
1409
+ enumerable: !0,
1410
+ configurable: !0,
1411
+ writable: !0,
1412
+ value: "InvalidVersionedHashVersionError"
1413
+ });
1414
+ }
1415
+ }
1416
+ function wn(e) {
1417
+ const t = e.to ?? (typeof e.data == "string" ? "hex" : "bytes"), n = typeof e.data == "string" ? I(e.data) : e.data, s = P(n);
1418
+ if (!s)
1419
+ throw new We();
1420
+ if (s > xe)
1421
+ throw new mn({
1422
+ maxSize: xe,
1423
+ size: s
1424
+ });
1425
+ const r = [];
1426
+ let i = !0, o = 0;
1427
+ for (; i; ) {
1428
+ const a = Ge(new Uint8Array(De));
1429
+ let u = 0;
1430
+ for (; u < se; ) {
1431
+ const l = n.slice(o, o + (Re - 1));
1432
+ if (a.pushByte(0), a.pushBytes(l), l.length < 31) {
1433
+ a.pushByte(128), i = !1;
1434
+ break;
1435
+ }
1436
+ u++, o += 31;
1437
+ }
1438
+ r.push(a);
1439
+ }
1440
+ return t === "bytes" ? r.map((a) => a.bytes) : r.map((a) => v(a.bytes));
1441
+ }
1442
+ function Pn(e) {
1443
+ const { data: t, kzg: n, to: s } = e, r = e.blobs ?? wn({ data: t, to: s }), i = e.commitments ?? Ve({ blobs: r, kzg: n, to: s }), o = e.proofs ?? _e({ blobs: r, commitments: i, kzg: n, to: s }), a = [];
1444
+ for (let u = 0; u < r.length; u++)
1445
+ a.push({
1446
+ blob: r[u],
1447
+ commitment: i[u],
1448
+ proof: o[u]
1449
+ });
1450
+ return a;
1451
+ }
1452
+ function vn(e) {
1453
+ if (e.type)
1454
+ return e.type;
1455
+ if (typeof e.blobs < "u" || typeof e.blobVersionedHashes < "u" || typeof e.maxFeePerBlobGas < "u" || typeof e.sidecars < "u")
1456
+ return "eip4844";
1457
+ if (typeof e.maxFeePerGas < "u" || typeof e.maxPriorityFeePerGas < "u")
1458
+ return "eip1559";
1459
+ if (typeof e.gasPrice < "u")
1460
+ return typeof e.accessList < "u" ? "eip2930" : "legacy";
1461
+ throw new Wt({ transaction: e });
1462
+ }
1463
+ function En(e, { args: t, eventName: n } = {}) {
1464
+ return {
1465
+ ...e,
1466
+ blockHash: e.blockHash ? e.blockHash : null,
1467
+ blockNumber: e.blockNumber ? BigInt(e.blockNumber) : null,
1468
+ logIndex: e.logIndex ? Number(e.logIndex) : null,
1469
+ transactionHash: e.transactionHash ? e.transactionHash : null,
1470
+ transactionIndex: e.transactionIndex ? Number(e.transactionIndex) : null,
1471
+ ...n ? { args: t, eventName: n } : {}
1472
+ };
1473
+ }
1474
+ class is extends c {
1475
+ constructor({ blockNumber: t, chain: n, contract: s }) {
1476
+ super(`Chain "${n.name}" does not support contract "${s.name}".`, {
1477
+ metaMessages: [
1478
+ "This could be due to any of the following:",
1479
+ ...t && s.blockCreated && s.blockCreated > t ? [
1480
+ `- The contract "${s.name}" was not deployed until block ${s.blockCreated} (current block ${t}).`
1481
+ ] : [
1482
+ `- The chain does not have the contract "${s.name}" configured.`
1483
+ ]
1484
+ ]
1485
+ }), Object.defineProperty(this, "name", {
1486
+ enumerable: !0,
1487
+ configurable: !0,
1488
+ writable: !0,
1489
+ value: "ChainDoesNotSupportContract"
1490
+ });
1491
+ }
1492
+ }
1493
+ class os extends c {
1494
+ constructor({ chain: t, currentChainId: n }) {
1495
+ super(`The current chain of the wallet (id: ${n}) does not match the target chain for the transaction (id: ${t.id} – ${t.name}).`, {
1496
+ metaMessages: [
1497
+ `Current Chain ID: ${n}`,
1498
+ `Expected Chain ID: ${t.id} – ${t.name}`
1499
+ ]
1500
+ }), Object.defineProperty(this, "name", {
1501
+ enumerable: !0,
1502
+ configurable: !0,
1503
+ writable: !0,
1504
+ value: "ChainMismatchError"
1505
+ });
1506
+ }
1507
+ }
1508
+ class as extends c {
1509
+ constructor() {
1510
+ super([
1511
+ "No chain was provided to the request.",
1512
+ "Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."
1513
+ ].join(`
1514
+ `)), Object.defineProperty(this, "name", {
1515
+ enumerable: !0,
1516
+ configurable: !0,
1517
+ writable: !0,
1518
+ value: "ChainNotFoundError"
1519
+ });
1520
+ }
1521
+ }
1522
+ class us extends c {
1523
+ constructor() {
1524
+ super("No chain was provided to the Client."), Object.defineProperty(this, "name", {
1525
+ enumerable: !0,
1526
+ configurable: !0,
1527
+ writable: !0,
1528
+ value: "ClientChainNotConfiguredError"
1529
+ });
1530
+ }
1531
+ }
1532
+ class re extends c {
1533
+ constructor({ chainId: t }) {
1534
+ super(typeof t == "number" ? `Chain ID "${t}" is invalid.` : "Chain ID is invalid."), Object.defineProperty(this, "name", {
1535
+ enumerable: !0,
1536
+ configurable: !0,
1537
+ writable: !0,
1538
+ value: "InvalidChainIdError"
1539
+ });
1540
+ }
1541
+ }
1542
+ function X(e) {
1543
+ return {
1544
+ formatters: void 0,
1545
+ fees: void 0,
1546
+ serializers: void 0,
1547
+ ...e
1548
+ };
1549
+ }
1550
+ function O(e, t = "hex") {
1551
+ const n = Xe(e), s = Ge(new Uint8Array(n.length));
1552
+ return n.encode(s), t === "hex" ? v(s.bytes) : s.bytes;
1553
+ }
1554
+ function Xe(e) {
1555
+ return Array.isArray(e) ? Bn(e.map((t) => Xe(t))) : In(e);
1556
+ }
1557
+ function Bn(e) {
1558
+ const t = e.reduce((r, i) => r + i.length, 0), n = qe(t);
1559
+ return {
1560
+ length: t <= 55 ? 1 + t : 1 + n + t,
1561
+ encode(r) {
1562
+ t <= 55 ? r.pushByte(192 + t) : (r.pushByte(247 + n), n === 1 ? r.pushUint8(t) : n === 2 ? r.pushUint16(t) : n === 3 ? r.pushUint24(t) : r.pushUint32(t));
1563
+ for (const { encode: i } of e)
1564
+ i(r);
1565
+ }
1566
+ };
1567
+ }
1568
+ function In(e) {
1569
+ const t = typeof e == "string" ? I(e) : e, n = qe(t.length);
1570
+ return {
1571
+ length: t.length === 1 && t[0] < 128 ? 1 : t.length <= 55 ? 1 + t.length : 1 + n + t.length,
1572
+ encode(r) {
1573
+ t.length === 1 && t[0] < 128 ? r.pushBytes(t) : t.length <= 55 ? (r.pushByte(128 + t.length), r.pushBytes(t)) : (r.pushByte(183 + n), n === 1 ? r.pushUint8(t.length) : n === 2 ? r.pushUint16(t.length) : n === 3 ? r.pushUint24(t.length) : r.pushUint32(t.length), r.pushBytes(t));
1574
+ }
1575
+ };
1576
+ }
1577
+ function qe(e) {
1578
+ if (e < 2 ** 8)
1579
+ return 1;
1580
+ if (e < 2 ** 16)
1581
+ return 2;
1582
+ if (e < 2 ** 24)
1583
+ return 3;
1584
+ if (e < 2 ** 32)
1585
+ return 4;
1586
+ throw new c("Length is too large.");
1587
+ }
1588
+ const $n = {
1589
+ "0x0": "reverted",
1590
+ "0x1": "success"
1591
+ };
1592
+ function Tn(e) {
1593
+ const t = {
1594
+ ...e,
1595
+ blockNumber: e.blockNumber ? BigInt(e.blockNumber) : null,
1596
+ contractAddress: e.contractAddress ? e.contractAddress : null,
1597
+ cumulativeGasUsed: e.cumulativeGasUsed ? BigInt(e.cumulativeGasUsed) : null,
1598
+ effectiveGasPrice: e.effectiveGasPrice ? BigInt(e.effectiveGasPrice) : null,
1599
+ gasUsed: e.gasUsed ? BigInt(e.gasUsed) : null,
1600
+ logs: e.logs ? e.logs.map((n) => En(n)) : null,
1601
+ to: e.to ? e.to : null,
1602
+ transactionIndex: e.transactionIndex ? _(e.transactionIndex) : null,
1603
+ status: e.status ? $n[e.status] : null,
1604
+ type: e.type ? Me[e.type] || e.type : null
1605
+ };
1606
+ return e.blobGasPrice && (t.blobGasPrice = BigInt(e.blobGasPrice)), e.blobGasUsed && (t.blobGasUsed = BigInt(e.blobGasUsed)), t;
1607
+ }
1608
+ const Un = /* @__PURE__ */ te("transactionReceipt", Tn);
1609
+ function Cn(e) {
1610
+ const { blobVersionedHashes: t } = e;
1611
+ if (t) {
1612
+ if (t.length === 0)
1613
+ throw new We();
1614
+ for (const n of t) {
1615
+ const s = P(n), r = _(kt(n, 0, 1));
1616
+ if (s !== 32)
1617
+ throw new xn({ hash: n, size: s });
1618
+ if (r !== Ke)
1619
+ throw new yn({
1620
+ hash: n,
1621
+ version: r
1622
+ });
1623
+ }
1624
+ }
1625
+ Ye(e);
1626
+ }
1627
+ function Ye(e) {
1628
+ const { chainId: t, maxPriorityFeePerGas: n, maxFeePerGas: s, to: r } = e;
1629
+ if (t <= 0)
1630
+ throw new re({ chainId: t });
1631
+ if (r && !T(r))
1632
+ throw new $({ address: r });
1633
+ if (s && s > 2n ** 256n - 1n)
1634
+ throw new W({ maxFeePerGas: s });
1635
+ if (n && s && n > s)
1636
+ throw new Ne({ maxFeePerGas: s, maxPriorityFeePerGas: n });
1637
+ }
1638
+ function On(e) {
1639
+ const { chainId: t, maxPriorityFeePerGas: n, gasPrice: s, maxFeePerGas: r, to: i } = e;
1640
+ if (t <= 0)
1641
+ throw new re({ chainId: t });
1642
+ if (i && !T(i))
1643
+ throw new $({ address: i });
1644
+ if (n || r)
1645
+ throw new c("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");
1646
+ if (s && s > 2n ** 256n - 1n)
1647
+ throw new W({ maxFeePerGas: s });
1648
+ }
1649
+ function zn(e) {
1650
+ const { chainId: t, maxPriorityFeePerGas: n, gasPrice: s, maxFeePerGas: r, to: i, accessList: o } = e;
1651
+ if (i && !T(i))
1652
+ throw new $({ address: i });
1653
+ if (typeof t < "u" && t <= 0)
1654
+ throw new re({ chainId: t });
1655
+ if (n || r)
1656
+ throw new c("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");
1657
+ if (s && s > 2n ** 256n - 1n)
1658
+ throw new W({ maxFeePerGas: s });
1659
+ if (o)
1660
+ throw new c("`accessList` is not a valid Legacy Transaction attribute.");
1661
+ }
1662
+ function ie(e) {
1663
+ if (!e || e.length === 0)
1664
+ return [];
1665
+ const t = [];
1666
+ for (let n = 0; n < e.length; n++) {
1667
+ const { address: s, storageKeys: r } = e[n];
1668
+ for (let i = 0; i < r.length; i++)
1669
+ if (r[i].length - 2 !== 64)
1670
+ throw new Xt({ storageKey: r[i] });
1671
+ if (!T(s, { strict: !1 }))
1672
+ throw new $({ address: s });
1673
+ t.push([s, r]);
1674
+ }
1675
+ return t;
1676
+ }
1677
+ function An(e, t) {
1678
+ const n = vn(e);
1679
+ return n === "eip1559" ? Ln(e, t) : n === "eip2930" ? Sn(e, t) : n === "eip4844" ? Fn(e, t) : Gn(e, t);
1680
+ }
1681
+ function Fn(e, t) {
1682
+ const { chainId: n, gas: s, nonce: r, to: i, value: o, maxFeePerBlobGas: a, maxFeePerGas: u, maxPriorityFeePerGas: l, accessList: h, data: f } = e;
1683
+ Cn(e);
1684
+ let p = e.blobVersionedHashes, b = e.sidecars;
1685
+ if (e.blobs && (typeof p > "u" || typeof b > "u")) {
1686
+ const E = typeof e.blobs[0] == "string" ? e.blobs : e.blobs.map((L) => v(L)), H = e.kzg, F = Ve({
1687
+ blobs: E,
1688
+ kzg: H
1689
+ });
1690
+ if (typeof p > "u" && (p = gn({
1691
+ commitments: F
1692
+ })), typeof b > "u") {
1693
+ const L = _e({ blobs: E, commitments: F, kzg: H });
1694
+ b = Pn({ blobs: E, commitments: F, proofs: L });
1695
+ }
1696
+ }
1697
+ const x = ie(h), U = [
1698
+ d(n),
1699
+ r ? d(r) : "0x",
1700
+ l ? d(l) : "0x",
1701
+ u ? d(u) : "0x",
1702
+ s ? d(s) : "0x",
1703
+ i ?? "0x",
1704
+ o ? d(o) : "0x",
1705
+ f ?? "0x",
1706
+ x,
1707
+ a ? d(a) : "0x",
1708
+ p ?? [],
1709
+ ...oe(e, t)
1710
+ ], ae = [], ue = [], ce = [];
1711
+ if (b)
1712
+ for (let E = 0; E < b.length; E++) {
1713
+ const { blob: H, commitment: F, proof: L } = b[E];
1714
+ ae.push(H), ue.push(F), ce.push(L);
1715
+ }
1716
+ return j([
1717
+ "0x03",
1718
+ // If sidecars are enabled, envelope turns into a "wrapper":
1719
+ O(b ? [U, ae, ue, ce] : U)
1720
+ ]);
1721
+ }
1722
+ function Ln(e, t) {
1723
+ const { chainId: n, gas: s, nonce: r, to: i, value: o, maxFeePerGas: a, maxPriorityFeePerGas: u, accessList: l, data: h } = e;
1724
+ Ye(e);
1725
+ const f = ie(l), p = [
1726
+ d(n),
1727
+ r ? d(r) : "0x",
1728
+ u ? d(u) : "0x",
1729
+ a ? d(a) : "0x",
1730
+ s ? d(s) : "0x",
1731
+ i ?? "0x",
1732
+ o ? d(o) : "0x",
1733
+ h ?? "0x",
1734
+ f,
1735
+ ...oe(e, t)
1736
+ ];
1737
+ return j([
1738
+ "0x02",
1739
+ O(p)
1740
+ ]);
1741
+ }
1742
+ function Sn(e, t) {
1743
+ const { chainId: n, gas: s, data: r, nonce: i, to: o, value: a, accessList: u, gasPrice: l } = e;
1744
+ On(e);
1745
+ const h = ie(u), f = [
1746
+ d(n),
1747
+ i ? d(i) : "0x",
1748
+ l ? d(l) : "0x",
1749
+ s ? d(s) : "0x",
1750
+ o ?? "0x",
1751
+ a ? d(a) : "0x",
1752
+ r ?? "0x",
1753
+ h,
1754
+ ...oe(e, t)
1755
+ ];
1756
+ return j([
1757
+ "0x01",
1758
+ O(f)
1759
+ ]);
1760
+ }
1761
+ function Gn(e, t) {
1762
+ const { chainId: n = 0, gas: s, data: r, nonce: i, to: o, value: a, gasPrice: u } = e;
1763
+ zn(e);
1764
+ let l = [
1765
+ i ? d(i) : "0x",
1766
+ u ? d(u) : "0x",
1767
+ s ? d(s) : "0x",
1768
+ o ?? "0x",
1769
+ a ? d(a) : "0x",
1770
+ r ?? "0x"
1771
+ ];
1772
+ if (t) {
1773
+ const h = (() => {
1774
+ if (t.v >= 35n)
1775
+ return (t.v - 35n) / 2n > 0 ? t.v : 27n + (t.v === 35n ? 0n : 1n);
1776
+ if (n > 0)
1777
+ return BigInt(n * 2) + BigInt(35n + t.v - 27n);
1778
+ const b = 27n + (t.v === 27n ? 0n : 1n);
1779
+ if (t.v !== b)
1780
+ throw new Kt({ v: t.v });
1781
+ return b;
1782
+ })(), f = V(t.r), p = V(t.s);
1783
+ l = [
1784
+ ...l,
1785
+ d(h),
1786
+ f === "0x00" ? "0x" : f,
1787
+ p === "0x00" ? "0x" : p
1788
+ ];
1789
+ } else n > 0 && (l = [
1790
+ ...l,
1791
+ d(n),
1792
+ "0x",
1793
+ "0x"
1794
+ ]);
1795
+ return O(l);
1796
+ }
1797
+ function oe(e, t) {
1798
+ const n = t ?? e, { v: s, yParity: r } = n;
1799
+ if (typeof n.r > "u")
1800
+ return [];
1801
+ if (typeof n.s > "u")
1802
+ return [];
1803
+ if (typeof s > "u" && typeof r > "u")
1804
+ return [];
1805
+ const i = V(n.r), o = V(n.s);
1806
+ return [typeof r == "number" ? r ? d(1) : "0x" : s === 0n ? "0x" : s === 1n ? d(1) : s === 27n ? "0x" : d(1), i === "0x00" ? "0x" : i, o === "0x00" ? "0x" : o];
1807
+ }
1808
+ const kn = {
1809
+ gasPriceOracle: { address: "0x420000000000000000000000000000000000000F" },
1810
+ l1Block: { address: "0x4200000000000000000000000000000000000015" },
1811
+ l2CrossDomainMessenger: {
1812
+ address: "0x4200000000000000000000000000000000000007"
1813
+ },
1814
+ l2Erc721Bridge: { address: "0x4200000000000000000000000000000000000014" },
1815
+ l2StandardBridge: { address: "0x4200000000000000000000000000000000000010" },
1816
+ l2ToL1MessagePasser: {
1817
+ address: "0x4200000000000000000000000000000000000016"
1818
+ }
1819
+ }, jn = {
1820
+ block: /* @__PURE__ */ on({
1821
+ format(e) {
1822
+ var n;
1823
+ return {
1824
+ transactions: (n = e.transactions) == null ? void 0 : n.map((s) => {
1825
+ if (typeof s == "string")
1826
+ return s;
1827
+ const r = ne(s);
1828
+ return r.typeHex === "0x7e" && (r.isSystemTx = s.isSystemTx, r.mint = s.mint ? C(s.mint) : void 0, r.sourceHash = s.sourceHash, r.type = "deposit"), r;
1829
+ }),
1830
+ stateRoot: e.stateRoot
1831
+ };
1832
+ }
1833
+ }),
1834
+ transaction: /* @__PURE__ */ sn({
1835
+ format(e) {
1836
+ const t = {};
1837
+ return e.type === "0x7e" && (t.isSystemTx = e.isSystemTx, t.mint = e.mint ? C(e.mint) : void 0, t.sourceHash = e.sourceHash, t.type = "deposit"), t;
1838
+ }
1839
+ }),
1840
+ transactionReceipt: /* @__PURE__ */ Un({
1841
+ format(e) {
1842
+ return {
1843
+ l1GasPrice: e.l1GasPrice ? C(e.l1GasPrice) : null,
1844
+ l1GasUsed: e.l1GasUsed ? C(e.l1GasUsed) : null,
1845
+ l1Fee: e.l1Fee ? C(e.l1Fee) : null,
1846
+ l1FeeScalar: e.l1FeeScalar ? Number(e.l1FeeScalar) : null
1847
+ };
1848
+ }
1849
+ })
1850
+ };
1851
+ function Hn(e, t) {
1852
+ return Vn(e) ? Mn(e) : An(e, t);
1853
+ }
1854
+ const Nn = {
1855
+ transaction: Hn
1856
+ };
1857
+ function Mn(e) {
1858
+ _n(e);
1859
+ const { sourceHash: t, data: n, from: s, gas: r, isSystemTx: i, mint: o, to: a, value: u } = e, l = [
1860
+ t,
1861
+ s,
1862
+ a ?? "0x",
1863
+ o ? d(o) : "0x",
1864
+ u ? d(u) : "0x",
1865
+ r ? d(r) : "0x",
1866
+ i ? "0x1" : "0x",
1867
+ n ?? "0x"
1868
+ ];
1869
+ return j([
1870
+ "0x7e",
1871
+ O(l)
1872
+ ]);
1873
+ }
1874
+ function Vn(e) {
1875
+ return e.type === "deposit" || typeof e.sourceHash < "u";
1876
+ }
1877
+ function _n(e) {
1878
+ const { from: t, to: n } = e;
1879
+ if (t && !T(t))
1880
+ throw new $({ address: t });
1881
+ if (n && !T(n))
1882
+ throw new $({ address: n });
1883
+ }
1884
+ const ye = {
1885
+ contracts: kn,
1886
+ formatters: jn,
1887
+ serializers: Nn
1888
+ }, M = 1, Je = /* @__PURE__ */ X({
1889
+ ...ye,
1890
+ id: 8453,
1891
+ name: "Base",
1892
+ nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
1893
+ rpcUrls: {
1894
+ default: {
1895
+ http: ["https://mainnet.base.org"]
1896
+ }
1897
+ },
1898
+ blockExplorers: {
1899
+ default: {
1900
+ name: "Basescan",
1901
+ url: "https://basescan.org",
1902
+ apiUrl: "https://api.basescan.org/api"
1903
+ }
1904
+ },
1905
+ contracts: {
1906
+ ...ye.contracts,
1907
+ l2OutputOracle: {
1908
+ [M]: {
1909
+ address: "0x56315b90c40730925ec5485cf004d835058518A0"
1910
+ }
1911
+ },
1912
+ multicall3: {
1913
+ address: "0xca11bde05977b3631167028862be2a173976ca11",
1914
+ blockCreated: 5022
1915
+ },
1916
+ portal: {
1917
+ [M]: {
1918
+ address: "0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",
1919
+ blockCreated: 17482143
1920
+ }
1921
+ },
1922
+ l1StandardBridge: {
1923
+ [M]: {
1924
+ address: "0x3154Cf16ccdb4C6d922629664174b904d80F2C35",
1925
+ blockCreated: 17482143
1926
+ }
1927
+ }
1928
+ },
1929
+ sourceId: M
1930
+ }), Qe = /* @__PURE__ */ X({
1931
+ id: 56,
1932
+ name: "BNB Smart Chain",
1933
+ nativeCurrency: {
1934
+ decimals: 18,
1935
+ name: "BNB",
1936
+ symbol: "BNB"
1937
+ },
1938
+ rpcUrls: {
1939
+ default: { http: ["https://rpc.ankr.com/bsc"] }
1940
+ },
1941
+ blockExplorers: {
1942
+ default: {
1943
+ name: "BscScan",
1944
+ url: "https://bscscan.com",
1945
+ apiUrl: "https://api.bscscan.com/api"
1946
+ }
1947
+ },
1948
+ contracts: {
1949
+ multicall3: {
1950
+ address: "0xca11bde05977b3631167028862be2a173976ca11",
1951
+ blockCreated: 15921452
1952
+ }
1953
+ }
1954
+ }), Ze = /* @__PURE__ */ X({
1955
+ id: 17e3,
1956
+ name: "Holesky",
1957
+ nativeCurrency: { name: "Holesky Ether", symbol: "ETH", decimals: 18 },
1958
+ rpcUrls: {
1959
+ default: {
1960
+ http: ["https://ethereum-holesky-rpc.publicnode.com"]
1961
+ }
1962
+ },
1963
+ blockExplorers: {
1964
+ default: {
1965
+ name: "Etherscan",
1966
+ url: "https://holesky.etherscan.io"
1967
+ }
1968
+ },
1969
+ contracts: {
1970
+ multicall3: {
1971
+ address: "0xca11bde05977b3631167028862be2a173976ca11",
1972
+ blockCreated: 77
1973
+ },
1974
+ ensRegistry: {
1975
+ address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
1976
+ blockCreated: 801613
1977
+ },
1978
+ ensUniversalResolver: {
1979
+ address: "0xa6AC935D4971E3CD133b950aE053bECD16fE7f3b",
1980
+ blockCreated: 973484
1981
+ }
1982
+ },
1983
+ testnet: !0
1984
+ }), et = /* @__PURE__ */ X({
1985
+ id: 1,
1986
+ name: "Ethereum",
1987
+ nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
1988
+ rpcUrls: {
1989
+ default: {
1990
+ http: ["https://cloudflare-eth.com"]
1991
+ }
1992
+ },
1993
+ blockExplorers: {
1994
+ default: {
1995
+ name: "Etherscan",
1996
+ url: "https://etherscan.io",
1997
+ apiUrl: "https://api.etherscan.io/api"
1998
+ }
1999
+ },
2000
+ contracts: {
2001
+ ensRegistry: {
2002
+ address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"
2003
+ },
2004
+ ensUniversalResolver: {
2005
+ address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67",
2006
+ blockCreated: 19258213
2007
+ },
2008
+ multicall3: {
2009
+ address: "0xca11bde05977b3631167028862be2a173976ca11",
2010
+ blockCreated: 14353601
2011
+ }
2012
+ }
2013
+ });
2014
+ var G = ((e) => (e[e.Mainnet = et.id] = "Mainnet", e[e.Holesky = Ze.id] = "Holesky", e[e.Base = Je.id] = "Base", e[e.Bsc = Qe.id] = "Bsc", e))(G || {});
2015
+ const cs = {
2016
+ [G.Mainnet]: et,
2017
+ [G.Holesky]: Ze,
2018
+ [G.Base]: Je,
2019
+ [G.Bsc]: Qe
2020
+ };
2021
+ export {
2022
+ qt as $,
2023
+ j as A,
2024
+ c as B,
2025
+ G as C,
2026
+ I as D,
2027
+ ne as E,
2028
+ ns as F,
2029
+ Tn as G,
2030
+ Te as H,
2031
+ $ as I,
2032
+ Jn as J,
2033
+ rn as K,
2034
+ Ae as L,
2035
+ ut as M,
2036
+ kt as N,
2037
+ A as O,
2038
+ Wn as P,
2039
+ Ge as Q,
2040
+ jt as R,
2041
+ je as S,
2042
+ ts as T,
2043
+ Dt as U,
2044
+ cs as V,
2045
+ ss as W,
2046
+ B as X,
2047
+ Rn as Y,
2048
+ He as Z,
2049
+ W as _,
2050
+ qn as a,
2051
+ Yt as a0,
2052
+ Jt as a1,
2053
+ Qt as a2,
2054
+ Zt as a3,
2055
+ en as a4,
2056
+ tn as a5,
2057
+ nn as a6,
2058
+ Ne as a7,
2059
+ rs as a8,
2060
+ Kn as a9,
2061
+ Zn as aa,
2062
+ Ve as ab,
2063
+ gn as ac,
2064
+ _e as ad,
2065
+ Pn as ae,
2066
+ vn as af,
2067
+ Nt as ag,
2068
+ is as ah,
2069
+ us as ai,
2070
+ as as aj,
2071
+ os as ak,
2072
+ es as al,
2073
+ K as b,
2074
+ Qn as c,
2075
+ lt as d,
2076
+ D as e,
2077
+ v as f,
2078
+ Dn as g,
2079
+ Xn as h,
2080
+ k as i,
2081
+ Be as j,
2082
+ Lt as k,
2083
+ Ie as l,
2084
+ d as m,
2085
+ Ee as n,
2086
+ V as o,
2087
+ st as p,
2088
+ _ as q,
2089
+ Yn as r,
2090
+ hn as s,
2091
+ Z as t,
2092
+ En as u,
2093
+ T as v,
2094
+ P as w,
2095
+ Fe as x,
2096
+ C as y,
2097
+ Ht as z
2098
+ };
2099
+ //# sourceMappingURL=constants-rWWWhxR_.js.map