Receive
If someone wants to send tokens to your Keeta account, they’ll need your public address. This guide shows how to access your public key and present it using a QR code.
Option 1: Create a New Account
import * as KeetaNet from '@keetanetwork/keetanet-client';
// Generate a secure random seed
const seed = KeetaNet.lib.Account.generateRandomSeed({ asString: true });
// Create a new account from the seed (index 0)
const account = KeetaNet.lib.Account.fromSeed(seed, 0);
// Get the public address
const publicKey = account.publicKeyString.toString();
console.log("Your public Keeta address:", publicKey);
Option 2: Import an Existing Account
Once you have the account, you can share your publicKey
to receive funds. This is the address others will send tokens to.
const existingSeed = "your existing seed string...";
const account = KeetaNet.lib.Account.fromSeed(existingSeed, 0);
const publicKey = account.publicKeyString.toString();
Generate a QR code
You can turn the public address into a QR code so others can scan and send easily. This works great on mobile wallets or in-person payments.
To generate a QR code image:
import { toDataURL } from "qrcode";
const qrCode = await toDataURL(accountPublicKey);
This gives you a base64 image URL (like data:image/png;base64,...
) that you can embed in an <img>
tag:
<img src={qrCode} />
You don’t need a specific library — any QR code tool that supports text-to-QR conversion will work. Just pass in the address string, and you're good to go.
Last updated