Skip to content

Latest commit

 

History

History
130 lines (99 loc) · 7.55 KB

migration.mdx

File metadata and controls

130 lines (99 loc) · 7.55 KB
title description
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://gateway-arbitrum.network.thegraph.com/api/{API_KEY}/subgraphs/id/FrwziBsTDBogUj57ts4U1kx5X5hDMkpX5STpUXphomyV
matic SUBGRAPH_LINK https://gateway-arbitrum.network.thegraph.com/api/{API_KEY}/subgraphs/id/Ga4gCEvJGuu7Y2oXCbpa3R9KMNBXWYLg1kJPxnfeu5fb
optimism SUBGRAPH_LINK https://gateway-arbitrum.network.thegraph.com/api/{API_KEY}/subgraphs/id/HxvH1S81KFam6J7etqtxngjLPhZMS5QcHKwPa7LVz1no
optimism-sepolia SUBGRAPH_LINK https://api.studio.thegraph.com/query/45842/opt-sep-jiffy-scan/version/latest
arbitrum-one SUBGRAPH_LINK https://gateway-arbitrum.network.thegraph.com/api/{API_KEY}/subgraphs/id/4YM6vwSP4Mx38qXsVh6TFyrWrKgm7zvX4mFGPS2L6afk
avalanche SUBGRAPH_LINK 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://api.studio.thegraph.com/query/45842/base-sep-jiffy-scan/version/latest
fuse SUBGRAPH_LINK https://gateway-arbitrum.network.thegraph.com/api/{API_KEY}/subgraphs/id/86D6T6o7YmB5MrSJhMU2Syeqt7r927yecSYcmJrpkTXn
base SUBGRAPH_LINK https://gateway-arbitrum.network.thegraph.com/api/{API_KEY}/subgraphs/id/9KToKxWC5uRS5ecCFgAxrScDPU2rVMy3hp7abAkt6BED
sepolia SUBGRAPH_LINK https://api.studio.thegraph.com/query/45842/sepolia-jiffy-scan/version/latest
arbitrum-sepolia SUBGRAPH_LINK https://gateway.thegraph.com/api/1afd1a1d48e26c2c6fed3465adb9b876/subgraphs/id/8bh2bxiNysQJtqwp1HbEMKPpKDYe5JYGnykGTpmprDWZ
polygon-amoy SUBGRAPH_LINK https://api.studio.thegraph.com/query/24129/polygon-amoy-jiffy-scan/version/latest

Querying the Subgraph

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

Sample Query

query GetUserOpHash($userOpHash: Bytes) {
  userOps(where: {userOpHash: $userOpHash}) {
    verificationGasLimit
    userOpHash
    transactionHash
    }
}

Sample curl Request

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

Installation

npm install jiffyscan-graph-wrapper

Usage Example

Below is an example of how to use the library:

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!