@gardenfi/utils 3.1.0 → 3.1.1-beta.2
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 +119 -114
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +5 -14
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +21 -24
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +43 -31
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +37 -43
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +6 -6
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +88 -101
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +14 -37
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +3 -8
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +26 -20
- package/dist/index110.cjs +2 -1
- package/dist/index110.js +25 -2
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +9 -75
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +8 -15
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +10 -151
- package/dist/index114.cjs +1 -20
- package/dist/index114.js +11 -326
- package/dist/index115.cjs +1 -3
- package/dist/index115.js +13 -451
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +19 -71
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +14 -16
- package/dist/index118.cjs +1 -1
- package/dist/index118.js +4 -10
- package/dist/index119.cjs +1 -1
- package/dist/index119.js +6 -125
- package/dist/index120.cjs +1 -1
- package/dist/index120.js +18 -5
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +10 -45
- package/dist/index122.cjs +1 -1
- package/dist/index122.js +56 -36
- package/dist/index123.cjs +1 -1
- package/dist/index123.js +6 -6
- package/dist/index124.cjs +1 -1
- package/dist/index124.js +13 -90
- package/dist/index125.cjs +1 -1
- package/dist/index125.js +7 -14
- package/dist/index126.cjs +1 -1
- package/dist/index126.js +138 -3
- package/dist/index127.cjs +1 -1
- package/dist/index127.js +7 -26
- package/dist/index128.cjs +1 -2
- package/dist/index128.js +19 -22
- package/dist/index129.cjs +1 -1
- package/dist/index129.js +17 -9
- package/dist/index130.cjs +1 -1
- package/dist/index130.js +43 -8
- package/dist/index131.cjs +1 -1
- package/dist/index131.js +21 -10
- package/dist/index132.cjs +1 -1
- package/dist/index132.js +80 -11
- package/dist/index133.cjs +1 -1
- package/dist/index133.js +11 -13
- package/dist/index134.cjs +1 -1
- package/dist/index134.js +7 -15
- package/dist/index135.cjs +1 -1
- package/dist/index135.js +6 -14
- package/dist/index136.cjs +1 -1
- package/dist/index136.js +41 -4
- package/dist/index137.cjs +1 -1
- package/dist/index137.js +5 -6
- package/dist/index138.cjs +1 -1
- package/dist/index138.js +33 -18
- package/dist/index139.cjs +1 -1
- package/dist/index139.js +9 -10
- package/dist/index140.cjs +1 -1
- package/dist/index140.js +60 -58
- package/dist/index141.cjs +1 -1
- package/dist/index141.js +19 -6
- package/dist/index142.cjs +1 -1
- package/dist/index142.js +106 -13
- package/dist/index143.cjs +1 -1
- package/dist/index143.js +78 -7
- package/dist/index144.cjs +1 -1
- package/dist/index144.js +7 -136
- package/dist/index145.cjs +1 -1
- package/dist/index145.js +90 -7
- package/dist/index146.cjs +2 -1
- package/dist/index146.js +3 -22
- package/dist/index147.cjs +1 -1
- package/dist/index147.js +9 -18
- package/dist/index148.cjs +1 -1
- package/dist/index148.js +13 -43
- package/dist/index149.cjs +1 -1
- package/dist/index149.js +4 -21
- package/dist/index150.cjs +1 -1
- package/dist/index150.js +11 -79
- package/dist/index151.cjs +1 -1
- package/dist/index151.js +2 -12
- package/dist/index152.cjs +1 -1
- package/dist/index152.js +32 -14
- package/dist/index153.cjs +1 -1
- package/dist/index153.js +21 -6
- package/dist/index154.cjs +1 -1
- package/dist/index154.js +5 -41
- package/dist/index155.cjs +1 -1
- package/dist/index155.js +5 -5
- package/dist/index156.cjs +1 -1
- package/dist/index156.js +5 -33
- package/dist/index157.cjs +9 -1
- package/dist/index157.js +34 -8
- package/dist/index158.cjs +1 -1
- package/dist/index158.js +3 -61
- package/dist/index159.cjs +1 -1
- package/dist/index159.js +18 -19
- package/dist/index160.cjs +1 -1
- package/dist/index160.js +19 -105
- package/dist/index161.cjs +1 -1
- package/dist/index161.js +27 -70
- package/dist/index162.cjs +1 -1
- package/dist/index162.js +6 -7
- package/dist/index163.cjs +4 -1
- package/dist/index163.js +192 -88
- package/dist/index164.cjs +1 -2
- package/dist/index164.js +28 -3
- package/dist/index165.cjs +1 -1
- package/dist/index165.js +162 -9
- package/dist/index166.cjs +1 -1
- package/dist/index166.js +127 -13
- package/dist/index167.cjs +1 -1
- package/dist/index167.js +27 -4
- package/dist/index168.cjs +1 -1
- package/dist/index168.js +56 -2
- package/dist/index169.cjs +1 -1
- package/dist/index169.js +191 -31
- package/dist/index170.cjs +1 -1
- package/dist/index170.js +4 -22
- package/dist/index171.cjs +1 -1
- package/dist/index171.js +20 -5
- package/dist/index172.cjs +1 -1
- package/dist/index172.js +3 -6
- package/dist/index173.cjs +1 -1
- package/dist/index173.js +16 -5
- package/dist/index174.cjs +1 -9
- package/dist/index174.js +11 -35
- package/dist/index175.cjs +1 -1
- package/dist/index175.js +35 -3
- package/dist/index176.cjs +1 -1
- package/dist/index176.js +3 -19
- package/dist/index177.cjs +1 -1
- package/dist/index177.js +25 -18
- package/dist/index178.cjs +1 -1
- package/dist/index178.js +8 -35
- package/dist/index179.cjs +1 -1
- package/dist/index179.js +23 -6
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +8 -8
- package/dist/index180.cjs +1 -4
- package/dist/index180.js +28 -194
- package/dist/index181.cjs +1 -1
- package/dist/index181.js +3 -27
- package/dist/index182.cjs +1 -1
- package/dist/index182.js +6 -161
- package/dist/index183.cjs +1 -1
- package/dist/index183.js +6 -127
- package/dist/index184.cjs +1 -1
- package/dist/index184.js +32 -27
- package/dist/index185.cjs +1 -1
- package/dist/index185.js +5 -192
- package/dist/index186.cjs +1 -1
- package/dist/index186.js +38 -4
- package/dist/index187.cjs +1 -1
- package/dist/index187.js +43 -14
- package/dist/index188.cjs +1 -1
- package/dist/index188.js +33 -3
- package/dist/index189.cjs +1 -1
- package/dist/index189.js +16 -15
- package/dist/index190.cjs +1 -1
- package/dist/index190.js +40 -32
- package/dist/index191.cjs +1 -1
- package/dist/index191.js +105 -3
- package/dist/index192.cjs +1 -1
- package/dist/index192.js +3 -28
- package/dist/index193.cjs +1 -1
- package/dist/index193.js +5 -25
- package/dist/index194.cjs +1 -1
- package/dist/index194.js +3 -28
- package/dist/index195.cjs +1 -1
- package/dist/index195.js +17 -6
- package/dist/index196.cjs +1 -1
- package/dist/index196.js +5 -6
- package/dist/index197.cjs +1 -1
- package/dist/index197.js +8 -32
- package/dist/index198.cjs +1 -1
- package/dist/index198.js +104 -5
- package/dist/index199.cjs +1 -1
- package/dist/index199.js +5 -37
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +2 -2
- package/dist/index200.cjs +1 -1
- package/dist/index200.js +6 -49
- package/dist/index201.cjs +1 -1
- package/dist/index201.js +25 -30
- package/dist/index202.cjs +1 -1
- package/dist/index202.js +34 -17
- package/dist/index203.cjs +1 -1
- package/dist/index203.js +13 -42
- package/dist/index204.cjs +1 -1
- package/dist/index204.js +74 -100
- package/dist/index205.cjs +1 -1
- package/dist/index205.js +2 -3
- package/dist/index206.cjs +1 -1
- package/dist/index206.js +17 -4
- package/dist/index207.cjs +1 -1
- package/dist/index207.js +171 -3
- package/dist/index208.cjs +1 -1
- package/dist/index208.js +17 -17
- package/dist/index209.cjs +1 -1
- package/dist/index209.js +10 -8
- package/dist/index210.cjs +1 -1
- package/dist/index210.js +25 -5
- package/dist/index211.cjs +1 -1
- package/dist/index211.js +18 -27
- package/dist/index212.cjs +1 -1
- package/dist/index212.js +15 -78
- package/dist/index213.cjs +1 -1
- package/dist/index213.js +6 -2
- package/dist/index214.cjs +1 -1
- package/dist/index214.js +13 -18
- package/dist/index215.cjs +1 -1
- package/dist/index215.js +10 -17
- package/dist/index216.cjs +1 -1
- package/dist/index216.js +16 -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 +23 -213
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +9 -9
- package/dist/index220.cjs +1 -1
- package/dist/index220.js +43 -105
- package/dist/index221.cjs +1 -1
- package/dist/index221.js +8 -205
- 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 +17 -74
- package/dist/index239.cjs +1 -1
- package/dist/index239.js +105 -37
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +5 -5
- package/dist/index240.cjs +1 -1
- package/dist/index240.js +6 -16
- package/dist/index241.cjs +1 -1
- package/dist/index241.js +7 -14
- package/dist/index242.cjs +1 -1
- package/dist/index242.js +26 -11
- package/dist/index243.cjs +1 -1
- package/dist/index243.js +102 -11
- package/dist/index244.cjs +1 -1
- package/dist/index244.js +16 -6
- package/dist/index245.cjs +1 -1
- package/dist/index245.js +215 -7
- package/dist/index246.cjs +1 -1
- package/dist/index246.js +205 -18
- package/dist/index247.cjs +1 -1
- package/dist/index247.js +41 -25
- package/dist/index248.cjs +1 -1
- package/dist/index248.js +77 -10
- package/dist/index249.cjs +1 -1
- package/dist/index249.js +2 -20
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +3 -3
- package/dist/index250.cjs +2 -1
- package/dist/index250.js +88 -654
- package/dist/index251.cjs +1 -1
- package/dist/index251.js +14 -177
- package/dist/index252.cjs +1 -2
- package/dist/index252.js +68 -91
- package/dist/index253.cjs +1 -1
- package/dist/index253.js +657 -14
- package/dist/index254.cjs +1 -1
- package/dist/index254.js +176 -67
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +1 -1
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +171 -13
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +109 -32
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +30 -32
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +3 -55
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +2 -46
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +4 -26
- package/dist/index35.cjs +2 -1
- package/dist/index35.js +59 -6
- package/dist/index36.cjs +2 -1
- package/dist/index36.js +54 -18
- package/dist/index37.cjs +3 -1
- package/dist/index37.js +215 -15
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +23 -5
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +18 -13
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +10 -10
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +19 -11
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +45 -11
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +13 -3
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +12 -21
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +24 -8
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +28 -3
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +47 -16
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +16 -5
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +10 -170
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +30 -102
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +34 -169
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +7 -111
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +29 -30
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +23 -2
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +8 -4
- package/dist/index56.cjs +1 -2
- package/dist/index56.js +69 -58
- package/dist/index57.cjs +1 -2
- package/dist/index57.js +43 -51
- package/dist/index58.cjs +1 -3
- package/dist/index58.js +16 -208
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +36 -22
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +17 -18
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +6 -10
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +9 -20
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +10 -10
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +164 -12
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +31 -23
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +74 -25
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +13 -47
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +51 -16
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +7 -11
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +7 -31
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +21 -36
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +8 -7
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +29 -27
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +15 -21
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +73 -7
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +35 -70
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +16 -46
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +73 -21
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +12 -37
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +29 -17
- package/dist/index81.cjs +2 -1
- package/dist/index81.js +120 -6
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +13 -8
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +24 -13
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +31 -162
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +39 -72
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +5 -12
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +102 -50
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +37 -7
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +8 -7
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +20 -21
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +2 -9
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +75 -31
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +15 -16
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +150 -72
- package/dist/index95.cjs +20 -1
- package/dist/index95.js +326 -35
- package/dist/index96.cjs +3 -1
- package/dist/index96.js +451 -16
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +70 -72
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +16 -12
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +10 -29
- package/package.json +1 -1
package/dist/index119.js
CHANGED
|
@@ -1,128 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { getTransactionError as j } from "./index86.js";
|
|
7
|
-
import { extract as k } from "./index64.js";
|
|
8
|
-
import { formatTransactionRequest as D } from "./index65.js";
|
|
9
|
-
import { getAction as f } from "./index75.js";
|
|
10
|
-
import { LruMap as H } from "./index134.js";
|
|
11
|
-
import { assertRequest as J } from "./index68.js";
|
|
12
|
-
import { getChainId as K } from "./index88.js";
|
|
13
|
-
import { prepareTransactionRequest as Q, defaultParameters as V } from "./index84.js";
|
|
14
|
-
import { sendRawTransaction as X } from "./index141.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
|
-
}
|
|
1
|
+
async function s(e, r) {
|
|
2
|
+
return e.request({
|
|
3
|
+
method: "wallet_requestPermissions",
|
|
4
|
+
params: [r]
|
|
5
|
+
}, { retryCount: 0 });
|
|
125
6
|
}
|
|
126
7
|
export {
|
|
127
|
-
|
|
8
|
+
s as requestPermissions
|
|
128
9
|
};
|
package/dist/index120.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function a(t){return typeof t[0]=="string"?f(t):o(t)}function o(t){let n=0;for(const r of t)n+=r.length;const e=new Uint8Array(n);let c=0;for(const r of t)e.set(r,c),c+=r.length;return e}function f(t){return`0x${t.reduce((n,e)=>n+e.replace("0x",""),"")}`}exports.concat=a;exports.concatBytes=o;exports.concatHex=f;
|
package/dist/index120.js
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
function i(t) {
|
|
2
|
+
return typeof t[0] == "string" ? f(t) : c(t);
|
|
3
|
+
}
|
|
4
|
+
function c(t) {
|
|
5
|
+
let n = 0;
|
|
6
|
+
for (const e of t)
|
|
7
|
+
n += e.length;
|
|
8
|
+
const r = new Uint8Array(n);
|
|
9
|
+
let o = 0;
|
|
10
|
+
for (const e of t)
|
|
11
|
+
r.set(e, o), o += e.length;
|
|
12
|
+
return r;
|
|
13
|
+
}
|
|
14
|
+
function f(t) {
|
|
15
|
+
return `0x${t.reduce((n, r) => n + r.replace("0x", ""), "")}`;
|
|
5
16
|
}
|
|
6
17
|
export {
|
|
7
|
-
|
|
18
|
+
i as concat,
|
|
19
|
+
c as concatBytes,
|
|
20
|
+
f as concatHex
|
|
8
21
|
};
|
package/dist/index121.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 l=require("./index106.cjs"),u=require("./index122.cjs");async function i(s,t){const{chain:n=s.chain}=t,o=t.timeout??Math.max(((n==null?void 0:n.blockTime)??0)*3,5e3),a=await l.sendCalls(s,t);return await u.waitForCallsStatus(s,{...t,id:a.id,timeout:o})}exports.sendCallsSync=i;
|
package/dist/index121.js
CHANGED
|
@@ -1,48 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
method: "eth_getTransactionReceipt",
|
|
11
|
-
params: [`0x${e}`]
|
|
12
|
-
}, { dedupe: !0 }) : void 0)), b = s.some((e) => e === null) ? 100 : s.every((e) => (e == null ? void 0 : e.status) === "0x1") ? 200 : s.every((e) => (e == null ? void 0 : e.status) === "0x0") ? 500 : 600;
|
|
13
|
-
return {
|
|
14
|
-
atomic: !1,
|
|
15
|
-
chainId: u(h),
|
|
16
|
-
receipts: s.filter(Boolean),
|
|
17
|
-
status: b,
|
|
18
|
-
version: "2.0.0"
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
return a.request({
|
|
22
|
-
method: "wallet_getCallsStatus",
|
|
23
|
-
params: [t]
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
const { atomic: l = !1, chainId: r, receipts: n, version: d = "2.0.0", ...i } = await m(f.id), [p, g] = (() => {
|
|
27
|
-
const t = i.status;
|
|
28
|
-
return t >= 100 && t < 200 ? ["pending", t] : t >= 200 && t < 300 ? ["success", t] : t >= 300 && t < 700 ? ["failure", t] : t === "CONFIRMED" ? ["success", 200] : t === "PENDING" ? ["pending", 100] : [void 0, t];
|
|
29
|
-
})();
|
|
30
|
-
return {
|
|
31
|
-
...i,
|
|
32
|
-
atomic: l,
|
|
33
|
-
// @ts-expect-error: for backwards compatibility
|
|
34
|
-
chainId: r ? u(r) : void 0,
|
|
35
|
-
receipts: (n == null ? void 0 : n.map((t) => ({
|
|
36
|
-
...t,
|
|
37
|
-
blockNumber: c(t.blockNumber),
|
|
38
|
-
gasUsed: c(t.gasUsed),
|
|
39
|
-
status: N[t.status]
|
|
40
|
-
}))) ?? [],
|
|
41
|
-
statusCode: g,
|
|
42
|
-
status: p,
|
|
43
|
-
version: d
|
|
44
|
-
};
|
|
1
|
+
import { sendCalls as a } from "./index106.js";
|
|
2
|
+
import { waitForCallsStatus as u } from "./index122.js";
|
|
3
|
+
async function d(o, t) {
|
|
4
|
+
const { chain: s = o.chain } = t, i = t.timeout ?? Math.max(((s == null ? void 0 : s.blockTime) ?? 0) * 3, 5e3), n = await a(o, t);
|
|
5
|
+
return await u(o, {
|
|
6
|
+
...t,
|
|
7
|
+
id: n.id,
|
|
8
|
+
timeout: i
|
|
9
|
+
});
|
|
45
10
|
}
|
|
46
11
|
export {
|
|
47
|
-
|
|
12
|
+
d as sendCallsSync
|
|
48
13
|
};
|
package/dist/index122.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 q=require("./index35.cjs"),C=require("./index134.cjs"),p=require("./index55.cjs"),F=require("./index88.cjs"),T=require("./index93.cjs"),E=require("./index89.cjs"),R=require("./index90.cjs"),j=require("./index91.cjs"),B=require("./index103.cjs");async function I(r,s){const{id:o,pollingInterval:y=r.pollingInterval,status:g=({statusCode:t})=>t===200||t>=300,retryCount:m=4,retryDelay:v=({count:t})=>~~(1<<t)*200,timeout:l=6e4,throwOnFailure:f=!1}=s,S=j.stringify(["waitForCallsStatus",r.uid,o]),{promise:b,resolve:h,reject:n}=E.withResolvers();let i;const u=F.observe(S,{resolve:h,reject:n},t=>{const c=T.poll(async()=>{const w=e=>{clearTimeout(i),c(),e(),u()};try{const e=await R.withRetry(async()=>{const a=await p.getAction(r,B.getCallsStatus,"getCallsStatus")({id:o});if(f&&a.status==="failure")throw new C.BundleFailedError(a);return a},{retryCount:m,delay:v});if(!g(e))return;w(()=>t.resolve(e))}catch(e){w(()=>t.reject(e))}},{interval:y,emitOnBegin:!0});return c});return i=l?setTimeout(()=>{u(),clearTimeout(i),n(new d({id:o}))},l):void 0,await b}class d extends q.BaseError{constructor({id:s}){super(`Timed out while waiting for call bundle with id "${s}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}exports.WaitForCallsStatusTimeoutError=d;exports.waitForCallsStatus=I;
|
package/dist/index122.js
CHANGED
|
@@ -1,41 +1,61 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { BaseError as C } from "./index35.js";
|
|
2
|
+
import { BundleFailedError as F } from "./index134.js";
|
|
3
|
+
import { getAction as S } from "./index55.js";
|
|
4
|
+
import { observe as T } from "./index88.js";
|
|
5
|
+
import { poll as b } from "./index93.js";
|
|
6
|
+
import { withResolvers as E } from "./index89.js";
|
|
7
|
+
import { withRetry as B } from "./index90.js";
|
|
8
|
+
import { stringify as I } from "./index91.js";
|
|
9
|
+
import { getCallsStatus as j } from "./index103.js";
|
|
10
|
+
async function z(e, o) {
|
|
11
|
+
const {
|
|
12
|
+
id: i,
|
|
13
|
+
pollingInterval: f = e.pollingInterval,
|
|
14
|
+
status: p = ({ statusCode: t }) => t === 200 || t >= 300,
|
|
15
|
+
retryCount: w = 4,
|
|
16
|
+
retryDelay: d = ({ count: t }) => ~~(1 << t) * 200,
|
|
17
|
+
// exponential backoff
|
|
18
|
+
timeout: l = 6e4,
|
|
19
|
+
throwOnFailure: y = !1
|
|
20
|
+
} = o, v = I(["waitForCallsStatus", e.uid, i]), { promise: g, resolve: h, reject: n } = E();
|
|
21
|
+
let s;
|
|
22
|
+
const u = T(v, { resolve: h, reject: n }, (t) => {
|
|
23
|
+
const m = b(async () => {
|
|
24
|
+
const c = (r) => {
|
|
25
|
+
clearTimeout(s), m(), r(), u();
|
|
26
|
+
};
|
|
27
|
+
try {
|
|
28
|
+
const r = await B(async () => {
|
|
29
|
+
const a = await S(e, j, "getCallsStatus")({ id: i });
|
|
30
|
+
if (y && a.status === "failure")
|
|
31
|
+
throw new F(a);
|
|
32
|
+
return a;
|
|
33
|
+
}, {
|
|
34
|
+
retryCount: w,
|
|
35
|
+
delay: d
|
|
36
|
+
});
|
|
37
|
+
if (!p(r))
|
|
38
|
+
return;
|
|
39
|
+
c(() => t.resolve(r));
|
|
40
|
+
} catch (r) {
|
|
41
|
+
c(() => t.reject(r));
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
interval: f,
|
|
45
|
+
emitOnBegin: !0
|
|
25
46
|
});
|
|
47
|
+
return m;
|
|
48
|
+
});
|
|
49
|
+
return s = l ? setTimeout(() => {
|
|
50
|
+
u(), clearTimeout(s), n(new x({ id: i }));
|
|
51
|
+
}, l) : void 0, await g;
|
|
26
52
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
function u(e, f, i, { strict: o } = {}) {
|
|
33
|
-
s(e, f);
|
|
34
|
-
const n = `0x${e.replace("0x", "").slice((f ?? 0) * 2, (i ?? e.length) * 2)}`;
|
|
35
|
-
return o && c(n, f, i), n;
|
|
53
|
+
class x extends C {
|
|
54
|
+
constructor({ id: o }) {
|
|
55
|
+
super(`Timed out while waiting for call bundle with id "${o}" to be confirmed.`, { name: "WaitForCallsStatusTimeoutError" });
|
|
56
|
+
}
|
|
36
57
|
}
|
|
37
58
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
u as sliceHex
|
|
59
|
+
x as WaitForCallsStatusTimeoutError,
|
|
60
|
+
z as waitForCallsStatus
|
|
41
61
|
};
|
package/dist/index123.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function t(e,{serializedTransaction:n}){return e.request({method:"eth_sendRawTransaction",params:[n]},{retryCount:0})}exports.sendRawTransaction=t;
|
package/dist/index123.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
async function a(n, { serializedTransaction: t }) {
|
|
2
|
+
return n.request({
|
|
3
|
+
method: "eth_sendRawTransaction",
|
|
4
|
+
params: [t]
|
|
5
|
+
}, { retryCount: 0 });
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
a as sendRawTransaction
|
|
9
9
|
};
|
package/dist/index124.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("./index81.cjs"),f=require("./index83.cjs"),m=require("./index42.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/index124.js
CHANGED
|
@@ -1,93 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
async function P(i, s) {
|
|
14
|
-
const { account: f = i.account, capabilities: l, chain: d = i.chain, experimental_fallback: b, experimental_fallbackDelay: m = 32, forceAtomic: h = !1, id: C, version: v = "2.0.0" } = s, r = f ? E(f) : null, u = s.calls.map((t) => {
|
|
15
|
-
const e = t, a = e.abi ? T({
|
|
16
|
-
abi: e.abi,
|
|
17
|
-
functionName: e.functionName,
|
|
18
|
-
args: e.args
|
|
19
|
-
}) : e.data;
|
|
20
|
-
return {
|
|
21
|
-
data: e.dataSuffix && a ? g([a, e.dataSuffix]) : a,
|
|
22
|
-
to: e.to,
|
|
23
|
-
value: e.value ? c(e.value) : void 0
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
try {
|
|
27
|
-
const t = await i.request({
|
|
28
|
-
method: "wallet_sendCalls",
|
|
29
|
-
params: [
|
|
30
|
-
{
|
|
31
|
-
atomicRequired: h,
|
|
32
|
-
calls: u,
|
|
33
|
-
capabilities: l,
|
|
34
|
-
chainId: c(d.id),
|
|
35
|
-
from: r == null ? void 0 : r.address,
|
|
36
|
-
id: C,
|
|
37
|
-
version: v
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
}, { retryCount: 0 });
|
|
41
|
-
return typeof t == "string" ? { id: t } : t;
|
|
42
|
-
} catch (t) {
|
|
43
|
-
const e = t;
|
|
44
|
-
if (b && (e.name === "MethodNotFoundRpcError" || e.name === "MethodNotSupportedRpcError" || e.name === "UnknownRpcError" || e.details.toLowerCase().includes("does not exist / is not available") || e.details.toLowerCase().includes("missing or invalid. request()") || e.details.toLowerCase().includes("did not match any variant of untagged enum") || e.details.toLowerCase().includes("account upgraded to unsupported contract") || e.details.toLowerCase().includes("eip-7702 not supported") || e.details.toLowerCase().includes("unsupported wc_ method") || // magic.link
|
|
45
|
-
e.details.toLowerCase().includes("feature toggled misconfigured") || // Trust Wallet
|
|
46
|
-
e.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))) {
|
|
47
|
-
if (l && Object.values(l).some((n) => !n.optional)) {
|
|
48
|
-
const n = "non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";
|
|
49
|
-
throw new L(new w(n, {
|
|
50
|
-
details: n
|
|
51
|
-
}));
|
|
52
|
-
}
|
|
53
|
-
if (h && u.length > 1) {
|
|
54
|
-
const o = "`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";
|
|
55
|
-
throw new N(new w(o, {
|
|
56
|
-
details: o
|
|
57
|
-
}));
|
|
58
|
-
}
|
|
59
|
-
const a = [];
|
|
60
|
-
for (const o of u) {
|
|
61
|
-
const n = S(i, {
|
|
62
|
-
account: r,
|
|
63
|
-
chain: d,
|
|
64
|
-
data: o.data,
|
|
65
|
-
to: o.to,
|
|
66
|
-
value: o.value ? k(o.value) : void 0
|
|
67
|
-
});
|
|
68
|
-
a.push(n), m > 0 && await new Promise((x) => setTimeout(x, m));
|
|
69
|
-
}
|
|
70
|
-
const p = await Promise.allSettled(a);
|
|
71
|
-
if (p.every((o) => o.status === "rejected"))
|
|
72
|
-
throw p[0].reason;
|
|
73
|
-
const y = p.map((o) => o.status === "fulfilled" ? o.value : A);
|
|
74
|
-
return {
|
|
75
|
-
id: g([
|
|
76
|
-
...y,
|
|
77
|
-
c(d.id, { size: 32 }),
|
|
78
|
-
q
|
|
79
|
-
])
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
throw _(t, {
|
|
83
|
-
...s,
|
|
84
|
-
account: r,
|
|
85
|
-
chain: s.chain
|
|
86
|
-
});
|
|
87
|
-
}
|
|
1
|
+
import { TransactionReceiptRevertedError as i } from "./index81.js";
|
|
2
|
+
import { formatTransactionReceipt as f } from "./index83.js";
|
|
3
|
+
import { numberToHex as p } from "./index42.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;
|
|
88
13
|
}
|
|
89
14
|
export {
|
|
90
|
-
|
|
91
|
-
A as fallbackTransactionErrorMagicIdentifier,
|
|
92
|
-
P as sendCalls
|
|
15
|
+
h as sendRawTransactionSync
|
|
93
16
|
};
|
package/dist/index125.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 e=require("./index36.cjs");function i({chain:r,currentChainId:t}){if(!r)throw new e.ChainNotFoundError;if(t!==r.id)throw new e.ChainMismatchError({chain:r,currentChainId:t})}exports.assertCurrentChain=i;
|
package/dist/index125.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}), a = {};
|
|
8
|
-
for (const [r, u] of Object.entries(b)) {
|
|
9
|
-
a[Number(r)] = {};
|
|
10
|
-
for (let [i, d] of Object.entries(u))
|
|
11
|
-
i === "addSubAccount" && (i = "unstable_addSubAccount"), a[Number(r)][i] = d;
|
|
12
|
-
}
|
|
13
|
-
return typeof t == "number" ? a[t] : a;
|
|
1
|
+
import { ChainNotFoundError as t, ChainMismatchError as i } from "./index36.js";
|
|
2
|
+
function e({ chain: r, currentChainId: o }) {
|
|
3
|
+
if (!r)
|
|
4
|
+
throw new t();
|
|
5
|
+
if (o !== r.id)
|
|
6
|
+
throw new i({ chain: r, currentChainId: o });
|
|
14
7
|
}
|
|
15
8
|
export {
|
|
16
|
-
|
|
9
|
+
e as assertCurrentChain
|
|
17
10
|
};
|
package/dist/index126.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function s(e){return await e.request({method:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("./index32.cjs"),u=require("./index110.cjs"),D=require("./index35.cjs"),H=require("./index81.cjs"),J=require("./index62.cjs"),K=require("./index125.cjs"),Q=require("./index67.cjs"),V=require("./index44.cjs"),X=require("./index45.cjs"),d=require("./index55.cjs"),Y=require("./index116.cjs"),Z=require("./index48.cjs"),$=require("./index69.cjs"),tt=require("./index87.cjs"),O=require("./index64.cjs"),et=require("./index124.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;
|