@coinbase/cdp-hooks 0.0.18 → 0.0.20
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/README.md +13 -5
- package/dist/esm/index.js +21 -18
- package/dist/esm/index10.js +6 -0
- package/dist/esm/index100.js +196 -0
- package/dist/esm/index101.js +11 -0
- package/dist/esm/index102.js +4 -0
- package/dist/esm/index103.js +15 -0
- package/dist/esm/index104.js +21 -0
- package/dist/esm/index105.js +30 -0
- package/dist/esm/index106.js +11 -0
- package/dist/esm/index107.js +58 -0
- package/dist/esm/index108.js +48 -0
- package/dist/esm/index109.js +11 -0
- package/dist/esm/index11.js +12 -0
- package/dist/esm/index110.js +10 -0
- package/dist/esm/index111.js +19 -0
- package/dist/esm/index112.js +21 -0
- package/dist/esm/index113.js +27 -0
- package/dist/esm/index114.js +19 -0
- package/dist/esm/index115.js +57 -0
- package/dist/esm/index116.js +14 -0
- package/dist/esm/index117.js +163 -0
- package/dist/esm/index118.js +24 -0
- package/dist/esm/index119.js +130 -0
- package/dist/esm/index12.js +71 -0
- package/dist/esm/index120.js +41 -0
- package/dist/esm/index121.js +9 -0
- package/dist/esm/index122.js +30 -0
- package/dist/esm/index123.js +194 -0
- package/dist/esm/index124.js +6 -0
- package/dist/esm/index125.js +67 -0
- package/dist/esm/index126.js +5 -0
- package/dist/esm/index127.js +23 -0
- package/dist/esm/index128.js +19 -0
- package/dist/esm/index129.js +26 -0
- package/dist/esm/index13.js +12 -0
- package/dist/esm/index130.js +14 -0
- package/dist/esm/index131.js +37 -0
- package/dist/esm/index132.js +5 -0
- package/dist/esm/index133.js +21 -0
- package/dist/esm/index134.js +30 -0
- package/dist/esm/index135.js +38 -0
- package/dist/esm/index136.js +10 -0
- package/dist/esm/index137.js +28 -0
- package/dist/esm/index138.js +31 -0
- package/dist/esm/index139.js +67 -0
- package/dist/esm/index14.js +31 -0
- package/dist/esm/index140.js +12 -0
- package/dist/esm/index141.js +36 -0
- package/dist/esm/index142.js +30 -0
- package/dist/esm/index143.js +27 -0
- package/dist/esm/index144.js +6 -0
- package/dist/esm/index145.js +17 -0
- package/dist/esm/index146.js +106 -0
- package/dist/esm/index147.js +67 -0
- package/dist/esm/index148.js +8 -0
- package/dist/esm/index149.js +9 -0
- package/dist/esm/index15.js +73 -0
- package/dist/esm/index150.js +30 -0
- package/dist/esm/index151.js +42 -0
- package/dist/esm/index152.js +16 -0
- package/dist/esm/index153.js +45 -0
- package/dist/esm/index154.js +8 -0
- package/dist/esm/index155.js +14 -0
- package/dist/esm/index156.js +22 -0
- package/dist/esm/index157.js +81 -0
- package/dist/esm/index158.js +4 -0
- package/dist/esm/index159.js +40 -0
- package/dist/esm/index16.js +22 -0
- package/dist/esm/index160.js +113 -0
- package/dist/esm/index161.js +51 -0
- package/dist/esm/index162.js +35 -0
- package/dist/esm/index163.js +11 -0
- package/dist/esm/index164.js +9 -0
- package/dist/esm/index165.js +9 -0
- package/dist/esm/index166.js +14 -0
- package/dist/esm/index167.js +13 -0
- package/dist/esm/index168.js +16 -0
- package/dist/esm/index169.js +35 -0
- package/dist/esm/index17.js +113 -0
- package/dist/esm/index170.js +7 -0
- package/dist/esm/index171.js +11 -0
- package/dist/esm/index172.js +22 -0
- package/dist/esm/index173.js +34 -0
- package/dist/esm/index174.js +23 -0
- package/dist/esm/index175.js +6 -0
- package/dist/esm/index176.js +20 -0
- package/dist/esm/index177.js +13 -0
- package/dist/esm/index178.js +24 -0
- package/dist/esm/index179.js +25 -0
- package/dist/esm/index18.js +63 -0
- package/dist/esm/index180.js +8 -0
- package/dist/esm/index181.js +8 -0
- package/dist/esm/index182.js +11 -0
- package/dist/esm/index183.js +107 -0
- package/dist/esm/index184.js +5 -0
- package/dist/esm/index185.js +21 -0
- package/dist/esm/index186.js +174 -0
- package/dist/esm/index187.js +20 -0
- package/dist/esm/index188.js +12 -0
- package/dist/esm/index189.js +43 -0
- package/dist/esm/index19.js +27 -0
- package/dist/esm/index190.js +4 -0
- package/dist/esm/index191.js +7 -0
- package/dist/esm/index192.js +13 -0
- package/dist/esm/index193.js +22 -0
- package/dist/esm/index194.js +10 -0
- package/dist/esm/index195.js +14 -0
- package/dist/esm/index196.js +69 -0
- package/dist/esm/index197.js +68 -0
- package/dist/esm/index198.js +188 -0
- package/dist/esm/index199.js +25 -0
- package/dist/esm/index20.js +43 -0
- package/dist/esm/index200.js +45 -0
- package/dist/esm/index201.js +79 -0
- package/dist/esm/index202.js +43 -0
- package/dist/esm/index203.js +19 -0
- package/dist/esm/index204.js +16 -0
- package/dist/esm/index205.js +39 -0
- package/dist/esm/index206.js +18 -0
- package/dist/esm/index207.js +11 -0
- package/dist/esm/index208.js +15 -0
- package/dist/esm/index209.js +12 -0
- package/dist/esm/index21.js +40 -0
- package/dist/esm/index210.js +19 -0
- package/dist/esm/index211.js +10 -0
- package/dist/esm/index212.js +25 -0
- package/dist/esm/index213.js +33 -0
- package/dist/esm/index214.js +4 -0
- package/dist/esm/index215.js +16 -0
- package/dist/esm/index216.js +15 -0
- package/dist/esm/index217.js +50 -0
- package/dist/esm/index218.js +9 -0
- package/dist/esm/index219.js +12 -0
- package/dist/esm/index22.js +61 -0
- package/dist/esm/index220.js +16 -0
- package/dist/esm/index221.js +17 -0
- package/dist/esm/index222.js +11 -0
- package/dist/esm/index223.js +18 -0
- package/dist/esm/index224.js +27 -0
- package/dist/esm/index225.js +14 -0
- package/dist/esm/index226.js +27 -0
- package/dist/esm/index227.js +54 -0
- package/dist/esm/index228.js +20 -0
- package/dist/esm/index229.js +17 -0
- package/dist/esm/index23.js +166 -0
- package/dist/esm/index230.js +14 -0
- package/dist/esm/index231.js +106 -0
- package/dist/esm/index232.js +9 -0
- package/dist/esm/index233.js +227 -0
- package/dist/esm/index234.js +9 -0
- package/dist/esm/index235.js +9 -0
- package/dist/esm/index236.js +29 -0
- package/dist/esm/index237.js +22 -0
- package/dist/esm/index238.js +149 -0
- package/dist/esm/index239.js +15 -0
- package/dist/esm/index24.js +42 -0
- package/dist/esm/index240.js +38 -0
- package/dist/esm/index241.js +44 -0
- package/dist/esm/index242.js +71 -0
- package/dist/esm/index243.js +6 -0
- package/dist/esm/index244.js +139 -0
- package/dist/esm/index245.js +158 -0
- package/dist/esm/index246.js +12 -0
- package/dist/esm/index247.js +19 -0
- package/dist/esm/index248.js +116 -0
- package/dist/esm/index249.js +137 -0
- package/dist/esm/index25.js +12 -0
- package/dist/esm/index250.js +81 -0
- package/dist/esm/index251.js +4 -0
- package/dist/esm/index252.js +701 -0
- package/dist/esm/index253.js +142 -0
- package/dist/esm/index254.js +45 -0
- package/dist/esm/index255.js +204 -0
- package/dist/esm/index256.js +68 -0
- package/dist/esm/index257.js +7 -0
- package/dist/esm/index258.js +43 -0
- package/dist/esm/index259.js +10 -0
- package/dist/esm/index26.js +34 -0
- package/dist/esm/index260.js +65 -0
- package/dist/esm/index261.js +80 -0
- package/dist/esm/index262.js +6 -0
- package/dist/esm/index263.js +197 -0
- package/dist/esm/index264.js +66 -0
- package/dist/esm/index265.js +47 -0
- package/dist/esm/index266.js +7 -0
- package/dist/esm/index267.js +7 -0
- package/dist/esm/index268.js +4 -0
- package/dist/esm/index269.js +24 -0
- package/dist/esm/index27.js +39 -0
- package/dist/esm/index28.js +12 -0
- package/dist/esm/index29.js +32 -0
- package/dist/esm/index3.js +65 -36
- package/dist/esm/index30.js +49 -0
- package/dist/esm/index31.js +91 -0
- package/dist/esm/index32.js +43 -0
- package/dist/esm/index33.js +11 -0
- package/dist/esm/index34.js +9 -0
- package/dist/esm/index35.js +19 -0
- package/dist/esm/index36.js +11 -0
- package/dist/esm/index37.js +16 -0
- package/dist/esm/index38.js +10 -0
- package/dist/esm/index39.js +12 -0
- package/dist/esm/index4.js +20 -0
- package/dist/esm/index40.js +19 -0
- package/dist/esm/index41.js +49 -0
- package/dist/esm/index42.js +16 -0
- package/dist/esm/index43.js +19 -0
- package/dist/esm/index44.js +16 -0
- package/dist/esm/index45.js +9 -0
- package/dist/esm/index46.js +38 -0
- package/dist/esm/index47.js +12 -0
- package/dist/esm/index48.js +11 -0
- package/dist/esm/index49.js +28 -0
- package/dist/esm/index5.js +14 -0
- package/dist/esm/index50.js +13 -0
- package/dist/esm/index51.js +17 -0
- package/dist/esm/index52.js +14 -0
- package/dist/esm/index53.js +119 -0
- package/dist/esm/index54.js +36 -0
- package/dist/esm/index55.js +82 -0
- package/dist/esm/index56.js +180 -0
- package/dist/esm/index57.js +47 -0
- package/dist/esm/index58.js +9 -0
- package/dist/esm/index59.js +16 -0
- package/dist/esm/index6.js +56 -0
- package/dist/esm/index60.js +16 -0
- package/dist/esm/index61.js +102 -0
- package/dist/esm/index62.js +75 -0
- package/dist/esm/index63.js +90 -0
- package/dist/esm/index64.js +151 -0
- package/dist/esm/index65.js +139 -0
- package/dist/esm/index66.js +71 -0
- package/dist/esm/index67.js +26 -0
- package/dist/esm/index68.js +108 -0
- package/dist/esm/index69.js +9 -0
- package/dist/esm/index7.js +60 -0
- package/dist/esm/index70.js +134 -0
- package/dist/esm/index71.js +278 -0
- package/dist/esm/index72.js +5 -0
- package/dist/esm/index73.js +6 -0
- package/dist/esm/index74.js +11 -0
- package/dist/esm/index75.js +4 -0
- package/dist/esm/index76.js +4 -0
- package/dist/esm/index77.js +5 -0
- package/dist/esm/index78.js +329 -0
- package/dist/esm/index79.js +16 -0
- package/dist/esm/index8.js +58 -0
- package/dist/esm/index80.js +7 -0
- package/dist/esm/index81.js +58 -0
- package/dist/esm/index82.js +4 -0
- package/dist/esm/index83.js +10 -0
- package/dist/esm/index84.js +217 -0
- package/dist/esm/index85.js +34 -0
- package/dist/esm/index86.js +24 -0
- package/dist/esm/index87.js +8 -0
- package/dist/esm/index88.js +76 -0
- package/dist/esm/index89.js +8 -0
- package/dist/esm/index9.js +35 -0
- package/dist/esm/index90.js +8 -0
- package/dist/esm/index91.js +38 -0
- package/dist/esm/index92.js +78 -0
- package/dist/esm/index93.js +5 -0
- package/dist/esm/index94.js +26 -0
- package/dist/esm/index95.js +454 -0
- package/dist/esm/index96.js +33 -0
- package/dist/esm/index97.js +29 -0
- package/dist/esm/index98.js +36 -0
- package/dist/esm/index99.js +37 -0
- package/dist/types/index.d.ts +39 -3
- package/package.json +3 -3
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { parseAvatarUri as o, parseNftUri as f, getNftTokenUri as v, resolveAvatarUri as l, getJsonImage as A, getMetadataAvatarUri as N } from "./index244.js";
|
|
2
|
+
async function b(r, { gatewayUrls: t, record: e }) {
|
|
3
|
+
return /eip155:/i.test(e) ? U(r, { gatewayUrls: t, record: e }) : o({ uri: e, gatewayUrls: t });
|
|
4
|
+
}
|
|
5
|
+
async function U(r, { gatewayUrls: t, record: e }) {
|
|
6
|
+
const i = f(e), s = await v(r, { nft: i }), { uri: a, isOnChain: c, isEncoded: p } = l({ uri: s, gatewayUrls: t });
|
|
7
|
+
if (c && (a.includes("data:application/json;base64,") || a.startsWith("{"))) {
|
|
8
|
+
const d = p ? (
|
|
9
|
+
// if it is encoded, decode it
|
|
10
|
+
atob(a.replace("data:application/json;base64,", ""))
|
|
11
|
+
) : (
|
|
12
|
+
// if it isn't encoded assume it is a JSON string, but it could be anything (it will error if it is)
|
|
13
|
+
a
|
|
14
|
+
), u = JSON.parse(d);
|
|
15
|
+
return o({ uri: A(u), gatewayUrls: t });
|
|
16
|
+
}
|
|
17
|
+
let n = i.tokenID;
|
|
18
|
+
return i.namespace === "erc1155" && (n = n.replace("0x", "").padStart(64, "0")), N({
|
|
19
|
+
gatewayUrls: t,
|
|
20
|
+
uri: a.replace(/(?:0x)?{id}/, n)
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
b as parseAvatarRecord
|
|
25
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { fromNumber as a } from "./index245.js";
|
|
2
|
+
import { toRpc as e } from "./index246.js";
|
|
3
|
+
function n(t) {
|
|
4
|
+
return {
|
|
5
|
+
...typeof t.baseFeePerGas == "bigint" && {
|
|
6
|
+
baseFeePerGas: a(t.baseFeePerGas)
|
|
7
|
+
},
|
|
8
|
+
...typeof t.blobBaseFee == "bigint" && {
|
|
9
|
+
blobBaseFee: a(t.blobBaseFee)
|
|
10
|
+
},
|
|
11
|
+
...typeof t.feeRecipient == "string" && {
|
|
12
|
+
feeRecipient: t.feeRecipient
|
|
13
|
+
},
|
|
14
|
+
...typeof t.gasLimit == "bigint" && {
|
|
15
|
+
gasLimit: a(t.gasLimit)
|
|
16
|
+
},
|
|
17
|
+
...typeof t.number == "bigint" && {
|
|
18
|
+
number: a(t.number)
|
|
19
|
+
},
|
|
20
|
+
...typeof t.prevRandao == "bigint" && {
|
|
21
|
+
prevRandao: a(t.prevRandao)
|
|
22
|
+
},
|
|
23
|
+
...typeof t.time == "bigint" && {
|
|
24
|
+
time: a(t.time)
|
|
25
|
+
},
|
|
26
|
+
...t.withdrawals && {
|
|
27
|
+
withdrawals: t.withdrawals.map(e)
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
n as toRpc
|
|
33
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CallExecutionError as c } from "./index84.js";
|
|
2
|
+
import { UnknownNodeError as i } from "./index100.js";
|
|
3
|
+
import { getNodeError as u } from "./index224.js";
|
|
4
|
+
function a(r, { docsPath: t, ...o }) {
|
|
5
|
+
const e = (() => {
|
|
6
|
+
const n = u(r, o);
|
|
7
|
+
return n instanceof i ? r : n;
|
|
8
|
+
})();
|
|
9
|
+
return new c(e, {
|
|
10
|
+
docsPath: t,
|
|
11
|
+
...o
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
a as getCallError
|
|
16
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function y(t, { format: r }) {
|
|
2
|
+
if (!r)
|
|
3
|
+
return {};
|
|
4
|
+
const e = {};
|
|
5
|
+
function i(c) {
|
|
6
|
+
const s = Object.keys(c);
|
|
7
|
+
for (const n of s)
|
|
8
|
+
n in t && (e[n] = t[n]), c[n] && typeof c[n] == "object" && !Array.isArray(c[n]) && i(c[n]);
|
|
9
|
+
}
|
|
10
|
+
const o = r(t || {});
|
|
11
|
+
return i(o), e;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
y as extract
|
|
15
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { InvalidAddressError as a } from "./index103.js";
|
|
2
|
+
import { InvalidBytesLengthError as d } from "./index104.js";
|
|
3
|
+
import { AccountStateConflictError as u, StateAssignmentConflictError as h } from "./index91.js";
|
|
4
|
+
import { isAddress as l } from "./index130.js";
|
|
5
|
+
import { numberToHex as c } from "./index108.js";
|
|
6
|
+
function s(r) {
|
|
7
|
+
if (!(!r || r.length === 0))
|
|
8
|
+
return r.reduce((t, { slot: e, value: n }) => {
|
|
9
|
+
if (e.length !== 66)
|
|
10
|
+
throw new d({
|
|
11
|
+
size: e.length,
|
|
12
|
+
targetSize: 66,
|
|
13
|
+
type: "hex"
|
|
14
|
+
});
|
|
15
|
+
if (n.length !== 66)
|
|
16
|
+
throw new d({
|
|
17
|
+
size: n.length,
|
|
18
|
+
targetSize: 66,
|
|
19
|
+
type: "hex"
|
|
20
|
+
});
|
|
21
|
+
return t[e] = n, t;
|
|
22
|
+
}, {});
|
|
23
|
+
}
|
|
24
|
+
function m(r) {
|
|
25
|
+
const { balance: t, nonce: e, state: n, stateDiff: o, code: f } = r, i = {};
|
|
26
|
+
if (f !== void 0 && (i.code = f), t !== void 0 && (i.balance = c(t)), e !== void 0 && (i.nonce = c(e)), n !== void 0 && (i.state = s(n)), o !== void 0) {
|
|
27
|
+
if (i.state)
|
|
28
|
+
throw new h();
|
|
29
|
+
i.stateDiff = s(o);
|
|
30
|
+
}
|
|
31
|
+
return i;
|
|
32
|
+
}
|
|
33
|
+
function A(r) {
|
|
34
|
+
if (!r)
|
|
35
|
+
return;
|
|
36
|
+
const t = {};
|
|
37
|
+
for (const { address: e, ...n } of r) {
|
|
38
|
+
if (!l(e, { strict: !1 }))
|
|
39
|
+
throw new a({ address: e });
|
|
40
|
+
if (t[e])
|
|
41
|
+
throw new u({ address: e });
|
|
42
|
+
t[e] = m(n);
|
|
43
|
+
}
|
|
44
|
+
return t;
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
m as serializeAccountStateOverride,
|
|
48
|
+
s as serializeStateMapping,
|
|
49
|
+
A as serializeStateOverride
|
|
50
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
function u(e, { method: r }) {
|
|
2
|
+
const t = {};
|
|
3
|
+
return e.transport.type === "fallback" && e.transport.onResponse?.(({ method: s, response: o, status: p, transport: n }) => {
|
|
4
|
+
p === "success" && r === s && (t[o] = n.request);
|
|
5
|
+
}), (s) => t[s] || e.request;
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
u as createFilterRequestScope
|
|
9
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { recoverAddress as i } from "./index148.js";
|
|
2
|
+
import { hashAuthorization as e } from "./index247.js";
|
|
3
|
+
async function a(o) {
|
|
4
|
+
const { authorization: r, signature: t } = o;
|
|
5
|
+
return i({
|
|
6
|
+
hash: e(r),
|
|
7
|
+
signature: t ?? r
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
a as recoverAuthorizationAddress
|
|
12
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { textResolverAbi as l, universalResolverResolveAbi as h } from "./index71.js";
|
|
2
|
+
import { decodeFunctionResult as p } from "./index129.js";
|
|
3
|
+
import { encodeFunctionData as A } from "./index136.js";
|
|
4
|
+
import { getChainContractAddress as R } from "./index172.js";
|
|
5
|
+
import { toHex as b } from "./index108.js";
|
|
6
|
+
import { isNullUniversalResolverError as g } from "./index209.js";
|
|
7
|
+
import { localBatchGatewayUrl as w } from "./index162.js";
|
|
8
|
+
import { namehash as x } from "./index111.js";
|
|
9
|
+
import { packetToBytes as C } from "./index210.js";
|
|
10
|
+
import { getAction as y } from "./index211.js";
|
|
11
|
+
import { readContract as N } from "./index54.js";
|
|
12
|
+
async function j(n, e) {
|
|
13
|
+
const { blockNumber: s, blockTag: m, key: d, name: t, gatewayUrls: u, strict: f } = e, { chain: o } = n, v = (() => {
|
|
14
|
+
if (e.universalResolverAddress)
|
|
15
|
+
return e.universalResolverAddress;
|
|
16
|
+
if (!o)
|
|
17
|
+
throw new Error("client chain not configured. universalResolverAddress is required.");
|
|
18
|
+
return R({
|
|
19
|
+
blockNumber: s,
|
|
20
|
+
chain: o,
|
|
21
|
+
contract: "ensUniversalResolver"
|
|
22
|
+
});
|
|
23
|
+
})(), a = o?.ensTlds;
|
|
24
|
+
if (a && !a.some((r) => t.endsWith(r)))
|
|
25
|
+
return null;
|
|
26
|
+
try {
|
|
27
|
+
const r = {
|
|
28
|
+
address: v,
|
|
29
|
+
abi: h,
|
|
30
|
+
functionName: "resolve",
|
|
31
|
+
args: [
|
|
32
|
+
b(C(t)),
|
|
33
|
+
A({
|
|
34
|
+
abi: l,
|
|
35
|
+
functionName: "text",
|
|
36
|
+
args: [x(t), d]
|
|
37
|
+
}),
|
|
38
|
+
u ?? [w]
|
|
39
|
+
],
|
|
40
|
+
blockNumber: s,
|
|
41
|
+
blockTag: m
|
|
42
|
+
}, i = await y(n, N, "readContract")(r);
|
|
43
|
+
if (i[0] === "0x")
|
|
44
|
+
return null;
|
|
45
|
+
const c = p({
|
|
46
|
+
abi: l,
|
|
47
|
+
functionName: "text",
|
|
48
|
+
data: i[0]
|
|
49
|
+
});
|
|
50
|
+
return c === "" ? null : c;
|
|
51
|
+
} catch (r) {
|
|
52
|
+
if (f)
|
|
53
|
+
throw r;
|
|
54
|
+
if (g(r, "resolve"))
|
|
55
|
+
return null;
|
|
56
|
+
throw r;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
j as getEnsText
|
|
61
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EstimateGasExecutionError as i } from "./index99.js";
|
|
2
|
+
import { UnknownNodeError as m } from "./index100.js";
|
|
3
|
+
import { getNodeError as s } from "./index224.js";
|
|
4
|
+
function a(r, { docsPath: e, ...o }) {
|
|
5
|
+
const n = (() => {
|
|
6
|
+
const t = s(r, o);
|
|
7
|
+
return t instanceof m ? r : t;
|
|
8
|
+
})();
|
|
9
|
+
return new i(n, {
|
|
10
|
+
docsPath: e,
|
|
11
|
+
...o
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
a as getEstimateGasError
|
|
16
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseError as t } from "./index81.js";
|
|
2
|
+
class r extends t {
|
|
3
|
+
constructor({ address: o }) {
|
|
4
|
+
super(`No EIP-712 domain found on contract "${o}".`, {
|
|
5
|
+
metaMessages: [
|
|
6
|
+
"Ensure that:",
|
|
7
|
+
`- The contract is deployed at the address "${o}".`,
|
|
8
|
+
"- `eip712Domain()` function exists on the contract.",
|
|
9
|
+
"- `eip712Domain()` function matches signature to ERC-5267 specification."
|
|
10
|
+
],
|
|
11
|
+
name: "Eip712DomainNotFoundError"
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
r as Eip712DomainNotFoundError
|
|
17
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function r(a) {
|
|
2
|
+
return {
|
|
3
|
+
baseFeePerGas: a.baseFeePerGas.map((e) => BigInt(e)),
|
|
4
|
+
gasUsedRatio: a.gasUsedRatio,
|
|
5
|
+
oldestBlock: BigInt(a.oldestBlock),
|
|
6
|
+
reward: a.reward?.map((e) => e.map((t) => BigInt(t)))
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
r as formatFeeHistory
|
|
11
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { hexToNumber as a } from "./index141.js";
|
|
2
|
+
function t(e) {
|
|
3
|
+
return e.map((n) => ({
|
|
4
|
+
...n,
|
|
5
|
+
value: BigInt(n.value)
|
|
6
|
+
}));
|
|
7
|
+
}
|
|
8
|
+
function o(e) {
|
|
9
|
+
return {
|
|
10
|
+
...e,
|
|
11
|
+
balance: e.balance ? BigInt(e.balance) : void 0,
|
|
12
|
+
nonce: e.nonce ? a(e.nonce) : void 0,
|
|
13
|
+
storageProof: e.storageProof ? t(e.storageProof) : void 0
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
o as formatProof
|
|
18
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { BaseError as a } from "./index81.js";
|
|
2
|
+
import { ExecutionRevertedError as s, FeeCapTooHighError as r, FeeCapTooLowError as i, NonceTooHighError as c, NonceTooLowError as u, NonceMaxValueError as d, InsufficientFundsError as f, IntrinsicGasTooHighError as w, IntrinsicGasTooLowError as E, TransactionTypeNotSupportedError as m, TipAboveFeeCapError as g, UnknownNodeError as F } from "./index100.js";
|
|
3
|
+
function G(e, n) {
|
|
4
|
+
const o = (e.details || "").toLowerCase(), t = e instanceof a ? e.walk((x) => x?.code === s.code) : e;
|
|
5
|
+
return t instanceof a ? new s({
|
|
6
|
+
cause: e,
|
|
7
|
+
message: t.details
|
|
8
|
+
}) : s.nodeMessage.test(o) ? new s({
|
|
9
|
+
cause: e,
|
|
10
|
+
message: e.details
|
|
11
|
+
}) : r.nodeMessage.test(o) ? new r({
|
|
12
|
+
cause: e,
|
|
13
|
+
maxFeePerGas: n?.maxFeePerGas
|
|
14
|
+
}) : i.nodeMessage.test(o) ? new i({
|
|
15
|
+
cause: e,
|
|
16
|
+
maxFeePerGas: n?.maxFeePerGas
|
|
17
|
+
}) : c.nodeMessage.test(o) ? new c({ cause: e, nonce: n?.nonce }) : u.nodeMessage.test(o) ? new u({ cause: e, nonce: n?.nonce }) : d.nodeMessage.test(o) ? new d({ cause: e, nonce: n?.nonce }) : f.nodeMessage.test(o) ? new f({ cause: e }) : w.nodeMessage.test(o) ? new w({ cause: e, gas: n?.gas }) : E.nodeMessage.test(o) ? new E({ cause: e, gas: n?.gas }) : m.nodeMessage.test(o) ? new m({ cause: e }) : g.nodeMessage.test(o) ? new g({
|
|
18
|
+
cause: e,
|
|
19
|
+
maxFeePerGas: n?.maxFeePerGas,
|
|
20
|
+
maxPriorityFeePerGas: n?.maxPriorityFeePerGas
|
|
21
|
+
}) : new F({
|
|
22
|
+
cause: e
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
G as getNodeError
|
|
27
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { from as t } from "./index248.js";
|
|
2
|
+
import { encode as m } from "./index249.js";
|
|
3
|
+
import { concat as c } from "./index245.js";
|
|
4
|
+
function s(o, e) {
|
|
5
|
+
const { bytecode: r, args: n } = e;
|
|
6
|
+
return c(r, o.inputs?.length && n?.length ? m(o.inputs, n) : "0x");
|
|
7
|
+
}
|
|
8
|
+
function u(o) {
|
|
9
|
+
return t(o);
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
s as encode,
|
|
13
|
+
u as from
|
|
14
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { from as c, fromAbi as m, NotFoundError as i, getSelector as s } from "./index248.js";
|
|
2
|
+
import { encode as u } from "./index249.js";
|
|
3
|
+
import { concat as d } from "./index245.js";
|
|
4
|
+
function S(o, ...t) {
|
|
5
|
+
const { overloads: r } = o, e = r ? p([o, ...r], o.name, {
|
|
6
|
+
args: t[0]
|
|
7
|
+
}) : o, n = l(e), f = t.length > 0 ? u(e.inputs, t[0]) : void 0;
|
|
8
|
+
return f ? d(n, f) : n;
|
|
9
|
+
}
|
|
10
|
+
function $(o, t = {}) {
|
|
11
|
+
return c(o, t);
|
|
12
|
+
}
|
|
13
|
+
function p(o, t, r) {
|
|
14
|
+
const e = m(o, t, r);
|
|
15
|
+
if (e.type !== "function")
|
|
16
|
+
throw new i({ name: t, type: "function" });
|
|
17
|
+
return e;
|
|
18
|
+
}
|
|
19
|
+
function l(o) {
|
|
20
|
+
return s(o);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
S as encodeData,
|
|
24
|
+
$ as from,
|
|
25
|
+
p as fromAbi,
|
|
26
|
+
l as getSelector
|
|
27
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { universalSignatureValidatorAbi as d } from "./index71.js";
|
|
2
|
+
import { universalSignatureValidatorByteCode as l } from "./index73.js";
|
|
3
|
+
import { CallExecutionError as g } from "./index84.js";
|
|
4
|
+
import { encodeDeployData as y } from "./index133.js";
|
|
5
|
+
import { getAddress as S } from "./index118.js";
|
|
6
|
+
import { isAddressEqual as h } from "./index140.js";
|
|
7
|
+
import { isHex as v } from "./index144.js";
|
|
8
|
+
import { bytesToHex as x } from "./index108.js";
|
|
9
|
+
import { getAction as b } from "./index211.js";
|
|
10
|
+
import { isErc6492Signature as A } from "./index154.js";
|
|
11
|
+
import { recoverAddress as w } from "./index148.js";
|
|
12
|
+
import { serializeErc6492Signature as E } from "./index155.js";
|
|
13
|
+
import { serializeSignature as V } from "./index152.js";
|
|
14
|
+
import { call as D } from "./index23.js";
|
|
15
|
+
import { encodeFunctionData as H } from "./index136.js";
|
|
16
|
+
import { hexToBool as z } from "./index141.js";
|
|
17
|
+
async function Q(o, p) {
|
|
18
|
+
const { address: i, factory: n, factoryData: s, hash: a, signature: r, universalSignatureVerifierAddress: f = o.chain?.contracts?.universalSignatureVerifier?.address, ...m } = p, t = v(r) ? r : typeof r == "object" && "r" in r && "s" in r ? V(r) : x(r), c = await (async () => !n && !s || A(t) ? t : E({
|
|
19
|
+
address: n,
|
|
20
|
+
data: s,
|
|
21
|
+
signature: t
|
|
22
|
+
}))();
|
|
23
|
+
try {
|
|
24
|
+
const e = f ? {
|
|
25
|
+
to: f,
|
|
26
|
+
data: H({
|
|
27
|
+
abi: d,
|
|
28
|
+
functionName: "isValidSig",
|
|
29
|
+
args: [i, a, c]
|
|
30
|
+
}),
|
|
31
|
+
...m
|
|
32
|
+
} : {
|
|
33
|
+
data: y({
|
|
34
|
+
abi: d,
|
|
35
|
+
args: [i, a, c],
|
|
36
|
+
bytecode: l
|
|
37
|
+
}),
|
|
38
|
+
...m
|
|
39
|
+
}, { data: u } = await b(o, D, "call")(e);
|
|
40
|
+
return z(u ?? "0x0");
|
|
41
|
+
} catch (e) {
|
|
42
|
+
try {
|
|
43
|
+
if (h(S(i), await w({ hash: a, signature: r })))
|
|
44
|
+
return !0;
|
|
45
|
+
} catch {
|
|
46
|
+
}
|
|
47
|
+
if (e instanceof g)
|
|
48
|
+
return !1;
|
|
49
|
+
throw e;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
Q as verifyHash
|
|
54
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function x(e) {
|
|
2
|
+
const { scheme: n, statement: t, ...c } = e.match(f)?.groups ?? {}, { chainId: s, expirationTime: i, issuedAt: o, notBefore: r, requestId: a, ...d } = e.match(p)?.groups ?? {}, u = e.split("Resources:")[1]?.split(`
|
|
3
|
+
- `).slice(1);
|
|
4
|
+
return {
|
|
5
|
+
...c,
|
|
6
|
+
...d,
|
|
7
|
+
...s ? { chainId: Number(s) } : {},
|
|
8
|
+
...i ? { expirationTime: new Date(i) } : {},
|
|
9
|
+
...o ? { issuedAt: new Date(o) } : {},
|
|
10
|
+
...r ? { notBefore: new Date(r) } : {},
|
|
11
|
+
...a ? { requestId: a } : {},
|
|
12
|
+
...u ? { resources: u } : {},
|
|
13
|
+
...n ? { scheme: n } : {},
|
|
14
|
+
...t ? { statement: t } : {}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
const f = /^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/, p = /(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;
|
|
18
|
+
export {
|
|
19
|
+
x as parseSiweMessage
|
|
20
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isAddress as f } from "./index130.js";
|
|
2
|
+
import { isAddressEqual as o } from "./index140.js";
|
|
3
|
+
function l(n) {
|
|
4
|
+
const { address: r, domain: s, message: e, nonce: t, scheme: a, time: i = /* @__PURE__ */ new Date() } = n;
|
|
5
|
+
if (s && e.domain !== s || t && e.nonce !== t || a && e.scheme !== a || e.expirationTime && i >= e.expirationTime || e.notBefore && i < e.notBefore)
|
|
6
|
+
return !1;
|
|
7
|
+
try {
|
|
8
|
+
if (!e.address || !f(e.address, { strict: !1 }) || r && !o(e.address, r))
|
|
9
|
+
return !1;
|
|
10
|
+
} catch {
|
|
11
|
+
return !1;
|
|
12
|
+
}
|
|
13
|
+
return !0;
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
l as validateSiweMessage
|
|
17
|
+
};
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { toRpc as $ } from "./index213.js";
|
|
2
|
+
import { parseAccount as W } from "./index10.js";
|
|
3
|
+
import { multicall3Abi as O } from "./index71.js";
|
|
4
|
+
import { aggregate3Signature as I } from "./index214.js";
|
|
5
|
+
import { deploylessCallViaBytecodeBytecode as J, deploylessCallViaFactoryBytecode as K } from "./index73.js";
|
|
6
|
+
import { BaseError as N } from "./index81.js";
|
|
7
|
+
import { ClientChainNotConfiguredError as P, ChainDoesNotSupportContract as Q } from "./index96.js";
|
|
8
|
+
import { CounterfactualDeploymentFailedError as U, RawContractError as X } from "./index84.js";
|
|
9
|
+
import { decodeFunctionResult as Y } from "./index129.js";
|
|
10
|
+
import { encodeDeployData as T } from "./index133.js";
|
|
11
|
+
import { encodeFunctionData as Z } from "./index136.js";
|
|
12
|
+
import { getChainContractAddress as tt } from "./index172.js";
|
|
13
|
+
import { numberToHex as V } from "./index108.js";
|
|
14
|
+
import { getCallError as at } from "./index215.js";
|
|
15
|
+
import { extract as et } from "./index216.js";
|
|
16
|
+
import { formatTransactionRequest as rt } from "./index143.js";
|
|
17
|
+
import { createBatchScheduler as ot } from "./index14.js";
|
|
18
|
+
import { serializeStateOverride as ct } from "./index217.js";
|
|
19
|
+
import { assertRequest as nt } from "./index156.js";
|
|
20
|
+
import { parseAbi as z } from "./index195.js";
|
|
21
|
+
async function Et(t, a) {
|
|
22
|
+
const { account: e = t.account, authorizationList: n, batch: r = !!t.batch?.multicall, blockNumber: m, blockTag: C = t.experimental_blockTag ?? "latest", accessList: x, blobs: D, blockOverrides: d, code: p, data: o, factory: u, factoryData: s, gas: B, gasPrice: b, maxFeePerBlobGas: h, maxFeePerGas: y, maxPriorityFeePerGas: g, nonce: k, to: f, value: H, stateOverride: L, ...j } = a, R = e ? W(e) : void 0;
|
|
23
|
+
if (p && (u || s))
|
|
24
|
+
throw new N("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
|
|
25
|
+
if (p && f)
|
|
26
|
+
throw new N("Cannot provide both `code` & `to` as parameters.");
|
|
27
|
+
const S = p && o, _ = u && s && f && o, A = S || _, G = S ? lt({
|
|
28
|
+
code: p,
|
|
29
|
+
data: o
|
|
30
|
+
}) : _ ? dt({
|
|
31
|
+
data: o,
|
|
32
|
+
factory: u,
|
|
33
|
+
factoryData: s,
|
|
34
|
+
to: f
|
|
35
|
+
}) : o;
|
|
36
|
+
try {
|
|
37
|
+
nt(a);
|
|
38
|
+
const w = (typeof m == "bigint" ? V(m) : void 0) || C, i = d ? $(d) : void 0, l = ct(L), q = t.chain?.formatters?.transactionRequest?.format, v = (q || rt)({
|
|
39
|
+
// Pick out extra data that might exist on the chain's transaction request type.
|
|
40
|
+
...et(j, { format: q }),
|
|
41
|
+
from: R?.address,
|
|
42
|
+
accessList: x,
|
|
43
|
+
authorizationList: n,
|
|
44
|
+
blobs: D,
|
|
45
|
+
data: G,
|
|
46
|
+
gas: B,
|
|
47
|
+
gasPrice: b,
|
|
48
|
+
maxFeePerBlobGas: h,
|
|
49
|
+
maxFeePerGas: y,
|
|
50
|
+
maxPriorityFeePerGas: g,
|
|
51
|
+
nonce: k,
|
|
52
|
+
to: A ? void 0 : f,
|
|
53
|
+
value: H
|
|
54
|
+
});
|
|
55
|
+
if (r && st({ request: v }) && !l && !i)
|
|
56
|
+
try {
|
|
57
|
+
return await it(t, {
|
|
58
|
+
...v,
|
|
59
|
+
blockNumber: m,
|
|
60
|
+
blockTag: C
|
|
61
|
+
});
|
|
62
|
+
} catch (c) {
|
|
63
|
+
if (!(c instanceof P) && !(c instanceof Q))
|
|
64
|
+
throw c;
|
|
65
|
+
}
|
|
66
|
+
const M = (() => {
|
|
67
|
+
const c = [
|
|
68
|
+
v,
|
|
69
|
+
w
|
|
70
|
+
];
|
|
71
|
+
return l && i ? [...c, l, i] : l ? [...c, l] : i ? [...c, {}, i] : c;
|
|
72
|
+
})(), E = await t.request({
|
|
73
|
+
method: "eth_call",
|
|
74
|
+
params: M
|
|
75
|
+
});
|
|
76
|
+
return E === "0x" ? { data: void 0 } : { data: E };
|
|
77
|
+
} catch (F) {
|
|
78
|
+
const w = ut(F), { offchainLookup: i, offchainLookupSignature: l } = await import("./index160.js");
|
|
79
|
+
if (t.ccipRead !== !1 && w?.slice(0, 10) === l && f)
|
|
80
|
+
return { data: await i(t, { data: w, to: f }) };
|
|
81
|
+
throw A && w?.slice(0, 10) === "0x101bb98d" ? new U({ factory: u }) : at(F, {
|
|
82
|
+
...a,
|
|
83
|
+
account: R,
|
|
84
|
+
chain: t.chain
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function st({ request: t }) {
|
|
89
|
+
const { data: a, to: e, ...n } = t;
|
|
90
|
+
return !(!a || a.startsWith(I) || !e || Object.values(n).filter((r) => typeof r < "u").length > 0);
|
|
91
|
+
}
|
|
92
|
+
async function it(t, a) {
|
|
93
|
+
const { batchSize: e = 1024, wait: n = 0 } = typeof t.batch?.multicall == "object" ? t.batch.multicall : {}, { blockNumber: r, blockTag: m = t.experimental_blockTag ?? "latest", data: C, multicallAddress: x, to: D } = a;
|
|
94
|
+
let d = x;
|
|
95
|
+
if (!d) {
|
|
96
|
+
if (!t.chain)
|
|
97
|
+
throw new P();
|
|
98
|
+
d = tt({
|
|
99
|
+
blockNumber: r,
|
|
100
|
+
chain: t.chain,
|
|
101
|
+
contract: "multicall3"
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
const o = (typeof r == "bigint" ? V(r) : void 0) || m, { schedule: u } = ot({
|
|
105
|
+
id: `${t.uid}.${o}`,
|
|
106
|
+
wait: n,
|
|
107
|
+
shouldSplitBatch(b) {
|
|
108
|
+
return b.reduce((y, { data: g }) => y + (g.length - 2), 0) > e * 2;
|
|
109
|
+
},
|
|
110
|
+
fn: async (b) => {
|
|
111
|
+
const h = b.map((k) => ({
|
|
112
|
+
allowFailure: !0,
|
|
113
|
+
callData: k.data,
|
|
114
|
+
target: k.to
|
|
115
|
+
})), y = Z({
|
|
116
|
+
abi: O,
|
|
117
|
+
args: [h],
|
|
118
|
+
functionName: "aggregate3"
|
|
119
|
+
}), g = await t.request({
|
|
120
|
+
method: "eth_call",
|
|
121
|
+
params: [
|
|
122
|
+
{
|
|
123
|
+
data: y,
|
|
124
|
+
to: d
|
|
125
|
+
},
|
|
126
|
+
o
|
|
127
|
+
]
|
|
128
|
+
});
|
|
129
|
+
return Y({
|
|
130
|
+
abi: O,
|
|
131
|
+
args: [h],
|
|
132
|
+
functionName: "aggregate3",
|
|
133
|
+
data: g || "0x"
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}), [{ returnData: s, success: B }] = await u({ data: C, to: D });
|
|
137
|
+
if (!B)
|
|
138
|
+
throw new X({ data: s });
|
|
139
|
+
return s === "0x" ? { data: void 0 } : { data: s };
|
|
140
|
+
}
|
|
141
|
+
function lt(t) {
|
|
142
|
+
const { code: a, data: e } = t;
|
|
143
|
+
return T({
|
|
144
|
+
abi: z(["constructor(bytes, bytes)"]),
|
|
145
|
+
bytecode: J,
|
|
146
|
+
args: [a, e]
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
function dt(t) {
|
|
150
|
+
const { data: a, factory: e, factoryData: n, to: r } = t;
|
|
151
|
+
return T({
|
|
152
|
+
abi: z(["constructor(address, bytes, address, bytes)"]),
|
|
153
|
+
bytecode: K,
|
|
154
|
+
args: [r, a, e, n]
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function ut(t) {
|
|
158
|
+
if (!(t instanceof N))
|
|
159
|
+
return;
|
|
160
|
+
const a = t.walk();
|
|
161
|
+
return typeof a?.data == "object" ? a.data?.data : a.data;
|
|
162
|
+
}
|
|
163
|
+
export {
|
|
164
|
+
Et as call,
|
|
165
|
+
ut as getRevertErrorData
|
|
166
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LruMap as u } from "./index178.js";
|
|
2
|
+
const t = /* @__PURE__ */ new u(8192);
|
|
3
|
+
function s(r, { enabled: o = !0, id: e }) {
|
|
4
|
+
if (!o || !e)
|
|
5
|
+
return r();
|
|
6
|
+
if (t.get(e))
|
|
7
|
+
return t.get(e);
|
|
8
|
+
const n = r().finally(() => t.delete(e));
|
|
9
|
+
return t.set(e, n), n;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
t as promiseCache,
|
|
13
|
+
s as withDedupe
|
|
14
|
+
};
|