@gardenfi/utils 3.1.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index100.cjs +1 -2
- package/dist/index100.js +27 -119
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +90 -14
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +4 -25
- package/dist/index103.cjs +2 -1
- package/dist/index103.js +3 -34
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +9 -45
- package/dist/index105.cjs +20 -1
- package/dist/index105.js +326 -6
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +13 -103
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +4 -37
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +2 -9
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +7 -20
- package/dist/index110.cjs +2 -1
- package/dist/index110.js +55 -2
- package/dist/index111.cjs +3 -1
- package/dist/index111.js +211 -71
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +32 -16
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +20 -150
- package/dist/index114.cjs +1 -20
- package/dist/index114.js +5 -326
- package/dist/index115.cjs +1 -3
- package/dist/index115.js +72 -450
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +5 -73
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +5 -16
- package/dist/index118.cjs +9 -1
- package/dist/index118.js +35 -10
- package/dist/index119.cjs +2 -1
- package/dist/index119.js +114 -119
- package/dist/index120.cjs +1 -1
- package/dist/index120.js +3 -6
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +17 -44
- package/dist/index122.cjs +1 -1
- package/dist/index122.js +17 -35
- package/dist/index123.cjs +1 -1
- package/dist/index123.js +35 -6
- package/dist/index124.cjs +1 -1
- package/dist/index124.js +21 -88
- package/dist/index125.cjs +1 -1
- package/dist/index125.js +7 -13
- package/dist/index126.cjs +4 -1
- package/dist/index126.js +194 -3
- package/dist/index127.cjs +3 -1
- package/dist/index127.js +451 -26
- package/dist/index128.cjs +1 -2
- package/dist/index128.js +22 -19
- package/dist/index129.cjs +1 -1
- package/dist/index129.js +161 -9
- package/dist/index130.cjs +1 -1
- package/dist/index130.js +127 -8
- package/dist/index131.cjs +1 -1
- package/dist/index131.js +38 -10
- package/dist/index132.cjs +1 -1
- package/dist/index132.js +6 -11
- package/dist/index133.cjs +1 -1
- package/dist/index133.js +27 -13
- package/dist/index134.cjs +1 -1
- package/dist/index134.js +189 -19
- package/dist/index135.cjs +1 -1
- package/dist/index135.js +4 -15
- package/dist/index136.cjs +1 -1
- package/dist/index136.js +73 -4
- package/dist/index137.cjs +1 -1
- package/dist/index137.js +20 -6
- package/dist/index138.cjs +1 -1
- package/dist/index138.js +3 -19
- package/dist/index139.cjs +1 -1
- package/dist/index139.js +16 -10
- package/dist/index140.cjs +1 -1
- package/dist/index140.js +22 -57
- package/dist/index141.cjs +1 -1
- package/dist/index141.js +18 -6
- package/dist/index142.cjs +1 -1
- package/dist/index142.js +34 -13
- package/dist/index143.cjs +1 -1
- package/dist/index143.js +3 -8
- package/dist/index144.cjs +1 -1
- package/dist/index144.js +18 -138
- package/dist/index145.cjs +1 -1
- package/dist/index145.js +27 -7
- package/dist/index146.cjs +1 -1
- package/dist/index146.js +36 -21
- package/dist/index147.cjs +1 -1
- package/dist/index147.js +10 -17
- package/dist/index148.cjs +1 -1
- package/dist/index148.js +24 -42
- package/dist/index149.cjs +1 -1
- package/dist/index149.js +28 -21
- package/dist/index150.cjs +1 -1
- package/dist/index150.js +70 -75
- package/dist/index151.cjs +1 -1
- package/dist/index151.js +9 -11
- package/dist/index152.cjs +1 -1
- package/dist/index152.js +15 -7
- package/dist/index153.cjs +1 -1
- package/dist/index153.js +8 -6
- package/dist/index154.cjs +1 -1
- package/dist/index154.js +10 -41
- package/dist/index155.cjs +1 -1
- package/dist/index155.js +11 -5
- package/dist/index156.cjs +1 -1
- package/dist/index156.js +6 -33
- package/dist/index157.cjs +1 -1
- package/dist/index157.js +6 -9
- package/dist/index158.cjs +1 -1
- package/dist/index158.js +13 -60
- package/dist/index159.cjs +1 -1
- package/dist/index159.js +32 -19
- package/dist/index160.cjs +1 -1
- package/dist/index160.js +5 -107
- package/dist/index161.cjs +1 -1
- package/dist/index161.js +32 -73
- package/dist/index162.cjs +1 -1
- package/dist/index162.js +109 -7
- package/dist/index163.cjs +1 -1
- package/dist/index163.js +166 -85
- package/dist/index164.cjs +1 -2
- package/dist/index164.js +50 -3
- package/dist/index165.cjs +1 -1
- package/dist/index165.js +33 -9
- package/dist/index166.cjs +1 -1
- package/dist/index166.js +7 -13
- package/dist/index167.cjs +1 -1
- package/dist/index167.js +17 -4
- package/dist/index168.cjs +1 -1
- package/dist/index168.js +21 -2
- package/dist/index169.cjs +1 -1
- package/dist/index169.js +41 -30
- package/dist/index170.cjs +1 -1
- package/dist/index170.js +22 -21
- package/dist/index171.cjs +1 -1
- package/dist/index171.js +21 -5
- package/dist/index172.cjs +1 -1
- package/dist/index172.js +51 -5
- package/dist/index173.cjs +1 -1
- package/dist/index173.js +12 -5
- package/dist/index174.cjs +1 -9
- package/dist/index174.js +24 -35
- package/dist/index175.cjs +1 -1
- package/dist/index175.js +25 -3
- package/dist/index176.cjs +1 -1
- package/dist/index176.js +100 -14
- package/dist/index177.cjs +1 -1
- package/dist/index177.js +3 -21
- package/dist/index178.cjs +1 -1
- package/dist/index178.js +5 -35
- package/dist/index179.cjs +1 -1
- package/dist/index179.js +30 -7
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +8 -8
- package/dist/index180.cjs +1 -4
- package/dist/index180.js +3 -194
- package/dist/index181.cjs +1 -1
- package/dist/index181.js +17 -27
- package/dist/index182.cjs +1 -1
- package/dist/index182.js +8 -161
- package/dist/index183.cjs +1 -1
- package/dist/index183.js +79 -126
- package/dist/index184.cjs +1 -1
- package/dist/index184.js +5 -27
- package/dist/index185.cjs +1 -1
- package/dist/index185.js +26 -190
- package/dist/index186.cjs +1 -1
- package/dist/index186.js +17 -4
- package/dist/index187.cjs +1 -1
- package/dist/index187.js +75 -17
- package/dist/index188.cjs +1 -1
- package/dist/index188.js +2 -3
- package/dist/index189.cjs +1 -1
- package/dist/index189.js +14 -16
- package/dist/index190.cjs +1 -1
- package/dist/index190.js +17 -33
- package/dist/index191.cjs +1 -1
- package/dist/index191.js +18 -3
- package/dist/index192.cjs +1 -1
- package/dist/index192.js +10 -27
- package/dist/index193.cjs +1 -1
- package/dist/index193.js +28 -23
- package/dist/index194.cjs +1 -1
- package/dist/index194.js +2 -29
- package/dist/index195.cjs +1 -1
- package/dist/index195.js +13 -6
- package/dist/index196.cjs +1 -1
- package/dist/index196.js +12 -6
- package/dist/index197.cjs +1 -1
- package/dist/index197.js +46 -31
- package/dist/index198.cjs +1 -1
- package/dist/index198.js +12 -5
- package/dist/index199.cjs +1 -1
- package/dist/index199.js +7 -37
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +2 -2
- package/dist/index200.cjs +1 -1
- package/dist/index200.js +68 -47
- package/dist/index201.cjs +1 -1
- package/dist/index201.js +46 -32
- package/dist/index202.cjs +1 -1
- package/dist/index202.js +36 -16
- package/dist/index203.cjs +1 -1
- package/dist/index203.js +17 -42
- package/dist/index204.cjs +1 -1
- package/dist/index204.js +6 -104
- package/dist/index205.cjs +1 -1
- package/dist/index205.js +10 -3
- package/dist/index206.cjs +1 -1
- package/dist/index206.js +13 -5
- package/dist/index207.cjs +1 -1
- package/dist/index207.js +13 -3
- package/dist/index208.cjs +1 -1
- package/dist/index208.js +8 -17
- package/dist/index209.cjs +1 -1
- package/dist/index209.js +35 -8
- package/dist/index210.cjs +1 -1
- package/dist/index210.js +16 -5
- package/dist/index211.cjs +1 -1
- package/dist/index211.js +29 -27
- package/dist/index212.cjs +1 -1
- package/dist/index212.js +14 -78
- package/dist/index213.cjs +1 -1
- package/dist/index213.js +7 -2
- package/dist/index214.cjs +1 -1
- package/dist/index214.js +103 -18
- package/dist/index215.cjs +1 -1
- package/dist/index215.js +74 -16
- package/dist/index216.cjs +2 -1
- package/dist/index216.js +24 -10
- package/dist/index217.cjs +1 -1
- package/dist/index217.js +10 -102
- package/dist/index218.cjs +1 -1
- package/dist/index218.js +18 -15
- package/dist/index219.cjs +1 -1
- package/dist/index219.js +101 -212
- package/dist/index220.cjs +1 -1
- package/dist/index220.js +16 -108
- package/dist/index221.cjs +1 -1
- package/dist/index221.js +206 -198
- package/dist/index222.cjs +2 -1
- package/dist/index222.js +40 -41
- package/dist/index223.cjs +1 -1
- package/dist/index223.js +2 -79
- package/dist/index224.cjs +1 -1
- package/dist/index224.js +6 -2
- package/dist/index225.cjs +1 -1
- package/dist/index225.js +10 -24
- package/dist/index226.cjs +1 -1
- package/dist/index226.js +17 -44
- package/dist/index227.cjs +1 -1
- package/dist/index227.js +8 -9
- package/dist/index228.cjs +1 -2
- package/dist/index228.js +66 -41
- package/dist/index229.cjs +1 -1
- package/dist/index229.js +66 -2
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +2 -2
- package/dist/index230.cjs +1 -1
- package/dist/index230.js +188 -5
- package/dist/index231.cjs +1 -1
- package/dist/index231.js +27 -9
- package/dist/index232.cjs +1 -1
- package/dist/index232.js +74 -17
- package/dist/index233.cjs +1 -1
- package/dist/index233.js +40 -8
- package/dist/index234.cjs +1 -1
- package/dist/index234.js +16 -66
- package/dist/index235.cjs +1 -1
- package/dist/index235.js +12 -64
- package/dist/index236.cjs +1 -1
- package/dist/index236.js +11 -188
- package/dist/index237.cjs +1 -1
- package/dist/index237.js +12 -28
- package/dist/index238.cjs +1 -1
- package/dist/index238.js +103 -71
- package/dist/index239.cjs +1 -1
- package/dist/index239.js +202 -36
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +5 -5
- package/dist/index240.cjs +1 -1
- package/dist/index240.js +41 -15
- package/dist/index241.cjs +1 -1
- package/dist/index241.js +77 -12
- package/dist/index242.cjs +1 -1
- package/dist/index242.js +2 -12
- package/dist/index243.cjs +1 -1
- package/dist/index243.js +19 -12
- package/dist/index245.cjs +1 -1
- package/dist/index245.js +2 -2
- package/dist/index246.cjs +1 -1
- package/dist/index246.js +25 -18
- package/dist/index247.cjs +1 -1
- package/dist/index247.js +45 -25
- package/dist/index248.cjs +1 -1
- package/dist/index248.js +9 -11
- package/dist/index249.cjs +1 -1
- package/dist/index249.js +24 -19
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +2 -2
- package/dist/index250.cjs +1 -1
- package/dist/index250.js +2 -2
- package/dist/index251.cjs +1 -1
- package/dist/index251.js +2 -2
- package/dist/index252.cjs +1 -2
- package/dist/index252.js +68 -91
- package/dist/index253.cjs +2 -1
- package/dist/index253.js +91 -14
- package/dist/index254.cjs +1 -1
- package/dist/index254.js +14 -68
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +1 -1
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +3 -3
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +2 -2
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +2 -2
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +2 -2
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +1 -1
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +1 -1
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +1 -1
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +1 -1
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +2 -2
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +1 -1
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +12 -12
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +3 -3
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +7 -171
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +30 -110
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +29 -30
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +17 -2
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +34 -4
- package/dist/index56.cjs +1 -2
- package/dist/index56.js +43 -58
- package/dist/index57.cjs +1 -2
- package/dist/index57.js +150 -53
- package/dist/index58.cjs +1 -3
- package/dist/index58.js +39 -213
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +57 -22
- package/dist/index60.cjs +2 -1
- package/dist/index60.js +59 -18
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +13 -10
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +37 -20
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +15 -13
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +8 -12
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +20 -24
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +2 -29
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +44 -46
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +33 -16
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +8 -10
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +58 -29
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +76 -35
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +7 -7
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +16 -29
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +9 -21
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +5 -7
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +13 -69
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +3 -46
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +25 -22
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +161 -34
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +4 -17
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +6 -6
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +89 -8
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +9 -12
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +6 -164
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +13 -77
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +125 -13
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +137 -50
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +7 -7
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +21 -7
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +17 -21
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +43 -8
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +20 -30
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +11 -16
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +6 -73
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +5 -35
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +19 -16
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +103 -72
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +78 -12
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +8 -28
- package/package.json +1 -1
package/dist/index84.js
CHANGED
|
@@ -1,167 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { MaxFeePerGasTooLowError as $, Eip1559FeesNotSupportedError as q } from "./index78.js";
|
|
7
|
-
import { blobsToCommitments as v } from "./index130.js";
|
|
8
|
-
import { blobsToProofs as j } from "./index131.js";
|
|
9
|
-
import { commitmentsToVersionedHashes as D } from "./index132.js";
|
|
10
|
-
import { toBlobSidecars as J } from "./index133.js";
|
|
11
|
-
import { getAction as p } from "./index75.js";
|
|
12
|
-
import { LruMap as O } from "./index134.js";
|
|
13
|
-
import { assertRequest as Q } from "./index68.js";
|
|
14
|
-
import { getTransactionType as U } from "./index135.js";
|
|
15
|
-
import { fillTransaction as W } from "./index85.js";
|
|
16
|
-
import { getChainId as X } from "./index88.js";
|
|
17
|
-
const Y = [
|
|
18
|
-
"blobVersionedHashes",
|
|
19
|
-
"chainId",
|
|
20
|
-
"fees",
|
|
21
|
-
"gas",
|
|
22
|
-
"nonce",
|
|
23
|
-
"type"
|
|
24
|
-
], B = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new O(128);
|
|
25
|
-
async function be(a, N) {
|
|
26
|
-
var I, k, A;
|
|
27
|
-
let e = N;
|
|
28
|
-
e.account ?? (e.account = a.account), e.parameters ?? (e.parameters = Y);
|
|
29
|
-
const { account: g, chain: o = a.chain, nonceManager: P, parameters: r } = e, i = (() => {
|
|
30
|
-
if (typeof (o == null ? void 0 : o.prepareTransactionRequest) == "function")
|
|
31
|
-
return {
|
|
32
|
-
fn: o.prepareTransactionRequest,
|
|
33
|
-
runAt: ["beforeFillTransaction"]
|
|
34
|
-
};
|
|
35
|
-
if (Array.isArray(o == null ? void 0 : o.prepareTransactionRequest))
|
|
36
|
-
return {
|
|
37
|
-
fn: o.prepareTransactionRequest[0],
|
|
38
|
-
runAt: o.prepareTransactionRequest[1].runAt
|
|
39
|
-
};
|
|
40
|
-
})();
|
|
41
|
-
let m;
|
|
42
|
-
async function G() {
|
|
43
|
-
return m || (typeof e.chainId < "u" ? e.chainId : o ? o.id : (m = await p(a, X, "getChainId")({}), m));
|
|
44
|
-
}
|
|
45
|
-
const s = g && K(g);
|
|
46
|
-
let f = e.nonce;
|
|
47
|
-
if (r.includes("nonce") && typeof f > "u" && s && P) {
|
|
48
|
-
const n = await G();
|
|
49
|
-
f = await P.consume({
|
|
50
|
-
address: s.address,
|
|
51
|
-
chainId: n,
|
|
52
|
-
client: a
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
i != null && i.fn && ((I = i.runAt) != null && I.includes("beforeFillTransaction")) && (e = await i.fn({ ...e, chain: o }, {
|
|
56
|
-
phase: "beforeFillTransaction"
|
|
57
|
-
}), f ?? (f = e.nonce));
|
|
58
|
-
const T = ((r.includes("blobVersionedHashes") || r.includes("sidecars")) && e.kzg && e.blobs || x.get(a.uid) === !1 || !["fees", "gas"].some((t) => r.includes(t)) ? !1 : !!(r.includes("chainId") && typeof e.chainId != "number" || r.includes("nonce") && typeof f != "number" || r.includes("fees") && typeof e.gasPrice != "bigint" && (typeof e.maxFeePerGas != "bigint" || typeof e.maxPriorityFeePerGas != "bigint") || r.includes("gas") && typeof e.gas != "bigint")) ? await p(a, W, "fillTransaction")({ ...e, nonce: f }).then((n) => {
|
|
59
|
-
const { chainId: t, from: d, gas: c, gasPrice: b, nonce: u, maxFeePerBlobGas: E, maxFeePerGas: H, maxPriorityFeePerGas: C, type: V, ...w } = n.transaction;
|
|
60
|
-
return x.set(a.uid, !0), {
|
|
61
|
-
...e,
|
|
62
|
-
...d ? { from: d } : {},
|
|
63
|
-
...V ? { type: V } : {},
|
|
64
|
-
...typeof t < "u" ? { chainId: t } : {},
|
|
65
|
-
...typeof c < "u" ? { gas: c } : {},
|
|
66
|
-
...typeof b < "u" ? { gasPrice: b } : {},
|
|
67
|
-
...typeof u < "u" ? { nonce: u } : {},
|
|
68
|
-
...typeof E < "u" ? { maxFeePerBlobGas: E } : {},
|
|
69
|
-
...typeof H < "u" ? { maxFeePerGas: H } : {},
|
|
70
|
-
...typeof C < "u" ? { maxPriorityFeePerGas: C } : {},
|
|
71
|
-
..."nonceKey" in w && typeof w.nonceKey < "u" ? { nonceKey: w.nonceKey } : {}
|
|
72
|
-
};
|
|
73
|
-
}).catch((n) => {
|
|
74
|
-
var c;
|
|
75
|
-
const t = n;
|
|
76
|
-
return t.name !== "TransactionExecutionError" || ((c = t.walk) == null ? void 0 : c.call(t, (b) => {
|
|
77
|
-
const u = b;
|
|
78
|
-
return u.name === "MethodNotFoundRpcError" || u.name === "MethodNotSupportedRpcError";
|
|
79
|
-
})) && x.set(a.uid, !1), e;
|
|
80
|
-
}) : e;
|
|
81
|
-
f ?? (f = T.nonce), e = {
|
|
82
|
-
...T,
|
|
83
|
-
...s ? { from: s == null ? void 0 : s.address } : {},
|
|
84
|
-
...f ? { nonce: f } : {}
|
|
85
|
-
};
|
|
86
|
-
const { blobs: l, gas: R, kzg: h, type: _ } = e;
|
|
87
|
-
i != null && i.fn && ((k = i.runAt) != null && k.includes("beforeFillParameters")) && (e = await i.fn({ ...e, chain: o }, {
|
|
88
|
-
phase: "beforeFillParameters"
|
|
89
|
-
}));
|
|
90
|
-
let y;
|
|
91
|
-
async function F() {
|
|
92
|
-
return y || (y = await p(a, z, "getBlock")({ blockTag: "latest" }), y);
|
|
93
|
-
}
|
|
94
|
-
if (r.includes("nonce") && typeof f > "u" && s && !P && (e.nonce = await p(a, L, "getTransactionCount")({
|
|
95
|
-
address: s.address,
|
|
96
|
-
blockTag: "pending"
|
|
97
|
-
})), (r.includes("blobVersionedHashes") || r.includes("sidecars")) && l && h) {
|
|
98
|
-
const n = v({ blobs: l, kzg: h });
|
|
99
|
-
if (r.includes("blobVersionedHashes")) {
|
|
100
|
-
const t = D({
|
|
101
|
-
commitments: n,
|
|
102
|
-
to: "hex"
|
|
103
|
-
});
|
|
104
|
-
e.blobVersionedHashes = t;
|
|
105
|
-
}
|
|
106
|
-
if (r.includes("sidecars")) {
|
|
107
|
-
const t = j({ blobs: l, commitments: n, kzg: h }), d = J({
|
|
108
|
-
blobs: l,
|
|
109
|
-
commitments: n,
|
|
110
|
-
proofs: t,
|
|
111
|
-
to: "hex"
|
|
112
|
-
});
|
|
113
|
-
e.sidecars = d;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
if (r.includes("chainId") && (e.chainId = await G()), (r.includes("fees") || r.includes("type")) && typeof _ > "u")
|
|
117
|
-
try {
|
|
118
|
-
e.type = U(e);
|
|
119
|
-
} catch {
|
|
120
|
-
let n = B.get(a.uid);
|
|
121
|
-
if (typeof n > "u") {
|
|
122
|
-
const t = await F();
|
|
123
|
-
n = typeof (t == null ? void 0 : t.baseFeePerGas) == "bigint", B.set(a.uid, n);
|
|
124
|
-
}
|
|
125
|
-
e.type = n ? "eip1559" : "legacy";
|
|
126
|
-
}
|
|
127
|
-
if (r.includes("fees"))
|
|
128
|
-
if (e.type !== "legacy" && e.type !== "eip2930") {
|
|
129
|
-
if (typeof e.maxFeePerGas > "u" || typeof e.maxPriorityFeePerGas > "u") {
|
|
130
|
-
const n = await F(), { maxFeePerGas: t, maxPriorityFeePerGas: d } = await M(a, {
|
|
131
|
-
block: n,
|
|
132
|
-
chain: o,
|
|
133
|
-
request: e
|
|
134
|
-
});
|
|
135
|
-
if (typeof e.maxPriorityFeePerGas > "u" && e.maxFeePerGas && e.maxFeePerGas < d)
|
|
136
|
-
throw new $({
|
|
137
|
-
maxPriorityFeePerGas: d
|
|
138
|
-
});
|
|
139
|
-
e.maxPriorityFeePerGas = d, e.maxFeePerGas = t;
|
|
140
|
-
}
|
|
141
|
-
} else {
|
|
142
|
-
if (typeof e.maxFeePerGas < "u" || typeof e.maxPriorityFeePerGas < "u")
|
|
143
|
-
throw new q();
|
|
144
|
-
if (typeof e.gasPrice > "u") {
|
|
145
|
-
const n = await F(), { gasPrice: t } = await M(a, {
|
|
146
|
-
block: n,
|
|
147
|
-
chain: o,
|
|
148
|
-
request: e,
|
|
149
|
-
type: "legacy"
|
|
150
|
-
});
|
|
151
|
-
e.gasPrice = t;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return r.includes("gas") && typeof R > "u" && (e.gas = await p(a, S, "estimateGas")({
|
|
155
|
-
...e,
|
|
156
|
-
account: s,
|
|
157
|
-
prepare: (s == null ? void 0 : s.type) === "local" ? [] : ["blobVersionedHashes"]
|
|
158
|
-
})), i != null && i.fn && ((A = i.runAt) != null && A.includes("afterFillParameters")) && (e = await i.fn({ ...e, chain: o }, {
|
|
159
|
-
phase: "afterFillParameters"
|
|
160
|
-
})), Q(e), delete e.parameters, e;
|
|
1
|
+
async function a(n, { serializedTransaction: t }) {
|
|
2
|
+
return n.request({
|
|
3
|
+
method: "eth_sendRawTransaction",
|
|
4
|
+
params: [t]
|
|
5
|
+
}, { retryCount: 0 });
|
|
161
6
|
}
|
|
162
7
|
export {
|
|
163
|
-
|
|
164
|
-
B as eip1559NetworkCache,
|
|
165
|
-
be as prepareTransactionRequest,
|
|
166
|
-
x as supportsFillTransaction
|
|
8
|
+
a as sendRawTransaction
|
|
167
9
|
};
|
package/dist/index85.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index119.cjs"),f=require("./index174.cjs"),m=require("./index33.cjs");async function d(e,{serializedTransaction:r,throwOnReceiptRevert:s,timeout:n}){var a,o,c;const i=await e.request({method:"eth_sendRawTransactionSync",params:n?[r,m.numberToHex(n)]:[r]},{retryCount:0}),t=(((c=(o=(a=e.chain)==null?void 0:a.formatters)==null?void 0:o.transactionReceipt)==null?void 0:c.format)||f.formatTransactionReceipt)(i);if(t.status==="reverted"&&s)throw new u.TransactionReceiptRevertedError({receipt:t});return t}exports.sendRawTransactionSync=d;
|
package/dist/index85.js
CHANGED
|
@@ -1,80 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const { account: s = r.account, accessList: h, authorizationList: B, chain: t = r.chain, blobVersionedHashes: q, blobs: I, data: M, gas: T, gasPrice: k, maxFeePerBlobGas: R, maxFeePerGas: _, maxPriorityFeePerGas: v, nonce: i, nonceManager: m, to: A, type: C, value: E, ...H } = a, L = await (async () => {
|
|
14
|
-
if (!s || !m || typeof i < "u")
|
|
15
|
-
return i;
|
|
16
|
-
const o = p(s), x = t ? t.id : await w(r, O, "getChainId")({});
|
|
17
|
-
return await m.consume({
|
|
18
|
-
address: o.address,
|
|
19
|
-
chainId: x,
|
|
20
|
-
client: r
|
|
21
|
-
});
|
|
22
|
-
})();
|
|
23
|
-
J(a);
|
|
24
|
-
const f = (u = (P = t == null ? void 0 : t.formatters) == null ? void 0 : P.transactionRequest) == null ? void 0 : u.format, l = (f || D)({
|
|
25
|
-
// Pick out extra data that might exist on the chain's transaction request type.
|
|
26
|
-
...V(H, { format: f }),
|
|
27
|
-
account: s ? p(s) : void 0,
|
|
28
|
-
accessList: h,
|
|
29
|
-
authorizationList: B,
|
|
30
|
-
blobs: I,
|
|
31
|
-
blobVersionedHashes: q,
|
|
32
|
-
data: M,
|
|
33
|
-
gas: T,
|
|
34
|
-
gasPrice: k,
|
|
35
|
-
maxFeePerBlobGas: R,
|
|
36
|
-
maxFeePerGas: _,
|
|
37
|
-
maxPriorityFeePerGas: v,
|
|
38
|
-
nonce: L,
|
|
39
|
-
to: A,
|
|
40
|
-
type: C,
|
|
41
|
-
value: E
|
|
42
|
-
}, "fillTransaction");
|
|
43
|
-
try {
|
|
44
|
-
const o = await r.request({
|
|
45
|
-
method: "eth_fillTransaction",
|
|
46
|
-
params: [l]
|
|
47
|
-
}), e = (((g = (d = t == null ? void 0 : t.formatters) == null ? void 0 : d.transaction) == null ? void 0 : g.format) || j)(o.tx);
|
|
48
|
-
delete e.blockHash, delete e.blockNumber, delete e.r, delete e.s, delete e.transactionIndex, delete e.v, delete e.yParity, e.data = e.input, e.gas && (e.gas = a.gas ?? e.gas), e.gasPrice && (e.gasPrice = a.gasPrice ?? e.gasPrice), e.maxFeePerBlobGas && (e.maxFeePerBlobGas = a.maxFeePerBlobGas ?? e.maxFeePerBlobGas), e.maxFeePerGas && (e.maxFeePerGas = a.maxFeePerGas ?? e.maxFeePerGas), e.maxPriorityFeePerGas && (e.maxPriorityFeePerGas = a.maxPriorityFeePerGas ?? e.maxPriorityFeePerGas), e.nonce && (e.nonce = a.nonce ?? e.nonce);
|
|
49
|
-
const c = await (async () => {
|
|
50
|
-
var n, y;
|
|
51
|
-
if (typeof ((n = t == null ? void 0 : t.fees) == null ? void 0 : n.baseFeeMultiplier) == "function") {
|
|
52
|
-
const S = await w(r, K, "getBlock")({});
|
|
53
|
-
return t.fees.baseFeeMultiplier({
|
|
54
|
-
block: S,
|
|
55
|
-
client: r,
|
|
56
|
-
request: a
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
return ((y = t == null ? void 0 : t.fees) == null ? void 0 : y.baseFeeMultiplier) ?? 1.2;
|
|
60
|
-
})();
|
|
61
|
-
if (c < 1)
|
|
62
|
-
throw new z();
|
|
63
|
-
const G = 10 ** (((F = c.toString().split(".")[1]) == null ? void 0 : F.length) ?? 0), b = (n) => n * BigInt(Math.ceil(c * G)) / BigInt(G);
|
|
64
|
-
return e.maxFeePerGas && !a.maxFeePerGas && (e.maxFeePerGas = b(e.maxFeePerGas)), e.gasPrice && !a.gasPrice && (e.gasPrice = b(e.gasPrice)), {
|
|
65
|
-
raw: o.raw,
|
|
66
|
-
transaction: {
|
|
67
|
-
from: l.from,
|
|
68
|
-
...e
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
} catch (o) {
|
|
72
|
-
throw N(o, {
|
|
73
|
-
...a,
|
|
74
|
-
chain: r.chain
|
|
75
|
-
});
|
|
76
|
-
}
|
|
1
|
+
import { TransactionReceiptRevertedError as i } from "./index119.js";
|
|
2
|
+
import { formatTransactionReceipt as f } from "./index174.js";
|
|
3
|
+
import { numberToHex as p } from "./index33.js";
|
|
4
|
+
async function h(r, { serializedTransaction: e, throwOnReceiptRevert: m, timeout: o }) {
|
|
5
|
+
var a, n, c;
|
|
6
|
+
const s = await r.request({
|
|
7
|
+
method: "eth_sendRawTransactionSync",
|
|
8
|
+
params: o ? [e, p(o)] : [e]
|
|
9
|
+
}, { retryCount: 0 }), t = (((c = (n = (a = r.chain) == null ? void 0 : a.formatters) == null ? void 0 : n.transactionReceipt) == null ? void 0 : c.format) || f)(s);
|
|
10
|
+
if (t.status === "reverted" && m)
|
|
11
|
+
throw new i({ receipt: t });
|
|
12
|
+
return t;
|
|
77
13
|
}
|
|
78
14
|
export {
|
|
79
|
-
|
|
15
|
+
h as sendRawTransactionSync
|
|
80
16
|
};
|
package/dist/index86.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./index43.cjs"),u=require("./index216.cjs"),j=require("./index60.cjs"),B=require("./index205.cjs"),U=require("./index166.cjs"),W=require("./index207.cjs"),k=require("./index196.cjs"),D=require("./index175.cjs"),l=require("./index51.cjs"),H=require("./index152.cjs"),J=require("./index186.cjs"),K=require("./index72.cjs"),L=require("./index79.cjs"),Q=require("./index84.cjs"),f=new H.LruMap(128);async function V(r,e){var I,M,z,S;const{account:d=r.account,assertChainId:_=!0,chain:n=r.chain,accessList:w,authorizationList:s,blobs:q,data:m,gas:T,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:R,maxPriorityFeePerGas:A,nonce:E,type:C,value:N,...P}=e;if(typeof d>"u")throw new u.AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransaction"});const t=d?O.parseAccount(d):null;try{J.assertRequest(e);const a=await(async()=>{if(e.to)return e.to;if(e.to!==null&&s&&s.length>0)return await B.recoverAuthorizationAddress({authorization:s[0]}).catch(()=>{throw new j.BaseError("`to` is required. Could not infer from `authorizationList`.")})})();if((t==null?void 0:t.type)==="json-rpc"||t===null){let i;n!==null&&(i=await l.getAction(r,K.getChainId,"getChainId")({}),_&&U.assertCurrentChain({currentChainId:i,chain:n}));const c=(z=(M=(I=r.chain)==null?void 0:I.formatters)==null?void 0:M.transactionRequest)==null?void 0:z.format,F=(c||D.formatTransactionRequest)({...k.extract(P,{format:c}),accessList:w,account:t,authorizationList:s,blobs:q,chainId:i,data:m,gas:T,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:R,maxPriorityFeePerGas:A,nonce:E,to:a,type:C,value:N},"sendTransaction"),v=f.get(r.uid),G=v?"wallet_sendTransaction":"eth_sendTransaction";try{return await r.request({method:G,params:[F]},{retryCount:0})}catch(x){if(v===!1)throw x;const o=x;if(o.name==="InvalidInputRpcError"||o.name==="InvalidParamsRpcError"||o.name==="MethodNotFoundRpcError"||o.name==="MethodNotSupportedRpcError")return await r.request({method:"wallet_sendTransaction",params:[F]},{retryCount:0}).then(p=>(f.set(r.uid,!0),p)).catch(p=>{const h=p;throw h.name==="MethodNotFoundRpcError"||h.name==="MethodNotSupportedRpcError"?(f.set(r.uid,!1),o):h});throw o}}if((t==null?void 0:t.type)==="local"){const i=await l.getAction(r,L.prepareTransactionRequest,"prepareTransactionRequest")({account:t,accessList:w,authorizationList:s,blobs:q,chain:n,data:m,gas:T,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:R,maxPriorityFeePerGas:A,nonce:E,nonceManager:t.nonceManager,parameters:[...L.defaultParameters,"sidecars"],type:C,value:N,...P,to:a}),c=(S=n==null?void 0:n.serializers)==null?void 0:S.transaction,b=await t.signTransaction(i,{serializer:c});return await l.getAction(r,Q.sendRawTransaction,"sendRawTransaction")({serializedTransaction:b})}throw(t==null?void 0:t.type)==="smart"?new u.AccountTypeNotSupportedError({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new u.AccountTypeNotSupportedError({docsPath:"/docs/actions/wallet/sendTransaction",type:t==null?void 0:t.type})}catch(a){throw a instanceof u.AccountTypeNotSupportedError?a:W.getTransactionError(a,{...e,account:t,chain:e.chain||void 0})}}exports.sendTransaction=V;
|
package/dist/index86.js
CHANGED
|
@@ -1,16 +1,128 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { parseAccount as G } from "./index43.js";
|
|
2
|
+
import { AccountNotFoundError as B, AccountTypeNotSupportedError as p } from "./index216.js";
|
|
3
|
+
import { BaseError as O } from "./index60.js";
|
|
4
|
+
import { recoverAuthorizationAddress as U } from "./index205.js";
|
|
5
|
+
import { assertCurrentChain as W } from "./index166.js";
|
|
6
|
+
import { getTransactionError as j } from "./index207.js";
|
|
7
|
+
import { extract as k } from "./index196.js";
|
|
8
|
+
import { formatTransactionRequest as D } from "./index175.js";
|
|
9
|
+
import { getAction as f } from "./index51.js";
|
|
10
|
+
import { LruMap as H } from "./index152.js";
|
|
11
|
+
import { assertRequest as J } from "./index186.js";
|
|
12
|
+
import { getChainId as K } from "./index72.js";
|
|
13
|
+
import { prepareTransactionRequest as Q, defaultParameters as V } from "./index79.js";
|
|
14
|
+
import { sendRawTransaction as X } from "./index84.js";
|
|
15
|
+
const h = new H(128);
|
|
16
|
+
async function mr(t, o) {
|
|
17
|
+
var M, z, A, F;
|
|
18
|
+
const { account: d = t.account, assertChainId: S = !0, chain: e = t.chain, accessList: w, authorizationList: s, blobs: l, data: y, gas: T, gasPrice: g, maxFeePerBlobGas: R, maxFeePerGas: E, maxPriorityFeePerGas: q, nonce: C, type: P, value: N, ...I } = o;
|
|
19
|
+
if (typeof d > "u")
|
|
20
|
+
throw new B({
|
|
21
|
+
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
22
|
+
});
|
|
23
|
+
const r = d ? G(d) : null;
|
|
24
|
+
try {
|
|
25
|
+
J(o);
|
|
26
|
+
const a = await (async () => {
|
|
27
|
+
if (o.to)
|
|
28
|
+
return o.to;
|
|
29
|
+
if (o.to !== null && s && s.length > 0)
|
|
30
|
+
return await U({
|
|
31
|
+
authorization: s[0]
|
|
32
|
+
}).catch(() => {
|
|
33
|
+
throw new O("`to` is required. Could not infer from `authorizationList`.");
|
|
34
|
+
});
|
|
35
|
+
})();
|
|
36
|
+
if ((r == null ? void 0 : r.type) === "json-rpc" || r === null) {
|
|
37
|
+
let i;
|
|
38
|
+
e !== null && (i = await f(t, K, "getChainId")({}), S && W({
|
|
39
|
+
currentChainId: i,
|
|
40
|
+
chain: e
|
|
41
|
+
}));
|
|
42
|
+
const c = (A = (z = (M = t.chain) == null ? void 0 : M.formatters) == null ? void 0 : z.transactionRequest) == null ? void 0 : A.format, b = (c || D)({
|
|
43
|
+
// Pick out extra data that might exist on the chain's transaction request type.
|
|
44
|
+
...k(I, { format: c }),
|
|
45
|
+
accessList: w,
|
|
46
|
+
account: r,
|
|
47
|
+
authorizationList: s,
|
|
48
|
+
blobs: l,
|
|
49
|
+
chainId: i,
|
|
50
|
+
data: y,
|
|
51
|
+
gas: T,
|
|
52
|
+
gasPrice: g,
|
|
53
|
+
maxFeePerBlobGas: R,
|
|
54
|
+
maxFeePerGas: E,
|
|
55
|
+
maxPriorityFeePerGas: q,
|
|
56
|
+
nonce: C,
|
|
57
|
+
to: a,
|
|
58
|
+
type: P,
|
|
59
|
+
value: N
|
|
60
|
+
}, "sendTransaction"), v = h.get(t.uid), _ = v ? "wallet_sendTransaction" : "eth_sendTransaction";
|
|
61
|
+
try {
|
|
62
|
+
return await t.request({
|
|
63
|
+
method: _,
|
|
64
|
+
params: [b]
|
|
65
|
+
}, { retryCount: 0 });
|
|
66
|
+
} catch (L) {
|
|
67
|
+
if (v === !1)
|
|
68
|
+
throw L;
|
|
69
|
+
const n = L;
|
|
70
|
+
if (n.name === "InvalidInputRpcError" || n.name === "InvalidParamsRpcError" || n.name === "MethodNotFoundRpcError" || n.name === "MethodNotSupportedRpcError")
|
|
71
|
+
return await t.request({
|
|
72
|
+
method: "wallet_sendTransaction",
|
|
73
|
+
params: [b]
|
|
74
|
+
}, { retryCount: 0 }).then((u) => (h.set(t.uid, !0), u)).catch((u) => {
|
|
75
|
+
const m = u;
|
|
76
|
+
throw m.name === "MethodNotFoundRpcError" || m.name === "MethodNotSupportedRpcError" ? (h.set(t.uid, !1), n) : m;
|
|
77
|
+
});
|
|
78
|
+
throw n;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if ((r == null ? void 0 : r.type) === "local") {
|
|
82
|
+
const i = await f(t, Q, "prepareTransactionRequest")({
|
|
83
|
+
account: r,
|
|
84
|
+
accessList: w,
|
|
85
|
+
authorizationList: s,
|
|
86
|
+
blobs: l,
|
|
87
|
+
chain: e,
|
|
88
|
+
data: y,
|
|
89
|
+
gas: T,
|
|
90
|
+
gasPrice: g,
|
|
91
|
+
maxFeePerBlobGas: R,
|
|
92
|
+
maxFeePerGas: E,
|
|
93
|
+
maxPriorityFeePerGas: q,
|
|
94
|
+
nonce: C,
|
|
95
|
+
nonceManager: r.nonceManager,
|
|
96
|
+
parameters: [...V, "sidecars"],
|
|
97
|
+
type: P,
|
|
98
|
+
value: N,
|
|
99
|
+
...I,
|
|
100
|
+
to: a
|
|
101
|
+
}), c = (F = e == null ? void 0 : e.serializers) == null ? void 0 : F.transaction, x = await r.signTransaction(i, {
|
|
102
|
+
serializer: c
|
|
103
|
+
});
|
|
104
|
+
return await f(t, X, "sendRawTransaction")({
|
|
105
|
+
serializedTransaction: x
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
throw (r == null ? void 0 : r.type) === "smart" ? new p({
|
|
109
|
+
metaMessages: [
|
|
110
|
+
"Consider using the `sendUserOperation` Action instead."
|
|
111
|
+
],
|
|
112
|
+
docsPath: "/docs/actions/bundler/sendUserOperation",
|
|
113
|
+
type: "smart"
|
|
114
|
+
}) : new p({
|
|
115
|
+
docsPath: "/docs/actions/wallet/sendTransaction",
|
|
116
|
+
type: r == null ? void 0 : r.type
|
|
117
|
+
});
|
|
118
|
+
} catch (a) {
|
|
119
|
+
throw a instanceof p ? a : j(a, {
|
|
120
|
+
...o,
|
|
121
|
+
account: r,
|
|
122
|
+
chain: o.chain || void 0
|
|
123
|
+
});
|
|
124
|
+
}
|
|
13
125
|
}
|
|
14
126
|
export {
|
|
15
|
-
|
|
127
|
+
mr as sendTransaction
|
|
16
128
|
};
|
package/dist/index87.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("./index43.cjs"),u=require("./index216.cjs"),D=require("./index60.cjs"),H=require("./index119.cjs"),J=require("./index205.cjs"),K=require("./index166.cjs"),Q=require("./index207.cjs"),V=require("./index196.cjs"),X=require("./index175.cjs"),d=require("./index51.cjs"),Y=require("./index152.cjs"),Z=require("./index186.cjs"),$=require("./index72.cjs"),tt=require("./index214.cjs"),O=require("./index79.cjs"),et=require("./index85.cjs"),f=new Y.LruMap(128);async function rt(e,r){var F,I,M,b;const{account:p=e.account,assertChainId:G=!0,chain:n=e.chain,accessList:m,authorizationList:s,blobs:q,data:y,gas:T,gasPrice:R,maxFeePerBlobGas:g,maxFeePerGas:A,maxPriorityFeePerGas:E,nonce:S,pollingInterval:j,throwOnReceiptRevert:C,type:N,value:P,...v}=r,k=r.timeout??Math.max(((n==null?void 0:n.blockTime)??0)*3,5e3);if(typeof p>"u")throw new u.AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransactionSync"});const t=p?W.parseAccount(p):null;try{Z.assertRequest(r);const a=await(async()=>{if(r.to)return r.to;if(r.to!==null&&s&&s.length>0)return await J.recoverAuthorizationAddress({authorization:s[0]}).catch(()=>{throw new D.BaseError("`to` is required. Could not infer from `authorizationList`.")})})();if((t==null?void 0:t.type)==="json-rpc"||t===null){let i;n!==null&&(i=await d.getAction(e,$.getChainId,"getChainId")({}),G&&K.assertCurrentChain({currentChainId:i,chain:n}));const c=(M=(I=(F=e.chain)==null?void 0:F.formatters)==null?void 0:I.transactionRequest)==null?void 0:M.format,x=(c||X.formatTransactionRequest)({...V.extract(v,{format:c}),accessList:m,account:t,authorizationList:s,blobs:q,chainId:i,data:y,gas:T,gasPrice:R,maxFeePerBlobGas:g,maxFeePerGas:A,maxPriorityFeePerGas:E,nonce:S,to:a,type:N,value:P},"sendTransaction"),_=f.get(e.uid),B=_?"wallet_sendTransaction":"eth_sendTransaction",U=await(async()=>{try{return await e.request({method:B,params:[x]},{retryCount:0})}catch(L){if(_===!1)throw L;const o=L;if(o.name==="InvalidInputRpcError"||o.name==="InvalidParamsRpcError"||o.name==="MethodNotFoundRpcError"||o.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[x]},{retryCount:0}).then(w=>(f.set(e.uid,!0),w)).catch(w=>{const l=w;throw l.name==="MethodNotFoundRpcError"||l.name==="MethodNotSupportedRpcError"?(f.set(e.uid,!1),o):l});throw o}})(),h=await d.getAction(e,tt.waitForTransactionReceipt,"waitForTransactionReceipt")({checkReplacement:!1,hash:U,pollingInterval:j,timeout:k});if(C&&h.status==="reverted")throw new H.TransactionReceiptRevertedError({receipt:h});return h}if((t==null?void 0:t.type)==="local"){const i=await d.getAction(e,O.prepareTransactionRequest,"prepareTransactionRequest")({account:t,accessList:m,authorizationList:s,blobs:q,chain:n,data:y,gas:T,gasPrice:R,maxFeePerBlobGas:g,maxFeePerGas:A,maxPriorityFeePerGas:E,nonce:S,nonceManager:t.nonceManager,parameters:[...O.defaultParameters,"sidecars"],type:N,value:P,...v,to:a}),c=(b=n==null?void 0:n.serializers)==null?void 0:b.transaction,z=await t.signTransaction(i,{serializer:c});return await d.getAction(e,et.sendRawTransactionSync,"sendRawTransactionSync")({serializedTransaction:z,throwOnReceiptRevert:C,timeout:r.timeout})}throw(t==null?void 0:t.type)==="smart"?new u.AccountTypeNotSupportedError({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new u.AccountTypeNotSupportedError({docsPath:"/docs/actions/wallet/sendTransactionSync",type:t==null?void 0:t.type})}catch(a){throw a instanceof u.AccountTypeNotSupportedError?a:Q.getTransactionError(a,{...r,account:t,chain:r.chain||void 0})}}exports.sendTransactionSync=rt;
|