mirror of
https://github.com/stronk-dev/RandomChad.git
synced 2025-07-05 10:35:08 +02:00
Fix missing erms and add some comments
This commit is contained in:
parent
63d72cbfcb
commit
931bfb0789
2
.github/workflows/deploy-functions.yml
vendored
2
.github/workflows/deploy-functions.yml
vendored
@ -42,6 +42,8 @@ jobs:
|
||||
service_account_key: "${{ secrets.GCP_SERVICE_ACCOUT_JSON_PRODUCTION }}"
|
||||
export_default_credentials: true
|
||||
|
||||
# Note to self: needs IAM permissions
|
||||
# see https://firebase.google.com/docs/firestore/manage-data/export-import
|
||||
- name: Backup firestore
|
||||
run: |
|
||||
gcloud config set project ${{ secrets.FIREBASE_PROJECT_ID_PRODUCTION }}
|
||||
|
@ -2,5 +2,8 @@ const functions = require( 'firebase-functions' )
|
||||
const testnetAPI = require( './modules/testnet' )
|
||||
const mainnetAPI = require( './modules/mainnet' )
|
||||
|
||||
// Testnet endpoint
|
||||
exports.testnetMetadata = functions.https.onRequest( testnetAPI )
|
||||
|
||||
// Mainnet endpoint
|
||||
exports.mainnetMetadata = functions.https.onRequest( mainnetAPI )
|
@ -8,6 +8,8 @@ const contractAddress = {
|
||||
mainnet: '',
|
||||
rinkeby: '0x2829ba9d76e675b8867E1707A9aB49B280D916c6'
|
||||
}
|
||||
|
||||
// ABI with only the supply definitions
|
||||
const ABI = [
|
||||
{
|
||||
"inputs": [],
|
||||
@ -25,6 +27,7 @@ const ABI = [
|
||||
}
|
||||
]
|
||||
|
||||
// Total current supply, in accordance with ERC721 spec
|
||||
async function getTotalSupply( network='mainnet' ) {
|
||||
|
||||
// Initialise contract connection
|
||||
|
@ -1,20 +1,14 @@
|
||||
const express = require( 'express' )
|
||||
const cors = require( 'cors' )
|
||||
|
||||
|
||||
|
||||
// CORS enabled express generator
|
||||
module.exports = f => {
|
||||
|
||||
// Create express server
|
||||
const app = express()
|
||||
|
||||
// Enable CORS
|
||||
app.use( cors( { origin: true } ) )
|
||||
// Logger for debugging
|
||||
// app.use( ( req, res, next ) => {
|
||||
|
||||
// console.log( 'base:', req.baseUrl, 'params:', req.params, 'body:', req.body, 'originalurl:', req.originalUrl, 'path:', req.path )
|
||||
|
||||
// next()
|
||||
// } )
|
||||
|
||||
return app
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Dependencies
|
||||
const admin = require('firebase-admin')
|
||||
const admin = require( 'firebase-admin' )
|
||||
|
||||
// Admin api
|
||||
const app = admin.initializeApp()
|
||||
|
@ -3,7 +3,7 @@ const { db } = require( './firebase' )
|
||||
const { getTotalSupply } = require( './contract' )
|
||||
|
||||
// ///////////////////////////////
|
||||
// Data sources
|
||||
// Attribute sources
|
||||
// ///////////////////////////////
|
||||
const globalAttributes = [
|
||||
{ trait_type: "Age", display_type: "number", values: [
|
||||
|
Loading…
x
Reference in New Issue
Block a user