Initial update for the bitmessage-js package #1

Merged
PeterSurda merged 15 commits from lee.miller/bitmessage-js:mac into master 2024-03-08 01:55:30 +01:00
6 changed files with 27 additions and 26 deletions
Showing only changes of commit fdd941083d - Show all commits

View File

@ -11,7 +11,7 @@
* // Or create it from passphrase.
* var addr2 = Address.fromPassphrase("test");
* console.log("Deterministic Bitmessage address:", addr2.encode());
* @see {@link https://bitmessage.org/wiki/Address}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/address.html}
* @module bitmessage/address
*/
// TODO(Kagami): Document getters/setters.

View File

@ -1,8 +1,7 @@
/**
* Working with messages.
* @see {@link https://bitmessage.org/wiki/Protocol_specification#Message_types}
* @see {@link https://bitmessage.org/wiki/Protocol_specification_v3#Message_types}
* @see {@link https://bitmessage.org/Bitmessage%20Technical%20Paper.pdf}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#message-types}
* @see {@link https://wiki.bitmessage.org/w/index.php?title=Protocol_specification&oldid=23#Message_types}
* @module bitmessage/messages
* @example
* var structs = require("bitmessage").structs;
@ -30,6 +29,8 @@
* console.log(structs.message.decode(verackmsg).command); // verack
*/
// broken link: https://bitmessage.org/Bitmessage%20Technical%20Paper.pdf
"use strict";
var objectAssign = Object.assign || require("object-assign");
@ -71,7 +72,7 @@ exports.getCommand = function(buf) {
/**
* `version` message.
* @see {@link https://bitmessage.org/wiki/Protocol_specification#version}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#version}
* @namespace
* @static
*/
@ -277,7 +278,7 @@ function checkAddrOpts(opts) {
/**
* `addr` message. Provide information on known nodes of the network.
* @see {@link https://bitmessage.org/wiki/Protocol_specification#addr}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#addr}
* @namespace
* @static
*/
@ -357,7 +358,7 @@ var addr = exports.addr = {
/**
* `inv` message. Allows a node to advertise its knowledge of one or
* more objects.
* @see {@link https://bitmessage.org/wiki/Protocol_specification#inv}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#inv}
* @namespace
* @static
*/
@ -431,7 +432,7 @@ var inv = exports.inv = {
* `getdata` message. `getdata` is used in response to an
* [inv]{@link module:bitmessage/messages.inv} message to retrieve the
* content of a specific object after filtering known elements.
* @see {@link https://bitmessage.org/wiki/Protocol_specification#getdata}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#getdata}
* @namespace
*/
exports.getdata = objectAssign({}, inv, {

View File

@ -2,7 +2,7 @@
* Working with objects.
* NOTE: Most operations with objects are asynchronous and return
* promises.
* @see {@link https://bitmessage.org/wiki/Protocol_specification#Object_types}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#object-types}
* @module bitmessage/objects
*/
@ -85,7 +85,7 @@ function prependNonce(obj, opts) {
* `getpubkey` object. When a node has the hash of a public key (from an
* address) but not the public key itself, it must send out a request
* for the public key.
* @see {@link https://bitmessage.org/wiki/Protocol_specification#getpubkey}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#getpubkey}
* @namespace
* @static
*/
@ -246,7 +246,7 @@ function findAddrByTag(addrs, tag) {
/**
* `pubkey` object.
* @see {@link https://bitmessage.org/wiki/Protocol_specification#pubkey}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#pubkey}
* @namespace
* @static
*/
@ -562,7 +562,7 @@ function decodeMessage(message, encoding) {
/**
* `msg` object.
* @see {@link https://bitmessage.org/wiki/Protocol_specification#msg}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#msg}
* @namespace
* @static
*/
@ -871,7 +871,7 @@ function tryDecryptBroadcastV4(subscriptions, buf) {
/**
* `broadcast` object.
* @see {@link https://bitmessage.org/wiki/Protocol_specification#broadcast}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#broadcast}
* @namespace
* @static
*/

View File

@ -1,6 +1,6 @@
/**
* Implements proof of work.
* @see {@link https://bitmessage.org/wiki/Proof_of_work}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/pow.html}
* @module bitmessage/pow
*/

View File

@ -1,7 +1,7 @@
/**
* Implements common structures.
* @see {@link
* https://bitmessage.org/wiki/Protocol_specification#Common_structures}
* https://pybitmessage.rtfd.io/en/v0.6/protocol.html#common-structures}
* @module bitmessage/structs
* @example
* var structs = require("bitmessage").structs;
@ -93,7 +93,7 @@ function findMagic(buf) {
/**
* Message structure.
* @see {@link https://bitmessage.org/wiki/Protocol_specification#Message_structure}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#id1}
* @namespace
* @static
*/
@ -274,7 +274,7 @@ var message = exports.message = {
* An `object` is a message which is shared throughout a stream. It is
* the only message which propagates; all others are only between two
* nodes.
* @see {@link https://bitmessage.org/wiki/Protocol_specification#object}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#object}
* @namespace
* @static
*/
@ -499,7 +499,7 @@ var object = exports.object = {
/**
* Variable length integer.
* @see {@link https://bitmessage.org/wiki/Protocol_specification#Variable_length_integer}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#variable-length-integer}
* @namespace
* @static
*/
@ -602,7 +602,7 @@ var var_int = exports.var_int = {
/**
* Variable length string.
* @see {@link https://bitmessage.org/wiki/Protocol_specification#Variable_length_string}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#variable-length-string}
* @namespace
*/
exports.var_str = {
@ -646,7 +646,7 @@ exports.var_str = {
/**
* Variable length list of integers.
* @see {@link https://bitmessage.org/wiki/Protocol_specification#Variable_length_list_of_integers}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#variable-length-list-of-integers}
* @namespace
*/
exports.var_int_list = {
@ -712,7 +712,7 @@ function inet_ntop(buf) {
/**
* Network address.
* @see {@link https://bitmessage.org/wiki/Protocol_specification#Network_address}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#network-address}
* @namespace
*/
exports.net_addr = {
@ -814,7 +814,7 @@ exports.net_addr = {
/**
* Inventory vector.
* @see {@link https://bitmessage.org/wiki/Protocol_specification#Inventory_Vectors}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#inventory-vectors}
* @namespace
*/
exports.inv_vect = {
@ -833,7 +833,7 @@ exports.inv_vect = {
/**
* Encrypted payload.
* @see {@link https://bitmessage.org/wiki/Protocol_specification#Encrypted_payload}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#encrypted-payload}
* @namespace encrypted
* @static
*/
@ -940,7 +940,7 @@ var Bitfield = function(size) {
/**
* Service features bitfield (MSB 0).
* @see {@link https://bitmessage.org/wiki/Protocol_specification#version}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#version}
* @param {Buffer=} buf - A 8-byte bitfield buffer (will be created if
* not provided or will be copied if `opts.copy` is `true`)
* @param {Object=} opts - Options
@ -1006,7 +1006,7 @@ var ServicesBitfield = exports.ServicesBitfield = objectAssign(Bitfield(64), {
/**
* Pubkey features bitfield (MSB 0).
* @see {@link https://bitmessage.org/wiki/Protocol_specification#Pubkey_bitfield_features}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/protocol.html#pubkey-bitfield-features}
* @param {Buffer=} buf - A 4-byte bitfield buffer (will be created if
* not provided or will be copied if `opts.copy` is `true`)
* @param {Object=} opts - Options

View File

@ -1,6 +1,6 @@
/**
* Working with Bitmessage user agents.
* @see {@link https://bitmessage.org/wiki/User_Agent}
* @see {@link https://pybitmessage.rtfd.io/en/v0.6/useragent.html}
* @module bitmessage/user-agent
*/