Type "A coffee, $4.50" and get an image that says what it costs in DOGE, with the rate and the time at the bottom.
Download it or copy it, then attach it to your post
The rate and the time are printed on the card
Made in your browser, nothing is uploaded
Your rate or the live one
The live price is read by your browser. If you would rather use your own number, type it under Advanced and the card says it is yours.
Choose the currency for prices without a sign
Use the live rate or set one by hand
A card made at your own rate says so
Whole numbers inside, so the same price gives the same DOGE every time
Euros, pounds and big numbers
Type the sign in front of the price, like €18 or £8, or a size like 67 million. The card follows as you type.
US, Canadian and Australian dollars, euros and pounds
Tap an example like Coffee, Pizza or A rocket launch
Any text with a price works
Attach it to your post
One button opens the X post box with the words filled in. Attach the card and press Post.
We never post for you
The text is short and ends with #Dogecoin
Works on phone and computer
How it works
Type a thing and its price
For example a coffee at $4.50.
Get the card
It shows the price in DOGE at the live rate.
Post it on X
Attach the image to the post we open for you.
Questions
Where does the price come from?
CoinGecko's public price endpoint, read by your browser. The card shows the rate and the time it was read.
What if the live price cannot be read?
The page says so. Type a rate under Advanced and the card shows it as your rate. Try again later for the live one.
Which currencies work?
US, Canadian and Australian dollars, euros and pounds.
Why integers?
So that 4.50 at 0.1825 always gives the same DOGE in every browser, with no rounding surprises.
Is the card a payment request?
No. It is a picture that says what something costs in Dogecoin. No money moves.
Is this made by X?
No. DogeJS is an independent project and is not affiliated with X Corp. The tools only open X's own post box with the text filled in; you press Post yourself.
How prices are read and converted with integers only, where the rate comes from, and how the card is drawn.
How it works
parsePriceText reads the item and the price, in $, C$, A$, €, £ or a currency code, with 1,234.56 or 1.234,56 and k, million or billion.
The rate is read from CoinGecko's public price endpoint by your browser, with no key, when the page opens. Under Advanced you can type your own rate. When it cannot be read, the page says so and you can type a rate under Advanced; a card made at your own rate says so.
All money is integers: cents in, koinu out (1 DOGE = 100,000,000 koinu), rate as fiat per DOGE x 1e8, rounded half up. No floating point.
The 1600x900 card is drawn on a canvas in the browser with the rate and time written small at the bottom; Download, Copy image, then Post on X and attach it.
The package is @dogejs/xkit. It is not on npm yet: install it from its repository tag, then import the helpers. They are plain functions with no DOM at module level, so they run in Node 20+, in browsers and in workers.
Use the same maths for a price tag on your own site, a bot reply, or a menu board.
Code examples
Each example runs in Node against the built package; the output is recorded from that run and checked by npm run examples.
Price things in DOGE
Three prices at one rate, with the card's headline and tagline. File examples/price.mjs; run: node examples/price.mjs.
JavaScript
// "A coffee, $4.50" in DOGE, with integers only.import { formatFiat, formatRate, headline, minorToKoinu, parsePriceText, pricePost, tagline } from'@dogejs/xkit';
const rate = 18_250_000n; // priceE8: $0.1825 per DOGE x 1e8 (the page fetches the live rate)for (const text of ['A coffee, $4.50', 'New sneakers, 120 EUR', 'A rocket launch, $67 million']) {
const p = parsePriceText(text);
const koinu = minorToKoinu(p.minor, rate);
console.log(formatFiat(p.minor, p.currency), '->', headline(p.item, koinu), tagline(koinu));
}
console.log(formatRate(rate, 'USD'));
const p = parsePriceText('A coffee, $4.50'), k = minorToKoinu(p.minor, rate);
console.log(pricePost(headline(p.item, k), tagline(k)));
Output
$4.50 -> A coffee is 25 DOGE. Much affordable.
€120 -> New sneakers are 658 DOGE. Such treat. Wow.
$67,000,000 -> A rocket launch is 367,123,288 DOGE. To the moon. Wow.
1 DOGE = $0.1825
A coffee is 25 DOGE. Much affordable. #Dogecoin
Prices written many ways
What the parser understands, in minor units, and what one cent is in koinu. File examples/price-formats.mjs; run: node examples/price-formats.mjs.
JavaScript
// Prices are read the way people write them, and stay integers: cents in, koinu out.import { friendlyDoge, minorToKoinu, parsePriceText } from'@dogejs/xkit';
for (const t of ['$4.50', '4,50 €', '£1,234.56', 'Rent 1.234,56 EUR', 'A car, 48k', 'C$ 15', 'free']) {
const p = parsePriceText(t);
console.log(JSON.stringify(t).padEnd(22), p ? `${p.minor} ${p.currency} minor units, item "${p.item}"` : 'not a price');
}
// 1 cent at $0.1825 per DOGE, rounded half up to the koinu (1 DOGE = 100,000,000 koinu)const k = minorToKoinu(1n, 18_250_000n);
console.log(k, 'koinu =', friendlyDoge(k), 'DOGE on the card');
Output
"$4.50" 450 USD minor units, item ""
"4,50 €" 450 EUR minor units, item ""
"£1,234.56" 123456 GBP minor units, item ""
"Rent 1.234,56 EUR" 123456 EUR minor units, item "Rent"
"A car, 48k" 4800000 USD minor units, item "A car"
"C$ 15" 1500 CAD minor units, item ""
"free" not a price
5479452n koinu = 0.05 DOGE on the card
The Post on X link
The text the page prefills, and the composer link. The person attaches the downloaded card. File examples/price-post.mjs; run: node examples/price-post.mjs.
JavaScript
// The "Post on X" button of the price page: text and link, no image (the person attaches the downloaded card).import { headline, minorToKoinu, parsePriceText, postIntentUrl, pricePost, tagline } from'@dogejs/xkit';
const p = parsePriceText('A large pizza, $18');
const koinu = minorToKoinu(p.minor, 18_250_000n);
const text = pricePost(headline(p.item, koinu), tagline(koinu));
console.log(text);
console.log(postIntentUrl({ text, url: 'https://dogejs.com/x/price/' }));
Output
A large pizza is 99 DOGE. Much affordable. #Dogecoin
https://x.com/intent/post?text=A%20large%20pizza%20is%2099%20DOGE.%20Much%20affordable.%20%23Dogecoin&url=https%3A%2F%2Fdogejs.com%2Fx%2Fprice%2F
Everything is static files. The page scripts are built from DogeJS-Dev/doge-on-x; the HTML and CSS of the pages are in DogeJS-Dev/website under site/x/.
Shell
git clone https://github.com/DogeJS-Dev/doge-on-x
cd doge-on-x
npm install
npm run build # dist/x-tip.js, x-t.js, x-proof.js, x-price.js, x-wow.js, x-profile.js, x-giveaway.js
npm test # unit tests
npm run examples # runs every example on this page and compares its output
Copy site/x/ from the website repository (the product page of each tool is x/<tool>/, the tool itself x/<tool>/app/), with ui.css, apps.css, styles.css, site.js, pay.js (tip pages) and signin.js (proof page) from the site root, and the images the pages name.
Put the built dist/x-*.js next to the pages as site/x/x-*.js.
Serve the folder from any static host. Nothing else is needed: no database, no keys, no X API.
What changes on your own host: the pages write links for the host they are served from (so your tip links point to your copy), and proofs are signed for your host. A proof page accepts proofs signed for dogejs.com and for its own host, nothing else. To make another host the default for links built in code, pass it as the base argument of tipLink, proofLink and bioLine, and the hosts you accept as allowedHosts of checkProof.