0.0.1 • Published 2 years ago

replit-cycles v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Cycles

Usage:

const cycles = new Cycles(1); // 1 is userid

await cycles.balance(); // balance in cycles
await cycles.send({ to: user, description: 'tip', nanos: 42 });

balance()

returns users balance

send({ to: userID, nanos: number, description: string, metadata: string})

Send nanocycles to a user. You can add arbitrary description and metadata to the transaction.

list()

List all the user's transactions.

listAll()

List the entire ledger.

escrow({ particpants: { userID, nanos } })

Escrows nanocycles for a number of particpants. The total nanos should add up to 0.

closeEscrow({ uuid, success: boolean })

Succeeds or rollbacks the escrow.