@pufferfinance/puffer-sdk 1.28.5 → 1.29.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.
- package/dist/api/puffer-client-helpers.cjs +1 -1
- package/dist/api/puffer-client-helpers.cjs.map +1 -1
- package/dist/api/puffer-client-helpers.js +3 -3
- package/dist/api/puffer-client-helpers.js.map +1 -1
- package/dist/api/puffer-client.cjs +1 -1
- package/dist/api/puffer-client.js +2 -2
- package/dist/{ccip-LIGR3N1A.cjs → ccip-Dv8Z-tXr.cjs} +2 -2
- package/dist/{ccip-LIGR3N1A.cjs.map → ccip-Dv8Z-tXr.cjs.map} +1 -1
- package/dist/{ccip-78YM988s.js → ccip-dYaIZXTj.js} +4 -4
- package/dist/{ccip-78YM988s.js.map → ccip-dYaIZXTj.js.map} +1 -1
- package/dist/chains/constants.cjs +1 -1
- package/dist/chains/constants.js +1 -1
- package/dist/constants-4-ehn8UI.cjs +9 -0
- package/dist/constants-4-ehn8UI.cjs.map +1 -0
- package/dist/{constants-CuIEh_ZS.js → constants-BO_Dvglw.js} +163 -143
- package/dist/constants-BO_Dvglw.js.map +1 -0
- package/dist/contracts/abis/mainnet/CarrotVesting.cjs +1 -1
- package/dist/contracts/abis/mainnet/CarrotVesting.cjs.map +1 -1
- package/dist/contracts/abis/mainnet/CarrotVesting.d.ts +30 -0
- package/dist/contracts/abis/mainnet/CarrotVesting.js +21 -0
- package/dist/contracts/abis/mainnet/CarrotVesting.js.map +1 -1
- package/dist/contracts/addresses.cjs +1 -1
- package/dist/contracts/addresses.js +1 -1
- package/dist/contracts/handlers/carrot-staking-handler.cjs +1 -1
- package/dist/contracts/handlers/carrot-staking-handler.d.ts +18 -0
- package/dist/contracts/handlers/carrot-staking-handler.js +2 -2
- package/dist/contracts/handlers/carrot-vesting-handler.cjs +1 -1
- package/dist/contracts/handlers/carrot-vesting-handler.cjs.map +1 -1
- package/dist/contracts/handlers/carrot-vesting-handler.d.ts +39 -0
- package/dist/contracts/handlers/carrot-vesting-handler.js +32 -5
- package/dist/contracts/handlers/carrot-vesting-handler.js.map +1 -1
- package/dist/contracts/handlers/concrete-vault-handler.cjs +1 -1
- package/dist/contracts/handlers/concrete-vault-handler.d.ts +18 -0
- package/dist/contracts/handlers/concrete-vault-handler.js +2 -2
- package/dist/contracts/handlers/distributor-handler.cjs +1 -1
- package/dist/contracts/handlers/distributor-handler.d.ts +18 -0
- package/dist/contracts/handlers/distributor-handler.js +2 -2
- package/dist/contracts/handlers/erc20-permit-handler.cjs +1 -1
- package/dist/contracts/handlers/erc20-permit-handler.cjs.map +1 -1
- package/dist/contracts/handlers/erc20-permit-handler.d.ts +18 -0
- package/dist/contracts/handlers/erc20-permit-handler.js +3 -3
- package/dist/contracts/handlers/erc20-permit-handler.js.map +1 -1
- package/dist/contracts/handlers/gauge-registry-handler.cjs +1 -1
- package/dist/contracts/handlers/gauge-registry-handler.d.ts +18 -0
- package/dist/contracts/handlers/gauge-registry-handler.js +2 -2
- package/dist/contracts/handlers/guardian-module-handler.cjs +1 -1
- package/dist/contracts/handlers/guardian-module-handler.d.ts +18 -0
- package/dist/contracts/handlers/guardian-module-handler.js +2 -2
- package/dist/contracts/handlers/institutional-access-manager-handler.cjs +1 -1
- package/dist/contracts/handlers/institutional-access-manager-handler.d.ts +18 -0
- package/dist/contracts/handlers/institutional-access-manager-handler.js +3 -3
- package/dist/contracts/handlers/institutional-vault-handler.cjs +1 -1
- package/dist/contracts/handlers/institutional-vault-handler.d.ts +18 -0
- package/dist/contracts/handlers/institutional-vault-handler.js +2 -2
- package/dist/contracts/handlers/l1-reward-manager-handler.cjs +1 -1
- package/dist/contracts/handlers/l1-reward-manager-handler.d.ts +18 -0
- package/dist/contracts/handlers/l1-reward-manager-handler.js +2 -2
- package/dist/contracts/handlers/l2-reward-manager-handler.cjs +1 -1
- package/dist/contracts/handlers/l2-reward-manager-handler.d.ts +18 -0
- package/dist/contracts/handlers/l2-reward-manager-handler.js +2 -2
- package/dist/contracts/handlers/lagoon-vault-handler.cjs +1 -1
- package/dist/contracts/handlers/lagoon-vault-handler.d.ts +18 -0
- package/dist/contracts/handlers/lagoon-vault-handler.js +2 -2
- package/dist/contracts/handlers/mtw-carrot-handler.cjs +1 -1
- package/dist/contracts/handlers/mtw-carrot-handler.d.ts +18 -0
- package/dist/contracts/handlers/mtw-carrot-handler.js +2 -2
- package/dist/contracts/handlers/nucleus-accountant-handler.cjs +1 -1
- package/dist/contracts/handlers/nucleus-accountant-handler.d.ts +18 -0
- package/dist/contracts/handlers/nucleus-accountant-handler.js +1 -1
- package/dist/contracts/handlers/nucleus-atomic-queue-handler.cjs +1 -1
- package/dist/contracts/handlers/nucleus-atomic-queue-handler.d.ts +18 -0
- package/dist/contracts/handlers/nucleus-atomic-queue-handler.js +2 -2
- package/dist/contracts/handlers/nucleus-boring-vault-handler.cjs +1 -1
- package/dist/contracts/handlers/nucleus-boring-vault-handler.d.ts +18 -0
- package/dist/contracts/handlers/nucleus-boring-vault-handler.js +2 -2
- package/dist/contracts/handlers/nucleus-teller-handler.cjs +1 -1
- package/dist/contracts/handlers/nucleus-teller-handler.d.ts +18 -0
- package/dist/contracts/handlers/nucleus-teller-handler.js +2 -2
- package/dist/contracts/handlers/puf-locker-handler.cjs +1 -1
- package/dist/contracts/handlers/puf-locker-handler.d.ts +18 -0
- package/dist/contracts/handlers/puf-locker-handler.js +2 -2
- package/dist/contracts/handlers/puffer-depositor-handler.cjs +1 -1
- package/dist/contracts/handlers/puffer-depositor-handler.d.ts +18 -0
- package/dist/contracts/handlers/puffer-depositor-handler.js +2 -2
- package/dist/contracts/handlers/puffer-l2-depositor-handler.cjs +1 -1
- package/dist/contracts/handlers/puffer-l2-depositor-handler.d.ts +18 -0
- package/dist/contracts/handlers/puffer-l2-depositor-handler.js +2 -2
- package/dist/contracts/handlers/puffer-oracle-v2-handler.cjs +1 -1
- package/dist/contracts/handlers/puffer-oracle-v2-handler.d.ts +18 -0
- package/dist/contracts/handlers/puffer-oracle-v2-handler.js +2 -2
- package/dist/contracts/handlers/puffer-protocol-handler.cjs +1 -1
- package/dist/contracts/handlers/puffer-protocol-handler.d.ts +18 -0
- package/dist/contracts/handlers/puffer-protocol-handler.js +2 -2
- package/dist/contracts/handlers/puffer-vault-handler.cjs +1 -1
- package/dist/contracts/handlers/puffer-vault-handler.d.ts +18 -0
- package/dist/contracts/handlers/puffer-vault-handler.js +2 -2
- package/dist/contracts/handlers/puffer-withdrawal-manager-handler.cjs +1 -1
- package/dist/contracts/handlers/puffer-withdrawal-manager-handler.d.ts +18 -0
- package/dist/contracts/handlers/puffer-withdrawal-manager-handler.js +2 -2
- package/dist/contracts/handlers/validator-ticket-handler.cjs +1 -1
- package/dist/contracts/handlers/validator-ticket-handler.d.ts +18 -0
- package/dist/contracts/handlers/validator-ticket-handler.js +2 -2
- package/dist/contracts/handlers/vl-puffer-handler.cjs +1 -1
- package/dist/contracts/handlers/vl-puffer-handler.d.ts +18 -0
- package/dist/contracts/handlers/vl-puffer-handler.js +2 -2
- package/dist/contracts/tokens.cjs +1 -1
- package/dist/contracts/tokens.js +1 -1
- package/dist/contracts/vaults-addresses.cjs +1 -1
- package/dist/contracts/vaults-addresses.js +1 -1
- package/dist/{getContract-D4_SEfqa.cjs → getContract-C6a8L2Jd.cjs} +2 -2
- package/dist/{getContract-D4_SEfqa.cjs.map → getContract-C6a8L2Jd.cjs.map} +1 -1
- package/dist/{getContract-DQN7VDBo.js → getContract-DRjKmuyC.js} +2 -2
- package/dist/{getContract-DQN7VDBo.js.map → getContract-DRjKmuyC.js.map} +1 -1
- package/dist/http-CRYDzx7w.cjs +5 -0
- package/dist/http-CRYDzx7w.cjs.map +1 -0
- package/dist/{http-CajzXkt4.js → http-ZcKHvn9V.js} +1313 -1116
- package/dist/http-ZcKHvn9V.js.map +1 -0
- package/dist/{localBatchGatewayRequest-C7zYTS2c.cjs → localBatchGatewayRequest-BTy8p6qj.cjs} +2 -2
- package/dist/{localBatchGatewayRequest-C7zYTS2c.cjs.map → localBatchGatewayRequest-BTy8p6qj.cjs.map} +1 -1
- package/dist/{localBatchGatewayRequest-DtOvBmA9.js → localBatchGatewayRequest-Cb0QKL0s.js} +3 -3
- package/dist/{localBatchGatewayRequest-DtOvBmA9.js.map → localBatchGatewayRequest-Cb0QKL0s.js.map} +1 -1
- package/dist/main.cjs +1 -1
- package/dist/main.js +1 -1
- package/dist/{secp256k1-CMP_u7qb.cjs → secp256k1-CzsL7iVx.cjs} +2 -2
- package/dist/{secp256k1-CMP_u7qb.cjs.map → secp256k1-CzsL7iVx.cjs.map} +1 -1
- package/dist/{secp256k1-DCMgMsfV.js → secp256k1-Dx1prb1E.js} +2 -2
- package/dist/{secp256k1-DCMgMsfV.js.map → secp256k1-Dx1prb1E.js.map} +1 -1
- package/dist/utils/version.cjs +1 -1
- package/dist/utils/version.js +1 -1
- package/dist/{writeContract-DYAfDrRz.js → writeContract-BFxyLFA9.js} +881 -902
- package/dist/writeContract-BFxyLFA9.js.map +1 -0
- package/dist/{writeContract-BnmmOPwy.cjs → writeContract-HBsqM_Od.cjs} +22 -22
- package/dist/writeContract-HBsqM_Od.cjs.map +1 -0
- package/package.json +12 -12
- package/dist/constants-6kuRTsbU.cjs +0 -9
- package/dist/constants-6kuRTsbU.cjs.map +0 -1
- package/dist/constants-CuIEh_ZS.js.map +0 -1
- package/dist/http-CajzXkt4.js.map +0 -1
- package/dist/http-qhIDc8Dn.cjs +0 -5
- package/dist/http-qhIDc8Dn.cjs.map +0 -1
- package/dist/writeContract-BnmmOPwy.cjs.map +0 -1
- package/dist/writeContract-DYAfDrRz.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { B as y,
|
|
2
|
-
const
|
|
3
|
-
let
|
|
1
|
+
import { B as y, u as R, v as ie, a as We, n as v, c as Q, w as G, I as ee, p as Z, x as r0, y as a0, z as s0, d as de, i as ke, e as Ze, A as he, D as Ke, b as J, F as ge, G as o0, h as le, J as ln, K as i0, L as bn, M as c0, N as Je, O as K, P as pn, t as Nt, Q as u0, E as fe, R as Oe, S as zt, T as Gt, U as Dt, W as Lt, X as _t, Y as Ht, Z as qt, _ as Ut, $ as Ne, a0 as we, a1 as Vt, a2 as f0, a3 as d0, a4 as l0, a5 as b0, a6 as p0, a7 as y0, a8 as m0, a9 as h0, aa as g0, ab as be, ac as ze, ad as yn, ae as w0, af as v0, ag as x0, ah as P0 } from "./constants-BO_Dvglw.js";
|
|
2
|
+
const E0 = "1.1.0";
|
|
3
|
+
let B = class Ge extends Error {
|
|
4
4
|
constructor(t, n = {}) {
|
|
5
|
-
const r = n.cause instanceof
|
|
5
|
+
const r = n.cause instanceof Ge ? n.cause.details : n.cause?.message ? n.cause.message : n.details, a = n.cause instanceof Ge && n.cause.docsPath || n.docsPath, s = [
|
|
6
6
|
t || "An error occurred.",
|
|
7
7
|
"",
|
|
8
8
|
...n.metaMessages ? [...n.metaMessages, ""] : [],
|
|
9
9
|
...a ? [`Docs: https://abitype.dev${a}`] : [],
|
|
10
10
|
...r ? [`Details: ${r}`] : [],
|
|
11
|
-
`Version: abitype@${
|
|
11
|
+
`Version: abitype@${E0}`
|
|
12
12
|
].join(`
|
|
13
13
|
`);
|
|
14
14
|
super(s), Object.defineProperty(this, "details", {
|
|
@@ -39,21 +39,21 @@ let C = class De extends Error {
|
|
|
39
39
|
}), n.cause && (this.cause = n.cause), this.details = r, this.docsPath = a, this.metaMessages = n.metaMessages, this.shortMessage = t;
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
function
|
|
42
|
+
function _(e, t) {
|
|
43
43
|
return e.exec(t)?.groups;
|
|
44
44
|
}
|
|
45
|
-
const
|
|
46
|
-
function
|
|
45
|
+
const mn = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/, hn = /^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/, gn = /^\(.+?\).*?$/, Wt = /^tuple(?<array>(\[(\d*)\])*)$/;
|
|
46
|
+
function De(e) {
|
|
47
47
|
let t = e.type;
|
|
48
|
-
if (
|
|
48
|
+
if (Wt.test(e.type) && "components" in e) {
|
|
49
49
|
t = "(";
|
|
50
50
|
const n = e.components.length;
|
|
51
51
|
for (let a = 0; a < n; a++) {
|
|
52
52
|
const s = e.components[a];
|
|
53
|
-
t +=
|
|
53
|
+
t += De(s), a < n - 1 && (t += ", ");
|
|
54
54
|
}
|
|
55
|
-
const r =
|
|
56
|
-
return t += `)${r?.array ?? ""}`,
|
|
55
|
+
const r = _(Wt, e.type);
|
|
56
|
+
return t += `)${r?.array ?? ""}`, De({
|
|
57
57
|
...e,
|
|
58
58
|
type: t
|
|
59
59
|
});
|
|
@@ -65,70 +65,70 @@ function se(e) {
|
|
|
65
65
|
const n = e.length;
|
|
66
66
|
for (let r = 0; r < n; r++) {
|
|
67
67
|
const a = e[r];
|
|
68
|
-
t +=
|
|
68
|
+
t += De(a), r !== n - 1 && (t += ", ");
|
|
69
69
|
}
|
|
70
70
|
return t;
|
|
71
71
|
}
|
|
72
|
-
function E0(e) {
|
|
73
|
-
return e.type === "function" ? `function ${e.name}(${se(e.inputs)})${e.stateMutability && e.stateMutability !== "nonpayable" ? ` ${e.stateMutability}` : ""}${e.outputs?.length ? ` returns (${se(e.outputs)})` : ""}` : e.type === "event" ? `event ${e.name}(${se(e.inputs)})` : e.type === "error" ? `error ${e.name}(${se(e.inputs)})` : e.type === "constructor" ? `constructor(${se(e.inputs)})${e.stateMutability === "payable" ? " payable" : ""}` : e.type === "fallback" ? `fallback() external${e.stateMutability === "payable" ? " payable" : ""}` : "receive() external payable";
|
|
74
|
-
}
|
|
75
|
-
const gn = /^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
|
|
76
72
|
function $0(e) {
|
|
77
|
-
return
|
|
73
|
+
return e.type === "function" ? `function ${e.name}(${se(e.inputs)})${e.stateMutability && e.stateMutability !== "nonpayable" ? ` ${e.stateMutability}` : ""}${e.outputs?.length ? ` returns (${se(e.outputs)})` : ""}` : e.type === "event" ? `event ${e.name}(${se(e.inputs)})` : e.type === "error" ? `error ${e.name}(${se(e.inputs)})` : e.type === "constructor" ? `constructor(${se(e.inputs)})${e.stateMutability === "payable" ? " payable" : ""}` : e.type === "fallback" ? `fallback() external${e.stateMutability === "payable" ? " payable" : ""}` : "receive() external payable";
|
|
78
74
|
}
|
|
75
|
+
const wn = /^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
|
|
79
76
|
function A0(e) {
|
|
80
|
-
return V(gn, e);
|
|
81
|
-
}
|
|
82
|
-
const wn = /^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
|
|
83
|
-
function S0(e) {
|
|
84
77
|
return wn.test(e);
|
|
85
78
|
}
|
|
86
|
-
function
|
|
87
|
-
return
|
|
79
|
+
function S0(e) {
|
|
80
|
+
return _(wn, e);
|
|
88
81
|
}
|
|
89
|
-
const vn = /^
|
|
82
|
+
const vn = /^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
|
|
90
83
|
function M0(e) {
|
|
91
84
|
return vn.test(e);
|
|
92
85
|
}
|
|
93
|
-
function
|
|
94
|
-
return
|
|
86
|
+
function F0(e) {
|
|
87
|
+
return _(vn, e);
|
|
95
88
|
}
|
|
96
|
-
const xn = /^
|
|
97
|
-
function
|
|
89
|
+
const xn = /^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;
|
|
90
|
+
function I0(e) {
|
|
98
91
|
return xn.test(e);
|
|
99
92
|
}
|
|
100
93
|
function B0(e) {
|
|
101
|
-
return
|
|
94
|
+
return _(xn, e);
|
|
102
95
|
}
|
|
103
|
-
const
|
|
104
|
-
function
|
|
105
|
-
return
|
|
96
|
+
const Pn = /^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;
|
|
97
|
+
function En(e) {
|
|
98
|
+
return Pn.test(e);
|
|
106
99
|
}
|
|
107
|
-
function
|
|
108
|
-
return
|
|
100
|
+
function T0(e) {
|
|
101
|
+
return _(Pn, e);
|
|
109
102
|
}
|
|
110
|
-
const $n = /^
|
|
103
|
+
const $n = /^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;
|
|
111
104
|
function C0(e) {
|
|
112
105
|
return $n.test(e);
|
|
113
106
|
}
|
|
107
|
+
function j0(e) {
|
|
108
|
+
return _($n, e);
|
|
109
|
+
}
|
|
110
|
+
const An = /^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;
|
|
111
|
+
function R0(e) {
|
|
112
|
+
return An.test(e);
|
|
113
|
+
}
|
|
114
114
|
function k0(e) {
|
|
115
|
-
return
|
|
115
|
+
return _(An, e);
|
|
116
116
|
}
|
|
117
|
-
const
|
|
118
|
-
function
|
|
119
|
-
return
|
|
117
|
+
const O0 = /^receive\(\) external payable$/;
|
|
118
|
+
function N0(e) {
|
|
119
|
+
return O0.test(e);
|
|
120
120
|
}
|
|
121
121
|
const ws = /* @__PURE__ */ new Set([
|
|
122
122
|
"memory",
|
|
123
123
|
"indexed",
|
|
124
124
|
"storage",
|
|
125
125
|
"calldata"
|
|
126
|
-
]),
|
|
126
|
+
]), z0 = /* @__PURE__ */ new Set(["indexed"]), Le = /* @__PURE__ */ new Set([
|
|
127
127
|
"calldata",
|
|
128
128
|
"memory",
|
|
129
129
|
"storage"
|
|
130
130
|
]);
|
|
131
|
-
class vs extends
|
|
131
|
+
class vs extends B {
|
|
132
132
|
constructor({ signature: t }) {
|
|
133
133
|
super("Failed to parse ABI item.", {
|
|
134
134
|
details: `parseAbiItem(${JSON.stringify(t, null, 2)})`,
|
|
@@ -141,7 +141,7 @@ class vs extends C {
|
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
class
|
|
144
|
+
class G0 extends B {
|
|
145
145
|
constructor({ type: t }) {
|
|
146
146
|
super("Unknown type.", {
|
|
147
147
|
metaMessages: [
|
|
@@ -155,7 +155,7 @@ class z0 extends C {
|
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
class
|
|
158
|
+
class D0 extends B {
|
|
159
159
|
constructor({ type: t }) {
|
|
160
160
|
super("Unknown type.", {
|
|
161
161
|
metaMessages: [`Type "${t}" is not a valid ABI type.`]
|
|
@@ -167,7 +167,7 @@ class G0 extends C {
|
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
class xs extends
|
|
170
|
+
class xs extends B {
|
|
171
171
|
constructor({ params: t }) {
|
|
172
172
|
super("Failed to parse ABI parameters.", {
|
|
173
173
|
details: `parseAbiParameters(${JSON.stringify(t, null, 2)})`,
|
|
@@ -180,7 +180,7 @@ class xs extends C {
|
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
-
class
|
|
183
|
+
class L0 extends B {
|
|
184
184
|
constructor({ param: t }) {
|
|
185
185
|
super("Invalid ABI parameter.", {
|
|
186
186
|
details: t
|
|
@@ -192,7 +192,7 @@ class D0 extends C {
|
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
class
|
|
195
|
+
class _0 extends B {
|
|
196
196
|
constructor({ param: t, name: n }) {
|
|
197
197
|
super("Invalid ABI parameter.", {
|
|
198
198
|
details: t,
|
|
@@ -207,7 +207,7 @@ class L0 extends C {
|
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
class
|
|
210
|
+
class H0 extends B {
|
|
211
211
|
constructor({ param: t, type: n, modifier: r }) {
|
|
212
212
|
super("Invalid ABI parameter.", {
|
|
213
213
|
details: t,
|
|
@@ -222,7 +222,7 @@ class _0 extends C {
|
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
class
|
|
225
|
+
class q0 extends B {
|
|
226
226
|
constructor({ param: t, type: n, modifier: r }) {
|
|
227
227
|
super("Invalid ABI parameter.", {
|
|
228
228
|
details: t,
|
|
@@ -238,7 +238,7 @@ class H0 extends C {
|
|
|
238
238
|
});
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
class
|
|
241
|
+
class U0 extends B {
|
|
242
242
|
constructor({ abiParameter: t }) {
|
|
243
243
|
super("Invalid ABI parameter.", {
|
|
244
244
|
details: JSON.stringify(t, null, 2),
|
|
@@ -251,7 +251,7 @@ class q0 extends C {
|
|
|
251
251
|
});
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
-
class
|
|
254
|
+
class re extends B {
|
|
255
255
|
constructor({ signature: t, type: n }) {
|
|
256
256
|
super(`Invalid ${n} signature.`, {
|
|
257
257
|
details: t
|
|
@@ -263,7 +263,7 @@ class ae extends C {
|
|
|
263
263
|
});
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
class
|
|
266
|
+
class V0 extends B {
|
|
267
267
|
constructor({ signature: t }) {
|
|
268
268
|
super("Unknown signature.", {
|
|
269
269
|
details: t
|
|
@@ -275,7 +275,7 @@ class U0 extends C {
|
|
|
275
275
|
});
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
|
-
class
|
|
278
|
+
class W0 extends B {
|
|
279
279
|
constructor({ signature: t }) {
|
|
280
280
|
super("Invalid struct signature.", {
|
|
281
281
|
details: t,
|
|
@@ -288,7 +288,7 @@ class V0 extends C {
|
|
|
288
288
|
});
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
-
class
|
|
291
|
+
class Z0 extends B {
|
|
292
292
|
constructor({ type: t }) {
|
|
293
293
|
super("Circular reference detected.", {
|
|
294
294
|
metaMessages: [`Struct "${t}" is a circular reference.`]
|
|
@@ -300,7 +300,7 @@ class W0 extends C {
|
|
|
300
300
|
});
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
class
|
|
303
|
+
class K0 extends B {
|
|
304
304
|
constructor({ current: t, depth: n }) {
|
|
305
305
|
super("Unbalanced parentheses.", {
|
|
306
306
|
metaMessages: [
|
|
@@ -315,7 +315,7 @@ class Z0 extends C {
|
|
|
315
315
|
});
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function J0(e, t, n) {
|
|
319
319
|
let r = "";
|
|
320
320
|
if (n)
|
|
321
321
|
for (const a of Object.entries(n)) {
|
|
@@ -328,7 +328,7 @@ function K0(e, t, n) {
|
|
|
328
328
|
}
|
|
329
329
|
return t ? `${t}:${e}${r}` : e;
|
|
330
330
|
}
|
|
331
|
-
const
|
|
331
|
+
const Fe = /* @__PURE__ */ new Map([
|
|
332
332
|
// Unnamed
|
|
333
333
|
["address", { type: "address" }],
|
|
334
334
|
["bool", { type: "bool" }],
|
|
@@ -382,41 +382,41 @@ const Ie = /* @__PURE__ */ new Map([
|
|
|
382
382
|
{ type: "uint256", name: "tokenId", indexed: !0 }
|
|
383
383
|
]
|
|
384
384
|
]);
|
|
385
|
-
function
|
|
386
|
-
if (
|
|
387
|
-
return Y0(e, t);
|
|
388
|
-
if (S0(e))
|
|
385
|
+
function Y0(e, t = {}) {
|
|
386
|
+
if (I0(e))
|
|
389
387
|
return X0(e, t);
|
|
390
|
-
if (
|
|
388
|
+
if (M0(e))
|
|
391
389
|
return Q0(e, t);
|
|
392
|
-
if (
|
|
390
|
+
if (A0(e))
|
|
393
391
|
return er(e, t);
|
|
394
392
|
if (C0(e))
|
|
395
|
-
return tr(e);
|
|
396
|
-
if (
|
|
393
|
+
return tr(e, t);
|
|
394
|
+
if (R0(e))
|
|
395
|
+
return nr(e);
|
|
396
|
+
if (N0(e))
|
|
397
397
|
return {
|
|
398
398
|
type: "receive",
|
|
399
399
|
stateMutability: "payable"
|
|
400
400
|
};
|
|
401
|
-
throw new
|
|
401
|
+
throw new V0({ signature: e });
|
|
402
402
|
}
|
|
403
|
-
function
|
|
404
|
-
const n =
|
|
403
|
+
function X0(e, t = {}) {
|
|
404
|
+
const n = B0(e);
|
|
405
405
|
if (!n)
|
|
406
|
-
throw new
|
|
407
|
-
const r =
|
|
406
|
+
throw new re({ signature: e, type: "function" });
|
|
407
|
+
const r = k(n.parameters), a = [], s = r.length;
|
|
408
408
|
for (let i = 0; i < s; i++)
|
|
409
|
-
a.push(
|
|
410
|
-
modifiers:
|
|
409
|
+
a.push(Y(r[i], {
|
|
410
|
+
modifiers: Le,
|
|
411
411
|
structs: t,
|
|
412
412
|
type: "function"
|
|
413
413
|
}));
|
|
414
414
|
const o = [];
|
|
415
415
|
if (n.returns) {
|
|
416
|
-
const i =
|
|
416
|
+
const i = k(n.returns), c = i.length;
|
|
417
417
|
for (let u = 0; u < c; u++)
|
|
418
|
-
o.push(
|
|
419
|
-
modifiers:
|
|
418
|
+
o.push(Y(i[u], {
|
|
419
|
+
modifiers: Le,
|
|
420
420
|
structs: t,
|
|
421
421
|
type: "function"
|
|
422
422
|
}));
|
|
@@ -429,85 +429,85 @@ function Y0(e, t = {}) {
|
|
|
429
429
|
outputs: o
|
|
430
430
|
};
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function Q0(e, t = {}) {
|
|
433
433
|
const n = F0(e);
|
|
434
434
|
if (!n)
|
|
435
|
-
throw new
|
|
436
|
-
const r =
|
|
435
|
+
throw new re({ signature: e, type: "event" });
|
|
436
|
+
const r = k(n.parameters), a = [], s = r.length;
|
|
437
437
|
for (let o = 0; o < s; o++)
|
|
438
|
-
a.push(
|
|
439
|
-
modifiers:
|
|
438
|
+
a.push(Y(r[o], {
|
|
439
|
+
modifiers: z0,
|
|
440
440
|
structs: t,
|
|
441
441
|
type: "event"
|
|
442
442
|
}));
|
|
443
443
|
return { name: n.name, type: "event", inputs: a };
|
|
444
444
|
}
|
|
445
|
-
function
|
|
446
|
-
const n =
|
|
445
|
+
function er(e, t = {}) {
|
|
446
|
+
const n = S0(e);
|
|
447
447
|
if (!n)
|
|
448
|
-
throw new
|
|
449
|
-
const r =
|
|
448
|
+
throw new re({ signature: e, type: "error" });
|
|
449
|
+
const r = k(n.parameters), a = [], s = r.length;
|
|
450
450
|
for (let o = 0; o < s; o++)
|
|
451
|
-
a.push(
|
|
451
|
+
a.push(Y(r[o], { structs: t, type: "error" }));
|
|
452
452
|
return { name: n.name, type: "error", inputs: a };
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function tr(e, t = {}) {
|
|
455
455
|
const n = j0(e);
|
|
456
456
|
if (!n)
|
|
457
|
-
throw new
|
|
458
|
-
const r =
|
|
457
|
+
throw new re({ signature: e, type: "constructor" });
|
|
458
|
+
const r = k(n.parameters), a = [], s = r.length;
|
|
459
459
|
for (let o = 0; o < s; o++)
|
|
460
|
-
a.push(
|
|
460
|
+
a.push(Y(r[o], { structs: t, type: "constructor" }));
|
|
461
461
|
return {
|
|
462
462
|
type: "constructor",
|
|
463
463
|
stateMutability: n.stateMutability ?? "nonpayable",
|
|
464
464
|
inputs: a
|
|
465
465
|
};
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function nr(e) {
|
|
468
468
|
const t = k0(e);
|
|
469
469
|
if (!t)
|
|
470
|
-
throw new
|
|
470
|
+
throw new re({ signature: e, type: "fallback" });
|
|
471
471
|
return {
|
|
472
472
|
type: "fallback",
|
|
473
473
|
stateMutability: t.stateMutability ?? "nonpayable"
|
|
474
474
|
};
|
|
475
475
|
}
|
|
476
|
-
const
|
|
477
|
-
function
|
|
478
|
-
const n =
|
|
479
|
-
if (
|
|
480
|
-
return
|
|
481
|
-
const r =
|
|
476
|
+
const rr = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/, ar = /^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/, sr = /^u?int$/;
|
|
477
|
+
function Y(e, t) {
|
|
478
|
+
const n = J0(e, t?.type, t?.structs);
|
|
479
|
+
if (Fe.has(n))
|
|
480
|
+
return Fe.get(n);
|
|
481
|
+
const r = gn.test(e), a = _(r ? ar : rr, e);
|
|
482
482
|
if (!a)
|
|
483
|
-
throw new
|
|
484
|
-
if (a.name &&
|
|
485
|
-
throw new
|
|
483
|
+
throw new L0({ param: e });
|
|
484
|
+
if (a.name && ir(a.name))
|
|
485
|
+
throw new _0({ param: e, name: a.name });
|
|
486
486
|
const s = a.name ? { name: a.name } : {}, o = a.modifier === "indexed" ? { indexed: !0 } : {}, i = t?.structs ?? {};
|
|
487
487
|
let c, u = {};
|
|
488
488
|
if (r) {
|
|
489
489
|
c = "tuple";
|
|
490
|
-
const l =
|
|
490
|
+
const l = k(a.type), d = [], b = l.length;
|
|
491
491
|
for (let m = 0; m < b; m++)
|
|
492
|
-
d.push(
|
|
492
|
+
d.push(Y(l[m], { structs: i }));
|
|
493
493
|
u = { components: d };
|
|
494
494
|
} else if (a.type in i)
|
|
495
495
|
c = "tuple", u = { components: i[a.type] };
|
|
496
|
-
else if (
|
|
496
|
+
else if (sr.test(a.type))
|
|
497
497
|
c = `${a.type}256`;
|
|
498
498
|
else if (a.type === "address payable")
|
|
499
499
|
c = "address";
|
|
500
|
-
else if (c = a.type, t?.type !== "struct" && !
|
|
501
|
-
throw new
|
|
500
|
+
else if (c = a.type, t?.type !== "struct" && !Sn(c))
|
|
501
|
+
throw new D0({ type: c });
|
|
502
502
|
if (a.modifier) {
|
|
503
503
|
if (!t?.modifiers?.has?.(a.modifier))
|
|
504
|
-
throw new
|
|
504
|
+
throw new H0({
|
|
505
505
|
param: e,
|
|
506
506
|
type: t?.type,
|
|
507
507
|
modifier: a.modifier
|
|
508
508
|
});
|
|
509
|
-
if (
|
|
510
|
-
throw new
|
|
509
|
+
if (Le.has(a.modifier) && !cr(c, !!a.array))
|
|
510
|
+
throw new q0({
|
|
511
511
|
param: e,
|
|
512
512
|
type: t?.type,
|
|
513
513
|
modifier: a.modifier
|
|
@@ -519,102 +519,102 @@ function X(e, t) {
|
|
|
519
519
|
...o,
|
|
520
520
|
...u
|
|
521
521
|
};
|
|
522
|
-
return
|
|
522
|
+
return Fe.set(n, f), f;
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function k(e, t = [], n = "", r = 0) {
|
|
525
525
|
const a = e.trim().length;
|
|
526
526
|
for (let s = 0; s < a; s++) {
|
|
527
527
|
const o = e[s], i = e.slice(s + 1);
|
|
528
528
|
switch (o) {
|
|
529
529
|
case ",":
|
|
530
|
-
return r === 0 ?
|
|
530
|
+
return r === 0 ? k(i, [...t, n.trim()]) : k(i, t, `${n}${o}`, r);
|
|
531
531
|
case "(":
|
|
532
|
-
return
|
|
532
|
+
return k(i, t, `${n}${o}`, r + 1);
|
|
533
533
|
case ")":
|
|
534
|
-
return
|
|
534
|
+
return k(i, t, `${n}${o}`, r - 1);
|
|
535
535
|
default:
|
|
536
|
-
return
|
|
536
|
+
return k(i, t, `${n}${o}`, r);
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
if (n === "")
|
|
540
540
|
return t;
|
|
541
541
|
if (r !== 0)
|
|
542
|
-
throw new
|
|
542
|
+
throw new K0({ current: n, depth: r });
|
|
543
543
|
return t.push(n.trim()), t;
|
|
544
544
|
}
|
|
545
|
-
function
|
|
546
|
-
return e === "address" || e === "bool" || e === "function" || e === "string" ||
|
|
545
|
+
function Sn(e) {
|
|
546
|
+
return e === "address" || e === "bool" || e === "function" || e === "string" || mn.test(e) || hn.test(e);
|
|
547
547
|
}
|
|
548
|
-
const
|
|
549
|
-
function
|
|
550
|
-
return e === "address" || e === "bool" || e === "function" || e === "string" || e === "tuple" ||
|
|
548
|
+
const or = /^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;
|
|
549
|
+
function ir(e) {
|
|
550
|
+
return e === "address" || e === "bool" || e === "function" || e === "string" || e === "tuple" || mn.test(e) || hn.test(e) || or.test(e);
|
|
551
551
|
}
|
|
552
|
-
function
|
|
552
|
+
function cr(e, t) {
|
|
553
553
|
return t || e === "bytes" || e === "string" || e === "tuple";
|
|
554
554
|
}
|
|
555
|
-
function
|
|
555
|
+
function ur(e) {
|
|
556
556
|
const t = {}, n = e.length;
|
|
557
557
|
for (let o = 0; o < n; o++) {
|
|
558
558
|
const i = e[o];
|
|
559
|
-
if (!
|
|
559
|
+
if (!En(i))
|
|
560
560
|
continue;
|
|
561
|
-
const c =
|
|
561
|
+
const c = T0(i);
|
|
562
562
|
if (!c)
|
|
563
|
-
throw new
|
|
563
|
+
throw new re({ signature: i, type: "struct" });
|
|
564
564
|
const u = c.properties.split(";"), f = [], l = u.length;
|
|
565
565
|
for (let d = 0; d < l; d++) {
|
|
566
566
|
const m = u[d].trim();
|
|
567
567
|
if (!m)
|
|
568
568
|
continue;
|
|
569
|
-
const p =
|
|
569
|
+
const p = Y(m, {
|
|
570
570
|
type: "struct"
|
|
571
571
|
});
|
|
572
572
|
f.push(p);
|
|
573
573
|
}
|
|
574
574
|
if (!f.length)
|
|
575
|
-
throw new
|
|
575
|
+
throw new W0({ signature: i });
|
|
576
576
|
t[c.name] = f;
|
|
577
577
|
}
|
|
578
578
|
const r = {}, a = Object.entries(t), s = a.length;
|
|
579
579
|
for (let o = 0; o < s; o++) {
|
|
580
580
|
const [i, c] = a[o];
|
|
581
|
-
r[i] =
|
|
581
|
+
r[i] = Mn(c, t);
|
|
582
582
|
}
|
|
583
583
|
return r;
|
|
584
584
|
}
|
|
585
|
-
const
|
|
586
|
-
function
|
|
585
|
+
const fr = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;
|
|
586
|
+
function Mn(e, t, n = /* @__PURE__ */ new Set()) {
|
|
587
587
|
const r = [], a = e.length;
|
|
588
588
|
for (let s = 0; s < a; s++) {
|
|
589
589
|
const o = e[s];
|
|
590
|
-
if (
|
|
590
|
+
if (gn.test(o.type))
|
|
591
591
|
r.push(o);
|
|
592
592
|
else {
|
|
593
|
-
const c =
|
|
593
|
+
const c = _(fr, o.type);
|
|
594
594
|
if (!c?.type)
|
|
595
|
-
throw new
|
|
595
|
+
throw new U0({ abiParameter: o });
|
|
596
596
|
const { array: u, type: f } = c;
|
|
597
597
|
if (f in t) {
|
|
598
598
|
if (n.has(f))
|
|
599
|
-
throw new
|
|
599
|
+
throw new Z0({ type: f });
|
|
600
600
|
r.push({
|
|
601
601
|
...o,
|
|
602
602
|
type: `tuple${u ?? ""}`,
|
|
603
|
-
components:
|
|
603
|
+
components: Mn(t[f] ?? [], t, /* @__PURE__ */ new Set([...n, f]))
|
|
604
604
|
});
|
|
605
|
-
} else if (
|
|
605
|
+
} else if (Sn(f))
|
|
606
606
|
r.push(o);
|
|
607
607
|
else
|
|
608
|
-
throw new
|
|
608
|
+
throw new G0({ type: f });
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
611
|
return r;
|
|
612
612
|
}
|
|
613
613
|
function Fn(e) {
|
|
614
|
-
const t =
|
|
614
|
+
const t = ur(e), n = [], r = e.length;
|
|
615
615
|
for (let a = 0; a < r; a++) {
|
|
616
616
|
const s = e[a];
|
|
617
|
-
|
|
617
|
+
En(s) || n.push(Y0(s, t));
|
|
618
618
|
}
|
|
619
619
|
return n;
|
|
620
620
|
}
|
|
@@ -625,18 +625,18 @@ function E(e, t, n) {
|
|
|
625
625
|
const a = e[n];
|
|
626
626
|
return typeof a == "function" ? a : (s) => t(e, s);
|
|
627
627
|
}
|
|
628
|
-
function
|
|
628
|
+
function D(e, { includeName: t = !1 } = {}) {
|
|
629
629
|
if (e.type !== "function" && e.type !== "event" && e.type !== "error")
|
|
630
|
-
throw new
|
|
631
|
-
return `${e.name}(${
|
|
630
|
+
throw new Pr(e.type);
|
|
631
|
+
return `${e.name}(${ve(e.inputs, { includeName: t })})`;
|
|
632
632
|
}
|
|
633
|
-
function
|
|
634
|
-
return e ? e.map((n) =>
|
|
633
|
+
function ve(e, { includeName: t = !1 } = {}) {
|
|
634
|
+
return e ? e.map((n) => dr(n, { includeName: t })).join(t ? ", " : ",") : "";
|
|
635
635
|
}
|
|
636
|
-
function
|
|
637
|
-
return e.type.startsWith("tuple") ? `(${
|
|
636
|
+
function dr(e, { includeName: t }) {
|
|
637
|
+
return e.type.startsWith("tuple") ? `(${ve(e.components, { includeName: t })})${e.type.slice(5)}` : e.type + (t && e.name ? ` ${e.name}` : "");
|
|
638
638
|
}
|
|
639
|
-
class
|
|
639
|
+
class lr extends y {
|
|
640
640
|
constructor({ docsPath: t }) {
|
|
641
641
|
super([
|
|
642
642
|
"A constructor was not found on the ABI.",
|
|
@@ -648,7 +648,7 @@ class dr extends y {
|
|
|
648
648
|
});
|
|
649
649
|
}
|
|
650
650
|
}
|
|
651
|
-
class
|
|
651
|
+
class Zt extends y {
|
|
652
652
|
constructor({ docsPath: t }) {
|
|
653
653
|
super([
|
|
654
654
|
"Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.",
|
|
@@ -660,12 +660,12 @@ class Wt extends y {
|
|
|
660
660
|
});
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
|
-
class
|
|
663
|
+
class In extends y {
|
|
664
664
|
constructor({ data: t, params: n, size: r }) {
|
|
665
665
|
super([`Data size of ${r} bytes is too small for given parameters.`].join(`
|
|
666
666
|
`), {
|
|
667
667
|
metaMessages: [
|
|
668
|
-
`Params: (${
|
|
668
|
+
`Params: (${ve(n, { includeName: !0 })})`,
|
|
669
669
|
`Data: ${t} (${r} bytes)`
|
|
670
670
|
],
|
|
671
671
|
name: "AbiDecodingDataSizeTooSmallError"
|
|
@@ -694,7 +694,7 @@ class Ye extends y {
|
|
|
694
694
|
});
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
class
|
|
697
|
+
class br extends y {
|
|
698
698
|
constructor({ expectedLength: t, givenLength: n, type: r }) {
|
|
699
699
|
super([
|
|
700
700
|
`ABI encoding array length mismatch for type ${r}.`,
|
|
@@ -704,12 +704,12 @@ class lr extends y {
|
|
|
704
704
|
`), { name: "AbiEncodingArrayLengthMismatchError" });
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
|
-
class
|
|
707
|
+
class pr extends y {
|
|
708
708
|
constructor({ expectedSize: t, value: n }) {
|
|
709
|
-
super(`Size of bytes "${n}" (bytes${
|
|
709
|
+
super(`Size of bytes "${n}" (bytes${R(n)}) does not match expected size (bytes${t}).`, { name: "AbiEncodingBytesSizeMismatchError" });
|
|
710
710
|
}
|
|
711
711
|
}
|
|
712
|
-
class
|
|
712
|
+
class yr extends y {
|
|
713
713
|
constructor({ expectedLength: t, givenLength: n }) {
|
|
714
714
|
super([
|
|
715
715
|
"ABI encoding params/values length mismatch.",
|
|
@@ -744,7 +744,7 @@ class Es extends y {
|
|
|
744
744
|
});
|
|
745
745
|
}
|
|
746
746
|
}
|
|
747
|
-
class
|
|
747
|
+
class Bn extends y {
|
|
748
748
|
constructor(t, { docsPath: n }) {
|
|
749
749
|
super([
|
|
750
750
|
`Encoded error signature "${t}" not found on ABI.`,
|
|
@@ -762,7 +762,7 @@ class In extends y {
|
|
|
762
762
|
}), this.signature = t;
|
|
763
763
|
}
|
|
764
764
|
}
|
|
765
|
-
class
|
|
765
|
+
class mr extends y {
|
|
766
766
|
constructor({ docsPath: t }) {
|
|
767
767
|
super("Cannot extract event signature from empty topics.", {
|
|
768
768
|
docsPath: t,
|
|
@@ -770,7 +770,7 @@ class yr extends y {
|
|
|
770
770
|
});
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
|
-
class
|
|
773
|
+
class Tn extends y {
|
|
774
774
|
constructor(t, { docsPath: n }) {
|
|
775
775
|
super([
|
|
776
776
|
`Encoded event signature "${t}" not found on ABI.`,
|
|
@@ -783,7 +783,7 @@ class Bn extends y {
|
|
|
783
783
|
});
|
|
784
784
|
}
|
|
785
785
|
}
|
|
786
|
-
class
|
|
786
|
+
class Kt extends y {
|
|
787
787
|
constructor(t, { docsPath: n } = {}) {
|
|
788
788
|
super([
|
|
789
789
|
`Event ${t ? `"${t}" ` : ""}not found on ABI.`,
|
|
@@ -795,7 +795,7 @@ class Zt extends y {
|
|
|
795
795
|
});
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
|
-
class
|
|
798
|
+
class pe extends y {
|
|
799
799
|
constructor(t, { docsPath: n } = {}) {
|
|
800
800
|
super([
|
|
801
801
|
`Function ${t ? `"${t}" ` : ""}not found on ABI.`,
|
|
@@ -807,7 +807,7 @@ class ye extends y {
|
|
|
807
807
|
});
|
|
808
808
|
}
|
|
809
809
|
}
|
|
810
|
-
class
|
|
810
|
+
class hr extends y {
|
|
811
811
|
constructor(t, { docsPath: n }) {
|
|
812
812
|
super([
|
|
813
813
|
`Function "${t}" does not contain any \`outputs\` on ABI.`,
|
|
@@ -833,12 +833,12 @@ class $s extends y {
|
|
|
833
833
|
});
|
|
834
834
|
}
|
|
835
835
|
}
|
|
836
|
-
class
|
|
836
|
+
class gr extends y {
|
|
837
837
|
constructor(t, n) {
|
|
838
838
|
super("Found ambiguous types in overloaded ABI items.", {
|
|
839
839
|
metaMessages: [
|
|
840
|
-
`\`${t.type}\` in \`${
|
|
841
|
-
`\`${n.type}\` in \`${
|
|
840
|
+
`\`${t.type}\` in \`${D(t.abiItem)}\`, and`,
|
|
841
|
+
`\`${n.type}\` in \`${D(n.abiItem)}\``,
|
|
842
842
|
"",
|
|
843
843
|
"These types encode differently and cannot be distinguished at runtime.",
|
|
844
844
|
"Remove one of the ambiguous items in the ABI."
|
|
@@ -854,14 +854,14 @@ class As extends y {
|
|
|
854
854
|
});
|
|
855
855
|
}
|
|
856
856
|
}
|
|
857
|
-
class
|
|
857
|
+
class ye extends y {
|
|
858
858
|
constructor({ abiItem: t, data: n, params: r, size: a }) {
|
|
859
859
|
super([
|
|
860
860
|
`Data size of ${a} bytes is too small for non-indexed event parameters.`
|
|
861
861
|
].join(`
|
|
862
862
|
`), {
|
|
863
863
|
metaMessages: [
|
|
864
|
-
`Params: (${
|
|
864
|
+
`Params: (${ve(r, { includeName: !0 })})`,
|
|
865
865
|
`Data: ${n} (${a} bytes)`
|
|
866
866
|
],
|
|
867
867
|
name: "DecodeLogDataMismatch"
|
|
@@ -891,7 +891,7 @@ class me extends y {
|
|
|
891
891
|
class Xe extends y {
|
|
892
892
|
constructor({ abiItem: t, param: n }) {
|
|
893
893
|
super([
|
|
894
|
-
`Expected a topic for indexed event parameter${n.name ? ` "${n.name}"` : ""} on event "${
|
|
894
|
+
`Expected a topic for indexed event parameter${n.name ? ` "${n.name}"` : ""} on event "${D(t, { includeName: !0 })}".`
|
|
895
895
|
].join(`
|
|
896
896
|
`), { name: "DecodeLogTopicsMismatch" }), Object.defineProperty(this, "abiItem", {
|
|
897
897
|
enumerable: !0,
|
|
@@ -901,7 +901,7 @@ class Xe extends y {
|
|
|
901
901
|
}), this.abiItem = t;
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
|
-
class
|
|
904
|
+
class wr extends y {
|
|
905
905
|
constructor(t, { docsPath: n }) {
|
|
906
906
|
super([
|
|
907
907
|
`Type "${t}" is not a valid encoding type.`,
|
|
@@ -910,7 +910,7 @@ class gr extends y {
|
|
|
910
910
|
`), { docsPath: n, name: "InvalidAbiEncodingType" });
|
|
911
911
|
}
|
|
912
912
|
}
|
|
913
|
-
class
|
|
913
|
+
class vr extends y {
|
|
914
914
|
constructor(t, { docsPath: n }) {
|
|
915
915
|
super([
|
|
916
916
|
`Type "${t}" is not a valid decoding type.`,
|
|
@@ -919,7 +919,7 @@ class wr extends y {
|
|
|
919
919
|
`), { docsPath: n, name: "InvalidAbiDecodingType" });
|
|
920
920
|
}
|
|
921
921
|
}
|
|
922
|
-
class
|
|
922
|
+
class xr extends y {
|
|
923
923
|
constructor(t) {
|
|
924
924
|
super([`Value "${t}" is not a valid array.`].join(`
|
|
925
925
|
`), {
|
|
@@ -927,7 +927,7 @@ class vr extends y {
|
|
|
927
927
|
});
|
|
928
928
|
}
|
|
929
929
|
}
|
|
930
|
-
class
|
|
930
|
+
class Pr extends y {
|
|
931
931
|
constructor(t) {
|
|
932
932
|
super([
|
|
933
933
|
`"${t}" is not a valid definition type.`,
|
|
@@ -936,18 +936,18 @@ class xr extends y {
|
|
|
936
936
|
`), { name: "InvalidDefinitionTypeError" });
|
|
937
937
|
}
|
|
938
938
|
}
|
|
939
|
-
class
|
|
939
|
+
class Er extends y {
|
|
940
940
|
constructor(t) {
|
|
941
941
|
super(`Filter type "${t}" is not supported.`, {
|
|
942
942
|
name: "FilterTypeNotSupportedError"
|
|
943
943
|
});
|
|
944
944
|
}
|
|
945
945
|
}
|
|
946
|
-
const
|
|
947
|
-
function $r(e) {
|
|
948
|
-
return Er(e);
|
|
949
|
-
}
|
|
946
|
+
const $r = (e) => ie(We(e));
|
|
950
947
|
function Ar(e) {
|
|
948
|
+
return $r(e);
|
|
949
|
+
}
|
|
950
|
+
function Sr(e) {
|
|
951
951
|
let t = !0, n = "", r = 0, a = "", s = !1;
|
|
952
952
|
for (let o = 0; o < e.length; o++) {
|
|
953
953
|
const i = e[o];
|
|
@@ -972,27 +972,27 @@ function Ar(e) {
|
|
|
972
972
|
throw new y("Unable to normalize signature.");
|
|
973
973
|
return a;
|
|
974
974
|
}
|
|
975
|
-
const
|
|
976
|
-
const t = typeof e == "string" ? e :
|
|
977
|
-
return
|
|
975
|
+
const Mr = (e) => {
|
|
976
|
+
const t = typeof e == "string" ? e : $0(e);
|
|
977
|
+
return Sr(t);
|
|
978
978
|
};
|
|
979
|
-
function
|
|
980
|
-
return
|
|
979
|
+
function Cn(e) {
|
|
980
|
+
return Ar(Mr(e));
|
|
981
981
|
}
|
|
982
|
-
const
|
|
982
|
+
const xe = Cn, Ss = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/, Fr = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
|
|
983
983
|
function Qe(e, t) {
|
|
984
984
|
if (e.length !== t.length)
|
|
985
|
-
throw new
|
|
985
|
+
throw new yr({
|
|
986
986
|
expectedLength: e.length,
|
|
987
987
|
givenLength: t.length
|
|
988
988
|
});
|
|
989
|
-
const n =
|
|
989
|
+
const n = Ir({
|
|
990
990
|
params: e,
|
|
991
991
|
values: t
|
|
992
992
|
}), r = tt(n);
|
|
993
993
|
return r.length === 0 ? "0x" : r;
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function Ir({ params: e, values: t }) {
|
|
996
996
|
const n = [];
|
|
997
997
|
for (let r = 0; r < e.length; r++)
|
|
998
998
|
n.push(et({ param: e[r], value: t[r] }));
|
|
@@ -1002,28 +1002,28 @@ function et({ param: e, value: t }) {
|
|
|
1002
1002
|
const n = nt(e.type);
|
|
1003
1003
|
if (n) {
|
|
1004
1004
|
const [r, a] = n;
|
|
1005
|
-
return
|
|
1005
|
+
return Tr(t, { length: r, param: { ...e, type: a } });
|
|
1006
1006
|
}
|
|
1007
1007
|
if (e.type === "tuple")
|
|
1008
|
-
return
|
|
1008
|
+
return Or(t, {
|
|
1009
1009
|
param: e
|
|
1010
1010
|
});
|
|
1011
1011
|
if (e.type === "address")
|
|
1012
|
-
return
|
|
1012
|
+
return Br(t);
|
|
1013
1013
|
if (e.type === "bool")
|
|
1014
1014
|
return jr(t);
|
|
1015
1015
|
if (e.type.startsWith("uint") || e.type.startsWith("int")) {
|
|
1016
1016
|
const r = e.type.startsWith("int"), [, , a = "256"] = Fr.exec(e.type) ?? [];
|
|
1017
|
-
return
|
|
1017
|
+
return Rr(t, {
|
|
1018
1018
|
signed: r,
|
|
1019
1019
|
size: Number(a)
|
|
1020
1020
|
});
|
|
1021
1021
|
}
|
|
1022
1022
|
if (e.type.startsWith("bytes"))
|
|
1023
|
-
return
|
|
1023
|
+
return Cr(t, { param: e });
|
|
1024
1024
|
if (e.type === "string")
|
|
1025
1025
|
return kr(t);
|
|
1026
|
-
throw new
|
|
1026
|
+
throw new wr(e.type, {
|
|
1027
1027
|
docsPath: "/docs/contract/encodeAbiParameters"
|
|
1028
1028
|
});
|
|
1029
1029
|
}
|
|
@@ -1031,27 +1031,27 @@ function tt(e) {
|
|
|
1031
1031
|
let t = 0;
|
|
1032
1032
|
for (let s = 0; s < e.length; s++) {
|
|
1033
1033
|
const { dynamic: o, encoded: i } = e[s];
|
|
1034
|
-
o ? t += 32 : t +=
|
|
1034
|
+
o ? t += 32 : t += R(i);
|
|
1035
1035
|
}
|
|
1036
1036
|
const n = [], r = [];
|
|
1037
1037
|
let a = 0;
|
|
1038
1038
|
for (let s = 0; s < e.length; s++) {
|
|
1039
1039
|
const { dynamic: o, encoded: i } = e[s];
|
|
1040
|
-
o ? (n.push(v(t + a, { size: 32 })), r.push(i), a +=
|
|
1040
|
+
o ? (n.push(v(t + a, { size: 32 })), r.push(i), a += R(i)) : n.push(i);
|
|
1041
1041
|
}
|
|
1042
|
-
return
|
|
1042
|
+
return Q([...n, ...r]);
|
|
1043
1043
|
}
|
|
1044
|
-
function
|
|
1045
|
-
if (!
|
|
1046
|
-
throw new
|
|
1047
|
-
return { dynamic: !1, encoded:
|
|
1044
|
+
function Br(e) {
|
|
1045
|
+
if (!G(e))
|
|
1046
|
+
throw new ee({ address: e });
|
|
1047
|
+
return { dynamic: !1, encoded: Z(e.toLowerCase()) };
|
|
1048
1048
|
}
|
|
1049
|
-
function
|
|
1049
|
+
function Tr(e, { length: t, param: n }) {
|
|
1050
1050
|
const r = t === null;
|
|
1051
1051
|
if (!Array.isArray(e))
|
|
1052
|
-
throw new
|
|
1052
|
+
throw new xr(e);
|
|
1053
1053
|
if (!r && e.length !== t)
|
|
1054
|
-
throw new
|
|
1054
|
+
throw new br({
|
|
1055
1055
|
expectedLength: t,
|
|
1056
1056
|
givenLength: e.length,
|
|
1057
1057
|
type: `${n.type}[${t}]`
|
|
@@ -1068,7 +1068,7 @@ function Br(e, { length: t, param: n }) {
|
|
|
1068
1068
|
const i = v(s.length, { size: 32 });
|
|
1069
1069
|
return {
|
|
1070
1070
|
dynamic: !0,
|
|
1071
|
-
encoded: s.length > 0 ?
|
|
1071
|
+
encoded: s.length > 0 ? Q([i, o]) : i
|
|
1072
1072
|
};
|
|
1073
1073
|
}
|
|
1074
1074
|
if (a)
|
|
@@ -1076,38 +1076,38 @@ function Br(e, { length: t, param: n }) {
|
|
|
1076
1076
|
}
|
|
1077
1077
|
return {
|
|
1078
1078
|
dynamic: !1,
|
|
1079
|
-
encoded:
|
|
1079
|
+
encoded: Q(s.map(({ encoded: o }) => o))
|
|
1080
1080
|
};
|
|
1081
1081
|
}
|
|
1082
|
-
function
|
|
1083
|
-
const [, n] = t.type.split("bytes"), r =
|
|
1082
|
+
function Cr(e, { param: t }) {
|
|
1083
|
+
const [, n] = t.type.split("bytes"), r = R(e);
|
|
1084
1084
|
if (!n) {
|
|
1085
1085
|
let a = e;
|
|
1086
|
-
return r % 32 !== 0 && (a =
|
|
1086
|
+
return r % 32 !== 0 && (a = Z(a, {
|
|
1087
1087
|
dir: "right",
|
|
1088
1088
|
size: Math.ceil((e.length - 2) / 2 / 32) * 32
|
|
1089
1089
|
})), {
|
|
1090
1090
|
dynamic: !0,
|
|
1091
|
-
encoded:
|
|
1091
|
+
encoded: Q([Z(v(r, { size: 32 })), a])
|
|
1092
1092
|
};
|
|
1093
1093
|
}
|
|
1094
1094
|
if (r !== Number.parseInt(n, 10))
|
|
1095
|
-
throw new
|
|
1095
|
+
throw new pr({
|
|
1096
1096
|
expectedSize: Number.parseInt(n, 10),
|
|
1097
1097
|
value: e
|
|
1098
1098
|
});
|
|
1099
|
-
return { dynamic: !1, encoded:
|
|
1099
|
+
return { dynamic: !1, encoded: Z(e, { dir: "right" }) };
|
|
1100
1100
|
}
|
|
1101
1101
|
function jr(e) {
|
|
1102
1102
|
if (typeof e != "boolean")
|
|
1103
1103
|
throw new y(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);
|
|
1104
|
-
return { dynamic: !1, encoded:
|
|
1104
|
+
return { dynamic: !1, encoded: Z(r0(e)) };
|
|
1105
1105
|
}
|
|
1106
|
-
function
|
|
1106
|
+
function Rr(e, { signed: t, size: n = 256 }) {
|
|
1107
1107
|
if (typeof n == "number") {
|
|
1108
1108
|
const r = 2n ** (BigInt(n) - (t ? 1n : 0n)) - 1n, a = t ? -r - 1n : 0n;
|
|
1109
1109
|
if (e > r || e < a)
|
|
1110
|
-
throw new
|
|
1110
|
+
throw new a0({
|
|
1111
1111
|
max: r.toString(),
|
|
1112
1112
|
min: a.toString(),
|
|
1113
1113
|
signed: t,
|
|
@@ -1124,20 +1124,20 @@ function Cr(e, { signed: t, size: n = 256 }) {
|
|
|
1124
1124
|
};
|
|
1125
1125
|
}
|
|
1126
1126
|
function kr(e) {
|
|
1127
|
-
const t =
|
|
1127
|
+
const t = s0(e), n = Math.ceil(R(t) / 32), r = [];
|
|
1128
1128
|
for (let a = 0; a < n; a++)
|
|
1129
|
-
r.push(
|
|
1129
|
+
r.push(Z(de(t, a * 32, (a + 1) * 32), {
|
|
1130
1130
|
dir: "right"
|
|
1131
1131
|
}));
|
|
1132
1132
|
return {
|
|
1133
1133
|
dynamic: !0,
|
|
1134
|
-
encoded:
|
|
1135
|
-
|
|
1134
|
+
encoded: Q([
|
|
1135
|
+
Z(v(R(t), { size: 32 })),
|
|
1136
1136
|
...r
|
|
1137
1137
|
])
|
|
1138
1138
|
};
|
|
1139
1139
|
}
|
|
1140
|
-
function
|
|
1140
|
+
function Or(e, { param: t }) {
|
|
1141
1141
|
let n = !1;
|
|
1142
1142
|
const r = [];
|
|
1143
1143
|
for (let a = 0; a < t.components.length; a++) {
|
|
@@ -1149,7 +1149,7 @@ function Rr(e, { param: t }) {
|
|
|
1149
1149
|
}
|
|
1150
1150
|
return {
|
|
1151
1151
|
dynamic: n,
|
|
1152
|
-
encoded: n ? tt(r) :
|
|
1152
|
+
encoded: n ? tt(r) : Q(r.map(({ encoded: a }) => a))
|
|
1153
1153
|
};
|
|
1154
1154
|
}
|
|
1155
1155
|
function nt(e) {
|
|
@@ -1159,9 +1159,9 @@ function nt(e) {
|
|
|
1159
1159
|
[t[2] ? Number(t[2]) : null, t[1]]
|
|
1160
1160
|
) : void 0;
|
|
1161
1161
|
}
|
|
1162
|
-
const rt = (e) =>
|
|
1162
|
+
const rt = (e) => de(Cn(e), 0, 4);
|
|
1163
1163
|
function ce(e) {
|
|
1164
|
-
const { abi: t, args: n = [], name: r } = e, a =
|
|
1164
|
+
const { abi: t, args: n = [], name: r } = e, a = ke(r, { strict: !1 }), s = t.filter((i) => a ? i.type === "function" ? rt(i) === r : i.type === "event" ? xe(i) === r : !1 : "name" in i && i.name === r);
|
|
1165
1165
|
if (s.length === 0)
|
|
1166
1166
|
return;
|
|
1167
1167
|
if (s.length === 1)
|
|
@@ -1179,12 +1179,12 @@ function ce(e) {
|
|
|
1179
1179
|
continue;
|
|
1180
1180
|
if (n.every((u, f) => {
|
|
1181
1181
|
const l = "inputs" in i && i.inputs[f];
|
|
1182
|
-
return l ?
|
|
1182
|
+
return l ? _e(u, l) : !1;
|
|
1183
1183
|
})) {
|
|
1184
1184
|
if (o && "inputs" in o && o.inputs) {
|
|
1185
1185
|
const u = jn(i.inputs, o.inputs, n);
|
|
1186
1186
|
if (u)
|
|
1187
|
-
throw new
|
|
1187
|
+
throw new gr({
|
|
1188
1188
|
abiItem: i,
|
|
1189
1189
|
type: u[0]
|
|
1190
1190
|
}, {
|
|
@@ -1197,11 +1197,11 @@ function ce(e) {
|
|
|
1197
1197
|
}
|
|
1198
1198
|
return o || s[0];
|
|
1199
1199
|
}
|
|
1200
|
-
function
|
|
1200
|
+
function _e(e, t) {
|
|
1201
1201
|
const n = typeof e, r = t.type;
|
|
1202
1202
|
switch (r) {
|
|
1203
1203
|
case "address":
|
|
1204
|
-
return
|
|
1204
|
+
return G(e, { strict: !1 });
|
|
1205
1205
|
case "bool":
|
|
1206
1206
|
return n === "boolean";
|
|
1207
1207
|
case "function":
|
|
@@ -1209,7 +1209,7 @@ function He(e, t) {
|
|
|
1209
1209
|
case "string":
|
|
1210
1210
|
return n === "string";
|
|
1211
1211
|
default:
|
|
1212
|
-
return r === "tuple" && "components" in t ? Object.values(t.components).every((a, s) =>
|
|
1212
|
+
return r === "tuple" && "components" in t ? Object.values(t.components).every((a, s) => _e(Object.values(e)[s], a)) : /^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r) ? n === "number" || n === "bigint" : /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r) ? n === "string" || e instanceof Uint8Array : /[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r) ? Array.isArray(e) && e.every((a) => _e(a, {
|
|
1213
1213
|
...t,
|
|
1214
1214
|
// Pop off `[]` or `[M]` from end of type
|
|
1215
1215
|
type: r.replace(/(\[[0-9]{0,}\])$/, "")
|
|
@@ -1222,45 +1222,45 @@ function jn(e, t, n) {
|
|
|
1222
1222
|
if (a.type === "tuple" && s.type === "tuple" && "components" in a && "components" in s)
|
|
1223
1223
|
return jn(a.components, s.components, n[r]);
|
|
1224
1224
|
const o = [a.type, s.type];
|
|
1225
|
-
if (o.includes("address") && o.includes("bytes20") ? !0 : o.includes("address") && o.includes("string") ?
|
|
1225
|
+
if (o.includes("address") && o.includes("bytes20") ? !0 : o.includes("address") && o.includes("string") ? G(n[r], { strict: !1 }) : o.includes("address") && o.includes("bytes") ? G(n[r], { strict: !1 }) : !1)
|
|
1226
1226
|
return o;
|
|
1227
1227
|
}
|
|
1228
1228
|
}
|
|
1229
|
-
const
|
|
1229
|
+
const Jt = "/docs/contract/encodeEventTopics";
|
|
1230
1230
|
function at(e) {
|
|
1231
1231
|
const { abi: t, eventName: n, args: r } = e;
|
|
1232
1232
|
let a = t[0];
|
|
1233
1233
|
if (n) {
|
|
1234
1234
|
const c = ce({ abi: t, name: n });
|
|
1235
1235
|
if (!c)
|
|
1236
|
-
throw new
|
|
1236
|
+
throw new Kt(n, { docsPath: Jt });
|
|
1237
1237
|
a = c;
|
|
1238
1238
|
}
|
|
1239
1239
|
if (a.type !== "event")
|
|
1240
|
-
throw new
|
|
1241
|
-
const s =
|
|
1240
|
+
throw new Kt(void 0, { docsPath: Jt });
|
|
1241
|
+
const s = D(a), o = xe(s);
|
|
1242
1242
|
let i = [];
|
|
1243
1243
|
if (r && "inputs" in a) {
|
|
1244
1244
|
const c = a.inputs?.filter((f) => "indexed" in f && f.indexed), u = Array.isArray(r) ? r : Object.values(r).length > 0 ? c?.map((f) => r[f.name]) ?? [] : [];
|
|
1245
|
-
u.length > 0 && (i = c?.map((f, l) => Array.isArray(u[l]) ? u[l].map((d, b) =>
|
|
1245
|
+
u.length > 0 && (i = c?.map((f, l) => Array.isArray(u[l]) ? u[l].map((d, b) => Yt({ param: f, value: u[l][b] })) : typeof u[l] < "u" && u[l] !== null ? Yt({ param: f, value: u[l] }) : null) ?? []);
|
|
1246
1246
|
}
|
|
1247
1247
|
return [o, ...i];
|
|
1248
1248
|
}
|
|
1249
|
-
function
|
|
1249
|
+
function Yt({ param: e, value: t }) {
|
|
1250
1250
|
if (e.type === "string" || e.type === "bytes")
|
|
1251
1251
|
return ie(We(t));
|
|
1252
1252
|
if (e.type === "tuple" || e.type.match(/^(.*)\[(\d+)?\]$/))
|
|
1253
|
-
throw new
|
|
1253
|
+
throw new Er(e.type);
|
|
1254
1254
|
return Qe([e], [t]);
|
|
1255
1255
|
}
|
|
1256
|
-
function
|
|
1256
|
+
function Nr(e, { method: t }) {
|
|
1257
1257
|
const n = {};
|
|
1258
1258
|
return e.transport.type === "fallback" && e.transport.onResponse?.(({ method: r, response: a, status: s, transport: o }) => {
|
|
1259
1259
|
s === "success" && t === r && (n[a] = o.request);
|
|
1260
1260
|
}), ((r) => n[r] || e.request);
|
|
1261
1261
|
}
|
|
1262
|
-
async function
|
|
1263
|
-
const { address: n, abi: r, args: a, eventName: s, fromBlock: o, strict: i, toBlock: c } = t, u =
|
|
1262
|
+
async function zr(e, t) {
|
|
1263
|
+
const { address: n, abi: r, args: a, eventName: s, fromBlock: o, strict: i, toBlock: c } = t, u = Nr(e, {
|
|
1264
1264
|
method: "eth_newFilter"
|
|
1265
1265
|
}), f = s ? at({
|
|
1266
1266
|
abi: r,
|
|
@@ -1287,11 +1287,11 @@ async function Nr(e, t) {
|
|
|
1287
1287
|
type: "event"
|
|
1288
1288
|
};
|
|
1289
1289
|
}
|
|
1290
|
-
function
|
|
1290
|
+
function H(e) {
|
|
1291
1291
|
return typeof e == "string" ? { address: e, type: "json-rpc" } : e;
|
|
1292
1292
|
}
|
|
1293
|
-
const
|
|
1294
|
-
function
|
|
1293
|
+
const Xt = "/docs/contract/encodeFunctionData";
|
|
1294
|
+
function Gr(e) {
|
|
1295
1295
|
const { abi: t, args: n, functionName: r } = e;
|
|
1296
1296
|
let a = t[0];
|
|
1297
1297
|
if (r) {
|
|
@@ -1301,21 +1301,21 @@ function zr(e) {
|
|
|
1301
1301
|
name: r
|
|
1302
1302
|
});
|
|
1303
1303
|
if (!s)
|
|
1304
|
-
throw new
|
|
1304
|
+
throw new pe(r, { docsPath: Xt });
|
|
1305
1305
|
a = s;
|
|
1306
1306
|
}
|
|
1307
1307
|
if (a.type !== "function")
|
|
1308
|
-
throw new
|
|
1308
|
+
throw new pe(void 0, { docsPath: Xt });
|
|
1309
1309
|
return {
|
|
1310
1310
|
abi: [a],
|
|
1311
|
-
functionName: rt(
|
|
1311
|
+
functionName: rt(D(a))
|
|
1312
1312
|
};
|
|
1313
1313
|
}
|
|
1314
1314
|
function ue(e) {
|
|
1315
|
-
const { args: t } = e, { abi: n, functionName: r } = e.abi.length === 1 && e.functionName?.startsWith("0x") ? e :
|
|
1315
|
+
const { args: t } = e, { abi: n, functionName: r } = e.abi.length === 1 && e.functionName?.startsWith("0x") ? e : Gr(e), a = n[0], s = r, o = "inputs" in a && a.inputs ? Qe(a.inputs, t ?? []) : void 0;
|
|
1316
1316
|
return Ze([s, o ?? "0x"]);
|
|
1317
1317
|
}
|
|
1318
|
-
const
|
|
1318
|
+
const Dr = {
|
|
1319
1319
|
1: "An `assert` condition failed.",
|
|
1320
1320
|
17: "Arithmetic operation resulted in underflow or overflow.",
|
|
1321
1321
|
18: "Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",
|
|
@@ -1325,7 +1325,7 @@ const Gr = {
|
|
|
1325
1325
|
50: "Array index is out of bounds.",
|
|
1326
1326
|
65: "Allocated too much memory or created an array which is too large.",
|
|
1327
1327
|
81: "Attempted to call a zero-initialized variable of internal function type."
|
|
1328
|
-
},
|
|
1328
|
+
}, Lr = {
|
|
1329
1329
|
inputs: [
|
|
1330
1330
|
{
|
|
1331
1331
|
name: "message",
|
|
@@ -1334,7 +1334,7 @@ const Gr = {
|
|
|
1334
1334
|
],
|
|
1335
1335
|
name: "Error",
|
|
1336
1336
|
type: "error"
|
|
1337
|
-
},
|
|
1337
|
+
}, _r = {
|
|
1338
1338
|
inputs: [
|
|
1339
1339
|
{
|
|
1340
1340
|
name: "reason",
|
|
@@ -1344,85 +1344,85 @@ const Gr = {
|
|
|
1344
1344
|
name: "Panic",
|
|
1345
1345
|
type: "error"
|
|
1346
1346
|
};
|
|
1347
|
-
function _r(e, t = {}) {
|
|
1348
|
-
typeof t.size < "u" && ge(e, { size: t.size });
|
|
1349
|
-
const n = Y(e, t);
|
|
1350
|
-
return be(n, t);
|
|
1351
|
-
}
|
|
1352
1347
|
function Hr(e, t = {}) {
|
|
1348
|
+
typeof t.size < "u" && he(e, { size: t.size });
|
|
1349
|
+
const n = J(e, t);
|
|
1350
|
+
return le(n, t);
|
|
1351
|
+
}
|
|
1352
|
+
function qr(e, t = {}) {
|
|
1353
1353
|
let n = e;
|
|
1354
|
-
if (typeof t.size < "u" && (
|
|
1355
|
-
throw new
|
|
1354
|
+
if (typeof t.size < "u" && (he(n, { size: t.size }), n = Ke(n)), n.length > 1 || n[0] > 1)
|
|
1355
|
+
throw new o0(n);
|
|
1356
1356
|
return !!n[0];
|
|
1357
1357
|
}
|
|
1358
|
-
function
|
|
1359
|
-
typeof t.size < "u" &&
|
|
1360
|
-
const n =
|
|
1361
|
-
return
|
|
1358
|
+
function z(e, t = {}) {
|
|
1359
|
+
typeof t.size < "u" && he(e, { size: t.size });
|
|
1360
|
+
const n = J(e, t);
|
|
1361
|
+
return ge(n, t);
|
|
1362
1362
|
}
|
|
1363
|
-
function
|
|
1363
|
+
function Ur(e, t = {}) {
|
|
1364
1364
|
let n = e;
|
|
1365
|
-
return typeof t.size < "u" && (
|
|
1365
|
+
return typeof t.size < "u" && (he(n, { size: t.size }), n = Ke(n, { dir: "right" })), new TextDecoder().decode(n);
|
|
1366
1366
|
}
|
|
1367
|
-
function
|
|
1368
|
-
const n = typeof t == "string" ?
|
|
1369
|
-
if (
|
|
1367
|
+
function Pe(e, t) {
|
|
1368
|
+
const n = typeof t == "string" ? ln(t) : t, r = i0(n);
|
|
1369
|
+
if (R(n) === 0 && e.length > 0)
|
|
1370
1370
|
throw new Ye();
|
|
1371
|
-
if (
|
|
1372
|
-
throw new
|
|
1373
|
-
data: typeof t == "string" ? t :
|
|
1371
|
+
if (R(t) && R(t) < 32)
|
|
1372
|
+
throw new In({
|
|
1373
|
+
data: typeof t == "string" ? t : J(t),
|
|
1374
1374
|
params: e,
|
|
1375
|
-
size:
|
|
1375
|
+
size: R(t)
|
|
1376
1376
|
});
|
|
1377
1377
|
let a = 0;
|
|
1378
1378
|
const s = [];
|
|
1379
1379
|
for (let o = 0; o < e.length; ++o) {
|
|
1380
1380
|
const i = e[o];
|
|
1381
1381
|
r.setPosition(a);
|
|
1382
|
-
const [c, u] =
|
|
1382
|
+
const [c, u] = X(r, i, {
|
|
1383
1383
|
staticPosition: 0
|
|
1384
1384
|
});
|
|
1385
1385
|
a += u, s.push(c);
|
|
1386
1386
|
}
|
|
1387
1387
|
return s;
|
|
1388
1388
|
}
|
|
1389
|
-
function
|
|
1389
|
+
function X(e, t, { staticPosition: n }) {
|
|
1390
1390
|
const r = nt(t.type);
|
|
1391
1391
|
if (r) {
|
|
1392
1392
|
const [a, s] = r;
|
|
1393
|
-
return
|
|
1393
|
+
return Wr(e, { ...t, type: s }, { length: a, staticPosition: n });
|
|
1394
1394
|
}
|
|
1395
1395
|
if (t.type === "tuple")
|
|
1396
|
-
return
|
|
1396
|
+
return Yr(e, t, { staticPosition: n });
|
|
1397
1397
|
if (t.type === "address")
|
|
1398
|
-
return
|
|
1398
|
+
return Vr(e);
|
|
1399
1399
|
if (t.type === "bool")
|
|
1400
|
-
return
|
|
1400
|
+
return Zr(e);
|
|
1401
1401
|
if (t.type.startsWith("bytes"))
|
|
1402
|
-
return
|
|
1402
|
+
return Kr(e, t, { staticPosition: n });
|
|
1403
1403
|
if (t.type.startsWith("uint") || t.type.startsWith("int"))
|
|
1404
|
-
return
|
|
1404
|
+
return Jr(e, t);
|
|
1405
1405
|
if (t.type === "string")
|
|
1406
|
-
return
|
|
1407
|
-
throw new
|
|
1406
|
+
return Xr(e, { staticPosition: n });
|
|
1407
|
+
throw new vr(t.type, {
|
|
1408
1408
|
docsPath: "/docs/contract/decodeAbiParameters"
|
|
1409
1409
|
});
|
|
1410
1410
|
}
|
|
1411
|
-
const
|
|
1412
|
-
function
|
|
1411
|
+
const Qt = 32, He = 32;
|
|
1412
|
+
function Vr(e) {
|
|
1413
1413
|
const t = e.readBytes(32);
|
|
1414
|
-
return [
|
|
1414
|
+
return [bn(J(c0(t, -20))), 32];
|
|
1415
1415
|
}
|
|
1416
|
-
function
|
|
1416
|
+
function Wr(e, t, { length: n, staticPosition: r }) {
|
|
1417
1417
|
if (!n) {
|
|
1418
|
-
const o =
|
|
1418
|
+
const o = z(e.readBytes(He)), i = r + o, c = i + Qt;
|
|
1419
1419
|
e.setPosition(i);
|
|
1420
|
-
const u =
|
|
1420
|
+
const u = z(e.readBytes(Qt)), f = oe(t);
|
|
1421
1421
|
let l = 0;
|
|
1422
1422
|
const d = [];
|
|
1423
1423
|
for (let b = 0; b < u; ++b) {
|
|
1424
1424
|
e.setPosition(c + (f ? b * 32 : l));
|
|
1425
|
-
const [m, p] =
|
|
1425
|
+
const [m, p] = X(e, t, {
|
|
1426
1426
|
staticPosition: c
|
|
1427
1427
|
});
|
|
1428
1428
|
l += p, d.push(m);
|
|
@@ -1430,10 +1430,10 @@ function Vr(e, t, { length: n, staticPosition: r }) {
|
|
|
1430
1430
|
return e.setPosition(r + 32), [d, 32];
|
|
1431
1431
|
}
|
|
1432
1432
|
if (oe(t)) {
|
|
1433
|
-
const o =
|
|
1433
|
+
const o = z(e.readBytes(He)), i = r + o, c = [];
|
|
1434
1434
|
for (let u = 0; u < n; ++u) {
|
|
1435
1435
|
e.setPosition(i + u * 32);
|
|
1436
|
-
const [f] =
|
|
1436
|
+
const [f] = X(e, t, {
|
|
1437
1437
|
staticPosition: i
|
|
1438
1438
|
});
|
|
1439
1439
|
c.push(f);
|
|
@@ -1443,45 +1443,45 @@ function Vr(e, t, { length: n, staticPosition: r }) {
|
|
|
1443
1443
|
let a = 0;
|
|
1444
1444
|
const s = [];
|
|
1445
1445
|
for (let o = 0; o < n; ++o) {
|
|
1446
|
-
const [i, c] =
|
|
1446
|
+
const [i, c] = X(e, t, {
|
|
1447
1447
|
staticPosition: r + a
|
|
1448
1448
|
});
|
|
1449
1449
|
a += c, s.push(i);
|
|
1450
1450
|
}
|
|
1451
1451
|
return [s, a];
|
|
1452
1452
|
}
|
|
1453
|
-
function
|
|
1454
|
-
return [
|
|
1453
|
+
function Zr(e) {
|
|
1454
|
+
return [qr(e.readBytes(32), { size: 32 }), 32];
|
|
1455
1455
|
}
|
|
1456
|
-
function
|
|
1456
|
+
function Kr(e, t, { staticPosition: n }) {
|
|
1457
1457
|
const [r, a] = t.type.split("bytes");
|
|
1458
1458
|
if (!a) {
|
|
1459
|
-
const o =
|
|
1459
|
+
const o = z(e.readBytes(32));
|
|
1460
1460
|
e.setPosition(n + o);
|
|
1461
|
-
const i =
|
|
1461
|
+
const i = z(e.readBytes(32));
|
|
1462
1462
|
if (i === 0)
|
|
1463
1463
|
return e.setPosition(n + 32), ["0x", 32];
|
|
1464
1464
|
const c = e.readBytes(i);
|
|
1465
|
-
return e.setPosition(n + 32), [
|
|
1465
|
+
return e.setPosition(n + 32), [J(c), 32];
|
|
1466
1466
|
}
|
|
1467
|
-
return [
|
|
1467
|
+
return [J(e.readBytes(Number.parseInt(a, 10), 32)), 32];
|
|
1468
1468
|
}
|
|
1469
|
-
function
|
|
1469
|
+
function Jr(e, t) {
|
|
1470
1470
|
const n = t.type.startsWith("int"), r = Number.parseInt(t.type.split("int")[1] || "256", 10), a = e.readBytes(32);
|
|
1471
1471
|
return [
|
|
1472
|
-
r > 48 ?
|
|
1472
|
+
r > 48 ? Hr(a, { signed: n }) : z(a, { signed: n }),
|
|
1473
1473
|
32
|
|
1474
1474
|
];
|
|
1475
1475
|
}
|
|
1476
|
-
function
|
|
1476
|
+
function Yr(e, t, { staticPosition: n }) {
|
|
1477
1477
|
const r = t.components.length === 0 || t.components.some(({ name: o }) => !o), a = r ? [] : {};
|
|
1478
1478
|
let s = 0;
|
|
1479
1479
|
if (oe(t)) {
|
|
1480
|
-
const o =
|
|
1480
|
+
const o = z(e.readBytes(He)), i = n + o;
|
|
1481
1481
|
for (let c = 0; c < t.components.length; ++c) {
|
|
1482
1482
|
const u = t.components[c];
|
|
1483
1483
|
e.setPosition(i + s);
|
|
1484
|
-
const [f, l] =
|
|
1484
|
+
const [f, l] = X(e, u, {
|
|
1485
1485
|
staticPosition: i
|
|
1486
1486
|
});
|
|
1487
1487
|
s += l, a[r ? c : u?.name] = f;
|
|
@@ -1489,20 +1489,20 @@ function Jr(e, t, { staticPosition: n }) {
|
|
|
1489
1489
|
return e.setPosition(n + 32), [a, 32];
|
|
1490
1490
|
}
|
|
1491
1491
|
for (let o = 0; o < t.components.length; ++o) {
|
|
1492
|
-
const i = t.components[o], [c, u] =
|
|
1492
|
+
const i = t.components[o], [c, u] = X(e, i, {
|
|
1493
1493
|
staticPosition: n
|
|
1494
1494
|
});
|
|
1495
1495
|
a[r ? o : i?.name] = c, s += u;
|
|
1496
1496
|
}
|
|
1497
1497
|
return [a, s];
|
|
1498
1498
|
}
|
|
1499
|
-
function
|
|
1500
|
-
const n =
|
|
1499
|
+
function Xr(e, { staticPosition: t }) {
|
|
1500
|
+
const n = z(e.readBytes(32)), r = t + n;
|
|
1501
1501
|
e.setPosition(r);
|
|
1502
|
-
const a =
|
|
1502
|
+
const a = z(e.readBytes(32));
|
|
1503
1503
|
if (a === 0)
|
|
1504
1504
|
return e.setPosition(t + 32), ["", 32];
|
|
1505
|
-
const s = e.readBytes(a, 32), o =
|
|
1505
|
+
const s = e.readBytes(a, 32), o = Ur(Ke(s));
|
|
1506
1506
|
return e.setPosition(t + 32), [o, 32];
|
|
1507
1507
|
}
|
|
1508
1508
|
function oe(e) {
|
|
@@ -1514,45 +1514,45 @@ function oe(e) {
|
|
|
1514
1514
|
const n = nt(e.type);
|
|
1515
1515
|
return !!(n && oe({ ...e, type: n[1] }));
|
|
1516
1516
|
}
|
|
1517
|
-
function
|
|
1518
|
-
const { abi: t, data: n } = e, r =
|
|
1517
|
+
function Qr(e) {
|
|
1518
|
+
const { abi: t, data: n } = e, r = de(n, 0, 4);
|
|
1519
1519
|
if (r === "0x")
|
|
1520
1520
|
throw new Ye();
|
|
1521
|
-
const s = [...t || [],
|
|
1521
|
+
const s = [...t || [], Lr, _r].find((o) => o.type === "error" && r === rt(D(o)));
|
|
1522
1522
|
if (!s)
|
|
1523
|
-
throw new
|
|
1523
|
+
throw new Bn(r, {
|
|
1524
1524
|
docsPath: "/docs/contract/decodeErrorResult"
|
|
1525
1525
|
});
|
|
1526
1526
|
return {
|
|
1527
1527
|
abiItem: s,
|
|
1528
|
-
args: "inputs" in s && s.inputs && s.inputs.length > 0 ?
|
|
1528
|
+
args: "inputs" in s && s.inputs && s.inputs.length > 0 ? Pe(s.inputs, de(n, 4)) : void 0,
|
|
1529
1529
|
errorName: s.name
|
|
1530
1530
|
};
|
|
1531
1531
|
}
|
|
1532
|
-
const
|
|
1533
|
-
function
|
|
1532
|
+
const te = (e, t, n) => JSON.stringify(e, (r, a) => typeof a == "bigint" ? a.toString() : a, n);
|
|
1533
|
+
function Rn({ abiItem: e, args: t, includeFunctionName: n = !0, includeName: r = !1 }) {
|
|
1534
1534
|
if ("name" in e && "inputs" in e && e.inputs)
|
|
1535
|
-
return `${n ? e.name : ""}(${e.inputs.map((a, s) => `${r && a.name ? `${a.name}: ` : ""}${typeof t[s] == "object" ?
|
|
1535
|
+
return `${n ? e.name : ""}(${e.inputs.map((a, s) => `${r && a.name ? `${a.name}: ` : ""}${typeof t[s] == "object" ? te(t[s]) : t[s]}`).join(", ")})`;
|
|
1536
1536
|
}
|
|
1537
|
-
class
|
|
1537
|
+
class ea extends y {
|
|
1538
1538
|
constructor({ address: t }) {
|
|
1539
1539
|
super(`State for account "${t}" is set multiple times.`, {
|
|
1540
1540
|
name: "AccountStateConflictError"
|
|
1541
1541
|
});
|
|
1542
1542
|
}
|
|
1543
1543
|
}
|
|
1544
|
-
class
|
|
1544
|
+
class ta extends y {
|
|
1545
1545
|
constructor() {
|
|
1546
1546
|
super("state and stateDiff are set on the same account.", {
|
|
1547
1547
|
name: "StateAssignmentConflictError"
|
|
1548
1548
|
});
|
|
1549
1549
|
}
|
|
1550
1550
|
}
|
|
1551
|
-
function
|
|
1551
|
+
function en(e) {
|
|
1552
1552
|
return e.reduce((t, { slot: n, value: r }) => `${t} ${n}: ${r}
|
|
1553
1553
|
`, "");
|
|
1554
1554
|
}
|
|
1555
|
-
function
|
|
1555
|
+
function na(e) {
|
|
1556
1556
|
return e.reduce((t, { address: n, ...r }) => {
|
|
1557
1557
|
let a = `${t} ${n}:
|
|
1558
1558
|
`;
|
|
@@ -1560,28 +1560,28 @@ function ta(e) {
|
|
|
1560
1560
|
`), r.balance && (a += ` balance: ${r.balance}
|
|
1561
1561
|
`), r.code && (a += ` code: ${r.code}
|
|
1562
1562
|
`), r.state && (a += ` state:
|
|
1563
|
-
`, a +=
|
|
1564
|
-
`, a +=
|
|
1563
|
+
`, a += en(r.state)), r.stateDiff && (a += ` stateDiff:
|
|
1564
|
+
`, a += en(r.stateDiff)), a;
|
|
1565
1565
|
}, ` State Override:
|
|
1566
1566
|
`).slice(0, -1);
|
|
1567
1567
|
}
|
|
1568
|
-
const
|
|
1569
|
-
class
|
|
1568
|
+
const ra = (e) => e, st = (e) => e;
|
|
1569
|
+
class aa extends y {
|
|
1570
1570
|
constructor(t, { account: n, docsPath: r, chain: a, data: s, gas: o, gasPrice: i, maxFeePerGas: c, maxPriorityFeePerGas: u, nonce: f, to: l, value: d, stateOverride: b }) {
|
|
1571
|
-
const m = n ?
|
|
1571
|
+
const m = n ? H(n) : void 0;
|
|
1572
1572
|
let p = Je({
|
|
1573
1573
|
from: m?.address,
|
|
1574
1574
|
to: l,
|
|
1575
|
-
value: typeof d < "u" && `${
|
|
1575
|
+
value: typeof d < "u" && `${pn(d)} ${a?.nativeCurrency?.symbol || "ETH"}`,
|
|
1576
1576
|
data: s,
|
|
1577
1577
|
gas: o,
|
|
1578
|
-
gasPrice: typeof i < "u" && `${
|
|
1579
|
-
maxFeePerGas: typeof c < "u" && `${
|
|
1580
|
-
maxPriorityFeePerGas: typeof u < "u" && `${
|
|
1578
|
+
gasPrice: typeof i < "u" && `${K(i)} gwei`,
|
|
1579
|
+
maxFeePerGas: typeof c < "u" && `${K(c)} gwei`,
|
|
1580
|
+
maxPriorityFeePerGas: typeof u < "u" && `${K(u)} gwei`,
|
|
1581
1581
|
nonce: f
|
|
1582
1582
|
});
|
|
1583
1583
|
b && (p += `
|
|
1584
|
-
${
|
|
1584
|
+
${na(b)}`), super(t.shortMessage, {
|
|
1585
1585
|
cause: t,
|
|
1586
1586
|
docsPath: r,
|
|
1587
1587
|
metaMessages: [
|
|
@@ -1598,15 +1598,15 @@ ${ta(b)}`), super(t.shortMessage, {
|
|
|
1598
1598
|
}), this.cause = t;
|
|
1599
1599
|
}
|
|
1600
1600
|
}
|
|
1601
|
-
class
|
|
1601
|
+
class sa extends y {
|
|
1602
1602
|
constructor(t, { abi: n, args: r, contractAddress: a, docsPath: s, functionName: o, sender: i }) {
|
|
1603
|
-
const c = ce({ abi: n, args: r, name: o }), u = c ?
|
|
1603
|
+
const c = ce({ abi: n, args: r, name: o }), u = c ? Rn({
|
|
1604
1604
|
abiItem: c,
|
|
1605
1605
|
args: r,
|
|
1606
1606
|
includeFunctionName: !1,
|
|
1607
1607
|
includeName: !1
|
|
1608
|
-
}) : void 0, f = c ?
|
|
1609
|
-
address: a &&
|
|
1608
|
+
}) : void 0, f = c ? D(c, { includeName: !0 }) : void 0, l = Je({
|
|
1609
|
+
address: a && ra(a),
|
|
1610
1610
|
function: f,
|
|
1611
1611
|
args: u && u !== "()" && `${[...Array(o?.length ?? 0).keys()].map(() => " ").join("")}${u}`,
|
|
1612
1612
|
sender: i
|
|
@@ -1658,20 +1658,20 @@ class aa extends y {
|
|
|
1658
1658
|
}), this.abi = n, this.args = r, this.cause = t, this.contractAddress = a, this.functionName = o, this.sender = i;
|
|
1659
1659
|
}
|
|
1660
1660
|
}
|
|
1661
|
-
class
|
|
1661
|
+
class oa extends y {
|
|
1662
1662
|
constructor({ abi: t, data: n, functionName: r, message: a }) {
|
|
1663
1663
|
let s, o, i, c;
|
|
1664
1664
|
if (n && n !== "0x")
|
|
1665
1665
|
try {
|
|
1666
|
-
o =
|
|
1666
|
+
o = Qr({ abi: t, data: n });
|
|
1667
1667
|
const { abiItem: f, errorName: l, args: d } = o;
|
|
1668
1668
|
if (l === "Error")
|
|
1669
1669
|
c = d[0];
|
|
1670
1670
|
else if (l === "Panic") {
|
|
1671
1671
|
const [b] = d;
|
|
1672
|
-
c =
|
|
1672
|
+
c = Dr[b];
|
|
1673
1673
|
} else {
|
|
1674
|
-
const b = f ?
|
|
1674
|
+
const b = f ? D(f, { includeName: !0 }) : void 0, m = f && d ? Rn({
|
|
1675
1675
|
abiItem: f,
|
|
1676
1676
|
args: d,
|
|
1677
1677
|
includeFunctionName: !1,
|
|
@@ -1687,7 +1687,7 @@ class sa extends y {
|
|
|
1687
1687
|
}
|
|
1688
1688
|
else a && (c = a);
|
|
1689
1689
|
let u;
|
|
1690
|
-
s instanceof
|
|
1690
|
+
s instanceof Bn && (u = s.signature, i = [
|
|
1691
1691
|
`Unable to decode signature "${u}" as it was not found on the provided ABI.`,
|
|
1692
1692
|
"Make sure you are using the correct ABI and that the error exists on it.",
|
|
1693
1693
|
`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${u}.`
|
|
@@ -1722,7 +1722,7 @@ class sa extends y {
|
|
|
1722
1722
|
}), this.data = o, this.raw = n, this.reason = c, this.signature = u;
|
|
1723
1723
|
}
|
|
1724
1724
|
}
|
|
1725
|
-
class
|
|
1725
|
+
class ia extends y {
|
|
1726
1726
|
constructor({ functionName: t }) {
|
|
1727
1727
|
super(`The contract function "${t}" returned no data ("0x").`, {
|
|
1728
1728
|
metaMessages: [
|
|
@@ -1735,7 +1735,7 @@ class oa extends y {
|
|
|
1735
1735
|
});
|
|
1736
1736
|
}
|
|
1737
1737
|
}
|
|
1738
|
-
class
|
|
1738
|
+
class ca extends y {
|
|
1739
1739
|
constructor({ factory: t }) {
|
|
1740
1740
|
super(`Deployment for counterfactual contract call failed${t ? ` for factory "${t}".` : ""}`, {
|
|
1741
1741
|
metaMessages: [
|
|
@@ -1762,7 +1762,7 @@ class kn extends y {
|
|
|
1762
1762
|
}), this.data = t;
|
|
1763
1763
|
}
|
|
1764
1764
|
}
|
|
1765
|
-
class
|
|
1765
|
+
class Ms extends y {
|
|
1766
1766
|
constructor({ body: t, cause: n, details: r, headers: a, status: s, url: o }) {
|
|
1767
1767
|
super("HTTP request failed.", {
|
|
1768
1768
|
cause: n,
|
|
@@ -1770,7 +1770,7 @@ class Fs extends y {
|
|
|
1770
1770
|
metaMessages: [
|
|
1771
1771
|
s && `Status: ${s}`,
|
|
1772
1772
|
`URL: ${st(o)}`,
|
|
1773
|
-
t && `Request body: ${
|
|
1773
|
+
t && `Request body: ${te(t)}`
|
|
1774
1774
|
].filter(Boolean),
|
|
1775
1775
|
name: "HttpRequestError"
|
|
1776
1776
|
}), Object.defineProperty(this, "body", {
|
|
@@ -1796,12 +1796,12 @@ class Fs extends y {
|
|
|
1796
1796
|
}), this.body = t, this.headers = a, this.status = s, this.url = o;
|
|
1797
1797
|
}
|
|
1798
1798
|
}
|
|
1799
|
-
class
|
|
1799
|
+
class On extends y {
|
|
1800
1800
|
constructor({ body: t, error: n, url: r }) {
|
|
1801
1801
|
super("RPC Request failed.", {
|
|
1802
1802
|
cause: n,
|
|
1803
1803
|
details: n.message,
|
|
1804
|
-
metaMessages: [`URL: ${st(r)}`, `Request body: ${
|
|
1804
|
+
metaMessages: [`URL: ${st(r)}`, `Request body: ${te(t)}`],
|
|
1805
1805
|
name: "RpcRequestError"
|
|
1806
1806
|
}), Object.defineProperty(this, "code", {
|
|
1807
1807
|
enumerable: !0,
|
|
@@ -1816,17 +1816,17 @@ class Rn extends y {
|
|
|
1816
1816
|
}), this.code = n.code, this.data = n.data;
|
|
1817
1817
|
}
|
|
1818
1818
|
}
|
|
1819
|
-
class
|
|
1819
|
+
class Fs extends y {
|
|
1820
1820
|
constructor({ body: t, url: n }) {
|
|
1821
1821
|
super("The request took too long to respond.", {
|
|
1822
1822
|
details: "The request timed out.",
|
|
1823
|
-
metaMessages: [`URL: ${st(n)}`, `Request body: ${
|
|
1823
|
+
metaMessages: [`URL: ${st(n)}`, `Request body: ${te(t)}`],
|
|
1824
1824
|
name: "TimeoutError"
|
|
1825
1825
|
});
|
|
1826
1826
|
}
|
|
1827
1827
|
}
|
|
1828
|
-
const
|
|
1829
|
-
class
|
|
1828
|
+
const ua = -1;
|
|
1829
|
+
class T extends y {
|
|
1830
1830
|
constructor(t, { code: n, docsPath: r, metaMessages: a, name: s, shortMessage: o }) {
|
|
1831
1831
|
super(o, {
|
|
1832
1832
|
cause: t,
|
|
@@ -1838,10 +1838,10 @@ class k extends y {
|
|
|
1838
1838
|
configurable: !0,
|
|
1839
1839
|
writable: !0,
|
|
1840
1840
|
value: void 0
|
|
1841
|
-
}), this.name = s || t.name, this.code = t instanceof
|
|
1841
|
+
}), this.name = s || t.name, this.code = t instanceof On ? t.code : n ?? ua;
|
|
1842
1842
|
}
|
|
1843
1843
|
}
|
|
1844
|
-
class
|
|
1844
|
+
class C extends T {
|
|
1845
1845
|
constructor(t, n) {
|
|
1846
1846
|
super(t, n), Object.defineProperty(this, "data", {
|
|
1847
1847
|
enumerable: !0,
|
|
@@ -1851,7 +1851,7 @@ class O extends k {
|
|
|
1851
1851
|
}), this.data = n.data;
|
|
1852
1852
|
}
|
|
1853
1853
|
}
|
|
1854
|
-
class ot extends
|
|
1854
|
+
class ot extends T {
|
|
1855
1855
|
constructor(t) {
|
|
1856
1856
|
super(t, {
|
|
1857
1857
|
code: ot.code,
|
|
@@ -1866,7 +1866,7 @@ Object.defineProperty(ot, "code", {
|
|
|
1866
1866
|
writable: !0,
|
|
1867
1867
|
value: -32700
|
|
1868
1868
|
});
|
|
1869
|
-
class it extends
|
|
1869
|
+
class it extends T {
|
|
1870
1870
|
constructor(t) {
|
|
1871
1871
|
super(t, {
|
|
1872
1872
|
code: it.code,
|
|
@@ -1881,7 +1881,7 @@ Object.defineProperty(it, "code", {
|
|
|
1881
1881
|
writable: !0,
|
|
1882
1882
|
value: -32600
|
|
1883
1883
|
});
|
|
1884
|
-
class ct extends
|
|
1884
|
+
class ct extends T {
|
|
1885
1885
|
constructor(t, { method: n } = {}) {
|
|
1886
1886
|
super(t, {
|
|
1887
1887
|
code: ct.code,
|
|
@@ -1896,7 +1896,7 @@ Object.defineProperty(ct, "code", {
|
|
|
1896
1896
|
writable: !0,
|
|
1897
1897
|
value: -32601
|
|
1898
1898
|
});
|
|
1899
|
-
class ut extends
|
|
1899
|
+
class ut extends T {
|
|
1900
1900
|
constructor(t) {
|
|
1901
1901
|
super(t, {
|
|
1902
1902
|
code: ut.code,
|
|
@@ -1915,25 +1915,25 @@ Object.defineProperty(ut, "code", {
|
|
|
1915
1915
|
writable: !0,
|
|
1916
1916
|
value: -32602
|
|
1917
1917
|
});
|
|
1918
|
-
class
|
|
1918
|
+
class Ee extends T {
|
|
1919
1919
|
constructor(t) {
|
|
1920
1920
|
super(t, {
|
|
1921
|
-
code:
|
|
1921
|
+
code: Ee.code,
|
|
1922
1922
|
name: "InternalRpcError",
|
|
1923
1923
|
shortMessage: "An internal error was received."
|
|
1924
1924
|
});
|
|
1925
1925
|
}
|
|
1926
1926
|
}
|
|
1927
|
-
Object.defineProperty(
|
|
1927
|
+
Object.defineProperty(Ee, "code", {
|
|
1928
1928
|
enumerable: !0,
|
|
1929
1929
|
configurable: !0,
|
|
1930
1930
|
writable: !0,
|
|
1931
1931
|
value: -32603
|
|
1932
1932
|
});
|
|
1933
|
-
class
|
|
1933
|
+
class $e extends T {
|
|
1934
1934
|
constructor(t) {
|
|
1935
1935
|
super(t, {
|
|
1936
|
-
code:
|
|
1936
|
+
code: $e.code,
|
|
1937
1937
|
name: "InvalidInputRpcError",
|
|
1938
1938
|
shortMessage: [
|
|
1939
1939
|
"Missing or invalid parameters.",
|
|
@@ -1943,13 +1943,13 @@ class Ae extends k {
|
|
|
1943
1943
|
});
|
|
1944
1944
|
}
|
|
1945
1945
|
}
|
|
1946
|
-
Object.defineProperty(
|
|
1946
|
+
Object.defineProperty($e, "code", {
|
|
1947
1947
|
enumerable: !0,
|
|
1948
1948
|
configurable: !0,
|
|
1949
1949
|
writable: !0,
|
|
1950
1950
|
value: -32e3
|
|
1951
1951
|
});
|
|
1952
|
-
class ft extends
|
|
1952
|
+
class ft extends T {
|
|
1953
1953
|
constructor(t) {
|
|
1954
1954
|
super(t, {
|
|
1955
1955
|
code: ft.code,
|
|
@@ -1969,7 +1969,7 @@ Object.defineProperty(ft, "code", {
|
|
|
1969
1969
|
writable: !0,
|
|
1970
1970
|
value: -32001
|
|
1971
1971
|
});
|
|
1972
|
-
class dt extends
|
|
1972
|
+
class dt extends T {
|
|
1973
1973
|
constructor(t) {
|
|
1974
1974
|
super(t, {
|
|
1975
1975
|
code: dt.code,
|
|
@@ -1984,7 +1984,7 @@ Object.defineProperty(dt, "code", {
|
|
|
1984
1984
|
writable: !0,
|
|
1985
1985
|
value: -32002
|
|
1986
1986
|
});
|
|
1987
|
-
class lt extends
|
|
1987
|
+
class lt extends T {
|
|
1988
1988
|
constructor(t) {
|
|
1989
1989
|
super(t, {
|
|
1990
1990
|
code: lt.code,
|
|
@@ -1999,7 +1999,7 @@ Object.defineProperty(lt, "code", {
|
|
|
1999
1999
|
writable: !0,
|
|
2000
2000
|
value: -32003
|
|
2001
2001
|
});
|
|
2002
|
-
class bt extends
|
|
2002
|
+
class bt extends T {
|
|
2003
2003
|
constructor(t, { method: n } = {}) {
|
|
2004
2004
|
super(t, {
|
|
2005
2005
|
code: bt.code,
|
|
@@ -2014,7 +2014,7 @@ Object.defineProperty(bt, "code", {
|
|
|
2014
2014
|
writable: !0,
|
|
2015
2015
|
value: -32004
|
|
2016
2016
|
});
|
|
2017
|
-
class pt extends
|
|
2017
|
+
class pt extends T {
|
|
2018
2018
|
constructor(t) {
|
|
2019
2019
|
super(t, {
|
|
2020
2020
|
code: pt.code,
|
|
@@ -2029,7 +2029,7 @@ Object.defineProperty(pt, "code", {
|
|
|
2029
2029
|
writable: !0,
|
|
2030
2030
|
value: -32005
|
|
2031
2031
|
});
|
|
2032
|
-
class yt extends
|
|
2032
|
+
class yt extends T {
|
|
2033
2033
|
constructor(t) {
|
|
2034
2034
|
super(t, {
|
|
2035
2035
|
code: yt.code,
|
|
@@ -2044,7 +2044,7 @@ Object.defineProperty(yt, "code", {
|
|
|
2044
2044
|
writable: !0,
|
|
2045
2045
|
value: -32006
|
|
2046
2046
|
});
|
|
2047
|
-
class mt extends
|
|
2047
|
+
class mt extends C {
|
|
2048
2048
|
constructor(t) {
|
|
2049
2049
|
super(t, {
|
|
2050
2050
|
code: mt.code,
|
|
@@ -2059,7 +2059,7 @@ Object.defineProperty(mt, "code", {
|
|
|
2059
2059
|
writable: !0,
|
|
2060
2060
|
value: 4001
|
|
2061
2061
|
});
|
|
2062
|
-
class ht extends
|
|
2062
|
+
class ht extends C {
|
|
2063
2063
|
constructor(t) {
|
|
2064
2064
|
super(t, {
|
|
2065
2065
|
code: ht.code,
|
|
@@ -2074,7 +2074,7 @@ Object.defineProperty(ht, "code", {
|
|
|
2074
2074
|
writable: !0,
|
|
2075
2075
|
value: 4100
|
|
2076
2076
|
});
|
|
2077
|
-
class gt extends
|
|
2077
|
+
class gt extends C {
|
|
2078
2078
|
constructor(t, { method: n } = {}) {
|
|
2079
2079
|
super(t, {
|
|
2080
2080
|
code: gt.code,
|
|
@@ -2089,7 +2089,7 @@ Object.defineProperty(gt, "code", {
|
|
|
2089
2089
|
writable: !0,
|
|
2090
2090
|
value: 4200
|
|
2091
2091
|
});
|
|
2092
|
-
class wt extends
|
|
2092
|
+
class wt extends C {
|
|
2093
2093
|
constructor(t) {
|
|
2094
2094
|
super(t, {
|
|
2095
2095
|
code: wt.code,
|
|
@@ -2104,7 +2104,7 @@ Object.defineProperty(wt, "code", {
|
|
|
2104
2104
|
writable: !0,
|
|
2105
2105
|
value: 4900
|
|
2106
2106
|
});
|
|
2107
|
-
class vt extends
|
|
2107
|
+
class vt extends C {
|
|
2108
2108
|
constructor(t) {
|
|
2109
2109
|
super(t, {
|
|
2110
2110
|
code: vt.code,
|
|
@@ -2119,7 +2119,7 @@ Object.defineProperty(vt, "code", {
|
|
|
2119
2119
|
writable: !0,
|
|
2120
2120
|
value: 4901
|
|
2121
2121
|
});
|
|
2122
|
-
class xt extends
|
|
2122
|
+
class xt extends C {
|
|
2123
2123
|
constructor(t) {
|
|
2124
2124
|
super(t, {
|
|
2125
2125
|
code: xt.code,
|
|
@@ -2134,7 +2134,7 @@ Object.defineProperty(xt, "code", {
|
|
|
2134
2134
|
writable: !0,
|
|
2135
2135
|
value: 4902
|
|
2136
2136
|
});
|
|
2137
|
-
class Pt extends
|
|
2137
|
+
class Pt extends C {
|
|
2138
2138
|
constructor(t) {
|
|
2139
2139
|
super(t, {
|
|
2140
2140
|
code: Pt.code,
|
|
@@ -2149,7 +2149,7 @@ Object.defineProperty(Pt, "code", {
|
|
|
2149
2149
|
writable: !0,
|
|
2150
2150
|
value: 5700
|
|
2151
2151
|
});
|
|
2152
|
-
class Et extends
|
|
2152
|
+
class Et extends C {
|
|
2153
2153
|
constructor(t) {
|
|
2154
2154
|
super(t, {
|
|
2155
2155
|
code: Et.code,
|
|
@@ -2164,7 +2164,7 @@ Object.defineProperty(Et, "code", {
|
|
|
2164
2164
|
writable: !0,
|
|
2165
2165
|
value: 5710
|
|
2166
2166
|
});
|
|
2167
|
-
class $t extends
|
|
2167
|
+
class $t extends C {
|
|
2168
2168
|
constructor(t) {
|
|
2169
2169
|
super(t, {
|
|
2170
2170
|
code: $t.code,
|
|
@@ -2179,7 +2179,7 @@ Object.defineProperty($t, "code", {
|
|
|
2179
2179
|
writable: !0,
|
|
2180
2180
|
value: 5720
|
|
2181
2181
|
});
|
|
2182
|
-
class At extends
|
|
2182
|
+
class At extends C {
|
|
2183
2183
|
constructor(t) {
|
|
2184
2184
|
super(t, {
|
|
2185
2185
|
code: At.code,
|
|
@@ -2194,7 +2194,7 @@ Object.defineProperty(At, "code", {
|
|
|
2194
2194
|
writable: !0,
|
|
2195
2195
|
value: 5730
|
|
2196
2196
|
});
|
|
2197
|
-
class St extends
|
|
2197
|
+
class St extends C {
|
|
2198
2198
|
constructor(t) {
|
|
2199
2199
|
super(t, {
|
|
2200
2200
|
code: St.code,
|
|
@@ -2209,37 +2209,37 @@ Object.defineProperty(St, "code", {
|
|
|
2209
2209
|
writable: !0,
|
|
2210
2210
|
value: 5740
|
|
2211
2211
|
});
|
|
2212
|
-
class
|
|
2212
|
+
class Mt extends C {
|
|
2213
2213
|
constructor(t) {
|
|
2214
2214
|
super(t, {
|
|
2215
|
-
code:
|
|
2215
|
+
code: Mt.code,
|
|
2216
2216
|
name: "AtomicReadyWalletRejectedUpgradeError",
|
|
2217
2217
|
shortMessage: "The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."
|
|
2218
2218
|
});
|
|
2219
2219
|
}
|
|
2220
2220
|
}
|
|
2221
|
-
Object.defineProperty(
|
|
2221
|
+
Object.defineProperty(Mt, "code", {
|
|
2222
2222
|
enumerable: !0,
|
|
2223
2223
|
configurable: !0,
|
|
2224
2224
|
writable: !0,
|
|
2225
2225
|
value: 5750
|
|
2226
2226
|
});
|
|
2227
|
-
class
|
|
2227
|
+
class Ft extends C {
|
|
2228
2228
|
constructor(t) {
|
|
2229
2229
|
super(t, {
|
|
2230
|
-
code:
|
|
2230
|
+
code: Ft.code,
|
|
2231
2231
|
name: "AtomicityNotSupportedError",
|
|
2232
2232
|
shortMessage: "The wallet does not support atomic execution but the request requires it."
|
|
2233
2233
|
});
|
|
2234
2234
|
}
|
|
2235
2235
|
}
|
|
2236
|
-
Object.defineProperty(
|
|
2236
|
+
Object.defineProperty(Ft, "code", {
|
|
2237
2237
|
enumerable: !0,
|
|
2238
2238
|
configurable: !0,
|
|
2239
2239
|
writable: !0,
|
|
2240
2240
|
value: 5760
|
|
2241
2241
|
});
|
|
2242
|
-
class Is extends
|
|
2242
|
+
class Is extends T {
|
|
2243
2243
|
constructor(t) {
|
|
2244
2244
|
super(t, {
|
|
2245
2245
|
name: "UnknownRpcError",
|
|
@@ -2247,15 +2247,15 @@ class Is extends k {
|
|
|
2247
2247
|
});
|
|
2248
2248
|
}
|
|
2249
2249
|
}
|
|
2250
|
-
const
|
|
2251
|
-
function
|
|
2252
|
-
const i = e instanceof kn ? e : e instanceof y ? e.walk((m) => "data" in m) || e.walk() : {}, { code: c, data: u, details: f, message: l, shortMessage: d } = i, b = e instanceof Ye ? new
|
|
2250
|
+
const fa = 3;
|
|
2251
|
+
function Ae(e, { abi: t, address: n, args: r, docsPath: a, functionName: s, sender: o }) {
|
|
2252
|
+
const i = e instanceof kn ? e : e instanceof y ? e.walk((m) => "data" in m) || e.walk() : {}, { code: c, data: u, details: f, message: l, shortMessage: d } = i, b = e instanceof Ye ? new ia({ functionName: s }) : [fa, Ee.code].includes(c) && (u || f || l || d) ? new oa({
|
|
2253
2253
|
abi: t,
|
|
2254
2254
|
data: typeof u == "object" ? u.data : u,
|
|
2255
2255
|
functionName: s,
|
|
2256
|
-
message: i instanceof
|
|
2256
|
+
message: i instanceof On ? f : d ?? l
|
|
2257
2257
|
}) : e;
|
|
2258
|
-
return new
|
|
2258
|
+
return new sa(b, {
|
|
2259
2259
|
abi: t,
|
|
2260
2260
|
args: r,
|
|
2261
2261
|
contractAddress: n,
|
|
@@ -2264,25 +2264,25 @@ function Se(e, { abi: t, address: n, args: r, docsPath: a, functionName: s, send
|
|
|
2264
2264
|
sender: o
|
|
2265
2265
|
});
|
|
2266
2266
|
}
|
|
2267
|
-
function
|
|
2267
|
+
function da(e) {
|
|
2268
2268
|
const t = ie(`0x${e.substring(4)}`).substring(26);
|
|
2269
|
-
return
|
|
2269
|
+
return bn(`0x${t}`);
|
|
2270
2270
|
}
|
|
2271
|
-
async function
|
|
2272
|
-
const n =
|
|
2271
|
+
async function la({ hash: e, signature: t }) {
|
|
2272
|
+
const n = ke(e) ? e : Nt(e), { secp256k1: r } = await import("./secp256k1-Dx1prb1E.js");
|
|
2273
2273
|
return `0x${(() => {
|
|
2274
2274
|
if (typeof t == "object" && "r" in t && "s" in t) {
|
|
2275
|
-
const { r: u, s: f, v: l, yParity: d } = t, b = Number(d ?? l), m =
|
|
2276
|
-
return new r.Signature(
|
|
2275
|
+
const { r: u, s: f, v: l, yParity: d } = t, b = Number(d ?? l), m = tn(b);
|
|
2276
|
+
return new r.Signature(le(u), le(f)).addRecoveryBit(m);
|
|
2277
2277
|
}
|
|
2278
|
-
const o =
|
|
2279
|
-
if (
|
|
2278
|
+
const o = ke(t) ? t : Nt(t);
|
|
2279
|
+
if (R(o) !== 65)
|
|
2280
2280
|
throw new Error("invalid signature length");
|
|
2281
|
-
const i =
|
|
2281
|
+
const i = ge(`0x${o.slice(130)}`), c = tn(i);
|
|
2282
2282
|
return r.Signature.fromCompact(o.substring(2, 130)).addRecoveryBit(c);
|
|
2283
2283
|
})().recoverPublicKey(n.substring(2)).toHex(!1)}`;
|
|
2284
2284
|
}
|
|
2285
|
-
function
|
|
2285
|
+
function tn(e) {
|
|
2286
2286
|
if (e === 0 || e === 1)
|
|
2287
2287
|
return e;
|
|
2288
2288
|
if (e === 27)
|
|
@@ -2291,38 +2291,38 @@ function en(e) {
|
|
|
2291
2291
|
return 1;
|
|
2292
2292
|
throw new Error("Invalid yParityOrV value");
|
|
2293
2293
|
}
|
|
2294
|
-
async function
|
|
2295
|
-
return
|
|
2294
|
+
async function ba({ hash: e, signature: t }) {
|
|
2295
|
+
return da(await la({ hash: e, signature: t }));
|
|
2296
2296
|
}
|
|
2297
|
-
function
|
|
2297
|
+
function pa(e) {
|
|
2298
2298
|
const { chainId: t, nonce: n, to: r } = e, a = e.contractAddress ?? e.address, s = ie(Ze([
|
|
2299
2299
|
"0x05",
|
|
2300
|
-
|
|
2300
|
+
u0([
|
|
2301
2301
|
t ? v(t) : "0x",
|
|
2302
2302
|
a,
|
|
2303
2303
|
n ? v(n) : "0x"
|
|
2304
2304
|
])
|
|
2305
2305
|
]));
|
|
2306
|
-
return r === "bytes" ?
|
|
2306
|
+
return r === "bytes" ? ln(s) : s;
|
|
2307
2307
|
}
|
|
2308
|
-
async function
|
|
2308
|
+
async function Nn(e) {
|
|
2309
2309
|
const { authorization: t, signature: n } = e;
|
|
2310
|
-
return
|
|
2311
|
-
hash:
|
|
2310
|
+
return ba({
|
|
2311
|
+
hash: pa(t),
|
|
2312
2312
|
signature: n ?? t
|
|
2313
2313
|
});
|
|
2314
2314
|
}
|
|
2315
|
-
class
|
|
2315
|
+
class ya extends y {
|
|
2316
2316
|
constructor(t, { account: n, docsPath: r, chain: a, data: s, gas: o, gasPrice: i, maxFeePerGas: c, maxPriorityFeePerGas: u, nonce: f, to: l, value: d }) {
|
|
2317
2317
|
const b = Je({
|
|
2318
2318
|
from: n?.address,
|
|
2319
2319
|
to: l,
|
|
2320
|
-
value: typeof d < "u" && `${
|
|
2320
|
+
value: typeof d < "u" && `${pn(d)} ${a?.nativeCurrency?.symbol || "ETH"}`,
|
|
2321
2321
|
data: s,
|
|
2322
2322
|
gas: o,
|
|
2323
|
-
gasPrice: typeof i < "u" && `${
|
|
2324
|
-
maxFeePerGas: typeof c < "u" && `${
|
|
2325
|
-
maxPriorityFeePerGas: typeof u < "u" && `${
|
|
2323
|
+
gasPrice: typeof i < "u" && `${K(i)} gwei`,
|
|
2324
|
+
maxFeePerGas: typeof c < "u" && `${K(c)} gwei`,
|
|
2325
|
+
maxPriorityFeePerGas: typeof u < "u" && `${K(u)} gwei`,
|
|
2326
2326
|
nonce: f
|
|
2327
2327
|
});
|
|
2328
2328
|
super(t.shortMessage, {
|
|
@@ -2343,33 +2343,33 @@ class pa extends y {
|
|
|
2343
2343
|
}
|
|
2344
2344
|
}
|
|
2345
2345
|
function It(e, t) {
|
|
2346
|
-
const n = (e.details || "").toLowerCase(), r = e instanceof y ? e.walk((a) => a?.code ===
|
|
2347
|
-
return r instanceof y ? new
|
|
2346
|
+
const n = (e.details || "").toLowerCase(), r = e instanceof y ? e.walk((a) => a?.code === fe.code) : e;
|
|
2347
|
+
return r instanceof y ? new fe({
|
|
2348
2348
|
cause: e,
|
|
2349
2349
|
message: r.details
|
|
2350
|
-
}) :
|
|
2350
|
+
}) : fe.nodeMessage.test(n) ? new fe({
|
|
2351
2351
|
cause: e,
|
|
2352
2352
|
message: e.details
|
|
2353
|
-
}) :
|
|
2353
|
+
}) : Oe.nodeMessage.test(n) ? new Oe({
|
|
2354
2354
|
cause: e,
|
|
2355
2355
|
maxFeePerGas: t?.maxFeePerGas
|
|
2356
|
-
}) :
|
|
2356
|
+
}) : zt.nodeMessage.test(n) ? new zt({
|
|
2357
2357
|
cause: e,
|
|
2358
2358
|
maxFeePerGas: t?.maxFeePerGas
|
|
2359
|
-
}) :
|
|
2359
|
+
}) : Gt.nodeMessage.test(n) ? new Gt({ cause: e, nonce: t?.nonce }) : Dt.nodeMessage.test(n) ? new Dt({ cause: e, nonce: t?.nonce }) : Lt.nodeMessage.test(n) ? new Lt({ cause: e, nonce: t?.nonce }) : _t.nodeMessage.test(n) ? new _t({ cause: e }) : Ht.nodeMessage.test(n) ? new Ht({ cause: e, gas: t?.gas }) : qt.nodeMessage.test(n) ? new qt({ cause: e, gas: t?.gas }) : Ut.nodeMessage.test(n) ? new Ut({ cause: e }) : Ne.nodeMessage.test(n) ? new Ne({
|
|
2360
2360
|
cause: e,
|
|
2361
2361
|
maxFeePerGas: t?.maxFeePerGas,
|
|
2362
2362
|
maxPriorityFeePerGas: t?.maxPriorityFeePerGas
|
|
2363
|
-
}) : new
|
|
2363
|
+
}) : new we({
|
|
2364
2364
|
cause: e
|
|
2365
2365
|
});
|
|
2366
2366
|
}
|
|
2367
|
-
function
|
|
2367
|
+
function ma(e, { docsPath: t, ...n }) {
|
|
2368
2368
|
const r = (() => {
|
|
2369
2369
|
const a = It(e, n);
|
|
2370
|
-
return a instanceof
|
|
2370
|
+
return a instanceof we ? e : a;
|
|
2371
2371
|
})();
|
|
2372
|
-
return new
|
|
2372
|
+
return new ya(r, {
|
|
2373
2373
|
docsPath: t,
|
|
2374
2374
|
...n
|
|
2375
2375
|
});
|
|
@@ -2386,18 +2386,18 @@ function Bt(e, { format: t }) {
|
|
|
2386
2386
|
const a = t(e || {});
|
|
2387
2387
|
return r(a), n;
|
|
2388
2388
|
}
|
|
2389
|
-
const
|
|
2389
|
+
const ha = {
|
|
2390
2390
|
legacy: "0x0",
|
|
2391
2391
|
eip2930: "0x1",
|
|
2392
2392
|
eip1559: "0x2",
|
|
2393
2393
|
eip4844: "0x3",
|
|
2394
2394
|
eip7702: "0x4"
|
|
2395
2395
|
};
|
|
2396
|
-
function Tt(e) {
|
|
2397
|
-
const
|
|
2398
|
-
return typeof e.authorizationList < "u" && (
|
|
2396
|
+
function Tt(e, t) {
|
|
2397
|
+
const n = {};
|
|
2398
|
+
return typeof e.authorizationList < "u" && (n.authorizationList = ga(e.authorizationList)), typeof e.accessList < "u" && (n.accessList = e.accessList), typeof e.blobVersionedHashes < "u" && (n.blobVersionedHashes = e.blobVersionedHashes), typeof e.blobs < "u" && (typeof e.blobs[0] != "string" ? n.blobs = e.blobs.map((r) => J(r)) : n.blobs = e.blobs), typeof e.data < "u" && (n.data = e.data), e.account && (n.from = e.account.address), typeof e.from < "u" && (n.from = e.from), typeof e.gas < "u" && (n.gas = v(e.gas)), typeof e.gasPrice < "u" && (n.gasPrice = v(e.gasPrice)), typeof e.maxFeePerBlobGas < "u" && (n.maxFeePerBlobGas = v(e.maxFeePerBlobGas)), typeof e.maxFeePerGas < "u" && (n.maxFeePerGas = v(e.maxFeePerGas)), typeof e.maxPriorityFeePerGas < "u" && (n.maxPriorityFeePerGas = v(e.maxPriorityFeePerGas)), typeof e.nonce < "u" && (n.nonce = v(e.nonce)), typeof e.to < "u" && (n.to = e.to), typeof e.type < "u" && (n.type = ha[e.type]), typeof e.value < "u" && (n.value = v(e.value)), n;
|
|
2399
2399
|
}
|
|
2400
|
-
function
|
|
2400
|
+
function ga(e) {
|
|
2401
2401
|
return e.map((t) => ({
|
|
2402
2402
|
address: t.address,
|
|
2403
2403
|
r: t.r ? v(BigInt(t.r)) : t.r,
|
|
@@ -2408,17 +2408,17 @@ function ha(e) {
|
|
|
2408
2408
|
...typeof t.v < "u" && typeof t.yParity > "u" ? { v: v(t.v) } : {}
|
|
2409
2409
|
}));
|
|
2410
2410
|
}
|
|
2411
|
-
function
|
|
2411
|
+
function nn(e) {
|
|
2412
2412
|
if (!(!e || e.length === 0))
|
|
2413
2413
|
return e.reduce((t, { slot: n, value: r }) => {
|
|
2414
2414
|
if (n.length !== 66)
|
|
2415
|
-
throw new
|
|
2415
|
+
throw new Vt({
|
|
2416
2416
|
size: n.length,
|
|
2417
2417
|
targetSize: 66,
|
|
2418
2418
|
type: "hex"
|
|
2419
2419
|
});
|
|
2420
2420
|
if (r.length !== 66)
|
|
2421
|
-
throw new
|
|
2421
|
+
throw new Vt({
|
|
2422
2422
|
size: r.length,
|
|
2423
2423
|
targetSize: 66,
|
|
2424
2424
|
type: "hex"
|
|
@@ -2426,67 +2426,67 @@ function tn(e) {
|
|
|
2426
2426
|
return t[n] = r, t;
|
|
2427
2427
|
}, {});
|
|
2428
2428
|
}
|
|
2429
|
-
function
|
|
2429
|
+
function wa(e) {
|
|
2430
2430
|
const { balance: t, nonce: n, state: r, stateDiff: a, code: s } = e, o = {};
|
|
2431
|
-
if (s !== void 0 && (o.code = s), t !== void 0 && (o.balance = v(t)), n !== void 0 && (o.nonce = v(n)), r !== void 0 && (o.state =
|
|
2431
|
+
if (s !== void 0 && (o.code = s), t !== void 0 && (o.balance = v(t)), n !== void 0 && (o.nonce = v(n)), r !== void 0 && (o.state = nn(r)), a !== void 0) {
|
|
2432
2432
|
if (o.state)
|
|
2433
|
-
throw new
|
|
2434
|
-
o.stateDiff =
|
|
2433
|
+
throw new ta();
|
|
2434
|
+
o.stateDiff = nn(a);
|
|
2435
2435
|
}
|
|
2436
2436
|
return o;
|
|
2437
2437
|
}
|
|
2438
|
-
function
|
|
2438
|
+
function zn(e) {
|
|
2439
2439
|
if (!e)
|
|
2440
2440
|
return;
|
|
2441
2441
|
const t = {};
|
|
2442
2442
|
for (const { address: n, ...r } of e) {
|
|
2443
|
-
if (!
|
|
2444
|
-
throw new
|
|
2443
|
+
if (!G(n, { strict: !1 }))
|
|
2444
|
+
throw new ee({ address: n });
|
|
2445
2445
|
if (t[n])
|
|
2446
|
-
throw new
|
|
2447
|
-
t[n] =
|
|
2446
|
+
throw new ea({ address: n });
|
|
2447
|
+
t[n] = wa(r);
|
|
2448
2448
|
}
|
|
2449
2449
|
return t;
|
|
2450
2450
|
}
|
|
2451
|
-
function
|
|
2452
|
-
const { account: t, gasPrice: n, maxFeePerGas: r, maxPriorityFeePerGas: a, to: s } = e, o = t ?
|
|
2453
|
-
if (o && !
|
|
2454
|
-
throw new
|
|
2455
|
-
if (s && !
|
|
2456
|
-
throw new
|
|
2451
|
+
function Se(e) {
|
|
2452
|
+
const { account: t, gasPrice: n, maxFeePerGas: r, maxPriorityFeePerGas: a, to: s } = e, o = t ? H(t) : void 0;
|
|
2453
|
+
if (o && !G(o.address))
|
|
2454
|
+
throw new ee({ address: o.address });
|
|
2455
|
+
if (s && !G(s))
|
|
2456
|
+
throw new ee({ address: s });
|
|
2457
2457
|
if (typeof n < "u" && (typeof r < "u" || typeof a < "u"))
|
|
2458
|
-
throw new
|
|
2459
|
-
if (r && r >
|
|
2460
|
-
throw new
|
|
2458
|
+
throw new f0();
|
|
2459
|
+
if (r && r > d0)
|
|
2460
|
+
throw new Oe({ maxFeePerGas: r });
|
|
2461
2461
|
if (a && r && a > r)
|
|
2462
|
-
throw new
|
|
2462
|
+
throw new Ne({ maxFeePerGas: r, maxPriorityFeePerGas: a });
|
|
2463
2463
|
}
|
|
2464
|
-
class
|
|
2464
|
+
class va extends y {
|
|
2465
2465
|
constructor() {
|
|
2466
2466
|
super("`baseFeeMultiplier` must be greater than 1.", {
|
|
2467
2467
|
name: "BaseFeeScalarError"
|
|
2468
2468
|
});
|
|
2469
2469
|
}
|
|
2470
2470
|
}
|
|
2471
|
-
class
|
|
2471
|
+
class Ct extends y {
|
|
2472
2472
|
constructor() {
|
|
2473
2473
|
super("Chain does not support EIP-1559 fees.", {
|
|
2474
2474
|
name: "Eip1559FeesNotSupportedError"
|
|
2475
2475
|
});
|
|
2476
2476
|
}
|
|
2477
2477
|
}
|
|
2478
|
-
class
|
|
2478
|
+
class xa extends y {
|
|
2479
2479
|
constructor({ maxPriorityFeePerGas: t }) {
|
|
2480
|
-
super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${
|
|
2480
|
+
super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${K(t)} gwei).`, { name: "MaxFeePerGasTooLowError" });
|
|
2481
2481
|
}
|
|
2482
2482
|
}
|
|
2483
|
-
class
|
|
2483
|
+
class Pa extends y {
|
|
2484
2484
|
constructor({ blockHash: t, blockNumber: n }) {
|
|
2485
2485
|
let r = "Block";
|
|
2486
2486
|
t && (r = `Block at hash "${t}"`), n && (r = `Block at number "${n}"`), super(`${r} could not be found.`, { name: "BlockNotFoundError" });
|
|
2487
2487
|
}
|
|
2488
2488
|
}
|
|
2489
|
-
async function
|
|
2489
|
+
async function me(e, { blockHash: t, blockNumber: n, blockTag: r = e.experimental_blockTag ?? "latest", includeTransactions: a } = {}) {
|
|
2490
2490
|
const s = a ?? !1, o = n !== void 0 ? v(n) : void 0;
|
|
2491
2491
|
let i = null;
|
|
2492
2492
|
if (t ? i = await e.request({
|
|
@@ -2496,24 +2496,24 @@ async function he(e, { blockHash: t, blockNumber: n, blockTag: r = e.experimenta
|
|
|
2496
2496
|
method: "eth_getBlockByNumber",
|
|
2497
2497
|
params: [o || r, s]
|
|
2498
2498
|
}, { dedupe: !!o }), !i)
|
|
2499
|
-
throw new
|
|
2500
|
-
return (e.chain?.formatters?.block?.format ||
|
|
2499
|
+
throw new Pa({ blockHash: t, blockNumber: n });
|
|
2500
|
+
return (e.chain?.formatters?.block?.format || l0)(i, "getBlock");
|
|
2501
2501
|
}
|
|
2502
|
-
async function
|
|
2502
|
+
async function Gn(e) {
|
|
2503
2503
|
const t = await e.request({
|
|
2504
2504
|
method: "eth_gasPrice"
|
|
2505
2505
|
});
|
|
2506
2506
|
return BigInt(t);
|
|
2507
2507
|
}
|
|
2508
2508
|
async function Bs(e, t) {
|
|
2509
|
-
return
|
|
2509
|
+
return Dn(e, t);
|
|
2510
2510
|
}
|
|
2511
|
-
async function
|
|
2511
|
+
async function Dn(e, t) {
|
|
2512
2512
|
const { block: n, chain: r = e.chain, request: a } = t || {};
|
|
2513
2513
|
try {
|
|
2514
2514
|
const s = r?.fees?.maxPriorityFeePerGas ?? r?.fees?.defaultPriorityFee;
|
|
2515
2515
|
if (typeof s == "function") {
|
|
2516
|
-
const i = n || await E(e,
|
|
2516
|
+
const i = n || await E(e, me, "getBlock")({}), c = await s({
|
|
2517
2517
|
block: i,
|
|
2518
2518
|
client: e,
|
|
2519
2519
|
request: a
|
|
@@ -2527,30 +2527,30 @@ async function Gn(e, t) {
|
|
|
2527
2527
|
const o = await e.request({
|
|
2528
2528
|
method: "eth_maxPriorityFeePerGas"
|
|
2529
2529
|
});
|
|
2530
|
-
return
|
|
2530
|
+
return le(o);
|
|
2531
2531
|
} catch {
|
|
2532
2532
|
const [s, o] = await Promise.all([
|
|
2533
|
-
n ? Promise.resolve(n) : E(e,
|
|
2534
|
-
E(e,
|
|
2533
|
+
n ? Promise.resolve(n) : E(e, me, "getBlock")({}),
|
|
2534
|
+
E(e, Gn, "getGasPrice")({})
|
|
2535
2535
|
]);
|
|
2536
2536
|
if (typeof s.baseFeePerGas != "bigint")
|
|
2537
|
-
throw new
|
|
2537
|
+
throw new Ct();
|
|
2538
2538
|
const i = o - s.baseFeePerGas;
|
|
2539
2539
|
return i < 0n ? 0n : i;
|
|
2540
2540
|
}
|
|
2541
2541
|
}
|
|
2542
2542
|
async function Ts(e, t) {
|
|
2543
|
-
return
|
|
2543
|
+
return qe(e, t);
|
|
2544
2544
|
}
|
|
2545
|
-
async function
|
|
2545
|
+
async function qe(e, t) {
|
|
2546
2546
|
const { block: n, chain: r = e.chain, request: a, type: s = "eip1559" } = t || {}, o = await (async () => typeof r?.fees?.baseFeeMultiplier == "function" ? r.fees.baseFeeMultiplier({
|
|
2547
2547
|
block: n,
|
|
2548
2548
|
client: e,
|
|
2549
2549
|
request: a
|
|
2550
2550
|
}) : r?.fees?.baseFeeMultiplier ?? 1.2)();
|
|
2551
2551
|
if (o < 1)
|
|
2552
|
-
throw new
|
|
2553
|
-
const c = 10 ** (o.toString().split(".")[1]?.length ?? 0), u = (d) => d * BigInt(Math.ceil(o * c)) / BigInt(c), f = n || await E(e,
|
|
2552
|
+
throw new va();
|
|
2553
|
+
const c = 10 ** (o.toString().split(".")[1]?.length ?? 0), u = (d) => d * BigInt(Math.ceil(o * c)) / BigInt(c), f = n || await E(e, me, "getBlock")({});
|
|
2554
2554
|
if (typeof r?.fees?.estimateFeesPerGas == "function") {
|
|
2555
2555
|
const d = await r.fees.estimateFeesPerGas({
|
|
2556
2556
|
block: n,
|
|
@@ -2564,8 +2564,8 @@ async function Ue(e, t) {
|
|
|
2564
2564
|
}
|
|
2565
2565
|
if (s === "eip1559") {
|
|
2566
2566
|
if (typeof f.baseFeePerGas != "bigint")
|
|
2567
|
-
throw new
|
|
2568
|
-
const d = typeof a?.maxPriorityFeePerGas == "bigint" ? a.maxPriorityFeePerGas : await
|
|
2567
|
+
throw new Ct();
|
|
2568
|
+
const d = typeof a?.maxPriorityFeePerGas == "bigint" ? a.maxPriorityFeePerGas : await Dn(e, {
|
|
2569
2569
|
block: f,
|
|
2570
2570
|
chain: r,
|
|
2571
2571
|
request: a
|
|
@@ -2576,10 +2576,10 @@ async function Ue(e, t) {
|
|
|
2576
2576
|
};
|
|
2577
2577
|
}
|
|
2578
2578
|
return {
|
|
2579
|
-
gasPrice: a?.gasPrice ?? u(await E(e,
|
|
2579
|
+
gasPrice: a?.gasPrice ?? u(await E(e, Gn, "getGasPrice")({}))
|
|
2580
2580
|
};
|
|
2581
2581
|
}
|
|
2582
|
-
async function
|
|
2582
|
+
async function Ea(e, { address: t, blockTag: n = "latest", blockNumber: r }) {
|
|
2583
2583
|
const a = await e.request({
|
|
2584
2584
|
method: "eth_getTransactionCount",
|
|
2585
2585
|
params: [
|
|
@@ -2589,31 +2589,31 @@ async function Pa(e, { address: t, blockTag: n = "latest", blockNumber: r }) {
|
|
|
2589
2589
|
}, {
|
|
2590
2590
|
dedupe: !!r
|
|
2591
2591
|
});
|
|
2592
|
-
return
|
|
2592
|
+
return ge(a);
|
|
2593
2593
|
}
|
|
2594
|
-
async function
|
|
2594
|
+
async function Ln(e) {
|
|
2595
2595
|
const t = await e.request({
|
|
2596
2596
|
method: "eth_chainId"
|
|
2597
2597
|
}, { dedupe: !0 });
|
|
2598
|
-
return
|
|
2598
|
+
return ge(t);
|
|
2599
2599
|
}
|
|
2600
|
-
const
|
|
2600
|
+
const _n = [
|
|
2601
2601
|
"blobVersionedHashes",
|
|
2602
2602
|
"chainId",
|
|
2603
2603
|
"fees",
|
|
2604
2604
|
"gas",
|
|
2605
2605
|
"nonce",
|
|
2606
2606
|
"type"
|
|
2607
|
-
],
|
|
2608
|
-
async function
|
|
2609
|
-
const { account: n = e.account, blobs: r, chain: a, gas: s, kzg: o, nonce: i, nonceManager: c, parameters: u =
|
|
2607
|
+
], rn = /* @__PURE__ */ new Map();
|
|
2608
|
+
async function Hn(e, t) {
|
|
2609
|
+
const { account: n = e.account, blobs: r, chain: a, gas: s, kzg: o, nonce: i, nonceManager: c, parameters: u = _n, type: f } = t, l = n && H(n), d = { ...t, ...l ? { from: l?.address } : {} };
|
|
2610
2610
|
let b;
|
|
2611
2611
|
async function m() {
|
|
2612
|
-
return b || (b = await E(e,
|
|
2612
|
+
return b || (b = await E(e, me, "getBlock")({ blockTag: "latest" }), b);
|
|
2613
2613
|
}
|
|
2614
2614
|
let p;
|
|
2615
2615
|
async function g() {
|
|
2616
|
-
return p || (a ? a.id : typeof t.chainId < "u" ? t.chainId : (p = await E(e,
|
|
2616
|
+
return p || (a ? a.id : typeof t.chainId < "u" ? t.chainId : (p = await E(e, Ln, "getChainId")({}), p));
|
|
2617
2617
|
}
|
|
2618
2618
|
if (u.includes("nonce") && typeof i > "u" && l)
|
|
2619
2619
|
if (c) {
|
|
@@ -2624,21 +2624,21 @@ async function _n(e, t) {
|
|
|
2624
2624
|
client: e
|
|
2625
2625
|
});
|
|
2626
2626
|
} else
|
|
2627
|
-
d.nonce = await E(e,
|
|
2627
|
+
d.nonce = await E(e, Ea, "getTransactionCount")({
|
|
2628
2628
|
address: l.address,
|
|
2629
2629
|
blockTag: "pending"
|
|
2630
2630
|
});
|
|
2631
2631
|
if ((u.includes("blobVersionedHashes") || u.includes("sidecars")) && r && o) {
|
|
2632
|
-
const h =
|
|
2632
|
+
const h = b0({ blobs: r, kzg: o });
|
|
2633
2633
|
if (u.includes("blobVersionedHashes")) {
|
|
2634
|
-
const w =
|
|
2634
|
+
const w = p0({
|
|
2635
2635
|
commitments: h,
|
|
2636
2636
|
to: "hex"
|
|
2637
2637
|
});
|
|
2638
2638
|
d.blobVersionedHashes = w;
|
|
2639
2639
|
}
|
|
2640
2640
|
if (u.includes("sidecars")) {
|
|
2641
|
-
const w =
|
|
2641
|
+
const w = y0({ blobs: r, commitments: h, kzg: o }), x = m0({
|
|
2642
2642
|
blobs: r,
|
|
2643
2643
|
commitments: h,
|
|
2644
2644
|
proofs: w,
|
|
@@ -2649,30 +2649,30 @@ async function _n(e, t) {
|
|
|
2649
2649
|
}
|
|
2650
2650
|
if (u.includes("chainId") && (d.chainId = await g()), (u.includes("fees") || u.includes("type")) && typeof f > "u")
|
|
2651
2651
|
try {
|
|
2652
|
-
d.type =
|
|
2652
|
+
d.type = h0(d);
|
|
2653
2653
|
} catch {
|
|
2654
|
-
let h =
|
|
2655
|
-
typeof h > "u" && (h = typeof (await m())?.baseFeePerGas == "bigint",
|
|
2654
|
+
let h = rn.get(e.uid);
|
|
2655
|
+
typeof h > "u" && (h = typeof (await m())?.baseFeePerGas == "bigint", rn.set(e.uid, h)), d.type = h ? "eip1559" : "legacy";
|
|
2656
2656
|
}
|
|
2657
2657
|
if (u.includes("fees"))
|
|
2658
2658
|
if (d.type !== "legacy" && d.type !== "eip2930") {
|
|
2659
2659
|
if (typeof d.maxFeePerGas > "u" || typeof d.maxPriorityFeePerGas > "u") {
|
|
2660
|
-
const h = await m(), { maxFeePerGas: w, maxPriorityFeePerGas: x } = await
|
|
2660
|
+
const h = await m(), { maxFeePerGas: w, maxPriorityFeePerGas: x } = await qe(e, {
|
|
2661
2661
|
block: h,
|
|
2662
2662
|
chain: a,
|
|
2663
2663
|
request: d
|
|
2664
2664
|
});
|
|
2665
2665
|
if (typeof t.maxPriorityFeePerGas > "u" && t.maxFeePerGas && t.maxFeePerGas < x)
|
|
2666
|
-
throw new
|
|
2666
|
+
throw new xa({
|
|
2667
2667
|
maxPriorityFeePerGas: x
|
|
2668
2668
|
});
|
|
2669
2669
|
d.maxPriorityFeePerGas = x, d.maxFeePerGas = w;
|
|
2670
2670
|
}
|
|
2671
2671
|
} else {
|
|
2672
2672
|
if (typeof t.maxFeePerGas < "u" || typeof t.maxPriorityFeePerGas < "u")
|
|
2673
|
-
throw new
|
|
2673
|
+
throw new Ct();
|
|
2674
2674
|
if (typeof t.gasPrice > "u") {
|
|
2675
|
-
const h = await m(), { gasPrice: w } = await
|
|
2675
|
+
const h = await m(), { gasPrice: w } = await qe(e, {
|
|
2676
2676
|
block: h,
|
|
2677
2677
|
chain: a,
|
|
2678
2678
|
request: d,
|
|
@@ -2681,110 +2681,83 @@ async function _n(e, t) {
|
|
|
2681
2681
|
d.gasPrice = w;
|
|
2682
2682
|
}
|
|
2683
2683
|
}
|
|
2684
|
-
return u.includes("gas") && typeof s > "u" && (d.gas = await E(e,
|
|
2684
|
+
return u.includes("gas") && typeof s > "u" && (d.gas = await E(e, qn, "estimateGas")({
|
|
2685
2685
|
...d,
|
|
2686
|
-
account: l
|
|
2687
|
-
|
|
2688
|
-
}
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
const { account: n = e.account } = t, r = n ? W(n) : void 0;
|
|
2686
|
+
account: l,
|
|
2687
|
+
prepare: l?.type === "local" ? [] : ["blobVersionedHashes"]
|
|
2688
|
+
})), Se(d), delete d.parameters, d;
|
|
2689
|
+
}
|
|
2690
|
+
async function qn(e, t) {
|
|
2691
|
+
const { account: n = e.account, prepare: r = !0 } = t, a = n ? H(n) : void 0, s = (() => {
|
|
2692
|
+
if (Array.isArray(r))
|
|
2693
|
+
return r;
|
|
2694
|
+
if (a?.type !== "local")
|
|
2695
|
+
return ["blobVersionedHashes"];
|
|
2696
|
+
})();
|
|
2698
2697
|
try {
|
|
2699
|
-
|
|
2700
|
-
const { block: T, request: M, rpcStateOverride: j } = D;
|
|
2701
|
-
return e.request({
|
|
2702
|
-
method: "eth_estimateGas",
|
|
2703
|
-
params: j ? [
|
|
2704
|
-
M,
|
|
2705
|
-
T ?? e.experimental_blockTag ?? "latest",
|
|
2706
|
-
j
|
|
2707
|
-
] : T ? [M, T] : [M]
|
|
2708
|
-
});
|
|
2709
|
-
};
|
|
2710
|
-
const { accessList: a, authorizationList: s, blobs: o, blobVersionedHashes: i, blockNumber: c, blockTag: u, data: f, gas: l, gasPrice: d, maxFeePerBlobGas: b, maxFeePerGas: m, maxPriorityFeePerGas: p, nonce: g, value: h, stateOverride: w, ...x } = await _n(e, {
|
|
2698
|
+
const { accessList: o, authorizationList: i, blobs: c, blobVersionedHashes: u, blockNumber: f, blockTag: l, data: d, gas: b, gasPrice: m, maxFeePerBlobGas: p, maxFeePerGas: g, maxPriorityFeePerGas: h, nonce: w, value: x, stateOverride: P, ...M } = r ? await Hn(e, {
|
|
2711
2699
|
...t,
|
|
2712
|
-
parameters:
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
)
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
return x.to;
|
|
2720
|
-
if (s && s.length > 0)
|
|
2721
|
-
return await On({
|
|
2722
|
-
authorization: s[0]
|
|
2700
|
+
parameters: s
|
|
2701
|
+
}) : t, $ = (typeof f == "bigint" ? v(f) : void 0) || l, A = zn(P), F = await (async () => {
|
|
2702
|
+
if (M.to)
|
|
2703
|
+
return M.to;
|
|
2704
|
+
if (i && i.length > 0)
|
|
2705
|
+
return await Nn({
|
|
2706
|
+
authorization: i[0]
|
|
2723
2707
|
}).catch(() => {
|
|
2724
2708
|
throw new y("`to` is required. Could not infer from `authorizationList`");
|
|
2725
2709
|
});
|
|
2726
2710
|
})();
|
|
2727
|
-
|
|
2728
|
-
const
|
|
2711
|
+
Se(t);
|
|
2712
|
+
const S = e.chain?.formatters?.transactionRequest?.format, I = (S || Tt)({
|
|
2729
2713
|
// Pick out extra data that might exist on the chain's transaction request type.
|
|
2730
|
-
...Bt(
|
|
2731
|
-
|
|
2732
|
-
accessList:
|
|
2733
|
-
authorizationList:
|
|
2734
|
-
blobs:
|
|
2735
|
-
blobVersionedHashes:
|
|
2736
|
-
data:
|
|
2737
|
-
gas:
|
|
2738
|
-
gasPrice:
|
|
2739
|
-
maxFeePerBlobGas:
|
|
2740
|
-
maxFeePerGas:
|
|
2741
|
-
maxPriorityFeePerGas:
|
|
2742
|
-
nonce:
|
|
2743
|
-
to:
|
|
2744
|
-
value:
|
|
2745
|
-
});
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
value: v(D)
|
|
2757
|
-
},
|
|
2758
|
-
rpcStateOverride: z
|
|
2759
|
-
}).catch(() => 100000n);
|
|
2760
|
-
return 2n * BigInt(fe);
|
|
2761
|
-
}));
|
|
2762
|
-
R += T.reduce((M, j) => M + j, 0n);
|
|
2763
|
-
}
|
|
2764
|
-
return R;
|
|
2765
|
-
} catch (a) {
|
|
2766
|
-
throw ya(a, {
|
|
2714
|
+
...Bt(M, { format: S }),
|
|
2715
|
+
account: a,
|
|
2716
|
+
accessList: o,
|
|
2717
|
+
authorizationList: i,
|
|
2718
|
+
blobs: c,
|
|
2719
|
+
blobVersionedHashes: u,
|
|
2720
|
+
data: d,
|
|
2721
|
+
gas: b,
|
|
2722
|
+
gasPrice: m,
|
|
2723
|
+
maxFeePerBlobGas: p,
|
|
2724
|
+
maxFeePerGas: g,
|
|
2725
|
+
maxPriorityFeePerGas: h,
|
|
2726
|
+
nonce: w,
|
|
2727
|
+
to: F,
|
|
2728
|
+
value: x
|
|
2729
|
+
}, "estimateGas");
|
|
2730
|
+
return BigInt(await e.request({
|
|
2731
|
+
method: "eth_estimateGas",
|
|
2732
|
+
params: A ? [
|
|
2733
|
+
I,
|
|
2734
|
+
$ ?? e.experimental_blockTag ?? "latest",
|
|
2735
|
+
A
|
|
2736
|
+
] : $ ? [I, $] : [I]
|
|
2737
|
+
}));
|
|
2738
|
+
} catch (o) {
|
|
2739
|
+
throw ma(o, {
|
|
2767
2740
|
...t,
|
|
2768
|
-
account:
|
|
2741
|
+
account: a,
|
|
2769
2742
|
chain: e.chain
|
|
2770
2743
|
});
|
|
2771
2744
|
}
|
|
2772
2745
|
}
|
|
2773
|
-
async function
|
|
2746
|
+
async function Cs(e, t) {
|
|
2774
2747
|
const { abi: n, address: r, args: a, functionName: s, dataSuffix: o, ...i } = t, c = ue({
|
|
2775
2748
|
abi: n,
|
|
2776
2749
|
args: a,
|
|
2777
2750
|
functionName: s
|
|
2778
2751
|
});
|
|
2779
2752
|
try {
|
|
2780
|
-
return await E(e,
|
|
2753
|
+
return await E(e, qn, "estimateGas")({
|
|
2781
2754
|
data: `${c}${o ? o.replace("0x", "") : ""}`,
|
|
2782
2755
|
to: r,
|
|
2783
2756
|
...i
|
|
2784
2757
|
});
|
|
2785
2758
|
} catch (u) {
|
|
2786
|
-
const f = i.account ?
|
|
2787
|
-
throw
|
|
2759
|
+
const f = i.account ? H(i.account) : void 0;
|
|
2760
|
+
throw Ae(u, {
|
|
2788
2761
|
abi: n,
|
|
2789
2762
|
address: r,
|
|
2790
2763
|
args: a,
|
|
@@ -2795,20 +2768,20 @@ async function js(e, t) {
|
|
|
2795
2768
|
}
|
|
2796
2769
|
}
|
|
2797
2770
|
function $a(e, t) {
|
|
2798
|
-
if (!
|
|
2799
|
-
throw new
|
|
2800
|
-
if (!
|
|
2801
|
-
throw new
|
|
2771
|
+
if (!G(e, { strict: !1 }))
|
|
2772
|
+
throw new ee({ address: e });
|
|
2773
|
+
if (!G(t, { strict: !1 }))
|
|
2774
|
+
throw new ee({ address: t });
|
|
2802
2775
|
return e.toLowerCase() === t.toLowerCase();
|
|
2803
2776
|
}
|
|
2804
|
-
const
|
|
2805
|
-
function
|
|
2777
|
+
const an = "/docs/contract/decodeEventLog";
|
|
2778
|
+
function Un(e) {
|
|
2806
2779
|
const { abi: t, data: n, strict: r, topics: a } = e, s = r ?? !0, [o, ...i] = a;
|
|
2807
2780
|
if (!o)
|
|
2808
|
-
throw new
|
|
2809
|
-
const c = t.find((p) => p.type === "event" && o ===
|
|
2781
|
+
throw new mr({ docsPath: an });
|
|
2782
|
+
const c = t.find((p) => p.type === "event" && o === xe(D(p)));
|
|
2810
2783
|
if (!(c && "name" in c) || c.type !== "event")
|
|
2811
|
-
throw new
|
|
2784
|
+
throw new Tn(o, { docsPath: an });
|
|
2812
2785
|
const { name: u, inputs: f } = c, l = f?.some((p) => !("name" in p && p.name)), d = l ? [] : {}, b = f.map((p, g) => [p, g]).filter(([p]) => "indexed" in p && p.indexed);
|
|
2813
2786
|
for (let p = 0; p < b.length; p++) {
|
|
2814
2787
|
const [g, h] = b[p], w = i[p];
|
|
@@ -2826,7 +2799,7 @@ function qn(e) {
|
|
|
2826
2799
|
if (m.length > 0) {
|
|
2827
2800
|
if (n && n !== "0x")
|
|
2828
2801
|
try {
|
|
2829
|
-
const p =
|
|
2802
|
+
const p = Pe(m, n);
|
|
2830
2803
|
if (p)
|
|
2831
2804
|
if (l)
|
|
2832
2805
|
for (let g = 0; g < f.length; g++)
|
|
@@ -2836,15 +2809,15 @@ function qn(e) {
|
|
|
2836
2809
|
d[m[g].name] = p[g];
|
|
2837
2810
|
} catch (p) {
|
|
2838
2811
|
if (s)
|
|
2839
|
-
throw p instanceof
|
|
2812
|
+
throw p instanceof In || p instanceof g0 ? new ye({
|
|
2840
2813
|
abiItem: c,
|
|
2841
2814
|
data: n,
|
|
2842
2815
|
params: m,
|
|
2843
|
-
size:
|
|
2816
|
+
size: R(n)
|
|
2844
2817
|
}) : p;
|
|
2845
2818
|
}
|
|
2846
2819
|
else if (s)
|
|
2847
|
-
throw new
|
|
2820
|
+
throw new ye({
|
|
2848
2821
|
abiItem: c,
|
|
2849
2822
|
data: "0x",
|
|
2850
2823
|
params: m,
|
|
@@ -2857,19 +2830,19 @@ function qn(e) {
|
|
|
2857
2830
|
};
|
|
2858
2831
|
}
|
|
2859
2832
|
function Aa({ param: e, value: t }) {
|
|
2860
|
-
return e.type === "string" || e.type === "bytes" || e.type === "tuple" || e.type.match(/^(.*)\[(\d+)?\]$/) ? t : (
|
|
2833
|
+
return e.type === "string" || e.type === "bytes" || e.type === "tuple" || e.type.match(/^(.*)\[(\d+)?\]$/) ? t : (Pe([e], t) || [])[0];
|
|
2861
2834
|
}
|
|
2862
|
-
function
|
|
2835
|
+
function Vn(e) {
|
|
2863
2836
|
const { abi: t, args: n, logs: r, strict: a = !0 } = e, s = (() => {
|
|
2864
2837
|
if (e.eventName)
|
|
2865
2838
|
return Array.isArray(e.eventName) ? e.eventName : [e.eventName];
|
|
2866
2839
|
})();
|
|
2867
2840
|
return r.map((o) => {
|
|
2868
2841
|
try {
|
|
2869
|
-
const i = t.find((u) => u.type === "event" && o.topics[0] ===
|
|
2842
|
+
const i = t.find((u) => u.type === "event" && o.topics[0] === xe(u));
|
|
2870
2843
|
if (!i)
|
|
2871
2844
|
return null;
|
|
2872
|
-
const c =
|
|
2845
|
+
const c = Un({
|
|
2873
2846
|
...o,
|
|
2874
2847
|
abi: [i],
|
|
2875
2848
|
strict: a
|
|
@@ -2881,9 +2854,9 @@ function Un(e) {
|
|
|
2881
2854
|
}) ? null : { ...c, ...o };
|
|
2882
2855
|
} catch (i) {
|
|
2883
2856
|
let c, u;
|
|
2884
|
-
if (i instanceof
|
|
2857
|
+
if (i instanceof Tn)
|
|
2885
2858
|
return null;
|
|
2886
|
-
if (i instanceof
|
|
2859
|
+
if (i instanceof ye || i instanceof Xe) {
|
|
2887
2860
|
if (a)
|
|
2888
2861
|
return null;
|
|
2889
2862
|
c = i.abiItem.name, u = i.abiItem.inputs?.some((f) => !("name" in f && f.name));
|
|
@@ -2917,7 +2890,7 @@ function Sa(e) {
|
|
|
2917
2890
|
return i ? (Array.isArray(o) ? o : [o]).some((u) => a(i, u, t[s])) : !1;
|
|
2918
2891
|
}) : !1;
|
|
2919
2892
|
}
|
|
2920
|
-
async function
|
|
2893
|
+
async function Ma(e, { address: t, blockHash: n, fromBlock: r, toBlock: a, event: s, events: o, args: i, strict: c } = {}) {
|
|
2921
2894
|
const u = c ?? !1, f = o ?? (s ? [s] : void 0);
|
|
2922
2895
|
let l = [];
|
|
2923
2896
|
f && (l = [f.flatMap((p) => at({
|
|
@@ -2940,17 +2913,17 @@ async function Fa(e, { address: t, blockHash: n, fromBlock: r, toBlock: a, event
|
|
|
2940
2913
|
}
|
|
2941
2914
|
]
|
|
2942
2915
|
});
|
|
2943
|
-
const b = d.map((m) =>
|
|
2944
|
-
return f ?
|
|
2916
|
+
const b = d.map((m) => be(m));
|
|
2917
|
+
return f ? Vn({
|
|
2945
2918
|
abi: f,
|
|
2946
2919
|
args: i,
|
|
2947
2920
|
logs: b,
|
|
2948
2921
|
strict: u
|
|
2949
2922
|
}) : b;
|
|
2950
2923
|
}
|
|
2951
|
-
async function
|
|
2924
|
+
async function Fa(e, t) {
|
|
2952
2925
|
const { abi: n, address: r, args: a, blockHash: s, eventName: o, fromBlock: i, toBlock: c, strict: u } = t, f = o ? ce({ abi: n, name: o }) : void 0, l = f ? void 0 : n.filter((d) => d.type === "event");
|
|
2953
|
-
return E(e,
|
|
2926
|
+
return E(e, Ma, "getLogs")({
|
|
2954
2927
|
address: r,
|
|
2955
2928
|
args: a,
|
|
2956
2929
|
blockHash: s,
|
|
@@ -2961,21 +2934,21 @@ async function Ma(e, t) {
|
|
|
2961
2934
|
strict: u
|
|
2962
2935
|
});
|
|
2963
2936
|
}
|
|
2964
|
-
const
|
|
2965
|
-
function
|
|
2937
|
+
const Ie = "/docs/contract/decodeFunctionResult";
|
|
2938
|
+
function jt(e) {
|
|
2966
2939
|
const { abi: t, args: n, functionName: r, data: a } = e;
|
|
2967
2940
|
let s = t[0];
|
|
2968
2941
|
if (r) {
|
|
2969
2942
|
const i = ce({ abi: t, args: n, name: r });
|
|
2970
2943
|
if (!i)
|
|
2971
|
-
throw new
|
|
2944
|
+
throw new pe(r, { docsPath: Ie });
|
|
2972
2945
|
s = i;
|
|
2973
2946
|
}
|
|
2974
2947
|
if (s.type !== "function")
|
|
2975
|
-
throw new
|
|
2948
|
+
throw new pe(void 0, { docsPath: Ie });
|
|
2976
2949
|
if (!s.outputs)
|
|
2977
|
-
throw new
|
|
2978
|
-
const o =
|
|
2950
|
+
throw new hr(s.name, { docsPath: Ie });
|
|
2951
|
+
const o = Pe(s.outputs, a);
|
|
2979
2952
|
if (o && o.length > 1)
|
|
2980
2953
|
return o;
|
|
2981
2954
|
if (o && o.length === 1)
|
|
@@ -2985,17 +2958,17 @@ const Ia = "0.1.1";
|
|
|
2985
2958
|
function Ba() {
|
|
2986
2959
|
return Ia;
|
|
2987
2960
|
}
|
|
2988
|
-
class
|
|
2961
|
+
class L extends Error {
|
|
2989
2962
|
constructor(t, n = {}) {
|
|
2990
2963
|
const r = (() => {
|
|
2991
|
-
if (n.cause instanceof
|
|
2964
|
+
if (n.cause instanceof L) {
|
|
2992
2965
|
if (n.cause.details)
|
|
2993
2966
|
return n.cause.details;
|
|
2994
2967
|
if (n.cause.shortMessage)
|
|
2995
2968
|
return n.cause.shortMessage;
|
|
2996
2969
|
}
|
|
2997
2970
|
return n.cause && "details" in n.cause && typeof n.cause.details == "string" ? n.cause.details : n.cause?.message ? n.cause.message : n.details;
|
|
2998
|
-
})(), a = n.cause instanceof
|
|
2971
|
+
})(), a = n.cause instanceof L && n.cause.docsPath || n.docsPath, o = `https://oxlib.sh${a ?? ""}`, i = [
|
|
2999
2972
|
t || "An error occurred.",
|
|
3000
2973
|
...n.metaMessages ? ["", ...n.metaMessages] : [],
|
|
3001
2974
|
...r || a ? [
|
|
@@ -3043,36 +3016,36 @@ class U extends Error {
|
|
|
3043
3016
|
}), this.cause = n.cause, this.details = r, this.docs = o, this.docsPath = a, this.shortMessage = t;
|
|
3044
3017
|
}
|
|
3045
3018
|
walk(t) {
|
|
3046
|
-
return
|
|
3019
|
+
return Wn(this, t);
|
|
3047
3020
|
}
|
|
3048
3021
|
}
|
|
3049
|
-
function
|
|
3050
|
-
return t?.(e) ? e : e && typeof e == "object" && "cause" in e && e.cause ?
|
|
3022
|
+
function Wn(e, t) {
|
|
3023
|
+
return t?.(e) ? e : e && typeof e == "object" && "cause" in e && e.cause ? Wn(e.cause, t) : t ? null : e;
|
|
3051
3024
|
}
|
|
3052
|
-
function
|
|
3053
|
-
if (
|
|
3025
|
+
function Rt(e, t) {
|
|
3026
|
+
if (ne(e) > t)
|
|
3054
3027
|
throw new La({
|
|
3055
|
-
givenSize:
|
|
3028
|
+
givenSize: ne(e),
|
|
3056
3029
|
maxSize: t
|
|
3057
3030
|
});
|
|
3058
3031
|
}
|
|
3059
3032
|
function Ta(e, t) {
|
|
3060
|
-
if (typeof t == "number" && t > 0 && t >
|
|
3061
|
-
throw new
|
|
3033
|
+
if (typeof t == "number" && t > 0 && t > ne(e) - 1)
|
|
3034
|
+
throw new Jn({
|
|
3062
3035
|
offset: t,
|
|
3063
3036
|
position: "start",
|
|
3064
|
-
size:
|
|
3037
|
+
size: ne(e)
|
|
3065
3038
|
});
|
|
3066
3039
|
}
|
|
3067
|
-
function
|
|
3068
|
-
if (typeof t == "number" && typeof n == "number" &&
|
|
3069
|
-
throw new
|
|
3040
|
+
function Ca(e, t, n) {
|
|
3041
|
+
if (typeof t == "number" && typeof n == "number" && ne(e) !== n - t)
|
|
3042
|
+
throw new Jn({
|
|
3070
3043
|
offset: n,
|
|
3071
3044
|
position: "end",
|
|
3072
|
-
size:
|
|
3045
|
+
size: ne(e)
|
|
3073
3046
|
});
|
|
3074
3047
|
}
|
|
3075
|
-
function
|
|
3048
|
+
function Zn(e, t = {}) {
|
|
3076
3049
|
const { dir: n, size: r = 32 } = t;
|
|
3077
3050
|
if (r === 0)
|
|
3078
3051
|
return e;
|
|
@@ -3085,40 +3058,40 @@ function Wn(e, t = {}) {
|
|
|
3085
3058
|
});
|
|
3086
3059
|
return `0x${a[n === "right" ? "padEnd" : "padStart"](r * 2, "0")}`;
|
|
3087
3060
|
}
|
|
3088
|
-
const
|
|
3089
|
-
function
|
|
3090
|
-
return JSON.stringify(e, (r, a) => typeof a == "bigint" ? a.toString() +
|
|
3061
|
+
const ja = "#__bigint";
|
|
3062
|
+
function Ra(e, t, n) {
|
|
3063
|
+
return JSON.stringify(e, (r, a) => typeof a == "bigint" ? a.toString() + ja : a, n);
|
|
3091
3064
|
}
|
|
3092
|
-
const
|
|
3065
|
+
const ka = /* @__PURE__ */ new TextEncoder(), Oa = /* @__PURE__ */ Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
|
|
3093
3066
|
function Na(e, t = {}) {
|
|
3094
3067
|
const { strict: n = !1 } = t;
|
|
3095
3068
|
if (!e)
|
|
3096
|
-
throw new
|
|
3069
|
+
throw new sn(e);
|
|
3097
3070
|
if (typeof e != "string")
|
|
3098
|
-
throw new an(e);
|
|
3099
|
-
if (n && !/^0x[0-9a-fA-F]*$/.test(e))
|
|
3100
3071
|
throw new sn(e);
|
|
3072
|
+
if (n && !/^0x[0-9a-fA-F]*$/.test(e))
|
|
3073
|
+
throw new on(e);
|
|
3101
3074
|
if (!e.startsWith("0x"))
|
|
3102
|
-
throw new
|
|
3075
|
+
throw new on(e);
|
|
3103
3076
|
}
|
|
3104
|
-
function
|
|
3077
|
+
function js(...e) {
|
|
3105
3078
|
return `0x${e.reduce((t, n) => t + n.replace("0x", ""), "")}`;
|
|
3106
3079
|
}
|
|
3107
|
-
function
|
|
3108
|
-
return e instanceof Uint8Array ?
|
|
3080
|
+
function Rs(e) {
|
|
3081
|
+
return e instanceof Uint8Array ? Ue(e) : Array.isArray(e) ? Ue(new Uint8Array(e)) : e;
|
|
3109
3082
|
}
|
|
3110
|
-
function
|
|
3083
|
+
function ks(e, t = {}) {
|
|
3111
3084
|
const n = `0x${Number(e)}`;
|
|
3112
|
-
return typeof t.size == "number" ? (
|
|
3085
|
+
return typeof t.size == "number" ? (Rt(n, t.size), Kn(n, t.size)) : n;
|
|
3113
3086
|
}
|
|
3114
|
-
function
|
|
3087
|
+
function Ue(e, t = {}) {
|
|
3115
3088
|
let n = "";
|
|
3116
3089
|
for (let a = 0; a < e.length; a++)
|
|
3117
3090
|
n += Oa[e[a]];
|
|
3118
3091
|
const r = `0x${n}`;
|
|
3119
|
-
return typeof t.size == "number" ? (
|
|
3092
|
+
return typeof t.size == "number" ? (Rt(r, t.size), za(r, t.size)) : r;
|
|
3120
3093
|
}
|
|
3121
|
-
function
|
|
3094
|
+
function N(e, t = {}) {
|
|
3122
3095
|
const { signed: n, size: r } = t, a = BigInt(e);
|
|
3123
3096
|
let s;
|
|
3124
3097
|
r ? n ? s = (1n << BigInt(r) * 8n - 1n) - 1n : s = 2n ** (BigInt(r) * 8n) - 1n : typeof e == "number" && (s = BigInt(Number.MAX_SAFE_INTEGER));
|
|
@@ -3134,29 +3107,29 @@ function L(e, t = {}) {
|
|
|
3134
3107
|
});
|
|
3135
3108
|
}
|
|
3136
3109
|
const c = `0x${(n && a < 0 ? (1n << BigInt(r * 8)) + BigInt(a) : a).toString(16)}`;
|
|
3137
|
-
return r ?
|
|
3110
|
+
return r ? Kn(c, r) : c;
|
|
3138
3111
|
}
|
|
3139
3112
|
function Os(e, t = {}) {
|
|
3140
|
-
return
|
|
3113
|
+
return Ue(ka.encode(e), t);
|
|
3141
3114
|
}
|
|
3142
|
-
function
|
|
3143
|
-
return
|
|
3115
|
+
function Kn(e, t) {
|
|
3116
|
+
return Zn(e, { dir: "left", size: t });
|
|
3144
3117
|
}
|
|
3145
3118
|
function za(e, t) {
|
|
3146
|
-
return
|
|
3119
|
+
return Zn(e, { dir: "right", size: t });
|
|
3147
3120
|
}
|
|
3148
3121
|
function Ns(e, t, n, r = {}) {
|
|
3149
3122
|
const { strict: a } = r;
|
|
3150
3123
|
Ta(e, t);
|
|
3151
3124
|
const s = `0x${e.replace("0x", "").slice((t ?? 0) * 2, (n ?? e.length) * 2)}`;
|
|
3152
|
-
return a &&
|
|
3125
|
+
return a && Ca(s, t, n), s;
|
|
3153
3126
|
}
|
|
3154
|
-
function
|
|
3127
|
+
function ne(e) {
|
|
3155
3128
|
return Math.ceil((e.length - 2) / 2);
|
|
3156
3129
|
}
|
|
3157
3130
|
function Ga(e, t = {}) {
|
|
3158
3131
|
const { signed: n } = t;
|
|
3159
|
-
t.size &&
|
|
3132
|
+
t.size && Rt(e, t.size);
|
|
3160
3133
|
const r = BigInt(e);
|
|
3161
3134
|
if (!n)
|
|
3162
3135
|
return r;
|
|
@@ -3175,7 +3148,7 @@ function Gs(e, t = {}) {
|
|
|
3175
3148
|
return !1;
|
|
3176
3149
|
}
|
|
3177
3150
|
}
|
|
3178
|
-
class Da extends
|
|
3151
|
+
class Da extends L {
|
|
3179
3152
|
constructor({ max: t, min: n, signed: r, size: a, value: s }) {
|
|
3180
3153
|
super(`Number \`${s}\` is not in safe${a ? ` ${a * 8}-bit` : ""}${r ? " signed" : " unsigned"} integer range ${t ? `(\`${n}\` to \`${t}\`)` : `(above \`${n}\`)`}`), Object.defineProperty(this, "name", {
|
|
3181
3154
|
enumerable: !0,
|
|
@@ -3185,9 +3158,9 @@ class Da extends U {
|
|
|
3185
3158
|
});
|
|
3186
3159
|
}
|
|
3187
3160
|
}
|
|
3188
|
-
class
|
|
3161
|
+
class sn extends L {
|
|
3189
3162
|
constructor(t) {
|
|
3190
|
-
super(`Value \`${typeof t == "object" ?
|
|
3163
|
+
super(`Value \`${typeof t == "object" ? Ra(t) : t}\` of type \`${typeof t}\` is an invalid hex type.`, {
|
|
3191
3164
|
metaMessages: ['Hex types must be represented as `"0x${string}"`.']
|
|
3192
3165
|
}), Object.defineProperty(this, "name", {
|
|
3193
3166
|
enumerable: !0,
|
|
@@ -3197,7 +3170,7 @@ class an extends U {
|
|
|
3197
3170
|
});
|
|
3198
3171
|
}
|
|
3199
3172
|
}
|
|
3200
|
-
class
|
|
3173
|
+
class on extends L {
|
|
3201
3174
|
constructor(t) {
|
|
3202
3175
|
super(`Value \`${t}\` is an invalid hex value.`, {
|
|
3203
3176
|
metaMessages: [
|
|
@@ -3211,7 +3184,7 @@ class sn extends U {
|
|
|
3211
3184
|
});
|
|
3212
3185
|
}
|
|
3213
3186
|
}
|
|
3214
|
-
class La extends
|
|
3187
|
+
class La extends L {
|
|
3215
3188
|
constructor({ givenSize: t, maxSize: n }) {
|
|
3216
3189
|
super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`), Object.defineProperty(this, "name", {
|
|
3217
3190
|
enumerable: !0,
|
|
@@ -3221,7 +3194,7 @@ class La extends U {
|
|
|
3221
3194
|
});
|
|
3222
3195
|
}
|
|
3223
3196
|
}
|
|
3224
|
-
class
|
|
3197
|
+
class Jn extends L {
|
|
3225
3198
|
constructor({ offset: t, position: n, size: r }) {
|
|
3226
3199
|
super(`Slice ${n === "start" ? "starting" : "ending"} at offset \`${t}\` is out-of-bounds (size: \`${r}\`).`), Object.defineProperty(this, "name", {
|
|
3227
3200
|
enumerable: !0,
|
|
@@ -3231,7 +3204,7 @@ class Kn extends U {
|
|
|
3231
3204
|
});
|
|
3232
3205
|
}
|
|
3233
3206
|
}
|
|
3234
|
-
class _a extends
|
|
3207
|
+
class _a extends L {
|
|
3235
3208
|
constructor({ size: t, targetSize: n, type: r }) {
|
|
3236
3209
|
super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`), Object.defineProperty(this, "name", {
|
|
3237
3210
|
enumerable: !0,
|
|
@@ -3244,40 +3217,40 @@ class _a extends U {
|
|
|
3244
3217
|
function Ha(e) {
|
|
3245
3218
|
return {
|
|
3246
3219
|
address: e.address,
|
|
3247
|
-
amount:
|
|
3248
|
-
index:
|
|
3249
|
-
validatorIndex:
|
|
3220
|
+
amount: N(e.amount),
|
|
3221
|
+
index: N(e.index),
|
|
3222
|
+
validatorIndex: N(e.validatorIndex)
|
|
3250
3223
|
};
|
|
3251
3224
|
}
|
|
3252
3225
|
function qa(e) {
|
|
3253
3226
|
return {
|
|
3254
3227
|
...typeof e.baseFeePerGas == "bigint" && {
|
|
3255
|
-
baseFeePerGas:
|
|
3228
|
+
baseFeePerGas: N(e.baseFeePerGas)
|
|
3256
3229
|
},
|
|
3257
3230
|
...typeof e.blobBaseFee == "bigint" && {
|
|
3258
|
-
blobBaseFee:
|
|
3231
|
+
blobBaseFee: N(e.blobBaseFee)
|
|
3259
3232
|
},
|
|
3260
3233
|
...typeof e.feeRecipient == "string" && {
|
|
3261
3234
|
feeRecipient: e.feeRecipient
|
|
3262
3235
|
},
|
|
3263
3236
|
...typeof e.gasLimit == "bigint" && {
|
|
3264
|
-
gasLimit:
|
|
3237
|
+
gasLimit: N(e.gasLimit)
|
|
3265
3238
|
},
|
|
3266
3239
|
...typeof e.number == "bigint" && {
|
|
3267
|
-
number:
|
|
3240
|
+
number: N(e.number)
|
|
3268
3241
|
},
|
|
3269
3242
|
...typeof e.prevRandao == "bigint" && {
|
|
3270
|
-
prevRandao:
|
|
3243
|
+
prevRandao: N(e.prevRandao)
|
|
3271
3244
|
},
|
|
3272
3245
|
...typeof e.time == "bigint" && {
|
|
3273
|
-
time:
|
|
3246
|
+
time: N(e.time)
|
|
3274
3247
|
},
|
|
3275
3248
|
...e.withdrawals && {
|
|
3276
3249
|
withdrawals: e.withdrawals.map(Ha)
|
|
3277
3250
|
}
|
|
3278
3251
|
};
|
|
3279
3252
|
}
|
|
3280
|
-
const
|
|
3253
|
+
const cn = [
|
|
3281
3254
|
{
|
|
3282
3255
|
inputs: [
|
|
3283
3256
|
{
|
|
@@ -3382,7 +3355,7 @@ const on = [
|
|
|
3382
3355
|
}
|
|
3383
3356
|
]
|
|
3384
3357
|
}
|
|
3385
|
-
],
|
|
3358
|
+
], Yn = [
|
|
3386
3359
|
{
|
|
3387
3360
|
inputs: [
|
|
3388
3361
|
{
|
|
@@ -3487,7 +3460,7 @@ const on = [
|
|
|
3487
3460
|
type: "error"
|
|
3488
3461
|
}
|
|
3489
3462
|
], Ls = [
|
|
3490
|
-
...
|
|
3463
|
+
...Yn,
|
|
3491
3464
|
{
|
|
3492
3465
|
name: "resolveWithGateways",
|
|
3493
3466
|
type: "function",
|
|
@@ -3503,7 +3476,7 @@ const on = [
|
|
|
3503
3476
|
]
|
|
3504
3477
|
}
|
|
3505
3478
|
], _s = [
|
|
3506
|
-
...
|
|
3479
|
+
...Yn,
|
|
3507
3480
|
{
|
|
3508
3481
|
name: "reverseWithGateways",
|
|
3509
3482
|
type: "function",
|
|
@@ -3602,30 +3575,30 @@ const on = [
|
|
|
3602
3575
|
type: "function",
|
|
3603
3576
|
name: "isValidSig"
|
|
3604
3577
|
}
|
|
3605
|
-
], Ua = "0x82ad56cb", Va = "0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe", Wa = "0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe", Ws = "0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572", Za = "0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033", Te = "/docs/contract/encodeDeployData";
|
|
3606
|
-
function
|
|
3578
|
+
], Ua = "0x82ad56cb", Va = "0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe", Wa = "0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe", Ws = "0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572", Za = "0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033", Be = "/docs/contract/encodeDeployData";
|
|
3579
|
+
function Xn(e) {
|
|
3607
3580
|
const { abi: t, args: n, bytecode: r } = e;
|
|
3608
3581
|
if (!n || n.length === 0)
|
|
3609
3582
|
return r;
|
|
3610
3583
|
const a = t.find((o) => "type" in o && o.type === "constructor");
|
|
3611
3584
|
if (!a)
|
|
3612
|
-
throw new
|
|
3585
|
+
throw new lr({ docsPath: Be });
|
|
3613
3586
|
if (!("inputs" in a))
|
|
3614
|
-
throw new
|
|
3587
|
+
throw new Zt({ docsPath: Be });
|
|
3615
3588
|
if (!a.inputs || a.inputs.length === 0)
|
|
3616
|
-
throw new
|
|
3589
|
+
throw new Zt({ docsPath: Be });
|
|
3617
3590
|
const s = Qe(a.inputs, n);
|
|
3618
3591
|
return Ze([r, s]);
|
|
3619
3592
|
}
|
|
3620
3593
|
function Ka({ blockNumber: e, chain: t, contract: n }) {
|
|
3621
3594
|
const r = t?.contracts?.[n];
|
|
3622
3595
|
if (!r)
|
|
3623
|
-
throw new
|
|
3596
|
+
throw new ze({
|
|
3624
3597
|
chain: t,
|
|
3625
3598
|
contract: { name: n }
|
|
3626
3599
|
});
|
|
3627
3600
|
if (e && r.blockCreated && r.blockCreated > e)
|
|
3628
|
-
throw new
|
|
3601
|
+
throw new ze({
|
|
3629
3602
|
blockNumber: e,
|
|
3630
3603
|
chain: t,
|
|
3631
3604
|
contract: {
|
|
@@ -3638,9 +3611,9 @@ function Ka({ blockNumber: e, chain: t, contract: n }) {
|
|
|
3638
3611
|
function Ja(e, { docsPath: t, ...n }) {
|
|
3639
3612
|
const r = (() => {
|
|
3640
3613
|
const a = It(e, n);
|
|
3641
|
-
return a instanceof
|
|
3614
|
+
return a instanceof we ? e : a;
|
|
3642
3615
|
})();
|
|
3643
|
-
return new
|
|
3616
|
+
return new aa(r, {
|
|
3644
3617
|
docsPath: t,
|
|
3645
3618
|
...n
|
|
3646
3619
|
});
|
|
@@ -3653,7 +3626,7 @@ function Ya() {
|
|
|
3653
3626
|
e = r, t = a;
|
|
3654
3627
|
}), resolve: e, reject: t };
|
|
3655
3628
|
}
|
|
3656
|
-
const
|
|
3629
|
+
const Te = /* @__PURE__ */ new Map();
|
|
3657
3630
|
function Xa({ fn: e, id: t, shouldSplitBatch: n, wait: r = 0, sort: a }) {
|
|
3658
3631
|
const s = async () => {
|
|
3659
3632
|
const f = c();
|
|
@@ -3671,7 +3644,7 @@ function Xa({ fn: e, id: t, shouldSplitBatch: n, wait: r = 0, sort: a }) {
|
|
|
3671
3644
|
m?.(d);
|
|
3672
3645
|
}
|
|
3673
3646
|
});
|
|
3674
|
-
}, o = () =>
|
|
3647
|
+
}, o = () => Te.delete(t), i = () => c().map(({ args: f }) => f), c = () => Te.get(t) || [], u = (f) => Te.set(t, [...c(), f]);
|
|
3675
3648
|
return {
|
|
3676
3649
|
flush: o,
|
|
3677
3650
|
async schedule(f) {
|
|
@@ -3680,69 +3653,69 @@ function Xa({ fn: e, id: t, shouldSplitBatch: n, wait: r = 0, sort: a }) {
|
|
|
3680
3653
|
}
|
|
3681
3654
|
};
|
|
3682
3655
|
}
|
|
3683
|
-
async function
|
|
3684
|
-
const { account: n = e.account, authorizationList: r, batch: a = !!e.batch?.multicall, blockNumber: s, blockTag: o = e.experimental_blockTag ?? "latest", accessList: i, blobs: c, blockOverrides: u, code: f, data: l, factory: d, factoryData: b, gas: m, gasPrice: p, maxFeePerBlobGas: g, maxFeePerGas: h, maxPriorityFeePerGas: w, nonce: x, to: P, value:
|
|
3656
|
+
async function Qn(e, t) {
|
|
3657
|
+
const { account: n = e.account, authorizationList: r, batch: a = !!e.batch?.multicall, blockNumber: s, blockTag: o = e.experimental_blockTag ?? "latest", accessList: i, blobs: c, blockOverrides: u, code: f, data: l, factory: d, factoryData: b, gas: m, gasPrice: p, maxFeePerBlobGas: g, maxFeePerGas: h, maxPriorityFeePerGas: w, nonce: x, to: P, value: M, stateOverride: O, ...$ } = t, A = n ? H(n) : void 0;
|
|
3685
3658
|
if (f && (d || b))
|
|
3686
3659
|
throw new y("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
|
|
3687
3660
|
if (f && P)
|
|
3688
3661
|
throw new y("Cannot provide both `code` & `to` as parameters.");
|
|
3689
|
-
const
|
|
3662
|
+
const F = f && l, S = d && b && P && l, j = F || S, I = F ? e0({
|
|
3690
3663
|
code: f,
|
|
3691
3664
|
data: l
|
|
3692
|
-
}) :
|
|
3665
|
+
}) : S ? ts({
|
|
3693
3666
|
data: l,
|
|
3694
3667
|
factory: d,
|
|
3695
3668
|
factoryData: b,
|
|
3696
3669
|
to: P
|
|
3697
3670
|
}) : l;
|
|
3698
3671
|
try {
|
|
3699
|
-
|
|
3700
|
-
const
|
|
3672
|
+
Se(t);
|
|
3673
|
+
const q = (typeof s == "bigint" ? v(s) : void 0) || o, V = u ? qa(u) : void 0, W = zn(O), kt = e.chain?.formatters?.transactionRequest?.format, Me = (kt || Tt)({
|
|
3701
3674
|
// Pick out extra data that might exist on the chain's transaction request type.
|
|
3702
|
-
...Bt(
|
|
3703
|
-
from: $?.address,
|
|
3675
|
+
...Bt($, { format: kt }),
|
|
3704
3676
|
accessList: i,
|
|
3677
|
+
account: A,
|
|
3705
3678
|
authorizationList: r,
|
|
3706
3679
|
blobs: c,
|
|
3707
|
-
data:
|
|
3680
|
+
data: I,
|
|
3708
3681
|
gas: m,
|
|
3709
3682
|
gasPrice: p,
|
|
3710
3683
|
maxFeePerBlobGas: g,
|
|
3711
3684
|
maxFeePerGas: h,
|
|
3712
3685
|
maxPriorityFeePerGas: w,
|
|
3713
3686
|
nonce: x,
|
|
3714
|
-
to:
|
|
3715
|
-
value:
|
|
3716
|
-
});
|
|
3717
|
-
if (a && Qa({ request: Me }) && !
|
|
3687
|
+
to: j ? void 0 : P,
|
|
3688
|
+
value: M
|
|
3689
|
+
}, "call");
|
|
3690
|
+
if (a && Qa({ request: Me }) && !W && !V)
|
|
3718
3691
|
try {
|
|
3719
3692
|
return await es(e, {
|
|
3720
3693
|
...Me,
|
|
3721
3694
|
blockNumber: s,
|
|
3722
3695
|
blockTag: o
|
|
3723
3696
|
});
|
|
3724
|
-
} catch (
|
|
3725
|
-
if (!(
|
|
3726
|
-
throw
|
|
3697
|
+
} catch (U) {
|
|
3698
|
+
if (!(U instanceof yn) && !(U instanceof ze))
|
|
3699
|
+
throw U;
|
|
3727
3700
|
}
|
|
3728
|
-
const
|
|
3729
|
-
const
|
|
3701
|
+
const n0 = (() => {
|
|
3702
|
+
const U = [
|
|
3730
3703
|
Me,
|
|
3731
|
-
|
|
3704
|
+
q
|
|
3732
3705
|
];
|
|
3733
|
-
return
|
|
3734
|
-
})(),
|
|
3706
|
+
return W && V ? [...U, W, V] : W ? [...U, W] : V ? [...U, {}, V] : U;
|
|
3707
|
+
})(), Ot = await e.request({
|
|
3735
3708
|
method: "eth_call",
|
|
3736
|
-
params:
|
|
3709
|
+
params: n0
|
|
3737
3710
|
});
|
|
3738
|
-
return
|
|
3739
|
-
} catch (
|
|
3740
|
-
const
|
|
3741
|
-
if (e.ccipRead !== !1 &&
|
|
3742
|
-
return { data: await
|
|
3743
|
-
throw
|
|
3711
|
+
return Ot === "0x" ? { data: void 0 } : { data: Ot };
|
|
3712
|
+
} catch (ae) {
|
|
3713
|
+
const q = ns(ae), { offchainLookup: V, offchainLookupSignature: W } = await import("./ccip-dYaIZXTj.js");
|
|
3714
|
+
if (e.ccipRead !== !1 && q?.slice(0, 10) === W && P)
|
|
3715
|
+
return { data: await V(e, { data: q, to: P }) };
|
|
3716
|
+
throw j && q?.slice(0, 10) === "0x101bb98d" ? new ca({ factory: d }) : Ja(ae, {
|
|
3744
3717
|
...t,
|
|
3745
|
-
account:
|
|
3718
|
+
account: A,
|
|
3746
3719
|
chain: e.chain
|
|
3747
3720
|
});
|
|
3748
3721
|
}
|
|
@@ -3763,7 +3736,7 @@ async function es(e, t) {
|
|
|
3763
3736
|
chain: e.chain,
|
|
3764
3737
|
contract: "multicall3"
|
|
3765
3738
|
});
|
|
3766
|
-
throw new
|
|
3739
|
+
throw new yn();
|
|
3767
3740
|
})(), l = (typeof s == "bigint" ? v(s) : void 0) || o, { schedule: d } = Xa({
|
|
3768
3741
|
id: `${e.uid}.${l}`,
|
|
3769
3742
|
wait: a,
|
|
@@ -3776,7 +3749,7 @@ async function es(e, t) {
|
|
|
3776
3749
|
callData: x.data,
|
|
3777
3750
|
target: x.to
|
|
3778
3751
|
})), h = ue({
|
|
3779
|
-
abi:
|
|
3752
|
+
abi: cn,
|
|
3780
3753
|
args: [g],
|
|
3781
3754
|
functionName: "aggregate3"
|
|
3782
3755
|
}), w = await e.request({
|
|
@@ -3784,7 +3757,7 @@ async function es(e, t) {
|
|
|
3784
3757
|
params: [
|
|
3785
3758
|
{
|
|
3786
3759
|
...u === null ? {
|
|
3787
|
-
data:
|
|
3760
|
+
data: e0({
|
|
3788
3761
|
code: Za,
|
|
3789
3762
|
data: h
|
|
3790
3763
|
})
|
|
@@ -3793,8 +3766,8 @@ async function es(e, t) {
|
|
|
3793
3766
|
l
|
|
3794
3767
|
]
|
|
3795
3768
|
});
|
|
3796
|
-
return
|
|
3797
|
-
abi:
|
|
3769
|
+
return jt({
|
|
3770
|
+
abi: cn,
|
|
3798
3771
|
args: [g],
|
|
3799
3772
|
functionName: "aggregate3",
|
|
3800
3773
|
data: w || "0x"
|
|
@@ -3805,9 +3778,9 @@ async function es(e, t) {
|
|
|
3805
3778
|
throw new kn({ data: b });
|
|
3806
3779
|
return b === "0x" ? { data: void 0 } : { data: b };
|
|
3807
3780
|
}
|
|
3808
|
-
function
|
|
3781
|
+
function e0(e) {
|
|
3809
3782
|
const { code: t, data: n } = e;
|
|
3810
|
-
return
|
|
3783
|
+
return Xn({
|
|
3811
3784
|
abi: Fn(["constructor(bytes, bytes)"]),
|
|
3812
3785
|
bytecode: Va,
|
|
3813
3786
|
args: [t, n]
|
|
@@ -3815,7 +3788,7 @@ function Qn(e) {
|
|
|
3815
3788
|
}
|
|
3816
3789
|
function ts(e) {
|
|
3817
3790
|
const { data: t, factory: n, factoryData: r, to: a } = e;
|
|
3818
|
-
return
|
|
3791
|
+
return Xn({
|
|
3819
3792
|
abi: Fn(["constructor(address, bytes, address, bytes)"]),
|
|
3820
3793
|
bytecode: Wa,
|
|
3821
3794
|
args: [a, t, n, r]
|
|
@@ -3834,19 +3807,19 @@ async function Zs(e, t) {
|
|
|
3834
3807
|
functionName: s
|
|
3835
3808
|
});
|
|
3836
3809
|
try {
|
|
3837
|
-
const { data: c } = await E(e,
|
|
3810
|
+
const { data: c } = await E(e, Qn, "call")({
|
|
3838
3811
|
...o,
|
|
3839
3812
|
data: i,
|
|
3840
3813
|
to: r
|
|
3841
3814
|
});
|
|
3842
|
-
return
|
|
3815
|
+
return jt({
|
|
3843
3816
|
abi: n,
|
|
3844
3817
|
args: a,
|
|
3845
3818
|
functionName: s,
|
|
3846
3819
|
data: c || "0x"
|
|
3847
3820
|
});
|
|
3848
3821
|
} catch (c) {
|
|
3849
|
-
throw
|
|
3822
|
+
throw Ae(c, {
|
|
3850
3823
|
abi: n,
|
|
3851
3824
|
address: r,
|
|
3852
3825
|
args: a,
|
|
@@ -3856,15 +3829,15 @@ async function Zs(e, t) {
|
|
|
3856
3829
|
}
|
|
3857
3830
|
}
|
|
3858
3831
|
async function Ks(e, t) {
|
|
3859
|
-
const { abi: n, address: r, args: a, dataSuffix: s, functionName: o, ...i } = t, c = i.account ?
|
|
3832
|
+
const { abi: n, address: r, args: a, dataSuffix: s, functionName: o, ...i } = t, c = i.account ? H(i.account) : e.account, u = ue({ abi: n, args: a, functionName: o });
|
|
3860
3833
|
try {
|
|
3861
|
-
const { data: f } = await E(e,
|
|
3834
|
+
const { data: f } = await E(e, Qn, "call")({
|
|
3862
3835
|
batch: !1,
|
|
3863
3836
|
data: `${u}${s ? s.replace("0x", "") : ""}`,
|
|
3864
3837
|
to: r,
|
|
3865
3838
|
...i,
|
|
3866
3839
|
account: c
|
|
3867
|
-
}), l =
|
|
3840
|
+
}), l = jt({
|
|
3868
3841
|
abi: n,
|
|
3869
3842
|
args: a,
|
|
3870
3843
|
functionName: o,
|
|
@@ -3883,7 +3856,7 @@ async function Ks(e, t) {
|
|
|
3883
3856
|
}
|
|
3884
3857
|
};
|
|
3885
3858
|
} catch (f) {
|
|
3886
|
-
throw
|
|
3859
|
+
throw Ae(f, {
|
|
3887
3860
|
abi: n,
|
|
3888
3861
|
address: r,
|
|
3889
3862
|
args: a,
|
|
@@ -3893,9 +3866,9 @@ async function Ks(e, t) {
|
|
|
3893
3866
|
});
|
|
3894
3867
|
}
|
|
3895
3868
|
}
|
|
3896
|
-
const Ce = /* @__PURE__ */ new Map(),
|
|
3869
|
+
const Ce = /* @__PURE__ */ new Map(), un = /* @__PURE__ */ new Map();
|
|
3897
3870
|
let rs = 0;
|
|
3898
|
-
function
|
|
3871
|
+
function fn(e, t, n) {
|
|
3899
3872
|
const r = ++rs, a = () => Ce.get(e) || [], s = () => {
|
|
3900
3873
|
const f = a();
|
|
3901
3874
|
Ce.set(e, f.filter((l) => l.id !== r));
|
|
@@ -3903,7 +3876,7 @@ function un(e, t, n) {
|
|
|
3903
3876
|
const f = a();
|
|
3904
3877
|
if (!f.some((d) => d.id === r))
|
|
3905
3878
|
return;
|
|
3906
|
-
const l =
|
|
3879
|
+
const l = un.get(e);
|
|
3907
3880
|
if (f.length === 1 && l) {
|
|
3908
3881
|
const d = l();
|
|
3909
3882
|
d instanceof Promise && d.catch(() => {
|
|
@@ -3925,9 +3898,9 @@ function un(e, t, n) {
|
|
|
3925
3898
|
b.fns[f]?.(...l);
|
|
3926
3899
|
});
|
|
3927
3900
|
const u = n(c);
|
|
3928
|
-
return typeof u == "function" &&
|
|
3901
|
+
return typeof u == "function" && un.set(e, u), o;
|
|
3929
3902
|
}
|
|
3930
|
-
async function
|
|
3903
|
+
async function dn(e) {
|
|
3931
3904
|
return new Promise((t) => setTimeout(t, e));
|
|
3932
3905
|
}
|
|
3933
3906
|
function as(e, { emitOnBegin: t, initialWaitTime: n, interval: r }) {
|
|
@@ -3937,9 +3910,9 @@ function as(e, { emitOnBegin: t, initialWaitTime: n, interval: r }) {
|
|
|
3937
3910
|
let i;
|
|
3938
3911
|
t && (i = await e({ unpoll: s }));
|
|
3939
3912
|
const c = await n?.(i) ?? r;
|
|
3940
|
-
await
|
|
3913
|
+
await dn(c);
|
|
3941
3914
|
const u = async () => {
|
|
3942
|
-
a && (await e({ unpoll: s }), await
|
|
3915
|
+
a && (await e({ unpoll: s }), await dn(r), u());
|
|
3943
3916
|
};
|
|
3944
3917
|
u();
|
|
3945
3918
|
})(), s;
|
|
@@ -3986,8 +3959,8 @@ async function ds(e, { filter: t }) {
|
|
|
3986
3959
|
});
|
|
3987
3960
|
if (typeof r[0] == "string")
|
|
3988
3961
|
return r;
|
|
3989
|
-
const a = r.map((s) =>
|
|
3990
|
-
return !("abi" in t) || !t.abi ? a :
|
|
3962
|
+
const a = r.map((s) => be(s));
|
|
3963
|
+
return !("abi" in t) || !t.abi ? a : Vn({
|
|
3991
3964
|
abi: t.abi,
|
|
3992
3965
|
logs: a,
|
|
3993
3966
|
strict: n
|
|
@@ -4002,7 +3975,7 @@ async function ls(e, { filter: t }) {
|
|
|
4002
3975
|
function Js(e, t) {
|
|
4003
3976
|
const { abi: n, address: r, args: a, batch: s = !0, eventName: o, fromBlock: i, onError: c, onLogs: u, poll: f, pollingInterval: l = e.pollingInterval, strict: d } = t;
|
|
4004
3977
|
return (typeof f < "u" ? f : typeof i == "bigint" ? !0 : !(e.transport.type === "webSocket" || e.transport.type === "ipc" || e.transport.type === "fallback" && (e.transport.transports[0].config.type === "webSocket" || e.transport.transports[0].config.type === "ipc"))) ? (() => {
|
|
4005
|
-
const g = d ?? !1, h =
|
|
3978
|
+
const g = d ?? !1, h = te([
|
|
4006
3979
|
"watchContractEvent",
|
|
4007
3980
|
r,
|
|
4008
3981
|
a,
|
|
@@ -4013,14 +3986,14 @@ function Js(e, t) {
|
|
|
4013
3986
|
g,
|
|
4014
3987
|
i
|
|
4015
3988
|
]);
|
|
4016
|
-
return
|
|
3989
|
+
return fn(h, { onLogs: u, onError: c }, (w) => {
|
|
4017
3990
|
let x;
|
|
4018
3991
|
i !== void 0 && (x = i - 1n);
|
|
4019
|
-
let P,
|
|
4020
|
-
const
|
|
4021
|
-
if (!
|
|
3992
|
+
let P, M = !1;
|
|
3993
|
+
const O = as(async () => {
|
|
3994
|
+
if (!M) {
|
|
4022
3995
|
try {
|
|
4023
|
-
P = await E(e,
|
|
3996
|
+
P = await E(e, zr, "createContractEventFilter")({
|
|
4024
3997
|
abi: n,
|
|
4025
3998
|
address: r,
|
|
4026
3999
|
args: a,
|
|
@@ -4030,45 +4003,45 @@ function Js(e, t) {
|
|
|
4030
4003
|
});
|
|
4031
4004
|
} catch {
|
|
4032
4005
|
}
|
|
4033
|
-
|
|
4006
|
+
M = !0;
|
|
4034
4007
|
return;
|
|
4035
4008
|
}
|
|
4036
4009
|
try {
|
|
4037
|
-
let
|
|
4010
|
+
let $;
|
|
4038
4011
|
if (P)
|
|
4039
|
-
|
|
4012
|
+
$ = await E(e, ds, "getFilterChanges")({ filter: P });
|
|
4040
4013
|
else {
|
|
4041
|
-
const
|
|
4042
|
-
x && x <
|
|
4014
|
+
const A = await E(e, fs, "getBlockNumber")({});
|
|
4015
|
+
x && x < A ? $ = await E(e, Fa, "getContractEvents")({
|
|
4043
4016
|
abi: n,
|
|
4044
4017
|
address: r,
|
|
4045
4018
|
args: a,
|
|
4046
4019
|
eventName: o,
|
|
4047
4020
|
fromBlock: x + 1n,
|
|
4048
|
-
toBlock:
|
|
4021
|
+
toBlock: A,
|
|
4049
4022
|
strict: g
|
|
4050
|
-
}) :
|
|
4023
|
+
}) : $ = [], x = A;
|
|
4051
4024
|
}
|
|
4052
|
-
if (
|
|
4025
|
+
if ($.length === 0)
|
|
4053
4026
|
return;
|
|
4054
4027
|
if (s)
|
|
4055
|
-
w.onLogs(
|
|
4028
|
+
w.onLogs($);
|
|
4056
4029
|
else
|
|
4057
|
-
for (const
|
|
4058
|
-
w.onLogs([
|
|
4059
|
-
} catch (
|
|
4060
|
-
P &&
|
|
4030
|
+
for (const A of $)
|
|
4031
|
+
w.onLogs([A]);
|
|
4032
|
+
} catch ($) {
|
|
4033
|
+
P && $ instanceof $e && (M = !1), w.onError?.($);
|
|
4061
4034
|
}
|
|
4062
4035
|
}, {
|
|
4063
4036
|
emitOnBegin: !0,
|
|
4064
4037
|
interval: l
|
|
4065
4038
|
});
|
|
4066
4039
|
return async () => {
|
|
4067
|
-
P && await E(e, ls, "uninstallFilter")({ filter: P }),
|
|
4040
|
+
P && await E(e, ls, "uninstallFilter")({ filter: P }), O();
|
|
4068
4041
|
};
|
|
4069
4042
|
});
|
|
4070
4043
|
})() : (() => {
|
|
4071
|
-
const g = d ?? !1, h =
|
|
4044
|
+
const g = d ?? !1, h = te([
|
|
4072
4045
|
"watchContractEvent",
|
|
4073
4046
|
r,
|
|
4074
4047
|
a,
|
|
@@ -4079,61 +4052,61 @@ function Js(e, t) {
|
|
|
4079
4052
|
g
|
|
4080
4053
|
]);
|
|
4081
4054
|
let w = !0, x = () => w = !1;
|
|
4082
|
-
return
|
|
4055
|
+
return fn(h, { onLogs: u, onError: c }, (P) => ((async () => {
|
|
4083
4056
|
try {
|
|
4084
|
-
const
|
|
4057
|
+
const M = (() => {
|
|
4085
4058
|
if (e.transport.type === "fallback") {
|
|
4086
|
-
const
|
|
4087
|
-
return
|
|
4059
|
+
const A = e.transport.transports.find((F) => F.config.type === "webSocket" || F.config.type === "ipc");
|
|
4060
|
+
return A ? A.value : e.transport;
|
|
4088
4061
|
}
|
|
4089
4062
|
return e.transport;
|
|
4090
|
-
})(),
|
|
4063
|
+
})(), O = o ? at({
|
|
4091
4064
|
abi: n,
|
|
4092
4065
|
eventName: o,
|
|
4093
4066
|
args: a
|
|
4094
|
-
}) : [], { unsubscribe:
|
|
4095
|
-
params: ["logs", { address: r, topics:
|
|
4096
|
-
onData(
|
|
4067
|
+
}) : [], { unsubscribe: $ } = await M.subscribe({
|
|
4068
|
+
params: ["logs", { address: r, topics: O }],
|
|
4069
|
+
onData(A) {
|
|
4097
4070
|
if (!w)
|
|
4098
4071
|
return;
|
|
4099
|
-
const
|
|
4072
|
+
const F = A.result;
|
|
4100
4073
|
try {
|
|
4101
|
-
const { eventName:
|
|
4074
|
+
const { eventName: S, args: j } = Un({
|
|
4102
4075
|
abi: n,
|
|
4103
|
-
data:
|
|
4104
|
-
topics:
|
|
4076
|
+
data: F.data,
|
|
4077
|
+
topics: F.topics,
|
|
4105
4078
|
strict: d
|
|
4106
|
-
}),
|
|
4107
|
-
args:
|
|
4108
|
-
eventName:
|
|
4079
|
+
}), I = be(F, {
|
|
4080
|
+
args: j,
|
|
4081
|
+
eventName: S
|
|
4109
4082
|
});
|
|
4110
|
-
P.onLogs([
|
|
4111
|
-
} catch (
|
|
4112
|
-
let
|
|
4113
|
-
if (
|
|
4083
|
+
P.onLogs([I]);
|
|
4084
|
+
} catch (S) {
|
|
4085
|
+
let j, I;
|
|
4086
|
+
if (S instanceof ye || S instanceof Xe) {
|
|
4114
4087
|
if (d)
|
|
4115
4088
|
return;
|
|
4116
|
-
|
|
4089
|
+
j = S.abiItem.name, I = S.abiItem.inputs?.some((q) => !("name" in q && q.name));
|
|
4117
4090
|
}
|
|
4118
|
-
const
|
|
4119
|
-
args:
|
|
4120
|
-
eventName:
|
|
4091
|
+
const ae = be(F, {
|
|
4092
|
+
args: I ? [] : {},
|
|
4093
|
+
eventName: j
|
|
4121
4094
|
});
|
|
4122
|
-
P.onLogs([
|
|
4095
|
+
P.onLogs([ae]);
|
|
4123
4096
|
}
|
|
4124
4097
|
},
|
|
4125
|
-
onError(
|
|
4126
|
-
P.onError?.(
|
|
4098
|
+
onError(A) {
|
|
4099
|
+
P.onError?.(A);
|
|
4127
4100
|
}
|
|
4128
4101
|
});
|
|
4129
|
-
x =
|
|
4130
|
-
} catch (
|
|
4131
|
-
c?.(
|
|
4102
|
+
x = $, w || x();
|
|
4103
|
+
} catch (M) {
|
|
4104
|
+
c?.(M);
|
|
4132
4105
|
}
|
|
4133
4106
|
})(), () => x()));
|
|
4134
4107
|
})();
|
|
4135
4108
|
}
|
|
4136
|
-
class
|
|
4109
|
+
class t0 extends y {
|
|
4137
4110
|
constructor({ docsPath: t } = {}) {
|
|
4138
4111
|
super([
|
|
4139
4112
|
"Could not find an Account to execute with this Action.",
|
|
@@ -4146,7 +4119,7 @@ class e0 extends y {
|
|
|
4146
4119
|
});
|
|
4147
4120
|
}
|
|
4148
4121
|
}
|
|
4149
|
-
class
|
|
4122
|
+
class je extends y {
|
|
4150
4123
|
constructor({ docsPath: t, metaMessages: n, type: r }) {
|
|
4151
4124
|
super(`Account type "${r}" is not supported.`, {
|
|
4152
4125
|
docsPath: t,
|
|
@@ -4157,16 +4130,16 @@ class ke extends y {
|
|
|
4157
4130
|
}
|
|
4158
4131
|
function bs({ chain: e, currentChainId: t }) {
|
|
4159
4132
|
if (!e)
|
|
4160
|
-
throw new
|
|
4133
|
+
throw new w0();
|
|
4161
4134
|
if (t !== e.id)
|
|
4162
|
-
throw new
|
|
4135
|
+
throw new v0({ chain: e, currentChainId: t });
|
|
4163
4136
|
}
|
|
4164
4137
|
function ps(e, { docsPath: t, ...n }) {
|
|
4165
4138
|
const r = (() => {
|
|
4166
4139
|
const a = It(e, n);
|
|
4167
|
-
return a instanceof
|
|
4140
|
+
return a instanceof we ? e : a;
|
|
4168
4141
|
})();
|
|
4169
|
-
return new
|
|
4142
|
+
return new x0(r, {
|
|
4170
4143
|
docsPath: t,
|
|
4171
4144
|
...n
|
|
4172
4145
|
});
|
|
@@ -4177,21 +4150,21 @@ async function ys(e, { serializedTransaction: t }) {
|
|
|
4177
4150
|
params: [t]
|
|
4178
4151
|
}, { retryCount: 0 });
|
|
4179
4152
|
}
|
|
4180
|
-
const Re = new
|
|
4153
|
+
const Re = new P0(128);
|
|
4181
4154
|
async function ms(e, t) {
|
|
4182
4155
|
const { account: n = e.account, chain: r = e.chain, accessList: a, authorizationList: s, blobs: o, data: i, gas: c, gasPrice: u, maxFeePerBlobGas: f, maxFeePerGas: l, maxPriorityFeePerGas: d, nonce: b, type: m, value: p, ...g } = t;
|
|
4183
4156
|
if (typeof n > "u")
|
|
4184
|
-
throw new
|
|
4157
|
+
throw new t0({
|
|
4185
4158
|
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
4186
4159
|
});
|
|
4187
|
-
const h = n ?
|
|
4160
|
+
const h = n ? H(n) : null;
|
|
4188
4161
|
try {
|
|
4189
|
-
|
|
4162
|
+
Se(t);
|
|
4190
4163
|
const w = await (async () => {
|
|
4191
4164
|
if (t.to)
|
|
4192
4165
|
return t.to;
|
|
4193
4166
|
if (t.to !== null && s && s.length > 0)
|
|
4194
|
-
return await
|
|
4167
|
+
return await Nn({
|
|
4195
4168
|
authorization: s[0]
|
|
4196
4169
|
}).catch(() => {
|
|
4197
4170
|
throw new y("`to` is required. Could not infer from `authorizationList`.");
|
|
@@ -4199,19 +4172,19 @@ async function ms(e, t) {
|
|
|
4199
4172
|
})();
|
|
4200
4173
|
if (h?.type === "json-rpc" || h === null) {
|
|
4201
4174
|
let x;
|
|
4202
|
-
r !== null && (x = await E(e,
|
|
4175
|
+
r !== null && (x = await E(e, Ln, "getChainId")({}), bs({
|
|
4203
4176
|
currentChainId: x,
|
|
4204
4177
|
chain: r
|
|
4205
4178
|
}));
|
|
4206
|
-
const P = e.chain?.formatters?.transactionRequest?.format,
|
|
4179
|
+
const P = e.chain?.formatters?.transactionRequest?.format, O = (P || Tt)({
|
|
4207
4180
|
// Pick out extra data that might exist on the chain's transaction request type.
|
|
4208
4181
|
...Bt(g, { format: P }),
|
|
4209
4182
|
accessList: a,
|
|
4183
|
+
account: h,
|
|
4210
4184
|
authorizationList: s,
|
|
4211
4185
|
blobs: o,
|
|
4212
4186
|
chainId: x,
|
|
4213
4187
|
data: i,
|
|
4214
|
-
from: h?.address,
|
|
4215
4188
|
gas: c,
|
|
4216
4189
|
gasPrice: u,
|
|
4217
4190
|
maxFeePerBlobGas: f,
|
|
@@ -4221,29 +4194,29 @@ async function ms(e, t) {
|
|
|
4221
4194
|
to: w,
|
|
4222
4195
|
type: m,
|
|
4223
4196
|
value: p
|
|
4224
|
-
}),
|
|
4197
|
+
}, "sendTransaction"), $ = Re.get(e.uid), A = $ ? "wallet_sendTransaction" : "eth_sendTransaction";
|
|
4225
4198
|
try {
|
|
4226
4199
|
return await e.request({
|
|
4227
|
-
method:
|
|
4228
|
-
params: [
|
|
4200
|
+
method: A,
|
|
4201
|
+
params: [O]
|
|
4229
4202
|
}, { retryCount: 0 });
|
|
4230
|
-
} catch (
|
|
4231
|
-
if (
|
|
4232
|
-
throw
|
|
4233
|
-
const
|
|
4234
|
-
if (
|
|
4203
|
+
} catch (F) {
|
|
4204
|
+
if ($ === !1)
|
|
4205
|
+
throw F;
|
|
4206
|
+
const S = F;
|
|
4207
|
+
if (S.name === "InvalidInputRpcError" || S.name === "InvalidParamsRpcError" || S.name === "MethodNotFoundRpcError" || S.name === "MethodNotSupportedRpcError")
|
|
4235
4208
|
return await e.request({
|
|
4236
4209
|
method: "wallet_sendTransaction",
|
|
4237
|
-
params: [
|
|
4238
|
-
}, { retryCount: 0 }).then((
|
|
4239
|
-
const
|
|
4240
|
-
throw
|
|
4210
|
+
params: [O]
|
|
4211
|
+
}, { retryCount: 0 }).then((j) => (Re.set(e.uid, !0), j)).catch((j) => {
|
|
4212
|
+
const I = j;
|
|
4213
|
+
throw I.name === "MethodNotFoundRpcError" || I.name === "MethodNotSupportedRpcError" ? (Re.set(e.uid, !1), S) : I;
|
|
4241
4214
|
});
|
|
4242
|
-
throw
|
|
4215
|
+
throw S;
|
|
4243
4216
|
}
|
|
4244
4217
|
}
|
|
4245
4218
|
if (h?.type === "local") {
|
|
4246
|
-
const x = await E(e,
|
|
4219
|
+
const x = await E(e, Hn, "prepareTransactionRequest")({
|
|
4247
4220
|
account: h,
|
|
4248
4221
|
accessList: a,
|
|
4249
4222
|
authorizationList: s,
|
|
@@ -4257,141 +4230,147 @@ async function ms(e, t) {
|
|
|
4257
4230
|
maxPriorityFeePerGas: d,
|
|
4258
4231
|
nonce: b,
|
|
4259
4232
|
nonceManager: h.nonceManager,
|
|
4260
|
-
parameters: [...
|
|
4233
|
+
parameters: [..._n, "sidecars"],
|
|
4261
4234
|
type: m,
|
|
4262
4235
|
value: p,
|
|
4263
4236
|
...g,
|
|
4264
4237
|
to: w
|
|
4265
|
-
}), P = r?.serializers?.transaction,
|
|
4238
|
+
}), P = r?.serializers?.transaction, M = await h.signTransaction(x, {
|
|
4266
4239
|
serializer: P
|
|
4267
4240
|
});
|
|
4268
4241
|
return await E(e, ys, "sendRawTransaction")({
|
|
4269
|
-
serializedTransaction:
|
|
4242
|
+
serializedTransaction: M
|
|
4270
4243
|
});
|
|
4271
4244
|
}
|
|
4272
|
-
throw h?.type === "smart" ? new
|
|
4245
|
+
throw h?.type === "smart" ? new je({
|
|
4273
4246
|
metaMessages: [
|
|
4274
4247
|
"Consider using the `sendUserOperation` Action instead."
|
|
4275
4248
|
],
|
|
4276
4249
|
docsPath: "/docs/actions/bundler/sendUserOperation",
|
|
4277
4250
|
type: "smart"
|
|
4278
|
-
}) : new
|
|
4251
|
+
}) : new je({
|
|
4279
4252
|
docsPath: "/docs/actions/wallet/sendTransaction",
|
|
4280
4253
|
type: h?.type
|
|
4281
4254
|
});
|
|
4282
4255
|
} catch (w) {
|
|
4283
|
-
throw w instanceof
|
|
4256
|
+
throw w instanceof je ? w : ps(w, {
|
|
4284
4257
|
...t,
|
|
4285
4258
|
account: h,
|
|
4286
4259
|
chain: t.chain || void 0
|
|
4287
4260
|
});
|
|
4288
4261
|
}
|
|
4289
4262
|
}
|
|
4290
|
-
async function
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
}
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
to: a,
|
|
4305
|
-
account: u,
|
|
4306
|
-
...c
|
|
4307
|
-
});
|
|
4308
|
-
} catch (l) {
|
|
4309
|
-
throw Se(l, {
|
|
4310
|
-
abi: n,
|
|
4311
|
-
address: a,
|
|
4312
|
-
args: s,
|
|
4313
|
-
docsPath: "/docs/contract/writeContract",
|
|
4314
|
-
functionName: i,
|
|
4315
|
-
sender: u?.address
|
|
4263
|
+
async function Ve(e, t) {
|
|
4264
|
+
return Ve.internal(e, ms, "sendTransaction", t);
|
|
4265
|
+
}
|
|
4266
|
+
(function(e) {
|
|
4267
|
+
async function t(n, r, a, s) {
|
|
4268
|
+
const { abi: o, account: i = n.account, address: c, args: u, dataSuffix: f, functionName: l, ...d } = s;
|
|
4269
|
+
if (typeof i > "u")
|
|
4270
|
+
throw new t0({
|
|
4271
|
+
docsPath: "/docs/contract/writeContract"
|
|
4272
|
+
});
|
|
4273
|
+
const b = i ? H(i) : null, m = ue({
|
|
4274
|
+
abi: o,
|
|
4275
|
+
args: u,
|
|
4276
|
+
functionName: l
|
|
4316
4277
|
});
|
|
4278
|
+
try {
|
|
4279
|
+
return await E(n, r, a)({
|
|
4280
|
+
data: `${m}${f ? f.replace("0x", "") : ""}`,
|
|
4281
|
+
to: c,
|
|
4282
|
+
account: b,
|
|
4283
|
+
...d
|
|
4284
|
+
});
|
|
4285
|
+
} catch (p) {
|
|
4286
|
+
throw Ae(p, {
|
|
4287
|
+
abi: o,
|
|
4288
|
+
address: c,
|
|
4289
|
+
args: u,
|
|
4290
|
+
docsPath: "/docs/contract/writeContract",
|
|
4291
|
+
functionName: l,
|
|
4292
|
+
sender: b?.address
|
|
4293
|
+
});
|
|
4294
|
+
}
|
|
4317
4295
|
}
|
|
4318
|
-
|
|
4296
|
+
e.internal = t;
|
|
4297
|
+
})(Ve || (Ve = {}));
|
|
4319
4298
|
export {
|
|
4320
4299
|
as as $,
|
|
4321
4300
|
$s as A,
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4301
|
+
Y0 as B,
|
|
4302
|
+
ur as C,
|
|
4303
|
+
En as D,
|
|
4325
4304
|
vs as E,
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4305
|
+
k as F,
|
|
4306
|
+
Y as G,
|
|
4307
|
+
Ms as H,
|
|
4308
|
+
xr as I,
|
|
4330
4309
|
xs as J,
|
|
4331
4310
|
ws as K,
|
|
4332
|
-
|
|
4311
|
+
Rt as L,
|
|
4333
4312
|
za as M,
|
|
4334
|
-
|
|
4335
|
-
|
|
4313
|
+
L as N,
|
|
4314
|
+
Ue as O,
|
|
4336
4315
|
zs as P,
|
|
4337
4316
|
Ga as Q,
|
|
4338
4317
|
ue as R,
|
|
4339
|
-
|
|
4318
|
+
H as S,
|
|
4340
4319
|
lt as T,
|
|
4341
4320
|
mt as U,
|
|
4342
4321
|
Pt as V,
|
|
4343
|
-
|
|
4322
|
+
Ft as W,
|
|
4344
4323
|
ms as X,
|
|
4345
4324
|
ps as Y,
|
|
4346
4325
|
Ya as Z,
|
|
4347
|
-
|
|
4348
|
-
|
|
4326
|
+
fn as _,
|
|
4327
|
+
Fa as a,
|
|
4349
4328
|
Va as a$,
|
|
4350
|
-
|
|
4329
|
+
oa as a0,
|
|
4351
4330
|
Ka as a1,
|
|
4352
4331
|
qs as a2,
|
|
4353
4332
|
Ls as a3,
|
|
4354
|
-
|
|
4333
|
+
jt as a4,
|
|
4355
4334
|
Hs as a5,
|
|
4356
4335
|
_s as a6,
|
|
4357
|
-
|
|
4336
|
+
Se as a7,
|
|
4358
4337
|
Tt as a8,
|
|
4359
4338
|
Bt as a9,
|
|
4360
4339
|
ot as aA,
|
|
4361
|
-
|
|
4340
|
+
Fs as aB,
|
|
4362
4341
|
Fr as aC,
|
|
4363
4342
|
Ss as aD,
|
|
4364
4343
|
As as aE,
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4344
|
+
ne as aF,
|
|
4345
|
+
N as aG,
|
|
4346
|
+
js as aH,
|
|
4347
|
+
Kn as aI,
|
|
4348
|
+
ks as aJ,
|
|
4370
4349
|
Da as aK,
|
|
4371
4350
|
Os as aL,
|
|
4372
4351
|
Ns as aM,
|
|
4373
4352
|
se as aN,
|
|
4374
|
-
|
|
4375
|
-
|
|
4353
|
+
Ra as aO,
|
|
4354
|
+
Rs as aP,
|
|
4376
4355
|
fs as aQ,
|
|
4377
|
-
|
|
4378
|
-
|
|
4356
|
+
Ae as aR,
|
|
4357
|
+
cn as aS,
|
|
4379
4358
|
Za as aT,
|
|
4380
4359
|
Ye as aU,
|
|
4381
4360
|
kn as aV,
|
|
4382
4361
|
qa as aW,
|
|
4383
|
-
|
|
4362
|
+
zn as aX,
|
|
4384
4363
|
It as aY,
|
|
4385
4364
|
Gs as aZ,
|
|
4386
|
-
|
|
4365
|
+
$0 as a_,
|
|
4387
4366
|
Ja as aa,
|
|
4388
|
-
|
|
4367
|
+
Nr as ab,
|
|
4389
4368
|
at as ac,
|
|
4390
|
-
|
|
4391
|
-
|
|
4369
|
+
Vn as ad,
|
|
4370
|
+
Nn as ae,
|
|
4392
4371
|
bt as af,
|
|
4393
4372
|
Is as ag,
|
|
4394
|
-
|
|
4373
|
+
Mt as ah,
|
|
4395
4374
|
St as ai,
|
|
4396
4375
|
At as aj,
|
|
4397
4376
|
$t as ak,
|
|
@@ -4405,64 +4384,64 @@ export {
|
|
|
4405
4384
|
pt as as,
|
|
4406
4385
|
dt as at,
|
|
4407
4386
|
ft as au,
|
|
4408
|
-
|
|
4409
|
-
|
|
4387
|
+
$e as av,
|
|
4388
|
+
Ee as aw,
|
|
4410
4389
|
ut as ax,
|
|
4411
4390
|
ct as ay,
|
|
4412
4391
|
it as az,
|
|
4413
|
-
|
|
4414
|
-
|
|
4392
|
+
Ur as b,
|
|
4393
|
+
ba as b0,
|
|
4415
4394
|
Us as b1,
|
|
4416
4395
|
Vs as b2,
|
|
4417
|
-
|
|
4396
|
+
Xn as b3,
|
|
4418
4397
|
Ws as b4,
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4398
|
+
aa as b5,
|
|
4399
|
+
sa as b6,
|
|
4400
|
+
me as b7,
|
|
4401
|
+
Pa as b8,
|
|
4402
|
+
Un as b9,
|
|
4403
|
+
ye as ba,
|
|
4425
4404
|
Xe as bb,
|
|
4426
4405
|
ds as bc,
|
|
4427
|
-
|
|
4406
|
+
Ma as bd,
|
|
4428
4407
|
ls as be,
|
|
4429
4408
|
ys as bf,
|
|
4430
|
-
|
|
4431
|
-
|
|
4409
|
+
Hn as bg,
|
|
4410
|
+
Ea as bh,
|
|
4432
4411
|
Bs as bi,
|
|
4433
|
-
|
|
4412
|
+
Gn as bj,
|
|
4434
4413
|
Ts as bk,
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4414
|
+
Ln as bl,
|
|
4415
|
+
qn as bm,
|
|
4416
|
+
t0 as bn,
|
|
4417
|
+
bs as bo,
|
|
4418
|
+
_n as bp,
|
|
4419
|
+
je as bq,
|
|
4441
4420
|
Xa as br,
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4421
|
+
On as bs,
|
|
4422
|
+
zr as c,
|
|
4423
|
+
Ve as d,
|
|
4424
|
+
Cs as e,
|
|
4446
4425
|
st as f,
|
|
4447
4426
|
E as g,
|
|
4448
|
-
|
|
4449
|
-
|
|
4427
|
+
te as h,
|
|
4428
|
+
Qr as i,
|
|
4450
4429
|
$a as j,
|
|
4451
|
-
|
|
4430
|
+
Qn as k,
|
|
4452
4431
|
Qe as l,
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4432
|
+
dn as m,
|
|
4433
|
+
D as n,
|
|
4434
|
+
Pe as o,
|
|
4456
4435
|
ce as p,
|
|
4457
4436
|
Es as q,
|
|
4458
4437
|
Zs as r,
|
|
4459
4438
|
Ks as s,
|
|
4460
4439
|
rt as t,
|
|
4461
4440
|
Ps as u,
|
|
4462
|
-
|
|
4441
|
+
pe as v,
|
|
4463
4442
|
Js as w,
|
|
4464
|
-
|
|
4443
|
+
hr as x,
|
|
4465
4444
|
Ds as y,
|
|
4466
|
-
|
|
4445
|
+
Lr as z
|
|
4467
4446
|
};
|
|
4468
|
-
//# sourceMappingURL=writeContract-
|
|
4447
|
+
//# sourceMappingURL=writeContract-BFxyLFA9.js.map
|