Updated code to fetch available offers using subgraph and multicall.

This commit is contained in:
Filipe Soccol
2025-06-06 17:38:00 -03:00
parent 8a1dab4764
commit fa2def812c
6 changed files with 274 additions and 226 deletions

View File

@@ -1,14 +1,20 @@
import p2pix from "@/utils/smart_contract_files/P2PIX.json";
import { updateWalletStatus } from "./wallet";
import { getProviderUrl, getP2PixAddress } from "./addresses";
import { createPublicClient, createWalletClient, custom, http } from "viem";
import {
createPublicClient,
createWalletClient,
custom,
http,
PublicClient,
} from "viem";
import { sepolia, rootstock } from "viem/chains";
import { useUser } from "@/composables/useUser";
let publicClient = null;
let walletClient = null;
const getPublicClient = (onlyRpcProvider = false) => {
const getPublicClient: PublicClient = (onlyRpcProvider = false) => {
if (onlyRpcProvider) {
const user = useUser();
const rpcUrl = getProviderUrl();