Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔬🐤 ↝ New API Routes, #25

Merged
merged 10 commits into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
26 changes: 24 additions & 2 deletions Server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,27 @@

app = Flask(__name__)

@app.route('/', methods=["GET"])
# Getting proposals (move to separate file)
web3Sdk = ThirdwebSDK("goerli")
contract = web3Sdk.get_contract("0xCcaA1ABA77Bae6296D386C2F130c46FEc3E5A004")
proposals = contract.call("getProposals")

# Minting candidate nfts
nftSdk = ThirdwebSDK('mumbai')
nftContract = nftSdk.get_contract("0xed6e837Fda815FBf78E8E7266482c5Be80bC4bF9")

@app.route('/')
def index():
return "Hello World"

@app.route('/proposals', methods=["GET"])
def getProposals():
# Mint nft based on proposal id
proposalCandidate = nftContract.call("lazyMint", _amount, _baseURIForTokens, _data) # Get this from Jupyter notebook -> https://thirdweb.com/mumbai/0xed6e837Fda815FBf78E8E7266482c5Be80bC4bF9/nfts token id 0 (e.g.)
createProposal = contract.call("createProposal", _owner, _title, _description, _target, _deadline, _image) # Get this from PUSH req contents

return proposals

@app.route('/login', methods=['POST'])
def login():
private_key = os.environ.get("PRIVATE_KEY")
Expand Down Expand Up @@ -73,4 +90,9 @@ def logout():

@app.route('/helloworld')
def helloworld():
return address
return "address" #address

# Getting proposals route
#@app.route('/proposals')
#def getProposals():
# return classifications;
10 changes: 10 additions & 0 deletions Server/frontend/assets/create-campaign.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions Server/frontend/assets/dashboard.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions Server/frontend/assets/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import createCampaign from './create-campaign.svg';
import dashboard from './dashboard.svg';
import logo from './logo.svg';
import logout from './logout.svg';
import payment from './payment.svg';
import profile from './profile.svg';
import sun from './sun.svg';
import withdraw from './withdraw.svg';
import tagType from './type.svg';
import search from './search.svg';
import menu from './menu.svg';
import money from './money.svg';
import loader from './loader.svg';
import thirdweb from './thirdweb.png';

export {
tagType,
createCampaign,
dashboard,
logo,
logout,
payment,
profile,
sun,
withdraw,
search,
menu,
money,
loader,
thirdweb,
};
51 changes: 51 additions & 0 deletions Server/frontend/assets/loader.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions Server/frontend/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Server/frontend/assets/logout.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Server/frontend/assets/menu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions Server/frontend/assets/money.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Server/frontend/assets/payment.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions Server/frontend/assets/profile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions Server/frontend/assets/search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Server/frontend/assets/sun.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Server/frontend/assets/thirdweb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Server/frontend/assets/type.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading