Using just HTML / PHP / Javascript and cardano-serialization, I have the connect wallet working. It shows the balance and stake address. So I have gotten that far.
My question is, how can I request the connected wallet for a chosen amount of ADA?
I do not want to use Mesh or any of those, just using Javascript.
Any and all input greatly appreciated!
EDIT: I am getting a lot of errors, can anyone tell me what else I can do to make this work correctly?
<script type="module">
import { Blockfrost, Lucid } from "https://unpkg.com/[email protected]/web/mod.js"; // NPM
const lucid = await Lucid.new(
new Blockfrost("https://cardano-preview.blockfrost.io/api/v0",
"mainnet..."),
"Preview",
);
// Assumes you are in a browser environment
const api = await window.cardano.nami.enable();
lucid.selectWallet(api);
const tx = await lucid.newTx()
.payToAddress("addr...", { lovelace: 5000000n })
.complete();
const signedTx = await tx.sign().complete();
const txHash = await signedTx.submit();
console.log(txHash);
</script>