@hashgraph/proto
Version:
Protobufs for the Hiero SDK
856 lines (776 loc) • 2.77 MB
JavaScript
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
import * as $protobuf from "protobufjs/minimal";
// Common aliases
const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
// Exported root namespace
const $root = $protobuf.roots.hashgraph || ($protobuf.roots.hashgraph = {});
export const com = $root.com = (() => {
/**
* Namespace com.
* @exports com
* @namespace
*/
const com = {};
com.hedera = (function() {
/**
* Namespace hedera.
* @memberof com
* @namespace
*/
const hedera = {};
hedera.mirror = (function() {
/**
* Namespace mirror.
* @memberof com.hedera
* @namespace
*/
const mirror = {};
mirror.api = (function() {
/**
* Namespace api.
* @memberof com.hedera.mirror
* @namespace
*/
const api = {};
api.proto = (function() {
/**
* Namespace proto.
* @memberof com.hedera.mirror.api
* @namespace
*/
const proto = {};
proto.ConsensusTopicQuery = (function() {
/**
* Properties of a ConsensusTopicQuery.
* @memberof com.hedera.mirror.api.proto
* @interface IConsensusTopicQuery
* @property {proto.ITopicID|null} [topicID] A required topic ID to retrieve messages for.
* @property {proto.ITimestamp|null} [consensusStartTime] Include messages which reached consensus on or after this time. Defaults to current time if
* not set.
* @property {proto.ITimestamp|null} [consensusEndTime] Include messages which reached consensus before this time. If not set it will receive
* indefinitely.
* @property {Long|null} [limit] The maximum number of messages to receive before stopping. If not set or set to zero it will
* return messages indefinitely.
*/
/**
* Constructs a new ConsensusTopicQuery.
* @memberof com.hedera.mirror.api.proto
* @classdesc Represents a ConsensusTopicQuery.
* @implements IConsensusTopicQuery
* @constructor
* @param {com.hedera.mirror.api.proto.IConsensusTopicQuery=} [p] Properties to set
*/
function ConsensusTopicQuery(p) {
if (p)
for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
if (p[ks[i]] != null)
this[ks[i]] = p[ks[i]];
}
/**
* A required topic ID to retrieve messages for.
* @member {proto.ITopicID|null|undefined} topicID
* @memberof com.hedera.mirror.api.proto.ConsensusTopicQuery
* @instance
*/
ConsensusTopicQuery.prototype.topicID = null;
/**
* Include messages which reached consensus on or after this time. Defaults to current time if
* not set.
* @member {proto.ITimestamp|null|undefined} consensusStartTime
* @memberof com.hedera.mirror.api.proto.ConsensusTopicQuery
* @instance
*/
ConsensusTopicQuery.prototype.consensusStartTime = null;
/**
* Include messages which reached consensus before this time. If not set it will receive
* indefinitely.
* @member {proto.ITimestamp|null|undefined} consensusEndTime
* @memberof com.hedera.mirror.api.proto.ConsensusTopicQuery
* @instance
*/
ConsensusTopicQuery.prototype.consensusEndTime = null;
/**
* The maximum number of messages to receive before stopping. If not set or set to zero it will
* return messages indefinitely.
* @member {Long} limit
* @memberof com.hedera.mirror.api.proto.ConsensusTopicQuery
* @instance
*/
ConsensusTopicQuery.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
/**
* Creates a new ConsensusTopicQuery instance using the specified properties.
* @function create
* @memberof com.hedera.mirror.api.proto.ConsensusTopicQuery
* @static
* @param {com.hedera.mirror.api.proto.IConsensusTopicQuery=} [properties] Properties to set
* @returns {com.hedera.mirror.api.proto.ConsensusTopicQuery} ConsensusTopicQuery instance
*/
ConsensusTopicQuery.create = function create(properties) {
return new ConsensusTopicQuery(properties);
};
/**
* Encodes the specified ConsensusTopicQuery message. Does not implicitly {@link com.hedera.mirror.api.proto.ConsensusTopicQuery.verify|verify} messages.
* @function encode
* @memberof com.hedera.mirror.api.proto.ConsensusTopicQuery
* @static
* @param {com.hedera.mirror.api.proto.IConsensusTopicQuery} m ConsensusTopicQuery message or plain object to encode
* @param {$protobuf.Writer} [w] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ConsensusTopicQuery.encode = function encode(m, w) {
if (!w)
w = $Writer.create();
if (m.topicID != null && Object.hasOwnProperty.call(m, "topicID"))
$root.proto.TopicID.encode(m.topicID, w.uint32(10).fork()).ldelim();
if (m.consensusStartTime != null && Object.hasOwnProperty.call(m, "consensusStartTime"))
$root.proto.Timestamp.encode(m.consensusStartTime, w.uint32(18).fork()).ldelim();
if (m.consensusEndTime != null && Object.hasOwnProperty.call(m, "consensusEndTime"))
$root.proto.Timestamp.encode(m.consensusEndTime, w.uint32(26).fork()).ldelim();
if (m.limit != null && Object.hasOwnProperty.call(m, "limit"))
w.uint32(32).uint64(m.limit);
return w;
};
/**
* Decodes a ConsensusTopicQuery message from the specified reader or buffer.
* @function decode
* @memberof com.hedera.mirror.api.proto.ConsensusTopicQuery
* @static
* @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from
* @param {number} [l] Message length if known beforehand
* @returns {com.hedera.mirror.api.proto.ConsensusTopicQuery} ConsensusTopicQuery
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ConsensusTopicQuery.decode = function decode(r, l) {
if (!(r instanceof $Reader))
r = $Reader.create(r);
var c = l === undefined ? r.len : r.pos + l, m = new $root.com.hedera.mirror.api.proto.ConsensusTopicQuery();
while (r.pos < c) {
var t = r.uint32();
switch (t >>> 3) {
case 1: {
m.topicID = $root.proto.TopicID.decode(r, r.uint32());
break;
}
case 2: {
m.consensusStartTime = $root.proto.Timestamp.decode(r, r.uint32());
break;
}
case 3: {
m.consensusEndTime = $root.proto.Timestamp.decode(r, r.uint32());
break;
}
case 4: {
m.limit = r.uint64();
break;
}
default:
r.skipType(t & 7);
break;
}
}
return m;
};
/**
* Gets the default type url for ConsensusTopicQuery
* @function getTypeUrl
* @memberof com.hedera.mirror.api.proto.ConsensusTopicQuery
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ConsensusTopicQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/com.hedera.mirror.api.proto.ConsensusTopicQuery";
};
return ConsensusTopicQuery;
})();
proto.ConsensusTopicResponse = (function() {
/**
* Properties of a ConsensusTopicResponse.
* @memberof com.hedera.mirror.api.proto
* @interface IConsensusTopicResponse
* @property {proto.ITimestamp|null} [consensusTimestamp] The time at which the transaction reached consensus
* @property {Uint8Array|null} [message] The message body originally in the ConsensusSubmitMessageTransactionBody. Message size will
* be less than 6KiB.
* @property {Uint8Array|null} [runningHash] The running hash (SHA384) of every message.
* @property {Long|null} [sequenceNumber] Starts at 1 for first submitted message. Incremented on each submitted message.
* @property {Long|null} [runningHashVersion] Version of the SHA-384 digest used to update the running hash.
* @property {proto.IConsensusMessageChunkInfo|null} [chunkInfo] Optional information of the current chunk in a fragmented message.
*/
/**
* Constructs a new ConsensusTopicResponse.
* @memberof com.hedera.mirror.api.proto
* @classdesc Represents a ConsensusTopicResponse.
* @implements IConsensusTopicResponse
* @constructor
* @param {com.hedera.mirror.api.proto.IConsensusTopicResponse=} [p] Properties to set
*/
function ConsensusTopicResponse(p) {
if (p)
for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
if (p[ks[i]] != null)
this[ks[i]] = p[ks[i]];
}
/**
* The time at which the transaction reached consensus
* @member {proto.ITimestamp|null|undefined} consensusTimestamp
* @memberof com.hedera.mirror.api.proto.ConsensusTopicResponse
* @instance
*/
ConsensusTopicResponse.prototype.consensusTimestamp = null;
/**
* The message body originally in the ConsensusSubmitMessageTransactionBody. Message size will
* be less than 6KiB.
* @member {Uint8Array} message
* @memberof com.hedera.mirror.api.proto.ConsensusTopicResponse
* @instance
*/
ConsensusTopicResponse.prototype.message = $util.newBuffer([]);
/**
* The running hash (SHA384) of every message.
* @member {Uint8Array} runningHash
* @memberof com.hedera.mirror.api.proto.ConsensusTopicResponse
* @instance
*/
ConsensusTopicResponse.prototype.runningHash = $util.newBuffer([]);
/**
* Starts at 1 for first submitted message. Incremented on each submitted message.
* @member {Long} sequenceNumber
* @memberof com.hedera.mirror.api.proto.ConsensusTopicResponse
* @instance
*/
ConsensusTopicResponse.prototype.sequenceNumber = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
/**
* Version of the SHA-384 digest used to update the running hash.
* @member {Long} runningHashVersion
* @memberof com.hedera.mirror.api.proto.ConsensusTopicResponse
* @instance
*/
ConsensusTopicResponse.prototype.runningHashVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
/**
* Optional information of the current chunk in a fragmented message.
* @member {proto.IConsensusMessageChunkInfo|null|undefined} chunkInfo
* @memberof com.hedera.mirror.api.proto.ConsensusTopicResponse
* @instance
*/
ConsensusTopicResponse.prototype.chunkInfo = null;
/**
* Creates a new ConsensusTopicResponse instance using the specified properties.
* @function create
* @memberof com.hedera.mirror.api.proto.ConsensusTopicResponse
* @static
* @param {com.hedera.mirror.api.proto.IConsensusTopicResponse=} [properties] Properties to set
* @returns {com.hedera.mirror.api.proto.ConsensusTopicResponse} ConsensusTopicResponse instance
*/
ConsensusTopicResponse.create = function create(properties) {
return new ConsensusTopicResponse(properties);
};
/**
* Encodes the specified ConsensusTopicResponse message. Does not implicitly {@link com.hedera.mirror.api.proto.ConsensusTopicResponse.verify|verify} messages.
* @function encode
* @memberof com.hedera.mirror.api.proto.ConsensusTopicResponse
* @static
* @param {com.hedera.mirror.api.proto.IConsensusTopicResponse} m ConsensusTopicResponse message or plain object to encode
* @param {$protobuf.Writer} [w] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ConsensusTopicResponse.encode = function encode(m, w) {
if (!w)
w = $Writer.create();
if (m.consensusTimestamp != null && Object.hasOwnProperty.call(m, "consensusTimestamp"))
$root.proto.Timestamp.encode(m.consensusTimestamp, w.uint32(10).fork()).ldelim();
if (m.message != null && Object.hasOwnProperty.call(m, "message"))
w.uint32(18).bytes(m.message);
if (m.runningHash != null && Object.hasOwnProperty.call(m, "runningHash"))
w.uint32(26).bytes(m.runningHash);
if (m.sequenceNumber != null && Object.hasOwnProperty.call(m, "sequenceNumber"))
w.uint32(32).uint64(m.sequenceNumber);
if (m.runningHashVersion != null && Object.hasOwnProperty.call(m, "runningHashVersion"))
w.uint32(40).uint64(m.runningHashVersion);
if (m.chunkInfo != null && Object.hasOwnProperty.call(m, "chunkInfo"))
$root.proto.ConsensusMessageChunkInfo.encode(m.chunkInfo, w.uint32(50).fork()).ldelim();
return w;
};
/**
* Decodes a ConsensusTopicResponse message from the specified reader or buffer.
* @function decode
* @memberof com.hedera.mirror.api.proto.ConsensusTopicResponse
* @static
* @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from
* @param {number} [l] Message length if known beforehand
* @returns {com.hedera.mirror.api.proto.ConsensusTopicResponse} ConsensusTopicResponse
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ConsensusTopicResponse.decode = function decode(r, l) {
if (!(r instanceof $Reader))
r = $Reader.create(r);
var c = l === undefined ? r.len : r.pos + l, m = new $root.com.hedera.mirror.api.proto.ConsensusTopicResponse();
while (r.pos < c) {
var t = r.uint32();
switch (t >>> 3) {
case 1: {
m.consensusTimestamp = $root.proto.Timestamp.decode(r, r.uint32());
break;
}
case 2: {
m.message = r.bytes();
break;
}
case 3: {
m.runningHash = r.bytes();
break;
}
case 4: {
m.sequenceNumber = r.uint64();
break;
}
case 5: {
m.runningHashVersion = r.uint64();
break;
}
case 6: {
m.chunkInfo = $root.proto.ConsensusMessageChunkInfo.decode(r, r.uint32());
break;
}
default:
r.skipType(t & 7);
break;
}
}
return m;
};
/**
* Gets the default type url for ConsensusTopicResponse
* @function getTypeUrl
* @memberof com.hedera.mirror.api.proto.ConsensusTopicResponse
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ConsensusTopicResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/com.hedera.mirror.api.proto.ConsensusTopicResponse";
};
return ConsensusTopicResponse;
})();
proto.ConsensusService = (function() {
/**
* Constructs a new ConsensusService service.
* @memberof com.hedera.mirror.api.proto
* @classdesc The Mirror Service provides the ability to query a stream of Hedera Consensus Service (HCS)
* messages for an HCS Topic via a specific (possibly open-ended) time range.
* @extends $protobuf.rpc.Service
* @constructor
* @param {$protobuf.RPCImpl} rpcImpl RPC implementation
* @param {boolean} [requestDelimited=false] Whether requests are length-delimited
* @param {boolean} [responseDelimited=false] Whether responses are length-delimited
*/
function ConsensusService(rpcImpl, requestDelimited, responseDelimited) {
$protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
}
(ConsensusService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ConsensusService;
/**
* Creates new ConsensusService service using the specified rpc implementation.
* @function create
* @memberof com.hedera.mirror.api.proto.ConsensusService
* @static
* @param {$protobuf.RPCImpl} rpcImpl RPC implementation
* @param {boolean} [requestDelimited=false] Whether requests are length-delimited
* @param {boolean} [responseDelimited=false] Whether responses are length-delimited
* @returns {ConsensusService} RPC service. Useful where requests and/or responses are streamed.
*/
ConsensusService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
return new this(rpcImpl, requestDelimited, responseDelimited);
};
/**
* Callback as used by {@link com.hedera.mirror.api.proto.ConsensusService#subscribeTopic}.
* @memberof com.hedera.mirror.api.proto.ConsensusService
* @typedef subscribeTopicCallback
* @type {function}
* @param {Error|null} error Error, if any
* @param {com.hedera.mirror.api.proto.ConsensusTopicResponse} [response] ConsensusTopicResponse
*/
/**
* Calls subscribeTopic.
* @function subscribeTopic
* @memberof com.hedera.mirror.api.proto.ConsensusService
* @instance
* @param {com.hedera.mirror.api.proto.IConsensusTopicQuery} request ConsensusTopicQuery message or plain object
* @param {com.hedera.mirror.api.proto.ConsensusService.subscribeTopicCallback} callback Node-style callback called with the error, if any, and ConsensusTopicResponse
* @returns {undefined}
* @variation 1
*/
Object.defineProperty(ConsensusService.prototype.subscribeTopic = function subscribeTopic(request, callback) {
return this.rpcCall(subscribeTopic, $root.com.hedera.mirror.api.proto.ConsensusTopicQuery, $root.com.hedera.mirror.api.proto.ConsensusTopicResponse, request, callback);
}, "name", { value: "subscribeTopic" });
/**
* Calls subscribeTopic.
* @function subscribeTopic
* @memberof com.hedera.mirror.api.proto.ConsensusService
* @instance
* @param {com.hedera.mirror.api.proto.IConsensusTopicQuery} request ConsensusTopicQuery message or plain object
* @returns {Promise<com.hedera.mirror.api.proto.ConsensusTopicResponse>} Promise
* @variation 2
*/
return ConsensusService;
})();
proto.AddressBookQuery = (function() {
/**
* Properties of an AddressBookQuery.
* @memberof com.hedera.mirror.api.proto
* @interface IAddressBookQuery
* @property {proto.IFileID|null} [fileId] The ID of the address book file on the network. Can be either 0.0.101 or 0.0.102.
* @property {number|null} [limit] The maximum number of node addresses to receive before stopping. If not set or set to zero it will return all node addresses in the database.
*/
/**
* Constructs a new AddressBookQuery.
* @memberof com.hedera.mirror.api.proto
* @classdesc Request object to query an address book for its list of nodes
* @implements IAddressBookQuery
* @constructor
* @param {com.hedera.mirror.api.proto.IAddressBookQuery=} [p] Properties to set
*/
function AddressBookQuery(p) {
if (p)
for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
if (p[ks[i]] != null)
this[ks[i]] = p[ks[i]];
}
/**
* The ID of the address book file on the network. Can be either 0.0.101 or 0.0.102.
* @member {proto.IFileID|null|undefined} fileId
* @memberof com.hedera.mirror.api.proto.AddressBookQuery
* @instance
*/
AddressBookQuery.prototype.fileId = null;
/**
* The maximum number of node addresses to receive before stopping. If not set or set to zero it will return all node addresses in the database.
* @member {number} limit
* @memberof com.hedera.mirror.api.proto.AddressBookQuery
* @instance
*/
AddressBookQuery.prototype.limit = 0;
/**
* Creates a new AddressBookQuery instance using the specified properties.
* @function create
* @memberof com.hedera.mirror.api.proto.AddressBookQuery
* @static
* @param {com.hedera.mirror.api.proto.IAddressBookQuery=} [properties] Properties to set
* @returns {com.hedera.mirror.api.proto.AddressBookQuery} AddressBookQuery instance
*/
AddressBookQuery.create = function create(properties) {
return new AddressBookQuery(properties);
};
/**
* Encodes the specified AddressBookQuery message. Does not implicitly {@link com.hedera.mirror.api.proto.AddressBookQuery.verify|verify} messages.
* @function encode
* @memberof com.hedera.mirror.api.proto.AddressBookQuery
* @static
* @param {com.hedera.mirror.api.proto.IAddressBookQuery} m AddressBookQuery message or plain object to encode
* @param {$protobuf.Writer} [w] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
AddressBookQuery.encode = function encode(m, w) {
if (!w)
w = $Writer.create();
if (m.fileId != null && Object.hasOwnProperty.call(m, "fileId"))
$root.proto.FileID.encode(m.fileId, w.uint32(10).fork()).ldelim();
if (m.limit != null && Object.hasOwnProperty.call(m, "limit"))
w.uint32(16).int32(m.limit);
return w;
};
/**
* Decodes an AddressBookQuery message from the specified reader or buffer.
* @function decode
* @memberof com.hedera.mirror.api.proto.AddressBookQuery
* @static
* @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from
* @param {number} [l] Message length if known beforehand
* @returns {com.hedera.mirror.api.proto.AddressBookQuery} AddressBookQuery
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
AddressBookQuery.decode = function decode(r, l) {
if (!(r instanceof $Reader))
r = $Reader.create(r);
var c = l === undefined ? r.len : r.pos + l, m = new $root.com.hedera.mirror.api.proto.AddressBookQuery();
while (r.pos < c) {
var t = r.uint32();
switch (t >>> 3) {
case 1: {
m.fileId = $root.proto.FileID.decode(r, r.uint32());
break;
}
case 2: {
m.limit = r.int32();
break;
}
default:
r.skipType(t & 7);
break;
}
}
return m;
};
/**
* Gets the default type url for AddressBookQuery
* @function getTypeUrl
* @memberof com.hedera.mirror.api.proto.AddressBookQuery
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
AddressBookQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/com.hedera.mirror.api.proto.AddressBookQuery";
};
return AddressBookQuery;
})();
proto.NetworkService = (function() {
/**
* Constructs a new NetworkService service.
* @memberof com.hedera.mirror.api.proto
* @classdesc Provides cross network APIs like address book queries
* @extends $protobuf.rpc.Service
* @constructor
* @param {$protobuf.RPCImpl} rpcImpl RPC implementation
* @param {boolean} [requestDelimited=false] Whether requests are length-delimited
* @param {boolean} [responseDelimited=false] Whether responses are length-delimited
*/
function NetworkService(rpcImpl, requestDelimited, responseDelimited) {
$protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
}
(NetworkService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = NetworkService;
/**
* Creates new NetworkService service using the specified rpc implementation.
* @function create
* @memberof com.hedera.mirror.api.proto.NetworkService
* @static
* @param {$protobuf.RPCImpl} rpcImpl RPC implementation
* @param {boolean} [requestDelimited=false] Whether requests are length-delimited
* @param {boolean} [responseDelimited=false] Whether responses are length-delimited
* @returns {NetworkService} RPC service. Useful where requests and/or responses are streamed.
*/
NetworkService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
return new this(rpcImpl, requestDelimited, responseDelimited);
};
/**
* Callback as used by {@link com.hedera.mirror.api.proto.NetworkService#getNodes}.
* @memberof com.hedera.mirror.api.proto.NetworkService
* @typedef getNodesCallback
* @type {function}
* @param {Error|null} error Error, if any
* @param {proto.NodeAddress} [response] NodeAddress
*/
/**
* Calls getNodes.
* @function getNodes
* @memberof com.hedera.mirror.api.proto.NetworkService
* @instance
* @param {com.hedera.mirror.api.proto.IAddressBookQuery} request AddressBookQuery message or plain object
* @param {com.hedera.mirror.api.proto.NetworkService.getNodesCallback} callback Node-style callback called with the error, if any, and NodeAddress
* @returns {undefined}
* @variation 1
*/
Object.defineProperty(NetworkService.prototype.getNodes = function getNodes(request, callback) {
return this.rpcCall(getNodes, $root.com.hedera.mirror.api.proto.AddressBookQuery, $root.proto.NodeAddress, request, callback);
}, "name", { value: "getNodes" });
/**
* Calls getNodes.
* @function getNodes
* @memberof com.hedera.mirror.api.proto.NetworkService
* @instance
* @param {com.hedera.mirror.api.proto.IAddressBookQuery} request AddressBookQuery message or plain object
* @returns {Promise<proto.NodeAddress>} Promise
* @variation 2
*/
return NetworkService;
})();
return proto;
})();
return api;
})();
return mirror;
})();
hedera.hapi = (function() {
/**
* Namespace hapi.
* @memberof com.hedera
* @namespace
*/
const hapi = {};
hapi.node = (function() {
/**
* Namespace node.
* @memberof com.hedera.hapi
* @namespace
*/
const node = {};
node.addressbook = (function() {
/**
* Namespace addressbook.
* @memberof com.hedera.hapi.node
* @namespace
*/
const addressbook = {};
addressbook.NodeCreateTransactionBody = (function() {
/**
* Properties of a NodeCreateTransactionBody.
* @memberof com.hedera.hapi.node.addressbook
* @interface INodeCreateTransactionBody
* @property {proto.IAccountID|null} [accountId] A Node account identifier.
* <p>
* This account identifier MUST be in the "account number" form.<br/>
* This account identifier MUST NOT use the alias field.<br/>
* If the identified account does not exist, this transaction SHALL fail.<br/>
* Multiple nodes MAY share the same node account.<br/>
* This field is REQUIRED.
* @property {string|null} [description] A short description of the node.
* <p>
* This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes`
* (default 100) bytes when encoded as UTF-8.<br/>
* This field is OPTIONAL.
* @property {Array.<proto.IServiceEndpoint>|null} [gossipEndpoint] A list of service endpoints for gossip.
* <p>
* These endpoints SHALL represent the published endpoints to which other
* consensus nodes may _gossip_ transactions.<br/>
* These endpoints MUST specify a port.<br/>
* This list MUST NOT be empty.<br/>
* This list MUST NOT contain more than `10` entries.<br/>
* The first two entries in this list SHALL be the endpoints published to
* all consensus nodes.<br/>
* All other entries SHALL be reserved for future use.
* <p>
* Each network may have additional requirements for these endpoints.
* A client MUST check network-specific documentation for those
* details.<br/>
* If the network configuration value `gossipFqdnRestricted` is set, then
* all endpoints in this list MUST supply only IP address.<br/>
* If the network configuration value `gossipFqdnRestricted` is _not_ set,
* then endpoints in this list MAY supply either IP address or FQDN, but
* MUST NOT supply both values for the same endpoint.
* @property {Array.<proto.IServiceEndpoint>|null} [serviceEndpoint] A list of service endpoints for gRPC calls.
* <p>
* These endpoints SHALL represent the published gRPC endpoints to which
* clients may submit transactions.<br/>
* These endpoints MUST specify a port.<br/>
* Endpoints in this list MAY supply either IP address or FQDN, but MUST
* NOT supply both values for the same endpoint.<br/>
* This list MUST NOT be empty.<br/>
* This list MUST NOT contain more than `8` entries.
* @property {Uint8Array|null} [gossipCaCertificate] A certificate used to sign gossip events.
* <p>
* This value MUST be a certificate of a type permitted for gossip
* signatures.<br/>
* This value MUST be the DER encoding of the certificate presented.<br/>
* This field is REQUIRED and MUST NOT be empty.
* @property {Uint8Array|null} [grpcCertificateHash] A hash of the node gRPC TLS certificate.
* <p>
* This value MAY be used to verify the certificate presented by the node
* during TLS negotiation for gRPC.<br/>
* This value MUST be a SHA-384 hash.<br/>
* The TLS certificate to be hashed MUST first be in PEM format and MUST be
* encoded with UTF-8 NFKD encoding to a stream of bytes provided to
* the hash algorithm.<br/>
* This field is OPTIONAL.
* @property {proto.IKey|null} [adminKey] An administrative key controlled by the node operator.
* <p>
* This key MUST sign this transaction.<br/>
* This key MUST sign each transaction to update this node.<br/>
* This field MUST contain a valid `Key` value.<br/>
* This field is REQUIRED and MUST NOT be set to an empty `KeyList`.
* @property {boolean|null} [declineReward] A boolean flag indicating whether the node operator declines to receive
* node rewards.
* <p>
* If this flag is set to `true`, the node operator declines to receive
* node rewards.<br/>
* @property {proto.IServiceEndpoint|null} [grpcProxyEndpoint] A web proxy for gRPC from non-gRPC clients.
* <p>
* This endpoint SHALL be a Fully Qualified Domain Name (FQDN) using the HTTPS
* protocol, and SHALL support gRPC-Web for use by browser-based clients.<br/>
* This endpoint MUST be signed by a trusted certificate authority.<br/>
* This endpoint MUST use a valid port and SHALL be reachable over TLS.<br/>
* This field MAY be omitted if the node does not support gRPC-Web access.<br/>
* This field MUST be updated if the gRPC-Web endpoint changes.<br/>
* This field SHALL enable frontend clients to avoid hard-coded proxy endpoints.
*/
/**
* Constructs a new NodeCreateTransactionBody.
* @memberof com.hedera.hapi.node.addressbook
* @classdesc A transaction body to add a new consensus node to the network address book.
*
* This transaction body SHALL be considered a "privileged transaction".
*
* This message supports a transaction to create a new node in the network
* address book. The transaction, once complete, enables a new consensus node
* to join the network, and requires governing council authorization.
*
* - A `NodeCreateTransactionBody` MUST be signed by the `Key` assigned to the
* `admin_key` field and one of those keys: treasure account (2) key,
* systemAdmin(50) key, or addressBookAdmin(55) key.
* - The newly created node information SHALL be added to the network address
* book information in the network state.
* - The new entry SHALL be created in "state" but SHALL NOT participate in
* network consensus and SHALL NOT be present in network "configuration"
* until the next "upgrade" transaction (as noted below).
* - All new address book entries SHALL be added to the active network
* configuration during the next `freeze` transaction with the field
* `freeze_type` set to `PREPARE_UPGRADE`.
*
* ### Block Stream Effects
* Upon completion the newly assigned `node_id` SHALL be recorded in
* the transaction receipt.<br/>
* This value SHALL be the next available node identifier.<br/>
* Node identifiers SHALL NOT be reused.
* @implements INodeCreateTransactionBody
* @constructor
* @param {com.hedera.hapi.node.addressbook.INodeCreateTransactionBody=} [p] Properties to set
*/
function NodeCreateTransactionBody(p) {
this.gossipEndpoint = [];
this.serviceEndpoint = [];
if (p)
for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
if (p[ks[i]] != null)
this[ks[i]] = p[ks[i]];
}
/**
* A Node account identifier.
* <p>
* This account identifier MUST be in the "account number" form.<br/>
* This account identifier MUST NOT use the alias field.<br/>
* If the identified account does not exist, this transaction SHALL fail.<br/>
* Multiple nodes MAY share the same node account.<br/>
* This field is REQUIRED.
* @member {proto.IAccountID|null|undefined} accountId
* @memberof com.hedera.hapi.node.addressbook.NodeCreateTransactionBody
* @instance
*/
NodeCreateTransactionBody.prototype.accountId = null;
/**
* A short description of the node.
* <p>
* This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes`
* (default 100) bytes when encoded as UTF-8.<br/>
* This field is OPTIONAL.
* @member {string} description
* @memberof com.hedera.hapi.node.addressbook.NodeCreateTransactionBody
* @instance
*/
NodeCreateTransactionBody.prototype.description = "";
/**
* A list of service endpoints for gossip.
* <p>
* These endpoints SHALL represent the published endpoints to which other
* consensus nodes may _gossip_ transactions.<br/>
* These endpoints MUST specify a port.<br/>
* This list MUST NOT be empty.<br/>
* This list MUST NOT contain more than `10` entries.<br/>