Skip to content

feat(core): add AGW v5 SDK support - #291

Open
mohammeds1992 wants to merge 27 commits into
mainfrom
feat/agw-sdk-v5
Open

mohammeds1992 wants to merge 27 commits into
mainfrom
feat/agw-sdk-v5

Conversation

@mohammeds1992

Copy link
Copy Markdown
Contributor

Summary

Adds client.agentic so owners can create and label an agentic wallet, grant/update/revoke rules, and connect an owner or agent signer to send from that wallet. Targets the deployed Donut v5 suite, with native Push execution, EVM destinations, named-IDL Solana instructions and owner funds-only SOL/SPL transfers.

  • Organizes bindings, codecs, management, reads, execution and response/tracking under packages/core/src/lib/agentic/.
  • Preserves atomic rule replacement, independent token budgets, sender identity and decoded contract errors. Enables stored labels with owner rename/reset and the 64-byte UTF-8 cap.
  • Adds unit tests, an isolated real-contract harness, durable ABI snapshots, validation scripts and 58 opt-in AGW E2E scenarios. Updates CI to the v5 contract source.
  • Adds READ.CHAIN.WEB2 with web2; legacy web2:https input remains accepted.

Consumer guide: packages/core/AGW.md.

Validation

  • The source tree passed 2,014 core unit tests and 90 local actual-contract tests; 12 unit tests are skipped.
  • 20 selected live E2E scenarios passed across separate Donut/Sepolia/Solana-devnet runs, covering labels, independent token budgets, destination delivery, SOL/SPL transfers and replay. This is not a full 58-case run.
  • The isolated branch without AGW planning files passed agw-verify.js: focused units, real contracts, library/spec/local typechecks, build, guide examples, package imports/declarations and API comparison.
  • Scenario registration passes; default all remains 76 scenarios and excludes funded AGW groups. No funded E2Es were rerun to create this PR.

Review notes

No plan/ changes are included. The planning/evidence bundle remains in #290; that PR is unchanged.

Fresh Sepolia CEA finalization exceeded the current upstream 500,000-gas default. Positive tests/examples use an explicit 2,000,000 destination-gas budget; the SDK does not silently change the default. Refund spend-credit wiring remains a downstream executor dependency. Existing v4 wallets are unsupported by this v5-only adapter.

mohammeds1992 and others added 27 commits October 7, 2026 20:31
Add wallet creation, labels and rules management, owner and agent execution, and EVM/Solana destination composition and tracking. Include independent token budgets, SPL source-mint resolution, raw-offset rule support and the READ.CHAIN.WEB2 alias.

Keep runtime bindings, consumer documentation, ABI snapshots, local-contract tests, opt-in funded E2Es and validation scripts together. Align CI with the deployed v5 source. Exclude all planning-folder changes.
Sync non-plan source through v4 aed6799, including AGW error improvements and marketplace SDK work. Preserve v5 release version, changelog, lockfile and existing plan tree.
- Resolve the node-registered Circle USDC routes (Sepolia, Base, Arbitrum
  Sepolia) by exact address for agentic wallets; DEXES Sepolia and LENDING
  Arbitrum Sepolia presets become route-ready.
- AGW gas budget never attaches less than the Push pool cost plus 20%, keeps
  the over-$10 share and excludes protocolFee; BNB testnet gas is valued at
  the pool rate because no BNB/USD feed exists.
- Agent EVM sends default to 1,000,000 gas for token exports or multi-call
  payloads (the 500,000 base ran out on a Sepolia swap); omitted Solana gas
  uses route and finalize sizing.
- Refuse an explicit gasLimit below the chain base, a Solana budget still
  short after one re-quote, and a zero Solana maxGasPerCall.
- Correct the Base Sepolia WETH address.
- Add opt-in live groups (unchanged and routed presets, gas, agent SPL,
  exact routes, Solana Memo) and read-only compatibility, gas-quote and
  route-registry drift scripts.
Act on the product, preset and contract answers (Harsh, Aman, Zaryab):

- Presets contain only what works: Uniswap V3 and Aave V3 on Sepolia,
  Base Sepolia and Arbitrum Sepolia. Each sends native ETH from Push and
  wraps it on arrival; DEX swaps WETH and Circle USDC on the destination
  only. get() returns { rules }: readiness and the network option are
  removed, PREDICTION and the mainnet templates are dropped, and supplied
  assets must be one ETH asset per chain with positive limits.
- Tokens-only EVM rules: ERC20 assets without allowedCalls become
  transfer calls pinned to the owner's EVM address, plus opt-in transferTo
  recipients. Native assets and Solana are refused.
- MOVEABLE.TOKEN.<CHAIN>.ALL expands to every routable token with default
  limits; utils.agentic.assets.all(chain) exposes the list. create, add
  and update take the new AuthoredRule input type; Rule is unchanged.
- Report the eight-function Push-chain limit before the generic 1..32.
- Refuse Solana fromEnd data pins on write until the policy fix.
- Decode InnerValueExceedsAllowance and BeneficiaryMismatch, which URP
  encodes by selector and its compiled ABI omits.

Tests: rewritten preset unit, local v6 and live acceptance specs (the
DEX case picks the fee tier with QuoterV2); new tokens-only/ALL unit and
live specs; the old prefunded preset fixtures are removed. All six
presets and both tokens-only/ALL cases pass live on Donut.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant