Skip to content

Conversation

@0xRAG
Copy link
Contributor

@0xRAG 0xRAG commented Feb 20, 2025

What changed?

  • Documentation
  • Bug fix
  • New Action
  • New Action Provider
  • Other

Why was this change implemented?

A lot of the action providers have a naive filter for network:

  supportsNetwork = () => true;

This breaks down now that we have support for Solana.

This PR:

  • updates all action providers to filter properly.
  • adds a warning when using unsupported actions

Checklist

  • Changelog updated
  • Commits are signed. See instructions
  • Doc strings
  • Readme updates
  • Rebased against master
  • Relevant exports added

How has it been tested?

  • Agent tested
  • Unit tests

Tested with agent by adding these lines to the privy chatbot:

    const actions = agentkit.getActions();
    console.log(actions.map(action => action.name));

Before:

[
  'PythActionProvider_fetch_price_feed',
  'PythActionProvider_fetch_price',
  'WalletActionProvider_get_wallet_details',
  'WalletActionProvider_native_transfer',
  'ERC20ActionProvider_get_balance',
  'ERC20ActionProvider_transfer',
  'CdpApiActionProvider_address_reputation',
  'CdpApiActionProvider_request_faucet_funds',
  'SplActionProvider_get_balance',
  'SplActionProvider_transfer'
]

After:

[
  'WalletActionProvider_get_wallet_details',
  'WalletActionProvider_native_transfer',
  'CdpApiActionProvider_address_reputation',
  'CdpApiActionProvider_request_faucet_funds',
  'SplActionProvider_get_balance',
  'SplActionProvider_transfer'
]

Example of warning:
Setup: Solana Chatbot, importing weth and erc20 action providers:

Starting Agent...
Warning: The following action providers are not supported on the current network and will be unavailable: weth, erc20
Current network: {
  protocolFamily: 'svm',
  chainId: '5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d',
  networkId: 'solana-mainnet'
}

@0xRAG 0xRAG requested a review from murrlincoln as a code owner February 20, 2025 00:09
@cb-heimdall
Copy link

cb-heimdall commented Feb 20, 2025

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

* @returns True if the Pyth action provider supports the network, false otherwise.
*/
supportsNetwork = () => true;
supportsNetwork = (network: Network) => network.protocolFamily === "evm";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pyth is not EVM specific

supportsNetwork(): boolean {
return true;
supportsNetwork(network: Network): boolean {
return network.protocolFamily === "evm";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe alchemy price data works with Solana as well? Please confirm

@0xRAG 0xRAG force-pushed the AGENT-202 branch 2 times, most recently from 8302e64 to beedb2f Compare February 20, 2025 13:11
@0xRAG 0xRAG merged commit 579d023 into main Feb 20, 2025
13 checks passed
@0xRAG 0xRAG deleted the AGENT-202 branch February 20, 2025 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants