@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.
Files changed (134) hide show
  1. package/dist/index100.cjs +1 -1
  2. package/dist/index100.js +15 -75
  3. package/dist/index101.cjs +1 -1
  4. package/dist/index101.js +10 -17
  5. package/dist/index102.cjs +1 -1
  6. package/dist/index102.js +19 -11
  7. package/dist/index103.cjs +1 -1
  8. package/dist/index103.js +8 -19
  9. package/dist/index105.cjs +1 -1
  10. package/dist/index105.js +2 -2
  11. package/dist/index109.cjs +1 -1
  12. package/dist/index109.js +126 -19
  13. package/dist/index110.cjs +1 -1
  14. package/dist/index110.js +6 -127
  15. package/dist/index111.cjs +1 -1
  16. package/dist/index111.js +2 -7
  17. package/dist/index112.cjs +1 -1
  18. package/dist/index112.js +38 -2
  19. package/dist/index113.cjs +1 -1
  20. package/dist/index113.js +14 -31
  21. package/dist/index117.cjs +1 -1
  22. package/dist/index117.js +3 -3
  23. package/dist/index118.cjs +1 -1
  24. package/dist/index118.js +2 -2
  25. package/dist/index15.cjs +1 -1
  26. package/dist/index15.js +2 -2
  27. package/dist/index20.cjs +1 -1
  28. package/dist/index20.js +18 -17
  29. package/dist/index21.cjs +16 -1
  30. package/dist/index21.js +112 -30
  31. package/dist/index22.cjs +1 -16
  32. package/dist/index22.js +30 -113
  33. package/dist/index33.cjs +1 -1
  34. package/dist/index33.js +1 -1
  35. package/dist/index35.cjs +1 -1
  36. package/dist/index35.js +1 -1
  37. package/dist/index38.cjs +1 -1
  38. package/dist/index38.js +1 -1
  39. package/dist/index4.cjs +1 -1
  40. package/dist/index4.js +19 -18
  41. package/dist/index41.cjs +1 -1
  42. package/dist/index41.js +1 -1
  43. package/dist/index42.cjs +1 -1
  44. package/dist/index42.js +3 -3
  45. package/dist/index51.cjs +1 -1
  46. package/dist/index51.js +1 -1
  47. package/dist/index53.cjs +1 -1
  48. package/dist/index53.js +1 -1
  49. package/dist/index54.cjs +1 -1
  50. package/dist/index54.js +2 -2
  51. package/dist/index55.cjs +1 -1
  52. package/dist/index55.js +1 -1
  53. package/dist/index56.cjs +1 -1
  54. package/dist/index56.js +2 -2
  55. package/dist/index57.cjs +1 -1
  56. package/dist/index57.js +11 -11
  57. package/dist/index58.cjs +1 -1
  58. package/dist/index58.js +3 -3
  59. package/dist/index59.cjs +1 -1
  60. package/dist/index59.js +1 -1
  61. package/dist/index62.cjs +1 -1
  62. package/dist/index62.js +6 -8
  63. package/dist/index66.cjs +1 -1
  64. package/dist/index66.js +4 -6
  65. package/dist/index67.cjs +1 -1
  66. package/dist/index67.js +11 -4
  67. package/dist/index68.cjs +5 -1
  68. package/dist/index68.js +56 -11
  69. package/dist/index69.cjs +2 -1
  70. package/dist/index69.js +34 -3
  71. package/dist/index70.cjs +1 -5
  72. package/dist/index70.js +5 -56
  73. package/dist/index71.cjs +1 -2
  74. package/dist/index71.js +3 -34
  75. package/dist/index72.cjs +1 -1
  76. package/dist/index72.js +21 -5
  77. package/dist/index73.cjs +1 -1
  78. package/dist/index73.js +8 -21
  79. package/dist/index74.cjs +1 -1
  80. package/dist/index74.js +10 -8
  81. package/dist/index75.cjs +1 -1
  82. package/dist/index75.js +11 -10
  83. package/dist/index76.cjs +1 -1
  84. package/dist/index76.js +6 -11
  85. package/dist/index77.cjs +1 -1
  86. package/dist/index77.js +13 -6
  87. package/dist/index78.cjs +1 -1
  88. package/dist/index78.js +31 -12
  89. package/dist/index79.cjs +1 -1
  90. package/dist/index79.js +14 -32
  91. package/dist/index80.cjs +1 -1
  92. package/dist/index80.js +64 -14
  93. package/dist/index81.cjs +1 -1
  94. package/dist/index81.js +24 -61
  95. package/dist/index82.cjs +1 -1
  96. package/dist/index82.js +3 -28
  97. package/dist/index83.cjs +1 -1
  98. package/dist/index83.js +4 -3
  99. package/dist/index84.cjs +1 -1
  100. package/dist/index84.js +8 -3
  101. package/dist/index85.cjs +1 -1
  102. package/dist/index85.js +191 -8
  103. package/dist/index86.cjs +1 -1
  104. package/dist/index86.js +18 -191
  105. package/dist/index87.cjs +1 -1
  106. package/dist/index87.js +40 -18
  107. package/dist/index88.cjs +1 -1
  108. package/dist/index88.js +34 -40
  109. package/dist/index89.cjs +1 -1
  110. package/dist/index89.js +69 -34
  111. package/dist/index9.cjs +1 -1
  112. package/dist/index9.js +51 -43
  113. package/dist/index90.cjs +1 -1
  114. package/dist/index90.js +109 -66
  115. package/dist/index91.cjs +1 -1
  116. package/dist/index91.js +62 -107
  117. package/dist/index92.cjs +1 -1
  118. package/dist/index92.js +2 -68
  119. package/dist/index93.cjs +1 -1
  120. package/dist/index93.js +17 -2
  121. package/dist/index94.cjs +1 -1
  122. package/dist/index94.js +220 -13
  123. package/dist/index95.cjs +1 -1
  124. package/dist/index95.js +220 -212
  125. package/dist/index96.cjs +1 -1
  126. package/dist/index96.js +37 -226
  127. package/dist/index97.cjs +1 -1
  128. package/dist/index97.js +100 -38
  129. package/dist/index98.cjs +1 -1
  130. package/dist/index98.js +17 -104
  131. package/dist/index99.cjs +1 -1
  132. package/dist/index99.js +77 -16
  133. package/dist/src/lib/utils.d.ts +1 -1
  134. package/package.json +1 -1
package/dist/index99.js CHANGED
@@ -1,20 +1,81 @@
1
- import { toHex as i } from "./index25.js";
2
- import { toYParitySignatureArray as c } from "./index57.js";
3
- function f(r) {
4
- if (!r || r.length === 0)
5
- return [];
6
- const t = [];
7
- for (const o of r) {
8
- const { chainId: n, nonce: e, ...s } = o, a = o.address;
9
- t.push([
10
- n ? i(n) : "0x",
11
- a,
12
- e ? i(e) : "0x",
13
- ...c({}, s)
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
- return t;
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
- f as serializeAuthorizationList
76
+ d as assertTransactionEIP1559,
77
+ B as assertTransactionEIP2930,
78
+ L as assertTransactionEIP4844,
79
+ C as assertTransactionEIP7702,
80
+ K as assertTransactionLegacy
20
81
  };
@@ -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 authToken
4
+ * @param authToken
5
5
  * @returns Authorization header
6
6
  */
7
7
  export declare const Authorization: (authToken: string) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gardenfi/utils",
3
- "version": "2.1.0",
3
+ "version": "2.1.2-beta.0",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "vite build",