@pufferfinance/puffer-sdk 1.8.1 → 1.9.1

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 (197) hide show
  1. package/dist/api/puffer-client-helpers.cjs +1 -1
  2. package/dist/api/puffer-client-helpers.cjs.map +1 -1
  3. package/dist/api/puffer-client-helpers.js +82 -81
  4. package/dist/api/puffer-client-helpers.js.map +1 -1
  5. package/dist/api/puffer-client.cjs +1 -1
  6. package/dist/api/puffer-client.cjs.map +1 -1
  7. package/dist/api/puffer-client.d.ts +3 -0
  8. package/dist/api/puffer-client.js +56 -49
  9. package/dist/api/puffer-client.js.map +1 -1
  10. package/dist/ccip-BO_b9tFc.cjs +2 -0
  11. package/dist/ccip-BO_b9tFc.cjs.map +1 -0
  12. package/dist/ccip-DLDO0_x2.js +148 -0
  13. package/dist/ccip-DLDO0_x2.js.map +1 -0
  14. package/dist/chains/constants.cjs +1 -1
  15. package/dist/chains/constants.js +1 -1
  16. package/dist/constants-BjRNQpT2.js +1997 -0
  17. package/dist/constants-BjRNQpT2.js.map +1 -0
  18. package/dist/constants-DA2xUb9r.cjs +9 -0
  19. package/dist/constants-DA2xUb9r.cjs.map +1 -0
  20. package/dist/contracts/abis/holesky/PufferDepositor.cjs.map +1 -1
  21. package/dist/contracts/abis/holesky/PufferDepositor.js.map +1 -1
  22. package/dist/contracts/abis/holesky/PufferVaultV2.cjs.map +1 -1
  23. package/dist/contracts/abis/holesky/PufferVaultV2.js.map +1 -1
  24. package/dist/contracts/abis/l1-reward-manager-abis.cjs +1 -1
  25. package/dist/contracts/abis/l1-reward-manager-abis.cjs.map +1 -1
  26. package/dist/contracts/abis/l1-reward-manager-abis.js +1 -1
  27. package/dist/contracts/abis/l2-reward-manager-abis.cjs +1 -1
  28. package/dist/contracts/abis/l2-reward-manager-abis.cjs.map +1 -1
  29. package/dist/contracts/abis/l2-reward-manager-abis.js +1 -1
  30. package/dist/contracts/abis/mainnet/Accountant.cjs.map +1 -1
  31. package/dist/contracts/abis/mainnet/Accountant.js.map +1 -1
  32. package/dist/contracts/abis/mainnet/AtomicQueue.cjs +2 -0
  33. package/dist/contracts/abis/mainnet/AtomicQueue.cjs.map +1 -0
  34. package/dist/contracts/abis/mainnet/AtomicQueue.d.ts +328 -0
  35. package/dist/contracts/abis/mainnet/AtomicQueue.js +237 -0
  36. package/dist/contracts/abis/mainnet/AtomicQueue.js.map +1 -0
  37. package/dist/contracts/abis/mainnet/BoringVault.cjs.map +1 -1
  38. package/dist/contracts/abis/mainnet/BoringVault.js.map +1 -1
  39. package/dist/contracts/abis/mainnet/ERC20Permit.cjs.map +1 -1
  40. package/dist/contracts/abis/mainnet/ERC20Permit.js.map +1 -1
  41. package/dist/contracts/abis/mainnet/L1RewardManager.cjs.map +1 -1
  42. package/dist/contracts/abis/mainnet/L1RewardManager.js.map +1 -1
  43. package/dist/contracts/abis/mainnet/L2RewardManager.cjs.map +1 -1
  44. package/dist/contracts/abis/mainnet/L2RewardManager.js.map +1 -1
  45. package/dist/contracts/abis/mainnet/PufLocker.cjs.map +1 -1
  46. package/dist/contracts/abis/mainnet/PufLocker.js.map +1 -1
  47. package/dist/contracts/abis/mainnet/PufferDepositor.cjs.map +1 -1
  48. package/dist/contracts/abis/mainnet/PufferDepositor.js.map +1 -1
  49. package/dist/contracts/abis/mainnet/PufferL2Depositor.cjs.map +1 -1
  50. package/dist/contracts/abis/mainnet/PufferL2Depositor.js.map +1 -1
  51. package/dist/contracts/abis/mainnet/PufferVaultV2.cjs.map +1 -1
  52. package/dist/contracts/abis/mainnet/PufferVaultV2.js.map +1 -1
  53. package/dist/contracts/abis/mainnet/PufferWithdrawalManager.cjs.map +1 -1
  54. package/dist/contracts/abis/mainnet/PufferWithdrawalManager.js.map +1 -1
  55. package/dist/contracts/abis/mainnet/Teller.cjs.map +1 -1
  56. package/dist/contracts/abis/mainnet/Teller.js.map +1 -1
  57. package/dist/contracts/abis/nucleus-accountant-abis.cjs +1 -1
  58. package/dist/contracts/abis/nucleus-accountant-abis.cjs.map +1 -1
  59. package/dist/contracts/abis/nucleus-accountant-abis.js +1 -1
  60. package/dist/contracts/abis/nucleus-atomic-queue-abis.cjs +2 -0
  61. package/dist/contracts/abis/nucleus-atomic-queue-abis.cjs.map +1 -0
  62. package/dist/contracts/abis/nucleus-atomic-queue-abis.d.ts +332 -0
  63. package/dist/contracts/abis/nucleus-atomic-queue-abis.js +9 -0
  64. package/dist/contracts/abis/nucleus-atomic-queue-abis.js.map +1 -0
  65. package/dist/contracts/abis/nucleus-boring-vault-abis.cjs +1 -1
  66. package/dist/contracts/abis/nucleus-boring-vault-abis.cjs.map +1 -1
  67. package/dist/contracts/abis/nucleus-boring-vault-abis.js +1 -1
  68. package/dist/contracts/abis/nucleus-teller-abis.cjs +1 -1
  69. package/dist/contracts/abis/nucleus-teller-abis.cjs.map +1 -1
  70. package/dist/contracts/abis/nucleus-teller-abis.js +1 -1
  71. package/dist/contracts/abis/puf-locker-abis.cjs +1 -1
  72. package/dist/contracts/abis/puf-locker-abis.cjs.map +1 -1
  73. package/dist/contracts/abis/puf-locker-abis.js +1 -1
  74. package/dist/contracts/abis/puffer-depositor-abis.cjs +1 -1
  75. package/dist/contracts/abis/puffer-depositor-abis.cjs.map +1 -1
  76. package/dist/contracts/abis/puffer-depositor-abis.js +1 -1
  77. package/dist/contracts/abis/puffer-depositor-abis.js.map +1 -1
  78. package/dist/contracts/abis/puffer-vault-abis.cjs +1 -1
  79. package/dist/contracts/abis/puffer-vault-abis.cjs.map +1 -1
  80. package/dist/contracts/abis/puffer-vault-abis.js +1 -1
  81. package/dist/contracts/abis/puffer-vault-abis.js.map +1 -1
  82. package/dist/contracts/abis/puffer-withdrawal-manager-abis.cjs +1 -1
  83. package/dist/contracts/abis/puffer-withdrawal-manager-abis.cjs.map +1 -1
  84. package/dist/contracts/abis/puffer-withdrawal-manager-abis.js +1 -1
  85. package/dist/contracts/addresses.cjs +1 -1
  86. package/dist/contracts/addresses.cjs.map +1 -1
  87. package/dist/contracts/addresses.d.ts +14 -0
  88. package/dist/contracts/addresses.js +3 -2
  89. package/dist/contracts/addresses.js.map +1 -1
  90. package/dist/contracts/handlers/erc20-permit-handler.cjs +1 -1
  91. package/dist/contracts/handlers/erc20-permit-handler.cjs.map +1 -1
  92. package/dist/contracts/handlers/erc20-permit-handler.d.ts +11128 -2714
  93. package/dist/contracts/handlers/erc20-permit-handler.js +3 -3
  94. package/dist/contracts/handlers/erc20-permit-handler.js.map +1 -1
  95. package/dist/contracts/handlers/l1-reward-manager-handler.cjs +1 -1
  96. package/dist/contracts/handlers/l1-reward-manager-handler.cjs.map +1 -1
  97. package/dist/contracts/handlers/l1-reward-manager-handler.d.ts +11128 -2714
  98. package/dist/contracts/handlers/l1-reward-manager-handler.js +2 -2
  99. package/dist/contracts/handlers/l1-reward-manager-handler.js.map +1 -1
  100. package/dist/contracts/handlers/l2-reward-manager-handler.cjs +1 -1
  101. package/dist/contracts/handlers/l2-reward-manager-handler.cjs.map +1 -1
  102. package/dist/contracts/handlers/l2-reward-manager-handler.d.ts +11128 -2714
  103. package/dist/contracts/handlers/l2-reward-manager-handler.js +2 -2
  104. package/dist/contracts/handlers/l2-reward-manager-handler.js.map +1 -1
  105. package/dist/contracts/handlers/nucleus-accountant-handler.cjs +1 -1
  106. package/dist/contracts/handlers/nucleus-accountant-handler.cjs.map +1 -1
  107. package/dist/contracts/handlers/nucleus-accountant-handler.d.ts +11128 -2714
  108. package/dist/contracts/handlers/nucleus-accountant-handler.js +1 -1
  109. package/dist/contracts/handlers/nucleus-accountant-handler.js.map +1 -1
  110. package/dist/contracts/handlers/nucleus-atomic-queue-handler.cjs +2 -0
  111. package/dist/contracts/handlers/nucleus-atomic-queue-handler.cjs.map +1 -0
  112. package/dist/contracts/handlers/nucleus-atomic-queue-handler.d.ts +14923 -0
  113. package/dist/contracts/handlers/nucleus-atomic-queue-handler.js +89 -0
  114. package/dist/contracts/handlers/nucleus-atomic-queue-handler.js.map +1 -0
  115. package/dist/contracts/handlers/nucleus-boring-vault-handler.cjs +1 -1
  116. package/dist/contracts/handlers/nucleus-boring-vault-handler.cjs.map +1 -1
  117. package/dist/contracts/handlers/nucleus-boring-vault-handler.d.ts +11128 -2714
  118. package/dist/contracts/handlers/nucleus-boring-vault-handler.js +2 -2
  119. package/dist/contracts/handlers/nucleus-boring-vault-handler.js.map +1 -1
  120. package/dist/contracts/handlers/nucleus-teller-handler.cjs +1 -1
  121. package/dist/contracts/handlers/nucleus-teller-handler.cjs.map +1 -1
  122. package/dist/contracts/handlers/nucleus-teller-handler.d.ts +11128 -2714
  123. package/dist/contracts/handlers/nucleus-teller-handler.js +2 -2
  124. package/dist/contracts/handlers/nucleus-teller-handler.js.map +1 -1
  125. package/dist/contracts/handlers/puf-locker-handler.cjs +1 -1
  126. package/dist/contracts/handlers/puf-locker-handler.cjs.map +1 -1
  127. package/dist/contracts/handlers/puf-locker-handler.d.ts +11128 -2714
  128. package/dist/contracts/handlers/puf-locker-handler.js +2 -2
  129. package/dist/contracts/handlers/puf-locker-handler.js.map +1 -1
  130. package/dist/contracts/handlers/puffer-depositor-handler.cjs +1 -1
  131. package/dist/contracts/handlers/puffer-depositor-handler.cjs.map +1 -1
  132. package/dist/contracts/handlers/puffer-depositor-handler.d.ts +11128 -2714
  133. package/dist/contracts/handlers/puffer-depositor-handler.js +2 -2
  134. package/dist/contracts/handlers/puffer-depositor-handler.js.map +1 -1
  135. package/dist/contracts/handlers/puffer-l2-depositor-handler.cjs +1 -1
  136. package/dist/contracts/handlers/puffer-l2-depositor-handler.cjs.map +1 -1
  137. package/dist/contracts/handlers/puffer-l2-depositor-handler.d.ts +11128 -2714
  138. package/dist/contracts/handlers/puffer-l2-depositor-handler.js +2 -2
  139. package/dist/contracts/handlers/puffer-l2-depositor-handler.js.map +1 -1
  140. package/dist/contracts/handlers/puffer-vault-handler.cjs +1 -1
  141. package/dist/contracts/handlers/puffer-vault-handler.cjs.map +1 -1
  142. package/dist/contracts/handlers/puffer-vault-handler.d.ts +11128 -2714
  143. package/dist/contracts/handlers/puffer-vault-handler.js +2 -2
  144. package/dist/contracts/handlers/puffer-vault-handler.js.map +1 -1
  145. package/dist/contracts/handlers/puffer-withdrawal-manager-handler.cjs +1 -1
  146. package/dist/contracts/handlers/puffer-withdrawal-manager-handler.cjs.map +1 -1
  147. package/dist/contracts/handlers/puffer-withdrawal-manager-handler.d.ts +11128 -2714
  148. package/dist/contracts/handlers/puffer-withdrawal-manager-handler.js +2 -2
  149. package/dist/contracts/handlers/puffer-withdrawal-manager-handler.js.map +1 -1
  150. package/dist/contracts/tokens.cjs +1 -1
  151. package/dist/contracts/tokens.cjs.map +1 -1
  152. package/dist/contracts/tokens.js +1 -1
  153. package/dist/contracts/tokens.js.map +1 -1
  154. package/dist/createWalletClient-BuLYysrp.cjs +4 -0
  155. package/dist/createWalletClient-BuLYysrp.cjs.map +1 -0
  156. package/dist/createWalletClient-DNcW-ENe.js +2028 -0
  157. package/dist/createWalletClient-DNcW-ENe.js.map +1 -0
  158. package/dist/errors/base-error.cjs.map +1 -1
  159. package/dist/errors/base-error.js.map +1 -1
  160. package/dist/{getContract-MrPLx6gp.cjs → getContract-3QbyfZBF.cjs} +2 -2
  161. package/dist/getContract-3QbyfZBF.cjs.map +1 -0
  162. package/dist/{getContract-B3Spz0SO.js → getContract-CezEyDf-.js} +2 -2
  163. package/dist/{getContract-MrPLx6gp.cjs.map → getContract-CezEyDf-.js.map} +1 -1
  164. package/dist/main.cjs +1 -1
  165. package/dist/main.js +1 -1
  166. package/dist/secp256k1-3OC5y4qp.js +1579 -0
  167. package/dist/secp256k1-3OC5y4qp.js.map +1 -0
  168. package/dist/secp256k1-bcahnPX9.cjs +2 -0
  169. package/dist/secp256k1-bcahnPX9.cjs.map +1 -0
  170. package/dist/utils/version.cjs +1 -1
  171. package/dist/utils/version.js +1 -1
  172. package/dist/writeContract-ChuHpJLC.js +3799 -0
  173. package/dist/writeContract-ChuHpJLC.js.map +1 -0
  174. package/dist/writeContract-D97dSJQe.cjs +32 -0
  175. package/dist/writeContract-D97dSJQe.cjs.map +1 -0
  176. package/package.json +13 -13
  177. package/dist/ccip-D4klNwCt.js +0 -159
  178. package/dist/ccip-D4klNwCt.js.map +0 -1
  179. package/dist/ccip-DLDqFodf.cjs +0 -2
  180. package/dist/ccip-DLDqFodf.cjs.map +0 -1
  181. package/dist/constants-BvU-JhfL.cjs +0 -9
  182. package/dist/constants-BvU-JhfL.cjs.map +0 -1
  183. package/dist/constants-rWWWhxR_.js +0 -2099
  184. package/dist/constants-rWWWhxR_.js.map +0 -1
  185. package/dist/createWalletClient-Bmopj8MM.cjs +0 -4
  186. package/dist/createWalletClient-Bmopj8MM.cjs.map +0 -1
  187. package/dist/createWalletClient-DKcpswHR.js +0 -2007
  188. package/dist/createWalletClient-DKcpswHR.js.map +0 -1
  189. package/dist/getContract-B3Spz0SO.js.map +0 -1
  190. package/dist/secp256k1-BLbXMlpX.js +0 -1172
  191. package/dist/secp256k1-BLbXMlpX.js.map +0 -1
  192. package/dist/secp256k1-CFnFaJ0H.cjs +0 -2
  193. package/dist/secp256k1-CFnFaJ0H.cjs.map +0 -1
  194. package/dist/writeContract-BBHpAss8.cjs +0 -32
  195. package/dist/writeContract-BBHpAss8.cjs.map +0 -1
  196. package/dist/writeContract-RluxM31W.js +0 -3833
  197. package/dist/writeContract-RluxM31W.js.map +0 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pufferfinance/puffer-sdk",
3
3
  "description": "SDK for interacting with the puffer smart contracts",
4
- "version": "1.8.1",
4
+ "version": "1.9.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/PufferFinance/puffer-sdk.git"
@@ -48,26 +48,26 @@
48
48
  "docs:deploy": "pnpm --filter docs run deploy"
49
49
  },
50
50
  "dependencies": {
51
- "viem": "~2.18.0"
51
+ "viem": "~2.21.55"
52
52
  },
53
53
  "devDependencies": {
54
- "@eslint/js": "^9.9.0",
55
- "@types/jest": "^29.5.12",
56
- "@types/node": "^20.14.2",
57
- "eslint": "^9.9.0",
54
+ "@eslint/js": "^9.17.0",
55
+ "@types/jest": "^29.5.14",
56
+ "@types/node": "^22.10.2",
57
+ "eslint": "^9.17.0",
58
58
  "eslint-config-prettier": "^9.1.0",
59
59
  "eslint-plugin-prettier": "^5.2.1",
60
60
  "eth-testing": "^1.14.0",
61
61
  "glob": "^11.0.0",
62
62
  "jest": "^29.7.0",
63
63
  "jest-environment-jsdom": "^29.7.0",
64
- "prettier": "^3.3.3",
65
- "release-it": "^17.6.0",
66
- "ts-jest": "^29.2.4",
64
+ "prettier": "^3.4.2",
65
+ "release-it": "^17.10.0",
66
+ "ts-jest": "^29.2.5",
67
67
  "ts-node": "^10.9.2",
68
- "typescript": "^5.5.4",
69
- "typescript-eslint": "^8.1.0",
70
- "vite": "^5.4.0",
71
- "vite-plugin-dts": "^4.0.2"
68
+ "typescript": "^5.7.2",
69
+ "typescript-eslint": "^8.18.1",
70
+ "vite": "^6.0.4",
71
+ "vite-plugin-dts": "^4.4.0"
72
72
  }
73
73
  }
@@ -1,159 +0,0 @@
1
- import { d as m, f as w, i as k, h as O, j as E, H as h } from "./writeContract-RluxM31W.js";
2
- import { B as p, g as y, c as L, i as x } from "./constants-rWWWhxR_.js";
3
- class M extends p {
4
- constructor({ callbackSelector: s, cause: e, data: o, extraData: c, sender: u, urls: t }) {
5
- var i;
6
- super(e.shortMessage || "An error occurred while fetching for an offchain result.", {
7
- cause: e,
8
- metaMessages: [
9
- ...e.metaMessages || [],
10
- (i = e.metaMessages) != null && i.length ? "" : [],
11
- "Offchain Gateway Call:",
12
- t && [
13
- " Gateway URL(s):",
14
- ...t.map((f) => ` ${y(f)}`)
15
- ],
16
- ` Sender: ${u}`,
17
- ` Data: ${o}`,
18
- ` Callback selector: ${s}`,
19
- ` Extra data: ${c}`
20
- ].flat()
21
- }), Object.defineProperty(this, "name", {
22
- enumerable: !0,
23
- configurable: !0,
24
- writable: !0,
25
- value: "OffchainLookupError"
26
- });
27
- }
28
- }
29
- class R extends p {
30
- constructor({ result: s, url: e }) {
31
- super("Offchain gateway response is malformed. Response data must be a hex value.", {
32
- metaMessages: [
33
- `Gateway URL: ${y(e)}`,
34
- `Response: ${m(s)}`
35
- ]
36
- }), Object.defineProperty(this, "name", {
37
- enumerable: !0,
38
- configurable: !0,
39
- writable: !0,
40
- value: "OffchainLookupResponseMalformedError"
41
- });
42
- }
43
- }
44
- class $ extends p {
45
- constructor({ sender: s, to: e }) {
46
- super("Reverted sender address does not match target contract address (`to`).", {
47
- metaMessages: [
48
- `Contract address: ${e}`,
49
- `OffchainLookup sender address: ${s}`
50
- ]
51
- }), Object.defineProperty(this, "name", {
52
- enumerable: !0,
53
- configurable: !0,
54
- writable: !0,
55
- value: "OffchainLookupSenderMismatchError"
56
- });
57
- }
58
- }
59
- const v = "0x556f1830", S = {
60
- name: "OffchainLookup",
61
- type: "error",
62
- inputs: [
63
- {
64
- name: "sender",
65
- type: "address"
66
- },
67
- {
68
- name: "urls",
69
- type: "string[]"
70
- },
71
- {
72
- name: "callData",
73
- type: "bytes"
74
- },
75
- {
76
- name: "callbackFunction",
77
- type: "bytes4"
78
- },
79
- {
80
- name: "extraData",
81
- type: "bytes"
82
- }
83
- ]
84
- };
85
- async function A(n, { blockNumber: s, blockTag: e, data: o, to: c }) {
86
- const { args: u } = w({
87
- data: o,
88
- abi: [S]
89
- }), [t, i, f, a, r] = u, { ccipRead: d } = n, b = d && typeof (d == null ? void 0 : d.request) == "function" ? d.request : j;
90
- try {
91
- if (!k(c, t))
92
- throw new $({ sender: t, to: c });
93
- const l = await b({ data: f, sender: t, urls: i }), { data: g } = await O(n, {
94
- blockNumber: s,
95
- blockTag: e,
96
- data: L([
97
- a,
98
- E([{ type: "bytes" }, { type: "bytes" }], [l, r])
99
- ]),
100
- to: c
101
- });
102
- return g;
103
- } catch (l) {
104
- throw new M({
105
- callbackSelector: a,
106
- cause: l,
107
- data: o,
108
- extraData: r,
109
- sender: t,
110
- urls: i
111
- });
112
- }
113
- }
114
- async function j({ data: n, sender: s, urls: e }) {
115
- var c;
116
- let o = new Error("An unknown error occurred.");
117
- for (let u = 0; u < e.length; u++) {
118
- const t = e[u], i = t.includes("{data}") ? "GET" : "POST", f = i === "POST" ? { data: n, sender: s } : void 0;
119
- try {
120
- const a = await fetch(t.replace("{sender}", s).replace("{data}", n), {
121
- body: JSON.stringify(f),
122
- method: i
123
- });
124
- let r;
125
- if ((c = a.headers.get("Content-Type")) != null && c.startsWith("application/json") ? r = (await a.json()).data : r = await a.text(), !a.ok) {
126
- o = new h({
127
- body: f,
128
- details: r != null && r.error ? m(r.error) : a.statusText,
129
- headers: a.headers,
130
- status: a.status,
131
- url: t
132
- });
133
- continue;
134
- }
135
- if (!x(r)) {
136
- o = new R({
137
- result: r,
138
- url: t
139
- });
140
- continue;
141
- }
142
- return r;
143
- } catch (a) {
144
- o = new h({
145
- body: f,
146
- details: a.message,
147
- url: t
148
- });
149
- }
150
- }
151
- throw o;
152
- }
153
- export {
154
- j as ccipRequest,
155
- A as offchainLookup,
156
- S as offchainLookupAbiItem,
157
- v as offchainLookupSignature
158
- };
159
- //# sourceMappingURL=ccip-D4klNwCt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ccip-D4klNwCt.js","sources":["../node_modules/.pnpm/viem@2.18.8_typescript@5.5.4_zod@3.23.8/node_modules/viem/_esm/errors/ccip.js","../node_modules/.pnpm/viem@2.18.8_typescript@5.5.4_zod@3.23.8/node_modules/viem/_esm/utils/ccip.js"],"sourcesContent":["import { stringify } from '../utils/stringify.js';\nimport { BaseError } from './base.js';\nimport { getUrl } from './utils.js';\nexport class OffchainLookupError extends BaseError {\n constructor({ callbackSelector, cause, data, extraData, sender, urls, }) {\n super(cause.shortMessage ||\n 'An error occurred while fetching for an offchain result.', {\n cause,\n metaMessages: [\n ...(cause.metaMessages || []),\n cause.metaMessages?.length ? '' : [],\n 'Offchain Gateway Call:',\n urls && [\n ' Gateway URL(s):',\n ...urls.map((url) => ` ${getUrl(url)}`),\n ],\n ` Sender: ${sender}`,\n ` Data: ${data}`,\n ` Callback selector: ${callbackSelector}`,\n ` Extra data: ${extraData}`,\n ].flat(),\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupError'\n });\n }\n}\nexport class OffchainLookupResponseMalformedError extends BaseError {\n constructor({ result, url }) {\n super('Offchain gateway response is malformed. Response data must be a hex value.', {\n metaMessages: [\n `Gateway URL: ${getUrl(url)}`,\n `Response: ${stringify(result)}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupResponseMalformedError'\n });\n }\n}\nexport class OffchainLookupSenderMismatchError extends BaseError {\n constructor({ sender, to }) {\n super('Reverted sender address does not match target contract address (`to`).', {\n metaMessages: [\n `Contract address: ${to}`,\n `OffchainLookup sender address: ${sender}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupSenderMismatchError'\n });\n }\n}\n//# sourceMappingURL=ccip.js.map","import { call } from '../actions/public/call.js';\nimport { OffchainLookupError, OffchainLookupResponseMalformedError, OffchainLookupSenderMismatchError, } from '../errors/ccip.js';\nimport { HttpRequestError, } from '../errors/request.js';\nimport { decodeErrorResult } from './abi/decodeErrorResult.js';\nimport { encodeAbiParameters } from './abi/encodeAbiParameters.js';\nimport { isAddressEqual } from './address/isAddressEqual.js';\nimport { concat } from './data/concat.js';\nimport { isHex } from './data/isHex.js';\nimport { stringify } from './stringify.js';\nexport const offchainLookupSignature = '0x556f1830';\nexport const offchainLookupAbiItem = {\n name: 'OffchainLookup',\n type: 'error',\n inputs: [\n {\n name: 'sender',\n type: 'address',\n },\n {\n name: 'urls',\n type: 'string[]',\n },\n {\n name: 'callData',\n type: 'bytes',\n },\n {\n name: 'callbackFunction',\n type: 'bytes4',\n },\n {\n name: 'extraData',\n type: 'bytes',\n },\n ],\n};\nexport async function offchainLookup(client, { blockNumber, blockTag, data, to, }) {\n const { args } = decodeErrorResult({\n data,\n abi: [offchainLookupAbiItem],\n });\n const [sender, urls, callData, callbackSelector, extraData] = args;\n const { ccipRead } = client;\n const ccipRequest_ = ccipRead && typeof ccipRead?.request === 'function'\n ? ccipRead.request\n : ccipRequest;\n try {\n if (!isAddressEqual(to, sender))\n throw new OffchainLookupSenderMismatchError({ sender, to });\n const result = await ccipRequest_({ data: callData, sender, urls });\n const { data: data_ } = await call(client, {\n blockNumber,\n blockTag,\n data: concat([\n callbackSelector,\n encodeAbiParameters([{ type: 'bytes' }, { type: 'bytes' }], [result, extraData]),\n ]),\n to,\n });\n return data_;\n }\n catch (err) {\n throw new OffchainLookupError({\n callbackSelector,\n cause: err,\n data,\n extraData,\n sender,\n urls,\n });\n }\n}\nexport async function ccipRequest({ data, sender, urls, }) {\n let error = new Error('An unknown error occurred.');\n for (let i = 0; i < urls.length; i++) {\n const url = urls[i];\n const method = url.includes('{data}') ? 'GET' : 'POST';\n const body = method === 'POST' ? { data, sender } : undefined;\n try {\n const response = await fetch(url.replace('{sender}', sender).replace('{data}', data), {\n body: JSON.stringify(body),\n method,\n });\n let result;\n if (response.headers.get('Content-Type')?.startsWith('application/json')) {\n result = (await response.json()).data;\n }\n else {\n result = (await response.text());\n }\n if (!response.ok) {\n error = new HttpRequestError({\n body,\n details: result?.error\n ? stringify(result.error)\n : response.statusText,\n headers: response.headers,\n status: response.status,\n url,\n });\n continue;\n }\n if (!isHex(result)) {\n error = new OffchainLookupResponseMalformedError({\n result,\n url,\n });\n continue;\n }\n return result;\n }\n catch (err) {\n error = new HttpRequestError({\n body,\n details: err.message,\n url,\n });\n }\n }\n throw error;\n}\n//# sourceMappingURL=ccip.js.map"],"names":["OffchainLookupError","BaseError","callbackSelector","cause","data","extraData","sender","urls","_a","url","getUrl","OffchainLookupResponseMalformedError","result","stringify","OffchainLookupSenderMismatchError","to","offchainLookupSignature","offchainLookupAbiItem","offchainLookup","client","blockNumber","blockTag","args","decodeErrorResult","callData","ccipRead","ccipRequest_","ccipRequest","isAddressEqual","data_","call","concat","encodeAbiParameters","err","error","i","method","body","response","HttpRequestError","isHex"],"mappings":"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","x_google_ignoreList":[0,1]}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./writeContract-BBHpAss8.cjs"),d=require("./constants-BvU-JhfL.cjs");class w extends d.BaseError{constructor({callbackSelector:s,cause:e,data:o,extraData:c,sender:f,urls:t}){var i;super(e.shortMessage||"An error occurred while fetching for an offchain result.",{cause:e,metaMessages:[...e.metaMessages||[],(i=e.metaMessages)!=null&&i.length?"":[],"Offchain Gateway Call:",t&&[" Gateway URL(s):",...t.map(l=>` ${d.getUrl(l)}`)],` Sender: ${f}`,` Data: ${o}`,` Callback selector: ${s}`,` Extra data: ${c}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class k extends d.BaseError{constructor({result:s,url:e}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${d.getUrl(e)}`,`Response: ${u.stringify(s)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class O extends d.BaseError{constructor({sender:s,to:e}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${e}`,`OffchainLookup sender address: ${s}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}const E="0x556f1830",y={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function L(n,{blockNumber:s,blockTag:e,data:o,to:c}){const{args:f}=u.decodeErrorResult({data:o,abi:[y]}),[t,i,l,r,a]=f,{ccipRead:p}=n,b=p&&typeof(p==null?void 0:p.request)=="function"?p.request:m;try{if(!u.isAddressEqual(c,t))throw new O({sender:t,to:c});const h=await b({data:l,sender:t,urls:i}),{data:g}=await u.call(n,{blockNumber:s,blockTag:e,data:d.concat([r,u.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[h,a])]),to:c});return g}catch(h){throw new w({callbackSelector:r,cause:h,data:o,extraData:a,sender:t,urls:i})}}async function m({data:n,sender:s,urls:e}){var c;let o=new Error("An unknown error occurred.");for(let f=0;f<e.length;f++){const t=e[f],i=t.includes("{data}")?"GET":"POST",l=i==="POST"?{data:n,sender:s}:void 0;try{const r=await fetch(t.replace("{sender}",s).replace("{data}",n),{body:JSON.stringify(l),method:i});let a;if((c=r.headers.get("Content-Type"))!=null&&c.startsWith("application/json")?a=(await r.json()).data:a=await r.text(),!r.ok){o=new u.HttpRequestError({body:l,details:a!=null&&a.error?u.stringify(a.error):r.statusText,headers:r.headers,status:r.status,url:t});continue}if(!d.isHex(a)){o=new k({result:a,url:t});continue}return a}catch(r){o=new u.HttpRequestError({body:l,details:r.message,url:t})}}throw o}exports.ccipRequest=m;exports.offchainLookup=L;exports.offchainLookupAbiItem=y;exports.offchainLookupSignature=E;
2
- //# sourceMappingURL=ccip-DLDqFodf.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ccip-DLDqFodf.cjs","sources":["../node_modules/.pnpm/viem@2.18.8_typescript@5.5.4_zod@3.23.8/node_modules/viem/_esm/errors/ccip.js","../node_modules/.pnpm/viem@2.18.8_typescript@5.5.4_zod@3.23.8/node_modules/viem/_esm/utils/ccip.js"],"sourcesContent":["import { stringify } from '../utils/stringify.js';\nimport { BaseError } from './base.js';\nimport { getUrl } from './utils.js';\nexport class OffchainLookupError extends BaseError {\n constructor({ callbackSelector, cause, data, extraData, sender, urls, }) {\n super(cause.shortMessage ||\n 'An error occurred while fetching for an offchain result.', {\n cause,\n metaMessages: [\n ...(cause.metaMessages || []),\n cause.metaMessages?.length ? '' : [],\n 'Offchain Gateway Call:',\n urls && [\n ' Gateway URL(s):',\n ...urls.map((url) => ` ${getUrl(url)}`),\n ],\n ` Sender: ${sender}`,\n ` Data: ${data}`,\n ` Callback selector: ${callbackSelector}`,\n ` Extra data: ${extraData}`,\n ].flat(),\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupError'\n });\n }\n}\nexport class OffchainLookupResponseMalformedError extends BaseError {\n constructor({ result, url }) {\n super('Offchain gateway response is malformed. Response data must be a hex value.', {\n metaMessages: [\n `Gateway URL: ${getUrl(url)}`,\n `Response: ${stringify(result)}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupResponseMalformedError'\n });\n }\n}\nexport class OffchainLookupSenderMismatchError extends BaseError {\n constructor({ sender, to }) {\n super('Reverted sender address does not match target contract address (`to`).', {\n metaMessages: [\n `Contract address: ${to}`,\n `OffchainLookup sender address: ${sender}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupSenderMismatchError'\n });\n }\n}\n//# sourceMappingURL=ccip.js.map","import { call } from '../actions/public/call.js';\nimport { OffchainLookupError, OffchainLookupResponseMalformedError, OffchainLookupSenderMismatchError, } from '../errors/ccip.js';\nimport { HttpRequestError, } from '../errors/request.js';\nimport { decodeErrorResult } from './abi/decodeErrorResult.js';\nimport { encodeAbiParameters } from './abi/encodeAbiParameters.js';\nimport { isAddressEqual } from './address/isAddressEqual.js';\nimport { concat } from './data/concat.js';\nimport { isHex } from './data/isHex.js';\nimport { stringify } from './stringify.js';\nexport const offchainLookupSignature = '0x556f1830';\nexport const offchainLookupAbiItem = {\n name: 'OffchainLookup',\n type: 'error',\n inputs: [\n {\n name: 'sender',\n type: 'address',\n },\n {\n name: 'urls',\n type: 'string[]',\n },\n {\n name: 'callData',\n type: 'bytes',\n },\n {\n name: 'callbackFunction',\n type: 'bytes4',\n },\n {\n name: 'extraData',\n type: 'bytes',\n },\n ],\n};\nexport async function offchainLookup(client, { blockNumber, blockTag, data, to, }) {\n const { args } = decodeErrorResult({\n data,\n abi: [offchainLookupAbiItem],\n });\n const [sender, urls, callData, callbackSelector, extraData] = args;\n const { ccipRead } = client;\n const ccipRequest_ = ccipRead && typeof ccipRead?.request === 'function'\n ? ccipRead.request\n : ccipRequest;\n try {\n if (!isAddressEqual(to, sender))\n throw new OffchainLookupSenderMismatchError({ sender, to });\n const result = await ccipRequest_({ data: callData, sender, urls });\n const { data: data_ } = await call(client, {\n blockNumber,\n blockTag,\n data: concat([\n callbackSelector,\n encodeAbiParameters([{ type: 'bytes' }, { type: 'bytes' }], [result, extraData]),\n ]),\n to,\n });\n return data_;\n }\n catch (err) {\n throw new OffchainLookupError({\n callbackSelector,\n cause: err,\n data,\n extraData,\n sender,\n urls,\n });\n }\n}\nexport async function ccipRequest({ data, sender, urls, }) {\n let error = new Error('An unknown error occurred.');\n for (let i = 0; i < urls.length; i++) {\n const url = urls[i];\n const method = url.includes('{data}') ? 'GET' : 'POST';\n const body = method === 'POST' ? { data, sender } : undefined;\n try {\n const response = await fetch(url.replace('{sender}', sender).replace('{data}', data), {\n body: JSON.stringify(body),\n method,\n });\n let result;\n if (response.headers.get('Content-Type')?.startsWith('application/json')) {\n result = (await response.json()).data;\n }\n else {\n result = (await response.text());\n }\n if (!response.ok) {\n error = new HttpRequestError({\n body,\n details: result?.error\n ? stringify(result.error)\n : response.statusText,\n headers: response.headers,\n status: response.status,\n url,\n });\n continue;\n }\n if (!isHex(result)) {\n error = new OffchainLookupResponseMalformedError({\n result,\n url,\n });\n continue;\n }\n return result;\n }\n catch (err) {\n error = new HttpRequestError({\n body,\n details: err.message,\n url,\n });\n }\n }\n throw error;\n}\n//# sourceMappingURL=ccip.js.map"],"names":["OffchainLookupError","BaseError","callbackSelector","cause","data","extraData","sender","urls","_a","url","getUrl","OffchainLookupResponseMalformedError","result","stringify","OffchainLookupSenderMismatchError","to","offchainLookupSignature","offchainLookupAbiItem","offchainLookup","client","blockNumber","blockTag","args","decodeErrorResult","callData","ccipRead","ccipRequest_","ccipRequest","isAddressEqual","data_","call","concat","encodeAbiParameters","err","error","i","method","body","response","HttpRequestError","isHex"],"mappings":"sKAGO,MAAMA,UAA4BC,EAAAA,SAAU,CAC/C,YAAY,CAAE,iBAAAC,EAAkB,MAAAC,EAAO,KAAAC,EAAM,UAAAC,EAAW,OAAAC,EAAQ,KAAAC,GAAS,OACrE,MAAMJ,EAAM,cACR,2DAA4D,CAC5D,MAAAA,EACA,aAAc,CACV,GAAIA,EAAM,cAAgB,IAC1BK,EAAAL,EAAM,eAAN,MAAAK,EAAoB,OAAS,GAAK,CAAE,EACpC,yBACAD,GAAQ,CACJ,oBACA,GAAGA,EAAK,IAAKE,GAAQ,OAAOC,EAAM,OAACD,CAAG,CAAC,EAAE,CAC5C,EACD,aAAaH,CAAM,GACnB,WAAWF,CAAI,GACf,wBAAwBF,CAAgB,GACxC,iBAAiBG,CAAS,EAC7B,EAAC,KAAM,CACpB,CAAS,EACD,OAAO,eAAe,KAAM,OAAQ,CAChC,WAAY,GACZ,aAAc,GACd,SAAU,GACV,MAAO,qBACnB,CAAS,CACJ,CACL,CACO,MAAMM,UAA6CV,EAAAA,SAAU,CAChE,YAAY,CAAE,OAAAW,EAAQ,IAAAH,GAAO,CACzB,MAAM,6EAA8E,CAChF,aAAc,CACV,gBAAgBC,EAAAA,OAAOD,CAAG,CAAC,GAC3B,aAAaI,EAAAA,UAAUD,CAAM,CAAC,EACjC,CACb,CAAS,EACD,OAAO,eAAe,KAAM,OAAQ,CAChC,WAAY,GACZ,aAAc,GACd,SAAU,GACV,MAAO,sCACnB,CAAS,CACJ,CACL,CACO,MAAME,UAA0Cb,EAAAA,SAAU,CAC7D,YAAY,CAAE,OAAAK,EAAQ,GAAAS,GAAM,CACxB,MAAM,yEAA0E,CAC5E,aAAc,CACV,qBAAqBA,CAAE,GACvB,kCAAkCT,CAAM,EAC3C,CACb,CAAS,EACD,OAAO,eAAe,KAAM,OAAQ,CAChC,WAAY,GACZ,aAAc,GACd,SAAU,GACV,MAAO,mCACnB,CAAS,CACJ,CACL,CCpDY,MAACU,EAA0B,aAC1BC,EAAwB,CACjC,KAAM,iBACN,KAAM,QACN,OAAQ,CACJ,CACI,KAAM,SACN,KAAM,SACT,EACD,CACI,KAAM,OACN,KAAM,UACT,EACD,CACI,KAAM,WACN,KAAM,OACT,EACD,CACI,KAAM,mBACN,KAAM,QACT,EACD,CACI,KAAM,YACN,KAAM,OACT,CACJ,CACL,EACO,eAAeC,EAAeC,EAAQ,CAAE,YAAAC,EAAa,SAAAC,EAAU,KAAAjB,EAAM,GAAAW,GAAO,CAC/E,KAAM,CAAE,KAAAO,CAAM,EAAGC,oBAAkB,CAC/B,KAAAnB,EACA,IAAK,CAACa,CAAqB,CACnC,CAAK,EACK,CAACX,EAAQC,EAAMiB,EAAUtB,EAAkBG,CAAS,EAAIiB,EACxD,CAAE,SAAAG,CAAU,EAAGN,EACfO,EAAeD,GAAY,OAAOA,GAAA,YAAAA,EAAU,UAAY,WACxDA,EAAS,QACTE,EACN,GAAI,CACA,GAAI,CAACC,EAAAA,eAAeb,EAAIT,CAAM,EAC1B,MAAM,IAAIQ,EAAkC,CAAE,OAAAR,EAAQ,GAAAS,CAAI,CAAA,EAC9D,MAAMH,EAAS,MAAMc,EAAa,CAAE,KAAMF,EAAU,OAAAlB,EAAQ,KAAAC,CAAI,CAAE,EAC5D,CAAE,KAAMsB,CAAO,EAAG,MAAMC,EAAAA,KAAKX,EAAQ,CACvC,YAAAC,EACA,SAAAC,EACA,KAAMU,EAAAA,OAAO,CACT7B,EACA8B,EAAAA,oBAAoB,CAAC,CAAE,KAAM,SAAW,CAAE,KAAM,QAAS,EAAG,CAACpB,EAAQP,CAAS,CAAC,CAC/F,CAAa,EACD,GAAAU,CACZ,CAAS,EACD,OAAOc,CACV,OACMI,EAAK,CACR,MAAM,IAAIjC,EAAoB,CAC1B,iBAAAE,EACA,MAAO+B,EACP,KAAA7B,EACA,UAAAC,EACA,OAAAC,EACA,KAAAC,CACZ,CAAS,CACJ,CACL,CACO,eAAeoB,EAAY,CAAE,KAAAvB,EAAM,OAAAE,EAAQ,KAAAC,CAAI,EAAK,OACvD,IAAI2B,EAAQ,IAAI,MAAM,4BAA4B,EAClD,QAASC,EAAI,EAAGA,EAAI5B,EAAK,OAAQ4B,IAAK,CAClC,MAAM1B,EAAMF,EAAK4B,CAAC,EACZC,EAAS3B,EAAI,SAAS,QAAQ,EAAI,MAAQ,OAC1C4B,EAAOD,IAAW,OAAS,CAAE,KAAAhC,EAAM,OAAAE,CAAQ,EAAG,OACpD,GAAI,CACA,MAAMgC,EAAW,MAAM,MAAM7B,EAAI,QAAQ,WAAYH,CAAM,EAAE,QAAQ,SAAUF,CAAI,EAAG,CAClF,KAAM,KAAK,UAAUiC,CAAI,EACzB,OAAAD,CAChB,CAAa,EACD,IAAIxB,EAOJ,IANIJ,EAAA8B,EAAS,QAAQ,IAAI,cAAc,IAAnC,MAAA9B,EAAsC,WAAW,oBACjDI,GAAU,MAAM0B,EAAS,KAAI,GAAI,KAGjC1B,EAAU,MAAM0B,EAAS,KAAI,EAE7B,CAACA,EAAS,GAAI,CACdJ,EAAQ,IAAIK,EAAAA,iBAAiB,CACzB,KAAAF,EACA,QAASzB,GAAA,MAAAA,EAAQ,MACXC,EAAS,UAACD,EAAO,KAAK,EACtB0B,EAAS,WACf,QAASA,EAAS,QAClB,OAAQA,EAAS,OACjB,IAAA7B,CACpB,CAAiB,EACD,QACH,CACD,GAAI,CAAC+B,EAAAA,MAAM5B,CAAM,EAAG,CAChBsB,EAAQ,IAAIvB,EAAqC,CAC7C,OAAAC,EACA,IAAAH,CACpB,CAAiB,EACD,QACH,CACD,OAAOG,CACV,OACMqB,EAAK,CACRC,EAAQ,IAAIK,EAAAA,iBAAiB,CACzB,KAAAF,EACA,QAASJ,EAAI,QACb,IAAAxB,CAChB,CAAa,CACJ,CACJ,CACD,MAAMyB,CACV","x_google_ignoreList":[0,1]}
@@ -1,9 +0,0 @@
1
- "use strict";function z(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function x(e){return z(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const Tt="2.18.8",It=e=>e,$t=e=>e,Ct=()=>`viem@${Tt}`;class c extends Error{constructor(t,n={}){var a;const r=n.cause instanceof c?n.cause.details:(a=n.cause)!=null&&a.message?n.cause.message:n.details,s=n.cause instanceof c&&n.cause.docsPath||n.docsPath,i=Ct(),o=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${n.docsBaseUrl??"https://viem.sh"}${s}${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${i}`].join(`
2
- `);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t,this.version=i}walk(t){return Fe(this,t)}}function Fe(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e?Fe(e.cause,t):t?null:e}class ze extends c{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}}class Le extends c{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}class Ut extends c{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesLengthError"})}}function L(e,{dir:t,size:n=32}={}){return typeof e=="string"?He(e,{dir:t,size:n}):At(e,{dir:t,size:n})}function He(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new Le({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function At(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new Le({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let s=0;s<n;s++){const i=t==="right";r[i?s:n-s-1]=e[i?s:e.length-s-1]}return r}class Ot extends c{constructor({max:t,min:n,signed:r,size:s,value:i}){super(`Number "${i}" is not in safe ${s?`${s*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class Ft extends c{constructor(t){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",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesBooleanError"})}}class zt extends c{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}function j(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let s=0;s<n.length-1&&n[t==="left"?s:n.length-s-1].toString()==="0";s++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function U(e,{size:t}){if(x(e)>t)throw new zt({givenSize:x(e),maxSize:t})}function C(e,t={}){const{signed:n}=t;t.size&&U(e,{size:t.size});const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2,i=(1n<<BigInt(s)*8n-1n)-1n;return r<=i?r:r-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function N(e,t={}){return Number(C(e,t))}const Lt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function d(e,t={}){return typeof e=="number"||typeof e=="bigint"?te(e,t):typeof e=="string"?Ge(e,t):typeof e=="boolean"?Se(e,t):y(e,t)}function Se(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(U(n,{size:t.size}),L(n,{size:t.size})):n}function y(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=Lt[e[s]];const r=`0x${n}`;return typeof t.size=="number"?(U(r,{size:t.size}),L(r,{dir:"right",size:t.size})):r}function te(e,t={}){const{signed:n,size:r}=t,s=BigInt(e);let i;r?n?i=(1n<<BigInt(r)*8n-1n)-1n:i=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof i=="bigint"&&n?-i-1n:0;if(i&&s>i||s<o){const u=typeof e=="bigint"?"n":"";throw new Ot({max:i?`${i}${u}`:void 0,min:`${o}${u}`,signed:n,size:r,value:`${e}${u}`})}const a=`0x${(n&&s<0?(1n<<BigInt(r*8))+BigInt(s):s).toString(16)}`;return r?L(a,{size:r}):a}const Ht=new TextEncoder;function Ge(e,t={}){const n=Ht.encode(e);return y(n,t)}const St=new TextEncoder;function ne(e,t={}){return typeof e=="number"||typeof e=="bigint"?kt(e,t):typeof e=="boolean"?Gt(e,t):z(e)?B(e,t):re(e,t)}function Gt(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(U(n,{size:t.size}),L(n,{size:t.size})):n}const g={zero:48,nine:57,A:65,F:70,a:97,f:102};function ve(e){if(e>=g.zero&&e<=g.nine)return e-g.zero;if(e>=g.A&&e<=g.F)return e-(g.A-10);if(e>=g.a&&e<=g.f)return e-(g.a-10)}function B(e,t={}){let n=e;t.size&&(U(n,{size:t.size}),n=L(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,i=new Uint8Array(s);for(let o=0,a=0;o<s;o++){const u=ve(r.charCodeAt(a++)),l=ve(r.charCodeAt(a++));if(u===void 0||l===void 0)throw new c(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);i[o]=u*16+l}return i}function kt(e,t){const n=te(e,t);return B(n)}function re(e,t={}){const n=St.encode(e);return typeof t.size=="number"?(U(n,{size:t.size}),L(n,{dir:"right",size:t.size})):n}function W(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function jt(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function V(e,...t){if(!jt(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function Nt(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");W(e.outputLen),W(e.blockLen)}function M(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function ke(e,t){V(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const D=BigInt(2**32-1),Ee=BigInt(32);function Mt(e,t=!1){return t?{h:Number(e&D),l:Number(e>>Ee&D)}:{h:Number(e>>Ee&D)|0,l:Number(e&D)|0}}function Vt(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:i,l:o}=Mt(e[s],t);[n[s],r[s]]=[i,o]}return[n,r]}const _t=(e,t,n)=>e<<n|t>>>32-n,Rt=(e,t,n)=>t<<n|e>>>32-n,Dt=(e,t,n)=>t<<n-32|e>>>64-n,Kt=(e,t,n)=>e<<n-32|t>>>64-n,J=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Wt=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Q=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),m=(e,t)=>e<<32-t|e>>>t,Be=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Xt=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function Te(e){for(let t=0;t<e.length;t++)e[t]=Xt(e[t])}function qt(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function X(e){return typeof e=="string"&&(e=qt(e)),V(e),e}function Yt(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];V(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const i=e[r];n.set(i,s),s+=i.length}return n}class se{clone(){return this._cloneInto()}}function je(e){const t=r=>e().update(X(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Jt(e=32){if(J&&typeof J.getRandomValues=="function")return J.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const Ne=[],Me=[],Ve=[],Qt=BigInt(0),k=BigInt(1),Zt=BigInt(2),en=BigInt(7),tn=BigInt(256),nn=BigInt(113);for(let e=0,t=k,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Ne.push(2*(5*r+n)),Me.push((e+1)*(e+2)/2%64);let s=Qt;for(let i=0;i<7;i++)t=(t<<k^(t>>en)*nn)%tn,t&Zt&&(s^=k<<(k<<BigInt(i))-k);Ve.push(s)}const[rn,sn]=Vt(Ve,!0),Ie=(e,t,n)=>n>32?Dt(e,t,n):_t(e,t,n),$e=(e,t,n)=>n>32?Kt(e,t,n):Rt(e,t,n);function on(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,u=(o+2)%10,l=n[u],h=n[u+1],f=Ie(l,h,1)^n[a],p=$e(l,h,1)^n[a+1];for(let b=0;b<50;b+=10)e[o+b]^=f,e[o+b+1]^=p}let s=e[2],i=e[3];for(let o=0;o<24;o++){const a=Me[o],u=Ie(s,i,a),l=$e(s,i,a),h=Ne[o];s=e[h],i=e[h+1],e[h]=u,e[h+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=e[o+a];for(let a=0;a<10;a++)e[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=rn[r],e[1]^=sn[r]}n.fill(0)}class ie extends se{constructor(t,n,r,s=!1,i=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,W(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Wt(this.state)}keccak(){Be||Te(this.state32),on(this.state32,this.rounds),Be||Te(this.state32),this.posOut=0,this.pos=0}update(t){M(this);const{blockLen:n,state:r}=this;t=X(t);const s=t.length;for(let i=0;i<s;){const o=Math.min(n-this.pos,s-i);for(let a=0;a<o;a++)r[this.pos++]^=t[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){M(this,!1),V(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,i=t.length;s<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-s);t.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return W(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(ke(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:i,enableXOF:o}=this;return t||(t=new ie(n,r,s,o,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=s,t.enableXOF=o,t.destroyed=this.destroyed,t}}const an=(e,t,n)=>je(()=>new ie(t,e,n)),un=an(1,136,256/8);function _e(e,t){const n=t||"hex",r=un(z(e,{strict:!1})?ne(e):e);return n==="bytes"?r:d(r)}class T extends c{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}class oe extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}set(t,n){return super.set(t,n),this.maxSize&&this.size>this.maxSize&&this.delete(this.keys().next().value),this}}const Z=new oe(8192);function ae(e,t){if(Z.has(`${e}.${t}`))return Z.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=_e(re(n),"bytes"),s=n.split("");for(let o=0;o<40;o+=2)r[o>>1]>>4>=8&&s[o]&&(s[o]=s[o].toUpperCase()),(r[o>>1]&15)>=8&&s[o+1]&&(s[o+1]=s[o+1].toUpperCase());const i=`0x${s.join("")}`;return Z.set(`${e}.${t}`,i),i}function cn(e,t){if(!I(e,{strict:!1}))throw new T({address:e});return ae(e,t)}const ln=/^0x[a-fA-F0-9]{40}$/,ee=new oe(8192);function I(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(ee.has(r))return ee.get(r);const s=ln.test(e)?e.toLowerCase()===e?!0:n?ae(e)===e:!0:!1;return ee.set(r,s),s}function fn(e){return typeof e[0]=="string"?H(e):dn(e)}function dn(e){let t=0;for(const s of e)t+=s.length;const n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function H(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function Re(e,t,n,{strict:r}={}){return z(e,{strict:!1})?Xe(e,t,n,{strict:r}):We(e,t,n,{strict:r})}function De(e,t){if(typeof t=="number"&&t>0&&t>x(e)-1)throw new ze({offset:t,position:"start",size:x(e)})}function Ke(e,t,n){if(typeof t=="number"&&typeof n=="number"&&x(e)!==n-t)throw new ze({offset:n,position:"end",size:x(e)})}function We(e,t,n,{strict:r}={}){De(e,t);const s=e.slice(t,n);return r&&Ke(s,t,n),s}function Xe(e,t,n,{strict:r}={}){De(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&Ke(s,t,n),s}class Ce extends c{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class qe extends c{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}}class hn extends c{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}}const bn={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new hn({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new qe({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Ce({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Ce({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function ue(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(bn);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}const pn={gwei:9,wei:18},mn={ether:-9,wei:9};function Ye(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,i]=[n.slice(0,n.length-t),n.slice(n.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${s||"0"}${i?`.${i}`:""}`}function Je(e,t="wei"){return Ye(e,pn[t])}function E(e,t="wei"){return Ye(e,mn[t])}function ce(e){const t=Object.entries(e).map(([r,s])=>s===void 0||s===!1?null:[r,s]).filter(Boolean),n=t.reduce((r,[s])=>Math.max(r,s.length),0);return t.map(([r,s])=>` ${`${r}:`.padEnd(n+1)} ${s}`).join(`
3
- `)}class gn extends c{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
4
- `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class xn extends c{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidLegacyVError"})}}class yn extends c{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",ce(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class wn extends c{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStorageKeySizeError"})}}class Pn extends c{constructor(t,{account:n,docsPath:r,chain:s,data:i,gas:o,gasPrice:a,maxFeePerGas:u,maxPriorityFeePerGas:l,nonce:h,to:f,value:p}){var w;const b=ce({chain:s&&`${s==null?void 0:s.name} (id: ${s==null?void 0:s.id})`,from:n==null?void 0:n.address,to:f,value:typeof p<"u"&&`${Je(p)} ${((w=s==null?void 0:s.nativeCurrency)==null?void 0:w.symbol)||"ETH"}`,data:i,gas:o,gasPrice:typeof a<"u"&&`${E(a)} gwei`,maxFeePerGas:typeof u<"u"&&`${E(u)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${E(l)} gwei`,nonce:h});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",b].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionExecutionError"}),this.cause=t}}class vn extends c{constructor({blockHash:t,blockNumber:n,blockTag:r,hash:s,index:i}){let o="Transaction";r&&i!==void 0&&(o=`Transaction at block time "${r}" 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}"`),s&&(o=`Transaction with hash "${s}"`),super(`${o} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class En extends c{constructor({hash:t}){super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}}class Bn extends c{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}class le extends c{constructor({cause:t,message:n}={}){var s;const r=(s=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:s.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(le,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(le,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class _ extends c{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${E(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(_,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class Qe extends c{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${E(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(Qe,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class Ze extends c{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(Ze,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class et extends c{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
5
- `),{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(et,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class tt extends c{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(tt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class nt extends c{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
6
- `),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(nt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class rt extends c{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty(rt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class st extends c{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(st,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class it extends c{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(it,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class fe extends c{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${E(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${E(r)} gwei`:""}).`].join(`
7
- `),{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(fe,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class Tn extends c{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}function de(e,t){return({exclude:n,format:r})=>({exclude:n,format:s=>{const i=t(s);if(n)for(const o of n)delete i[o];return{...i,...r(s)}},type:e})}const ot={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function q(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?N(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?N(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?ot[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof t.v=="bigint"){if(t.v===0n||t.v===27n)return 0;if(t.v===1n||t.v===28n)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),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}const In=de("transaction",q);function at(e){var n;const t=(n=e.transactions)==null?void 0:n.map(r=>typeof r=="string"?r:q(r));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const $n=de("block",at);function he(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(i=>B(i)):e.blobs,s=[];for(const i of r)s.push(Uint8Array.from(t.blobToKzgCommitment(i)));return n==="bytes"?s:s.map(i=>y(i))}function be(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(o=>B(o)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(o=>B(o)):e.commitments,i=[];for(let o=0;o<r.length;o++){const a=r[o],u=s[o];i.push(Uint8Array.from(t.computeBlobKzgProof(a,u)))}return n==="bytes"?i:i.map(o=>y(o))}function Cn(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),i=BigInt(4294967295),o=Number(n>>s&i),a=Number(n&i),u=r?4:0,l=r?0:4;e.setUint32(t+u,o,r),e.setUint32(t+l,a,r)}const Un=(e,t,n)=>e&t^~e&n,An=(e,t,n)=>e&t^e&n^t&n;class On extends se{constructor(t,n,r,s){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Q(this.buffer)}update(t){M(this);const{view:n,buffer:r,blockLen:s}=this;t=X(t);const i=t.length;for(let o=0;o<i;){const a=Math.min(s-this.pos,i-o);if(a===s){const u=Q(t);for(;s<=i-o;o+=s)this.process(u,o);continue}r.set(t.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){M(this),ke(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:i}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let f=o;f<s;f++)n[f]=0;Cn(r,s-8,BigInt(this.length*8),i),this.process(r,0);const a=Q(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=u/4,h=this.get();if(l>h.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<l;f++)a.setUint32(4*f,h[f],i)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:i,destroyed:o,pos:a}=this;return t.length=s,t.pos=a,t.finished=i,t.destroyed=o,s%n&&t.buffer.set(r),t}}const Fn=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),P=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),v=new Uint32Array(64);class zn extends On{constructor(){super(64,32,8,!1),this.A=P[0]|0,this.B=P[1]|0,this.C=P[2]|0,this.D=P[3]|0,this.E=P[4]|0,this.F=P[5]|0,this.G=P[6]|0,this.H=P[7]|0}get(){const{A:t,B:n,C:r,D:s,E:i,F:o,G:a,H:u}=this;return[t,n,r,s,i,o,a,u]}set(t,n,r,s,i,o,a,u){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=u|0}process(t,n){for(let f=0;f<16;f++,n+=4)v[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const p=v[f-15],b=v[f-2],w=m(p,7)^m(p,18)^p>>>3,A=m(b,17)^m(b,19)^b>>>10;v[f]=A+v[f-7]+w+v[f-16]|0}let{A:r,B:s,C:i,D:o,E:a,F:u,G:l,H:h}=this;for(let f=0;f<64;f++){const p=m(a,6)^m(a,11)^m(a,25),b=h+p+Un(a,u,l)+Fn[f]+v[f]|0,A=(m(r,2)^m(r,13)^m(r,22))+An(r,s,i)|0;h=l,l=u,u=a,a=o+b|0,o=i,i=s,s=r,r=b+A|0}r=r+this.A|0,s=s+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(r,s,i,o,a,u,l,h)}roundClean(){v.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const ut=je(()=>new zn);function Ln(e,t){return ut(z(e,{strict:!1})?ne(e):e)}function Hn(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),s=Ln(t);return s.set([n],0),r==="bytes"?s:y(s)}function ct(e){const{commitments:t,version:n}=e,r=e.to??(typeof t[0]=="string"?"hex":"bytes"),s=[];for(const i of t)s.push(Hn({commitment:i,to:r,version:n}));return s}const Ue=6,lt=32,pe=4096,ft=lt*pe,Ae=ft*Ue-1-1*pe*Ue,dt=1;class Sn extends c{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlobSizeTooLargeError"})}}class ht extends c{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}}class Gn extends c{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashSizeError"})}}class kn extends c{constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${dt}`,`Received: ${n}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}}function jn(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?B(e.data):e.data,r=x(n);if(!r)throw new ht;if(r>Ae)throw new Sn({maxSize:Ae,size:r});const s=[];let i=!0,o=0;for(;i;){const a=ue(new Uint8Array(ft));let u=0;for(;u<pe;){const l=n.slice(o,o+(lt-1));if(a.pushByte(0),a.pushBytes(l),l.length<31){a.pushByte(128),i=!1;break}u++,o+=31}s.push(a)}return t==="bytes"?s.map(a=>a.bytes):s.map(a=>y(a.bytes))}function bt(e){const{data:t,kzg:n,to:r}=e,s=e.blobs??jn({data:t,to:r}),i=e.commitments??he({blobs:s,kzg:n,to:r}),o=e.proofs??be({blobs:s,commitments:i,kzg:n,to:r}),a=[];for(let u=0;u<s.length;u++)a.push({blob:s[u],commitment:i[u],proof:o[u]});return a}function pt(e){if(e.type)return e.type;if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new yn({transaction:e})}function mt(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}class Nn extends c{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class Mn extends c{constructor({chain:t,currentChainId:n}){super(`The current chain of the wallet (id: ${n}) does not match the target chain for the transaction (id: ${t.id} – ${t.name}).`,{metaMessages:[`Current Chain ID: ${n}`,`Expected Chain ID: ${t.id} – ${t.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class Vn extends c{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
8
- `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class _n extends c{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}class me extends c{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidChainIdError"})}}function Y(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}function F(e,t="hex"){const n=gt(e),r=ue(new Uint8Array(n.length));return n.encode(r),t==="hex"?y(r.bytes):r.bytes}function gt(e){return Array.isArray(e)?Rn(e.map(t=>gt(t))):Dn(e)}function Rn(e){const t=e.reduce((s,i)=>s+i.length,0),n=xt(t);return{length:t<=55?1+t:1+n+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:i}of e)i(s)}}}function Dn(e){const t=typeof e=="string"?B(e):e,n=xt(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function xt(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new c("Length is too large.")}const Kn={"0x0":"reverted","0x1":"success"};function yt(e){const t={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(n=>mt(n)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?N(e.transactionIndex):null,status:e.status?Kn[e.status]:null,type:e.type?ot[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const Wn=de("transactionReceipt",yt);function Xn(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new ht;for(const n of t){const r=x(n),s=N(Re(n,0,1));if(r!==32)throw new Gn({hash:n,size:r});if(s!==dt)throw new kn({hash:n,version:s})}}wt(e)}function wt(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:s}=e;if(t<=0)throw new me({chainId:t});if(s&&!I(s))throw new T({address:s});if(r&&r>2n**256n-1n)throw new _({maxFeePerGas:r});if(n&&r&&n>r)throw new fe({maxFeePerGas:r,maxPriorityFeePerGas:n})}function qn(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:i}=e;if(t<=0)throw new me({chainId:t});if(i&&!I(i))throw new T({address:i});if(n||s)throw new c("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>2n**256n-1n)throw new _({maxFeePerGas:r})}function Yn(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:i,accessList:o}=e;if(i&&!I(i))throw new T({address:i});if(typeof t<"u"&&t<=0)throw new me({chainId:t});if(n||s)throw new c("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>2n**256n-1n)throw new _({maxFeePerGas:r});if(o)throw new c("`accessList` is not a valid Legacy Transaction attribute.")}function ge(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n<e.length;n++){const{address:r,storageKeys:s}=e[n];for(let i=0;i<s.length;i++)if(s[i].length-2!==64)throw new wn({storageKey:s[i]});if(!I(r,{strict:!1}))throw new T({address:r});t.push([r,s])}return t}function Jn(e,t){const n=pt(e);return n==="eip1559"?Zn(e,t):n==="eip2930"?er(e,t):n==="eip4844"?Qn(e,t):tr(e,t)}function Qn(e,t){const{chainId:n,gas:r,nonce:s,to:i,value:o,maxFeePerBlobGas:a,maxFeePerGas:u,maxPriorityFeePerGas:l,accessList:h,data:f}=e;Xn(e);let p=e.blobVersionedHashes,b=e.sidecars;if(e.blobs&&(typeof p>"u"||typeof b>"u")){const $=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(G=>y(G)),R=e.kzg,S=he({blobs:$,kzg:R});if(typeof p>"u"&&(p=ct({commitments:S})),typeof b>"u"){const G=be({blobs:$,commitments:S,kzg:R});b=bt({blobs:$,commitments:S,proofs:G})}}const w=ge(h),A=[d(n),s?d(s):"0x",l?d(l):"0x",u?d(u):"0x",r?d(r):"0x",i??"0x",o?d(o):"0x",f??"0x",w,a?d(a):"0x",p??[],...xe(e,t)],ye=[],we=[],Pe=[];if(b)for(let $=0;$<b.length;$++){const{blob:R,commitment:S,proof:G}=b[$];ye.push(R),we.push(S),Pe.push(G)}return H(["0x03",F(b?[A,ye,we,Pe]:A)])}function Zn(e,t){const{chainId:n,gas:r,nonce:s,to:i,value:o,maxFeePerGas:a,maxPriorityFeePerGas:u,accessList:l,data:h}=e;wt(e);const f=ge(l),p=[d(n),s?d(s):"0x",u?d(u):"0x",a?d(a):"0x",r?d(r):"0x",i??"0x",o?d(o):"0x",h??"0x",f,...xe(e,t)];return H(["0x02",F(p)])}function er(e,t){const{chainId:n,gas:r,data:s,nonce:i,to:o,value:a,accessList:u,gasPrice:l}=e;qn(e);const h=ge(u),f=[d(n),i?d(i):"0x",l?d(l):"0x",r?d(r):"0x",o??"0x",a?d(a):"0x",s??"0x",h,...xe(e,t)];return H(["0x01",F(f)])}function tr(e,t){const{chainId:n=0,gas:r,data:s,nonce:i,to:o,value:a,gasPrice:u}=e;Yn(e);let l=[i?d(i):"0x",u?d(u):"0x",r?d(r):"0x",o??"0x",a?d(a):"0x",s??"0x"];if(t){const h=(()=>{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+t.v-27n);const b=27n+(t.v===27n?0n:1n);if(t.v!==b)throw new xn({v:t.v});return b})(),f=j(t.r),p=j(t.s);l=[...l,d(h),f==="0x00"?"0x":f,p==="0x00"?"0x":p]}else n>0&&(l=[...l,d(n),"0x","0x"]);return F(l)}function xe(e,t){const n=t??e,{v:r,yParity:s}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof r>"u"&&typeof s>"u")return[];const i=j(n.r),o=j(n.s);return[typeof s=="number"?s?d(1):"0x":r===0n?"0x":r===1n?d(1):r===27n?"0x":d(1),i==="0x00"?"0x":i,o==="0x00"?"0x":o]}const nr={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},rr={block:$n({format(e){var n;return{transactions:(n=e.transactions)==null?void 0:n.map(r=>{if(typeof r=="string")return r;const s=q(r);return s.typeHex==="0x7e"&&(s.isSystemTx=r.isSystemTx,s.mint=r.mint?C(r.mint):void 0,s.sourceHash=r.sourceHash,s.type="deposit"),s}),stateRoot:e.stateRoot}}}),transaction:In({format(e){const t={};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}}),transactionReceipt:Wn({format(e){return{l1GasPrice:e.l1GasPrice?C(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?C(e.l1GasUsed):null,l1Fee:e.l1Fee?C(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null}}})};function sr(e,t){return ar(e)?or(e):Jn(e,t)}const ir={transaction:sr};function or(e){ur(e);const{sourceHash:t,data:n,from:r,gas:s,isSystemTx:i,mint:o,to:a,value:u}=e,l=[t,r,a??"0x",o?d(o):"0x",u?d(u):"0x",s?d(s):"0x",i?"0x1":"0x",n??"0x"];return H(["0x7e",F(l)])}function ar(e){return e.type==="deposit"||typeof e.sourceHash<"u"}function ur(e){const{from:t,to:n}=e;if(t&&!I(t))throw new T({address:t});if(n&&!I(n))throw new T({address:n})}const Oe={contracts:nr,formatters:rr,serializers:ir},K=1,Pt=Y({...Oe,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...Oe.contracts,l2OutputOracle:{[K]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[K]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[K]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:K}),vt=Y({id:56,name:"BNB Smart Chain",nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://rpc.ankr.com/bsc"]}},blockExplorers:{default:{name:"BscScan",url:"https://bscscan.com",apiUrl:"https://api.bscscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15921452}}}),Et=Y({id:17e3,name:"Holesky",nativeCurrency:{name:"Holesky Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky-rpc.publicnode.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://holesky.etherscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:77},ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",blockCreated:801613},ensUniversalResolver:{address:"0xa6AC935D4971E3CD133b950aE053bECD16fE7f3b",blockCreated:973484}},testnet:!0}),Bt=Y({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}});var O=(e=>(e[e.Mainnet=Bt.id]="Mainnet",e[e.Holesky=Et.id]="Holesky",e[e.Base=Pt.id]="Base",e[e.Bsc=vt.id]="Bsc",e))(O||{});const cr={[O.Mainnet]:Bt,[O.Holesky]:Et,[O.Base]:Pt,[O.Bsc]:vt};exports.BaseError=c;exports.Chain=O;exports.ChainDoesNotSupportContract=Nn;exports.ChainMismatchError=Mn;exports.ChainNotFoundError=Vn;exports.ClientChainNotConfiguredError=_n;exports.ExecutionRevertedError=le;exports.FeeCapTooHighError=_;exports.FeeCapTooLowError=Qe;exports.FeeConflictError=gn;exports.Hash=se;exports.InsufficientFundsError=nt;exports.IntrinsicGasTooHighError=rt;exports.IntrinsicGasTooLowError=st;exports.InvalidAddressError=T;exports.InvalidBytesBooleanError=Ft;exports.InvalidBytesLengthError=Ut;exports.LruMap=oe;exports.NonceMaxValueError=tt;exports.NonceTooHighError=Ze;exports.NonceTooLowError=et;exports.PositionOutOfBoundsError=qe;exports.TipAboveFeeCapError=fe;exports.TransactionExecutionError=Pn;exports.TransactionNotFoundError=vn;exports.TransactionReceiptNotFoundError=En;exports.TransactionTypeNotSupportedError=it;exports.UnknownNodeError=Tn;exports.VIEM_CHAINS=cr;exports.WaitForTransactionReceiptTimeoutError=Bn;exports.assertSize=U;exports.blobsToCommitments=he;exports.blobsToProofs=be;exports.boolToHex=Se;exports.bytes=V;exports.bytesToHex=y;exports.checksumAddress=ae;exports.commitmentsToVersionedHashes=ct;exports.concat=fn;exports.concatBytes=Yt;exports.concatHex=H;exports.createCursor=ue;exports.exists=M;exports.formatBlock=at;exports.formatEther=Je;exports.formatGwei=E;exports.formatLog=mt;exports.formatTransaction=q;exports.formatTransactionReceipt=yt;exports.getAddress=cn;exports.getContractAddress=It;exports.getTransactionType=pt;exports.getUrl=$t;exports.hash=Nt;exports.hexToBigInt=C;exports.hexToBytes=B;exports.hexToNumber=N;exports.isAddress=I;exports.isHex=z;exports.keccak256=_e;exports.numberToHex=te;exports.padHex=He;exports.prettyPrint=ce;exports.randomBytes=Jt;exports.sha256=ut;exports.size=x;exports.slice=Re;exports.sliceBytes=We;exports.sliceHex=Xe;exports.stringToBytes=re;exports.stringToHex=Ge;exports.toBlobSidecars=bt;exports.toBytes=X;exports.toBytes$1=ne;exports.toHex=d;exports.trim=j;
9
- //# sourceMappingURL=constants-BvU-JhfL.cjs.map