@mortiseagentvault/mcp 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -4
- package/dist/main.js +821 -240
- package/package.json +4 -2
package/dist/main.js
CHANGED
|
@@ -1361,14 +1361,14 @@ function pad(hexOrBytes, { dir, size: size5 = 32 } = {}) {
|
|
|
1361
1361
|
function padHex(hex_, { dir, size: size5 = 32 } = {}) {
|
|
1362
1362
|
if (size5 === null)
|
|
1363
1363
|
return hex_;
|
|
1364
|
-
const
|
|
1365
|
-
if (
|
|
1364
|
+
const hex4 = hex_.startsWith("0x") ? hex_.slice(2) : hex_.replace("0x", "");
|
|
1365
|
+
if (hex4.length > size5 * 2)
|
|
1366
1366
|
throw new SizeExceedsPaddingSizeError({
|
|
1367
|
-
size: Math.ceil(
|
|
1367
|
+
size: Math.ceil(hex4.length / 2),
|
|
1368
1368
|
targetSize: size5,
|
|
1369
1369
|
type: "hex"
|
|
1370
1370
|
});
|
|
1371
|
-
return `0x${
|
|
1371
|
+
return `0x${hex4[dir === "right" ? "padEnd" : "padStart"](size5 * 2, "0")}`;
|
|
1372
1372
|
}
|
|
1373
1373
|
function padBytes(bytes, { dir, size: size5 = 32 } = {}) {
|
|
1374
1374
|
if (size5 === null)
|
|
@@ -1415,8 +1415,8 @@ var init_encoding = __esm({
|
|
|
1415
1415
|
}
|
|
1416
1416
|
};
|
|
1417
1417
|
InvalidHexBooleanError = class extends BaseError2 {
|
|
1418
|
-
constructor(
|
|
1419
|
-
super(`Hex value "${
|
|
1418
|
+
constructor(hex4) {
|
|
1419
|
+
super(`Hex value "${hex4}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`, { name: "InvalidHexBooleanError" });
|
|
1420
1420
|
}
|
|
1421
1421
|
};
|
|
1422
1422
|
InvalidHexValueError = class extends BaseError2 {
|
|
@@ -1498,41 +1498,41 @@ function assertSize(hexOrBytes, { size: size5 }) {
|
|
|
1498
1498
|
maxSize: size5
|
|
1499
1499
|
});
|
|
1500
1500
|
}
|
|
1501
|
-
function hexToBigInt(
|
|
1501
|
+
function hexToBigInt(hex4, opts = {}) {
|
|
1502
1502
|
const { signed } = opts;
|
|
1503
1503
|
if (opts.size)
|
|
1504
|
-
assertSize(
|
|
1505
|
-
const value = BigInt(
|
|
1504
|
+
assertSize(hex4, { size: opts.size });
|
|
1505
|
+
const value = BigInt(hex4);
|
|
1506
1506
|
if (!signed)
|
|
1507
1507
|
return value;
|
|
1508
|
-
const size5 = Math.ceil((
|
|
1508
|
+
const size5 = Math.ceil((hex4.length - 2) / 2);
|
|
1509
1509
|
const max = (1n << BigInt(size5) * 8n - 1n) - 1n;
|
|
1510
1510
|
if (value <= max)
|
|
1511
1511
|
return value;
|
|
1512
|
-
if (typeof
|
|
1512
|
+
if (typeof hex4 === "string" && hex4.startsWith("0x"))
|
|
1513
1513
|
return BigInt.asIntN(size5 * 8, value);
|
|
1514
1514
|
return value - BigInt(`0x${"f".padStart(size5 * 2, "f")}`) - 1n;
|
|
1515
1515
|
}
|
|
1516
1516
|
function hexToBool(hex_, opts = {}) {
|
|
1517
|
-
let
|
|
1517
|
+
let hex4 = hex_;
|
|
1518
1518
|
if (opts.size) {
|
|
1519
|
-
assertSize(
|
|
1520
|
-
|
|
1519
|
+
assertSize(hex4, { size: opts.size });
|
|
1520
|
+
hex4 = trim(hex4);
|
|
1521
1521
|
}
|
|
1522
|
-
if (trim(
|
|
1522
|
+
if (trim(hex4) === "0x00")
|
|
1523
1523
|
return false;
|
|
1524
|
-
if (trim(
|
|
1524
|
+
if (trim(hex4) === "0x01")
|
|
1525
1525
|
return true;
|
|
1526
|
-
throw new InvalidHexBooleanError(
|
|
1526
|
+
throw new InvalidHexBooleanError(hex4);
|
|
1527
1527
|
}
|
|
1528
|
-
function hexToNumber(
|
|
1528
|
+
function hexToNumber(hex4, opts = {}) {
|
|
1529
1529
|
const { signed, size: size5 } = opts;
|
|
1530
|
-
if (!signed && !size5 && typeof
|
|
1531
|
-
const number5 = Number(
|
|
1530
|
+
if (!signed && !size5 && typeof hex4 === "string" && hex4.startsWith("0x")) {
|
|
1531
|
+
const number5 = Number(hex4);
|
|
1532
1532
|
if (Number.isSafeInteger(number5))
|
|
1533
1533
|
return number5;
|
|
1534
1534
|
}
|
|
1535
|
-
const value = hexToBigInt(
|
|
1535
|
+
const value = hexToBigInt(hex4, opts);
|
|
1536
1536
|
const number4 = Number(value);
|
|
1537
1537
|
if (!Number.isSafeInteger(number4))
|
|
1538
1538
|
throw new IntegerOutOfRangeError({
|
|
@@ -1564,12 +1564,12 @@ function toHex(value, opts = {}) {
|
|
|
1564
1564
|
return bytesToHex(value, opts);
|
|
1565
1565
|
}
|
|
1566
1566
|
function boolToHex(value, opts = {}) {
|
|
1567
|
-
const
|
|
1567
|
+
const hex4 = `0x${Number(value)}`;
|
|
1568
1568
|
if (typeof opts.size === "number") {
|
|
1569
|
-
assertSize(
|
|
1570
|
-
return pad(
|
|
1569
|
+
assertSize(hex4, { size: opts.size });
|
|
1570
|
+
return pad(hex4, { size: opts.size });
|
|
1571
1571
|
}
|
|
1572
|
-
return
|
|
1572
|
+
return hex4;
|
|
1573
1573
|
}
|
|
1574
1574
|
function bytesToHex(value, opts = {}) {
|
|
1575
1575
|
let string4 = "";
|
|
@@ -1579,21 +1579,21 @@ function bytesToHex(value, opts = {}) {
|
|
|
1579
1579
|
for (let i = 0; i < value.length; i++) {
|
|
1580
1580
|
string4 += hexes[value[i]];
|
|
1581
1581
|
}
|
|
1582
|
-
const
|
|
1582
|
+
const hex4 = `0x${string4}`;
|
|
1583
1583
|
if (typeof opts.size === "number") {
|
|
1584
|
-
assertSize(
|
|
1585
|
-
return pad(
|
|
1584
|
+
assertSize(hex4, { size: opts.size });
|
|
1585
|
+
return pad(hex4, { dir: "right", size: opts.size });
|
|
1586
1586
|
}
|
|
1587
|
-
return
|
|
1587
|
+
return hex4;
|
|
1588
1588
|
}
|
|
1589
1589
|
function numberToHex(value_, opts = {}) {
|
|
1590
1590
|
const { signed, size: size5 } = opts;
|
|
1591
1591
|
if (!signed && (typeof value_ === "bigint" ? value_ >= 0n : Number.isSafeInteger(value_) && value_ >= 0)) {
|
|
1592
|
-
const
|
|
1592
|
+
const hex5 = value_.toString(16);
|
|
1593
1593
|
if (!size5)
|
|
1594
|
-
return `0x${
|
|
1595
|
-
if (Number.isSafeInteger(size5) && size5 > 0 &&
|
|
1596
|
-
return `0x${
|
|
1594
|
+
return `0x${hex5}`;
|
|
1595
|
+
if (Number.isSafeInteger(size5) && size5 > 0 && hex5.length <= size5 * 2)
|
|
1596
|
+
return `0x${hex5.padStart(size5 * 2, "0")}`;
|
|
1597
1597
|
}
|
|
1598
1598
|
const value = BigInt(value_);
|
|
1599
1599
|
let maxValue;
|
|
@@ -1616,10 +1616,10 @@ function numberToHex(value_, opts = {}) {
|
|
|
1616
1616
|
value: `${value_}${suffix}`
|
|
1617
1617
|
});
|
|
1618
1618
|
}
|
|
1619
|
-
const
|
|
1619
|
+
const hex4 = `0x${(signed && value < 0 ? (1n << BigInt(size5 * 8)) + BigInt(value) : value).toString(16)}`;
|
|
1620
1620
|
if (size5)
|
|
1621
|
-
return pad(
|
|
1622
|
-
return
|
|
1621
|
+
return pad(hex4, { size: size5 });
|
|
1622
|
+
return hex4;
|
|
1623
1623
|
}
|
|
1624
1624
|
function stringToHex(value_, opts = {}) {
|
|
1625
1625
|
return bytesToHex(stringToBytes(value_), opts);
|
|
@@ -1660,22 +1660,22 @@ function boolToBytes(value, opts = {}) {
|
|
|
1660
1660
|
}
|
|
1661
1661
|
return bytes;
|
|
1662
1662
|
}
|
|
1663
|
-
function decodeHex(
|
|
1664
|
-
const odd =
|
|
1665
|
-
const length =
|
|
1663
|
+
function decodeHex(hex4, size5) {
|
|
1664
|
+
const odd = hex4.length & 1;
|
|
1665
|
+
const length = hex4.length - 1 >> 1;
|
|
1666
1666
|
const bytes = new Uint8Array(size5 || length);
|
|
1667
1667
|
let i = 0;
|
|
1668
1668
|
let j = 2;
|
|
1669
1669
|
if (odd) {
|
|
1670
|
-
const code =
|
|
1670
|
+
const code = hex4.charCodeAt(j++);
|
|
1671
1671
|
const nibble = code < 128 ? nibbles[code] : -1;
|
|
1672
1672
|
if (nibble < 0)
|
|
1673
1673
|
return void 0;
|
|
1674
1674
|
bytes[i++] = nibble;
|
|
1675
1675
|
}
|
|
1676
1676
|
for (; i < length; i++) {
|
|
1677
|
-
const a =
|
|
1678
|
-
const b =
|
|
1677
|
+
const a = hex4.charCodeAt(j++);
|
|
1678
|
+
const b = hex4.charCodeAt(j++);
|
|
1679
1679
|
const high = a < 128 ? nibbles[a] : -1;
|
|
1680
1680
|
const low = b < 128 ? nibbles[b] : -1;
|
|
1681
1681
|
if ((high | low) < 0)
|
|
@@ -1693,20 +1693,20 @@ function charCodeToBase16(char) {
|
|
|
1693
1693
|
return char - (charCodeMap.a - 10);
|
|
1694
1694
|
return void 0;
|
|
1695
1695
|
}
|
|
1696
|
-
function hexToBytes(
|
|
1696
|
+
function hexToBytes(hex4, opts = {}) {
|
|
1697
1697
|
const size5 = opts.size;
|
|
1698
|
-
if (typeof
|
|
1698
|
+
if (typeof hex4 === "string" && hex4.length >= 2 && (!size5 || Number.isSafeInteger(size5) && size5 > 0)) {
|
|
1699
1699
|
if (size5)
|
|
1700
|
-
assertSize(
|
|
1701
|
-
const bytes2 = decodeHex(
|
|
1700
|
+
assertSize(hex4, { size: size5 });
|
|
1701
|
+
const bytes2 = decodeHex(hex4, size5);
|
|
1702
1702
|
if (bytes2)
|
|
1703
1703
|
return bytes2;
|
|
1704
1704
|
}
|
|
1705
|
-
let hexString =
|
|
1705
|
+
let hexString = hex4.slice(2);
|
|
1706
1706
|
if (hexString.length % 2)
|
|
1707
1707
|
hexString = `0${hexString}`;
|
|
1708
1708
|
if (opts.size) {
|
|
1709
|
-
assertSize(
|
|
1709
|
+
assertSize(hex4, { size: opts.size });
|
|
1710
1710
|
hexString = hexString.padEnd(opts.size * 2, "0");
|
|
1711
1711
|
}
|
|
1712
1712
|
const length = hexString.length / 2;
|
|
@@ -1722,8 +1722,8 @@ function hexToBytes(hex3, opts = {}) {
|
|
|
1722
1722
|
return bytes;
|
|
1723
1723
|
}
|
|
1724
1724
|
function numberToBytes(value, opts) {
|
|
1725
|
-
const
|
|
1726
|
-
return hexToBytes(
|
|
1725
|
+
const hex4 = numberToHex(value, opts);
|
|
1726
|
+
return hexToBytes(hex4);
|
|
1727
1727
|
}
|
|
1728
1728
|
function stringToBytes(value, opts = {}) {
|
|
1729
1729
|
const bytes = (() => {
|
|
@@ -2511,8 +2511,8 @@ function encode3(compiled, value) {
|
|
|
2511
2511
|
});
|
|
2512
2512
|
if (typeof value !== "bigint" && !(typeof value === "number" && Number.isSafeInteger(value)))
|
|
2513
2513
|
return numberToHex(value, { size: 32, signed }).slice(2);
|
|
2514
|
-
const
|
|
2515
|
-
return zeros.slice(
|
|
2514
|
+
const hex4 = (value < 0 ? (1n << 256n) + BigInt(value) : value).toString(16);
|
|
2515
|
+
return zeros.slice(hex4.length) + hex4;
|
|
2516
2516
|
}
|
|
2517
2517
|
if (kind === "string") {
|
|
2518
2518
|
const data = stringToHex(value).slice(2);
|
|
@@ -2590,15 +2590,15 @@ function encodeParts(compiled, parts) {
|
|
|
2590
2590
|
return head + tail;
|
|
2591
2591
|
}
|
|
2592
2592
|
function word(value) {
|
|
2593
|
-
const
|
|
2594
|
-
return zeros.slice(
|
|
2593
|
+
const hex4 = value.toString(16);
|
|
2594
|
+
return zeros.slice(hex4.length) + hex4;
|
|
2595
2595
|
}
|
|
2596
2596
|
function encodeBytes(value, { param }) {
|
|
2597
2597
|
const [, paramSize] = param.type.split("bytes");
|
|
2598
|
-
const
|
|
2599
|
-
const bytesSize = size(
|
|
2598
|
+
const hex4 = value.length % 2 ? `0x0${value.slice(2)}` : value;
|
|
2599
|
+
const bytesSize = size(hex4);
|
|
2600
2600
|
if (!paramSize) {
|
|
2601
|
-
let value_ =
|
|
2601
|
+
let value_ = hex4;
|
|
2602
2602
|
if (bytesSize % 32 !== 0)
|
|
2603
2603
|
value_ = padHex(value_, {
|
|
2604
2604
|
dir: "right",
|
|
@@ -2617,7 +2617,7 @@ function encodeBytes(value, { param }) {
|
|
|
2617
2617
|
expectedSize: Number.parseInt(paramSize, 10),
|
|
2618
2618
|
value
|
|
2619
2619
|
});
|
|
2620
|
-
return { dynamic: false, encoded: padHex(
|
|
2620
|
+
return { dynamic: false, encoded: padHex(hex4, { dir: "right" }) };
|
|
2621
2621
|
}
|
|
2622
2622
|
function getArrayComponents(type) {
|
|
2623
2623
|
const matches = type.match(/^(.*)\[(\d+)?\]$/);
|
|
@@ -2695,8 +2695,8 @@ function sliceBytes(value_, start, end, { strict } = {}) {
|
|
|
2695
2695
|
}
|
|
2696
2696
|
function sliceHex(value_, start, end, { strict } = {}) {
|
|
2697
2697
|
assertStartOffset(value_, start);
|
|
2698
|
-
const
|
|
2699
|
-
const value = `0x${
|
|
2698
|
+
const hex4 = value_.startsWith("0x") ? value_.slice(2) : value_.replace("0x", "");
|
|
2699
|
+
const value = `0x${hex4.slice((start ?? 0) * 2, (end ?? value_.length) * 2)}`;
|
|
2700
2700
|
if (strict)
|
|
2701
2701
|
assertEndOffset(value, start, end);
|
|
2702
2702
|
return value;
|
|
@@ -3225,8 +3225,8 @@ function bytesToNumber(bytes, opts = {}) {
|
|
|
3225
3225
|
return value;
|
|
3226
3226
|
}
|
|
3227
3227
|
}
|
|
3228
|
-
const
|
|
3229
|
-
return hexToNumber(
|
|
3228
|
+
const hex4 = bytesToHex(bytes);
|
|
3229
|
+
return hexToNumber(hex4, opts);
|
|
3230
3230
|
}
|
|
3231
3231
|
var init_fromBytes = __esm({
|
|
3232
3232
|
"../node_modules/viem/_esm/utils/encoding/fromBytes.js"() {
|
|
@@ -4853,23 +4853,23 @@ function abool(title, value) {
|
|
|
4853
4853
|
throw new Error(title + " boolean expected, got " + value);
|
|
4854
4854
|
}
|
|
4855
4855
|
function numberToHexUnpadded(num2) {
|
|
4856
|
-
const
|
|
4857
|
-
return
|
|
4856
|
+
const hex4 = num2.toString(16);
|
|
4857
|
+
return hex4.length & 1 ? "0" + hex4 : hex4;
|
|
4858
4858
|
}
|
|
4859
|
-
function hexToNumber2(
|
|
4860
|
-
if (typeof
|
|
4861
|
-
throw new Error("hex string expected, got " + typeof
|
|
4862
|
-
return
|
|
4859
|
+
function hexToNumber2(hex4) {
|
|
4860
|
+
if (typeof hex4 !== "string")
|
|
4861
|
+
throw new Error("hex string expected, got " + typeof hex4);
|
|
4862
|
+
return hex4 === "" ? _0n2 : BigInt("0x" + hex4);
|
|
4863
4863
|
}
|
|
4864
4864
|
function bytesToHex2(bytes) {
|
|
4865
4865
|
abytes2(bytes);
|
|
4866
4866
|
if (hasHexBuiltin)
|
|
4867
4867
|
return bytes.toHex();
|
|
4868
|
-
let
|
|
4868
|
+
let hex4 = "";
|
|
4869
4869
|
for (let i = 0; i < bytes.length; i++) {
|
|
4870
|
-
|
|
4870
|
+
hex4 += hexes2[bytes[i]];
|
|
4871
4871
|
}
|
|
4872
|
-
return
|
|
4872
|
+
return hex4;
|
|
4873
4873
|
}
|
|
4874
4874
|
function asciiToBase16(ch) {
|
|
4875
4875
|
if (ch >= asciis._0 && ch <= asciis._9)
|
|
@@ -4880,21 +4880,21 @@ function asciiToBase16(ch) {
|
|
|
4880
4880
|
return ch - (asciis.a - 10);
|
|
4881
4881
|
return;
|
|
4882
4882
|
}
|
|
4883
|
-
function hexToBytes2(
|
|
4884
|
-
if (typeof
|
|
4885
|
-
throw new Error("hex string expected, got " + typeof
|
|
4883
|
+
function hexToBytes2(hex4) {
|
|
4884
|
+
if (typeof hex4 !== "string")
|
|
4885
|
+
throw new Error("hex string expected, got " + typeof hex4);
|
|
4886
4886
|
if (hasHexBuiltin)
|
|
4887
|
-
return Uint8Array.fromHex(
|
|
4888
|
-
const hl =
|
|
4887
|
+
return Uint8Array.fromHex(hex4);
|
|
4888
|
+
const hl = hex4.length;
|
|
4889
4889
|
const al = hl / 2;
|
|
4890
4890
|
if (hl % 2)
|
|
4891
4891
|
throw new Error("hex string expected, got unpadded hex of length " + hl);
|
|
4892
4892
|
const array2 = new Uint8Array(al);
|
|
4893
4893
|
for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {
|
|
4894
|
-
const n1 = asciiToBase16(
|
|
4895
|
-
const n2 = asciiToBase16(
|
|
4894
|
+
const n1 = asciiToBase16(hex4.charCodeAt(hi));
|
|
4895
|
+
const n2 = asciiToBase16(hex4.charCodeAt(hi + 1));
|
|
4896
4896
|
if (n1 === void 0 || n2 === void 0) {
|
|
4897
|
-
const char =
|
|
4897
|
+
const char = hex4[hi] + hex4[hi + 1];
|
|
4898
4898
|
throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi);
|
|
4899
4899
|
}
|
|
4900
4900
|
array2[ai] = n1 * 16 + n2;
|
|
@@ -4914,16 +4914,16 @@ function numberToBytesBE(n, len) {
|
|
|
4914
4914
|
function numberToBytesLE(n, len) {
|
|
4915
4915
|
return numberToBytesBE(n, len).reverse();
|
|
4916
4916
|
}
|
|
4917
|
-
function ensureBytes(title,
|
|
4917
|
+
function ensureBytes(title, hex4, expectedLength) {
|
|
4918
4918
|
let res;
|
|
4919
|
-
if (typeof
|
|
4919
|
+
if (typeof hex4 === "string") {
|
|
4920
4920
|
try {
|
|
4921
|
-
res = hexToBytes2(
|
|
4921
|
+
res = hexToBytes2(hex4);
|
|
4922
4922
|
} catch (e) {
|
|
4923
4923
|
throw new Error(title + " must be hex string or Uint8Array, cause: " + e);
|
|
4924
4924
|
}
|
|
4925
|
-
} else if (isBytes2(
|
|
4926
|
-
res = Uint8Array.from(
|
|
4925
|
+
} else if (isBytes2(hex4)) {
|
|
4926
|
+
res = Uint8Array.from(hex4);
|
|
4927
4927
|
} else {
|
|
4928
4928
|
throw new Error(title + " must be hex string or Uint8Array");
|
|
4929
4929
|
}
|
|
@@ -5761,8 +5761,8 @@ function weierstrassPoints(opts) {
|
|
|
5761
5761
|
* Converts hash string or Uint8Array to Point.
|
|
5762
5762
|
* @param hex short/long ECDSA hex
|
|
5763
5763
|
*/
|
|
5764
|
-
static fromHex(
|
|
5765
|
-
const P = Point2.fromAffine(fromBytes5(ensureBytes("pointHex",
|
|
5764
|
+
static fromHex(hex4) {
|
|
5765
|
+
const P = Point2.fromAffine(fromBytes5(ensureBytes("pointHex", hex4)));
|
|
5766
5766
|
P.assertValidity();
|
|
5767
5767
|
return P;
|
|
5768
5768
|
}
|
|
@@ -6117,15 +6117,15 @@ function weierstrass(curveDef) {
|
|
|
6117
6117
|
Object.freeze(this);
|
|
6118
6118
|
}
|
|
6119
6119
|
// pair (bytes of r, bytes of s)
|
|
6120
|
-
static fromCompact(
|
|
6120
|
+
static fromCompact(hex4) {
|
|
6121
6121
|
const l = nByteLength;
|
|
6122
|
-
|
|
6123
|
-
return new Signature(slcNum(
|
|
6122
|
+
hex4 = ensureBytes("compactSignature", hex4, l * 2);
|
|
6123
|
+
return new Signature(slcNum(hex4, 0, l), slcNum(hex4, l, 2 * l));
|
|
6124
6124
|
}
|
|
6125
6125
|
// DER encoded ECDSA signature
|
|
6126
6126
|
// https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script
|
|
6127
|
-
static fromDER(
|
|
6128
|
-
const { r, s } = DER.toSig(ensureBytes("DER",
|
|
6127
|
+
static fromDER(hex4) {
|
|
6128
|
+
const { r, s } = DER.toSig(ensureBytes("DER", hex4));
|
|
6129
6129
|
return new Signature(r, s);
|
|
6130
6130
|
}
|
|
6131
6131
|
/**
|
|
@@ -6541,12 +6541,12 @@ var init_weierstrass = __esm({
|
|
|
6541
6541
|
const { Err: E } = DER;
|
|
6542
6542
|
if (num2 < _0n5)
|
|
6543
6543
|
throw new E("integer: negative integers are not allowed");
|
|
6544
|
-
let
|
|
6545
|
-
if (Number.parseInt(
|
|
6546
|
-
|
|
6547
|
-
if (
|
|
6544
|
+
let hex4 = numberToHexUnpadded(num2);
|
|
6545
|
+
if (Number.parseInt(hex4[0], 16) & 8)
|
|
6546
|
+
hex4 = "00" + hex4;
|
|
6547
|
+
if (hex4.length & 1)
|
|
6548
6548
|
throw new E("unexpected DER parsing assertion: unpadded hex");
|
|
6549
|
-
return
|
|
6549
|
+
return hex4;
|
|
6550
6550
|
},
|
|
6551
6551
|
decode(data) {
|
|
6552
6552
|
const { Err: E } = DER;
|
|
@@ -6557,9 +6557,9 @@ var init_weierstrass = __esm({
|
|
|
6557
6557
|
return bytesToNumberBE(data);
|
|
6558
6558
|
}
|
|
6559
6559
|
},
|
|
6560
|
-
toSig(
|
|
6560
|
+
toSig(hex4) {
|
|
6561
6561
|
const { Err: E, _int: int2, _tlv: tlv } = DER;
|
|
6562
|
-
const data = ensureBytes("signature",
|
|
6562
|
+
const data = ensureBytes("signature", hex4);
|
|
6563
6563
|
const { v: seqBytes, l: seqLeftBytes } = tlv.decode(48, data);
|
|
6564
6564
|
if (seqLeftBytes.length)
|
|
6565
6565
|
throw new E("invalid signature: left bytes after parsing");
|
|
@@ -7805,10 +7805,10 @@ var init_bytes = __esm({
|
|
|
7805
7805
|
});
|
|
7806
7806
|
|
|
7807
7807
|
// ../node_modules/ox/_esm/core/internal/hex.js
|
|
7808
|
-
function assertSize3(
|
|
7809
|
-
if (size3(
|
|
7808
|
+
function assertSize3(hex4, size_) {
|
|
7809
|
+
if (size3(hex4) > size_)
|
|
7810
7810
|
throw new SizeOverflowError3({
|
|
7811
|
-
givenSize: size3(
|
|
7811
|
+
givenSize: size3(hex4),
|
|
7812
7812
|
maxSize: size_
|
|
7813
7813
|
});
|
|
7814
7814
|
}
|
|
@@ -7833,14 +7833,14 @@ function pad3(hex_, options = {}) {
|
|
|
7833
7833
|
const { dir, size: size5 = 32 } = options;
|
|
7834
7834
|
if (size5 === 0)
|
|
7835
7835
|
return hex_;
|
|
7836
|
-
const
|
|
7837
|
-
if (
|
|
7836
|
+
const hex4 = hex_.replace("0x", "");
|
|
7837
|
+
if (hex4.length > size5 * 2)
|
|
7838
7838
|
throw new SizeExceedsPaddingSizeError3({
|
|
7839
|
-
size: Math.ceil(
|
|
7839
|
+
size: Math.ceil(hex4.length / 2),
|
|
7840
7840
|
targetSize: size5,
|
|
7841
7841
|
type: "Hex"
|
|
7842
7842
|
});
|
|
7843
|
-
return `0x${
|
|
7843
|
+
return `0x${hex4[dir === "right" ? "padEnd" : "padStart"](size5 * 2, "0")}`;
|
|
7844
7844
|
}
|
|
7845
7845
|
function trim3(value, options = {}) {
|
|
7846
7846
|
const { dir = "left" } = options;
|
|
@@ -7953,8 +7953,8 @@ function toBigInt2(bytes, options = {}) {
|
|
|
7953
7953
|
const { size: size5 } = options;
|
|
7954
7954
|
if (typeof size5 !== "undefined")
|
|
7955
7955
|
assertSize2(bytes, size5);
|
|
7956
|
-
const
|
|
7957
|
-
return toBigInt(
|
|
7956
|
+
const hex4 = fromBytes(bytes, options);
|
|
7957
|
+
return toBigInt(hex4, options);
|
|
7958
7958
|
}
|
|
7959
7959
|
function toBoolean(bytes, options = {}) {
|
|
7960
7960
|
const { size: size5 } = options;
|
|
@@ -7971,8 +7971,8 @@ function toNumber2(bytes, options = {}) {
|
|
|
7971
7971
|
const { size: size5 } = options;
|
|
7972
7972
|
if (typeof size5 !== "undefined")
|
|
7973
7973
|
assertSize2(bytes, size5);
|
|
7974
|
-
const
|
|
7975
|
-
return toNumber(
|
|
7974
|
+
const hex4 = fromBytes(bytes, options);
|
|
7975
|
+
return toNumber(hex4, options);
|
|
7976
7976
|
}
|
|
7977
7977
|
function toString(bytes, options = {}) {
|
|
7978
7978
|
const { size: size5 } = options;
|
|
@@ -8098,23 +8098,23 @@ function from3(value) {
|
|
|
8098
8098
|
return value;
|
|
8099
8099
|
}
|
|
8100
8100
|
function fromBoolean(value, options = {}) {
|
|
8101
|
-
const
|
|
8101
|
+
const hex4 = `0x${Number(value)}`;
|
|
8102
8102
|
if (typeof options.size === "number") {
|
|
8103
|
-
assertSize3(
|
|
8104
|
-
return padLeft(
|
|
8103
|
+
assertSize3(hex4, options.size);
|
|
8104
|
+
return padLeft(hex4, options.size);
|
|
8105
8105
|
}
|
|
8106
|
-
return
|
|
8106
|
+
return hex4;
|
|
8107
8107
|
}
|
|
8108
8108
|
function fromBytes(value, options = {}) {
|
|
8109
8109
|
let string4 = "";
|
|
8110
8110
|
for (let i = 0; i < value.length; i++)
|
|
8111
8111
|
string4 += hexes3[value[i]];
|
|
8112
|
-
const
|
|
8112
|
+
const hex4 = `0x${string4}`;
|
|
8113
8113
|
if (typeof options.size === "number") {
|
|
8114
|
-
assertSize3(
|
|
8115
|
-
return padRight2(
|
|
8114
|
+
assertSize3(hex4, options.size);
|
|
8115
|
+
return padRight2(hex4, options.size);
|
|
8116
8116
|
}
|
|
8117
|
-
return
|
|
8117
|
+
return hex4;
|
|
8118
8118
|
}
|
|
8119
8119
|
function fromNumber(value, options = {}) {
|
|
8120
8120
|
const { signed, size: size5 } = options;
|
|
@@ -8140,10 +8140,10 @@ function fromNumber(value, options = {}) {
|
|
|
8140
8140
|
});
|
|
8141
8141
|
}
|
|
8142
8142
|
const stringValue = (signed && value_ < 0 ? BigInt.asUintN(size5 * 8, BigInt(value_)) : value_).toString(16);
|
|
8143
|
-
const
|
|
8143
|
+
const hex4 = `0x${stringValue}`;
|
|
8144
8144
|
if (size5)
|
|
8145
|
-
return padLeft(
|
|
8146
|
-
return
|
|
8145
|
+
return padLeft(hex4, size5);
|
|
8146
|
+
return hex4;
|
|
8147
8147
|
}
|
|
8148
8148
|
function fromString2(value, options = {}) {
|
|
8149
8149
|
return fromBytes(encoder3.encode(value), options);
|
|
@@ -8168,24 +8168,24 @@ function size3(value) {
|
|
|
8168
8168
|
function trimLeft2(value) {
|
|
8169
8169
|
return trim3(value, { dir: "left" });
|
|
8170
8170
|
}
|
|
8171
|
-
function toBigInt(
|
|
8171
|
+
function toBigInt(hex4, options = {}) {
|
|
8172
8172
|
const { signed } = options;
|
|
8173
8173
|
if (options.size)
|
|
8174
|
-
assertSize3(
|
|
8175
|
-
const value = BigInt(
|
|
8174
|
+
assertSize3(hex4, options.size);
|
|
8175
|
+
const value = BigInt(hex4);
|
|
8176
8176
|
if (!signed)
|
|
8177
8177
|
return value;
|
|
8178
|
-
const max_unsigned = (1n << BigInt(size3(
|
|
8178
|
+
const max_unsigned = (1n << BigInt(size3(hex4)) * 8n) - 1n;
|
|
8179
8179
|
const max_signed = max_unsigned >> 1n;
|
|
8180
8180
|
if (value <= max_signed)
|
|
8181
8181
|
return value;
|
|
8182
8182
|
return value - max_unsigned - 1n;
|
|
8183
8183
|
}
|
|
8184
|
-
function toNumber(
|
|
8184
|
+
function toNumber(hex4, options = {}) {
|
|
8185
8185
|
const { signed, size: size5 } = options;
|
|
8186
8186
|
if (!signed && !size5)
|
|
8187
|
-
return Number(
|
|
8188
|
-
return Number(toBigInt(
|
|
8187
|
+
return Number(hex4);
|
|
8188
|
+
return Number(toBigInt(hex4, options));
|
|
8189
8189
|
}
|
|
8190
8190
|
function validate3(value, options = {}) {
|
|
8191
8191
|
const { even = false, strict = false } = options;
|
|
@@ -13320,9 +13320,9 @@ var require_utils = __commonJS({
|
|
|
13320
13320
|
let output2 = "";
|
|
13321
13321
|
for (let i = 0; i < input2.length; i++) {
|
|
13322
13322
|
if (input2[i] === "%" && i + 2 < input2.length) {
|
|
13323
|
-
const
|
|
13324
|
-
if (isHexPair(
|
|
13325
|
-
const normalizedHex =
|
|
13323
|
+
const hex4 = input2.slice(i + 1, i + 3);
|
|
13324
|
+
if (isHexPair(hex4)) {
|
|
13325
|
+
const normalizedHex = hex4.toUpperCase();
|
|
13326
13326
|
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
13327
13327
|
if (decodeUnreserved && isUnreserved(decoded)) {
|
|
13328
13328
|
output2 += decoded;
|
|
@@ -13342,9 +13342,9 @@ var require_utils = __commonJS({
|
|
|
13342
13342
|
for (let i = 0; i < input2.length; i++) {
|
|
13343
13343
|
const ch = input2[i];
|
|
13344
13344
|
if (ch === "%" && i + 2 < input2.length) {
|
|
13345
|
-
const
|
|
13346
|
-
if (isHexPair(
|
|
13347
|
-
const normalizedHex =
|
|
13345
|
+
const hex4 = input2.slice(i + 1, i + 3);
|
|
13346
|
+
if (isHexPair(hex4)) {
|
|
13347
|
+
const normalizedHex = hex4.toUpperCase();
|
|
13348
13348
|
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
13349
13349
|
if (decoded !== "." && isUnreserved(decoded)) {
|
|
13350
13350
|
output2 += decoded;
|
|
@@ -13384,9 +13384,9 @@ var require_utils = __commonJS({
|
|
|
13384
13384
|
for (let i = 0; i < input2.length; i++) {
|
|
13385
13385
|
const ch = input2[i];
|
|
13386
13386
|
if (ch === "%" && i + 2 < input2.length) {
|
|
13387
|
-
const
|
|
13388
|
-
if (isHexPair(
|
|
13389
|
-
output2 += "%" +
|
|
13387
|
+
const hex4 = input2.slice(i + 1, i + 3);
|
|
13388
|
+
if (isHexPair(hex4)) {
|
|
13389
|
+
output2 += "%" + hex4.toUpperCase();
|
|
13390
13390
|
i += 2;
|
|
13391
13391
|
continue;
|
|
13392
13392
|
}
|
|
@@ -13422,9 +13422,9 @@ var require_utils = __commonJS({
|
|
|
13422
13422
|
for (let i = 0; i < input2.length; i++) {
|
|
13423
13423
|
const ch = input2[i];
|
|
13424
13424
|
if (ch === "%" && i + 2 < input2.length) {
|
|
13425
|
-
const
|
|
13426
|
-
if (isHexPair(
|
|
13427
|
-
output2 += "%" +
|
|
13425
|
+
const hex4 = input2.slice(i + 1, i + 3);
|
|
13426
|
+
if (isHexPair(hex4)) {
|
|
13427
|
+
output2 += "%" + hex4.toUpperCase();
|
|
13428
13428
|
i += 2;
|
|
13429
13429
|
continue;
|
|
13430
13430
|
}
|
|
@@ -13469,9 +13469,9 @@ var require_utils = __commonJS({
|
|
|
13469
13469
|
for (let i = 0; i < input2.length; i++) {
|
|
13470
13470
|
const ch = input2[i];
|
|
13471
13471
|
if (ch === "%" && i + 2 < input2.length) {
|
|
13472
|
-
const
|
|
13473
|
-
if (isHexPair(
|
|
13474
|
-
const normalizedHex =
|
|
13472
|
+
const hex4 = input2.slice(i + 1, i + 3);
|
|
13473
|
+
if (isHexPair(hex4)) {
|
|
13474
|
+
const normalizedHex = hex4.toUpperCase();
|
|
13475
13475
|
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
13476
13476
|
if (isUnreserved(decoded)) {
|
|
13477
13477
|
output2 += decoded;
|
|
@@ -13509,9 +13509,9 @@ var require_utils = __commonJS({
|
|
|
13509
13509
|
let output2 = "";
|
|
13510
13510
|
for (let i = 0; i < input2.length; i++) {
|
|
13511
13511
|
if (input2[i] === "%" && i + 2 < input2.length) {
|
|
13512
|
-
const
|
|
13513
|
-
if (isHexPair(
|
|
13514
|
-
output2 += "%" +
|
|
13512
|
+
const hex4 = input2.slice(i + 1, i + 3);
|
|
13513
|
+
if (isHexPair(hex4)) {
|
|
13514
|
+
output2 += "%" + hex4.toUpperCase();
|
|
13515
13515
|
i += 2;
|
|
13516
13516
|
continue;
|
|
13517
13517
|
}
|
|
@@ -18499,8 +18499,8 @@ function base64urlToUint8Array(base64url3) {
|
|
|
18499
18499
|
function uint8ArrayToBase64url(bytes) {
|
|
18500
18500
|
return uint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
18501
18501
|
}
|
|
18502
|
-
function hexToUint8Array(
|
|
18503
|
-
const cleanHex =
|
|
18502
|
+
function hexToUint8Array(hex4) {
|
|
18503
|
+
const cleanHex = hex4.replace(/^0x/, "");
|
|
18504
18504
|
if (cleanHex.length % 2 !== 0) {
|
|
18505
18505
|
throw new Error("Invalid hex string length");
|
|
18506
18506
|
}
|
|
@@ -38808,8 +38808,8 @@ function encodeHex(value) {
|
|
|
38808
38808
|
}
|
|
38809
38809
|
const body = (() => {
|
|
38810
38810
|
if (typeof value === "string" && hexRegex.test(value)) {
|
|
38811
|
-
const
|
|
38812
|
-
return
|
|
38811
|
+
const hex4 = value.slice(2).toLowerCase();
|
|
38812
|
+
return hex4.length % 2 ? `0${hex4}` : hex4;
|
|
38813
38813
|
}
|
|
38814
38814
|
if (value instanceof Uint8Array)
|
|
38815
38815
|
return bytesToHex(value).slice(2);
|
|
@@ -41437,19 +41437,19 @@ async function sendCalls(client, parameters) {
|
|
|
41437
41437
|
};
|
|
41438
41438
|
}
|
|
41439
41439
|
const calls = parameters.calls.map((call_) => {
|
|
41440
|
-
const
|
|
41441
|
-
const data =
|
|
41442
|
-
abi:
|
|
41443
|
-
functionName:
|
|
41444
|
-
args:
|
|
41445
|
-
}) :
|
|
41440
|
+
const call3 = call_;
|
|
41441
|
+
const data = call3.abi ? encodeFunctionData({
|
|
41442
|
+
abi: call3.abi,
|
|
41443
|
+
functionName: call3.functionName,
|
|
41444
|
+
args: call3.args
|
|
41445
|
+
}) : call3.data;
|
|
41446
41446
|
return {
|
|
41447
|
-
data:
|
|
41447
|
+
data: call3.dataSuffix ? concat([
|
|
41448
41448
|
data ?? "0x",
|
|
41449
|
-
|
|
41449
|
+
call3.dataSuffix.length % 2 ? `0x0${call3.dataSuffix.slice(2)}` : call3.dataSuffix
|
|
41450
41450
|
]) : data,
|
|
41451
|
-
to:
|
|
41452
|
-
value:
|
|
41451
|
+
to: call3.to,
|
|
41452
|
+
value: call3.value ? numberToHex(call3.value) : void 0
|
|
41453
41453
|
};
|
|
41454
41454
|
});
|
|
41455
41455
|
try {
|
|
@@ -41491,14 +41491,14 @@ async function sendCalls(client, parameters) {
|
|
|
41491
41491
|
}));
|
|
41492
41492
|
}
|
|
41493
41493
|
const results = [];
|
|
41494
|
-
for (const
|
|
41494
|
+
for (const call3 of calls) {
|
|
41495
41495
|
try {
|
|
41496
41496
|
const value = await getAction(client, sendTransaction, "sendTransaction")({
|
|
41497
41497
|
account,
|
|
41498
41498
|
chain,
|
|
41499
|
-
data:
|
|
41500
|
-
to:
|
|
41501
|
-
value:
|
|
41499
|
+
data: call3.data,
|
|
41500
|
+
to: call3.to,
|
|
41501
|
+
value: call3.value ? hexToBigInt(call3.value) : void 0
|
|
41502
41502
|
});
|
|
41503
41503
|
results.push({ status: "fulfilled", value });
|
|
41504
41504
|
} catch (reason) {
|
|
@@ -42695,15 +42695,15 @@ async function getCode(client, { address: address3, blockHash, blockNumber, bloc
|
|
|
42695
42695
|
blockTag,
|
|
42696
42696
|
requireCanonical
|
|
42697
42697
|
});
|
|
42698
|
-
const
|
|
42698
|
+
const hex4 = await client.request({
|
|
42699
42699
|
method: "eth_getCode",
|
|
42700
42700
|
params: [address3, block]
|
|
42701
42701
|
}, {
|
|
42702
42702
|
dedupe: typeof blockNumber === "bigint" || blockHash !== void 0
|
|
42703
42703
|
});
|
|
42704
|
-
if (
|
|
42704
|
+
if (hex4 === "0x")
|
|
42705
42705
|
return void 0;
|
|
42706
|
-
return
|
|
42706
|
+
return hex4;
|
|
42707
42707
|
}
|
|
42708
42708
|
|
|
42709
42709
|
// ../node_modules/viem/_esm/actions/public/getDelegation.js
|
|
@@ -43533,8 +43533,8 @@ function readList(cursor, length, to, recursiveDepth) {
|
|
|
43533
43533
|
return value;
|
|
43534
43534
|
}
|
|
43535
43535
|
function fromRlpHex(value) {
|
|
43536
|
-
const
|
|
43537
|
-
const source =
|
|
43536
|
+
const hex4 = value.slice(2).toLowerCase();
|
|
43537
|
+
const source = hex4.length % 2 ? `0${hex4}` : hex4;
|
|
43538
43538
|
const reader = {
|
|
43539
43539
|
assertPosition(position) {
|
|
43540
43540
|
if (position < 0 || position > this.length - 1)
|
|
@@ -45403,9 +45403,9 @@ function from7(value, options) {
|
|
|
45403
45403
|
return fromBytes(cursor.bytes);
|
|
45404
45404
|
return cursor.bytes;
|
|
45405
45405
|
}
|
|
45406
|
-
function fromHex3(
|
|
45406
|
+
function fromHex3(hex4, options = {}) {
|
|
45407
45407
|
const { as = "Hex" } = options;
|
|
45408
|
-
return from7(
|
|
45408
|
+
return from7(hex4, { as });
|
|
45409
45409
|
}
|
|
45410
45410
|
function getEncodable2(bytes) {
|
|
45411
45411
|
if (Array.isArray(bytes))
|
|
@@ -46057,7 +46057,7 @@ async function multicall(client, parameters) {
|
|
|
46057
46057
|
}
|
|
46058
46058
|
}
|
|
46059
46059
|
const batching = Boolean(client.batch?.multicall);
|
|
46060
|
-
const batches = batching ? chunkedCalls.flatMap((calls) => calls.map((
|
|
46060
|
+
const batches = batching ? chunkedCalls.flatMap((calls) => calls.map((call3) => [call3])) : chunkedCalls;
|
|
46061
46061
|
const aggregate3Results = await Promise.allSettled(batches.map((calls) => {
|
|
46062
46062
|
if (batching)
|
|
46063
46063
|
return scheduleMulticall2(client, {
|
|
@@ -46139,7 +46139,7 @@ async function multicall(client, parameters) {
|
|
|
46139
46139
|
return results;
|
|
46140
46140
|
}
|
|
46141
46141
|
async function scheduleMulticall2(client, parameters) {
|
|
46142
|
-
const { batchSize, call:
|
|
46142
|
+
const { batchSize, call: call3, multicallAddress, ...rest } = parameters;
|
|
46143
46143
|
const { wait: wait2 = 0 } = typeof client.batch?.multicall === "object" ? client.batch.multicall : {};
|
|
46144
46144
|
const { schedule } = createBatchScheduler({
|
|
46145
46145
|
id: stringify(["multicall", client.uid, batchSize, multicallAddress, rest]),
|
|
@@ -46154,7 +46154,7 @@ async function scheduleMulticall2(client, parameters) {
|
|
|
46154
46154
|
functionName: "aggregate3"
|
|
46155
46155
|
})
|
|
46156
46156
|
});
|
|
46157
|
-
const [result] = await schedule(
|
|
46157
|
+
const [result] = await schedule(call3);
|
|
46158
46158
|
return result;
|
|
46159
46159
|
}
|
|
46160
46160
|
|
|
@@ -46179,17 +46179,17 @@ async function simulateBlocks(client, parameters) {
|
|
|
46179
46179
|
for (const block2 of blocks) {
|
|
46180
46180
|
const blockOverrides = block2.blockOverrides ? toRpc2(block2.blockOverrides) : void 0;
|
|
46181
46181
|
const calls = block2.calls.map((call_) => {
|
|
46182
|
-
const
|
|
46183
|
-
const account =
|
|
46184
|
-
const data =
|
|
46182
|
+
const call3 = call_;
|
|
46183
|
+
const account = call3.account ? parseAccount(call3.account) : void 0;
|
|
46184
|
+
const data = call3.abi ? encodeFunctionData(call3) : call3.data;
|
|
46185
46185
|
const request = {
|
|
46186
|
-
...
|
|
46186
|
+
...call3,
|
|
46187
46187
|
account,
|
|
46188
|
-
data:
|
|
46188
|
+
data: call3.dataSuffix ? concat([
|
|
46189
46189
|
data || "0x",
|
|
46190
|
-
|
|
46190
|
+
call3.dataSuffix.length % 2 ? `0x0${call3.dataSuffix.slice(2)}` : call3.dataSuffix
|
|
46191
46191
|
]) : data,
|
|
46192
|
-
from:
|
|
46192
|
+
from: call3.from ?? account?.address
|
|
46193
46193
|
};
|
|
46194
46194
|
assertRequest(request);
|
|
46195
46195
|
return formatTransactionRequest(request);
|
|
@@ -46212,13 +46212,13 @@ async function simulateBlocks(client, parameters) {
|
|
|
46212
46212
|
});
|
|
46213
46213
|
return result.map((block2, i) => ({
|
|
46214
46214
|
...formatBlock(block2),
|
|
46215
|
-
calls: block2.calls.map((
|
|
46215
|
+
calls: block2.calls.map((call3, j) => {
|
|
46216
46216
|
const { abi: abi2, args, functionName, to } = blocks[i].calls[j];
|
|
46217
|
-
const data =
|
|
46218
|
-
const gasUsed = BigInt(
|
|
46219
|
-
const maxUsedGas =
|
|
46220
|
-
const logs =
|
|
46221
|
-
const status =
|
|
46217
|
+
const data = call3.error?.data ?? call3.returnData;
|
|
46218
|
+
const gasUsed = BigInt(call3.gasUsed);
|
|
46219
|
+
const maxUsedGas = call3.maxUsedGas === void 0 ? void 0 : BigInt(call3.maxUsedGas);
|
|
46220
|
+
const logs = call3.logs?.map((log) => formatLog(log));
|
|
46221
|
+
const status = call3.status === "0x1" ? "success" : "failure";
|
|
46222
46222
|
const result2 = abi2 && status === "success" && data !== "0x" ? decodeFunctionResult({
|
|
46223
46223
|
abi: abi2,
|
|
46224
46224
|
args,
|
|
@@ -46726,8 +46726,8 @@ async function simulateCalls(client, parameters) {
|
|
|
46726
46726
|
...block_,
|
|
46727
46727
|
blocks: [
|
|
46728
46728
|
{
|
|
46729
|
-
calls: calls.map((
|
|
46730
|
-
...
|
|
46729
|
+
calls: calls.map((call3) => ({
|
|
46730
|
+
...call3,
|
|
46731
46731
|
from: account.address
|
|
46732
46732
|
})),
|
|
46733
46733
|
stateOverrides
|
|
@@ -46738,11 +46738,11 @@ async function simulateCalls(client, parameters) {
|
|
|
46738
46738
|
}) : void 0;
|
|
46739
46739
|
const assetAddresses = discovery ? [
|
|
46740
46740
|
.../* @__PURE__ */ new Set([
|
|
46741
|
-
...tokensFromLogs(discovery[0].calls.flatMap((
|
|
46741
|
+
...tokensFromLogs(discovery[0].calls.flatMap((call3) => call3.logs ?? []), account.address),
|
|
46742
46742
|
// Included even for calls without data: contracts that mint on receiving
|
|
46743
46743
|
// native value (WETH) emit `Deposit`, not a `Transfer` the logs would catch.
|
|
46744
46744
|
// Candidates without code fall out at `isBalance`.
|
|
46745
|
-
...parameters.calls.map((
|
|
46745
|
+
...parameters.calls.map((call3) => call3.to?.toLowerCase())
|
|
46746
46746
|
])
|
|
46747
46747
|
].filter((address3) => Boolean(address3) && address3 !== ethAddress && address3 !== zeroAddress) : [];
|
|
46748
46748
|
const staticCallAddress = getStaticCallAddress([
|
|
@@ -46776,8 +46776,8 @@ async function simulateCalls(client, parameters) {
|
|
|
46776
46776
|
...block_,
|
|
46777
46777
|
blocks: [
|
|
46778
46778
|
{
|
|
46779
|
-
calls: [...calls, { to: zeroAddress }].map((
|
|
46780
|
-
...
|
|
46779
|
+
calls: [...calls, { to: zeroAddress }].map((call3) => ({
|
|
46780
|
+
...call3,
|
|
46781
46781
|
from: account?.address
|
|
46782
46782
|
})),
|
|
46783
46783
|
stateOverrides
|
|
@@ -46835,14 +46835,14 @@ async function simulateCalls(client, parameters) {
|
|
|
46835
46835
|
const [block_ethPost, block_assetsPost, block_decimals, block_tokenURI, block_symbols] = traceAssetChanges ? blocks.slice(1) : [];
|
|
46836
46836
|
const { calls: block_calls, ...block } = block_results;
|
|
46837
46837
|
const results = block_calls.slice(0, -1);
|
|
46838
|
-
const balancesPre = balanceCallsPre.map((
|
|
46838
|
+
const balancesPre = balanceCallsPre.map((call3) => isBalance(call3) ? hexToBigInt(call3.data) : null);
|
|
46839
46839
|
const ethPost = block_ethPost?.calls ?? [];
|
|
46840
46840
|
const assetsPost = block_assetsPost?.calls ?? [];
|
|
46841
46841
|
const balanceCallsPost = [...ethPost, ...assetsPost];
|
|
46842
|
-
const balancesPost = balanceCallsPost.map((
|
|
46843
|
-
const decimals = (block_decimals?.calls ?? []).map((
|
|
46844
|
-
const symbols = (block_symbols?.calls ?? []).map((
|
|
46845
|
-
const tokenURI = (block_tokenURI?.calls ?? []).map((
|
|
46842
|
+
const balancesPost = balanceCallsPost.map((call3) => isBalance(call3) ? hexToBigInt(call3.data) : null);
|
|
46843
|
+
const decimals = (block_decimals?.calls ?? []).map((call3) => decodeAssetResult(call3, decimalsFunction));
|
|
46844
|
+
const symbols = (block_symbols?.calls ?? []).map((call3) => decodeAssetResult(call3, symbolFunction));
|
|
46845
|
+
const tokenURI = (block_tokenURI?.calls ?? []).map((call3) => decodeAssetResult(call3, tokenUriFunction));
|
|
46846
46846
|
const changes = [];
|
|
46847
46847
|
for (const [i, balancePost] of balancesPost.entries()) {
|
|
46848
46848
|
const balancePre_ = balancesPre[i];
|
|
@@ -46896,14 +46896,14 @@ function tokensFromLogs(logs, account) {
|
|
|
46896
46896
|
return log.topics[1]?.toLowerCase() === account_ || log.topics[2]?.toLowerCase() === account_;
|
|
46897
46897
|
}).map((log) => log.address.toLowerCase());
|
|
46898
46898
|
}
|
|
46899
|
-
function isBalance(
|
|
46900
|
-
return
|
|
46899
|
+
function isBalance(call3) {
|
|
46900
|
+
return call3.status === "success" && /^0x[\da-f]{64}$/i.test(call3.data);
|
|
46901
46901
|
}
|
|
46902
|
-
function decodeAssetResult(
|
|
46903
|
-
if (
|
|
46902
|
+
function decodeAssetResult(call3, abiFunction) {
|
|
46903
|
+
if (call3.status === "failure" || call3.data === "0x")
|
|
46904
46904
|
return null;
|
|
46905
46905
|
try {
|
|
46906
|
-
return decodeResult(abiFunction,
|
|
46906
|
+
return decodeResult(abiFunction, call3.data);
|
|
46907
46907
|
} catch {
|
|
46908
46908
|
return null;
|
|
46909
46909
|
}
|
|
@@ -48279,11 +48279,11 @@ function pickWriteParameters(parameters) {
|
|
|
48279
48279
|
const { account, chain, gas, maxFeePerGas, maxPriorityFeePerGas, nonce } = parameters;
|
|
48280
48280
|
return { account, chain, gas, maxFeePerGas, maxPriorityFeePerGas, nonce };
|
|
48281
48281
|
}
|
|
48282
|
-
function defineCall(
|
|
48282
|
+
function defineCall(call3) {
|
|
48283
48283
|
return {
|
|
48284
|
-
...
|
|
48285
|
-
data: encodeFunctionData(
|
|
48286
|
-
to:
|
|
48284
|
+
...call3,
|
|
48285
|
+
data: encodeFunctionData(call3),
|
|
48286
|
+
to: call3.address
|
|
48287
48287
|
};
|
|
48288
48288
|
}
|
|
48289
48289
|
|
|
@@ -48299,10 +48299,10 @@ async function approve(client, parameters) {
|
|
|
48299
48299
|
});
|
|
48300
48300
|
}
|
|
48301
48301
|
approve2.inner = inner;
|
|
48302
|
-
function
|
|
48302
|
+
function call3(client, parameters) {
|
|
48303
48303
|
return defineCall(getCall(client, parameters));
|
|
48304
48304
|
}
|
|
48305
|
-
Object.defineProperty(approve2, "call", { configurable: true, enumerable: true, value:
|
|
48305
|
+
Object.defineProperty(approve2, "call", { configurable: true, enumerable: true, value: call3, writable: true });
|
|
48306
48306
|
async function estimateGas2(client, parameters) {
|
|
48307
48307
|
return estimateContractGas(client, {
|
|
48308
48308
|
...pickWriteParameters(parameters),
|
|
@@ -48625,7 +48625,7 @@ async function getAllowance(client, parameters) {
|
|
|
48625
48625
|
return toAmount(amount2, resolved);
|
|
48626
48626
|
}
|
|
48627
48627
|
(function(getAllowance2) {
|
|
48628
|
-
function
|
|
48628
|
+
function call3(client, args) {
|
|
48629
48629
|
return defineCall({
|
|
48630
48630
|
address: resolveToken(client, args).address,
|
|
48631
48631
|
abi: erc20Abi,
|
|
@@ -48633,7 +48633,7 @@ async function getAllowance(client, parameters) {
|
|
|
48633
48633
|
args: [args.account, args.spender]
|
|
48634
48634
|
});
|
|
48635
48635
|
}
|
|
48636
|
-
Object.defineProperty(getAllowance2, "call", { configurable: true, enumerable: true, value:
|
|
48636
|
+
Object.defineProperty(getAllowance2, "call", { configurable: true, enumerable: true, value: call3, writable: true });
|
|
48637
48637
|
})(getAllowance || (getAllowance = {}));
|
|
48638
48638
|
|
|
48639
48639
|
// ../node_modules/viem/_esm/actions/token/getBalance.js
|
|
@@ -48657,7 +48657,7 @@ async function getBalance2(client, parameters) {
|
|
|
48657
48657
|
return toAmount(amount2, resolved);
|
|
48658
48658
|
}
|
|
48659
48659
|
(function(getBalance3) {
|
|
48660
|
-
function
|
|
48660
|
+
function call3(client, args) {
|
|
48661
48661
|
const account_ = args.account ?? client.account;
|
|
48662
48662
|
if (!account_)
|
|
48663
48663
|
throw new AccountNotFoundError();
|
|
@@ -48669,7 +48669,7 @@ async function getBalance2(client, parameters) {
|
|
|
48669
48669
|
args: [account]
|
|
48670
48670
|
});
|
|
48671
48671
|
}
|
|
48672
|
-
Object.defineProperty(getBalance3, "call", { configurable: true, enumerable: true, value:
|
|
48672
|
+
Object.defineProperty(getBalance3, "call", { configurable: true, enumerable: true, value: call3, writable: true });
|
|
48673
48673
|
})(getBalance2 || (getBalance2 = {}));
|
|
48674
48674
|
|
|
48675
48675
|
// ../node_modules/viem/_esm/actions/token/getMetadata.js
|
|
@@ -48722,7 +48722,7 @@ async function getTotalSupply(client, parameters) {
|
|
|
48722
48722
|
return toAmount(amount2, resolved);
|
|
48723
48723
|
}
|
|
48724
48724
|
(function(getTotalSupply2) {
|
|
48725
|
-
function
|
|
48725
|
+
function call3(client, args) {
|
|
48726
48726
|
return defineCall({
|
|
48727
48727
|
address: resolveToken(client, args).address,
|
|
48728
48728
|
abi: erc20Abi,
|
|
@@ -48730,7 +48730,7 @@ async function getTotalSupply(client, parameters) {
|
|
|
48730
48730
|
functionName: "totalSupply"
|
|
48731
48731
|
});
|
|
48732
48732
|
}
|
|
48733
|
-
Object.defineProperty(getTotalSupply2, "call", { configurable: true, enumerable: true, value:
|
|
48733
|
+
Object.defineProperty(getTotalSupply2, "call", { configurable: true, enumerable: true, value: call3, writable: true });
|
|
48734
48734
|
})(getTotalSupply || (getTotalSupply = {}));
|
|
48735
48735
|
|
|
48736
48736
|
// ../node_modules/viem/_esm/actions/token/transfer.js
|
|
@@ -48746,10 +48746,10 @@ async function transfer(client, parameters) {
|
|
|
48746
48746
|
});
|
|
48747
48747
|
}
|
|
48748
48748
|
transfer2.inner = inner;
|
|
48749
|
-
function
|
|
48749
|
+
function call3(client, parameters) {
|
|
48750
48750
|
return defineCall(getCall2(client, parameters));
|
|
48751
48751
|
}
|
|
48752
|
-
Object.defineProperty(transfer2, "call", { configurable: true, enumerable: true, value:
|
|
48752
|
+
Object.defineProperty(transfer2, "call", { configurable: true, enumerable: true, value: call3, writable: true });
|
|
48753
48753
|
async function estimateGas2(client, parameters) {
|
|
48754
48754
|
return estimateContractGas(client, {
|
|
48755
48755
|
...pickWriteParameters(parameters),
|
|
@@ -49374,9 +49374,11 @@ function http(url2, config2 = {}) {
|
|
|
49374
49374
|
init_decodeErrorResult();
|
|
49375
49375
|
init_encodeAbiParameters();
|
|
49376
49376
|
init_encodeFunctionData();
|
|
49377
|
+
init_getAddress();
|
|
49377
49378
|
init_isAddress();
|
|
49378
49379
|
init_isHex();
|
|
49379
49380
|
init_pad();
|
|
49381
|
+
init_toHex();
|
|
49380
49382
|
init_keccak256();
|
|
49381
49383
|
|
|
49382
49384
|
// ../node_modules/viem/_esm/accounts/privateKeyToAccount.js
|
|
@@ -49521,33 +49523,54 @@ function privateKeyToAccount(privateKey, options = {}) {
|
|
|
49521
49523
|
// ../sdk/src/abis.ts
|
|
49522
49524
|
var abis_exports = {};
|
|
49523
49525
|
__export(abis_exports, {
|
|
49526
|
+
aaveV3Abi: () => aaveV3Abi,
|
|
49524
49527
|
accountAbi: () => accountAbi,
|
|
49525
49528
|
acrossAbi: () => acrossAbi,
|
|
49526
49529
|
adapterAbi: () => adapterAbi,
|
|
49530
|
+
aeroLiquidityAbi: () => aeroLiquidityAbi,
|
|
49531
|
+
aeroSlipstreamAbi: () => aeroSlipstreamAbi,
|
|
49527
49532
|
automationAbi: () => automationAbi,
|
|
49533
|
+
beefyAbi: () => beefyAbi,
|
|
49534
|
+
ccipAbi: () => ccipAbi,
|
|
49535
|
+
compoundAbi: () => compoundAbi,
|
|
49528
49536
|
dcaAbi: () => dcaAbi,
|
|
49529
49537
|
entryPointAbi: () => entryPointAbi,
|
|
49530
49538
|
erc20Abi: () => erc20Abi2,
|
|
49531
49539
|
erc4626Abi: () => erc4626Abi,
|
|
49540
|
+
erc8004Abi: () => erc8004Abi,
|
|
49532
49541
|
factoryAbi: () => factoryAbi,
|
|
49533
49542
|
familyTransferAbi: () => familyTransferAbi,
|
|
49534
49543
|
flapAbi: () => flapAbi,
|
|
49535
49544
|
gateAbi: () => gateAbi,
|
|
49545
|
+
layerZeroOftAbi: () => layerZeroOftAbi,
|
|
49546
|
+
lighterAbi: () => lighterAbi,
|
|
49547
|
+
listaLendingAbi: () => listaLendingAbi,
|
|
49536
49548
|
morphoBlueAbi: () => morphoBlueAbi,
|
|
49549
|
+
morphoBorrowAbi: () => morphoBorrowAbi,
|
|
49550
|
+
oneInchAbi: () => oneInchAbi,
|
|
49551
|
+
pancakeInfinityAbi: () => pancakeInfinityAbi,
|
|
49552
|
+
pancakeV3Abi: () => pancakeV3Abi,
|
|
49553
|
+
pauseGuardAbi: () => pauseGuardAbi,
|
|
49554
|
+
pendleAbi: () => pendleAbi,
|
|
49537
49555
|
ponsAbi: () => ponsAbi,
|
|
49556
|
+
priorsAbi: () => priorsAbi,
|
|
49538
49557
|
rebalanceAbi: () => rebalanceAbi,
|
|
49539
49558
|
rootValidatorAbi: () => rootValidatorAbi,
|
|
49540
49559
|
routerAbi: () => routerAbi,
|
|
49541
49560
|
safe7579Abi: () => safe7579Abi,
|
|
49542
49561
|
signerAbi: () => signerAbi,
|
|
49543
49562
|
subVaultsAbi: () => subVaultsAbi,
|
|
49563
|
+
sushiAbi: () => sushiAbi,
|
|
49544
49564
|
timelockAbi: () => timelockAbi,
|
|
49545
49565
|
transferAbi: () => transferAbi,
|
|
49566
|
+
uniswapV2Abi: () => uniswapV2Abi,
|
|
49546
49567
|
uniswapV3Abi: () => uniswapV3Abi,
|
|
49547
49568
|
uniswapV3LiquidityAbi: () => uniswapV3LiquidityAbi,
|
|
49548
49569
|
uniswapV4Abi: () => uniswapV4Abi,
|
|
49549
49570
|
uniswapV4LiquidityAbi: () => uniswapV4LiquidityAbi,
|
|
49550
|
-
wethAbi: () => wethAbi
|
|
49571
|
+
wethAbi: () => wethAbi,
|
|
49572
|
+
x402Abi: () => x402Abi,
|
|
49573
|
+
x402EscrowAbi: () => x402EscrowAbi
|
|
49551
49574
|
});
|
|
49552
49575
|
var gateAbi = [{ "type": "function", "name": "ENTRY_POINT", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "PERMIT2", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "acceptChild", "inputs": [{ "name": "child", "type": "address", "internalType": "address" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "agentUntil", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "agent", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint64", "internalType": "uint64" }], "stateMutability": "view" }, { "type": "function", "name": "canUse", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "actor", "type": "address", "internalType": "address" }, { "name": "adapter", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "cap", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "actor", "type": "address", "internalType": "address" }, { "name": "token", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "tuple", "internalType": "struct MortiseGate.Cap", "components": [{ "name": "limit", "type": "uint128", "internalType": "uint128" }, { "name": "used", "type": "uint128", "internalType": "uint128" }, { "name": "period", "type": "uint64", "internalType": "uint64" }, { "name": "windowStart", "type": "uint64", "internalType": "uint64" }] }], "stateMutability": "view" }, { "type": "function", "name": "childCount", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "epoch", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "execute", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "actions", "type": "tuple[]", "internalType": "struct Action[]", "components": [{ "name": "adapter", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }] }], "outputs": [{ "name": "results", "type": "bytes[][]", "internalType": "bytes[][]" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "hasOpenFloor", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "actor", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "hasOpenMarkets", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "actor", "type": "address", "internalType": "address" }, { "name": "adapter", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "installed", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "isAgent", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "agent", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "isFamily", "inputs": [{ "name": "a", "type": "address", "internalType": "address" }, { "name": "b", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "isInitialized", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "isMarket", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "adapter", "type": "address", "internalType": "address" }, { "name": "market", "type": "bytes32", "internalType": "bytes32" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "isModule", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "module", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "isModuleType", "inputs": [{ "name": "moduleTypeId", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "pure" }, { "type": "function", "name": "isPaused", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "liveParent", "inputs": [{ "name": "child", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "minRate", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "tokenIn", "type": "address", "internalType": "address" }, { "name": "tokenOut", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "moduleState", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "module", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "bytes", "internalType": "bytes" }], "stateMutability": "view" }, { "type": "function", "name": "onInstall", "inputs": [{ "name": "", "type": "bytes", "internalType": "bytes" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "onUninstall", "inputs": [{ "name": "", "type": "bytes", "internalType": "bytes" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "parentEpoch", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "parentVault", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "pause", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "pauser", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "proposeParent", "inputs": [{ "name": "parent", "type": "address", "internalType": "address" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "proposedParent", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "setAdapterAccess", "inputs": [{ "name": "actor", "type": "address", "internalType": "address" }, { "name": "adapter", "type": "address", "internalType": "address" }, { "name": "allowed", "type": "bool", "internalType": "bool" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setAgent", "inputs": [{ "name": "agent", "type": "address", "internalType": "address" }, { "name": "until", "type": "uint64", "internalType": "uint64" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setCap", "inputs": [{ "name": "actor", "type": "address", "internalType": "address" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "limit", "type": "uint128", "internalType": "uint128" }, { "name": "period", "type": "uint64", "internalType": "uint64" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setMarket", "inputs": [{ "name": "adapter", "type": "address", "internalType": "address" }, { "name": "market", "type": "bytes32", "internalType": "bytes32" }, { "name": "allowed", "type": "bool", "internalType": "bool" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setMinRate", "inputs": [{ "name": "tokenIn", "type": "address", "internalType": "address" }, { "name": "tokenOut", "type": "address", "internalType": "address" }, { "name": "rate", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setModule", "inputs": [{ "name": "module", "type": "address", "internalType": "address" }, { "name": "enabled", "type": "bool", "internalType": "bool" }, { "name": "initState", "type": "bytes", "internalType": "bytes" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setOpenFloor", "inputs": [{ "name": "actor", "type": "address", "internalType": "address" }, { "name": "open", "type": "bool", "internalType": "bool" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setOpenMarkets", "inputs": [{ "name": "actor", "type": "address", "internalType": "address" }, { "name": "adapter", "type": "address", "internalType": "address" }, { "name": "open", "type": "bool", "internalType": "bool" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setPauser", "inputs": [{ "name": "newPauser", "type": "address", "internalType": "address" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "trigger", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "module", "type": "address", "internalType": "address" }], "outputs": [{ "name": "results", "type": "bytes[][]", "internalType": "bytes[][]" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "unlink", "inputs": [{ "name": "child", "type": "address", "internalType": "address" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "unpause", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "event", "name": "ActionExecuted", "inputs": [{ "name": "vault", "type": "address", "indexed": true, "internalType": "address" }, { "name": "actor", "type": "address", "indexed": true, "internalType": "address" }, { "name": "adapter", "type": "address", "indexed": true, "internalType": "address" }, { "name": "market", "type": "bytes32", "indexed": false, "internalType": "bytes32" }], "anonymous": false }, { "type": "event", "name": "AdapterAccessSet", "inputs": [{ "name": "vault", "type": "address", "indexed": true, "internalType": "address" }, { "name": "actor", "type": "address", "indexed": true, "internalType": "address" }, { "name": "adapter", "type": "address", "indexed": true, "internalType": "address" }, { "name": "allowed", "type": "bool", "indexed": false, "internalType": "bool" }], "anonymous": false }, { "type": "event", "name": "AgentSet", "inputs": [{ "name": "vault", "type": "address", "indexed": true, "internalType": "address" }, { "name": "agent", "type": "address", "indexed": true, "internalType": "address" }, { "name": "until", "type": "uint64", "indexed": false, "internalType": "uint64" }], "anonymous": false }, { "type": "event", "name": "CapSet", "inputs": [{ "name": "vault", "type": "address", "indexed": true, "internalType": "address" }, { "name": "actor", "type": "address", "indexed": true, "internalType": "address" }, { "name": "token", "type": "address", "indexed": true, "internalType": "address" }, { "name": "limit", "type": "uint128", "indexed": false, "internalType": "uint128" }, { "name": "period", "type": "uint64", "indexed": false, "internalType": "uint64" }], "anonymous": false }, { "type": "event", "name": "FamilyLinked", "inputs": [{ "name": "child", "type": "address", "indexed": true, "internalType": "address" }, { "name": "parentVault", "type": "address", "indexed": true, "internalType": "address" }, { "name": "childCount", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "FamilyUnlinked", "inputs": [{ "name": "child", "type": "address", "indexed": true, "internalType": "address" }, { "name": "parentVault", "type": "address", "indexed": true, "internalType": "address" }, { "name": "childCount", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "Installed", "inputs": [{ "name": "vault", "type": "address", "indexed": true, "internalType": "address" }, { "name": "epoch", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "MarketSet", "inputs": [{ "name": "vault", "type": "address", "indexed": true, "internalType": "address" }, { "name": "adapter", "type": "address", "indexed": true, "internalType": "address" }, { "name": "market", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "allowed", "type": "bool", "indexed": false, "internalType": "bool" }], "anonymous": false }, { "type": "event", "name": "MinRateSet", "inputs": [{ "name": "vault", "type": "address", "indexed": true, "internalType": "address" }, { "name": "tokenIn", "type": "address", "indexed": true, "internalType": "address" }, { "name": "tokenOut", "type": "address", "indexed": true, "internalType": "address" }, { "name": "rate", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ModuleSet", "inputs": [{ "name": "vault", "type": "address", "indexed": true, "internalType": "address" }, { "name": "module", "type": "address", "indexed": true, "internalType": "address" }, { "name": "enabled", "type": "bool", "indexed": false, "internalType": "bool" }], "anonymous": false }, { "type": "event", "name": "OpenFloorSet", "inputs": [{ "name": "vault", "type": "address", "indexed": true, "internalType": "address" }, { "name": "actor", "type": "address", "indexed": true, "internalType": "address" }, { "name": "open", "type": "bool", "indexed": false, "internalType": "bool" }], "anonymous": false }, { "type": "event", "name": "OpenMarketsSet", "inputs": [{ "name": "vault", "type": "address", "indexed": true, "internalType": "address" }, { "name": "actor", "type": "address", "indexed": true, "internalType": "address" }, { "name": "adapter", "type": "address", "indexed": true, "internalType": "address" }, { "name": "open", "type": "bool", "indexed": false, "internalType": "bool" }], "anonymous": false }, { "type": "event", "name": "Paused", "inputs": [{ "name": "vault", "type": "address", "indexed": true, "internalType": "address" }, { "name": "by", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "PauserSet", "inputs": [{ "name": "vault", "type": "address", "indexed": true, "internalType": "address" }, { "name": "pauser", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ProposedParentSet", "inputs": [{ "name": "child", "type": "address", "indexed": true, "internalType": "address" }, { "name": "proposedParent", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "Uninstalled", "inputs": [{ "name": "vault", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "Unpaused", "inputs": [{ "name": "vault", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "error", "name": "AdapterNotAllowed", "inputs": [{ "name": "adapter", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "AllowanceLeft", "inputs": [{ "name": "token", "type": "address", "internalType": "address" }, { "name": "spender", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "AlreadyInitialized", "inputs": [{ "name": "smartAccount", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "BalanceUnreadable", "inputs": [{ "name": "token", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "BelowMinRate", "inputs": [{ "name": "spent", "type": "uint256", "internalType": "uint256" }, { "name": "received", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "CallNotAllowed", "inputs": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }, { "type": "error", "name": "CapExceeded", "inputs": [{ "name": "token", "type": "address", "internalType": "address" }, { "name": "used", "type": "uint256", "internalType": "uint256" }, { "name": "limit", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "DuplicateToken", "inputs": [{ "name": "token", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "EmptyPlan", "inputs": [] }, { "type": "error", "name": "ForbiddenTarget", "inputs": [{ "name": "target", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "InvalidPeriod", "inputs": [] }, { "type": "error", "name": "MalformedCall", "inputs": [{ "name": "target", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "MarketNotAllowed", "inputs": [{ "name": "adapter", "type": "address", "internalType": "address" }, { "name": "market", "type": "bytes32", "internalType": "bytes32" }] }, { "type": "error", "name": "NoMinRate", "inputs": [{ "name": "tokenIn", "type": "address", "internalType": "address" }, { "name": "tokenOut", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "NotAgent", "inputs": [{ "name": "agent", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "NotInitialized", "inputs": [{ "name": "smartAccount", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "NotInstalled", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "NotLinked", "inputs": [{ "name": "child", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "NotModule", "inputs": [{ "name": "module", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "NotPauser", "inputs": [{ "name": "caller", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "NotProposedParent", "inputs": [{ "name": "child", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "Reentrancy", "inputs": [] }, { "type": "error", "name": "SwapNotSettled", "inputs": [] }, { "type": "error", "name": "UndeclaredEth", "inputs": [] }, { "type": "error", "name": "UndeclaredToken", "inputs": [{ "name": "token", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "VaultPaused", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }] }];
|
|
49553
49576
|
var rootValidatorAbi = [{ "type": "function", "name": "MAX_GUARDIANS", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "MAX_MEMBERS", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "MAX_RECOVERY_DELAY", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "MIN_RECOVERY_DELAY", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "approveRecovery", "inputs": [{ "name": "account", "type": "address", "internalType": "address" }, { "name": "newRoot", "type": "bytes", "internalType": "bytes" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "cancelRecovery", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "executeRecovery", "inputs": [{ "name": "account", "type": "address", "internalType": "address" }, { "name": "newRoot", "type": "bytes", "internalType": "bytes" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "guardiansOf", "inputs": [{ "name": "account", "type": "address", "internalType": "address" }], "outputs": [{ "name": "guardians", "type": "address[]", "internalType": "address[]" }, { "name": "threshold", "type": "uint256", "internalType": "uint256" }, { "name": "delay", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "isInitialized", "inputs": [{ "name": "account", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "isModuleType", "inputs": [{ "name": "moduleTypeId", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "pure" }, { "type": "function", "name": "isPaymasterOnly", "inputs": [{ "name": "account", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "isRootSignature", "inputs": [{ "name": "account", "type": "address", "internalType": "address" }, { "name": "hash", "type": "bytes32", "internalType": "bytes32" }, { "name": "signature", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "isValidSignatureWithSender", "inputs": [{ "name": "", "type": "address", "internalType": "address" }, { "name": "", "type": "bytes32", "internalType": "bytes32" }, { "name": "", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "", "type": "bytes4", "internalType": "bytes4" }], "stateMutability": "pure" }, { "type": "function", "name": "onInstall", "inputs": [{ "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "onUninstall", "inputs": [{ "name": "", "type": "bytes", "internalType": "bytes" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "recoveryNonce", "inputs": [{ "name": "account", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "recoveryOf", "inputs": [{ "name": "account", "type": "address", "internalType": "address" }, { "name": "rootHash", "type": "bytes32", "internalType": "bytes32" }], "outputs": [{ "name": "", "type": "tuple", "internalType": "struct MortiseRootValidator.Recovery", "components": [{ "name": "approvals", "type": "uint256", "internalType": "uint256" }, { "name": "readyAt", "type": "uint256", "internalType": "uint256" }] }], "stateMutability": "view" }, { "type": "function", "name": "rootOf", "inputs": [{ "name": "account", "type": "address", "internalType": "address" }], "outputs": [{ "name": "members", "type": "tuple[]", "internalType": "struct MortiseRootValidator.Member[]", "components": [{ "name": "keyType", "type": "uint8", "internalType": "enum MortiseRootValidator.KeyType" }, { "name": "signer", "type": "address", "internalType": "address" }, { "name": "x", "type": "bytes32", "internalType": "bytes32" }, { "name": "y", "type": "bytes32", "internalType": "bytes32" }] }, { "name": "threshold", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "setGuardians", "inputs": [{ "name": "guardians", "type": "address[]", "internalType": "address[]" }, { "name": "threshold", "type": "uint256", "internalType": "uint256" }, { "name": "delay", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setPaymasterOnly", "inputs": [{ "name": "required", "type": "bool", "internalType": "bool" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setRootKey", "inputs": [{ "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "validateUserOp", "inputs": [{ "name": "userOp", "type": "tuple", "internalType": "struct PackedUserOperation", "components": [{ "name": "sender", "type": "address", "internalType": "address" }, { "name": "nonce", "type": "uint256", "internalType": "uint256" }, { "name": "initCode", "type": "bytes", "internalType": "bytes" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }, { "name": "accountGasLimits", "type": "bytes32", "internalType": "bytes32" }, { "name": "preVerificationGas", "type": "uint256", "internalType": "uint256" }, { "name": "gasFees", "type": "bytes32", "internalType": "bytes32" }, { "name": "paymasterAndData", "type": "bytes", "internalType": "bytes" }, { "name": "signature", "type": "bytes", "internalType": "bytes" }] }, { "name": "userOpHash", "type": "bytes32", "internalType": "bytes32" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "event", "name": "GuardiansSet", "inputs": [{ "name": "account", "type": "address", "indexed": true, "internalType": "address" }, { "name": "guardians", "type": "address[]", "indexed": false, "internalType": "address[]" }, { "name": "threshold", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "delay", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "PaymasterOnlySet", "inputs": [{ "name": "account", "type": "address", "indexed": true, "internalType": "address" }, { "name": "required", "type": "bool", "indexed": false, "internalType": "bool" }], "anonymous": false }, { "type": "event", "name": "RecoveryApproved", "inputs": [{ "name": "account", "type": "address", "indexed": true, "internalType": "address" }, { "name": "guardian", "type": "address", "indexed": true, "internalType": "address" }, { "name": "rootHash", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "approvals", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "RecoveryCancelled", "inputs": [{ "name": "account", "type": "address", "indexed": true, "internalType": "address" }, { "name": "nonce", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "RecoveryExecuted", "inputs": [{ "name": "account", "type": "address", "indexed": true, "internalType": "address" }, { "name": "rootHash", "type": "bytes32", "indexed": true, "internalType": "bytes32" }], "anonymous": false }, { "type": "event", "name": "RecoveryReady", "inputs": [{ "name": "account", "type": "address", "indexed": true, "internalType": "address" }, { "name": "rootHash", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "readyAt", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "newRoot", "type": "bytes", "indexed": false, "internalType": "bytes" }], "anonymous": false }, { "type": "event", "name": "RootCleared", "inputs": [{ "name": "account", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "RootSet", "inputs": [{ "name": "account", "type": "address", "indexed": true, "internalType": "address" }, { "name": "members", "type": "tuple[]", "indexed": false, "internalType": "struct MortiseRootValidator.Member[]", "components": [{ "name": "keyType", "type": "uint8", "internalType": "enum MortiseRootValidator.KeyType" }, { "name": "signer", "type": "address", "internalType": "address" }, { "name": "x", "type": "bytes32", "internalType": "bytes32" }, { "name": "y", "type": "bytes32", "internalType": "bytes32" }] }, { "name": "threshold", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "error", "name": "AlreadyInitialized", "inputs": [{ "name": "smartAccount", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "HookInstalled", "inputs": [] }, { "type": "error", "name": "InvalidGuardians", "inputs": [] }, { "type": "error", "name": "InvalidKey", "inputs": [] }, { "type": "error", "name": "InvalidRoot", "inputs": [] }, { "type": "error", "name": "InvalidTargetAddress", "inputs": [{ "name": "target", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "NotGuardian", "inputs": [{ "name": "caller", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "NotInitialized", "inputs": [{ "name": "smartAccount", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "RecoveryNotReady", "inputs": [{ "name": "rootHash", "type": "bytes32", "internalType": "bytes32" }] }];
|
|
@@ -49572,6 +49595,27 @@ var familyTransferAbi = [{ "type": "constructor", "inputs": [{ "name": "gate", "
|
|
|
49572
49595
|
var dcaAbi = [{ "type": "function", "name": "encodePlan", "inputs": [{ "name": "action", "type": "tuple", "internalType": "struct Action", "components": [{ "name": "adapter", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }] }, { "name": "keeper", "type": "address", "internalType": "address" }, { "name": "interval", "type": "uint64", "internalType": "uint64" }, { "name": "firstAt", "type": "uint64", "internalType": "uint64" }, { "name": "runs", "type": "uint32", "internalType": "uint32" }], "outputs": [{ "name": "", "type": "bytes", "internalType": "bytes" }], "stateMutability": "pure" }, { "type": "function", "name": "propose", "inputs": [{ "name": "", "type": "address", "internalType": "address" }, { "name": "caller", "type": "address", "internalType": "address" }, { "name": "state", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "actions", "type": "tuple[]", "internalType": "struct Action[]", "components": [{ "name": "adapter", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }] }, { "name": "nextState", "type": "bytes", "internalType": "bytes" }], "stateMutability": "view" }, { "type": "error", "name": "Finished", "inputs": [] }, { "type": "error", "name": "NotDue", "inputs": [{ "name": "nextAt", "type": "uint64", "internalType": "uint64" }] }, { "type": "error", "name": "NotKeeper", "inputs": [{ "name": "caller", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "ZeroInterval", "inputs": [] }, { "type": "error", "name": "ZeroKeeper", "inputs": [] }];
|
|
49573
49596
|
var automationAbi = [{ "type": "constructor", "inputs": [{ "name": "gate", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "GATE", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "MAX_INTERVAL", "inputs": [], "outputs": [{ "name": "", "type": "uint64", "internalType": "uint64" }], "stateMutability": "view" }, { "type": "function", "name": "MAX_STEPS", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "MAX_TASKS", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "encodeTasks", "inputs": [{ "name": "tasks", "type": "tuple[]", "internalType": "struct AutomationModule.Task[]", "components": [{ "name": "keeper", "type": "address", "internalType": "address" }, { "name": "nextAt", "type": "uint64", "internalType": "uint64" }, { "name": "interval", "type": "uint64", "internalType": "uint64" }, { "name": "runsLeft", "type": "uint32", "internalType": "uint32" }, { "name": "group", "type": "uint32", "internalType": "uint32" }, { "name": "condition", "type": "tuple", "internalType": "struct AutomationModule.Condition", "components": [{ "name": "feed", "type": "tuple", "internalType": "struct Feed", "components": [{ "name": "feed", "type": "address", "internalType": "address" }, { "name": "maxAge", "type": "uint32", "internalType": "uint32" }, { "name": "stockToken", "type": "address", "internalType": "address" }] }, { "name": "above", "type": "bool", "internalType": "bool" }, { "name": "price", "type": "uint256", "internalType": "uint256" }] }, { "name": "steps", "type": "tuple[]", "internalType": "struct AutomationModule.Step[]", "components": [{ "name": "action", "type": "tuple", "internalType": "struct Action", "components": [{ "name": "adapter", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }] }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "keep", "type": "uint256", "internalType": "uint256" }, { "name": "bps", "type": "uint16", "internalType": "uint16" }, { "name": "word", "type": "uint16", "internalType": "uint16" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }] }] }], "outputs": [{ "name": "", "type": "bytes", "internalType": "bytes" }], "stateMutability": "pure" }, { "type": "function", "name": "propose", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "caller", "type": "address", "internalType": "address" }, { "name": "state", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "actions", "type": "tuple[]", "internalType": "struct Action[]", "components": [{ "name": "adapter", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }] }, { "name": "nextState", "type": "bytes", "internalType": "bytes" }], "stateMutability": "view" }, { "type": "error", "name": "BadTemplate", "inputs": [{ "name": "task", "type": "uint256", "internalType": "uint256" }, { "name": "step", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "InvalidTasks", "inputs": [] }, { "type": "error", "name": "NothingToRun", "inputs": [] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }];
|
|
49574
49597
|
var rebalanceAbi = [{ "type": "constructor", "inputs": [{ "name": "gate", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "GATE", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "MAX_INTERVAL", "inputs": [], "outputs": [{ "name": "", "type": "uint64", "internalType": "uint64" }], "stateMutability": "view" }, { "type": "function", "name": "MAX_PAIRS", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "encodePairs", "inputs": [{ "name": "pairs", "type": "tuple[]", "internalType": "struct RebalanceModule.Pair[]", "components": [{ "name": "keeper", "type": "address", "internalType": "address" }, { "name": "tokenA", "type": "address", "internalType": "address" }, { "name": "tokenB", "type": "address", "internalType": "address" }, { "name": "feedA", "type": "tuple", "internalType": "struct Feed", "components": [{ "name": "feed", "type": "address", "internalType": "address" }, { "name": "maxAge", "type": "uint32", "internalType": "uint32" }, { "name": "stockToken", "type": "address", "internalType": "address" }] }, { "name": "feedB", "type": "tuple", "internalType": "struct Feed", "components": [{ "name": "feed", "type": "address", "internalType": "address" }, { "name": "maxAge", "type": "uint32", "internalType": "uint32" }, { "name": "stockToken", "type": "address", "internalType": "address" }] }, { "name": "targetBpsA", "type": "uint16", "internalType": "uint16" }, { "name": "bandBps", "type": "uint16", "internalType": "uint16" }, { "name": "slippageBps", "type": "uint16", "internalType": "uint16" }, { "name": "interval", "type": "uint64", "internalType": "uint64" }, { "name": "nextAt", "type": "uint64", "internalType": "uint64" }, { "name": "minTradeUsd", "type": "uint256", "internalType": "uint256" }, { "name": "sellA", "type": "tuple", "internalType": "struct Action", "components": [{ "name": "adapter", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }] }, { "name": "wordA", "type": "uint16", "internalType": "uint16" }, { "name": "minOutWordA", "type": "uint16", "internalType": "uint16" }, { "name": "sellB", "type": "tuple", "internalType": "struct Action", "components": [{ "name": "adapter", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }] }, { "name": "wordB", "type": "uint16", "internalType": "uint16" }, { "name": "minOutWordB", "type": "uint16", "internalType": "uint16" }] }], "outputs": [{ "name": "", "type": "bytes", "internalType": "bytes" }], "stateMutability": "pure" }, { "type": "function", "name": "propose", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "caller", "type": "address", "internalType": "address" }, { "name": "state", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "actions", "type": "tuple[]", "internalType": "struct Action[]", "components": [{ "name": "adapter", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }] }, { "name": "nextState", "type": "bytes", "internalType": "bytes" }], "stateMutability": "view" }, { "type": "error", "name": "BadTemplate", "inputs": [{ "name": "pair", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "InvalidPairs", "inputs": [] }, { "type": "error", "name": "NothingToRun", "inputs": [] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }];
|
|
49598
|
+
var uniswapV2Abi = [{ "type": "constructor", "inputs": [{ "name": "gate", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "FACTORY", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "GATE", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "PERMIT2", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "UNIVERSAL_ROUTER", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "WETH", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "plan", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "p", "type": "tuple", "internalType": "struct Plan", "components": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }, { "name": "calls", "type": "tuple[]", "internalType": "struct Execution[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }] }, { "name": "tokens", "type": "address[]", "internalType": "address[]" }, { "name": "isSwap", "type": "bool", "internalType": "bool" }, { "name": "swapIn", "type": "address", "internalType": "address" }, { "name": "swapOut", "type": "address", "internalType": "address" }] }], "stateMutability": "view" }, { "type": "function", "name": "rules", "inputs": [], "outputs": [{ "name": "r", "type": "tuple[]", "internalType": "struct CallRule[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }], "stateMutability": "pure" }, { "type": "error", "name": "NoPair", "inputs": [] }, { "type": "error", "name": "SameToken", "inputs": [] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }, { "type": "error", "name": "ZeroAmount", "inputs": [] }];
|
|
49599
|
+
var pancakeV3Abi = [{ "type": "constructor", "inputs": [{ "name": "gate", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "FACTORY", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "GATE", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "PERMIT2", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "UNIVERSAL_ROUTER", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "WETH", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "plan", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "p", "type": "tuple", "internalType": "struct Plan", "components": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }, { "name": "calls", "type": "tuple[]", "internalType": "struct Execution[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }] }, { "name": "tokens", "type": "address[]", "internalType": "address[]" }, { "name": "isSwap", "type": "bool", "internalType": "bool" }, { "name": "swapIn", "type": "address", "internalType": "address" }, { "name": "swapOut", "type": "address", "internalType": "address" }] }], "stateMutability": "view" }, { "type": "function", "name": "rules", "inputs": [], "outputs": [{ "name": "r", "type": "tuple[]", "internalType": "struct CallRule[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }], "stateMutability": "pure" }, { "type": "error", "name": "NoPool", "inputs": [] }, { "type": "error", "name": "SameToken", "inputs": [] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }, { "type": "error", "name": "ZeroAmount", "inputs": [] }];
|
|
49600
|
+
var pancakeInfinityAbi = [{ "type": "constructor", "inputs": [{ "name": "gate", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "CL_POOL_MANAGER", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "GATE", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "PERMIT2", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "UNIVERSAL_ROUTER", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "plan", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "p", "type": "tuple", "internalType": "struct Plan", "components": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }, { "name": "calls", "type": "tuple[]", "internalType": "struct Execution[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }] }, { "name": "tokens", "type": "address[]", "internalType": "address[]" }, { "name": "isSwap", "type": "bool", "internalType": "bool" }, { "name": "swapIn", "type": "address", "internalType": "address" }, { "name": "swapOut", "type": "address", "internalType": "address" }] }], "stateMutability": "view" }, { "type": "function", "name": "rules", "inputs": [], "outputs": [{ "name": "r", "type": "tuple[]", "internalType": "struct CallRule[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }], "stateMutability": "pure" }, { "type": "error", "name": "NotClPool", "inputs": [] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }, { "type": "error", "name": "ZeroAmount", "inputs": [] }];
|
|
49601
|
+
var aeroSlipstreamAbi = [{ "type": "constructor", "inputs": [{ "name": "gate", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "CL_FACTORY", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "GATE", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "SWAP_ROUTER", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "WETH", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "plan", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "p", "type": "tuple", "internalType": "struct Plan", "components": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }, { "name": "calls", "type": "tuple[]", "internalType": "struct Execution[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }] }, { "name": "tokens", "type": "address[]", "internalType": "address[]" }, { "name": "isSwap", "type": "bool", "internalType": "bool" }, { "name": "swapIn", "type": "address", "internalType": "address" }, { "name": "swapOut", "type": "address", "internalType": "address" }] }], "stateMutability": "view" }, { "type": "function", "name": "rules", "inputs": [], "outputs": [{ "name": "r", "type": "tuple[]", "internalType": "struct CallRule[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }], "stateMutability": "pure" }, { "type": "error", "name": "NoPool", "inputs": [] }, { "type": "error", "name": "SameToken", "inputs": [] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }, { "type": "error", "name": "ZeroAmount", "inputs": [] }];
|
|
49602
|
+
var oneInchAbi = [{ "type": "constructor", "inputs": [{ "name": "gate", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "GATE", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "ROUTER", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "plan", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "p", "type": "tuple", "internalType": "struct Plan", "components": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }, { "name": "calls", "type": "tuple[]", "internalType": "struct Execution[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }] }, { "name": "tokens", "type": "address[]", "internalType": "address[]" }, { "name": "isSwap", "type": "bool", "internalType": "bool" }, { "name": "swapIn", "type": "address", "internalType": "address" }, { "name": "swapOut", "type": "address", "internalType": "address" }] }], "stateMutability": "view" }, { "type": "function", "name": "rules", "inputs": [], "outputs": [{ "name": "r", "type": "tuple[]", "internalType": "struct CallRule[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }], "stateMutability": "pure" }, { "type": "error", "name": "BadLayout", "inputs": [] }, { "type": "error", "name": "MinReturnBelowFloor", "inputs": [{ "name": "minReturn", "type": "uint256", "internalType": "uint256" }, { "name": "floor", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "NotSwap", "inputs": [{ "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }, { "type": "error", "name": "SameToken", "inputs": [] }, { "type": "error", "name": "UnpricedPair", "inputs": [{ "name": "tokenIn", "type": "address", "internalType": "address" }, { "name": "tokenOut", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "UnsupportedFlags", "inputs": [{ "name": "flags", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "WrongEthAmount", "inputs": [{ "name": "declared", "type": "uint256", "internalType": "uint256" }, { "name": "needed", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "WrongReceiver", "inputs": [{ "name": "receiver", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "WrongTokenOut", "inputs": [{ "name": "declared", "type": "address", "internalType": "address" }, { "name": "inCalldata", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }, { "type": "error", "name": "ZeroAmount", "inputs": [] }];
|
|
49603
|
+
var sushiAbi = [{ "type": "constructor", "inputs": [{ "name": "gate", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "GATE", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "RED_SNWAPPER", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "plan", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "p", "type": "tuple", "internalType": "struct Plan", "components": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }, { "name": "calls", "type": "tuple[]", "internalType": "struct Execution[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }] }, { "name": "tokens", "type": "address[]", "internalType": "address[]" }, { "name": "isSwap", "type": "bool", "internalType": "bool" }, { "name": "swapIn", "type": "address", "internalType": "address" }, { "name": "swapOut", "type": "address", "internalType": "address" }] }], "stateMutability": "view" }, { "type": "function", "name": "rules", "inputs": [], "outputs": [{ "name": "r", "type": "tuple[]", "internalType": "struct CallRule[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }], "stateMutability": "pure" }, { "type": "error", "name": "MinReturnBelowFloor", "inputs": [{ "name": "minReturn", "type": "uint256", "internalType": "uint256" }, { "name": "floor", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "NotSnwap", "inputs": [{ "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }, { "type": "error", "name": "SameToken", "inputs": [] }, { "type": "error", "name": "UnpricedPair", "inputs": [{ "name": "tokenIn", "type": "address", "internalType": "address" }, { "name": "tokenOut", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "WrongReceiver", "inputs": [{ "name": "receiver", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }, { "type": "error", "name": "ZeroAmount", "inputs": [] }];
|
|
49604
|
+
var listaLendingAbi = [{ "type": "constructor", "inputs": [{ "name": "gate", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "GATE", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "MOOLAH", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "plan", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "", "type": "tuple", "internalType": "struct Plan", "components": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }, { "name": "calls", "type": "tuple[]", "internalType": "struct Execution[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }] }, { "name": "tokens", "type": "address[]", "internalType": "address[]" }, { "name": "isSwap", "type": "bool", "internalType": "bool" }, { "name": "swapIn", "type": "address", "internalType": "address" }, { "name": "swapOut", "type": "address", "internalType": "address" }] }], "stateMutability": "view" }, { "type": "function", "name": "rules", "inputs": [], "outputs": [{ "name": "r", "type": "tuple[]", "internalType": "struct CallRule[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }], "stateMutability": "pure" }, { "type": "error", "name": "InvalidAmount", "inputs": [] }, { "type": "error", "name": "NotListed", "inputs": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }];
|
|
49605
|
+
var aaveV3Abi = [{ "type": "constructor", "inputs": [{ "name": "pool", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "POOL", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "plan", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "p", "type": "tuple", "internalType": "struct Plan", "components": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }, { "name": "calls", "type": "tuple[]", "internalType": "struct Execution[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }] }, { "name": "tokens", "type": "address[]", "internalType": "address[]" }, { "name": "isSwap", "type": "bool", "internalType": "bool" }, { "name": "swapIn", "type": "address", "internalType": "address" }, { "name": "swapOut", "type": "address", "internalType": "address" }] }], "stateMutability": "view" }, { "type": "function", "name": "rules", "inputs": [], "outputs": [{ "name": "r", "type": "tuple[]", "internalType": "struct CallRule[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }], "stateMutability": "view" }, { "type": "error", "name": "NoReserve", "inputs": [{ "name": "asset", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }, { "type": "error", "name": "ZeroAmount", "inputs": [] }];
|
|
49606
|
+
var priorsAbi = [{ "type": "constructor", "inputs": [{ "name": "gate", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "BORROW", "inputs": [], "outputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], "stateMutability": "view" }, { "type": "function", "name": "GATE", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "LEND", "inputs": [], "outputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], "stateMutability": "view" }, { "type": "function", "name": "POOL", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "USDG", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "borrowOf", "inputs": [{ "name": "agentId", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], "stateMutability": "pure" }, { "type": "function", "name": "plan", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "p", "type": "tuple", "internalType": "struct Plan", "components": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }, { "name": "calls", "type": "tuple[]", "internalType": "struct Execution[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }] }, { "name": "tokens", "type": "address[]", "internalType": "address[]" }, { "name": "isSwap", "type": "bool", "internalType": "bool" }, { "name": "swapIn", "type": "address", "internalType": "address" }, { "name": "swapOut", "type": "address", "internalType": "address" }] }], "stateMutability": "view" }, { "type": "function", "name": "rules", "inputs": [], "outputs": [{ "name": "r", "type": "tuple[]", "internalType": "struct CallRule[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }], "stateMutability": "pure" }, { "type": "error", "name": "DelegateActive", "inputs": [{ "name": "agentId", "type": "uint256", "internalType": "uint256" }, { "name": "delegate", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "NotListed", "inputs": [{ "name": "agentId", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "NotVaultLoan", "inputs": [{ "name": "loanId", "type": "uint256", "internalType": "uint256" }, { "name": "owner", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }, { "type": "error", "name": "ZeroAmount", "inputs": [] }];
|
|
49607
|
+
var beefyAbi = [{ "type": "constructor", "inputs": [{ "name": "gate", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "GATE", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "plan", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "p", "type": "tuple", "internalType": "struct Plan", "components": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }, { "name": "calls", "type": "tuple[]", "internalType": "struct Execution[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }] }, { "name": "tokens", "type": "address[]", "internalType": "address[]" }, { "name": "isSwap", "type": "bool", "internalType": "bool" }, { "name": "swapIn", "type": "address", "internalType": "address" }, { "name": "swapOut", "type": "address", "internalType": "address" }] }], "stateMutability": "view" }, { "type": "function", "name": "rules", "inputs": [], "outputs": [{ "name": "r", "type": "tuple[]", "internalType": "struct CallRule[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }], "stateMutability": "pure" }, { "type": "error", "name": "NotListed", "inputs": [{ "name": "target", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }, { "type": "error", "name": "ZeroAmount", "inputs": [] }];
|
|
49608
|
+
var pendleAbi = [{ "type": "constructor", "inputs": [{ "name": "gate", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "GATE", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "MARKET_FACTORY", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "ROUTER", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "plan", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "p", "type": "tuple", "internalType": "struct Plan", "components": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }, { "name": "calls", "type": "tuple[]", "internalType": "struct Execution[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }] }, { "name": "tokens", "type": "address[]", "internalType": "address[]" }, { "name": "isSwap", "type": "bool", "internalType": "bool" }, { "name": "swapIn", "type": "address", "internalType": "address" }, { "name": "swapOut", "type": "address", "internalType": "address" }] }], "stateMutability": "view" }, { "type": "function", "name": "rules", "inputs": [], "outputs": [{ "name": "r", "type": "tuple[]", "internalType": "struct CallRule[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }], "stateMutability": "pure" }, { "type": "error", "name": "Expired", "inputs": [{ "name": "market", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "NotExpired", "inputs": [{ "name": "market", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "NotListed", "inputs": [{ "name": "market", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "NotPendleMarket", "inputs": [{ "name": "market", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }, { "type": "error", "name": "ZeroAmount", "inputs": [] }];
|
|
49609
|
+
var aeroLiquidityAbi = [{ "type": "constructor", "inputs": [{ "name": "gate", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "FACTORY", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "GATE", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "POSITION_MANAGER", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "plan", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "p", "type": "tuple", "internalType": "struct Plan", "components": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }, { "name": "calls", "type": "tuple[]", "internalType": "struct Execution[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }] }, { "name": "tokens", "type": "address[]", "internalType": "address[]" }, { "name": "isSwap", "type": "bool", "internalType": "bool" }, { "name": "swapIn", "type": "address", "internalType": "address" }, { "name": "swapOut", "type": "address", "internalType": "address" }] }], "stateMutability": "view" }, { "type": "function", "name": "rules", "inputs": [], "outputs": [{ "name": "r", "type": "tuple[]", "internalType": "struct CallRule[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }], "stateMutability": "pure" }, { "type": "error", "name": "NoPool", "inputs": [] }, { "type": "error", "name": "NoPriceBand", "inputs": [{ "name": "token0", "type": "address", "internalType": "address" }, { "name": "token1", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "NotVaultPosition", "inputs": [{ "name": "tokenId", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "PriceOutOfBand", "inputs": [] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }];
|
|
49610
|
+
var lighterAbi = [{ "type": "function", "name": "MARKET", "inputs": [], "outputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], "stateMutability": "view" }, { "type": "function", "name": "USDG", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "USDG_INDEX", "inputs": [], "outputs": [{ "name": "", "type": "uint16", "internalType": "uint16" }], "stateMutability": "view" }, { "type": "function", "name": "ZK_LIGHTER", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "plan", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "p", "type": "tuple", "internalType": "struct Plan", "components": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }, { "name": "calls", "type": "tuple[]", "internalType": "struct Execution[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }] }, { "name": "tokens", "type": "address[]", "internalType": "address[]" }, { "name": "isSwap", "type": "bool", "internalType": "bool" }, { "name": "swapIn", "type": "address", "internalType": "address" }, { "name": "swapOut", "type": "address", "internalType": "address" }] }], "stateMutability": "pure" }, { "type": "function", "name": "rules", "inputs": [], "outputs": [{ "name": "r", "type": "tuple[]", "internalType": "struct CallRule[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }], "stateMutability": "pure" }, { "type": "error", "name": "ZeroAmount", "inputs": [] }];
|
|
49611
|
+
var layerZeroOftAbi = [{ "type": "constructor", "inputs": [{ "name": "gate", "type": "address", "internalType": "address" }, { "name": "oft", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "GATE", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "OFT", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "TOKEN", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "plan", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "p", "type": "tuple", "internalType": "struct Plan", "components": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }, { "name": "calls", "type": "tuple[]", "internalType": "struct Execution[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }] }, { "name": "tokens", "type": "address[]", "internalType": "address[]" }, { "name": "isSwap", "type": "bool", "internalType": "bool" }, { "name": "swapIn", "type": "address", "internalType": "address" }, { "name": "swapOut", "type": "address", "internalType": "address" }] }], "stateMutability": "view" }, { "type": "function", "name": "routeOf", "inputs": [{ "name": "dstEid", "type": "uint32", "internalType": "uint32" }, { "name": "to", "type": "bytes32", "internalType": "bytes32" }, { "name": "minRate", "type": "uint256", "internalType": "uint256" }, { "name": "maxFee", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], "stateMutability": "pure" }, { "type": "function", "name": "rules", "inputs": [], "outputs": [{ "name": "r", "type": "tuple[]", "internalType": "struct CallRule[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }], "stateMutability": "view" }, { "type": "error", "name": "Dust", "inputs": [{ "name": "amountLD", "type": "uint256", "internalType": "uint256" }, { "name": "conversionRate", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "FeeTooHigh", "inputs": [{ "name": "fee", "type": "uint256", "internalType": "uint256" }, { "name": "maxFee", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "NotListed", "inputs": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }, { "type": "error", "name": "ZeroAmount", "inputs": [] }];
|
|
49612
|
+
var ccipAbi = [{ "type": "constructor", "inputs": [{ "name": "gate", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "GATE", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "ROUTER", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "plan", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "p", "type": "tuple", "internalType": "struct Plan", "components": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }, { "name": "calls", "type": "tuple[]", "internalType": "struct Execution[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }] }, { "name": "tokens", "type": "address[]", "internalType": "address[]" }, { "name": "isSwap", "type": "bool", "internalType": "bool" }, { "name": "swapIn", "type": "address", "internalType": "address" }, { "name": "swapOut", "type": "address", "internalType": "address" }] }], "stateMutability": "view" }, { "type": "function", "name": "routeOf", "inputs": [{ "name": "destinationChainSelector", "type": "uint64", "internalType": "uint64" }, { "name": "receiver", "type": "address", "internalType": "address" }, { "name": "token", "type": "address", "internalType": "address" }, { "name": "maxFee", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], "stateMutability": "pure" }, { "type": "function", "name": "rules", "inputs": [], "outputs": [{ "name": "r", "type": "tuple[]", "internalType": "struct CallRule[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }], "stateMutability": "pure" }, { "type": "error", "name": "FeeTooHigh", "inputs": [{ "name": "fee", "type": "uint256", "internalType": "uint256" }, { "name": "maxFee", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "NotListed", "inputs": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }, { "type": "error", "name": "ZeroAmount", "inputs": [] }];
|
|
49613
|
+
var morphoBorrowAbi = [{ "type": "constructor", "inputs": [{ "name": "gate", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "GATE", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "MORPHO", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "checkLtv", "inputs": [{ "name": "params", "type": "tuple", "internalType": "struct MarketParams", "components": [{ "name": "loanToken", "type": "address", "internalType": "address" }, { "name": "collateralToken", "type": "address", "internalType": "address" }, { "name": "oracle", "type": "address", "internalType": "address" }, { "name": "irm", "type": "address", "internalType": "address" }, { "name": "lltv", "type": "uint256", "internalType": "uint256" }] }, { "name": "vault", "type": "address", "internalType": "address" }, { "name": "maxLtv", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "view" }, { "type": "function", "name": "ltvOf", "inputs": [{ "name": "params", "type": "tuple", "internalType": "struct MarketParams", "components": [{ "name": "loanToken", "type": "address", "internalType": "address" }, { "name": "collateralToken", "type": "address", "internalType": "address" }, { "name": "oracle", "type": "address", "internalType": "address" }, { "name": "irm", "type": "address", "internalType": "address" }, { "name": "lltv", "type": "uint256", "internalType": "uint256" }] }, { "name": "vault", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "marketOf", "inputs": [{ "name": "params", "type": "tuple", "internalType": "struct MarketParams", "components": [{ "name": "loanToken", "type": "address", "internalType": "address" }, { "name": "collateralToken", "type": "address", "internalType": "address" }, { "name": "oracle", "type": "address", "internalType": "address" }, { "name": "irm", "type": "address", "internalType": "address" }, { "name": "lltv", "type": "uint256", "internalType": "uint256" }] }, { "name": "maxLtv", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], "stateMutability": "pure" }, { "type": "function", "name": "plan", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "p", "type": "tuple", "internalType": "struct Plan", "components": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }, { "name": "calls", "type": "tuple[]", "internalType": "struct Execution[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }] }, { "name": "tokens", "type": "address[]", "internalType": "address[]" }, { "name": "isSwap", "type": "bool", "internalType": "bool" }, { "name": "swapIn", "type": "address", "internalType": "address" }, { "name": "swapOut", "type": "address", "internalType": "address" }] }], "stateMutability": "view" }, { "type": "function", "name": "rules", "inputs": [], "outputs": [{ "name": "r", "type": "tuple[]", "internalType": "struct CallRule[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }], "stateMutability": "view" }, { "type": "error", "name": "BadCeiling", "inputs": [{ "name": "maxLtv", "type": "uint256", "internalType": "uint256" }, { "name": "lltv", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "LtvAboveCeiling", "inputs": [{ "name": "ltv", "type": "uint256", "internalType": "uint256" }, { "name": "maxLtv", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "NoDebt", "inputs": [] }, { "type": "error", "name": "NotListed", "inputs": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }, { "type": "error", "name": "ZeroAmount", "inputs": [] }];
|
|
49614
|
+
var erc8004Abi = [{ "type": "function", "name": "IDENTITY", "inputs": [], "outputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], "stateMutability": "view" }, { "type": "function", "name": "REGISTRY", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "plan", "inputs": [{ "name": "", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "p", "type": "tuple", "internalType": "struct Plan", "components": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }, { "name": "calls", "type": "tuple[]", "internalType": "struct Execution[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }] }, { "name": "tokens", "type": "address[]", "internalType": "address[]" }, { "name": "isSwap", "type": "bool", "internalType": "bool" }, { "name": "swapIn", "type": "address", "internalType": "address" }, { "name": "swapOut", "type": "address", "internalType": "address" }] }], "stateMutability": "pure" }, { "type": "function", "name": "rules", "inputs": [], "outputs": [{ "name": "r", "type": "tuple[]", "internalType": "struct CallRule[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }], "stateMutability": "pure" }];
|
|
49615
|
+
var x402EscrowAbi = [{ "type": "constructor", "inputs": [{ "name": "token", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "MAX_WINDOW", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "TOKEN", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "TRANSFER_WITH_AUTHORIZATION_TYPEHASH", "inputs": [], "outputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], "stateMutability": "view" }, { "type": "function", "name": "authorize", "inputs": [{ "name": "to", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "validAfter", "type": "uint256", "internalType": "uint256" }, { "name": "validBefore", "type": "uint256", "internalType": "uint256" }, { "name": "nonce", "type": "bytes32", "internalType": "bytes32" }], "outputs": [{ "name": "digest", "type": "bytes32", "internalType": "bytes32" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "digestFor", "inputs": [{ "name": "to", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "validAfter", "type": "uint256", "internalType": "uint256" }, { "name": "validBefore", "type": "uint256", "internalType": "uint256" }, { "name": "nonce", "type": "bytes32", "internalType": "bytes32" }], "outputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], "stateMutability": "view" }, { "type": "function", "name": "digestOf", "inputs": [{ "name": "nonce", "type": "bytes32", "internalType": "bytes32" }], "outputs": [{ "name": "digest", "type": "bytes32", "internalType": "bytes32" }], "stateMutability": "view" }, { "type": "function", "name": "isValidSignature", "inputs": [{ "name": "hash", "type": "bytes32", "internalType": "bytes32" }, { "name": "", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "", "type": "bytes4", "internalType": "bytes4" }], "stateMutability": "view" }, { "type": "function", "name": "payments", "inputs": [{ "name": "digest", "type": "bytes32", "internalType": "bytes32" }], "outputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "validBefore", "type": "uint64", "internalType": "uint64" }, { "name": "closed", "type": "bool", "internalType": "bool" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "nonce", "type": "bytes32", "internalType": "bytes32" }], "stateMutability": "view" }, { "type": "function", "name": "reclaim", "inputs": [{ "name": "nonce", "type": "bytes32", "internalType": "bytes32" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "event", "name": "Authorized", "inputs": [{ "name": "vault", "type": "address", "indexed": true, "internalType": "address" }, { "name": "to", "type": "address", "indexed": true, "internalType": "address" }, { "name": "nonce", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "value", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "validAfter", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "validBefore", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "digest", "type": "bytes32", "indexed": false, "internalType": "bytes32" }], "anonymous": false }, { "type": "event", "name": "Reclaimed", "inputs": [{ "name": "vault", "type": "address", "indexed": true, "internalType": "address" }, { "name": "nonce", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "value", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "error", "name": "AlreadyClosed", "inputs": [{ "name": "nonce", "type": "bytes32", "internalType": "bytes32" }] }, { "type": "error", "name": "AlreadyPaid", "inputs": [{ "name": "nonce", "type": "bytes32", "internalType": "bytes32" }] }, { "type": "error", "name": "BadWindow", "inputs": [] }, { "type": "error", "name": "NonceTaken", "inputs": [{ "name": "nonce", "type": "bytes32", "internalType": "bytes32" }] }, { "type": "error", "name": "SelfPayment", "inputs": [] }, { "type": "error", "name": "StillOpen", "inputs": [{ "name": "validBefore", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "UnknownNonce", "inputs": [{ "name": "nonce", "type": "bytes32", "internalType": "bytes32" }] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }, { "type": "error", "name": "ZeroValue", "inputs": [] }];
|
|
49616
|
+
var x402Abi = [{ "type": "constructor", "inputs": [{ "name": "gate", "type": "address", "internalType": "address" }, { "name": "escrow", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "ESCROW", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "GATE", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "TOKEN", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "plan", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "p", "type": "tuple", "internalType": "struct Plan", "components": [{ "name": "market", "type": "bytes32", "internalType": "bytes32" }, { "name": "calls", "type": "tuple[]", "internalType": "struct Execution[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "value", "type": "uint256", "internalType": "uint256" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }] }, { "name": "tokens", "type": "address[]", "internalType": "address[]" }, { "name": "isSwap", "type": "bool", "internalType": "bool" }, { "name": "swapIn", "type": "address", "internalType": "address" }, { "name": "swapOut", "type": "address", "internalType": "address" }] }], "stateMutability": "view" }, { "type": "function", "name": "rules", "inputs": [], "outputs": [{ "name": "r", "type": "tuple[]", "internalType": "struct CallRule[]", "components": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }] }], "stateMutability": "view" }, { "type": "error", "name": "NotListed", "inputs": [{ "name": "to", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }];
|
|
49617
|
+
var pauseGuardAbi = [{ "type": "constructor", "inputs": [{ "name": "gate", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "GATE", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "MAX_TRIPS", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "isWatcher", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "wallet", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "pause", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setTrips", "inputs": [{ "name": "trips", "type": "tuple[]", "internalType": "struct MortisePauseGuard.Trip[]", "components": [{ "name": "feed", "type": "tuple", "internalType": "struct Feed", "components": [{ "name": "feed", "type": "address", "internalType": "address" }, { "name": "maxAge", "type": "uint32", "internalType": "uint32" }, { "name": "stockToken", "type": "address", "internalType": "address" }] }, { "name": "min", "type": "uint256", "internalType": "uint256" }, { "name": "max", "type": "uint256", "internalType": "uint256" }] }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setWatcher", "inputs": [{ "name": "wallet", "type": "address", "internalType": "address" }, { "name": "allowed", "type": "bool", "internalType": "bool" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "trip", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "index", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "tripsOf", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "tuple[]", "internalType": "struct MortisePauseGuard.Trip[]", "components": [{ "name": "feed", "type": "tuple", "internalType": "struct Feed", "components": [{ "name": "feed", "type": "address", "internalType": "address" }, { "name": "maxAge", "type": "uint32", "internalType": "uint32" }, { "name": "stockToken", "type": "address", "internalType": "address" }] }, { "name": "min", "type": "uint256", "internalType": "uint256" }, { "name": "max", "type": "uint256", "internalType": "uint256" }] }], "stateMutability": "view" }, { "type": "event", "name": "PausedBy", "inputs": [{ "name": "vault", "type": "address", "indexed": true, "internalType": "address" }, { "name": "caller", "type": "address", "indexed": true, "internalType": "address" }, { "name": "tripIndex", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "price", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "TripsSet", "inputs": [{ "name": "vault", "type": "address", "indexed": true, "internalType": "address" }, { "name": "count", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "WatcherSet", "inputs": [{ "name": "vault", "type": "address", "indexed": true, "internalType": "address" }, { "name": "wallet", "type": "address", "indexed": true, "internalType": "address" }, { "name": "allowed", "type": "bool", "indexed": false, "internalType": "bool" }], "anonymous": false }, { "type": "error", "name": "BadTrip", "inputs": [{ "name": "index", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "NotTripped", "inputs": [{ "name": "price", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "NotWatcher", "inputs": [{ "name": "caller", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "TooManyTrips", "inputs": [] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }];
|
|
49618
|
+
var compoundAbi = [{ "type": "constructor", "inputs": [{ "name": "gate", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "DEPOSIT_WINDOW", "inputs": [], "outputs": [{ "name": "", "type": "uint64", "internalType": "uint64" }], "stateMutability": "view" }, { "type": "function", "name": "GATE", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "MAX_INTERVAL", "inputs": [], "outputs": [{ "name": "", "type": "uint64", "internalType": "uint64" }], "stateMutability": "view" }, { "type": "function", "name": "MAX_POSITIONS", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "encodePositions", "inputs": [{ "name": "positions", "type": "tuple[]", "internalType": "struct CompoundModule.Position[]", "components": [{ "name": "keeper", "type": "address", "internalType": "address" }, { "name": "nextAt", "type": "uint64", "internalType": "uint64" }, { "name": "interval", "type": "uint64", "internalType": "uint64" }, { "name": "collectedAt", "type": "uint64", "internalType": "uint64" }, { "name": "collect", "type": "tuple", "internalType": "struct Action", "components": [{ "name": "adapter", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }] }, { "name": "deposit", "type": "tuple", "internalType": "struct Action", "components": [{ "name": "adapter", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }] }, { "name": "token0", "type": "address", "internalType": "address" }, { "name": "token1", "type": "address", "internalType": "address" }, { "name": "word0", "type": "uint16", "internalType": "uint16" }, { "name": "word1", "type": "uint16", "internalType": "uint16" }, { "name": "min0", "type": "uint256", "internalType": "uint256" }, { "name": "min1", "type": "uint256", "internalType": "uint256" }, { "name": "base0", "type": "uint256", "internalType": "uint256" }, { "name": "base1", "type": "uint256", "internalType": "uint256" }] }], "outputs": [{ "name": "", "type": "bytes", "internalType": "bytes" }], "stateMutability": "pure" }, { "type": "function", "name": "propose", "inputs": [{ "name": "vault", "type": "address", "internalType": "address" }, { "name": "caller", "type": "address", "internalType": "address" }, { "name": "state", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "actions", "type": "tuple[]", "internalType": "struct Action[]", "components": [{ "name": "adapter", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }] }, { "name": "nextState", "type": "bytes", "internalType": "bytes" }], "stateMutability": "view" }, { "type": "error", "name": "BadTemplate", "inputs": [{ "name": "position", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "InvalidPositions", "inputs": [] }, { "type": "error", "name": "NothingToRun", "inputs": [] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }];
|
|
49575
49619
|
var accountAbi = [{ "type": "function", "name": "accountId", "inputs": [], "outputs": [{ "name": "accountImplementationId", "type": "string", "internalType": "string" }], "stateMutability": "view" }, { "type": "function", "name": "execute", "inputs": [{ "name": "mode", "type": "bytes32", "internalType": "ModeCode" }, { "name": "executionCalldata", "type": "bytes", "internalType": "bytes" }], "outputs": [], "stateMutability": "payable" }, { "type": "function", "name": "executeFromExecutor", "inputs": [{ "name": "mode", "type": "bytes32", "internalType": "ModeCode" }, { "name": "executionCalldata", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "returnData", "type": "bytes[]", "internalType": "bytes[]" }], "stateMutability": "payable" }, { "type": "function", "name": "installModule", "inputs": [{ "name": "moduleTypeId", "type": "uint256", "internalType": "uint256" }, { "name": "module", "type": "address", "internalType": "address" }, { "name": "initData", "type": "bytes", "internalType": "bytes" }], "outputs": [], "stateMutability": "payable" }, { "type": "function", "name": "isModuleInstalled", "inputs": [{ "name": "moduleTypeId", "type": "uint256", "internalType": "uint256" }, { "name": "module", "type": "address", "internalType": "address" }, { "name": "additionalContext", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "isValidSignature", "inputs": [{ "name": "hash", "type": "bytes32", "internalType": "bytes32" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "", "type": "bytes4", "internalType": "bytes4" }], "stateMutability": "view" }, { "type": "function", "name": "supportsExecutionMode", "inputs": [{ "name": "encodedMode", "type": "bytes32", "internalType": "ModeCode" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "supportsModule", "inputs": [{ "name": "moduleTypeId", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "uninstallModule", "inputs": [{ "name": "moduleTypeId", "type": "uint256", "internalType": "uint256" }, { "name": "module", "type": "address", "internalType": "address" }, { "name": "deInitData", "type": "bytes", "internalType": "bytes" }], "outputs": [], "stateMutability": "payable" }, { "type": "event", "name": "ModuleInstalled", "inputs": [{ "name": "moduleTypeId", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "module", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "ModuleUninstalled", "inputs": [{ "name": "moduleTypeId", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "module", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false }];
|
|
49576
49620
|
var entryPointAbi = [{ "type": "function", "name": "addStake", "inputs": [{ "name": "_unstakeDelaySec", "type": "uint32", "internalType": "uint32" }], "outputs": [], "stateMutability": "payable" }, { "type": "function", "name": "balanceOf", "inputs": [{ "name": "account", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "delegateAndRevert", "inputs": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "depositTo", "inputs": [{ "name": "account", "type": "address", "internalType": "address" }], "outputs": [], "stateMutability": "payable" }, { "type": "function", "name": "getDepositInfo", "inputs": [{ "name": "account", "type": "address", "internalType": "address" }], "outputs": [{ "name": "info", "type": "tuple", "internalType": "struct IStakeManager.DepositInfo", "components": [{ "name": "deposit", "type": "uint256", "internalType": "uint256" }, { "name": "staked", "type": "bool", "internalType": "bool" }, { "name": "stake", "type": "uint112", "internalType": "uint112" }, { "name": "unstakeDelaySec", "type": "uint32", "internalType": "uint32" }, { "name": "withdrawTime", "type": "uint48", "internalType": "uint48" }] }], "stateMutability": "view" }, { "type": "function", "name": "getNonce", "inputs": [{ "name": "sender", "type": "address", "internalType": "address" }, { "name": "key", "type": "uint192", "internalType": "uint192" }], "outputs": [{ "name": "nonce", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "getSenderAddress", "inputs": [{ "name": "initCode", "type": "bytes", "internalType": "bytes" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "getUserOpHash", "inputs": [{ "name": "userOp", "type": "tuple", "internalType": "struct PackedUserOperation", "components": [{ "name": "sender", "type": "address", "internalType": "address" }, { "name": "nonce", "type": "uint256", "internalType": "uint256" }, { "name": "initCode", "type": "bytes", "internalType": "bytes" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }, { "name": "accountGasLimits", "type": "bytes32", "internalType": "bytes32" }, { "name": "preVerificationGas", "type": "uint256", "internalType": "uint256" }, { "name": "gasFees", "type": "bytes32", "internalType": "bytes32" }, { "name": "paymasterAndData", "type": "bytes", "internalType": "bytes" }, { "name": "signature", "type": "bytes", "internalType": "bytes" }] }], "outputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], "stateMutability": "view" }, { "type": "function", "name": "handleAggregatedOps", "inputs": [{ "name": "opsPerAggregator", "type": "tuple[]", "internalType": "struct IEntryPoint.UserOpsPerAggregator[]", "components": [{ "name": "userOps", "type": "tuple[]", "internalType": "struct PackedUserOperation[]", "components": [{ "name": "sender", "type": "address", "internalType": "address" }, { "name": "nonce", "type": "uint256", "internalType": "uint256" }, { "name": "initCode", "type": "bytes", "internalType": "bytes" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }, { "name": "accountGasLimits", "type": "bytes32", "internalType": "bytes32" }, { "name": "preVerificationGas", "type": "uint256", "internalType": "uint256" }, { "name": "gasFees", "type": "bytes32", "internalType": "bytes32" }, { "name": "paymasterAndData", "type": "bytes", "internalType": "bytes" }, { "name": "signature", "type": "bytes", "internalType": "bytes" }] }, { "name": "aggregator", "type": "address", "internalType": "contract IAggregator" }, { "name": "signature", "type": "bytes", "internalType": "bytes" }] }, { "name": "beneficiary", "type": "address", "internalType": "address payable" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "handleOps", "inputs": [{ "name": "ops", "type": "tuple[]", "internalType": "struct PackedUserOperation[]", "components": [{ "name": "sender", "type": "address", "internalType": "address" }, { "name": "nonce", "type": "uint256", "internalType": "uint256" }, { "name": "initCode", "type": "bytes", "internalType": "bytes" }, { "name": "callData", "type": "bytes", "internalType": "bytes" }, { "name": "accountGasLimits", "type": "bytes32", "internalType": "bytes32" }, { "name": "preVerificationGas", "type": "uint256", "internalType": "uint256" }, { "name": "gasFees", "type": "bytes32", "internalType": "bytes32" }, { "name": "paymasterAndData", "type": "bytes", "internalType": "bytes" }, { "name": "signature", "type": "bytes", "internalType": "bytes" }] }, { "name": "beneficiary", "type": "address", "internalType": "address payable" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "incrementNonce", "inputs": [{ "name": "key", "type": "uint192", "internalType": "uint192" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "unlockStake", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "withdrawStake", "inputs": [{ "name": "withdrawAddress", "type": "address", "internalType": "address payable" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "withdrawTo", "inputs": [{ "name": "withdrawAddress", "type": "address", "internalType": "address payable" }, { "name": "withdrawAmount", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "event", "name": "AccountDeployed", "inputs": [{ "name": "userOpHash", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "sender", "type": "address", "indexed": true, "internalType": "address" }, { "name": "factory", "type": "address", "indexed": false, "internalType": "address" }, { "name": "paymaster", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "BeforeExecution", "inputs": [], "anonymous": false }, { "type": "event", "name": "Deposited", "inputs": [{ "name": "account", "type": "address", "indexed": true, "internalType": "address" }, { "name": "totalDeposit", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "PostOpRevertReason", "inputs": [{ "name": "userOpHash", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "sender", "type": "address", "indexed": true, "internalType": "address" }, { "name": "nonce", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "revertReason", "type": "bytes", "indexed": false, "internalType": "bytes" }], "anonymous": false }, { "type": "event", "name": "SignatureAggregatorChanged", "inputs": [{ "name": "aggregator", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "StakeLocked", "inputs": [{ "name": "account", "type": "address", "indexed": true, "internalType": "address" }, { "name": "totalStaked", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "unstakeDelaySec", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "StakeUnlocked", "inputs": [{ "name": "account", "type": "address", "indexed": true, "internalType": "address" }, { "name": "withdrawTime", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "StakeWithdrawn", "inputs": [{ "name": "account", "type": "address", "indexed": true, "internalType": "address" }, { "name": "withdrawAddress", "type": "address", "indexed": false, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "UserOperationEvent", "inputs": [{ "name": "userOpHash", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "sender", "type": "address", "indexed": true, "internalType": "address" }, { "name": "paymaster", "type": "address", "indexed": true, "internalType": "address" }, { "name": "nonce", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "success", "type": "bool", "indexed": false, "internalType": "bool" }, { "name": "actualGasCost", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "actualGasUsed", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "UserOperationPrefundTooLow", "inputs": [{ "name": "userOpHash", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "sender", "type": "address", "indexed": true, "internalType": "address" }, { "name": "nonce", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "UserOperationRevertReason", "inputs": [{ "name": "userOpHash", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "sender", "type": "address", "indexed": true, "internalType": "address" }, { "name": "nonce", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "revertReason", "type": "bytes", "indexed": false, "internalType": "bytes" }], "anonymous": false }, { "type": "event", "name": "Withdrawn", "inputs": [{ "name": "account", "type": "address", "indexed": true, "internalType": "address" }, { "name": "withdrawAddress", "type": "address", "indexed": false, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "error", "name": "DelegateAndRevert", "inputs": [{ "name": "success", "type": "bool", "internalType": "bool" }, { "name": "ret", "type": "bytes", "internalType": "bytes" }] }, { "type": "error", "name": "FailedOp", "inputs": [{ "name": "opIndex", "type": "uint256", "internalType": "uint256" }, { "name": "reason", "type": "string", "internalType": "string" }] }, { "type": "error", "name": "FailedOpWithRevert", "inputs": [{ "name": "opIndex", "type": "uint256", "internalType": "uint256" }, { "name": "reason", "type": "string", "internalType": "string" }, { "name": "inner", "type": "bytes", "internalType": "bytes" }] }, { "type": "error", "name": "PostOpReverted", "inputs": [{ "name": "returnData", "type": "bytes", "internalType": "bytes" }] }, { "type": "error", "name": "SenderAddressResult", "inputs": [{ "name": "sender", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "SignatureValidationFailed", "inputs": [{ "name": "aggregator", "type": "address", "internalType": "address" }] }];
|
|
49577
49621
|
var erc20Abi2 = [{ "type": "function", "name": "allowance", "inputs": [{ "name": "owner", "type": "address", "internalType": "address" }, { "name": "spender", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "approve", "inputs": [{ "name": "spender", "type": "address", "internalType": "address" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "balanceOf", "inputs": [{ "name": "account", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "decimals", "inputs": [], "outputs": [{ "name": "", "type": "uint8", "internalType": "uint8" }], "stateMutability": "view" }, { "type": "function", "name": "name", "inputs": [], "outputs": [{ "name": "", "type": "string", "internalType": "string" }], "stateMutability": "view" }, { "type": "function", "name": "symbol", "inputs": [], "outputs": [{ "name": "", "type": "string", "internalType": "string" }], "stateMutability": "view" }, { "type": "function", "name": "totalSupply", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "transfer", "inputs": [{ "name": "to", "type": "address", "internalType": "address" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "transferFrom", "inputs": [{ "name": "from", "type": "address", "internalType": "address" }, { "name": "to", "type": "address", "internalType": "address" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "nonpayable" }, { "type": "event", "name": "Approval", "inputs": [{ "name": "owner", "type": "address", "indexed": true, "internalType": "address" }, { "name": "spender", "type": "address", "indexed": true, "internalType": "address" }, { "name": "value", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "Transfer", "inputs": [{ "name": "from", "type": "address", "indexed": true, "internalType": "address" }, { "name": "to", "type": "address", "indexed": true, "internalType": "address" }, { "name": "value", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }];
|
|
@@ -49609,7 +49653,28 @@ var mortise = {
|
|
|
49609
49653
|
familyTransfer: "0x398f4003F11197d70744D14423114D81280B5042",
|
|
49610
49654
|
dca: "0xC319309684725a0cF3F712F630A9e7c63ACE345a",
|
|
49611
49655
|
automation: "0x2aFf436334EbcafA4233363fcAf95bFE63219d7d",
|
|
49612
|
-
rebalance: "0xe6e501a2A6422587E8c81813B805D52B4b4fFc57"
|
|
49656
|
+
rebalance: "0xe6e501a2A6422587E8c81813B805D52B4b4fFc57",
|
|
49657
|
+
uniswapV2: "0x41D0Be363De3b05F4A3C94820B690b1851A8a1Ed",
|
|
49658
|
+
pancakeV3: "0xe35C76466C723C88E75B12469E813488065b6Eab",
|
|
49659
|
+
pancakeInfinity: "0x1e403cf84375845216EB8335C84724033FB4FE44",
|
|
49660
|
+
aeroSlipstream: "0x8Ef073497C2782b31Bd691A8230FDcc6E9c1Aa0C",
|
|
49661
|
+
oneInch: "0xBBf54683bEa7964D4F54F68e61F50053e4a348FF",
|
|
49662
|
+
sushi: "0xF03FDF71b37473865B7aee99ff1349458efE6bD1",
|
|
49663
|
+
listaLending: "0x91880854d8738564FcC681E2A14CD9186e7a0508",
|
|
49664
|
+
aaveV3: "0x3b1e415443ccBB11c5B0e64a71A33c6F3Ab70989",
|
|
49665
|
+
priors: "0xc7FB4a6B54b3ba55E31A7F58bA5d45169B2A6Fe9",
|
|
49666
|
+
beefy: "0x61dB2eFA7561A9b99E3226d118b5Db9b7F63b92a",
|
|
49667
|
+
pendle: "0xe7B2BbFc3b2d5eE81991043A1FE35B52D86Fa249",
|
|
49668
|
+
aeroLiquidity: "0x61DF34fE62a3276D819EA9D599479615b63a1DB0",
|
|
49669
|
+
lighter: "0xEE4CBD35bA70cd69d71D3b130f142b1886f7F67a",
|
|
49670
|
+
layerZeroOft: "0x61FE2335508cB2Cf818b173d6900bAE8cC720eAf",
|
|
49671
|
+
ccip: "0xfA875b19C28d32eeebfc5cE2d33dF1Df634f06e9",
|
|
49672
|
+
morphoBorrow: "0xA89b35F26466d28D4270B728DA6B6643888707f0",
|
|
49673
|
+
erc8004: "0x40714A05fF27C0fF24106299b1b584BCaedAa76b",
|
|
49674
|
+
x402Escrow: "0x0fCB7f2e7023e94eCD7c31D831b3f172931723e1",
|
|
49675
|
+
x402: "0xa3e7A52413be4c050f9d613c00b614f5dc59cCEb",
|
|
49676
|
+
pauseGuard: "0x0a880ce9c5D521AC35Dd7215238a84EB715e8eb0",
|
|
49677
|
+
compound: "0xfd774AdE825d243B08b4e028B59216E39A0Cd4a0"
|
|
49613
49678
|
};
|
|
49614
49679
|
var external = {
|
|
49615
49680
|
entryPoint: "0x0000000071727De22E5E9d8BAf0edAc6f37da032",
|
|
@@ -49643,12 +49708,12 @@ function decodeMortiseError(data) {
|
|
|
49643
49708
|
}
|
|
49644
49709
|
}
|
|
49645
49710
|
function revertData(err) {
|
|
49646
|
-
const
|
|
49711
|
+
const hex4 = (v) => typeof v === "string" && v.startsWith("0x") && v.length >= 10 ? v : void 0;
|
|
49647
49712
|
let found;
|
|
49648
49713
|
let e = err;
|
|
49649
49714
|
for (let depth = 0; e && typeof e === "object" && depth < 20; depth++) {
|
|
49650
49715
|
const data = e.data;
|
|
49651
|
-
found =
|
|
49716
|
+
found = hex4(data) ?? hex4(e.raw) ?? (data && typeof data === "object" ? hex4(data.data) : void 0);
|
|
49652
49717
|
if (found) return found;
|
|
49653
49718
|
e = e.cause;
|
|
49654
49719
|
}
|
|
@@ -49659,6 +49724,12 @@ function revertData(err) {
|
|
|
49659
49724
|
var MODULE_TYPE = { validator: 1n, executor: 2n, fallback: 3n, hook: 4n };
|
|
49660
49725
|
var BATCH_MODE = pad("0x01", { dir: "right", size: 32 });
|
|
49661
49726
|
|
|
49727
|
+
// ../sdk/src/calls.ts
|
|
49728
|
+
var call2 = (to, data, value = 0n) => ({ to, data, value });
|
|
49729
|
+
var x402Escrow = {
|
|
49730
|
+
reclaim: (nonce) => call2(mortise.x402Escrow, encodeFunctionData({ abi: x402EscrowAbi, functionName: "reclaim", args: [nonce] }))
|
|
49731
|
+
};
|
|
49732
|
+
|
|
49662
49733
|
// ../sdk/src/actions.ts
|
|
49663
49734
|
var poolKeyType = {
|
|
49664
49735
|
type: "tuple",
|
|
@@ -49680,6 +49751,35 @@ var marketParamsType = {
|
|
|
49680
49751
|
{ name: "lltv", type: "uint256" }
|
|
49681
49752
|
]
|
|
49682
49753
|
};
|
|
49754
|
+
var infinityPoolKeyType = {
|
|
49755
|
+
type: "tuple",
|
|
49756
|
+
components: [
|
|
49757
|
+
{ name: "currency0", type: "address" },
|
|
49758
|
+
{ name: "currency1", type: "address" },
|
|
49759
|
+
{ name: "hooks", type: "address" },
|
|
49760
|
+
{ name: "poolManager", type: "address" },
|
|
49761
|
+
{ name: "fee", type: "uint24" },
|
|
49762
|
+
{ name: "parameters", type: "bytes32" }
|
|
49763
|
+
]
|
|
49764
|
+
};
|
|
49765
|
+
var changeType = {
|
|
49766
|
+
type: "tuple",
|
|
49767
|
+
components: [
|
|
49768
|
+
{ name: "tokenId", type: "uint256" },
|
|
49769
|
+
{ name: "liquidity", type: "uint128" },
|
|
49770
|
+
{ name: "amount0", type: "uint256" },
|
|
49771
|
+
{ name: "amount1", type: "uint256" },
|
|
49772
|
+
{ name: "amount0Min", type: "uint256" },
|
|
49773
|
+
{ name: "amount1Min", type: "uint256" }
|
|
49774
|
+
]
|
|
49775
|
+
};
|
|
49776
|
+
var X402_SIGNATURE = `0x${"0".repeat(63)}1${"0".repeat(63)}11b`;
|
|
49777
|
+
function poolId(key2) {
|
|
49778
|
+
return keccak256(encodeAbiParameters([poolKeyType], [key2]));
|
|
49779
|
+
}
|
|
49780
|
+
function morphoMarketId(m) {
|
|
49781
|
+
return keccak256(encodeAbiParameters([marketParamsType], [m]));
|
|
49782
|
+
}
|
|
49683
49783
|
var actions = {
|
|
49684
49784
|
/** Exact-input swap on one Uniswap v3 pool; address(0) is ETH. The minimum is raised to the vault's floor. */
|
|
49685
49785
|
uniswapV3Swap: (a) => ({
|
|
@@ -49795,7 +49895,191 @@ var actions = {
|
|
|
49795
49895
|
args = encodeAbiParameters([{ type: "uint256" }, { type: "uint128" }, { type: "uint128" }], [a.tokenId, a.amount0Min, a.amount1Min]);
|
|
49796
49896
|
}
|
|
49797
49897
|
return { adapter: mortise.uniswapV4Liquidity, data: encodeAbiParameters([{ type: "uint8" }, { type: "bytes" }], [op, args]) };
|
|
49798
|
-
}
|
|
49898
|
+
},
|
|
49899
|
+
/** Exact-input swap on one Uniswap v2 pair; address(0) is ETH. The minimum is raised to the vault's floor. */
|
|
49900
|
+
uniswapV2Swap: (a) => ({
|
|
49901
|
+
adapter: mortise.uniswapV2,
|
|
49902
|
+
data: encodeAbiParameters([{ type: "address" }, { type: "address" }, { type: "uint256" }, { type: "uint256" }], [a.tokenIn, a.tokenOut, a.amountIn, a.amountOutMinimum])
|
|
49903
|
+
}),
|
|
49904
|
+
/** Exact-input swap on one PancakeSwap v3 pool; address(0) is ETH. */
|
|
49905
|
+
pancakeV3Swap: (a) => ({
|
|
49906
|
+
adapter: mortise.pancakeV3,
|
|
49907
|
+
data: encodeAbiParameters([{ type: "address" }, { type: "address" }, { type: "uint24" }, { type: "uint128" }, { type: "uint128" }], [a.tokenIn, a.tokenOut, a.fee, a.amountIn, a.amountOutMinimum])
|
|
49908
|
+
}),
|
|
49909
|
+
/** Exact-input swap on one PancakeSwap Infinity CL pool. */
|
|
49910
|
+
pancakeInfinitySwap: (a) => ({
|
|
49911
|
+
adapter: mortise.pancakeInfinity,
|
|
49912
|
+
data: encodeAbiParameters([infinityPoolKeyType, { type: "bool" }, { type: "uint128" }, { type: "uint128" }], [a.key, a.zeroForOne, a.amountIn, a.amountOutMinimum])
|
|
49913
|
+
}),
|
|
49914
|
+
/** Exact-input swap on one Aero Slipstream (CL) pool, chosen by tick spacing; address(0) is ETH. */
|
|
49915
|
+
aeroSlipstreamSwap: (a) => ({
|
|
49916
|
+
adapter: mortise.aeroSlipstream,
|
|
49917
|
+
data: encodeAbiParameters([{ type: "address" }, { type: "address" }, { type: "int24" }, { type: "uint128" }, { type: "uint128" }], [a.tokenIn, a.tokenOut, a.tickSpacing, a.amountIn, a.amountOutMinimum])
|
|
49918
|
+
}),
|
|
49919
|
+
/** A 1inch v6 router call from 1inch's swap API (swap or unoswap); tokenOut is what the vault receives, ethIn the
|
|
49920
|
+
* ETH sent with it (0 for an ERC-20 input). The router must pay the vault. */
|
|
49921
|
+
oneInch: (a) => ({
|
|
49922
|
+
adapter: mortise.oneInch,
|
|
49923
|
+
data: encodeAbiParameters([{ type: "address" }, { type: "uint256" }, { type: "bytes" }], [a.tokenOut, a.ethIn, a.routerCalldata])
|
|
49924
|
+
}),
|
|
49925
|
+
/** A Sushi RedSnwapper snwap call from Sushi's swap API, as is. The recipient must be the vault. */
|
|
49926
|
+
sushi: (a) => ({ adapter: mortise.sushi, data: a.snwapCalldata }),
|
|
49927
|
+
/** Supply or withdraw the loan token of a listed Lista Lending (Moolah) market; give either assets or shares, the other 0. */
|
|
49928
|
+
listaLending: (a) => ({
|
|
49929
|
+
adapter: mortise.listaLending,
|
|
49930
|
+
data: encodeAbiParameters([{ type: "uint8" }, marketParamsType, { type: "uint256" }, { type: "uint256" }], [a.op === "supply" ? 0 : 1, a.market, a.assets, a.shares])
|
|
49931
|
+
}),
|
|
49932
|
+
/** Supply an asset to Aave v3 (Kaskad) or withdraw it; maxUint256 withdraws the whole position. */
|
|
49933
|
+
aaveV3: (a) => ({
|
|
49934
|
+
adapter: mortise.aaveV3,
|
|
49935
|
+
data: encodeAbiParameters([{ type: "uint8" }, { type: "address" }, { type: "uint256" }], [a.op === "supply" ? 0 : 1, a.asset, a.amount])
|
|
49936
|
+
}),
|
|
49937
|
+
/** The Priors credit pool: lend USDG (deposit, withdraw shares), or borrow on a listed agent identity and repay a loan. */
|
|
49938
|
+
priors: (a) => {
|
|
49939
|
+
const v = a.op === "deposit" ? [0, 0n, a.amount, a.minShares, 0n] : a.op === "withdraw" ? [1, 0n, a.shares, 0n, 0n] : a.op === "borrow" ? [2, a.agentId, a.amount, a.maxFee, a.term] : [3, a.loanId, 0n, 0n, 0n];
|
|
49940
|
+
return {
|
|
49941
|
+
adapter: mortise.priors,
|
|
49942
|
+
data: encodeAbiParameters([{ type: "uint8" }, { type: "uint256" }, { type: "uint256" }, { type: "uint256" }, { type: "uint64" }], v)
|
|
49943
|
+
};
|
|
49944
|
+
},
|
|
49945
|
+
/** Beefy: a Cowcentrated Liquidity Manager (clm*) or a Beefy vault (vault*), at a listed target. */
|
|
49946
|
+
beefy: (a) => {
|
|
49947
|
+
const v = a.op === "clmDeposit" ? [0, a.target, a.amount0, a.amount1, a.minShares] : a.op === "clmWithdraw" ? [1, a.target, a.shares, a.minAmount0, a.minAmount1] : a.op === "vaultDeposit" ? [2, a.target, a.amount, 0n, 0n] : [3, a.target, a.shares, 0n, 0n];
|
|
49948
|
+
return {
|
|
49949
|
+
adapter: mortise.beefy,
|
|
49950
|
+
data: encodeAbiParameters([{ type: "uint8" }, { type: "address" }, { type: "uint256" }, { type: "uint256" }, { type: "uint256" }], v)
|
|
49951
|
+
};
|
|
49952
|
+
},
|
|
49953
|
+
/** Pendle PT on a listed market: buy with a token, sell before maturity, redeem after. amountIn is the token for buy
|
|
49954
|
+
* and the PT for sell and redeem; the token must be one the market's SY takes directly. */
|
|
49955
|
+
pendle: (a) => ({
|
|
49956
|
+
adapter: mortise.pendle,
|
|
49957
|
+
data: encodeAbiParameters(
|
|
49958
|
+
[{ type: "uint8" }, { type: "address" }, { type: "address" }, { type: "uint256" }, { type: "uint256" }],
|
|
49959
|
+
[{ buy: 0, sell: 1, redeem: 2 }[a.op], a.market, a.token, a.amountIn, a.minOut]
|
|
49960
|
+
)
|
|
49961
|
+
}),
|
|
49962
|
+
/** Aero CL positions: Mint and Increase take up to amount0/amount1; Decrease takes `liquidity`. ERC-20 pairs only. */
|
|
49963
|
+
aeroLiquidity: (a) => {
|
|
49964
|
+
let op;
|
|
49965
|
+
let args;
|
|
49966
|
+
if (a.op === "mint") {
|
|
49967
|
+
op = 0;
|
|
49968
|
+
args = encodeAbiParameters(
|
|
49969
|
+
[{ type: "tuple", components: [{ name: "token0", type: "address" }, { name: "token1", type: "address" }, { name: "tickSpacing", type: "int24" }, { name: "tickLower", type: "int24" }, { name: "tickUpper", type: "int24" }, { name: "amount0", type: "uint256" }, { name: "amount1", type: "uint256" }, { name: "amount0Min", type: "uint256" }, { name: "amount1Min", type: "uint256" }] }],
|
|
49970
|
+
[a]
|
|
49971
|
+
);
|
|
49972
|
+
} else if (a.op === "increase" || a.op === "decrease") {
|
|
49973
|
+
op = a.op === "increase" ? 1 : 2;
|
|
49974
|
+
args = encodeAbiParameters([changeType], [a]);
|
|
49975
|
+
} else {
|
|
49976
|
+
op = a.op === "collect" ? 3 : 4;
|
|
49977
|
+
args = encodeAbiParameters([{ type: "uint256" }], [a.tokenId]);
|
|
49978
|
+
}
|
|
49979
|
+
return { adapter: mortise.aeroLiquidity, data: encodeAbiParameters([{ type: "uint8" }, { type: "bytes" }], [op, args]) };
|
|
49980
|
+
},
|
|
49981
|
+
/** USDG margin in the vault's own Lighter account: deposit (at least Lighter's 1 USDG minimum), withdraw (paid back to
|
|
49982
|
+
* the vault), claim a pending balance, or cancel every open order. Amounts in USDG raw units. */
|
|
49983
|
+
lighter: (a) => {
|
|
49984
|
+
const v = a.op === "deposit" ? [0, 0, a.amount] : a.op === "withdraw" ? [1, a.accountIndex, a.amount] : a.op === "claim" ? [2, 0, a.amount] : [3, a.accountIndex, 0n];
|
|
49985
|
+
return { adapter: mortise.lighter, data: encodeAbiParameters([{ type: "uint8" }, { type: "uint48" }, { type: "uint256" }], v) };
|
|
49986
|
+
},
|
|
49987
|
+
/** Send USDG over LayerZero (the USDG OFT) on a listed route; the native fee is paid from the vault's ETH. */
|
|
49988
|
+
layerZeroOft: (a) => ({
|
|
49989
|
+
adapter: mortise.layerZeroOft,
|
|
49990
|
+
data: encodeAbiParameters(
|
|
49991
|
+
[{ type: "uint32" }, { type: "bytes32" }, { type: "uint256" }, { type: "uint256" }, { type: "uint256" }, { type: "uint256" }],
|
|
49992
|
+
[a.dstEid, a.to, a.minRate, a.maxFee, a.amountLD, a.minAmountLD]
|
|
49993
|
+
)
|
|
49994
|
+
}),
|
|
49995
|
+
/** Send a token over Chainlink CCIP on a listed route to an EVM receiver; the fee is paid in ETH from the vault. */
|
|
49996
|
+
ccip: (a) => ({
|
|
49997
|
+
adapter: mortise.ccip,
|
|
49998
|
+
data: encodeAbiParameters(
|
|
49999
|
+
[{ type: "uint64" }, { type: "address" }, { type: "address" }, { type: "uint256" }, { type: "uint256" }],
|
|
50000
|
+
[a.destinationChainSelector, a.receiver, a.token, a.maxFee, a.amount]
|
|
50001
|
+
)
|
|
50002
|
+
}),
|
|
50003
|
+
/** Borrow on Morpho Blue below a listed loan-to-value ceiling (maxLtv, a 1e18 fraction): collateral in and out,
|
|
50004
|
+
* borrow and repay. maxUint256 repays the whole debt. */
|
|
50005
|
+
morphoBorrow: (a) => ({
|
|
50006
|
+
adapter: mortise.morphoBorrow,
|
|
50007
|
+
data: encodeAbiParameters(
|
|
50008
|
+
[{ type: "uint8" }, marketParamsType, { type: "uint256" }, { type: "uint256" }],
|
|
50009
|
+
[{ supplyCollateral: 0, withdrawCollateral: 1, borrow: 2, repay: 3 }[a.op], a.market, a.amount, a.maxLtv]
|
|
50010
|
+
)
|
|
50011
|
+
}),
|
|
50012
|
+
/** The vault's ERC-8004 agent identity: register one (uri), change its URI, or set a metadata entry. */
|
|
50013
|
+
erc8004: (a) => {
|
|
50014
|
+
const v = a.op === "register" ? [0, 0n, a.uri, "", "0x"] : a.op === "setUri" ? [1, a.agentId, a.uri, "", "0x"] : [2, a.agentId, "", a.key, a.value];
|
|
50015
|
+
return {
|
|
50016
|
+
adapter: mortise.erc8004,
|
|
50017
|
+
data: encodeAbiParameters([{ type: "uint8" }, { type: "uint256" }, { type: "string" }, { type: "string" }, { type: "bytes" }], v)
|
|
50018
|
+
};
|
|
50019
|
+
},
|
|
50020
|
+
/** Funds one x402 payment in MortiseX402Escrow, to a payee the owner listed: the fields of the server's payment
|
|
50021
|
+
* requirements and a fresh random nonce. Then send x402Payment(...) to the server. */
|
|
50022
|
+
x402: (a) => ({
|
|
50023
|
+
adapter: mortise.x402,
|
|
50024
|
+
data: encodeAbiParameters(
|
|
50025
|
+
[{ type: "address" }, { type: "uint256" }, { type: "uint256" }, { type: "uint256" }, { type: "bytes32" }],
|
|
50026
|
+
[a.to, a.value, a.validAfter, a.validBefore, a.nonce]
|
|
50027
|
+
)
|
|
50028
|
+
})
|
|
50029
|
+
};
|
|
50030
|
+
function x402Payment(a) {
|
|
50031
|
+
return {
|
|
50032
|
+
authorization: { from: mortise.x402Escrow, to: a.to, value: a.value.toString(), validAfter: a.validAfter.toString(), validBefore: a.validBefore.toString(), nonce: a.nonce },
|
|
50033
|
+
signature: X402_SIGNATURE
|
|
50034
|
+
};
|
|
50035
|
+
}
|
|
50036
|
+
var addressMarket = (a) => pad(a.toLowerCase(), { size: 32 });
|
|
50037
|
+
var pairHash = (a, b) => keccak256(encodeAbiParameters([{ type: "address" }, { type: "address" }], [a, b]));
|
|
50038
|
+
var markets = {
|
|
50039
|
+
/** The pool address from the official v3 factory (UniswapV3Adapter and UniswapV3LiquidityAdapter). */
|
|
50040
|
+
uniswapV3Pool: (pool) => addressMarket(pool),
|
|
50041
|
+
/** The PoolId (UniswapV4Adapter and UniswapV4LiquidityAdapter). */
|
|
50042
|
+
uniswapV4Pool: (key2) => poolId(key2),
|
|
50043
|
+
morpho: (m) => morphoMarketId(m),
|
|
50044
|
+
/** The token's bonding curve. */
|
|
50045
|
+
ponsCurve: (curve) => addressMarket(curve),
|
|
50046
|
+
/** The pair, lower address first. */
|
|
50047
|
+
flapPair: (a, b) => BigInt(a) < BigInt(b) ? pairHash(a, b) : pairHash(b, a),
|
|
50048
|
+
erc4626: (target) => addressMarket(target),
|
|
50049
|
+
/** Lets the transfer adapter send `token` to `to`. */
|
|
50050
|
+
transfer: (token, to) => pairHash(token, to),
|
|
50051
|
+
/** The token allowed to move inside the family. */
|
|
50052
|
+
familyTransfer: (token) => addressMarket(token),
|
|
50053
|
+
weth: () => addressMarket(external.weth),
|
|
50054
|
+
uniswapV2Pair: (pair) => addressMarket(pair),
|
|
50055
|
+
pancakeV3Pool: (pool) => addressMarket(pool),
|
|
50056
|
+
pancakeInfinityPool: (key2) => keccak256(encodeAbiParameters([infinityPoolKeyType], [key2])),
|
|
50057
|
+
/** The pool address from the Aero CL factory (AeroSlipstreamAdapter and AeroLiquidityAdapter). */
|
|
50058
|
+
aeroPool: (pool) => addressMarket(pool),
|
|
50059
|
+
/** The pair as traded, tokenIn first, address(0) for ETH (OneInchAdapter and SushiAdapter). */
|
|
50060
|
+
swapPair: (tokenIn, tokenOut) => pairHash(tokenIn, tokenOut),
|
|
50061
|
+
listaLending: (m) => morphoMarketId(m),
|
|
50062
|
+
aaveV3: (asset) => addressMarket(asset),
|
|
50063
|
+
/** Lending to the Priors pool (deposit and withdraw). */
|
|
50064
|
+
priorsLend: () => keccak256(toHex("priors.lend")),
|
|
50065
|
+
/** Borrowing and repaying on one agent identity. */
|
|
50066
|
+
priorsBorrow: (agentId) => keccak256(encodeAbiParameters([{ type: "bytes32" }, { type: "uint256" }], [keccak256(toHex("priors.borrow")), agentId])),
|
|
50067
|
+
beefy: (target) => addressMarket(target),
|
|
50068
|
+
pendle: (market2) => addressMarket(market2),
|
|
50069
|
+
lighter: () => keccak256(toHex("lighter.usdg")),
|
|
50070
|
+
layerZeroRoute: (r) => keccak256(encodeAbiParameters([{ type: "uint32" }, { type: "bytes32" }, { type: "uint256" }, { type: "uint256" }], [r.dstEid, r.to, r.minRate, r.maxFee])),
|
|
50071
|
+
ccipRoute: (r) => keccak256(encodeAbiParameters([{ type: "uint64" }, { type: "address" }, { type: "address" }, { type: "uint256" }], [r.destinationChainSelector, r.receiver, r.token, r.maxFee])),
|
|
50072
|
+
/** A Morpho Blue market with the loan-to-value ceiling the owner allows on it. */
|
|
50073
|
+
morphoBorrow: (m, maxLtv) => keccak256(encodeAbiParameters([{ type: "bytes32" }, { type: "uint256" }], [morphoMarketId(m), maxLtv])),
|
|
50074
|
+
erc8004: () => keccak256(toHex("erc8004.identity")),
|
|
50075
|
+
/** An x402 payee; it must be listed even when the agent has open markets. */
|
|
50076
|
+
x402Payee: (to) => addressMarket(to),
|
|
50077
|
+
acrossRoute: (r) => keccak256(
|
|
50078
|
+
encodeAbiParameters(
|
|
50079
|
+
[{ type: "uint256" }, { type: "bytes32" }, { type: "address" }, { type: "bytes32" }, { type: "uint256" }],
|
|
50080
|
+
[r.destinationChainId, r.recipient, r.inputToken, r.outputToken, r.minRate]
|
|
50081
|
+
)
|
|
50082
|
+
)
|
|
49799
50083
|
};
|
|
49800
50084
|
|
|
49801
50085
|
// ../sdk/src/agent.ts
|
|
@@ -49874,10 +50158,10 @@ async function permissions(client, vault, actor, q) {
|
|
|
49874
50158
|
return { token, limit: c.limit, period: c.period, used, left: c.limit > used ? c.limit - used : 0n, resetsAt: fresh ? void 0 : c.windowStart + c.period };
|
|
49875
50159
|
})
|
|
49876
50160
|
);
|
|
49877
|
-
const
|
|
50161
|
+
const markets2 = await Promise.all(
|
|
49878
50162
|
(q.markets ?? []).map(async (m) => ({ ...m, allowed: await client.readContract({ ...g, functionName: "isMarket", args: [vault, m.adapter, m.market] }) }))
|
|
49879
50163
|
);
|
|
49880
|
-
return { installed, live, until, paused, openFloor, adapters: adapters2, caps, markets };
|
|
50164
|
+
return { installed, live, until, paused, openFloor, adapters: adapters2, caps, markets: markets2 };
|
|
49881
50165
|
}
|
|
49882
50166
|
function minRate(client, vault, tokenIn, tokenOut) {
|
|
49883
50167
|
return client.readContract({ address: mortise.gate, abi: gateAbi, functionName: "minRate", args: [vault, tokenIn, tokenOut] });
|
|
@@ -49930,6 +50214,56 @@ async function vaultStatus(client, vault) {
|
|
|
49930
50214
|
};
|
|
49931
50215
|
}
|
|
49932
50216
|
|
|
50217
|
+
// ../sdk/src/x402.ts
|
|
50218
|
+
var USDG = "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168";
|
|
50219
|
+
var NETWORKS = ["eip155:4663", "robinhood"];
|
|
50220
|
+
var toBase64 = (s) => btoa(Array.from(new TextEncoder().encode(s), (c) => String.fromCharCode(c)).join(""));
|
|
50221
|
+
var fromBase64 = (s) => new TextDecoder().decode(Uint8Array.from(atob(s), (c) => c.charCodeAt(0)));
|
|
50222
|
+
function x402Required(headers, body) {
|
|
50223
|
+
const header = headers.get("payment-required");
|
|
50224
|
+
const required2 = header ? JSON.parse(fromBase64(header)) : body;
|
|
50225
|
+
if (!required2 || !Array.isArray(required2.accepts)) throw new Error("the answer carries no x402 payment requirements");
|
|
50226
|
+
return required2;
|
|
50227
|
+
}
|
|
50228
|
+
function robinhoodUsdg(required2) {
|
|
50229
|
+
const r = required2.accepts.find((a) => a.scheme === "exact" && NETWORKS.includes(a.network) && a.asset.toLowerCase() === USDG.toLowerCase());
|
|
50230
|
+
if (!r) throw new Error(`the server takes no USDG on Robinhood Chain: ${required2.accepts.map((a) => `${a.network} ${a.asset}`).join(", ")}`);
|
|
50231
|
+
return r;
|
|
50232
|
+
}
|
|
50233
|
+
function x402Terms(r, chainNow) {
|
|
50234
|
+
const value = BigInt(r.amount ?? r.maxAmountRequired ?? "0");
|
|
50235
|
+
if (value <= 0n) throw new Error("the requirement names no amount");
|
|
50236
|
+
const nonce = bytesToHex(crypto.getRandomValues(new Uint8Array(32)));
|
|
50237
|
+
const timeout = BigInt(Math.min(Math.max(Number(r.maxTimeoutSeconds ?? 300), 60), 3600));
|
|
50238
|
+
const wallNow = BigInt(Math.floor(Date.now() / 1e3));
|
|
50239
|
+
const earliest = chainNow < wallNow ? chainNow : wallNow;
|
|
50240
|
+
const latest = chainNow > wallNow ? chainNow : wallNow;
|
|
50241
|
+
return { to: getAddress(r.payTo), value, validAfter: earliest - 600n, validBefore: latest + timeout, nonce };
|
|
50242
|
+
}
|
|
50243
|
+
function x402Header(required2, r, terms) {
|
|
50244
|
+
const payload = x402Payment(terms);
|
|
50245
|
+
if (required2.x402Version === 1) return { "X-PAYMENT": toBase64(JSON.stringify({ x402Version: 1, scheme: "exact", network: r.network, payload })) };
|
|
50246
|
+
const body = { x402Version: required2.x402Version, payload, resource: required2.resource, accepted: r, ...required2.extensions ? { extensions: required2.extensions } : {} };
|
|
50247
|
+
return { "PAYMENT-SIGNATURE": toBase64(JSON.stringify(body)) };
|
|
50248
|
+
}
|
|
50249
|
+
function x402Settlement(headers) {
|
|
50250
|
+
const h = headers.get("payment-response") ?? headers.get("x-payment-response");
|
|
50251
|
+
if (!h) return void 0;
|
|
50252
|
+
try {
|
|
50253
|
+
return JSON.parse(fromBase64(h));
|
|
50254
|
+
} catch {
|
|
50255
|
+
return void 0;
|
|
50256
|
+
}
|
|
50257
|
+
}
|
|
50258
|
+
function x402Collected(client, nonce) {
|
|
50259
|
+
return client.readContract({
|
|
50260
|
+
address: USDG,
|
|
50261
|
+
abi: [{ type: "function", name: "authorizationState", inputs: [{ type: "address" }, { type: "bytes32" }], outputs: [{ type: "bool" }], stateMutability: "view" }],
|
|
50262
|
+
functionName: "authorizationState",
|
|
50263
|
+
args: [mortise.x402Escrow, nonce]
|
|
50264
|
+
});
|
|
50265
|
+
}
|
|
50266
|
+
|
|
49933
50267
|
// src/config.ts
|
|
49934
50268
|
var PUBLIC_RPC = "https://rpc.mainnet.chain.robinhood.com";
|
|
49935
50269
|
function configFromEnv(env = process.env) {
|
|
@@ -49951,9 +50285,9 @@ function readPrivateFile(path, name) {
|
|
|
49951
50285
|
}
|
|
49952
50286
|
async function connect(cfg) {
|
|
49953
50287
|
const key2 = readPrivateFile(cfg.keyFile, "MORTISE_AGENT_KEY_FILE");
|
|
49954
|
-
const
|
|
49955
|
-
if (!isHex(
|
|
49956
|
-
const account = privateKeyToAccount(
|
|
50288
|
+
const hex4 = key2.startsWith("0x") ? key2 : `0x${key2}`;
|
|
50289
|
+
if (!isHex(hex4) || hex4.length !== 66) throw new Error("MORTISE_AGENT_KEY_FILE must hold a 32-byte hex private key");
|
|
50290
|
+
const account = privateKeyToAccount(hex4);
|
|
49957
50291
|
const transport = http(cfg.rpcUrl, { retryCount: 2, retryDelay: 500, timeout: 1e4 });
|
|
49958
50292
|
const client = createPublicClient({ chain: robinhood, transport });
|
|
49959
50293
|
const wallet = createWalletClient({ account, chain: robinhood, transport });
|
|
@@ -58037,6 +58371,27 @@ var poolKey = external_exports.object({
|
|
|
58037
58371
|
hooks: address
|
|
58038
58372
|
});
|
|
58039
58373
|
var marketParams = external_exports.object({ loanToken: address, collateralToken: address, oracle: address, irm: address, lltv: amount });
|
|
58374
|
+
var hex3 = external_exports.string().regex(/^0x([0-9a-fA-F]{2})*$/, "0x-prefixed hex bytes");
|
|
58375
|
+
var infinityKey = external_exports.object({
|
|
58376
|
+
currency0: address,
|
|
58377
|
+
currency1: address,
|
|
58378
|
+
hooks: address,
|
|
58379
|
+
poolManager: address,
|
|
58380
|
+
fee: external_exports.number().int().min(0).max(16777215),
|
|
58381
|
+
parameters: bytes32
|
|
58382
|
+
});
|
|
58383
|
+
var liquidityFields = {
|
|
58384
|
+
token0: address.optional(),
|
|
58385
|
+
token1: address.optional(),
|
|
58386
|
+
tickLower: external_exports.number().int().optional(),
|
|
58387
|
+
tickUpper: external_exports.number().int().optional(),
|
|
58388
|
+
tokenId: amount.optional(),
|
|
58389
|
+
liquidity: amount.optional(),
|
|
58390
|
+
amount0: amount.optional(),
|
|
58391
|
+
amount1: amount.optional(),
|
|
58392
|
+
amount0Min: amount.optional(),
|
|
58393
|
+
amount1Min: amount.optional()
|
|
58394
|
+
};
|
|
58040
58395
|
var actionSchema = external_exports.discriminatedUnion("kind", [
|
|
58041
58396
|
external_exports.object({ kind: external_exports.literal("weth"), wrap: external_exports.boolean().describe("true wraps ETH into WETH, false unwraps"), amount }),
|
|
58042
58397
|
external_exports.object({ kind: external_exports.literal("uniswapV3Swap"), tokenIn: address, tokenOut: address, fee: external_exports.number().int().describe("pool fee in hundredths of a bip, e.g. 100, 500, 3000"), amountIn: amount, amountOutMinimum: amount }).describe(`Exact-input swap on one Uniswap v3 pool; ${ethNote}`),
|
|
@@ -58088,7 +58443,45 @@ var actionSchema = external_exports.discriminatedUnion("kind", [
|
|
|
58088
58443
|
amount1: amount.optional(),
|
|
58089
58444
|
amount0Min: amount.optional(),
|
|
58090
58445
|
amount1Min: amount.optional()
|
|
58091
|
-
}).describe("Uniswap v4 position: amounts are maximums for mint and increase, minimums for decrease and burn")
|
|
58446
|
+
}).describe("Uniswap v4 position: amounts are maximums for mint and increase, minimums for decrease and burn"),
|
|
58447
|
+
external_exports.object({ kind: external_exports.literal("uniswapV2Swap"), tokenIn: address, tokenOut: address, amountIn: amount, amountOutMinimum: amount }).describe(`Exact-input swap on one Uniswap v2 pair; ${ethNote}`),
|
|
58448
|
+
external_exports.object({ kind: external_exports.literal("pancakeV3Swap"), tokenIn: address, tokenOut: address, fee: external_exports.number().int().describe("pool fee in hundredths of a bip, e.g. 100, 500, 2500"), amountIn: amount, amountOutMinimum: amount }).describe(`Exact-input swap on one PancakeSwap v3 pool; ${ethNote}`),
|
|
58449
|
+
external_exports.object({ kind: external_exports.literal("pancakeInfinitySwap"), key: infinityKey, zeroForOne: external_exports.boolean(), amountIn: amount, amountOutMinimum: amount }).describe(`Exact-input swap on one PancakeSwap Infinity CL pool; ${ethNote}`),
|
|
58450
|
+
external_exports.object({ kind: external_exports.literal("aeroSlipstreamSwap"), tokenIn: address, tokenOut: address, tickSpacing: external_exports.number().int(), amountIn: amount, amountOutMinimum: amount }).describe(`Exact-input swap on one Aero Slipstream pool, chosen by tick spacing; ${ethNote}`),
|
|
58451
|
+
external_exports.object({ kind: external_exports.literal("oneInch"), tokenOut: address, ethIn: amount.describe("ETH sent with the call, 0 for an ERC-20 input"), routerCalldata: hex3.describe("the 1inch v6 router call from 1inch's swap API, paying the vault") }).describe(`A swap through the 1inch router; ${ethNote}`),
|
|
58452
|
+
external_exports.object({ kind: external_exports.literal("sushi"), snwapCalldata: hex3.describe("the RedSnwapper snwap call from Sushi's swap API, with the vault as recipient") }).describe("A swap through Sushi's RedSnwapper"),
|
|
58453
|
+
external_exports.object({ kind: external_exports.literal("listaLending"), op: external_exports.enum(["supply", "withdraw"]), market: marketParams, assets: amount, shares: amount }).describe("Supply or withdraw the loan token of a listed Lista Lending market; give assets or shares, the other 0"),
|
|
58454
|
+
external_exports.object({ kind: external_exports.literal("aaveV3"), op: external_exports.enum(["supply", "withdraw"]), asset: address, amount: amount.describe("115792089237316195423570985008687907853269984665640564039457584007913129639935 withdraws everything") }).describe("Supply an asset to Aave v3 (Kaskad) or withdraw it"),
|
|
58455
|
+
external_exports.object({
|
|
58456
|
+
kind: external_exports.literal("priors"),
|
|
58457
|
+
op: external_exports.enum(["deposit", "withdraw", "borrow", "repay"]),
|
|
58458
|
+
amount: amount.optional(),
|
|
58459
|
+
minShares: amount.optional(),
|
|
58460
|
+
shares: amount.optional(),
|
|
58461
|
+
agentId: amount.optional(),
|
|
58462
|
+
maxFee: amount.optional(),
|
|
58463
|
+
term: amount.optional(),
|
|
58464
|
+
loanId: amount.optional()
|
|
58465
|
+
}).describe("The Priors credit pool: deposit needs amount and minShares; withdraw needs shares; borrow needs agentId, amount, maxFee and term (seconds); repay needs loanId"),
|
|
58466
|
+
external_exports.object({
|
|
58467
|
+
kind: external_exports.literal("beefy"),
|
|
58468
|
+
op: external_exports.enum(["clmDeposit", "clmWithdraw", "vaultDeposit", "vaultWithdraw"]),
|
|
58469
|
+
target: address,
|
|
58470
|
+
amount: amount.optional(),
|
|
58471
|
+
amount0: amount.optional(),
|
|
58472
|
+
amount1: amount.optional(),
|
|
58473
|
+
minShares: amount.optional(),
|
|
58474
|
+
shares: amount.optional(),
|
|
58475
|
+
minAmount0: amount.optional(),
|
|
58476
|
+
minAmount1: amount.optional()
|
|
58477
|
+
}).describe("Beefy at a listed target: clmDeposit needs amount0, amount1, minShares; clmWithdraw needs shares, minAmount0, minAmount1; vaultDeposit needs amount; vaultWithdraw needs shares"),
|
|
58478
|
+
external_exports.object({ kind: external_exports.literal("pendle"), op: external_exports.enum(["buy", "sell", "redeem"]), market: address, token: address, amountIn: amount, minOut: amount }).describe("Pendle PT on a listed market: amountIn is the token for buy and the PT for sell and redeem"),
|
|
58479
|
+
external_exports.object({ kind: external_exports.literal("aeroLiquidity"), op: external_exports.enum(["mint", "increase", "decrease", "collect", "burn"]), tickSpacing: external_exports.number().int().optional(), ...liquidityFields }).describe("Aero CL position: mint needs token0, token1, tickSpacing, ticks, amount0/1 and amount0/1Min; increase needs tokenId, amount0/1 and amount0/1Min; decrease needs tokenId, liquidity and amount0/1Min; collect and burn need tokenId"),
|
|
58480
|
+
external_exports.object({ kind: external_exports.literal("lighter"), op: external_exports.enum(["deposit", "withdraw", "claim", "cancelAll"]), accountIndex: external_exports.number().int().nonnegative().optional(), amount: amount.optional() }).describe("USDG margin in the vault's Lighter account: deposit and claim need amount; withdraw needs accountIndex and amount; cancelAll needs accountIndex"),
|
|
58481
|
+
external_exports.object({ kind: external_exports.literal("layerZeroOft"), dstEid: external_exports.number().int().nonnegative(), to: bytes32, minRate: amount, maxFee: amount, amountLD: amount, minAmountLD: amount }).describe("Send USDG over LayerZero on a listed route; the native fee comes from the vault's ETH"),
|
|
58482
|
+
external_exports.object({ kind: external_exports.literal("ccip"), destinationChainSelector: amount, receiver: address, token: address, maxFee: amount, amount }).describe("Send a token over Chainlink CCIP on a listed route; the fee comes from the vault's ETH"),
|
|
58483
|
+
external_exports.object({ kind: external_exports.literal("morphoBorrow"), op: external_exports.enum(["supplyCollateral", "withdrawCollateral", "borrow", "repay"]), market: marketParams, amount, maxLtv: amount.describe("the listed loan-to-value ceiling, a 1e18 fraction") }).describe("Borrow on Morpho Blue under the ceiling the owner listed"),
|
|
58484
|
+
external_exports.object({ kind: external_exports.literal("erc8004"), op: external_exports.enum(["register", "setUri", "setMetadata"]), agentId: amount.optional(), uri: external_exports.string().optional(), key: external_exports.string().optional(), value: hex3.optional() }).describe("The vault's ERC-8004 identity: register needs uri; setUri needs agentId and uri; setMetadata needs agentId, key and value")
|
|
58092
58485
|
]);
|
|
58093
58486
|
var A = (s) => s;
|
|
58094
58487
|
var B = (s) => BigInt(s);
|
|
@@ -58176,8 +58569,97 @@ function toAction(a) {
|
|
|
58176
58569
|
if (op === "burn") return actions.uniswapV4Liquidity({ op, tokenId: B(n("tokenId")), amount0Min: B(n("amount0Min")), amount1Min: B(n("amount1Min")) });
|
|
58177
58570
|
return actions.uniswapV4Liquidity({ op, tokenId: B(n("tokenId")), liquidity: B(n("liquidity")), amount0: B(n("amount0")), amount1: B(n("amount1")) });
|
|
58178
58571
|
}
|
|
58572
|
+
case "uniswapV2Swap":
|
|
58573
|
+
return actions.uniswapV2Swap({ tokenIn: A(a.tokenIn), tokenOut: A(a.tokenOut), amountIn: B(a.amountIn), amountOutMinimum: B(a.amountOutMinimum) });
|
|
58574
|
+
case "pancakeV3Swap":
|
|
58575
|
+
return actions.pancakeV3Swap({ tokenIn: A(a.tokenIn), tokenOut: A(a.tokenOut), fee: a.fee, amountIn: B(a.amountIn), amountOutMinimum: B(a.amountOutMinimum) });
|
|
58576
|
+
case "pancakeInfinitySwap":
|
|
58577
|
+
return actions.pancakeInfinitySwap({
|
|
58578
|
+
key: { currency0: A(a.key.currency0), currency1: A(a.key.currency1), hooks: A(a.key.hooks), poolManager: A(a.key.poolManager), fee: a.key.fee, parameters: a.key.parameters },
|
|
58579
|
+
zeroForOne: a.zeroForOne,
|
|
58580
|
+
amountIn: B(a.amountIn),
|
|
58581
|
+
amountOutMinimum: B(a.amountOutMinimum)
|
|
58582
|
+
});
|
|
58583
|
+
case "aeroSlipstreamSwap":
|
|
58584
|
+
return actions.aeroSlipstreamSwap({ tokenIn: A(a.tokenIn), tokenOut: A(a.tokenOut), tickSpacing: a.tickSpacing, amountIn: B(a.amountIn), amountOutMinimum: B(a.amountOutMinimum) });
|
|
58585
|
+
case "oneInch":
|
|
58586
|
+
return actions.oneInch({ tokenOut: A(a.tokenOut), ethIn: B(a.ethIn), routerCalldata: a.routerCalldata });
|
|
58587
|
+
case "sushi":
|
|
58588
|
+
return actions.sushi({ snwapCalldata: a.snwapCalldata });
|
|
58589
|
+
case "listaLending":
|
|
58590
|
+
return actions.listaLending({ op: a.op, market: market(a.market), assets: B(a.assets), shares: B(a.shares) });
|
|
58591
|
+
case "aaveV3":
|
|
58592
|
+
return actions.aaveV3({ op: a.op, asset: A(a.asset), amount: B(a.amount) });
|
|
58593
|
+
case "priors": {
|
|
58594
|
+
const n = (name) => B(need(a[name], name, `priors ${a.op}`));
|
|
58595
|
+
if (a.op === "deposit") return actions.priors({ op: "deposit", amount: n("amount"), minShares: n("minShares") });
|
|
58596
|
+
if (a.op === "withdraw") return actions.priors({ op: "withdraw", shares: n("shares") });
|
|
58597
|
+
if (a.op === "borrow") return actions.priors({ op: "borrow", agentId: n("agentId"), amount: n("amount"), maxFee: n("maxFee"), term: n("term") });
|
|
58598
|
+
return actions.priors({ op: "repay", loanId: n("loanId") });
|
|
58599
|
+
}
|
|
58600
|
+
case "beefy": {
|
|
58601
|
+
const n = (name) => B(need(a[name], name, `beefy ${a.op}`));
|
|
58602
|
+
const target = A(a.target);
|
|
58603
|
+
if (a.op === "clmDeposit") return actions.beefy({ op: "clmDeposit", target, amount0: n("amount0"), amount1: n("amount1"), minShares: n("minShares") });
|
|
58604
|
+
if (a.op === "clmWithdraw") return actions.beefy({ op: "clmWithdraw", target, shares: n("shares"), minAmount0: n("minAmount0"), minAmount1: n("minAmount1") });
|
|
58605
|
+
if (a.op === "vaultDeposit") return actions.beefy({ op: "vaultDeposit", target, amount: n("amount") });
|
|
58606
|
+
return actions.beefy({ op: "vaultWithdraw", target, shares: n("shares") });
|
|
58607
|
+
}
|
|
58608
|
+
case "pendle":
|
|
58609
|
+
return actions.pendle({ op: a.op, market: A(a.market), token: A(a.token), amountIn: B(a.amountIn), minOut: B(a.minOut) });
|
|
58610
|
+
case "aeroLiquidity": {
|
|
58611
|
+
const op = a.op;
|
|
58612
|
+
const n = (name) => need(a[name], name, `aeroLiquidity ${op}`);
|
|
58613
|
+
const i = (name) => need(a[name], name, `aeroLiquidity ${op}`);
|
|
58614
|
+
if (op === "mint") {
|
|
58615
|
+
return actions.aeroLiquidity({
|
|
58616
|
+
op,
|
|
58617
|
+
token0: A(n("token0")),
|
|
58618
|
+
token1: A(n("token1")),
|
|
58619
|
+
tickSpacing: i("tickSpacing"),
|
|
58620
|
+
tickLower: i("tickLower"),
|
|
58621
|
+
tickUpper: i("tickUpper"),
|
|
58622
|
+
amount0: B(n("amount0")),
|
|
58623
|
+
amount1: B(n("amount1")),
|
|
58624
|
+
amount0Min: B(n("amount0Min")),
|
|
58625
|
+
amount1Min: B(n("amount1Min"))
|
|
58626
|
+
});
|
|
58627
|
+
}
|
|
58628
|
+
if (op === "increase") {
|
|
58629
|
+
return actions.aeroLiquidity({ op, tokenId: B(n("tokenId")), liquidity: 0n, amount0: B(n("amount0")), amount1: B(n("amount1")), amount0Min: B(n("amount0Min")), amount1Min: B(n("amount1Min")) });
|
|
58630
|
+
}
|
|
58631
|
+
if (op === "decrease") {
|
|
58632
|
+
return actions.aeroLiquidity({ op, tokenId: B(n("tokenId")), liquidity: B(n("liquidity")), amount0: 0n, amount1: 0n, amount0Min: B(n("amount0Min")), amount1Min: B(n("amount1Min")) });
|
|
58633
|
+
}
|
|
58634
|
+
return actions.aeroLiquidity({ op, tokenId: B(n("tokenId")) });
|
|
58635
|
+
}
|
|
58636
|
+
case "lighter": {
|
|
58637
|
+
const op = a.op;
|
|
58638
|
+
const amt = () => B(need(a.amount, "amount", `lighter ${op}`));
|
|
58639
|
+
const idx = () => need(a.accountIndex, "accountIndex", `lighter ${op}`);
|
|
58640
|
+
if (op === "deposit") return actions.lighter({ op, amount: amt() });
|
|
58641
|
+
if (op === "claim") return actions.lighter({ op, amount: amt() });
|
|
58642
|
+
if (op === "withdraw") return actions.lighter({ op, accountIndex: idx(), amount: amt() });
|
|
58643
|
+
return actions.lighter({ op, accountIndex: idx() });
|
|
58644
|
+
}
|
|
58645
|
+
case "layerZeroOft":
|
|
58646
|
+
return actions.layerZeroOft({ dstEid: a.dstEid, to: a.to, minRate: B(a.minRate), maxFee: B(a.maxFee), amountLD: B(a.amountLD), minAmountLD: B(a.minAmountLD) });
|
|
58647
|
+
case "ccip":
|
|
58648
|
+
return actions.ccip({ destinationChainSelector: B(a.destinationChainSelector), receiver: A(a.receiver), token: A(a.token), maxFee: B(a.maxFee), amount: B(a.amount) });
|
|
58649
|
+
case "morphoBorrow":
|
|
58650
|
+
return actions.morphoBorrow({ op: a.op, market: market(a.market), amount: B(a.amount), maxLtv: B(a.maxLtv) });
|
|
58651
|
+
case "erc8004": {
|
|
58652
|
+
const op = a.op;
|
|
58653
|
+
if (op === "register") return actions.erc8004({ op, uri: need(a.uri, "uri", "erc8004 register") });
|
|
58654
|
+
const agentId = B(need(a.agentId, "agentId", `erc8004 ${op}`));
|
|
58655
|
+
if (op === "setUri") return actions.erc8004({ op, agentId, uri: need(a.uri, "uri", "erc8004 setUri") });
|
|
58656
|
+
return actions.erc8004({ op, agentId, key: need(a.key, "key", "erc8004 setMetadata"), value: need(a.value, "value", "erc8004 setMetadata") });
|
|
58657
|
+
}
|
|
58179
58658
|
}
|
|
58180
58659
|
}
|
|
58660
|
+
function market(m) {
|
|
58661
|
+
return { loanToken: A(m.loanToken), collateralToken: A(m.collateralToken), oracle: A(m.oracle), irm: A(m.irm), lltv: B(m.lltv) };
|
|
58662
|
+
}
|
|
58181
58663
|
function key(k) {
|
|
58182
58664
|
return { currency0: A(k.currency0), currency1: A(k.currency1), fee: k.fee, tickSpacing: k.tickSpacing, hooks: A(k.hooks) };
|
|
58183
58665
|
}
|
|
@@ -58195,29 +58677,47 @@ var adapters = {
|
|
|
58195
58677
|
transfer: mortise.transfer,
|
|
58196
58678
|
weth: mortise.weth,
|
|
58197
58679
|
across: mortise.across,
|
|
58198
|
-
familyTransfer: mortise.familyTransfer
|
|
58680
|
+
familyTransfer: mortise.familyTransfer,
|
|
58681
|
+
uniswapV2: mortise.uniswapV2,
|
|
58682
|
+
pancakeV3: mortise.pancakeV3,
|
|
58683
|
+
pancakeInfinity: mortise.pancakeInfinity,
|
|
58684
|
+
aeroSlipstream: mortise.aeroSlipstream,
|
|
58685
|
+
oneInch: mortise.oneInch,
|
|
58686
|
+
sushi: mortise.sushi,
|
|
58687
|
+
listaLending: mortise.listaLending,
|
|
58688
|
+
aaveV3: mortise.aaveV3,
|
|
58689
|
+
priors: mortise.priors,
|
|
58690
|
+
beefy: mortise.beefy,
|
|
58691
|
+
pendle: mortise.pendle,
|
|
58692
|
+
aeroLiquidity: mortise.aeroLiquidity,
|
|
58693
|
+
lighter: mortise.lighter,
|
|
58694
|
+
layerZeroOft: mortise.layerZeroOft,
|
|
58695
|
+
ccip: mortise.ccip,
|
|
58696
|
+
morphoBorrow: mortise.morphoBorrow,
|
|
58697
|
+
erc8004: mortise.erc8004,
|
|
58698
|
+
x402: mortise.x402
|
|
58199
58699
|
};
|
|
58200
58700
|
var adapterName = new Map(Object.entries(adapters).map(([name, a]) => [a.toLowerCase(), name]));
|
|
58201
|
-
var modules = { dca: mortise.dca, automation: mortise.automation, rebalance: mortise.rebalance };
|
|
58701
|
+
var modules = { dca: mortise.dca, automation: mortise.automation, rebalance: mortise.rebalance, compound: mortise.compound };
|
|
58202
58702
|
var TOOL_DEADLINE_MS = 45e3;
|
|
58203
58703
|
var WRITE_BUDGET_MS = 45e3;
|
|
58204
58704
|
var SEND_DEADLINE_MS = 3e4;
|
|
58205
58705
|
var MIN_SEND_MS = 1e4;
|
|
58706
|
+
var QUOTE_DEADLINE_MS = 1e4;
|
|
58206
58707
|
var address2 = external_exports.string().regex(/^0x[0-9a-fA-F]{40}$/);
|
|
58207
58708
|
var actionList = external_exports.array(actionSchema).min(1).max(16);
|
|
58208
58709
|
function createServer(c, hide2) {
|
|
58209
|
-
const server = new McpServer({ name: "mortise", version: "0.
|
|
58710
|
+
const server = new McpServer({ name: "mortise", version: "0.2.0" });
|
|
58210
58711
|
const ok = (value) => ({ content: [{ type: "text", text: hide2(json2(value)) }] });
|
|
58211
58712
|
const fail = (err) => ({ content: [{ type: "text", text: hide2(explain(err)) }], isError: true });
|
|
58212
58713
|
const run = (fn) => withDeadline(fn(), TOOL_DEADLINE_MS, "the RPC did not answer in time").then(ok, fail);
|
|
58213
58714
|
let writes = Promise.resolve();
|
|
58214
|
-
const act = (fn, signal) => {
|
|
58215
|
-
const
|
|
58216
|
-
const run2 = writes.then(() => actNow(fn, arrived, signal));
|
|
58715
|
+
const act = (fn, signal, then, info = {}, arrived = Date.now()) => {
|
|
58716
|
+
const run2 = writes.then(() => actNow(fn, arrived, signal, then, info));
|
|
58217
58717
|
writes = run2.catch(() => void 0);
|
|
58218
58718
|
return run2;
|
|
58219
58719
|
};
|
|
58220
|
-
const actNow = async (fn, arrived, signal) => {
|
|
58720
|
+
const actNow = async (fn, arrived, signal, then, info = {}) => {
|
|
58221
58721
|
const sendLeft = arrived + SEND_DEADLINE_MS - Date.now();
|
|
58222
58722
|
if (sendLeft < MIN_SEND_MS || signal?.aborted) {
|
|
58223
58723
|
return fail(new Error("too many writes were waiting, so this one was not started; nothing was sent"));
|
|
@@ -58240,17 +58740,24 @@ function createServer(c, hide2) {
|
|
|
58240
58740
|
hash4 = await Promise.race([fn({ shouldSend: () => !stopped, onSigned: (h) => signed = h }), late2]);
|
|
58241
58741
|
} catch (err) {
|
|
58242
58742
|
if (!signed) return fail(err);
|
|
58243
|
-
return ok({ status: "unknown", transactionHash: signed, note: `sent but the RPC did not confirm it (${explain(err)}); check this hash before sending again
|
|
58743
|
+
return ok({ status: "unknown", transactionHash: signed, note: `sent but the RPC did not confirm it (${explain(err)}); check this hash before sending again`, ...info });
|
|
58244
58744
|
} finally {
|
|
58245
58745
|
clearTimeout(timer);
|
|
58246
58746
|
if (onAbort) signal?.removeEventListener("abort", onAbort);
|
|
58247
58747
|
}
|
|
58748
|
+
let r;
|
|
58248
58749
|
try {
|
|
58249
|
-
|
|
58250
|
-
return ok({ status: "confirmed", ...r, executed: r.executed.map((e) => ({ ...e, adapter: adapterName.get(e.adapter.toLowerCase()) ?? e.adapter })) });
|
|
58750
|
+
r = await actionReceipt(c.client, hash4, Math.max(arrived + WRITE_BUDGET_MS - Date.now(), 2e3));
|
|
58251
58751
|
} catch (err) {
|
|
58252
58752
|
if (err?.name === "TransactionRevertedError") return fail(err);
|
|
58253
|
-
return ok({ status: "pending", transactionHash: hash4, note: "sent but not confirmed yet; do not send it again, check this hash later" });
|
|
58753
|
+
return ok({ status: "pending", transactionHash: hash4, note: "sent but not confirmed yet; do not send it again, check this hash later", ...info });
|
|
58754
|
+
}
|
|
58755
|
+
const confirmed = { status: "confirmed", ...r, executed: r.executed.map((e) => ({ ...e, adapter: adapterName.get(e.adapter.toLowerCase()) ?? e.adapter })), ...info };
|
|
58756
|
+
if (!then) return ok(confirmed);
|
|
58757
|
+
try {
|
|
58758
|
+
return ok({ ...confirmed, ...await withDeadline(then(r), Math.max(arrived + WRITE_BUDGET_MS - Date.now(), 5e3), "the follow-up did not finish in time") });
|
|
58759
|
+
} catch (err) {
|
|
58760
|
+
return ok({ ...confirmed, followUp: { error: explain(err) } });
|
|
58254
58761
|
}
|
|
58255
58762
|
};
|
|
58256
58763
|
server.registerTool(
|
|
@@ -58369,12 +58876,86 @@ function createServer(c, hide2) {
|
|
|
58369
58876
|
"mortise_trigger",
|
|
58370
58877
|
{
|
|
58371
58878
|
title: "Trigger a module",
|
|
58372
|
-
description: "As the module's keeper, runs what an enabled automation module (dca, automation or
|
|
58373
|
-
inputSchema: { module: external_exports.enum(["dca", "automation", "rebalance"]) },
|
|
58879
|
+
description: "As the module's keeper, runs what an enabled automation module (dca, automation, rebalance or compound) proposes now. The module refuses when nothing is due. A compound round takes two triggers: collect, then deposit; send the second right after the first.",
|
|
58880
|
+
inputSchema: { module: external_exports.enum(["dca", "automation", "rebalance", "compound"]) },
|
|
58374
58881
|
annotations: { destructiveHint: true, idempotentHint: false, openWorldHint: true }
|
|
58375
58882
|
},
|
|
58376
58883
|
({ module }, extra) => act((o) => sendTrigger(c.client, c.wallet, c.vault, modules[module], o), extra.signal)
|
|
58377
58884
|
);
|
|
58885
|
+
server.registerTool(
|
|
58886
|
+
"mortise_pay_x402",
|
|
58887
|
+
{
|
|
58888
|
+
title: "Pay an x402 resource",
|
|
58889
|
+
description: "Pays an x402 resource (HTTP 402) from the vault in USDG on Robinhood Chain, through the Mortise escrow: reads the price, funds one payment to the seller the owner listed, and asks again with it. Refuses a price above maxValue (USDG raw units, 1e-6). The seller's facilitator must accept a contract payer (ERC-1271), as the official x402 facilitator does. Every answer after funding carries reclaim.nonce: do not call again for the same purchase; if the seller did not collect (payment.collected false), take the payment back with mortise_x402_reclaim after reclaim.validBefore.",
|
|
58890
|
+
inputSchema: {
|
|
58891
|
+
url: external_exports.string().url().regex(/^https?:\/\//),
|
|
58892
|
+
method: external_exports.enum(["GET", "POST"]).default("GET"),
|
|
58893
|
+
body: external_exports.string().max(1e5).optional().describe("request body, sent as application/json for POST"),
|
|
58894
|
+
maxValue: external_exports.string().regex(/^\d+$/).describe("the most this payment may cost, in USDG raw units (100000 is 0.10 USDG)")
|
|
58895
|
+
},
|
|
58896
|
+
annotations: { destructiveHint: true, idempotentHint: false, openWorldHint: true }
|
|
58897
|
+
},
|
|
58898
|
+
async ({ url: url2, method, body, maxValue }, extra) => {
|
|
58899
|
+
const arrived = Date.now();
|
|
58900
|
+
const init = method === "POST" ? { method, headers: { "content-type": "application/json" }, body: body ?? "{}" } : { method };
|
|
58901
|
+
let quote;
|
|
58902
|
+
try {
|
|
58903
|
+
quote = await withDeadline(
|
|
58904
|
+
(async () => {
|
|
58905
|
+
const first = await fetch(url2, init);
|
|
58906
|
+
if (first.status !== 402) throw new Error(`expected a 402 answer, got ${first.status}`);
|
|
58907
|
+
let json3;
|
|
58908
|
+
try {
|
|
58909
|
+
json3 = await first.json();
|
|
58910
|
+
} catch {
|
|
58911
|
+
json3 = void 0;
|
|
58912
|
+
}
|
|
58913
|
+
const required3 = x402Required(first.headers, json3);
|
|
58914
|
+
const r2 = robinhoodUsdg(required3);
|
|
58915
|
+
const terms2 = x402Terms(r2, (await c.client.getBlock()).timestamp);
|
|
58916
|
+
if (terms2.value > BigInt(maxValue)) throw new Error(`the price ${terms2.value} is above maxValue ${maxValue}; nothing was sent`);
|
|
58917
|
+
const listed = await c.client.readContract({ address: mortise.gate, abi: gateAbi, functionName: "isMarket", args: [c.vault, mortise.x402, markets.x402Payee(terms2.to)] });
|
|
58918
|
+
if (!listed) throw new Error(`the seller's payee ${terms2.to} is not listed by the vault's owner; nothing was sent`);
|
|
58919
|
+
return { required: required3, r: r2, terms: terms2 };
|
|
58920
|
+
})(),
|
|
58921
|
+
QUOTE_DEADLINE_MS,
|
|
58922
|
+
"the seller or the RPC did not answer in time; nothing was sent"
|
|
58923
|
+
);
|
|
58924
|
+
} catch (err) {
|
|
58925
|
+
return fail(err);
|
|
58926
|
+
}
|
|
58927
|
+
const { required: required2, r, terms } = quote;
|
|
58928
|
+
const reclaim = { nonce: terms.nonce, validBefore: terms.validBefore.toString() };
|
|
58929
|
+
return act(
|
|
58930
|
+
(o) => sendActions(c.client, c.wallet, c.vault, [actions.x402(terms)], o),
|
|
58931
|
+
extra.signal,
|
|
58932
|
+
async () => {
|
|
58933
|
+
const paid = await fetch(url2, { ...init, headers: { ...init.headers, ...x402Header(required2, r, terms) } });
|
|
58934
|
+
const text = await paid.text();
|
|
58935
|
+
return { payment: { status: paid.status, body: text.slice(0, 4e3), collected: await x402Collected(c.client, terms.nonce), settlement: x402Settlement(paid.headers) } };
|
|
58936
|
+
},
|
|
58937
|
+
{ reclaim },
|
|
58938
|
+
arrived
|
|
58939
|
+
);
|
|
58940
|
+
}
|
|
58941
|
+
);
|
|
58942
|
+
server.registerTool(
|
|
58943
|
+
"mortise_x402_reclaim",
|
|
58944
|
+
{
|
|
58945
|
+
title: "Take back an uncollected x402 payment",
|
|
58946
|
+
description: "Sends an x402 payment the seller never collected back to the vault, once its validBefore has passed. The agent's key pays the gas.",
|
|
58947
|
+
inputSchema: { nonce: external_exports.string().regex(/^0x[0-9a-fA-F]{64}$/) },
|
|
58948
|
+
annotations: { destructiveHint: false, idempotentHint: true, openWorldHint: true }
|
|
58949
|
+
},
|
|
58950
|
+
({ nonce }, extra) => act(async (o) => {
|
|
58951
|
+
const call3 = x402Escrow.reclaim(nonce);
|
|
58952
|
+
await c.client.call({ account: c.agent, to: call3.to, data: call3.data });
|
|
58953
|
+
if (o.shouldSend && !o.shouldSend()) throw new Error("the send was stopped before the transaction went out");
|
|
58954
|
+
const hash4 = await c.wallet.sendTransaction({ to: call3.to, data: call3.data });
|
|
58955
|
+
o.onSigned?.(hash4);
|
|
58956
|
+
return hash4;
|
|
58957
|
+
}, extra.signal)
|
|
58958
|
+
);
|
|
58378
58959
|
return server;
|
|
58379
58960
|
}
|
|
58380
58961
|
function explain(err) {
|