This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Web3 = require('web3') | |
// *WRONG* | |
// const localProviderUrl = 'wss://localhost:8545' | |
// Result: | |
// | |
// connection not open on send() | |
// Error in subscription wss://localhost:8545 | |
// Error: connection not open |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Web3 from 'web3' | |
// Setup a message with instructions for the server. | |
const messageData = [ | |
{ | |
name: ‘Contents’, | |
type: ‘string’, | |
value: 'extra! extra! read all about it!' | |
} | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sigUtil = require('eth-sig-util') | |
app.post('/api/message', (req, res) => { | |
const messageData = req.body.messageData | |
const signature = req.body.signature | |
// recover the public key | |
const publicKey = sigUtil.recoverTypedSignature({ | |
data: messageData, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gnarly-5f7885c68-5686g — TypeError: Cannot read property 'owner' of undefined | |
gnarly-5f7885c68-5686g — at Object.replace (/snapshot/gnarly/node_modules/@xlnt/fast-json-patch/lib/core.js:27:26) | |
gnarly-5f7885c68-5686g — at applyOperation (/snapshot/gnarly/node_modules/@xlnt/fast-json-patch/lib/core.js:231:60) | |
gnarly-5f7885c68-5686g — at Object.applyPatch (/snapshot/gnarly/node_modules/@xlnt/fast-json-patch/lib/core.js:268:22) | |
gnarly-5f7885c68-5686g — at __dirname.resumeFromTxId.txBatch.forEach (/snapshot/gnarly/node_modules/@xlnt/gnarly-core/lib/Ourbit.js:134:43) | |
gnarly-5f7885c68-5686g — at Array.forEach (<anonymous>) | |
gnarly-5f7885c68-5686g — at Ourbit.<anonymous> (/snapshot/gnarly/node_modules/@xlnt/gnarly-core/lib/Ourbit.js:130:29) | |
gnarly-5f7885c68-5686g — at Generator.next (<anonymous>) | |
gnarly-5f7885c68-5686g — at fulfilled (/snapshot/gnarly/node_modules/@xlnt/gnarly-core/lib/Ourbit.js:4:58) | |
gnarly-5f7885c68-5686g — at <anonymous> 'TypeError: Cannot read property \'owner\' of undefined\n at Object.replace (/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sigUtil = require('eth-sig-util'); | |
const { checkUserMembership } = require('./pg-controller'); | |
function recover(message, signature) { | |
return sigUtil.recoverPersonalSignature({ | |
data: message, | |
sig: signature | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function getLeaderboard() { | |
try { | |
// get tournament ID from server | |
const tournamentData = await fetch('/api/data').then(async response => { | |
if (response.status !== 200) throw Error('API error - request'); | |
return response.json(); | |
}); | |
if (!tournamentData.tournamentId) throw Error('API error - data'); | |
console.log('Tournament Code:', tournamentData.tournamentId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"tokenId": "56967430895675811679808265096816440670731486143859213145439561619809262108673", | |
"tokenAddress": "0xfaee4b062449a24a3d0f211d08caac43ee3a1d9b", | |
"name": "Beach 1", | |
"description": "Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1Beach 1", | |
"owner": { | |
"user": { | |
"username": "NullAddress" | |
}, | |
"profile_img_url": "https://storage.googleapis.com/opensea-static/opensea-profile/1.png", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"tokenId": "4", | |
"tokenAddress": "0x91f16f2b28d96c3d1a3202b574fc05e749defb6c", | |
"name": "WizardZ", | |
"description": "WizardZ is a zombie wizard collectible artwork.", | |
"owner": { | |
"user": { | |
"username": null | |
}, | |
"profile_img_url": "https://storage.googleapis.com/opensea-static/opensea-profile/8.png", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
firstFans: [], // sorted by reverse chronological; how many? | |
topFans: [], // sorted by ra, how many? | |
uniqueBidders: [], //do we need/want this? | |
topBids: [], // how many? | |
asset: {}, | |
nextBid: {number} | |
} |