@gardenfi/utils 3.0.0-beta.1 → 3.0.0-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/index.cjs +1 -1
- package/dist/index.js +36 -35
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +4 -4
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +125 -3
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +5 -26
- package/dist/index102.cjs +1 -2
- package/dist/index102.js +20 -23
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +45 -9
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +38 -8
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +6 -10
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +90 -11
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +14 -13
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +3 -14
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +26 -4
- package/dist/index110.cjs +2 -1
- package/dist/index110.js +24 -6
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +9 -18
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +8 -13
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +10 -6
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +11 -7
- package/dist/index115.cjs +1 -1
- package/dist/index115.js +13 -21
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +21 -7
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +14 -21
- package/dist/index118.cjs +1 -1
- package/dist/index118.js +4 -17
- package/dist/index119.cjs +1 -1
- package/dist/index119.js +5 -39
- package/dist/index120.cjs +1 -1
- package/dist/index120.js +18 -21
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +10 -80
- package/dist/index122.cjs +1 -1
- package/dist/index122.js +57 -10
- package/dist/index123.cjs +1 -1
- package/dist/index123.js +6 -58
- package/dist/index124.cjs +1 -1
- package/dist/index124.js +13 -13
- package/dist/index125.cjs +1 -1
- package/dist/index125.js +7 -8
- package/dist/index126.cjs +1 -1
- package/dist/index126.js +137 -20
- package/dist/index127.cjs +1 -1
- package/dist/index127.js +7 -6
- package/dist/index128.cjs +1 -1
- package/dist/index128.js +19 -33
- package/dist/index129.cjs +1 -1
- package/dist/index129.js +17 -32
- package/dist/index130.cjs +1 -1
- package/dist/index130.js +43 -9
- package/dist/index131.cjs +1 -1
- package/dist/index131.js +20 -49
- package/dist/index132.cjs +1 -1
- package/dist/index132.js +79 -18
- package/dist/index133.cjs +1 -1
- package/dist/index133.js +10 -105
- package/dist/index134.cjs +1 -1
- package/dist/index134.js +8 -63
- package/dist/index135.cjs +1 -1
- package/dist/index135.js +6 -9
- package/dist/index136.cjs +1 -1
- package/dist/index136.js +41 -71
- package/dist/index137.cjs +1 -2
- package/dist/index137.js +6 -3
- package/dist/index138.cjs +1 -1
- package/dist/index138.js +14 -9
- package/dist/index139.cjs +1 -1
- package/dist/index139.js +34 -13
- package/dist/index140.cjs +1 -1
- package/dist/index140.js +55 -4
- package/dist/index141.cjs +1 -1
- package/dist/index141.js +24 -11
- package/dist/index142.cjs +1 -1
- package/dist/index142.js +7 -2
- package/dist/index143.cjs +1 -1
- package/dist/index143.js +19 -32
- package/dist/index144.cjs +1 -1
- package/dist/index144.js +15 -21
- package/dist/index145.cjs +1 -1
- package/dist/index145.js +5 -5
- package/dist/index146.cjs +1 -1
- package/dist/index146.js +13 -5
- package/dist/index147.cjs +1 -1
- package/dist/index147.js +10 -5
- package/dist/index148.cjs +1 -9
- package/dist/index148.js +10 -33
- package/dist/index149.cjs +1 -1
- package/dist/index149.js +12 -3
- package/dist/index150.cjs +1 -1
- package/dist/index150.js +8 -18
- package/dist/index151.cjs +1 -1
- package/dist/index151.js +3 -20
- package/dist/index152.cjs +1 -1
- package/dist/index152.js +16 -35
- package/dist/index153.cjs +1 -1
- package/dist/index153.js +5 -8
- package/dist/index154.cjs +1 -4
- package/dist/index154.js +163 -186
- package/dist/index155.cjs +1 -1
- package/dist/index155.js +98 -22
- package/dist/index156.cjs +1 -1
- package/dist/index156.js +33 -161
- package/dist/index157.cjs +1 -1
- package/dist/index157.js +8 -126
- package/dist/index158.cjs +1 -1
- package/dist/index158.js +60 -27
- package/dist/index159.cjs +1 -1
- package/dist/index159.js +19 -55
- package/dist/index160.cjs +1 -1
- package/dist/index160.js +103 -188
- package/dist/index161.cjs +1 -1
- package/dist/index161.js +79 -4
- package/dist/index162.cjs +1 -1
- package/dist/index162.js +7 -18
- package/dist/index163.cjs +1 -1
- package/dist/index163.js +72 -3
- package/dist/index164.cjs +2 -1
- package/dist/index164.js +3 -17
- package/dist/index165.cjs +1 -1
- package/dist/index165.js +9 -12
- package/dist/index166.cjs +1 -1
- package/dist/index166.js +11 -32
- package/dist/index167.cjs +1 -1
- package/dist/index167.js +5 -3
- package/dist/index168.cjs +1 -1
- package/dist/index168.js +2 -28
- package/dist/index169.cjs +1 -1
- package/dist/index169.js +32 -9
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +2 -2
- package/dist/index170.cjs +1 -1
- package/dist/index170.js +18 -22
- package/dist/index171.cjs +1 -1
- package/dist/index171.js +5 -28
- package/dist/index172.cjs +1 -1
- package/dist/index172.js +5 -3
- package/dist/index173.cjs +1 -1
- package/dist/index173.js +5 -6
- package/dist/index174.cjs +9 -1
- package/dist/index174.js +35 -6
- package/dist/index175.cjs +1 -1
- package/dist/index175.js +3 -33
- package/dist/index176.cjs +1 -1
- package/dist/index176.js +19 -5
- package/dist/index177.cjs +1 -1
- package/dist/index177.js +14 -31
- package/dist/index178.cjs +1 -1
- package/dist/index178.js +32 -46
- package/dist/index179.cjs +1 -1
- package/dist/index179.js +8 -32
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +5 -5
- package/dist/index180.cjs +4 -1
- package/dist/index180.js +194 -8
- package/dist/index181.cjs +1 -1
- package/dist/index181.js +25 -40
- package/dist/index182.cjs +1 -1
- package/dist/index182.js +160 -50
- package/dist/index183.cjs +1 -1
- package/dist/index183.js +125 -102
- package/dist/index184.cjs +1 -1
- package/dist/index184.js +28 -3
- package/dist/index185.cjs +1 -1
- package/dist/index185.js +191 -5
- package/dist/index186.cjs +1 -1
- package/dist/index186.js +4 -4
- package/dist/index187.cjs +1 -1
- package/dist/index187.js +20 -17
- package/dist/index188.cjs +1 -1
- package/dist/index188.js +3 -6
- package/dist/index189.cjs +1 -1
- package/dist/index189.js +16 -8
- package/dist/index190.cjs +1 -1
- package/dist/index190.js +31 -100
- package/dist/index191.cjs +1 -1
- package/dist/index191.js +3 -6
- package/dist/index192.cjs +1 -1
- package/dist/index192.js +27 -6
- package/dist/index193.cjs +1 -1
- package/dist/index193.js +25 -27
- package/dist/index194.cjs +1 -1
- package/dist/index194.js +28 -34
- package/dist/index195.cjs +1 -1
- package/dist/index195.js +6 -13
- package/dist/index196.cjs +1 -1
- package/dist/index196.js +6 -78
- package/dist/index197.cjs +1 -1
- package/dist/index197.js +33 -2
- package/dist/index198.cjs +1 -1
- package/dist/index198.js +5 -19
- package/dist/index199.cjs +1 -1
- package/dist/index199.js +32 -166
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +8 -8
- package/dist/index200.cjs +1 -1
- package/dist/index200.js +48 -16
- package/dist/index201.cjs +1 -1
- package/dist/index201.js +32 -10
- package/dist/index202.cjs +1 -1
- package/dist/index202.js +15 -23
- package/dist/index203.cjs +1 -1
- package/dist/index203.js +41 -17
- package/dist/index204.cjs +1 -1
- package/dist/index204.js +104 -15
- package/dist/index205.cjs +1 -1
- package/dist/index205.js +3 -6
- package/dist/index206.cjs +1 -1
- package/dist/index206.js +5 -13
- package/dist/index207.cjs +1 -1
- package/dist/index207.js +3 -10
- package/dist/index208.cjs +1 -1
- package/dist/index208.js +17 -16
- package/dist/index209.cjs +1 -1
- package/dist/index209.js +8 -24
- package/dist/index210.cjs +1 -1
- package/dist/index210.js +5 -46
- package/dist/index211.cjs +1 -1
- package/dist/index211.js +27 -9
- package/dist/index212.cjs +1 -2
- package/dist/index212.js +77 -40
- package/dist/index213.cjs +1 -1
- package/dist/index213.js +2 -2
- package/dist/index214.cjs +1 -1
- package/dist/index214.js +18 -5
- package/dist/index215.cjs +1 -1
- package/dist/index215.js +16 -9
- package/dist/index216.cjs +1 -1
- package/dist/index216.js +10 -19
- package/dist/index217.cjs +1 -1
- package/dist/index217.js +24 -8
- package/dist/index218.cjs +1 -1
- package/dist/index218.js +46 -66
- package/dist/index219.cjs +1 -1
- package/dist/index219.js +9 -65
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +8 -8
- package/dist/index220.cjs +1 -1
- package/dist/index220.js +99 -184
- package/dist/index221.cjs +1 -1
- package/dist/index221.js +15 -27
- package/dist/index222.cjs +1 -1
- package/dist/index222.js +209 -71
- package/dist/index223.cjs +1 -1
- package/dist/index223.js +105 -37
- package/dist/index224.cjs +1 -1
- package/dist/index224.js +205 -15
- package/dist/index225.cjs +1 -1
- package/dist/index225.js +41 -12
- package/dist/index226.cjs +1 -1
- package/dist/index226.js +78 -11
- package/dist/index227.cjs +1 -1
- package/dist/index227.js +2 -13
- package/dist/index228.cjs +2 -1
- package/dist/index228.js +40 -18
- package/dist/index229.cjs +1 -1
- package/dist/index229.js +2 -109
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +26 -12
- package/dist/index230.cjs +1 -1
- package/dist/index230.js +5 -6
- package/dist/index231.cjs +1 -1
- package/dist/index231.js +11 -7
- package/dist/index232.cjs +1 -1
- package/dist/index232.js +17 -101
- package/dist/index233.cjs +1 -1
- package/dist/index233.js +8 -26
- package/dist/index234.cjs +1 -1
- package/dist/index234.js +66 -16
- package/dist/index235.cjs +1 -1
- package/dist/index235.js +63 -212
- package/dist/index236.cjs +1 -1
- package/dist/index236.js +185 -39
- package/dist/index237.cjs +1 -1
- package/dist/index237.js +26 -76
- package/dist/index238.cjs +1 -1
- package/dist/index238.js +77 -2
- package/dist/index239.cjs +1 -1
- package/dist/index239.js +38 -9
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +8 -59
- package/dist/index240.cjs +1 -1
- package/dist/index240.js +16 -19
- package/dist/index241.cjs +1 -2
- package/dist/index241.js +8 -61
- package/dist/index242.cjs +1 -1
- package/dist/index242.js +11 -14
- package/dist/index243.cjs +1 -1
- package/dist/index243.js +11 -67
- package/dist/index244.cjs +1 -1
- package/dist/index244.js +6 -657
- package/dist/index245.cjs +1 -1
- package/dist/index245.js +6 -206
- package/dist/index246.cjs +1 -1
- package/dist/index246.js +22 -173
- package/dist/index247.cjs +1 -1
- package/dist/index247.js +19 -4
- package/dist/index248.cjs +1 -1
- package/dist/index248.js +12 -2
- package/dist/index249.cjs +1 -0
- package/dist/index249.js +22 -0
- package/dist/index25.cjs +1 -16
- package/dist/index25.js +12 -113
- package/dist/index250.cjs +2 -0
- package/dist/index250.js +94 -0
- package/dist/index251.cjs +1 -0
- package/dist/index251.js +17 -0
- package/dist/index252.cjs +1 -0
- package/dist/index252.js +660 -0
- package/dist/index253.cjs +1 -0
- package/dist/index253.js +180 -0
- package/dist/index254.cjs +1 -0
- package/dist/index254.js +71 -0
- package/dist/index255.cjs +1 -0
- package/dist/index255.js +7 -0
- package/dist/index256.cjs +1 -0
- package/dist/index256.js +4 -0
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +59 -30
- package/dist/index27.cjs +16 -1
- package/dist/index27.js +111 -24
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +29 -7
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +35 -35
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +41 -24
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +9 -9
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +2 -2
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +1 -1
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +11 -11
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +3 -3
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +3 -3
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +3 -3
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +2 -2
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +2 -2
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +15 -15
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +1 -1
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +4 -4
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +14 -17
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +3 -3
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +8 -8
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +14 -14
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +60 -56
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +1 -1
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +8 -8
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +2 -2
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +3 -3
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +131 -76
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +2 -2
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +76 -6
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +13 -21
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +51 -8
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +7 -31
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +7 -7
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +21 -16
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +8 -73
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +31 -35
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +15 -15
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +69 -61
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +35 -11
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +15 -13
- package/dist/index78.cjs +1 -3
- package/dist/index78.js +72 -92
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +11 -23
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +28 -32
- package/dist/index81.cjs +2 -1
- package/dist/index81.js +118 -42
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +13 -5
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +24 -151
- package/dist/index84.cjs +1 -20
- package/dist/index84.js +31 -324
- package/dist/index85.cjs +1 -3
- package/dist/index85.js +42 -449
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +6 -64
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +101 -35
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +36 -14
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +9 -2
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +19 -15
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +2 -11
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +72 -122
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +15 -5
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +151 -21
- package/dist/index95.cjs +20 -1
- package/dist/index95.js +326 -45
- package/dist/index96.cjs +3 -1
- package/dist/index96.js +451 -38
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +64 -6
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +15 -87
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +10 -14
- package/dist/src/lib/utils.d.ts +15 -0
- package/package.json +3 -3
package/dist/index29.js
CHANGED
|
@@ -3,10 +3,10 @@ import { parseAccount as U } from "./index32.js";
|
|
|
3
3
|
import { multicall3Abi as z } from "./index21.js";
|
|
4
4
|
import { aggregate3Signature as X } from "./index33.js";
|
|
5
5
|
import { deploylessCallViaBytecodeBytecode as Y, deploylessCallViaFactoryBytecode as Z, multicall3Bytecode as tt } from "./index34.js";
|
|
6
|
-
import { BaseError as
|
|
6
|
+
import { BaseError as N } from "./index35.js";
|
|
7
7
|
import { ClientChainNotConfiguredError as H, ChainDoesNotSupportContract as at } from "./index36.js";
|
|
8
|
-
import { CounterfactualDeploymentFailedError as et, RawContractError as
|
|
9
|
-
import { decodeFunctionResult as
|
|
8
|
+
import { CounterfactualDeploymentFailedError as et, RawContractError as ot } from "./index37.js";
|
|
9
|
+
import { decodeFunctionResult as rt } from "./index38.js";
|
|
10
10
|
import { encodeDeployData as L } from "./index39.js";
|
|
11
11
|
import { encodeFunctionData as ct } from "./index40.js";
|
|
12
12
|
import { getChainContractAddress as nt } from "./index41.js";
|
|
@@ -20,43 +20,43 @@ import { assertRequest as ft } from "./index48.js";
|
|
|
20
20
|
import { parseAbi as G } from "./index49.js";
|
|
21
21
|
async function zt(t, a) {
|
|
22
22
|
var q, E, O, P;
|
|
23
|
-
const { account: e = t.account, authorizationList: s, batch: i = !!((q = t.batch) != null && q.multicall), blockNumber: l, blockTag: C = t.experimental_blockTag ?? "latest", accessList:
|
|
23
|
+
const { account: e = t.account, authorizationList: s, batch: i = !!((q = t.batch) != null && q.multicall), blockNumber: l, blockTag: C = t.experimental_blockTag ?? "latest", accessList: x, blobs: D, blockOverrides: b, code: h, data: c, factory: m, factoryData: u, gas: B, gasPrice: k, maxFeePerBlobGas: y, maxFeePerGas: g, maxPriorityFeePerGas: p, nonce: w, to: o, value: $, stateOverride: W, ...I } = a, R = e ? U(e) : void 0;
|
|
24
24
|
if (h && (m || u))
|
|
25
|
-
throw new
|
|
26
|
-
if (h &&
|
|
27
|
-
throw new
|
|
28
|
-
const S = h && c, A = m && u &&
|
|
25
|
+
throw new N("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
|
|
26
|
+
if (h && o)
|
|
27
|
+
throw new N("Cannot provide both `code` & `to` as parameters.");
|
|
28
|
+
const S = h && c, A = m && u && o && c, _ = S || A, J = S ? M({
|
|
29
29
|
code: h,
|
|
30
30
|
data: c
|
|
31
31
|
}) : A ? bt({
|
|
32
32
|
data: c,
|
|
33
33
|
factory: m,
|
|
34
34
|
factoryData: u,
|
|
35
|
-
to:
|
|
35
|
+
to: o
|
|
36
36
|
}) : c;
|
|
37
37
|
try {
|
|
38
38
|
ft(a);
|
|
39
|
-
const
|
|
39
|
+
const r = (typeof l == "bigint" ? j(l) : void 0) || C, d = b ? Q(b) : void 0, f = dt(W), T = (P = (O = (E = t.chain) == null ? void 0 : E.formatters) == null ? void 0 : O.transactionRequest) == null ? void 0 : P.format, v = (T || lt)({
|
|
40
40
|
// Pick out extra data that might exist on the chain's transaction request type.
|
|
41
41
|
...it(I, { format: T }),
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
accessList: x,
|
|
43
|
+
account: R,
|
|
44
44
|
authorizationList: s,
|
|
45
|
-
blobs:
|
|
45
|
+
blobs: D,
|
|
46
46
|
data: J,
|
|
47
|
-
gas:
|
|
47
|
+
gas: B,
|
|
48
48
|
gasPrice: k,
|
|
49
49
|
maxFeePerBlobGas: y,
|
|
50
50
|
maxFeePerGas: g,
|
|
51
51
|
maxPriorityFeePerGas: p,
|
|
52
52
|
nonce: w,
|
|
53
|
-
to: _ ? void 0 :
|
|
53
|
+
to: _ ? void 0 : o,
|
|
54
54
|
value: $
|
|
55
|
-
});
|
|
56
|
-
if (i && mt({ request:
|
|
55
|
+
}, "call");
|
|
56
|
+
if (i && mt({ request: v }) && !f && !d)
|
|
57
57
|
try {
|
|
58
58
|
return await pt(t, {
|
|
59
|
-
...
|
|
59
|
+
...v,
|
|
60
60
|
blockNumber: l,
|
|
61
61
|
blockTag: C
|
|
62
62
|
});
|
|
@@ -66,8 +66,8 @@ async function zt(t, a) {
|
|
|
66
66
|
}
|
|
67
67
|
const K = (() => {
|
|
68
68
|
const n = [
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
v,
|
|
70
|
+
r
|
|
71
71
|
];
|
|
72
72
|
return f && d ? [...n, f, d] : f ? [...n, f] : d ? [...n, {}, d] : n;
|
|
73
73
|
})(), V = await t.request({
|
|
@@ -75,13 +75,13 @@ async function zt(t, a) {
|
|
|
75
75
|
params: K
|
|
76
76
|
});
|
|
77
77
|
return V === "0x" ? { data: void 0 } : { data: V };
|
|
78
|
-
} catch (
|
|
79
|
-
const
|
|
80
|
-
if (t.ccipRead !== !1 && (
|
|
81
|
-
return { data: await d(t, { data:
|
|
82
|
-
throw _ && (
|
|
78
|
+
} catch (F) {
|
|
79
|
+
const r = ht(F), { offchainLookup: d, offchainLookupSignature: f } = await import("./index30.js");
|
|
80
|
+
if (t.ccipRead !== !1 && (r == null ? void 0 : r.slice(0, 10)) === f && o)
|
|
81
|
+
return { data: await d(t, { data: r, to: o }) };
|
|
82
|
+
throw _ && (r == null ? void 0 : r.slice(0, 10)) === "0x101bb98d" ? new et({ factory: m }) : st(F, {
|
|
83
83
|
...a,
|
|
84
|
-
account:
|
|
84
|
+
account: R,
|
|
85
85
|
chain: t.chain
|
|
86
86
|
});
|
|
87
87
|
}
|
|
@@ -92,7 +92,7 @@ function mt({ request: t }) {
|
|
|
92
92
|
}
|
|
93
93
|
async function pt(t, a) {
|
|
94
94
|
var k;
|
|
95
|
-
const { batchSize: e = 1024, deployless: s = !1, wait: i = 0 } = typeof ((k = t.batch) == null ? void 0 : k.multicall) == "object" ? t.batch.multicall : {}, { blockNumber: l, blockTag: C = t.experimental_blockTag ?? "latest", data:
|
|
95
|
+
const { batchSize: e = 1024, deployless: s = !1, wait: i = 0 } = typeof ((k = t.batch) == null ? void 0 : k.multicall) == "object" ? t.batch.multicall : {}, { blockNumber: l, blockTag: C = t.experimental_blockTag ?? "latest", data: x, to: D } = a, b = (() => {
|
|
96
96
|
if (s)
|
|
97
97
|
return null;
|
|
98
98
|
if (a.multicallAddress)
|
|
@@ -111,10 +111,10 @@ async function pt(t, a) {
|
|
|
111
111
|
return y.reduce((p, { data: w }) => p + (w.length - 2), 0) > e * 2;
|
|
112
112
|
},
|
|
113
113
|
fn: async (y) => {
|
|
114
|
-
const g = y.map((
|
|
114
|
+
const g = y.map((o) => ({
|
|
115
115
|
allowFailure: !0,
|
|
116
|
-
callData:
|
|
117
|
-
target:
|
|
116
|
+
callData: o.data,
|
|
117
|
+
target: o.to
|
|
118
118
|
})), p = ct({
|
|
119
119
|
abi: z,
|
|
120
120
|
args: [g],
|
|
@@ -133,16 +133,16 @@ async function pt(t, a) {
|
|
|
133
133
|
c
|
|
134
134
|
]
|
|
135
135
|
});
|
|
136
|
-
return
|
|
136
|
+
return rt({
|
|
137
137
|
abi: z,
|
|
138
138
|
args: [g],
|
|
139
139
|
functionName: "aggregate3",
|
|
140
140
|
data: w || "0x"
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
|
-
}), [{ returnData: u, success:
|
|
144
|
-
if (!
|
|
145
|
-
throw new
|
|
143
|
+
}), [{ returnData: u, success: B }] = await m({ data: x, to: D });
|
|
144
|
+
if (!B)
|
|
145
|
+
throw new ot({ data: u });
|
|
146
146
|
return u === "0x" ? { data: void 0 } : { data: u };
|
|
147
147
|
}
|
|
148
148
|
function M(t) {
|
|
@@ -163,7 +163,7 @@ function bt(t) {
|
|
|
163
163
|
}
|
|
164
164
|
function ht(t) {
|
|
165
165
|
var e;
|
|
166
|
-
if (!(t instanceof
|
|
166
|
+
if (!(t instanceof N))
|
|
167
167
|
return;
|
|
168
168
|
const a = t.walk();
|
|
169
169
|
return typeof (a == null ? void 0 : a.data) == "object" ? (e = a.data) == null ? void 0 : e.data : a.data;
|
package/dist/index3.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("jwt-decode"),h=t=>t.startsWith("0x")?t:`0x${t}`,f=t=>`Bearer ${t}`,T=t=>new Promise(n=>setTimeout(n,t)),y=t=>{try{return l.jwtDecode(t)}catch{return}};var a=(t=>(t.MAINNET="mainnet",t.TESTNET="testnet",t.LOCALNET="localnet",t))(a||{}),u=(t=>(t.MAINNET="mainnet",t.TESTNET="testnet",t.LOCALNET="localnet",t))(u||{});const x=t=>t.startsWith("0x")?t:`0x${t}`;function p(t,n="big"){if(t=t.replace("0x",""),t.length!==64)throw new Error("Invalid hash length");const e=[];for(let o=0;o<8;o++){const s=t.slice(o*8,(o+1)*8).match(/.{2}/g);n==="little"&&s.reverse();const c=s.join("");e.push(parseInt(c,16))}const r=(o,i,s,c)=>BigInt(o)<<96n|BigInt(i)<<64n|BigInt(s)<<32n|BigInt(c);return[r(e[0],e[1],e[2],e[3]),r(e[4],e[5],e[6],e[7])]}function A(t,n="big"){if(t=t.replace("0x",""),t.length!==64)throw new Error("Invalid hash length");const e=[];for(let r=0;r<8;r++){const i=t.slice(r*8,(r+1)*8).match(/.{2}/g);n==="little"&&i.reverse();const s=i.join("");e.push(parseInt(s,16))}return e}function d(t){return t.startsWith("0x")?t.slice(2):t}const w=(t,n)=>t&&typeof t=="object"&&n.every(e=>e in t);exports.Authorization=f;exports.Environment=u;exports.Network=a;exports.add0x=x;exports.hasKeys=w;exports.hexToU128Array=p;exports.hexToU32Array=A;exports.parseJwt=y;exports.sleep=T;exports.trim0x=d;exports.with0x=h;
|
package/dist/index3.js
CHANGED
|
@@ -1,38 +1,55 @@
|
|
|
1
|
-
import { jwtDecode as
|
|
2
|
-
const
|
|
1
|
+
import { jwtDecode as a } from "jwt-decode";
|
|
2
|
+
const f = (t) => t.startsWith("0x") ? t : `0x${t}`, T = (t) => `Bearer ${t}`, p = (t) => new Promise((n) => setTimeout(n, t)), I = (t) => {
|
|
3
3
|
try {
|
|
4
|
-
return
|
|
4
|
+
return a(t);
|
|
5
5
|
} catch {
|
|
6
6
|
return;
|
|
7
7
|
}
|
|
8
8
|
};
|
|
9
|
-
var
|
|
10
|
-
const
|
|
11
|
-
function
|
|
9
|
+
var u = /* @__PURE__ */ ((t) => (t.MAINNET = "mainnet", t.TESTNET = "testnet", t.LOCALNET = "localnet", t))(u || {}), l = /* @__PURE__ */ ((t) => (t.MAINNET = "mainnet", t.TESTNET = "testnet", t.LOCALNET = "localnet", t))(l || {});
|
|
10
|
+
const x = (t) => t.startsWith("0x") ? t : `0x${t}`;
|
|
11
|
+
function y(t, n = "big") {
|
|
12
12
|
if (t = t.replace("0x", ""), t.length !== 64)
|
|
13
13
|
throw new Error("Invalid hash length");
|
|
14
|
-
const
|
|
15
|
-
for (let
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
14
|
+
const e = [];
|
|
15
|
+
for (let s = 0; s < 8; s++) {
|
|
16
|
+
const c = t.slice(s * 8, (s + 1) * 8).match(/.{2}/g);
|
|
17
|
+
n === "little" && c.reverse();
|
|
18
|
+
const i = c.join("");
|
|
19
|
+
e.push(parseInt(i, 16));
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
const r = (s, o, c, i) => BigInt(s) << 96n | BigInt(o) << 64n | BigInt(c) << 32n | BigInt(i);
|
|
22
|
+
return [
|
|
23
|
+
r(e[0], e[1], e[2], e[3]),
|
|
24
|
+
r(e[4], e[5], e[6], e[7])
|
|
25
|
+
];
|
|
22
26
|
}
|
|
23
|
-
function
|
|
27
|
+
function A(t, n = "big") {
|
|
28
|
+
if (t = t.replace("0x", ""), t.length !== 64)
|
|
29
|
+
throw new Error("Invalid hash length");
|
|
30
|
+
const e = [];
|
|
31
|
+
for (let r = 0; r < 8; r++) {
|
|
32
|
+
const o = t.slice(r * 8, (r + 1) * 8).match(/.{2}/g);
|
|
33
|
+
n === "little" && o.reverse();
|
|
34
|
+
const c = o.join("");
|
|
35
|
+
e.push(parseInt(c, 16));
|
|
36
|
+
}
|
|
37
|
+
return e;
|
|
38
|
+
}
|
|
39
|
+
function E(t) {
|
|
24
40
|
return t.startsWith("0x") ? t.slice(2) : t;
|
|
25
41
|
}
|
|
26
|
-
const
|
|
42
|
+
const m = (t, n) => t && typeof t == "object" && n.every((e) => e in t);
|
|
27
43
|
export {
|
|
28
44
|
T as Authorization,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
45
|
+
l as Environment,
|
|
46
|
+
u as Network,
|
|
47
|
+
x as add0x,
|
|
48
|
+
m as hasKeys,
|
|
49
|
+
y as hexToU128Array,
|
|
50
|
+
A as hexToU32Array,
|
|
51
|
+
I as parseJwt,
|
|
52
|
+
p as sleep,
|
|
53
|
+
E as trim0x,
|
|
54
|
+
f as with0x
|
|
38
55
|
};
|
package/dist/index30.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./index29.cjs"),p=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./index29.cjs"),p=require("./index200.cjs"),h=require("./index161.cjs"),g=require("./index170.cjs"),E=require("./index185.cjs"),L=require("./index111.cjs"),R=require("./index120.cjs"),S=require("./index151.cjs"),q=require("./index201.cjs"),O=require("./index91.cjs"),T="0x556f1830",w={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function x(c,{blockNumber:u,blockTag:l,data:a,to:n}){const{args:i}=g.decodeErrorResult({data:a,abi:[w]}),[r,o,s,d,t]=i,{ccipRead:e}=c,y=e&&typeof(e==null?void 0:e.request)=="function"?e.request:b;try{if(!L.isAddressEqual(n,r))throw new p.OffchainLookupSenderMismatchError({sender:r,to:n});const f=o.includes(q.localBatchGatewayUrl)?await q.localBatchGatewayRequest({data:s,ccipRequest:y}):await y({data:s,sender:r,urls:o}),{data:m}=await k.call(c,{blockNumber:u,blockTag:l,data:R.concat([d,E.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[f,t])]),to:n});return m}catch(f){throw new p.OffchainLookupError({callbackSelector:d,cause:f,data:a,extraData:t,sender:r,urls:o})}}async function b({data:c,sender:u,urls:l}){var n;let a=new Error("An unknown error occurred.");for(let i=0;i<l.length;i++){const r=l[i],o=r.includes("{data}")?"GET":"POST",s=o==="POST"?{data:c,sender:u}:void 0,d=o==="POST"?{"Content-Type":"application/json"}:{};try{const t=await fetch(r.replace("{sender}",u.toLowerCase()).replace("{data}",c),{body:JSON.stringify(s),headers:d,method:o});let e;if((n=t.headers.get("Content-Type"))!=null&&n.startsWith("application/json")?e=(await t.json()).data:e=await t.text(),!t.ok){a=new h.HttpRequestError({body:s,details:e!=null&&e.error?O.stringify(e.error):t.statusText,headers:t.headers,status:t.status,url:r});continue}if(!S.isHex(e)){a=new p.OffchainLookupResponseMalformedError({result:e,url:r});continue}return e}catch(t){a=new h.HttpRequestError({body:s,details:t.message,url:r})}}throw a}exports.ccipRequest=b;exports.offchainLookup=x;exports.offchainLookupAbiItem=w;exports.offchainLookupSignature=T;
|
package/dist/index30.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { call as h } from "./index29.js";
|
|
2
|
-
import { OffchainLookupSenderMismatchError as w, OffchainLookupError as b, OffchainLookupResponseMalformedError as k } from "./
|
|
3
|
-
import { HttpRequestError as d } from "./
|
|
4
|
-
import { decodeErrorResult as g } from "./
|
|
5
|
-
import { encodeAbiParameters as q } from "./
|
|
6
|
-
import { isAddressEqual as E } from "./
|
|
7
|
-
import { concat as L } from "./
|
|
8
|
-
import { isHex as O } from "./
|
|
9
|
-
import { localBatchGatewayUrl as x, localBatchGatewayRequest as S } from "./
|
|
10
|
-
import { stringify as T } from "./
|
|
2
|
+
import { OffchainLookupSenderMismatchError as w, OffchainLookupError as b, OffchainLookupResponseMalformedError as k } from "./index200.js";
|
|
3
|
+
import { HttpRequestError as d } from "./index161.js";
|
|
4
|
+
import { decodeErrorResult as g } from "./index170.js";
|
|
5
|
+
import { encodeAbiParameters as q } from "./index185.js";
|
|
6
|
+
import { isAddressEqual as E } from "./index111.js";
|
|
7
|
+
import { concat as L } from "./index120.js";
|
|
8
|
+
import { isHex as O } from "./index151.js";
|
|
9
|
+
import { localBatchGatewayUrl as x, localBatchGatewayRequest as S } from "./index201.js";
|
|
10
|
+
import { stringify as T } from "./index91.js";
|
|
11
11
|
const I = "0x556f1830", R = {
|
|
12
12
|
name: "OffchainLookup",
|
|
13
13
|
type: "error",
|
package/dist/index31.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index218.cjs"),a=require("./index219.cjs");function i(t){return{...typeof t.baseFeePerGas=="bigint"&&{baseFeePerGas:e.fromNumber(t.baseFeePerGas)},...typeof t.blobBaseFee=="bigint"&&{blobBaseFee:e.fromNumber(t.blobBaseFee)},...typeof t.feeRecipient=="string"&&{feeRecipient:t.feeRecipient},...typeof t.gasLimit=="bigint"&&{gasLimit:e.fromNumber(t.gasLimit)},...typeof t.number=="bigint"&&{number:e.fromNumber(t.number)},...typeof t.prevRandao=="bigint"&&{prevRandao:e.fromNumber(t.prevRandao)},...typeof t.time=="bigint"&&{time:e.fromNumber(t.time)},...t.withdrawals&&{withdrawals:t.withdrawals.map(a.toRpc)}}}exports.toRpc=i;
|
package/dist/index31.js
CHANGED
package/dist/index35.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index168.cjs");let i={getDocsUrl:({docsBaseUrl:s,docsPath:t="",docsSlug:e})=>t?`${s??"https://viem.sh"}${t}${e?`#${e}`:""}`:void 0,version:`viem@${l.version}`};class u extends Error{constructor(t,e={}){var o;const r=(()=>{var c;return e.cause instanceof u?e.cause.details:(c=e.cause)!=null&&c.message?e.cause.message:e.details})(),n=e.cause instanceof u&&e.cause.docsPath||e.docsPath,a=(o=i.getDocsUrl)==null?void 0:o.call(i,{...e,docsPath:n}),b=[t||"An error occurred.","",...e.metaMessages?[...e.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...i.version?[`Version: ${i.version}`]:[]].join(`
|
|
2
2
|
`);super(b,e.cause?{cause:e.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=n,this.metaMessages=e.metaMessages,this.name=e.name??this.name,this.shortMessage=t,this.version=l.version}walk(t){return d(this,t)}}function d(s,t){return t!=null&&t(s)?s:s&&typeof s=="object"&&"cause"in s&&s.cause!==void 0?d(s.cause,t):t?null:s}exports.BaseError=u;
|
package/dist/index35.js
CHANGED
package/dist/index37.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./index32.cjs"),C=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./index32.cjs"),C=require("./index169.cjs"),P=require("./index170.cjs"),v=require("./index166.cjs"),E=require("./index171.cjs"),$=require("./index75.cjs"),j=require("./index172.cjs"),h=require("./index173.cjs"),x=require("./index95.cjs"),m=require("./index35.cjs"),F=require("./index174.cjs"),w=require("./index81.cjs"),O=require("./index175.cjs");class q extends m.BaseError{constructor(e,{account:o,docsPath:c,chain:n,data:l,gas:a,gasPrice:u,maxFeePerGas:r,maxPriorityFeePerGas:t,nonce:i,to:s,value:d,stateOverride:f}){var p;const b=o?A.parseAccount(o):void 0;let y=w.prettyPrint({from:b==null?void 0:b.address,to:s,value:typeof d<"u"&&`${j.formatEther(d)} ${((p=n==null?void 0:n.nativeCurrency)==null?void 0:p.symbol)||"ETH"}`,data:l,gas:a,gasPrice:typeof u<"u"&&`${h.formatGwei(u)} gwei`,maxFeePerGas:typeof r<"u"&&`${h.formatGwei(r)} gwei`,maxPriorityFeePerGas:typeof t<"u"&&`${h.formatGwei(t)} gwei`,nonce:i});f&&(y+=`
|
|
2
2
|
${F.prettyStateOverride(f)}`),super(e.shortMessage,{cause:e,docsPath:c,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",y].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class M extends m.BaseError{constructor(e,{abi:o,args:c,contractAddress:n,docsPath:l,functionName:a,sender:u}){const r=$.getAbiItem({abi:o,args:c,name:a}),t=r?E.formatAbiItemWithArgs({abiItem:r,args:c,includeFunctionName:!1,includeName:!1}):void 0,i=r?v.formatAbiItem(r,{includeName:!0}):void 0,s=w.prettyPrint({address:n&&O.getContractAddress(n),function:i,args:t&&t!=="()"&&`${[...Array((a==null?void 0:a.length)??0).keys()].map(()=>" ").join("")}${t}`,sender:u});super(e.shortMessage||`An unknown error occurred while executing the contract function "${a}".`,{cause:e,docsPath:l,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],s&&"Contract Call:",s].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=o,this.args=c,this.cause=e,this.contractAddress=n,this.functionName=a,this.sender=u}}class I extends m.BaseError{constructor({abi:e,data:o,functionName:c,message:n}){let l,a,u,r;if(o&&o!=="0x")try{a=P.decodeErrorResult({abi:e,data:o});const{abiItem:i,errorName:s,args:d}=a;if(s==="Error")r=d[0];else if(s==="Panic"){const[f]=d;r=C.panicReasons[f]}else{const f=i?v.formatAbiItem(i,{includeName:!0}):void 0,b=i&&d?E.formatAbiItemWithArgs({abiItem:i,args:d,includeFunctionName:!1,includeName:!1}):void 0;u=[f?`Error: ${f}`:"",b&&b!=="()"?` ${[...Array((s==null?void 0:s.length)??0).keys()].map(()=>" ").join("")}${b}`:""]}}catch(i){l=i}else n&&(r=n);let t;l instanceof x.AbiErrorSignatureNotFoundError&&(t=l.signature,u=[`Unable to decode signature "${t}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`]),super(r&&r!=="execution reverted"||t?[`The contract function "${c}" reverted with the following ${t?"signature":"reason"}:`,r||t].join(`
|
|
3
3
|
`):`The contract function "${c}" reverted.`,{cause:l,metaMessages:u,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=a,this.raw=o,this.reason=r,this.signature=t}}class R extends m.BaseError{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class T extends m.BaseError{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class B extends m.BaseError{constructor({data:e,message:o}){super(o||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}exports.CallExecutionError=q;exports.ContractFunctionExecutionError=M;exports.ContractFunctionRevertedError=I;exports.ContractFunctionZeroDataError=R;exports.CounterfactualDeploymentFailedError=T;exports.RawContractError=B;
|
package/dist/index37.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { parseAccount as $ } from "./index32.js";
|
|
2
|
-
import { panicReasons as A } from "./
|
|
3
|
-
import { decodeErrorResult as C } from "./
|
|
4
|
-
import { formatAbiItem as v } from "./
|
|
5
|
-
import { formatAbiItemWithArgs as w } from "./
|
|
6
|
-
import { getAbiItem as P } from "./
|
|
7
|
-
import { formatEther as j } from "./
|
|
8
|
-
import { formatGwei as p } from "./
|
|
9
|
-
import { AbiErrorSignatureNotFoundError as x } from "./
|
|
2
|
+
import { panicReasons as A } from "./index169.js";
|
|
3
|
+
import { decodeErrorResult as C } from "./index170.js";
|
|
4
|
+
import { formatAbiItem as v } from "./index166.js";
|
|
5
|
+
import { formatAbiItemWithArgs as w } from "./index171.js";
|
|
6
|
+
import { getAbiItem as P } from "./index75.js";
|
|
7
|
+
import { formatEther as j } from "./index172.js";
|
|
8
|
+
import { formatGwei as p } from "./index173.js";
|
|
9
|
+
import { AbiErrorSignatureNotFoundError as x } from "./index95.js";
|
|
10
10
|
import { BaseError as b } from "./index35.js";
|
|
11
|
-
import { prettyStateOverride as O } from "./
|
|
12
|
-
import { prettyPrint as E } from "./
|
|
13
|
-
import { getContractAddress as F } from "./
|
|
11
|
+
import { prettyStateOverride as O } from "./index174.js";
|
|
12
|
+
import { prettyPrint as E } from "./index81.js";
|
|
13
|
+
import { getContractAddress as F } from "./index175.js";
|
|
14
14
|
class H extends b {
|
|
15
15
|
constructor(e, { account: o, docsPath: c, chain: n, data: l, gas: a, gasPrice: u, maxFeePerGas: r, maxPriorityFeePerGas: t, nonce: i, to: s, value: d, stateOverride: f }) {
|
|
16
16
|
var y;
|
package/dist/index38.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index95.cjs"),a=require("./index182.cjs"),b=require("./index75.cjs"),i="/docs/contract/decodeFunctionResult";function f(c){const{abi:r,args:d,functionName:n,data:s}=c;let e=r[0];if(n){const u=b.getAbiItem({abi:r,args:d,name:n});if(!u)throw new o.AbiFunctionNotFoundError(n,{docsPath:i});e=u}if(e.type!=="function")throw new o.AbiFunctionNotFoundError(void 0,{docsPath:i});if(!e.outputs)throw new o.AbiFunctionOutputsNotFoundError(e.name,{docsPath:i});const t=a.decodeAbiParameters(e.outputs,s);if(t&&t.length>1)return t;if(t&&t.length===1)return t[0]}exports.decodeFunctionResult=f;
|
package/dist/index38.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AbiFunctionNotFoundError as u, AbiFunctionOutputsNotFoundError as s } from "./
|
|
2
|
-
import { decodeAbiParameters as a } from "./
|
|
3
|
-
import { getAbiItem as m } from "./
|
|
1
|
+
import { AbiFunctionNotFoundError as u, AbiFunctionOutputsNotFoundError as s } from "./index95.js";
|
|
2
|
+
import { decodeAbiParameters as a } from "./index182.js";
|
|
3
|
+
import { getAbiItem as m } from "./index75.js";
|
|
4
4
|
const e = "/docs/contract/decodeFunctionResult";
|
|
5
5
|
function l(c) {
|
|
6
6
|
const { abi: r, args: d, functionName: o, data: f } = c;
|
package/dist/index39.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index95.cjs"),u=require("./index120.cjs"),d=require("./index185.cjs"),r="/docs/contract/encodeDeployData";function b(i){const{abi:a,args:o,bytecode:n}=i;if(!o||o.length===0)return n;const t=a.find(c=>"type"in c&&c.type==="constructor");if(!t)throw new e.AbiConstructorNotFoundError({docsPath:r});if(!("inputs"in t))throw new e.AbiConstructorParamsNotFoundError({docsPath:r});if(!t.inputs||t.inputs.length===0)throw new e.AbiConstructorParamsNotFoundError({docsPath:r});const s=d.encodeAbiParameters(t.inputs,o);return u.concatHex([n,s])}exports.encodeDeployData=b;
|
package/dist/index39.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AbiConstructorNotFoundError as p, AbiConstructorParamsNotFoundError as i } from "./
|
|
2
|
-
import { concatHex as u } from "./
|
|
3
|
-
import { encodeAbiParameters as d } from "./
|
|
1
|
+
import { AbiConstructorNotFoundError as p, AbiConstructorParamsNotFoundError as i } from "./index95.js";
|
|
2
|
+
import { concatHex as u } from "./index120.js";
|
|
3
|
+
import { encodeAbiParameters as d } from "./index185.js";
|
|
4
4
|
const r = "/docs/contract/encodeDeployData";
|
|
5
5
|
function w(c) {
|
|
6
6
|
const { abi: s, args: o, bytecode: n } = c;
|
package/dist/index40.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index120.cjs"),s=require("./index185.cjs"),d=require("./index193.cjs");function b(n){const{args:c}=n,{abi:o,functionName:i}=(()=>{var e;return n.abi.length===1&&((e=n.functionName)!=null&&e.startsWith("0x"))?n:d.prepareEncodeFunctionData(n)})(),t=o[0],u=i,a="inputs"in t&&t.inputs?s.encodeAbiParameters(t.inputs,c??[]):void 0;return r.concatHex([u,a??"0x"])}exports.encodeFunctionData=b;
|
package/dist/index40.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { concatHex as a } from "./
|
|
2
|
-
import { encodeAbiParameters as s } from "./
|
|
3
|
-
import { prepareEncodeFunctionData as f } from "./
|
|
1
|
+
import { concatHex as a } from "./index120.js";
|
|
2
|
+
import { encodeAbiParameters as s } from "./index185.js";
|
|
3
|
+
import { prepareEncodeFunctionData as f } from "./index193.js";
|
|
4
4
|
function b(n) {
|
|
5
5
|
const { args: i } = n, { abi: c, functionName: e } = (() => {
|
|
6
6
|
var o;
|
package/dist/index42.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./index177.cjs"),f=require("./index190.cjs"),x=require("./index65.cjs"),z=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function H(e,n={}){return typeof e=="number"||typeof e=="bigint"?d(e,n):typeof e=="string"?m(e,n):typeof e=="boolean"?b(e,n):u(e,n)}function b(e,n={}){const t=`0x${Number(e)}`;return typeof n.size=="number"?(x.assertSize(t,{size:n.size}),f.pad(t,{size:n.size})):t}function u(e,n={}){let t="";for(let i=0;i<e.length;i++)t+=z[e[i]];const r=`0x${t}`;return typeof n.size=="number"?(x.assertSize(r,{size:n.size}),f.pad(r,{dir:"right",size:n.size})):r}function d(e,n={}){const{signed:t,size:r}=n,i=BigInt(e);let o;r?t?o=(1n<<BigInt(r)*8n-1n)-1n:o=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(o=BigInt(Number.MAX_SAFE_INTEGER));const c=typeof o=="bigint"&&t?-o-1n:0;if(o&&i>o||i<c){const s=typeof e=="bigint"?"n":"";throw new y.IntegerOutOfRangeError({max:o?`${o}${s}`:void 0,min:`${c}${s}`,signed:t,size:r,value:`${e}${s}`})}const g=`0x${(t&&i<0?(1n<<BigInt(r*8))+BigInt(i):i).toString(16)}`;return r?f.pad(g,{size:r}):g}const T=new TextEncoder;function m(e,n={}){const t=T.encode(e);return u(t,n)}exports.boolToHex=b;exports.bytesToHex=u;exports.numberToHex=d;exports.stringToHex=m;exports.toHex=H;
|
package/dist/index42.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IntegerOutOfRangeError as x } from "./
|
|
2
|
-
import { pad as s } from "./
|
|
1
|
+
import { IntegerOutOfRangeError as x } from "./index177.js";
|
|
2
|
+
import { pad as s } from "./index190.js";
|
|
3
3
|
import { assertSize as c } from "./index65.js";
|
|
4
4
|
const b = /* @__PURE__ */ Array.from({ length: 256 }, (n, e) => e.toString(16).padStart(2, "0"));
|
|
5
5
|
function B(n, e = {}) {
|
package/dist/index43.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index37.cjs"),u=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index37.cjs"),u=require("./index180.cjs"),i=require("./index217.cjs");function l(r,{docsPath:t,...e}){const n=(()=>{const o=i.getNodeError(r,e);return o instanceof u.UnknownNodeError?r:o})();return new c.CallExecutionError(n,{docsPath:t,...e})}exports.getCallError=l;
|
package/dist/index43.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CallExecutionError as c } from "./index37.js";
|
|
2
|
-
import { UnknownNodeError as i } from "./
|
|
3
|
-
import { getNodeError as u } from "./
|
|
2
|
+
import { UnknownNodeError as i } from "./index180.js";
|
|
3
|
+
import { getNodeError as u } from "./index217.js";
|
|
4
4
|
function a(r, { docsPath: t, ...o }) {
|
|
5
5
|
const e = (() => {
|
|
6
6
|
const n = u(r, o);
|
package/dist/index45.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("./index42.cjs"),i={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function a(e,f){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=y(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(d=>o.bytesToHex(d)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=o.numberToHex(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=o.numberToHex(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=o.numberToHex(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=o.numberToHex(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=o.numberToHex(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=o.numberToHex(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=i[e.type]),typeof e.value<"u"&&(n.value=o.numberToHex(e.value)),n}function y(e){return e.map(f=>({address:f.address,r:f.r?o.numberToHex(BigInt(f.r)):f.r,s:f.s?o.numberToHex(BigInt(f.s)):f.s,chainId:o.numberToHex(f.chainId),nonce:o.numberToHex(f.nonce),...typeof f.yParity<"u"?{yParity:o.numberToHex(f.yParity)}:{},...typeof f.v<"u"&&typeof f.yParity>"u"?{v:o.numberToHex(f.v)}:{}}))}exports.formatTransactionRequest=a;exports.rpcTransactionType=i;
|
package/dist/index45.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { bytesToHex as
|
|
2
|
-
const
|
|
1
|
+
import { bytesToHex as o, numberToHex as i } from "./index42.js";
|
|
2
|
+
const a = {
|
|
3
3
|
legacy: "0x0",
|
|
4
4
|
eip2930: "0x1",
|
|
5
5
|
eip1559: "0x2",
|
|
6
6
|
eip4844: "0x3",
|
|
7
7
|
eip7702: "0x4"
|
|
8
8
|
};
|
|
9
|
-
function
|
|
9
|
+
function c(e, n) {
|
|
10
10
|
const f = {};
|
|
11
|
-
return typeof e.authorizationList < "u" && (f.authorizationList =
|
|
11
|
+
return typeof e.authorizationList < "u" && (f.authorizationList = y(e.authorizationList)), typeof e.accessList < "u" && (f.accessList = e.accessList), typeof e.blobVersionedHashes < "u" && (f.blobVersionedHashes = e.blobVersionedHashes), typeof e.blobs < "u" && (typeof e.blobs[0] != "string" ? f.blobs = e.blobs.map((d) => o(d)) : f.blobs = e.blobs), typeof e.data < "u" && (f.data = e.data), e.account && (f.from = e.account.address), typeof e.from < "u" && (f.from = e.from), typeof e.gas < "u" && (f.gas = i(e.gas)), typeof e.gasPrice < "u" && (f.gasPrice = i(e.gasPrice)), typeof e.maxFeePerBlobGas < "u" && (f.maxFeePerBlobGas = i(e.maxFeePerBlobGas)), typeof e.maxFeePerGas < "u" && (f.maxFeePerGas = i(e.maxFeePerGas)), typeof e.maxPriorityFeePerGas < "u" && (f.maxPriorityFeePerGas = i(e.maxPriorityFeePerGas)), typeof e.nonce < "u" && (f.nonce = i(e.nonce)), typeof e.to < "u" && (f.to = e.to), typeof e.type < "u" && (f.type = a[e.type]), typeof e.value < "u" && (f.value = i(e.value)), f;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return e.map((
|
|
15
|
-
address:
|
|
16
|
-
r:
|
|
17
|
-
s:
|
|
18
|
-
chainId: n
|
|
19
|
-
nonce: n
|
|
20
|
-
...typeof
|
|
21
|
-
...typeof
|
|
13
|
+
function y(e) {
|
|
14
|
+
return e.map((n) => ({
|
|
15
|
+
address: n.address,
|
|
16
|
+
r: n.r ? i(BigInt(n.r)) : n.r,
|
|
17
|
+
s: n.s ? i(BigInt(n.s)) : n.s,
|
|
18
|
+
chainId: i(n.chainId),
|
|
19
|
+
nonce: i(n.nonce),
|
|
20
|
+
...typeof n.yParity < "u" ? { yParity: i(n.yParity) } : {},
|
|
21
|
+
...typeof n.v < "u" && typeof n.yParity > "u" ? { v: i(n.v) } : {}
|
|
22
22
|
}));
|
|
23
23
|
}
|
|
24
24
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
c as formatTransactionRequest,
|
|
26
|
+
a as rpcTransactionType
|
|
27
27
|
};
|
package/dist/index46.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index89.cjs"),l=new Map;function A({fn:a,id:o,shouldSplitBatch:h,wait:y=0,sort:u}){const i=async()=>{const e=n();f();const s=e.map(({args:t})=>t);s.length!==0&&a(s).then(t=>{u&&Array.isArray(t)&&t.sort(u);for(let c=0;c<e.length;c++){const{resolve:r}=e[c];r==null||r([t[c],t])}}).catch(t=>{for(let c=0;c<e.length;c++){const{reject:r}=e[c];r==null||r(t)}})},f=()=>l.delete(o),m=()=>n().map(({args:e})=>e),n=()=>l.get(o)||[],g=e=>l.set(o,[...n(),e]);return{flush:f,async schedule(e){const{promise:s,resolve:t,reject:c}=v.withResolvers();return(h==null?void 0:h([...m(),e]))&&i(),n().length>0?(g({args:e,resolve:t,reject:c}),s):(g({args:e,resolve:t,reject:c}),setTimeout(i,y),s)}}}exports.createBatchScheduler=A;
|
package/dist/index46.js
CHANGED
package/dist/index47.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index148.cjs"),a=require("./index176.cjs"),f=require("./index174.cjs"),S=require("./index149.cjs"),c=require("./index42.cjs");function d(r){if(!(!r||r.length===0))return r.reduce((t,{slot:e,value:n})=>{if(e.length!==66)throw new a.InvalidBytesLengthError({size:e.length,targetSize:66,type:"hex"});if(n.length!==66)throw new a.InvalidBytesLengthError({size:n.length,targetSize:66,type:"hex"});return t[e]=n,t},{})}function u(r){const{balance:t,nonce:e,state:n,stateDiff:s,code:o}=r,i={};if(o!==void 0&&(i.code=o),t!==void 0&&(i.balance=c.numberToHex(t)),e!==void 0&&(i.nonce=c.numberToHex(e)),n!==void 0&&(i.state=d(n)),s!==void 0){if(i.state)throw new f.StateAssignmentConflictError;i.stateDiff=d(s)}return i}function h(r){if(!r)return;const t={};for(const{address:e,...n}of r){if(!S.isAddress(e,{strict:!1}))throw new l.InvalidAddressError({address:e});if(t[e])throw new f.AccountStateConflictError({address:e});t[e]=u(n)}return t}exports.serializeAccountStateOverride=u;exports.serializeStateMapping=d;exports.serializeStateOverride=h;
|
package/dist/index47.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { InvalidAddressError as a } from "./
|
|
2
|
-
import { InvalidBytesLengthError as d } from "./
|
|
3
|
-
import { AccountStateConflictError as u, StateAssignmentConflictError as h } from "./
|
|
4
|
-
import { isAddress as l } from "./
|
|
1
|
+
import { InvalidAddressError as a } from "./index148.js";
|
|
2
|
+
import { InvalidBytesLengthError as d } from "./index176.js";
|
|
3
|
+
import { AccountStateConflictError as u, StateAssignmentConflictError as h } from "./index174.js";
|
|
4
|
+
import { isAddress as l } from "./index149.js";
|
|
5
5
|
import { numberToHex as c } from "./index42.js";
|
|
6
6
|
function s(r) {
|
|
7
7
|
if (!(!r || r.length === 0))
|
package/dist/index48.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 c=require("./index32.cjs"),u=require("./index19.cjs"),d=require("./index148.cjs"),n=require("./index180.cjs"),i=require("./index149.cjs");function w(a){const{account:t,maxFeePerGas:e,maxPriorityFeePerGas:r,to:s}=a,o=t?c.parseAccount(t):void 0;if(o&&!i.isAddress(o.address))throw new d.InvalidAddressError({address:o.address});if(s&&!i.isAddress(s))throw new d.InvalidAddressError({address:s});if(e&&e>u.maxUint256)throw new n.FeeCapTooHighError({maxFeePerGas:e});if(r&&e&&r>e)throw new n.TipAboveFeeCapError({maxFeePerGas:e,maxPriorityFeePerGas:r})}exports.assertRequest=w;
|