Skip to content

Commit 9a096ec

Browse files
authored
feat: Add support for Robinhood chain (#8)
1 parent ba5e8b3 commit 9a096ec

3 files changed

Lines changed: 31 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ curl -fsSL https://raw.githubusercontent.com/0xProject/0x-cli/main/scripts/insta
2525
## Features
2626

2727
- **4 APIs**: EVM Swap (Allowance Holder), Gasless Swap, Solana Swap, Cross-Chain
28-
- **21 chains**: Ethereum, Base, Arbitrum, Optimism, Polygon, BSC, Avalanche, Linea, Scroll, Blast, Mantle, Berachain, Sonic, Unichain, World Chain, Abstract, Ink, Monad, HyperEVM, Solana, Tron
28+
- **22 chains**: Ethereum, Base, Arbitrum, Optimism, Polygon, BSC, Avalanche, Linea, Scroll, Blast, Mantle, Berachain, Sonic, Unichain, World Chain, Abstract, Ink, Monad, HyperEVM, Robinhood Chain, Solana, Tron
2929
- **Agent-first**: Auto-detect non-TTY for JSON output, structured error codes, stable exit codes, inline `RESPONSE:` schemas in every `--help`
3030
- **Pay-per-request (no API key)**: `--pay x402-evm` or `--pay mpp` settles ~$0.01 USDC per request via the 0x agent gateway — for autonomous agents with a funded wallet
3131
- **Safe by default**: OS keyring for wallet secrets, transaction simulation before every execution, `--dry-run` mode, exact token approvals
@@ -485,6 +485,7 @@ Every interactive prompt has a flag equivalent:
485485
| 480 | worldchain | World Chain | ETH |
486486
| 999 | hyperevm | HyperEVM | HYPE |
487487
| 2741 | abstract | Abstract | ETH |
488+
| 4663 | robinhood | Robinhood Chain | ETH |
488489
| 5000 | mantle | Mantle | MNT |
489490
| 8453 | base | Base | ETH |
490491
| 42161 | arbitrum | Arbitrum | ETH |

skills/0x-trade/references/tokens.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Run `0x chains -o json-envelope` for the live list (with explorer URLs and chain
1414
| 480 | worldchain | World Chain | ETH |
1515
| 999 | hyperevm | HyperEVM | HYPE |
1616
| 2741 | abstract | Abstract | ETH |
17+
| 4663 | robinhood | Robinhood Chain | ETH |
1718
| 5000 | mantle | Mantle | MNT |
1819
| 8453 | base | Base | ETH |
1920
| 42161 | arbitrum | Arbitrum | ETH |

src/chain/mod.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,19 @@ const CHAINS: &[ChainInfo] = &[
315315
chain_type: ChainType::Evm,
316316
default_rpc_url: Some("https://rpc.hyperliquid.xyz/evm"),
317317
},
318+
ChainInfo {
319+
id: ChainId::Numeric(4663),
320+
name: "robinhood",
321+
display_name: "Robinhood Chain",
322+
native_token: "ETH",
323+
explorer_url: "https://robinhoodchain.blockscout.com",
324+
chain_type: ChainType::Evm,
325+
// Public endpoint documented by Robinhood; rate-limited (they steer
326+
// production traffic to Alchemy et al.), which matches how the other
327+
// built-in defaults here are "good enough to try, configure your own
328+
// for real volume".
329+
default_rpc_url: Some("https://rpc.mainnet.chain.robinhood.com"),
330+
},
318331
ChainInfo {
319332
id: ChainId::Solana,
320333
name: "solana",
@@ -502,6 +515,21 @@ mod tests {
502515
assert_eq!(chain.name, "base");
503516
}
504517

518+
#[test]
519+
fn test_resolve_robinhood() {
520+
let by_name = resolve_chain("robinhood").unwrap();
521+
assert!(by_name.is_evm());
522+
assert_eq!(by_name.numeric_id(), Some(4663));
523+
assert_eq!(by_name.api_chain_id(), "4663");
524+
// Blockscout explorer uses the standard /tx/ path.
525+
assert_eq!(
526+
by_name.explorer_tx_url("0xabc"),
527+
"https://robinhoodchain.blockscout.com/tx/0xabc"
528+
);
529+
// Resolvable by numeric ID too.
530+
assert_eq!(resolve_chain("4663").unwrap().name, "robinhood");
531+
}
532+
505533
#[test]
506534
fn test_resolve_solana() {
507535
let chain = resolve_chain("solana").unwrap();

0 commit comments

Comments
 (0)