cartesi / rollups-explorer

Cartesi Rollups Explorer Web Application
https://cartesiscan.io
Apache License 2.0
7 stars 26 forks source link

Add Export and Import for Specifications #229

Closed brunomenezes closed 2 months ago

brunomenezes commented 3 months ago

📄 Context

We have a new Specification feature to help decode abi-encoded data on the input's payload. The created specs persist on local storage and belong to the domain where you run the web application (e.g., localhost). So, to avoid the tedious task of recreating them every time you run the App in a different domain, an import/export feature will be helpful.

✔️ Solution

Create a versioned importer/exporter. The exporter should generate a JSON file with specific properties (described below). The importer should be able to accept only JSON extensions and work on the designated version.

Example of Data Format

interface SpecificationExport {
 name: 'cartesiscan_specifications_export';
 version: number;
 timestamp: number;
 specifications: Specification[]
}

References:

Web APIs: URL , Blob, File.

📈 Subtasks

🎯 Definition of Done