Skip to content

Commit

Permalink
🐤🦷 ↝ Merge pull request #25 from Signal-K/wb3-5-take-user-inputs-for-…
Browse files Browse the repository at this point in the history
…minting-via-flask

🔬🐤 ↝ New API Routes,
  • Loading branch information
Gizmotronn authored Jan 4, 2023
2 parents ef7fa27 + 9d64b17 commit 2d303d4
Show file tree
Hide file tree
Showing 57 changed files with 3,368 additions and 449 deletions.
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

0 comments on commit 2d303d4

Please sign in to comment.