@dev.sail.money/sailor 1.3.0-95 → 1.3.0-98
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/AGENTS.md +3 -0
- package/package.json +2 -3
- package/packages/cli/dist/index.cjs +168 -76
- package/packages/cli/dist/server.cjs +57 -63
- package/packages/sdk/dist/abis/SailGovernance.d.ts +6 -5
- package/packages/sdk/dist/abis/SailGovernance.d.ts.map +1 -1
- package/packages/sdk/dist/abis/SailGovernance.js +6 -5
- package/packages/sdk/dist/abis/SailGovernance.js.map +1 -1
- package/packages/sdk/dist/fees.d.ts +58 -10
- package/packages/sdk/dist/fees.d.ts.map +1 -1
- package/packages/sdk/dist/fees.js +73 -41
- package/packages/sdk/dist/fees.js.map +1 -1
- package/packages/sdk/dist/index.d.ts +2 -1
- package/packages/sdk/dist/index.d.ts.map +1 -1
- package/packages/sdk/dist/index.js +1 -1
- package/packages/sdk/dist/index.js.map +1 -1
- package/packages/sdk/dist/intelligence.d.ts +7 -2
- package/packages/sdk/dist/intelligence.d.ts.map +1 -1
- package/packages/sdk/dist/intelligence.js +2 -2
- package/packages/sdk/dist/intelligence.js.map +1 -1
- package/packages/sdk/dist/signing.d.ts +14 -0
- package/packages/sdk/dist/signing.d.ts.map +1 -1
- package/packages/ui/dist/assets/{add-CLs0-B0p.js → add-BX5reKtK.js} +1 -1
- package/packages/ui/dist/assets/{all-wallets-CDOk28sj.js → all-wallets-IZ3PlVF-.js} +1 -1
- package/packages/ui/dist/assets/{app-store-DVzpi1qN.js → app-store-ARgRdMdF.js} +1 -1
- package/packages/ui/dist/assets/{apple-C9U9iH1l.js → apple-VCaqsI9w.js} +1 -1
- package/packages/ui/dist/assets/{arrow-bottom-DjQ4jGMe.js → arrow-bottom-Cwptw8fW.js} +1 -1
- package/packages/ui/dist/assets/{arrow-bottom-circle-jxial9Si.js → arrow-bottom-circle-h5vFiZ2I.js} +1 -1
- package/packages/ui/dist/assets/{arrow-left-BjAyI8D1.js → arrow-left-bM1TRcV9.js} +1 -1
- package/packages/ui/dist/assets/{arrow-right-BlFO4Tcx.js → arrow-right-BYd_N4Jr.js} +1 -1
- package/packages/ui/dist/assets/{arrow-top-DJ3oh3DH.js → arrow-top-CLUnwVE2.js} +1 -1
- package/packages/ui/dist/assets/{bank-B98it1qN.js → bank-6c28yOM9.js} +1 -1
- package/packages/ui/dist/assets/{basic-DsgeyPNu.js → basic-CJnbTfSd.js} +1 -1
- package/packages/ui/dist/assets/{browser-j4vCeHwE.js → browser-CDKlxM3D.js} +1 -1
- package/packages/ui/dist/assets/{card-CzxbMvEd.js → card-DQdED02q.js} +1 -1
- package/packages/ui/dist/assets/{ccip-U9yiu_EK.js → ccip-BL7RIPfY.js} +1 -1
- package/packages/ui/dist/assets/{checkmark-D5sWBbk3.js → checkmark-JoRNVoFV.js} +1 -1
- package/packages/ui/dist/assets/{checkmark-bold-BW6w3KCC.js → checkmark-bold-B6bGHVIs.js} +1 -1
- package/packages/ui/dist/assets/{chevron-bottom-BbHhmTQq.js → chevron-bottom-BMCelIEu.js} +1 -1
- package/packages/ui/dist/assets/{chevron-left-D8BDH4Wo.js → chevron-left-ryPLhHCc.js} +1 -1
- package/packages/ui/dist/assets/{chevron-right-BQuQk5zc.js → chevron-right-CdDNRv7f.js} +1 -1
- package/packages/ui/dist/assets/{chevron-top-1oeSXkx4.js → chevron-top-BxWIjjGk.js} +1 -1
- package/packages/ui/dist/assets/{chrome-store-B1OMtzC-.js → chrome-store-D-fiJ9qJ.js} +1 -1
- package/packages/ui/dist/assets/{clock-e0HueehS.js → clock-xCPkzwjj.js} +1 -1
- package/packages/ui/dist/assets/{close-Cy1ytr26.js → close-BkqmPpWG.js} +1 -1
- package/packages/ui/dist/assets/{coinPlaceholder-DqJu3ZPV.js → coinPlaceholder-PIvN9oq_.js} +1 -1
- package/packages/ui/dist/assets/{compass-XDz_N2Hg.js → compass-CW5kWcxW.js} +1 -1
- package/packages/ui/dist/assets/{copy-DmDo3Nob.js → copy-DUZlAQJJ.js} +1 -1
- package/packages/ui/dist/assets/{core-DbkMGSYW.js → core-von2c1sc.js} +3 -3
- package/packages/ui/dist/assets/cursor-BzRVY7BD.js +3 -0
- package/packages/ui/dist/assets/{cursor-transparent-DF2aA10D.js → cursor-transparent-BUAMB0G1.js} +1 -1
- package/packages/ui/dist/assets/{desktop-CVydOWLn.js → desktop-BxdlwV8P.js} +1 -1
- package/packages/ui/dist/assets/{disconnect-BuN2Whnz.js → disconnect-GelNh3mn.js} +1 -1
- package/packages/ui/dist/assets/{discord-DMNPvTB2.js → discord-N0jnxkzC.js} +1 -1
- package/packages/ui/dist/assets/{etherscan-CacW-93f.js → etherscan-B41u7wF4.js} +1 -1
- package/packages/ui/dist/assets/{events-CZkVDFih.js → events-C9icG2YB.js} +1 -1
- package/packages/ui/dist/assets/{exclamation-triangle-B26hIvqO.js → exclamation-triangle-BWJC56FC.js} +1 -1
- package/packages/ui/dist/assets/{extension-B7rI0gv7.js → extension-G6I6oogw.js} +1 -1
- package/packages/ui/dist/assets/{external-link-CX8skCbH.js → external-link-BPaGQf4a.js} +1 -1
- package/packages/ui/dist/assets/{facebook-BDqbE6kl.js → facebook-47twy32b.js} +1 -1
- package/packages/ui/dist/assets/{fallback-DWQYKf3l.js → fallback-BTfJeGjh.js} +1 -1
- package/packages/ui/dist/assets/{farcaster-zQ3oQzZ8.js → farcaster-DYqnqCqs.js} +1 -1
- package/packages/ui/dist/assets/{filters-DCglZYsM.js → filters-dF6xeJnE.js} +1 -1
- package/packages/ui/dist/assets/{github-BH-BYjss.js → github-DbW4Ihz2.js} +1 -1
- package/packages/ui/dist/assets/{google-DYFWxZbC.js → google-TKm7G8LF.js} +1 -1
- package/packages/ui/dist/assets/{help-circle-BXH_DtZ_.js → help-circle-CY3qTmsG.js} +1 -1
- package/packages/ui/dist/assets/{id-Dr2yTeX1.js → id-JpHW4q14.js} +1 -1
- package/packages/ui/dist/assets/{image-DeJey1Eg.js → image-Dip2fG98.js} +1 -1
- package/packages/ui/dist/assets/{index-BP-UuQ8g.js → index-BGJ_8fMk.js} +1 -1
- package/packages/ui/dist/assets/{index-C55-Ne92.js → index-Bq3PAopp.js} +1 -1
- package/packages/ui/dist/assets/{index-BksbyFjf.js → index-C4_cA5XW.js} +1 -1
- package/packages/ui/dist/assets/{index-uSdXE5b_.js → index-CaDN0gL4.js} +1 -1
- package/packages/ui/dist/assets/index-DLElIcBr.js +1789 -0
- package/packages/ui/dist/assets/index-lhNfD4jA.css +1 -0
- package/packages/ui/dist/assets/{index-DVjAiPHI.js → index-q0mGElxZ.js} +3 -3
- package/packages/ui/dist/assets/{index.es-dZlNPpfR.js → index.es-BaCKS_tW.js} +4 -4
- package/packages/ui/dist/assets/{info-B91pD5Rw.js → info-B1enFsqh.js} +1 -1
- package/packages/ui/dist/assets/{info-circle-CySl3_on.js → info-circle-D4j3FISs.js} +1 -1
- package/packages/ui/dist/assets/{lightbulb-wwG8LQLo.js → lightbulb-DZbKr-vS.js} +1 -1
- package/packages/ui/dist/assets/{mail-D617YZ8y.js → mail-D-TO_uVQ.js} +1 -1
- package/packages/ui/dist/assets/{metamask-sdk-RbLbxUgF.js → metamask-sdk-DljW3QD1.js} +1 -1
- package/packages/ui/dist/assets/{mobile-CD9KlA0m.js → mobile-Bkmwzav2.js} +1 -1
- package/packages/ui/dist/assets/{more-BQ_rpPXo.js → more-D1_I_jiB.js} +1 -1
- package/packages/ui/dist/assets/{network-placeholder-BA7nl9e6.js → network-placeholder-DUaFjoXh.js} +1 -1
- package/packages/ui/dist/assets/{nftPlaceholder-D1EaaeDn.js → nftPlaceholder-Cc0iUryh.js} +1 -1
- package/packages/ui/dist/assets/{off-DnGG35_w.js → off-BvX71sse.js} +1 -1
- package/packages/ui/dist/assets/{parseSignature-E29x8poM.js → parseSignature-BAS-wKoj.js} +1 -1
- package/packages/ui/dist/assets/{play-store-C5u2FvYB.js → play-store-XzLbtbTd.js} +1 -1
- package/packages/ui/dist/assets/{plus-CM4xJkvI.js → plus-B77_RmYR.js} +1 -1
- package/packages/ui/dist/assets/{qr-code-kM3FUIdR.js → qr-code-BNeIhB1d.js} +1 -1
- package/packages/ui/dist/assets/{recycle-horizontal-DWrRWIBM.js → recycle-horizontal-B9sX-yty.js} +1 -1
- package/packages/ui/dist/assets/{refresh-CztbjK2d.js → refresh-BWRygnjm.js} +1 -1
- package/packages/ui/dist/assets/{reown-logo-DUHEIodF.js → reown-logo-DCAEsGFm.js} +1 -1
- package/packages/ui/dist/assets/{search-BJtb4mn1.js → search-ZXIqrawS.js} +1 -1
- package/packages/ui/dist/assets/{secp256k1-BjrTZpQx.js → secp256k1-Doz05h4g.js} +1 -1
- package/packages/ui/dist/assets/{send-B3_kavG1.js → send-BQcO0jNC.js} +1 -1
- package/packages/ui/dist/assets/{swapHorizontal-BrF9POiv.js → swapHorizontal-4yZEzz2K.js} +1 -1
- package/packages/ui/dist/assets/{swapHorizontalBold-Dgf8OjXj.js → swapHorizontalBold-DxBKu3sl.js} +1 -1
- package/packages/ui/dist/assets/{swapHorizontalMedium-C6wX0JZj.js → swapHorizontalMedium-DAQYJ2JK.js} +1 -1
- package/packages/ui/dist/assets/{swapHorizontalRoundedBold-DTAVw6oF.js → swapHorizontalRoundedBold-CUlZzFJ6.js} +1 -1
- package/packages/ui/dist/assets/{swapVertical-KGlTFNoi.js → swapVertical-CjWHAaDM.js} +1 -1
- package/packages/ui/dist/assets/{telegram-DnLrK-4y.js → telegram-JBeabiJP.js} +1 -1
- package/packages/ui/dist/assets/{three-dots-C6_oMJfw.js → three-dots-D3R8OjSx.js} +1 -1
- package/packages/ui/dist/assets/{twitch-DvPqPD4f.js → twitch-1f9z7xVO.js} +1 -1
- package/packages/ui/dist/assets/{twitterIcon-BZdk82Am.js → twitterIcon-BW7n2xnp.js} +1 -1
- package/packages/ui/dist/assets/{verify-CbESD5G0.js → verify-Cs5owI38.js} +1 -1
- package/packages/ui/dist/assets/{verify-filled-BRjTrLxw.js → verify-filled-Ci5sx5qS.js} +1 -1
- package/packages/ui/dist/assets/{w3m-modal-D9b2TGHc.js → w3m-modal-DnWtss8u.js} +1 -1
- package/packages/ui/dist/assets/{wallet-B87E5UId.js → wallet-MaGNqaW-.js} +1 -1
- package/packages/ui/dist/assets/{wallet-placeholder-DmssSbYf.js → wallet-placeholder-kTOy12_L.js} +1 -1
- package/packages/ui/dist/assets/{walletconnect-CZkLKWMZ.js → walletconnect-CyuP92jg.js} +1 -1
- package/packages/ui/dist/assets/{warning-circle-BPTpHB1P.js → warning-circle-BImUCdpG.js} +1 -1
- package/packages/ui/dist/assets/{x-D_dEtEDU.js → x-II45JHpV.js} +1 -1
- package/packages/ui/dist/index.html +2 -2
- package/scripts/check-docs.mjs +1 -1
- package/templates/default/.agents/skills/sail-mandates/SKILL.md +12 -0
- package/templates/default/.agents/skills/sail-onboarding/SKILL.md +33 -34
- package/templates/default/.agents/skills/sail-overview/SKILL.md +100 -0
- package/templates/default/.agents/skills/sail-project-info/SKILL.md +2 -0
- package/templates/default/.agents/skills/sail-sailor/SKILL.md +190 -0
- package/templates/default/.agents/skills/sail-setup/SKILL.md +38 -0
- package/templates/default/.gitlab-ci.yml +58 -0
- package/templates/default/AGENTS.md +12 -87
- package/packages/cli/dist/mcp.cjs +0 -15534
- package/packages/ui/dist/assets/cursor-DRFqL8nZ.js +0 -3
- package/packages/ui/dist/assets/index-D6_Zei-R.js +0 -1790
- package/packages/ui/dist/assets/index-DZ2C2rHq.css +0 -1
|
@@ -15943,7 +15943,7 @@ var require_get_intrinsic = __commonJS({
|
|
|
15943
15943
|
var abs = require_abs();
|
|
15944
15944
|
var floor = require_floor();
|
|
15945
15945
|
var max = require_max();
|
|
15946
|
-
var
|
|
15946
|
+
var min = require_min();
|
|
15947
15947
|
var pow = require_pow();
|
|
15948
15948
|
var round = require_round();
|
|
15949
15949
|
var sign3 = require_sign();
|
|
@@ -16057,7 +16057,7 @@ var require_get_intrinsic = __commonJS({
|
|
|
16057
16057
|
"%Math.abs%": abs,
|
|
16058
16058
|
"%Math.floor%": floor,
|
|
16059
16059
|
"%Math.max%": max,
|
|
16060
|
-
"%Math.min%":
|
|
16060
|
+
"%Math.min%": min,
|
|
16061
16061
|
"%Math.pow%": pow,
|
|
16062
16062
|
"%Math.round%": round,
|
|
16063
16063
|
"%Math.sign%": sign3,
|
|
@@ -22055,12 +22055,12 @@ var require_cookie = __commonJS({
|
|
|
22055
22055
|
} while (++index2 < max);
|
|
22056
22056
|
return max;
|
|
22057
22057
|
}
|
|
22058
|
-
function endIndex(str, index2,
|
|
22059
|
-
while (index2 >
|
|
22058
|
+
function endIndex(str, index2, min) {
|
|
22059
|
+
while (index2 > min) {
|
|
22060
22060
|
var code = str.charCodeAt(--index2);
|
|
22061
22061
|
if (code !== 32 && code !== 9) return index2 + 1;
|
|
22062
22062
|
}
|
|
22063
|
-
return
|
|
22063
|
+
return min;
|
|
22064
22064
|
}
|
|
22065
22065
|
function serialize(name, val, opt) {
|
|
22066
22066
|
var enc = opt && opt.encode || encodeURIComponent;
|
|
@@ -26953,8 +26953,8 @@ var init_encoding = __esm({
|
|
|
26953
26953
|
"../../node_modules/.pnpm/viem@2.51.3_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.4.3/node_modules/viem/_esm/errors/encoding.js"() {
|
|
26954
26954
|
init_base();
|
|
26955
26955
|
IntegerOutOfRangeError = class extends BaseError {
|
|
26956
|
-
constructor({ max, min
|
|
26957
|
-
super(`Number "${value}" is not in safe ${size6 ? `${size6 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${
|
|
26956
|
+
constructor({ max, min, signed, size: size6, value }) {
|
|
26957
|
+
super(`Number "${value}" is not in safe ${size6 ? `${size6 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: "IntegerOutOfRangeError" });
|
|
26958
26958
|
}
|
|
26959
26959
|
};
|
|
26960
26960
|
SizeOverflowError = class extends BaseError {
|
|
@@ -27265,9 +27265,9 @@ function aexists(instance, checkFinished = true) {
|
|
|
27265
27265
|
}
|
|
27266
27266
|
function aoutput(out, instance) {
|
|
27267
27267
|
abytes(out);
|
|
27268
|
-
const
|
|
27269
|
-
if (out.length <
|
|
27270
|
-
throw new Error("digestInto() expects output buffer of length at least " +
|
|
27268
|
+
const min = instance.outputLen;
|
|
27269
|
+
if (out.length < min) {
|
|
27270
|
+
throw new Error("digestInto() expects output buffer of length at least " + min);
|
|
27271
27271
|
}
|
|
27272
27272
|
}
|
|
27273
27273
|
function u32(arr) {
|
|
@@ -28063,11 +28063,11 @@ function encodeBool(value) {
|
|
|
28063
28063
|
function encodeNumber(value, { signed, size: size6 = 256 }) {
|
|
28064
28064
|
if (typeof size6 === "number") {
|
|
28065
28065
|
const max = 2n ** (BigInt(size6) - (signed ? 1n : 0n)) - 1n;
|
|
28066
|
-
const
|
|
28067
|
-
if (value > max || value <
|
|
28066
|
+
const min = signed ? -max - 1n : 0n;
|
|
28067
|
+
if (value > max || value < min)
|
|
28068
28068
|
throw new IntegerOutOfRangeError({
|
|
28069
28069
|
max: max.toString(),
|
|
28070
|
-
min:
|
|
28070
|
+
min: min.toString(),
|
|
28071
28071
|
signed,
|
|
28072
28072
|
size: size6 / 8,
|
|
28073
28073
|
value: value.toString()
|
|
@@ -29898,12 +29898,12 @@ function utf8ToBytes2(str) {
|
|
|
29898
29898
|
throw new Error("string expected");
|
|
29899
29899
|
return new Uint8Array(new TextEncoder().encode(str));
|
|
29900
29900
|
}
|
|
29901
|
-
function inRange(n,
|
|
29902
|
-
return isPosBig(n) && isPosBig(
|
|
29901
|
+
function inRange(n, min, max) {
|
|
29902
|
+
return isPosBig(n) && isPosBig(min) && isPosBig(max) && min <= n && n < max;
|
|
29903
29903
|
}
|
|
29904
|
-
function aInRange(title, n,
|
|
29905
|
-
if (!inRange(n,
|
|
29906
|
-
throw new Error("expected valid " + title + ": " +
|
|
29904
|
+
function aInRange(title, n, min, max) {
|
|
29905
|
+
if (!inRange(n, min, max))
|
|
29906
|
+
throw new Error("expected valid " + title + ": " + min + " <= n < " + max + ", got " + n);
|
|
29907
29907
|
}
|
|
29908
29908
|
function bitLen(n) {
|
|
29909
29909
|
let len;
|
|
@@ -34260,8 +34260,8 @@ var init_encoding2 = __esm({
|
|
|
34260
34260
|
"../../node_modules/.pnpm/viem@2.51.3_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/errors/encoding.js"() {
|
|
34261
34261
|
init_base2();
|
|
34262
34262
|
IntegerOutOfRangeError2 = class extends BaseError3 {
|
|
34263
|
-
constructor({ max, min
|
|
34264
|
-
super(`Number "${value}" is not in safe ${size6 ? `${size6 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${
|
|
34263
|
+
constructor({ max, min, signed, size: size6, value }) {
|
|
34264
|
+
super(`Number "${value}" is not in safe ${size6 ? `${size6 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: "IntegerOutOfRangeError" });
|
|
34265
34265
|
}
|
|
34266
34266
|
};
|
|
34267
34267
|
InvalidBytesBooleanError = class extends BaseError3 {
|
|
@@ -34990,11 +34990,11 @@ function encodeBool2(value) {
|
|
|
34990
34990
|
function encodeNumber2(value, { signed, size: size6 = 256 }) {
|
|
34991
34991
|
if (typeof size6 === "number") {
|
|
34992
34992
|
const max = 2n ** (BigInt(size6) - (signed ? 1n : 0n)) - 1n;
|
|
34993
|
-
const
|
|
34994
|
-
if (value > max || value <
|
|
34993
|
+
const min = signed ? -max - 1n : 0n;
|
|
34994
|
+
if (value > max || value < min)
|
|
34995
34995
|
throw new IntegerOutOfRangeError2({
|
|
34996
34996
|
max: max.toString(),
|
|
34997
|
-
min:
|
|
34997
|
+
min: min.toString(),
|
|
34998
34998
|
signed,
|
|
34999
34999
|
size: size6 / 8,
|
|
35000
35000
|
value: value.toString()
|
|
@@ -38094,8 +38094,8 @@ var init_Hex = __esm({
|
|
|
38094
38094
|
encoder6 = /* @__PURE__ */ new TextEncoder();
|
|
38095
38095
|
hexes5 = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
|
|
38096
38096
|
IntegerOutOfRangeError3 = class extends BaseError4 {
|
|
38097
|
-
constructor({ max, min
|
|
38098
|
-
super(`Number \`${value}\` is not in safe${size6 ? ` ${size6 * 8}-bit` : ""}${signed ? " signed" : " unsigned"} integer range ${max ? `(\`${
|
|
38097
|
+
constructor({ max, min, signed, size: size6, value }) {
|
|
38098
|
+
super(`Number \`${value}\` is not in safe${size6 ? ` ${size6 * 8}-bit` : ""}${signed ? " signed" : " unsigned"} integer range ${max ? `(\`${min}\` to \`${max}\`)` : `(above \`${min}\`)`}`);
|
|
38099
38099
|
Object.defineProperty(this, "name", {
|
|
38100
38100
|
enumerable: true,
|
|
38101
38101
|
configurable: true,
|
|
@@ -40808,39 +40808,12 @@ function buildSafeSetupInitializer(params) {
|
|
|
40808
40808
|
}
|
|
40809
40809
|
|
|
40810
40810
|
// ../sdk/dist/fees.js
|
|
40811
|
-
function
|
|
40812
|
-
return
|
|
40813
|
-
|
|
40814
|
-
|
|
40815
|
-
|
|
40816
|
-
|
|
40817
|
-
publicClient.readContract({
|
|
40818
|
-
address: governance,
|
|
40819
|
-
abi: SailGovernanceAbi,
|
|
40820
|
-
functionName: "baseFee"
|
|
40821
|
-
}),
|
|
40822
|
-
publicClient.readContract({
|
|
40823
|
-
address: governance,
|
|
40824
|
-
abi: SailGovernanceAbi,
|
|
40825
|
-
functionName: "complexityRate"
|
|
40826
|
-
}),
|
|
40827
|
-
publicClient.readContract({
|
|
40828
|
-
address: governance,
|
|
40829
|
-
abi: SailGovernanceAbi,
|
|
40830
|
-
functionName: "MAX_PERMISSION_FEE_WEI"
|
|
40831
|
-
}),
|
|
40832
|
-
publicClient.getBytecode({ address: permission })
|
|
40833
|
-
]);
|
|
40834
|
-
const byteLength = code ? BigInt((code.length - 2) / 2) : 0n;
|
|
40835
|
-
const fee = min(baseFee, cap) + min(byteLength * complexityRate, cap);
|
|
40836
|
-
return min(fee, cap);
|
|
40837
|
-
} catch {
|
|
40838
|
-
return publicClient.readContract({
|
|
40839
|
-
address: governance,
|
|
40840
|
-
abi: SailGovernanceAbi,
|
|
40841
|
-
functionName: "permissionRegistrationFee"
|
|
40842
|
-
});
|
|
40843
|
-
}
|
|
40811
|
+
async function readPermissionRegistrationFee(publicClient, governance) {
|
|
40812
|
+
return publicClient.readContract({
|
|
40813
|
+
address: governance,
|
|
40814
|
+
abi: SailGovernanceAbi,
|
|
40815
|
+
functionName: "permissionRegistrationFee"
|
|
40816
|
+
});
|
|
40844
40817
|
}
|
|
40845
40818
|
|
|
40846
40819
|
// ../../node_modules/.pnpm/viem@2.51.3_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/getAction.js
|
|
@@ -46228,11 +46201,11 @@ function encodeBoolean(value) {
|
|
|
46228
46201
|
function encodeNumber3(value, { signed, size: size6 }) {
|
|
46229
46202
|
if (typeof size6 === "number") {
|
|
46230
46203
|
const max = 2n ** (BigInt(size6) - (signed ? 1n : 0n)) - 1n;
|
|
46231
|
-
const
|
|
46232
|
-
if (value > max || value <
|
|
46204
|
+
const min = signed ? -max - 1n : 0n;
|
|
46205
|
+
if (value > max || value < min)
|
|
46233
46206
|
throw new IntegerOutOfRangeError3({
|
|
46234
46207
|
max: max.toString(),
|
|
46235
|
-
min:
|
|
46208
|
+
min: min.toString(),
|
|
46236
46209
|
signed,
|
|
46237
46210
|
size: size6 / 8,
|
|
46238
46211
|
value: value.toString()
|
|
@@ -50586,8 +50559,8 @@ function startServer(sailDir, { port = PORT } = {}) {
|
|
|
50586
50559
|
if (!deployment?.kernel) throw new Error(`No SailKernel deployment for chain ${chainId}`);
|
|
50587
50560
|
const keyring = await LocalKeyring.fromKeystoreFile(at("keys/manager.json"), password);
|
|
50588
50561
|
const publicClient = createPublicClient({ transport: http(rpcUrl) });
|
|
50589
|
-
|
|
50590
|
-
|
|
50562
|
+
const flatFee = await readPermissionRegistrationFee(publicClient, deployment.governance);
|
|
50563
|
+
const fee = flatFee * BigInt(addrs.length);
|
|
50591
50564
|
const chain2 = defineChain({
|
|
50592
50565
|
id: Number(chainId),
|
|
50593
50566
|
name: `chain-${chainId}`,
|
|
@@ -50603,6 +50576,27 @@ function startServer(sailDir, { port = PORT } = {}) {
|
|
|
50603
50576
|
txHash = await walletClient.sendTransaction({ to: deployment.kernel, data, value: fee, account: keyring.viemAccount, chain: chain2 });
|
|
50604
50577
|
const receipt = await publicClient.waitForTransactionReceipt({ hash: txHash });
|
|
50605
50578
|
if (receipt.status !== "success") throw new Error(`registerPermissions reverted (tx ${txHash})`);
|
|
50579
|
+
const feeEth = formatEther(flatFee);
|
|
50580
|
+
for (const addr of addrs) {
|
|
50581
|
+
const meta = permissionMeta.find((p) => p.address && getAddress(p.address) === addr);
|
|
50582
|
+
const ev = {
|
|
50583
|
+
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
50584
|
+
actor: "agent",
|
|
50585
|
+
type: "permission_registered",
|
|
50586
|
+
permission: addr,
|
|
50587
|
+
...meta?.template ? { name: meta.template } : {},
|
|
50588
|
+
sma: safe,
|
|
50589
|
+
txHash,
|
|
50590
|
+
chainId,
|
|
50591
|
+
fee: flatFee.toString(),
|
|
50592
|
+
feeEth
|
|
50593
|
+
};
|
|
50594
|
+
try {
|
|
50595
|
+
import_node_fs2.default.appendFileSync(at("activity.jsonl"), `${JSON.stringify(ev)}
|
|
50596
|
+
`);
|
|
50597
|
+
} catch {
|
|
50598
|
+
}
|
|
50599
|
+
}
|
|
50606
50600
|
} catch (err) {
|
|
50607
50601
|
res.status(500).json({ error: `On-chain registration failed: ${err?.message ?? String(err)}` });
|
|
50608
50602
|
return;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* SailGovernance ABI —
|
|
3
|
-
*
|
|
4
|
-
* fee
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* SailGovernance ABI — the views needed to read the permission registration fee.
|
|
3
|
+
* The kernel charges a FLAT fee: `permissionRegistrationFee()` per permission
|
|
4
|
+
* (total = fee × n), bounded by MAX_PERMISSION_FEE_WEI, excess refunded. The
|
|
5
|
+
* baseFee / complexityRate views below describe an abandoned bytecode-size-based
|
|
6
|
+
* design that never shipped in the live contracts; they are retained only for
|
|
7
|
+
* back-compat and are not used to compute the fee.
|
|
7
8
|
*/
|
|
8
9
|
export declare const SailGovernanceAbi: readonly [{
|
|
9
10
|
readonly type: "function";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SailGovernance.d.ts","sourceRoot":"","sources":["../../src/abis/SailGovernance.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"SailGovernance.d.ts","sourceRoot":"","sources":["../../src/abis/SailGovernance.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CpB,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* SailGovernance ABI —
|
|
3
|
-
*
|
|
4
|
-
* fee
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* SailGovernance ABI — the views needed to read the permission registration fee.
|
|
3
|
+
* The kernel charges a FLAT fee: `permissionRegistrationFee()` per permission
|
|
4
|
+
* (total = fee × n), bounded by MAX_PERMISSION_FEE_WEI, excess refunded. The
|
|
5
|
+
* baseFee / complexityRate views below describe an abandoned bytecode-size-based
|
|
6
|
+
* design that never shipped in the live contracts; they are retained only for
|
|
7
|
+
* back-compat and are not used to compute the fee.
|
|
7
8
|
*/
|
|
8
9
|
export const SailGovernanceAbi = [
|
|
9
10
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SailGovernance.js","sourceRoot":"","sources":["../../src/abis/SailGovernance.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"SailGovernance.js","sourceRoot":"","sources":["../../src/abis/SailGovernance.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,SAAS;QACf,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC/B;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,gBAAgB;QACtB,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC/B;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,wBAAwB;QAC9B,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC/B;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,2BAA2B;QACjC,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC/B;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,0BAA0B;QAChC,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC/B;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;KAC5B;CACO,CAAC"}
|
|
@@ -1,16 +1,64 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Address, type PublicClient } from "viem";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Read the live FLAT per-permission registration fee (wei) from governance —
|
|
4
|
+
* `permissionRegistrationFee()`, the single scalar the kernel's
|
|
5
|
+
* `_calcPermissionFee()` returns for EVERY charging path (registerPermission,
|
|
6
|
+
* replacePermission, and the batch / deployAndAttach variants).
|
|
4
7
|
*
|
|
5
|
-
*
|
|
8
|
+
* This is THE single source of truth for the registration fee. The kernel
|
|
9
|
+
* charges `fee × N` for N permissions, bounded by MAX_PERMISSION_FEE_WEI
|
|
10
|
+
* (0.001 ETH) and refunding any excess; there is NO bytecode/size-based
|
|
11
|
+
* component in the live contracts (that "variable" formula existed only in
|
|
12
|
+
* stale protocol docs describing an abandoned design). Underpaying reverts with
|
|
13
|
+
* InsufficientFee(required, provided).
|
|
14
|
+
*/
|
|
15
|
+
export declare function readPermissionRegistrationFee(publicClient: PublicClient, governance: Address): Promise<bigint>;
|
|
16
|
+
/** The flat fee a single permission is charged on registration. */
|
|
17
|
+
export type PermissionFee = {
|
|
18
|
+
permission: Address;
|
|
19
|
+
feeWei: bigint;
|
|
20
|
+
};
|
|
21
|
+
/** The total registration fee for a mandate, with the per-permission breakdown. */
|
|
22
|
+
export type MandateFeeEstimate = {
|
|
23
|
+
/** Total wei the kernel will require = flat fee × number of permissions. */
|
|
24
|
+
totalWei: bigint;
|
|
25
|
+
/** The flat fee attributed to each permission (uniform), in the order given. */
|
|
26
|
+
perPermission: PermissionFee[];
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The TOTAL registration fee for a mandate of `permissions`: the flat
|
|
30
|
+
* `permissionRegistrationFee` read ONCE and applied per permission (`fee × N`) —
|
|
31
|
+
* exactly what the kernel charges (it requires `msg.value >= fee × n` for a
|
|
32
|
+
* batch, flat per permission; excess is refunded).
|
|
6
33
|
*
|
|
7
|
-
*
|
|
34
|
+
* Single source of truth: disclosure, preflight, the tx `value`, and the
|
|
35
|
+
* activity record all derive from this, so they are provably the same number
|
|
36
|
+
* and provably the number the kernel will require.
|
|
37
|
+
*/
|
|
38
|
+
export declare function estimateMandateRegistrationFee(publicClient: PublicClient, governance: Address, permissions: Address[]): Promise<MandateFeeEstimate>;
|
|
39
|
+
/**
|
|
40
|
+
* Plain-language disclosure of a mandate's flat registration fee, e.g.
|
|
41
|
+
* `"Registration fee: 0.00003 ETH (3 permissions × 0.00001 ETH)"`.
|
|
8
42
|
*
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*
|
|
43
|
+
* Factual cost statement only — no price/value framing.
|
|
44
|
+
*/
|
|
45
|
+
export declare function describeMandateFee(estimate: MandateFeeEstimate): string;
|
|
46
|
+
/** Thrown when a signer cannot cover the registration fee. A typed error so the
|
|
47
|
+
* preflight block can't be silently disabled by re-wording a message string. */
|
|
48
|
+
export declare class RegistrationFeeError extends Error {
|
|
49
|
+
/** Total fee required (wei). */
|
|
50
|
+
readonly requiredWei: bigint;
|
|
51
|
+
/** Signer balance available (wei). */
|
|
52
|
+
readonly balanceWei: bigint;
|
|
53
|
+
constructor(message: string, requiredWei: bigint, balanceWei: bigint);
|
|
54
|
+
}
|
|
55
|
+
/** Shortfall (wei) between `balanceWei` and the total fee, or `0n` if covered. */
|
|
56
|
+
export declare function feeShortfall(balanceWei: bigint, totalFeeWei: bigint): bigint;
|
|
57
|
+
/**
|
|
58
|
+
* Throw a {@link RegistrationFeeError} when `balanceWei` cannot cover the total
|
|
59
|
+
* registration fee. Call this BEFORE prompting the owner to sign so an
|
|
60
|
+
* underfunded signer fails early rather than after a wasted signature or an
|
|
61
|
+
* on-chain revert. Scoped to the fee itself — gas is a separate concern.
|
|
14
62
|
*/
|
|
15
|
-
export declare function
|
|
63
|
+
export declare function assertFeeAffordable(balanceWei: bigint, totalFeeWei: bigint): void;
|
|
16
64
|
//# sourceMappingURL=fees.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fees.d.ts","sourceRoot":"","sources":["../src/fees.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"fees.d.ts","sourceRoot":"","sources":["../src/fees.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,MAAM,CAAC;AAGpE;;;;;;;;;;;;GAYG;AACH,wBAAsB,6BAA6B,CACjD,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,OAAO,GAClB,OAAO,CAAC,MAAM,CAAC,CAMjB;AAED,mEAAmE;AACnE,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,mFAAmF;AACnF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC;IACjB,gFAAgF;IAChF,aAAa,EAAE,aAAa,EAAE,CAAC;CAChC,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAsB,8BAA8B,CAClD,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,OAAO,EACnB,WAAW,EAAE,OAAO,EAAE,GACrB,OAAO,CAAC,kBAAkB,CAAC,CAK7B;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,MAAM,CAMvE;AAED;iFACiF;AACjF,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,gCAAgC;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,sCAAsC;IACtC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;gBAChB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;CAMrE;AAED,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CASjF"}
|
|
@@ -1,51 +1,83 @@
|
|
|
1
|
+
import { formatEther } from "viem";
|
|
1
2
|
import { SailGovernanceAbi } from "./abis/SailGovernance.js";
|
|
2
|
-
function min(a, b) {
|
|
3
|
-
return a < b ? a : b;
|
|
4
|
-
}
|
|
5
3
|
/**
|
|
6
|
-
*
|
|
4
|
+
* Read the live FLAT per-permission registration fee (wei) from governance —
|
|
5
|
+
* `permissionRegistrationFee()`, the single scalar the kernel's
|
|
6
|
+
* `_calcPermissionFee()` returns for EVERY charging path (registerPermission,
|
|
7
|
+
* replacePermission, and the batch / deployAndAttach variants).
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
+
* This is THE single source of truth for the registration fee. The kernel
|
|
10
|
+
* charges `fee × N` for N permissions, bounded by MAX_PERMISSION_FEE_WEI
|
|
11
|
+
* (0.001 ETH) and refunding any excess; there is NO bytecode/size-based
|
|
12
|
+
* component in the live contracts (that "variable" formula existed only in
|
|
13
|
+
* stale protocol docs describing an abandoned design). Underpaying reverts with
|
|
14
|
+
* InsufficientFee(required, provided).
|
|
15
|
+
*/
|
|
16
|
+
export async function readPermissionRegistrationFee(publicClient, governance) {
|
|
17
|
+
return publicClient.readContract({
|
|
18
|
+
address: governance,
|
|
19
|
+
abi: SailGovernanceAbi,
|
|
20
|
+
functionName: "permissionRegistrationFee",
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The TOTAL registration fee for a mandate of `permissions`: the flat
|
|
25
|
+
* `permissionRegistrationFee` read ONCE and applied per permission (`fee × N`) —
|
|
26
|
+
* exactly what the kernel charges (it requires `msg.value >= fee × n` for a
|
|
27
|
+
* batch, flat per permission; excess is refunded).
|
|
9
28
|
*
|
|
10
|
-
*
|
|
29
|
+
* Single source of truth: disclosure, preflight, the tx `value`, and the
|
|
30
|
+
* activity record all derive from this, so they are provably the same number
|
|
31
|
+
* and provably the number the kernel will require.
|
|
32
|
+
*/
|
|
33
|
+
export async function estimateMandateRegistrationFee(publicClient, governance, permissions) {
|
|
34
|
+
const flatFeeWei = await readPermissionRegistrationFee(publicClient, governance);
|
|
35
|
+
const perPermission = permissions.map((permission) => ({ permission, feeWei: flatFeeWei }));
|
|
36
|
+
const totalWei = flatFeeWei * BigInt(permissions.length);
|
|
37
|
+
return { totalWei, perPermission };
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Plain-language disclosure of a mandate's flat registration fee, e.g.
|
|
41
|
+
* `"Registration fee: 0.00003 ETH (3 permissions × 0.00001 ETH)"`.
|
|
11
42
|
*
|
|
12
|
-
*
|
|
13
|
-
* cap = MAX_PERMISSION_FEE_WEI. Newer governance may instead expose a flat
|
|
14
|
-
* permissionRegistrationFee(); if the legacy views are missing we fall back to
|
|
15
|
-
* that. The fee must be sent exactly: underpaying reverts with InsufficientFee,
|
|
16
|
-
* and overpaying (e.g. sending the cap) needlessly ties up the agent's balance.
|
|
43
|
+
* Factual cost statement only — no price/value framing.
|
|
17
44
|
*/
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const byteLength = code ? BigInt((code.length - 2) / 2) : 0n;
|
|
39
|
-
const fee = min(baseFee, cap) + min(byteLength * complexityRate, cap);
|
|
40
|
-
return min(fee, cap);
|
|
45
|
+
export function describeMandateFee(estimate) {
|
|
46
|
+
const count = estimate.perPermission.length;
|
|
47
|
+
if (count === 0)
|
|
48
|
+
return "Registration fee: 0 ETH (no new permissions to register)";
|
|
49
|
+
const noun = count === 1 ? "permission" : "permissions";
|
|
50
|
+
const perFeeWei = estimate.perPermission[0].feeWei; // flat — identical for every permission
|
|
51
|
+
return `Registration fee: ${formatEther(estimate.totalWei)} ETH (${count} ${noun} × ${formatEther(perFeeWei)} ETH)`;
|
|
52
|
+
}
|
|
53
|
+
/** Thrown when a signer cannot cover the registration fee. A typed error so the
|
|
54
|
+
* preflight block can't be silently disabled by re-wording a message string. */
|
|
55
|
+
export class RegistrationFeeError extends Error {
|
|
56
|
+
/** Total fee required (wei). */
|
|
57
|
+
requiredWei;
|
|
58
|
+
/** Signer balance available (wei). */
|
|
59
|
+
balanceWei;
|
|
60
|
+
constructor(message, requiredWei, balanceWei) {
|
|
61
|
+
super(message);
|
|
62
|
+
this.name = "RegistrationFeeError";
|
|
63
|
+
this.requiredWei = requiredWei;
|
|
64
|
+
this.balanceWei = balanceWei;
|
|
41
65
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
66
|
+
}
|
|
67
|
+
/** Shortfall (wei) between `balanceWei` and the total fee, or `0n` if covered. */
|
|
68
|
+
export function feeShortfall(balanceWei, totalFeeWei) {
|
|
69
|
+
return balanceWei >= totalFeeWei ? 0n : totalFeeWei - balanceWei;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Throw a {@link RegistrationFeeError} when `balanceWei` cannot cover the total
|
|
73
|
+
* registration fee. Call this BEFORE prompting the owner to sign so an
|
|
74
|
+
* underfunded signer fails early rather than after a wasted signature or an
|
|
75
|
+
* on-chain revert. Scoped to the fee itself — gas is a separate concern.
|
|
76
|
+
*/
|
|
77
|
+
export function assertFeeAffordable(balanceWei, totalFeeWei) {
|
|
78
|
+
if (balanceWei < totalFeeWei) {
|
|
79
|
+
throw new RegistrationFeeError(`Insufficient ETH for the ${formatEther(totalFeeWei)} ETH registration fee; ` +
|
|
80
|
+
`signer balance is ${formatEther(balanceWei)} ETH.`, totalFeeWei, balanceWei);
|
|
49
81
|
}
|
|
50
82
|
}
|
|
51
83
|
//# sourceMappingURL=fees.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fees.js","sourceRoot":"","sources":["../src/fees.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fees.js","sourceRoot":"","sources":["../src/fees.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,WAAW,EAAE,MAAM,MAAM,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,YAA0B,EAC1B,UAAmB;IAEnB,OAAO,YAAY,CAAC,YAAY,CAAC;QAC/B,OAAO,EAAE,UAAU;QACnB,GAAG,EAAE,iBAAiB;QACtB,YAAY,EAAE,2BAA2B;KAC1C,CAAoB,CAAC;AACxB,CAAC;AAgBD;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,YAA0B,EAC1B,UAAmB,EACnB,WAAsB;IAEtB,MAAM,UAAU,GAAG,MAAM,6BAA6B,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACjF,MAAM,aAAa,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;IAC5F,MAAM,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACzD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AACrC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAA4B;IAC7D,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC;IAC5C,IAAI,KAAK,KAAK,CAAC;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, REGISTER_PERMISSION_TYPE_ST
|
|
|
16
16
|
export type { KernelError } from "./errors.js";
|
|
17
17
|
export { KERNEL_ERROR_ABI, KERNEL_ERROR_SIGNATURES, decodeKernelError, explainKernelRevert, } from "./errors.js";
|
|
18
18
|
export { DISPATCH_EIP712_FIELDS, REGISTER_PERMISSION_TYPES, REGISTER_PERMISSION_TYPES_NO_DEADLINE, REGISTER_PERMISSIONS_BATCH_TYPES, buildDispatchSignature, buildRegisterPermissionTypedData, buildRegisterPermissionsBatchTypedData, sailKernelDomain, signRegisterPermission, } from "./eip712.js";
|
|
19
|
-
export {
|
|
19
|
+
export { RegistrationFeeError, assertFeeAffordable, describeMandateFee, estimateMandateRegistrationFee, feeShortfall, readPermissionRegistrationFee, } from "./fees.js";
|
|
20
|
+
export type { MandateFeeEstimate, PermissionFee } from "./fees.js";
|
|
20
21
|
export type { FetchLifiQuoteParams, LifiSwapQuote } from "./lifi.js";
|
|
21
22
|
export { DEFAULT_SLIPPAGE, LIFI_QUOTE_URL, LIFI_ROUTERS, encodeApprove, fetchLifiQuote, minTokenOut, } from "./lifi.js";
|
|
22
23
|
export type { AllocationItem, AllocationRequest, AllocationResponse, BenchmarkResponse, ComparePosition, CompareRequest, CompareResponse, ExplainRequest, ExplainResponse, InstitutionalRequest, InstitutionalResponse, OpportunitiesResponse, PortfolioCheckResponse, RebalanceRequest, RebalanceResponse, RisksSummaryResponse, SafeCheckResponse, SailIntelligenceOptions, ScreenRequest, ScreenResponse, ValidateRequest, ValidateResponse, VaultRiskResponse, VaultScreenResult, YieldOpportunity, YieldSourceItem, YieldSourcesResponse, } from "./intelligence.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa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BAAoB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,mBAAmB,CAAC"}
|
|
@@ -11,7 +11,7 @@ export { getSailDeployment, normalizeDeployment, sailDeployments, } from "./depl
|
|
|
11
11
|
export { DISPATCH_TYPE_STRINGS, DISPATCH_TYPEHASHES, REGISTER_PERMISSION_TYPE_STRINGS, REGISTER_PERMISSION_TYPEHASHES, clearCapabilityCache, detectKernelCapabilities, } from "./capabilities.js";
|
|
12
12
|
export { KERNEL_ERROR_ABI, KERNEL_ERROR_SIGNATURES, decodeKernelError, explainKernelRevert, } from "./errors.js";
|
|
13
13
|
export { DISPATCH_EIP712_FIELDS, REGISTER_PERMISSION_TYPES, REGISTER_PERMISSION_TYPES_NO_DEADLINE, REGISTER_PERMISSIONS_BATCH_TYPES, buildDispatchSignature, buildRegisterPermissionTypedData, buildRegisterPermissionsBatchTypedData, sailKernelDomain, signRegisterPermission, } from "./eip712.js";
|
|
14
|
-
export {
|
|
14
|
+
export { RegistrationFeeError, assertFeeAffordable, describeMandateFee, estimateMandateRegistrationFee, feeShortfall, readPermissionRegistrationFee, } from "./fees.js";
|
|
15
15
|
export { DEFAULT_SLIPPAGE, LIFI_QUOTE_URL, LIFI_ROUTERS, encodeApprove, fetchLifiQuote, minTokenOut, } from "./lifi.js";
|
|
16
16
|
export { SAIL_INTELLIGENCE_BASE_URL, SAIL_INTELLIGENCE_DOCS_URL, SailIntelligence, } from "./intelligence.js";
|
|
17
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,YAA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at build time.
|
|
5
5
|
* Do not edit manually — run `pnpm build` to regenerate.
|
|
6
6
|
*
|
|
7
|
-
* Spec version : 1.2.
|
|
8
|
-
* Generated at : 2026-06-
|
|
7
|
+
* Spec version : 1.2.1
|
|
8
|
+
* Generated at : 2026-06-29T17:17:50.187Z
|
|
9
9
|
*/
|
|
10
10
|
export declare const SAIL_INTELLIGENCE_BASE_URL = "https://api.sail.money";
|
|
11
11
|
export declare const SAIL_INTELLIGENCE_DOCS_URL = "https://api.sail.money/docs";
|
|
@@ -275,6 +275,8 @@ export interface OptimizationResult {
|
|
|
275
275
|
weighted_apr_final: number;
|
|
276
276
|
apr_improvement: number;
|
|
277
277
|
unallocated_amount?: string;
|
|
278
|
+
weighted_apr_equal_weight?: number | null;
|
|
279
|
+
weighted_apr_optimized?: number | null;
|
|
278
280
|
}
|
|
279
281
|
export interface PeriodSnapshot {
|
|
280
282
|
period_index: number;
|
|
@@ -341,6 +343,9 @@ export interface ProtocolAllocation {
|
|
|
341
343
|
risk_score?: number | null;
|
|
342
344
|
forecast_apr?: number[] | null;
|
|
343
345
|
forecast_apr_sigma?: number[] | null;
|
|
346
|
+
weight?: number | null;
|
|
347
|
+
apr_after_deposit?: number | null;
|
|
348
|
+
capacity_usd?: number | null;
|
|
344
349
|
}
|
|
345
350
|
/** CompareResponse without risk-delta fields — used by Engine Raw tier. */
|
|
346
351
|
export interface RawCompareResponse {
|