diff --git a/src/molecules/ar/atoms/mime.js b/src/molecules/ar/atoms/mime.js index bf75f10..56af42a 100644 --- a/src/molecules/ar/atoms/mime.js +++ b/src/molecules/ar/atoms/mime.js @@ -1,4 +1,4 @@ -import { getArTxObject } from "./tx-gql.js"; +import axios from "axios"; export async function getTxsMimeType(txs) { try { @@ -7,11 +7,10 @@ export async function getTxsMimeType(txs) { for (const tx of txsArray) { res[tx] = {}; - const metadata = await getArTxObject(tx); + const metadata = await getArseedTxMeta(tx); res[tx].mime = metadata?.tags.find( (tag) => tag.name.toLowerCase() === "content-type" )?.value; - res[tx]["size"] = metadata?.data?.size; } return res; @@ -20,3 +19,15 @@ export async function getTxsMimeType(txs) { return {}; } } + +async function getArseedTxMeta(txid) { + try { + const metadata = ( + await axios.get(`https://arseed.web3infra.dev/bundle/tx/${txid}`) + )?.data; + return metadata; + } catch (error) { + console.log(error); + return {}; + } +}