Repository navigation
Feat/167 soroban spec driven arg forms - #1122
Merged
Nanle-code merged 3 commits intoOct 1, 2026
Merged
Nanle-code merged 3 commits into
Nanle-code merged 3 commits into
Conversation
added 2 commits
September 29, 2026 12:26
…ortfolioRebalancer The `local/no-direct-submit` rule (Nanle-code#983) landed in 7d6ea30 three days ago and has been failing `pnpm run lint` ever since: 8 errors, none of them triaged. This PR resolves all 8 and leaves Lint & Format Check green. The rule's own docstring says it "forbids calling server.submitTransaction() or sendTransaction() directly from component code", but the implementation flagged every file in the repo. That is not workable, because the remedy the rule prescribes - useWriteGuard().guard() - is a React hook, so non-component code cannot satisfy it at all. Three of the four remaining production violations are in src/lib/*.ts transport helpers. Two changes: 1. eslint-rules/no-direct-submit.mjs now returns early for anything outside src/components/. The transport layers stay on the explicit ALLOWLIST as before; scripts/ and docs/ are no longer in scope, since they have no user to confirm with. The guard is unchanged for component code, which is where the mainnet risk actually lives. 2. src/components/dashboard/PortfolioRebalancer.tsx was the one genuine component violation: "Execute Live Rebalance" called signAndSubmitTransaction() straight from the click handler, with no confirmation gate, so a real write could reach the network with a single click. It now goes through useWriteGuard(), matching how TransactionSigner already does it, and renders <MainnetConfirmDialog {...dialogProps} />. The handler is split into handleLiveExecute (the guarded entry point) and runLiveExecute (the work), so the submit is only reachable from the guard's onConfirm. The import is aliased to submitSignedTransaction. The rule matches on the callee's identifier, and the symbol comes from the already allowlisted src/lib/transactionBuilder, so the rule flags the call site in the component regardless of where the function was defined. The alias makes the guarded path explicit at the call site. On mainnet, clicking "Execute Live Rebalance" now requires typing "mainnet" to confirm, and is blocked entirely when the per-session mainnet read-only lock is active. Non-mainnet networks proceed immediately, as guard() is designed to. Lint: 14 errors on master -> 5 with this PR (the remaining 5 are the parse errors fixed in Nanle-code#1108 and Nanle-code#1119). All 8 no-direct-submit errors are resolved. Warnings unchanged at 2258. Verified: `pnpm exec tsc --noEmit` reports no errors in PortfolioRebalancer.tsx.
…le-code#167) - Parse contract spec via parseContractWasm and store spec object in ContractInteraction alongside contractFunctions - Add encodeArgsWithSpec() / tryEncodeWithSpec() helpers that call spec.funcArgsToScVals() for full type-safe ScVal encoding; fall back to the existing 4-type manual encoder when spec is unavailable - Thread optional spec param through BuildContractInvocationParams, simulateContractCall, and invokeContractFunction so complex types (Vec, Map, enums, structs) encode correctly - Render enum-typed parameters as a select populated from parameter.schema.enum variants - Run spec.funcArgsToScVals as a dry-run before hitting the RPC; surface type errors in a specArgError message and block simulate - Clear specArgError on every field/arg edit Fixes AuditLog.tsx build breakage (emoji surrogate pairs crashing esbuild, misindented detail panel JSX causing unterminated-regex parser error). Fixes pre-existing soroban.ts SorobanRpc->rpc.Durability reference. Add browser-compatible shim for src/ml/isolation_forest.ts (was using Node-only createRequire, crashing the Vite browser bundle).
|
Someone is attempting to deploy a commit to the nanle-code's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Sensei-Victor Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #167
How was this tested?
Merge requirements
A PR is merged only when every box below is true. See
Merge requirements for the full policy.
masterif GitHub shows "This branch has conflicts").Security-sensitive changes
.github/CODEOWNERS(wallet, auth, cryptography, CI) and a code owner has been requested for review.