Web Contract to init a ledger


GitHub license npm npm Github Stars

⚡️ Introduction

Init is a web contract to init a ledger

Data Model


 "@type": "Wallet",
 "webledger": "./webledger.json",
 "webcredits": "./webcredits.json",
 "currency": "Mark"

Web Credit

Here is a full example of a Web Credits Object

  "@id": "urn:cuid:a74xt3jbin",
  "@type": "Credit",
  "source": ""
  "amount": 100,
  "currency": "Mark",
  "destination": "",
  "description": "for technical help",
  "context": "",
  "timestamp": 1640111035

Web Ledger

A web ledger in this case can be derived from the credit object

Both the webledger and the web credits will appear as JSON in the webcredits directory, which is in the .gitignore so that it can be a separate entity

Web Contract

The Web Contract is a single file that operates on the webcredits data store and is described here


Currently signing is done out of band using the gitmark protocol, but explicit signing will be added, in future

✍️ API


The following switches are allowed

--id          # the id for the wallet object
--currency    # the currency
--walletFile  # the wallet file
--creditFile  # the webcredits file
--ledgerFile  # the webledgers file
--indir       # the webcredits directory, defaults to ./webcredits

or from npm

import init from 'webcontracts-init'

var wallet = {
  currency: data.currency

function init(wallet, indir, walletFile, ledgerFile, creditsFile)

indir, infile, walletFile, ledgerFile and creditsFile are optional and will default to ../webcredits/webcredits.json

⚖️ License