jb-terminal-selection
Dynamic terminal selection for Juicebox V5 payments. Use when: (1) building payment UIs that support\nmultiple tokens (ETH/USDC), (2) encountering JBMultiTerminal_TokenNotAccepted error, (3) paying a\nproject that uses ETH-only accounting with non-ETH tokens, (4) implementing
Installation
Pick a client and clone the repository into its skills directory.
Installation
About this skill
Dynamic terminal selection for Juicebox V5 payments. Use when: (1) building payment UIs that support\nmultiple tokens (ETH/USDC), (2) encountering JBMultiTerminal_TokenNotAccepted error, (3) paying a\nproject that uses ETH-only accounting with non-ETH tokens, (4) implementing cross-token payments\nwhere the project may not directly accept the user's payment token. Covers JBDirectory.primaryTerminalOf()\nquerying, JBSwapTerminal fallback logic, and permit2 integration with correct terminal addresses.
How to use
- Zainstaluj skill jb-terminal-selection w swoim projekcie Juicebox V5, dodając go do konfiguracji agenta lub MCP servera.
- Przed wysłaniem płatności, wywołaj JBDirectory.primaryTerminalOf(projectId, tokenAddress) aby sprawdzić, czy projekt akceptuje wybrany token.
- Jeśli funkcja zwróci adres terminala, użyj go jako celu dla transakcji płatności z permit2.
- Jeśli zwróci adres zerowy (token nie jest akceptowany), automatycznie kieruj płatność do JBSwapTerminal, który wymieni token na ten, który projekt obsługuje.
- Upewnij się, że adres JBSwapTerminal jest poprawny dla Twojego łańcucha (adresy są identyczne na wszystkich sieciach dzięki CREATE2).
- Testuj przepływ w symulatorze transakcji (np. Tenderly) aby potwierdzić, że błąd TokenNotAccepted znika i transakcja przechodzi.