From 6ab42735b089cc5dce4ad51bc7b23fbfc1cc5f8e Mon Sep 17 00:00:00 2001 From: rvcas Date: Fri, 21 Apr 2023 11:59:31 -0400 Subject: [PATCH] fix: switch back to blockfrost kupmios + demeter setup showing strange behavior --- examples/gift_card/fresh.gen.ts | 4 ++-- examples/gift_card/islands/Oneshot.tsx | 24 ++++++++---------------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/examples/gift_card/fresh.gen.ts b/examples/gift_card/fresh.gen.ts index 170185ca..bdd037d9 100644 --- a/examples/gift_card/fresh.gen.ts +++ b/examples/gift_card/fresh.gen.ts @@ -4,14 +4,14 @@ import config from "./deno.json" assert { type: "json" }; import * as $0 from "./routes/index.tsx"; -import * as $$0 from "./islands/App.tsx"; +import * as $$0 from "./islands/Oneshot.tsx"; const manifest = { routes: { "./routes/index.tsx": $0, }, islands: { - "./islands/App.tsx": $$0, + "./islands/Oneshot.tsx": $$0, }, baseUrl: import.meta.url, config, diff --git a/examples/gift_card/islands/Oneshot.tsx b/examples/gift_card/islands/Oneshot.tsx index 8b5d32e5..470e8565 100644 --- a/examples/gift_card/islands/Oneshot.tsx +++ b/examples/gift_card/islands/Oneshot.tsx @@ -1,5 +1,5 @@ import { useEffect, useState } from "preact/hooks"; -import { Constr, Data, fromText, Kupmios, Lucid } from "lucid/mod.ts"; +import { Blockfrost, Constr, Data, fromText, Lucid } from "lucid/mod.ts"; import { Input } from "~/components/Input.tsx"; import { Button } from "~/components/Button.tsx"; @@ -17,8 +17,7 @@ export interface AppProps { export default function App({ validators }: AppProps) { const [lucid, setLucid] = useState(null); - const [kupoUrl, setKupoUrl] = useState(""); - const [ogmiosUrl, setOgmiosUrl] = useState(""); + const [blockfrostAPIKey, setBlockfrostAPIKey] = useState(""); const [tokenName, setTokenName] = useState(""); const [giftADA, setGiftADA] = useState(); const [lockTxHash, setLockTxHash] = useState(undefined); @@ -35,9 +34,9 @@ export default function App({ validators }: AppProps) { e.preventDefault(); const lucid = await Lucid.new( - new Kupmios( - kupoUrl, - ogmiosUrl, + new Blockfrost( + "https://cardano-preprod.blockfrost.io/api/v0", + blockfrostAPIKey, ), "Preprod", ); @@ -209,18 +208,11 @@ export default function App({ validators }: AppProps) { onSubmit={setupLucid} > setKupoUrl(e.currentTarget.value)} + onInput={(e) => setBlockfrostAPIKey(e.currentTarget.value)} > - Kupo URL - - setOgmiosUrl(e.currentTarget.value)} - > - Ogmios URL + Blockfrost API Key