Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add sequance for ethereum service #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rickliujh
Copy link
Member

@rickliujh rickliujh commented Dec 10, 2023

ETHEREUM WATCHER API SPEC

[POST] /ews/v1/gas-report

request body:

{
    "target": {
        "type": "market-transactions", // type of the target
        "address": "0xdsfjl3j3214jljfdklj1lkjkl24", // collection address
        "tokenId": "1234", // tokenId for the specific collection address (aka collection/contract address)
        "markets": ["seaport"], // reports from which markets should be included
        "network": "mainnet" // ethereum network
    },
    "args": {
        "pushNotification": true, // specify whether push notification is needed
        "timeout": 60 // in seconds, this field is mendatory when pushNotification is set to true
    }
}

response:

{
    "id": "ea79904d-11ac-499e-9d28-71aac784c5ee",
    "target": {
        "type": "market-transactions", // type of the target
        "address": "0xdsfjl3j3214jljfdklj1lkjkl24", // collection address
        "tokenId": "1234", // tokenId for the specific collection address (aka collection/contract address)
        "markets": ["seaport"], // reports from which markets should be included
        "network": "mainnet" // ethereum network
    },
    "gasReport": {
        "timestamp": 1702230377, // timestamp of transaction of present gas fee report
        "gasLimit": "123", // bigint, could be null
        "gasPrice": "123", // bigint, could be null
        "maxPriorityFeePerGas": "123", // bigint required 
        "maxFeePerGas": "123", // bigint, required 
        "baseFee": "123", // bigint, required
    },
    "pushNotification": true // should be true if requested
}

[DELETE] /ews/v1/gas-report/{id}

request body:

NAN

response:

A successful response MUST be 200 (OK) if the server response includes a message body,
202 (Accepted) if the DELETE action has not yet been performed, or 204 (No content) if the DELETE action has been completed but the response does not have a message body

[WS]

event body:

{
    "id": "ea79904d-11ac-499e-9d28-71aac784c5ee",
    "eventId": "45b6712e-01ef-4781-a0e1-49109ba32363",
    "target": {
        "type": "market-transactions", // type of the target
        "address": "0xdsfjl3j3214jljfdklj1lkjkl24", // collection address
        "tokenId": "1234", // tokenId for the specific collection address (aka collection/contract address)
        "markets": ["seaport"], // reports from which markets should be included
        "network": "mainnet" // ethereum network
    },
    "gasReport": {
        "timestamp": 1702230377,
        "gasLimit": "123", // bigint, could be null
        "gasPrice": "123", // bigint, could be null
        "maxPriorityFeePerGas": "123", // bigint required 
        "maxFeePerGas": "123", // bigint, required 
        "baseFee": "123", // bigint, required
    },
    "pushNotification": true // should be true if requested
}

@rickliujh rickliujh requested a review from nnmax December 10, 2023 15:16
@rickliujh
Copy link
Member Author

image

@rickliujh rickliujh self-assigned this Dec 10, 2023
@rickliujh
Copy link
Member Author

@nnmax target field in request and response has been updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants