UNPKG

@paradeum/burrow

Version:

TypeScript library that calls a Hyperledger Burrow server over GRPC.

926 lines (794 loc) 25 kB
// source: acm.proto /** * @fileoverview * @enhanceable * @suppress {messageConventions} JS Compiler reports an error if a variable or * field starts with 'MSG_' and isn't a translatable message. * @public */ // GENERATED CODE -- DO NOT EDIT! var jspb = require('google-protobuf'); var goog = jspb; var global = Function('return this')(); var github_com_gogo_protobuf_gogoproto_gogo_pb = require('./github.com/gogo/protobuf/gogoproto/gogo_pb.js'); goog.object.extend(proto, github_com_gogo_protobuf_gogoproto_gogo_pb); var permission_pb = require('./permission_pb.js'); goog.object.extend(proto, permission_pb); var crypto_pb = require('./crypto_pb.js'); goog.object.extend(proto, crypto_pb); goog.exportSymbol('proto.acm.Account', null, global); goog.exportSymbol('proto.acm.ContractMeta', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.acm.Account = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.acm.Account.repeatedFields_, null); }; goog.inherits(proto.acm.Account, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.acm.Account.displayName = 'proto.acm.Account'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.acm.ContractMeta = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.acm.ContractMeta, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.acm.ContractMeta.displayName = 'proto.acm.ContractMeta'; } /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.acm.Account.repeatedFields_ = [9]; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.acm.Account.prototype.toObject = function(opt_includeInstance) { return proto.acm.Account.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.acm.Account} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.acm.Account.toObject = function(includeInstance, msg) { var f, obj = { address: msg.getAddress_asB64(), publickey: (f = msg.getPublickey()) && crypto_pb.PublicKey.toObject(includeInstance, f), sequence: jspb.Message.getFieldWithDefault(msg, 3, 0), balance: jspb.Message.getFieldWithDefault(msg, 4, 0), evmcode: msg.getEvmcode_asB64(), permissions: (f = msg.getPermissions()) && permission_pb.AccountPermissions.toObject(includeInstance, f), wasmcode: msg.getWasmcode_asB64(), nativename: jspb.Message.getFieldWithDefault(msg, 11, ""), codehash: msg.getCodehash_asB64(), contractmetaList: jspb.Message.toObjectList(msg.getContractmetaList(), proto.acm.ContractMeta.toObject, includeInstance), forebear: msg.getForebear_asB64() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.acm.Account} */ proto.acm.Account.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.acm.Account; return proto.acm.Account.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.acm.Account} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.acm.Account} */ proto.acm.Account.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setAddress(value); break; case 2: var value = new crypto_pb.PublicKey; reader.readMessage(value,crypto_pb.PublicKey.deserializeBinaryFromReader); msg.setPublickey(value); break; case 3: var value = /** @type {number} */ (reader.readUint64()); msg.setSequence(value); break; case 4: var value = /** @type {number} */ (reader.readUint64()); msg.setBalance(value); break; case 5: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setEvmcode(value); break; case 6: var value = new permission_pb.AccountPermissions; reader.readMessage(value,permission_pb.AccountPermissions.deserializeBinaryFromReader); msg.setPermissions(value); break; case 7: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setWasmcode(value); break; case 11: var value = /** @type {string} */ (reader.readString()); msg.setNativename(value); break; case 8: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setCodehash(value); break; case 9: var value = new proto.acm.ContractMeta; reader.readMessage(value,proto.acm.ContractMeta.deserializeBinaryFromReader); msg.addContractmeta(value); break; case 10: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setForebear(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.acm.Account.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.acm.Account.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.acm.Account} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.acm.Account.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getAddress_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getPublickey(); if (f != null) { writer.writeMessage( 2, f, crypto_pb.PublicKey.serializeBinaryToWriter ); } f = message.getSequence(); if (f !== 0) { writer.writeUint64( 3, f ); } f = message.getBalance(); if (f !== 0) { writer.writeUint64( 4, f ); } f = message.getEvmcode_asU8(); if (f.length > 0) { writer.writeBytes( 5, f ); } f = message.getPermissions(); if (f != null) { writer.writeMessage( 6, f, permission_pb.AccountPermissions.serializeBinaryToWriter ); } f = message.getWasmcode_asU8(); if (f.length > 0) { writer.writeBytes( 7, f ); } f = message.getNativename(); if (f.length > 0) { writer.writeString( 11, f ); } f = message.getCodehash_asU8(); if (f.length > 0) { writer.writeBytes( 8, f ); } f = message.getContractmetaList(); if (f.length > 0) { writer.writeRepeatedMessage( 9, f, proto.acm.ContractMeta.serializeBinaryToWriter ); } f = message.getForebear_asU8(); if (f.length > 0) { writer.writeBytes( 10, f ); } }; /** * optional bytes Address = 1; * @return {!(string|Uint8Array)} */ proto.acm.Account.prototype.getAddress = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes Address = 1; * This is a type-conversion wrapper around `getAddress()` * @return {string} */ proto.acm.Account.prototype.getAddress_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getAddress())); }; /** * optional bytes Address = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getAddress()` * @return {!Uint8Array} */ proto.acm.Account.prototype.getAddress_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getAddress())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.acm.Account} returns this */ proto.acm.Account.prototype.setAddress = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional crypto.PublicKey PublicKey = 2; * @return {?proto.crypto.PublicKey} */ proto.acm.Account.prototype.getPublickey = function() { return /** @type{?proto.crypto.PublicKey} */ ( jspb.Message.getWrapperField(this, crypto_pb.PublicKey, 2)); }; /** * @param {?proto.crypto.PublicKey|undefined} value * @return {!proto.acm.Account} returns this */ proto.acm.Account.prototype.setPublickey = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.acm.Account} returns this */ proto.acm.Account.prototype.clearPublickey = function() { return this.setPublickey(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.acm.Account.prototype.hasPublickey = function() { return jspb.Message.getField(this, 2) != null; }; /** * optional uint64 Sequence = 3; * @return {number} */ proto.acm.Account.prototype.getSequence = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {number} value * @return {!proto.acm.Account} returns this */ proto.acm.Account.prototype.setSequence = function(value) { return jspb.Message.setProto3IntField(this, 3, value); }; /** * optional uint64 Balance = 4; * @return {number} */ proto.acm.Account.prototype.getBalance = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); }; /** * @param {number} value * @return {!proto.acm.Account} returns this */ proto.acm.Account.prototype.setBalance = function(value) { return jspb.Message.setProto3IntField(this, 4, value); }; /** * optional bytes EVMCode = 5; * @return {!(string|Uint8Array)} */ proto.acm.Account.prototype.getEvmcode = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 5, "")); }; /** * optional bytes EVMCode = 5; * This is a type-conversion wrapper around `getEvmcode()` * @return {string} */ proto.acm.Account.prototype.getEvmcode_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getEvmcode())); }; /** * optional bytes EVMCode = 5; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getEvmcode()` * @return {!Uint8Array} */ proto.acm.Account.prototype.getEvmcode_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getEvmcode())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.acm.Account} returns this */ proto.acm.Account.prototype.setEvmcode = function(value) { return jspb.Message.setProto3BytesField(this, 5, value); }; /** * optional permission.AccountPermissions Permissions = 6; * @return {?proto.permission.AccountPermissions} */ proto.acm.Account.prototype.getPermissions = function() { return /** @type{?proto.permission.AccountPermissions} */ ( jspb.Message.getWrapperField(this, permission_pb.AccountPermissions, 6)); }; /** * @param {?proto.permission.AccountPermissions|undefined} value * @return {!proto.acm.Account} returns this */ proto.acm.Account.prototype.setPermissions = function(value) { return jspb.Message.setWrapperField(this, 6, value); }; /** * Clears the message field making it undefined. * @return {!proto.acm.Account} returns this */ proto.acm.Account.prototype.clearPermissions = function() { return this.setPermissions(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.acm.Account.prototype.hasPermissions = function() { return jspb.Message.getField(this, 6) != null; }; /** * optional bytes WASMCode = 7; * @return {!(string|Uint8Array)} */ proto.acm.Account.prototype.getWasmcode = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 7, "")); }; /** * optional bytes WASMCode = 7; * This is a type-conversion wrapper around `getWasmcode()` * @return {string} */ proto.acm.Account.prototype.getWasmcode_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getWasmcode())); }; /** * optional bytes WASMCode = 7; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getWasmcode()` * @return {!Uint8Array} */ proto.acm.Account.prototype.getWasmcode_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getWasmcode())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.acm.Account} returns this */ proto.acm.Account.prototype.setWasmcode = function(value) { return jspb.Message.setProto3BytesField(this, 7, value); }; /** * optional string NativeName = 11; * @return {string} */ proto.acm.Account.prototype.getNativename = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, "")); }; /** * @param {string} value * @return {!proto.acm.Account} returns this */ proto.acm.Account.prototype.setNativename = function(value) { return jspb.Message.setProto3StringField(this, 11, value); }; /** * optional bytes CodeHash = 8; * @return {!(string|Uint8Array)} */ proto.acm.Account.prototype.getCodehash = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 8, "")); }; /** * optional bytes CodeHash = 8; * This is a type-conversion wrapper around `getCodehash()` * @return {string} */ proto.acm.Account.prototype.getCodehash_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getCodehash())); }; /** * optional bytes CodeHash = 8; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getCodehash()` * @return {!Uint8Array} */ proto.acm.Account.prototype.getCodehash_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getCodehash())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.acm.Account} returns this */ proto.acm.Account.prototype.setCodehash = function(value) { return jspb.Message.setProto3BytesField(this, 8, value); }; /** * repeated ContractMeta ContractMeta = 9; * @return {!Array<!proto.acm.ContractMeta>} */ proto.acm.Account.prototype.getContractmetaList = function() { return /** @type{!Array<!proto.acm.ContractMeta>} */ ( jspb.Message.getRepeatedWrapperField(this, proto.acm.ContractMeta, 9)); }; /** * @param {!Array<!proto.acm.ContractMeta>} value * @return {!proto.acm.Account} returns this */ proto.acm.Account.prototype.setContractmetaList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 9, value); }; /** * @param {!proto.acm.ContractMeta=} opt_value * @param {number=} opt_index * @return {!proto.acm.ContractMeta} */ proto.acm.Account.prototype.addContractmeta = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 9, opt_value, proto.acm.ContractMeta, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.acm.Account} returns this */ proto.acm.Account.prototype.clearContractmetaList = function() { return this.setContractmetaList([]); }; /** * optional bytes Forebear = 10; * @return {!(string|Uint8Array)} */ proto.acm.Account.prototype.getForebear = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 10, "")); }; /** * optional bytes Forebear = 10; * This is a type-conversion wrapper around `getForebear()` * @return {string} */ proto.acm.Account.prototype.getForebear_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getForebear())); }; /** * optional bytes Forebear = 10; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getForebear()` * @return {!Uint8Array} */ proto.acm.Account.prototype.getForebear_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getForebear())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.acm.Account} returns this */ proto.acm.Account.prototype.setForebear = function(value) { return jspb.Message.setProto3BytesField(this, 10, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.acm.ContractMeta.prototype.toObject = function(opt_includeInstance) { return proto.acm.ContractMeta.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.acm.ContractMeta} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.acm.ContractMeta.toObject = function(includeInstance, msg) { var f, obj = { codehash: msg.getCodehash_asB64(), metadatahash: msg.getMetadatahash_asB64(), metadata: jspb.Message.getFieldWithDefault(msg, 3, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.acm.ContractMeta} */ proto.acm.ContractMeta.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.acm.ContractMeta; return proto.acm.ContractMeta.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.acm.ContractMeta} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.acm.ContractMeta} */ proto.acm.ContractMeta.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setCodehash(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setMetadatahash(value); break; case 3: var value = /** @type {string} */ (reader.readString()); msg.setMetadata(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.acm.ContractMeta.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.acm.ContractMeta.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.acm.ContractMeta} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.acm.ContractMeta.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getCodehash_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getMetadatahash_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } f = message.getMetadata(); if (f.length > 0) { writer.writeString( 3, f ); } }; /** * optional bytes CodeHash = 1; * @return {!(string|Uint8Array)} */ proto.acm.ContractMeta.prototype.getCodehash = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes CodeHash = 1; * This is a type-conversion wrapper around `getCodehash()` * @return {string} */ proto.acm.ContractMeta.prototype.getCodehash_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getCodehash())); }; /** * optional bytes CodeHash = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getCodehash()` * @return {!Uint8Array} */ proto.acm.ContractMeta.prototype.getCodehash_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getCodehash())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.acm.ContractMeta} returns this */ proto.acm.ContractMeta.prototype.setCodehash = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional bytes MetadataHash = 2; * @return {!(string|Uint8Array)} */ proto.acm.ContractMeta.prototype.getMetadatahash = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes MetadataHash = 2; * This is a type-conversion wrapper around `getMetadatahash()` * @return {string} */ proto.acm.ContractMeta.prototype.getMetadatahash_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getMetadatahash())); }; /** * optional bytes MetadataHash = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getMetadatahash()` * @return {!Uint8Array} */ proto.acm.ContractMeta.prototype.getMetadatahash_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getMetadatahash())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.acm.ContractMeta} returns this */ proto.acm.ContractMeta.prototype.setMetadatahash = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; /** * optional string Metadata = 3; * @return {string} */ proto.acm.ContractMeta.prototype.getMetadata = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * @param {string} value * @return {!proto.acm.ContractMeta} returns this */ proto.acm.ContractMeta.prototype.setMetadata = function(value) { return jspb.Message.setProto3StringField(this, 3, value); }; goog.object.extend(exports, proto.acm);