Repository navigation
feat(engine): cross-chain stablecoin quotes through NEAR Intents, with 1Click's signature as proof (#273) - #278
Merged
Merged
Conversation
…in payments (#273) NEAR Intents has no testnet and HelloNear wallets are testnet, so this is a preview only: 1Click POST /v0/quote with dry: true (no deposit address, no transaction, no key). Asset ids from GET /v0/tokens, amounts in BigInt, refundTo is the Mind's own wallet address. Tests: test/crosschain.test.ts 5/5 (fake 1Click); one live dry quote by hand: 10 USDC on NEAR -> 9.99558 USDC on Base. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e
…273) The Payments Mind template already carries the payments skill, so no owner adds anything. Its blurb names the quote: with "(cannot send them yet)" a try-out Mind with ~20 skills refused from the skill list without calling the tool (Chrome, 12 Nov). Tests: test:unit 177/177; skills-crosschain (live, a 14-skill Mind, fake 1Click) 9/9 over 3 runs; bun run test 315/317 (autopilot timing and one calendar-local-times run; both pass alone, 7/7 and 3/3); Chrome e2e on a local stack with the real 1Click: Base USDC and Solana USDT quotes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e
1Click signs every quote, dry ones too. The result now carries proof:
{ signedBy1Click, signature, quoteHash, publicKey }, checked with the
official verifyQuoteSignature from @defuse-protocol/one-click-sdk-typescript
0.1.26 (pinned). The playbook has the Mind say so in plain words after the
result, or that the signature could not be checked.
Tests: test:unit 178/178 (a recorded real signed quote verifies, a changed
amountOut does not); skills-crosschain live 9/9 over 3 runs (the signed
answer is called signed, the unsigned one never verified); Chrome e2e on a
local stack against the real 1Click: proof question in English and
Indonesian answered with the hash, key and signature.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e
#273) Asked to list the hash and signature, the model dropped characters (a three-character gap in the 88-character signature; the hash missing or wrong in 3 of 6 runs), so a shown proof would not verify. It now says NEAR Intents signed the numbers and the signature checked out, and leaves the exact values to the app, which shows them from the tool result. Tests: skills-crosschain live 9/9 over 3 runs (fails on any proof-like string that is not exactly the tool's); Chrome e2e: a plain request got the proof without being asked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e
rpc.testnet.near.org answered "THIS ENDPOINT IS DEPRECATED! STOP USING IT NOW!" instead of results on and off (12 Nov), failing near_view_account and every test that reads an account (11 in one full run). https://test.rpc.fastnear.com is listed at docs.near.org/api/rpc/providers; NEAR_RPC_URL still overrides it. Tests: test:unit 178/178; bun run test 317/318 with the new default (one workflow test where the model tried send_payment, which a workflow doesn't have: ToolNotFoundError, nothing paid; 5/5 on this branch and 5/5 with main's playbook afterwards). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e
Contributor
Author
|
Merged with Axel's approval; @AncungAulia here's what we built today and how to try it on https://app.hellonear.xyz once it's live (James posts the deploy here): What it is
How to test
FE pieces (yours, optional before the freeze)
Next: #277. "Paste the quote in TEE Explorer" will open the report already verified, with no pasting. I'm starting the backend route now; you'll get a URL to open from the link. @Lin1er the engine's default NEAR RPC is now |
Contributor
|
Live on the hosted demo:
|
This was referenced Nov 12, 2026
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.
Engine part of #273. A Payments Mind can quote a USDC/USDT payment from NEAR to any chain NEAR Intents supports, and show that the numbers are NEAR Intents' own.
What
crosschain_quote(engine/src/crosschain.ts), in thepaymentsskill. The Payments Mind template already carries that skill, so owners add nothing.POST /v0/quotewithdry: true: no deposit address, no transaction, no API key (HACKATHON.md Q-006/Q-007).GET /v0/tokens; amounts are converted in BigInt;refundTois the Mind's own wallet address. No approval, since nothing moves.proof: { signedBy1Click, signature, quoteHash, publicKey }, checked with the officialverifyQuoteSignaturefrom@defuse-protocol/one-click-sdk-typescript0.1.26, pinned.amountOutchanged does not.test/fixtures/oneclick-dry-quote.jsonis a real signed dry quote.https://test.rpc.fastnear.com(listed at docs.near.org/api/rpc/providers).rpc.testnet.near.organswered "THIS ENDPOINT IS DEPRECATED! STOP USING IT NOW!" on and off today, which failednear_view_accountand 11 tests in one full run.engine/CLAUDE.md,docs/api-contract.md,engine/.env.example.Tests (local)
bun run typecheck: passes.bun run test:unit: 178/178.bun run testwith the FastNear default: 317/318.send_payment. Workflows don't have it, so it gotToolNotFoundError, with no card and nothing paid.main's playbook.test/skills-crosschain.test.ts(14-skill Payments Mind, fake 1Click): 9/9 in 3 runs. It covers Base USDC (signed, so the reply must say signed), Solana USDT (unsigned, never called verified), and a NEAR payment still going tosend_paymentwith its card.load/chat.js2 VUs 20 s, 20/20 checks;load/workflow.js20 s, 15462/15462 checks.For @AncungAulia
tool.resultofcrosschain_quote, showfrom.amount from.token→to.amount to.tokenonto.chain, thencost,seconds, and "Preview only, nothing sent". Add a "Signed by NEAR Intents" line that opensproof.quoteHash,proof.publicKeyandproof.signature, copied straight from the result. No pay button.runs/data/tools.ts:crosschain_quote: { doing: "Getting a cross-chain quote", done: "Got a cross-chain quote", orb: "searching", node: "Cross-chain quote" }.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q5ZrzK8une3S2YyhDG746e