Skip to content
Merged
Show file tree
Hide file tree
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 Dec 26, 2025
122fb68
fix: add NEAR to getNativeFeeAssetReference
gomesalexandre Dec 26, 2025
3109d87
fix: use descriptive error from NEAR RPC response
gomesalexandre Dec 26, 2025
8b14ebe
docs: add getNativeFeeAssetReference gotcha to chain-integration skill
gomesalexandre Dec 26, 2025
d99ec67
fix: implement NEAR case in accountToPortfolio
gomesalexandre Dec 26, 2025
1139831
docs: add accountToPortfolio gotcha to chain-integration skill
gomesalexandre Dec 26, 2025
b6b47e6
feat: add NEAR support to NEAR Intents swapper
gomesalexandre Dec 26, 2025
68c6e58
fix: use plain bs58 encoding for NEAR public keys
gomesalexandre Dec 26, 2025
1e38261
feat: add NEAR chain namespace support for fee data
gomesalexandre Dec 26, 2025
d91e0d9
fix: read fresh swap state in trade execution event handlers
gomesalexandre Dec 26, 2025
0e57d39
[skip ci] feat: skip ci
gomesalexandre Dec 27, 2025
b2aeea6
[skip ci] feat: progression
gomesalexandre Dec 27, 2025
3e504fa
feat: implement swaps FROM NEAR and token balance fetching
gomesalexandre Dec 27, 2025
6bac80b
feat: add Ledger and Trezor NEAR hardware wallet support
gomesalexandre Dec 27, 2025
22df129
docs: add Native Agent to crew structure
gomesalexandre Dec 27, 2025
915e346
feat: add chain-integration-crew skill for full e2e chain integration
gomesalexandre Dec 27, 2025
7443140
feat: add NEP-141 token sends and RPC failover for NEAR
gomesalexandre Dec 27, 2025
1e2d93c
feat: add Ledger NEAR transport support and swapper token fix
gomesalexandre Dec 27, 2025
eb54f2c
fix: handle NEAR implicit accounts that don't exist on-chain
gomesalexandre Dec 27, 2025
ff87f4c
fix: dedupe assetIds in popular assets
gomesalexandre Dec 27, 2025
d684b7a
[skip ci] fix: replace NearBlocks with FastNEAR API for token balances
gomesalexandre Dec 27, 2025
689806c
Merge remote-tracking branch 'origin/develop' into near_chain
gomesalexandre Dec 27, 2025
901b462
[skip ci] refactor: NEAR chain adapter improvements
gomesalexandre Dec 27, 2025
8870d6c
[skip ci] chore: remove NEAR planning docs
gomesalexandre Dec 27, 2025
479bfbc
[skip ci] chore: bump @shapeshiftoss/hdwallet-* to 1.62.33
gomesalexandre Dec 27, 2025
70e7e15
[skip ci] chore: revert .yarnrc.yml to origin/develop
gomesalexandre Dec 27, 2025
a86b599
fix: derivation path and update hdwallet
NeOMakinG Dec 30, 2025
cde32b3
fix(caip): load dotenv in coincap adapter generation script
gomesalexandre Jan 3, 2026
c21c75a
fix(near): add rate limit retry with exponential backoff
gomesalexandre Jan 3, 2026
fcae5ba
fix(near): reduce individual provider retries to enable faster failover
gomesalexandre Jan 3, 2026
c8deab3
fix: address NEAR chain review feedback
gomesalexandre Jan 3, 2026
eb421c0
fix: use skipDeviceDerivation pattern for NEAR pubKey handling
gomesalexandre Jan 3, 2026
f9d359d
fix: surgically restore NEAR changes without lint noise
gomesalexandre Jan 3, 2026
62621c0
fix: move FastNEAR API version path from env to code for CSP compliance
gomesalexandre Jan 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
196 changes: 196 additions & 0 deletions .claude/skills/chain-integration-crew/skill.md
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 │
└─────────────────────────────────────────────────────────────────┘
```

## 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]
```
Loading