@dev.sail.money/sailor 1.2.0-78 → 1.2.0-79
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/package.json +1 -1
- package/packages/cli/README.md +7 -3
- package/packages/cli/dist/index.cjs +151 -34
- package/packages/cli/dist/server.cjs +73 -12
- package/packages/sdk/dist/intelligence.d.ts +1 -1
- package/packages/sdk/dist/intelligence.js +1 -1
- package/packages/ui/dist/assets/{add-BlwOYgVP.js → add-BcdMqg1w.js} +1 -1
- package/packages/ui/dist/assets/{all-wallets-X886TnrY.js → all-wallets-eEMl6lkQ.js} +1 -1
- package/packages/ui/dist/assets/{app-store-5_THkwcX.js → app-store-CpHkkt4t.js} +1 -1
- package/packages/ui/dist/assets/{apple-RN9llXeT.js → apple-6ouqFZiK.js} +1 -1
- package/packages/ui/dist/assets/{arrow-bottom-itKniM1p.js → arrow-bottom-Bb9Z428n.js} +1 -1
- package/packages/ui/dist/assets/{arrow-bottom-circle-D7iFEHHJ.js → arrow-bottom-circle-DYEjX8QA.js} +1 -1
- package/packages/ui/dist/assets/{arrow-left-MaM2Avp9.js → arrow-left-3BCB1QCk.js} +1 -1
- package/packages/ui/dist/assets/{arrow-right-C5PtJtgH.js → arrow-right-Dx167xiS.js} +1 -1
- package/packages/ui/dist/assets/{arrow-top-BA_RQAq5.js → arrow-top-BH3F8Ed6.js} +1 -1
- package/packages/ui/dist/assets/{bank-D050DHfC.js → bank-CXANr0cC.js} +1 -1
- package/packages/ui/dist/assets/{basic-BFjw6sn6.js → basic-eaFgT79l.js} +1 -1
- package/packages/ui/dist/assets/{browser-D9ZnsZ5_.js → browser-BSyuQm_z.js} +1 -1
- package/packages/ui/dist/assets/{card-D1vIWsVX.js → card-DFrPUtDH.js} +1 -1
- package/packages/ui/dist/assets/{ccip-BaapcBO_.js → ccip-CYKGeMKc.js} +1 -1
- package/packages/ui/dist/assets/{checkmark-kkCO5JXg.js → checkmark-YRC9worI.js} +1 -1
- package/packages/ui/dist/assets/{checkmark-bold-BRSKSCgc.js → checkmark-bold-D8N8eQl6.js} +1 -1
- package/packages/ui/dist/assets/{chevron-bottom-sjsi68Y-.js → chevron-bottom-rc1vB7aX.js} +1 -1
- package/packages/ui/dist/assets/{chevron-left-BoufMmcX.js → chevron-left-2YccVP2W.js} +1 -1
- package/packages/ui/dist/assets/{chevron-right-BU7j74TB.js → chevron-right-C8wuK404.js} +1 -1
- package/packages/ui/dist/assets/{chevron-top-dMkP1P_w.js → chevron-top-EHhbhVVn.js} +1 -1
- package/packages/ui/dist/assets/{chrome-store-BYeu3s6a.js → chrome-store-_RmUc4Ak.js} +1 -1
- package/packages/ui/dist/assets/{clock-DsKDv2h1.js → clock-CdU3KA3t.js} +1 -1
- package/packages/ui/dist/assets/{close-DYFbNxP-.js → close-D_9HQRAi.js} +1 -1
- package/packages/ui/dist/assets/{coinPlaceholder-CC6D8T1D.js → coinPlaceholder-V1liE3T5.js} +1 -1
- package/packages/ui/dist/assets/{compass-BOCJUm1b.js → compass-BX5YFPqM.js} +1 -1
- package/packages/ui/dist/assets/{copy-DFPgSWQd.js → copy-D0yRL7B0.js} +1 -1
- package/packages/ui/dist/assets/{core-DA9LGlcF.js → core-DOm1cgRJ.js} +3 -3
- package/packages/ui/dist/assets/cursor-6cIMtmH6.js +3 -0
- package/packages/ui/dist/assets/{cursor-transparent-BiHhMjXj.js → cursor-transparent-DSt6DvIs.js} +1 -1
- package/packages/ui/dist/assets/{desktop-B-5ikoqn.js → desktop-5Gxn4pwD.js} +1 -1
- package/packages/ui/dist/assets/{disconnect-CfxFi0us.js → disconnect-DOKGtT5y.js} +1 -1
- package/packages/ui/dist/assets/{discord--Ca_ovYN.js → discord-qZ7e61AG.js} +1 -1
- package/packages/ui/dist/assets/{etherscan-CPzRv_tJ.js → etherscan-Cv5nh9fz.js} +1 -1
- package/packages/ui/dist/assets/{events-Bi074D97.js → events-C9qV0Eqh.js} +1 -1
- package/packages/ui/dist/assets/{exclamation-triangle-aQLpZRAe.js → exclamation-triangle-BrGltoOD.js} +1 -1
- package/packages/ui/dist/assets/{extension-BLI9H6uE.js → extension-rbJzrxR2.js} +1 -1
- package/packages/ui/dist/assets/{external-link-pmDBOLeB.js → external-link-u-PkoqkW.js} +1 -1
- package/packages/ui/dist/assets/{facebook-D0oBeuoW.js → facebook-BUOuB1AR.js} +1 -1
- package/packages/ui/dist/assets/{fallback-CTr-5J_0.js → fallback-Jc8-Tg7J.js} +1 -1
- package/packages/ui/dist/assets/{farcaster-D830ZQ6B.js → farcaster-DevdHBvK.js} +1 -1
- package/packages/ui/dist/assets/{filters-BDP12UH5.js → filters-Cdt_A-0T.js} +1 -1
- package/packages/ui/dist/assets/{github-Dsd8CaiB.js → github-D7OvtfA8.js} +1 -1
- package/packages/ui/dist/assets/{google-COaMfV-s.js → google-C7fcCh2C.js} +1 -1
- package/packages/ui/dist/assets/{help-circle-83k3tIYb.js → help-circle-CJYlQMQa.js} +1 -1
- package/packages/ui/dist/assets/{id-CKS6JA_C.js → id-DCrIrxvr.js} +1 -1
- package/packages/ui/dist/assets/{image-aPyURhkB.js → image-Cd4vAx3U.js} +1 -1
- package/packages/ui/dist/assets/{index-CUnzuCB1.js → index-C3Sr96ZU.js} +1 -1
- package/packages/ui/dist/assets/{index-COwDkv3o.js → index-Cy0esu9J.js} +3 -3
- package/packages/ui/dist/assets/{index-BvOsrf-A.js → index-DuEJJZTM.js} +1 -1
- package/packages/ui/dist/assets/{index-r4_v_97D.js → index-DvcJAW05.js} +1 -1
- package/packages/ui/dist/assets/{index-D0iREzjM.js → index-Yv-OtrtU.js} +36 -36
- package/packages/ui/dist/assets/{index-DXXwogr1.js → index-gZLKcNMf.js} +1 -1
- package/packages/ui/dist/assets/{index.es-YsdrjCOa.js → index.es-Ca_ntIyw.js} +4 -4
- package/packages/ui/dist/assets/{info-D-1gEaGf.js → info-BOvAn_nI.js} +1 -1
- package/packages/ui/dist/assets/{info-circle-CEcnXhcO.js → info-circle-COJvasGE.js} +1 -1
- package/packages/ui/dist/assets/{lightbulb-DuA1KrDX.js → lightbulb-CYz6UExH.js} +1 -1
- package/packages/ui/dist/assets/{mail-JkKpEBi6.js → mail-CkvkX18O.js} +1 -1
- package/packages/ui/dist/assets/{metamask-sdk-C9-v-knv.js → metamask-sdk-Cla6IB3a.js} +1 -1
- package/packages/ui/dist/assets/{mobile-DB9TNZz2.js → mobile-BQ9XvT6i.js} +1 -1
- package/packages/ui/dist/assets/{more-fP-bGgw9.js → more-zLvEx7Yq.js} +1 -1
- package/packages/ui/dist/assets/{network-placeholder-deY-B03n.js → network-placeholder-D69ehkDI.js} +1 -1
- package/packages/ui/dist/assets/{nftPlaceholder-CbbA4n3F.js → nftPlaceholder-D-h9zVKU.js} +1 -1
- package/packages/ui/dist/assets/{off-3ayAMsjV.js → off-_ywdT_df.js} +1 -1
- package/packages/ui/dist/assets/{parseSignature-GtjdojrJ.js → parseSignature-v17gXnmS.js} +1 -1
- package/packages/ui/dist/assets/{play-store-CKhO0KNl.js → play-store-CtqyPBxV.js} +1 -1
- package/packages/ui/dist/assets/{plus-BpuLUULB.js → plus-BZOwBZ9w.js} +1 -1
- package/packages/ui/dist/assets/{qr-code-CEW33VkT.js → qr-code-DVOdLGxV.js} +1 -1
- package/packages/ui/dist/assets/{recycle-horizontal-DzGMiQae.js → recycle-horizontal-Dw3F0SSR.js} +1 -1
- package/packages/ui/dist/assets/{refresh-jrP4AYfI.js → refresh-qm0DaJsK.js} +1 -1
- package/packages/ui/dist/assets/{reown-logo-DpirAqQj.js → reown-logo-CzLVxYtT.js} +1 -1
- package/packages/ui/dist/assets/{search-Cgo0L18Y.js → search-CFUlrZp6.js} +1 -1
- package/packages/ui/dist/assets/{secp256k1-DnW9PvLG.js → secp256k1-CBBCIY2h.js} +1 -1
- package/packages/ui/dist/assets/{send-D3WMesev.js → send-iEDKm814.js} +1 -1
- package/packages/ui/dist/assets/{swapHorizontal-X4k4Igqe.js → swapHorizontal-hkjwDOAT.js} +1 -1
- package/packages/ui/dist/assets/{swapHorizontalBold-guhcb5yU.js → swapHorizontalBold-ChOzydJB.js} +1 -1
- package/packages/ui/dist/assets/{swapHorizontalMedium-CY2hH1IK.js → swapHorizontalMedium-Qo-5Y2XZ.js} +1 -1
- package/packages/ui/dist/assets/{swapHorizontalRoundedBold-CkhmSVjn.js → swapHorizontalRoundedBold-B-oYiYML.js} +1 -1
- package/packages/ui/dist/assets/{swapVertical-ma4DOuv4.js → swapVertical-BG1cYFY6.js} +1 -1
- package/packages/ui/dist/assets/{telegram-CqxCoBfI.js → telegram-DlJUJAi-.js} +1 -1
- package/packages/ui/dist/assets/{three-dots-aYCJI1VH.js → three-dots-D9zuDuAD.js} +1 -1
- package/packages/ui/dist/assets/{twitch-DR7QLryB.js → twitch-CDwQYknJ.js} +1 -1
- package/packages/ui/dist/assets/{twitterIcon-BM8nMwqp.js → twitterIcon-CSI33QQX.js} +1 -1
- package/packages/ui/dist/assets/{verify-xRIdFoIV.js → verify-CR4ymsCx.js} +1 -1
- package/packages/ui/dist/assets/{verify-filled-Sd1hUDT2.js → verify-filled-BmJ4toa-.js} +1 -1
- package/packages/ui/dist/assets/{w3m-modal-DKu422qv.js → w3m-modal-D1A5jBj8.js} +1 -1
- package/packages/ui/dist/assets/{wallet-DwQDD6b7.js → wallet-CiGCme34.js} +1 -1
- package/packages/ui/dist/assets/{wallet-placeholder-D5B5F28S.js → wallet-placeholder-Bu8kFN6w.js} +1 -1
- package/packages/ui/dist/assets/{walletconnect-BgHdDlnQ.js → walletconnect-CNT0pexA.js} +1 -1
- package/packages/ui/dist/assets/{warning-circle-CxanhntI.js → warning-circle-DQTpi2d7.js} +1 -1
- package/packages/ui/dist/assets/{x-orN8l3rW.js → x-DuuOfymx.js} +1 -1
- package/packages/ui/dist/index.html +1 -1
- package/templates/default/.agents/skills/sail-onboarding/SKILL.md +1 -1
- package/templates/default/AGENTS.md +2 -0
- package/packages/ui/dist/assets/cursor-mfqk2Gsx.js +0 -3
package/package.json
CHANGED
package/packages/cli/README.md
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
# sailor
|
|
2
2
|
|
|
3
|
-
Start a new agent project with `npx sailor init <name>` from inside your
|
|
4
|
-
assistant, or install globally for direct command use and CI/CD.
|
|
3
|
+
Start a new agent project with `npx @sail.money/sailor init <name>` from inside your
|
|
4
|
+
AI coding assistant, or install globally for direct command use and CI/CD.
|
|
5
5
|
|
|
6
6
|
CLI operator toolkit for Sail Protocol. Run `sailor --help` to see all commands.
|
|
7
7
|
|
|
8
|
+
The published package is `@sail.money/sailor`. The bare name `sailor` is an unrelated
|
|
9
|
+
npm package — always install/invoke with the scoped name. Once installed, the `sailor`
|
|
10
|
+
bin works bare.
|
|
11
|
+
|
|
8
12
|
```sh
|
|
9
|
-
npm install -g sailor
|
|
13
|
+
npm install -g @sail.money/sailor
|
|
10
14
|
sailor init my-fund
|
|
11
15
|
```
|
|
12
16
|
|
|
@@ -38583,6 +38583,7 @@ var import_node_fs5 = require("node:fs");
|
|
|
38583
38583
|
var import_node_http = require("node:http");
|
|
38584
38584
|
var import_node_net = require("node:net");
|
|
38585
38585
|
var import_node_path4 = require("node:path");
|
|
38586
|
+
init_esm2();
|
|
38586
38587
|
|
|
38587
38588
|
// ../../node_modules/.pnpm/ws@8.21.0_bufferutil@4.1.0_utf-8-validate@5.0.10/node_modules/ws/wrapper.mjs
|
|
38588
38589
|
var import_stream2 = __toESM(require_stream2(), 1);
|
|
@@ -38879,8 +38880,38 @@ var SigningServer = class {
|
|
|
38879
38880
|
* from the previously-active account.json, so writing it first would drop the
|
|
38880
38881
|
* prior SMA.
|
|
38881
38882
|
*/
|
|
38883
|
+
/**
|
|
38884
|
+
* Read the SMA's true permissionSigner + manager from the kernel, so a saved
|
|
38885
|
+
* account never records the owner as a placeholder manager (which desyncs
|
|
38886
|
+
* account.json from chain). Returns null if unregistered or the RPC read fails.
|
|
38887
|
+
*/
|
|
38888
|
+
async readKernelSigners(safe, chainId) {
|
|
38889
|
+
try {
|
|
38890
|
+
if (!isAddress(safe)) return null;
|
|
38891
|
+
const rpcUrl = getRpcUrl(chainId);
|
|
38892
|
+
const kernel = getSailDeployment(chainId)?.kernel;
|
|
38893
|
+
if (!rpcUrl || !kernel) return null;
|
|
38894
|
+
const client = createPublicClient({ transport: http(rpcUrl, { timeout: 4e3 }) });
|
|
38895
|
+
const registered = await client.readContract({
|
|
38896
|
+
address: kernel,
|
|
38897
|
+
abi: SailKernelAbi,
|
|
38898
|
+
functionName: "registered",
|
|
38899
|
+
args: [getAddress(safe)]
|
|
38900
|
+
});
|
|
38901
|
+
if (!registered) return null;
|
|
38902
|
+
const configs = await client.readContract({
|
|
38903
|
+
address: kernel,
|
|
38904
|
+
abi: SailKernelAbi,
|
|
38905
|
+
functionName: "configs",
|
|
38906
|
+
args: [getAddress(safe)]
|
|
38907
|
+
});
|
|
38908
|
+
return { permissionSigner: getAddress(configs[0]), manager: getAddress(configs[1]) };
|
|
38909
|
+
} catch {
|
|
38910
|
+
return null;
|
|
38911
|
+
}
|
|
38912
|
+
}
|
|
38882
38913
|
handleSaveAccount(req, res) {
|
|
38883
|
-
this.readBody(req).then((body) => {
|
|
38914
|
+
this.readBody(req).then(async (body) => {
|
|
38884
38915
|
const parsed = body ? JSON.parse(body) : {};
|
|
38885
38916
|
const { safe, owner: owner2, permissionSigner, manager, chainId, createdAtBlock } = parsed;
|
|
38886
38917
|
if (!safe || !owner2 || !chainId) {
|
|
@@ -38888,11 +38919,12 @@ var SigningServer = class {
|
|
|
38888
38919
|
res.end(JSON.stringify({ error: "safe, owner, and chainId are required" }));
|
|
38889
38920
|
return;
|
|
38890
38921
|
}
|
|
38922
|
+
const onchain = await this.readKernelSigners(safe, chainId);
|
|
38891
38923
|
const record = {
|
|
38892
38924
|
safe,
|
|
38893
38925
|
owner: owner2,
|
|
38894
|
-
permissionSigner: permissionSigner ?? owner2,
|
|
38895
|
-
manager: manager ?? owner2,
|
|
38926
|
+
permissionSigner: onchain?.permissionSigner ?? permissionSigner ?? owner2,
|
|
38927
|
+
manager: onchain?.manager ?? manager ?? owner2,
|
|
38896
38928
|
chainId,
|
|
38897
38929
|
createdAtBlock: createdAtBlock ?? "0"
|
|
38898
38930
|
};
|
|
@@ -40231,21 +40263,51 @@ async function probePassThrough(pc, permission, account2) {
|
|
|
40231
40263
|
};
|
|
40232
40264
|
}
|
|
40233
40265
|
}
|
|
40266
|
+
function isRateLimit(err) {
|
|
40267
|
+
const msg = (err instanceof Error ? err.message : String(err)).toLowerCase();
|
|
40268
|
+
return msg.includes("429") || msg.includes("rate limit") || msg.includes("too many requests") || err?.status === 429;
|
|
40269
|
+
}
|
|
40270
|
+
function rpcFailure(err, ctx) {
|
|
40271
|
+
const reason = isRateLimit(err) ? "rate-limited (HTTP 429)" : err instanceof Error ? err.message.split("\n")[0] : String(err);
|
|
40272
|
+
const fix = ctx.usingDefaultRpc ? "No RPC_URL is configured, so doctor used the public fallback \u2014 which throttles aggressively. Set a dedicated endpoint in .sail/.env.local:\n RPC_URL=https://your-endpoint" : "Check RPC_URL in .sail/.env.local (endpoint reachable, not rate-limited, serves this chain).";
|
|
40273
|
+
if (ctx.json) {
|
|
40274
|
+
console.log(
|
|
40275
|
+
JSON.stringify({ status: "error", error: "rpc_unreachable", reason, chainId: ctx.chainId })
|
|
40276
|
+
);
|
|
40277
|
+
} else {
|
|
40278
|
+
console.error(`\u2717 Could not reach the RPC for chain ${ctx.chainId} \u2014 ${reason}.
|
|
40279
|
+
|
|
40280
|
+
${fix}`);
|
|
40281
|
+
}
|
|
40282
|
+
process.exit(1);
|
|
40283
|
+
}
|
|
40234
40284
|
async function doctor(options = {}) {
|
|
40235
40285
|
const project = new ProjectContext();
|
|
40236
40286
|
const chainId = project.chainId;
|
|
40237
40287
|
const kernel = project.contracts.kernel;
|
|
40238
|
-
const
|
|
40288
|
+
const configuredRpc = getRpcUrl(chainId);
|
|
40289
|
+
const rpcUrl = configuredRpc ?? getChainById(chainId).rpcUrls.default.http[0];
|
|
40290
|
+
const usingDefaultRpc = !configuredRpc;
|
|
40239
40291
|
const client = new SailorClient({ chainId, rpcUrl, kernel });
|
|
40240
40292
|
const pc = createPublicClient({ chain: getChainById(chainId), transport: http(rpcUrl) });
|
|
40241
|
-
|
|
40293
|
+
let caps;
|
|
40294
|
+
try {
|
|
40295
|
+
caps = await client.capabilities();
|
|
40296
|
+
} catch (err) {
|
|
40297
|
+
rpcFailure(err, { chainId, rpcUrl, usingDefaultRpc, json: !!options.json });
|
|
40298
|
+
}
|
|
40242
40299
|
const stored = readJsonFile(sailPath("account.json"));
|
|
40243
40300
|
const safe = options.account ? getAddress(options.account) : stored?.safe ? getAddress(stored.safe) : null;
|
|
40244
40301
|
let permissions = [];
|
|
40245
40302
|
let checks = [];
|
|
40246
40303
|
let permsNoCode = [];
|
|
40247
40304
|
if (safe) {
|
|
40248
|
-
|
|
40305
|
+
let mandates;
|
|
40306
|
+
try {
|
|
40307
|
+
mandates = await client.mandate.list(safe);
|
|
40308
|
+
} catch (err) {
|
|
40309
|
+
rpcFailure(err, { chainId, rpcUrl, usingDefaultRpc, json: !!options.json });
|
|
40310
|
+
}
|
|
40249
40311
|
permissions = mandates.map((m) => getAddress(m.permission));
|
|
40250
40312
|
if (permissions.length > 0) {
|
|
40251
40313
|
const codeChecks = await Promise.all(permissions.map((p) => checkContractExists(pc, p)));
|
|
@@ -40800,11 +40862,14 @@ run from the repo root.` : ` Available: ${available}`;
|
|
|
40800
40862
|
if (!inPlace && !dest.startsWith(cwd + import_node_path8.default.sep) && dest !== cwd) {
|
|
40801
40863
|
throw new Error(`Directory must be inside the current working directory`);
|
|
40802
40864
|
}
|
|
40803
|
-
if (!inPlace && import_node_fs9.default.existsSync(dest)) {
|
|
40804
|
-
throw new Error(`Directory already exists: ${dest}
|
|
40865
|
+
if (!inPlace && import_node_fs9.default.existsSync(dest) && !options.force) {
|
|
40866
|
+
throw new Error(`Directory already exists: ${dest}
|
|
40867
|
+
Pass --force to scaffold into it anyway (existing files with the same name are overwritten).`);
|
|
40805
40868
|
}
|
|
40806
|
-
if (inPlace && import_node_fs9.default.existsSync(import_node_path8.default.join(dest, ".sail", "config.json"))) {
|
|
40807
|
-
throw new Error(
|
|
40869
|
+
if (inPlace && import_node_fs9.default.existsSync(import_node_path8.default.join(dest, ".sail", "config.json")) && !options.force) {
|
|
40870
|
+
throw new Error(
|
|
40871
|
+
"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)."
|
|
40872
|
+
);
|
|
40808
40873
|
}
|
|
40809
40874
|
copyDirSync(templateSrc, dest);
|
|
40810
40875
|
const pkgRoot = packageRoot();
|
|
@@ -41033,28 +41098,75 @@ Added (new in template):`);
|
|
|
41033
41098
|
// src/commands/keys.ts
|
|
41034
41099
|
var import_node_fs11 = __toESM(require("node:fs"), 1);
|
|
41035
41100
|
var import_node_path10 = __toESM(require("node:path"), 1);
|
|
41036
|
-
|
|
41037
|
-
|
|
41038
|
-
|
|
41101
|
+
function readStdin() {
|
|
41102
|
+
return new Promise((resolve3, reject) => {
|
|
41103
|
+
let data = "";
|
|
41104
|
+
process.stdin.setEncoding("utf8");
|
|
41105
|
+
process.stdin.on("data", (c) => {
|
|
41106
|
+
data += c;
|
|
41107
|
+
});
|
|
41108
|
+
process.stdin.on("end", () => resolve3(data));
|
|
41109
|
+
process.stdin.on("error", reject);
|
|
41110
|
+
});
|
|
41111
|
+
}
|
|
41112
|
+
async function keysGenerate(options = {}) {
|
|
41113
|
+
const interactive = process.stdin.isTTY === true;
|
|
41114
|
+
let role = options.type ? normalizeRole(options.type) : null;
|
|
41115
|
+
if (options.type && !role) {
|
|
41116
|
+
throw new Error(
|
|
41117
|
+
`Unknown --type "${options.type}". Use "agent-wallet" (manager) or "mandate-signer".`
|
|
41118
|
+
);
|
|
41119
|
+
}
|
|
41039
41120
|
if (!role) {
|
|
41040
|
-
|
|
41121
|
+
if (!interactive) {
|
|
41122
|
+
throw new Error(
|
|
41123
|
+
"Non-interactive: pass --type <agent-wallet|mandate-signer> (no TTY to prompt on)."
|
|
41124
|
+
);
|
|
41125
|
+
}
|
|
41126
|
+
const roleInput = await prompt("Which key? (agent wallet / mandate signer)", "agent wallet");
|
|
41127
|
+
role = normalizeRole(roleInput);
|
|
41128
|
+
if (!role) {
|
|
41129
|
+
throw new Error(`Unknown key role: "${roleInput}". Choose "agent wallet" or "mandate signer".`);
|
|
41130
|
+
}
|
|
41041
41131
|
}
|
|
41042
41132
|
if (fileExists(keyPath(role))) {
|
|
41043
|
-
|
|
41044
|
-
|
|
41045
|
-
|
|
41046
|
-
|
|
41047
|
-
|
|
41048
|
-
|
|
41133
|
+
if (!options.force) {
|
|
41134
|
+
if (!interactive) {
|
|
41135
|
+
throw new Error(
|
|
41136
|
+
`A ${roleLabel(role)} key already exists at .sail/keys/${role}.json. Pass --force to overwrite.`
|
|
41137
|
+
);
|
|
41138
|
+
}
|
|
41139
|
+
const overwrite = await confirm(
|
|
41140
|
+
`A ${roleLabel(role)} key already exists at .sail/keys/${role}.json. Overwrite it?`
|
|
41141
|
+
);
|
|
41142
|
+
if (!overwrite) {
|
|
41143
|
+
console.log("Aborted \u2014 existing key left untouched.");
|
|
41144
|
+
return;
|
|
41145
|
+
}
|
|
41146
|
+
}
|
|
41147
|
+
}
|
|
41148
|
+
let password = options.passphrase ?? process.env.SAIL_PASSPHRASE ?? "";
|
|
41149
|
+
let promptedInteractively = false;
|
|
41150
|
+
if (!password && !interactive) {
|
|
41151
|
+
password = (await readStdin()).trim();
|
|
41152
|
+
if (!password) {
|
|
41153
|
+
throw new Error(
|
|
41154
|
+
"No passphrase provided. Pass --passphrase, set SAIL_PASSPHRASE, or pipe it on stdin."
|
|
41155
|
+
);
|
|
41049
41156
|
}
|
|
41050
41157
|
}
|
|
41051
|
-
|
|
41158
|
+
if (!password && interactive) {
|
|
41159
|
+
password = await promptHidden("Set a password to encrypt the key");
|
|
41160
|
+
promptedInteractively = true;
|
|
41161
|
+
}
|
|
41052
41162
|
if (password.length < 8) {
|
|
41053
41163
|
throw new Error("Password must be at least 8 characters.");
|
|
41054
41164
|
}
|
|
41055
|
-
|
|
41056
|
-
|
|
41057
|
-
|
|
41165
|
+
if (promptedInteractively) {
|
|
41166
|
+
const confirmation = await promptHidden("Confirm password");
|
|
41167
|
+
if (password !== confirmation) {
|
|
41168
|
+
throw new Error("Passwords do not match.");
|
|
41169
|
+
}
|
|
41058
41170
|
}
|
|
41059
41171
|
const keyring = LocalKeyring.generate();
|
|
41060
41172
|
const keystore = await keyring.exportKeystore(password);
|
|
@@ -41064,16 +41176,21 @@ async function keysGenerate() {
|
|
|
41064
41176
|
${label} key saved. Address: ${checksum4(keyring.address)}`);
|
|
41065
41177
|
console.log(`Encrypted keystore written to .sail/keys/${role}.json`);
|
|
41066
41178
|
if (role === "manager") {
|
|
41067
|
-
|
|
41068
|
-
|
|
41069
|
-
|
|
41070
|
-
|
|
41179
|
+
if (interactive && !options.passphrase) {
|
|
41180
|
+
const save = await confirm(
|
|
41181
|
+
"\nSave passphrase to .sail/.env.local for non-interactive use? (required for CI/GitHub Actions)"
|
|
41182
|
+
);
|
|
41183
|
+
if (save) {
|
|
41184
|
+
persistPassphrase(sailPath(".env.local"), password);
|
|
41185
|
+
console.log("\u2713 SAIL_PASSPHRASE saved to .sail/.env.local (mode 0600)");
|
|
41186
|
+
console.log(" sailor run will now work non-interactively.");
|
|
41187
|
+
} else {
|
|
41188
|
+
console.log("\nTo run non-interactively, add this to .sail/.env.local:");
|
|
41189
|
+
console.log(` SAIL_PASSPHRASE=<your-passphrase>`);
|
|
41190
|
+
}
|
|
41191
|
+
} else {
|
|
41071
41192
|
persistPassphrase(sailPath(".env.local"), password);
|
|
41072
41193
|
console.log("\u2713 SAIL_PASSPHRASE saved to .sail/.env.local (mode 0600)");
|
|
41073
|
-
console.log(" sailor run will now work non-interactively.");
|
|
41074
|
-
} else {
|
|
41075
|
-
console.log("\nTo run non-interactively, add this to .sail/.env.local:");
|
|
41076
|
-
console.log(` SAIL_PASSPHRASE=<your-passphrase>`);
|
|
41077
41194
|
}
|
|
41078
41195
|
}
|
|
41079
41196
|
}
|
|
@@ -45086,7 +45203,7 @@ function actionWith(fn) {
|
|
|
45086
45203
|
closePrompts();
|
|
45087
45204
|
};
|
|
45088
45205
|
}
|
|
45089
|
-
program2.command("init [dir]").description("Scaffold a new Sail agent into the current directory (or [dir] subdirectory)").option("--template <name>", "Template to scaffold from (default: default)").option("--chain <id>", "Default EVM chain id written to .sail/config.json and .env.example").option("--rpc-url <url>", "Default RPC_URL written to .sail/.env.local").action(
|
|
45206
|
+
program2.command("init [dir]").description("Scaffold a new Sail agent into the current directory (or [dir] subdirectory)").option("--template <name>", "Template to scaffold from (default: default)").option("--chain <id>", "Default EVM chain id written to .sail/config.json and .env.example").option("--rpc-url <url>", "Default RPC_URL written to .sail/.env.local").option("--force", "Re-initialize even if already initialized (overwrites scaffold files; keys/ and state/ are preserved)").action(
|
|
45090
45207
|
async (name, opts) => {
|
|
45091
45208
|
try {
|
|
45092
45209
|
await initCommand(name, opts);
|
|
@@ -45103,7 +45220,7 @@ ui.command("stop").description("Stop the running dashboard").action(() => uiStop
|
|
|
45103
45220
|
ui.command("status").description("Show whether the dashboard is running").action(() => uiStatus());
|
|
45104
45221
|
ui.action(action(uiCommand));
|
|
45105
45222
|
var keys = program2.command("keys").description("Manage local signing keys");
|
|
45106
|
-
keys.command("generate").description("Generate and encrypt an agent wallet or mandate signer key").
|
|
45223
|
+
keys.command("generate").description("Generate and encrypt an agent wallet or mandate signer key").option("--type <role>", "Key role: agent-wallet (manager) or mandate-signer (non-interactive)").option("--passphrase <value>", "Encryption passphrase (else SAIL_PASSPHRASE, else stdin, else prompt)").option("--force", "Overwrite an existing key without prompting").action(actionWith(keysGenerate));
|
|
45107
45224
|
keys.command("show").description("Show the address of each stored key").action(action(keysShow));
|
|
45108
45225
|
keys.command("export-ci").description(
|
|
45109
45226
|
"Copy the encrypted agent wallet keystore to ci-keystore.json for committing to CI"
|
|
@@ -48736,6 +48736,21 @@ var _thisFile = (() => {
|
|
|
48736
48736
|
return __filename;
|
|
48737
48737
|
}
|
|
48738
48738
|
})();
|
|
48739
|
+
function readPackageVersion() {
|
|
48740
|
+
let dir = import_node_path.default.dirname(_thisFile);
|
|
48741
|
+
for (let i = 0; i < 6; i++) {
|
|
48742
|
+
try {
|
|
48743
|
+
const pkg = JSON.parse(import_node_fs2.default.readFileSync(import_node_path.default.join(dir, "package.json"), "utf-8"));
|
|
48744
|
+
if (pkg?.version) return String(pkg.version);
|
|
48745
|
+
} catch {
|
|
48746
|
+
}
|
|
48747
|
+
const parent = import_node_path.default.dirname(dir);
|
|
48748
|
+
if (parent === dir) break;
|
|
48749
|
+
dir = parent;
|
|
48750
|
+
}
|
|
48751
|
+
return null;
|
|
48752
|
+
}
|
|
48753
|
+
var RUNNING_VERSION = readPackageVersion();
|
|
48739
48754
|
function parseEnvFile(file) {
|
|
48740
48755
|
const out = {};
|
|
48741
48756
|
let raw;
|
|
@@ -48798,6 +48813,32 @@ function resolveRpcUrl(env, chainId) {
|
|
|
48798
48813
|
if (env.RPC_URL && Number(env.CHAIN_ID) === Number(chainId)) return env.RPC_URL;
|
|
48799
48814
|
return DEFAULT_RPC_URLS[chainId] ?? env.RPC_URL ?? null;
|
|
48800
48815
|
}
|
|
48816
|
+
async function readKernelSigners(safe, chainId, rpcUrl) {
|
|
48817
|
+
try {
|
|
48818
|
+
if (!rpcUrl || !isAddress2(safe)) return null;
|
|
48819
|
+
const kernel = getSailDeployment(Number(chainId))?.kernel;
|
|
48820
|
+
if (!kernel) return null;
|
|
48821
|
+
const client = createPublicClient({ transport: http(rpcUrl, { timeout: 4e3 }) });
|
|
48822
|
+
const registered = await client.readContract({
|
|
48823
|
+
address: kernel,
|
|
48824
|
+
abi: SailKernelAbi,
|
|
48825
|
+
functionName: "registered",
|
|
48826
|
+
args: [getAddress(safe)]
|
|
48827
|
+
});
|
|
48828
|
+
if (!registered) return null;
|
|
48829
|
+
const configs = await client.readContract({
|
|
48830
|
+
address: kernel,
|
|
48831
|
+
abi: SailKernelAbi,
|
|
48832
|
+
functionName: "configs",
|
|
48833
|
+
args: [getAddress(safe)]
|
|
48834
|
+
});
|
|
48835
|
+
const [permissionSigner, manager] = configs;
|
|
48836
|
+
return { permissionSigner: getAddress(permissionSigner), manager: getAddress(manager) };
|
|
48837
|
+
} catch (err) {
|
|
48838
|
+
console.warn(`[account] on-chain signer read failed for ${safe} on chain ${chainId}; using provided values: ${err instanceof Error ? err.message.split("\n")[0] : String(err)}`);
|
|
48839
|
+
return null;
|
|
48840
|
+
}
|
|
48841
|
+
}
|
|
48801
48842
|
function balanceStatus(wei) {
|
|
48802
48843
|
if (wei === 0n) return "critical";
|
|
48803
48844
|
const eth = Number(formatEther(wei));
|
|
@@ -48961,7 +49002,7 @@ function startServer(sailDir, { port = PORT } = {}) {
|
|
|
48961
49002
|
res.status(500).json({ error: String(err) });
|
|
48962
49003
|
}
|
|
48963
49004
|
});
|
|
48964
|
-
app.post("/api/account", (req, res) => {
|
|
49005
|
+
app.post("/api/account", async (req, res) => {
|
|
48965
49006
|
const { safe, owner, permissionSigner, manager, chainId, createdAtBlock, deployedChains } = req.body ?? {};
|
|
48966
49007
|
if (!safe || !owner || !chainId) {
|
|
48967
49008
|
res.status(400).json({ error: "safe, owner, and chainId are required" });
|
|
@@ -48969,7 +49010,16 @@ function startServer(sailDir, { port = PORT } = {}) {
|
|
|
48969
49010
|
}
|
|
48970
49011
|
try {
|
|
48971
49012
|
import_node_fs2.default.mkdirSync(at("state"), { recursive: true });
|
|
48972
|
-
const
|
|
49013
|
+
const env = parseEnvFile(at(".env.local"));
|
|
49014
|
+
const onchain = await readKernelSigners(safe, chainId, resolveRpcUrl(env, Number(chainId)));
|
|
49015
|
+
const record = {
|
|
49016
|
+
safe,
|
|
49017
|
+
owner,
|
|
49018
|
+
permissionSigner: onchain?.permissionSigner ?? permissionSigner ?? owner,
|
|
49019
|
+
manager: onchain?.manager ?? manager ?? owner,
|
|
49020
|
+
chainId,
|
|
49021
|
+
createdAtBlock: createdAtBlock ?? "0"
|
|
49022
|
+
};
|
|
48973
49023
|
if (Array.isArray(deployedChains) && deployedChains.length > 0) record.deployedChains = deployedChains;
|
|
48974
49024
|
const accountsPath = at("state/accounts.json");
|
|
48975
49025
|
let accounts = [];
|
|
@@ -49776,8 +49826,9 @@ function startServer(sailDir, { port = PORT } = {}) {
|
|
|
49776
49826
|
}
|
|
49777
49827
|
} catch {
|
|
49778
49828
|
}
|
|
49829
|
+
const onchain = await readKernelSigners(safe, chainId, resolveRpcUrl(parseEnvFile(at(".env.local")), Number(chainId)));
|
|
49779
49830
|
const managerKeyPath2 = at("keys/manager.json");
|
|
49780
|
-
let resolvedManager = manager;
|
|
49831
|
+
let resolvedManager = onchain?.manager ?? manager;
|
|
49781
49832
|
if (!resolvedManager) {
|
|
49782
49833
|
try {
|
|
49783
49834
|
const ks = JSON.parse(import_node_fs2.default.readFileSync(managerKeyPath2, "utf-8"));
|
|
@@ -49789,7 +49840,7 @@ function startServer(sailDir, { port = PORT } = {}) {
|
|
|
49789
49840
|
const record = {
|
|
49790
49841
|
safe: getAddress(safe),
|
|
49791
49842
|
owner: getAddress(owner),
|
|
49792
|
-
permissionSigner: getAddress(owner),
|
|
49843
|
+
permissionSigner: onchain?.permissionSigner ?? getAddress(owner),
|
|
49793
49844
|
manager: getAddress(resolvedManager),
|
|
49794
49845
|
chainId,
|
|
49795
49846
|
createdAtBlock,
|
|
@@ -49980,13 +50031,12 @@ function startServer(sailDir, { port = PORT } = {}) {
|
|
|
49980
50031
|
const perSmaPath = managerKeyPath(account.safe);
|
|
49981
50032
|
const legacyPerSmaPath = legacyManagerKeyPath(account.safe);
|
|
49982
50033
|
const flatManagerPath = at("keys/manager.json");
|
|
49983
|
-
|
|
50034
|
+
const activeKeyPath = [perSmaPath, legacyPerSmaPath].find((p) => import_node_fs2.default.existsSync(p)) ?? (import_node_fs2.default.existsSync(flatManagerPath) ? flatManagerPath : null);
|
|
50035
|
+
if (activeKeyPath) {
|
|
49984
50036
|
try {
|
|
49985
|
-
|
|
49986
|
-
|
|
49987
|
-
|
|
49988
|
-
localManagerAddrs.add(getAddress(`0x${String(ks.address).replace(/^0x/, "")}`));
|
|
49989
|
-
}
|
|
50037
|
+
const ks = JSON.parse(import_node_fs2.default.readFileSync(activeKeyPath, "utf-8"));
|
|
50038
|
+
if (ks?.address) {
|
|
50039
|
+
localManagerAddrs.add(getAddress(`0x${String(ks.address).replace(/^0x/, "")}`));
|
|
49990
50040
|
}
|
|
49991
50041
|
} catch {
|
|
49992
50042
|
}
|
|
@@ -50099,11 +50149,22 @@ function startServer(sailDir, { port = PORT } = {}) {
|
|
|
50099
50149
|
}
|
|
50100
50150
|
return result;
|
|
50101
50151
|
}
|
|
50152
|
+
app.get("/api/version", (_req, res) => {
|
|
50153
|
+
const installed = readPackageVersion();
|
|
50154
|
+
res.json({ running: RUNNING_VERSION, installed, stale: Boolean(RUNNING_VERSION && installed && installed !== RUNNING_VERSION) });
|
|
50155
|
+
});
|
|
50102
50156
|
const distDir = process.env.SAILOR_UI_DIST ?? import_node_path.default.join(import_node_path.default.dirname(_thisFile), "dist");
|
|
50103
50157
|
const hasUiDist = import_node_fs2.default.existsSync(import_node_path.default.join(distDir, "index.html"));
|
|
50104
50158
|
if (process.env.SERVE_DIST === "1" || hasUiDist) {
|
|
50105
|
-
app.use(import_express.default.static(distDir
|
|
50106
|
-
|
|
50159
|
+
app.use(import_express.default.static(distDir, {
|
|
50160
|
+
setHeaders: (res, filePath) => {
|
|
50161
|
+
if (filePath.endsWith("index.html")) res.setHeader("Cache-Control", "no-cache");
|
|
50162
|
+
}
|
|
50163
|
+
}));
|
|
50164
|
+
app.get("*", (_req, res) => {
|
|
50165
|
+
res.setHeader("Cache-Control", "no-cache");
|
|
50166
|
+
res.sendFile(import_node_path.default.join(distDir, "index.html"));
|
|
50167
|
+
});
|
|
50107
50168
|
}
|
|
50108
50169
|
const httpServer = app.listen(port, () => {
|
|
50109
50170
|
console.log(`Sailor UI running at http://localhost:${port} (reading ${sailDir})`);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Do not edit manually — run `pnpm build` to regenerate.
|
|
6
6
|
*
|
|
7
7
|
* Spec version : 1.2.0
|
|
8
|
-
* Generated at : 2026-06-18T13:
|
|
8
|
+
* Generated at : 2026-06-18T13:31:20.223Z
|
|
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";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Do not edit manually — run `pnpm build` to regenerate.
|
|
6
6
|
*
|
|
7
7
|
* Spec version : 1.2.0
|
|
8
|
-
* Generated at : 2026-06-18T13:
|
|
8
|
+
* Generated at : 2026-06-18T13:31:20.223Z
|
|
9
9
|
*/
|
|
10
10
|
export const SAIL_INTELLIGENCE_BASE_URL = "https://api.sail.money";
|
|
11
11
|
export const SAIL_INTELLIGENCE_DOCS_URL = "https://api.sail.money/docs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-DOm1cgRJ.js";import"./index-Yv-OtrtU.js";import"./events-C9qV0Eqh.js";import"./index.es-Ca_ntIyw.js";import"./fallback-Jc8-Tg7J.js";const d=o`<svg
|
|
2
2
|
width="14"
|
|
3
3
|
height="14"
|
|
4
4
|
viewBox="0 0 14 14"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-DOm1cgRJ.js";import"./index-Yv-OtrtU.js";import"./events-C9qV0Eqh.js";import"./index.es-Ca_ntIyw.js";import"./fallback-Jc8-Tg7J.js";const p=o`<svg fill="none" viewBox="0 0 24 24">
|
|
2
2
|
<path
|
|
3
3
|
style="fill: var(--wui-color-accent-100);"
|
|
4
4
|
d="M10.2 6.6a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0ZM21 6.6a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0ZM10.2 17.4a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0ZM21 17.4a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0Z"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as t}from"./core-
|
|
1
|
+
import{F as t}from"./core-DOm1cgRJ.js";import"./index-Yv-OtrtU.js";import"./events-C9qV0Eqh.js";import"./index.es-Ca_ntIyw.js";import"./fallback-Jc8-Tg7J.js";const e=t`
|
|
2
2
|
<svg width="36" height="36">
|
|
3
3
|
<path
|
|
4
4
|
d="M28.724 0H7.271A7.269 7.269 0 0 0 0 7.272v21.46A7.268 7.268 0 0 0 7.271 36H28.73A7.272 7.272 0 0 0 36 28.728V7.272A7.275 7.275 0 0 0 28.724 0Z"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as i}from"./core-
|
|
1
|
+
import{F as i}from"./core-DOm1cgRJ.js";import"./index-Yv-OtrtU.js";import"./events-C9qV0Eqh.js";import"./index.es-Ca_ntIyw.js";import"./fallback-Jc8-Tg7J.js";const h=i`<svg fill="none" viewBox="0 0 40 40">
|
|
2
2
|
<g clip-path="url(#a)">
|
|
3
3
|
<g clip-path="url(#b)">
|
|
4
4
|
<circle cx="20" cy="19.89" r="20" fill="#000" />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-DOm1cgRJ.js";import"./index-Yv-OtrtU.js";import"./events-C9qV0Eqh.js";import"./index.es-Ca_ntIyw.js";import"./fallback-Jc8-Tg7J.js";const p=o`<svg fill="none" viewBox="0 0 14 15">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
package/packages/ui/dist/assets/{arrow-bottom-circle-D7iFEHHJ.js → arrow-bottom-circle-DYEjX8QA.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-DOm1cgRJ.js";import"./index-Yv-OtrtU.js";import"./events-C9qV0Eqh.js";import"./index.es-Ca_ntIyw.js";import"./fallback-Jc8-Tg7J.js";const t=o`<svg
|
|
2
2
|
fill="none"
|
|
3
3
|
viewBox="0 0 21 20"
|
|
4
4
|
>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-DOm1cgRJ.js";import"./index-Yv-OtrtU.js";import"./events-C9qV0Eqh.js";import"./index.es-Ca_ntIyw.js";import"./fallback-Jc8-Tg7J.js";const a=o`<svg fill="none" viewBox="0 0 14 15">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-DOm1cgRJ.js";import"./index-Yv-OtrtU.js";import"./events-C9qV0Eqh.js";import"./index.es-Ca_ntIyw.js";import"./fallback-Jc8-Tg7J.js";const p=o`<svg fill="none" viewBox="0 0 14 15">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-DOm1cgRJ.js";import"./index-Yv-OtrtU.js";import"./events-C9qV0Eqh.js";import"./index.es-Ca_ntIyw.js";import"./fallback-Jc8-Tg7J.js";const t=o`<svg fill="none" viewBox="0 0 14 15">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-DOm1cgRJ.js";import"./index-Yv-OtrtU.js";import"./events-C9qV0Eqh.js";import"./index.es-Ca_ntIyw.js";import"./fallback-Jc8-Tg7J.js";const H=o`<svg
|
|
2
2
|
xmlns="http://www.w3.org/2000/svg"
|
|
3
3
|
width="12"
|
|
4
4
|
height="13"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as P,s as M,y as A,v as I,p as c,g as L,c as T,O as Y,l as E,m as J,R as O,h as ke,e as D,f as S,o as ft,j as Hi,W as gt,C as jt,d as si,T as kt,n as Qe,M as vi,k as yi,F as Ae,A as li,q as Ki}from"./core-
|
|
1
|
+
import{u as P,s as M,y as A,v as I,p as c,g as L,c as T,O as Y,l as E,m as J,R as O,h as ke,e as D,f as S,o as ft,j as Hi,W as gt,C as jt,d as si,T as kt,n as Qe,M as vi,k as yi,F as Ae,A as li,q as Ki}from"./core-DOm1cgRJ.js";import{n as u,c as C,o as y,r as v,U as se,e as Gi,f as Yi,a as Ji}from"./index-Cy0esu9J.js";import"./index-Yv-OtrtU.js";import"./events-C9qV0Eqh.js";import"./index.es-Ca_ntIyw.js";import"./fallback-Jc8-Tg7J.js";const Qi=P`
|
|
2
2
|
:host {
|
|
3
3
|
position: relative;
|
|
4
4
|
background-color: var(--wui-color-gray-glass-002);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as l}from"./core-
|
|
1
|
+
import{F as l}from"./core-DOm1cgRJ.js";import"./index-Yv-OtrtU.js";import"./events-C9qV0Eqh.js";import"./index.es-Ca_ntIyw.js";import"./fallback-Jc8-Tg7J.js";const i=l`<svg fill="none" viewBox="0 0 20 20">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as C}from"./core-
|
|
1
|
+
import{F as C}from"./core-DOm1cgRJ.js";import"./index-Yv-OtrtU.js";import"./events-C9qV0Eqh.js";import"./index.es-Ca_ntIyw.js";import"./fallback-Jc8-Tg7J.js";const l=C`<svg
|
|
2
2
|
xmlns="http://www.w3.org/2000/svg"
|
|
3
3
|
width="12"
|
|
4
4
|
height="13"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as u,cY as p,fP as k,c0 as x,de as M,dl as S,dk as $,bK as A,bR as T,cd as C,cJ as w,dc as E,a0 as b,dg as G}from"./index-
|
|
1
|
+
import{B as u,cY as p,fP as k,c0 as x,de as M,dl as S,dk as $,bK as A,bR as T,cd as C,cJ as w,dc as E,a0 as b,dg as G}from"./index-Yv-OtrtU.js";class D extends u{constructor({callbackSelector:a,cause:t,data:f,extraData:e,sender:d,urls:i}){var o;super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],(o=t.metaMessages)!=null&&o.length?"":[],"Offchain Gateway Call:",i&&[" Gateway URL(s):",...i.map(n=>` ${p(n)}`)],` Sender: ${d}`,` Data: ${f}`,` Callback selector: ${a}`,` Extra data: ${e}`].flat(),name:"OffchainLookupError"})}}class P extends u{constructor({result:a,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${p(t)}`,`Response: ${k(a)}`],name:"OffchainLookupResponseMalformedError"})}}class B extends u{constructor({sender:a,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${a}`],name:"OffchainLookupSenderMismatchError"})}}const H="0x556f1830",U={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function J(c,{blockNumber:a,blockTag:t,data:f,requestOptions:e,to:d}){var s;const{args:i}=x({data:f,abi:[U]}),[o,n,l,g,y]=i,{ccipRead:h}=c,r=h&&typeof(h==null?void 0:h.request)=="function"?h.request:j;try{if(!M(d,o))throw new B({sender:o,to:d});const m=n.includes(S)?await $({data:l,ccipRequest:R=>r({...R,requestOptions:e})}):await r({data:l,requestOptions:e,sender:o,urls:n}),{data:L}=await A(c,{blockNumber:a,blockTag:t,data:T([g,C([{type:"bytes"},{type:"bytes"}],[m,y])]),requestOptions:e,to:d});return L}catch(m){throw(s=e==null?void 0:e.signal)!=null&&s.aborted?w(e.signal):E(m)?m:new D({callbackSelector:g,cause:m,data:f,extraData:y,sender:o,urls:n})}}async function j({data:c,requestOptions:a,sender:t,urls:f}){var d,i,o;let e=new Error("An unknown error occurred.");for(let n=0;n<f.length;n++){if((d=a==null?void 0:a.signal)!=null&&d.aborted)throw w(a.signal);const l=f[n],g=l.includes("{data}")?"GET":"POST",y=g==="POST"?{data:c,sender:t}:void 0,h=g==="POST"?{"Content-Type":"application/json"}:{};try{const r=await fetch(l.replace("{sender}",t.toLowerCase()).replace("{data}",c),{body:JSON.stringify(y),headers:h,method:g,...a!=null&&a.signal?{signal:a.signal}:{}});let s;if((i=r.headers.get("Content-Type"))!=null&&i.startsWith("application/json")?s=(await r.json()).data:s=await r.text(),!r.ok){e=new b({body:y,details:s!=null&&s.error?k(s.error):r.statusText,headers:r.headers,status:r.status,url:l});continue}if(!G(s)){e=new P({result:s,url:l});continue}return s}catch(r){if((o=a==null?void 0:a.signal)!=null&&o.aborted)throw w(a.signal);if(E(r))throw r;e=new b({body:y,details:r.message,url:l})}}throw e}export{j as ccipRequest,J as offchainLookup,U as offchainLookupAbiItem,H as offchainLookupSignature};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-DOm1cgRJ.js";import"./index-Yv-OtrtU.js";import"./events-C9qV0Eqh.js";import"./index.es-Ca_ntIyw.js";import"./fallback-Jc8-Tg7J.js";const p=o`<svg
|
|
2
2
|
width="28"
|
|
3
3
|
height="28"
|
|
4
4
|
viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-DOm1cgRJ.js";import"./index-Yv-OtrtU.js";import"./events-C9qV0Eqh.js";import"./index.es-Ca_ntIyw.js";import"./fallback-Jc8-Tg7J.js";const p=o`<svg fill="none" viewBox="0 0 14 14">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-DOm1cgRJ.js";import"./index-Yv-OtrtU.js";import"./events-C9qV0Eqh.js";import"./index.es-Ca_ntIyw.js";import"./fallback-Jc8-Tg7J.js";const p=o`<svg fill="none" viewBox="0 0 16 16">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-DOm1cgRJ.js";import"./index-Yv-OtrtU.js";import"./events-C9qV0Eqh.js";import"./index.es-Ca_ntIyw.js";import"./fallback-Jc8-Tg7J.js";const p=o`<svg fill="none" viewBox="0 0 16 16">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as o}from"./core-
|
|
1
|
+
import{F as o}from"./core-DOm1cgRJ.js";import"./index-Yv-OtrtU.js";import"./events-C9qV0Eqh.js";import"./index.es-Ca_ntIyw.js";import"./fallback-Jc8-Tg7J.js";const p=o`<svg fill="none" viewBox="0 0 16 16">
|
|
2
2
|
<path
|
|
3
3
|
fill="currentColor"
|
|
4
4
|
fill-rule="evenodd"
|