tiny-crypto-suite
Version:
Tiny tools, big crypto — seamless encryption and certificate handling for modern web and Node apps.
54 lines (49 loc) • 1.49 kB
JavaScript
;
var TinyBtcSecp256k1 = require('./Secp256k1/TinyBtcSecp256k1.cjs');
var index = require('./Secp256k1/index.cjs');
var TinyChainEvents = require('./TinyChainEvents.cjs');
var TinyChainBlock = require('./TinyChainBlock.cjs');
var TinyChainInstance = require('./TinyChainInstance.cjs');
var TinyEthSecp256k1 = require('./Secp256k1/TinyEthSecp256k1.cjs');
var TinySecp256k1Mock = require('./Secp256k1/TinySecp256k1Mock.cjs');
/**
*
* To create a working instance, use {@link TinyChain.Instance}, and {@link TinyChain.Events} to access the event names
*
* This class is in beta version!
*
* @beta
* @class
*/
class TinyChain {
static Instance = TinyChainInstance;
static Block = TinyChainBlock;
static Events = TinyChainEvents;
static Secp256k1 = index;
static Btc256k1 = TinyBtcSecp256k1;
static Eth256k1 = TinyEthSecp256k1;
static Mock256k1 = TinySecp256k1Mock;
/**
* This constructor is intentionally blocked.
*
* ⚠️ You must NOT instantiate TinyChain directly.
* To create a working instance, use {@link TinyChain.Instance}:
*
* ```js
* const client = new TinyChain.Instance();
* ```
*
* Access event constants with:
*
* ```js
* TinyChain.Events
* ```
*
* @constructor
* @throws {Error} Always throws an error to prevent direct instantiation.
*/
constructor() {
throw new Error('You must use new TinyChain.Instance() to create your new instance.');
}
}
module.exports = TinyChain;