@circles/timecircles
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

Time Circles (TC)

Time Circles (TC) are a time-dependent display unit for Circles.

The unit is rooted in the daily UBI payout every user receives in CRC and the fixed inflation rate. It normalizes the daily UBI payout to 24 TC regardless of the inflation.

Usage

import {crcToTc, tcToCrc} from "@circles/timecircles";

// Since TC are time-dependent we'll always need a timestamp
const transactionTimestamp = new Date("2022-05-03T04:21:25.000Z");
// The amount in CRC
const transactionCrcAmount = 8.566935185185093;  

// Convert to TC
const tcAmount = crcToTc(transactionTimestamp, transactionCrcAmount);
console.log(`${transactionCrcAmount} CRC are ${tcAmount} TC at ${transactionTimestamp}`);

// Convert back to CRC
const crcAmount = tcToCrc(transactionTimestamp, tcAmount);
console.log(`${crcAmount} TC are ${crcAmount} CRC at ${transactionTimestamp}`);

Readme

Keywords

Package Sidebar

Install

npm i @circles/timecircles

Weekly Downloads

95

Version

1.0.6

License

MIT

Unpacked Size

8.21 kB

Total Files

6

Last publish

Collaborators

  • jaensen
  • ingocollatz
  • thorstengnosis
  • mikozet
  • juanenrisley
  • jacquemate
  • andreasdz
  • lluna.creixent
  • louilinn