From 049fa770025b097d262e9b0785e269bc892fd6f8 Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Sat, 8 Aug 2015 22:47:46 +0100 Subject: [PATCH] Add Dogecoin payment protocol support Add Dogecoin payment protocol support, and remove unused proto definition files. --- pom.xml | 62 +- .../dogecoin/protocols/payments/Protos.java | 6012 +++++++++++++++++ .../org/altcoinj/protocols/package-info.java | 5 - src/paymentchannel.proto | 259 - src/paymentrequest.proto | 39 +- src/peerseeds.proto | 26 - src/storedclientpaymentchannel.proto | 51 - src/storedserverpaymentchannel.proto | 44 - src/wallet.proto | 400 -- 9 files changed, 6081 insertions(+), 817 deletions(-) create mode 100644 src/main/java/com/dogecoin/protocols/payments/Protos.java delete mode 100644 src/main/java/org/altcoinj/protocols/package-info.java delete mode 100644 src/paymentchannel.proto delete mode 100644 src/peerseeds.proto delete mode 100644 src/storedclientpaymentchannel.proto delete mode 100644 src/storedserverpaymentchannel.proto delete mode 100644 src/wallet.proto diff --git a/pom.xml b/pom.xml index 7a3b9aab..5bd83508 100644 --- a/pom.xml +++ b/pom.xml @@ -2,9 +2,68 @@ 4.0.0 org.altcoinj - altcoinj + libdohj 0.14-SNAPSHOT jar + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + The bitcoinj and libdohj teams. + info@dogecoin.com + + + + + update-protobuf + + + updateProtobuf + true + + + + + + maven-antrun-plugin + + + compile-protoc + generate-sources + + + + + + + + + + + + + + + + + run + + + + + + + + + org.slf4j @@ -39,4 +98,5 @@ 1.6 1.6 + libdohj diff --git a/src/main/java/com/dogecoin/protocols/payments/Protos.java b/src/main/java/com/dogecoin/protocols/payments/Protos.java new file mode 100644 index 00000000..664f5fed --- /dev/null +++ b/src/main/java/com/dogecoin/protocols/payments/Protos.java @@ -0,0 +1,6012 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: src/paymentrequest.proto + +package com.dogecoin.protocols.payments; + +public final class Protos { + private Protos() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + } + public interface OutputOrBuilder extends + // @@protoc_insertion_point(interface_extends:payments.Output) + com.google.protobuf.MessageOrBuilder { + + /** + * optional uint64 amount = 1 [default = 0]; + * + *
+     * amount is integer-number-of-satoshis
+     * 
+ */ + boolean hasAmount(); + /** + * optional uint64 amount = 1 [default = 0]; + * + *
+     * amount is integer-number-of-satoshis
+     * 
+ */ + long getAmount(); + + /** + * required bytes script = 2; + * + *
+     * usually one of the standard Script forms
+     * 
+ */ + boolean hasScript(); + /** + * required bytes script = 2; + * + *
+     * usually one of the standard Script forms
+     * 
+ */ + com.google.protobuf.ByteString getScript(); + } + /** + * Protobuf type {@code payments.Output} + * + *
+   * Generalized form of "send payment to this/these dogecoin addresses"
+   * 
+ */ + public static final class Output extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:payments.Output) + OutputOrBuilder { + // Use Output.newBuilder() to construct. + private Output(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private Output(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final Output defaultInstance; + public static Output getDefaultInstance() { + return defaultInstance; + } + + public Output getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @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 { + initFields(); + 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.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_Output_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_Output_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.dogecoin.protocols.payments.Protos.Output.class, com.dogecoin.protocols.payments.Protos.Output.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Output parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Output(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int AMOUNT_FIELD_NUMBER = 1; + private long amount_; + /** + * optional uint64 amount = 1 [default = 0]; + * + *
+     * amount is integer-number-of-satoshis
+     * 
+ */ + public boolean hasAmount() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional uint64 amount = 1 [default = 0]; + * + *
+     * amount is integer-number-of-satoshis
+     * 
+ */ + public long getAmount() { + return amount_; + } + + public static final int SCRIPT_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString script_; + /** + * required bytes script = 2; + * + *
+     * usually one of the standard Script forms
+     * 
+ */ + public boolean hasScript() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required bytes script = 2; + * + *
+     * usually one of the standard Script forms
+     * 
+ */ + public com.google.protobuf.ByteString getScript() { + return script_; + } + + private void initFields() { + amount_ = 0L; + script_ = com.google.protobuf.ByteString.EMPTY; + } + 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 { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeUInt64(1, amount_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, script_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + 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 += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.dogecoin.protocols.payments.Protos.Output parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.dogecoin.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 com.dogecoin.protocols.payments.Protos.Output parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.dogecoin.protocols.payments.Protos.Output parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.Output parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.dogecoin.protocols.payments.Protos.Output parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.Output parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.dogecoin.protocols.payments.Protos.Output parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.Output parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.dogecoin.protocols.payments.Protos.Output parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(com.dogecoin.protocols.payments.Protos.Output prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code payments.Output} + * + *
+     * Generalized form of "send payment to this/these dogecoin addresses"
+     * 
+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:payments.Output) + com.dogecoin.protocols.payments.Protos.OutputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_Output_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_Output_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.dogecoin.protocols.payments.Protos.Output.class, com.dogecoin.protocols.payments.Protos.Output.Builder.class); + } + + // Construct using com.dogecoin.protocols.payments.Protos.Output.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + amount_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + script_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_Output_descriptor; + } + + public com.dogecoin.protocols.payments.Protos.Output getDefaultInstanceForType() { + return com.dogecoin.protocols.payments.Protos.Output.getDefaultInstance(); + } + + public com.dogecoin.protocols.payments.Protos.Output build() { + com.dogecoin.protocols.payments.Protos.Output result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.dogecoin.protocols.payments.Protos.Output buildPartial() { + com.dogecoin.protocols.payments.Protos.Output result = new com.dogecoin.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 mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.dogecoin.protocols.payments.Protos.Output) { + return mergeFrom((com.dogecoin.protocols.payments.Protos.Output)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.dogecoin.protocols.payments.Protos.Output other) { + if (other == com.dogecoin.protocols.payments.Protos.Output.getDefaultInstance()) return this; + if (other.hasAmount()) { + setAmount(other.getAmount()); + } + if (other.hasScript()) { + setScript(other.getScript()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + com.dogecoin.protocols.payments.Protos.Output parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.dogecoin.protocols.payments.Protos.Output) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private long amount_ ; + /** + * optional uint64 amount = 1 [default = 0]; + * + *
+       * amount is integer-number-of-satoshis
+       * 
+ */ + public boolean hasAmount() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional uint64 amount = 1 [default = 0]; + * + *
+       * amount is integer-number-of-satoshis
+       * 
+ */ + public long getAmount() { + return amount_; + } + /** + * optional uint64 amount = 1 [default = 0]; + * + *
+       * amount is integer-number-of-satoshis
+       * 
+ */ + public Builder setAmount(long value) { + bitField0_ |= 0x00000001; + amount_ = value; + onChanged(); + return this; + } + /** + * optional uint64 amount = 1 [default = 0]; + * + *
+       * amount is integer-number-of-satoshis
+       * 
+ */ + public Builder clearAmount() { + bitField0_ = (bitField0_ & ~0x00000001); + amount_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString script_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes script = 2; + * + *
+       * usually one of the standard Script forms
+       * 
+ */ + public boolean hasScript() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required bytes script = 2; + * + *
+       * usually one of the standard Script forms
+       * 
+ */ + public com.google.protobuf.ByteString getScript() { + return script_; + } + /** + * required bytes script = 2; + * + *
+       * usually one of the standard Script forms
+       * 
+ */ + public Builder setScript(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + script_ = value; + onChanged(); + return this; + } + /** + * required bytes script = 2; + * + *
+       * usually one of the standard Script forms
+       * 
+ */ + public Builder clearScript() { + bitField0_ = (bitField0_ & ~0x00000002); + script_ = getDefaultInstance().getScript(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:payments.Output) + } + + static { + defaultInstance = new Output(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:payments.Output) + } + + public interface PaymentDetailsOrBuilder extends + // @@protoc_insertion_point(interface_extends:payments.PaymentDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string genesis = 1 [default = "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"]; + * + *
+     * Hash of the network genesis block
+     * 
+ */ + boolean hasGenesis(); + /** + * optional string genesis = 1 [default = "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"]; + * + *
+     * Hash of the network genesis block
+     * 
+ */ + java.lang.String getGenesis(); + /** + * optional string genesis = 1 [default = "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"]; + * + *
+     * Hash of the network genesis block
+     * 
+ */ + com.google.protobuf.ByteString + getGenesisBytes(); + + /** + * repeated .payments.Output outputs = 2; + * + *
+     * Where payment should be sent
+     * 
+ */ + java.util.List + getOutputsList(); + /** + * repeated .payments.Output outputs = 2; + * + *
+     * Where payment should be sent
+     * 
+ */ + com.dogecoin.protocols.payments.Protos.Output getOutputs(int index); + /** + * repeated .payments.Output outputs = 2; + * + *
+     * Where payment should be sent
+     * 
+ */ + int getOutputsCount(); + /** + * repeated .payments.Output outputs = 2; + * + *
+     * Where payment should be sent
+     * 
+ */ + java.util.List + getOutputsOrBuilderList(); + /** + * repeated .payments.Output outputs = 2; + * + *
+     * Where payment should be sent
+     * 
+ */ + com.dogecoin.protocols.payments.Protos.OutputOrBuilder getOutputsOrBuilder( + int index); + + /** + * required uint64 time = 3; + * + *
+     * Timestamp; when payment request created
+     * 
+ */ + boolean hasTime(); + /** + * required uint64 time = 3; + * + *
+     * Timestamp; when payment request created
+     * 
+ */ + long getTime(); + + /** + * optional uint64 expires = 4; + * + *
+     * Timestamp; when this request should be considered invalid
+     * 
+ */ + boolean hasExpires(); + /** + * optional uint64 expires = 4; + * + *
+     * Timestamp; when this request should be considered invalid
+     * 
+ */ + long getExpires(); + + /** + * optional string memo = 5; + * + *
+     * Human-readable description of request for the customer
+     * 
+ */ + boolean hasMemo(); + /** + * optional string memo = 5; + * + *
+     * Human-readable description of request for the customer
+     * 
+ */ + java.lang.String getMemo(); + /** + * optional string memo = 5; + * + *
+     * Human-readable description of request for the customer
+     * 
+ */ + com.google.protobuf.ByteString + getMemoBytes(); + + /** + * optional string payment_url = 6; + * + *
+     * URL to send Payment and get PaymentACK
+     * 
+ */ + boolean hasPaymentUrl(); + /** + * optional string payment_url = 6; + * + *
+     * URL to send Payment and get PaymentACK
+     * 
+ */ + java.lang.String getPaymentUrl(); + /** + * optional string payment_url = 6; + * + *
+     * URL to send Payment and get PaymentACK
+     * 
+ */ + com.google.protobuf.ByteString + getPaymentUrlBytes(); + + /** + * optional bytes merchant_data = 7; + * + *
+     * Arbitrary data to include in the Payment message
+     * 
+ */ + boolean hasMerchantData(); + /** + * optional bytes merchant_data = 7; + * + *
+     * Arbitrary data to include in the Payment message
+     * 
+ */ + com.google.protobuf.ByteString getMerchantData(); + } + /** + * Protobuf type {@code payments.PaymentDetails} + */ + public static final class PaymentDetails extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:payments.PaymentDetails) + PaymentDetailsOrBuilder { + // Use PaymentDetails.newBuilder() to construct. + private PaymentDetails(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private PaymentDetails(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final PaymentDetails defaultInstance; + public static PaymentDetails getDefaultInstance() { + return defaultInstance; + } + + public PaymentDetails getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PaymentDetails( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + 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: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + genesis_ = bs; + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + outputs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + outputs_.add(input.readMessage(com.dogecoin.protocols.payments.Protos.Output.PARSER, extensionRegistry)); + break; + } + case 24: { + bitField0_ |= 0x00000002; + time_ = input.readUInt64(); + break; + } + case 32: { + bitField0_ |= 0x00000004; + expires_ = input.readUInt64(); + break; + } + case 42: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000008; + memo_ = bs; + break; + } + case 50: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000010; + paymentUrl_ = bs; + break; + } + case 58: { + bitField0_ |= 0x00000020; + merchantData_ = 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.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + outputs_ = java.util.Collections.unmodifiableList(outputs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_PaymentDetails_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_PaymentDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.dogecoin.protocols.payments.Protos.PaymentDetails.class, com.dogecoin.protocols.payments.Protos.PaymentDetails.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public PaymentDetails parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PaymentDetails(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int GENESIS_FIELD_NUMBER = 1; + private java.lang.Object genesis_; + /** + * optional string genesis = 1 [default = "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"]; + * + *
+     * Hash of the network genesis block
+     * 
+ */ + public boolean hasGenesis() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string genesis = 1 [default = "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"]; + * + *
+     * Hash of the network genesis block
+     * 
+ */ + public java.lang.String getGenesis() { + java.lang.Object ref = genesis_; + 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()) { + genesis_ = s; + } + return s; + } + } + /** + * optional string genesis = 1 [default = "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"]; + * + *
+     * Hash of the network genesis block
+     * 
+ */ + public com.google.protobuf.ByteString + getGenesisBytes() { + java.lang.Object ref = genesis_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + genesis_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OUTPUTS_FIELD_NUMBER = 2; + private java.util.List outputs_; + /** + * repeated .payments.Output outputs = 2; + * + *
+     * Where payment should be sent
+     * 
+ */ + public java.util.List getOutputsList() { + return outputs_; + } + /** + * repeated .payments.Output outputs = 2; + * + *
+     * Where payment should be sent
+     * 
+ */ + public java.util.List + getOutputsOrBuilderList() { + return outputs_; + } + /** + * repeated .payments.Output outputs = 2; + * + *
+     * Where payment should be sent
+     * 
+ */ + public int getOutputsCount() { + return outputs_.size(); + } + /** + * repeated .payments.Output outputs = 2; + * + *
+     * Where payment should be sent
+     * 
+ */ + public com.dogecoin.protocols.payments.Protos.Output getOutputs(int index) { + return outputs_.get(index); + } + /** + * repeated .payments.Output outputs = 2; + * + *
+     * Where payment should be sent
+     * 
+ */ + public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getOutputsOrBuilder( + int index) { + return outputs_.get(index); + } + + public static final int TIME_FIELD_NUMBER = 3; + private long time_; + /** + * required uint64 time = 3; + * + *
+     * Timestamp; when payment request created
+     * 
+ */ + public boolean hasTime() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required uint64 time = 3; + * + *
+     * Timestamp; when payment request created
+     * 
+ */ + public long getTime() { + return time_; + } + + public static final int EXPIRES_FIELD_NUMBER = 4; + private long expires_; + /** + * optional uint64 expires = 4; + * + *
+     * Timestamp; when this request should be considered invalid
+     * 
+ */ + public boolean hasExpires() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional uint64 expires = 4; + * + *
+     * Timestamp; when this request should be considered invalid
+     * 
+ */ + public long getExpires() { + return expires_; + } + + public static final int MEMO_FIELD_NUMBER = 5; + private java.lang.Object memo_; + /** + * optional string memo = 5; + * + *
+     * Human-readable description of request for the customer
+     * 
+ */ + public boolean hasMemo() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional string memo = 5; + * + *
+     * Human-readable description of request for the customer
+     * 
+ */ + public java.lang.String getMemo() { + java.lang.Object ref = memo_; + 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()) { + memo_ = s; + } + return s; + } + } + /** + * optional string memo = 5; + * + *
+     * Human-readable description of request for the customer
+     * 
+ */ + public com.google.protobuf.ByteString + getMemoBytes() { + java.lang.Object ref = memo_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + memo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAYMENT_URL_FIELD_NUMBER = 6; + private java.lang.Object paymentUrl_; + /** + * optional string payment_url = 6; + * + *
+     * URL to send Payment and get PaymentACK
+     * 
+ */ + public boolean hasPaymentUrl() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional string payment_url = 6; + * + *
+     * URL to send Payment and get PaymentACK
+     * 
+ */ + public java.lang.String getPaymentUrl() { + java.lang.Object ref = paymentUrl_; + 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()) { + paymentUrl_ = s; + } + return s; + } + } + /** + * optional string payment_url = 6; + * + *
+     * URL to send Payment and get PaymentACK
+     * 
+ */ + public com.google.protobuf.ByteString + getPaymentUrlBytes() { + java.lang.Object ref = paymentUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + paymentUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MERCHANT_DATA_FIELD_NUMBER = 7; + private com.google.protobuf.ByteString merchantData_; + /** + * optional bytes merchant_data = 7; + * + *
+     * Arbitrary data to include in the Payment message
+     * 
+ */ + public boolean hasMerchantData() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional bytes merchant_data = 7; + * + *
+     * Arbitrary data to include in the Payment message
+     * 
+ */ + public com.google.protobuf.ByteString getMerchantData() { + return merchantData_; + } + + private void initFields() { + genesis_ = "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"; + outputs_ = java.util.Collections.emptyList(); + time_ = 0L; + expires_ = 0L; + memo_ = ""; + paymentUrl_ = ""; + merchantData_ = com.google.protobuf.ByteString.EMPTY; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasTime()) { + memoizedIsInitialized = 0; + return false; + } + for (int i = 0; i < getOutputsCount(); i++) { + if (!getOutputs(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getGenesisBytes()); + } + for (int i = 0; i < outputs_.size(); i++) { + output.writeMessage(2, outputs_.get(i)); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeUInt64(3, time_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeUInt64(4, expires_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBytes(5, getMemoBytes()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBytes(6, getPaymentUrlBytes()); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeBytes(7, merchantData_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, getGenesisBytes()); + } + for (int i = 0; i < outputs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, outputs_.get(i)); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, time_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(4, expires_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(5, getMemoBytes()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(6, getPaymentUrlBytes()); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(7, merchantData_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.dogecoin.protocols.payments.Protos.PaymentDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.dogecoin.protocols.payments.Protos.PaymentDetails parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.PaymentDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.dogecoin.protocols.payments.Protos.PaymentDetails parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.PaymentDetails parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.dogecoin.protocols.payments.Protos.PaymentDetails parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.PaymentDetails parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.dogecoin.protocols.payments.Protos.PaymentDetails parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.PaymentDetails parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.dogecoin.protocols.payments.Protos.PaymentDetails parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(com.dogecoin.protocols.payments.Protos.PaymentDetails prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code payments.PaymentDetails} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:payments.PaymentDetails) + com.dogecoin.protocols.payments.Protos.PaymentDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_PaymentDetails_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_PaymentDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.dogecoin.protocols.payments.Protos.PaymentDetails.class, com.dogecoin.protocols.payments.Protos.PaymentDetails.Builder.class); + } + + // Construct using com.dogecoin.protocols.payments.Protos.PaymentDetails.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getOutputsFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + genesis_ = "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"; + bitField0_ = (bitField0_ & ~0x00000001); + if (outputsBuilder_ == null) { + outputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + outputsBuilder_.clear(); + } + time_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + expires_ = 0L; + bitField0_ = (bitField0_ & ~0x00000008); + memo_ = ""; + bitField0_ = (bitField0_ & ~0x00000010); + paymentUrl_ = ""; + bitField0_ = (bitField0_ & ~0x00000020); + merchantData_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_PaymentDetails_descriptor; + } + + public com.dogecoin.protocols.payments.Protos.PaymentDetails getDefaultInstanceForType() { + return com.dogecoin.protocols.payments.Protos.PaymentDetails.getDefaultInstance(); + } + + public com.dogecoin.protocols.payments.Protos.PaymentDetails build() { + com.dogecoin.protocols.payments.Protos.PaymentDetails result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.dogecoin.protocols.payments.Protos.PaymentDetails buildPartial() { + com.dogecoin.protocols.payments.Protos.PaymentDetails result = new com.dogecoin.protocols.payments.Protos.PaymentDetails(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.genesis_ = genesis_; + if (outputsBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + outputs_ = java.util.Collections.unmodifiableList(outputs_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.outputs_ = outputs_; + } else { + result.outputs_ = outputsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000002; + } + result.time_ = time_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000004; + } + result.expires_ = expires_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000008; + } + result.memo_ = memo_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000010; + } + result.paymentUrl_ = paymentUrl_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000020; + } + result.merchantData_ = merchantData_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.dogecoin.protocols.payments.Protos.PaymentDetails) { + return mergeFrom((com.dogecoin.protocols.payments.Protos.PaymentDetails)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.dogecoin.protocols.payments.Protos.PaymentDetails other) { + if (other == com.dogecoin.protocols.payments.Protos.PaymentDetails.getDefaultInstance()) return this; + if (other.hasGenesis()) { + bitField0_ |= 0x00000001; + genesis_ = other.genesis_; + onChanged(); + } + if (outputsBuilder_ == null) { + if (!other.outputs_.isEmpty()) { + if (outputs_.isEmpty()) { + outputs_ = other.outputs_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureOutputsIsMutable(); + outputs_.addAll(other.outputs_); + } + onChanged(); + } + } else { + if (!other.outputs_.isEmpty()) { + if (outputsBuilder_.isEmpty()) { + outputsBuilder_.dispose(); + outputsBuilder_ = null; + outputs_ = other.outputs_; + bitField0_ = (bitField0_ & ~0x00000002); + outputsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getOutputsFieldBuilder() : null; + } else { + outputsBuilder_.addAllMessages(other.outputs_); + } + } + } + if (other.hasTime()) { + setTime(other.getTime()); + } + if (other.hasExpires()) { + setExpires(other.getExpires()); + } + if (other.hasMemo()) { + bitField0_ |= 0x00000010; + memo_ = other.memo_; + onChanged(); + } + if (other.hasPaymentUrl()) { + bitField0_ |= 0x00000020; + paymentUrl_ = other.paymentUrl_; + onChanged(); + } + if (other.hasMerchantData()) { + setMerchantData(other.getMerchantData()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasTime()) { + + return false; + } + for (int i = 0; i < getOutputsCount(); i++) { + if (!getOutputs(i).isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.dogecoin.protocols.payments.Protos.PaymentDetails parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.dogecoin.protocols.payments.Protos.PaymentDetails) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object genesis_ = "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"; + /** + * optional string genesis = 1 [default = "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"]; + * + *
+       * Hash of the network genesis block
+       * 
+ */ + public boolean hasGenesis() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string genesis = 1 [default = "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"]; + * + *
+       * Hash of the network genesis block
+       * 
+ */ + public java.lang.String getGenesis() { + java.lang.Object ref = genesis_; + 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()) { + genesis_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string genesis = 1 [default = "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"]; + * + *
+       * Hash of the network genesis block
+       * 
+ */ + public com.google.protobuf.ByteString + getGenesisBytes() { + java.lang.Object ref = genesis_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + genesis_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string genesis = 1 [default = "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"]; + * + *
+       * Hash of the network genesis block
+       * 
+ */ + public Builder setGenesis( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + genesis_ = value; + onChanged(); + return this; + } + /** + * optional string genesis = 1 [default = "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"]; + * + *
+       * Hash of the network genesis block
+       * 
+ */ + public Builder clearGenesis() { + bitField0_ = (bitField0_ & ~0x00000001); + genesis_ = getDefaultInstance().getGenesis(); + onChanged(); + return this; + } + /** + * optional string genesis = 1 [default = "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"]; + * + *
+       * Hash of the network genesis block
+       * 
+ */ + public Builder setGenesisBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + genesis_ = value; + onChanged(); + return this; + } + + private java.util.List outputs_ = + java.util.Collections.emptyList(); + private void ensureOutputsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + outputs_ = new java.util.ArrayList(outputs_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.dogecoin.protocols.payments.Protos.Output, com.dogecoin.protocols.payments.Protos.Output.Builder, com.dogecoin.protocols.payments.Protos.OutputOrBuilder> outputsBuilder_; + + /** + * repeated .payments.Output outputs = 2; + * + *
+       * Where payment should be sent
+       * 
+ */ + public java.util.List getOutputsList() { + if (outputsBuilder_ == null) { + return java.util.Collections.unmodifiableList(outputs_); + } else { + return outputsBuilder_.getMessageList(); + } + } + /** + * repeated .payments.Output outputs = 2; + * + *
+       * Where payment should be sent
+       * 
+ */ + public int getOutputsCount() { + if (outputsBuilder_ == null) { + return outputs_.size(); + } else { + return outputsBuilder_.getCount(); + } + } + /** + * repeated .payments.Output outputs = 2; + * + *
+       * Where payment should be sent
+       * 
+ */ + public com.dogecoin.protocols.payments.Protos.Output getOutputs(int index) { + if (outputsBuilder_ == null) { + return outputs_.get(index); + } else { + return outputsBuilder_.getMessage(index); + } + } + /** + * repeated .payments.Output outputs = 2; + * + *
+       * Where payment should be sent
+       * 
+ */ + public Builder setOutputs( + int index, com.dogecoin.protocols.payments.Protos.Output value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.set(index, value); + onChanged(); + } else { + outputsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .payments.Output outputs = 2; + * + *
+       * Where payment should be sent
+       * 
+ */ + public Builder setOutputs( + int index, com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.set(index, builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .payments.Output outputs = 2; + * + *
+       * Where payment should be sent
+       * 
+ */ + public Builder addOutputs(com.dogecoin.protocols.payments.Protos.Output value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.add(value); + onChanged(); + } else { + outputsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .payments.Output outputs = 2; + * + *
+       * Where payment should be sent
+       * 
+ */ + public Builder addOutputs( + int index, com.dogecoin.protocols.payments.Protos.Output value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.add(index, value); + onChanged(); + } else { + outputsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .payments.Output outputs = 2; + * + *
+       * Where payment should be sent
+       * 
+ */ + public Builder addOutputs( + com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.add(builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .payments.Output outputs = 2; + * + *
+       * Where payment should be sent
+       * 
+ */ + public Builder addOutputs( + int index, com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.add(index, builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .payments.Output outputs = 2; + * + *
+       * Where payment should be sent
+       * 
+ */ + public Builder addAllOutputs( + java.lang.Iterable values) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, outputs_); + onChanged(); + } else { + outputsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .payments.Output outputs = 2; + * + *
+       * Where payment should be sent
+       * 
+ */ + public Builder clearOutputs() { + if (outputsBuilder_ == null) { + outputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + outputsBuilder_.clear(); + } + return this; + } + /** + * repeated .payments.Output outputs = 2; + * + *
+       * Where payment should be sent
+       * 
+ */ + public Builder removeOutputs(int index) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.remove(index); + onChanged(); + } else { + outputsBuilder_.remove(index); + } + return this; + } + /** + * repeated .payments.Output outputs = 2; + * + *
+       * Where payment should be sent
+       * 
+ */ + public com.dogecoin.protocols.payments.Protos.Output.Builder getOutputsBuilder( + int index) { + return getOutputsFieldBuilder().getBuilder(index); + } + /** + * repeated .payments.Output outputs = 2; + * + *
+       * Where payment should be sent
+       * 
+ */ + public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getOutputsOrBuilder( + int index) { + if (outputsBuilder_ == null) { + return outputs_.get(index); } else { + return outputsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .payments.Output outputs = 2; + * + *
+       * Where payment should be sent
+       * 
+ */ + public java.util.List + getOutputsOrBuilderList() { + if (outputsBuilder_ != null) { + return outputsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(outputs_); + } + } + /** + * repeated .payments.Output outputs = 2; + * + *
+       * Where payment should be sent
+       * 
+ */ + public com.dogecoin.protocols.payments.Protos.Output.Builder addOutputsBuilder() { + return getOutputsFieldBuilder().addBuilder( + com.dogecoin.protocols.payments.Protos.Output.getDefaultInstance()); + } + /** + * repeated .payments.Output outputs = 2; + * + *
+       * Where payment should be sent
+       * 
+ */ + public com.dogecoin.protocols.payments.Protos.Output.Builder addOutputsBuilder( + int index) { + return getOutputsFieldBuilder().addBuilder( + index, com.dogecoin.protocols.payments.Protos.Output.getDefaultInstance()); + } + /** + * repeated .payments.Output outputs = 2; + * + *
+       * Where payment should be sent
+       * 
+ */ + public java.util.List + getOutputsBuilderList() { + return getOutputsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.dogecoin.protocols.payments.Protos.Output, com.dogecoin.protocols.payments.Protos.Output.Builder, com.dogecoin.protocols.payments.Protos.OutputOrBuilder> + getOutputsFieldBuilder() { + if (outputsBuilder_ == null) { + outputsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.dogecoin.protocols.payments.Protos.Output, com.dogecoin.protocols.payments.Protos.Output.Builder, com.dogecoin.protocols.payments.Protos.OutputOrBuilder>( + outputs_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + outputs_ = null; + } + return outputsBuilder_; + } + + private long time_ ; + /** + * required uint64 time = 3; + * + *
+       * Timestamp; when payment request created
+       * 
+ */ + public boolean hasTime() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required uint64 time = 3; + * + *
+       * Timestamp; when payment request created
+       * 
+ */ + public long getTime() { + return time_; + } + /** + * required uint64 time = 3; + * + *
+       * Timestamp; when payment request created
+       * 
+ */ + public Builder setTime(long value) { + bitField0_ |= 0x00000004; + time_ = value; + onChanged(); + return this; + } + /** + * required uint64 time = 3; + * + *
+       * Timestamp; when payment request created
+       * 
+ */ + public Builder clearTime() { + bitField0_ = (bitField0_ & ~0x00000004); + time_ = 0L; + onChanged(); + return this; + } + + private long expires_ ; + /** + * optional uint64 expires = 4; + * + *
+       * Timestamp; when this request should be considered invalid
+       * 
+ */ + public boolean hasExpires() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional uint64 expires = 4; + * + *
+       * Timestamp; when this request should be considered invalid
+       * 
+ */ + public long getExpires() { + return expires_; + } + /** + * optional uint64 expires = 4; + * + *
+       * Timestamp; when this request should be considered invalid
+       * 
+ */ + public Builder setExpires(long value) { + bitField0_ |= 0x00000008; + expires_ = value; + onChanged(); + return this; + } + /** + * optional uint64 expires = 4; + * + *
+       * Timestamp; when this request should be considered invalid
+       * 
+ */ + public Builder clearExpires() { + bitField0_ = (bitField0_ & ~0x00000008); + expires_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object memo_ = ""; + /** + * optional string memo = 5; + * + *
+       * Human-readable description of request for the customer
+       * 
+ */ + public boolean hasMemo() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional string memo = 5; + * + *
+       * Human-readable description of request for the customer
+       * 
+ */ + public java.lang.String getMemo() { + java.lang.Object ref = memo_; + 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()) { + memo_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string memo = 5; + * + *
+       * Human-readable description of request for the customer
+       * 
+ */ + public com.google.protobuf.ByteString + getMemoBytes() { + java.lang.Object ref = memo_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + memo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string memo = 5; + * + *
+       * Human-readable description of request for the customer
+       * 
+ */ + public Builder setMemo( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + memo_ = value; + onChanged(); + return this; + } + /** + * optional string memo = 5; + * + *
+       * Human-readable description of request for the customer
+       * 
+ */ + public Builder clearMemo() { + bitField0_ = (bitField0_ & ~0x00000010); + memo_ = getDefaultInstance().getMemo(); + onChanged(); + return this; + } + /** + * optional string memo = 5; + * + *
+       * Human-readable description of request for the customer
+       * 
+ */ + public Builder setMemoBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + memo_ = value; + onChanged(); + return this; + } + + private java.lang.Object paymentUrl_ = ""; + /** + * optional string payment_url = 6; + * + *
+       * URL to send Payment and get PaymentACK
+       * 
+ */ + public boolean hasPaymentUrl() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional string payment_url = 6; + * + *
+       * URL to send Payment and get PaymentACK
+       * 
+ */ + public java.lang.String getPaymentUrl() { + java.lang.Object ref = paymentUrl_; + 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()) { + paymentUrl_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string payment_url = 6; + * + *
+       * URL to send Payment and get PaymentACK
+       * 
+ */ + public com.google.protobuf.ByteString + getPaymentUrlBytes() { + java.lang.Object ref = paymentUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + paymentUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string payment_url = 6; + * + *
+       * URL to send Payment and get PaymentACK
+       * 
+ */ + public Builder setPaymentUrl( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + paymentUrl_ = value; + onChanged(); + return this; + } + /** + * optional string payment_url = 6; + * + *
+       * URL to send Payment and get PaymentACK
+       * 
+ */ + public Builder clearPaymentUrl() { + bitField0_ = (bitField0_ & ~0x00000020); + paymentUrl_ = getDefaultInstance().getPaymentUrl(); + onChanged(); + return this; + } + /** + * optional string payment_url = 6; + * + *
+       * URL to send Payment and get PaymentACK
+       * 
+ */ + public Builder setPaymentUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + paymentUrl_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString merchantData_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes merchant_data = 7; + * + *
+       * Arbitrary data to include in the Payment message
+       * 
+ */ + public boolean hasMerchantData() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional bytes merchant_data = 7; + * + *
+       * Arbitrary data to include in the Payment message
+       * 
+ */ + public com.google.protobuf.ByteString getMerchantData() { + return merchantData_; + } + /** + * optional bytes merchant_data = 7; + * + *
+       * Arbitrary data to include in the Payment message
+       * 
+ */ + public Builder setMerchantData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + merchantData_ = value; + onChanged(); + return this; + } + /** + * optional bytes merchant_data = 7; + * + *
+       * Arbitrary data to include in the Payment message
+       * 
+ */ + public Builder clearMerchantData() { + bitField0_ = (bitField0_ & ~0x00000040); + merchantData_ = getDefaultInstance().getMerchantData(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:payments.PaymentDetails) + } + + static { + defaultInstance = new PaymentDetails(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:payments.PaymentDetails) + } + + public interface PaymentRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:payments.PaymentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * optional uint32 payment_details_version = 1 [default = 1]; + */ + boolean hasPaymentDetailsVersion(); + /** + * optional uint32 payment_details_version = 1 [default = 1]; + */ + int getPaymentDetailsVersion(); + + /** + * optional string pki_type = 2 [default = "none"]; + * + *
+     * none / x509+sha256 / x509+sha1
+     * 
+ */ + boolean hasPkiType(); + /** + * optional string pki_type = 2 [default = "none"]; + * + *
+     * none / x509+sha256 / x509+sha1
+     * 
+ */ + java.lang.String getPkiType(); + /** + * optional string pki_type = 2 [default = "none"]; + * + *
+     * none / x509+sha256 / x509+sha1
+     * 
+ */ + com.google.protobuf.ByteString + getPkiTypeBytes(); + + /** + * optional bytes pki_data = 3; + * + *
+     * depends on pki_type
+     * 
+ */ + boolean hasPkiData(); + /** + * optional bytes pki_data = 3; + * + *
+     * depends on pki_type
+     * 
+ */ + com.google.protobuf.ByteString getPkiData(); + + /** + * required bytes serialized_payment_details = 4; + * + *
+     * PaymentDetails
+     * 
+ */ + boolean hasSerializedPaymentDetails(); + /** + * required bytes serialized_payment_details = 4; + * + *
+     * PaymentDetails
+     * 
+ */ + com.google.protobuf.ByteString getSerializedPaymentDetails(); + + /** + * optional bytes signature = 5; + * + *
+     * pki-dependent signature
+     * 
+ */ + boolean hasSignature(); + /** + * optional bytes signature = 5; + * + *
+     * pki-dependent signature
+     * 
+ */ + com.google.protobuf.ByteString getSignature(); + } + /** + * Protobuf type {@code payments.PaymentRequest} + */ + public static final class PaymentRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:payments.PaymentRequest) + PaymentRequestOrBuilder { + // Use PaymentRequest.newBuilder() to construct. + private PaymentRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private PaymentRequest(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final PaymentRequest defaultInstance; + public static PaymentRequest getDefaultInstance() { + return defaultInstance; + } + + public PaymentRequest getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PaymentRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + 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; + paymentDetailsVersion_ = input.readUInt32(); + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + pkiType_ = bs; + break; + } + case 26: { + bitField0_ |= 0x00000004; + pkiData_ = input.readBytes(); + break; + } + case 34: { + bitField0_ |= 0x00000008; + serializedPaymentDetails_ = input.readBytes(); + break; + } + case 42: { + bitField0_ |= 0x00000010; + 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.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_PaymentRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_PaymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.dogecoin.protocols.payments.Protos.PaymentRequest.class, com.dogecoin.protocols.payments.Protos.PaymentRequest.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public PaymentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PaymentRequest(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int PAYMENT_DETAILS_VERSION_FIELD_NUMBER = 1; + private int paymentDetailsVersion_; + /** + * optional uint32 payment_details_version = 1 [default = 1]; + */ + public boolean hasPaymentDetailsVersion() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional uint32 payment_details_version = 1 [default = 1]; + */ + public int getPaymentDetailsVersion() { + return paymentDetailsVersion_; + } + + public static final int PKI_TYPE_FIELD_NUMBER = 2; + private java.lang.Object pkiType_; + /** + * optional string pki_type = 2 [default = "none"]; + * + *
+     * none / x509+sha256 / x509+sha1
+     * 
+ */ + public boolean hasPkiType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string pki_type = 2 [default = "none"]; + * + *
+     * none / x509+sha256 / x509+sha1
+     * 
+ */ + public java.lang.String getPkiType() { + java.lang.Object ref = pkiType_; + 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()) { + pkiType_ = s; + } + return s; + } + } + /** + * optional string pki_type = 2 [default = "none"]; + * + *
+     * none / x509+sha256 / x509+sha1
+     * 
+ */ + public com.google.protobuf.ByteString + getPkiTypeBytes() { + java.lang.Object ref = pkiType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pkiType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PKI_DATA_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString pkiData_; + /** + * optional bytes pki_data = 3; + * + *
+     * depends on pki_type
+     * 
+ */ + public boolean hasPkiData() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional bytes pki_data = 3; + * + *
+     * depends on pki_type
+     * 
+ */ + public com.google.protobuf.ByteString getPkiData() { + return pkiData_; + } + + public static final int SERIALIZED_PAYMENT_DETAILS_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString serializedPaymentDetails_; + /** + * required bytes serialized_payment_details = 4; + * + *
+     * PaymentDetails
+     * 
+ */ + public boolean hasSerializedPaymentDetails() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * required bytes serialized_payment_details = 4; + * + *
+     * PaymentDetails
+     * 
+ */ + public com.google.protobuf.ByteString getSerializedPaymentDetails() { + return serializedPaymentDetails_; + } + + public static final int SIGNATURE_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString signature_; + /** + * optional bytes signature = 5; + * + *
+     * pki-dependent signature
+     * 
+ */ + public boolean hasSignature() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional bytes signature = 5; + * + *
+     * pki-dependent signature
+     * 
+ */ + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + + private void initFields() { + paymentDetailsVersion_ = 1; + pkiType_ = "none"; + pkiData_ = com.google.protobuf.ByteString.EMPTY; + serializedPaymentDetails_ = com.google.protobuf.ByteString.EMPTY; + signature_ = com.google.protobuf.ByteString.EMPTY; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasSerializedPaymentDetails()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeUInt32(1, paymentDetailsVersion_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getPkiTypeBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, pkiData_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBytes(4, serializedPaymentDetails_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBytes(5, signature_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, paymentDetailsVersion_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getPkiTypeBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, pkiData_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, serializedPaymentDetails_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(5, signature_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.dogecoin.protocols.payments.Protos.PaymentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.dogecoin.protocols.payments.Protos.PaymentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.PaymentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.dogecoin.protocols.payments.Protos.PaymentRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.PaymentRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.dogecoin.protocols.payments.Protos.PaymentRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.PaymentRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.dogecoin.protocols.payments.Protos.PaymentRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.PaymentRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.dogecoin.protocols.payments.Protos.PaymentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(com.dogecoin.protocols.payments.Protos.PaymentRequest prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code payments.PaymentRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:payments.PaymentRequest) + com.dogecoin.protocols.payments.Protos.PaymentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_PaymentRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_PaymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.dogecoin.protocols.payments.Protos.PaymentRequest.class, com.dogecoin.protocols.payments.Protos.PaymentRequest.Builder.class); + } + + // Construct using com.dogecoin.protocols.payments.Protos.PaymentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + paymentDetailsVersion_ = 1; + bitField0_ = (bitField0_ & ~0x00000001); + pkiType_ = "none"; + bitField0_ = (bitField0_ & ~0x00000002); + pkiData_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + serializedPaymentDetails_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + signature_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_PaymentRequest_descriptor; + } + + public com.dogecoin.protocols.payments.Protos.PaymentRequest getDefaultInstanceForType() { + return com.dogecoin.protocols.payments.Protos.PaymentRequest.getDefaultInstance(); + } + + public com.dogecoin.protocols.payments.Protos.PaymentRequest build() { + com.dogecoin.protocols.payments.Protos.PaymentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.dogecoin.protocols.payments.Protos.PaymentRequest buildPartial() { + com.dogecoin.protocols.payments.Protos.PaymentRequest result = new com.dogecoin.protocols.payments.Protos.PaymentRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.paymentDetailsVersion_ = paymentDetailsVersion_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.pkiType_ = pkiType_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.pkiData_ = pkiData_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.serializedPaymentDetails_ = serializedPaymentDetails_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.signature_ = signature_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.dogecoin.protocols.payments.Protos.PaymentRequest) { + return mergeFrom((com.dogecoin.protocols.payments.Protos.PaymentRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.dogecoin.protocols.payments.Protos.PaymentRequest other) { + if (other == com.dogecoin.protocols.payments.Protos.PaymentRequest.getDefaultInstance()) return this; + if (other.hasPaymentDetailsVersion()) { + setPaymentDetailsVersion(other.getPaymentDetailsVersion()); + } + if (other.hasPkiType()) { + bitField0_ |= 0x00000002; + pkiType_ = other.pkiType_; + onChanged(); + } + if (other.hasPkiData()) { + setPkiData(other.getPkiData()); + } + if (other.hasSerializedPaymentDetails()) { + setSerializedPaymentDetails(other.getSerializedPaymentDetails()); + } + if (other.hasSignature()) { + setSignature(other.getSignature()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasSerializedPaymentDetails()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.dogecoin.protocols.payments.Protos.PaymentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.dogecoin.protocols.payments.Protos.PaymentRequest) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int paymentDetailsVersion_ = 1; + /** + * optional uint32 payment_details_version = 1 [default = 1]; + */ + public boolean hasPaymentDetailsVersion() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional uint32 payment_details_version = 1 [default = 1]; + */ + public int getPaymentDetailsVersion() { + return paymentDetailsVersion_; + } + /** + * optional uint32 payment_details_version = 1 [default = 1]; + */ + public Builder setPaymentDetailsVersion(int value) { + bitField0_ |= 0x00000001; + paymentDetailsVersion_ = value; + onChanged(); + return this; + } + /** + * optional uint32 payment_details_version = 1 [default = 1]; + */ + public Builder clearPaymentDetailsVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + paymentDetailsVersion_ = 1; + onChanged(); + return this; + } + + private java.lang.Object pkiType_ = "none"; + /** + * optional string pki_type = 2 [default = "none"]; + * + *
+       * none / x509+sha256 / x509+sha1
+       * 
+ */ + public boolean hasPkiType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string pki_type = 2 [default = "none"]; + * + *
+       * none / x509+sha256 / x509+sha1
+       * 
+ */ + public java.lang.String getPkiType() { + java.lang.Object ref = pkiType_; + 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()) { + pkiType_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string pki_type = 2 [default = "none"]; + * + *
+       * none / x509+sha256 / x509+sha1
+       * 
+ */ + public com.google.protobuf.ByteString + getPkiTypeBytes() { + java.lang.Object ref = pkiType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pkiType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string pki_type = 2 [default = "none"]; + * + *
+       * none / x509+sha256 / x509+sha1
+       * 
+ */ + public Builder setPkiType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + pkiType_ = value; + onChanged(); + return this; + } + /** + * optional string pki_type = 2 [default = "none"]; + * + *
+       * none / x509+sha256 / x509+sha1
+       * 
+ */ + public Builder clearPkiType() { + bitField0_ = (bitField0_ & ~0x00000002); + pkiType_ = getDefaultInstance().getPkiType(); + onChanged(); + return this; + } + /** + * optional string pki_type = 2 [default = "none"]; + * + *
+       * none / x509+sha256 / x509+sha1
+       * 
+ */ + public Builder setPkiTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + pkiType_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString pkiData_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes pki_data = 3; + * + *
+       * depends on pki_type
+       * 
+ */ + public boolean hasPkiData() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional bytes pki_data = 3; + * + *
+       * depends on pki_type
+       * 
+ */ + public com.google.protobuf.ByteString getPkiData() { + return pkiData_; + } + /** + * optional bytes pki_data = 3; + * + *
+       * depends on pki_type
+       * 
+ */ + public Builder setPkiData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + pkiData_ = value; + onChanged(); + return this; + } + /** + * optional bytes pki_data = 3; + * + *
+       * depends on pki_type
+       * 
+ */ + public Builder clearPkiData() { + bitField0_ = (bitField0_ & ~0x00000004); + pkiData_ = getDefaultInstance().getPkiData(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString serializedPaymentDetails_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes serialized_payment_details = 4; + * + *
+       * PaymentDetails
+       * 
+ */ + public boolean hasSerializedPaymentDetails() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * required bytes serialized_payment_details = 4; + * + *
+       * PaymentDetails
+       * 
+ */ + public com.google.protobuf.ByteString getSerializedPaymentDetails() { + return serializedPaymentDetails_; + } + /** + * required bytes serialized_payment_details = 4; + * + *
+       * PaymentDetails
+       * 
+ */ + public Builder setSerializedPaymentDetails(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + serializedPaymentDetails_ = value; + onChanged(); + return this; + } + /** + * required bytes serialized_payment_details = 4; + * + *
+       * PaymentDetails
+       * 
+ */ + public Builder clearSerializedPaymentDetails() { + bitField0_ = (bitField0_ & ~0x00000008); + serializedPaymentDetails_ = getDefaultInstance().getSerializedPaymentDetails(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString signature_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes signature = 5; + * + *
+       * pki-dependent signature
+       * 
+ */ + public boolean hasSignature() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional bytes signature = 5; + * + *
+       * pki-dependent signature
+       * 
+ */ + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + /** + * optional bytes signature = 5; + * + *
+       * pki-dependent signature
+       * 
+ */ + public Builder setSignature(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + signature_ = value; + onChanged(); + return this; + } + /** + * optional bytes signature = 5; + * + *
+       * pki-dependent signature
+       * 
+ */ + public Builder clearSignature() { + bitField0_ = (bitField0_ & ~0x00000010); + signature_ = getDefaultInstance().getSignature(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:payments.PaymentRequest) + } + + static { + defaultInstance = new PaymentRequest(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:payments.PaymentRequest) + } + + public interface X509CertificatesOrBuilder extends + // @@protoc_insertion_point(interface_extends:payments.X509Certificates) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated bytes certificate = 1; + * + *
+     * DER-encoded X.509 certificate chain
+     * 
+ */ + java.util.List getCertificateList(); + /** + * repeated bytes certificate = 1; + * + *
+     * DER-encoded X.509 certificate chain
+     * 
+ */ + int getCertificateCount(); + /** + * repeated bytes certificate = 1; + * + *
+     * DER-encoded X.509 certificate chain
+     * 
+ */ + com.google.protobuf.ByteString getCertificate(int index); + } + /** + * Protobuf type {@code payments.X509Certificates} + */ + public static final class X509Certificates extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:payments.X509Certificates) + X509CertificatesOrBuilder { + // Use X509Certificates.newBuilder() to construct. + private X509Certificates(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private X509Certificates(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final X509Certificates defaultInstance; + public static X509Certificates getDefaultInstance() { + return defaultInstance; + } + + public X509Certificates getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private X509Certificates( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + 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: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + certificate_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + certificate_.add(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.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + certificate_ = java.util.Collections.unmodifiableList(certificate_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_X509Certificates_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_X509Certificates_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.dogecoin.protocols.payments.Protos.X509Certificates.class, com.dogecoin.protocols.payments.Protos.X509Certificates.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public X509Certificates parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new X509Certificates(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public static final int CERTIFICATE_FIELD_NUMBER = 1; + private java.util.List certificate_; + /** + * repeated bytes certificate = 1; + * + *
+     * DER-encoded X.509 certificate chain
+     * 
+ */ + public java.util.List + getCertificateList() { + return certificate_; + } + /** + * repeated bytes certificate = 1; + * + *
+     * DER-encoded X.509 certificate chain
+     * 
+ */ + public int getCertificateCount() { + return certificate_.size(); + } + /** + * repeated bytes certificate = 1; + * + *
+     * DER-encoded X.509 certificate chain
+     * 
+ */ + public com.google.protobuf.ByteString getCertificate(int index) { + return certificate_.get(index); + } + + private void initFields() { + certificate_ = java.util.Collections.emptyList(); + } + 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 { + getSerializedSize(); + for (int i = 0; i < certificate_.size(); i++) { + output.writeBytes(1, certificate_.get(i)); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < certificate_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(certificate_.get(i)); + } + size += dataSize; + size += 1 * getCertificateList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.dogecoin.protocols.payments.Protos.X509Certificates parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.dogecoin.protocols.payments.Protos.X509Certificates parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.X509Certificates parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.dogecoin.protocols.payments.Protos.X509Certificates parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.X509Certificates parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.dogecoin.protocols.payments.Protos.X509Certificates parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.X509Certificates parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.dogecoin.protocols.payments.Protos.X509Certificates parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.X509Certificates parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.dogecoin.protocols.payments.Protos.X509Certificates parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(com.dogecoin.protocols.payments.Protos.X509Certificates prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code payments.X509Certificates} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:payments.X509Certificates) + com.dogecoin.protocols.payments.Protos.X509CertificatesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_X509Certificates_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_X509Certificates_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.dogecoin.protocols.payments.Protos.X509Certificates.class, com.dogecoin.protocols.payments.Protos.X509Certificates.Builder.class); + } + + // Construct using com.dogecoin.protocols.payments.Protos.X509Certificates.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + certificate_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_X509Certificates_descriptor; + } + + public com.dogecoin.protocols.payments.Protos.X509Certificates getDefaultInstanceForType() { + return com.dogecoin.protocols.payments.Protos.X509Certificates.getDefaultInstance(); + } + + public com.dogecoin.protocols.payments.Protos.X509Certificates build() { + com.dogecoin.protocols.payments.Protos.X509Certificates result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.dogecoin.protocols.payments.Protos.X509Certificates buildPartial() { + com.dogecoin.protocols.payments.Protos.X509Certificates result = new com.dogecoin.protocols.payments.Protos.X509Certificates(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + certificate_ = java.util.Collections.unmodifiableList(certificate_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.certificate_ = certificate_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.dogecoin.protocols.payments.Protos.X509Certificates) { + return mergeFrom((com.dogecoin.protocols.payments.Protos.X509Certificates)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.dogecoin.protocols.payments.Protos.X509Certificates other) { + if (other == com.dogecoin.protocols.payments.Protos.X509Certificates.getDefaultInstance()) return this; + if (!other.certificate_.isEmpty()) { + if (certificate_.isEmpty()) { + certificate_ = other.certificate_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCertificateIsMutable(); + certificate_.addAll(other.certificate_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + com.dogecoin.protocols.payments.Protos.X509Certificates parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.dogecoin.protocols.payments.Protos.X509Certificates) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List certificate_ = java.util.Collections.emptyList(); + private void ensureCertificateIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + certificate_ = new java.util.ArrayList(certificate_); + bitField0_ |= 0x00000001; + } + } + /** + * repeated bytes certificate = 1; + * + *
+       * DER-encoded X.509 certificate chain
+       * 
+ */ + public java.util.List + getCertificateList() { + return java.util.Collections.unmodifiableList(certificate_); + } + /** + * repeated bytes certificate = 1; + * + *
+       * DER-encoded X.509 certificate chain
+       * 
+ */ + public int getCertificateCount() { + return certificate_.size(); + } + /** + * repeated bytes certificate = 1; + * + *
+       * DER-encoded X.509 certificate chain
+       * 
+ */ + public com.google.protobuf.ByteString getCertificate(int index) { + return certificate_.get(index); + } + /** + * repeated bytes certificate = 1; + * + *
+       * DER-encoded X.509 certificate chain
+       * 
+ */ + public Builder setCertificate( + int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertificateIsMutable(); + certificate_.set(index, value); + onChanged(); + return this; + } + /** + * repeated bytes certificate = 1; + * + *
+       * DER-encoded X.509 certificate chain
+       * 
+ */ + public Builder addCertificate(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertificateIsMutable(); + certificate_.add(value); + onChanged(); + return this; + } + /** + * repeated bytes certificate = 1; + * + *
+       * DER-encoded X.509 certificate chain
+       * 
+ */ + public Builder addAllCertificate( + java.lang.Iterable values) { + ensureCertificateIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, certificate_); + onChanged(); + return this; + } + /** + * repeated bytes certificate = 1; + * + *
+       * DER-encoded X.509 certificate chain
+       * 
+ */ + public Builder clearCertificate() { + certificate_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:payments.X509Certificates) + } + + static { + defaultInstance = new X509Certificates(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:payments.X509Certificates) + } + + public interface PaymentOrBuilder extends + // @@protoc_insertion_point(interface_extends:payments.Payment) + com.google.protobuf.MessageOrBuilder { + + /** + * optional bytes merchant_data = 1; + * + *
+     * From PaymentDetails.merchant_data
+     * 
+ */ + boolean hasMerchantData(); + /** + * optional bytes merchant_data = 1; + * + *
+     * From PaymentDetails.merchant_data
+     * 
+ */ + com.google.protobuf.ByteString getMerchantData(); + + /** + * repeated bytes transactions = 2; + * + *
+     * Signed transactions that satisfy PaymentDetails.outputs
+     * 
+ */ + java.util.List getTransactionsList(); + /** + * repeated bytes transactions = 2; + * + *
+     * Signed transactions that satisfy PaymentDetails.outputs
+     * 
+ */ + int getTransactionsCount(); + /** + * repeated bytes transactions = 2; + * + *
+     * Signed transactions that satisfy PaymentDetails.outputs
+     * 
+ */ + com.google.protobuf.ByteString getTransactions(int index); + + /** + * repeated .payments.Output refund_to = 3; + * + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ */ + java.util.List + getRefundToList(); + /** + * repeated .payments.Output refund_to = 3; + * + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ */ + com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index); + /** + * repeated .payments.Output refund_to = 3; + * + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ */ + int getRefundToCount(); + /** + * repeated .payments.Output refund_to = 3; + * + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ */ + java.util.List + getRefundToOrBuilderList(); + /** + * repeated .payments.Output refund_to = 3; + * + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ */ + com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder( + int index); + + /** + * optional string memo = 4; + * + *
+     * Human-readable message for the merchant
+     * 
+ */ + boolean hasMemo(); + /** + * optional string memo = 4; + * + *
+     * Human-readable message for the merchant
+     * 
+ */ + java.lang.String getMemo(); + /** + * optional string memo = 4; + * + *
+     * Human-readable message for the merchant
+     * 
+ */ + com.google.protobuf.ByteString + getMemoBytes(); + } + /** + * Protobuf type {@code payments.Payment} + */ + public static final class Payment extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:payments.Payment) + PaymentOrBuilder { + // Use Payment.newBuilder() to construct. + private Payment(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private Payment(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final Payment defaultInstance; + public static Payment getDefaultInstance() { + return defaultInstance; + } + + public Payment getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Payment( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + 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; + merchantData_ = input.readBytes(); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + transactions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + transactions_.add(input.readBytes()); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + refundTo_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + refundTo_.add(input.readMessage(com.dogecoin.protocols.payments.Protos.Output.PARSER, extensionRegistry)); + break; + } + case 34: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + memo_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + transactions_ = java.util.Collections.unmodifiableList(transactions_); + } + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + refundTo_ = java.util.Collections.unmodifiableList(refundTo_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_Payment_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_Payment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.dogecoin.protocols.payments.Protos.Payment.class, com.dogecoin.protocols.payments.Protos.Payment.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Payment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Payment(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int MERCHANT_DATA_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString merchantData_; + /** + * optional bytes merchant_data = 1; + * + *
+     * From PaymentDetails.merchant_data
+     * 
+ */ + public boolean hasMerchantData() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional bytes merchant_data = 1; + * + *
+     * From PaymentDetails.merchant_data
+     * 
+ */ + public com.google.protobuf.ByteString getMerchantData() { + return merchantData_; + } + + public static final int TRANSACTIONS_FIELD_NUMBER = 2; + private java.util.List transactions_; + /** + * repeated bytes transactions = 2; + * + *
+     * Signed transactions that satisfy PaymentDetails.outputs
+     * 
+ */ + public java.util.List + getTransactionsList() { + return transactions_; + } + /** + * repeated bytes transactions = 2; + * + *
+     * Signed transactions that satisfy PaymentDetails.outputs
+     * 
+ */ + public int getTransactionsCount() { + return transactions_.size(); + } + /** + * repeated bytes transactions = 2; + * + *
+     * Signed transactions that satisfy PaymentDetails.outputs
+     * 
+ */ + public com.google.protobuf.ByteString getTransactions(int index) { + return transactions_.get(index); + } + + public static final int REFUND_TO_FIELD_NUMBER = 3; + private java.util.List refundTo_; + /** + * repeated .payments.Output refund_to = 3; + * + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ */ + public java.util.List getRefundToList() { + return refundTo_; + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ */ + public java.util.List + getRefundToOrBuilderList() { + return refundTo_; + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ */ + public int getRefundToCount() { + return refundTo_.size(); + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ */ + public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) { + return refundTo_.get(index); + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+     * Where to send refunds, if a refund is necessary
+     * 
+ */ + public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder( + int index) { + return refundTo_.get(index); + } + + public static final int MEMO_FIELD_NUMBER = 4; + private java.lang.Object memo_; + /** + * optional string memo = 4; + * + *
+     * Human-readable message for the merchant
+     * 
+ */ + public boolean hasMemo() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string memo = 4; + * + *
+     * Human-readable message for the merchant
+     * 
+ */ + public java.lang.String getMemo() { + java.lang.Object ref = memo_; + 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()) { + memo_ = s; + } + return s; + } + } + /** + * optional string memo = 4; + * + *
+     * Human-readable message for the merchant
+     * 
+ */ + public com.google.protobuf.ByteString + getMemoBytes() { + java.lang.Object ref = memo_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + memo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private void initFields() { + merchantData_ = com.google.protobuf.ByteString.EMPTY; + transactions_ = java.util.Collections.emptyList(); + refundTo_ = java.util.Collections.emptyList(); + memo_ = ""; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + for (int i = 0; i < getRefundToCount(); i++) { + if (!getRefundTo(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, merchantData_); + } + for (int i = 0; i < transactions_.size(); i++) { + output.writeBytes(2, transactions_.get(i)); + } + for (int i = 0; i < refundTo_.size(); i++) { + output.writeMessage(3, refundTo_.get(i)); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(4, getMemoBytes()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, merchantData_); + } + { + int dataSize = 0; + for (int i = 0; i < transactions_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(transactions_.get(i)); + } + size += dataSize; + size += 1 * getTransactionsList().size(); + } + for (int i = 0; i < refundTo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, refundTo_.get(i)); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, getMemoBytes()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.dogecoin.protocols.payments.Protos.Payment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.dogecoin.protocols.payments.Protos.Payment parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.Payment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.dogecoin.protocols.payments.Protos.Payment parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.Payment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.dogecoin.protocols.payments.Protos.Payment parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.Payment parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.dogecoin.protocols.payments.Protos.Payment parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.Payment parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.dogecoin.protocols.payments.Protos.Payment parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(com.dogecoin.protocols.payments.Protos.Payment prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code payments.Payment} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:payments.Payment) + com.dogecoin.protocols.payments.Protos.PaymentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_Payment_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_Payment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.dogecoin.protocols.payments.Protos.Payment.class, com.dogecoin.protocols.payments.Protos.Payment.Builder.class); + } + + // Construct using com.dogecoin.protocols.payments.Protos.Payment.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getRefundToFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + merchantData_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + transactions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + if (refundToBuilder_ == null) { + refundTo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + refundToBuilder_.clear(); + } + memo_ = ""; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_Payment_descriptor; + } + + public com.dogecoin.protocols.payments.Protos.Payment getDefaultInstanceForType() { + return com.dogecoin.protocols.payments.Protos.Payment.getDefaultInstance(); + } + + public com.dogecoin.protocols.payments.Protos.Payment build() { + com.dogecoin.protocols.payments.Protos.Payment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.dogecoin.protocols.payments.Protos.Payment buildPartial() { + com.dogecoin.protocols.payments.Protos.Payment result = new com.dogecoin.protocols.payments.Protos.Payment(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.merchantData_ = merchantData_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + transactions_ = java.util.Collections.unmodifiableList(transactions_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.transactions_ = transactions_; + if (refundToBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + refundTo_ = java.util.Collections.unmodifiableList(refundTo_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.refundTo_ = refundTo_; + } else { + result.refundTo_ = refundToBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000002; + } + result.memo_ = memo_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.dogecoin.protocols.payments.Protos.Payment) { + return mergeFrom((com.dogecoin.protocols.payments.Protos.Payment)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.dogecoin.protocols.payments.Protos.Payment other) { + if (other == com.dogecoin.protocols.payments.Protos.Payment.getDefaultInstance()) return this; + if (other.hasMerchantData()) { + setMerchantData(other.getMerchantData()); + } + if (!other.transactions_.isEmpty()) { + if (transactions_.isEmpty()) { + transactions_ = other.transactions_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureTransactionsIsMutable(); + transactions_.addAll(other.transactions_); + } + onChanged(); + } + if (refundToBuilder_ == null) { + if (!other.refundTo_.isEmpty()) { + if (refundTo_.isEmpty()) { + refundTo_ = other.refundTo_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureRefundToIsMutable(); + refundTo_.addAll(other.refundTo_); + } + onChanged(); + } + } else { + if (!other.refundTo_.isEmpty()) { + if (refundToBuilder_.isEmpty()) { + refundToBuilder_.dispose(); + refundToBuilder_ = null; + refundTo_ = other.refundTo_; + bitField0_ = (bitField0_ & ~0x00000004); + refundToBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getRefundToFieldBuilder() : null; + } else { + refundToBuilder_.addAllMessages(other.refundTo_); + } + } + } + if (other.hasMemo()) { + bitField0_ |= 0x00000008; + memo_ = other.memo_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + for (int i = 0; i < getRefundToCount(); i++) { + if (!getRefundTo(i).isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.dogecoin.protocols.payments.Protos.Payment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.dogecoin.protocols.payments.Protos.Payment) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString merchantData_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes merchant_data = 1; + * + *
+       * From PaymentDetails.merchant_data
+       * 
+ */ + public boolean hasMerchantData() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional bytes merchant_data = 1; + * + *
+       * From PaymentDetails.merchant_data
+       * 
+ */ + public com.google.protobuf.ByteString getMerchantData() { + return merchantData_; + } + /** + * optional bytes merchant_data = 1; + * + *
+       * From PaymentDetails.merchant_data
+       * 
+ */ + public Builder setMerchantData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + merchantData_ = value; + onChanged(); + return this; + } + /** + * optional bytes merchant_data = 1; + * + *
+       * From PaymentDetails.merchant_data
+       * 
+ */ + public Builder clearMerchantData() { + bitField0_ = (bitField0_ & ~0x00000001); + merchantData_ = getDefaultInstance().getMerchantData(); + onChanged(); + return this; + } + + private java.util.List transactions_ = java.util.Collections.emptyList(); + private void ensureTransactionsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + transactions_ = new java.util.ArrayList(transactions_); + bitField0_ |= 0x00000002; + } + } + /** + * repeated bytes transactions = 2; + * + *
+       * Signed transactions that satisfy PaymentDetails.outputs
+       * 
+ */ + public java.util.List + getTransactionsList() { + return java.util.Collections.unmodifiableList(transactions_); + } + /** + * repeated bytes transactions = 2; + * + *
+       * Signed transactions that satisfy PaymentDetails.outputs
+       * 
+ */ + public int getTransactionsCount() { + return transactions_.size(); + } + /** + * repeated bytes transactions = 2; + * + *
+       * Signed transactions that satisfy PaymentDetails.outputs
+       * 
+ */ + public com.google.protobuf.ByteString getTransactions(int index) { + return transactions_.get(index); + } + /** + * repeated bytes transactions = 2; + * + *
+       * Signed transactions that satisfy PaymentDetails.outputs
+       * 
+ */ + public Builder setTransactions( + int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionsIsMutable(); + transactions_.set(index, value); + onChanged(); + return this; + } + /** + * repeated bytes transactions = 2; + * + *
+       * Signed transactions that satisfy PaymentDetails.outputs
+       * 
+ */ + public Builder addTransactions(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTransactionsIsMutable(); + transactions_.add(value); + onChanged(); + return this; + } + /** + * repeated bytes transactions = 2; + * + *
+       * Signed transactions that satisfy PaymentDetails.outputs
+       * 
+ */ + public Builder addAllTransactions( + java.lang.Iterable values) { + ensureTransactionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, transactions_); + onChanged(); + return this; + } + /** + * repeated bytes transactions = 2; + * + *
+       * Signed transactions that satisfy PaymentDetails.outputs
+       * 
+ */ + public Builder clearTransactions() { + transactions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + private java.util.List refundTo_ = + java.util.Collections.emptyList(); + private void ensureRefundToIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + refundTo_ = new java.util.ArrayList(refundTo_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.dogecoin.protocols.payments.Protos.Output, com.dogecoin.protocols.payments.Protos.Output.Builder, com.dogecoin.protocols.payments.Protos.OutputOrBuilder> refundToBuilder_; + + /** + * repeated .payments.Output refund_to = 3; + * + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ */ + public java.util.List getRefundToList() { + if (refundToBuilder_ == null) { + return java.util.Collections.unmodifiableList(refundTo_); + } else { + return refundToBuilder_.getMessageList(); + } + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ */ + public int getRefundToCount() { + if (refundToBuilder_ == null) { + return refundTo_.size(); + } else { + return refundToBuilder_.getCount(); + } + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ */ + public com.dogecoin.protocols.payments.Protos.Output getRefundTo(int index) { + if (refundToBuilder_ == null) { + return refundTo_.get(index); + } else { + return refundToBuilder_.getMessage(index); + } + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ */ + public Builder setRefundTo( + int index, com.dogecoin.protocols.payments.Protos.Output value) { + if (refundToBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRefundToIsMutable(); + refundTo_.set(index, value); + onChanged(); + } else { + refundToBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ */ + public Builder setRefundTo( + int index, com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) { + if (refundToBuilder_ == null) { + ensureRefundToIsMutable(); + refundTo_.set(index, builderForValue.build()); + onChanged(); + } else { + refundToBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ */ + public Builder addRefundTo(com.dogecoin.protocols.payments.Protos.Output value) { + if (refundToBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRefundToIsMutable(); + refundTo_.add(value); + onChanged(); + } else { + refundToBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ */ + public Builder addRefundTo( + int index, com.dogecoin.protocols.payments.Protos.Output value) { + if (refundToBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRefundToIsMutable(); + refundTo_.add(index, value); + onChanged(); + } else { + refundToBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ */ + public Builder addRefundTo( + com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) { + if (refundToBuilder_ == null) { + ensureRefundToIsMutable(); + refundTo_.add(builderForValue.build()); + onChanged(); + } else { + refundToBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ */ + public Builder addRefundTo( + int index, com.dogecoin.protocols.payments.Protos.Output.Builder builderForValue) { + if (refundToBuilder_ == null) { + ensureRefundToIsMutable(); + refundTo_.add(index, builderForValue.build()); + onChanged(); + } else { + refundToBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ */ + public Builder addAllRefundTo( + java.lang.Iterable values) { + if (refundToBuilder_ == null) { + ensureRefundToIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, refundTo_); + onChanged(); + } else { + refundToBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ */ + public Builder clearRefundTo() { + if (refundToBuilder_ == null) { + refundTo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + refundToBuilder_.clear(); + } + return this; + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ */ + public Builder removeRefundTo(int index) { + if (refundToBuilder_ == null) { + ensureRefundToIsMutable(); + refundTo_.remove(index); + onChanged(); + } else { + refundToBuilder_.remove(index); + } + return this; + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ */ + public com.dogecoin.protocols.payments.Protos.Output.Builder getRefundToBuilder( + int index) { + return getRefundToFieldBuilder().getBuilder(index); + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ */ + public com.dogecoin.protocols.payments.Protos.OutputOrBuilder getRefundToOrBuilder( + int index) { + if (refundToBuilder_ == null) { + return refundTo_.get(index); } else { + return refundToBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ */ + public java.util.List + getRefundToOrBuilderList() { + if (refundToBuilder_ != null) { + return refundToBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(refundTo_); + } + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ */ + public com.dogecoin.protocols.payments.Protos.Output.Builder addRefundToBuilder() { + return getRefundToFieldBuilder().addBuilder( + com.dogecoin.protocols.payments.Protos.Output.getDefaultInstance()); + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ */ + public com.dogecoin.protocols.payments.Protos.Output.Builder addRefundToBuilder( + int index) { + return getRefundToFieldBuilder().addBuilder( + index, com.dogecoin.protocols.payments.Protos.Output.getDefaultInstance()); + } + /** + * repeated .payments.Output refund_to = 3; + * + *
+       * Where to send refunds, if a refund is necessary
+       * 
+ */ + public java.util.List + getRefundToBuilderList() { + return getRefundToFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.dogecoin.protocols.payments.Protos.Output, com.dogecoin.protocols.payments.Protos.Output.Builder, com.dogecoin.protocols.payments.Protos.OutputOrBuilder> + getRefundToFieldBuilder() { + if (refundToBuilder_ == null) { + refundToBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.dogecoin.protocols.payments.Protos.Output, com.dogecoin.protocols.payments.Protos.Output.Builder, com.dogecoin.protocols.payments.Protos.OutputOrBuilder>( + refundTo_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + refundTo_ = null; + } + return refundToBuilder_; + } + + private java.lang.Object memo_ = ""; + /** + * optional string memo = 4; + * + *
+       * Human-readable message for the merchant
+       * 
+ */ + public boolean hasMemo() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional string memo = 4; + * + *
+       * Human-readable message for the merchant
+       * 
+ */ + public java.lang.String getMemo() { + java.lang.Object ref = memo_; + 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()) { + memo_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string memo = 4; + * + *
+       * Human-readable message for the merchant
+       * 
+ */ + public com.google.protobuf.ByteString + getMemoBytes() { + java.lang.Object ref = memo_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + memo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string memo = 4; + * + *
+       * Human-readable message for the merchant
+       * 
+ */ + public Builder setMemo( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + memo_ = value; + onChanged(); + return this; + } + /** + * optional string memo = 4; + * + *
+       * Human-readable message for the merchant
+       * 
+ */ + public Builder clearMemo() { + bitField0_ = (bitField0_ & ~0x00000008); + memo_ = getDefaultInstance().getMemo(); + onChanged(); + return this; + } + /** + * optional string memo = 4; + * + *
+       * Human-readable message for the merchant
+       * 
+ */ + public Builder setMemoBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + memo_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:payments.Payment) + } + + static { + defaultInstance = new Payment(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:payments.Payment) + } + + public interface PaymentACKOrBuilder extends + // @@protoc_insertion_point(interface_extends:payments.PaymentACK) + com.google.protobuf.MessageOrBuilder { + + /** + * required .payments.Payment payment = 1; + * + *
+     * Payment message that triggered this ACK
+     * 
+ */ + boolean hasPayment(); + /** + * required .payments.Payment payment = 1; + * + *
+     * Payment message that triggered this ACK
+     * 
+ */ + com.dogecoin.protocols.payments.Protos.Payment getPayment(); + /** + * required .payments.Payment payment = 1; + * + *
+     * Payment message that triggered this ACK
+     * 
+ */ + com.dogecoin.protocols.payments.Protos.PaymentOrBuilder getPaymentOrBuilder(); + + /** + * optional string memo = 2; + * + *
+     * human-readable message for customer
+     * 
+ */ + boolean hasMemo(); + /** + * optional string memo = 2; + * + *
+     * human-readable message for customer
+     * 
+ */ + java.lang.String getMemo(); + /** + * optional string memo = 2; + * + *
+     * human-readable message for customer
+     * 
+ */ + com.google.protobuf.ByteString + getMemoBytes(); + } + /** + * Protobuf type {@code payments.PaymentACK} + */ + public static final class PaymentACK extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:payments.PaymentACK) + PaymentACKOrBuilder { + // Use PaymentACK.newBuilder() to construct. + private PaymentACK(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private PaymentACK(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final PaymentACK defaultInstance; + public static PaymentACK getDefaultInstance() { + return defaultInstance; + } + + public PaymentACK getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @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 { + initFields(); + 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: { + com.dogecoin.protocols.payments.Protos.Payment.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = payment_.toBuilder(); + } + payment_ = input.readMessage(com.dogecoin.protocols.payments.Protos.Payment.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(payment_); + payment_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + memo_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_PaymentACK_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_PaymentACK_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.dogecoin.protocols.payments.Protos.PaymentACK.class, com.dogecoin.protocols.payments.Protos.PaymentACK.Builder.class); + } + + public static 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); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int PAYMENT_FIELD_NUMBER = 1; + private com.dogecoin.protocols.payments.Protos.Payment payment_; + /** + * required .payments.Payment payment = 1; + * + *
+     * Payment message that triggered this ACK
+     * 
+ */ + public boolean hasPayment() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required .payments.Payment payment = 1; + * + *
+     * Payment message that triggered this ACK
+     * 
+ */ + public com.dogecoin.protocols.payments.Protos.Payment getPayment() { + return payment_; + } + /** + * required .payments.Payment payment = 1; + * + *
+     * Payment message that triggered this ACK
+     * 
+ */ + public com.dogecoin.protocols.payments.Protos.PaymentOrBuilder getPaymentOrBuilder() { + return payment_; + } + + public static final int MEMO_FIELD_NUMBER = 2; + private java.lang.Object memo_; + /** + * optional string memo = 2; + * + *
+     * human-readable message for customer
+     * 
+ */ + public boolean hasMemo() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string memo = 2; + * + *
+     * human-readable message for customer
+     * 
+ */ + public java.lang.String getMemo() { + java.lang.Object ref = memo_; + 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()) { + memo_ = s; + } + return s; + } + } + /** + * optional string memo = 2; + * + *
+     * human-readable message for customer
+     * 
+ */ + public com.google.protobuf.ByteString + getMemoBytes() { + java.lang.Object ref = memo_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + memo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private void initFields() { + payment_ = com.dogecoin.protocols.payments.Protos.Payment.getDefaultInstance(); + memo_ = ""; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasPayment()) { + memoizedIsInitialized = 0; + return false; + } + if (!getPayment().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, payment_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getMemoBytes()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, payment_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getMemoBytes()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.dogecoin.protocols.payments.Protos.PaymentACK parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.dogecoin.protocols.payments.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 com.dogecoin.protocols.payments.Protos.PaymentACK parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.dogecoin.protocols.payments.Protos.PaymentACK parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.PaymentACK parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.dogecoin.protocols.payments.Protos.PaymentACK parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.PaymentACK parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.dogecoin.protocols.payments.Protos.PaymentACK parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.dogecoin.protocols.payments.Protos.PaymentACK parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.dogecoin.protocols.payments.Protos.PaymentACK parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(com.dogecoin.protocols.payments.Protos.PaymentACK prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code payments.PaymentACK} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:payments.PaymentACK) + com.dogecoin.protocols.payments.Protos.PaymentACKOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_PaymentACK_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_PaymentACK_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.dogecoin.protocols.payments.Protos.PaymentACK.class, com.dogecoin.protocols.payments.Protos.PaymentACK.Builder.class); + } + + // Construct using com.dogecoin.protocols.payments.Protos.PaymentACK.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getPaymentFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + if (paymentBuilder_ == null) { + payment_ = com.dogecoin.protocols.payments.Protos.Payment.getDefaultInstance(); + } else { + paymentBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + memo_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.dogecoin.protocols.payments.Protos.internal_static_payments_PaymentACK_descriptor; + } + + public com.dogecoin.protocols.payments.Protos.PaymentACK getDefaultInstanceForType() { + return com.dogecoin.protocols.payments.Protos.PaymentACK.getDefaultInstance(); + } + + public com.dogecoin.protocols.payments.Protos.PaymentACK build() { + com.dogecoin.protocols.payments.Protos.PaymentACK result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.dogecoin.protocols.payments.Protos.PaymentACK buildPartial() { + com.dogecoin.protocols.payments.Protos.PaymentACK result = new com.dogecoin.protocols.payments.Protos.PaymentACK(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (paymentBuilder_ == null) { + result.payment_ = payment_; + } else { + result.payment_ = paymentBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.memo_ = memo_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.dogecoin.protocols.payments.Protos.PaymentACK) { + return mergeFrom((com.dogecoin.protocols.payments.Protos.PaymentACK)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.dogecoin.protocols.payments.Protos.PaymentACK other) { + if (other == com.dogecoin.protocols.payments.Protos.PaymentACK.getDefaultInstance()) return this; + if (other.hasPayment()) { + mergePayment(other.getPayment()); + } + if (other.hasMemo()) { + bitField0_ |= 0x00000002; + memo_ = other.memo_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasPayment()) { + + return false; + } + if (!getPayment().isInitialized()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.dogecoin.protocols.payments.Protos.PaymentACK parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.dogecoin.protocols.payments.Protos.PaymentACK) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.dogecoin.protocols.payments.Protos.Payment payment_ = com.dogecoin.protocols.payments.Protos.Payment.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + com.dogecoin.protocols.payments.Protos.Payment, com.dogecoin.protocols.payments.Protos.Payment.Builder, com.dogecoin.protocols.payments.Protos.PaymentOrBuilder> paymentBuilder_; + /** + * required .payments.Payment payment = 1; + * + *
+       * Payment message that triggered this ACK
+       * 
+ */ + public boolean hasPayment() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required .payments.Payment payment = 1; + * + *
+       * Payment message that triggered this ACK
+       * 
+ */ + public com.dogecoin.protocols.payments.Protos.Payment getPayment() { + if (paymentBuilder_ == null) { + return payment_; + } else { + return paymentBuilder_.getMessage(); + } + } + /** + * required .payments.Payment payment = 1; + * + *
+       * Payment message that triggered this ACK
+       * 
+ */ + public Builder setPayment(com.dogecoin.protocols.payments.Protos.Payment value) { + if (paymentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payment_ = value; + onChanged(); + } else { + paymentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * required .payments.Payment payment = 1; + * + *
+       * Payment message that triggered this ACK
+       * 
+ */ + public Builder setPayment( + com.dogecoin.protocols.payments.Protos.Payment.Builder builderForValue) { + if (paymentBuilder_ == null) { + payment_ = builderForValue.build(); + onChanged(); + } else { + paymentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * required .payments.Payment payment = 1; + * + *
+       * Payment message that triggered this ACK
+       * 
+ */ + public Builder mergePayment(com.dogecoin.protocols.payments.Protos.Payment value) { + if (paymentBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) && + payment_ != com.dogecoin.protocols.payments.Protos.Payment.getDefaultInstance()) { + payment_ = + com.dogecoin.protocols.payments.Protos.Payment.newBuilder(payment_).mergeFrom(value).buildPartial(); + } else { + payment_ = value; + } + onChanged(); + } else { + paymentBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * required .payments.Payment payment = 1; + * + *
+       * Payment message that triggered this ACK
+       * 
+ */ + public Builder clearPayment() { + if (paymentBuilder_ == null) { + payment_ = com.dogecoin.protocols.payments.Protos.Payment.getDefaultInstance(); + onChanged(); + } else { + paymentBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * required .payments.Payment payment = 1; + * + *
+       * Payment message that triggered this ACK
+       * 
+ */ + public com.dogecoin.protocols.payments.Protos.Payment.Builder getPaymentBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getPaymentFieldBuilder().getBuilder(); + } + /** + * required .payments.Payment payment = 1; + * + *
+       * Payment message that triggered this ACK
+       * 
+ */ + public com.dogecoin.protocols.payments.Protos.PaymentOrBuilder getPaymentOrBuilder() { + if (paymentBuilder_ != null) { + return paymentBuilder_.getMessageOrBuilder(); + } else { + return payment_; + } + } + /** + * required .payments.Payment payment = 1; + * + *
+       * Payment message that triggered this ACK
+       * 
+ */ + private com.google.protobuf.SingleFieldBuilder< + com.dogecoin.protocols.payments.Protos.Payment, com.dogecoin.protocols.payments.Protos.Payment.Builder, com.dogecoin.protocols.payments.Protos.PaymentOrBuilder> + getPaymentFieldBuilder() { + if (paymentBuilder_ == null) { + paymentBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.dogecoin.protocols.payments.Protos.Payment, com.dogecoin.protocols.payments.Protos.Payment.Builder, com.dogecoin.protocols.payments.Protos.PaymentOrBuilder>( + getPayment(), + getParentForChildren(), + isClean()); + payment_ = null; + } + return paymentBuilder_; + } + + private java.lang.Object memo_ = ""; + /** + * optional string memo = 2; + * + *
+       * human-readable message for customer
+       * 
+ */ + public boolean hasMemo() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string memo = 2; + * + *
+       * human-readable message for customer
+       * 
+ */ + public java.lang.String getMemo() { + java.lang.Object ref = memo_; + 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()) { + memo_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string memo = 2; + * + *
+       * human-readable message for customer
+       * 
+ */ + public com.google.protobuf.ByteString + getMemoBytes() { + java.lang.Object ref = memo_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + memo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string memo = 2; + * + *
+       * human-readable message for customer
+       * 
+ */ + public Builder setMemo( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + memo_ = value; + onChanged(); + return this; + } + /** + * optional string memo = 2; + * + *
+       * human-readable message for customer
+       * 
+ */ + public Builder clearMemo() { + bitField0_ = (bitField0_ & ~0x00000002); + memo_ = getDefaultInstance().getMemo(); + onChanged(); + return this; + } + /** + * optional string memo = 2; + * + *
+       * human-readable message for customer
+       * 
+ */ + public Builder setMemoBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + memo_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:payments.PaymentACK) + } + + static { + defaultInstance = new PaymentACK(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:payments.PaymentACK) + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_payments_Output_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_payments_Output_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_payments_PaymentDetails_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_payments_PaymentDetails_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_payments_PaymentRequest_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_payments_PaymentRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_payments_X509Certificates_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_payments_X509Certificates_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_payments_Payment_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_payments_Payment_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_payments_PaymentACK_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_payments_PaymentACK_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\030src/paymentrequest.proto\022\010payments\"+\n\006" + + "Output\022\021\n\006amount\030\001 \001(\004:\0010\022\016\n\006script\030\002 \002(" + + "\014\"\337\001\n\016PaymentDetails\022Q\n\007genesis\030\001 \001(\t:@1" + + "a91e3dace36e2be3bf030a65679fe821aa1d6ef9" + + "2e7c9902eb318182c355691\022!\n\007outputs\030\002 \003(\013" + + "2\020.payments.Output\022\014\n\004time\030\003 \002(\004\022\017\n\007expi" + + "res\030\004 \001(\004\022\014\n\004memo\030\005 \001(\t\022\023\n\013payment_url\030\006" + + " \001(\t\022\025\n\rmerchant_data\030\007 \001(\014\"\225\001\n\016PaymentR" + + "equest\022\"\n\027payment_details_version\030\001 \001(\r:" + + "\0011\022\026\n\010pki_type\030\002 \001(\t:\004none\022\020\n\010pki_data\030\003", + " \001(\014\022\"\n\032serialized_payment_details\030\004 \002(\014" + + "\022\021\n\tsignature\030\005 \001(\014\"\'\n\020X509Certificates\022" + + "\023\n\013certificate\030\001 \003(\014\"i\n\007Payment\022\025\n\rmerch" + + "ant_data\030\001 \001(\014\022\024\n\014transactions\030\002 \003(\014\022#\n\t" + + "refund_to\030\003 \003(\0132\020.payments.Output\022\014\n\004mem" + + "o\030\004 \001(\t\">\n\nPaymentACK\022\"\n\007payment\030\001 \002(\0132\021" + + ".payments.Payment\022\014\n\004memo\030\002 \001(\tB)\n\037com.d" + + "ogecoin.protocols.paymentsB\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_payments_Output_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_payments_Output_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_payments_Output_descriptor, + new java.lang.String[] { "Amount", "Script", }); + internal_static_payments_PaymentDetails_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_payments_PaymentDetails_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_payments_PaymentDetails_descriptor, + new java.lang.String[] { "Genesis", "Outputs", "Time", "Expires", "Memo", "PaymentUrl", "MerchantData", }); + internal_static_payments_PaymentRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_payments_PaymentRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_payments_PaymentRequest_descriptor, + new java.lang.String[] { "PaymentDetailsVersion", "PkiType", "PkiData", "SerializedPaymentDetails", "Signature", }); + internal_static_payments_X509Certificates_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_payments_X509Certificates_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_payments_X509Certificates_descriptor, + new java.lang.String[] { "Certificate", }); + internal_static_payments_Payment_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_payments_Payment_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_payments_Payment_descriptor, + new java.lang.String[] { "MerchantData", "Transactions", "RefundTo", "Memo", }); + internal_static_payments_PaymentACK_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_payments_PaymentACK_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_payments_PaymentACK_descriptor, + new java.lang.String[] { "Payment", "Memo", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/org/altcoinj/protocols/package-info.java b/src/main/java/org/altcoinj/protocols/package-info.java deleted file mode 100644 index c69a02ad..00000000 --- a/src/main/java/org/altcoinj/protocols/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * High level protocols that build on top of Bitcoin go here: we have the payment protocol for sending transactions - * from sender to receiver with metadata, and a micropayment channels implementation. - */ -package org.altcoinj.protocols; diff --git a/src/paymentchannel.proto b/src/paymentchannel.proto deleted file mode 100644 index 761eabbb..00000000 --- a/src/paymentchannel.proto +++ /dev/null @@ -1,259 +0,0 @@ -/** Copyright 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Authors: Mike Hearn, Matt Corallo - */ - -/* Notes: - * - Endianness: All byte arrays that represent numbers (such as hashes and private keys) are Big Endian - * - To regenerate after editing, run mvn clean package -DupdateProtobuf - */ - -package paymentchannels; - -option java_package = "org.bitcoin.paymentchannel"; -option java_outer_classname = "Protos"; - -// This message is designed to be either sent raw over the network (e.g. length prefixed) or embedded inside another -// protocol that is being extended to support micropayments. In this file "primary" typically can be read as "client" -// and "secondary" as "server". -message TwoWayChannelMessage { - enum MessageType { - CLIENT_VERSION = 1; - SERVER_VERSION = 2; - INITIATE = 3; - PROVIDE_REFUND = 4; - RETURN_REFUND = 5; - PROVIDE_CONTRACT = 6; - // Note that there are no optional fields set for CHANNEL_OPEN, it is sent from the - // secondary to the primary to indicate that the provided contract was received, - // verified, and broadcast successfully and the primary can now provide UPDATE messages - // at will to begin paying secondary. If the channel is interrupted after the - // CHANNEL_OPEN message (ie closed without an explicit CLOSE or ERROR) the primary may - // reopen the channel by setting the contract transaction hash in its CLIENT_VERSION - // message. - CHANNEL_OPEN = 7; - UPDATE_PAYMENT = 8; - // Sent by the server to the client after an UPDATE_PAYMENT message is successfully processed. - PAYMENT_ACK = 11; - // Either side can send this message. If the client sends it to the server, then the server - // takes the most recent signature it received in an UPDATE_PAYMENT and uses it to create a - // valid transaction, which it then broadcasts on the network. - // - // Once broadcast is complete, it sends back another CLOSE message with the settlement field set, containing - // the final state of the contract. - // - // The server is allowed to initiate settlement whenever it wants, in which case the client will - // asynchronously receive a CLOSE message with the settlement field set. The server is also allowed - // to send a CLOSE to mark the end of a connection without any settlement taking place, in which - // case this is just an equivalent to a TCP FIN packet. An explicit end-of-protocol markers can be - // useful when this protocol is embedded inside another. - CLOSE = 9; - - // Used to indicate an error condition. - // 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). This is important - // because the protocol may not run over TCP. - ERROR = 10; - }; - - // This is required so if a new message type is added in future, old software aborts trying - // to read the message as early as possible. If the message doesn't parse, the socket should - // be closed. - required MessageType type = 1; - - // Now one optional field for each message. Only the field specified by type should be read. - optional ClientVersion client_version = 2; - optional ServerVersion server_version = 3; - optional Initiate initiate = 4; - optional ProvideRefund provide_refund = 5; - optional ReturnRefund return_refund = 6; - optional ProvideContract provide_contract = 7; - optional UpdatePayment update_payment = 8; - optional PaymentAck payment_ack = 11; - optional Settlement settlement = 9; - - optional Error error = 10; -} - -// Sent by primary to secondary on opening the connection. If anything is received before this is -// sent, the socket is closed. -message ClientVersion { - required int32 major = 1; - optional int32 minor = 2 [default = 0]; - - // The hash of the multisig contract of a previous channel. This indicates that the primary - // wishes to reopen the given channel. If the server is willing to reopen it, it simply - // responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise - // follows SERVER_VERSION with an Initiate representing a new channel - optional bytes previous_channel_contract_hash = 3; - - // How many seconds should the channel be open, only used when a new channel is created. - // Defaults to 24 h minus 60 seconds, 24*60*60 - 60 - optional uint64 time_window_secs = 4 [default = 86340]; -} - -// Send by secondary to primary upon receiving the ClientVersion message. If it is willing to -// speak the given major version, it sends back the same major version and the minor version it -// speaks. If it is not, it may send back a lower major version representing the highest version -// it is willing to speak, or sends a NO_ACCEPTABLE_VERSION Error. If the secondary sends back a -// lower major version, the secondary should either expect to continue with that version, or -// should immediately close the connection with a NO_ACCEPTABLE_VERSION Error. Backwards -// incompatible changes to the protocol bump the major version. Extensions bump the minor version -message ServerVersion { - required int32 major = 1; - optional int32 minor = 2 [default = 0]; -} - -// Sent from server to client once version nego is done. -message Initiate { - // 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; - - // 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; - - // 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; - - // 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; -} - -// Sent from primary to secondary after Initiate to begin the refund transaction signing. -message ProvideRefund { - // 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; - - // 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; -} - -// 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. -message ReturnRefund { - required bytes signature = 1; -} - -// Sent from the primary to the secondary to complete initialization. -message ProvideContract { - // The serialized bytes of the transaction in Satoshi format. - // * 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") - required bytes tx = 1; - - // 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 UpdatePayment initial_payment = 2; -} - -// 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) -message UpdatePayment { - // 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; - // 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; - // Information about this update. Used to extend this protocol. - optional bytes info = 3; - -} - -// This message is sent as an acknowledgement of an UpdatePayment message -message PaymentAck { - // Information about this update. Used to extend this protocol - optional bytes info = 1; -} - -message Settlement { - // 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; -} - -// 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) -message Error { - enum ErrorCode { - TIMEOUT = 1; // Protocol timeout occurred (one party hung). - SYNTAX_ERROR = 2; // Generic error indicating some message was not properly - // formatted or was out of order. - NO_ACCEPTABLE_VERSION = 3; // We don't speak the version the other side asked for. - BAD_TRANSACTION = 4; // A provided transaction was not in the proper structure - // (wrong inputs/outputs, sequence, lock time, signature, - // etc) - TIME_WINDOW_UNACCEPTABLE = 5; // The expire time specified by the secondary was unacceptable - // for the primary - CHANNEL_VALUE_TOO_LARGE = 6; // The minimum channel value specified by the secondary was - // too large for the primary - MIN_PAYMENT_TOO_LARGE = 7; // The min "dust limit" specified by the server was too large for the client. - - OTHER = 8; - }; - optional ErrorCode code = 1 [default=OTHER]; - optional string explanation = 2; // NOT SAFE FOR HTML WITHOUT ESCAPING - - // 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; -} diff --git a/src/paymentrequest.proto b/src/paymentrequest.proto index e01d514c..964d6e17 100644 --- a/src/paymentrequest.proto +++ b/src/paymentrequest.proto @@ -1,46 +1,23 @@ -/** Copyright 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Authors: Mike Hearn, Gavin Andresen - */ - -/* Notes: - * - Endianness: All byte arrays that represent numbers (such as hashes and private keys) are Big Endian - * - To regenerate after editing, run mvn clean package -DupdateProtobuf - */ - // -// Simple Bitcoin Payment Protocol messages +// Simple Dogecoin Payment Protocol messages +// Derived fromthe Bitcoin Payment Protocol // // Use fields 100+ for extensions; -// to avoid conflicts, register extensions at: -// https://en.bitcoin.it/wiki/Payment_Request +// to avoid conflicts, register extensions via pull-req at: +// https://github.com/dogecoin/dips // package payments; -option java_package = "org.bitcoin.protocols.payments"; +option java_package = "com.dogecoin.protocols.payments"; option java_outer_classname = "Protos"; -// Generalized form of "send payment to this/these bitcoin addresses" +// Generalized form of "send payment to this/these dogecoin addresses" message Output { optional uint64 amount = 1 [default = 0]; // amount is integer-number-of-satoshis required bytes script = 2; // usually one of the standard Script forms } message PaymentDetails { - optional string network = 1 [default = "main"]; // "main" or "test" + optional string genesis = 1 [default = "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"]; // Hash of the network genesis block repeated Output outputs = 2; // Where payment should be sent required uint64 time = 3; // Timestamp; when payment request created optional uint64 expires = 4; // Timestamp; when this request should be considered invalid @@ -67,4 +44,4 @@ message Payment { message PaymentACK { required Payment payment = 1; // Payment message that triggered this ACK optional string memo = 2; // human-readable message for customer -} \ No newline at end of file +} diff --git a/src/peerseeds.proto b/src/peerseeds.proto deleted file mode 100644 index c9c6ca7e..00000000 --- a/src/peerseeds.proto +++ /dev/null @@ -1,26 +0,0 @@ -package org.bitcoin.crawler; - -// -// A simple protocol for describing signed sets of IP addresses. Intended to be distributed via HTTP[S] or in files. -// - -option java_package = "org.bitcoin.crawler"; -option java_outer_classname = "PeerSeedProtos"; - -message PeerSeedData { - required string ip_address = 1; - required uint32 port = 2; - required uint32 services = 3; -} - -message PeerSeeds { - repeated PeerSeedData seed = 1; - required uint64 timestamp = 2; // seconds since UNIX epoch - required string net = 3; -} - -message SignedPeerSeeds { - required bytes peer_seeds = 1; - required bytes signature = 2; - required bytes pubkey = 3; -} \ No newline at end of file diff --git a/src/storedclientpaymentchannel.proto b/src/storedclientpaymentchannel.proto deleted file mode 100644 index 909cd3d1..00000000 --- a/src/storedclientpaymentchannel.proto +++ /dev/null @@ -1,51 +0,0 @@ -/** Copyright 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Authors: Mike Hearn, Matt Corallo - */ - -/* Notes: - * - Endianness: All byte arrays that represent numbers (such as hashes and private keys) are Big Endian - * - To regenerate after editing, run mvn clean package -DupdateProtobuf - */ - -package paymentchannels; - -option java_package = "com.dogecoin.dogecoinj.protocols.channels"; -option java_outer_classname = "ClientState"; - - -// A set of StoredPaymentChannel's -message StoredClientPaymentChannels { - repeated StoredClientPaymentChannel channels = 1; -} - -// A client-side payment channel in serialized form, which can be reloaded later if the client restarts and wants to -// reopen an existing channel -message StoredClientPaymentChannel { - required bytes id = 1; - required bytes contractTransaction = 2; - required bytes refundTransaction = 3; - required bytes myPublicKey = 8; - // Deprecated, key is already stored in the wallet, and found using myPublicKey; - required bytes myKey = 4; - required uint64 valueToMe = 5; - required uint64 refundFees = 6; - // When set, the hash of the transaction that was presented by the server for closure of the channel. - // It spends the contractTransaction and is expected to be broadcast to the network by the server. - // It's supposed to be in the wallet already. - optional bytes closeTransactionHash = 7; -} \ No newline at end of file diff --git a/src/storedserverpaymentchannel.proto b/src/storedserverpaymentchannel.proto deleted file mode 100644 index 2cb91280..00000000 --- a/src/storedserverpaymentchannel.proto +++ /dev/null @@ -1,44 +0,0 @@ -/** Copyright 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Authors: Mike Hearn, Matt Corallo - */ - -/* Notes: - * - Endianness: All byte arrays that represent numbers (such as hashes and private keys) are Big Endian - * - To regenerate after editing, run mvn clean package -DupdateProtobuf - */ - -package paymentchannels; - -option java_package = "com.dogecoin.dogecoinj.protocols.channels"; -option java_outer_classname = "ServerState"; - - -// A set of StoredPaymentChannel's -message StoredServerPaymentChannels { - repeated StoredServerPaymentChannel channels = 1; -} - -// A server-side payment channel in serialized form, which can be reloaded later if the server restarts -message StoredServerPaymentChannel { - required uint64 bestValueToMe = 1; - optional bytes bestValueSignature = 2; - required uint64 refundTransactionUnlockTimeSecs = 3; - required bytes contractTransaction = 4; - required bytes clientOutput = 5; - required bytes myKey = 6; -} \ No newline at end of file diff --git a/src/wallet.proto b/src/wallet.proto deleted file mode 100644 index 860486c7..00000000 --- a/src/wallet.proto +++ /dev/null @@ -1,400 +0,0 @@ -/** Copyright 2013 Google Inc. - * Copyright 2014 Andreas Schildbach - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Authors: Jim Burton, Miron Cuperman, Andreas Schildbach - */ - -/* Notes: - * - Endianness: All byte arrays that represent numbers (such as hashes and private keys) are Big Endian - * - To regenerate after editing, run: mvn generate-sources -DupdateProtobuf - */ - -package wallet; - -option java_package = "com.dogecoin.dogecoinj.wallet"; -option java_outer_classname = "Protos"; - -message PeerAddress { - required bytes ip_address = 1; - required uint32 port = 2; - required uint64 services = 3; -} - -message EncryptedData { - required bytes initialisation_vector = 1; // The initialisation vector for the AES encryption (16 bytes) - required bytes encrypted_private_key = 2; // The encrypted private key -} - -/** - * Data attached to a Key message that defines the data needed by the BIP32 deterministic key hierarchy algorithm. - */ -message DeterministicKey { - // Random data that allows us to extend a key. Without this, we can't figure out the next key in the chain and - // should just treat it as a regular ORIGINAL type key. - required bytes chain_code = 1; - - // The path through the key tree. Each number is encoded in the standard form: high bit set for private derivation - // and high bit unset for public derivation. - repeated uint32 path = 2; - - // How many children of this key have been issued, that is, given to the user when they requested a fresh key? - // For the parents of keys being handed out, this is always less than the true number of children: the difference is - // called the lookahead zone. These keys are put into Bloom filters so we can spot transactions made by clones of - // this wallet - for instance when restoring from backup or if the seed was shared between devices. - // - // If this field is missing it means we're not issuing subkeys of this key to users. - optional uint32 issued_subkeys = 3; - optional uint32 lookahead_size = 4; - - /** - * Flag indicating that this key is a root of a following chain. This chain is following the next non-following chain. - * Following/followed chains concept is used for married keychains, where the set of keys combined together to produce - * a single P2SH multisignature address - */ - optional bool isFollowing = 5; - - // Number of signatures required to spend. This field is needed only for married keychains to reconstruct KeyChain - // and represents the N value from N-of-M CHECKMULTISIG script. For regular single keychains it will always be 1. - optional uint32 sigsRequiredToSpend = 6 [default = 1]; -} - -/** - * A key used to control Bitcoin spending. - * - * Either the private key, the public key or both may be present. It is recommended that - * if the private key is provided that the public key is provided too because deriving it is slow. - * - * If only the public key is provided, the key can only be used to watch the blockchain and verify - * transactions, and not for spending. - */ -message Key { - enum Type { - /** Unencrypted - Original bitcoin secp256k1 curve */ - ORIGINAL = 1; - - /** Encrypted with Scrypt and AES - Original bitcoin secp256k1 curve */ - ENCRYPTED_SCRYPT_AES = 2; - - /** - * Not really a key, but rather contains the mnemonic phrase for a deterministic key hierarchy in the private_key field. - * The label and public_key fields are missing. Creation timestamp will exist. - */ - DETERMINISTIC_MNEMONIC = 3; - - /** - * A key that was derived deterministically. Note that the root seed that created it may NOT be present in the - * wallet, for the case of watching wallets. A deterministic key may or may not have the private key bytes present. - * However the public key bytes and the deterministic_key field are guaranteed to exist. In a wallet where there - * is a path from this key up to a key that has (possibly encrypted) private bytes, it's expected that the private - * key can be rederived on the fly. - */ - DETERMINISTIC_KEY = 4; - } - required Type type = 1; - - // Either the private EC key bytes (without any ASN.1 wrapping), or the deterministic root seed. - // If the secret is encrypted, or this is a "watching entry" then this is missing. - optional bytes secret_bytes = 2; - - // If the secret data is encrypted, then secret_bytes is missing and this field is set. - optional EncryptedData encrypted_data = 6; - - // The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to - // do lots of slow EC math on startup. For DETERMINISTIC_MNEMONIC entries this is missing. - optional bytes public_key = 3; - - // User-provided label associated with the key. - optional string label = 4; - - // Timestamp stored as millis since epoch. Useful for skipping block bodies before this point. Only reason it's - // optional is that some very old wallets don't have this data. - optional int64 creation_timestamp = 5; - - optional DeterministicKey deterministic_key = 7; - - // The seed for a deterministic key hierarchy. Derived from the mnemonic, - // but cached here for quick startup. Only applicable to a DETERMINISTIC_MNEMONIC key entry. - optional bytes deterministic_seed = 8; - - // Encrypted version of the seed - optional EncryptedData encrypted_deterministic_seed = 9; -} - -message Script { - required bytes program = 1; - - // Timestamp stored as millis since epoch. Useful for skipping block bodies before this point - // when watching for scripts on the blockchain. - required int64 creation_timestamp = 2; -} - -message TransactionInput { - // Hash of the transaction this input is using. - required bytes transaction_out_point_hash = 1; - // Index of transaction output used by this input. - required uint32 transaction_out_point_index = 2; - // Script that contains the signatures/pubkeys. - required bytes script_bytes = 3; - // Sequence number. Currently unused, but intended for contracts in future. - optional uint32 sequence = 4; - // Value of connected output, if known - optional int64 value = 5; -} - -message TransactionOutput { - required int64 value = 1; - required bytes script_bytes = 2; // script of transaction output - // If spent, the hash of the transaction doing the spend. - optional bytes spent_by_transaction_hash = 3; - // If spent, the index of the transaction input of the transaction doing the spend. - optional int32 spent_by_transaction_index = 4; -} - -/** - * A description of the confidence we have that a transaction cannot be reversed in the future. - * - * Parsing should be lenient, since this could change for different applications yet we should - * maintain backward compatibility. - */ -message TransactionConfidence { - enum Type { - UNKNOWN = 0; - BUILDING = 1; // In best chain. If and only if appeared_at_height is present. - PENDING = 2; // Unconfirmed and sitting in the networks memory pools, waiting to be included in the chain. - NOT_IN_BEST_CHAIN = 3; // Deprecated: equivalent to PENDING. - DEAD = 4; // Either if overriding_transaction is present or transaction is dead coinbase - } - - // This is optional in case we add confidence types to prevent parse errors - backwards compatible. - optional Type type = 1; - - // If type == BUILDING then this is the chain height at which the transaction was included. - optional int32 appeared_at_height = 2; - - // If set, hash of the transaction that double spent this one into oblivion. A transaction can be double spent by - // multiple transactions in the case of several inputs being re-spent by several transactions but we don't - // bother to track them all, just the first. This only makes sense if type = DEAD. - optional bytes overriding_transaction = 3; - - // If type == BUILDING then this is the depth of the transaction in the blockchain. - // Zero confirmations: depth = 0, one confirmation: depth = 1 etc. - optional int32 depth = 4; - - // deprecated - do not recycle this numeric identifier - // optional int64 work_done = 5; - - repeated PeerAddress broadcast_by = 6; - - // Where did we get this transaction from? Knowing the source may help us to risk analyze pending transactions. - enum Source { - SOURCE_UNKNOWN = 0; // We don't know where it came from, or this is a wallet from the future. - SOURCE_NETWORK = 1; // We received it from a network broadcast. This is the normal way to get payments. - SOURCE_SELF = 2; // We made it ourselves, so we know it should be valid. - // In future: - // - direct from trusted counterparty, eg via bluetooth/wifi direct - // - direct from untrusted counterparty - // - from a wallet that uses trusted computing/secure hardware that won't create double spends - } - optional Source source = 7; -} - -/** A bitcoin transaction */ - -message Transaction { - /** - * This is a bitfield oriented enum, with the following bits: - * - * bit 0 - spent - * bit 1 - appears in alt chain - * bit 2 - appears in best chain - * bit 3 - double-spent - * bit 4 - pending (we would like the tx to go into the best chain) - * - * Not all combinations are interesting, just the ones actually used in the enum. - */ - enum Pool { - UNSPENT = 4; // In best chain, not all outputs spent - SPENT = 5; // In best chain, all outputs spent - INACTIVE = 2; // In non-best chain, not our transaction - DEAD = 10; // Double-spent by a transaction in the best chain - PENDING = 16; // Our transaction, not in any chain - PENDING_INACTIVE = 18; // In non-best chain, our transaction - } - - // See Wallet.java for detailed description of pool semantics - required int32 version = 1; - required bytes hash = 2; - - // If pool is not present, that means either: - // - This Transaction is either not in a wallet at all (the proto is re-used elsewhere) - // - Or it is stored but for other purposes, for example, because it is the overriding transaction of a double spend. - // - Or the Pool enum got a new value which your software is too old to parse. - optional Pool pool = 3; - - optional uint32 lock_time = 4; // The nLockTime field is useful for contracts. - optional int64 updated_at = 5; // millis since epoch the transaction was last updated - - repeated TransactionInput transaction_input = 6; - repeated TransactionOutput transaction_output = 7; - - // A list of blocks in which the transaction has been observed (on any chain). Also, a number used to disambiguate - // ordering within a block. - repeated bytes block_hash = 8; - repeated int32 block_relativity_offsets = 11; - - // Data describing where the transaction is in the chain. - optional TransactionConfidence confidence = 9; - - // For what purpose the transaction was created. - enum Purpose { - // Old wallets or the purpose genuinely is a mystery (e.g. imported from some external source). - UNKNOWN = 0; - // Created in response to a user request for payment. This is the normal case. - USER_PAYMENT = 1; - // Created automatically to move money from rotated keys. - KEY_ROTATION = 2; - // Stuff used by Lighthouse. - ASSURANCE_CONTRACT_CLAIM = 3; - ASSURANCE_CONTRACT_PLEDGE = 4; - ASSURANCE_CONTRACT_STUB = 5; - // In future: de/refragmentation, privacy boosting/mixing, child-pays-for-parent fees, etc. - } - optional Purpose purpose = 10 [default = UNKNOWN]; - - // Exchange rate that was valid when the transaction was sent. - optional ExchangeRate exchange_rate = 12; - - // Memo of the transaction. It can be used to record the memo of the payment request that initiated the - // transaction. - optional string memo = 13; - - // Next tag: 14 -} - -/** The parameters used in the scrypt key derivation function. - * The default values are taken from http://www.tarsnap.com/scrypt/scrypt-slides.pdf. - * They can be increased - n is the number of iterations performed and - * r and p can be used to tweak the algorithm - see: - * http://stackoverflow.com/questions/11126315/what-are-optimal-scrypt-work-factors - */ -message ScryptParameters { - required bytes salt = 1; // Salt to use in generation of the wallet password (8 bytes) - optional int64 n = 2 [default = 16384]; // CPU/ memory cost parameter - optional int32 r = 3 [default = 8]; // Block size parameter - optional int32 p = 4 [default = 1]; // Parallelisation parameter -} - -/** An extension to the wallet */ -message Extension { - required string id = 1; // like org.whatever.foo.bar - required bytes data = 2; - // If we do not understand a mandatory extension, abort to prevent data loss. - // For example, this could be applied to a new type of holding, such as a contract, where - // dropping of an extension in a read/write cycle could cause loss of value. - required bool mandatory = 3; -} - -/** - * A simple key->value mapping that has no interpreted content at all. A bit like the extensions mechanism except - * an extension is keyed by the ID of a piece of code that's loaded with the given data, and has the concept of - * being mandatory if that code isn't found. Whereas this is just a blind key/value store. - */ -message Tag { - required string tag = 1; - required bytes data = 2; -} - -/** - * Data required to reconstruct TransactionSigner. - */ -message TransactionSigner { - // fully qualified class name of TransactionSigner implementation - required string class_name = 1; - // arbitrary data required for signer to function - optional bytes data = 2; -} - -/** A bitcoin wallet */ -message Wallet { - /** - * The encryption type of the wallet. - * - * The encryption type is UNENCRYPTED for wallets where the wallet does not support encryption - wallets prior to - * encryption support are grandfathered in as this wallet type. - * When a wallet is ENCRYPTED_SCRYPT_AES the keys are either encrypted with the wallet password or are unencrypted. - */ - enum EncryptionType { - UNENCRYPTED = 1; // All keys in the wallet are unencrypted - ENCRYPTED_SCRYPT_AES = 2; // All keys are encrypted with a passphrase based KDF of scrypt and AES encryption - } - - required string network_identifier = 1; // the network used by this wallet - // org.bitcoin.production = main, production network (Satoshi genesis block) - // org.bitcoin.test = test network (Andresen genesis block) - - // The SHA256 hash of the head of the best chain seen by this wallet. - optional bytes last_seen_block_hash = 2; - // The height in the chain of the last seen block. - optional uint32 last_seen_block_height = 12; - optional int64 last_seen_block_time_secs = 14; - - repeated Key key = 3; - repeated Transaction transaction = 4; - repeated Script watched_script = 15; - - optional EncryptionType encryption_type = 5 [default=UNENCRYPTED]; - optional ScryptParameters encryption_parameters = 6; - - // The version number of the wallet - used to detect wallets that were produced in the future - // (i.e. the wallet may contain some future format this protobuf or parser code does not know about). - // A version that's higher than the default is considered from the future. - optional int32 version = 7 [default = 1]; - - // deprecated - do not recycle this numeric identifier - // optional int32 minor_version = 8; - - repeated Extension extension = 10; - - // A UTF8 encoded text description of the wallet that is intended for end user provided text. - optional string description = 11; - - // (The field number 12 is used by last_seen_block_height) - - // UNIX time in seconds since the epoch. If set, then any keys created before this date are assumed to be no longer - // wanted. Money sent to them will be re-spent automatically to the first key that was created after this time. It - // can be used to recover a compromised wallet, or just as part of preventative defence-in-depth measures. - optional uint64 key_rotation_time = 13; - - repeated Tag tags = 16; - - // transaction signers added to the wallet - repeated TransactionSigner transaction_signers = 17; - - // Next tag: 18 -} - -/** An exchange rate between Bitcoin and some fiat currency. */ -message ExchangeRate { - // This much of satoshis (1E-8 fractions)… - required int64 coin_value = 1; - // …is worth this much of fiat (1E-4 fractions). - required int64 fiat_value = 2; - // ISO 4217 currency code (if available) of the fiat currency. - required string fiat_currency_code = 3; - - // Next tag: 4 -}