eliza icon indicating copy to clipboard operation
eliza copied to clipboard

feat: implement coinbase webhook generation

Open monilpat opened this issue 1 year ago • 0 comments


Relates to:

Implementation of a Coinbase Webhook Plugin for Eliza.


Risks:

  • Low Risk:
    • Potential misconfiguration of the webhook URL.
    • Possible delays in receiving real-time events due to network or service interruptions.
  • Mitigation: Thorough testing using services like [Webhook.site](https://webhook.site) and error-handling mechanisms.

Background:

What does this PR do?

This PR introduces a plugin enabling Eliza to manage Coinbase webhooks. It allows real-time updates and actions based on cryptocurrency transactions, enhancing the system's dynamic capabilities.

What kind of change is this?

  • Feature: Adds new functionality to create, manage, and retrieve Coinbase webhooks for cryptocurrency events.
  • Improvement: Provides support for seamless integration with the Coinbase SDK.

Documentation changes needed?

  • Yes:
    • Update the project documentation to include instructions on configuring and testing the Coinbase Webhook Plugin.
    • Add a section detailing supported event types and example webhook payloads.

Testing:

Where should a reviewer start?

  1. Review the CREATE_WEBHOOK and webhookProvider functionality for accurate event handling and API interactions.
  2. Verify the implementation of error-handling and security measures (e.g., webhook secret validation).

Detailed testing steps:

  1. Testing Webhook Creation:

    • Use a public testing service like [Webhook.site](https://webhook.site) to create a webhook URL.
    • Replace the notificationUri field in the example code with the generated URL.
    • Run the CREATE_WEBHOOK action and validate the response.
  2. Testing Webhook Listing:

    • Trigger the webhookProvider action to fetch and log existing webhooks.
    • Cross-check the response data with Coinbase's CDP portal to ensure consistency.
  3. Error Scenarios:

    • Test webhook creation with invalid inputs (e.g., invalid network ID or event type) and confirm appropriate error responses.
  4. Security Validation:

    • Verify the webhook secret is securely stored and not exposed in logs or public code.

Deploy Notes:

  • Deploy as part of the Eliza core runtime update.
  • Ensure the necessary environment variables (e.g., API keys, webhook secret) are set in production.
  • Include retry logic in case of intermittent service failures during webhook registration.

Database Changes:

  • None: This plugin does not introduce database dependencies.

Deployment Instructions:

  1. Set up the Coinbase API key file in a secure environment.
  2. Configure runtime.character.settings.secrets with the webhook secret.
  3. Verify the webhook functionality using test and production environments.

Discord Username:

0x8664

monilpat avatar Nov 30 '24 19:11 monilpat