[Dev] Bun.shでSteemKeychainの学習用サイトをつくる
こんにちは、@yasuです。
SteemKeychainの学習のために、Bun.shでhttpサーバを作成した。
最小限度の機能のみ実装。
サーバー側ログ
① サーバーから nonce を取得
const nonceRes = await fetch(`/api/get-nonce?username=${username}`);
const { nonce, error } = await nonceRes.json();
② Keychain で署名を作成
steem_keychain.requestSignBuffer(username, message, "Posting", async (res) => {
if (!res.success) {
resultEl.textContent = "署名に失敗しました。";
return;
}
const signature = res.result;
const publicKey = res.publicKey;
③ Bunサーバーに署名を送信して検証
const verifyRes = await fetch("/api/verify", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ username, message, signature, publicKey }),
});






Congratulations, your post has been manually
upvoted by @steem-bingo trail
Thank you for joining us to play bingo.
STEEM-BINGO, a new game on Steem that rewards the player! 💰
How to join, read here
DEVELOPED BY XPILAR TEAM - @xpilar.witness