Post
Topic
Board Development & Technical Discussion
Re: Pure TypeScript library to operate with sats (zero-dependencies)
by
ETFbitcoin
on 30/08/2023, 12:17:21 UTC
I did quick test with few inscription and it seems to works properly. So here are few of my thought,
1. Is it right to assume your library only have function to look for sat properties of Ordinals inscription based on one of known value (e.g. decimal)?
2. It annoys me fromDecimal require me to enter string rather than decimal.

Code:
> Sat.fromDecimal(313225.1127208201)
<repl>.ts:29:17 - error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.

29 Sat.fromDecimal(313225.1127208201)
> Sat.fromDecimal("313225.1127208201")
Sat { n: 1308063627208201 }

3. Function fromString with parameter sat initially confuse me. Different name such as fromSat or fromSatNumber probably would be better.