Repository navigation
feat: add optional Edge Signals Token Verdict action provider - #1666
Open
konstantinbozukov wants to merge 1 commit into
Open
konstantinbozukov wants to merge 1 commit into
konstantinbozukov wants to merge 1 commit into
Conversation
Adds an opt-in action provider that fetches a Token Verdict for an ERC-20 before a swap or other interaction. Each call costs $0.01 USDC on Base via x402, paid from the agent's wallet. Existing actions and default provider lists are unchanged.
🟡 Heimdall Review Status
|
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR adds an optional Edge Signals action provider with a single action,
get_token_verdict.Token Verdict is a pre-trade token risk check for ERC-20s. The agent calls it before swapping, transferring, or otherwise interacting with an unknown token, and gets back a letter grade (A–F), a band (
SAFE|CAUTION|AVOID), a score from 0–100, and human-readable reasons.Disclosure: I built Edge Signals / Token Verdict (Konstantin Bozukov). This provider is opt-in: it is not added to any default AgentKit instance or example chatbot. Existing actions, prices, and provider lists are unchanged. Each call is paid — $0.01 USDC on Base via x402, charged to the agent's wallet. There is no API key. The result is not financial advice.
Payment uses the same
@x402/fetch/@x402/evmpath as the existing x402 action provider, signed with the agent'sEvmWalletProvider. The action is only offered when the wallet is on Base mainnet (supportsNetwork).Docs:
typescript/agentkit/src/action-providers/edgesignals/README.mdA Python port is not included, to keep this change small. Happy to add one in a follow-up if useful.
Commit signing: I was not able to sign this commit from this environment (no signing key is attached to the GitHub account used to open the PR). I can re-sign if that is required before merge.
Tests
Unit tests for the new provider (10 tests) cover
supportsNetwork(Base mainnet only), a successful paid fetch via mockedwrapFetchWithPayment, URL construction, HTTP errors, JSON parse errors, and network failures:pnpm exec eslinton the new files andpnpm run check(tsc --noEmit) both pass.I did not run a live chatbot against Base mainnet in this PR, because that would spend real USDC. The unit tests mock the x402 payment wrapper and assert the Token Verdict URL, method, and formatted output. I can follow up with a recorded chatbot transcript if a reviewer wants one:
Checklist
A couple of things to include in your PR for completeness: