getParserForType() {
+ return PARSER;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.ServerVersion getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface InitiateOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:paymentchannels.Initiate)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is used only in the creation of the multisig contract, as outputs are
+ * created entirely by the secondary
+ *
+ *
+ * required bytes multisig_key = 1;
+ */
+ boolean hasMultisigKey();
+ /**
+ *
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is used only in the creation of the multisig contract, as outputs are
+ * created entirely by the secondary
+ *
+ *
+ * required bytes multisig_key = 1;
+ */
+ com.google.protobuf.ByteString getMultisigKey();
+
+ /**
+ *
+ * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+ * size it's willing to accept here. This can be lower to trade off resources against
+ * security but shouldn't be so low the transactions get rejected by the network as spam.
+ * Zero isn't a sensible value to have here, so we make the field required.
+ *
+ *
+ * required uint64 min_accepted_channel_size = 2;
+ */
+ boolean hasMinAcceptedChannelSize();
+ /**
+ *
+ * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+ * size it's willing to accept here. This can be lower to trade off resources against
+ * security but shouldn't be so low the transactions get rejected by the network as spam.
+ * Zero isn't a sensible value to have here, so we make the field required.
+ *
+ *
+ * required uint64 min_accepted_channel_size = 2;
+ */
+ long getMinAcceptedChannelSize();
+
+ /**
+ *
+ * Rough UNIX time for when the channel expires. This is determined by the block header
+ * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+ * Channels could also be specified in terms of block heights but then how do you know the
+ * current chain height if you don't have internet access? Trust the server? Probably opens up
+ * attack vectors. We can assume the client has an independent clock, however. If the client
+ * considers this value too far off (eg more than a day), it may send an ERROR and close the
+ * channel.
+ *
+ *
+ * required uint64 expire_time_secs = 3;
+ */
+ boolean hasExpireTimeSecs();
+ /**
+ *
+ * Rough UNIX time for when the channel expires. This is determined by the block header
+ * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+ * Channels could also be specified in terms of block heights but then how do you know the
+ * current chain height if you don't have internet access? Trust the server? Probably opens up
+ * attack vectors. We can assume the client has an independent clock, however. If the client
+ * considers this value too far off (eg more than a day), it may send an ERROR and close the
+ * channel.
+ *
+ *
+ * required uint64 expire_time_secs = 3;
+ */
+ long getExpireTimeSecs();
+
+ /**
+ *
+ * The amount of money the server requires for the initial payment. The act of opening a channel
+ * always transfers some quantity of money to the server: it's impossible to have a channel with
+ * zero value transferred. This rule ensures that you can't get a channel that can't be settled
+ * due to having paid under the dust limit. Because the dust limit will float in future, the
+ * server tells the client what it thinks it is, and the client is supposed to sanity check this
+ * value.
+ *
+ *
+ * required uint64 min_payment = 4;
+ */
+ boolean hasMinPayment();
+ /**
+ *
+ * The amount of money the server requires for the initial payment. The act of opening a channel
+ * always transfers some quantity of money to the server: it's impossible to have a channel with
+ * zero value transferred. This rule ensures that you can't get a channel that can't be settled
+ * due to having paid under the dust limit. Because the dust limit will float in future, the
+ * server tells the client what it thinks it is, and the client is supposed to sanity check this
+ * value.
+ *
+ *
+ * required uint64 min_payment = 4;
+ */
+ long getMinPayment();
+ }
+ /**
+ *
+ * Sent from server to client once version nego is done.
+ *
+ *
+ * Protobuf type {@code paymentchannels.Initiate}
+ */
+ public static final class Initiate extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:paymentchannels.Initiate)
+ InitiateOrBuilder {
+ // Use Initiate.newBuilder() to construct.
+ private Initiate(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private Initiate() {
+ multisigKey_ = com.google.protobuf.ByteString.EMPTY;
+ minAcceptedChannelSize_ = 0L;
+ expireTimeSecs_ = 0L;
+ minPayment_ = 0L;
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Initiate(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ bitField0_ |= 0x00000001;
+ multisigKey_ = input.readBytes();
+ break;
+ }
+ case 16: {
+ bitField0_ |= 0x00000002;
+ minAcceptedChannelSize_ = input.readUInt64();
+ break;
+ }
+ case 24: {
+ bitField0_ |= 0x00000004;
+ expireTimeSecs_ = input.readUInt64();
+ break;
+ }
+ case 32: {
+ bitField0_ |= 0x00000008;
+ minPayment_ = input.readUInt64();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.bitcoin.paymentchannel.Protos.Initiate.class, org.bitcoin.paymentchannel.Protos.Initiate.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int MULTISIG_KEY_FIELD_NUMBER = 1;
+ private com.google.protobuf.ByteString multisigKey_;
+ /**
+ *
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is used only in the creation of the multisig contract, as outputs are
+ * created entirely by the secondary
+ *
+ *
+ * required bytes multisig_key = 1;
+ */
+ public boolean hasMultisigKey() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ *
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is used only in the creation of the multisig contract, as outputs are
+ * created entirely by the secondary
+ *
+ *
+ * required bytes multisig_key = 1;
+ */
+ public com.google.protobuf.ByteString getMultisigKey() {
+ return multisigKey_;
+ }
+
+ public static final int MIN_ACCEPTED_CHANNEL_SIZE_FIELD_NUMBER = 2;
+ private long minAcceptedChannelSize_;
+ /**
+ *
+ * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+ * size it's willing to accept here. This can be lower to trade off resources against
+ * security but shouldn't be so low the transactions get rejected by the network as spam.
+ * Zero isn't a sensible value to have here, so we make the field required.
+ *
+ *
+ * required uint64 min_accepted_channel_size = 2;
+ */
+ public boolean hasMinAcceptedChannelSize() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ *
+ * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+ * size it's willing to accept here. This can be lower to trade off resources against
+ * security but shouldn't be so low the transactions get rejected by the network as spam.
+ * Zero isn't a sensible value to have here, so we make the field required.
+ *
+ *
+ * required uint64 min_accepted_channel_size = 2;
+ */
+ public long getMinAcceptedChannelSize() {
+ return minAcceptedChannelSize_;
+ }
+
+ public static final int EXPIRE_TIME_SECS_FIELD_NUMBER = 3;
+ private long expireTimeSecs_;
+ /**
+ *
+ * Rough UNIX time for when the channel expires. This is determined by the block header
+ * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+ * Channels could also be specified in terms of block heights but then how do you know the
+ * current chain height if you don't have internet access? Trust the server? Probably opens up
+ * attack vectors. We can assume the client has an independent clock, however. If the client
+ * considers this value too far off (eg more than a day), it may send an ERROR and close the
+ * channel.
+ *
+ *
+ * required uint64 expire_time_secs = 3;
+ */
+ public boolean hasExpireTimeSecs() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ *
+ * Rough UNIX time for when the channel expires. This is determined by the block header
+ * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+ * Channels could also be specified in terms of block heights but then how do you know the
+ * current chain height if you don't have internet access? Trust the server? Probably opens up
+ * attack vectors. We can assume the client has an independent clock, however. If the client
+ * considers this value too far off (eg more than a day), it may send an ERROR and close the
+ * channel.
+ *
+ *
+ * required uint64 expire_time_secs = 3;
+ */
+ public long getExpireTimeSecs() {
+ return expireTimeSecs_;
+ }
+
+ public static final int MIN_PAYMENT_FIELD_NUMBER = 4;
+ private long minPayment_;
+ /**
+ *
+ * The amount of money the server requires for the initial payment. The act of opening a channel
+ * always transfers some quantity of money to the server: it's impossible to have a channel with
+ * zero value transferred. This rule ensures that you can't get a channel that can't be settled
+ * due to having paid under the dust limit. Because the dust limit will float in future, the
+ * server tells the client what it thinks it is, and the client is supposed to sanity check this
+ * value.
+ *
+ *
+ * required uint64 min_payment = 4;
+ */
+ public boolean hasMinPayment() {
+ return ((bitField0_ & 0x00000008) == 0x00000008);
+ }
+ /**
+ *
+ * The amount of money the server requires for the initial payment. The act of opening a channel
+ * always transfers some quantity of money to the server: it's impossible to have a channel with
+ * zero value transferred. This rule ensures that you can't get a channel that can't be settled
+ * due to having paid under the dust limit. Because the dust limit will float in future, the
+ * server tells the client what it thinks it is, and the client is supposed to sanity check this
+ * value.
+ *
+ *
+ * required uint64 min_payment = 4;
+ */
+ public long getMinPayment() {
+ return minPayment_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (!hasMultisigKey()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!hasMinAcceptedChannelSize()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!hasExpireTimeSecs()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!hasMinPayment()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, multisigKey_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeUInt64(2, minAcceptedChannelSize_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ output.writeUInt64(3, expireTimeSecs_);
+ }
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ output.writeUInt64(4, minPayment_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, multisigKey_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt64Size(2, minAcceptedChannelSize_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt64Size(3, expireTimeSecs_);
+ }
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt64Size(4, minPayment_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof org.bitcoin.paymentchannel.Protos.Initiate)) {
+ return super.equals(obj);
+ }
+ org.bitcoin.paymentchannel.Protos.Initiate other = (org.bitcoin.paymentchannel.Protos.Initiate) obj;
+
+ boolean result = true;
+ result = result && (hasMultisigKey() == other.hasMultisigKey());
+ if (hasMultisigKey()) {
+ result = result && getMultisigKey()
+ .equals(other.getMultisigKey());
+ }
+ result = result && (hasMinAcceptedChannelSize() == other.hasMinAcceptedChannelSize());
+ if (hasMinAcceptedChannelSize()) {
+ result = result && (getMinAcceptedChannelSize()
+ == other.getMinAcceptedChannelSize());
+ }
+ result = result && (hasExpireTimeSecs() == other.hasExpireTimeSecs());
+ if (hasExpireTimeSecs()) {
+ result = result && (getExpireTimeSecs()
+ == other.getExpireTimeSecs());
+ }
+ result = result && (hasMinPayment() == other.hasMinPayment());
+ if (hasMinPayment()) {
+ result = result && (getMinPayment()
+ == other.getMinPayment());
+ }
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptorForType().hashCode();
+ if (hasMultisigKey()) {
+ hash = (37 * hash) + MULTISIG_KEY_FIELD_NUMBER;
+ hash = (53 * hash) + getMultisigKey().hashCode();
+ }
+ if (hasMinAcceptedChannelSize()) {
+ hash = (37 * hash) + MIN_ACCEPTED_CHANNEL_SIZE_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getMinAcceptedChannelSize());
+ }
+ if (hasExpireTimeSecs()) {
+ hash = (37 * hash) + EXPIRE_TIME_SECS_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getExpireTimeSecs());
+ }
+ if (hasMinPayment()) {
+ hash = (37 * hash) + MIN_PAYMENT_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getMinPayment());
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Initiate parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Initiate parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.Initiate prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ *
+ * Sent from server to client once version nego is done.
+ *
+ *
+ * Protobuf type {@code paymentchannels.Initiate}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:paymentchannels.Initiate)
+ org.bitcoin.paymentchannel.Protos.InitiateOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.bitcoin.paymentchannel.Protos.Initiate.class, org.bitcoin.paymentchannel.Protos.Initiate.Builder.class);
+ }
+
+ // Construct using org.bitcoin.paymentchannel.Protos.Initiate.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ }
+ }
+ public Builder clear() {
+ super.clear();
+ multisigKey_ = com.google.protobuf.ByteString.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ minAcceptedChannelSize_ = 0L;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ expireTimeSecs_ = 0L;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ minPayment_ = 0L;
+ bitField0_ = (bitField0_ & ~0x00000008);
+ return this;
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_descriptor;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.Initiate getDefaultInstanceForType() {
+ return org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance();
+ }
+
+ public org.bitcoin.paymentchannel.Protos.Initiate build() {
+ org.bitcoin.paymentchannel.Protos.Initiate result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.Initiate buildPartial() {
+ org.bitcoin.paymentchannel.Protos.Initiate result = new org.bitcoin.paymentchannel.Protos.Initiate(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.multisigKey_ = multisigKey_;
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.minAcceptedChannelSize_ = minAcceptedChannelSize_;
+ if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+ to_bitField0_ |= 0x00000004;
+ }
+ result.expireTimeSecs_ = expireTimeSecs_;
+ if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
+ to_bitField0_ |= 0x00000008;
+ }
+ result.minPayment_ = minPayment_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder clone() {
+ return (Builder) super.clone();
+ }
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ Object value) {
+ return (Builder) super.setField(field, value);
+ }
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return (Builder) super.clearField(field);
+ }
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return (Builder) super.clearOneof(oneof);
+ }
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, Object value) {
+ return (Builder) super.setRepeatedField(field, index, value);
+ }
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ Object value) {
+ return (Builder) super.addRepeatedField(field, value);
+ }
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.bitcoin.paymentchannel.Protos.Initiate) {
+ return mergeFrom((org.bitcoin.paymentchannel.Protos.Initiate)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.Initiate other) {
+ if (other == org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance()) return this;
+ if (other.hasMultisigKey()) {
+ setMultisigKey(other.getMultisigKey());
+ }
+ if (other.hasMinAcceptedChannelSize()) {
+ setMinAcceptedChannelSize(other.getMinAcceptedChannelSize());
+ }
+ if (other.hasExpireTimeSecs()) {
+ setExpireTimeSecs(other.getExpireTimeSecs());
+ }
+ if (other.hasMinPayment()) {
+ setMinPayment(other.getMinPayment());
+ }
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasMultisigKey()) {
+ return false;
+ }
+ if (!hasMinAcceptedChannelSize()) {
+ return false;
+ }
+ if (!hasExpireTimeSecs()) {
+ return false;
+ }
+ if (!hasMinPayment()) {
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.bitcoin.paymentchannel.Protos.Initiate parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.bitcoin.paymentchannel.Protos.Initiate) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private com.google.protobuf.ByteString multisigKey_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ *
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is used only in the creation of the multisig contract, as outputs are
+ * created entirely by the secondary
+ *
+ *
+ * required bytes multisig_key = 1;
+ */
+ public boolean hasMultisigKey() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ *
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is used only in the creation of the multisig contract, as outputs are
+ * created entirely by the secondary
+ *
+ *
+ * required bytes multisig_key = 1;
+ */
+ public com.google.protobuf.ByteString getMultisigKey() {
+ return multisigKey_;
+ }
+ /**
+ *
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is used only in the creation of the multisig contract, as outputs are
+ * created entirely by the secondary
+ *
+ *
+ * required bytes multisig_key = 1;
+ */
+ public Builder setMultisigKey(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ multisigKey_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is used only in the creation of the multisig contract, as outputs are
+ * created entirely by the secondary
+ *
+ *
+ * required bytes multisig_key = 1;
+ */
+ public Builder clearMultisigKey() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ multisigKey_ = getDefaultInstance().getMultisigKey();
+ onChanged();
+ return this;
+ }
+
+ private long minAcceptedChannelSize_ ;
+ /**
+ *
+ * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+ * size it's willing to accept here. This can be lower to trade off resources against
+ * security but shouldn't be so low the transactions get rejected by the network as spam.
+ * Zero isn't a sensible value to have here, so we make the field required.
+ *
+ *
+ * required uint64 min_accepted_channel_size = 2;
+ */
+ public boolean hasMinAcceptedChannelSize() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ *
+ * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+ * size it's willing to accept here. This can be lower to trade off resources against
+ * security but shouldn't be so low the transactions get rejected by the network as spam.
+ * Zero isn't a sensible value to have here, so we make the field required.
+ *
+ *
+ * required uint64 min_accepted_channel_size = 2;
+ */
+ public long getMinAcceptedChannelSize() {
+ return minAcceptedChannelSize_;
+ }
+ /**
+ *
+ * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+ * size it's willing to accept here. This can be lower to trade off resources against
+ * security but shouldn't be so low the transactions get rejected by the network as spam.
+ * Zero isn't a sensible value to have here, so we make the field required.
+ *
+ *
+ * required uint64 min_accepted_channel_size = 2;
+ */
+ public Builder setMinAcceptedChannelSize(long value) {
+ bitField0_ |= 0x00000002;
+ minAcceptedChannelSize_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+ * size it's willing to accept here. This can be lower to trade off resources against
+ * security but shouldn't be so low the transactions get rejected by the network as spam.
+ * Zero isn't a sensible value to have here, so we make the field required.
+ *
+ *
+ * required uint64 min_accepted_channel_size = 2;
+ */
+ public Builder clearMinAcceptedChannelSize() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ minAcceptedChannelSize_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ private long expireTimeSecs_ ;
+ /**
+ *
+ * Rough UNIX time for when the channel expires. This is determined by the block header
+ * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+ * Channels could also be specified in terms of block heights but then how do you know the
+ * current chain height if you don't have internet access? Trust the server? Probably opens up
+ * attack vectors. We can assume the client has an independent clock, however. If the client
+ * considers this value too far off (eg more than a day), it may send an ERROR and close the
+ * channel.
+ *
+ *
+ * required uint64 expire_time_secs = 3;
+ */
+ public boolean hasExpireTimeSecs() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ *
+ * Rough UNIX time for when the channel expires. This is determined by the block header
+ * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+ * Channels could also be specified in terms of block heights but then how do you know the
+ * current chain height if you don't have internet access? Trust the server? Probably opens up
+ * attack vectors. We can assume the client has an independent clock, however. If the client
+ * considers this value too far off (eg more than a day), it may send an ERROR and close the
+ * channel.
+ *
+ *
+ * required uint64 expire_time_secs = 3;
+ */
+ public long getExpireTimeSecs() {
+ return expireTimeSecs_;
+ }
+ /**
+ *
+ * Rough UNIX time for when the channel expires. This is determined by the block header
+ * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+ * Channels could also be specified in terms of block heights but then how do you know the
+ * current chain height if you don't have internet access? Trust the server? Probably opens up
+ * attack vectors. We can assume the client has an independent clock, however. If the client
+ * considers this value too far off (eg more than a day), it may send an ERROR and close the
+ * channel.
+ *
+ *
+ * required uint64 expire_time_secs = 3;
+ */
+ public Builder setExpireTimeSecs(long value) {
+ bitField0_ |= 0x00000004;
+ expireTimeSecs_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * Rough UNIX time for when the channel expires. This is determined by the block header
+ * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+ * Channels could also be specified in terms of block heights but then how do you know the
+ * current chain height if you don't have internet access? Trust the server? Probably opens up
+ * attack vectors. We can assume the client has an independent clock, however. If the client
+ * considers this value too far off (eg more than a day), it may send an ERROR and close the
+ * channel.
+ *
+ *
+ * required uint64 expire_time_secs = 3;
+ */
+ public Builder clearExpireTimeSecs() {
+ bitField0_ = (bitField0_ & ~0x00000004);
+ expireTimeSecs_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ private long minPayment_ ;
+ /**
+ *
+ * The amount of money the server requires for the initial payment. The act of opening a channel
+ * always transfers some quantity of money to the server: it's impossible to have a channel with
+ * zero value transferred. This rule ensures that you can't get a channel that can't be settled
+ * due to having paid under the dust limit. Because the dust limit will float in future, the
+ * server tells the client what it thinks it is, and the client is supposed to sanity check this
+ * value.
+ *
+ *
+ * required uint64 min_payment = 4;
+ */
+ public boolean hasMinPayment() {
+ return ((bitField0_ & 0x00000008) == 0x00000008);
+ }
+ /**
+ *
+ * The amount of money the server requires for the initial payment. The act of opening a channel
+ * always transfers some quantity of money to the server: it's impossible to have a channel with
+ * zero value transferred. This rule ensures that you can't get a channel that can't be settled
+ * due to having paid under the dust limit. Because the dust limit will float in future, the
+ * server tells the client what it thinks it is, and the client is supposed to sanity check this
+ * value.
+ *
+ *
+ * required uint64 min_payment = 4;
+ */
+ public long getMinPayment() {
+ return minPayment_;
+ }
+ /**
+ *
+ * The amount of money the server requires for the initial payment. The act of opening a channel
+ * always transfers some quantity of money to the server: it's impossible to have a channel with
+ * zero value transferred. This rule ensures that you can't get a channel that can't be settled
+ * due to having paid under the dust limit. Because the dust limit will float in future, the
+ * server tells the client what it thinks it is, and the client is supposed to sanity check this
+ * value.
+ *
+ *
+ * required uint64 min_payment = 4;
+ */
+ public Builder setMinPayment(long value) {
+ bitField0_ |= 0x00000008;
+ minPayment_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * The amount of money the server requires for the initial payment. The act of opening a channel
+ * always transfers some quantity of money to the server: it's impossible to have a channel with
+ * zero value transferred. This rule ensures that you can't get a channel that can't be settled
+ * due to having paid under the dust limit. Because the dust limit will float in future, the
+ * server tells the client what it thinks it is, and the client is supposed to sanity check this
+ * value.
+ *
+ *
+ * required uint64 min_payment = 4;
+ */
+ public Builder clearMinPayment() {
+ bitField0_ = (bitField0_ & ~0x00000008);
+ minPayment_ = 0L;
+ onChanged();
+ return this;
+ }
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:paymentchannels.Initiate)
+ }
+
+ // @@protoc_insertion_point(class_scope:paymentchannels.Initiate)
+ private static final org.bitcoin.paymentchannel.Protos.Initiate DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.bitcoin.paymentchannel.Protos.Initiate();
+ }
+
+ public static org.bitcoin.paymentchannel.Protos.Initiate getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ public Initiate parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Initiate(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.Initiate getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface ProvideRefundOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:paymentchannels.ProvideRefund)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is only used in the creation of the multisig contract.
+ *
+ *
+ * required bytes multisig_key = 1;
+ */
+ boolean hasMultisigKey();
+ /**
+ *
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is only used in the creation of the multisig contract.
+ *
+ *
+ * required bytes multisig_key = 1;
+ */
+ com.google.protobuf.ByteString getMultisigKey();
+
+ /**
+ *
+ * The serialized bytes of the return transaction in Satoshi format.
+ * * It must have exactly one input which spends the multisig output (see ProvideContract for
+ * details of exactly what that output must look like). This output must have a sequence
+ * number of 0.
+ * * It must have the lock time set to a time after the min_time_window_secs (from the
+ * Initiate message).
+ * * It must have exactly one output which goes back to the primary. This output's
+ * scriptPubKey will be reused to create payment transactions.
+ *
+ *
+ * required bytes tx = 2;
+ */
+ boolean hasTx();
+ /**
+ *
+ * The serialized bytes of the return transaction in Satoshi format.
+ * * It must have exactly one input which spends the multisig output (see ProvideContract for
+ * details of exactly what that output must look like). This output must have a sequence
+ * number of 0.
+ * * It must have the lock time set to a time after the min_time_window_secs (from the
+ * Initiate message).
+ * * It must have exactly one output which goes back to the primary. This output's
+ * scriptPubKey will be reused to create payment transactions.
+ *
+ *
+ * required bytes tx = 2;
+ */
+ com.google.protobuf.ByteString getTx();
+ }
+ /**
+ *
+ * Sent from primary to secondary after Initiate to begin the refund transaction signing.
+ *
+ *
+ * Protobuf type {@code paymentchannels.ProvideRefund}
+ */
+ public static final class ProvideRefund extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:paymentchannels.ProvideRefund)
+ ProvideRefundOrBuilder {
+ // Use ProvideRefund.newBuilder() to construct.
+ private ProvideRefund(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private ProvideRefund() {
+ multisigKey_ = com.google.protobuf.ByteString.EMPTY;
+ tx_ = com.google.protobuf.ByteString.EMPTY;
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private ProvideRefund(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ bitField0_ |= 0x00000001;
+ multisigKey_ = input.readBytes();
+ break;
+ }
+ case 18: {
+ bitField0_ |= 0x00000002;
+ tx_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.bitcoin.paymentchannel.Protos.ProvideRefund.class, org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int MULTISIG_KEY_FIELD_NUMBER = 1;
+ private com.google.protobuf.ByteString multisigKey_;
+ /**
+ *
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is only used in the creation of the multisig contract.
+ *
+ *
+ * required bytes multisig_key = 1;
+ */
+ public boolean hasMultisigKey() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ *
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is only used in the creation of the multisig contract.
+ *
+ *
+ * required bytes multisig_key = 1;
+ */
+ public com.google.protobuf.ByteString getMultisigKey() {
+ return multisigKey_;
+ }
+
+ public static final int TX_FIELD_NUMBER = 2;
+ private com.google.protobuf.ByteString tx_;
+ /**
+ *
+ * The serialized bytes of the return transaction in Satoshi format.
+ * * It must have exactly one input which spends the multisig output (see ProvideContract for
+ * details of exactly what that output must look like). This output must have a sequence
+ * number of 0.
+ * * It must have the lock time set to a time after the min_time_window_secs (from the
+ * Initiate message).
+ * * It must have exactly one output which goes back to the primary. This output's
+ * scriptPubKey will be reused to create payment transactions.
+ *
+ *
+ * required bytes tx = 2;
+ */
+ public boolean hasTx() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ *
+ * The serialized bytes of the return transaction in Satoshi format.
+ * * It must have exactly one input which spends the multisig output (see ProvideContract for
+ * details of exactly what that output must look like). This output must have a sequence
+ * number of 0.
+ * * It must have the lock time set to a time after the min_time_window_secs (from the
+ * Initiate message).
+ * * It must have exactly one output which goes back to the primary. This output's
+ * scriptPubKey will be reused to create payment transactions.
+ *
+ *
+ * required bytes tx = 2;
+ */
+ public com.google.protobuf.ByteString getTx() {
+ return tx_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (!hasMultisigKey()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!hasTx()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, multisigKey_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeBytes(2, tx_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, multisigKey_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(2, tx_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof org.bitcoin.paymentchannel.Protos.ProvideRefund)) {
+ return super.equals(obj);
+ }
+ org.bitcoin.paymentchannel.Protos.ProvideRefund other = (org.bitcoin.paymentchannel.Protos.ProvideRefund) obj;
+
+ boolean result = true;
+ result = result && (hasMultisigKey() == other.hasMultisigKey());
+ if (hasMultisigKey()) {
+ result = result && getMultisigKey()
+ .equals(other.getMultisigKey());
+ }
+ result = result && (hasTx() == other.hasTx());
+ if (hasTx()) {
+ result = result && getTx()
+ .equals(other.getTx());
+ }
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptorForType().hashCode();
+ if (hasMultisigKey()) {
+ hash = (37 * hash) + MULTISIG_KEY_FIELD_NUMBER;
+ hash = (53 * hash) + getMultisigKey().hashCode();
+ }
+ if (hasTx()) {
+ hash = (37 * hash) + TX_FIELD_NUMBER;
+ hash = (53 * hash) + getTx().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.ProvideRefund prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ *
+ * Sent from primary to secondary after Initiate to begin the refund transaction signing.
+ *
+ *
+ * Protobuf type {@code paymentchannels.ProvideRefund}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:paymentchannels.ProvideRefund)
+ org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.bitcoin.paymentchannel.Protos.ProvideRefund.class, org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder.class);
+ }
+
+ // Construct using org.bitcoin.paymentchannel.Protos.ProvideRefund.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ }
+ }
+ public Builder clear() {
+ super.clear();
+ multisigKey_ = com.google.protobuf.ByteString.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ tx_ = com.google.protobuf.ByteString.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_descriptor;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.ProvideRefund getDefaultInstanceForType() {
+ return org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance();
+ }
+
+ public org.bitcoin.paymentchannel.Protos.ProvideRefund build() {
+ org.bitcoin.paymentchannel.Protos.ProvideRefund result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.ProvideRefund buildPartial() {
+ org.bitcoin.paymentchannel.Protos.ProvideRefund result = new org.bitcoin.paymentchannel.Protos.ProvideRefund(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.multisigKey_ = multisigKey_;
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.tx_ = tx_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder clone() {
+ return (Builder) super.clone();
+ }
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ Object value) {
+ return (Builder) super.setField(field, value);
+ }
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return (Builder) super.clearField(field);
+ }
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return (Builder) super.clearOneof(oneof);
+ }
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, Object value) {
+ return (Builder) super.setRepeatedField(field, index, value);
+ }
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ Object value) {
+ return (Builder) super.addRepeatedField(field, value);
+ }
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.bitcoin.paymentchannel.Protos.ProvideRefund) {
+ return mergeFrom((org.bitcoin.paymentchannel.Protos.ProvideRefund)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.ProvideRefund other) {
+ if (other == org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance()) return this;
+ if (other.hasMultisigKey()) {
+ setMultisigKey(other.getMultisigKey());
+ }
+ if (other.hasTx()) {
+ setTx(other.getTx());
+ }
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasMultisigKey()) {
+ return false;
+ }
+ if (!hasTx()) {
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.bitcoin.paymentchannel.Protos.ProvideRefund parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.bitcoin.paymentchannel.Protos.ProvideRefund) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private com.google.protobuf.ByteString multisigKey_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ *
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is only used in the creation of the multisig contract.
+ *
+ *
+ * required bytes multisig_key = 1;
+ */
+ public boolean hasMultisigKey() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ *
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is only used in the creation of the multisig contract.
+ *
+ *
+ * required bytes multisig_key = 1;
+ */
+ public com.google.protobuf.ByteString getMultisigKey() {
+ return multisigKey_;
+ }
+ /**
+ *
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is only used in the creation of the multisig contract.
+ *
+ *
+ * required bytes multisig_key = 1;
+ */
+ public Builder setMultisigKey(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ multisigKey_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is only used in the creation of the multisig contract.
+ *
+ *
+ * required bytes multisig_key = 1;
+ */
+ public Builder clearMultisigKey() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ multisigKey_ = getDefaultInstance().getMultisigKey();
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.ByteString tx_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ *
+ * The serialized bytes of the return transaction in Satoshi format.
+ * * It must have exactly one input which spends the multisig output (see ProvideContract for
+ * details of exactly what that output must look like). This output must have a sequence
+ * number of 0.
+ * * It must have the lock time set to a time after the min_time_window_secs (from the
+ * Initiate message).
+ * * It must have exactly one output which goes back to the primary. This output's
+ * scriptPubKey will be reused to create payment transactions.
+ *
+ *
+ * required bytes tx = 2;
+ */
+ public boolean hasTx() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ *
+ * The serialized bytes of the return transaction in Satoshi format.
+ * * It must have exactly one input which spends the multisig output (see ProvideContract for
+ * details of exactly what that output must look like). This output must have a sequence
+ * number of 0.
+ * * It must have the lock time set to a time after the min_time_window_secs (from the
+ * Initiate message).
+ * * It must have exactly one output which goes back to the primary. This output's
+ * scriptPubKey will be reused to create payment transactions.
+ *
+ *
+ * required bytes tx = 2;
+ */
+ public com.google.protobuf.ByteString getTx() {
+ return tx_;
+ }
+ /**
+ *
+ * The serialized bytes of the return transaction in Satoshi format.
+ * * It must have exactly one input which spends the multisig output (see ProvideContract for
+ * details of exactly what that output must look like). This output must have a sequence
+ * number of 0.
+ * * It must have the lock time set to a time after the min_time_window_secs (from the
+ * Initiate message).
+ * * It must have exactly one output which goes back to the primary. This output's
+ * scriptPubKey will be reused to create payment transactions.
+ *
+ *
+ * required bytes tx = 2;
+ */
+ public Builder setTx(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ tx_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * The serialized bytes of the return transaction in Satoshi format.
+ * * It must have exactly one input which spends the multisig output (see ProvideContract for
+ * details of exactly what that output must look like). This output must have a sequence
+ * number of 0.
+ * * It must have the lock time set to a time after the min_time_window_secs (from the
+ * Initiate message).
+ * * It must have exactly one output which goes back to the primary. This output's
+ * scriptPubKey will be reused to create payment transactions.
+ *
+ *
+ * required bytes tx = 2;
+ */
+ public Builder clearTx() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ tx_ = getDefaultInstance().getTx();
+ onChanged();
+ return this;
+ }
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:paymentchannels.ProvideRefund)
+ }
+
+ // @@protoc_insertion_point(class_scope:paymentchannels.ProvideRefund)
+ private static final org.bitcoin.paymentchannel.Protos.ProvideRefund DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.bitcoin.paymentchannel.Protos.ProvideRefund();
+ }
+
+ public static org.bitcoin.paymentchannel.Protos.ProvideRefund getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ public ProvideRefund parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new ProvideRefund(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.ProvideRefund getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface ReturnRefundOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:paymentchannels.ReturnRefund)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ * required bytes signature = 1;
+ */
+ boolean hasSignature();
+ /**
+ * required bytes signature = 1;
+ */
+ com.google.protobuf.ByteString getSignature();
+ }
+ /**
+ *
+ * Sent from secondary to primary after it has done initial verification of the refund
+ * transaction. Contains the primary's signature which is required to spend the multisig contract
+ * to the refund transaction. Must be signed using SIGHASH_NONE|SIGHASH_ANYONECANPAY (and include
+ * the postfix type byte) to allow the client to add any outputs/inputs it wants as long as the
+ * input's sequence and transaction's nLockTime remain set.
+ *
+ *
+ * Protobuf type {@code paymentchannels.ReturnRefund}
+ */
+ public static final class ReturnRefund extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:paymentchannels.ReturnRefund)
+ ReturnRefundOrBuilder {
+ // Use ReturnRefund.newBuilder() to construct.
+ private ReturnRefund(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private ReturnRefund() {
+ signature_ = com.google.protobuf.ByteString.EMPTY;
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private ReturnRefund(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ bitField0_ |= 0x00000001;
+ signature_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.bitcoin.paymentchannel.Protos.ReturnRefund.class, org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int SIGNATURE_FIELD_NUMBER = 1;
+ private com.google.protobuf.ByteString signature_;
+ /**
+ * required bytes signature = 1;
+ */
+ public boolean hasSignature() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * required bytes signature = 1;
+ */
+ public com.google.protobuf.ByteString getSignature() {
+ return signature_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (!hasSignature()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, signature_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, signature_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof org.bitcoin.paymentchannel.Protos.ReturnRefund)) {
+ return super.equals(obj);
+ }
+ org.bitcoin.paymentchannel.Protos.ReturnRefund other = (org.bitcoin.paymentchannel.Protos.ReturnRefund) obj;
+
+ boolean result = true;
+ result = result && (hasSignature() == other.hasSignature());
+ if (hasSignature()) {
+ result = result && getSignature()
+ .equals(other.getSignature());
+ }
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptorForType().hashCode();
+ if (hasSignature()) {
+ hash = (37 * hash) + SIGNATURE_FIELD_NUMBER;
+ hash = (53 * hash) + getSignature().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.ReturnRefund prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ *
+ * Sent from secondary to primary after it has done initial verification of the refund
+ * transaction. Contains the primary's signature which is required to spend the multisig contract
+ * to the refund transaction. Must be signed using SIGHASH_NONE|SIGHASH_ANYONECANPAY (and include
+ * the postfix type byte) to allow the client to add any outputs/inputs it wants as long as the
+ * input's sequence and transaction's nLockTime remain set.
+ *
+ *
+ * Protobuf type {@code paymentchannels.ReturnRefund}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:paymentchannels.ReturnRefund)
+ org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.bitcoin.paymentchannel.Protos.ReturnRefund.class, org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder.class);
+ }
+
+ // Construct using org.bitcoin.paymentchannel.Protos.ReturnRefund.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ }
+ }
+ public Builder clear() {
+ super.clear();
+ signature_ = com.google.protobuf.ByteString.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_descriptor;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.ReturnRefund getDefaultInstanceForType() {
+ return org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance();
+ }
+
+ public org.bitcoin.paymentchannel.Protos.ReturnRefund build() {
+ org.bitcoin.paymentchannel.Protos.ReturnRefund result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.ReturnRefund buildPartial() {
+ org.bitcoin.paymentchannel.Protos.ReturnRefund result = new org.bitcoin.paymentchannel.Protos.ReturnRefund(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.signature_ = signature_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder clone() {
+ return (Builder) super.clone();
+ }
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ Object value) {
+ return (Builder) super.setField(field, value);
+ }
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return (Builder) super.clearField(field);
+ }
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return (Builder) super.clearOneof(oneof);
+ }
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, Object value) {
+ return (Builder) super.setRepeatedField(field, index, value);
+ }
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ Object value) {
+ return (Builder) super.addRepeatedField(field, value);
+ }
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.bitcoin.paymentchannel.Protos.ReturnRefund) {
+ return mergeFrom((org.bitcoin.paymentchannel.Protos.ReturnRefund)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.ReturnRefund other) {
+ if (other == org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance()) return this;
+ if (other.hasSignature()) {
+ setSignature(other.getSignature());
+ }
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasSignature()) {
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.bitcoin.paymentchannel.Protos.ReturnRefund parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.bitcoin.paymentchannel.Protos.ReturnRefund) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private com.google.protobuf.ByteString signature_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ * required bytes signature = 1;
+ */
+ public boolean hasSignature() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * required bytes signature = 1;
+ */
+ public com.google.protobuf.ByteString getSignature() {
+ return signature_;
+ }
+ /**
+ * required bytes signature = 1;
+ */
+ public Builder setSignature(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ signature_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * required bytes signature = 1;
+ */
+ public Builder clearSignature() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ signature_ = getDefaultInstance().getSignature();
+ onChanged();
+ return this;
+ }
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:paymentchannels.ReturnRefund)
+ }
+
+ // @@protoc_insertion_point(class_scope:paymentchannels.ReturnRefund)
+ private static final org.bitcoin.paymentchannel.Protos.ReturnRefund DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.bitcoin.paymentchannel.Protos.ReturnRefund();
+ }
+
+ public static org.bitcoin.paymentchannel.Protos.ReturnRefund getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ public ReturnRefund parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new ReturnRefund(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.ReturnRefund getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface ProvideContractOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:paymentchannels.ProvideContract)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ * The serialized bytes of the transaction in Satoshi format.
+ * For version 1:
+ * * It must be signed and completely valid and ready for broadcast (ie it includes the
+ * necessary fees) TODO: tell the client how much fee it needs
+ * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+ * primary's and the second being the secondary's (ie the script must be exactly "OP_2
+ * ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+ * For version 2:
+ * * It must be signed and completely valid and ready for broadcast (ie it includes the
+ * necessary fees) TODO: tell the client how much fee it needs
+ * * Its first output must be a CHECKLOCKTIMEVERIFY output with the first pubkey being the
+ * primary's and the second being the secondary's.
+ *
+ *
+ * required bytes tx = 1;
+ */
+ boolean hasTx();
+ /**
+ *
+ * The serialized bytes of the transaction in Satoshi format.
+ * For version 1:
+ * * It must be signed and completely valid and ready for broadcast (ie it includes the
+ * necessary fees) TODO: tell the client how much fee it needs
+ * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+ * primary's and the second being the secondary's (ie the script must be exactly "OP_2
+ * ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+ * For version 2:
+ * * It must be signed and completely valid and ready for broadcast (ie it includes the
+ * necessary fees) TODO: tell the client how much fee it needs
+ * * Its first output must be a CHECKLOCKTIMEVERIFY output with the first pubkey being the
+ * primary's and the second being the secondary's.
+ *
+ *
+ * required bytes tx = 1;
+ */
+ com.google.protobuf.ByteString getTx();
+
+ /**
+ *
+ * To open the channel, an initial payment of the server-specified dust limit value must be
+ * provided. This ensures that the channel is never in an un-settleable state due to either
+ * no payment tx having been provided at all, or a payment that is smaller than the dust
+ * limit being provided.
+ *
+ *
+ * required .paymentchannels.UpdatePayment initial_payment = 2;
+ */
+ boolean hasInitialPayment();
+ /**
+ *
+ * To open the channel, an initial payment of the server-specified dust limit value must be
+ * provided. This ensures that the channel is never in an un-settleable state due to either
+ * no payment tx having been provided at all, or a payment that is smaller than the dust
+ * limit being provided.
+ *
+ *
+ * required .paymentchannels.UpdatePayment initial_payment = 2;
+ */
+ org.bitcoin.paymentchannel.Protos.UpdatePayment getInitialPayment();
+ /**
+ *
+ * To open the channel, an initial payment of the server-specified dust limit value must be
+ * provided. This ensures that the channel is never in an un-settleable state due to either
+ * no payment tx having been provided at all, or a payment that is smaller than the dust
+ * limit being provided.
+ *
+ *
+ * required .paymentchannels.UpdatePayment initial_payment = 2;
+ */
+ org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder getInitialPaymentOrBuilder();
+
+ /**
+ *
+ * This field is added in protocol version 2 to send the client public key to the server.
+ * In version 1 it isn't used.
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is only used in the creation of the multisig contract.
+ *
+ *
+ * optional bytes client_key = 3;
+ */
+ boolean hasClientKey();
+ /**
+ *
+ * This field is added in protocol version 2 to send the client public key to the server.
+ * In version 1 it isn't used.
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is only used in the creation of the multisig contract.
+ *
+ *
+ * optional bytes client_key = 3;
+ */
+ com.google.protobuf.ByteString getClientKey();
+ }
+ /**
+ *
+ * Sent from the primary to the secondary to complete initialization.
+ *
+ *
+ * Protobuf type {@code paymentchannels.ProvideContract}
+ */
+ public static final class ProvideContract extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:paymentchannels.ProvideContract)
+ ProvideContractOrBuilder {
+ // Use ProvideContract.newBuilder() to construct.
+ private ProvideContract(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private ProvideContract() {
+ tx_ = com.google.protobuf.ByteString.EMPTY;
+ clientKey_ = com.google.protobuf.ByteString.EMPTY;
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private ProvideContract(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ bitField0_ |= 0x00000001;
+ tx_ = input.readBytes();
+ break;
+ }
+ case 18: {
+ org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ subBuilder = initialPayment_.toBuilder();
+ }
+ initialPayment_ = input.readMessage(org.bitcoin.paymentchannel.Protos.UpdatePayment.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(initialPayment_);
+ initialPayment_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000002;
+ break;
+ }
+ case 26: {
+ bitField0_ |= 0x00000004;
+ clientKey_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.bitcoin.paymentchannel.Protos.ProvideContract.class, org.bitcoin.paymentchannel.Protos.ProvideContract.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int TX_FIELD_NUMBER = 1;
+ private com.google.protobuf.ByteString tx_;
+ /**
+ *
+ * The serialized bytes of the transaction in Satoshi format.
+ * For version 1:
+ * * It must be signed and completely valid and ready for broadcast (ie it includes the
+ * necessary fees) TODO: tell the client how much fee it needs
+ * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+ * primary's and the second being the secondary's (ie the script must be exactly "OP_2
+ * ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+ * For version 2:
+ * * It must be signed and completely valid and ready for broadcast (ie it includes the
+ * necessary fees) TODO: tell the client how much fee it needs
+ * * Its first output must be a CHECKLOCKTIMEVERIFY output with the first pubkey being the
+ * primary's and the second being the secondary's.
+ *
+ *
+ * required bytes tx = 1;
+ */
+ public boolean hasTx() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ *
+ * The serialized bytes of the transaction in Satoshi format.
+ * For version 1:
+ * * It must be signed and completely valid and ready for broadcast (ie it includes the
+ * necessary fees) TODO: tell the client how much fee it needs
+ * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+ * primary's and the second being the secondary's (ie the script must be exactly "OP_2
+ * ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+ * For version 2:
+ * * It must be signed and completely valid and ready for broadcast (ie it includes the
+ * necessary fees) TODO: tell the client how much fee it needs
+ * * Its first output must be a CHECKLOCKTIMEVERIFY output with the first pubkey being the
+ * primary's and the second being the secondary's.
+ *
+ *
+ * required bytes tx = 1;
+ */
+ public com.google.protobuf.ByteString getTx() {
+ return tx_;
+ }
+
+ public static final int INITIAL_PAYMENT_FIELD_NUMBER = 2;
+ private org.bitcoin.paymentchannel.Protos.UpdatePayment initialPayment_;
+ /**
+ *
+ * To open the channel, an initial payment of the server-specified dust limit value must be
+ * provided. This ensures that the channel is never in an un-settleable state due to either
+ * no payment tx having been provided at all, or a payment that is smaller than the dust
+ * limit being provided.
+ *
+ *
+ * required .paymentchannels.UpdatePayment initial_payment = 2;
+ */
+ public boolean hasInitialPayment() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ *
+ * To open the channel, an initial payment of the server-specified dust limit value must be
+ * provided. This ensures that the channel is never in an un-settleable state due to either
+ * no payment tx having been provided at all, or a payment that is smaller than the dust
+ * limit being provided.
+ *
+ *
+ * required .paymentchannels.UpdatePayment initial_payment = 2;
+ */
+ public org.bitcoin.paymentchannel.Protos.UpdatePayment getInitialPayment() {
+ return initialPayment_ == null ? org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance() : initialPayment_;
+ }
+ /**
+ *
+ * To open the channel, an initial payment of the server-specified dust limit value must be
+ * provided. This ensures that the channel is never in an un-settleable state due to either
+ * no payment tx having been provided at all, or a payment that is smaller than the dust
+ * limit being provided.
+ *
+ *
+ * required .paymentchannels.UpdatePayment initial_payment = 2;
+ */
+ public org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder getInitialPaymentOrBuilder() {
+ return initialPayment_ == null ? org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance() : initialPayment_;
+ }
+
+ public static final int CLIENT_KEY_FIELD_NUMBER = 3;
+ private com.google.protobuf.ByteString clientKey_;
+ /**
+ *
+ * This field is added in protocol version 2 to send the client public key to the server.
+ * In version 1 it isn't used.
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is only used in the creation of the multisig contract.
+ *
+ *
+ * optional bytes client_key = 3;
+ */
+ public boolean hasClientKey() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ *
+ * This field is added in protocol version 2 to send the client public key to the server.
+ * In version 1 it isn't used.
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is only used in the creation of the multisig contract.
+ *
+ *
+ * optional bytes client_key = 3;
+ */
+ public com.google.protobuf.ByteString getClientKey() {
+ return clientKey_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (!hasTx()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!hasInitialPayment()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getInitialPayment().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, tx_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeMessage(2, getInitialPayment());
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ output.writeBytes(3, clientKey_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, tx_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, getInitialPayment());
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(3, clientKey_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof org.bitcoin.paymentchannel.Protos.ProvideContract)) {
+ return super.equals(obj);
+ }
+ org.bitcoin.paymentchannel.Protos.ProvideContract other = (org.bitcoin.paymentchannel.Protos.ProvideContract) obj;
+
+ boolean result = true;
+ result = result && (hasTx() == other.hasTx());
+ if (hasTx()) {
+ result = result && getTx()
+ .equals(other.getTx());
+ }
+ result = result && (hasInitialPayment() == other.hasInitialPayment());
+ if (hasInitialPayment()) {
+ result = result && getInitialPayment()
+ .equals(other.getInitialPayment());
+ }
+ result = result && (hasClientKey() == other.hasClientKey());
+ if (hasClientKey()) {
+ result = result && getClientKey()
+ .equals(other.getClientKey());
+ }
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptorForType().hashCode();
+ if (hasTx()) {
+ hash = (37 * hash) + TX_FIELD_NUMBER;
+ hash = (53 * hash) + getTx().hashCode();
+ }
+ if (hasInitialPayment()) {
+ hash = (37 * hash) + INITIAL_PAYMENT_FIELD_NUMBER;
+ hash = (53 * hash) + getInitialPayment().hashCode();
+ }
+ if (hasClientKey()) {
+ hash = (37 * hash) + CLIENT_KEY_FIELD_NUMBER;
+ hash = (53 * hash) + getClientKey().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ProvideContract parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ProvideContract parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.ProvideContract prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ *
+ * Sent from the primary to the secondary to complete initialization.
+ *
+ *
+ * Protobuf type {@code paymentchannels.ProvideContract}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:paymentchannels.ProvideContract)
+ org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.bitcoin.paymentchannel.Protos.ProvideContract.class, org.bitcoin.paymentchannel.Protos.ProvideContract.Builder.class);
+ }
+
+ // Construct using org.bitcoin.paymentchannel.Protos.ProvideContract.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ getInitialPaymentFieldBuilder();
+ }
+ }
+ public Builder clear() {
+ super.clear();
+ tx_ = com.google.protobuf.ByteString.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ if (initialPaymentBuilder_ == null) {
+ initialPayment_ = null;
+ } else {
+ initialPaymentBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ clientKey_ = com.google.protobuf.ByteString.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_descriptor;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.ProvideContract getDefaultInstanceForType() {
+ return org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance();
+ }
+
+ public org.bitcoin.paymentchannel.Protos.ProvideContract build() {
+ org.bitcoin.paymentchannel.Protos.ProvideContract result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.ProvideContract buildPartial() {
+ org.bitcoin.paymentchannel.Protos.ProvideContract result = new org.bitcoin.paymentchannel.Protos.ProvideContract(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.tx_ = tx_;
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ if (initialPaymentBuilder_ == null) {
+ result.initialPayment_ = initialPayment_;
+ } else {
+ result.initialPayment_ = initialPaymentBuilder_.build();
+ }
+ if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+ to_bitField0_ |= 0x00000004;
+ }
+ result.clientKey_ = clientKey_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder clone() {
+ return (Builder) super.clone();
+ }
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ Object value) {
+ return (Builder) super.setField(field, value);
+ }
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return (Builder) super.clearField(field);
+ }
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return (Builder) super.clearOneof(oneof);
+ }
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, Object value) {
+ return (Builder) super.setRepeatedField(field, index, value);
+ }
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ Object value) {
+ return (Builder) super.addRepeatedField(field, value);
+ }
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.bitcoin.paymentchannel.Protos.ProvideContract) {
+ return mergeFrom((org.bitcoin.paymentchannel.Protos.ProvideContract)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.ProvideContract other) {
+ if (other == org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance()) return this;
+ if (other.hasTx()) {
+ setTx(other.getTx());
+ }
+ if (other.hasInitialPayment()) {
+ mergeInitialPayment(other.getInitialPayment());
+ }
+ if (other.hasClientKey()) {
+ setClientKey(other.getClientKey());
+ }
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasTx()) {
+ return false;
+ }
+ if (!hasInitialPayment()) {
+ return false;
+ }
+ if (!getInitialPayment().isInitialized()) {
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.bitcoin.paymentchannel.Protos.ProvideContract parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.bitcoin.paymentchannel.Protos.ProvideContract) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private com.google.protobuf.ByteString tx_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ *
+ * The serialized bytes of the transaction in Satoshi format.
+ * For version 1:
+ * * It must be signed and completely valid and ready for broadcast (ie it includes the
+ * necessary fees) TODO: tell the client how much fee it needs
+ * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+ * primary's and the second being the secondary's (ie the script must be exactly "OP_2
+ * ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+ * For version 2:
+ * * It must be signed and completely valid and ready for broadcast (ie it includes the
+ * necessary fees) TODO: tell the client how much fee it needs
+ * * Its first output must be a CHECKLOCKTIMEVERIFY output with the first pubkey being the
+ * primary's and the second being the secondary's.
+ *
+ *
+ * required bytes tx = 1;
+ */
+ public boolean hasTx() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ *
+ * The serialized bytes of the transaction in Satoshi format.
+ * For version 1:
+ * * It must be signed and completely valid and ready for broadcast (ie it includes the
+ * necessary fees) TODO: tell the client how much fee it needs
+ * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+ * primary's and the second being the secondary's (ie the script must be exactly "OP_2
+ * ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+ * For version 2:
+ * * It must be signed and completely valid and ready for broadcast (ie it includes the
+ * necessary fees) TODO: tell the client how much fee it needs
+ * * Its first output must be a CHECKLOCKTIMEVERIFY output with the first pubkey being the
+ * primary's and the second being the secondary's.
+ *
+ *
+ * required bytes tx = 1;
+ */
+ public com.google.protobuf.ByteString getTx() {
+ return tx_;
+ }
+ /**
+ *
+ * The serialized bytes of the transaction in Satoshi format.
+ * For version 1:
+ * * It must be signed and completely valid and ready for broadcast (ie it includes the
+ * necessary fees) TODO: tell the client how much fee it needs
+ * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+ * primary's and the second being the secondary's (ie the script must be exactly "OP_2
+ * ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+ * For version 2:
+ * * It must be signed and completely valid and ready for broadcast (ie it includes the
+ * necessary fees) TODO: tell the client how much fee it needs
+ * * Its first output must be a CHECKLOCKTIMEVERIFY output with the first pubkey being the
+ * primary's and the second being the secondary's.
+ *
+ *
+ * required bytes tx = 1;
+ */
+ public Builder setTx(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ tx_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * The serialized bytes of the transaction in Satoshi format.
+ * For version 1:
+ * * It must be signed and completely valid and ready for broadcast (ie it includes the
+ * necessary fees) TODO: tell the client how much fee it needs
+ * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+ * primary's and the second being the secondary's (ie the script must be exactly "OP_2
+ * ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+ * For version 2:
+ * * It must be signed and completely valid and ready for broadcast (ie it includes the
+ * necessary fees) TODO: tell the client how much fee it needs
+ * * Its first output must be a CHECKLOCKTIMEVERIFY output with the first pubkey being the
+ * primary's and the second being the secondary's.
+ *
+ *
+ * required bytes tx = 1;
+ */
+ public Builder clearTx() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ tx_ = getDefaultInstance().getTx();
+ onChanged();
+ return this;
+ }
+
+ private org.bitcoin.paymentchannel.Protos.UpdatePayment initialPayment_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.bitcoin.paymentchannel.Protos.UpdatePayment, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder, org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder> initialPaymentBuilder_;
+ /**
+ *
+ * To open the channel, an initial payment of the server-specified dust limit value must be
+ * provided. This ensures that the channel is never in an un-settleable state due to either
+ * no payment tx having been provided at all, or a payment that is smaller than the dust
+ * limit being provided.
+ *
+ *
+ * required .paymentchannels.UpdatePayment initial_payment = 2;
+ */
+ public boolean hasInitialPayment() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ *
+ * To open the channel, an initial payment of the server-specified dust limit value must be
+ * provided. This ensures that the channel is never in an un-settleable state due to either
+ * no payment tx having been provided at all, or a payment that is smaller than the dust
+ * limit being provided.
+ *
+ *
+ * required .paymentchannels.UpdatePayment initial_payment = 2;
+ */
+ public org.bitcoin.paymentchannel.Protos.UpdatePayment getInitialPayment() {
+ if (initialPaymentBuilder_ == null) {
+ return initialPayment_ == null ? org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance() : initialPayment_;
+ } else {
+ return initialPaymentBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ * To open the channel, an initial payment of the server-specified dust limit value must be
+ * provided. This ensures that the channel is never in an un-settleable state due to either
+ * no payment tx having been provided at all, or a payment that is smaller than the dust
+ * limit being provided.
+ *
+ *
+ * required .paymentchannels.UpdatePayment initial_payment = 2;
+ */
+ public Builder setInitialPayment(org.bitcoin.paymentchannel.Protos.UpdatePayment value) {
+ if (initialPaymentBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ initialPayment_ = value;
+ onChanged();
+ } else {
+ initialPaymentBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ *
+ * To open the channel, an initial payment of the server-specified dust limit value must be
+ * provided. This ensures that the channel is never in an un-settleable state due to either
+ * no payment tx having been provided at all, or a payment that is smaller than the dust
+ * limit being provided.
+ *
+ *
+ * required .paymentchannels.UpdatePayment initial_payment = 2;
+ */
+ public Builder setInitialPayment(
+ org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder builderForValue) {
+ if (initialPaymentBuilder_ == null) {
+ initialPayment_ = builderForValue.build();
+ onChanged();
+ } else {
+ initialPaymentBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ *
+ * To open the channel, an initial payment of the server-specified dust limit value must be
+ * provided. This ensures that the channel is never in an un-settleable state due to either
+ * no payment tx having been provided at all, or a payment that is smaller than the dust
+ * limit being provided.
+ *
+ *
+ * required .paymentchannels.UpdatePayment initial_payment = 2;
+ */
+ public Builder mergeInitialPayment(org.bitcoin.paymentchannel.Protos.UpdatePayment value) {
+ if (initialPaymentBuilder_ == null) {
+ if (((bitField0_ & 0x00000002) == 0x00000002) &&
+ initialPayment_ != null &&
+ initialPayment_ != org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance()) {
+ initialPayment_ =
+ org.bitcoin.paymentchannel.Protos.UpdatePayment.newBuilder(initialPayment_).mergeFrom(value).buildPartial();
+ } else {
+ initialPayment_ = value;
+ }
+ onChanged();
+ } else {
+ initialPaymentBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ *
+ * To open the channel, an initial payment of the server-specified dust limit value must be
+ * provided. This ensures that the channel is never in an un-settleable state due to either
+ * no payment tx having been provided at all, or a payment that is smaller than the dust
+ * limit being provided.
+ *
+ *
+ * required .paymentchannels.UpdatePayment initial_payment = 2;
+ */
+ public Builder clearInitialPayment() {
+ if (initialPaymentBuilder_ == null) {
+ initialPayment_ = null;
+ onChanged();
+ } else {
+ initialPaymentBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
+ }
+ /**
+ *
+ * To open the channel, an initial payment of the server-specified dust limit value must be
+ * provided. This ensures that the channel is never in an un-settleable state due to either
+ * no payment tx having been provided at all, or a payment that is smaller than the dust
+ * limit being provided.
+ *
+ *
+ * required .paymentchannels.UpdatePayment initial_payment = 2;
+ */
+ public org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder getInitialPaymentBuilder() {
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return getInitialPaymentFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ * To open the channel, an initial payment of the server-specified dust limit value must be
+ * provided. This ensures that the channel is never in an un-settleable state due to either
+ * no payment tx having been provided at all, or a payment that is smaller than the dust
+ * limit being provided.
+ *
+ *
+ * required .paymentchannels.UpdatePayment initial_payment = 2;
+ */
+ public org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder getInitialPaymentOrBuilder() {
+ if (initialPaymentBuilder_ != null) {
+ return initialPaymentBuilder_.getMessageOrBuilder();
+ } else {
+ return initialPayment_ == null ?
+ org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance() : initialPayment_;
+ }
+ }
+ /**
+ *
+ * To open the channel, an initial payment of the server-specified dust limit value must be
+ * provided. This ensures that the channel is never in an un-settleable state due to either
+ * no payment tx having been provided at all, or a payment that is smaller than the dust
+ * limit being provided.
+ *
+ *
+ * required .paymentchannels.UpdatePayment initial_payment = 2;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ org.bitcoin.paymentchannel.Protos.UpdatePayment, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder, org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder>
+ getInitialPaymentFieldBuilder() {
+ if (initialPaymentBuilder_ == null) {
+ initialPaymentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ org.bitcoin.paymentchannel.Protos.UpdatePayment, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder, org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder>(
+ getInitialPayment(),
+ getParentForChildren(),
+ isClean());
+ initialPayment_ = null;
+ }
+ return initialPaymentBuilder_;
+ }
+
+ private com.google.protobuf.ByteString clientKey_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ *
+ * This field is added in protocol version 2 to send the client public key to the server.
+ * In version 1 it isn't used.
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is only used in the creation of the multisig contract.
+ *
+ *
+ * optional bytes client_key = 3;
+ */
+ public boolean hasClientKey() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ *
+ * This field is added in protocol version 2 to send the client public key to the server.
+ * In version 1 it isn't used.
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is only used in the creation of the multisig contract.
+ *
+ *
+ * optional bytes client_key = 3;
+ */
+ public com.google.protobuf.ByteString getClientKey() {
+ return clientKey_;
+ }
+ /**
+ *
+ * This field is added in protocol version 2 to send the client public key to the server.
+ * In version 1 it isn't used.
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is only used in the creation of the multisig contract.
+ *
+ *
+ * optional bytes client_key = 3;
+ */
+ public Builder setClientKey(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000004;
+ clientKey_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * This field is added in protocol version 2 to send the client public key to the server.
+ * In version 1 it isn't used.
+ * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+ * are accepted. It is only used in the creation of the multisig contract.
+ *
+ *
+ * optional bytes client_key = 3;
+ */
+ public Builder clearClientKey() {
+ bitField0_ = (bitField0_ & ~0x00000004);
+ clientKey_ = getDefaultInstance().getClientKey();
+ onChanged();
+ return this;
+ }
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:paymentchannels.ProvideContract)
+ }
+
+ // @@protoc_insertion_point(class_scope:paymentchannels.ProvideContract)
+ private static final org.bitcoin.paymentchannel.Protos.ProvideContract DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.bitcoin.paymentchannel.Protos.ProvideContract();
+ }
+
+ public static org.bitcoin.paymentchannel.Protos.ProvideContract getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ public ProvideContract parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new ProvideContract(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.ProvideContract getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface UpdatePaymentOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:paymentchannels.UpdatePayment)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ * The value which is sent back to the primary. The rest of the multisig output is left for
+ * the secondary to do with as they wish.
+ *
+ *
+ * required uint64 client_change_value = 1;
+ */
+ boolean hasClientChangeValue();
+ /**
+ *
+ * The value which is sent back to the primary. The rest of the multisig output is left for
+ * the secondary to do with as they wish.
+ *
+ *
+ * required uint64 client_change_value = 1;
+ */
+ long getClientChangeValue();
+
+ /**
+ *
+ * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+ * spends the primary's part of the multisig contract's output. This signature only covers
+ * the primary's refund output and thus the secondary is free to do what they wish with their
+ * part of the multisig output.
+ *
+ *
+ * required bytes signature = 2;
+ */
+ boolean hasSignature();
+ /**
+ *
+ * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+ * spends the primary's part of the multisig contract's output. This signature only covers
+ * the primary's refund output and thus the secondary is free to do what they wish with their
+ * part of the multisig output.
+ *
+ *
+ * required bytes signature = 2;
+ */
+ com.google.protobuf.ByteString getSignature();
+
+ /**
+ *
+ * Information about this update. Used to extend this protocol.
+ *
+ *
+ * optional bytes info = 3;
+ */
+ boolean hasInfo();
+ /**
+ *
+ * Information about this update. Used to extend this protocol.
+ *
+ *
+ * optional bytes info = 3;
+ */
+ com.google.protobuf.ByteString getInfo();
+ }
+ /**
+ *
+ * This message can only be used by the primary after it has received a CHANNEL_OPEN message. It
+ * creates a new payment transaction. Note that we don't resubmit the entire TX, this is to avoid
+ * (re)parsing bugs and overhead. The payment transaction is created by the primary by:
+ * * Adding an input which spends the multisig contract
+ * * Setting this input's scriptSig to the given signature and a new signature created by the
+ * primary (the primary should ensure the signature provided correctly spends the multisig
+ * contract)
+ * * Adding an output who's scriptPubKey is the same as the refund output (the only output) in
+ * the refund transaction
+ * * Setting this output's value to client_change_value (which must be lower than the most recent
+ * client_change_value and lower than the multisig contract's output value)
+ * * Adding any number of additional outputs as desired (leaving sufficient fee, if necessary)
+ * * Adding any number of additional inputs as desired (eg to add more fee)
+ *
+ *
+ * Protobuf type {@code paymentchannels.UpdatePayment}
+ */
+ public static final class UpdatePayment extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:paymentchannels.UpdatePayment)
+ UpdatePaymentOrBuilder {
+ // Use UpdatePayment.newBuilder() to construct.
+ private UpdatePayment(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private UpdatePayment() {
+ clientChangeValue_ = 0L;
+ signature_ = com.google.protobuf.ByteString.EMPTY;
+ info_ = com.google.protobuf.ByteString.EMPTY;
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private UpdatePayment(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 8: {
+ bitField0_ |= 0x00000001;
+ clientChangeValue_ = input.readUInt64();
+ break;
+ }
+ case 18: {
+ bitField0_ |= 0x00000002;
+ signature_ = input.readBytes();
+ break;
+ }
+ case 26: {
+ bitField0_ |= 0x00000004;
+ info_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.bitcoin.paymentchannel.Protos.UpdatePayment.class, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int CLIENT_CHANGE_VALUE_FIELD_NUMBER = 1;
+ private long clientChangeValue_;
+ /**
+ *
+ * The value which is sent back to the primary. The rest of the multisig output is left for
+ * the secondary to do with as they wish.
+ *
+ *
+ * required uint64 client_change_value = 1;
+ */
+ public boolean hasClientChangeValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ *
+ * The value which is sent back to the primary. The rest of the multisig output is left for
+ * the secondary to do with as they wish.
+ *
+ *
+ * required uint64 client_change_value = 1;
+ */
+ public long getClientChangeValue() {
+ return clientChangeValue_;
+ }
+
+ public static final int SIGNATURE_FIELD_NUMBER = 2;
+ private com.google.protobuf.ByteString signature_;
+ /**
+ *
+ * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+ * spends the primary's part of the multisig contract's output. This signature only covers
+ * the primary's refund output and thus the secondary is free to do what they wish with their
+ * part of the multisig output.
+ *
+ *
+ * required bytes signature = 2;
+ */
+ public boolean hasSignature() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ *
+ * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+ * spends the primary's part of the multisig contract's output. This signature only covers
+ * the primary's refund output and thus the secondary is free to do what they wish with their
+ * part of the multisig output.
+ *
+ *
+ * required bytes signature = 2;
+ */
+ public com.google.protobuf.ByteString getSignature() {
+ return signature_;
+ }
+
+ public static final int INFO_FIELD_NUMBER = 3;
+ private com.google.protobuf.ByteString info_;
+ /**
+ *
+ * Information about this update. Used to extend this protocol.
+ *
+ *
+ * optional bytes info = 3;
+ */
+ public boolean hasInfo() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ *
+ * Information about this update. Used to extend this protocol.
+ *
+ *
+ * optional bytes info = 3;
+ */
+ public com.google.protobuf.ByteString getInfo() {
+ return info_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (!hasClientChangeValue()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!hasSignature()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeUInt64(1, clientChangeValue_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeBytes(2, signature_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ output.writeBytes(3, info_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt64Size(1, clientChangeValue_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(2, signature_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(3, info_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof org.bitcoin.paymentchannel.Protos.UpdatePayment)) {
+ return super.equals(obj);
+ }
+ org.bitcoin.paymentchannel.Protos.UpdatePayment other = (org.bitcoin.paymentchannel.Protos.UpdatePayment) obj;
+
+ boolean result = true;
+ result = result && (hasClientChangeValue() == other.hasClientChangeValue());
+ if (hasClientChangeValue()) {
+ result = result && (getClientChangeValue()
+ == other.getClientChangeValue());
+ }
+ result = result && (hasSignature() == other.hasSignature());
+ if (hasSignature()) {
+ result = result && getSignature()
+ .equals(other.getSignature());
+ }
+ result = result && (hasInfo() == other.hasInfo());
+ if (hasInfo()) {
+ result = result && getInfo()
+ .equals(other.getInfo());
+ }
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptorForType().hashCode();
+ if (hasClientChangeValue()) {
+ hash = (37 * hash) + CLIENT_CHANGE_VALUE_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getClientChangeValue());
+ }
+ if (hasSignature()) {
+ hash = (37 * hash) + SIGNATURE_FIELD_NUMBER;
+ hash = (53 * hash) + getSignature().hashCode();
+ }
+ if (hasInfo()) {
+ hash = (37 * hash) + INFO_FIELD_NUMBER;
+ hash = (53 * hash) + getInfo().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.UpdatePayment prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ *
+ * This message can only be used by the primary after it has received a CHANNEL_OPEN message. It
+ * creates a new payment transaction. Note that we don't resubmit the entire TX, this is to avoid
+ * (re)parsing bugs and overhead. The payment transaction is created by the primary by:
+ * * Adding an input which spends the multisig contract
+ * * Setting this input's scriptSig to the given signature and a new signature created by the
+ * primary (the primary should ensure the signature provided correctly spends the multisig
+ * contract)
+ * * Adding an output who's scriptPubKey is the same as the refund output (the only output) in
+ * the refund transaction
+ * * Setting this output's value to client_change_value (which must be lower than the most recent
+ * client_change_value and lower than the multisig contract's output value)
+ * * Adding any number of additional outputs as desired (leaving sufficient fee, if necessary)
+ * * Adding any number of additional inputs as desired (eg to add more fee)
+ *
+ *
+ * Protobuf type {@code paymentchannels.UpdatePayment}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:paymentchannels.UpdatePayment)
+ org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.bitcoin.paymentchannel.Protos.UpdatePayment.class, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder.class);
+ }
+
+ // Construct using org.bitcoin.paymentchannel.Protos.UpdatePayment.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ }
+ }
+ public Builder clear() {
+ super.clear();
+ clientChangeValue_ = 0L;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ signature_ = com.google.protobuf.ByteString.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ info_ = com.google.protobuf.ByteString.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_descriptor;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.UpdatePayment getDefaultInstanceForType() {
+ return org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance();
+ }
+
+ public org.bitcoin.paymentchannel.Protos.UpdatePayment build() {
+ org.bitcoin.paymentchannel.Protos.UpdatePayment result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.UpdatePayment buildPartial() {
+ org.bitcoin.paymentchannel.Protos.UpdatePayment result = new org.bitcoin.paymentchannel.Protos.UpdatePayment(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.clientChangeValue_ = clientChangeValue_;
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.signature_ = signature_;
+ if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+ to_bitField0_ |= 0x00000004;
+ }
+ result.info_ = info_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder clone() {
+ return (Builder) super.clone();
+ }
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ Object value) {
+ return (Builder) super.setField(field, value);
+ }
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return (Builder) super.clearField(field);
+ }
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return (Builder) super.clearOneof(oneof);
+ }
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, Object value) {
+ return (Builder) super.setRepeatedField(field, index, value);
+ }
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ Object value) {
+ return (Builder) super.addRepeatedField(field, value);
+ }
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.bitcoin.paymentchannel.Protos.UpdatePayment) {
+ return mergeFrom((org.bitcoin.paymentchannel.Protos.UpdatePayment)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.UpdatePayment other) {
+ if (other == org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance()) return this;
+ if (other.hasClientChangeValue()) {
+ setClientChangeValue(other.getClientChangeValue());
+ }
+ if (other.hasSignature()) {
+ setSignature(other.getSignature());
+ }
+ if (other.hasInfo()) {
+ setInfo(other.getInfo());
+ }
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasClientChangeValue()) {
+ return false;
+ }
+ if (!hasSignature()) {
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.bitcoin.paymentchannel.Protos.UpdatePayment parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.bitcoin.paymentchannel.Protos.UpdatePayment) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private long clientChangeValue_ ;
+ /**
+ *
+ * The value which is sent back to the primary. The rest of the multisig output is left for
+ * the secondary to do with as they wish.
+ *
+ *
+ * required uint64 client_change_value = 1;
+ */
+ public boolean hasClientChangeValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ *
+ * The value which is sent back to the primary. The rest of the multisig output is left for
+ * the secondary to do with as they wish.
+ *
+ *
+ * required uint64 client_change_value = 1;
+ */
+ public long getClientChangeValue() {
+ return clientChangeValue_;
+ }
+ /**
+ *
+ * The value which is sent back to the primary. The rest of the multisig output is left for
+ * the secondary to do with as they wish.
+ *
+ *
+ * required uint64 client_change_value = 1;
+ */
+ public Builder setClientChangeValue(long value) {
+ bitField0_ |= 0x00000001;
+ clientChangeValue_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * The value which is sent back to the primary. The rest of the multisig output is left for
+ * the secondary to do with as they wish.
+ *
+ *
+ * required uint64 client_change_value = 1;
+ */
+ public Builder clearClientChangeValue() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ clientChangeValue_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.ByteString signature_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ *
+ * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+ * spends the primary's part of the multisig contract's output. This signature only covers
+ * the primary's refund output and thus the secondary is free to do what they wish with their
+ * part of the multisig output.
+ *
+ *
+ * required bytes signature = 2;
+ */
+ public boolean hasSignature() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ *
+ * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+ * spends the primary's part of the multisig contract's output. This signature only covers
+ * the primary's refund output and thus the secondary is free to do what they wish with their
+ * part of the multisig output.
+ *
+ *
+ * required bytes signature = 2;
+ */
+ public com.google.protobuf.ByteString getSignature() {
+ return signature_;
+ }
+ /**
+ *
+ * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+ * spends the primary's part of the multisig contract's output. This signature only covers
+ * the primary's refund output and thus the secondary is free to do what they wish with their
+ * part of the multisig output.
+ *
+ *
+ * required bytes signature = 2;
+ */
+ public Builder setSignature(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ signature_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+ * spends the primary's part of the multisig contract's output. This signature only covers
+ * the primary's refund output and thus the secondary is free to do what they wish with their
+ * part of the multisig output.
+ *
+ *
+ * required bytes signature = 2;
+ */
+ public Builder clearSignature() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ signature_ = getDefaultInstance().getSignature();
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.ByteString info_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ *
+ * Information about this update. Used to extend this protocol.
+ *
+ *
+ * optional bytes info = 3;
+ */
+ public boolean hasInfo() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ *
+ * Information about this update. Used to extend this protocol.
+ *
+ *
+ * optional bytes info = 3;
+ */
+ public com.google.protobuf.ByteString getInfo() {
+ return info_;
+ }
+ /**
+ *
+ * Information about this update. Used to extend this protocol.
+ *
+ *
+ * optional bytes info = 3;
+ */
+ public Builder setInfo(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000004;
+ info_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * Information about this update. Used to extend this protocol.
+ *
+ *
+ * optional bytes info = 3;
+ */
+ public Builder clearInfo() {
+ bitField0_ = (bitField0_ & ~0x00000004);
+ info_ = getDefaultInstance().getInfo();
+ onChanged();
+ return this;
+ }
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:paymentchannels.UpdatePayment)
+ }
+
+ // @@protoc_insertion_point(class_scope:paymentchannels.UpdatePayment)
+ private static final org.bitcoin.paymentchannel.Protos.UpdatePayment DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.bitcoin.paymentchannel.Protos.UpdatePayment();
+ }
+
+ public static org.bitcoin.paymentchannel.Protos.UpdatePayment getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ public UpdatePayment parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new UpdatePayment(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.UpdatePayment getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface PaymentAckOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:paymentchannels.PaymentAck)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ * Information about this update. Used to extend this protocol
+ *
+ *
+ * optional bytes info = 1;
+ */
+ boolean hasInfo();
+ /**
+ *
+ * Information about this update. Used to extend this protocol
+ *
+ *
+ * optional bytes info = 1;
+ */
+ com.google.protobuf.ByteString getInfo();
+ }
+ /**
+ *
+ * This message is sent as an acknowledgement of an UpdatePayment message
+ *
+ *
+ * Protobuf type {@code paymentchannels.PaymentAck}
+ */
+ public static final class PaymentAck extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:paymentchannels.PaymentAck)
+ PaymentAckOrBuilder {
+ // Use PaymentAck.newBuilder() to construct.
+ private PaymentAck(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private PaymentAck() {
+ info_ = com.google.protobuf.ByteString.EMPTY;
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private PaymentAck(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 10: {
+ bitField0_ |= 0x00000001;
+ info_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_PaymentAck_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_PaymentAck_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.bitcoin.paymentchannel.Protos.PaymentAck.class, org.bitcoin.paymentchannel.Protos.PaymentAck.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int INFO_FIELD_NUMBER = 1;
+ private com.google.protobuf.ByteString info_;
+ /**
+ *
+ * Information about this update. Used to extend this protocol
+ *
+ *
+ * optional bytes info = 1;
+ */
+ public boolean hasInfo() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ *
+ * Information about this update. Used to extend this protocol
+ *
+ *
+ * optional bytes info = 1;
+ */
+ public com.google.protobuf.ByteString getInfo() {
+ return info_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, info_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, info_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof org.bitcoin.paymentchannel.Protos.PaymentAck)) {
+ return super.equals(obj);
+ }
+ org.bitcoin.paymentchannel.Protos.PaymentAck other = (org.bitcoin.paymentchannel.Protos.PaymentAck) obj;
+
+ boolean result = true;
+ result = result && (hasInfo() == other.hasInfo());
+ if (hasInfo()) {
+ result = result && getInfo()
+ .equals(other.getInfo());
+ }
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptorForType().hashCode();
+ if (hasInfo()) {
+ hash = (37 * hash) + INFO_FIELD_NUMBER;
+ hash = (53 * hash) + getInfo().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.bitcoin.paymentchannel.Protos.PaymentAck parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.bitcoin.paymentchannel.Protos.PaymentAck parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.PaymentAck parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.bitcoin.paymentchannel.Protos.PaymentAck parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.PaymentAck parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.PaymentAck parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.PaymentAck parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.PaymentAck parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.PaymentAck parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.PaymentAck parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.PaymentAck prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ *
+ * This message is sent as an acknowledgement of an UpdatePayment message
+ *
+ *
+ * Protobuf type {@code paymentchannels.PaymentAck}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:paymentchannels.PaymentAck)
+ org.bitcoin.paymentchannel.Protos.PaymentAckOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_PaymentAck_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_PaymentAck_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.bitcoin.paymentchannel.Protos.PaymentAck.class, org.bitcoin.paymentchannel.Protos.PaymentAck.Builder.class);
+ }
+
+ // Construct using org.bitcoin.paymentchannel.Protos.PaymentAck.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ }
+ }
+ public Builder clear() {
+ super.clear();
+ info_ = com.google.protobuf.ByteString.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_PaymentAck_descriptor;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.PaymentAck getDefaultInstanceForType() {
+ return org.bitcoin.paymentchannel.Protos.PaymentAck.getDefaultInstance();
+ }
+
+ public org.bitcoin.paymentchannel.Protos.PaymentAck build() {
+ org.bitcoin.paymentchannel.Protos.PaymentAck result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.PaymentAck buildPartial() {
+ org.bitcoin.paymentchannel.Protos.PaymentAck result = new org.bitcoin.paymentchannel.Protos.PaymentAck(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.info_ = info_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder clone() {
+ return (Builder) super.clone();
+ }
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ Object value) {
+ return (Builder) super.setField(field, value);
+ }
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return (Builder) super.clearField(field);
+ }
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return (Builder) super.clearOneof(oneof);
+ }
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, Object value) {
+ return (Builder) super.setRepeatedField(field, index, value);
+ }
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ Object value) {
+ return (Builder) super.addRepeatedField(field, value);
+ }
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.bitcoin.paymentchannel.Protos.PaymentAck) {
+ return mergeFrom((org.bitcoin.paymentchannel.Protos.PaymentAck)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.PaymentAck other) {
+ if (other == org.bitcoin.paymentchannel.Protos.PaymentAck.getDefaultInstance()) return this;
+ if (other.hasInfo()) {
+ setInfo(other.getInfo());
+ }
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.bitcoin.paymentchannel.Protos.PaymentAck parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.bitcoin.paymentchannel.Protos.PaymentAck) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private com.google.protobuf.ByteString info_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ *
+ * Information about this update. Used to extend this protocol
+ *
+ *
+ * optional bytes info = 1;
+ */
+ public boolean hasInfo() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ *
+ * Information about this update. Used to extend this protocol
+ *
+ *
+ * optional bytes info = 1;
+ */
+ public com.google.protobuf.ByteString getInfo() {
+ return info_;
+ }
+ /**
+ *
+ * Information about this update. Used to extend this protocol
+ *
+ *
+ * optional bytes info = 1;
+ */
+ public Builder setInfo(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ info_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * Information about this update. Used to extend this protocol
+ *
+ *
+ * optional bytes info = 1;
+ */
+ public Builder clearInfo() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ info_ = getDefaultInstance().getInfo();
+ onChanged();
+ return this;
+ }
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:paymentchannels.PaymentAck)
+ }
+
+ // @@protoc_insertion_point(class_scope:paymentchannels.PaymentAck)
+ private static final org.bitcoin.paymentchannel.Protos.PaymentAck DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.bitcoin.paymentchannel.Protos.PaymentAck();
+ }
+
+ public static org.bitcoin.paymentchannel.Protos.PaymentAck getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ public PaymentAck parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new PaymentAck(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.PaymentAck getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface SettlementOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:paymentchannels.Settlement)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ * A copy of the fully signed final contract that settles the channel. The client can verify
+ * the transaction is correct and then commit it to their wallet.
+ *
+ *
+ * required bytes tx = 3;
+ */
+ boolean hasTx();
+ /**
+ *
+ * A copy of the fully signed final contract that settles the channel. The client can verify
+ * the transaction is correct and then commit it to their wallet.
+ *
+ *
+ * required bytes tx = 3;
+ */
+ com.google.protobuf.ByteString getTx();
+ }
+ /**
+ * Protobuf type {@code paymentchannels.Settlement}
+ */
+ public static final class Settlement extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:paymentchannels.Settlement)
+ SettlementOrBuilder {
+ // Use Settlement.newBuilder() to construct.
+ private Settlement(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private Settlement() {
+ tx_ = com.google.protobuf.ByteString.EMPTY;
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Settlement(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 26: {
+ bitField0_ |= 0x00000001;
+ tx_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Settlement_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Settlement_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.bitcoin.paymentchannel.Protos.Settlement.class, org.bitcoin.paymentchannel.Protos.Settlement.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int TX_FIELD_NUMBER = 3;
+ private com.google.protobuf.ByteString tx_;
+ /**
+ *
+ * A copy of the fully signed final contract that settles the channel. The client can verify
+ * the transaction is correct and then commit it to their wallet.
+ *
+ *
+ * required bytes tx = 3;
+ */
+ public boolean hasTx() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ *
+ * A copy of the fully signed final contract that settles the channel. The client can verify
+ * the transaction is correct and then commit it to their wallet.
+ *
+ *
+ * required bytes tx = 3;
+ */
+ public com.google.protobuf.ByteString getTx() {
+ return tx_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (!hasTx()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(3, tx_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(3, tx_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof org.bitcoin.paymentchannel.Protos.Settlement)) {
+ return super.equals(obj);
+ }
+ org.bitcoin.paymentchannel.Protos.Settlement other = (org.bitcoin.paymentchannel.Protos.Settlement) obj;
+
+ boolean result = true;
+ result = result && (hasTx() == other.hasTx());
+ if (hasTx()) {
+ result = result && getTx()
+ .equals(other.getTx());
+ }
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptorForType().hashCode();
+ if (hasTx()) {
+ hash = (37 * hash) + TX_FIELD_NUMBER;
+ hash = (53 * hash) + getTx().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.bitcoin.paymentchannel.Protos.Settlement parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Settlement parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Settlement parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Settlement parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Settlement parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Settlement parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Settlement parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Settlement parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Settlement parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Settlement parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.Settlement prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code paymentchannels.Settlement}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:paymentchannels.Settlement)
+ org.bitcoin.paymentchannel.Protos.SettlementOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Settlement_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Settlement_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.bitcoin.paymentchannel.Protos.Settlement.class, org.bitcoin.paymentchannel.Protos.Settlement.Builder.class);
+ }
+
+ // Construct using org.bitcoin.paymentchannel.Protos.Settlement.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ }
+ }
+ public Builder clear() {
+ super.clear();
+ tx_ = com.google.protobuf.ByteString.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ return this;
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Settlement_descriptor;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.Settlement getDefaultInstanceForType() {
+ return org.bitcoin.paymentchannel.Protos.Settlement.getDefaultInstance();
+ }
+
+ public org.bitcoin.paymentchannel.Protos.Settlement build() {
+ org.bitcoin.paymentchannel.Protos.Settlement result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.Settlement buildPartial() {
+ org.bitcoin.paymentchannel.Protos.Settlement result = new org.bitcoin.paymentchannel.Protos.Settlement(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.tx_ = tx_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder clone() {
+ return (Builder) super.clone();
+ }
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ Object value) {
+ return (Builder) super.setField(field, value);
+ }
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return (Builder) super.clearField(field);
+ }
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return (Builder) super.clearOneof(oneof);
+ }
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, Object value) {
+ return (Builder) super.setRepeatedField(field, index, value);
+ }
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ Object value) {
+ return (Builder) super.addRepeatedField(field, value);
+ }
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.bitcoin.paymentchannel.Protos.Settlement) {
+ return mergeFrom((org.bitcoin.paymentchannel.Protos.Settlement)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.Settlement other) {
+ if (other == org.bitcoin.paymentchannel.Protos.Settlement.getDefaultInstance()) return this;
+ if (other.hasTx()) {
+ setTx(other.getTx());
+ }
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasTx()) {
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.bitcoin.paymentchannel.Protos.Settlement parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.bitcoin.paymentchannel.Protos.Settlement) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private com.google.protobuf.ByteString tx_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ *
+ * A copy of the fully signed final contract that settles the channel. The client can verify
+ * the transaction is correct and then commit it to their wallet.
+ *
+ *
+ * required bytes tx = 3;
+ */
+ public boolean hasTx() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ *
+ * A copy of the fully signed final contract that settles the channel. The client can verify
+ * the transaction is correct and then commit it to their wallet.
+ *
+ *
+ * required bytes tx = 3;
+ */
+ public com.google.protobuf.ByteString getTx() {
+ return tx_;
+ }
+ /**
+ *
+ * A copy of the fully signed final contract that settles the channel. The client can verify
+ * the transaction is correct and then commit it to their wallet.
+ *
+ *
+ * required bytes tx = 3;
+ */
+ public Builder setTx(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ tx_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * A copy of the fully signed final contract that settles the channel. The client can verify
+ * the transaction is correct and then commit it to their wallet.
+ *
+ *
+ * required bytes tx = 3;
+ */
+ public Builder clearTx() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ tx_ = getDefaultInstance().getTx();
+ onChanged();
+ return this;
+ }
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:paymentchannels.Settlement)
+ }
+
+ // @@protoc_insertion_point(class_scope:paymentchannels.Settlement)
+ private static final org.bitcoin.paymentchannel.Protos.Settlement DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.bitcoin.paymentchannel.Protos.Settlement();
+ }
+
+ public static org.bitcoin.paymentchannel.Protos.Settlement getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ public Settlement parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Settlement(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.Settlement getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface ErrorOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:paymentchannels.Error)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER];
+ */
+ boolean hasCode();
+ /**
+ * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER];
+ */
+ org.bitcoin.paymentchannel.Protos.Error.ErrorCode getCode();
+
+ /**
+ *
+ * NOT SAFE FOR HTML WITHOUT ESCAPING
+ *
+ *
+ * optional string explanation = 2;
+ */
+ boolean hasExplanation();
+ /**
+ *
+ * NOT SAFE FOR HTML WITHOUT ESCAPING
+ *
+ *
+ * optional string explanation = 2;
+ */
+ java.lang.String getExplanation();
+ /**
+ *
+ * NOT SAFE FOR HTML WITHOUT ESCAPING
+ *
+ *
+ * optional string explanation = 2;
+ */
+ com.google.protobuf.ByteString
+ getExplanationBytes();
+
+ /**
+ *
+ * Can be set by the client when erroring to the server if a value was out of range. Can help with debugging.
+ *
+ *
+ * optional uint64 expected_value = 3;
+ */
+ boolean hasExpectedValue();
+ /**
+ *
+ * Can be set by the client when erroring to the server if a value was out of range. Can help with debugging.
+ *
+ *
+ * optional uint64 expected_value = 3;
+ */
+ long getExpectedValue();
+ }
+ /**
+ *
+ * An Error can be sent by either party at any time
+ * Both parties should make an effort to send either an ERROR or a CLOSE immediately before
+ * closing the socket (unless they just received an ERROR or a CLOSE)
+ *
+ *
+ * Protobuf type {@code paymentchannels.Error}
+ */
+ public static final class Error extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:paymentchannels.Error)
+ ErrorOrBuilder {
+ // Use Error.newBuilder() to construct.
+ private Error(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private Error() {
+ code_ = 8;
+ explanation_ = "";
+ expectedValue_ = 0L;
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Error(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 8: {
+ int rawValue = input.readEnum();
+ org.bitcoin.paymentchannel.Protos.Error.ErrorCode value = org.bitcoin.paymentchannel.Protos.Error.ErrorCode.valueOf(rawValue);
+ if (value == null) {
+ unknownFields.mergeVarintField(1, rawValue);
+ } else {
+ bitField0_ |= 0x00000001;
+ code_ = rawValue;
+ }
+ break;
+ }
+ case 18: {
+ com.google.protobuf.ByteString bs = input.readBytes();
+ bitField0_ |= 0x00000002;
+ explanation_ = bs;
+ break;
+ }
+ case 24: {
+ bitField0_ |= 0x00000004;
+ expectedValue_ = input.readUInt64();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.bitcoin.paymentchannel.Protos.Error.class, org.bitcoin.paymentchannel.Protos.Error.Builder.class);
+ }
+
+ /**
+ * Protobuf enum {@code paymentchannels.Error.ErrorCode}
+ */
+ public enum ErrorCode
+ implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ *
+ * Protocol timeout occurred (one party hung).
+ *
+ *
+ * TIMEOUT = 1;
+ */
+ TIMEOUT(1),
+ /**
+ *
+ * Generic error indicating some message was not properly
+ *
+ *
+ * SYNTAX_ERROR = 2;
+ */
+ SYNTAX_ERROR(2),
+ /**
+ *
+ * formatted or was out of order.
+ *
+ *
+ * NO_ACCEPTABLE_VERSION = 3;
+ */
+ NO_ACCEPTABLE_VERSION(3),
+ /**
+ *
+ * A provided transaction was not in the proper structure
+ *
+ *
+ * BAD_TRANSACTION = 4;
+ */
+ BAD_TRANSACTION(4),
+ /**
+ *
+ * (wrong inputs/outputs, sequence, lock time, signature,
+ * etc)
+ *
+ *
+ * TIME_WINDOW_UNACCEPTABLE = 5;
+ */
+ TIME_WINDOW_UNACCEPTABLE(5),
+ /**
+ *
+ * for the primary
+ *
+ *
+ * CHANNEL_VALUE_TOO_LARGE = 6;
+ */
+ CHANNEL_VALUE_TOO_LARGE(6),
+ /**
+ *
+ * too large for the primary
+ *
+ *
+ * MIN_PAYMENT_TOO_LARGE = 7;
+ */
+ MIN_PAYMENT_TOO_LARGE(7),
+ /**
+ * OTHER = 8;
+ */
+ OTHER(8),
+ ;
+
+ /**
+ *
+ * Protocol timeout occurred (one party hung).
+ *
+ *
+ * TIMEOUT = 1;
+ */
+ public static final int TIMEOUT_VALUE = 1;
+ /**
+ *
+ * Generic error indicating some message was not properly
+ *
+ *
+ * SYNTAX_ERROR = 2;
+ */
+ public static final int SYNTAX_ERROR_VALUE = 2;
+ /**
+ *
+ * formatted or was out of order.
+ *
+ *
+ * NO_ACCEPTABLE_VERSION = 3;
+ */
+ public static final int NO_ACCEPTABLE_VERSION_VALUE = 3;
+ /**
+ *
+ * A provided transaction was not in the proper structure
+ *
+ *
+ * BAD_TRANSACTION = 4;
+ */
+ public static final int BAD_TRANSACTION_VALUE = 4;
+ /**
+ *
+ * (wrong inputs/outputs, sequence, lock time, signature,
+ * etc)
+ *
+ *
+ * TIME_WINDOW_UNACCEPTABLE = 5;
+ */
+ public static final int TIME_WINDOW_UNACCEPTABLE_VALUE = 5;
+ /**
+ *
+ * for the primary
+ *
+ *
+ * CHANNEL_VALUE_TOO_LARGE = 6;
+ */
+ public static final int CHANNEL_VALUE_TOO_LARGE_VALUE = 6;
+ /**
+ *
+ * too large for the primary
+ *
+ *
+ * MIN_PAYMENT_TOO_LARGE = 7;
+ */
+ public static final int MIN_PAYMENT_TOO_LARGE_VALUE = 7;
+ /**
+ * OTHER = 8;
+ */
+ public static final int OTHER_VALUE = 8;
+
+
+ public final int getNumber() {
+ return value;
+ }
+
+ /**
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static ErrorCode valueOf(int value) {
+ return forNumber(value);
+ }
+
+ public static ErrorCode forNumber(int value) {
+ switch (value) {
+ case 1: return TIMEOUT;
+ case 2: return SYNTAX_ERROR;
+ case 3: return NO_ACCEPTABLE_VERSION;
+ case 4: return BAD_TRANSACTION;
+ case 5: return TIME_WINDOW_UNACCEPTABLE;
+ case 6: return CHANNEL_VALUE_TOO_LARGE;
+ case 7: return MIN_PAYMENT_TOO_LARGE;
+ case 8: return OTHER;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static final com.google.protobuf.Internal.EnumLiteMap<
+ ErrorCode> internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap() {
+ public ErrorCode findValueByNumber(int number) {
+ return ErrorCode.forNumber(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ return getDescriptor().getValues().get(ordinal());
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return org.bitcoin.paymentchannel.Protos.Error.getDescriptor().getEnumTypes().get(0);
+ }
+
+ private static final ErrorCode[] VALUES = values();
+
+ public static ErrorCode valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int value;
+
+ private ErrorCode(int value) {
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:paymentchannels.Error.ErrorCode)
+ }
+
+ private int bitField0_;
+ public static final int CODE_FIELD_NUMBER = 1;
+ private int code_;
+ /**
+ * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER];
+ */
+ public boolean hasCode() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER];
+ */
+ public org.bitcoin.paymentchannel.Protos.Error.ErrorCode getCode() {
+ org.bitcoin.paymentchannel.Protos.Error.ErrorCode result = org.bitcoin.paymentchannel.Protos.Error.ErrorCode.valueOf(code_);
+ return result == null ? org.bitcoin.paymentchannel.Protos.Error.ErrorCode.OTHER : result;
+ }
+
+ public static final int EXPLANATION_FIELD_NUMBER = 2;
+ private volatile java.lang.Object explanation_;
+ /**
+ *
+ * NOT SAFE FOR HTML WITHOUT ESCAPING
+ *
+ *
+ * optional string explanation = 2;
+ */
+ public boolean hasExplanation() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ *
+ * NOT SAFE FOR HTML WITHOUT ESCAPING
+ *
+ *
+ * optional string explanation = 2;
+ */
+ public java.lang.String getExplanation() {
+ java.lang.Object ref = explanation_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ explanation_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ *
+ * NOT SAFE FOR HTML WITHOUT ESCAPING
+ *
+ *
+ * optional string explanation = 2;
+ */
+ public com.google.protobuf.ByteString
+ getExplanationBytes() {
+ java.lang.Object ref = explanation_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ explanation_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int EXPECTED_VALUE_FIELD_NUMBER = 3;
+ private long expectedValue_;
+ /**
+ *
+ * Can be set by the client when erroring to the server if a value was out of range. Can help with debugging.
+ *
+ *
+ * optional uint64 expected_value = 3;
+ */
+ public boolean hasExpectedValue() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ *
+ * Can be set by the client when erroring to the server if a value was out of range. Can help with debugging.
+ *
+ *
+ * optional uint64 expected_value = 3;
+ */
+ public long getExpectedValue() {
+ return expectedValue_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeEnum(1, code_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, explanation_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ output.writeUInt64(3, expectedValue_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeEnumSize(1, code_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, explanation_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt64Size(3, expectedValue_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof org.bitcoin.paymentchannel.Protos.Error)) {
+ return super.equals(obj);
+ }
+ org.bitcoin.paymentchannel.Protos.Error other = (org.bitcoin.paymentchannel.Protos.Error) obj;
+
+ boolean result = true;
+ result = result && (hasCode() == other.hasCode());
+ if (hasCode()) {
+ result = result && code_ == other.code_;
+ }
+ result = result && (hasExplanation() == other.hasExplanation());
+ if (hasExplanation()) {
+ result = result && getExplanation()
+ .equals(other.getExplanation());
+ }
+ result = result && (hasExpectedValue() == other.hasExpectedValue());
+ if (hasExpectedValue()) {
+ result = result && (getExpectedValue()
+ == other.getExpectedValue());
+ }
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptorForType().hashCode();
+ if (hasCode()) {
+ hash = (37 * hash) + CODE_FIELD_NUMBER;
+ hash = (53 * hash) + code_;
+ }
+ if (hasExplanation()) {
+ hash = (37 * hash) + EXPLANATION_FIELD_NUMBER;
+ hash = (53 * hash) + getExplanation().hashCode();
+ }
+ if (hasExpectedValue()) {
+ hash = (37 * hash) + EXPECTED_VALUE_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getExpectedValue());
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.bitcoin.paymentchannel.Protos.Error parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Error parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Error parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Error parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Error parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Error parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Error parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Error parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Error parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.paymentchannel.Protos.Error parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.Error prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ *
+ * An Error can be sent by either party at any time
+ * Both parties should make an effort to send either an ERROR or a CLOSE immediately before
+ * closing the socket (unless they just received an ERROR or a CLOSE)
+ *
+ *
+ * Protobuf type {@code paymentchannels.Error}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:paymentchannels.Error)
+ org.bitcoin.paymentchannel.Protos.ErrorOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.bitcoin.paymentchannel.Protos.Error.class, org.bitcoin.paymentchannel.Protos.Error.Builder.class);
+ }
+
+ // Construct using org.bitcoin.paymentchannel.Protos.Error.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ }
+ }
+ public Builder clear() {
+ super.clear();
+ code_ = 8;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ explanation_ = "";
+ bitField0_ = (bitField0_ & ~0x00000002);
+ expectedValue_ = 0L;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_descriptor;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.Error getDefaultInstanceForType() {
+ return org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance();
+ }
+
+ public org.bitcoin.paymentchannel.Protos.Error build() {
+ org.bitcoin.paymentchannel.Protos.Error result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.Error buildPartial() {
+ org.bitcoin.paymentchannel.Protos.Error result = new org.bitcoin.paymentchannel.Protos.Error(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.code_ = code_;
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.explanation_ = explanation_;
+ if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+ to_bitField0_ |= 0x00000004;
+ }
+ result.expectedValue_ = expectedValue_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder clone() {
+ return (Builder) super.clone();
+ }
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ Object value) {
+ return (Builder) super.setField(field, value);
+ }
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return (Builder) super.clearField(field);
+ }
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return (Builder) super.clearOneof(oneof);
+ }
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, Object value) {
+ return (Builder) super.setRepeatedField(field, index, value);
+ }
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ Object value) {
+ return (Builder) super.addRepeatedField(field, value);
+ }
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.bitcoin.paymentchannel.Protos.Error) {
+ return mergeFrom((org.bitcoin.paymentchannel.Protos.Error)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.Error other) {
+ if (other == org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance()) return this;
+ if (other.hasCode()) {
+ setCode(other.getCode());
+ }
+ if (other.hasExplanation()) {
+ bitField0_ |= 0x00000002;
+ explanation_ = other.explanation_;
+ onChanged();
+ }
+ if (other.hasExpectedValue()) {
+ setExpectedValue(other.getExpectedValue());
+ }
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.bitcoin.paymentchannel.Protos.Error parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.bitcoin.paymentchannel.Protos.Error) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private int code_ = 8;
+ /**
+ * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER];
+ */
+ public boolean hasCode() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER];
+ */
+ public org.bitcoin.paymentchannel.Protos.Error.ErrorCode getCode() {
+ org.bitcoin.paymentchannel.Protos.Error.ErrorCode result = org.bitcoin.paymentchannel.Protos.Error.ErrorCode.valueOf(code_);
+ return result == null ? org.bitcoin.paymentchannel.Protos.Error.ErrorCode.OTHER : result;
+ }
+ /**
+ * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER];
+ */
+ public Builder setCode(org.bitcoin.paymentchannel.Protos.Error.ErrorCode value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ code_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER];
+ */
+ public Builder clearCode() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ code_ = 8;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object explanation_ = "";
+ /**
+ *
+ * NOT SAFE FOR HTML WITHOUT ESCAPING
+ *
+ *
+ * optional string explanation = 2;
+ */
+ public boolean hasExplanation() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ *
+ * NOT SAFE FOR HTML WITHOUT ESCAPING
+ *
+ *
+ * optional string explanation = 2;
+ */
+ public java.lang.String getExplanation() {
+ java.lang.Object ref = explanation_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ explanation_ = s;
+ }
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ *
+ * NOT SAFE FOR HTML WITHOUT ESCAPING
+ *
+ *
+ * optional string explanation = 2;
+ */
+ public com.google.protobuf.ByteString
+ getExplanationBytes() {
+ java.lang.Object ref = explanation_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ explanation_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ *
+ * NOT SAFE FOR HTML WITHOUT ESCAPING
+ *
+ *
+ * optional string explanation = 2;
+ */
+ public Builder setExplanation(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ explanation_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * NOT SAFE FOR HTML WITHOUT ESCAPING
+ *
+ *
+ * optional string explanation = 2;
+ */
+ public Builder clearExplanation() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ explanation_ = getDefaultInstance().getExplanation();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * NOT SAFE FOR HTML WITHOUT ESCAPING
+ *
+ *
+ * optional string explanation = 2;
+ */
+ public Builder setExplanationBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ explanation_ = value;
+ onChanged();
+ return this;
+ }
+
+ private long expectedValue_ ;
+ /**
+ *
+ * Can be set by the client when erroring to the server if a value was out of range. Can help with debugging.
+ *
+ *
+ * optional uint64 expected_value = 3;
+ */
+ public boolean hasExpectedValue() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ *
+ * Can be set by the client when erroring to the server if a value was out of range. Can help with debugging.
+ *
+ *
+ * optional uint64 expected_value = 3;
+ */
+ public long getExpectedValue() {
+ return expectedValue_;
+ }
+ /**
+ *
+ * Can be set by the client when erroring to the server if a value was out of range. Can help with debugging.
+ *
+ *
+ * optional uint64 expected_value = 3;
+ */
+ public Builder setExpectedValue(long value) {
+ bitField0_ |= 0x00000004;
+ expectedValue_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * Can be set by the client when erroring to the server if a value was out of range. Can help with debugging.
+ *
+ *
+ * optional uint64 expected_value = 3;
+ */
+ public Builder clearExpectedValue() {
+ bitField0_ = (bitField0_ & ~0x00000004);
+ expectedValue_ = 0L;
+ onChanged();
+ return this;
+ }
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:paymentchannels.Error)
+ }
+
+ // @@protoc_insertion_point(class_scope:paymentchannels.Error)
+ private static final org.bitcoin.paymentchannel.Protos.Error DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.bitcoin.paymentchannel.Protos.Error();
+ }
+
+ public static org.bitcoin.paymentchannel.Protos.Error getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ public Error parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new Error(input, extensionRegistry);
+ }
+ };
+
+ public static com.google.protobuf.Parser parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ public org.bitcoin.paymentchannel.Protos.Error getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_paymentchannels_TwoWayChannelMessage_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_paymentchannels_TwoWayChannelMessage_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_paymentchannels_ClientVersion_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_paymentchannels_ClientVersion_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_paymentchannels_ServerVersion_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_paymentchannels_ServerVersion_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_paymentchannels_Initiate_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_paymentchannels_Initiate_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_paymentchannels_ProvideRefund_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_paymentchannels_ProvideRefund_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_paymentchannels_ReturnRefund_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_paymentchannels_ReturnRefund_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_paymentchannels_ProvideContract_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_paymentchannels_ProvideContract_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_paymentchannels_UpdatePayment_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_paymentchannels_UpdatePayment_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_paymentchannels_PaymentAck_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_paymentchannels_PaymentAck_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_paymentchannels_Settlement_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_paymentchannels_Settlement_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_paymentchannels_Error_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_paymentchannels_Error_fieldAccessorTable;
+
+ public static com.google.protobuf.Descriptors.FileDescriptor
+ getDescriptor() {
+ return descriptor;
+ }
+ private static com.google.protobuf.Descriptors.FileDescriptor
+ descriptor;
+ static {
+ java.lang.String[] descriptorData = {
+ "\n\024paymentchannel.proto\022\017paymentchannels\"" +
+ "\260\006\n\024TwoWayChannelMessage\022?\n\004type\030\001 \002(\01621" +
+ ".paymentchannels.TwoWayChannelMessage.Me" +
+ "ssageType\0226\n\016client_version\030\002 \001(\0132\036.paym" +
+ "entchannels.ClientVersion\0226\n\016server_vers" +
+ "ion\030\003 \001(\0132\036.paymentchannels.ServerVersio" +
+ "n\022+\n\010initiate\030\004 \001(\0132\031.paymentchannels.In" +
+ "itiate\0226\n\016provide_refund\030\005 \001(\0132\036.payment" +
+ "channels.ProvideRefund\0224\n\rreturn_refund\030" +
+ "\006 \001(\0132\035.paymentchannels.ReturnRefund\022:\n\020",
+ "provide_contract\030\007 \001(\0132 .paymentchannels" +
+ ".ProvideContract\0226\n\016update_payment\030\010 \001(\013" +
+ "2\036.paymentchannels.UpdatePayment\0220\n\013paym" +
+ "ent_ack\030\013 \001(\0132\033.paymentchannels.PaymentA" +
+ "ck\022/\n\nsettlement\030\t \001(\0132\033.paymentchannels" +
+ ".Settlement\022%\n\005error\030\n \001(\0132\026.paymentchan" +
+ "nels.Error\"\315\001\n\013MessageType\022\022\n\016CLIENT_VER" +
+ "SION\020\001\022\022\n\016SERVER_VERSION\020\002\022\014\n\010INITIATE\020\003" +
+ "\022\022\n\016PROVIDE_REFUND\020\004\022\021\n\rRETURN_REFUND\020\005\022" +
+ "\024\n\020PROVIDE_CONTRACT\020\006\022\020\n\014CHANNEL_OPEN\020\007\022",
+ "\022\n\016UPDATE_PAYMENT\020\010\022\017\n\013PAYMENT_ACK\020\013\022\t\n\005" +
+ "CLOSE\020\t\022\t\n\005ERROR\020\n\"y\n\rClientVersion\022\r\n\005m" +
+ "ajor\030\001 \002(\005\022\020\n\005minor\030\002 \001(\005:\0010\022&\n\036previous" +
+ "_channel_contract_hash\030\003 \001(\014\022\037\n\020time_win" +
+ "dow_secs\030\004 \001(\004:\00586340\"0\n\rServerVersion\022\r" +
+ "\n\005major\030\001 \002(\005\022\020\n\005minor\030\002 \001(\005:\0010\"r\n\010Initi" +
+ "ate\022\024\n\014multisig_key\030\001 \002(\014\022!\n\031min_accepte" +
+ "d_channel_size\030\002 \002(\004\022\030\n\020expire_time_secs" +
+ "\030\003 \002(\004\022\023\n\013min_payment\030\004 \002(\004\"1\n\rProvideRe" +
+ "fund\022\024\n\014multisig_key\030\001 \002(\014\022\n\n\002tx\030\002 \002(\014\"!",
+ "\n\014ReturnRefund\022\021\n\tsignature\030\001 \002(\014\"j\n\017Pro" +
+ "videContract\022\n\n\002tx\030\001 \002(\014\0227\n\017initial_paym" +
+ "ent\030\002 \002(\0132\036.paymentchannels.UpdatePaymen" +
+ "t\022\022\n\nclient_key\030\003 \001(\014\"M\n\rUpdatePayment\022\033" +
+ "\n\023client_change_value\030\001 \002(\004\022\021\n\tsignature" +
+ "\030\002 \002(\014\022\014\n\004info\030\003 \001(\014\"\032\n\nPaymentAck\022\014\n\004in" +
+ "fo\030\001 \001(\014\"\030\n\nSettlement\022\n\n\002tx\030\003 \002(\014\"\251\002\n\005E" +
+ "rror\0225\n\004code\030\001 \001(\0162 .paymentchannels.Err" +
+ "or.ErrorCode:\005OTHER\022\023\n\013explanation\030\002 \001(\t" +
+ "\022\026\n\016expected_value\030\003 \001(\004\"\273\001\n\tErrorCode\022\013",
+ "\n\007TIMEOUT\020\001\022\020\n\014SYNTAX_ERROR\020\002\022\031\n\025NO_ACCE" +
+ "PTABLE_VERSION\020\003\022\023\n\017BAD_TRANSACTION\020\004\022\034\n" +
+ "\030TIME_WINDOW_UNACCEPTABLE\020\005\022\033\n\027CHANNEL_V" +
+ "ALUE_TOO_LARGE\020\006\022\031\n\025MIN_PAYMENT_TOO_LARG" +
+ "E\020\007\022\t\n\005OTHER\020\010B$\n\032org.bitcoin.paymentcha" +
+ "nnelB\006Protos"
+ };
+ com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
+ new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
+ public com.google.protobuf.ExtensionRegistry assignDescriptors(
+ com.google.protobuf.Descriptors.FileDescriptor root) {
+ descriptor = root;
+ return null;
+ }
+ };
+ com.google.protobuf.Descriptors.FileDescriptor
+ .internalBuildGeneratedFileFrom(descriptorData,
+ new com.google.protobuf.Descriptors.FileDescriptor[] {
+ }, assigner);
+ internal_static_paymentchannels_TwoWayChannelMessage_descriptor =
+ getDescriptor().getMessageTypes().get(0);
+ internal_static_paymentchannels_TwoWayChannelMessage_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_paymentchannels_TwoWayChannelMessage_descriptor,
+ new java.lang.String[] { "Type", "ClientVersion", "ServerVersion", "Initiate", "ProvideRefund", "ReturnRefund", "ProvideContract", "UpdatePayment", "PaymentAck", "Settlement", "Error", });
+ internal_static_paymentchannels_ClientVersion_descriptor =
+ getDescriptor().getMessageTypes().get(1);
+ internal_static_paymentchannels_ClientVersion_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_paymentchannels_ClientVersion_descriptor,
+ new java.lang.String[] { "Major", "Minor", "PreviousChannelContractHash", "TimeWindowSecs", });
+ internal_static_paymentchannels_ServerVersion_descriptor =
+ getDescriptor().getMessageTypes().get(2);
+ internal_static_paymentchannels_ServerVersion_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_paymentchannels_ServerVersion_descriptor,
+ new java.lang.String[] { "Major", "Minor", });
+ internal_static_paymentchannels_Initiate_descriptor =
+ getDescriptor().getMessageTypes().get(3);
+ internal_static_paymentchannels_Initiate_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_paymentchannels_Initiate_descriptor,
+ new java.lang.String[] { "MultisigKey", "MinAcceptedChannelSize", "ExpireTimeSecs", "MinPayment", });
+ internal_static_paymentchannels_ProvideRefund_descriptor =
+ getDescriptor().getMessageTypes().get(4);
+ internal_static_paymentchannels_ProvideRefund_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_paymentchannels_ProvideRefund_descriptor,
+ new java.lang.String[] { "MultisigKey", "Tx", });
+ internal_static_paymentchannels_ReturnRefund_descriptor =
+ getDescriptor().getMessageTypes().get(5);
+ internal_static_paymentchannels_ReturnRefund_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_paymentchannels_ReturnRefund_descriptor,
+ new java.lang.String[] { "Signature", });
+ internal_static_paymentchannels_ProvideContract_descriptor =
+ getDescriptor().getMessageTypes().get(6);
+ internal_static_paymentchannels_ProvideContract_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_paymentchannels_ProvideContract_descriptor,
+ new java.lang.String[] { "Tx", "InitialPayment", "ClientKey", });
+ internal_static_paymentchannels_UpdatePayment_descriptor =
+ getDescriptor().getMessageTypes().get(7);
+ internal_static_paymentchannels_UpdatePayment_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_paymentchannels_UpdatePayment_descriptor,
+ new java.lang.String[] { "ClientChangeValue", "Signature", "Info", });
+ internal_static_paymentchannels_PaymentAck_descriptor =
+ getDescriptor().getMessageTypes().get(8);
+ internal_static_paymentchannels_PaymentAck_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_paymentchannels_PaymentAck_descriptor,
+ new java.lang.String[] { "Info", });
+ internal_static_paymentchannels_Settlement_descriptor =
+ getDescriptor().getMessageTypes().get(9);
+ internal_static_paymentchannels_Settlement_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_paymentchannels_Settlement_descriptor,
+ new java.lang.String[] { "Tx", });
+ internal_static_paymentchannels_Error_descriptor =
+ getDescriptor().getMessageTypes().get(10);
+ internal_static_paymentchannels_Error_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_paymentchannels_Error_descriptor,
+ new java.lang.String[] { "Code", "Explanation", "ExpectedValue", });
+ }
+
+ // @@protoc_insertion_point(outer_class_scope)
+}
diff --git a/core/src/main/java/org/bitcoin/protocols/payments/Protos.java b/core/src/main/java/org/bitcoin/protocols/payments/Protos.java
new file mode 100644
index 00000000..7db4cb8c
--- /dev/null
+++ b/core/src/main/java/org/bitcoin/protocols/payments/Protos.java
@@ -0,0 +1,6547 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: paymentrequest.proto
+
+package org.bitcoin.protocols.payments;
+
+public final class Protos {
+ private Protos() {}
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistryLite registry) {
+ }
+
+ public static void registerAllExtensions(
+ com.google.protobuf.ExtensionRegistry registry) {
+ registerAllExtensions(
+ (com.google.protobuf.ExtensionRegistryLite) registry);
+ }
+ public interface OutputOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:payments.Output)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ * amount is integer-number-of-satoshis
+ *
+ *
+ * optional uint64 amount = 1 [default = 0];
+ */
+ boolean hasAmount();
+ /**
+ *
+ * amount is integer-number-of-satoshis
+ *
+ *
+ * optional uint64 amount = 1 [default = 0];
+ */
+ long getAmount();
+
+ /**
+ *
+ * usually one of the standard Script forms
+ *
+ *
+ * required bytes script = 2;
+ */
+ boolean hasScript();
+ /**
+ *
+ * usually one of the standard Script forms
+ *
+ *
+ * required bytes script = 2;
+ */
+ com.google.protobuf.ByteString getScript();
+ }
+ /**
+ *
+ * Generalized form of "send payment to this/these bitcoin addresses"
+ *
+ *
+ * Protobuf type {@code payments.Output}
+ */
+ public static final class Output extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:payments.Output)
+ OutputOrBuilder {
+ // Use Output.newBuilder() to construct.
+ private Output(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private Output() {
+ amount_ = 0L;
+ script_ = com.google.protobuf.ByteString.EMPTY;
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private Output(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ this();
+ int mutable_bitField0_ = 0;
+ com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+ com.google.protobuf.UnknownFieldSet.newBuilder();
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ default: {
+ if (!parseUnknownField(input, unknownFields,
+ extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ case 8: {
+ bitField0_ |= 0x00000001;
+ amount_ = input.readUInt64();
+ break;
+ }
+ case 18: {
+ bitField0_ |= 0x00000002;
+ script_ = input.readBytes();
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(
+ e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.bitcoin.protocols.payments.Protos.internal_static_payments_Output_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.bitcoin.protocols.payments.Protos.internal_static_payments_Output_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.bitcoin.protocols.payments.Protos.Output.class, org.bitcoin.protocols.payments.Protos.Output.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int AMOUNT_FIELD_NUMBER = 1;
+ private long amount_;
+ /**
+ *
+ * amount is integer-number-of-satoshis
+ *
+ *
+ * optional uint64 amount = 1 [default = 0];
+ */
+ public boolean hasAmount() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ *
+ * amount is integer-number-of-satoshis
+ *
+ *
+ * optional uint64 amount = 1 [default = 0];
+ */
+ public long getAmount() {
+ return amount_;
+ }
+
+ public static final int SCRIPT_FIELD_NUMBER = 2;
+ private com.google.protobuf.ByteString script_;
+ /**
+ *
+ * usually one of the standard Script forms
+ *
+ *
+ * required bytes script = 2;
+ */
+ public boolean hasScript() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ *
+ * usually one of the standard Script forms
+ *
+ *
+ * required bytes script = 2;
+ */
+ public com.google.protobuf.ByteString getScript() {
+ return script_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ if (!hasScript()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeUInt64(1, amount_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeBytes(2, script_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt64Size(1, amount_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(2, script_);
+ }
+ size += unknownFields.getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ private static final long serialVersionUID = 0L;
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof org.bitcoin.protocols.payments.Protos.Output)) {
+ return super.equals(obj);
+ }
+ org.bitcoin.protocols.payments.Protos.Output other = (org.bitcoin.protocols.payments.Protos.Output) obj;
+
+ boolean result = true;
+ result = result && (hasAmount() == other.hasAmount());
+ if (hasAmount()) {
+ result = result && (getAmount()
+ == other.getAmount());
+ }
+ result = result && (hasScript() == other.hasScript());
+ if (hasScript()) {
+ result = result && getScript()
+ .equals(other.getScript());
+ }
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptorForType().hashCode();
+ if (hasAmount()) {
+ hash = (37 * hash) + AMOUNT_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getAmount());
+ }
+ if (hasScript()) {
+ hash = (37 * hash) + SCRIPT_FIELD_NUMBER;
+ hash = (53 * hash) + getScript().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static org.bitcoin.protocols.payments.Protos.Output parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.bitcoin.protocols.payments.Protos.Output parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.bitcoin.protocols.payments.Protos.Output parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.bitcoin.protocols.payments.Protos.Output parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static org.bitcoin.protocols.payments.Protos.Output parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.protocols.payments.Protos.Output parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static org.bitcoin.protocols.payments.Protos.Output parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.protocols.payments.Protos.Output parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static org.bitcoin.protocols.payments.Protos.Output parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static org.bitcoin.protocols.payments.Protos.Output parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(org.bitcoin.protocols.payments.Protos.Output prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ *
+ * Generalized form of "send payment to this/these bitcoin addresses"
+ *
+ *
+ * Protobuf type {@code payments.Output}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:payments.Output)
+ org.bitcoin.protocols.payments.Protos.OutputOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.bitcoin.protocols.payments.Protos.internal_static_payments_Output_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.bitcoin.protocols.payments.Protos.internal_static_payments_Output_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.bitcoin.protocols.payments.Protos.Output.class, org.bitcoin.protocols.payments.Protos.Output.Builder.class);
+ }
+
+ // Construct using org.bitcoin.protocols.payments.Protos.Output.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessageV3
+ .alwaysUseFieldBuilders) {
+ }
+ }
+ public Builder clear() {
+ super.clear();
+ amount_ = 0L;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ script_ = com.google.protobuf.ByteString.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.bitcoin.protocols.payments.Protos.internal_static_payments_Output_descriptor;
+ }
+
+ public org.bitcoin.protocols.payments.Protos.Output getDefaultInstanceForType() {
+ return org.bitcoin.protocols.payments.Protos.Output.getDefaultInstance();
+ }
+
+ public org.bitcoin.protocols.payments.Protos.Output build() {
+ org.bitcoin.protocols.payments.Protos.Output result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.bitcoin.protocols.payments.Protos.Output buildPartial() {
+ org.bitcoin.protocols.payments.Protos.Output result = new org.bitcoin.protocols.payments.Protos.Output(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.amount_ = amount_;
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.script_ = script_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder clone() {
+ return (Builder) super.clone();
+ }
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ Object value) {
+ return (Builder) super.setField(field, value);
+ }
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return (Builder) super.clearField(field);
+ }
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return (Builder) super.clearOneof(oneof);
+ }
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, Object value) {
+ return (Builder) super.setRepeatedField(field, index, value);
+ }
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ Object value) {
+ return (Builder) super.addRepeatedField(field, value);
+ }
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.bitcoin.protocols.payments.Protos.Output) {
+ return mergeFrom((org.bitcoin.protocols.payments.Protos.Output)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.bitcoin.protocols.payments.Protos.Output other) {
+ if (other == org.bitcoin.protocols.payments.Protos.Output.getDefaultInstance()) return this;
+ if (other.hasAmount()) {
+ setAmount(other.getAmount());
+ }
+ if (other.hasScript()) {
+ setScript(other.getScript());
+ }
+ this.mergeUnknownFields(other.unknownFields);
+ onChanged();
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasScript()) {
+ return false;
+ }
+ return true;
+ }
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.bitcoin.protocols.payments.Protos.Output parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.bitcoin.protocols.payments.Protos.Output) e.getUnfinishedMessage();
+ throw e.unwrapIOException();
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ private long amount_ ;
+ /**
+ *
+ * amount is integer-number-of-satoshis
+ *
+ *
+ * optional uint64 amount = 1 [default = 0];
+ */
+ public boolean hasAmount() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ *
+ * amount is integer-number-of-satoshis
+ *
+ *
+ * optional uint64 amount = 1 [default = 0];
+ */
+ public long getAmount() {
+ return amount_;
+ }
+ /**
+ *
+ * amount is integer-number-of-satoshis
+ *
+ *
+ * optional uint64 amount = 1 [default = 0];
+ */
+ public Builder setAmount(long value) {
+ bitField0_ |= 0x00000001;
+ amount_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * amount is integer-number-of-satoshis
+ *
+ *
+ * optional uint64 amount = 1 [default = 0];
+ */
+ public Builder clearAmount() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ amount_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.ByteString script_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ *
+ * usually one of the standard Script forms
+ *
+ *
+ * required bytes script = 2;
+ */
+ public boolean hasScript() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ *
+ * usually one of the standard Script forms
+ *
+ *
+ * required bytes script = 2;
+ */
+ public com.google.protobuf.ByteString getScript() {
+ return script_;
+ }
+ /**
+ *
+ * usually one of the standard Script forms
+ *
+ *
+ * required bytes script = 2;
+ */
+ public Builder setScript(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ script_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * usually one of the standard Script forms
+ *
+ *
+ * required bytes script = 2;
+ */
+ public Builder clearScript() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ script_ = getDefaultInstance().getScript();
+ onChanged();
+ return this;
+ }
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:payments.Output)
+ }
+
+ // @@protoc_insertion_point(class_scope:payments.Output)
+ private static final org.bitcoin.protocols.payments.Protos.Output DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new org.bitcoin.protocols.payments.Protos.Output();
+ }
+
+ public static org.bitcoin.protocols.payments.Protos.Output getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ @java.lang.Deprecated public static final com.google.protobuf.Parser