@dev.sail.money/sailor 1.2.1-92 → 1.2.1-94
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 +1 -1
- package/package.json +1 -2
- package/packages/cli/dist/index.cjs +99 -239
- package/packages/sdk/dist/intelligence.d.ts +1 -1
- package/packages/sdk/dist/intelligence.js +1 -1
- package/packages/ui/dist/assets/{add-DxdePWzw.js → add-Dj4_n773.js} +1 -1
- package/packages/ui/dist/assets/{all-wallets-CcDyr50U.js → all-wallets-BaFysN1G.js} +1 -1
- package/packages/ui/dist/assets/{app-store-BCSHe8EN.js → app-store-DOc31zzY.js} +1 -1
- package/packages/ui/dist/assets/{apple-Cio1eVvD.js → apple-BvrvOkPH.js} +1 -1
- package/packages/ui/dist/assets/{arrow-bottom-BlzVLDUl.js → arrow-bottom-E1AfjXOT.js} +1 -1
- package/packages/ui/dist/assets/{arrow-bottom-circle-Bi45LFFD.js → arrow-bottom-circle-sou7Vo1V.js} +1 -1
- package/packages/ui/dist/assets/{arrow-left-B3VkjnnJ.js → arrow-left-wk3G9Ywf.js} +1 -1
- package/packages/ui/dist/assets/{arrow-right-5DrDm6ll.js → arrow-right-_a703_Pw.js} +1 -1
- package/packages/ui/dist/assets/{arrow-top-wcXizC-G.js → arrow-top-txyg3R3e.js} +1 -1
- package/packages/ui/dist/assets/{bank-SqJo5jS7.js → bank-BB1kd0NJ.js} +1 -1
- package/packages/ui/dist/assets/{basic-BgCrxFS4.js → basic-D0dy7nIZ.js} +1 -1
- package/packages/ui/dist/assets/{browser-DI6l7Tng.js → browser-BwHLhsTn.js} +1 -1
- package/packages/ui/dist/assets/{card-DjP6FOz-.js → card-DRC6HmPF.js} +1 -1
- package/packages/ui/dist/assets/{ccip-CKVRZdQQ.js → ccip-Dq6KeJQl.js} +1 -1
- package/packages/ui/dist/assets/{checkmark-CBdVh2Kg.js → checkmark-TbAAQGjd.js} +1 -1
- package/packages/ui/dist/assets/{checkmark-bold-DvvsfN8H.js → checkmark-bold-4723vJ0-.js} +1 -1
- package/packages/ui/dist/assets/{chevron-bottom-BBTXniKn.js → chevron-bottom-DtLoBRe9.js} +1 -1
- package/packages/ui/dist/assets/{chevron-left-LL7HKhOV.js → chevron-left-BtydsF9j.js} +1 -1
- package/packages/ui/dist/assets/{chevron-right-BT3XvCea.js → chevron-right-BbkU_Kf8.js} +1 -1
- package/packages/ui/dist/assets/{chevron-top-D3lHXBcd.js → chevron-top-BWf-sN-F.js} +1 -1
- package/packages/ui/dist/assets/{chrome-store-BOzOVwkP.js → chrome-store-CVFxc5H2.js} +1 -1
- package/packages/ui/dist/assets/{clock-JbWtGDR2.js → clock-B4hJww1X.js} +1 -1
- package/packages/ui/dist/assets/{close-ZT_Jiw1f.js → close-Ci93jqGe.js} +1 -1
- package/packages/ui/dist/assets/{coinPlaceholder-C-Csq_lw.js → coinPlaceholder-cRv_xDgC.js} +1 -1
- package/packages/ui/dist/assets/{compass-XKXG-uKY.js → compass-_sZZPtm6.js} +1 -1
- package/packages/ui/dist/assets/{copy-BI6jLoZK.js → copy-DLaiLK0n.js} +1 -1
- package/packages/ui/dist/assets/{core-BLwyu_UZ.js → core-YssZmpJa.js} +3 -3
- package/packages/ui/dist/assets/cursor-B_xyJnjj.js +3 -0
- package/packages/ui/dist/assets/{cursor-transparent-CFZylRzv.js → cursor-transparent-CzXQbB2p.js} +1 -1
- package/packages/ui/dist/assets/{desktop-Hl3xhHy9.js → desktop-BiqQI1Ss.js} +1 -1
- package/packages/ui/dist/assets/{disconnect-DW6U-dN7.js → disconnect-DYu7YCzu.js} +1 -1
- package/packages/ui/dist/assets/{discord-BkDRI6sB.js → discord-C-ife-UZ.js} +1 -1
- package/packages/ui/dist/assets/{etherscan-DM0DlV8l.js → etherscan-Dq7ac-p9.js} +1 -1
- package/packages/ui/dist/assets/{events-DuWTfKWm.js → events-BhTGLk8n.js} +1 -1
- package/packages/ui/dist/assets/{exclamation-triangle-BJXppW_n.js → exclamation-triangle-BcOdRdbp.js} +1 -1
- package/packages/ui/dist/assets/{extension-CVwJSN6F.js → extension-DmJLIidM.js} +1 -1
- package/packages/ui/dist/assets/{external-link-9T1VC3J9.js → external-link-HNjp7-Po.js} +1 -1
- package/packages/ui/dist/assets/{facebook-R1848HX9.js → facebook-BrSvHNyw.js} +1 -1
- package/packages/ui/dist/assets/{fallback-BQyFegq4.js → fallback-Ubz80uXP.js} +1 -1
- package/packages/ui/dist/assets/{farcaster-C8lScwHE.js → farcaster-BsjltM6k.js} +1 -1
- package/packages/ui/dist/assets/{filters-D_hUKJc6.js → filters-B4yQbYZP.js} +1 -1
- package/packages/ui/dist/assets/{github-BUdSlQ0g.js → github-CFq82Dds.js} +1 -1
- package/packages/ui/dist/assets/{google-DCVSiGyR.js → google-DwZutf4a.js} +1 -1
- package/packages/ui/dist/assets/{help-circle-BmbA9WiR.js → help-circle-CyA_8KQg.js} +1 -1
- package/packages/ui/dist/assets/{id-BpZ2AesF.js → id-jyZYn4LJ.js} +1 -1
- package/packages/ui/dist/assets/{image-D9OlBR50.js → image-Zv0yoBcH.js} +1 -1
- package/packages/ui/dist/assets/{index-DnTTITgJ.js → index-67NncC_u.js} +3 -3
- package/packages/ui/dist/assets/{index-BcngInt2.js → index-BY8A6EK8.js} +1 -1
- package/packages/ui/dist/assets/{index-VuBRR5Ee.js → index-BdG43zCl.js} +1 -1
- package/packages/ui/dist/assets/{index-Cw74yaCx.js → index-BxRaYDiX.js} +1 -1
- package/packages/ui/dist/assets/{index-CFdoQ0C9.js → index-CeGppB9s.js} +1 -1
- package/packages/ui/dist/assets/index-DZ2C2rHq.css +1 -0
- package/packages/ui/dist/assets/{index-BmKpVmQo.js → index-_DkPx8RN.js} +50 -50
- package/packages/ui/dist/assets/{index.es-Cwe8eYYQ.js → index.es-C8EklrJY.js} +4 -4
- package/packages/ui/dist/assets/{info-CsTScSXv.js → info-BwGEOdmB.js} +1 -1
- package/packages/ui/dist/assets/{info-circle-C85unnhg.js → info-circle-BPCcX-Iq.js} +1 -1
- package/packages/ui/dist/assets/{lightbulb-DNRTVt--.js → lightbulb-BRwr4IaC.js} +1 -1
- package/packages/ui/dist/assets/{mail-lo_xlG5y.js → mail-D-k_Vhe4.js} +1 -1
- package/packages/ui/dist/assets/{metamask-sdk-D_zgrb2L.js → metamask-sdk-AcOgwGrj.js} +1 -1
- package/packages/ui/dist/assets/{mobile-CeziQrHs.js → mobile-B1ok9PfY.js} +1 -1
- package/packages/ui/dist/assets/{more-BJJ25Bco.js → more-DeMTMLWs.js} +1 -1
- package/packages/ui/dist/assets/{network-placeholder-C2bTejHc.js → network-placeholder-J0Rc1I89.js} +1 -1
- package/packages/ui/dist/assets/{nftPlaceholder-P9e90e3l.js → nftPlaceholder-dXGrzzoa.js} +1 -1
- package/packages/ui/dist/assets/{off-Cf9Lcmke.js → off-CS0f77lw.js} +1 -1
- package/packages/ui/dist/assets/{parseSignature-D3jDGZxJ.js → parseSignature-DJ16fHC4.js} +1 -1
- package/packages/ui/dist/assets/{play-store-CIvfWMTw.js → play-store-DmK8UaNC.js} +1 -1
- package/packages/ui/dist/assets/{plus-y4ZSXf_2.js → plus-CSGSnoCh.js} +1 -1
- package/packages/ui/dist/assets/{qr-code-BHKbMyiU.js → qr-code-BJMH0xmM.js} +1 -1
- package/packages/ui/dist/assets/{recycle-horizontal-IClLWZNS.js → recycle-horizontal-D5XP5VgJ.js} +1 -1
- package/packages/ui/dist/assets/{refresh-DGceqRDA.js → refresh-MLX3Rdp6.js} +1 -1
- package/packages/ui/dist/assets/{reown-logo-Bv7sNHvL.js → reown-logo-CVoDFQbM.js} +1 -1
- package/packages/ui/dist/assets/{search-CRgTCcsE.js → search-BDJDyvjC.js} +1 -1
- package/packages/ui/dist/assets/{secp256k1-Cqp3PtVi.js → secp256k1-BWh3B02k.js} +1 -1
- package/packages/ui/dist/assets/{send-DU6bIrPo.js → send-BOq2svx_.js} +1 -1
- package/packages/ui/dist/assets/{swapHorizontal-gFwRhx0T.js → swapHorizontal-ByjLi_-_.js} +1 -1
- package/packages/ui/dist/assets/{swapHorizontalBold-JtBzA3Ii.js → swapHorizontalBold-fmCp_4AE.js} +1 -1
- package/packages/ui/dist/assets/{swapHorizontalMedium-DoYVrxv8.js → swapHorizontalMedium-D6dFseYw.js} +1 -1
- package/packages/ui/dist/assets/{swapHorizontalRoundedBold-CAKgeiv9.js → swapHorizontalRoundedBold-B2V3m4ha.js} +1 -1
- package/packages/ui/dist/assets/{swapVertical-D4_Wkrmp.js → swapVertical-DVmCsmeT.js} +1 -1
- package/packages/ui/dist/assets/{telegram-DezHeoAw.js → telegram-Bv8JRbMM.js} +1 -1
- package/packages/ui/dist/assets/{three-dots-_2l4KYeg.js → three-dots-YYDJ18z6.js} +1 -1
- package/packages/ui/dist/assets/{twitch-D7lxAEZq.js → twitch-B2_Jy-Ft.js} +1 -1
- package/packages/ui/dist/assets/{twitterIcon-y5jVQyUi.js → twitterIcon-pKQzPQRt.js} +1 -1
- package/packages/ui/dist/assets/{verify-Ue3VkpeM.js → verify-Bty2jIav.js} +1 -1
- package/packages/ui/dist/assets/{verify-filled-DhQ6l5Hx.js → verify-filled-CKz2fuKl.js} +1 -1
- package/packages/ui/dist/assets/{w3m-modal-Dk1A5UT_.js → w3m-modal-Wg1mtmVM.js} +1 -1
- package/packages/ui/dist/assets/{wallet-Z5h6x06d.js → wallet-DslzC8rD.js} +1 -1
- package/packages/ui/dist/assets/{wallet-placeholder-C56EAJDw.js → wallet-placeholder-Dyw8jJ56.js} +1 -1
- package/packages/ui/dist/assets/{walletconnect-CIEAhB_r.js → walletconnect-DZBfbgp4.js} +1 -1
- package/packages/ui/dist/assets/{warning-circle-DhGvQBv6.js → warning-circle-D7NPDx4k.js} +1 -1
- package/packages/ui/dist/assets/{x-BveyWTSW.js → x-DRR_9FNs.js} +1 -1
- package/packages/ui/dist/index.html +2 -2
- package/templates/default/.agents/skills/sail-onboarding/SKILL.md +0 -7
- package/templates/default/.agents/skills/sail-servers/SKILL.md +0 -16
- package/templates/default/AGENTS.md +1 -1
- package/packages/ui/dist/assets/cursor-jNUI_tHN.js +0 -3
- package/packages/ui/dist/assets/index-CxWif5qB.css +0 -1
- package/scripts/clean.mjs +0 -17
|
@@ -35210,7 +35210,7 @@ var {
|
|
|
35210
35210
|
Help
|
|
35211
35211
|
} = import_index.default;
|
|
35212
35212
|
|
|
35213
|
-
// ../sdk/
|
|
35213
|
+
// ../sdk/dist/chains.js
|
|
35214
35214
|
var chains = {
|
|
35215
35215
|
// Ethereum mainnet
|
|
35216
35216
|
1: {
|
|
@@ -35292,17 +35292,15 @@ var chains = {
|
|
|
35292
35292
|
function getChain(chainId) {
|
|
35293
35293
|
const config = chains[chainId];
|
|
35294
35294
|
if (!config) {
|
|
35295
|
-
throw new Error(
|
|
35296
|
-
`Chain ${chainId} is not supported. Supported chains: 1 (Ethereum), 8453 (Base), 42161 (Arbitrum), 130 (Unichain), 84532 (Base Sepolia), 11155111 (Eth Sepolia).`
|
|
35297
|
-
);
|
|
35295
|
+
throw new Error(`Chain ${chainId} is not supported. Supported chains: 1 (Ethereum), 8453 (Base), 42161 (Arbitrum), 130 (Unichain), 84532 (Base Sepolia), 11155111 (Eth Sepolia).`);
|
|
35298
35296
|
}
|
|
35299
35297
|
return config;
|
|
35300
35298
|
}
|
|
35301
35299
|
|
|
35302
|
-
// ../sdk/
|
|
35300
|
+
// ../sdk/dist/client.js
|
|
35303
35301
|
init_esm2();
|
|
35304
35302
|
|
|
35305
|
-
// ../sdk/
|
|
35303
|
+
// ../sdk/dist/abis/SailKernel.js
|
|
35306
35304
|
var SailKernelAbi = [
|
|
35307
35305
|
// ── Account instantiation ────────────────────────────────────────────────
|
|
35308
35306
|
{
|
|
@@ -35607,7 +35605,7 @@ var SailKernelAbi = [
|
|
|
35607
35605
|
}
|
|
35608
35606
|
];
|
|
35609
35607
|
|
|
35610
|
-
// ../sdk/
|
|
35608
|
+
// ../sdk/dist/capabilities.js
|
|
35611
35609
|
init_esm2();
|
|
35612
35610
|
var DISPATCH_TYPE_STRINGS = {
|
|
35613
35611
|
conjunctive: "Dispatch(address account,address target,uint256 value,bytes32 dataHash,uint256 nonce,uint256 deadline)",
|
|
@@ -35652,9 +35650,7 @@ function fromDispatchTypehash(kernel, dispatchTypehash, registerPermissionTypeha
|
|
|
35652
35650
|
} else if (dispatchTypehash === DISPATCH_TYPEHASHES.selective) {
|
|
35653
35651
|
dispatchModel = "selective";
|
|
35654
35652
|
} else {
|
|
35655
|
-
throw new Error(
|
|
35656
|
-
`Unrecognized kernel DISPATCH_TYPEHASH ${dispatchTypehash} for ${kernel}. The SDK cannot safely sign dispatches for this kernel version. Known: conjunctive=${DISPATCH_TYPEHASHES.conjunctive}, selective=${DISPATCH_TYPEHASHES.selective}.`
|
|
35657
|
-
);
|
|
35653
|
+
throw new Error(`Unrecognized kernel DISPATCH_TYPEHASH ${dispatchTypehash} for ${kernel}. The SDK cannot safely sign dispatches for this kernel version. Known: conjunctive=${DISPATCH_TYPEHASHES.conjunctive}, selective=${DISPATCH_TYPEHASHES.selective}.`);
|
|
35658
35654
|
}
|
|
35659
35655
|
let registerPermissionHasDeadline = dispatchModel === "selective";
|
|
35660
35656
|
if (registerPermissionTypehash === REGISTER_PERMISSION_TYPEHASHES.withDeadline) {
|
|
@@ -35679,7 +35675,8 @@ async function detectKernelCapabilities(publicClient, kernel, opts) {
|
|
|
35679
35675
|
const key = cacheKey2(chainId, kernel);
|
|
35680
35676
|
if (!opts?.force) {
|
|
35681
35677
|
const hit = cache.get(key);
|
|
35682
|
-
if (hit)
|
|
35678
|
+
if (hit)
|
|
35679
|
+
return hit;
|
|
35683
35680
|
}
|
|
35684
35681
|
let dispatchTypehash;
|
|
35685
35682
|
let registerPermissionTypehash;
|
|
@@ -35701,29 +35698,17 @@ async function detectKernelCapabilities(publicClient, kernel, opts) {
|
|
|
35701
35698
|
}
|
|
35702
35699
|
let caps;
|
|
35703
35700
|
if (dispatchTypehash) {
|
|
35704
|
-
caps = fromDispatchTypehash(
|
|
35705
|
-
kernel,
|
|
35706
|
-
dispatchTypehash,
|
|
35707
|
-
registerPermissionTypehash,
|
|
35708
|
-
"onchain-typehash"
|
|
35709
|
-
);
|
|
35701
|
+
caps = fromDispatchTypehash(kernel, dispatchTypehash, registerPermissionTypehash, "onchain-typehash");
|
|
35710
35702
|
} else if (opts?.staticModel) {
|
|
35711
|
-
caps = fromDispatchTypehash(
|
|
35712
|
-
kernel,
|
|
35713
|
-
DISPATCH_TYPEHASHES[opts.staticModel],
|
|
35714
|
-
void 0,
|
|
35715
|
-
"static-hint"
|
|
35716
|
-
);
|
|
35703
|
+
caps = fromDispatchTypehash(kernel, DISPATCH_TYPEHASHES[opts.staticModel], void 0, "static-hint");
|
|
35717
35704
|
} else {
|
|
35718
|
-
throw new Error(
|
|
35719
|
-
`Could not read DISPATCH_TYPEHASH from kernel ${kernel}, and no staticModel hint was given. Pass opts.staticModel ('conjunctive' | 'selective') to proceed without on-chain detection.`
|
|
35720
|
-
);
|
|
35705
|
+
throw new Error(`Could not read DISPATCH_TYPEHASH from kernel ${kernel}, and no staticModel hint was given. Pass opts.staticModel ('conjunctive' | 'selective') to proceed without on-chain detection.`);
|
|
35721
35706
|
}
|
|
35722
35707
|
cache.set(key, caps);
|
|
35723
35708
|
return caps;
|
|
35724
35709
|
}
|
|
35725
35710
|
|
|
35726
|
-
// ../sdk/
|
|
35711
|
+
// ../sdk/dist/deployments.js
|
|
35727
35712
|
var CREATE2_KERNEL = "0x02ABC18B65A328de2e749F56ba79ACF2718a6659";
|
|
35728
35713
|
var CREATE2_GOVERNANCE = "0x7A478118715791728BDE3bc7A4D7ECfdEB89C6EC";
|
|
35729
35714
|
var CREATE2_TIMELOCK = "0xE48Ba8DB6d748adafD13155c3590f62e58a77f56";
|
|
@@ -35876,7 +35861,7 @@ function getSailDeployment(chainId) {
|
|
|
35876
35861
|
return deployment;
|
|
35877
35862
|
}
|
|
35878
35863
|
|
|
35879
|
-
// ../sdk/
|
|
35864
|
+
// ../sdk/dist/errors.js
|
|
35880
35865
|
init_esm2();
|
|
35881
35866
|
var KERNEL_ERROR_SIGNATURES = [
|
|
35882
35867
|
"error AccountAlreadyRegistered(address account)",
|
|
@@ -35955,12 +35940,14 @@ async function decode2(data) {
|
|
|
35955
35940
|
}
|
|
35956
35941
|
}
|
|
35957
35942
|
function decodeKernelError(data) {
|
|
35958
|
-
if (!data || data === "0x")
|
|
35943
|
+
if (!data || data === "0x")
|
|
35944
|
+
return Promise.resolve(null);
|
|
35959
35945
|
return decode2(data);
|
|
35960
35946
|
}
|
|
35961
35947
|
async function explainKernelRevert(err) {
|
|
35962
35948
|
const data = extractRevertData(err);
|
|
35963
|
-
if (!data)
|
|
35949
|
+
if (!data)
|
|
35950
|
+
return null;
|
|
35964
35951
|
return decodeKernelError(data);
|
|
35965
35952
|
}
|
|
35966
35953
|
function extractRevertData(err) {
|
|
@@ -35990,7 +35977,7 @@ function extractRevertData(err) {
|
|
|
35990
35977
|
return null;
|
|
35991
35978
|
}
|
|
35992
35979
|
|
|
35993
|
-
// ../sdk/
|
|
35980
|
+
// ../sdk/dist/eip712.js
|
|
35994
35981
|
init_esm2();
|
|
35995
35982
|
function sailKernelDomain(args) {
|
|
35996
35983
|
return {
|
|
@@ -36044,16 +36031,12 @@ async function buildDispatchSignature(params) {
|
|
|
36044
36031
|
const dataHash = keccak256(call2.data);
|
|
36045
36032
|
const selective = caps.dispatchModel === "selective";
|
|
36046
36033
|
const message = selective ? { account: account2, permission, target: call2.target, value: call2.value, dataHash, nonce, deadline } : { account: account2, target: call2.target, value: call2.value, dataHash, nonce, deadline };
|
|
36047
|
-
const signature = await manager.signTyped(
|
|
36048
|
-
|
|
36049
|
-
{
|
|
36050
|
-
|
|
36051
|
-
|
|
36052
|
-
|
|
36053
|
-
}
|
|
36054
|
-
},
|
|
36055
|
-
message
|
|
36056
|
-
);
|
|
36034
|
+
const signature = await manager.signTyped(sailKernelDomain({ chainId, kernel }), {
|
|
36035
|
+
primaryType: "Dispatch",
|
|
36036
|
+
types: {
|
|
36037
|
+
Dispatch: DISPATCH_EIP712_FIELDS[caps.dispatchModel]
|
|
36038
|
+
}
|
|
36039
|
+
}, message);
|
|
36057
36040
|
return { signature, nonce, deadline, dispatchModel: caps.dispatchModel };
|
|
36058
36041
|
}
|
|
36059
36042
|
var REGISTER_PERMISSION_TYPES = {
|
|
@@ -36132,7 +36115,7 @@ function buildRegisterPermissionsBatchTypedData(args) {
|
|
|
36132
36115
|
};
|
|
36133
36116
|
}
|
|
36134
36117
|
|
|
36135
|
-
// ../sdk/
|
|
36118
|
+
// ../sdk/dist/lifi.js
|
|
36136
36119
|
init_esm2();
|
|
36137
36120
|
var LIFI_QUOTE_URL = "https://li.quest/v1/quote";
|
|
36138
36121
|
var LIFI_ROUTERS = {
|
|
@@ -36171,9 +36154,7 @@ async function fetchLifiQuote(params) {
|
|
|
36171
36154
|
const quote = await res.json();
|
|
36172
36155
|
const tx = quote.transactionRequest;
|
|
36173
36156
|
if (!tx?.to || !tx?.data) {
|
|
36174
|
-
throw new Error(
|
|
36175
|
-
"LiFi quote returned no usable transactionRequest: " + JSON.stringify(quote).slice(0, 400)
|
|
36176
|
-
);
|
|
36157
|
+
throw new Error("LiFi quote returned no usable transactionRequest: " + JSON.stringify(quote).slice(0, 400));
|
|
36177
36158
|
}
|
|
36178
36159
|
return {
|
|
36179
36160
|
target: tx.to,
|
|
@@ -36184,7 +36165,7 @@ async function fetchLifiQuote(params) {
|
|
|
36184
36165
|
};
|
|
36185
36166
|
}
|
|
36186
36167
|
|
|
36187
|
-
// ../sdk/
|
|
36168
|
+
// ../sdk/dist/client.js
|
|
36188
36169
|
function notImplemented() {
|
|
36189
36170
|
throw new Error("not implemented");
|
|
36190
36171
|
}
|
|
@@ -36228,13 +36209,17 @@ var CONJUNCTIVE_DISPATCH_ABI = [
|
|
|
36228
36209
|
async function enrichKernelRevert(err) {
|
|
36229
36210
|
const decoded = await explainKernelRevert(err);
|
|
36230
36211
|
const base2 = err instanceof Error ? err : new Error(String(err));
|
|
36231
|
-
if (!decoded)
|
|
36212
|
+
if (!decoded)
|
|
36213
|
+
return base2;
|
|
36232
36214
|
const wrapped = new Error(`Kernel reverted: ${decoded.message}`);
|
|
36233
36215
|
wrapped.cause = base2;
|
|
36234
36216
|
wrapped.kernelError = decoded;
|
|
36235
36217
|
return wrapped;
|
|
36236
36218
|
}
|
|
36237
36219
|
var KernelNamespace = class {
|
|
36220
|
+
publicClient;
|
|
36221
|
+
config;
|
|
36222
|
+
walletClient;
|
|
36238
36223
|
constructor(publicClient, config, walletClient) {
|
|
36239
36224
|
this.publicClient = publicClient;
|
|
36240
36225
|
this.config = config;
|
|
@@ -36243,17 +36228,13 @@ var KernelNamespace = class {
|
|
|
36243
36228
|
requireKernel() {
|
|
36244
36229
|
const kernel = this.config.kernel;
|
|
36245
36230
|
if (!kernel) {
|
|
36246
|
-
throw new Error(
|
|
36247
|
-
"SailKernel address not configured \u2014 set `kernel` in SailorClientConfig."
|
|
36248
|
-
);
|
|
36231
|
+
throw new Error("SailKernel address not configured \u2014 set `kernel` in SailorClientConfig.");
|
|
36249
36232
|
}
|
|
36250
36233
|
return kernel;
|
|
36251
36234
|
}
|
|
36252
36235
|
requireSigner() {
|
|
36253
36236
|
if (!this.walletClient) {
|
|
36254
|
-
throw new Error(
|
|
36255
|
-
"No signer attached \u2014 call client.withSigner(walletClient) before write operations."
|
|
36256
|
-
);
|
|
36237
|
+
throw new Error("No signer attached \u2014 call client.withSigner(walletClient) before write operations.");
|
|
36257
36238
|
}
|
|
36258
36239
|
return this.walletClient;
|
|
36259
36240
|
}
|
|
@@ -36276,9 +36257,7 @@ var AccountNamespace = class extends KernelNamespace {
|
|
|
36276
36257
|
const kernel = this.requireKernel();
|
|
36277
36258
|
const signer = this.requireSigner();
|
|
36278
36259
|
if (!params.safeFactory || !params.safeSingleton || !params.safeInitializer) {
|
|
36279
|
-
throw new Error(
|
|
36280
|
-
"createAccount requires safeFactory, safeSingleton, and safeInitializer."
|
|
36281
|
-
);
|
|
36260
|
+
throw new Error("createAccount requires safeFactory, safeSingleton, and safeInitializer.");
|
|
36282
36261
|
}
|
|
36283
36262
|
const txHash = await signer.writeContract({
|
|
36284
36263
|
address: kernel,
|
|
@@ -36339,21 +36318,17 @@ var MandateNamespace = class extends KernelNamespace {
|
|
|
36339
36318
|
functionName: "signerNonces",
|
|
36340
36319
|
args: [safe]
|
|
36341
36320
|
});
|
|
36342
|
-
const sig = await signer.signTyped(
|
|
36343
|
-
|
|
36344
|
-
{
|
|
36345
|
-
|
|
36346
|
-
|
|
36347
|
-
|
|
36348
|
-
|
|
36349
|
-
|
|
36350
|
-
|
|
36351
|
-
|
|
36352
|
-
|
|
36353
|
-
}
|
|
36354
|
-
},
|
|
36355
|
-
{ account: safe, permissions, nonce, deadline }
|
|
36356
|
-
);
|
|
36321
|
+
const sig = await signer.signTyped(sailKernelDomain({ chainId: this.config.chainId, kernel }), {
|
|
36322
|
+
primaryType: "RegisterPermissions",
|
|
36323
|
+
types: {
|
|
36324
|
+
RegisterPermissions: [
|
|
36325
|
+
{ name: "account", type: "address" },
|
|
36326
|
+
{ name: "permissions", type: "address[]" },
|
|
36327
|
+
{ name: "nonce", type: "uint256" },
|
|
36328
|
+
{ name: "deadline", type: "uint256" }
|
|
36329
|
+
]
|
|
36330
|
+
}
|
|
36331
|
+
}, { account: safe, permissions, nonce, deadline });
|
|
36357
36332
|
await wallet.writeContract({
|
|
36358
36333
|
address: kernel,
|
|
36359
36334
|
abi: SailKernelAbi,
|
|
@@ -36372,9 +36347,7 @@ var MandateNamespace = class extends KernelNamespace {
|
|
|
36372
36347
|
return notImplemented();
|
|
36373
36348
|
}
|
|
36374
36349
|
deployAndAttachClone(_safe, _impl, _initData, _salt, _signer) {
|
|
36375
|
-
throw new Error(
|
|
36376
|
-
"deployAndAttachClone is not yet implemented in the SDK.\nUse `sailor mandate attach --address <impl>` to attach a clone template via the factory."
|
|
36377
|
-
);
|
|
36350
|
+
throw new Error("deployAndAttachClone is not yet implemented in the SDK.\nUse `sailor mandate attach --address <impl>` to attach a clone template via the factory.");
|
|
36378
36351
|
}
|
|
36379
36352
|
async list(safe) {
|
|
36380
36353
|
const kernel = this.requireKernel();
|
|
@@ -36444,12 +36417,11 @@ var DispatchNamespace = class extends KernelNamespace {
|
|
|
36444
36417
|
let latest = 0n;
|
|
36445
36418
|
for (let i = 0; i < tries; i++) {
|
|
36446
36419
|
latest = await this.readManagerNonce(kernel, safe);
|
|
36447
|
-
if (latest >= expected)
|
|
36420
|
+
if (latest >= expected)
|
|
36421
|
+
return latest;
|
|
36448
36422
|
await delay(1e3);
|
|
36449
36423
|
}
|
|
36450
|
-
throw new Error(
|
|
36451
|
-
`Manager nonce for ${safe} did not reach ${expected} after ${tries}s (last seen ${latest}). The prior dispatch may not have mined, or the RPC endpoint is lagging. Retry, or pass an explicit nonce via options.nonce.`
|
|
36452
|
-
);
|
|
36424
|
+
throw new Error(`Manager nonce for ${safe} did not reach ${expected} after ${tries}s (last seen ${latest}). The prior dispatch may not have mined, or the RPC endpoint is lagging. Retry, or pass an explicit nonce via options.nonce.`);
|
|
36453
36425
|
}
|
|
36454
36426
|
/**
|
|
36455
36427
|
* Determine the nonce to sign with. Honors an explicit `options.nonce`
|
|
@@ -36458,7 +36430,8 @@ var DispatchNamespace = class extends KernelNamespace {
|
|
|
36458
36430
|
* dispatch on this account) before reading the live value.
|
|
36459
36431
|
*/
|
|
36460
36432
|
async resolveNonce(kernel, safe, options) {
|
|
36461
|
-
if (options?.nonce !== void 0)
|
|
36433
|
+
if (options?.nonce !== void 0)
|
|
36434
|
+
return options.nonce;
|
|
36462
36435
|
const expected = options?.awaitNonce ?? this.nextNonce.get(this.nonceKey(kernel, safe));
|
|
36463
36436
|
if (expected !== void 0) {
|
|
36464
36437
|
return this.waitForManagerNonce(kernel, safe, expected);
|
|
@@ -36550,9 +36523,7 @@ var DispatchNamespace = class extends KernelNamespace {
|
|
|
36550
36523
|
const deadline = defaultDeadline();
|
|
36551
36524
|
const caps = await this.capabilities();
|
|
36552
36525
|
if (caps.dispatchModel === "conjunctive") {
|
|
36553
|
-
throw new Error(
|
|
36554
|
-
`Batch dispatch is not supported by the conjunctive kernel at ${kernel} (it has no dispatchBatch). Submit calls individually via dispatch.single, ensuring the manager nonce advances between them.`
|
|
36555
|
-
);
|
|
36526
|
+
throw new Error(`Batch dispatch is not supported by the conjunctive kernel at ${kernel} (it has no dispatchBatch). Submit calls individually via dispatch.single, ensuring the manager nonce advances between them.`);
|
|
36556
36527
|
}
|
|
36557
36528
|
const nonce = await this.publicClient.readContract({
|
|
36558
36529
|
address: kernel,
|
|
@@ -36560,25 +36531,19 @@ var DispatchNamespace = class extends KernelNamespace {
|
|
|
36560
36531
|
functionName: "batchNonces",
|
|
36561
36532
|
args: [safe]
|
|
36562
36533
|
});
|
|
36563
|
-
const callsHash = keccak256(
|
|
36564
|
-
|
|
36565
|
-
|
|
36566
|
-
|
|
36567
|
-
|
|
36568
|
-
|
|
36569
|
-
|
|
36570
|
-
|
|
36571
|
-
|
|
36572
|
-
|
|
36573
|
-
|
|
36574
|
-
|
|
36575
|
-
|
|
36576
|
-
{ name: "deadline", type: "uint256" }
|
|
36577
|
-
]
|
|
36578
|
-
}
|
|
36579
|
-
},
|
|
36580
|
-
{ account: safe, permission, callsHash, nonce, deadline }
|
|
36581
|
-
);
|
|
36534
|
+
const callsHash = keccak256(encodeAbiParameters([{ type: "tuple[]", components: CALL_COMPONENTS }], [calls]));
|
|
36535
|
+
const managerSig = await manager.signTyped(sailKernelDomain({ chainId: this.config.chainId, kernel }), {
|
|
36536
|
+
primaryType: "DispatchBatch",
|
|
36537
|
+
types: {
|
|
36538
|
+
DispatchBatch: [
|
|
36539
|
+
{ name: "account", type: "address" },
|
|
36540
|
+
{ name: "permission", type: "address" },
|
|
36541
|
+
{ name: "callsHash", type: "bytes32" },
|
|
36542
|
+
{ name: "nonce", type: "uint256" },
|
|
36543
|
+
{ name: "deadline", type: "uint256" }
|
|
36544
|
+
]
|
|
36545
|
+
}
|
|
36546
|
+
}, { account: safe, permission, callsHash, nonce, deadline });
|
|
36582
36547
|
let txHash;
|
|
36583
36548
|
try {
|
|
36584
36549
|
txHash = await wallet.writeContract({
|
|
@@ -36603,9 +36568,7 @@ var DispatchNamespace = class extends KernelNamespace {
|
|
|
36603
36568
|
const kernel = this.requireKernel();
|
|
36604
36569
|
const caps = await this.capabilities();
|
|
36605
36570
|
if (caps.dispatchModel === "conjunctive") {
|
|
36606
|
-
throw new Error(
|
|
36607
|
-
`Dry-run preview is not supported by the conjunctive kernel at ${kernel} (it has no previewBatch view). Validate calls off-chain against each registered permission's evaluate() logic, or simulate the dispatch.single tx instead.`
|
|
36608
|
-
);
|
|
36571
|
+
throw new Error(`Dry-run preview is not supported by the conjunctive kernel at ${kernel} (it has no previewBatch view). Validate calls off-chain against each registered permission's evaluate() logic, or simulate the dispatch.single tx instead.`);
|
|
36609
36572
|
}
|
|
36610
36573
|
const [approved, reason] = await this.publicClient.readContract({
|
|
36611
36574
|
address: kernel,
|
|
@@ -36617,6 +36580,7 @@ var DispatchNamespace = class extends KernelNamespace {
|
|
|
36617
36580
|
}
|
|
36618
36581
|
};
|
|
36619
36582
|
var StrategyNamespace = class extends KernelNamespace {
|
|
36583
|
+
dispatch;
|
|
36620
36584
|
constructor(publicClient, config, dispatch, walletClient) {
|
|
36621
36585
|
super(publicClient, config, walletClient);
|
|
36622
36586
|
this.dispatch = dispatch;
|
|
@@ -36634,17 +36598,13 @@ var StrategyNamespace = class extends KernelNamespace {
|
|
|
36634
36598
|
const slippage = params.slippage ?? DEFAULT_SLIPPAGE;
|
|
36635
36599
|
const router = params.router ?? LIFI_ROUTERS[this.config.chainId];
|
|
36636
36600
|
if (!router) {
|
|
36637
|
-
throw new Error(
|
|
36638
|
-
`No LiFi router known for chain ${this.config.chainId}. Pass params.router explicitly.`
|
|
36639
|
-
);
|
|
36601
|
+
throw new Error(`No LiFi router known for chain ${this.config.chainId}. Pass params.router explicitly.`);
|
|
36640
36602
|
}
|
|
36641
36603
|
const caps = await this.capabilities();
|
|
36642
36604
|
const swapPermission = params.swapPermission ?? router;
|
|
36643
36605
|
const approvePermission = params.approvePermission ?? params.swapPermission ?? router;
|
|
36644
36606
|
if (caps.dispatchModel === "selective" && !params.swapPermission) {
|
|
36645
|
-
throw new Error(
|
|
36646
|
-
"This kernel uses the selective dispatch model \u2014 params.swapPermission is required (the permission that authorizes the swap)."
|
|
36647
|
-
);
|
|
36607
|
+
throw new Error("This kernel uses the selective dispatch model \u2014 params.swapPermission is required (the permission that authorizes the swap).");
|
|
36648
36608
|
}
|
|
36649
36609
|
const quote = await fetchLifiQuote({
|
|
36650
36610
|
chainId: this.config.chainId,
|
|
@@ -36664,19 +36624,9 @@ var StrategyNamespace = class extends KernelNamespace {
|
|
|
36664
36624
|
let approve;
|
|
36665
36625
|
if (allowance < params.amount) {
|
|
36666
36626
|
const approveAmount = params.approveAmount ?? params.amount;
|
|
36667
|
-
approve = await this.dispatch.single(
|
|
36668
|
-
safe,
|
|
36669
|
-
approvePermission,
|
|
36670
|
-
{ target: params.from, value: 0n, data: encodeApprove(router, approveAmount) },
|
|
36671
|
-
manager
|
|
36672
|
-
);
|
|
36627
|
+
approve = await this.dispatch.single(safe, approvePermission, { target: params.from, value: 0n, data: encodeApprove(router, approveAmount) }, manager);
|
|
36673
36628
|
}
|
|
36674
|
-
const swap = await this.dispatch.single(
|
|
36675
|
-
safe,
|
|
36676
|
-
swapPermission,
|
|
36677
|
-
{ target: quote.target, value: quote.value, data: quote.data },
|
|
36678
|
-
manager
|
|
36679
|
-
);
|
|
36629
|
+
const swap = await this.dispatch.single(safe, swapPermission, { target: quote.target, value: quote.value, data: quote.data }, manager);
|
|
36680
36630
|
return {
|
|
36681
36631
|
swap,
|
|
36682
36632
|
approve,
|
|
@@ -36796,7 +36746,7 @@ var SailorClient = class _SailorClient {
|
|
|
36796
36746
|
}
|
|
36797
36747
|
};
|
|
36798
36748
|
|
|
36799
|
-
// ../sdk/
|
|
36749
|
+
// ../sdk/dist/keyring.js
|
|
36800
36750
|
var import_node_crypto = require("node:crypto");
|
|
36801
36751
|
var import_node_fs = require("node:fs");
|
|
36802
36752
|
init_esm2();
|
|
@@ -37478,7 +37428,7 @@ function mnemonicToAccount(mnemonic, { passphrase, ...hdKeyOpts } = {}) {
|
|
|
37478
37428
|
return hdKeyToAccount(HDKey.fromMasterSeed(seed), hdKeyOpts);
|
|
37479
37429
|
}
|
|
37480
37430
|
|
|
37481
|
-
// ../sdk/
|
|
37431
|
+
// ../sdk/dist/keyring.js
|
|
37482
37432
|
var SCRYPT_N = 1 << 18;
|
|
37483
37433
|
var SCRYPT_R = 8;
|
|
37484
37434
|
var SCRYPT_P = 1;
|
|
@@ -37496,16 +37446,11 @@ var LocalKeyring = class _LocalKeyring {
|
|
|
37496
37446
|
this.address = account2.address;
|
|
37497
37447
|
this.privateKey = options.privateKey;
|
|
37498
37448
|
} else if (options.type === "mnemonic") {
|
|
37499
|
-
const account2 = mnemonicToAccount(
|
|
37500
|
-
options.mnemonic,
|
|
37501
|
-
options.derivationPath ? { path: options.derivationPath } : void 0
|
|
37502
|
-
);
|
|
37449
|
+
const account2 = mnemonicToAccount(options.mnemonic, options.derivationPath ? { path: options.derivationPath } : void 0);
|
|
37503
37450
|
this.account = account2;
|
|
37504
37451
|
this.address = account2.address;
|
|
37505
37452
|
} else {
|
|
37506
|
-
throw new Error(
|
|
37507
|
-
"keystore decryption not implemented \u2014 use type: 'privateKey' or type: 'mnemonic' instead"
|
|
37508
|
-
);
|
|
37453
|
+
throw new Error("keystore decryption not implemented \u2014 use type: 'privateKey' or type: 'mnemonic' instead");
|
|
37509
37454
|
}
|
|
37510
37455
|
}
|
|
37511
37456
|
/** Returns a lightweight signer stub for read-only contexts where the key is not available. */
|
|
@@ -37535,9 +37480,7 @@ var LocalKeyring = class _LocalKeyring {
|
|
|
37535
37480
|
}
|
|
37536
37481
|
const { n, r, p, dklen, salt } = crypto3.kdfparams;
|
|
37537
37482
|
if (n < 1 << 14) {
|
|
37538
|
-
throw new Error(
|
|
37539
|
-
`Keystore scrypt N=${n} is below the minimum accepted value (16384). Refusing to decrypt.`
|
|
37540
|
-
);
|
|
37483
|
+
throw new Error(`Keystore scrypt N=${n} is below the minimum accepted value (16384). Refusing to decrypt.`);
|
|
37541
37484
|
}
|
|
37542
37485
|
if (r < 8) {
|
|
37543
37486
|
throw new Error(`Keystore scrypt r=${r} is below the minimum accepted value (8).`);
|
|
@@ -37555,11 +37498,7 @@ var LocalKeyring = class _LocalKeyring {
|
|
|
37555
37498
|
if (computedMac.length !== storedMac.length || !(0, import_node_crypto.timingSafeEqual)(computedMac, storedMac)) {
|
|
37556
37499
|
throw new Error("Invalid password or corrupt keystore");
|
|
37557
37500
|
}
|
|
37558
|
-
const decipher = (0, import_node_crypto.createDecipheriv)(
|
|
37559
|
-
"aes-128-ctr",
|
|
37560
|
-
derived.subarray(0, 16),
|
|
37561
|
-
Buffer.from(crypto3.cipherparams.iv, "hex")
|
|
37562
|
-
);
|
|
37501
|
+
const decipher = (0, import_node_crypto.createDecipheriv)("aes-128-ctr", derived.subarray(0, 16), Buffer.from(crypto3.cipherparams.iv, "hex"));
|
|
37563
37502
|
const pkBytes = Buffer.concat([decipher.update(ciphertext), decipher.final()]);
|
|
37564
37503
|
return _LocalKeyring.fromPrivateKey(`0x${pkBytes.toString("hex")}`);
|
|
37565
37504
|
}
|
|
@@ -37597,9 +37536,7 @@ var LocalKeyring = class _LocalKeyring {
|
|
|
37597
37536
|
/** Exports the private key as an encrypted keystore JSON (scrypt + aes-128-ctr, geth v3). */
|
|
37598
37537
|
async exportKeystore(password) {
|
|
37599
37538
|
if (!this.privateKey) {
|
|
37600
|
-
throw new Error(
|
|
37601
|
-
"Private key unavailable \u2014 only privateKey/generated keyrings can be exported"
|
|
37602
|
-
);
|
|
37539
|
+
throw new Error("Private key unavailable \u2014 only privateKey/generated keyrings can be exported");
|
|
37603
37540
|
}
|
|
37604
37541
|
const salt = (0, import_node_crypto.randomBytes)(32);
|
|
37605
37542
|
const derived = (0, import_node_crypto.scryptSync)(password, salt, SCRYPT_DKLEN, {
|
|
@@ -37636,7 +37573,7 @@ var LocalKeyring = class _LocalKeyring {
|
|
|
37636
37573
|
}
|
|
37637
37574
|
};
|
|
37638
37575
|
|
|
37639
|
-
// ../sdk/
|
|
37576
|
+
// ../sdk/dist/abis/SailGovernance.js
|
|
37640
37577
|
var SailGovernanceAbi = [
|
|
37641
37578
|
{
|
|
37642
37579
|
type: "function",
|
|
@@ -37682,7 +37619,7 @@ var SailGovernanceAbi = [
|
|
|
37682
37619
|
}
|
|
37683
37620
|
];
|
|
37684
37621
|
|
|
37685
|
-
// ../sdk/
|
|
37622
|
+
// ../sdk/dist/safe.js
|
|
37686
37623
|
init_esm2();
|
|
37687
37624
|
var setManagerAbi = [
|
|
37688
37625
|
{
|
|
@@ -37772,10 +37709,7 @@ function buildSafeSetupInitializer(params) {
|
|
|
37772
37709
|
});
|
|
37773
37710
|
}
|
|
37774
37711
|
function buildApprovedHashSignature(owner2) {
|
|
37775
|
-
return encodePacked(
|
|
37776
|
-
["bytes32", "bytes32", "uint8"],
|
|
37777
|
-
[pad(owner2, { size: 32 }), pad("0x", { size: 32 }), 1]
|
|
37778
|
-
);
|
|
37712
|
+
return encodePacked(["bytes32", "bytes32", "uint8"], [pad(owner2, { size: 32 }), pad("0x", { size: 32 }), 1]);
|
|
37779
37713
|
}
|
|
37780
37714
|
var safeProxyFactoryAbi = [
|
|
37781
37715
|
{
|
|
@@ -37788,15 +37722,11 @@ var safeProxyFactoryAbi = [
|
|
|
37788
37722
|
];
|
|
37789
37723
|
function computeSafeProxyAddress(params) {
|
|
37790
37724
|
const { initializer, saltNonce, proxyCreationCode } = params;
|
|
37791
|
-
const initCodeHash = keccak256(
|
|
37792
|
-
|
|
37793
|
-
|
|
37794
|
-
|
|
37795
|
-
|
|
37796
|
-
);
|
|
37797
|
-
const salt = keccak256(
|
|
37798
|
-
encodePacked(["bytes32", "uint256"], [keccak256(initializer), saltNonce])
|
|
37799
|
-
);
|
|
37725
|
+
const initCodeHash = keccak256(concat([
|
|
37726
|
+
proxyCreationCode,
|
|
37727
|
+
encodeAbiParameters([{ type: "address" }], [SAFE_V141.singletonL2])
|
|
37728
|
+
]));
|
|
37729
|
+
const salt = keccak256(encodePacked(["bytes32", "uint256"], [keccak256(initializer), saltNonce]));
|
|
37800
37730
|
return getCreate2Address({
|
|
37801
37731
|
from: SAFE_V141.proxyFactory,
|
|
37802
37732
|
salt,
|
|
@@ -37805,20 +37735,13 @@ function computeSafeProxyAddress(params) {
|
|
|
37805
37735
|
}
|
|
37806
37736
|
function computeKernelBoundSalt(params) {
|
|
37807
37737
|
const { saltNonce, deployer, permissionSigner, manager, feePolicy } = params;
|
|
37808
|
-
return BigInt(
|
|
37809
|
-
|
|
37810
|
-
|
|
37811
|
-
|
|
37812
|
-
|
|
37813
|
-
|
|
37814
|
-
|
|
37815
|
-
{ type: "address" },
|
|
37816
|
-
{ type: "address" }
|
|
37817
|
-
],
|
|
37818
|
-
[saltNonce, deployer, permissionSigner, manager, feePolicy]
|
|
37819
|
-
)
|
|
37820
|
-
)
|
|
37821
|
-
);
|
|
37738
|
+
return BigInt(keccak256(encodeAbiParameters([
|
|
37739
|
+
{ type: "uint256" },
|
|
37740
|
+
{ type: "address" },
|
|
37741
|
+
{ type: "address" },
|
|
37742
|
+
{ type: "address" },
|
|
37743
|
+
{ type: "address" }
|
|
37744
|
+
], [saltNonce, deployer, permissionSigner, manager, feePolicy])));
|
|
37822
37745
|
}
|
|
37823
37746
|
function computeSailSmaAddress(params) {
|
|
37824
37747
|
const boundSalt = computeKernelBoundSalt(params);
|
|
@@ -37865,7 +37788,7 @@ function buildSetManagerExecTransaction(params) {
|
|
|
37865
37788
|
return { to: params.safe, data };
|
|
37866
37789
|
}
|
|
37867
37790
|
|
|
37868
|
-
// ../sdk/
|
|
37791
|
+
// ../sdk/dist/discovery.js
|
|
37869
37792
|
var SAFE_TX_SERVICE_SLUGS = {
|
|
37870
37793
|
1: "eth",
|
|
37871
37794
|
100: "gno",
|
|
@@ -37893,7 +37816,7 @@ async function discoverSafesForOwner(owner2, chainId) {
|
|
|
37893
37816
|
return data.safes ?? [];
|
|
37894
37817
|
}
|
|
37895
37818
|
|
|
37896
|
-
// ../sdk/
|
|
37819
|
+
// ../sdk/dist/fees.js
|
|
37897
37820
|
function min(a, b) {
|
|
37898
37821
|
return a < b ? a : b;
|
|
37899
37822
|
}
|
|
@@ -37929,7 +37852,7 @@ async function estimatePermissionFee(publicClient, governance, permission) {
|
|
|
37929
37852
|
}
|
|
37930
37853
|
}
|
|
37931
37854
|
|
|
37932
|
-
// ../sdk/
|
|
37855
|
+
// ../sdk/dist/intelligence.js
|
|
37933
37856
|
var SAIL_INTELLIGENCE_BASE_URL = "https://api.sail.money";
|
|
37934
37857
|
var SAIL_INTELLIGENCE_DOCS_URL = "https://api.sail.money/docs";
|
|
37935
37858
|
|
|
@@ -38596,7 +38519,7 @@ var import_websocket2 = __toESM(require_websocket2(), 1);
|
|
|
38596
38519
|
var import_websocket_server2 = __toESM(require_websocket_server2(), 1);
|
|
38597
38520
|
|
|
38598
38521
|
// src/signing/server.ts
|
|
38599
|
-
var DEFAULT_SIGNING_PORT =
|
|
38522
|
+
var DEFAULT_SIGNING_PORT = 3141;
|
|
38600
38523
|
var RUNTIME_SUBDIR = (0, import_node_path4.join)(".sail", "runtime");
|
|
38601
38524
|
var SERVER_STATE_FILE = "server.json";
|
|
38602
38525
|
var REQUEST_SECRET_HEADER = "x-sailor-secret";
|
|
@@ -40770,8 +40693,6 @@ function scaffoldProjectWorkspace(dest, name, options) {
|
|
|
40770
40693
|
import_node_fs9.default.mkdirSync(import_node_path8.default.join(sailDir2, "keys"), { recursive: true });
|
|
40771
40694
|
import_node_fs9.default.mkdirSync(import_node_path8.default.join(sailDir2, "runtime"), { recursive: true });
|
|
40772
40695
|
import_node_fs9.default.mkdirSync(import_node_path8.default.join(sailDir2, "state"), { recursive: true });
|
|
40773
|
-
const installMode = process.env.SAILOR_INSTALL_MODE === "docker" ? "docker" : "local";
|
|
40774
|
-
const containerName = process.env.SAILOR_CONTAINER_NAME ?? "agent";
|
|
40775
40696
|
import_node_fs9.default.writeFileSync(
|
|
40776
40697
|
import_node_path8.default.join(sailDir2, "config.json"),
|
|
40777
40698
|
`${JSON.stringify(
|
|
@@ -40782,8 +40703,6 @@ function scaffoldProjectWorkspace(dest, name, options) {
|
|
|
40782
40703
|
// null = chain not yet chosen; Stage 1 will set this
|
|
40783
40704
|
stateDir: ".sail/state",
|
|
40784
40705
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
40785
|
-
installMode,
|
|
40786
|
-
...installMode === "docker" ? { containerName } : {},
|
|
40787
40706
|
contracts: {
|
|
40788
40707
|
kernel: "",
|
|
40789
40708
|
mandateFactory: ""
|
|
@@ -40875,14 +40794,6 @@ Pass --force to scaffold into it anyway (existing files with the same name are o
|
|
|
40875
40794
|
"This project is already initialized.\nRun `sailor update` to re-sync template files, or `sailor init --force` to re-initialize (overwrites scaffold files; your .sail/keys/ and .sail/state/ are left in place)."
|
|
40876
40795
|
);
|
|
40877
40796
|
}
|
|
40878
|
-
const existingConfigPath = import_node_path8.default.join(dest, ".sail", "config.json");
|
|
40879
|
-
const previousConfig = import_node_fs9.default.existsSync(existingConfigPath) ? (() => {
|
|
40880
|
-
try {
|
|
40881
|
-
return JSON.parse(import_node_fs9.default.readFileSync(existingConfigPath, "utf-8"));
|
|
40882
|
-
} catch {
|
|
40883
|
-
return null;
|
|
40884
|
-
}
|
|
40885
|
-
})() : null;
|
|
40886
40797
|
copyDirSync(templateSrc, dest);
|
|
40887
40798
|
const pkgRoot = packageRoot();
|
|
40888
40799
|
const examplesPermSrc = import_node_path8.default.join(pkgRoot, "examples", "permissions");
|
|
@@ -40922,18 +40833,6 @@ Pass --force to scaffold into it anyway (existing files with the same name are o
|
|
|
40922
40833
|
}
|
|
40923
40834
|
scaffoldProjectWorkspace(dest, name, options);
|
|
40924
40835
|
scaffoldFoundryWorkspace(dest);
|
|
40925
|
-
const newMode = process.env.SAILOR_INSTALL_MODE === "docker" ? "docker" : "local";
|
|
40926
|
-
if (previousConfig?.installMode === "docker" && newMode === "local") {
|
|
40927
|
-
const prev = previousConfig.containerName ?? "agent";
|
|
40928
|
-
console.log(`
|
|
40929
|
-
Switched to local install. If the Docker container is still running:`);
|
|
40930
|
-
console.log(` docker stop ${prev}`);
|
|
40931
|
-
console.log(`You can restart it anytime with the standard docker run command.`);
|
|
40932
|
-
} else if (previousConfig?.installMode === "local" && newMode === "docker") {
|
|
40933
|
-
const containerName = process.env.SAILOR_CONTAINER_NAME ?? "agent";
|
|
40934
|
-
console.log(`
|
|
40935
|
-
Switched to Docker install (container: ${containerName}).`);
|
|
40936
|
-
}
|
|
40937
40836
|
printWelcome(
|
|
40938
40837
|
dest,
|
|
40939
40838
|
name,
|
|
@@ -41044,12 +40943,6 @@ Created ${name}/`);
|
|
|
41044
40943
|
"\u2551 If you skip this step, setup WILL break and you will have to \u2551",
|
|
41045
40944
|
"\u2551 restart. There are no shortcuts. \u2551",
|
|
41046
40945
|
"\u2551 \u2551",
|
|
41047
|
-
"\u2551 IF SAILOR IS RUNNING IN DOCKER: \u2551",
|
|
41048
|
-
"\u2551 \u2022 Read project files from your local filesystem \u2014 they are \u2551",
|
|
41049
|
-
"\u2551 shared via volume mount, do NOT use docker exec to read them. \u2551",
|
|
41050
|
-
"\u2551 \u2022 Prefix every sailor command with: \u2551",
|
|
41051
|
-
"\u2551 docker exec <containerName> sailor <command> \u2551",
|
|
41052
|
-
"\u2551 \u2551",
|
|
41053
40946
|
"\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D",
|
|
41054
40947
|
""
|
|
41055
40948
|
].join("\n"));
|
|
@@ -41103,39 +40996,6 @@ async function updateCommand() {
|
|
|
41103
40996
|
}
|
|
41104
40997
|
const added = [];
|
|
41105
40998
|
copyDirSyncIfMissing(templateSrc, dest, added);
|
|
41106
|
-
const configPath = import_node_path9.default.join(dest, ".sail", "config.json");
|
|
41107
|
-
try {
|
|
41108
|
-
const config = JSON.parse(import_node_fs10.default.readFileSync(configPath, "utf-8"));
|
|
41109
|
-
const newMode = process.env.SAILOR_INSTALL_MODE === "docker" ? "docker" : "local";
|
|
41110
|
-
const containerName = process.env.SAILOR_CONTAINER_NAME ?? "agent";
|
|
41111
|
-
if (config.installMode !== newMode) {
|
|
41112
|
-
const previousMode = config.installMode;
|
|
41113
|
-
const previousContainer = config.containerName;
|
|
41114
|
-
config.installMode = newMode;
|
|
41115
|
-
if (newMode === "docker") {
|
|
41116
|
-
config.containerName = containerName;
|
|
41117
|
-
} else {
|
|
41118
|
-
delete config.containerName;
|
|
41119
|
-
}
|
|
41120
|
-
import_node_fs10.default.writeFileSync(configPath, `${JSON.stringify(config, null, 2)}
|
|
41121
|
-
`, "utf-8");
|
|
41122
|
-
if (previousMode === "docker" && newMode === "local") {
|
|
41123
|
-
const prev = previousContainer ?? "agent";
|
|
41124
|
-
console.log(`
|
|
41125
|
-
Switched to local install. If the Docker container is still running:`);
|
|
41126
|
-
console.log(` docker stop ${prev}`);
|
|
41127
|
-
console.log(`You can restart it anytime with the standard docker run command.`);
|
|
41128
|
-
} else if (newMode === "docker") {
|
|
41129
|
-
console.log(`
|
|
41130
|
-
Switched to Docker install (container: ${containerName}).`);
|
|
41131
|
-
}
|
|
41132
|
-
} else if (newMode === "docker" && config.containerName !== containerName) {
|
|
41133
|
-
config.containerName = containerName;
|
|
41134
|
-
import_node_fs10.default.writeFileSync(configPath, `${JSON.stringify(config, null, 2)}
|
|
41135
|
-
`, "utf-8");
|
|
41136
|
-
}
|
|
41137
|
-
} catch {
|
|
41138
|
-
}
|
|
41139
40999
|
if (removed.length === 0 && updated.length === 0 && added.length === 0) {
|
|
41140
41000
|
console.log("Nothing to update.");
|
|
41141
41001
|
return;
|
|
@@ -45288,7 +45148,7 @@ async function uiCommand() {
|
|
|
45288
45148
|
const serverBundle = import_node_path16.default.resolve(distDir, "server.cjs");
|
|
45289
45149
|
const projectRoot = process.cwd();
|
|
45290
45150
|
const sailDir2 = import_node_path16.default.join(projectRoot, ".sail");
|
|
45291
|
-
const port = await findFreePort(
|
|
45151
|
+
const port = await findFreePort(projectPort(projectRoot));
|
|
45292
45152
|
if (!import_node_fs20.default.existsSync(serverBundle)) {
|
|
45293
45153
|
throw new Error(`Server bundle not found at ${serverBundle}. Re-run the sailor build.`);
|
|
45294
45154
|
}
|