Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.
/ timecircle Public archive

Time Circles (TC) are a time-dependent display unit for Circles (CRC). This repo contains functions to convert between CRC and TC.

License

Notifications You must be signed in to change notification settings

circlesland/timecircle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 "@jaensen/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}`);

About

Time Circles (TC) are a time-dependent display unit for Circles (CRC). This repo contains functions to convert between CRC and TC.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published