Giter Site home page Giter Site logo

contractwatch's Introduction

๐Ÿ“œ ContractWatch

ContractWatch is a powerful tool that simplifies monitoring and tracking events emitted by Ethereum smart contracts. ๐Ÿ” With ContractWatch, you can effortlessly retrieve contract events, apply filters based on various criteria, and seamlessly integrate them into your applications. ๐Ÿš€

Note

๐Ÿ“Œ Currently, only Scroll Sepolia is supported.

๐ŸŒŸ Features

  • ๐Ÿ—๏ธ Manage applications associated with specific smart contracts
  • ๐Ÿ” Filter events by block range, event name, transaction hash, and more.
  • ๐Ÿ“ Pagination support for efficient event retrieval
  • ๐Ÿ”’ Secure authentication using wallet signatures
  • ๐Ÿ”‘ API key management for secure access to event data
  • ๐Ÿ’ฐ ERC20 token for API usage and credit management
  • ๐Ÿ›’ Subscription contract for purchasing ERC20 tokens and API credits

๐Ÿ’ฐ ERC20 Token and Subscription Contract

ContractWatch utilizes an ERC20 token and a subscription contract to manage API access and usage. The ERC20 token serves as a means of payment for accessing the ContractWatch API, while the subscription contract allows users to purchase the ERC20 token and buy API credits.

To gain access to the ContractWatch API, users need to:

  1. ๐Ÿ›’ Interact with the subscription contract to purchase the ERC20 token.
  2. ๐Ÿ’ธ Use the ERC20 token to buy API credits through the subscription contract.
  3. ๐Ÿ”‘ Utilize the purchased API credits to make requests to the ContractWatch API endpoints.

The subscription contract provides a seamless and secure way for users to acquire the necessary ERC20 tokens and API credits.

๐Ÿ”— Deployed Contracts

Below are the links to the deployed ERC20 token and subscription contract:

Please refer to these contracts for purchasing ERC20 tokens and API credits.

๐Ÿš€ Getting Started

To get started with ContractWatch, follow these steps:

  1. ๐Ÿ’ณ Interact with the subscription contract to purchase ERC20 tokens and API credits.
  2. ๐Ÿ” Authenticate your requests by including the required wallet signature in the header.
  3. ๐Ÿ—๏ธ Create an application by providing the contract address and other relevant details.
  4. ๐Ÿ“ฅ Retrieve contract events using the provided API endpoints and filters.
  5. ๐Ÿ”ง Integrate the retrieved event data into your application.

For detailed information on interacting with the subscription contract and using the API endpoints, please refer to the API documentation. ๐Ÿ“š

๐ŸŒ API Endpoints

  • POST /api/applications: Create a new application associated with a smart contract.
  • GET /api/applications: Retrieve a list of your applications.
  • GET /api/applications/:id: Retrieve details of a specific application.
  • DELETE /api/applications/:id: Delete an application.
  • GET /api/accounts/api-keys: Retrieve a list of your API keys.
  • POST /api/accounts/api-keys: Create a new API key.
  • DELETE /api/accounts/api-keys/:id: Delete an API key.
  • GET /api/events: Retrieve contract events based on specified filters.

๐Ÿ”’ Authentication

ContractWatch provides two authentication methods:

  1. ๐Ÿ” Wallet Signature: Sign a predefined message using your Ethereum wallet and include the signature in the X-Wallet-Signature header.
  2. ๐Ÿ”‘ API Key: Include your API key in the X-API-Key header when making requests to the /api/events endpoint.

Ensure that you keep your wallet and API keys secure. ๐Ÿ™Š

๐Ÿ” Generating Wallet Signatures

To generate a wallet signature for authentication, follow these steps:

  1. ๐Ÿ“ Use the following predefined message to sign:
    'By signing this message, I confirm my intention to use ContractWatch and agree to the associated terms and conditions.'
    
  2. ๐Ÿ”‘ Use your Ethereum wallet (e.g., MetaMask) to sign the predefined message.
  3. ๐Ÿ“‹ Copy the generated signature.
  4. ๐Ÿ“ฅ Include the signature in the X-Wallet-Signature header when making requests to the ContractWatch API.

Here's a code snippet to generate the wallet signature in TypeScript using the ethers library:

import { ethers } from 'ethers';

const message = 'By signing this message, I confirm my intention to use ContractWatch and agree to the associated terms and conditions.';
const signer = new ethers.Wallet(privateKey);
const signature = await signer.signMessage(message);

And here's a code snippet to generate the wallet signature in Python using the web3 library:

from web3.auto import w3

message = 'By signing this message, I confirm my intention to use ContractWatch and agree to the associated terms and conditions.'
signed_message = w3.eth.account.sign_message(message, private_key=private_key)
signature = signed_message.signature.hex()

๐Ÿ†˜ Support

If you encounter any issues or have questions about ContractWatch, please open an issue here on GitHub. ๐Ÿ›

Happy contract watching! ๐ŸŽ‰

contractwatch's People

Contributors

prettyirrelevant avatar tee-py avatar

Stargazers

Samuel Tosin avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.