Spaces:
Runtime error
Runtime error
File size: 859 Bytes
55c2187 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
import json
from re import search
import streamlit as st
#from metamask_component import metamask_component
from wallet_connect import wallet_connect
import web3
from abi.abi import get_contract
import requests
def get_papers(search_word):
with open('datasets/papers_ipfs.json') as json_file:
data = json.load(json_file)
select_data = [ key for key, values in data.items() if key.startswith(search_word)]
contract = get_contract()
call_papers = [contract.functions.retrievePaper(i).call() for i in select_data ]
for i in call_papers:
st.markdown('#')
col1,col2 = st.columns((3,1))
with col1:
st.markdown(f"""
<embed src="https://{i[1]}.ipfs.nftstorage.link/" width="1200" height="600">
""", unsafe_allow_html=True)
|