Skip to content

Commit

Permalink
Strip various deprecated APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
martindale committed Nov 5, 2024
1 parent 1ded412 commit 96b90e3
Show file tree
Hide file tree
Showing 18 changed files with 971 additions and 2,584 deletions.
3,403 changes: 966 additions & 2,437 deletions API.md

Large diffs are not rendered by default.

12 changes: 0 additions & 12 deletions services/exchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,7 @@ const Collection = require('../types/collection');
const Message = require('../types/message');
const Service = require('../types/service');

/**
* Implements a basic Exchange.
*/
class Exchange extends Service {
/**
* Create an instance of the Exchange. You may run two instances at
* once to simulate two-party contracts, or use the Fabric Market to
* find and trade with real peers.
* @param {Object} settings Map of settings to values.
* @param {Object} settings.fees Map of fee settings (all values in BTC).
* @param {Object} settings.fees.minimum Minimum fee (satoshis).
* @returns Exchnge
*/
constructor (settings = {}) {
super(settings);

Expand Down
6 changes: 3 additions & 3 deletions services/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ const Service = require('../types/service');
const Message = require('../types/message');

/**
* Connect and subscribe to ZeroMQ servers.
* Connect and subscribe to Redis servers.
*/
class Redis extends Service {
/**
* Creates an instance of a ZeroMQ subscriber.
* Creates an instance of a Redis subscriber.
* @param {Object} [settings] Settings for the Redis connection.
* @param {String} [settings.host] Host for the Redis server.
* @param {Number} [settings.port] Remote ZeroMQ service port.
* @param {Number} [settings.port] Remote Redis service port.
* @returns {Redis} Instance of the Redis service, ready to run `start()`
*/
constructor (settings = {}) {
Expand Down
9 changes: 0 additions & 9 deletions types/aggregator.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,7 @@ const Service = require('./service');
const Actor = require('./actor');
const Tree = require('./tree');

/**
* Aggregates a set of balances (inputs).
*/
class Aggregator extends Service {
/**
* Create a new Aggregator.
* @param {Object} [settings] Map of configuration values.
* @param {Array} [settings.inputs] Array of {@link AnchorBalance} instances.
* @returns {Aggregator} Instance of the {@link Aggregator}.
*/
constructor (settings = {}) {
super(settings);

Expand Down
13 changes: 0 additions & 13 deletions types/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,7 @@ const Service = require('./service');
const Storage = require('./store');
// const Swarm = require('./swarm');

/**
* Web-friendly application framework for building single-page applications with
* Fabric-based networking and storage.
* @extends Service
* @property {Collection} components Interface elements.
* @property {Store} stash Routable {@link Datastore}.
*/
// class App extends Scribe {
class App extends Service {
/**
* Generic bundle for building Fabric applications.
* @param {Object} definition Application definition. See `config` for examples.
* @return {App} Returns an instance of `App`.
*/
constructor (definition = {}) {
super(definition);

Expand Down
2 changes: 1 addition & 1 deletion types/circuit.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const Actor = require('./actor');
* The {@link Circuit} is the mechanism through which {@link Fabric}
* operates, a computable directed graph describing a network of
* {@link Peer} components and their interactions (side effects).
* See also {@link Swarm} for deeper *inspection of {@link Machine}
* See also {@link Swarm} for deeper inspection of {@link Machine}
* mechanics.
*/
class Circuit extends Actor {
Expand Down
12 changes: 0 additions & 12 deletions types/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,7 @@ const Machine = require('./machine');
// ```
// This will auto-configure validation base from chain of greatest work.

/**
* Compilers build interfaces for users of Fabric applications.
* @type {Actor}
* @property {AST} ast Compiler's current AST.
* @property {Entity} entity Compiler's current {@link Entity}.
*/
class Compiler {
/**
* Create a new Compiler.
* @param {Object} settings={} Configuration.
* @param {Buffer} settings.body Body of the input program to compile.
* @return {Compiler} Instance of the compiler.
*/
constructor (settings = {}) {
this.settings = Object.assign({
ast: null,
Expand Down
9 changes: 0 additions & 9 deletions types/consensus.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,7 @@
// For node...
const bcoin = require('bcoin');

/**
* Provides various network-specific rules.
*/
class Consensus {
/**
* Create an instance of a {@link Consensus} verifier.
* @param {Object} [settings] Configuration for the network.
* @param {String} [settings.network] Name of the network.
* @param {String} [settings.provider] Name of the source provider.
*/
constructor (settings = {}) {
this.settings = Object.assign({
network: 'mainnet',
Expand Down
9 changes: 0 additions & 9 deletions types/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@
const crypto = require('crypto');
const { EventEmitter } = require('events');

/**
* Live instance of an ARC in Fabric.
* @type {Object}
*/
class Entity extends EventEmitter {
/**
* Generic template for virtual objects.
* @param {Object} [data={}] Pass an object to use.
* @return {Entity} Instance of the {@link Entity}.
*/
constructor (data = {}) {
super(data);

Expand Down
9 changes: 0 additions & 9 deletions types/keystore.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,7 @@ const Message = require('./message');
const Tree = require('./tree');
const Key = require('./key');

/**
* Provides an encrypted datastore for generic object storage.
*/
class Keystore extends Actor {
/**
* Create an instance of the Store.
* @param {FabricStoreConfiguration} [configuration] Settings to use.
* @param {String} [configuration.name="DefaultStore"] Name of the Store.
* @returns {Keystore} Instance of the store.
*/
constructor (settings = {}) {
super(settings);
if (!settings.seed) settings.seed = (process) ? process.env.FABRIC_SEED || null : null;
Expand Down
8 changes: 0 additions & 8 deletions types/mempool.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,7 @@ const Service = require('./service');
const Collection = require('./collection');
const Transaction = require('./transaction');

/**
* Stores a list of {@link Transaction} elements.
* @emits {Message} confirmed Emitted when the Mempool has dropped a transaction.
*/
class Mempool extends Service {
/**
* Creates an instance of a {@link Mempool} {@link Service}.
* @param {Object} settings Map of settings to utilize.
*/
constructor (settings = {}) {
super(settings);

Expand Down
8 changes: 0 additions & 8 deletions types/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,7 @@ const Service = require('../types/service');
const Environment = require('../types/environment');
const environment = new Environment();

/**
* Full definition of a Fabric node.
*/
class Node extends Service {
/**
* Manage a Fabric service.
* @param {Object} settings Configuration for the node.
* @returns {Node} Instance of the managed service.
*/
constructor (settings = {}) {
super(settings);

Expand Down
9 changes: 0 additions & 9 deletions types/oracle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,7 @@ const Machine = require('./machine');
const Resource = require('./resource');
const Store = require('./store');

/**
* An Oracle manages one or more collections, using a <code>mempool</code> for
* transitive state.
* @extends Store
*/
class Oracle extends Store {
/**
* Trusted point-of-reference for external services.
* @param {Object} initial - Initialization vector.
*/
constructor (init) {
super(init);

Expand Down
10 changes: 1 addition & 9 deletions types/path.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
'use strict';

/**
* A {@link Path} is a {@link Fabric}-native link to a {@link Document}
* within the network.
*/
class Path extends String {
/**
* Create a new {@link Path}.
* @param {String|Object} input Named path.
*/
constructor (input = {}) {
super(input);

Expand All @@ -31,4 +23,4 @@ class Path extends String {
}
}

module.exports = Path;
module.exports = Path;
8 changes: 0 additions & 8 deletions types/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,7 @@ const Scribe = require('./scribe');
// Current code is specific to @fabric/doorman — should be a general-
// purpose Router, not for strings and triggers in chat messages.

/**
* Process incoming messages.
* @extends Scribe
*/
class Router extends Scribe {
/**
* Maintains a list of triggers ("commands") and their behaviors.
* @param {Object} map Map of command names => behaviors.
*/
constructor (config) {
super(config);

Expand Down
10 changes: 0 additions & 10 deletions types/scribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,7 @@ const crypto = require('crypto');
// Fabric Components
const State = require('./state');

/**
* Simple tag-based recordkeeper.
* @extends State
* @property {Object} config Current configuration.
*/
class Scribe extends State {
/**
* The "Scribe" is a simple tag-based recordkeeper.
* @param {Object} config General configuration object.
* @param {Boolean} config.verbose Should the Scribe be noisy?
*/
constructor (config = {}) {
super(config);

Expand Down
10 changes: 0 additions & 10 deletions types/swap.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,7 @@ const bcoin = require('bcoin');
// Native Dependencies
const crypto = require('crypto');

/**
* The {@link Swap} contract executes a set of transactions on two distinct
* {@link Chain} components, utilizing a secret-reveal mechanism to atomically
* execute either the full set or none.
* @type {Object}
*/
class Swap {
/**
* Atomically execute a set of transactions across two {@link Chain} components.
* @param {Object} [settings={}] Configuration for the swap.
*/
constructor (settings = {}) {
this.settings = Object.assign({
chain: 'bitcoin:regtest'
Expand Down
8 changes: 0 additions & 8 deletions types/transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@ const EncryptedPromise = require('./promise');
const Entity = require('./entity');
const Witness = require('./witness');

/**
* The {@link Transition} type reflects a change from one finite
* {@link State} to another.
*/
class Transition extends Entity {
/**
*
* @param {Object} settings Configuration for the transition object.
*/
constructor (settings = {}) {
super(settings);

Expand Down

0 comments on commit 96b90e3

Please sign in to comment.