@gardenfi/swap 0.1.2 → 0.1.3-beta.10
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/index113.cjs +1 -1
- package/dist/index113.js +1 -1
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +1 -1
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +1 -1
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +1 -1
- package/dist/index120.cjs +1 -1
- package/dist/index120.js +2 -2
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +7 -7
- package/dist/index126.cjs +1 -1
- package/dist/index126.js +2 -2
- package/dist/index127.cjs +1 -1
- package/dist/index127.js +1 -1
- package/dist/index128.cjs +1 -1
- package/dist/index128.js +1 -1
- package/dist/index129.cjs +1 -1
- package/dist/index129.js +1 -1
- package/dist/index130.cjs +1 -1
- package/dist/index130.js +2 -2
- package/dist/index138.cjs +1 -1
- package/dist/index138.js +1 -1
- package/dist/index140.cjs +1 -1
- package/dist/index140.js +1 -1
- package/dist/index148.cjs +1 -1
- package/dist/index148.js +1 -1
- package/dist/index149.cjs +1 -1
- package/dist/index149.js +1 -1
- package/dist/index154.cjs +1 -1
- package/dist/index154.js +1 -1
- package/dist/index162.cjs +1 -1
- package/dist/index162.js +2 -2
- package/dist/index173.cjs +1 -1
- package/dist/index173.js +2 -2
- package/dist/index303.cjs +1 -1
- package/dist/index303.js +10 -43
- package/dist/index304.cjs +1 -1
- package/dist/index304.js +16 -320
- package/dist/index305.cjs +1 -1
- package/dist/index305.js +21 -604
- package/dist/index306.cjs +1 -1
- package/dist/index306.js +14 -110
- package/dist/index307.cjs +1 -1
- package/dist/index307.js +13 -167
- package/dist/index308.cjs +1 -1
- package/dist/index308.js +13 -300
- package/dist/index309.cjs +1 -1
- package/dist/index309.js +9 -93
- package/dist/index310.cjs +1 -1
- package/dist/index310.js +13 -54
- package/dist/index311.cjs +1 -1
- package/dist/index311.js +23 -51
- package/dist/index312.cjs +1 -1
- package/dist/index312.js +30 -43
- package/dist/index313.cjs +2 -1
- package/dist/index313.js +18 -15
- package/dist/index314.cjs +1 -1
- package/dist/index314.js +14 -317
- package/dist/index315.cjs +1 -1
- package/dist/index315.js +41 -58
- package/dist/index316.cjs +1 -1
- package/dist/index316.js +319 -18
- package/dist/index317.cjs +1 -1
- package/dist/index317.js +602 -26
- package/dist/index318.cjs +1 -1
- package/dist/index318.js +110 -4
- package/dist/index319.cjs +1 -7
- package/dist/index319.js +166 -236
- package/dist/index320.cjs +1 -1
- package/dist/index320.js +302 -48
- package/dist/index321.cjs +1 -1
- package/dist/index321.js +92 -211
- package/dist/index322.cjs +1 -1
- package/dist/index322.js +49 -74
- package/dist/index323.cjs +1 -1
- package/dist/index323.js +51 -27
- package/dist/index324.cjs +1 -1
- package/dist/index324.js +42 -74
- package/dist/index325.cjs +1 -1
- package/dist/index325.js +15 -9
- package/dist/index326.cjs +1 -1
- package/dist/index326.js +317 -16
- package/dist/index327.cjs +1 -1
- package/dist/index327.js +57 -20
- package/dist/index328.cjs +1 -1
- package/dist/index328.js +18 -12
- package/dist/index329.cjs +1 -1
- package/dist/index329.js +29 -13
- package/dist/index330.cjs +1 -1
- package/dist/index330.js +3 -14
- package/dist/index331.cjs +7 -1
- package/dist/index331.js +237 -9
- package/dist/index332.cjs +1 -1
- package/dist/index332.js +48 -16
- package/dist/index333.cjs +1 -1
- package/dist/index333.js +209 -22
- package/dist/index334.cjs +1 -1
- package/dist/index334.js +80 -30
- package/dist/index335.cjs +1 -2
- package/dist/index335.js +29 -18
- package/dist/index336.cjs +1 -1
- package/dist/index336.js +75 -13
- package/dist/index361.cjs +1 -1
- package/dist/index361.js +3 -94
- package/dist/index362.cjs +1 -1
- package/dist/index362.js +137 -25
- package/dist/index363.cjs +1 -1
- package/dist/index363.js +129 -144
- package/dist/index364.cjs +1 -1
- package/dist/index364.js +71 -331
- package/dist/index365.cjs +1 -1
- package/dist/index365.js +27 -72
- package/dist/index366.cjs +1 -1
- package/dist/index366.js +148 -31
- package/dist/index367.cjs +1 -1
- package/dist/index367.js +354 -5
- package/dist/index368.cjs +1 -1
- package/dist/index368.js +275 -3
- package/dist/index369.cjs +1 -1
- package/dist/index369.js +170 -140
- package/dist/index370.cjs +1 -1
- package/dist/index370.js +10 -276
- package/dist/index371.cjs +1 -1
- package/dist/index371.js +107 -170
- package/dist/index372.cjs +1 -1
- package/dist/index372.js +6 -10
- package/dist/index373.cjs +1 -1
- package/dist/index373.js +70 -104
- package/dist/index374.cjs +1 -1
- package/dist/index374.js +2 -2
- package/dist/index375.cjs +1 -1
- package/dist/index375.js +29 -131
- package/dist/index383.cjs +1 -1
- package/dist/index383.js +59 -106
- package/dist/index384.cjs +1 -1
- package/dist/index384.js +110 -3
- package/dist/index385.cjs +1 -1
- package/dist/index385.js +3 -63
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +42 -42
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +13 -13
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +16 -14
- package/dist/src/lib/store/swapStore.d.ts +1 -1
- package/package.json +5 -5
package/dist/index363.js
CHANGED
|
@@ -1,151 +1,136 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { BaseError as d } from "./index278.js";
|
|
2
|
+
import { keccak256 as v } from "./index347.js";
|
|
3
|
+
import { validate as $, slice as A, fromString as S } from "./index277.js";
|
|
4
|
+
import { isArgOfType as E, normalizeSignature as m, getAmbiguousTypes as B } from "./index383.js";
|
|
5
|
+
import { parseAbiItem as y } from "./index292.js";
|
|
6
|
+
import { formatAbiItem as p } from "./index285.js";
|
|
7
|
+
function H(r, t = {}) {
|
|
8
|
+
const { prepare: i = !0 } = t, n = Array.isArray(r) ? y(r) : typeof r == "string" ? y(r) : r;
|
|
9
|
+
return {
|
|
10
|
+
...n,
|
|
11
|
+
...i ? { hash: f(n) } : {}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function h(r, t, i) {
|
|
15
|
+
const { args: n = [], prepare: u = !0 } = i ?? {}, w = $(t, { strict: !1 }), s = r.filter((e) => w ? e.type === "function" || e.type === "error" ? T(e) === A(t, 0, 4) : e.type === "event" ? f(e) === t : !1 : "name" in e && e.name === t);
|
|
16
|
+
if (s.length === 0)
|
|
17
|
+
throw new b({ name: t });
|
|
18
|
+
if (s.length === 1)
|
|
19
|
+
return {
|
|
20
|
+
...s[0],
|
|
21
|
+
...u ? { hash: f(s[0]) } : {}
|
|
22
|
+
};
|
|
23
|
+
let o;
|
|
24
|
+
for (const e of s) {
|
|
25
|
+
if (!("inputs" in e))
|
|
26
|
+
continue;
|
|
27
|
+
if (!n || n.length === 0) {
|
|
28
|
+
if (!e.inputs || e.inputs.length === 0)
|
|
29
|
+
return {
|
|
30
|
+
...e,
|
|
31
|
+
...u ? { hash: f(e) } : {}
|
|
32
|
+
};
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (!e.inputs || e.inputs.length === 0 || e.inputs.length !== n.length)
|
|
36
|
+
continue;
|
|
37
|
+
if (n.every((a, I) => {
|
|
38
|
+
const l = "inputs" in e && e.inputs[I];
|
|
39
|
+
return l ? E(a, l) : !1;
|
|
40
|
+
})) {
|
|
41
|
+
if (o && "inputs" in o && o.inputs) {
|
|
42
|
+
const a = B(e.inputs, o.inputs, n);
|
|
43
|
+
if (a)
|
|
44
|
+
throw new O({
|
|
45
|
+
abiItem: e,
|
|
46
|
+
type: a[0]
|
|
47
|
+
}, {
|
|
48
|
+
abiItem: o,
|
|
49
|
+
type: a[1]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
o = e;
|
|
25
53
|
}
|
|
26
54
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Write a U256 value into a buffer and shift cursor position by 16.
|
|
90
|
-
*
|
|
91
|
-
* @param {bigint} value Value to write.
|
|
92
|
-
* @returns {this}
|
|
93
|
-
*/
|
|
94
|
-
write256(t) {
|
|
95
|
-
return h(BigInt(t), 32).forEach((i) => this.write8(i)), this;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Write a ULEB value into a buffer and shift cursor position by number of bytes
|
|
99
|
-
* written.
|
|
100
|
-
* @param {Number} value Value to write.
|
|
101
|
-
* @returns {this}
|
|
102
|
-
*/
|
|
103
|
-
writeULEB(t) {
|
|
104
|
-
return n(t).forEach((i) => this.write8(i)), this;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Write a vector into a buffer by first writing the vector length and then calling
|
|
108
|
-
* a callback on each passed value.
|
|
109
|
-
*
|
|
110
|
-
* @param {Array<Any>} vector Array of elements to write.
|
|
111
|
-
* @param {WriteVecCb} cb Callback to call on each element of the vector.
|
|
112
|
-
* @returns {this}
|
|
113
|
-
*/
|
|
114
|
-
writeVec(t, i) {
|
|
115
|
-
return this.writeULEB(t.length), Array.from(t).forEach((e, s) => i(this, e, s, t.length)), this;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Adds support for iterations over the object.
|
|
119
|
-
* @returns {Uint8Array}
|
|
120
|
-
*/
|
|
121
|
-
// oxlint-disable-next-line require-yields
|
|
122
|
-
*[Symbol.iterator]() {
|
|
123
|
-
for (let t = 0; t < this.bytePosition; t++)
|
|
124
|
-
yield this.dataView.getUint8(t);
|
|
125
|
-
return this.toBytes();
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Get underlying buffer taking only value bytes (in case initial buffer size was bigger).
|
|
129
|
-
* @returns {Uint8Array} Resulting bcs.
|
|
130
|
-
*/
|
|
131
|
-
toBytes() {
|
|
132
|
-
return new Uint8Array(this.dataView.buffer.slice(0, this.bytePosition));
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Represent data as 'hex' or 'base64'
|
|
136
|
-
* @param encoding Encoding to use: 'base64' or 'hex'
|
|
137
|
-
*/
|
|
138
|
-
toString(t) {
|
|
139
|
-
return o(this.toBytes(), t);
|
|
55
|
+
const c = (() => {
|
|
56
|
+
if (o)
|
|
57
|
+
return o;
|
|
58
|
+
const [e, ...g] = s;
|
|
59
|
+
return { ...e, overloads: g };
|
|
60
|
+
})();
|
|
61
|
+
if (!c)
|
|
62
|
+
throw new b({ name: t });
|
|
63
|
+
return {
|
|
64
|
+
...c,
|
|
65
|
+
...u ? { hash: f(c) } : {}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function T(...r) {
|
|
69
|
+
const t = (() => {
|
|
70
|
+
if (Array.isArray(r[0])) {
|
|
71
|
+
const [i, n] = r;
|
|
72
|
+
return h(i, n);
|
|
73
|
+
}
|
|
74
|
+
return r[0];
|
|
75
|
+
})();
|
|
76
|
+
return A(f(t), 0, 4);
|
|
77
|
+
}
|
|
78
|
+
function F(...r) {
|
|
79
|
+
const t = (() => {
|
|
80
|
+
if (Array.isArray(r[0])) {
|
|
81
|
+
const [n, u] = r;
|
|
82
|
+
return h(n, u);
|
|
83
|
+
}
|
|
84
|
+
return r[0];
|
|
85
|
+
})(), i = typeof t == "string" ? t : p(t);
|
|
86
|
+
return m(i);
|
|
87
|
+
}
|
|
88
|
+
function f(...r) {
|
|
89
|
+
const t = (() => {
|
|
90
|
+
if (Array.isArray(r[0])) {
|
|
91
|
+
const [i, n] = r;
|
|
92
|
+
return h(i, n);
|
|
93
|
+
}
|
|
94
|
+
return r[0];
|
|
95
|
+
})();
|
|
96
|
+
return typeof t != "string" && "hash" in t && t.hash ? t.hash : v(S(F(t)));
|
|
97
|
+
}
|
|
98
|
+
class O extends d {
|
|
99
|
+
constructor(t, i) {
|
|
100
|
+
super("Found ambiguous types in overloaded ABI Items.", {
|
|
101
|
+
metaMessages: [
|
|
102
|
+
// TODO: abitype to add support for signature-formatted ABI items.
|
|
103
|
+
`\`${t.type}\` in \`${m(p(t.abiItem))}\`, and`,
|
|
104
|
+
`\`${i.type}\` in \`${m(p(i.abiItem))}\``,
|
|
105
|
+
"",
|
|
106
|
+
"These types encode differently and cannot be distinguished at runtime.",
|
|
107
|
+
"Remove one of the ambiguous items in the ABI."
|
|
108
|
+
]
|
|
109
|
+
}), Object.defineProperty(this, "name", {
|
|
110
|
+
enumerable: !0,
|
|
111
|
+
configurable: !0,
|
|
112
|
+
writable: !0,
|
|
113
|
+
value: "AbiItem.AmbiguityError"
|
|
114
|
+
});
|
|
140
115
|
}
|
|
141
116
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
117
|
+
class b extends d {
|
|
118
|
+
constructor({ name: t, data: i, type: n = "item" }) {
|
|
119
|
+
const u = t ? ` with name "${t}"` : i ? ` with data "${i}"` : "";
|
|
120
|
+
super(`ABI ${n}${u} not found.`), Object.defineProperty(this, "name", {
|
|
121
|
+
enumerable: !0,
|
|
122
|
+
configurable: !0,
|
|
123
|
+
writable: !0,
|
|
124
|
+
value: "AbiItem.NotFoundError"
|
|
125
|
+
});
|
|
126
|
+
}
|
|
148
127
|
}
|
|
149
128
|
export {
|
|
150
|
-
|
|
129
|
+
O as AmbiguityError,
|
|
130
|
+
b as NotFoundError,
|
|
131
|
+
H as from,
|
|
132
|
+
h as fromAbi,
|
|
133
|
+
T as getSelector,
|
|
134
|
+
F as getSignature,
|
|
135
|
+
f as getSignatureHash
|
|
151
136
|
};
|
package/dist/index364.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 r=require("./index365.cjs");class n{constructor(t){this.bytePosition=0,this.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength)}shift(t){return this.bytePosition+=t,this}read8(){const t=this.dataView.getUint8(this.bytePosition);return this.shift(1),t}read16(){const t=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),t}read32(){const t=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),t}read64(){const t=this.read32(),e=this.read32().toString(16)+t.toString(16).padStart(8,"0");return BigInt("0x"+e).toString(10)}read128(){const t=BigInt(this.read64()),e=BigInt(this.read64()).toString(16)+t.toString(16).padStart(16,"0");return BigInt("0x"+e).toString(10)}read256(){const t=BigInt(this.read128()),e=BigInt(this.read128()).toString(16)+t.toString(16).padStart(32,"0");return BigInt("0x"+e).toString(10)}readBytes(t){const i=this.bytePosition+this.dataView.byteOffset,e=new Uint8Array(this.dataView.buffer,i,t);return this.shift(t),e}readULEB(){const t=this.bytePosition+this.dataView.byteOffset,i=new Uint8Array(this.dataView.buffer,t),{value:e,length:s}=r.ulebDecode(i);return this.shift(s),e}readVec(t){const i=this.readULEB(),e=[];for(let s=0;s<i;s++)e.push(t(this,s,i));return e}}exports.BcsReader=n;
|