CLI: Lend commands#423
Draft
its-everdred wants to merge 21 commits intomainfrom
Draft
Conversation
25f543e to
6683bbd
Compare
This was referenced May 5, 2026
Open
7115ee4 to
5e8c7db
Compare
✅ Deploy Preview for actions-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
its-everdred
commented
May 5, 2026
| afterEach(() => setJsonMode(false)) | ||
|
|
||
| const ANVIL_ACCOUNT_0 = | ||
| '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80' |
Collaborator
Author
There was a problem hiding this comment.
DRY, import this from 1 place
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.
Fixes #409. Adds the lend namespace on top of the CLI scaffolding: read-only
actions lend markets/actions lend marketand wallet-scopedwallet lend open/close/position.SDK → CLI
Output
{ "action": "open", "market": { "name": "Gauntlet USDC", "address": "0x...", "chainId": 84532, "provider": "morpho" }, "asset": { "symbol": "USDC_DEMO" }, "amount": 10, "transactions": [ { "transactionHash": "0x...", "status": "success", ... } ] }transactionsis always an array (1-2 receipts on EOA: optional approval + position call). Read commands return the SDK shape verbatim with bigints stringified.Notable
ActionsErrormapping inoutput/errors.ts—ChainNotSupportedError,InvalidParamsError,ProviderNotConfiguredErroretc. become structuredvalidation/configenvelopes; viemContractFunctionRevertedErrorbecomesonchain.status === 'success'(EOA) orsuccess === true(UserOp) becomescode: "onchain"exit 5; a misbehaving RPC can't silently report success.--amount— rejects scientific notation, hex, signs, whitespace, bigint suffixes, and integer parts aboveMAX_SAFE_INTEGER.validationinstead of silently picking the first.parseAmount,WalletTransactionReceipt,toReceiptArray,ensureOnchainSuccess) live incli/src/utils/.openandcloseshare arunLendActionbackbone.159 tests pass.
Out of scope (follow-ups)
lendProvideron the read-sideLendMarketpayload — needs an SDK field.LendMarketPositionin the open/close envelope — extra RPC per write.getLendProviders(config)SDK accessor so the CLI doesn't string-skip thesettingssibling.