Story behind in advance: I came back from EVM to check do I have exotic/rare sats on my wallet from 2017 (still HODL with 600% profit) and found (thanks for early builders) few polindromes. But during exploration I found lack of JS lib to operate with sats (convert from one to another notation, parse from strings and etc). I decided to fill the gap with 0-dependency implementation on pure TS and publish as open-source public npm module.
https://github.com/tookey-io/sats — source-code
https://www.npmjs.com/package/@tookey-io/sats — npm library
Here is simple example:
Code:
import { Sat } from "@tookey-io/sats";
const sat = Sat.fromName("alerdenisov");
console.log("alerdenisov sat #" + sat.n); // 1892488848343776
console.log("alerdenisov sat mine height: " + sat.decimal.height.n); // 717982
console.log("alerdenisov sat mine offset: " + sat.decimal.offset); // 98343776
I would like to see your feedback and stars on github!
PS: API is simple and partially documented and very welcome to contribute typedoc if you free to
PSS: Rarity and exotic checks for sats are coming with v0.1.0