-
Notifications
You must be signed in to change notification settings - Fork 198
feat: near chain #11537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+17,315
−13,415
Merged
feat: near chain #11537
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
164df37
feat: implement NEAR Protocol as second-class citizen chain
gomesalexandre 122fb68
fix: add NEAR to getNativeFeeAssetReference
gomesalexandre 3109d87
fix: use descriptive error from NEAR RPC response
gomesalexandre 8b14ebe
docs: add getNativeFeeAssetReference gotcha to chain-integration skill
gomesalexandre d99ec67
fix: implement NEAR case in accountToPortfolio
gomesalexandre 1139831
docs: add accountToPortfolio gotcha to chain-integration skill
gomesalexandre b6b47e6
feat: add NEAR support to NEAR Intents swapper
gomesalexandre 68c6e58
fix: use plain bs58 encoding for NEAR public keys
gomesalexandre 1e38261
feat: add NEAR chain namespace support for fee data
gomesalexandre d91e0d9
fix: read fresh swap state in trade execution event handlers
gomesalexandre 0e57d39
[skip ci] feat: skip ci
gomesalexandre b2aeea6
[skip ci] feat: progression
gomesalexandre 3e504fa
feat: implement swaps FROM NEAR and token balance fetching
gomesalexandre 6bac80b
feat: add Ledger and Trezor NEAR hardware wallet support
gomesalexandre 22df129
docs: add Native Agent to crew structure
gomesalexandre 915e346
feat: add chain-integration-crew skill for full e2e chain integration
gomesalexandre 7443140
feat: add NEP-141 token sends and RPC failover for NEAR
gomesalexandre 1e2d93c
feat: add Ledger NEAR transport support and swapper token fix
gomesalexandre eb54f2c
fix: handle NEAR implicit accounts that don't exist on-chain
gomesalexandre ff87f4c
fix: dedupe assetIds in popular assets
gomesalexandre d684b7a
[skip ci] fix: replace NearBlocks with FastNEAR API for token balances
gomesalexandre 689806c
Merge remote-tracking branch 'origin/develop' into near_chain
gomesalexandre 901b462
[skip ci] refactor: NEAR chain adapter improvements
gomesalexandre 8870d6c
[skip ci] chore: remove NEAR planning docs
gomesalexandre 479bfbc
[skip ci] chore: bump @shapeshiftoss/hdwallet-* to 1.62.33
gomesalexandre 70e7e15
[skip ci] chore: revert .yarnrc.yml to origin/develop
gomesalexandre a86b599
fix: derivation path and update hdwallet
NeOMakinG cde32b3
fix(caip): load dotenv in coincap adapter generation script
gomesalexandre c21c75a
fix(near): add rate limit retry with exponential backoff
gomesalexandre fcae5ba
fix(near): reduce individual provider retries to enable faster failover
gomesalexandre c8deab3
fix: address NEAR chain review feedback
gomesalexandre eb421c0
fix: use skipDeviceDerivation pattern for NEAR pubKey handling
gomesalexandre f9d359d
fix: surgically restore NEAR changes without lint noise
gomesalexandre 62621c0
fix: move FastNEAR API version path from env to code for CSP compliance
gomesalexandre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,196 @@ | ||
| # Chain Integration Full YOLO E2E Crew | ||
|
|
||
| This skill orchestrates a complete end-to-end blockchain integration using a "crew" model with specialized agents working in parallel. | ||
|
|
||
| ## When to Use This Skill | ||
|
|
||
| When a user says they want to integrate a new chain (e.g., "I want to integrate X chain"), ask them: | ||
|
|
||
| > Would you like to use: | ||
| > 1. **Regular chain-integration skill** - Step-by-step guided integration | ||
| > 2. **Chain Integration Crew (Full YOLO E2E)** - Spawns a crew of specialized agents for complete integration including native wallet, Ledger, Trezor, and swapper support | ||
|
|
||
| ## Crew Structure | ||
|
|
||
| The crew operates with the following agent hierarchy: | ||
|
|
||
| ### Master Agent (Chief) | ||
| - Coordinates all work across the crew | ||
| - Writes master documentation (`{CHAIN}_CHAIN_INTEGRATION_MASTER.md`) | ||
| - Performs final sanity checks | ||
| - Runs verdaccio publish pipeline for hdwallet changes | ||
| - Handles final lint, type-check, test, commit, push | ||
|
|
||
| ### Research Agent (Phase 1 - Always First) | ||
| Before any implementation begins, spawn a research agent to: | ||
| - Investigate the chain's specifications (SLIP-44 coin type, derivation path, address format) | ||
| - Check Ledger support (`@ledgerhq/hw-app-{chain}` or similar) | ||
| - Check Trezor support (`@trezor/connect` methods) | ||
| - Check existing swapper support (DEX aggregators, bridges) | ||
| - Review chain documentation and specs | ||
| - Identify any gotchas or special requirements | ||
|
|
||
| ### Native Agent | ||
| - Implements base chain support in `hdwallet-native` | ||
| - Key derivation (BIP44/SLIP-0010) | ||
| - Address generation | ||
| - Transaction signing | ||
| - This is the foundation - must be tested before Ledger/Trezor | ||
|
|
||
| ### Ledger Agent (if supported) | ||
| - Implements chain support in `hdwallet-ledger` | ||
| - Adds hw-app dependency if needed | ||
| - Updates transport.ts, ledger.ts, utils.ts | ||
| - Updates web-side Ledger integration (ledgerAppGate, constants) | ||
|
|
||
| ### Trezor Agent (if supported) | ||
| - Implements chain support in `hdwallet-trezor` | ||
| - Updates trezor.ts with wallet interfaces | ||
| - Web-side integration is usually automatic via `_supports{Chain}` check | ||
|
|
||
| ### Chain Integration Agent | ||
| - Leverages the existing `chain-integration` skill | ||
| - Handles ChainAdapter, CAIP constants, feature flags | ||
| - Web-side chain support (portfolio, send, receive) | ||
|
|
||
| ### Swapper Agent (if applicable) | ||
| - Leverages the existing `swapper-integration` skill | ||
| - Implements swapper support for the new chain | ||
| - Quote fetching, transaction building, status tracking | ||
|
|
||
| ## Execution Flow | ||
|
|
||
| ``` | ||
| ┌─────────────────────────────────────────────────────────────────┐ | ||
| │ PHASE 1: RESEARCH │ | ||
| │ Research Agent explores specs, docs, hw support │ | ||
| └─────────────────────────────────────────────────────────────────┘ | ||
| ↓ | ||
| ┌─────────────────────────────────────────────────────────────────┐ | ||
| │ PHASE 2: HDWALLET │ | ||
| │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ | ||
| │ │ Native │ │ Ledger │ │ Trezor │ (parallel) │ | ||
| │ │ Agent │ │ Agent │ │ Agent │ │ | ||
| │ └─────────────┘ └─────────────┘ └─────────────┘ │ | ||
| └─────────────────────────────────────────────────────────────────┘ | ||
| ↓ | ||
| ┌─────────────────────────────────────────────────────────────────┐ | ||
| │ PHASE 3: VERDACCIO │ | ||
| │ Master Agent runs hdwallet-verdaccio-local-publish-pipeline │ | ||
| └─────────────────────────────────────────────────────────────────┘ | ||
| ↓ | ||
| ┌─────────────────────────────────────────────────────────────────┐ | ||
| │ PHASE 4: WEB INTEGRATION │ | ||
| │ ┌──────────────────┐ ┌──────────────────┐ │ | ||
| │ │ Chain Integration│ │ Swapper Integration│ (parallel) │ | ||
| │ │ Agent │ │ Agent │ │ | ||
| │ └──────────────────┘ └──────────────────┘ │ | ||
| └─────────────────────────────────────────────────────────────────┘ | ||
| ↓ | ||
| ┌─────────────────────────────────────────────────────────────────┐ | ||
| │ PHASE 5: FINALIZATION │ | ||
| │ Master Agent: sanity check, lint, type-check, test, commit │ | ||
| └─────────────────────────────────────────────────────────────────┘ | ||
| ``` | ||
gomesalexandre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Master Documentation Template | ||
|
|
||
| Create `{CHAIN}_CHAIN_INTEGRATION_MASTER.md` in the web repo root with: | ||
|
|
||
| ```markdown | ||
| # {CHAIN} Chain Integration - Master Documentation | ||
|
|
||
| ## Crew Overview | ||
| [Document the crew structure and who did what] | ||
|
|
||
| ### Crew Structure | ||
| - **Master Agent (Chief)**: Coordinates all work, writes master documentation | ||
| - **Research Agent**: Initial research phase, specs, hw support investigation | ||
| - **Native Agent**: Base hdwallet-native implementation | ||
| - **Ledger Agent**: Ledger hardware wallet support (if applicable) | ||
| - **Trezor Agent**: Trezor hardware wallet support (if applicable) | ||
| - **Chain Integration Agent**: Web-side chain adapter and integration | ||
| - **Swapper Agent**: Swapper/DEX support (if applicable) | ||
|
|
||
| ## Implementation Summary | ||
| [Technical details of what was implemented] | ||
|
|
||
| ## Chain Specifications | ||
| - Chain Namespace: | ||
| - Chain Reference: | ||
| - Chain ID: | ||
| - SLIP-44 Coin Type: | ||
| - Derivation Path: | ||
| - Address Format: | ||
|
|
||
| ## Files Modified | ||
| [List all files modified across hdwallet and web repos] | ||
|
|
||
| ## Environment Variables | ||
| [List any new env vars added] | ||
|
|
||
| ## Testing Checklist | ||
| [Checklist for manual testing] | ||
|
|
||
| ## Changelog | ||
| [Session-by-session changelog] | ||
| ``` | ||
|
|
||
| ## Spawning Agents | ||
|
|
||
| Use the Task tool with appropriate subagent_type: | ||
|
|
||
| ``` | ||
| # Research phase | ||
| Task(subagent_type="Explore", prompt="Research {CHAIN} chain specs, Ledger/Trezor support...") | ||
|
|
||
| # Native implementation | ||
| Task(subagent_type="general-purpose", prompt="Implement {CHAIN} support in hdwallet-native...") | ||
|
|
||
| # Ledger implementation (parallel with Trezor) | ||
| Task(subagent_type="general-purpose", prompt="Implement {CHAIN} Ledger support in hdwallet-ledger...") | ||
|
|
||
| # Trezor implementation (parallel with Ledger) | ||
| Task(subagent_type="general-purpose", prompt="Implement {CHAIN} Trezor support in hdwallet-trezor...") | ||
|
|
||
| # Chain integration | ||
| Skill(skill="chain-integration") | ||
|
|
||
| # Swapper integration | ||
| Skill(skill="swapper-integration") | ||
| ``` | ||
|
|
||
| ## Important Notes | ||
|
|
||
| 1. **Research First**: Always run research phase before any implementation | ||
| 2. **Native Before Hardware**: Native wallet must work before Ledger/Trezor | ||
| 3. **Parallel Where Possible**: Ledger and Trezor can run in parallel | ||
| 4. **Verdaccio Required**: hdwallet changes must go through verdaccio pipeline | ||
| 5. **Documentation**: Each agent should contribute to the master doc | ||
| 6. **Sanity Checks**: Master agent validates all work at the end | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - User must have run Claude with `--add-dir` pointing to hdwallet repo | ||
| - Verdaccio must be running on `http://127.0.0.1:4873` | ||
| - Both repos must be on feature branches | ||
|
|
||
| ## Example Usage | ||
|
|
||
| ``` | ||
| User: I want to integrate Monad chain | ||
|
|
||
| Claude: Would you like to use: | ||
| 1. Regular chain-integration skill - Step-by-step guided integration | ||
| 2. Chain Integration Crew (Full YOLO E2E) - Spawns a crew for complete integration | ||
|
|
||
| User: Let's go with the crew! | ||
|
|
||
| Claude: 🚀 Initiating Chain Integration Crew for Monad... | ||
|
|
||
| [Phase 1: Research Agent investigates Monad specs] | ||
| [Phase 2: Native/Ledger/Trezor agents work on hdwallet] | ||
| [Phase 3: Verdaccio publish pipeline] | ||
| [Phase 4: Chain/Swapper integration on web] | ||
| [Phase 5: Final sanity check and commit] | ||
| ``` | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.