@gardenfi/utils 2.1.0 → 2.1.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +15 -75
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +10 -17
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +19 -11
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +8 -19
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +2 -2
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +126 -19
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +6 -127
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +2 -7
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +38 -2
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +14 -31
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +3 -3
- package/dist/index118.cjs +1 -1
- package/dist/index118.js +2 -2
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +2 -2
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +18 -17
- package/dist/index21.cjs +16 -1
- package/dist/index21.js +112 -30
- package/dist/index22.cjs +1 -16
- package/dist/index22.js +30 -113
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +1 -1
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +1 -1
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +1 -1
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +19 -18
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +1 -1
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +3 -3
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +1 -1
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +1 -1
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +2 -2
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +1 -1
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +2 -2
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +11 -11
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +3 -3
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +1 -1
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +6 -8
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +4 -6
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +11 -4
- package/dist/index68.cjs +5 -1
- package/dist/index68.js +56 -11
- package/dist/index69.cjs +2 -1
- package/dist/index69.js +34 -3
- package/dist/index70.cjs +1 -5
- package/dist/index70.js +5 -56
- package/dist/index71.cjs +1 -2
- package/dist/index71.js +3 -34
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +21 -5
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +8 -21
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +10 -8
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +11 -10
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +6 -11
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +13 -6
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +31 -12
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +14 -32
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +64 -14
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +24 -61
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +3 -28
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +4 -3
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +8 -3
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +191 -8
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +18 -191
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +40 -18
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +34 -40
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +69 -34
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +51 -43
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +109 -66
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +62 -107
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +2 -68
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +17 -2
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +220 -13
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +220 -212
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +37 -226
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +100 -38
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +17 -104
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +77 -16
- package/dist/src/lib/utils.d.ts +1 -1
- package/package.json +1 -1
package/dist/index99.js
CHANGED
|
@@ -1,20 +1,81 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { versionedHashVersionKzg as c } from "./index111.js";
|
|
2
|
+
import { maxUint256 as m } from "./index108.js";
|
|
3
|
+
import { InvalidAddressError as s } from "./index50.js";
|
|
4
|
+
import { BaseError as h } from "./index63.js";
|
|
5
|
+
import { EmptyBlobError as P, InvalidVersionedHashSizeError as p, InvalidVersionedHashVersionError as x } from "./index112.js";
|
|
6
|
+
import { InvalidChainIdError as n } from "./index65.js";
|
|
7
|
+
import { FeeCapTooHighError as w, TipAboveFeeCapError as E } from "./index69.js";
|
|
8
|
+
import { isAddress as f } from "./index51.js";
|
|
9
|
+
import { size as F } from "./index66.js";
|
|
10
|
+
import { slice as I } from "./index105.js";
|
|
11
|
+
import { hexToNumber as G } from "./index35.js";
|
|
12
|
+
function C(t) {
|
|
13
|
+
const { authorizationList: e } = t;
|
|
14
|
+
if (e)
|
|
15
|
+
for (const o of e) {
|
|
16
|
+
const { chainId: r } = o, i = o.address;
|
|
17
|
+
if (!f(i))
|
|
18
|
+
throw new s({ address: i });
|
|
19
|
+
if (r < 0)
|
|
20
|
+
throw new n({ chainId: r });
|
|
21
|
+
}
|
|
22
|
+
d(t);
|
|
23
|
+
}
|
|
24
|
+
function L(t) {
|
|
25
|
+
const { blobVersionedHashes: e } = t;
|
|
26
|
+
if (e) {
|
|
27
|
+
if (e.length === 0)
|
|
28
|
+
throw new P();
|
|
29
|
+
for (const o of e) {
|
|
30
|
+
const r = F(o), i = G(I(o, 0, 1));
|
|
31
|
+
if (r !== 32)
|
|
32
|
+
throw new p({ hash: o, size: r });
|
|
33
|
+
if (i !== c)
|
|
34
|
+
throw new x({
|
|
35
|
+
hash: o,
|
|
36
|
+
version: i
|
|
37
|
+
});
|
|
38
|
+
}
|
|
15
39
|
}
|
|
16
|
-
|
|
40
|
+
d(t);
|
|
41
|
+
}
|
|
42
|
+
function d(t) {
|
|
43
|
+
const { chainId: e, maxPriorityFeePerGas: o, maxFeePerGas: r, to: i } = t;
|
|
44
|
+
if (e <= 0)
|
|
45
|
+
throw new n({ chainId: e });
|
|
46
|
+
if (i && !f(i))
|
|
47
|
+
throw new s({ address: i });
|
|
48
|
+
if (r && r > m)
|
|
49
|
+
throw new w({ maxFeePerGas: r });
|
|
50
|
+
if (o && r && o > r)
|
|
51
|
+
throw new E({ maxFeePerGas: r, maxPriorityFeePerGas: o });
|
|
52
|
+
}
|
|
53
|
+
function B(t) {
|
|
54
|
+
const { chainId: e, maxPriorityFeePerGas: o, gasPrice: r, maxFeePerGas: i, to: a } = t;
|
|
55
|
+
if (e <= 0)
|
|
56
|
+
throw new n({ chainId: e });
|
|
57
|
+
if (a && !f(a))
|
|
58
|
+
throw new s({ address: a });
|
|
59
|
+
if (o || i)
|
|
60
|
+
throw new h("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");
|
|
61
|
+
if (r && r > m)
|
|
62
|
+
throw new w({ maxFeePerGas: r });
|
|
63
|
+
}
|
|
64
|
+
function K(t) {
|
|
65
|
+
const { chainId: e, maxPriorityFeePerGas: o, gasPrice: r, maxFeePerGas: i, to: a } = t;
|
|
66
|
+
if (a && !f(a))
|
|
67
|
+
throw new s({ address: a });
|
|
68
|
+
if (typeof e < "u" && e <= 0)
|
|
69
|
+
throw new n({ chainId: e });
|
|
70
|
+
if (o || i)
|
|
71
|
+
throw new h("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");
|
|
72
|
+
if (r && r > m)
|
|
73
|
+
throw new w({ maxFeePerGas: r });
|
|
17
74
|
}
|
|
18
75
|
export {
|
|
19
|
-
|
|
76
|
+
d as assertTransactionEIP1559,
|
|
77
|
+
B as assertTransactionEIP2930,
|
|
78
|
+
L as assertTransactionEIP4844,
|
|
79
|
+
C as assertTransactionEIP7702,
|
|
80
|
+
K as assertTransactionLegacy
|
|
20
81
|
};
|
package/dist/src/lib/utils.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const with0x: (str: string) => `0x${string}`;
|
|
2
2
|
/**
|
|
3
3
|
* Includes `Bearer ` in the Authorization header
|
|
4
|
-
* @param authToken
|
|
4
|
+
* @param authToken
|
|
5
5
|
* @returns Authorization header
|
|
6
6
|
*/
|
|
7
7
|
export declare const Authorization: (authToken: string) => string;
|