-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add blobscan client #31
Comments
Hey @mattsse! Could you give more context about the issue and point out where to add this? Thanks! |
hey @kamuik16 so this should ideally be another client implementation. like there are perhaps some tools that generate rust code for swagger for example https://github.com/OpenAPITools/openapi-generator In my experience, their usefulness is very limited though, but definitely helpful to get all the stubs and json types then do a cleanup pass. |
I think this is the spec '{"openapi":"3.0.3","info":{"title":"Blobscan API","description":"OpenAPI compliant REST API built using tRPC with Express","version":"1.0.0"},"servers":[{"url":"https://api.blobscan.com/api"}],"paths":{"/blocks/{number}":{"get":{"operationId":"block-getByBlockNumber","summary":"Get blocks time series stats","tags":["blocks"],"parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"number"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"blobAsCalldataGasUsed":{"type":"string"},"blobGasUsed":{"type":"string"},"excessBlobGas":{"type":"string"},"blobGasPrice":{"type":"string"},"number":{"type":"number"},"hash":{"type":"string"},"slot":{"type":"number"},"timestamp":{"type":"string","format":"date-time"},"transactions":{"type":"array","items":{"type":"object","properties":{"hash":{"type":"string"},"fromId":{"type":"string"},"toId":{"type":"string"},"blobs":{"type":"array","items":{"type":"object","properties":{"blobHash":{"type":"string"},"index":{"type":"number"},"blob":{"type":"object","properties":{"size":{"type":"number"}},"required":["size"],"additionalProperties":false}},"required":["blobHash","index","blob"],"additionalProperties":false}}},"required":["hash","fromId","toId","blobs"],"additionalProperties":false}}},"required":["blobAsCalldataGasUsed","blobGasUsed","excessBlobGas","blobGasPrice","number","hash","slot","timestamp","transactions"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/error"}}}},"/indexer/slot":{"get":{"operationId":"indexer-getSlot","summary":"Get the latest processed slot from the database","tags":["indexer"],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"slot":{"type":"number"}},"required":["slot"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/error"}}},"put":{"operationId":"indexer-updateSlot","summary":"Update the latest processed slot in the database","tags":["indexer"],"security":[{"Authorization":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slot":{"type":"number"}},"required":["slot"],"additionalProperties":false}}}},"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{}}}},"default":{"$ref":"#/components/responses/error"}}}},"/indexer/block-txs-blobs":{"put":{"operationId":"indexer-indexData","summary":"Index data in the database","tags":["indexer"],"security":[{"Authorization":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"block":{"type":"object","properties":{"number":{"type":"number"},"hash":{"type":"string"},"timestamp":{"type":"number"},"slot":{"type":"number"},"blobGasUsed":{"type":"string"},"excessBlobGas":{"type":"string"}},"required":["number","hash","timestamp","slot","blobGasUsed","excessBlobGas"],"additionalProperties":false},"transactions":{"type":"array","items":{"type":"object","properties":{"hash":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"blockNumber":{"type":"number"},"gasPrice":{"type":"string"},"maxFeePerBlobGas":{"type":"string"}},"required":["hash","from","to","blockNumber","gasPrice","maxFeePerBlobGas"],"additionalProperties":false}},"blobs":{"type":"array","items":{"type":"object","properties":{"versionedHash":{"type":"string"},"commitment":{"type":"string"},"data":{"type":"string"},"txHash":{"type":"string"},"index":{"type":"number"}},"required":["versionedHash","commitment","data","txHash","index"],"additionalProperties":false}}},"required":["block","transactions","blobs"],"additionalProperties":false}}}},"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{}}}},"default":{"$ref":"#/components/responses/error"}}}},"/stats/overall":{"get":{"operationId":"stats-getAllOverallStats","summary":"Get all overall stats","tags":["overall"],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"blob":{"type":"object","properties":{"totalBlobs":{"type":"number"},"totalUniqueBlobs":{"type":"number"},"totalBlobSize":{"type":"integer","format":"int64"},"avgBlobSize":{"type":"number"},"updatedAt":{"type":"string","format":"date-time"}},"required":["totalBlobs","totalUniqueBlobs","totalBlobSize","avgBlobSize","updatedAt"],"additionalProperties":false},"block":{"type":"object","properties":{"totalBlocks":{"type":"number"},"totalBlobGasUsed":{"type":"string"},"totalBlobAsCalldataGasUsed":{"type":"string"},"totalBlobFee":{"type":"string"},"totalBlobAsCalldataFee":{"type":"string"},"avgBlobFee":{"type":"number"},"avgBlobAsCalldataFee":{"type":"number"},"avgBlobGasPrice":{"type":"number"},"updatedAt":{"type":"string","format":"date-time"}},"required":["totalBlocks","totalBlobGasUsed","totalBlobAsCalldataGasUsed","totalBlobFee","totalBlobAsCalldataFee","avgBlobFee","avgBlobAsCalldataFee","avgBlobGasPrice","updatedAt"],"additionalProperties":false},"transaction":{"type":"object","properties":{"totalTransactions":{"type":"number"},"totalUniqueReceivers":{"type":"number"},"totalUniqueSenders":{"type":"number"},"avgMaxBlobGasFee":{"type":"number"},"updatedAt":{"type":"string","format":"date-time"}},"required":["totalTransactions","totalUniqueReceivers","totalUniqueSenders","avgMaxBlobGasFee","updatedAt"],"additionalProperties":false}},"required":["blob","block","transaction"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/error"}}}},"/stats/blobs":{"get":{"operationId":"stats-getBlobDailyStats","summary":"Get blobs time series stats","tags":["blobs"],"parameters":[{"name":"timeFrame","in":"query","required":true,"schema":{"type":"string","enum":["1d","7d","15d","30d","180d","360d","All"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"days":{"type":"array","items":{"type":"string"}},"totalBlobs":{"type":"array","items":{"type":"number"}},"totalUniqueBlobs":{"type":"array","items":{"type":"number"}},"totalBlobSizes":{"type":"array","items":{"type":"number"}},"avgBlobSizes":{"type":"array","items":{"type":"number"}}},"required":["days","totalBlobs","totalUniqueBlobs","totalBlobSizes","avgBlobSizes"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/error"}}}},"/stats/blobs/overall":{"get":{"operationId":"stats-getBlobOverallStats","summary":"Get blobs overall stats","tags":["blobs"],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"totalBlobs":{"type":"number"},"totalUniqueBlobs":{"type":"number"},"totalBlobSize":{"type":"integer","format":"int64"},"avgBlobSize":{"type":"number"},"updatedAt":{"type":"string","format":"date-time"}},"required":["totalBlobs","totalUniqueBlobs","totalBlobSize","avgBlobSize","updatedAt"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/error"}}}},"/stats/blocks":{"get":{"operationId":"stats-getBlockDailyStats","summary":"Get blocks time series stats","tags":["blocks"],"parameters":[{"name":"timeFrame","in":"query","required":true,"schema":{"type":"string","enum":["1d","7d","15d","30d","180d","360d","All"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"days":{"type":"array","items":{"type":"string"}},"totalBlocks":{"type":"array","items":{"type":"number"}},"totalBlobGasUsed":{"type":"array","items":{"type":"string"}},"totalBlobAsCalldataGasUsed":{"type":"array","items":{"type":"string"}},"totalBlobFees":{"type":"array","items":{"type":"string"}},"totalBlobAsCalldataFees":{"type":"array","items":{"type":"string"}},"avgBlobFees":{"type":"array","items":{"type":"number"}},"avgBlobAsCalldataFees":{"type":"array","items":{"type":"number"}},"avgBlobGasPrices":{"type":"array","items":{"type":"number"}}},"required":["days","totalBlocks","totalBlobGasUsed","totalBlobAsCalldataGasUsed","totalBlobFees","totalBlobAsCalldataFees","avgBlobFees","avgBlobAsCalldataFees","avgBlobGasPrices"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/error"}}}},"/stats/blocks/overall":{"get":{"operationId":"stats-getBlockOverallStats","summary":"Get blocks overall stats","tags":["blocks"],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"totalBlocks":{"type":"number"},"totalBlobGasUsed":{"type":"string"},"totalBlobAsCalldataGasUsed":{"type":"string"},"totalBlobFee":{"type":"string"},"totalBlobAsCalldataFee":{"type":"string"},"avgBlobFee":{"type":"number"},"avgBlobAsCalldataFee":{"type":"number"},"avgBlobGasPrice":{"type":"number"},"updatedAt":{"type":"string","format":"date-time"}},"required":["totalBlocks","totalBlobGasUsed","totalBlobAsCalldataGasUsed","totalBlobFee","totalBlobAsCalldataFee","avgBlobFee","avgBlobAsCalldataFee","avgBlobGasPrice","updatedAt"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/error"}}}},"/stats/transactions":{"get":{"operationId":"stats-getTransactionDailyStats","summary":"Get transactions time series stats","tags":["transactions"],"parameters":[{"name":"timeFrame","in":"query","required":true,"schema":{"type":"string","enum":["1d","7d","15d","30d","180d","360d","All"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"days":{"type":"array","items":{"type":"string"}},"totalTransactions":{"type":"array","items":{"type":"number"}},"totalUniqueSenders":{"type":"array","items":{"type":"number"}},"totalUniqueReceivers":{"type":"array","items":{"type":"number"}},"avgMaxBlobGasFees":{"type":"array","items":{"type":"number"}}},"required":["days","totalTransactions","totalUniqueSenders","totalUniqueReceivers","avgMaxBlobGasFees"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/error"}}}},"/stats/transactions/overall":{"get":{"operationId":"stats-getTransactionOverallStats","summary":"Get transactions overall stats","tags":["transactions"],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"totalTransactions":{"type":"number"},"totalUniqueReceivers":{"type":"number"},"totalUniqueSenders":{"type":"number"},"avgMaxBlobGasFee":{"type":"number"},"updatedAt":{"type":"string","format":"date-time"}},"required":["totalTransactions","totalUniqueReceivers","totalUniqueSenders","avgMaxBlobGasFee","updatedAt"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/error"}}}},"/healthcheck":{"get":{"operationId":"healthcheck","summary":"Connection healthcheck","tags":["system"],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"string"}}}},"default":{"$ref":"#/components/responses/error"}}}}},"components":{"securitySchemes":{"Authorization":{"type":"http","scheme":"bearer"}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false}}}}}},"tags":[{"name":"blobs"},{"name":"blocks"},{"name":"transactions"},{"name":"overall"},{"name":"system"}],"externalDocs":{"url":"https://docs.blobscan.com/"}}' |
I would like us to split this report into multiple crates as this is not related to etherscan. |
agree, we can do it either before this pr or after before sounds easier @kamuik16 lmk if you want to take this |
Prob not, I haven't even understood the issue. |
hello, i'd be happy to take this (: |
prep for #31 puts the block-explorers crate into a new folder `crates/block-explorers`, so we can add `blob-explorers`
closes #31 support for most useful endpoints: * blocks/id * transactions/id types will most likely be changed a bit because some of them can be potentially unified for multiple endpoints --------- Co-authored-by: Oliver Nordbjerg <onbjerg@users.noreply.github.com>
TODO
add simple client for https://sepolia.blobscan.com/
swagger:
https://api.blobscan.com/
The text was updated successfully, but these errors were encountered: