> ## Documentation Index
> Fetch the complete documentation index at: https://jiffyscan.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Data API Migration

> Provides alternative routes to using the Jiffyscan API service

# Migration Guide: Deprecation of Jiffyscan API Services

As part of our ongoing efforts to streamline our offerings, we are deprecating our API services. Below are the two alternative approaches you can use to transition seamlessly:

## Option 1: Use Jiffyscan Subgraphs Directly

Jiffyscan provides subgraphs for querying blockchain data directly. Each subgraph corresponds to a specific EVM blockchain.

### Subgraphs

| Network          | Subgraph Name                                                                                                                         | Subgraph Endpoint                                                                                                             |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| mainnet          | [SUBGRAPH\_LINK](https://thegraph.com/explorer/subgraphs/FrwziBsTDBogUj57ts4U1kx5X5hDMkpX5STpUXphomyV?view=Query\&chain=arbitrum-one) | `https://gateway-arbitrum.network.thegraph.com/api/{API_KEY}/subgraphs/id/FrwziBsTDBogUj57ts4U1kx5X5hDMkpX5STpUXphomyV`       |
| matic            | [SUBGRAPH\_LINK](https://thegraph.com/explorer/subgraphs/Ga4gCEvJGuu7Y2oXCbpa3R9KMNBXWYLg1kJPxnfeu5fb?view=Query\&chain=arbitrum-one) | `https://gateway-arbitrum.network.thegraph.com/api/{API_KEY}/subgraphs/id/Ga4gCEvJGuu7Y2oXCbpa3R9KMNBXWYLg1kJPxnfeu5fb`       |
| optimism         | [SUBGRAPH\_LINK](https://thegraph.com/explorer/subgraphs/HxvH1S81KFam6J7etqtxngjLPhZMS5QcHKwPa7LVz1no?view=Query\&chain=arbitrum-one) | `https://gateway-arbitrum.network.thegraph.com/api/{API_KEY}/subgraphs/id/HxvH1S81KFam6J7etqtxngjLPhZMS5QcHKwPa7LVz1no`       |
| optimism-sepolia | [SUBGRAPH\_LINK](https://thegraph.com/explorer/subgraphs/AZR6rSiFMk3bTU4EhYKpTxYuAXNcU9m354nPbnp9JMcT?view=Query\&chain=arbitrum-one) | `https://api.studio.thegraph.com/query/45842/opt-sep-jiffy-scan/version/latest`                                               |
| arbitrum-one     | [SUBGRAPH\_LINK](https://thegraph.com/explorer/subgraphs/4YM6vwSP4Mx38qXsVh6TFyrWrKgm7zvX4mFGPS2L6afk?view=Query\&chain=arbitrum-one) | `https://gateway-arbitrum.network.thegraph.com/api/{API_KEY}/subgraphs/id/4YM6vwSP4Mx38qXsVh6TFyrWrKgm7zvX4mFGPS2L6afk`       |
| avalanche        | [SUBGRAPH\_LINK](https://thegraph.com/explorer/subgraphs/ALNXErAtAfjQU8TP39nitk6ej9ZtrDYmnXRYRdWiFuGZ?view=Query\&chain=arbitrum-one) | `https://gateway-arbitrum.network.thegraph.com/api/{API_KEY}/subgraphs/id/ALNXErAtAfjQU8TP39nitk6ej9ZtrDYmnXRYRdWiFuGZ`       |
| avalanche-fuji   | NOT\_PUBLISHED                                                                                                                        | `https://api.studio.thegraph.com/query/45842/avalanche-fuji-jiffy-scan/version/latest/`                                       |
| base-sepolia     | [SUBGRAPH\_LINK](https://thegraph.com/explorer/subgraphs/FiEADiC5WBsZ7jSgLdAQSzFR44zAt7jeT51bpaGVDxdi?view=Query\&chain=arbitrum-one) | `https://api.studio.thegraph.com/query/45842/base-sep-jiffy-scan/version/latest`                                              |
| fuse             | [SUBGRAPH\_LINK](https://thegraph.com/explorer/subgraphs/86D6T6o7YmB5MrSJhMU2Syeqt7r927yecSYcmJrpkTXn?view=Query\&chain=arbitrum-one) | `https://gateway-arbitrum.network.thegraph.com/api/{API_KEY}/subgraphs/id/86D6T6o7YmB5MrSJhMU2Syeqt7r927yecSYcmJrpkTXn`       |
| base             | [SUBGRAPH\_LINK](https://thegraph.com/explorer/subgraphs/9KToKxWC5uRS5ecCFgAxrScDPU2rVMy3hp7abAkt6BED?view=Query\&chain=arbitrum-one) | `https://gateway-arbitrum.network.thegraph.com/api/{API_KEY}/subgraphs/id/9KToKxWC5uRS5ecCFgAxrScDPU2rVMy3hp7abAkt6BED`       |
| sepolia          | [SUBGRAPH\_LINK](https://thegraph.com/explorer/subgraphs/2M32xcbPjStNzTUe8vhtQ29aDyRgb6TfeezA68kHohtM?view=Query\&chain=arbitrum-one) | `https://api.studio.thegraph.com/query/45842/sepolia-jiffy-scan/version/latest`                                               |
| arbitrum-sepolia | [SUBGRAPH\_LINK](https://thegraph.com/explorer/subgraphs/8bh2bxiNysQJtqwp1HbEMKPpKDYe5JYGnykGTpmprDWZ?view=Query\&chain=arbitrum-one) | `https://gateway.thegraph.com/api/1afd1a1d48e26c2c6fed3465adb9b876/subgraphs/id/8bh2bxiNysQJtqwp1HbEMKPpKDYe5JYGnykGTpmprDWZ` |
| polygon-amoy     | [SUBGRAPH\_LINK](https://thegraph.com/explorer/subgraphs/7Nfkhneum5YhB9FKGG6xs3KrmkZHiaDZxLQwiuMxaEYT?view=Query\&chain=arbitrum-one) | `https://api.studio.thegraph.com/query/24129/polygon-amoy-jiffy-scan/version/latest`                                          |
| Bsc              | [SUBGRAPH\_LINK](https://thegraph.com/explorer/subgraphs/8S8KDUFTAXaV5JEyFesQp3Rwxr5QqbkjyphbjNR7zjBk?view=Query\&chain=arbitrum-one) | `https://gateway-arbitrum.network.thegraph.com/api/{API_KEY}/subgraphs/id/8S8KDUFTAXaV5JEyFesQp3Rwxr5QqbkjyphbjNR7zjBk`       |

### Querying the Subgraph

Subgraphs allow you to fetch data using GraphQL queries. Below is an example of how to make a query:

#### Sample Query

```graphql theme={null}
query GetUserOpHash($userOpHash: Bytes) {
  userOps(where: {userOpHash: $userOpHash}) {
    verificationGasLimit
    userOpHash
    transactionHash
    }
}
```

#### Sample `curl` Request

```bash theme={null}
curl -X POST -H "Content-Type: application/json" \
  -d '{
    "query": "query GetUserOpHash($userOpHash: Bytes) { userOps(where: {userOpHash: $userOpHash}) { userOpHash transactionHash } }",
    "variables": {
      "userOpHash": "0x7e4ba0a376476010d3e4ade7b5e5783a74174d3672c620c3148ddcc0f3a58e01"
    }
  }' \
  https://api.studio.thegraph.com/query/45842/sepolia-jiffy-scan/version/latest
```

Replace the URL with the appropriate subgraph link for the blockchain you are querying.

## Option 2: Use Our TypeScript Library

We have created a TypeScript library that implements the top two most-used APIs from Jiffyscan. This library is easy to integrate into your projects.

### Resources

* **GitHub Repository:** [Library GitHub](https://github.com/jiffy-labs/graph-wrapper)

* **npm Package:** [jiffyscan-graph-wrapper](https://www.npmjs.com/package/jiffyscan-graph-wrapper)

### Installation

```bash theme={null}
npm install jiffyscan-graph-wrapper
```

### Usage Example

Below is an example of how to use the library:

```typescript theme={null}
import { JiffyscanGraphClient } from "jiffyscan-graph-wrapper";

// Initialize the client with your Graph API key
const graphApiKey = "your-graph-api-key";
const client = new JiffyscanGraphClient(graphApiKey);

// Fetch network status
async function fetchNetworkStatus() {
    try {
        const response = await client.getNetworkStatus("base");
        console.log("Network Status:", response);
    } catch (error) {
        console.error("Error fetching network status:", error);
    }
}

// Fetch user operation details
async function fetchUserOpDetails() {
    try {
        const response = await client.getUserOp("sepolia", "0x7e4ba0a376476010d3e4ade7b5e5783a74174d3672c620c3148ddcc0f3a58e01");
        console.log("User Operation Details:", response);
    } catch (error) {
        console.error("Error fetching user operation details:", error);
    }
}

// Fetch address activity
async function fetchAddressActivity() {
    try {
        const response = await client.getAddressActivity("sepolia", "0x2bbac9aad155c87343070feedfd03a855c77e695", 1, 0, 0, 0);
        console.log("Address Activity:", response);
    } catch (error) {
        console.error("Error fetching address activity:", error);
    }
}

// Call the functions
fetchNetworkStatus();
fetchUserOpDetails();
fetchAddressActivity();
```

Refer to the GitHub repository for complete documentation and advanced usage.

***

If you have any questions or require further assistance, please reach out to our support team. We are here to help ensure a smooth migration!
