@gardenfi/utils 2.5.3-beta.2 → 2.5.3-beta.3
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 +7 -13
- package/dist/index101.cjs +4 -1
- package/dist/index101.js +194 -3
- package/dist/index102.cjs +3 -1
- package/dist/index102.js +451 -26
- package/dist/index103.cjs +1 -2
- package/dist/index103.js +22 -19
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +161 -9
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +21 -8
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +126 -9
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +38 -11
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +6 -13
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +27 -14
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +55 -4
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +45 -6
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +191 -18
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +4 -14
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +64 -6
- package/dist/index115.cjs +1 -1
- package/dist/index115.js +20 -7
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +3 -22
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +16 -7
- package/dist/index118.cjs +1 -1
- package/dist/index118.js +23 -21
- package/dist/index119.cjs +1 -1
- package/dist/index119.js +11 -17
- package/dist/index120.cjs +1 -1
- package/dist/index120.js +18 -40
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +32 -19
- package/dist/index122.cjs +1 -1
- package/dist/index122.js +3 -81
- package/dist/index123.cjs +1 -1
- package/dist/index123.js +18 -11
- package/dist/index124.cjs +1 -1
- package/dist/index124.js +26 -57
- package/dist/index125.cjs +1 -1
- package/dist/index125.js +35 -12
- package/dist/index126.cjs +1 -1
- package/dist/index126.js +8 -8
- package/dist/index127.cjs +1 -1
- package/dist/index127.js +10 -20
- package/dist/index128.cjs +1 -1
- package/dist/index128.js +25 -6
- package/dist/index129.cjs +1 -1
- package/dist/index129.js +27 -34
- package/dist/index130.cjs +1 -1
- package/dist/index130.js +3 -32
- package/dist/index131.cjs +1 -1
- package/dist/index131.js +64 -8
- package/dist/index132.cjs +1 -1
- package/dist/index132.js +9 -50
- package/dist/index133.cjs +1 -1
- package/dist/index133.js +21 -19
- package/dist/index134.cjs +1 -1
- package/dist/index134.js +8 -106
- package/dist/index135.cjs +1 -1
- package/dist/index135.js +9 -67
- package/dist/index136.cjs +1 -1
- package/dist/index136.js +11 -9
- package/dist/index137.cjs +1 -1
- package/dist/index137.js +6 -71
- package/dist/index138.cjs +1 -2
- package/dist/index138.js +7 -3
- package/dist/index139.cjs +1 -1
- package/dist/index139.js +14 -9
- package/dist/index140.cjs +1 -1
- package/dist/index140.js +32 -13
- package/dist/index141.cjs +1 -1
- package/dist/index141.js +5 -5
- package/dist/index142.cjs +1 -1
- package/dist/index142.js +33 -8
- package/dist/index143.cjs +1 -1
- package/dist/index143.js +112 -2
- package/dist/index144.cjs +1 -1
- package/dist/index144.js +171 -31
- package/dist/index145.cjs +1 -1
- package/dist/index145.js +48 -20
- package/dist/index146.cjs +1 -1
- package/dist/index146.js +32 -5
- package/dist/index147.cjs +1 -1
- package/dist/index147.js +7 -5
- package/dist/index148.cjs +1 -1
- package/dist/index148.js +8 -5
- package/dist/index149.cjs +1 -9
- package/dist/index149.js +18 -33
- package/dist/index150.cjs +1 -1
- package/dist/index150.js +24 -3
- package/dist/index151.cjs +1 -1
- package/dist/index151.js +40 -16
- package/dist/index152.cjs +1 -1
- package/dist/index152.js +22 -20
- package/dist/index153.cjs +1 -1
- package/dist/index153.js +21 -35
- package/dist/index154.cjs +1 -1
- package/dist/index154.js +51 -8
- package/dist/index155.cjs +1 -4
- package/dist/index155.js +11 -194
- package/dist/index156.cjs +1 -1
- package/dist/index156.js +24 -27
- package/dist/index157.cjs +1 -1
- package/dist/index157.js +24 -161
- package/dist/index158.cjs +1 -1
- package/dist/index158.js +102 -125
- package/dist/index159.cjs +1 -1
- package/dist/index159.js +3 -28
- package/dist/index160.cjs +1 -1
- package/dist/index160.js +5 -55
- package/dist/index161.cjs +1 -1
- package/dist/index161.js +27 -187
- package/dist/index162.cjs +1 -1
- package/dist/index162.js +4 -4
- package/dist/index163.cjs +1 -1
- package/dist/index163.js +17 -20
- package/dist/index164.cjs +1 -1
- package/dist/index164.js +6 -3
- package/dist/index165.cjs +1 -1
- package/dist/index165.js +8 -16
- package/dist/index166.cjs +1 -1
- package/dist/index166.js +103 -11
- package/dist/index167.cjs +1 -1
- package/dist/index167.js +78 -32
- package/dist/index168.cjs +1 -1
- package/dist/index168.js +6 -3
- package/dist/index169.cjs +1 -1
- package/dist/index169.js +6 -27
- package/dist/index170.cjs +1 -1
- package/dist/index170.js +27 -8
- package/dist/index171.cjs +1 -1
- package/dist/index171.js +34 -25
- package/dist/index172.cjs +1 -1
- package/dist/index172.js +13 -28
- package/dist/index173.cjs +1 -1
- package/dist/index173.js +19 -3
- package/dist/index174.cjs +1 -1
- package/dist/index174.js +78 -6
- package/dist/index175.cjs +1 -1
- package/dist/index175.js +2 -7
- package/dist/index176.cjs +1 -1
- package/dist/index176.js +14 -32
- package/dist/index177.cjs +1 -1
- package/dist/index177.js +19 -5
- package/dist/index178.cjs +1 -1
- package/dist/index178.js +166 -32
- package/dist/index179.cjs +1 -1
- package/dist/index179.js +16 -48
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +8 -8
- package/dist/index180.cjs +1 -1
- package/dist/index180.js +10 -32
- package/dist/index181.cjs +1 -1
- package/dist/index181.js +28 -6
- package/dist/index182.cjs +1 -1
- package/dist/index182.js +2 -43
- package/dist/index183.cjs +1 -1
- package/dist/index183.js +13 -51
- package/dist/index184.cjs +1 -1
- package/dist/index184.js +12 -104
- package/dist/index185.cjs +1 -1
- package/dist/index185.js +48 -3
- package/dist/index186.cjs +1 -1
- package/dist/index186.js +11 -5
- package/dist/index187.cjs +1 -1
- package/dist/index187.js +7 -3
- package/dist/index188.cjs +1 -1
- package/dist/index188.js +65 -16
- package/dist/index189.cjs +1 -1
- package/dist/index189.js +46 -5
- package/dist/index190.cjs +1 -1
- package/dist/index190.js +37 -8
- package/dist/index191.cjs +1 -1
- package/dist/index191.js +17 -103
- package/dist/index192.cjs +1 -1
- package/dist/index192.js +6 -5
- package/dist/index193.cjs +1 -1
- package/dist/index193.js +9 -6
- package/dist/index194.cjs +1 -1
- package/dist/index194.js +13 -27
- package/dist/index195.cjs +1 -1
- package/dist/index195.js +8 -34
- package/dist/index196.cjs +1 -1
- package/dist/index196.js +35 -13
- package/dist/index197.cjs +1 -1
- package/dist/index197.js +16 -78
- package/dist/index198.cjs +1 -1
- package/dist/index198.js +15 -2
- package/dist/index199.cjs +1 -1
- package/dist/index199.js +6 -18
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +2 -2
- package/dist/index200.cjs +2 -1
- package/dist/index200.js +21 -168
- package/dist/index201.cjs +1 -1
- package/dist/index201.js +13 -17
- package/dist/index202.cjs +1 -1
- package/dist/index202.js +25 -10
- package/dist/index203.cjs +1 -1
- package/dist/index203.js +17 -24
- package/dist/index204.cjs +1 -1
- package/dist/index204.js +15 -18
- package/dist/index205.cjs +1 -1
- package/dist/index205.js +5 -15
- package/dist/index206.cjs +1 -1
- package/dist/index206.js +13 -5
- package/dist/index207.cjs +1 -1
- package/dist/index207.js +9 -12
- package/dist/index208.cjs +1 -1
- package/dist/index208.js +16 -10
- package/dist/index209.cjs +2 -1
- package/dist/index209.js +41 -16
- package/dist/index210.cjs +1 -1
- package/dist/index210.js +2 -25
- package/dist/index211.cjs +1 -1
- package/dist/index211.js +5 -46
- package/dist/index212.cjs +1 -1
- package/dist/index212.js +10 -9
- package/dist/index213.cjs +1 -2
- package/dist/index213.js +18 -40
- package/dist/index214.cjs +1 -1
- package/dist/index214.js +9 -2
- package/dist/index215.cjs +1 -1
- package/dist/index215.js +66 -5
- package/dist/index216.cjs +1 -1
- package/dist/index216.js +64 -9
- package/dist/index217.cjs +1 -1
- package/dist/index217.js +186 -17
- package/dist/index218.cjs +1 -1
- package/dist/index218.js +28 -8
- package/dist/index219.cjs +1 -1
- package/dist/index219.js +72 -62
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +9 -9
- package/dist/index220.cjs +1 -1
- package/dist/index220.js +36 -61
- package/dist/index221.cjs +1 -1
- package/dist/index221.js +15 -187
- package/dist/index222.cjs +1 -1
- package/dist/index222.js +5 -20
- package/dist/index223.cjs +1 -1
- package/dist/index223.js +13 -77
- package/dist/index224.cjs +1 -1
- package/dist/index224.js +11 -40
- package/dist/index225.cjs +1 -1
- package/dist/index225.js +18 -15
- package/dist/index226.cjs +1 -1
- package/dist/index226.js +107 -12
- package/dist/index227.cjs +1 -1
- package/dist/index227.js +6 -11
- package/dist/index228.cjs +1 -1
- package/dist/index228.js +7 -13
- package/dist/index229.cjs +1 -1
- package/dist/index229.js +103 -6
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +2 -2
- package/dist/index230.cjs +1 -1
- package/dist/index230.js +27 -7
- package/dist/index231.cjs +1 -1
- package/dist/index231.js +15 -18
- package/dist/index232.cjs +1 -1
- package/dist/index232.js +210 -104
- package/dist/index233.cjs +1 -1
- package/dist/index233.js +43 -100
- package/dist/index234.cjs +1 -1
- package/dist/index234.js +9 -26
- package/dist/index235.cjs +1 -1
- package/dist/index235.js +24 -16
- package/dist/index236.cjs +1 -1
- package/dist/index236.js +41 -213
- package/dist/index237.cjs +1 -1
- package/dist/index237.js +66 -30
- package/dist/index238.cjs +1 -1
- package/dist/index238.js +2 -79
- package/dist/index239.cjs +1 -1
- package/dist/index239.js +12 -2
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +5 -5
- package/dist/index240.cjs +1 -1
- package/dist/index240.js +19 -11
- package/dist/index241.cjs +1 -1
- package/dist/index241.js +68 -19
- package/dist/index242.cjs +1 -2
- package/dist/index242.js +654 -63
- package/dist/index243.cjs +1 -1
- package/dist/index243.js +206 -14
- package/dist/index244.cjs +1 -1
- package/dist/index244.js +176 -67
- package/dist/index245.cjs +2 -1
- package/dist/index245.js +63 -654
- package/dist/index246.cjs +1 -1
- package/dist/index246.js +14 -206
- package/dist/index247.cjs +1 -1
- package/dist/index247.js +4 -177
- package/dist/index248.cjs +1 -1
- package/dist/index248.js +2 -5
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +3 -3
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +1 -1
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +7 -171
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +30 -110
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +29 -30
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +16 -3
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +34 -2
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +45 -4
- package/dist/index35.cjs +1 -2
- package/dist/index35.js +151 -59
- package/dist/index36.cjs +1 -2
- package/dist/index36.js +31 -50
- package/dist/index37.cjs +1 -3
- package/dist/index37.js +53 -210
- package/dist/index38.cjs +2 -1
- package/dist/index38.js +58 -22
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +13 -18
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +37 -10
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +15 -20
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +8 -45
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +19 -12
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +2 -13
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +45 -24
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +31 -27
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +3 -47
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +9 -19
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +50 -11
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +7 -31
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +16 -36
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +10 -7
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +5 -29
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +14 -22
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +3 -7
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +25 -88
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +107 -44
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +4 -23
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +6 -37
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +88 -17
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +6 -6
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +125 -9
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +6 -12
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +21 -109
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +17 -8
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +39 -22
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +21 -7
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +11 -21
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +6 -8
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +16 -28
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +106 -7
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +68 -16
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +8 -72
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +27 -34
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +71 -16
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +4 -66
- package/dist/index77.cjs +2 -1
- package/dist/index77.js +3 -12
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +9 -15
- package/dist/index79.cjs +20 -3
- package/dist/index79.js +302 -71
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +13 -24
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +4 -33
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +10 -42
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +2 -7
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +7 -151
- package/dist/index85.cjs +2 -20
- package/dist/index85.js +35 -307
- package/dist/index86.cjs +3 -3
- package/dist/index86.js +194 -430
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +32 -65
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +21 -37
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +5 -15
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +74 -2
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +5 -16
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +5 -10
- package/dist/index93.cjs +9 -1
- package/dist/index93.js +32 -122
- package/dist/index94.cjs +3 -1
- package/dist/index94.js +95 -5
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +3 -22
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +17 -44
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +17 -35
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +35 -6
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +21 -86
- package/package.json +2 -2
- package/dist/index249.cjs +0 -1
- package/dist/index249.js +0 -4
package/dist/index140.js
CHANGED
|
@@ -1,16 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
function e
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { maxBytesPerTransaction as y, fieldElementsPerBlob as a, bytesPerFieldElement as f, bytesPerBlob as p } from "./index141.js";
|
|
2
|
+
import { EmptyBlobError as c, BlobSizeTooLargeError as h } from "./index142.js";
|
|
3
|
+
import { createCursor as B } from "./index106.js";
|
|
4
|
+
import { size as u } from "./index81.js";
|
|
5
|
+
import { hexToBytes as x } from "./index110.js";
|
|
6
|
+
import { bytesToHex as d } from "./index111.js";
|
|
7
|
+
function S(e) {
|
|
8
|
+
const m = e.to ?? (typeof e.data == "string" ? "hex" : "bytes"), i = typeof e.data == "string" ? x(e.data) : e.data, o = u(i);
|
|
9
|
+
if (!o)
|
|
10
|
+
throw new c();
|
|
11
|
+
if (o > y)
|
|
12
|
+
throw new h({
|
|
13
|
+
maxSize: y,
|
|
14
|
+
size: o
|
|
15
|
+
});
|
|
16
|
+
const s = [];
|
|
17
|
+
let n = !0, r = 0;
|
|
18
|
+
for (; n; ) {
|
|
19
|
+
const t = B(new Uint8Array(p));
|
|
20
|
+
let l = 0;
|
|
21
|
+
for (; l < a; ) {
|
|
22
|
+
const b = i.slice(r, r + (f - 1));
|
|
23
|
+
if (t.pushByte(0), t.pushBytes(b), b.length < 31) {
|
|
24
|
+
t.pushByte(128), n = !1;
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
l++, r += 31;
|
|
28
|
+
}
|
|
29
|
+
s.push(t);
|
|
30
|
+
}
|
|
31
|
+
return m === "bytes" ? s.map((t) => t.bytes) : s.map((t) => d(t.bytes));
|
|
12
32
|
}
|
|
13
33
|
export {
|
|
14
|
-
|
|
15
|
-
e as formatAbiParams
|
|
34
|
+
S as toBlobs
|
|
16
35
|
};
|
package/dist/index141.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=6,s=32,e=4096,n=s*e,o=n*t-1-1*e*t;exports.bytesPerBlob=n;exports.bytesPerFieldElement=s;exports.fieldElementsPerBlob=e;exports.maxBytesPerTransaction=o;
|
package/dist/index141.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
function i(t) {
|
|
3
|
-
return r(t, { strict: !1 }) ? Math.ceil((t.length - 2) / 2) : t.length;
|
|
4
|
-
}
|
|
1
|
+
const e = 32, s = 4096, t = 131072, l = 761855;
|
|
5
2
|
export {
|
|
6
|
-
|
|
3
|
+
t as bytesPerBlob,
|
|
4
|
+
e as bytesPerFieldElement,
|
|
5
|
+
s as fieldElementsPerBlob,
|
|
6
|
+
l as maxBytesPerTransaction
|
|
7
7
|
};
|
package/dist/index142.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index175.cjs"),s=require("./index38.cjs");class i extends s.BaseError{constructor({maxSize:e,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}}class n extends s.BaseError{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class t extends s.BaseError{constructor({hash:e,size:r}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${r}`],name:"InvalidVersionedHashSizeError"})}}class d extends s.BaseError{constructor({hash:e,version:r}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${a.versionedHashVersionKzg}`,`Received: ${r}`],name:"InvalidVersionedHashVersionError"})}}exports.BlobSizeTooLargeError=i;exports.EmptyBlobError=n;exports.InvalidVersionedHashSizeError=t;exports.InvalidVersionedHashVersionError=d;
|
package/dist/index142.js
CHANGED
|
@@ -1,15 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { versionedHashVersionKzg as a } from "./index175.js";
|
|
2
|
+
import { BaseError as s } from "./index38.js";
|
|
3
|
+
class t extends s {
|
|
4
|
+
constructor({ maxSize: e, size: r }) {
|
|
5
|
+
super("Blob size is too large.", {
|
|
6
|
+
metaMessages: [`Max: ${e} bytes`, `Given: ${r} bytes`],
|
|
7
|
+
name: "BlobSizeTooLargeError"
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
class d extends s {
|
|
12
|
+
constructor() {
|
|
13
|
+
super("Blob data must not be empty.", { name: "EmptyBlobError" });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
class l extends s {
|
|
17
|
+
constructor({ hash: e, size: r }) {
|
|
18
|
+
super(`Versioned hash "${e}" size is invalid.`, {
|
|
19
|
+
metaMessages: ["Expected: 32", `Received: ${r}`],
|
|
20
|
+
name: "InvalidVersionedHashSizeError"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
class c extends s {
|
|
25
|
+
constructor({ hash: e, version: r }) {
|
|
26
|
+
super(`Versioned hash "${e}" version is invalid.`, {
|
|
5
27
|
metaMessages: [
|
|
6
|
-
|
|
7
|
-
|
|
28
|
+
`Expected: ${a}`,
|
|
29
|
+
`Received: ${r}`
|
|
8
30
|
],
|
|
9
|
-
name: "
|
|
31
|
+
name: "InvalidVersionedHashVersionError"
|
|
10
32
|
});
|
|
11
33
|
}
|
|
12
34
|
}
|
|
13
35
|
export {
|
|
14
|
-
|
|
36
|
+
t as BlobSizeTooLargeError,
|
|
37
|
+
d as EmptyBlobError,
|
|
38
|
+
l as InvalidVersionedHashSizeError,
|
|
39
|
+
c as InvalidVersionedHashVersionError
|
|
15
40
|
};
|
package/dist/index143.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./index144.cjs"),p=require("./index145.cjs"),h=require("./index72.cjs"),g=require("./index88.cjs"),E=require("./index112.cjs"),L=require("./index132.cjs"),R=require("./index120.cjs"),S=require("./index130.cjs"),q=require("./index146.cjs"),O=require("./index44.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/index143.js
CHANGED
|
@@ -1,4 +1,114 @@
|
|
|
1
|
-
|
|
1
|
+
import { call as h } from "./index144.js";
|
|
2
|
+
import { OffchainLookupSenderMismatchError as w, OffchainLookupError as b, OffchainLookupResponseMalformedError as k } from "./index145.js";
|
|
3
|
+
import { HttpRequestError as d } from "./index72.js";
|
|
4
|
+
import { decodeErrorResult as g } from "./index88.js";
|
|
5
|
+
import { encodeAbiParameters as q } from "./index112.js";
|
|
6
|
+
import { isAddressEqual as E } from "./index132.js";
|
|
7
|
+
import { concat as L } from "./index120.js";
|
|
8
|
+
import { isHex as O } from "./index130.js";
|
|
9
|
+
import { localBatchGatewayUrl as x, localBatchGatewayRequest as S } from "./index146.js";
|
|
10
|
+
import { stringify as T } from "./index44.js";
|
|
11
|
+
const I = "0x556f1830", R = {
|
|
12
|
+
name: "OffchainLookup",
|
|
13
|
+
type: "error",
|
|
14
|
+
inputs: [
|
|
15
|
+
{
|
|
16
|
+
name: "sender",
|
|
17
|
+
type: "address"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "urls",
|
|
21
|
+
type: "string[]"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "callData",
|
|
25
|
+
type: "bytes"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "callbackFunction",
|
|
29
|
+
type: "bytes4"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "extraData",
|
|
33
|
+
type: "bytes"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
};
|
|
37
|
+
async function J(c, { blockNumber: p, blockTag: f, data: o, to: n }) {
|
|
38
|
+
const { args: i } = g({
|
|
39
|
+
data: o,
|
|
40
|
+
abi: [R]
|
|
41
|
+
}), [r, a, s, u, e] = i, { ccipRead: t } = c, m = t && typeof (t == null ? void 0 : t.request) == "function" ? t.request : A;
|
|
42
|
+
try {
|
|
43
|
+
if (!E(n, r))
|
|
44
|
+
throw new w({ sender: r, to: n });
|
|
45
|
+
const l = a.includes(x) ? await S({
|
|
46
|
+
data: s,
|
|
47
|
+
ccipRequest: m
|
|
48
|
+
}) : await m({ data: s, sender: r, urls: a }), { data: y } = await h(c, {
|
|
49
|
+
blockNumber: p,
|
|
50
|
+
blockTag: f,
|
|
51
|
+
data: L([
|
|
52
|
+
u,
|
|
53
|
+
q([{ type: "bytes" }, { type: "bytes" }], [l, e])
|
|
54
|
+
]),
|
|
55
|
+
to: n
|
|
56
|
+
});
|
|
57
|
+
return y;
|
|
58
|
+
} catch (l) {
|
|
59
|
+
throw new b({
|
|
60
|
+
callbackSelector: u,
|
|
61
|
+
cause: l,
|
|
62
|
+
data: o,
|
|
63
|
+
extraData: e,
|
|
64
|
+
sender: r,
|
|
65
|
+
urls: a
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async function A({ data: c, sender: p, urls: f }) {
|
|
70
|
+
var n;
|
|
71
|
+
let o = new Error("An unknown error occurred.");
|
|
72
|
+
for (let i = 0; i < f.length; i++) {
|
|
73
|
+
const r = f[i], a = r.includes("{data}") ? "GET" : "POST", s = a === "POST" ? { data: c, sender: p } : void 0, u = a === "POST" ? { "Content-Type": "application/json" } : {};
|
|
74
|
+
try {
|
|
75
|
+
const e = await fetch(r.replace("{sender}", p.toLowerCase()).replace("{data}", c), {
|
|
76
|
+
body: JSON.stringify(s),
|
|
77
|
+
headers: u,
|
|
78
|
+
method: a
|
|
79
|
+
});
|
|
80
|
+
let t;
|
|
81
|
+
if ((n = e.headers.get("Content-Type")) != null && n.startsWith("application/json") ? t = (await e.json()).data : t = await e.text(), !e.ok) {
|
|
82
|
+
o = new d({
|
|
83
|
+
body: s,
|
|
84
|
+
details: t != null && t.error ? T(t.error) : e.statusText,
|
|
85
|
+
headers: e.headers,
|
|
86
|
+
status: e.status,
|
|
87
|
+
url: r
|
|
88
|
+
});
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
if (!O(t)) {
|
|
92
|
+
o = new k({
|
|
93
|
+
result: t,
|
|
94
|
+
url: r
|
|
95
|
+
});
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
return t;
|
|
99
|
+
} catch (e) {
|
|
100
|
+
o = new d({
|
|
101
|
+
body: s,
|
|
102
|
+
details: e.message,
|
|
103
|
+
url: r
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
throw o;
|
|
108
|
+
}
|
|
2
109
|
export {
|
|
3
|
-
|
|
110
|
+
A as ccipRequest,
|
|
111
|
+
J as offchainLookup,
|
|
112
|
+
R as offchainLookupAbiItem,
|
|
113
|
+
I as offchainLookupSignature
|
|
4
114
|
};
|
package/dist/index144.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 Y=require("./index181.cjs"),Z=require("./index47.cjs"),j=require("./index21.cjs"),ee=require("./index182.cjs"),E=require("./index76.cjs"),A=require("./index38.cjs"),R=require("./index85.cjs"),L=require("./index86.cjs"),te=require("./index118.cjs"),$=require("./index123.cjs"),ae=require("./index127.cjs"),re=require("./index149.cjs"),G=require("./index111.cjs"),oe=require("./index183.cjs"),ce=require("./index184.cjs"),ne=require("./index157.cjs"),se=require("./index74.cjs"),ie=require("./index185.cjs"),le=require("./index173.cjs"),M=require("./index186.cjs");async function ue(e,t){var P,T,H,_;const{account:a=e.account,authorizationList:s,batch:i=!!((P=e.batch)!=null&&P.multicall),blockNumber:l,blockTag:C=e.experimental_blockTag??"latest",accessList:k,blobs:x,blockOverrides:y,code:m,data:c,factory:b,factoryData:u,gas:v,gasPrice:w,maxFeePerBlobGas:p,maxFeePerGas:g,maxPriorityFeePerGas:h,nonce:q,to:r,value:J,stateOverride:K,...Q}=t,D=a?Z.parseAccount(a):void 0;if(m&&(b||u))throw new A.BaseError("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(m&&r)throw new A.BaseError("Cannot provide both `code` & `to` as parameters.");const N=m&&c,S=b&&u&&r&&c,O=N||S,U=N?W({code:m,data:c}):S?be({data:c,factory:b,factoryData:u,to:r}):c;try{le.assertRequest(t);const o=(typeof l=="bigint"?G.numberToHex(l):void 0)||C,d=y?Y.toRpc(y):void 0,f=ie.serializeStateOverride(K),V=(_=(H=(T=e.chain)==null?void 0:T.formatters)==null?void 0:H.transactionRequest)==null?void 0:_.format,F=(V||ne.formatTransactionRequest)({...ce.extract(Q,{format:V}),from:D==null?void 0:D.address,accessList:k,authorizationList:s,blobs:x,data:U,gas:v,gasPrice:w,maxFeePerBlobGas:p,maxFeePerGas:g,maxPriorityFeePerGas:h,nonce:q,to:O?void 0:r,value:J});if(i&&de({request:F})&&!f&&!d)try{return await fe(e,{...F,blockNumber:l,blockTag:C})}catch(n){if(!(n instanceof R.ClientChainNotConfiguredError)&&!(n instanceof R.ChainDoesNotSupportContract))throw n}const X=(()=>{const n=[F,o];return f&&d?[...n,f,d]:f?[...n,f]:d?[...n,{},d]:n})(),z=await e.request({method:"eth_call",params:X});return z==="0x"?{data:void 0}:{data:z}}catch(B){const o=I(B),{offchainLookup:d,offchainLookupSignature:f}=await Promise.resolve().then(()=>require("./index143.cjs"));if(e.ccipRead!==!1&&(o==null?void 0:o.slice(0,10))===f&&r)return{data:await d(e,{data:o,to:r})};throw O&&(o==null?void 0:o.slice(0,10))==="0x101bb98d"?new L.CounterfactualDeploymentFailedError({factory:b}):oe.getCallError(B,{...t,account:D,chain:e.chain})}}function de({request:e}){const{data:t,to:a,...s}=e;return!(!t||t.startsWith(ee.aggregate3Signature)||!a||Object.values(s).filter(i=>typeof i<"u").length>0)}async function fe(e,t){var w;const{batchSize:a=1024,deployless:s=!1,wait:i=0}=typeof((w=e.batch)==null?void 0:w.multicall)=="object"?e.batch.multicall:{},{blockNumber:l,blockTag:C=e.experimental_blockTag??"latest",data:k,to:x}=t,y=(()=>{if(s)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return re.getChainContractAddress({blockNumber:l,chain:e.chain,contract:"multicall3"});throw new R.ClientChainNotConfiguredError})(),c=(typeof l=="bigint"?G.numberToHex(l):void 0)||C,{schedule:b}=se.createBatchScheduler({id:`${e.uid}.${c}`,wait:i,shouldSplitBatch(p){return p.reduce((h,{data:q})=>h+(q.length-2),0)>a*2},fn:async p=>{const g=p.map(r=>({allowFailure:!0,callData:r.data,target:r.to})),h=ae.encodeFunctionData({abi:j.multicall3Abi,args:[g],functionName:"aggregate3"}),q=await e.request({method:"eth_call",params:[{...y===null?{data:W({code:E.multicall3Bytecode,data:h})}:{to:y,data:h}},c]});return te.decodeFunctionResult({abi:j.multicall3Abi,args:[g],functionName:"aggregate3",data:q||"0x"})}}),[{returnData:u,success:v}]=await b({data:k,to:x});if(!v)throw new L.RawContractError({data:u});return u==="0x"?{data:void 0}:{data:u}}function W(e){const{code:t,data:a}=e;return $.encodeDeployData({abi:M.parseAbi(["constructor(bytes, bytes)"]),bytecode:E.deploylessCallViaBytecodeBytecode,args:[t,a]})}function be(e){const{data:t,factory:a,factoryData:s,to:i}=e;return $.encodeDeployData({abi:M.parseAbi(["constructor(address, bytes, address, bytes)"]),bytecode:E.deploylessCallViaFactoryBytecode,args:[i,t,a,s]})}function I(e){var a;if(!(e instanceof A.BaseError))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(a=t.data)==null?void 0:a.data:t.data}exports.call=ue;exports.getRevertErrorData=I;
|
package/dist/index144.js
CHANGED
|
@@ -1,34 +1,174 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { toRpc as Q } from "./index181.js";
|
|
2
|
+
import { parseAccount as U } from "./index47.js";
|
|
3
|
+
import { multicall3Abi as z } from "./index21.js";
|
|
4
|
+
import { aggregate3Signature as X } from "./index182.js";
|
|
5
|
+
import { deploylessCallViaBytecodeBytecode as Y, deploylessCallViaFactoryBytecode as Z, multicall3Bytecode as tt } from "./index76.js";
|
|
6
|
+
import { BaseError as R } from "./index38.js";
|
|
7
|
+
import { ClientChainNotConfiguredError as H, ChainDoesNotSupportContract as at } from "./index85.js";
|
|
8
|
+
import { CounterfactualDeploymentFailedError as et, RawContractError as rt } from "./index86.js";
|
|
9
|
+
import { decodeFunctionResult as ot } from "./index118.js";
|
|
10
|
+
import { encodeDeployData as L } from "./index123.js";
|
|
11
|
+
import { encodeFunctionData as ct } from "./index127.js";
|
|
12
|
+
import { getChainContractAddress as nt } from "./index149.js";
|
|
13
|
+
import { numberToHex as j } from "./index111.js";
|
|
14
|
+
import { getCallError as st } from "./index183.js";
|
|
15
|
+
import { extract as it } from "./index184.js";
|
|
16
|
+
import { formatTransactionRequest as lt } from "./index157.js";
|
|
17
|
+
import { createBatchScheduler as ut } from "./index74.js";
|
|
18
|
+
import { serializeStateOverride as dt } from "./index185.js";
|
|
19
|
+
import { assertRequest as ft } from "./index173.js";
|
|
20
|
+
import { parseAbi as G } from "./index186.js";
|
|
21
|
+
async function zt(t, a) {
|
|
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: D, blobs: B, blockOverrides: b, code: h, data: c, factory: m, factoryData: u, gas: F, gasPrice: k, maxFeePerBlobGas: y, maxFeePerGas: g, maxPriorityFeePerGas: p, nonce: w, to: r, value: $, stateOverride: W, ...I } = a, x = e ? U(e) : void 0;
|
|
24
|
+
if (h && (m || u))
|
|
25
|
+
throw new R("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
|
|
26
|
+
if (h && r)
|
|
27
|
+
throw new R("Cannot provide both `code` & `to` as parameters.");
|
|
28
|
+
const S = h && c, A = m && u && r && c, _ = S || A, J = S ? M({
|
|
29
|
+
code: h,
|
|
30
|
+
data: c
|
|
31
|
+
}) : A ? bt({
|
|
32
|
+
data: c,
|
|
33
|
+
factory: m,
|
|
34
|
+
factoryData: u,
|
|
35
|
+
to: r
|
|
36
|
+
}) : c;
|
|
37
|
+
try {
|
|
38
|
+
ft(a);
|
|
39
|
+
const o = (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, N = (T || lt)({
|
|
40
|
+
// Pick out extra data that might exist on the chain's transaction request type.
|
|
41
|
+
...it(I, { format: T }),
|
|
42
|
+
from: x == null ? void 0 : x.address,
|
|
43
|
+
accessList: D,
|
|
44
|
+
authorizationList: s,
|
|
45
|
+
blobs: B,
|
|
46
|
+
data: J,
|
|
47
|
+
gas: F,
|
|
48
|
+
gasPrice: k,
|
|
49
|
+
maxFeePerBlobGas: y,
|
|
50
|
+
maxFeePerGas: g,
|
|
51
|
+
maxPriorityFeePerGas: p,
|
|
52
|
+
nonce: w,
|
|
53
|
+
to: _ ? void 0 : r,
|
|
54
|
+
value: $
|
|
55
|
+
});
|
|
56
|
+
if (i && mt({ request: N }) && !f && !d)
|
|
57
|
+
try {
|
|
58
|
+
return await pt(t, {
|
|
59
|
+
...N,
|
|
60
|
+
blockNumber: l,
|
|
61
|
+
blockTag: C
|
|
62
|
+
});
|
|
63
|
+
} catch (n) {
|
|
64
|
+
if (!(n instanceof H) && !(n instanceof at))
|
|
65
|
+
throw n;
|
|
66
|
+
}
|
|
67
|
+
const K = (() => {
|
|
68
|
+
const n = [
|
|
69
|
+
N,
|
|
70
|
+
o
|
|
71
|
+
];
|
|
72
|
+
return f && d ? [...n, f, d] : f ? [...n, f] : d ? [...n, {}, d] : n;
|
|
73
|
+
})(), V = await t.request({
|
|
74
|
+
method: "eth_call",
|
|
75
|
+
params: K
|
|
76
|
+
});
|
|
77
|
+
return V === "0x" ? { data: void 0 } : { data: V };
|
|
78
|
+
} catch (v) {
|
|
79
|
+
const o = ht(v), { offchainLookup: d, offchainLookupSignature: f } = await import("./index143.js");
|
|
80
|
+
if (t.ccipRead !== !1 && (o == null ? void 0 : o.slice(0, 10)) === f && r)
|
|
81
|
+
return { data: await d(t, { data: o, to: r }) };
|
|
82
|
+
throw _ && (o == null ? void 0 : o.slice(0, 10)) === "0x101bb98d" ? new et({ factory: m }) : st(v, {
|
|
83
|
+
...a,
|
|
84
|
+
account: x,
|
|
85
|
+
chain: t.chain
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function mt({ request: t }) {
|
|
90
|
+
const { data: a, to: e, ...s } = t;
|
|
91
|
+
return !(!a || a.startsWith(X) || !e || Object.values(s).filter((i) => typeof i < "u").length > 0);
|
|
92
|
+
}
|
|
93
|
+
async function pt(t, a) {
|
|
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: D, to: B } = a, b = (() => {
|
|
96
|
+
if (s)
|
|
97
|
+
return null;
|
|
98
|
+
if (a.multicallAddress)
|
|
99
|
+
return a.multicallAddress;
|
|
100
|
+
if (t.chain)
|
|
101
|
+
return nt({
|
|
102
|
+
blockNumber: l,
|
|
103
|
+
chain: t.chain,
|
|
104
|
+
contract: "multicall3"
|
|
105
|
+
});
|
|
106
|
+
throw new H();
|
|
107
|
+
})(), c = (typeof l == "bigint" ? j(l) : void 0) || C, { schedule: m } = ut({
|
|
108
|
+
id: `${t.uid}.${c}`,
|
|
109
|
+
wait: i,
|
|
110
|
+
shouldSplitBatch(y) {
|
|
111
|
+
return y.reduce((p, { data: w }) => p + (w.length - 2), 0) > e * 2;
|
|
112
|
+
},
|
|
113
|
+
fn: async (y) => {
|
|
114
|
+
const g = y.map((r) => ({
|
|
115
|
+
allowFailure: !0,
|
|
116
|
+
callData: r.data,
|
|
117
|
+
target: r.to
|
|
118
|
+
})), p = ct({
|
|
119
|
+
abi: z,
|
|
120
|
+
args: [g],
|
|
121
|
+
functionName: "aggregate3"
|
|
122
|
+
}), w = await t.request({
|
|
123
|
+
method: "eth_call",
|
|
124
|
+
params: [
|
|
125
|
+
{
|
|
126
|
+
...b === null ? {
|
|
127
|
+
data: M({
|
|
128
|
+
code: tt,
|
|
129
|
+
data: p
|
|
130
|
+
})
|
|
131
|
+
} : { to: b, data: p }
|
|
132
|
+
},
|
|
133
|
+
c
|
|
134
|
+
]
|
|
135
|
+
});
|
|
136
|
+
return ot({
|
|
137
|
+
abi: z,
|
|
138
|
+
args: [g],
|
|
139
|
+
functionName: "aggregate3",
|
|
140
|
+
data: w || "0x"
|
|
141
|
+
});
|
|
16
142
|
}
|
|
17
|
-
],
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
143
|
+
}), [{ returnData: u, success: F }] = await m({ data: D, to: B });
|
|
144
|
+
if (!F)
|
|
145
|
+
throw new rt({ data: u });
|
|
146
|
+
return u === "0x" ? { data: void 0 } : { data: u };
|
|
147
|
+
}
|
|
148
|
+
function M(t) {
|
|
149
|
+
const { code: a, data: e } = t;
|
|
150
|
+
return L({
|
|
151
|
+
abi: G(["constructor(bytes, bytes)"]),
|
|
152
|
+
bytecode: Y,
|
|
153
|
+
args: [a, e]
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
function bt(t) {
|
|
157
|
+
const { data: a, factory: e, factoryData: s, to: i } = t;
|
|
158
|
+
return L({
|
|
159
|
+
abi: G(["constructor(address, bytes, address, bytes)"]),
|
|
160
|
+
bytecode: Z,
|
|
161
|
+
args: [i, a, e, s]
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
function ht(t) {
|
|
165
|
+
var e;
|
|
166
|
+
if (!(t instanceof R))
|
|
167
|
+
return;
|
|
168
|
+
const a = t.walk();
|
|
169
|
+
return typeof (a == null ? void 0 : a.data) == "object" ? (e = a.data) == null ? void 0 : e.data : a.data;
|
|
170
|
+
}
|
|
30
171
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
t as solidityPanic
|
|
172
|
+
zt as call,
|
|
173
|
+
ht as getRevertErrorData
|
|
34
174
|
};
|
package/dist/index145.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("./index44.cjs"),s=require("./index38.cjs"),n=require("./index95.cjs");class h extends s.BaseError{constructor({callbackSelector:r,cause:e,data:c,extraData:f,sender:i,urls:o}){var t;super(e.shortMessage||"An error occurred while fetching for an offchain result.",{cause:e,metaMessages:[...e.metaMessages||[],(t=e.metaMessages)!=null&&t.length?"":[],"Offchain Gateway Call:",o&&[" Gateway URL(s):",...o.map(d=>` ${n.getUrl(d)}`)],` Sender: ${i}`,` Data: ${c}`,` Callback selector: ${r}`,` Extra data: ${f}`].flat(),name:"OffchainLookupError"})}}class l extends s.BaseError{constructor({result:r,url:e}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${n.getUrl(e)}`,`Response: ${u.stringify(r)}`],name:"OffchainLookupResponseMalformedError"})}}class p extends s.BaseError{constructor({sender:r,to:e}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${e}`,`OffchainLookup sender address: ${r}`],name:"OffchainLookupSenderMismatchError"})}}exports.OffchainLookupError=h;exports.OffchainLookupResponseMalformedError=l;exports.OffchainLookupSenderMismatchError=p;
|
package/dist/index145.js
CHANGED
|
@@ -1,24 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { stringify as i } from "./index44.js";
|
|
2
|
+
import { BaseError as a } from "./index38.js";
|
|
3
|
+
import { getUrl as n } from "./index95.js";
|
|
4
|
+
class u extends a {
|
|
5
|
+
constructor({ callbackSelector: r, cause: e, data: f, extraData: c, sender: d, urls: o }) {
|
|
6
|
+
var t;
|
|
7
|
+
super(e.shortMessage || "An error occurred while fetching for an offchain result.", {
|
|
8
|
+
cause: e,
|
|
9
|
+
metaMessages: [
|
|
10
|
+
...e.metaMessages || [],
|
|
11
|
+
(t = e.metaMessages) != null && t.length ? "" : [],
|
|
12
|
+
"Offchain Gateway Call:",
|
|
13
|
+
o && [
|
|
14
|
+
" Gateway URL(s):",
|
|
15
|
+
...o.map((m) => ` ${n(m)}`)
|
|
16
|
+
],
|
|
17
|
+
` Sender: ${d}`,
|
|
18
|
+
` Data: ${f}`,
|
|
19
|
+
` Callback selector: ${r}`,
|
|
20
|
+
` Extra data: ${c}`
|
|
21
|
+
].flat(),
|
|
22
|
+
name: "OffchainLookupError"
|
|
15
23
|
});
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
class g extends a {
|
|
27
|
+
constructor({ result: r, url: e }) {
|
|
28
|
+
super("Offchain gateway response is malformed. Response data must be a hex value.", {
|
|
29
|
+
metaMessages: [
|
|
30
|
+
`Gateway URL: ${n(e)}`,
|
|
31
|
+
`Response: ${i(r)}`
|
|
32
|
+
],
|
|
33
|
+
name: "OffchainLookupResponseMalformedError"
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
class M extends a {
|
|
38
|
+
constructor({ sender: r, to: e }) {
|
|
39
|
+
super("Reverted sender address does not match target contract address (`to`).", {
|
|
40
|
+
metaMessages: [
|
|
41
|
+
`Contract address: ${e}`,
|
|
42
|
+
`OffchainLookup sender address: ${r}`
|
|
43
|
+
],
|
|
44
|
+
name: "OffchainLookupSenderMismatchError"
|
|
45
|
+
});
|
|
46
|
+
}
|
|
21
47
|
}
|
|
22
48
|
export {
|
|
23
|
-
|
|
49
|
+
u as OffchainLookupError,
|
|
50
|
+
g as OffchainLookupResponseMalformedError,
|
|
51
|
+
M as OffchainLookupSenderMismatchError
|
|
24
52
|
};
|
package/dist/index146.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("./index21.cjs"),y=require("./index87.cjs"),h=require("./index117.cjs"),n=require("./index124.cjs"),w=require("./index129.cjs"),u="x-batch-gateway:true";async function i(t){const{data:l,ccipRequest:o}=t,{args:[d]}=h.decodeFunctionData({abi:c.batchGatewayAbi,data:l}),a=[],s=[];return await Promise.all(d.map(async(r,e)=>{try{s[e]=r.urls.includes(u)?await i({data:r.data,ccipRequest:o}):await o(r),a[e]=!1}catch(b){a[e]=!0,s[e]=g(b)}})),w.encodeFunctionResult({abi:c.batchGatewayAbi,functionName:"query",result:[a,s]})}function g(t){return t.name==="HttpRequestError"&&t.status?n.encodeErrorResult({abi:c.batchGatewayAbi,errorName:"HttpError",args:[t.status,t.shortMessage]}):n.encodeErrorResult({abi:[y.solidityError],errorName:"Error",args:["shortMessage"in t?t.shortMessage:t.message]})}exports.localBatchGatewayRequest=i;exports.localBatchGatewayUrl=u;
|
package/dist/index146.js
CHANGED
|
@@ -1,8 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { batchGatewayAbi as o } from "./index21.js";
|
|
2
|
+
import { solidityError as l } from "./index87.js";
|
|
3
|
+
import { decodeFunctionData as f } from "./index117.js";
|
|
4
|
+
import { encodeErrorResult as n } from "./index124.js";
|
|
5
|
+
import { encodeFunctionResult as p } from "./index129.js";
|
|
6
|
+
const d = "x-batch-gateway:true";
|
|
7
|
+
async function g(t) {
|
|
8
|
+
const { data: i, ccipRequest: c } = t, { args: [u] } = f({ abi: o, data: i }), e = [], s = [];
|
|
9
|
+
return await Promise.all(u.map(async (r, a) => {
|
|
10
|
+
try {
|
|
11
|
+
s[a] = r.urls.includes(d) ? await g({ data: r.data, ccipRequest: c }) : await c(r), e[a] = !1;
|
|
12
|
+
} catch (m) {
|
|
13
|
+
e[a] = !0, s[a] = h(m);
|
|
14
|
+
}
|
|
15
|
+
})), p({
|
|
16
|
+
abi: o,
|
|
17
|
+
functionName: "query",
|
|
18
|
+
result: [e, s]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function h(t) {
|
|
22
|
+
return t.name === "HttpRequestError" && t.status ? n({
|
|
23
|
+
abi: o,
|
|
24
|
+
errorName: "HttpError",
|
|
25
|
+
args: [t.status, t.shortMessage]
|
|
26
|
+
}) : n({
|
|
27
|
+
abi: [l],
|
|
28
|
+
errorName: "Error",
|
|
29
|
+
args: ["shortMessage" in t ? t.shortMessage : t.message]
|
|
30
|
+
});
|
|
5
31
|
}
|
|
6
32
|
export {
|
|
7
|
-
|
|
33
|
+
g as localBatchGatewayRequest,
|
|
34
|
+
d as localBatchGatewayUrl
|
|
8
35
|
};
|
package/dist/index147.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("./index85.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/index147.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ChainNotFoundError as t, ChainMismatchError as i } from "./index85.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 });
|
|
5
7
|
}
|
|
6
8
|
export {
|
|
7
|
-
|
|
9
|
+
e as assertCurrentChain
|
|
8
10
|
};
|
package/dist/index148.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 n(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}exports.defineChain=n;
|