-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from jdaly13/mySql
My sql
- Loading branch information
Showing
46 changed files
with
1,676 additions
and
1,016 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { getClientIPAddress } from "remix-utils"; | ||
const Mixpanel = require("mixpanel"); | ||
const mixPanelAccount = process.env.MIXPANEL; | ||
export async function mixPanelPageView(request, obj = {}) { | ||
console.log({ getClientIPAddress }); | ||
let ipAddress = getClientIPAddress(request); | ||
console.log({ ipAddress }); | ||
if (process.env.NODE_ENV === "production") { | ||
const mixpanel = Mixpanel.init(mixPanelAccount, { track_pageview: true }); | ||
mixpanel.track("page_viewed", { | ||
game: obj.currentGame || "no current game", | ||
page: request.url, | ||
ip: ipAddress, | ||
}); | ||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { prisma } from "~/db.server"; | ||
require("dotenv").config(); | ||
export async function updateTxInGame(receipt, nativePayoutTx, gameId, address) { | ||
return prisma.winner.create({ | ||
data: { | ||
triviaTransaction: receipt?.hash || "", | ||
nativeTransaction: nativePayoutTx?.hash || "", | ||
gameId, | ||
network: process.env.NETWORK, | ||
id: address, | ||
}, | ||
}); | ||
} | ||
|
||
export async function updateWinnerWithNftTransaction(winnerAddress, nftTx) { | ||
return prisma.winner.update({ | ||
where: { | ||
id: winnerAddress, | ||
}, | ||
data: { | ||
nftTransaction: nftTx, | ||
}, | ||
}); | ||
} |
Oops, something went wrong.