@gardenfi/core 0.2.0-beta.7 → 0.2.0-beta.71
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 -29
- package/dist/index.js +27 -6785
- package/dist/index10.cjs +1 -0
- package/dist/index10.js +101 -0
- package/dist/index100.cjs +1 -0
- package/dist/index100.js +37 -0
- package/dist/index101.cjs +1 -0
- package/dist/index101.js +369 -0
- package/dist/index102.cjs +1 -0
- package/dist/index102.js +23 -0
- package/dist/index103.cjs +1 -0
- package/dist/index103.js +58 -0
- package/dist/index104.cjs +1 -0
- package/dist/index104.js +5 -0
- package/dist/index105.cjs +1 -0
- package/dist/index105.js +51 -0
- package/dist/index106.cjs +1 -0
- package/dist/index106.js +28 -0
- package/dist/index107.cjs +1 -0
- package/dist/index107.js +4 -0
- package/dist/index108.cjs +1 -0
- package/dist/index108.js +4 -0
- package/dist/index109.cjs +1 -0
- package/dist/index109.js +64 -0
- package/dist/index11.cjs +20 -0
- package/dist/index11.js +380 -0
- package/dist/index110.cjs +1 -0
- package/dist/index110.js +37 -0
- package/dist/index111.cjs +1 -0
- package/dist/index111.js +4 -0
- package/dist/index112.cjs +1 -0
- package/dist/index112.js +60 -0
- package/dist/index113.cjs +1 -0
- package/dist/index113.js +4 -0
- package/dist/index114.cjs +1 -0
- package/dist/index114.js +42 -0
- package/dist/index115.cjs +1 -0
- package/dist/index115.js +45 -0
- package/dist/index116.cjs +1 -0
- package/dist/index116.js +20 -0
- package/dist/index117.cjs +1 -0
- package/dist/index117.js +111 -0
- package/dist/index118.cjs +1 -0
- package/dist/index118.js +23 -0
- package/dist/index119.cjs +1 -0
- package/dist/index119.js +228 -0
- package/dist/index12.cjs +1 -0
- package/dist/index12.js +22 -0
- package/dist/index120.cjs +1 -0
- package/dist/index120.js +6 -0
- package/dist/index121.cjs +1 -0
- package/dist/index121.js +160 -0
- package/dist/index122.cjs +1 -0
- package/dist/index122.js +4 -0
- package/dist/index123.cjs +1 -0
- package/dist/index123.js +75 -0
- package/dist/index124.cjs +1 -0
- package/dist/index124.js +7 -0
- package/dist/index125.cjs +1 -0
- package/dist/index125.js +107 -0
- package/dist/index126.cjs +1 -0
- package/dist/index126.js +15 -0
- package/dist/index127.cjs +1 -0
- package/dist/index127.js +35 -0
- package/dist/index128.cjs +1 -0
- package/dist/index128.js +32 -0
- package/dist/index129.cjs +1 -0
- package/dist/index129.js +4 -0
- package/dist/index13.cjs +1 -0
- package/dist/index13.js +396 -0
- package/dist/index130.cjs +1 -0
- package/dist/index130.js +21 -0
- package/dist/index131.cjs +1 -0
- package/dist/index131.js +4 -0
- package/dist/index132.cjs +1 -0
- package/dist/index132.js +358 -0
- package/dist/index133.cjs +1 -0
- package/dist/index133.js +241 -0
- package/dist/index134.cjs +1 -0
- package/dist/index134.js +70 -0
- package/dist/index135.cjs +1 -0
- package/dist/index135.js +64 -0
- package/dist/index136.cjs +1 -0
- package/dist/index136.js +14 -0
- package/dist/index137.cjs +1 -0
- package/dist/index137.js +47 -0
- package/dist/index138.cjs +1 -0
- package/dist/index138.js +65 -0
- package/dist/index139.cjs +1 -0
- package/dist/index139.js +228 -0
- package/dist/index14.cjs +1 -0
- package/dist/index14.js +23 -0
- package/dist/index140.cjs +1 -0
- package/dist/index140.js +5 -0
- package/dist/index141.cjs +1 -0
- package/dist/index141.js +171 -0
- package/dist/index142.cjs +1 -0
- package/dist/index142.js +30 -0
- package/dist/index143.cjs +1 -0
- package/dist/index143.js +23 -0
- package/dist/index144.cjs +1 -0
- package/dist/index144.js +72 -0
- package/dist/index145.cjs +1 -0
- package/dist/index145.js +130 -0
- package/dist/index146.cjs +1 -0
- package/dist/index146.js +9 -0
- package/dist/index147.cjs +1 -0
- package/dist/index147.js +4 -0
- package/dist/index148.cjs +1 -0
- package/dist/index148.js +28 -0
- package/dist/index149.cjs +1 -0
- package/dist/index149.js +4 -0
- package/dist/index15.cjs +1 -0
- package/dist/index15.js +4 -0
- package/dist/index16.cjs +1 -0
- package/dist/index16.js +34 -0
- package/dist/index17.cjs +1 -0
- package/dist/index17.js +27 -0
- package/dist/index18.cjs +1 -0
- package/dist/index18.js +33 -0
- package/dist/index19.cjs +1 -0
- package/dist/index19.js +32 -0
- package/dist/index2.cjs +1 -0
- package/dist/index2.js +412 -0
- package/dist/index20.cjs +1 -0
- package/dist/index20.js +55 -0
- package/dist/index21.cjs +1 -0
- package/dist/index21.js +30 -0
- package/dist/index22.cjs +1 -0
- package/dist/index22.js +17 -0
- package/dist/index23.cjs +1 -0
- package/dist/index23.js +11 -0
- package/dist/index24.cjs +1 -0
- package/dist/index24.js +11 -0
- package/dist/index25.cjs +1 -0
- package/dist/index25.js +140 -0
- package/dist/index26.cjs +1 -0
- package/dist/index26.js +4 -0
- package/dist/index27.cjs +1 -0
- package/dist/index27.js +15 -0
- package/dist/index28.cjs +1 -0
- package/dist/index28.js +39 -0
- package/dist/index29.cjs +1 -0
- package/dist/index29.js +44 -0
- package/dist/index3.cjs +1 -0
- package/dist/index3.js +5 -0
- package/dist/index30.cjs +1 -0
- package/dist/index30.js +26 -0
- package/dist/index31.cjs +1 -0
- package/dist/index31.js +28 -0
- package/dist/index32.cjs +1 -0
- package/dist/index32.js +57 -0
- package/dist/index33.cjs +1 -0
- package/dist/index33.js +30 -0
- package/dist/index34.cjs +3 -0
- package/dist/index34.js +30 -0
- package/dist/index35.cjs +1 -0
- package/dist/index35.js +17 -0
- package/dist/index36.cjs +2 -0
- package/dist/index36.js +27 -0
- package/dist/index37.cjs +1 -0
- package/dist/index37.js +43 -0
- package/dist/index38.cjs +1 -0
- package/dist/index38.js +201 -0
- package/dist/index39.cjs +1 -0
- package/dist/index39.js +4 -0
- package/dist/index4.cjs +1 -0
- package/dist/index4.js +18 -0
- package/dist/index40.cjs +1 -0
- package/dist/index40.js +4 -0
- package/dist/index41.cjs +1 -0
- package/dist/index41.js +4 -0
- package/dist/index42.cjs +1 -0
- package/dist/index42.js +15 -0
- package/dist/index43.cjs +1 -0
- package/dist/index43.js +14 -0
- package/dist/index44.cjs +1 -0
- package/dist/index44.js +6 -0
- package/dist/index45.cjs +1 -0
- package/dist/index45.js +48 -0
- package/dist/index46.cjs +1 -0
- package/dist/index46.js +45 -0
- package/dist/index47.cjs +1 -0
- package/dist/index47.js +174 -0
- package/dist/index48.cjs +1 -0
- package/dist/index48.js +15 -0
- package/dist/index49.cjs +1 -0
- package/dist/index49.js +7 -0
- package/dist/index5.cjs +1 -0
- package/dist/index5.js +110 -0
- package/dist/index50.cjs +1 -0
- package/dist/index50.js +19 -0
- package/dist/index51.cjs +1 -0
- package/dist/index51.js +14 -0
- package/dist/index52.cjs +1 -0
- package/dist/index52.js +177 -0
- package/dist/index53.cjs +1 -0
- package/dist/index53.js +24 -0
- package/dist/index54.cjs +1 -0
- package/dist/index54.js +4 -0
- package/dist/index55.cjs +1 -0
- package/dist/index55.js +37 -0
- package/dist/index56.cjs +1 -0
- package/dist/index56.js +11 -0
- package/dist/index57.cjs +1 -0
- package/dist/index57.js +37 -0
- package/dist/index58.cjs +1 -0
- package/dist/index58.js +58 -0
- package/dist/index59.cjs +2 -0
- package/dist/index59.js +62 -0
- package/dist/index6.cjs +1 -0
- package/dist/index6.js +5 -0
- package/dist/index60.cjs +1 -0
- package/dist/index60.js +6 -0
- package/dist/index61.cjs +1 -0
- package/dist/index61.js +130 -0
- package/dist/index62.cjs +2 -0
- package/dist/index62.js +45 -0
- package/dist/index63.cjs +1 -0
- package/dist/index63.js +11 -0
- package/dist/index64.cjs +1 -0
- package/dist/index64.js +13 -0
- package/dist/index65.cjs +1 -0
- package/dist/index65.js +14 -0
- package/dist/index66.cjs +1 -0
- package/dist/index66.js +16 -0
- package/dist/index67.cjs +1 -0
- package/dist/index67.js +9 -0
- package/dist/index68.cjs +1 -0
- package/dist/index68.js +20 -0
- package/dist/index69.cjs +1 -0
- package/dist/index69.js +81 -0
- package/dist/index7.cjs +1 -0
- package/dist/index7.js +76 -0
- package/dist/index70.cjs +1 -0
- package/dist/index70.js +17 -0
- package/dist/index71.cjs +1 -0
- package/dist/index71.js +21 -0
- package/dist/index72.cjs +1 -0
- package/dist/index72.js +24 -0
- package/dist/index73.cjs +1 -0
- package/dist/index73.js +16 -0
- package/dist/index74.cjs +1 -0
- package/dist/index74.js +4 -0
- package/dist/index75.cjs +1 -0
- package/dist/index75.js +4 -0
- package/dist/index76.cjs +1 -0
- package/dist/index76.js +9 -0
- package/dist/index77.cjs +2 -0
- package/dist/index77.js +37 -0
- package/dist/index78.cjs +1 -0
- package/dist/index78.js +8 -0
- package/dist/index79.cjs +1 -0
- package/dist/index79.js +22 -0
- package/dist/index8.cjs +1 -0
- package/dist/index8.js +62 -0
- package/dist/index80.cjs +1 -0
- package/dist/index80.js +34 -0
- package/dist/index81.cjs +1 -0
- package/dist/index81.js +4 -0
- package/dist/index82.cjs +6 -0
- package/dist/index82.js +949 -0
- package/dist/index83.cjs +1 -0
- package/dist/index83.js +4 -0
- package/dist/index84.cjs +1 -0
- package/dist/index84.js +64 -0
- package/dist/index85.cjs +1 -0
- package/dist/index85.js +35 -0
- package/dist/index86.cjs +1 -0
- package/dist/index86.js +89 -0
- package/dist/index87.cjs +1 -0
- package/dist/index87.js +15 -0
- package/dist/index88.cjs +1 -0
- package/dist/index88.js +9 -0
- package/dist/index89.cjs +1 -0
- package/dist/index89.js +115 -0
- package/dist/index9.cjs +1 -0
- package/dist/index9.js +63 -0
- package/dist/index90.cjs +1 -0
- package/dist/index90.js +9 -0
- package/dist/index91.cjs +1 -0
- package/dist/index91.js +35 -0
- package/dist/index92.cjs +1 -0
- package/dist/index92.js +4 -0
- package/dist/index93.cjs +1 -0
- package/dist/index93.js +40 -0
- package/dist/index94.cjs +1 -0
- package/dist/index94.js +31 -0
- package/dist/index95.cjs +1 -0
- package/dist/index95.js +23 -0
- package/dist/index96.cjs +1 -0
- package/dist/index96.js +9 -0
- package/dist/index97.cjs +1 -0
- package/dist/index97.js +7 -0
- package/dist/index98.cjs +1 -0
- package/dist/index98.js +13 -0
- package/dist/index99.cjs +1 -0
- package/dist/index99.js +22 -0
- package/dist/src/index.d.ts +8 -5
- package/dist/src/lib/bitcoin/htlc.d.ts +2 -1
- package/dist/src/lib/evm/htlc/evmHTLC.d.ts +54 -54
- package/dist/src/lib/garden/blockNumber.d.ts +16 -0
- package/dist/src/lib/garden/cache/executorCache.d.ts +9 -0
- package/dist/src/lib/garden/garden.d.ts +8 -3
- package/dist/src/lib/garden/garden.types.d.ts +12 -7
- package/dist/src/lib/garden/orderStatusParser.d.ts +8 -0
- package/dist/src/lib/quote/quote.d.ts +2 -1
- package/dist/src/lib/quote/quote.types.d.ts +31 -1
- package/dist/src/lib/status.d.ts +6 -4
- package/dist/src/lib/utils.d.ts +10 -5
- package/package.json +5 -3
- package/dist/src/lib/garden/orderCache.d.ts +0 -13
package/dist/index61.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { RecursiveReadLimitExceededError as e, PositionOutOfBoundsError as n, NegativeOffsetError as o } from "./index95.js";
|
|
2
|
+
const h = {
|
|
3
|
+
bytes: new Uint8Array(),
|
|
4
|
+
dataView: new DataView(new ArrayBuffer(0)),
|
|
5
|
+
position: 0,
|
|
6
|
+
positionReadCount: /* @__PURE__ */ new Map(),
|
|
7
|
+
recursiveReadCount: 0,
|
|
8
|
+
recursiveReadLimit: Number.POSITIVE_INFINITY,
|
|
9
|
+
assertReadLimit() {
|
|
10
|
+
if (this.recursiveReadCount >= this.recursiveReadLimit)
|
|
11
|
+
throw new e({
|
|
12
|
+
count: this.recursiveReadCount + 1,
|
|
13
|
+
limit: this.recursiveReadLimit
|
|
14
|
+
});
|
|
15
|
+
},
|
|
16
|
+
assertPosition(t) {
|
|
17
|
+
if (t < 0 || t > this.bytes.length - 1)
|
|
18
|
+
throw new n({
|
|
19
|
+
length: this.bytes.length,
|
|
20
|
+
position: t
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
decrementPosition(t) {
|
|
24
|
+
if (t < 0)
|
|
25
|
+
throw new o({ offset: t });
|
|
26
|
+
const i = this.position - t;
|
|
27
|
+
this.assertPosition(i), this.position = i;
|
|
28
|
+
},
|
|
29
|
+
getReadCount(t) {
|
|
30
|
+
return this.positionReadCount.get(t || this.position) || 0;
|
|
31
|
+
},
|
|
32
|
+
incrementPosition(t) {
|
|
33
|
+
if (t < 0)
|
|
34
|
+
throw new o({ offset: t });
|
|
35
|
+
const i = this.position + t;
|
|
36
|
+
this.assertPosition(i), this.position = i;
|
|
37
|
+
},
|
|
38
|
+
inspectByte(t) {
|
|
39
|
+
const i = t ?? this.position;
|
|
40
|
+
return this.assertPosition(i), this.bytes[i];
|
|
41
|
+
},
|
|
42
|
+
inspectBytes(t, i) {
|
|
43
|
+
const s = i ?? this.position;
|
|
44
|
+
return this.assertPosition(s + t - 1), this.bytes.subarray(s, s + t);
|
|
45
|
+
},
|
|
46
|
+
inspectUint8(t) {
|
|
47
|
+
const i = t ?? this.position;
|
|
48
|
+
return this.assertPosition(i), this.bytes[i];
|
|
49
|
+
},
|
|
50
|
+
inspectUint16(t) {
|
|
51
|
+
const i = t ?? this.position;
|
|
52
|
+
return this.assertPosition(i + 1), this.dataView.getUint16(i);
|
|
53
|
+
},
|
|
54
|
+
inspectUint24(t) {
|
|
55
|
+
const i = t ?? this.position;
|
|
56
|
+
return this.assertPosition(i + 2), (this.dataView.getUint16(i) << 8) + this.dataView.getUint8(i + 2);
|
|
57
|
+
},
|
|
58
|
+
inspectUint32(t) {
|
|
59
|
+
const i = t ?? this.position;
|
|
60
|
+
return this.assertPosition(i + 3), this.dataView.getUint32(i);
|
|
61
|
+
},
|
|
62
|
+
pushByte(t) {
|
|
63
|
+
this.assertPosition(this.position), this.bytes[this.position] = t, this.position++;
|
|
64
|
+
},
|
|
65
|
+
pushBytes(t) {
|
|
66
|
+
this.assertPosition(this.position + t.length - 1), this.bytes.set(t, this.position), this.position += t.length;
|
|
67
|
+
},
|
|
68
|
+
pushUint8(t) {
|
|
69
|
+
this.assertPosition(this.position), this.bytes[this.position] = t, this.position++;
|
|
70
|
+
},
|
|
71
|
+
pushUint16(t) {
|
|
72
|
+
this.assertPosition(this.position + 1), this.dataView.setUint16(this.position, t), this.position += 2;
|
|
73
|
+
},
|
|
74
|
+
pushUint24(t) {
|
|
75
|
+
this.assertPosition(this.position + 2), this.dataView.setUint16(this.position, t >> 8), this.dataView.setUint8(this.position + 2, t & 255), this.position += 3;
|
|
76
|
+
},
|
|
77
|
+
pushUint32(t) {
|
|
78
|
+
this.assertPosition(this.position + 3), this.dataView.setUint32(this.position, t), this.position += 4;
|
|
79
|
+
},
|
|
80
|
+
readByte() {
|
|
81
|
+
this.assertReadLimit(), this._touch();
|
|
82
|
+
const t = this.inspectByte();
|
|
83
|
+
return this.position++, t;
|
|
84
|
+
},
|
|
85
|
+
readBytes(t, i) {
|
|
86
|
+
this.assertReadLimit(), this._touch();
|
|
87
|
+
const s = this.inspectBytes(t);
|
|
88
|
+
return this.position += i ?? t, s;
|
|
89
|
+
},
|
|
90
|
+
readUint8() {
|
|
91
|
+
this.assertReadLimit(), this._touch();
|
|
92
|
+
const t = this.inspectUint8();
|
|
93
|
+
return this.position += 1, t;
|
|
94
|
+
},
|
|
95
|
+
readUint16() {
|
|
96
|
+
this.assertReadLimit(), this._touch();
|
|
97
|
+
const t = this.inspectUint16();
|
|
98
|
+
return this.position += 2, t;
|
|
99
|
+
},
|
|
100
|
+
readUint24() {
|
|
101
|
+
this.assertReadLimit(), this._touch();
|
|
102
|
+
const t = this.inspectUint24();
|
|
103
|
+
return this.position += 3, t;
|
|
104
|
+
},
|
|
105
|
+
readUint32() {
|
|
106
|
+
this.assertReadLimit(), this._touch();
|
|
107
|
+
const t = this.inspectUint32();
|
|
108
|
+
return this.position += 4, t;
|
|
109
|
+
},
|
|
110
|
+
get remaining() {
|
|
111
|
+
return this.bytes.length - this.position;
|
|
112
|
+
},
|
|
113
|
+
setPosition(t) {
|
|
114
|
+
const i = this.position;
|
|
115
|
+
return this.assertPosition(t), this.position = t, () => this.position = i;
|
|
116
|
+
},
|
|
117
|
+
_touch() {
|
|
118
|
+
if (this.recursiveReadLimit === Number.POSITIVE_INFINITY)
|
|
119
|
+
return;
|
|
120
|
+
const t = this.getReadCount();
|
|
121
|
+
this.positionReadCount.set(this.position, t + 1), t > 0 && this.recursiveReadCount++;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
function a(t, { recursiveReadLimit: i = 8192 } = {}) {
|
|
125
|
+
const s = Object.create(h);
|
|
126
|
+
return s.bytes = t, s.dataView = new DataView(t.buffer, t.byteOffset, t.byteLength), s.positionReadCount = /* @__PURE__ */ new Map(), s.recursiveReadLimit = i, s;
|
|
127
|
+
}
|
|
128
|
+
export {
|
|
129
|
+
a as createCursor
|
|
130
|
+
};
|
package/dist/index62.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index59.cjs");function i(n){const r=Object.entries(n).map(([a,e])=>e===void 0||e===!1?null:[a,e]).filter(Boolean),o=r.reduce((a,[e])=>Math.max(a,e.length),0);return r.map(([a,e])=>` ${`${a}:`.padEnd(o+1)} ${e}`).join(`
|
|
2
|
+
`)}class s extends t.BaseError{constructor({v:r}){super(`Invalid \`v\` value "${r}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class c extends t.BaseError{constructor({transaction:r}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",i(r),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class l extends t.BaseError{constructor({storageKey:r}){super(`Size for storage key "${r}" is invalid. Expected 32 bytes. Got ${Math.floor((r.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}exports.InvalidLegacyVError=s;exports.InvalidSerializableTransactionError=c;exports.InvalidStorageKeySizeError=l;exports.prettyPrint=i;
|
package/dist/index62.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BaseError as t } from "./index59.js";
|
|
2
|
+
function i(n) {
|
|
3
|
+
const r = Object.entries(n).map(([a, e]) => e === void 0 || e === !1 ? null : [a, e]).filter(Boolean), o = r.reduce((a, [e]) => Math.max(a, e.length), 0);
|
|
4
|
+
return r.map(([a, e]) => ` ${`${a}:`.padEnd(o + 1)} ${e}`).join(`
|
|
5
|
+
`);
|
|
6
|
+
}
|
|
7
|
+
class c extends t {
|
|
8
|
+
constructor({ v: r }) {
|
|
9
|
+
super(`Invalid \`v\` value "${r}". Expected 27 or 28.`, {
|
|
10
|
+
name: "InvalidLegacyVError"
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
class d extends t {
|
|
15
|
+
constructor({ transaction: r }) {
|
|
16
|
+
super("Cannot infer a transaction type from provided transaction.", {
|
|
17
|
+
metaMessages: [
|
|
18
|
+
"Provided Transaction:",
|
|
19
|
+
"{",
|
|
20
|
+
i(r),
|
|
21
|
+
"}",
|
|
22
|
+
"",
|
|
23
|
+
"To infer the type, either provide:",
|
|
24
|
+
"- a `type` to the Transaction, or",
|
|
25
|
+
"- an EIP-1559 Transaction with `maxFeePerGas`, or",
|
|
26
|
+
"- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
|
|
27
|
+
"- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or",
|
|
28
|
+
"- an EIP-7702 Transaction with `authorizationList`, or",
|
|
29
|
+
"- a Legacy Transaction with `gasPrice`"
|
|
30
|
+
],
|
|
31
|
+
name: "InvalidSerializableTransactionError"
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
class l extends t {
|
|
36
|
+
constructor({ storageKey: r }) {
|
|
37
|
+
super(`Size for storage key "${r}" is invalid. Expected 32 bytes. Got ${Math.floor((r.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
c as InvalidLegacyVError,
|
|
42
|
+
d as InvalidSerializableTransactionError,
|
|
43
|
+
l as InvalidStorageKeySizeError,
|
|
44
|
+
i as prettyPrint
|
|
45
|
+
};
|
package/dist/index63.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index58.cjs"),l=require("./index45.cjs");function c(o){const{kzg:s}=o,n=o.to??(typeof o.blobs[0]=="string"?"hex":"bytes"),e=typeof o.blobs[0]=="string"?o.blobs.map(t=>i.hexToBytes(t)):o.blobs,b=[];for(const t of e)b.push(Uint8Array.from(s.blobToKzgCommitment(t)));return n==="bytes"?b:b.map(t=>l.bytesToHex(t))}exports.blobsToCommitments=c;
|
package/dist/index63.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { hexToBytes as i } from "./index58.js";
|
|
2
|
+
import { bytesToHex as f } from "./index45.js";
|
|
3
|
+
function y(o) {
|
|
4
|
+
const { kzg: s } = o, n = o.to ?? (typeof o.blobs[0] == "string" ? "hex" : "bytes"), m = typeof o.blobs[0] == "string" ? o.blobs.map((t) => i(t)) : o.blobs, b = [];
|
|
5
|
+
for (const t of m)
|
|
6
|
+
b.push(Uint8Array.from(s.blobToKzgCommitment(t)));
|
|
7
|
+
return n === "bytes" ? b : b.map((t) => f(t));
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
y as blobsToCommitments
|
|
11
|
+
};
|
package/dist/index64.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index58.cjs"),y=require("./index45.cjs");function f(t){const{kzg:c}=t,e=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(o=>b.hexToBytes(o)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(o=>b.hexToBytes(o)):t.commitments,s=[];for(let o=0;o<n.length;o++){const l=n[o],m=i[o];s.push(Uint8Array.from(c.computeBlobKzgProof(l,m)))}return e==="bytes"?s:s.map(o=>y.bytesToHex(o))}exports.blobsToProofs=f;
|
package/dist/index64.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { hexToBytes as b } from "./index58.js";
|
|
2
|
+
import { bytesToHex as y } from "./index45.js";
|
|
3
|
+
function h(t) {
|
|
4
|
+
const { kzg: m } = t, c = t.to ?? (typeof t.blobs[0] == "string" ? "hex" : "bytes"), s = typeof t.blobs[0] == "string" ? t.blobs.map((o) => b(o)) : t.blobs, i = typeof t.commitments[0] == "string" ? t.commitments.map((o) => b(o)) : t.commitments, n = [];
|
|
5
|
+
for (let o = 0; o < s.length; o++) {
|
|
6
|
+
const f = s[o], l = i[o];
|
|
7
|
+
n.push(Uint8Array.from(m.computeBlobKzgProof(f, l)));
|
|
8
|
+
}
|
|
9
|
+
return c === "bytes" ? n : n.map((o) => y(o));
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
h as blobsToProofs
|
|
13
|
+
};
|
package/dist/index65.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index90.cjs");function c(o){const{commitments:e,version:s}=o,n=o.to??(typeof e[0]=="string"?"hex":"bytes"),t=[];for(const m of e)t.push(i.commitmentToVersionedHash({commitment:m,to:n,version:s}));return t}exports.commitmentsToVersionedHashes=c;
|
package/dist/index65.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { commitmentToVersionedHash as i } from "./index90.js";
|
|
2
|
+
function r(o) {
|
|
3
|
+
const { commitments: t, version: n } = o, e = o.to ?? (typeof t[0] == "string" ? "hex" : "bytes"), s = [];
|
|
4
|
+
for (const m of t)
|
|
5
|
+
s.push(i({
|
|
6
|
+
commitment: m,
|
|
7
|
+
to: e,
|
|
8
|
+
version: n
|
|
9
|
+
}));
|
|
10
|
+
return s;
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
r as commitmentsToVersionedHashes
|
|
14
|
+
};
|
package/dist/index66.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index63.cjs"),m=require("./index64.cjs"),u=require("./index91.cjs");function f(t){const{data:i,kzg:n,to:b}=t,s=t.blobs??u.toBlobs({data:i,to:b}),e=t.commitments??r.blobsToCommitments({blobs:s,kzg:n,to:b}),l=t.proofs??m.blobsToProofs({blobs:s,commitments:e,kzg:n,to:b}),c=[];for(let o=0;o<s.length;o++)c.push({blob:s[o],commitment:e[o],proof:l[o]});return c}exports.toBlobSidecars=f;
|
package/dist/index66.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { blobsToCommitments as f } from "./index63.js";
|
|
2
|
+
import { blobsToProofs as l } from "./index64.js";
|
|
3
|
+
import { toBlobs as p } from "./index91.js";
|
|
4
|
+
function k(t) {
|
|
5
|
+
const { data: i, kzg: n, to: m } = t, s = t.blobs ?? p({ data: i, to: m }), b = t.commitments ?? f({ blobs: s, kzg: n, to: m }), r = t.proofs ?? l({ blobs: s, commitments: b, kzg: n, to: m }), c = [];
|
|
6
|
+
for (let o = 0; o < s.length; o++)
|
|
7
|
+
c.push({
|
|
8
|
+
blob: s[o],
|
|
9
|
+
commitment: b[o],
|
|
10
|
+
proof: r[o]
|
|
11
|
+
});
|
|
12
|
+
return c;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
k as toBlobSidecars
|
|
16
|
+
};
|
package/dist/index67.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function g(e,{dir:i="left"}={}){let t=typeof e=="string"?e.replace("0x",""):e,n=0;for(let l=0;l<t.length-1&&t[i==="left"?l:t.length-l-1].toString()==="0";l++)n++;return t=i==="left"?t.slice(n):t.slice(0,t.length-n),typeof e=="string"?(t.length===1&&i==="right"&&(t=`${t}0`),`0x${t.length%2===1?`0${t}`:t}`):t}exports.trim=g;
|
package/dist/index67.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
function f(e, { dir: n = "left" } = {}) {
|
|
2
|
+
let t = typeof e == "string" ? e.replace("0x", "") : e, i = 0;
|
|
3
|
+
for (let l = 0; l < t.length - 1 && t[n === "left" ? l : t.length - l - 1].toString() === "0"; l++)
|
|
4
|
+
i++;
|
|
5
|
+
return t = n === "left" ? t.slice(i) : t.slice(0, t.length - i), typeof e == "string" ? (t.length === 1 && n === "right" && (t = `${t}0`), `0x${t.length % 2 === 1 ? `0${t}` : t}`) : t;
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
f as trim
|
|
9
|
+
};
|
package/dist/index68.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index45.cjs"),c=require("./index47.cjs");function u(t){if(!t||t.length===0)return[];const e=[];for(const o of t){const{contractAddress:n,chainId:s,nonce:r,...a}=o;e.push([i.toHex(s),n,r?i.toHex(r):"0x",...c.toYParitySignatureArray({},a)])}return e}exports.serializeAuthorizationList=u;
|
package/dist/index68.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { toHex as n } from "./index45.js";
|
|
2
|
+
import { toYParitySignatureArray as c } from "./index47.js";
|
|
3
|
+
function d(r) {
|
|
4
|
+
if (!r || r.length === 0)
|
|
5
|
+
return [];
|
|
6
|
+
const t = [];
|
|
7
|
+
for (const i of r) {
|
|
8
|
+
const { contractAddress: e, chainId: s, nonce: o, ...a } = i;
|
|
9
|
+
t.push([
|
|
10
|
+
n(s),
|
|
11
|
+
e,
|
|
12
|
+
o ? n(o) : "0x",
|
|
13
|
+
...c({}, a)
|
|
14
|
+
]);
|
|
15
|
+
}
|
|
16
|
+
return t;
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
d as serializeAuthorizationList
|
|
20
|
+
};
|
package/dist/index69.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./index92.cjs"),w=require("./index74.cjs"),t=require("./index42.cjs"),P=require("./index59.cjs"),h=require("./index93.cjs"),d=require("./index76.cjs"),n=require("./index77.cjs"),c=require("./index43.cjs"),I=require("./index49.cjs"),u=require("./index94.cjs"),l=require("./index30.cjs");function m(o){const{authorizationList:e}=o;if(e)for(const s of e){const{contractAddress:r,chainId:i}=s;if(!c.isAddress(r))throw new t.InvalidAddressError({address:r});if(i<=0)throw new d.InvalidChainIdError({chainId:i})}f(o)}function T(o){const{blobVersionedHashes:e}=o;if(e){if(e.length===0)throw new h.EmptyBlobError;for(const s of e){const r=I.size(s),i=l.hexToNumber(u.slice(s,0,1));if(r!==32)throw new h.InvalidVersionedHashSizeError({hash:s,size:r});if(i!==E.versionedHashVersionKzg)throw new h.InvalidVersionedHashVersionError({hash:s,version:i})}}f(o)}function f(o){const{chainId:e,maxPriorityFeePerGas:s,maxFeePerGas:r,to:i}=o;if(e<=0)throw new d.InvalidChainIdError({chainId:e});if(i&&!c.isAddress(i))throw new t.InvalidAddressError({address:i});if(r&&r>w.maxUint256)throw new n.FeeCapTooHighError({maxFeePerGas:r});if(s&&r&&s>r)throw new n.TipAboveFeeCapError({maxFeePerGas:r,maxPriorityFeePerGas:s})}function x(o){const{chainId:e,maxPriorityFeePerGas:s,gasPrice:r,maxFeePerGas:i,to:a}=o;if(e<=0)throw new d.InvalidChainIdError({chainId:e});if(a&&!c.isAddress(a))throw new t.InvalidAddressError({address:a});if(s||i)throw new P.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>w.maxUint256)throw new n.FeeCapTooHighError({maxFeePerGas:r})}function v(o){const{chainId:e,maxPriorityFeePerGas:s,gasPrice:r,maxFeePerGas:i,to:a}=o;if(a&&!c.isAddress(a))throw new t.InvalidAddressError({address:a});if(typeof e<"u"&&e<=0)throw new d.InvalidChainIdError({chainId:e});if(s||i)throw new P.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>w.maxUint256)throw new n.FeeCapTooHighError({maxFeePerGas:r})}exports.assertTransactionEIP1559=f;exports.assertTransactionEIP2930=x;exports.assertTransactionEIP4844=T;exports.assertTransactionEIP7702=m;exports.assertTransactionLegacy=v;
|
package/dist/index69.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { versionedHashVersionKzg as d } from "./index92.js";
|
|
2
|
+
import { maxUint256 as m } from "./index74.js";
|
|
3
|
+
import { InvalidAddressError as s } from "./index42.js";
|
|
4
|
+
import { BaseError as h } from "./index59.js";
|
|
5
|
+
import { EmptyBlobError as P, InvalidVersionedHashSizeError as p, InvalidVersionedHashVersionError as x } from "./index93.js";
|
|
6
|
+
import { InvalidChainIdError as n } from "./index76.js";
|
|
7
|
+
import { FeeCapTooHighError as w, TipAboveFeeCapError as E } from "./index77.js";
|
|
8
|
+
import { isAddress as f } from "./index43.js";
|
|
9
|
+
import { size as F } from "./index49.js";
|
|
10
|
+
import { slice as I } from "./index94.js";
|
|
11
|
+
import { hexToNumber as G } from "./index30.js";
|
|
12
|
+
function C(t) {
|
|
13
|
+
const { authorizationList: e } = t;
|
|
14
|
+
if (e)
|
|
15
|
+
for (const o of e) {
|
|
16
|
+
const { contractAddress: r, chainId: i } = o;
|
|
17
|
+
if (!f(r))
|
|
18
|
+
throw new s({ address: r });
|
|
19
|
+
if (i <= 0)
|
|
20
|
+
throw new n({ chainId: i });
|
|
21
|
+
}
|
|
22
|
+
c(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 !== d)
|
|
34
|
+
throw new x({
|
|
35
|
+
hash: o,
|
|
36
|
+
version: i
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
c(t);
|
|
41
|
+
}
|
|
42
|
+
function c(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 });
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
c as assertTransactionEIP1559,
|
|
77
|
+
B as assertTransactionEIP2930,
|
|
78
|
+
L as assertTransactionEIP4844,
|
|
79
|
+
C as assertTransactionEIP7702,
|
|
80
|
+
K as assertTransactionLegacy
|
|
81
|
+
};
|
package/dist/index7.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index3.cjs"),e=require("./index6.cjs"),o=(t,u,d)=>{const r=S(t.source_swap,u),a=S(t.destination_swap,d);if(a===e.SwapStatus.RedeemDetected)return e.OrderStatus.RedeemDetected;if(r===e.SwapStatus.Redeemed)return e.OrderStatus.CounterPartyRedeemed;if(r===e.SwapStatus.RedeemDetected)return e.OrderStatus.CounterPartyRedeemDetected;if(a===e.SwapStatus.Redeemed)return e.OrderStatus.Redeemed;if(r===e.SwapStatus.Refunded)return e.OrderStatus.Refunded;if(r===e.SwapStatus.RefundDetected)return e.OrderStatus.RefundDetected;if(a===e.SwapStatus.Expired)return e.OrderStatus.CounterPartySwapExpired;if(r===e.SwapStatus.Expired)return e.OrderStatus.Expired;if(a===e.SwapStatus.Refunded)return e.OrderStatus.CounterPartyRefunded;if(a===e.SwapStatus.RefundDetected)return e.OrderStatus.CounterPartyRefundDetected;const n=Number(t.create_order.additional_data.deadline);return a===e.SwapStatus.Initiated?e.OrderStatus.CounterPartyInitiated:a===e.SwapStatus.InitiateDetected?e.OrderStatus.CounterPartyInitiateDetected:i(n,12)?e.OrderStatus.DeadLineExceeded:r===e.SwapStatus.Initiated?e.OrderStatus.Initiated:i(n,1)?e.OrderStatus.DeadLineExceeded:r===e.SwapStatus.InitiateDetected?e.OrderStatus.InitiateDetected:e.OrderStatus.Matched},S=(t,u)=>{if(t.redeem_tx_hash)return Number(t.redeem_block_number)?e.SwapStatus.Redeemed:e.SwapStatus.RedeemDetected;if(t.refund_tx_hash)return Number(t.refund_block_number)?e.SwapStatus.Refunded:e.SwapStatus.RefundDetected;if(Number(t.initiate_block_number)){const d=Number(t.initiate_block_number)+t.timelock;if(u>d)return e.SwapStatus.Expired}return t.initiate_tx_hash?Number(t.initiate_block_number)?e.SwapStatus.Initiated:e.SwapStatus.InitiateDetected:e.SwapStatus.Idle},p=(t,u,d)=>{const r=o(t,u,d);return f(r)},f=t=>{switch(t){case e.OrderStatus.Matched:return s.OrderActions.Initiate;case e.OrderStatus.CounterPartyInitiated:case e.OrderStatus.CounterPartyInitiateDetected:case e.OrderStatus.RedeemDetected:return s.OrderActions.Redeem;case e.OrderStatus.Expired:return s.OrderActions.Refund;default:return s.OrderActions.Idle}},i=(t,u=0)=>{const d=Date.now(),r=t*1e3+u*36e5;return d>=r},m=t=>t.filter(u=>{const{source_swap:d,create_order:r}=u,{initiate_tx_hash:a,initiate_block_number:n}=d,{deadline:c}=r.additional_data;return a&&Number(n)?!0:a&&!Number(n)?!i(Number(c),12):a?!0:!i(Number(c),1)});exports.ParseOrderStatus=o;exports.ParseSwapStatus=S;exports.filterDeadlineExpiredOrders=m;exports.isExpired=i;exports.parseAction=p;exports.parseActionFromStatus=f;
|
package/dist/index7.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { OrderActions as c } from "./index3.js";
|
|
2
|
+
import { SwapStatus as t, OrderStatus as e } from "./index6.js";
|
|
3
|
+
const m = (r, d, u) => {
|
|
4
|
+
const n = s(
|
|
5
|
+
r.source_swap,
|
|
6
|
+
d
|
|
7
|
+
), i = s(
|
|
8
|
+
r.destination_swap,
|
|
9
|
+
u
|
|
10
|
+
);
|
|
11
|
+
if (i === t.RedeemDetected)
|
|
12
|
+
return e.RedeemDetected;
|
|
13
|
+
if (n === t.Redeemed)
|
|
14
|
+
return e.CounterPartyRedeemed;
|
|
15
|
+
if (n === t.RedeemDetected)
|
|
16
|
+
return e.CounterPartyRedeemDetected;
|
|
17
|
+
if (i === t.Redeemed) return e.Redeemed;
|
|
18
|
+
if (n === t.Refunded) return e.Refunded;
|
|
19
|
+
if (n === t.RefundDetected)
|
|
20
|
+
return e.RefundDetected;
|
|
21
|
+
if (i === t.Expired)
|
|
22
|
+
return e.CounterPartySwapExpired;
|
|
23
|
+
if (n === t.Expired) return e.Expired;
|
|
24
|
+
if (i === t.Refunded)
|
|
25
|
+
return e.CounterPartyRefunded;
|
|
26
|
+
if (i === t.RefundDetected)
|
|
27
|
+
return e.CounterPartyRefundDetected;
|
|
28
|
+
const a = Number(
|
|
29
|
+
r.create_order.additional_data.deadline
|
|
30
|
+
);
|
|
31
|
+
return i === t.Initiated ? e.CounterPartyInitiated : i === t.InitiateDetected ? e.CounterPartyInitiateDetected : o(a, 12) ? e.DeadLineExceeded : n === t.Initiated ? e.Initiated : o(a, 1) ? e.DeadLineExceeded : n === t.InitiateDetected ? e.InitiateDetected : e.Matched;
|
|
32
|
+
}, s = (r, d) => {
|
|
33
|
+
if (r.redeem_tx_hash)
|
|
34
|
+
return Number(r.redeem_block_number) ? t.Redeemed : t.RedeemDetected;
|
|
35
|
+
if (r.refund_tx_hash)
|
|
36
|
+
return Number(r.refund_block_number) ? t.Refunded : t.RefundDetected;
|
|
37
|
+
if (Number(r.initiate_block_number)) {
|
|
38
|
+
const u = Number(r.initiate_block_number) + r.timelock;
|
|
39
|
+
if (d > u) return t.Expired;
|
|
40
|
+
}
|
|
41
|
+
return r.initiate_tx_hash ? Number(r.initiate_block_number) ? t.Initiated : t.InitiateDetected : t.Idle;
|
|
42
|
+
}, D = (r, d, u) => {
|
|
43
|
+
const n = m(
|
|
44
|
+
r,
|
|
45
|
+
d,
|
|
46
|
+
u
|
|
47
|
+
);
|
|
48
|
+
return _(n);
|
|
49
|
+
}, _ = (r) => {
|
|
50
|
+
switch (r) {
|
|
51
|
+
case e.Matched:
|
|
52
|
+
return c.Initiate;
|
|
53
|
+
case e.CounterPartyInitiated:
|
|
54
|
+
case e.CounterPartyInitiateDetected:
|
|
55
|
+
case e.RedeemDetected:
|
|
56
|
+
return c.Redeem;
|
|
57
|
+
case e.Expired:
|
|
58
|
+
return c.Refund;
|
|
59
|
+
default:
|
|
60
|
+
return c.Idle;
|
|
61
|
+
}
|
|
62
|
+
}, o = (r, d = 0) => {
|
|
63
|
+
const u = Date.now(), n = r * 1e3 + d * 36e5;
|
|
64
|
+
return u >= n;
|
|
65
|
+
}, l = (r) => r.filter((d) => {
|
|
66
|
+
const { source_swap: u, create_order: n } = d, { initiate_tx_hash: i, initiate_block_number: a } = u, { deadline: f } = n.additional_data;
|
|
67
|
+
return i && Number(a) ? !0 : i && !Number(a) ? !o(Number(f), 12) : i ? !0 : !o(Number(f), 1);
|
|
68
|
+
});
|
|
69
|
+
export {
|
|
70
|
+
m as ParseOrderStatus,
|
|
71
|
+
s as ParseSwapStatus,
|
|
72
|
+
l as filterDeadlineExpiredOrders,
|
|
73
|
+
o as isExpired,
|
|
74
|
+
D as parseAction,
|
|
75
|
+
_ as parseActionFromStatus
|
|
76
|
+
};
|
package/dist/index70.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index62.cjs");function f(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new i.InvalidSerializableTransactionError({transaction:e})}exports.getTransactionType=f;
|
package/dist/index70.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { InvalidSerializableTransactionError as f } from "./index62.js";
|
|
2
|
+
function d(e) {
|
|
3
|
+
if (e.type)
|
|
4
|
+
return e.type;
|
|
5
|
+
if (typeof e.authorizationList < "u")
|
|
6
|
+
return "eip7702";
|
|
7
|
+
if (typeof e.blobs < "u" || typeof e.blobVersionedHashes < "u" || typeof e.maxFeePerBlobGas < "u" || typeof e.sidecars < "u")
|
|
8
|
+
return "eip4844";
|
|
9
|
+
if (typeof e.maxFeePerGas < "u" || typeof e.maxPriorityFeePerGas < "u")
|
|
10
|
+
return "eip1559";
|
|
11
|
+
if (typeof e.gasPrice < "u")
|
|
12
|
+
return typeof e.accessList < "u" ? "eip2930" : "legacy";
|
|
13
|
+
throw new f({ transaction: e });
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
d as getTransactionType
|
|
17
|
+
};
|
package/dist/index71.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index42.cjs"),d=require("./index62.cjs"),l=require("./index43.cjs");function a(e){if(!e||e.length===0)return[];const n=[];for(let t=0;t<e.length;t++){const{address:i,storageKeys:r}=e[t];for(let s=0;s<r.length;s++)if(r[s].length-2!==64)throw new d.InvalidStorageKeySizeError({storageKey:r[s]});if(!l.isAddress(i,{strict:!1}))throw new o.InvalidAddressError({address:i});n.push([i,r])}return n}exports.serializeAccessList=a;
|
package/dist/index71.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InvalidAddressError as s } from "./index42.js";
|
|
2
|
+
import { InvalidStorageKeySizeError as l } from "./index62.js";
|
|
3
|
+
import { isAddress as f } from "./index43.js";
|
|
4
|
+
function a(r) {
|
|
5
|
+
if (!r || r.length === 0)
|
|
6
|
+
return [];
|
|
7
|
+
const n = [];
|
|
8
|
+
for (let o = 0; o < r.length; o++) {
|
|
9
|
+
const { address: i, storageKeys: e } = r[o];
|
|
10
|
+
for (let t = 0; t < e.length; t++)
|
|
11
|
+
if (e[t].length - 2 !== 64)
|
|
12
|
+
throw new l({ storageKey: e[t] });
|
|
13
|
+
if (!f(i, { strict: !1 }))
|
|
14
|
+
throw new s({ address: i });
|
|
15
|
+
n.push([i, e]);
|
|
16
|
+
}
|
|
17
|
+
return n;
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
a as serializeAccessList
|
|
21
|
+
};
|
package/dist/index72.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class i extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&t!==void 0&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const s=this.keys().next().value;s&&this.delete(s)}return this}}exports.LruMap=i;
|
package/dist/index72.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
class r extends Map {
|
|
2
|
+
constructor(e) {
|
|
3
|
+
super(), Object.defineProperty(this, "maxSize", {
|
|
4
|
+
enumerable: !0,
|
|
5
|
+
configurable: !0,
|
|
6
|
+
writable: !0,
|
|
7
|
+
value: void 0
|
|
8
|
+
}), this.maxSize = e;
|
|
9
|
+
}
|
|
10
|
+
get(e) {
|
|
11
|
+
const t = super.get(e);
|
|
12
|
+
return super.has(e) && t !== void 0 && (this.delete(e), super.set(e, t)), t;
|
|
13
|
+
}
|
|
14
|
+
set(e, t) {
|
|
15
|
+
if (super.set(e, t), this.maxSize && this.size > this.maxSize) {
|
|
16
|
+
const s = this.keys().next().value;
|
|
17
|
+
s && this.delete(s);
|
|
18
|
+
}
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
r as LruMap
|
|
24
|
+
};
|
package/dist/index73.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index58.cjs"),a=require("./index96.cjs"),f=require("./index72.cjs"),o=new f.LruMap(8192);function k(t,r){if(o.has(`${t}.${r}`))return o.get(`${t}.${r}`);const c=t.substring(2).toLowerCase(),n=a.keccak256(i.stringToBytes(c)),s=c.split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&s[e]&&(s[e]=s[e].toUpperCase()),(n[e>>1]&15)>=8&&s[e+1]&&(s[e+1]=s[e+1].toUpperCase());const u=`0x${s.join("")}`;return o.set(`${t}.${r}`,u),u}exports.checksumAddress=k;
|
package/dist/index73.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { stringToBytes as p } from "./index58.js";
|
|
2
|
+
import { keccak256 as f } from "./index96.js";
|
|
3
|
+
import { LruMap as m } from "./index72.js";
|
|
4
|
+
const r = /* @__PURE__ */ new m(8192);
|
|
5
|
+
function a(s, o) {
|
|
6
|
+
if (r.has(`${s}.${o}`))
|
|
7
|
+
return r.get(`${s}.${o}`);
|
|
8
|
+
const c = s.substring(2).toLowerCase(), n = f(p(c)), e = c.split("");
|
|
9
|
+
for (let t = 0; t < 40; t += 2)
|
|
10
|
+
n[t >> 1] >> 4 >= 8 && e[t] && (e[t] = e[t].toUpperCase()), (n[t >> 1] & 15) >= 8 && e[t + 1] && (e[t + 1] = e[t + 1].toUpperCase());
|
|
11
|
+
const i = `0x${e.join("")}`;
|
|
12
|
+
return r.set(`${s}.${o}`, i), i;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
a as checksumAddress
|
|
16
|
+
};
|
package/dist/index74.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=2n**256n-1n;exports.maxUint256=t;
|
package/dist/index74.js
ADDED
package/dist/index75.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="2.21.30";exports.version=e;
|
package/dist/index75.js
ADDED
package/dist/index76.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index59.cjs");class i extends e.BaseError{constructor({chainId:r}){super(typeof r=="number"?`Chain ID "${r}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}exports.InvalidChainIdError=i;
|
package/dist/index76.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseError as i } from "./index59.js";
|
|
2
|
+
class o extends i {
|
|
3
|
+
constructor({ chainId: r }) {
|
|
4
|
+
super(typeof r == "number" ? `Chain ID "${r}" is invalid.` : "Chain ID is invalid.", { name: "InvalidChainIdError" });
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
o as InvalidChainIdError
|
|
9
|
+
};
|
package/dist/index77.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index78.cjs"),t=require("./index59.cjs");class i extends t.BaseError{constructor({cause:r,maxFeePerGas:e}={}){super(`The fee cap (\`maxFeePerGas\`${e?` = ${a.formatGwei(e)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:r,name:"FeeCapTooHighError"})}}Object.defineProperty(i,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class n extends t.BaseError{constructor({cause:r,maxPriorityFeePerGas:e,maxFeePerGas:o}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${e?` = ${a.formatGwei(e)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${o?` = ${a.formatGwei(o)} gwei`:""}).`].join(`
|
|
2
|
+
`),{cause:r,name:"TipAboveFeeCapError"})}}Object.defineProperty(n,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});exports.FeeCapTooHighError=i;exports.TipAboveFeeCapError=n;
|
package/dist/index77.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { formatGwei as a } from "./index78.js";
|
|
2
|
+
import { BaseError as o } from "./index59.js";
|
|
3
|
+
class n extends o {
|
|
4
|
+
constructor({ cause: r, maxFeePerGas: e } = {}) {
|
|
5
|
+
super(`The fee cap (\`maxFeePerGas\`${e ? ` = ${a(e)} gwei` : ""}) cannot be higher than the maximum allowed value (2^256-1).`, {
|
|
6
|
+
cause: r,
|
|
7
|
+
name: "FeeCapTooHighError"
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(n, "nodeMessage", {
|
|
12
|
+
enumerable: !0,
|
|
13
|
+
configurable: !0,
|
|
14
|
+
writable: !0,
|
|
15
|
+
value: /max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/
|
|
16
|
+
});
|
|
17
|
+
class h extends o {
|
|
18
|
+
constructor({ cause: r, maxPriorityFeePerGas: e, maxFeePerGas: t } = {}) {
|
|
19
|
+
super([
|
|
20
|
+
`The provided tip (\`maxPriorityFeePerGas\`${e ? ` = ${a(e)} gwei` : ""}) cannot be higher than the fee cap (\`maxFeePerGas\`${t ? ` = ${a(t)} gwei` : ""}).`
|
|
21
|
+
].join(`
|
|
22
|
+
`), {
|
|
23
|
+
cause: r,
|
|
24
|
+
name: "TipAboveFeeCapError"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(h, "nodeMessage", {
|
|
29
|
+
enumerable: !0,
|
|
30
|
+
configurable: !0,
|
|
31
|
+
writable: !0,
|
|
32
|
+
value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/
|
|
33
|
+
});
|
|
34
|
+
export {
|
|
35
|
+
n as FeeCapTooHighError,
|
|
36
|
+
h as TipAboveFeeCapError
|
|
37
|
+
};
|
package/dist/index78.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index97.cjs"),r=require("./index98.cjs");function n(t,e="wei"){return r.formatUnits(t,i.gweiUnits[e])}exports.formatGwei=n;
|