Import Decimal in cli
This commit is contained in:
parent
7f705fcb53
commit
5e26a8605f
@ -73,6 +73,7 @@ export function main(originalArgs: readonly string[]): void {
|
||||
[
|
||||
"Bech32",
|
||||
"Encoding",
|
||||
"Decimal",
|
||||
// integers
|
||||
"Int53",
|
||||
"Uint32",
|
||||
@ -133,6 +134,8 @@ export function main(originalArgs: readonly string[]): void {
|
||||
const decoded = fromAscii(fromBase64(fromUtf8(fromHex(encoded))));
|
||||
assert(decoded === original);
|
||||
|
||||
assert(Decimal.fromAtomics("12870000", 6).toString() === "12.87");
|
||||
|
||||
const mnemonic = Bip39.encode(Random.getBytes(16)).toString();
|
||||
const pen = await Secp256k1Pen.fromMnemonic(mnemonic);
|
||||
const pubkey = encodeSecp256k1Pubkey(pen.pubkey);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user