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
import { ProviderType } from "@lit-protocol/constants" | |
import { LitAuthClient, WebAuthnProvider } from "@lit-protocol/lit-auth-client" | |
const litAuthClient = new LitAuthClient({ | |
litRelayConfig: { relayApiKey: LIT_API_KEY }, | |
}) | |
const provider = litAuthClient.initProvider<WebAuthnProvider>( | |
ProviderType.WebAuthn | |
) |
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
import { guidGenerator } from "./mem-utils.js" | |
import { MEM_TESTNET_URL } from "./constants.js" | |
import axios from "axios" | |
import { Redis } from "@upstash/redis" | |
const redisClient = new Redis({ | |
url: process.env.UPSTASH_REDIS_REST_URL, | |
token: process.env.UPSTASH_REDIS_REST_TOKEN, | |
}) |
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
<!DOCTYPE html> | |
<title>Using Lit Protocol with Web3Auth</title> | |
<script src="https://unpkg.com/@web3auth/modal@3.3.0/dist/modal.umd.min.js"></script> | |
<script src="https://unpkg.com/@web3auth/base@3.3.0/dist/base.umd.min.js"></script> | |
<script src="https://unpkg.com/ethers@5.7.2/dist/ethers.umd.js"></script> | |
<script src="https://jscdn.litgateway.com/index.web.js"></script> | |
<button id="encryptButton">Encrypt</button> |
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
export class Controls { | |
public up = false | |
public down = false | |
public left = false | |
public right = false | |
public action = false | |
constructor(scene: Phaser.Scene) { | |
if (touchscreenAvailable()) this.initializeTouchscreen(scene) | |
else this.initializeKeyboard(scene) |
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
// Save one string | |
let string = "a"; | |
// A string can be written directly into localStorage | |
localStorage.setItem("myKey", string); | |
string = localStorage.getItem("myKey"); | |
console.log("String data for myKey:", string); | |
localStorage.removeItem("myKey"); | |
// Save multiple strings |
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
// Save one string | |
let string = "a"; | |
// A string can be written directly into localStorage | |
localStorage.setItem("myKey", string); | |
string = localStorage.getItem("myKey"); | |
console.log("String data for myKey:", string); | |
localStorage.removeItem("myKey"); | |
// Save multiple strings |
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
{ | |
"facebooklogin": true, | |
"fname": "Mark", | |
"email": "lofqazwczg_1571920845@tfbnw.net", | |
"facebookid": "101937261244556", | |
"facebookaccesstoken": "EAAB3KhOVpAIBAKHoP6yqIhGRTnpkjXgaUeeSFXIiMrxT39u5yombL8QIHMqKmKcJ1keM7hYmIJ5V42dbz0O8L1LZCAtB14Vj02XOXkUOEHZA9j6ZCTLz4dTKz4gybkeVgI57f1M2rBS0GDZCjMUNM1xISvOZA2783FhwiVNel6GvuZAz0hkSabFZAHQX62c7mYgqRP7jT1dZB3S91KnXh8JIUBJQApBYjdzEhfkZCiHBTH1Yas7y5t0AE9cboirw1J3kZD", | |
"facebookavatar": "https://graph.facebook.com/101937261244556/picture?type=large" | |
} | |
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
function useFetch(input, init, useEffectInputs) { | |
const [error, setError] = useState(null); | |
const [response, setResponse] = useState(null); | |
const abortController = useRef(); | |
useEffect(() => { | |
abortController.current = new AbortController(); | |
fetch(input, { ...init, signal: abortController.current.signal }) |