/core/src/main/java/org/bitcoinj/wallet/Protos.java

https://code.google.com/ · Java · 12763 lines · 8241 code · 597 blank · 3925 comment · 1364 complexity · b3df529ded99ef4f09f75f868c89ba96 MD5 · raw file

  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: bitcoin.proto
  3. package org.bitcoinj.wallet;
  4. public final class Protos {
  5. private Protos() {}
  6. public static void registerAllExtensions(
  7. com.google.protobuf.ExtensionRegistry registry) {
  8. }
  9. public interface PeerAddressOrBuilder
  10. extends com.google.protobuf.MessageOrBuilder {
  11. // required bytes ip_address = 1;
  12. /**
  13. * <code>required bytes ip_address = 1;</code>
  14. */
  15. boolean hasIpAddress();
  16. /**
  17. * <code>required bytes ip_address = 1;</code>
  18. */
  19. com.google.protobuf.ByteString getIpAddress();
  20. // required uint32 port = 2;
  21. /**
  22. * <code>required uint32 port = 2;</code>
  23. */
  24. boolean hasPort();
  25. /**
  26. * <code>required uint32 port = 2;</code>
  27. */
  28. int getPort();
  29. // required uint64 services = 3;
  30. /**
  31. * <code>required uint64 services = 3;</code>
  32. */
  33. boolean hasServices();
  34. /**
  35. * <code>required uint64 services = 3;</code>
  36. */
  37. long getServices();
  38. }
  39. /**
  40. * Protobuf type {@code wallet.PeerAddress}
  41. */
  42. public static final class PeerAddress extends
  43. com.google.protobuf.GeneratedMessage
  44. implements PeerAddressOrBuilder {
  45. // Use PeerAddress.newBuilder() to construct.
  46. private PeerAddress(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  47. super(builder);
  48. this.unknownFields = builder.getUnknownFields();
  49. }
  50. private PeerAddress(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  51. private static final PeerAddress defaultInstance;
  52. public static PeerAddress getDefaultInstance() {
  53. return defaultInstance;
  54. }
  55. public PeerAddress getDefaultInstanceForType() {
  56. return defaultInstance;
  57. }
  58. private final com.google.protobuf.UnknownFieldSet unknownFields;
  59. @java.lang.Override
  60. public final com.google.protobuf.UnknownFieldSet
  61. getUnknownFields() {
  62. return this.unknownFields;
  63. }
  64. private PeerAddress(
  65. com.google.protobuf.CodedInputStream input,
  66. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  67. throws com.google.protobuf.InvalidProtocolBufferException {
  68. initFields();
  69. int mutable_bitField0_ = 0;
  70. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  71. com.google.protobuf.UnknownFieldSet.newBuilder();
  72. try {
  73. boolean done = false;
  74. while (!done) {
  75. int tag = input.readTag();
  76. switch (tag) {
  77. case 0:
  78. done = true;
  79. break;
  80. default: {
  81. if (!parseUnknownField(input, unknownFields,
  82. extensionRegistry, tag)) {
  83. done = true;
  84. }
  85. break;
  86. }
  87. case 10: {
  88. bitField0_ |= 0x00000001;
  89. ipAddress_ = input.readBytes();
  90. break;
  91. }
  92. case 16: {
  93. bitField0_ |= 0x00000002;
  94. port_ = input.readUInt32();
  95. break;
  96. }
  97. case 24: {
  98. bitField0_ |= 0x00000004;
  99. services_ = input.readUInt64();
  100. break;
  101. }
  102. }
  103. }
  104. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  105. throw e.setUnfinishedMessage(this);
  106. } catch (java.io.IOException e) {
  107. throw new com.google.protobuf.InvalidProtocolBufferException(
  108. e.getMessage()).setUnfinishedMessage(this);
  109. } finally {
  110. this.unknownFields = unknownFields.build();
  111. makeExtensionsImmutable();
  112. }
  113. }
  114. public static final com.google.protobuf.Descriptors.Descriptor
  115. getDescriptor() {
  116. return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_descriptor;
  117. }
  118. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  119. internalGetFieldAccessorTable() {
  120. return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_fieldAccessorTable
  121. .ensureFieldAccessorsInitialized(
  122. org.bitcoinj.wallet.Protos.PeerAddress.class, org.bitcoinj.wallet.Protos.PeerAddress.Builder.class);
  123. }
  124. public static com.google.protobuf.Parser<PeerAddress> PARSER =
  125. new com.google.protobuf.AbstractParser<PeerAddress>() {
  126. public PeerAddress parsePartialFrom(
  127. com.google.protobuf.CodedInputStream input,
  128. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  129. throws com.google.protobuf.InvalidProtocolBufferException {
  130. return new PeerAddress(input, extensionRegistry);
  131. }
  132. };
  133. @java.lang.Override
  134. public com.google.protobuf.Parser<PeerAddress> getParserForType() {
  135. return PARSER;
  136. }
  137. private int bitField0_;
  138. // required bytes ip_address = 1;
  139. public static final int IP_ADDRESS_FIELD_NUMBER = 1;
  140. private com.google.protobuf.ByteString ipAddress_;
  141. /**
  142. * <code>required bytes ip_address = 1;</code>
  143. */
  144. public boolean hasIpAddress() {
  145. return ((bitField0_ & 0x00000001) == 0x00000001);
  146. }
  147. /**
  148. * <code>required bytes ip_address = 1;</code>
  149. */
  150. public com.google.protobuf.ByteString getIpAddress() {
  151. return ipAddress_;
  152. }
  153. // required uint32 port = 2;
  154. public static final int PORT_FIELD_NUMBER = 2;
  155. private int port_;
  156. /**
  157. * <code>required uint32 port = 2;</code>
  158. */
  159. public boolean hasPort() {
  160. return ((bitField0_ & 0x00000002) == 0x00000002);
  161. }
  162. /**
  163. * <code>required uint32 port = 2;</code>
  164. */
  165. public int getPort() {
  166. return port_;
  167. }
  168. // required uint64 services = 3;
  169. public static final int SERVICES_FIELD_NUMBER = 3;
  170. private long services_;
  171. /**
  172. * <code>required uint64 services = 3;</code>
  173. */
  174. public boolean hasServices() {
  175. return ((bitField0_ & 0x00000004) == 0x00000004);
  176. }
  177. /**
  178. * <code>required uint64 services = 3;</code>
  179. */
  180. public long getServices() {
  181. return services_;
  182. }
  183. private void initFields() {
  184. ipAddress_ = com.google.protobuf.ByteString.EMPTY;
  185. port_ = 0;
  186. services_ = 0L;
  187. }
  188. private byte memoizedIsInitialized = -1;
  189. public final boolean isInitialized() {
  190. byte isInitialized = memoizedIsInitialized;
  191. if (isInitialized != -1) return isInitialized == 1;
  192. if (!hasIpAddress()) {
  193. memoizedIsInitialized = 0;
  194. return false;
  195. }
  196. if (!hasPort()) {
  197. memoizedIsInitialized = 0;
  198. return false;
  199. }
  200. if (!hasServices()) {
  201. memoizedIsInitialized = 0;
  202. return false;
  203. }
  204. memoizedIsInitialized = 1;
  205. return true;
  206. }
  207. public void writeTo(com.google.protobuf.CodedOutputStream output)
  208. throws java.io.IOException {
  209. getSerializedSize();
  210. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  211. output.writeBytes(1, ipAddress_);
  212. }
  213. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  214. output.writeUInt32(2, port_);
  215. }
  216. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  217. output.writeUInt64(3, services_);
  218. }
  219. getUnknownFields().writeTo(output);
  220. }
  221. private int memoizedSerializedSize = -1;
  222. public int getSerializedSize() {
  223. int size = memoizedSerializedSize;
  224. if (size != -1) return size;
  225. size = 0;
  226. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  227. size += com.google.protobuf.CodedOutputStream
  228. .computeBytesSize(1, ipAddress_);
  229. }
  230. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  231. size += com.google.protobuf.CodedOutputStream
  232. .computeUInt32Size(2, port_);
  233. }
  234. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  235. size += com.google.protobuf.CodedOutputStream
  236. .computeUInt64Size(3, services_);
  237. }
  238. size += getUnknownFields().getSerializedSize();
  239. memoizedSerializedSize = size;
  240. return size;
  241. }
  242. private static final long serialVersionUID = 0L;
  243. @java.lang.Override
  244. protected java.lang.Object writeReplace()
  245. throws java.io.ObjectStreamException {
  246. return super.writeReplace();
  247. }
  248. public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(
  249. com.google.protobuf.ByteString data)
  250. throws com.google.protobuf.InvalidProtocolBufferException {
  251. return PARSER.parseFrom(data);
  252. }
  253. public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(
  254. com.google.protobuf.ByteString data,
  255. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  256. throws com.google.protobuf.InvalidProtocolBufferException {
  257. return PARSER.parseFrom(data, extensionRegistry);
  258. }
  259. public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(byte[] data)
  260. throws com.google.protobuf.InvalidProtocolBufferException {
  261. return PARSER.parseFrom(data);
  262. }
  263. public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(
  264. byte[] data,
  265. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  266. throws com.google.protobuf.InvalidProtocolBufferException {
  267. return PARSER.parseFrom(data, extensionRegistry);
  268. }
  269. public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(java.io.InputStream input)
  270. throws java.io.IOException {
  271. return PARSER.parseFrom(input);
  272. }
  273. public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(
  274. java.io.InputStream input,
  275. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  276. throws java.io.IOException {
  277. return PARSER.parseFrom(input, extensionRegistry);
  278. }
  279. public static org.bitcoinj.wallet.Protos.PeerAddress parseDelimitedFrom(java.io.InputStream input)
  280. throws java.io.IOException {
  281. return PARSER.parseDelimitedFrom(input);
  282. }
  283. public static org.bitcoinj.wallet.Protos.PeerAddress parseDelimitedFrom(
  284. java.io.InputStream input,
  285. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  286. throws java.io.IOException {
  287. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  288. }
  289. public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(
  290. com.google.protobuf.CodedInputStream input)
  291. throws java.io.IOException {
  292. return PARSER.parseFrom(input);
  293. }
  294. public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(
  295. com.google.protobuf.CodedInputStream input,
  296. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  297. throws java.io.IOException {
  298. return PARSER.parseFrom(input, extensionRegistry);
  299. }
  300. public static Builder newBuilder() { return Builder.create(); }
  301. public Builder newBuilderForType() { return newBuilder(); }
  302. public static Builder newBuilder(org.bitcoinj.wallet.Protos.PeerAddress prototype) {
  303. return newBuilder().mergeFrom(prototype);
  304. }
  305. public Builder toBuilder() { return newBuilder(this); }
  306. @java.lang.Override
  307. protected Builder newBuilderForType(
  308. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  309. Builder builder = new Builder(parent);
  310. return builder;
  311. }
  312. /**
  313. * Protobuf type {@code wallet.PeerAddress}
  314. */
  315. public static final class Builder extends
  316. com.google.protobuf.GeneratedMessage.Builder<Builder>
  317. implements org.bitcoinj.wallet.Protos.PeerAddressOrBuilder {
  318. public static final com.google.protobuf.Descriptors.Descriptor
  319. getDescriptor() {
  320. return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_descriptor;
  321. }
  322. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  323. internalGetFieldAccessorTable() {
  324. return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_fieldAccessorTable
  325. .ensureFieldAccessorsInitialized(
  326. org.bitcoinj.wallet.Protos.PeerAddress.class, org.bitcoinj.wallet.Protos.PeerAddress.Builder.class);
  327. }
  328. // Construct using org.bitcoinj.wallet.Protos.PeerAddress.newBuilder()
  329. private Builder() {
  330. maybeForceBuilderInitialization();
  331. }
  332. private Builder(
  333. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  334. super(parent);
  335. maybeForceBuilderInitialization();
  336. }
  337. private void maybeForceBuilderInitialization() {
  338. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  339. }
  340. }
  341. private static Builder create() {
  342. return new Builder();
  343. }
  344. public Builder clear() {
  345. super.clear();
  346. ipAddress_ = com.google.protobuf.ByteString.EMPTY;
  347. bitField0_ = (bitField0_ & ~0x00000001);
  348. port_ = 0;
  349. bitField0_ = (bitField0_ & ~0x00000002);
  350. services_ = 0L;
  351. bitField0_ = (bitField0_ & ~0x00000004);
  352. return this;
  353. }
  354. public Builder clone() {
  355. return create().mergeFrom(buildPartial());
  356. }
  357. public com.google.protobuf.Descriptors.Descriptor
  358. getDescriptorForType() {
  359. return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_descriptor;
  360. }
  361. public org.bitcoinj.wallet.Protos.PeerAddress getDefaultInstanceForType() {
  362. return org.bitcoinj.wallet.Protos.PeerAddress.getDefaultInstance();
  363. }
  364. public org.bitcoinj.wallet.Protos.PeerAddress build() {
  365. org.bitcoinj.wallet.Protos.PeerAddress result = buildPartial();
  366. if (!result.isInitialized()) {
  367. throw newUninitializedMessageException(result);
  368. }
  369. return result;
  370. }
  371. public org.bitcoinj.wallet.Protos.PeerAddress buildPartial() {
  372. org.bitcoinj.wallet.Protos.PeerAddress result = new org.bitcoinj.wallet.Protos.PeerAddress(this);
  373. int from_bitField0_ = bitField0_;
  374. int to_bitField0_ = 0;
  375. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  376. to_bitField0_ |= 0x00000001;
  377. }
  378. result.ipAddress_ = ipAddress_;
  379. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  380. to_bitField0_ |= 0x00000002;
  381. }
  382. result.port_ = port_;
  383. if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
  384. to_bitField0_ |= 0x00000004;
  385. }
  386. result.services_ = services_;
  387. result.bitField0_ = to_bitField0_;
  388. onBuilt();
  389. return result;
  390. }
  391. public Builder mergeFrom(com.google.protobuf.Message other) {
  392. if (other instanceof org.bitcoinj.wallet.Protos.PeerAddress) {
  393. return mergeFrom((org.bitcoinj.wallet.Protos.PeerAddress)other);
  394. } else {
  395. super.mergeFrom(other);
  396. return this;
  397. }
  398. }
  399. public Builder mergeFrom(org.bitcoinj.wallet.Protos.PeerAddress other) {
  400. if (other == org.bitcoinj.wallet.Protos.PeerAddress.getDefaultInstance()) return this;
  401. if (other.hasIpAddress()) {
  402. setIpAddress(other.getIpAddress());
  403. }
  404. if (other.hasPort()) {
  405. setPort(other.getPort());
  406. }
  407. if (other.hasServices()) {
  408. setServices(other.getServices());
  409. }
  410. this.mergeUnknownFields(other.getUnknownFields());
  411. return this;
  412. }
  413. public final boolean isInitialized() {
  414. if (!hasIpAddress()) {
  415. return false;
  416. }
  417. if (!hasPort()) {
  418. return false;
  419. }
  420. if (!hasServices()) {
  421. return false;
  422. }
  423. return true;
  424. }
  425. public Builder mergeFrom(
  426. com.google.protobuf.CodedInputStream input,
  427. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  428. throws java.io.IOException {
  429. org.bitcoinj.wallet.Protos.PeerAddress parsedMessage = null;
  430. try {
  431. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  432. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  433. parsedMessage = (org.bitcoinj.wallet.Protos.PeerAddress) e.getUnfinishedMessage();
  434. throw e;
  435. } finally {
  436. if (parsedMessage != null) {
  437. mergeFrom(parsedMessage);
  438. }
  439. }
  440. return this;
  441. }
  442. private int bitField0_;
  443. // required bytes ip_address = 1;
  444. private com.google.protobuf.ByteString ipAddress_ = com.google.protobuf.ByteString.EMPTY;
  445. /**
  446. * <code>required bytes ip_address = 1;</code>
  447. */
  448. public boolean hasIpAddress() {
  449. return ((bitField0_ & 0x00000001) == 0x00000001);
  450. }
  451. /**
  452. * <code>required bytes ip_address = 1;</code>
  453. */
  454. public com.google.protobuf.ByteString getIpAddress() {
  455. return ipAddress_;
  456. }
  457. /**
  458. * <code>required bytes ip_address = 1;</code>
  459. */
  460. public Builder setIpAddress(com.google.protobuf.ByteString value) {
  461. if (value == null) {
  462. throw new NullPointerException();
  463. }
  464. bitField0_ |= 0x00000001;
  465. ipAddress_ = value;
  466. onChanged();
  467. return this;
  468. }
  469. /**
  470. * <code>required bytes ip_address = 1;</code>
  471. */
  472. public Builder clearIpAddress() {
  473. bitField0_ = (bitField0_ & ~0x00000001);
  474. ipAddress_ = getDefaultInstance().getIpAddress();
  475. onChanged();
  476. return this;
  477. }
  478. // required uint32 port = 2;
  479. private int port_ ;
  480. /**
  481. * <code>required uint32 port = 2;</code>
  482. */
  483. public boolean hasPort() {
  484. return ((bitField0_ & 0x00000002) == 0x00000002);
  485. }
  486. /**
  487. * <code>required uint32 port = 2;</code>
  488. */
  489. public int getPort() {
  490. return port_;
  491. }
  492. /**
  493. * <code>required uint32 port = 2;</code>
  494. */
  495. public Builder setPort(int value) {
  496. bitField0_ |= 0x00000002;
  497. port_ = value;
  498. onChanged();
  499. return this;
  500. }
  501. /**
  502. * <code>required uint32 port = 2;</code>
  503. */
  504. public Builder clearPort() {
  505. bitField0_ = (bitField0_ & ~0x00000002);
  506. port_ = 0;
  507. onChanged();
  508. return this;
  509. }
  510. // required uint64 services = 3;
  511. private long services_ ;
  512. /**
  513. * <code>required uint64 services = 3;</code>
  514. */
  515. public boolean hasServices() {
  516. return ((bitField0_ & 0x00000004) == 0x00000004);
  517. }
  518. /**
  519. * <code>required uint64 services = 3;</code>
  520. */
  521. public long getServices() {
  522. return services_;
  523. }
  524. /**
  525. * <code>required uint64 services = 3;</code>
  526. */
  527. public Builder setServices(long value) {
  528. bitField0_ |= 0x00000004;
  529. services_ = value;
  530. onChanged();
  531. return this;
  532. }
  533. /**
  534. * <code>required uint64 services = 3;</code>
  535. */
  536. public Builder clearServices() {
  537. bitField0_ = (bitField0_ & ~0x00000004);
  538. services_ = 0L;
  539. onChanged();
  540. return this;
  541. }
  542. // @@protoc_insertion_point(builder_scope:wallet.PeerAddress)
  543. }
  544. static {
  545. defaultInstance = new PeerAddress(true);
  546. defaultInstance.initFields();
  547. }
  548. // @@protoc_insertion_point(class_scope:wallet.PeerAddress)
  549. }
  550. public interface EncryptedPrivateKeyOrBuilder
  551. extends com.google.protobuf.MessageOrBuilder {
  552. // required bytes initialisation_vector = 1;
  553. /**
  554. * <code>required bytes initialisation_vector = 1;</code>
  555. *
  556. * <pre>
  557. * The initialisation vector for the AES encryption (16 bytes)
  558. * </pre>
  559. */
  560. boolean hasInitialisationVector();
  561. /**
  562. * <code>required bytes initialisation_vector = 1;</code>
  563. *
  564. * <pre>
  565. * The initialisation vector for the AES encryption (16 bytes)
  566. * </pre>
  567. */
  568. com.google.protobuf.ByteString getInitialisationVector();
  569. // required bytes encrypted_private_key = 2;
  570. /**
  571. * <code>required bytes encrypted_private_key = 2;</code>
  572. *
  573. * <pre>
  574. * The encrypted private key
  575. * </pre>
  576. */
  577. boolean hasEncryptedPrivateKey();
  578. /**
  579. * <code>required bytes encrypted_private_key = 2;</code>
  580. *
  581. * <pre>
  582. * The encrypted private key
  583. * </pre>
  584. */
  585. com.google.protobuf.ByteString getEncryptedPrivateKey();
  586. }
  587. /**
  588. * Protobuf type {@code wallet.EncryptedPrivateKey}
  589. *
  590. * <pre>
  591. **
  592. * The data to store a private key encrypted with Scrypt and AES
  593. * </pre>
  594. */
  595. public static final class EncryptedPrivateKey extends
  596. com.google.protobuf.GeneratedMessage
  597. implements EncryptedPrivateKeyOrBuilder {
  598. // Use EncryptedPrivateKey.newBuilder() to construct.
  599. private EncryptedPrivateKey(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  600. super(builder);
  601. this.unknownFields = builder.getUnknownFields();
  602. }
  603. private EncryptedPrivateKey(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  604. private static final EncryptedPrivateKey defaultInstance;
  605. public static EncryptedPrivateKey getDefaultInstance() {
  606. return defaultInstance;
  607. }
  608. public EncryptedPrivateKey getDefaultInstanceForType() {
  609. return defaultInstance;
  610. }
  611. private final com.google.protobuf.UnknownFieldSet unknownFields;
  612. @java.lang.Override
  613. public final com.google.protobuf.UnknownFieldSet
  614. getUnknownFields() {
  615. return this.unknownFields;
  616. }
  617. private EncryptedPrivateKey(
  618. com.google.protobuf.CodedInputStream input,
  619. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  620. throws com.google.protobuf.InvalidProtocolBufferException {
  621. initFields();
  622. int mutable_bitField0_ = 0;
  623. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  624. com.google.protobuf.UnknownFieldSet.newBuilder();
  625. try {
  626. boolean done = false;
  627. while (!done) {
  628. int tag = input.readTag();
  629. switch (tag) {
  630. case 0:
  631. done = true;
  632. break;
  633. default: {
  634. if (!parseUnknownField(input, unknownFields,
  635. extensionRegistry, tag)) {
  636. done = true;
  637. }
  638. break;
  639. }
  640. case 10: {
  641. bitField0_ |= 0x00000001;
  642. initialisationVector_ = input.readBytes();
  643. break;
  644. }
  645. case 18: {
  646. bitField0_ |= 0x00000002;
  647. encryptedPrivateKey_ = input.readBytes();
  648. break;
  649. }
  650. }
  651. }
  652. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  653. throw e.setUnfinishedMessage(this);
  654. } catch (java.io.IOException e) {
  655. throw new com.google.protobuf.InvalidProtocolBufferException(
  656. e.getMessage()).setUnfinishedMessage(this);
  657. } finally {
  658. this.unknownFields = unknownFields.build();
  659. makeExtensionsImmutable();
  660. }
  661. }
  662. public static final com.google.protobuf.Descriptors.Descriptor
  663. getDescriptor() {
  664. return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedPrivateKey_descriptor;
  665. }
  666. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  667. internalGetFieldAccessorTable() {
  668. return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedPrivateKey_fieldAccessorTable
  669. .ensureFieldAccessorsInitialized(
  670. org.bitcoinj.wallet.Protos.EncryptedPrivateKey.class, org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder.class);
  671. }
  672. public static com.google.protobuf.Parser<EncryptedPrivateKey> PARSER =
  673. new com.google.protobuf.AbstractParser<EncryptedPrivateKey>() {
  674. public EncryptedPrivateKey parsePartialFrom(
  675. com.google.protobuf.CodedInputStream input,
  676. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  677. throws com.google.protobuf.InvalidProtocolBufferException {
  678. return new EncryptedPrivateKey(input, extensionRegistry);
  679. }
  680. };
  681. @java.lang.Override
  682. public com.google.protobuf.Parser<EncryptedPrivateKey> getParserForType() {
  683. return PARSER;
  684. }
  685. private int bitField0_;
  686. // required bytes initialisation_vector = 1;
  687. public static final int INITIALISATION_VECTOR_FIELD_NUMBER = 1;
  688. private com.google.protobuf.ByteString initialisationVector_;
  689. /**
  690. * <code>required bytes initialisation_vector = 1;</code>
  691. *
  692. * <pre>
  693. * The initialisation vector for the AES encryption (16 bytes)
  694. * </pre>
  695. */
  696. public boolean hasInitialisationVector() {
  697. return ((bitField0_ & 0x00000001) == 0x00000001);
  698. }
  699. /**
  700. * <code>required bytes initialisation_vector = 1;</code>
  701. *
  702. * <pre>
  703. * The initialisation vector for the AES encryption (16 bytes)
  704. * </pre>
  705. */
  706. public com.google.protobuf.ByteString getInitialisationVector() {
  707. return initialisationVector_;
  708. }
  709. // required bytes encrypted_private_key = 2;
  710. public static final int ENCRYPTED_PRIVATE_KEY_FIELD_NUMBER = 2;
  711. private com.google.protobuf.ByteString encryptedPrivateKey_;
  712. /**
  713. * <code>required bytes encrypted_private_key = 2;</code>
  714. *
  715. * <pre>
  716. * The encrypted private key
  717. * </pre>
  718. */
  719. public boolean hasEncryptedPrivateKey() {
  720. return ((bitField0_ & 0x00000002) == 0x00000002);
  721. }
  722. /**
  723. * <code>required bytes encrypted_private_key = 2;</code>
  724. *
  725. * <pre>
  726. * The encrypted private key
  727. * </pre>
  728. */
  729. public com.google.protobuf.ByteString getEncryptedPrivateKey() {
  730. return encryptedPrivateKey_;
  731. }
  732. private void initFields() {
  733. initialisationVector_ = com.google.protobuf.ByteString.EMPTY;
  734. encryptedPrivateKey_ = com.google.protobuf.ByteString.EMPTY;
  735. }
  736. private byte memoizedIsInitialized = -1;
  737. public final boolean isInitialized() {
  738. byte isInitialized = memoizedIsInitialized;
  739. if (isInitialized != -1) return isInitialized == 1;
  740. if (!hasInitialisationVector()) {
  741. memoizedIsInitialized = 0;
  742. return false;
  743. }
  744. if (!hasEncryptedPrivateKey()) {
  745. memoizedIsInitialized = 0;
  746. return false;
  747. }
  748. memoizedIsInitialized = 1;
  749. return true;
  750. }
  751. public void writeTo(com.google.protobuf.CodedOutputStream output)
  752. throws java.io.IOException {
  753. getSerializedSize();
  754. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  755. output.writeBytes(1, initialisationVector_);
  756. }
  757. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  758. output.writeBytes(2, encryptedPrivateKey_);
  759. }
  760. getUnknownFields().writeTo(output);
  761. }
  762. private int memoizedSerializedSize = -1;
  763. public int getSerializedSize() {
  764. int size = memoizedSerializedSize;
  765. if (size != -1) return size;
  766. size = 0;
  767. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  768. size += com.google.protobuf.CodedOutputStream
  769. .computeBytesSize(1, initialisationVector_);
  770. }
  771. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  772. size += com.google.protobuf.CodedOutputStream
  773. .computeBytesSize(2, encryptedPrivateKey_);
  774. }
  775. size += getUnknownFields().getSerializedSize();
  776. memoizedSerializedSize = size;
  777. return size;
  778. }
  779. private static final long serialVersionUID = 0L;
  780. @java.lang.Override
  781. protected java.lang.Object writeReplace()
  782. throws java.io.ObjectStreamException {
  783. return super.writeReplace();
  784. }
  785. public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom(
  786. com.google.protobuf.ByteString data)
  787. throws com.google.protobuf.InvalidProtocolBufferException {
  788. return PARSER.parseFrom(data);
  789. }
  790. public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom(
  791. com.google.protobuf.ByteString data,
  792. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  793. throws com.google.protobuf.InvalidProtocolBufferException {
  794. return PARSER.parseFrom(data, extensionRegistry);
  795. }
  796. public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom(byte[] data)
  797. throws com.google.protobuf.InvalidProtocolBufferException {
  798. return PARSER.parseFrom(data);
  799. }
  800. public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom(
  801. byte[] data,
  802. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  803. throws com.google.protobuf.InvalidProtocolBufferException {
  804. return PARSER.parseFrom(data, extensionRegistry);
  805. }
  806. public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom(java.io.InputStream input)
  807. throws java.io.IOException {
  808. return PARSER.parseFrom(input);
  809. }
  810. public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom(
  811. java.io.InputStream input,
  812. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  813. throws java.io.IOException {
  814. return PARSER.parseFrom(input, extensionRegistry);
  815. }
  816. public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseDelimitedFrom(java.io.InputStream input)
  817. throws java.io.IOException {
  818. return PARSER.parseDelimitedFrom(input);
  819. }
  820. public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseDelimitedFrom(
  821. java.io.InputStream input,
  822. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  823. throws java.io.IOException {
  824. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  825. }
  826. public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom(
  827. com.google.protobuf.CodedInputStream input)
  828. throws java.io.IOException {
  829. return PARSER.parseFrom(input);
  830. }
  831. public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom(
  832. com.google.protobuf.CodedInputStream input,
  833. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  834. throws java.io.IOException {
  835. return PARSER.parseFrom(input, extensionRegistry);
  836. }
  837. public static Builder newBuilder() { return Builder.create(); }
  838. public Builder newBuilderForType() { return newBuilder(); }
  839. public static Builder newBuilder(org.bitcoinj.wallet.Protos.EncryptedPrivateKey prototype) {
  840. return newBuilder().mergeFrom(prototype);
  841. }
  842. public Builder toBuilder() { return newBuilder(this); }
  843. @java.lang.Override
  844. protected Builder newBuilderForType(
  845. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  846. Builder builder = new Builder(parent);
  847. return builder;
  848. }
  849. /**
  850. * Protobuf type {@code wallet.EncryptedPrivateKey}
  851. *
  852. * <pre>
  853. **
  854. * The data to store a private key encrypted with Scrypt and AES
  855. * </pre>
  856. */
  857. public static final class Builder extends
  858. com.google.protobuf.GeneratedMessage.Builder<Builder>
  859. implements org.bitcoinj.wallet.Protos.EncryptedPrivateKeyOrBuilder {
  860. public static final com.google.protobuf.Descriptors.Descriptor
  861. getDescriptor() {
  862. return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedPrivateKey_descriptor;
  863. }
  864. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  865. internalGetFieldAccessorTable() {
  866. return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedPrivateKey_fieldAccessorTable
  867. .ensureFieldAccessorsInitialized(
  868. org.bitcoinj.wallet.Protos.EncryptedPrivateKey.class, org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder.class);
  869. }
  870. // Construct using org.bitcoinj.wallet.Protos.EncryptedPrivateKey.newBuilder()
  871. private Builder() {
  872. maybeForceBuilderInitialization();
  873. }
  874. private Builder(
  875. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  876. super(parent);
  877. maybeForceBuilderInitialization();
  878. }
  879. private void maybeForceBuilderInitialization() {
  880. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  881. }
  882. }
  883. private static Builder create() {
  884. return new Builder();
  885. }
  886. public Builder clear() {
  887. super.clear();
  888. initialisationVector_ = com.google.protobuf.ByteString.EMPTY;
  889. bitField0_ = (bitField0_ & ~0x00000001);
  890. encryptedPrivateKey_ = com.google.protobuf.ByteString.EMPTY;
  891. bitField0_ = (bitField0_ & ~0x00000002);
  892. return this;
  893. }
  894. public Builder clone() {
  895. return create().mergeFrom(buildPartial());
  896. }
  897. public com.google.protobuf.Descriptors.Descriptor
  898. getDescriptorForType() {
  899. return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedPrivateKey_descriptor;
  900. }
  901. public org.bitcoinj.wallet.Protos.EncryptedPrivateKey getDefaultInstanceForType() {
  902. return org.bitcoinj.wallet.Protos.EncryptedPrivateKey.getDefaultInstance();
  903. }
  904. public org.bitcoinj.wallet.Protos.EncryptedPrivateKey build() {
  905. org.bitcoinj.wallet.Protos.EncryptedPrivateKey result = buildPartial();
  906. if (!result.isInitialized()) {
  907. throw newUninitializedMessageException(result);
  908. }
  909. return result;
  910. }
  911. public org.bitcoinj.wallet.Protos.EncryptedPrivateKey buildPartial() {
  912. org.bitcoinj.wallet.Protos.EncryptedPrivateKey result = new org.bitcoinj.wallet.Protos.EncryptedPrivateKey(this);
  913. int from_bitField0_ = bitField0_;
  914. int to_bitField0_ = 0;
  915. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  916. to_bitField0_ |= 0x00000001;
  917. }
  918. result.initialisationVector_ = initialisationVector_;
  919. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  920. to_bitField0_ |= 0x00000002;
  921. }
  922. result.encryptedPrivateKey_ = encryptedPrivateKey_;
  923. result.bitField0_ = to_bitField0_;
  924. onBuilt();
  925. return result;
  926. }
  927. public Builder mergeFrom(com.google.protobuf.Message other) {
  928. if (other instanceof org.bitcoinj.wallet.Protos.EncryptedPrivateKey) {
  929. return mergeFrom((org.bitcoinj.wallet.Protos.EncryptedPrivateKey)other);
  930. } else {
  931. super.mergeFrom(other);
  932. return this;
  933. }
  934. }
  935. public Builder mergeFrom(org.bitcoinj.wallet.Protos.EncryptedPrivateKey other) {
  936. if (other == org.bitcoinj.wallet.Protos.EncryptedPrivateKey.getDefaultInstance()) return this;
  937. if (other.hasInitialisationVector()) {
  938. setInitialisationVector(other.getInitialisationVector());
  939. }
  940. if (other.hasEncryptedPrivateKey()) {
  941. setEncryptedPrivateKey(other.getEncryptedPrivateKey());
  942. }
  943. this.mergeUnknownFields(other.getUnknownFields());
  944. return this;
  945. }
  946. public final boolean isInitialized() {
  947. if (!hasInitialisationVector()) {
  948. return false;
  949. }
  950. if (!hasEncryptedPrivateKey()) {
  951. return false;
  952. }
  953. return true;
  954. }
  955. public Builder mergeFrom(
  956. com.google.protobuf.CodedInputStream input,
  957. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  958. throws java.io.IOException {
  959. org.bitcoinj.wallet.Protos.EncryptedPrivateKey parsedMessage = null;
  960. try {
  961. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  962. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  963. parsedMessage = (org.bitcoinj.wallet.Protos.EncryptedPrivateKey) e.getUnfinishedMessage();
  964. throw e;
  965. } finally {
  966. if (parsedMessage != null) {
  967. mergeFrom(parsedMessage);
  968. }
  969. }
  970. return this;
  971. }
  972. private int bitField0_;
  973. // required bytes initialisation_vector = 1;
  974. private com.google.protobuf.ByteString initialisationVector_ = com.google.protobuf.ByteString.EMPTY;
  975. /**
  976. * <code>required bytes initialisation_vector = 1;</code>
  977. *
  978. * <pre>
  979. * The initialisation vector for the AES encryption (16 bytes)
  980. * </pre>
  981. */
  982. public boolean hasInitialisationVector() {
  983. return ((bitField0_ & 0x00000001) == 0x00000001);
  984. }
  985. /**
  986. * <code>required bytes initialisation_vector = 1;</code>
  987. *
  988. * <pre>
  989. * The initialisation vector for the AES encryption (16 bytes)
  990. * </pre>
  991. */
  992. public com.google.protobuf.ByteString getInitialisationVector() {
  993. return initialisationVector_;
  994. }
  995. /**
  996. * <code>required bytes initialisation_vector = 1;</code>
  997. *
  998. * <pre>
  999. * The initialisation vector for the AES encryption (16 bytes)
  1000. * </pre>
  1001. */
  1002. public Builder setInitialisationVector(com.google.protobuf.ByteString value) {
  1003. if (value == null) {
  1004. throw new NullPointerException();
  1005. }
  1006. bitField0_ |= 0x00000001;
  1007. initialisationVector_ = value;
  1008. onChanged();
  1009. return this;
  1010. }
  1011. /**
  1012. * <code>required bytes initialisation_vector = 1;</code>
  1013. *
  1014. * <pre>
  1015. * The initialisation vector for the AES encryption (16 bytes)
  1016. * </pre>
  1017. */
  1018. public Builder clearInitialisationVector() {
  1019. bitField0_ = (bitField0_ & ~0x00000001);
  1020. initialisationVector_ = getDefaultInstance().getInitialisationVector();
  1021. onChanged();
  1022. return this;
  1023. }
  1024. // required bytes encrypted_private_key = 2;
  1025. private com.google.protobuf.ByteString encryptedPrivateKey_ = com.google.protobuf.ByteString.EMPTY;
  1026. /**
  1027. * <code>required bytes encrypted_private_key = 2;</code>
  1028. *
  1029. * <pre>
  1030. * The encrypted private key
  1031. * </pre>
  1032. */
  1033. public boolean hasEncryptedPrivateKey() {
  1034. return ((bitField0_ & 0x00000002) == 0x00000002);
  1035. }
  1036. /**
  1037. * <code>required bytes encrypted_private_key = 2;</code>
  1038. *
  1039. * <pre>
  1040. * The encrypted private key
  1041. * </pre>
  1042. */
  1043. public com.google.protobuf.ByteString getEncryptedPrivateKey() {
  1044. return encryptedPrivateKey_;
  1045. }
  1046. /**
  1047. * <code>required bytes encrypted_private_key = 2;</code>
  1048. *
  1049. * <pre>
  1050. * The encrypted private key
  1051. * </pre>
  1052. */
  1053. public Builder setEncryptedPrivateKey(com.google.protobuf.ByteString value) {
  1054. if (value == null) {
  1055. throw new NullPointerException();
  1056. }
  1057. bitField0_ |= 0x00000002;
  1058. encryptedPrivateKey_ = value;
  1059. onChanged();
  1060. return this;
  1061. }
  1062. /**
  1063. * <code>required bytes encrypted_private_key = 2;</code>
  1064. *
  1065. * <pre>
  1066. * The encrypted private key
  1067. * </pre>
  1068. */
  1069. public Builder clearEncryptedPrivateKey() {
  1070. bitField0_ = (bitField0_ & ~0x00000002);
  1071. encryptedPrivateKey_ = getDefaultInstance().getEncryptedPrivateKey();
  1072. onChanged();
  1073. return this;
  1074. }
  1075. // @@protoc_insertion_point(builder_scope:wallet.EncryptedPrivateKey)
  1076. }
  1077. static {
  1078. defaultInstance = new EncryptedPrivateKey(true);
  1079. defaultInstance.initFields();
  1080. }
  1081. // @@protoc_insertion_point(class_scope:wallet.EncryptedPrivateKey)
  1082. }
  1083. public interface KeyOrBuilder
  1084. extends com.google.protobuf.MessageOrBuilder {
  1085. // required .wallet.Key.Type type = 1;
  1086. /**
  1087. * <code>required .wallet.Key.Type type = 1;</code>
  1088. */
  1089. boolean hasType();
  1090. /**
  1091. * <code>required .wallet.Key.Type type = 1;</code>
  1092. */
  1093. org.bitcoinj.wallet.Protos.Key.Type getType();
  1094. // optional bytes private_key = 2;
  1095. /**
  1096. * <code>optional bytes private_key = 2;</code>
  1097. *
  1098. * <pre>
  1099. * The private EC key bytes without any ASN.1 wrapping.
  1100. * </pre>
  1101. */
  1102. boolean hasPrivateKey();
  1103. /**
  1104. * <code>optional bytes private_key = 2;</code>
  1105. *
  1106. * <pre>
  1107. * The private EC key bytes without any ASN.1 wrapping.
  1108. * </pre>
  1109. */
  1110. com.google.protobuf.ByteString getPrivateKey();
  1111. // optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;
  1112. /**
  1113. * <code>optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;</code>
  1114. *
  1115. * <pre>
  1116. * The message containing the encrypted private EC key information.
  1117. * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
  1118. * This is for security of the private key information.
  1119. * </pre>
  1120. */
  1121. boolean hasEncryptedPrivateKey();
  1122. /**
  1123. * <code>optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;</code>
  1124. *
  1125. * <pre>
  1126. * The message containing the encrypted private EC key information.
  1127. * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
  1128. * This is for security of the private key information.
  1129. * </pre>
  1130. */
  1131. org.bitcoinj.wallet.Protos.EncryptedPrivateKey getEncryptedPrivateKey();
  1132. /**
  1133. * <code>optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;</code>
  1134. *
  1135. * <pre>
  1136. * The message containing the encrypted private EC key information.
  1137. * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
  1138. * This is for security of the private key information.
  1139. * </pre>
  1140. */
  1141. org.bitcoinj.wallet.Protos.EncryptedPrivateKeyOrBuilder getEncryptedPrivateKeyOrBuilder();
  1142. // optional bytes public_key = 3;
  1143. /**
  1144. * <code>optional bytes public_key = 3;</code>
  1145. *
  1146. * <pre>
  1147. * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
  1148. * do lots of slow EC math on startup.
  1149. * </pre>
  1150. */
  1151. boolean hasPublicKey();
  1152. /**
  1153. * <code>optional bytes public_key = 3;</code>
  1154. *
  1155. * <pre>
  1156. * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
  1157. * do lots of slow EC math on startup.
  1158. * </pre>
  1159. */
  1160. com.google.protobuf.ByteString getPublicKey();
  1161. // optional string label = 4;
  1162. /**
  1163. * <code>optional string label = 4;</code>
  1164. *
  1165. * <pre>
  1166. * User-provided label associated with the key.
  1167. * </pre>
  1168. */
  1169. boolean hasLabel();
  1170. /**
  1171. * <code>optional string label = 4;</code>
  1172. *
  1173. * <pre>
  1174. * User-provided label associated with the key.
  1175. * </pre>
  1176. */
  1177. java.lang.String getLabel();
  1178. /**
  1179. * <code>optional string label = 4;</code>
  1180. *
  1181. * <pre>
  1182. * User-provided label associated with the key.
  1183. * </pre>
  1184. */
  1185. com.google.protobuf.ByteString
  1186. getLabelBytes();
  1187. // optional int64 creation_timestamp = 5;
  1188. /**
  1189. * <code>optional int64 creation_timestamp = 5;</code>
  1190. *
  1191. * <pre>
  1192. * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
  1193. * </pre>
  1194. */
  1195. boolean hasCreationTimestamp();
  1196. /**
  1197. * <code>optional int64 creation_timestamp = 5;</code>
  1198. *
  1199. * <pre>
  1200. * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
  1201. * </pre>
  1202. */
  1203. long getCreationTimestamp();
  1204. }
  1205. /**
  1206. * Protobuf type {@code wallet.Key}
  1207. *
  1208. * <pre>
  1209. **
  1210. * A key used to control Bitcoin spending.
  1211. *
  1212. * Either the private key, the public key or both may be present. It is recommended that
  1213. * if the private key is provided that the public key is provided too because deriving it is slow.
  1214. *
  1215. * If only the public key is provided, the key can only be used to watch the blockchain and verify
  1216. * transactions, and not for spending.
  1217. * </pre>
  1218. */
  1219. public static final class Key extends
  1220. com.google.protobuf.GeneratedMessage
  1221. implements KeyOrBuilder {
  1222. // Use Key.newBuilder() to construct.
  1223. private Key(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  1224. super(builder);
  1225. this.unknownFields = builder.getUnknownFields();
  1226. }
  1227. private Key(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  1228. private static final Key defaultInstance;
  1229. public static Key getDefaultInstance() {
  1230. return defaultInstance;
  1231. }
  1232. public Key getDefaultInstanceForType() {
  1233. return defaultInstance;
  1234. }
  1235. private final com.google.protobuf.UnknownFieldSet unknownFields;
  1236. @java.lang.Override
  1237. public final com.google.protobuf.UnknownFieldSet
  1238. getUnknownFields() {
  1239. return this.unknownFields;
  1240. }
  1241. private Key(
  1242. com.google.protobuf.CodedInputStream input,
  1243. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1244. throws com.google.protobuf.InvalidProtocolBufferException {
  1245. initFields();
  1246. int mutable_bitField0_ = 0;
  1247. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  1248. com.google.protobuf.UnknownFieldSet.newBuilder();
  1249. try {
  1250. boolean done = false;
  1251. while (!done) {
  1252. int tag = input.readTag();
  1253. switch (tag) {
  1254. case 0:
  1255. done = true;
  1256. break;
  1257. default: {
  1258. if (!parseUnknownField(input, unknownFields,
  1259. extensionRegistry, tag)) {
  1260. done = true;
  1261. }
  1262. break;
  1263. }
  1264. case 8: {
  1265. int rawValue = input.readEnum();
  1266. org.bitcoinj.wallet.Protos.Key.Type value = org.bitcoinj.wallet.Protos.Key.Type.valueOf(rawValue);
  1267. if (value == null) {
  1268. unknownFields.mergeVarintField(1, rawValue);
  1269. } else {
  1270. bitField0_ |= 0x00000001;
  1271. type_ = value;
  1272. }
  1273. break;
  1274. }
  1275. case 18: {
  1276. bitField0_ |= 0x00000002;
  1277. privateKey_ = input.readBytes();
  1278. break;
  1279. }
  1280. case 26: {
  1281. bitField0_ |= 0x00000008;
  1282. publicKey_ = input.readBytes();
  1283. break;
  1284. }
  1285. case 34: {
  1286. bitField0_ |= 0x00000010;
  1287. label_ = input.readBytes();
  1288. break;
  1289. }
  1290. case 40: {
  1291. bitField0_ |= 0x00000020;
  1292. creationTimestamp_ = input.readInt64();
  1293. break;
  1294. }
  1295. case 50: {
  1296. org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder subBuilder = null;
  1297. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  1298. subBuilder = encryptedPrivateKey_.toBuilder();
  1299. }
  1300. encryptedPrivateKey_ = input.readMessage(org.bitcoinj.wallet.Protos.EncryptedPrivateKey.PARSER, extensionRegistry);
  1301. if (subBuilder != null) {
  1302. subBuilder.mergeFrom(encryptedPrivateKey_);
  1303. encryptedPrivateKey_ = subBuilder.buildPartial();
  1304. }
  1305. bitField0_ |= 0x00000004;
  1306. break;
  1307. }
  1308. }
  1309. }
  1310. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  1311. throw e.setUnfinishedMessage(this);
  1312. } catch (java.io.IOException e) {
  1313. throw new com.google.protobuf.InvalidProtocolBufferException(
  1314. e.getMessage()).setUnfinishedMessage(this);
  1315. } finally {
  1316. this.unknownFields = unknownFields.build();
  1317. makeExtensionsImmutable();
  1318. }
  1319. }
  1320. public static final com.google.protobuf.Descriptors.Descriptor
  1321. getDescriptor() {
  1322. return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_descriptor;
  1323. }
  1324. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  1325. internalGetFieldAccessorTable() {
  1326. return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_fieldAccessorTable
  1327. .ensureFieldAccessorsInitialized(
  1328. org.bitcoinj.wallet.Protos.Key.class, org.bitcoinj.wallet.Protos.Key.Builder.class);
  1329. }
  1330. public static com.google.protobuf.Parser<Key> PARSER =
  1331. new com.google.protobuf.AbstractParser<Key>() {
  1332. public Key parsePartialFrom(
  1333. com.google.protobuf.CodedInputStream input,
  1334. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1335. throws com.google.protobuf.InvalidProtocolBufferException {
  1336. return new Key(input, extensionRegistry);
  1337. }
  1338. };
  1339. @java.lang.Override
  1340. public com.google.protobuf.Parser<Key> getParserForType() {
  1341. return PARSER;
  1342. }
  1343. /**
  1344. * Protobuf enum {@code wallet.Key.Type}
  1345. */
  1346. public enum Type
  1347. implements com.google.protobuf.ProtocolMessageEnum {
  1348. /**
  1349. * <code>ORIGINAL = 1;</code>
  1350. *
  1351. * <pre>
  1352. * Unencrypted - Original bitcoin secp256k1 curve
  1353. * </pre>
  1354. */
  1355. ORIGINAL(0, 1),
  1356. /**
  1357. * <code>ENCRYPTED_SCRYPT_AES = 2;</code>
  1358. *
  1359. * <pre>
  1360. * Encrypted with Scrypt and AES - - Original bitcoin secp256k1 curve
  1361. * </pre>
  1362. */
  1363. ENCRYPTED_SCRYPT_AES(1, 2),
  1364. ;
  1365. /**
  1366. * <code>ORIGINAL = 1;</code>
  1367. *
  1368. * <pre>
  1369. * Unencrypted - Original bitcoin secp256k1 curve
  1370. * </pre>
  1371. */
  1372. public static final int ORIGINAL_VALUE = 1;
  1373. /**
  1374. * <code>ENCRYPTED_SCRYPT_AES = 2;</code>
  1375. *
  1376. * <pre>
  1377. * Encrypted with Scrypt and AES - - Original bitcoin secp256k1 curve
  1378. * </pre>
  1379. */
  1380. public static final int ENCRYPTED_SCRYPT_AES_VALUE = 2;
  1381. public final int getNumber() { return value; }
  1382. public static Type valueOf(int value) {
  1383. switch (value) {
  1384. case 1: return ORIGINAL;
  1385. case 2: return ENCRYPTED_SCRYPT_AES;
  1386. default: return null;
  1387. }
  1388. }
  1389. public static com.google.protobuf.Internal.EnumLiteMap<Type>
  1390. internalGetValueMap() {
  1391. return internalValueMap;
  1392. }
  1393. private static com.google.protobuf.Internal.EnumLiteMap<Type>
  1394. internalValueMap =
  1395. new com.google.protobuf.Internal.EnumLiteMap<Type>() {
  1396. public Type findValueByNumber(int number) {
  1397. return Type.valueOf(number);
  1398. }
  1399. };
  1400. public final com.google.protobuf.Descriptors.EnumValueDescriptor
  1401. getValueDescriptor() {
  1402. return getDescriptor().getValues().get(index);
  1403. }
  1404. public final com.google.protobuf.Descriptors.EnumDescriptor
  1405. getDescriptorForType() {
  1406. return getDescriptor();
  1407. }
  1408. public static final com.google.protobuf.Descriptors.EnumDescriptor
  1409. getDescriptor() {
  1410. return org.bitcoinj.wallet.Protos.Key.getDescriptor().getEnumTypes().get(0);
  1411. }
  1412. private static final Type[] VALUES = values();
  1413. public static Type valueOf(
  1414. com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
  1415. if (desc.getType() != getDescriptor()) {
  1416. throw new java.lang.IllegalArgumentException(
  1417. "EnumValueDescriptor is not for this type.");
  1418. }
  1419. return VALUES[desc.getIndex()];
  1420. }
  1421. private final int index;
  1422. private final int value;
  1423. private Type(int index, int value) {
  1424. this.index = index;
  1425. this.value = value;
  1426. }
  1427. // @@protoc_insertion_point(enum_scope:wallet.Key.Type)
  1428. }
  1429. private int bitField0_;
  1430. // required .wallet.Key.Type type = 1;
  1431. public static final int TYPE_FIELD_NUMBER = 1;
  1432. private org.bitcoinj.wallet.Protos.Key.Type type_;
  1433. /**
  1434. * <code>required .wallet.Key.Type type = 1;</code>
  1435. */
  1436. public boolean hasType() {
  1437. return ((bitField0_ & 0x00000001) == 0x00000001);
  1438. }
  1439. /**
  1440. * <code>required .wallet.Key.Type type = 1;</code>
  1441. */
  1442. public org.bitcoinj.wallet.Protos.Key.Type getType() {
  1443. return type_;
  1444. }
  1445. // optional bytes private_key = 2;
  1446. public static final int PRIVATE_KEY_FIELD_NUMBER = 2;
  1447. private com.google.protobuf.ByteString privateKey_;
  1448. /**
  1449. * <code>optional bytes private_key = 2;</code>
  1450. *
  1451. * <pre>
  1452. * The private EC key bytes without any ASN.1 wrapping.
  1453. * </pre>
  1454. */
  1455. public boolean hasPrivateKey() {
  1456. return ((bitField0_ & 0x00000002) == 0x00000002);
  1457. }
  1458. /**
  1459. * <code>optional bytes private_key = 2;</code>
  1460. *
  1461. * <pre>
  1462. * The private EC key bytes without any ASN.1 wrapping.
  1463. * </pre>
  1464. */
  1465. public com.google.protobuf.ByteString getPrivateKey() {
  1466. return privateKey_;
  1467. }
  1468. // optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;
  1469. public static final int ENCRYPTED_PRIVATE_KEY_FIELD_NUMBER = 6;
  1470. private org.bitcoinj.wallet.Protos.EncryptedPrivateKey encryptedPrivateKey_;
  1471. /**
  1472. * <code>optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;</code>
  1473. *
  1474. * <pre>
  1475. * The message containing the encrypted private EC key information.
  1476. * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
  1477. * This is for security of the private key information.
  1478. * </pre>
  1479. */
  1480. public boolean hasEncryptedPrivateKey() {
  1481. return ((bitField0_ & 0x00000004) == 0x00000004);
  1482. }
  1483. /**
  1484. * <code>optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;</code>
  1485. *
  1486. * <pre>
  1487. * The message containing the encrypted private EC key information.
  1488. * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
  1489. * This is for security of the private key information.
  1490. * </pre>
  1491. */
  1492. public org.bitcoinj.wallet.Protos.EncryptedPrivateKey getEncryptedPrivateKey() {
  1493. return encryptedPrivateKey_;
  1494. }
  1495. /**
  1496. * <code>optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;</code>
  1497. *
  1498. * <pre>
  1499. * The message containing the encrypted private EC key information.
  1500. * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
  1501. * This is for security of the private key information.
  1502. * </pre>
  1503. */
  1504. public org.bitcoinj.wallet.Protos.EncryptedPrivateKeyOrBuilder getEncryptedPrivateKeyOrBuilder() {
  1505. return encryptedPrivateKey_;
  1506. }
  1507. // optional bytes public_key = 3;
  1508. public static final int PUBLIC_KEY_FIELD_NUMBER = 3;
  1509. private com.google.protobuf.ByteString publicKey_;
  1510. /**
  1511. * <code>optional bytes public_key = 3;</code>
  1512. *
  1513. * <pre>
  1514. * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
  1515. * do lots of slow EC math on startup.
  1516. * </pre>
  1517. */
  1518. public boolean hasPublicKey() {
  1519. return ((bitField0_ & 0x00000008) == 0x00000008);
  1520. }
  1521. /**
  1522. * <code>optional bytes public_key = 3;</code>
  1523. *
  1524. * <pre>
  1525. * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
  1526. * do lots of slow EC math on startup.
  1527. * </pre>
  1528. */
  1529. public com.google.protobuf.ByteString getPublicKey() {
  1530. return publicKey_;
  1531. }
  1532. // optional string label = 4;
  1533. public static final int LABEL_FIELD_NUMBER = 4;
  1534. private java.lang.Object label_;
  1535. /**
  1536. * <code>optional string label = 4;</code>
  1537. *
  1538. * <pre>
  1539. * User-provided label associated with the key.
  1540. * </pre>
  1541. */
  1542. public boolean hasLabel() {
  1543. return ((bitField0_ & 0x00000010) == 0x00000010);
  1544. }
  1545. /**
  1546. * <code>optional string label = 4;</code>
  1547. *
  1548. * <pre>
  1549. * User-provided label associated with the key.
  1550. * </pre>
  1551. */
  1552. public java.lang.String getLabel() {
  1553. java.lang.Object ref = label_;
  1554. if (ref instanceof java.lang.String) {
  1555. return (java.lang.String) ref;
  1556. } else {
  1557. com.google.protobuf.ByteString bs =
  1558. (com.google.protobuf.ByteString) ref;
  1559. java.lang.String s = bs.toStringUtf8();
  1560. if (bs.isValidUtf8()) {
  1561. label_ = s;
  1562. }
  1563. return s;
  1564. }
  1565. }
  1566. /**
  1567. * <code>optional string label = 4;</code>
  1568. *
  1569. * <pre>
  1570. * User-provided label associated with the key.
  1571. * </pre>
  1572. */
  1573. public com.google.protobuf.ByteString
  1574. getLabelBytes() {
  1575. java.lang.Object ref = label_;
  1576. if (ref instanceof java.lang.String) {
  1577. com.google.protobuf.ByteString b =
  1578. com.google.protobuf.ByteString.copyFromUtf8(
  1579. (java.lang.String) ref);
  1580. label_ = b;
  1581. return b;
  1582. } else {
  1583. return (com.google.protobuf.ByteString) ref;
  1584. }
  1585. }
  1586. // optional int64 creation_timestamp = 5;
  1587. public static final int CREATION_TIMESTAMP_FIELD_NUMBER = 5;
  1588. private long creationTimestamp_;
  1589. /**
  1590. * <code>optional int64 creation_timestamp = 5;</code>
  1591. *
  1592. * <pre>
  1593. * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
  1594. * </pre>
  1595. */
  1596. public boolean hasCreationTimestamp() {
  1597. return ((bitField0_ & 0x00000020) == 0x00000020);
  1598. }
  1599. /**
  1600. * <code>optional int64 creation_timestamp = 5;</code>
  1601. *
  1602. * <pre>
  1603. * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
  1604. * </pre>
  1605. */
  1606. public long getCreationTimestamp() {
  1607. return creationTimestamp_;
  1608. }
  1609. private void initFields() {
  1610. type_ = org.bitcoinj.wallet.Protos.Key.Type.ORIGINAL;
  1611. privateKey_ = com.google.protobuf.ByteString.EMPTY;
  1612. encryptedPrivateKey_ = org.bitcoinj.wallet.Protos.EncryptedPrivateKey.getDefaultInstance();
  1613. publicKey_ = com.google.protobuf.ByteString.EMPTY;
  1614. label_ = "";
  1615. creationTimestamp_ = 0L;
  1616. }
  1617. private byte memoizedIsInitialized = -1;
  1618. public final boolean isInitialized() {
  1619. byte isInitialized = memoizedIsInitialized;
  1620. if (isInitialized != -1) return isInitialized == 1;
  1621. if (!hasType()) {
  1622. memoizedIsInitialized = 0;
  1623. return false;
  1624. }
  1625. if (hasEncryptedPrivateKey()) {
  1626. if (!getEncryptedPrivateKey().isInitialized()) {
  1627. memoizedIsInitialized = 0;
  1628. return false;
  1629. }
  1630. }
  1631. memoizedIsInitialized = 1;
  1632. return true;
  1633. }
  1634. public void writeTo(com.google.protobuf.CodedOutputStream output)
  1635. throws java.io.IOException {
  1636. getSerializedSize();
  1637. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  1638. output.writeEnum(1, type_.getNumber());
  1639. }
  1640. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  1641. output.writeBytes(2, privateKey_);
  1642. }
  1643. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  1644. output.writeBytes(3, publicKey_);
  1645. }
  1646. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  1647. output.writeBytes(4, getLabelBytes());
  1648. }
  1649. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  1650. output.writeInt64(5, creationTimestamp_);
  1651. }
  1652. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  1653. output.writeMessage(6, encryptedPrivateKey_);
  1654. }
  1655. getUnknownFields().writeTo(output);
  1656. }
  1657. private int memoizedSerializedSize = -1;
  1658. public int getSerializedSize() {
  1659. int size = memoizedSerializedSize;
  1660. if (size != -1) return size;
  1661. size = 0;
  1662. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  1663. size += com.google.protobuf.CodedOutputStream
  1664. .computeEnumSize(1, type_.getNumber());
  1665. }
  1666. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  1667. size += com.google.protobuf.CodedOutputStream
  1668. .computeBytesSize(2, privateKey_);
  1669. }
  1670. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  1671. size += com.google.protobuf.CodedOutputStream
  1672. .computeBytesSize(3, publicKey_);
  1673. }
  1674. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  1675. size += com.google.protobuf.CodedOutputStream
  1676. .computeBytesSize(4, getLabelBytes());
  1677. }
  1678. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  1679. size += com.google.protobuf.CodedOutputStream
  1680. .computeInt64Size(5, creationTimestamp_);
  1681. }
  1682. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  1683. size += com.google.protobuf.CodedOutputStream
  1684. .computeMessageSize(6, encryptedPrivateKey_);
  1685. }
  1686. size += getUnknownFields().getSerializedSize();
  1687. memoizedSerializedSize = size;
  1688. return size;
  1689. }
  1690. private static final long serialVersionUID = 0L;
  1691. @java.lang.Override
  1692. protected java.lang.Object writeReplace()
  1693. throws java.io.ObjectStreamException {
  1694. return super.writeReplace();
  1695. }
  1696. public static org.bitcoinj.wallet.Protos.Key parseFrom(
  1697. com.google.protobuf.ByteString data)
  1698. throws com.google.protobuf.InvalidProtocolBufferException {
  1699. return PARSER.parseFrom(data);
  1700. }
  1701. public static org.bitcoinj.wallet.Protos.Key parseFrom(
  1702. com.google.protobuf.ByteString data,
  1703. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1704. throws com.google.protobuf.InvalidProtocolBufferException {
  1705. return PARSER.parseFrom(data, extensionRegistry);
  1706. }
  1707. public static org.bitcoinj.wallet.Protos.Key parseFrom(byte[] data)
  1708. throws com.google.protobuf.InvalidProtocolBufferException {
  1709. return PARSER.parseFrom(data);
  1710. }
  1711. public static org.bitcoinj.wallet.Protos.Key parseFrom(
  1712. byte[] data,
  1713. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1714. throws com.google.protobuf.InvalidProtocolBufferException {
  1715. return PARSER.parseFrom(data, extensionRegistry);
  1716. }
  1717. public static org.bitcoinj.wallet.Protos.Key parseFrom(java.io.InputStream input)
  1718. throws java.io.IOException {
  1719. return PARSER.parseFrom(input);
  1720. }
  1721. public static org.bitcoinj.wallet.Protos.Key parseFrom(
  1722. java.io.InputStream input,
  1723. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1724. throws java.io.IOException {
  1725. return PARSER.parseFrom(input, extensionRegistry);
  1726. }
  1727. public static org.bitcoinj.wallet.Protos.Key parseDelimitedFrom(java.io.InputStream input)
  1728. throws java.io.IOException {
  1729. return PARSER.parseDelimitedFrom(input);
  1730. }
  1731. public static org.bitcoinj.wallet.Protos.Key parseDelimitedFrom(
  1732. java.io.InputStream input,
  1733. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1734. throws java.io.IOException {
  1735. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  1736. }
  1737. public static org.bitcoinj.wallet.Protos.Key parseFrom(
  1738. com.google.protobuf.CodedInputStream input)
  1739. throws java.io.IOException {
  1740. return PARSER.parseFrom(input);
  1741. }
  1742. public static org.bitcoinj.wallet.Protos.Key parseFrom(
  1743. com.google.protobuf.CodedInputStream input,
  1744. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1745. throws java.io.IOException {
  1746. return PARSER.parseFrom(input, extensionRegistry);
  1747. }
  1748. public static Builder newBuilder() { return Builder.create(); }
  1749. public Builder newBuilderForType() { return newBuilder(); }
  1750. public static Builder newBuilder(org.bitcoinj.wallet.Protos.Key prototype) {
  1751. return newBuilder().mergeFrom(prototype);
  1752. }
  1753. public Builder toBuilder() { return newBuilder(this); }
  1754. @java.lang.Override
  1755. protected Builder newBuilderForType(
  1756. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  1757. Builder builder = new Builder(parent);
  1758. return builder;
  1759. }
  1760. /**
  1761. * Protobuf type {@code wallet.Key}
  1762. *
  1763. * <pre>
  1764. **
  1765. * A key used to control Bitcoin spending.
  1766. *
  1767. * Either the private key, the public key or both may be present. It is recommended that
  1768. * if the private key is provided that the public key is provided too because deriving it is slow.
  1769. *
  1770. * If only the public key is provided, the key can only be used to watch the blockchain and verify
  1771. * transactions, and not for spending.
  1772. * </pre>
  1773. */
  1774. public static final class Builder extends
  1775. com.google.protobuf.GeneratedMessage.Builder<Builder>
  1776. implements org.bitcoinj.wallet.Protos.KeyOrBuilder {
  1777. public static final com.google.protobuf.Descriptors.Descriptor
  1778. getDescriptor() {
  1779. return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_descriptor;
  1780. }
  1781. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  1782. internalGetFieldAccessorTable() {
  1783. return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_fieldAccessorTable
  1784. .ensureFieldAccessorsInitialized(
  1785. org.bitcoinj.wallet.Protos.Key.class, org.bitcoinj.wallet.Protos.Key.Builder.class);
  1786. }
  1787. // Construct using org.bitcoinj.wallet.Protos.Key.newBuilder()
  1788. private Builder() {
  1789. maybeForceBuilderInitialization();
  1790. }
  1791. private Builder(
  1792. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  1793. super(parent);
  1794. maybeForceBuilderInitialization();
  1795. }
  1796. private void maybeForceBuilderInitialization() {
  1797. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  1798. getEncryptedPrivateKeyFieldBuilder();
  1799. }
  1800. }
  1801. private static Builder create() {
  1802. return new Builder();
  1803. }
  1804. public Builder clear() {
  1805. super.clear();
  1806. type_ = org.bitcoinj.wallet.Protos.Key.Type.ORIGINAL;
  1807. bitField0_ = (bitField0_ & ~0x00000001);
  1808. privateKey_ = com.google.protobuf.ByteString.EMPTY;
  1809. bitField0_ = (bitField0_ & ~0x00000002);
  1810. if (encryptedPrivateKeyBuilder_ == null) {
  1811. encryptedPrivateKey_ = org.bitcoinj.wallet.Protos.EncryptedPrivateKey.getDefaultInstance();
  1812. } else {
  1813. encryptedPrivateKeyBuilder_.clear();
  1814. }
  1815. bitField0_ = (bitField0_ & ~0x00000004);
  1816. publicKey_ = com.google.protobuf.ByteString.EMPTY;
  1817. bitField0_ = (bitField0_ & ~0x00000008);
  1818. label_ = "";
  1819. bitField0_ = (bitField0_ & ~0x00000010);
  1820. creationTimestamp_ = 0L;
  1821. bitField0_ = (bitField0_ & ~0x00000020);
  1822. return this;
  1823. }
  1824. public Builder clone() {
  1825. return create().mergeFrom(buildPartial());
  1826. }
  1827. public com.google.protobuf.Descriptors.Descriptor
  1828. getDescriptorForType() {
  1829. return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_descriptor;
  1830. }
  1831. public org.bitcoinj.wallet.Protos.Key getDefaultInstanceForType() {
  1832. return org.bitcoinj.wallet.Protos.Key.getDefaultInstance();
  1833. }
  1834. public org.bitcoinj.wallet.Protos.Key build() {
  1835. org.bitcoinj.wallet.Protos.Key result = buildPartial();
  1836. if (!result.isInitialized()) {
  1837. throw newUninitializedMessageException(result);
  1838. }
  1839. return result;
  1840. }
  1841. public org.bitcoinj.wallet.Protos.Key buildPartial() {
  1842. org.bitcoinj.wallet.Protos.Key result = new org.bitcoinj.wallet.Protos.Key(this);
  1843. int from_bitField0_ = bitField0_;
  1844. int to_bitField0_ = 0;
  1845. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  1846. to_bitField0_ |= 0x00000001;
  1847. }
  1848. result.type_ = type_;
  1849. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  1850. to_bitField0_ |= 0x00000002;
  1851. }
  1852. result.privateKey_ = privateKey_;
  1853. if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
  1854. to_bitField0_ |= 0x00000004;
  1855. }
  1856. if (encryptedPrivateKeyBuilder_ == null) {
  1857. result.encryptedPrivateKey_ = encryptedPrivateKey_;
  1858. } else {
  1859. result.encryptedPrivateKey_ = encryptedPrivateKeyBuilder_.build();
  1860. }
  1861. if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
  1862. to_bitField0_ |= 0x00000008;
  1863. }
  1864. result.publicKey_ = publicKey_;
  1865. if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
  1866. to_bitField0_ |= 0x00000010;
  1867. }
  1868. result.label_ = label_;
  1869. if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
  1870. to_bitField0_ |= 0x00000020;
  1871. }
  1872. result.creationTimestamp_ = creationTimestamp_;
  1873. result.bitField0_ = to_bitField0_;
  1874. onBuilt();
  1875. return result;
  1876. }
  1877. public Builder mergeFrom(com.google.protobuf.Message other) {
  1878. if (other instanceof org.bitcoinj.wallet.Protos.Key) {
  1879. return mergeFrom((org.bitcoinj.wallet.Protos.Key)other);
  1880. } else {
  1881. super.mergeFrom(other);
  1882. return this;
  1883. }
  1884. }
  1885. public Builder mergeFrom(org.bitcoinj.wallet.Protos.Key other) {
  1886. if (other == org.bitcoinj.wallet.Protos.Key.getDefaultInstance()) return this;
  1887. if (other.hasType()) {
  1888. setType(other.getType());
  1889. }
  1890. if (other.hasPrivateKey()) {
  1891. setPrivateKey(other.getPrivateKey());
  1892. }
  1893. if (other.hasEncryptedPrivateKey()) {
  1894. mergeEncryptedPrivateKey(other.getEncryptedPrivateKey());
  1895. }
  1896. if (other.hasPublicKey()) {
  1897. setPublicKey(other.getPublicKey());
  1898. }
  1899. if (other.hasLabel()) {
  1900. bitField0_ |= 0x00000010;
  1901. label_ = other.label_;
  1902. onChanged();
  1903. }
  1904. if (other.hasCreationTimestamp()) {
  1905. setCreationTimestamp(other.getCreationTimestamp());
  1906. }
  1907. this.mergeUnknownFields(other.getUnknownFields());
  1908. return this;
  1909. }
  1910. public final boolean isInitialized() {
  1911. if (!hasType()) {
  1912. return false;
  1913. }
  1914. if (hasEncryptedPrivateKey()) {
  1915. if (!getEncryptedPrivateKey().isInitialized()) {
  1916. return false;
  1917. }
  1918. }
  1919. return true;
  1920. }
  1921. public Builder mergeFrom(
  1922. com.google.protobuf.CodedInputStream input,
  1923. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1924. throws java.io.IOException {
  1925. org.bitcoinj.wallet.Protos.Key parsedMessage = null;
  1926. try {
  1927. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  1928. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  1929. parsedMessage = (org.bitcoinj.wallet.Protos.Key) e.getUnfinishedMessage();
  1930. throw e;
  1931. } finally {
  1932. if (parsedMessage != null) {
  1933. mergeFrom(parsedMessage);
  1934. }
  1935. }
  1936. return this;
  1937. }
  1938. private int bitField0_;
  1939. // required .wallet.Key.Type type = 1;
  1940. private org.bitcoinj.wallet.Protos.Key.Type type_ = org.bitcoinj.wallet.Protos.Key.Type.ORIGINAL;
  1941. /**
  1942. * <code>required .wallet.Key.Type type = 1;</code>
  1943. */
  1944. public boolean hasType() {
  1945. return ((bitField0_ & 0x00000001) == 0x00000001);
  1946. }
  1947. /**
  1948. * <code>required .wallet.Key.Type type = 1;</code>
  1949. */
  1950. public org.bitcoinj.wallet.Protos.Key.Type getType() {
  1951. return type_;
  1952. }
  1953. /**
  1954. * <code>required .wallet.Key.Type type = 1;</code>
  1955. */
  1956. public Builder setType(org.bitcoinj.wallet.Protos.Key.Type value) {
  1957. if (value == null) {
  1958. throw new NullPointerException();
  1959. }
  1960. bitField0_ |= 0x00000001;
  1961. type_ = value;
  1962. onChanged();
  1963. return this;
  1964. }
  1965. /**
  1966. * <code>required .wallet.Key.Type type = 1;</code>
  1967. */
  1968. public Builder clearType() {
  1969. bitField0_ = (bitField0_ & ~0x00000001);
  1970. type_ = org.bitcoinj.wallet.Protos.Key.Type.ORIGINAL;
  1971. onChanged();
  1972. return this;
  1973. }
  1974. // optional bytes private_key = 2;
  1975. private com.google.protobuf.ByteString privateKey_ = com.google.protobuf.ByteString.EMPTY;
  1976. /**
  1977. * <code>optional bytes private_key = 2;</code>
  1978. *
  1979. * <pre>
  1980. * The private EC key bytes without any ASN.1 wrapping.
  1981. * </pre>
  1982. */
  1983. public boolean hasPrivateKey() {
  1984. return ((bitField0_ & 0x00000002) == 0x00000002);
  1985. }
  1986. /**
  1987. * <code>optional bytes private_key = 2;</code>
  1988. *
  1989. * <pre>
  1990. * The private EC key bytes without any ASN.1 wrapping.
  1991. * </pre>
  1992. */
  1993. public com.google.protobuf.ByteString getPrivateKey() {
  1994. return privateKey_;
  1995. }
  1996. /**
  1997. * <code>optional bytes private_key = 2;</code>
  1998. *
  1999. * <pre>
  2000. * The private EC key bytes without any ASN.1 wrapping.
  2001. * </pre>
  2002. */
  2003. public Builder setPrivateKey(com.google.protobuf.ByteString value) {
  2004. if (value == null) {
  2005. throw new NullPointerException();
  2006. }
  2007. bitField0_ |= 0x00000002;
  2008. privateKey_ = value;
  2009. onChanged();
  2010. return this;
  2011. }
  2012. /**
  2013. * <code>optional bytes private_key = 2;</code>
  2014. *
  2015. * <pre>
  2016. * The private EC key bytes without any ASN.1 wrapping.
  2017. * </pre>
  2018. */
  2019. public Builder clearPrivateKey() {
  2020. bitField0_ = (bitField0_ & ~0x00000002);
  2021. privateKey_ = getDefaultInstance().getPrivateKey();
  2022. onChanged();
  2023. return this;
  2024. }
  2025. // optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;
  2026. private org.bitcoinj.wallet.Protos.EncryptedPrivateKey encryptedPrivateKey_ = org.bitcoinj.wallet.Protos.EncryptedPrivateKey.getDefaultInstance();
  2027. private com.google.protobuf.SingleFieldBuilder<
  2028. org.bitcoinj.wallet.Protos.EncryptedPrivateKey, org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder, org.bitcoinj.wallet.Protos.EncryptedPrivateKeyOrBuilder> encryptedPrivateKeyBuilder_;
  2029. /**
  2030. * <code>optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;</code>
  2031. *
  2032. * <pre>
  2033. * The message containing the encrypted private EC key information.
  2034. * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
  2035. * This is for security of the private key information.
  2036. * </pre>
  2037. */
  2038. public boolean hasEncryptedPrivateKey() {
  2039. return ((bitField0_ & 0x00000004) == 0x00000004);
  2040. }
  2041. /**
  2042. * <code>optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;</code>
  2043. *
  2044. * <pre>
  2045. * The message containing the encrypted private EC key information.
  2046. * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
  2047. * This is for security of the private key information.
  2048. * </pre>
  2049. */
  2050. public org.bitcoinj.wallet.Protos.EncryptedPrivateKey getEncryptedPrivateKey() {
  2051. if (encryptedPrivateKeyBuilder_ == null) {
  2052. return encryptedPrivateKey_;
  2053. } else {
  2054. return encryptedPrivateKeyBuilder_.getMessage();
  2055. }
  2056. }
  2057. /**
  2058. * <code>optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;</code>
  2059. *
  2060. * <pre>
  2061. * The message containing the encrypted private EC key information.
  2062. * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
  2063. * This is for security of the private key information.
  2064. * </pre>
  2065. */
  2066. public Builder setEncryptedPrivateKey(org.bitcoinj.wallet.Protos.EncryptedPrivateKey value) {
  2067. if (encryptedPrivateKeyBuilder_ == null) {
  2068. if (value == null) {
  2069. throw new NullPointerException();
  2070. }
  2071. encryptedPrivateKey_ = value;
  2072. onChanged();
  2073. } else {
  2074. encryptedPrivateKeyBuilder_.setMessage(value);
  2075. }
  2076. bitField0_ |= 0x00000004;
  2077. return this;
  2078. }
  2079. /**
  2080. * <code>optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;</code>
  2081. *
  2082. * <pre>
  2083. * The message containing the encrypted private EC key information.
  2084. * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
  2085. * This is for security of the private key information.
  2086. * </pre>
  2087. */
  2088. public Builder setEncryptedPrivateKey(
  2089. org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder builderForValue) {
  2090. if (encryptedPrivateKeyBuilder_ == null) {
  2091. encryptedPrivateKey_ = builderForValue.build();
  2092. onChanged();
  2093. } else {
  2094. encryptedPrivateKeyBuilder_.setMessage(builderForValue.build());
  2095. }
  2096. bitField0_ |= 0x00000004;
  2097. return this;
  2098. }
  2099. /**
  2100. * <code>optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;</code>
  2101. *
  2102. * <pre>
  2103. * The message containing the encrypted private EC key information.
  2104. * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
  2105. * This is for security of the private key information.
  2106. * </pre>
  2107. */
  2108. public Builder mergeEncryptedPrivateKey(org.bitcoinj.wallet.Protos.EncryptedPrivateKey value) {
  2109. if (encryptedPrivateKeyBuilder_ == null) {
  2110. if (((bitField0_ & 0x00000004) == 0x00000004) &&
  2111. encryptedPrivateKey_ != org.bitcoinj.wallet.Protos.EncryptedPrivateKey.getDefaultInstance()) {
  2112. encryptedPrivateKey_ =
  2113. org.bitcoinj.wallet.Protos.EncryptedPrivateKey.newBuilder(encryptedPrivateKey_).mergeFrom(value).buildPartial();
  2114. } else {
  2115. encryptedPrivateKey_ = value;
  2116. }
  2117. onChanged();
  2118. } else {
  2119. encryptedPrivateKeyBuilder_.mergeFrom(value);
  2120. }
  2121. bitField0_ |= 0x00000004;
  2122. return this;
  2123. }
  2124. /**
  2125. * <code>optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;</code>
  2126. *
  2127. * <pre>
  2128. * The message containing the encrypted private EC key information.
  2129. * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
  2130. * This is for security of the private key information.
  2131. * </pre>
  2132. */
  2133. public Builder clearEncryptedPrivateKey() {
  2134. if (encryptedPrivateKeyBuilder_ == null) {
  2135. encryptedPrivateKey_ = org.bitcoinj.wallet.Protos.EncryptedPrivateKey.getDefaultInstance();
  2136. onChanged();
  2137. } else {
  2138. encryptedPrivateKeyBuilder_.clear();
  2139. }
  2140. bitField0_ = (bitField0_ & ~0x00000004);
  2141. return this;
  2142. }
  2143. /**
  2144. * <code>optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;</code>
  2145. *
  2146. * <pre>
  2147. * The message containing the encrypted private EC key information.
  2148. * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
  2149. * This is for security of the private key information.
  2150. * </pre>
  2151. */
  2152. public org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder getEncryptedPrivateKeyBuilder() {
  2153. bitField0_ |= 0x00000004;
  2154. onChanged();
  2155. return getEncryptedPrivateKeyFieldBuilder().getBuilder();
  2156. }
  2157. /**
  2158. * <code>optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;</code>
  2159. *
  2160. * <pre>
  2161. * The message containing the encrypted private EC key information.
  2162. * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
  2163. * This is for security of the private key information.
  2164. * </pre>
  2165. */
  2166. public org.bitcoinj.wallet.Protos.EncryptedPrivateKeyOrBuilder getEncryptedPrivateKeyOrBuilder() {
  2167. if (encryptedPrivateKeyBuilder_ != null) {
  2168. return encryptedPrivateKeyBuilder_.getMessageOrBuilder();
  2169. } else {
  2170. return encryptedPrivateKey_;
  2171. }
  2172. }
  2173. /**
  2174. * <code>optional .wallet.EncryptedPrivateKey encrypted_private_key = 6;</code>
  2175. *
  2176. * <pre>
  2177. * The message containing the encrypted private EC key information.
  2178. * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
  2179. * This is for security of the private key information.
  2180. * </pre>
  2181. */
  2182. private com.google.protobuf.SingleFieldBuilder<
  2183. org.bitcoinj.wallet.Protos.EncryptedPrivateKey, org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder, org.bitcoinj.wallet.Protos.EncryptedPrivateKeyOrBuilder>
  2184. getEncryptedPrivateKeyFieldBuilder() {
  2185. if (encryptedPrivateKeyBuilder_ == null) {
  2186. encryptedPrivateKeyBuilder_ = new com.google.protobuf.SingleFieldBuilder<
  2187. org.bitcoinj.wallet.Protos.EncryptedPrivateKey, org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder, org.bitcoinj.wallet.Protos.EncryptedPrivateKeyOrBuilder>(
  2188. encryptedPrivateKey_,
  2189. getParentForChildren(),
  2190. isClean());
  2191. encryptedPrivateKey_ = null;
  2192. }
  2193. return encryptedPrivateKeyBuilder_;
  2194. }
  2195. // optional bytes public_key = 3;
  2196. private com.google.protobuf.ByteString publicKey_ = com.google.protobuf.ByteString.EMPTY;
  2197. /**
  2198. * <code>optional bytes public_key = 3;</code>
  2199. *
  2200. * <pre>
  2201. * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
  2202. * do lots of slow EC math on startup.
  2203. * </pre>
  2204. */
  2205. public boolean hasPublicKey() {
  2206. return ((bitField0_ & 0x00000008) == 0x00000008);
  2207. }
  2208. /**
  2209. * <code>optional bytes public_key = 3;</code>
  2210. *
  2211. * <pre>
  2212. * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
  2213. * do lots of slow EC math on startup.
  2214. * </pre>
  2215. */
  2216. public com.google.protobuf.ByteString getPublicKey() {
  2217. return publicKey_;
  2218. }
  2219. /**
  2220. * <code>optional bytes public_key = 3;</code>
  2221. *
  2222. * <pre>
  2223. * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
  2224. * do lots of slow EC math on startup.
  2225. * </pre>
  2226. */
  2227. public Builder setPublicKey(com.google.protobuf.ByteString value) {
  2228. if (value == null) {
  2229. throw new NullPointerException();
  2230. }
  2231. bitField0_ |= 0x00000008;
  2232. publicKey_ = value;
  2233. onChanged();
  2234. return this;
  2235. }
  2236. /**
  2237. * <code>optional bytes public_key = 3;</code>
  2238. *
  2239. * <pre>
  2240. * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
  2241. * do lots of slow EC math on startup.
  2242. * </pre>
  2243. */
  2244. public Builder clearPublicKey() {
  2245. bitField0_ = (bitField0_ & ~0x00000008);
  2246. publicKey_ = getDefaultInstance().getPublicKey();
  2247. onChanged();
  2248. return this;
  2249. }
  2250. // optional string label = 4;
  2251. private java.lang.Object label_ = "";
  2252. /**
  2253. * <code>optional string label = 4;</code>
  2254. *
  2255. * <pre>
  2256. * User-provided label associated with the key.
  2257. * </pre>
  2258. */
  2259. public boolean hasLabel() {
  2260. return ((bitField0_ & 0x00000010) == 0x00000010);
  2261. }
  2262. /**
  2263. * <code>optional string label = 4;</code>
  2264. *
  2265. * <pre>
  2266. * User-provided label associated with the key.
  2267. * </pre>
  2268. */
  2269. public java.lang.String getLabel() {
  2270. java.lang.Object ref = label_;
  2271. if (!(ref instanceof java.lang.String)) {
  2272. java.lang.String s = ((com.google.protobuf.ByteString) ref)
  2273. .toStringUtf8();
  2274. label_ = s;
  2275. return s;
  2276. } else {
  2277. return (java.lang.String) ref;
  2278. }
  2279. }
  2280. /**
  2281. * <code>optional string label = 4;</code>
  2282. *
  2283. * <pre>
  2284. * User-provided label associated with the key.
  2285. * </pre>
  2286. */
  2287. public com.google.protobuf.ByteString
  2288. getLabelBytes() {
  2289. java.lang.Object ref = label_;
  2290. if (ref instanceof String) {
  2291. com.google.protobuf.ByteString b =
  2292. com.google.protobuf.ByteString.copyFromUtf8(
  2293. (java.lang.String) ref);
  2294. label_ = b;
  2295. return b;
  2296. } else {
  2297. return (com.google.protobuf.ByteString) ref;
  2298. }
  2299. }
  2300. /**
  2301. * <code>optional string label = 4;</code>
  2302. *
  2303. * <pre>
  2304. * User-provided label associated with the key.
  2305. * </pre>
  2306. */
  2307. public Builder setLabel(
  2308. java.lang.String value) {
  2309. if (value == null) {
  2310. throw new NullPointerException();
  2311. }
  2312. bitField0_ |= 0x00000010;
  2313. label_ = value;
  2314. onChanged();
  2315. return this;
  2316. }
  2317. /**
  2318. * <code>optional string label = 4;</code>
  2319. *
  2320. * <pre>
  2321. * User-provided label associated with the key.
  2322. * </pre>
  2323. */
  2324. public Builder clearLabel() {
  2325. bitField0_ = (bitField0_ & ~0x00000010);
  2326. label_ = getDefaultInstance().getLabel();
  2327. onChanged();
  2328. return this;
  2329. }
  2330. /**
  2331. * <code>optional string label = 4;</code>
  2332. *
  2333. * <pre>
  2334. * User-provided label associated with the key.
  2335. * </pre>
  2336. */
  2337. public Builder setLabelBytes(
  2338. com.google.protobuf.ByteString value) {
  2339. if (value == null) {
  2340. throw new NullPointerException();
  2341. }
  2342. bitField0_ |= 0x00000010;
  2343. label_ = value;
  2344. onChanged();
  2345. return this;
  2346. }
  2347. // optional int64 creation_timestamp = 5;
  2348. private long creationTimestamp_ ;
  2349. /**
  2350. * <code>optional int64 creation_timestamp = 5;</code>
  2351. *
  2352. * <pre>
  2353. * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
  2354. * </pre>
  2355. */
  2356. public boolean hasCreationTimestamp() {
  2357. return ((bitField0_ & 0x00000020) == 0x00000020);
  2358. }
  2359. /**
  2360. * <code>optional int64 creation_timestamp = 5;</code>
  2361. *
  2362. * <pre>
  2363. * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
  2364. * </pre>
  2365. */
  2366. public long getCreationTimestamp() {
  2367. return creationTimestamp_;
  2368. }
  2369. /**
  2370. * <code>optional int64 creation_timestamp = 5;</code>
  2371. *
  2372. * <pre>
  2373. * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
  2374. * </pre>
  2375. */
  2376. public Builder setCreationTimestamp(long value) {
  2377. bitField0_ |= 0x00000020;
  2378. creationTimestamp_ = value;
  2379. onChanged();
  2380. return this;
  2381. }
  2382. /**
  2383. * <code>optional int64 creation_timestamp = 5;</code>
  2384. *
  2385. * <pre>
  2386. * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
  2387. * </pre>
  2388. */
  2389. public Builder clearCreationTimestamp() {
  2390. bitField0_ = (bitField0_ & ~0x00000020);
  2391. creationTimestamp_ = 0L;
  2392. onChanged();
  2393. return this;
  2394. }
  2395. // @@protoc_insertion_point(builder_scope:wallet.Key)
  2396. }
  2397. static {
  2398. defaultInstance = new Key(true);
  2399. defaultInstance.initFields();
  2400. }
  2401. // @@protoc_insertion_point(class_scope:wallet.Key)
  2402. }
  2403. public interface TransactionInputOrBuilder
  2404. extends com.google.protobuf.MessageOrBuilder {
  2405. // required bytes transaction_out_point_hash = 1;
  2406. /**
  2407. * <code>required bytes transaction_out_point_hash = 1;</code>
  2408. *
  2409. * <pre>
  2410. * Hash of the transaction this input is using.
  2411. * </pre>
  2412. */
  2413. boolean hasTransactionOutPointHash();
  2414. /**
  2415. * <code>required bytes transaction_out_point_hash = 1;</code>
  2416. *
  2417. * <pre>
  2418. * Hash of the transaction this input is using.
  2419. * </pre>
  2420. */
  2421. com.google.protobuf.ByteString getTransactionOutPointHash();
  2422. // required uint32 transaction_out_point_index = 2;
  2423. /**
  2424. * <code>required uint32 transaction_out_point_index = 2;</code>
  2425. *
  2426. * <pre>
  2427. * Index of transaction output used by this input.
  2428. * </pre>
  2429. */
  2430. boolean hasTransactionOutPointIndex();
  2431. /**
  2432. * <code>required uint32 transaction_out_point_index = 2;</code>
  2433. *
  2434. * <pre>
  2435. * Index of transaction output used by this input.
  2436. * </pre>
  2437. */
  2438. int getTransactionOutPointIndex();
  2439. // required bytes script_bytes = 3;
  2440. /**
  2441. * <code>required bytes script_bytes = 3;</code>
  2442. *
  2443. * <pre>
  2444. * Script that contains the signatures/pubkeys.
  2445. * </pre>
  2446. */
  2447. boolean hasScriptBytes();
  2448. /**
  2449. * <code>required bytes script_bytes = 3;</code>
  2450. *
  2451. * <pre>
  2452. * Script that contains the signatures/pubkeys.
  2453. * </pre>
  2454. */
  2455. com.google.protobuf.ByteString getScriptBytes();
  2456. // optional uint32 sequence = 4;
  2457. /**
  2458. * <code>optional uint32 sequence = 4;</code>
  2459. *
  2460. * <pre>
  2461. * Sequence number. Currently unused, but intended for contracts in future.
  2462. * </pre>
  2463. */
  2464. boolean hasSequence();
  2465. /**
  2466. * <code>optional uint32 sequence = 4;</code>
  2467. *
  2468. * <pre>
  2469. * Sequence number. Currently unused, but intended for contracts in future.
  2470. * </pre>
  2471. */
  2472. int getSequence();
  2473. }
  2474. /**
  2475. * Protobuf type {@code wallet.TransactionInput}
  2476. */
  2477. public static final class TransactionInput extends
  2478. com.google.protobuf.GeneratedMessage
  2479. implements TransactionInputOrBuilder {
  2480. // Use TransactionInput.newBuilder() to construct.
  2481. private TransactionInput(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  2482. super(builder);
  2483. this.unknownFields = builder.getUnknownFields();
  2484. }
  2485. private TransactionInput(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  2486. private static final TransactionInput defaultInstance;
  2487. public static TransactionInput getDefaultInstance() {
  2488. return defaultInstance;
  2489. }
  2490. public TransactionInput getDefaultInstanceForType() {
  2491. return defaultInstance;
  2492. }
  2493. private final com.google.protobuf.UnknownFieldSet unknownFields;
  2494. @java.lang.Override
  2495. public final com.google.protobuf.UnknownFieldSet
  2496. getUnknownFields() {
  2497. return this.unknownFields;
  2498. }
  2499. private TransactionInput(
  2500. com.google.protobuf.CodedInputStream input,
  2501. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  2502. throws com.google.protobuf.InvalidProtocolBufferException {
  2503. initFields();
  2504. int mutable_bitField0_ = 0;
  2505. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  2506. com.google.protobuf.UnknownFieldSet.newBuilder();
  2507. try {
  2508. boolean done = false;
  2509. while (!done) {
  2510. int tag = input.readTag();
  2511. switch (tag) {
  2512. case 0:
  2513. done = true;
  2514. break;
  2515. default: {
  2516. if (!parseUnknownField(input, unknownFields,
  2517. extensionRegistry, tag)) {
  2518. done = true;
  2519. }
  2520. break;
  2521. }
  2522. case 10: {
  2523. bitField0_ |= 0x00000001;
  2524. transactionOutPointHash_ = input.readBytes();
  2525. break;
  2526. }
  2527. case 16: {
  2528. bitField0_ |= 0x00000002;
  2529. transactionOutPointIndex_ = input.readUInt32();
  2530. break;
  2531. }
  2532. case 26: {
  2533. bitField0_ |= 0x00000004;
  2534. scriptBytes_ = input.readBytes();
  2535. break;
  2536. }
  2537. case 32: {
  2538. bitField0_ |= 0x00000008;
  2539. sequence_ = input.readUInt32();
  2540. break;
  2541. }
  2542. }
  2543. }
  2544. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  2545. throw e.setUnfinishedMessage(this);
  2546. } catch (java.io.IOException e) {
  2547. throw new com.google.protobuf.InvalidProtocolBufferException(
  2548. e.getMessage()).setUnfinishedMessage(this);
  2549. } finally {
  2550. this.unknownFields = unknownFields.build();
  2551. makeExtensionsImmutable();
  2552. }
  2553. }
  2554. public static final com.google.protobuf.Descriptors.Descriptor
  2555. getDescriptor() {
  2556. return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionInput_descriptor;
  2557. }
  2558. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  2559. internalGetFieldAccessorTable() {
  2560. return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionInput_fieldAccessorTable
  2561. .ensureFieldAccessorsInitialized(
  2562. org.bitcoinj.wallet.Protos.TransactionInput.class, org.bitcoinj.wallet.Protos.TransactionInput.Builder.class);
  2563. }
  2564. public static com.google.protobuf.Parser<TransactionInput> PARSER =
  2565. new com.google.protobuf.AbstractParser<TransactionInput>() {
  2566. public TransactionInput parsePartialFrom(
  2567. com.google.protobuf.CodedInputStream input,
  2568. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  2569. throws com.google.protobuf.InvalidProtocolBufferException {
  2570. return new TransactionInput(input, extensionRegistry);
  2571. }
  2572. };
  2573. @java.lang.Override
  2574. public com.google.protobuf.Parser<TransactionInput> getParserForType() {
  2575. return PARSER;
  2576. }
  2577. private int bitField0_;
  2578. // required bytes transaction_out_point_hash = 1;
  2579. public static final int TRANSACTION_OUT_POINT_HASH_FIELD_NUMBER = 1;
  2580. private com.google.protobuf.ByteString transactionOutPointHash_;
  2581. /**
  2582. * <code>required bytes transaction_out_point_hash = 1;</code>
  2583. *
  2584. * <pre>
  2585. * Hash of the transaction this input is using.
  2586. * </pre>
  2587. */
  2588. public boolean hasTransactionOutPointHash() {
  2589. return ((bitField0_ & 0x00000001) == 0x00000001);
  2590. }
  2591. /**
  2592. * <code>required bytes transaction_out_point_hash = 1;</code>
  2593. *
  2594. * <pre>
  2595. * Hash of the transaction this input is using.
  2596. * </pre>
  2597. */
  2598. public com.google.protobuf.ByteString getTransactionOutPointHash() {
  2599. return transactionOutPointHash_;
  2600. }
  2601. // required uint32 transaction_out_point_index = 2;
  2602. public static final int TRANSACTION_OUT_POINT_INDEX_FIELD_NUMBER = 2;
  2603. private int transactionOutPointIndex_;
  2604. /**
  2605. * <code>required uint32 transaction_out_point_index = 2;</code>
  2606. *
  2607. * <pre>
  2608. * Index of transaction output used by this input.
  2609. * </pre>
  2610. */
  2611. public boolean hasTransactionOutPointIndex() {
  2612. return ((bitField0_ & 0x00000002) == 0x00000002);
  2613. }
  2614. /**
  2615. * <code>required uint32 transaction_out_point_index = 2;</code>
  2616. *
  2617. * <pre>
  2618. * Index of transaction output used by this input.
  2619. * </pre>
  2620. */
  2621. public int getTransactionOutPointIndex() {
  2622. return transactionOutPointIndex_;
  2623. }
  2624. // required bytes script_bytes = 3;
  2625. public static final int SCRIPT_BYTES_FIELD_NUMBER = 3;
  2626. private com.google.protobuf.ByteString scriptBytes_;
  2627. /**
  2628. * <code>required bytes script_bytes = 3;</code>
  2629. *
  2630. * <pre>
  2631. * Script that contains the signatures/pubkeys.
  2632. * </pre>
  2633. */
  2634. public boolean hasScriptBytes() {
  2635. return ((bitField0_ & 0x00000004) == 0x00000004);
  2636. }
  2637. /**
  2638. * <code>required bytes script_bytes = 3;</code>
  2639. *
  2640. * <pre>
  2641. * Script that contains the signatures/pubkeys.
  2642. * </pre>
  2643. */
  2644. public com.google.protobuf.ByteString getScriptBytes() {
  2645. return scriptBytes_;
  2646. }
  2647. // optional uint32 sequence = 4;
  2648. public static final int SEQUENCE_FIELD_NUMBER = 4;
  2649. private int sequence_;
  2650. /**
  2651. * <code>optional uint32 sequence = 4;</code>
  2652. *
  2653. * <pre>
  2654. * Sequence number. Currently unused, but intended for contracts in future.
  2655. * </pre>
  2656. */
  2657. public boolean hasSequence() {
  2658. return ((bitField0_ & 0x00000008) == 0x00000008);
  2659. }
  2660. /**
  2661. * <code>optional uint32 sequence = 4;</code>
  2662. *
  2663. * <pre>
  2664. * Sequence number. Currently unused, but intended for contracts in future.
  2665. * </pre>
  2666. */
  2667. public int getSequence() {
  2668. return sequence_;
  2669. }
  2670. private void initFields() {
  2671. transactionOutPointHash_ = com.google.protobuf.ByteString.EMPTY;
  2672. transactionOutPointIndex_ = 0;
  2673. scriptBytes_ = com.google.protobuf.ByteString.EMPTY;
  2674. sequence_ = 0;
  2675. }
  2676. private byte memoizedIsInitialized = -1;
  2677. public final boolean isInitialized() {
  2678. byte isInitialized = memoizedIsInitialized;
  2679. if (isInitialized != -1) return isInitialized == 1;
  2680. if (!hasTransactionOutPointHash()) {
  2681. memoizedIsInitialized = 0;
  2682. return false;
  2683. }
  2684. if (!hasTransactionOutPointIndex()) {
  2685. memoizedIsInitialized = 0;
  2686. return false;
  2687. }
  2688. if (!hasScriptBytes()) {
  2689. memoizedIsInitialized = 0;
  2690. return false;
  2691. }
  2692. memoizedIsInitialized = 1;
  2693. return true;
  2694. }
  2695. public void writeTo(com.google.protobuf.CodedOutputStream output)
  2696. throws java.io.IOException {
  2697. getSerializedSize();
  2698. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  2699. output.writeBytes(1, transactionOutPointHash_);
  2700. }
  2701. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  2702. output.writeUInt32(2, transactionOutPointIndex_);
  2703. }
  2704. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  2705. output.writeBytes(3, scriptBytes_);
  2706. }
  2707. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  2708. output.writeUInt32(4, sequence_);
  2709. }
  2710. getUnknownFields().writeTo(output);
  2711. }
  2712. private int memoizedSerializedSize = -1;
  2713. public int getSerializedSize() {
  2714. int size = memoizedSerializedSize;
  2715. if (size != -1) return size;
  2716. size = 0;
  2717. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  2718. size += com.google.protobuf.CodedOutputStream
  2719. .computeBytesSize(1, transactionOutPointHash_);
  2720. }
  2721. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  2722. size += com.google.protobuf.CodedOutputStream
  2723. .computeUInt32Size(2, transactionOutPointIndex_);
  2724. }
  2725. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  2726. size += com.google.protobuf.CodedOutputStream
  2727. .computeBytesSize(3, scriptBytes_);
  2728. }
  2729. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  2730. size += com.google.protobuf.CodedOutputStream
  2731. .computeUInt32Size(4, sequence_);
  2732. }
  2733. size += getUnknownFields().getSerializedSize();
  2734. memoizedSerializedSize = size;
  2735. return size;
  2736. }
  2737. private static final long serialVersionUID = 0L;
  2738. @java.lang.Override
  2739. protected java.lang.Object writeReplace()
  2740. throws java.io.ObjectStreamException {
  2741. return super.writeReplace();
  2742. }
  2743. public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom(
  2744. com.google.protobuf.ByteString data)
  2745. throws com.google.protobuf.InvalidProtocolBufferException {
  2746. return PARSER.parseFrom(data);
  2747. }
  2748. public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom(
  2749. com.google.protobuf.ByteString data,
  2750. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  2751. throws com.google.protobuf.InvalidProtocolBufferException {
  2752. return PARSER.parseFrom(data, extensionRegistry);
  2753. }
  2754. public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom(byte[] data)
  2755. throws com.google.protobuf.InvalidProtocolBufferException {
  2756. return PARSER.parseFrom(data);
  2757. }
  2758. public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom(
  2759. byte[] data,
  2760. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  2761. throws com.google.protobuf.InvalidProtocolBufferException {
  2762. return PARSER.parseFrom(data, extensionRegistry);
  2763. }
  2764. public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom(java.io.InputStream input)
  2765. throws java.io.IOException {
  2766. return PARSER.parseFrom(input);
  2767. }
  2768. public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom(
  2769. java.io.InputStream input,
  2770. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  2771. throws java.io.IOException {
  2772. return PARSER.parseFrom(input, extensionRegistry);
  2773. }
  2774. public static org.bitcoinj.wallet.Protos.TransactionInput parseDelimitedFrom(java.io.InputStream input)
  2775. throws java.io.IOException {
  2776. return PARSER.parseDelimitedFrom(input);
  2777. }
  2778. public static org.bitcoinj.wallet.Protos.TransactionInput parseDelimitedFrom(
  2779. java.io.InputStream input,
  2780. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  2781. throws java.io.IOException {
  2782. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  2783. }
  2784. public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom(
  2785. com.google.protobuf.CodedInputStream input)
  2786. throws java.io.IOException {
  2787. return PARSER.parseFrom(input);
  2788. }
  2789. public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom(
  2790. com.google.protobuf.CodedInputStream input,
  2791. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  2792. throws java.io.IOException {
  2793. return PARSER.parseFrom(input, extensionRegistry);
  2794. }
  2795. public static Builder newBuilder() { return Builder.create(); }
  2796. public Builder newBuilderForType() { return newBuilder(); }
  2797. public static Builder newBuilder(org.bitcoinj.wallet.Protos.TransactionInput prototype) {
  2798. return newBuilder().mergeFrom(prototype);
  2799. }
  2800. public Builder toBuilder() { return newBuilder(this); }
  2801. @java.lang.Override
  2802. protected Builder newBuilderForType(
  2803. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  2804. Builder builder = new Builder(parent);
  2805. return builder;
  2806. }
  2807. /**
  2808. * Protobuf type {@code wallet.TransactionInput}
  2809. */
  2810. public static final class Builder extends
  2811. com.google.protobuf.GeneratedMessage.Builder<Builder>
  2812. implements org.bitcoinj.wallet.Protos.TransactionInputOrBuilder {
  2813. public static final com.google.protobuf.Descriptors.Descriptor
  2814. getDescriptor() {
  2815. return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionInput_descriptor;
  2816. }
  2817. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  2818. internalGetFieldAccessorTable() {
  2819. return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionInput_fieldAccessorTable
  2820. .ensureFieldAccessorsInitialized(
  2821. org.bitcoinj.wallet.Protos.TransactionInput.class, org.bitcoinj.wallet.Protos.TransactionInput.Builder.class);
  2822. }
  2823. // Construct using org.bitcoinj.wallet.Protos.TransactionInput.newBuilder()
  2824. private Builder() {
  2825. maybeForceBuilderInitialization();
  2826. }
  2827. private Builder(
  2828. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  2829. super(parent);
  2830. maybeForceBuilderInitialization();
  2831. }
  2832. private void maybeForceBuilderInitialization() {
  2833. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  2834. }
  2835. }
  2836. private static Builder create() {
  2837. return new Builder();
  2838. }
  2839. public Builder clear() {
  2840. super.clear();
  2841. transactionOutPointHash_ = com.google.protobuf.ByteString.EMPTY;
  2842. bitField0_ = (bitField0_ & ~0x00000001);
  2843. transactionOutPointIndex_ = 0;
  2844. bitField0_ = (bitField0_ & ~0x00000002);
  2845. scriptBytes_ = com.google.protobuf.ByteString.EMPTY;
  2846. bitField0_ = (bitField0_ & ~0x00000004);
  2847. sequence_ = 0;
  2848. bitField0_ = (bitField0_ & ~0x00000008);
  2849. return this;
  2850. }
  2851. public Builder clone() {
  2852. return create().mergeFrom(buildPartial());
  2853. }
  2854. public com.google.protobuf.Descriptors.Descriptor
  2855. getDescriptorForType() {
  2856. return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionInput_descriptor;
  2857. }
  2858. public org.bitcoinj.wallet.Protos.TransactionInput getDefaultInstanceForType() {
  2859. return org.bitcoinj.wallet.Protos.TransactionInput.getDefaultInstance();
  2860. }
  2861. public org.bitcoinj.wallet.Protos.TransactionInput build() {
  2862. org.bitcoinj.wallet.Protos.TransactionInput result = buildPartial();
  2863. if (!result.isInitialized()) {
  2864. throw newUninitializedMessageException(result);
  2865. }
  2866. return result;
  2867. }
  2868. public org.bitcoinj.wallet.Protos.TransactionInput buildPartial() {
  2869. org.bitcoinj.wallet.Protos.TransactionInput result = new org.bitcoinj.wallet.Protos.TransactionInput(this);
  2870. int from_bitField0_ = bitField0_;
  2871. int to_bitField0_ = 0;
  2872. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  2873. to_bitField0_ |= 0x00000001;
  2874. }
  2875. result.transactionOutPointHash_ = transactionOutPointHash_;
  2876. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  2877. to_bitField0_ |= 0x00000002;
  2878. }
  2879. result.transactionOutPointIndex_ = transactionOutPointIndex_;
  2880. if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
  2881. to_bitField0_ |= 0x00000004;
  2882. }
  2883. result.scriptBytes_ = scriptBytes_;
  2884. if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
  2885. to_bitField0_ |= 0x00000008;
  2886. }
  2887. result.sequence_ = sequence_;
  2888. result.bitField0_ = to_bitField0_;
  2889. onBuilt();
  2890. return result;
  2891. }
  2892. public Builder mergeFrom(com.google.protobuf.Message other) {
  2893. if (other instanceof org.bitcoinj.wallet.Protos.TransactionInput) {
  2894. return mergeFrom((org.bitcoinj.wallet.Protos.TransactionInput)other);
  2895. } else {
  2896. super.mergeFrom(other);
  2897. return this;
  2898. }
  2899. }
  2900. public Builder mergeFrom(org.bitcoinj.wallet.Protos.TransactionInput other) {
  2901. if (other == org.bitcoinj.wallet.Protos.TransactionInput.getDefaultInstance()) return this;
  2902. if (other.hasTransactionOutPointHash()) {
  2903. setTransactionOutPointHash(other.getTransactionOutPointHash());
  2904. }
  2905. if (other.hasTransactionOutPointIndex()) {
  2906. setTransactionOutPointIndex(other.getTransactionOutPointIndex());
  2907. }
  2908. if (other.hasScriptBytes()) {
  2909. setScriptBytes(other.getScriptBytes());
  2910. }
  2911. if (other.hasSequence()) {
  2912. setSequence(other.getSequence());
  2913. }
  2914. this.mergeUnknownFields(other.getUnknownFields());
  2915. return this;
  2916. }
  2917. public final boolean isInitialized() {
  2918. if (!hasTransactionOutPointHash()) {
  2919. return false;
  2920. }
  2921. if (!hasTransactionOutPointIndex()) {
  2922. return false;
  2923. }
  2924. if (!hasScriptBytes()) {
  2925. return false;
  2926. }
  2927. return true;
  2928. }
  2929. public Builder mergeFrom(
  2930. com.google.protobuf.CodedInputStream input,
  2931. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  2932. throws java.io.IOException {
  2933. org.bitcoinj.wallet.Protos.TransactionInput parsedMessage = null;
  2934. try {
  2935. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  2936. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  2937. parsedMessage = (org.bitcoinj.wallet.Protos.TransactionInput) e.getUnfinishedMessage();
  2938. throw e;
  2939. } finally {
  2940. if (parsedMessage != null) {
  2941. mergeFrom(parsedMessage);
  2942. }
  2943. }
  2944. return this;
  2945. }
  2946. private int bitField0_;
  2947. // required bytes transaction_out_point_hash = 1;
  2948. private com.google.protobuf.ByteString transactionOutPointHash_ = com.google.protobuf.ByteString.EMPTY;
  2949. /**
  2950. * <code>required bytes transaction_out_point_hash = 1;</code>
  2951. *
  2952. * <pre>
  2953. * Hash of the transaction this input is using.
  2954. * </pre>
  2955. */
  2956. public boolean hasTransactionOutPointHash() {
  2957. return ((bitField0_ & 0x00000001) == 0x00000001);
  2958. }
  2959. /**
  2960. * <code>required bytes transaction_out_point_hash = 1;</code>
  2961. *
  2962. * <pre>
  2963. * Hash of the transaction this input is using.
  2964. * </pre>
  2965. */
  2966. public com.google.protobuf.ByteString getTransactionOutPointHash() {
  2967. return transactionOutPointHash_;
  2968. }
  2969. /**
  2970. * <code>required bytes transaction_out_point_hash = 1;</code>
  2971. *
  2972. * <pre>
  2973. * Hash of the transaction this input is using.
  2974. * </pre>
  2975. */
  2976. public Builder setTransactionOutPointHash(com.google.protobuf.ByteString value) {
  2977. if (value == null) {
  2978. throw new NullPointerException();
  2979. }
  2980. bitField0_ |= 0x00000001;
  2981. transactionOutPointHash_ = value;
  2982. onChanged();
  2983. return this;
  2984. }
  2985. /**
  2986. * <code>required bytes transaction_out_point_hash = 1;</code>
  2987. *
  2988. * <pre>
  2989. * Hash of the transaction this input is using.
  2990. * </pre>
  2991. */
  2992. public Builder clearTransactionOutPointHash() {
  2993. bitField0_ = (bitField0_ & ~0x00000001);
  2994. transactionOutPointHash_ = getDefaultInstance().getTransactionOutPointHash();
  2995. onChanged();
  2996. return this;
  2997. }
  2998. // required uint32 transaction_out_point_index = 2;
  2999. private int transactionOutPointIndex_ ;
  3000. /**
  3001. * <code>required uint32 transaction_out_point_index = 2;</code>
  3002. *
  3003. * <pre>
  3004. * Index of transaction output used by this input.
  3005. * </pre>
  3006. */
  3007. public boolean hasTransactionOutPointIndex() {
  3008. return ((bitField0_ & 0x00000002) == 0x00000002);
  3009. }
  3010. /**
  3011. * <code>required uint32 transaction_out_point_index = 2;</code>
  3012. *
  3013. * <pre>
  3014. * Index of transaction output used by this input.
  3015. * </pre>
  3016. */
  3017. public int getTransactionOutPointIndex() {
  3018. return transactionOutPointIndex_;
  3019. }
  3020. /**
  3021. * <code>required uint32 transaction_out_point_index = 2;</code>
  3022. *
  3023. * <pre>
  3024. * Index of transaction output used by this input.
  3025. * </pre>
  3026. */
  3027. public Builder setTransactionOutPointIndex(int value) {
  3028. bitField0_ |= 0x00000002;
  3029. transactionOutPointIndex_ = value;
  3030. onChanged();
  3031. return this;
  3032. }
  3033. /**
  3034. * <code>required uint32 transaction_out_point_index = 2;</code>
  3035. *
  3036. * <pre>
  3037. * Index of transaction output used by this input.
  3038. * </pre>
  3039. */
  3040. public Builder clearTransactionOutPointIndex() {
  3041. bitField0_ = (bitField0_ & ~0x00000002);
  3042. transactionOutPointIndex_ = 0;
  3043. onChanged();
  3044. return this;
  3045. }
  3046. // required bytes script_bytes = 3;
  3047. private com.google.protobuf.ByteString scriptBytes_ = com.google.protobuf.ByteString.EMPTY;
  3048. /**
  3049. * <code>required bytes script_bytes = 3;</code>
  3050. *
  3051. * <pre>
  3052. * Script that contains the signatures/pubkeys.
  3053. * </pre>
  3054. */
  3055. public boolean hasScriptBytes() {
  3056. return ((bitField0_ & 0x00000004) == 0x00000004);
  3057. }
  3058. /**
  3059. * <code>required bytes script_bytes = 3;</code>
  3060. *
  3061. * <pre>
  3062. * Script that contains the signatures/pubkeys.
  3063. * </pre>
  3064. */
  3065. public com.google.protobuf.ByteString getScriptBytes() {
  3066. return scriptBytes_;
  3067. }
  3068. /**
  3069. * <code>required bytes script_bytes = 3;</code>
  3070. *
  3071. * <pre>
  3072. * Script that contains the signatures/pubkeys.
  3073. * </pre>
  3074. */
  3075. public Builder setScriptBytes(com.google.protobuf.ByteString value) {
  3076. if (value == null) {
  3077. throw new NullPointerException();
  3078. }
  3079. bitField0_ |= 0x00000004;
  3080. scriptBytes_ = value;
  3081. onChanged();
  3082. return this;
  3083. }
  3084. /**
  3085. * <code>required bytes script_bytes = 3;</code>
  3086. *
  3087. * <pre>
  3088. * Script that contains the signatures/pubkeys.
  3089. * </pre>
  3090. */
  3091. public Builder clearScriptBytes() {
  3092. bitField0_ = (bitField0_ & ~0x00000004);
  3093. scriptBytes_ = getDefaultInstance().getScriptBytes();
  3094. onChanged();
  3095. return this;
  3096. }
  3097. // optional uint32 sequence = 4;
  3098. private int sequence_ ;
  3099. /**
  3100. * <code>optional uint32 sequence = 4;</code>
  3101. *
  3102. * <pre>
  3103. * Sequence number. Currently unused, but intended for contracts in future.
  3104. * </pre>
  3105. */
  3106. public boolean hasSequence() {
  3107. return ((bitField0_ & 0x00000008) == 0x00000008);
  3108. }
  3109. /**
  3110. * <code>optional uint32 sequence = 4;</code>
  3111. *
  3112. * <pre>
  3113. * Sequence number. Currently unused, but intended for contracts in future.
  3114. * </pre>
  3115. */
  3116. public int getSequence() {
  3117. return sequence_;
  3118. }
  3119. /**
  3120. * <code>optional uint32 sequence = 4;</code>
  3121. *
  3122. * <pre>
  3123. * Sequence number. Currently unused, but intended for contracts in future.
  3124. * </pre>
  3125. */
  3126. public Builder setSequence(int value) {
  3127. bitField0_ |= 0x00000008;
  3128. sequence_ = value;
  3129. onChanged();
  3130. return this;
  3131. }
  3132. /**
  3133. * <code>optional uint32 sequence = 4;</code>
  3134. *
  3135. * <pre>
  3136. * Sequence number. Currently unused, but intended for contracts in future.
  3137. * </pre>
  3138. */
  3139. public Builder clearSequence() {
  3140. bitField0_ = (bitField0_ & ~0x00000008);
  3141. sequence_ = 0;
  3142. onChanged();
  3143. return this;
  3144. }
  3145. // @@protoc_insertion_point(builder_scope:wallet.TransactionInput)
  3146. }
  3147. static {
  3148. defaultInstance = new TransactionInput(true);
  3149. defaultInstance.initFields();
  3150. }
  3151. // @@protoc_insertion_point(class_scope:wallet.TransactionInput)
  3152. }
  3153. public interface TransactionOutputOrBuilder
  3154. extends com.google.protobuf.MessageOrBuilder {
  3155. // required int64 value = 1;
  3156. /**
  3157. * <code>required int64 value = 1;</code>
  3158. */
  3159. boolean hasValue();
  3160. /**
  3161. * <code>required int64 value = 1;</code>
  3162. */
  3163. long getValue();
  3164. // required bytes script_bytes = 2;
  3165. /**
  3166. * <code>required bytes script_bytes = 2;</code>
  3167. *
  3168. * <pre>
  3169. * script of transaction output
  3170. * </pre>
  3171. */
  3172. boolean hasScriptBytes();
  3173. /**
  3174. * <code>required bytes script_bytes = 2;</code>
  3175. *
  3176. * <pre>
  3177. * script of transaction output
  3178. * </pre>
  3179. */
  3180. com.google.protobuf.ByteString getScriptBytes();
  3181. // optional bytes spent_by_transaction_hash = 3;
  3182. /**
  3183. * <code>optional bytes spent_by_transaction_hash = 3;</code>
  3184. *
  3185. * <pre>
  3186. * If spent, the hash of the transaction doing the spend.
  3187. * </pre>
  3188. */
  3189. boolean hasSpentByTransactionHash();
  3190. /**
  3191. * <code>optional bytes spent_by_transaction_hash = 3;</code>
  3192. *
  3193. * <pre>
  3194. * If spent, the hash of the transaction doing the spend.
  3195. * </pre>
  3196. */
  3197. com.google.protobuf.ByteString getSpentByTransactionHash();
  3198. // optional int32 spent_by_transaction_index = 4;
  3199. /**
  3200. * <code>optional int32 spent_by_transaction_index = 4;</code>
  3201. *
  3202. * <pre>
  3203. * If spent, the index of the transaction input of the transaction doing the spend.
  3204. * </pre>
  3205. */
  3206. boolean hasSpentByTransactionIndex();
  3207. /**
  3208. * <code>optional int32 spent_by_transaction_index = 4;</code>
  3209. *
  3210. * <pre>
  3211. * If spent, the index of the transaction input of the transaction doing the spend.
  3212. * </pre>
  3213. */
  3214. int getSpentByTransactionIndex();
  3215. }
  3216. /**
  3217. * Protobuf type {@code wallet.TransactionOutput}
  3218. */
  3219. public static final class TransactionOutput extends
  3220. com.google.protobuf.GeneratedMessage
  3221. implements TransactionOutputOrBuilder {
  3222. // Use TransactionOutput.newBuilder() to construct.
  3223. private TransactionOutput(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  3224. super(builder);
  3225. this.unknownFields = builder.getUnknownFields();
  3226. }
  3227. private TransactionOutput(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  3228. private static final TransactionOutput defaultInstance;
  3229. public static TransactionOutput getDefaultInstance() {
  3230. return defaultInstance;
  3231. }
  3232. public TransactionOutput getDefaultInstanceForType() {
  3233. return defaultInstance;
  3234. }
  3235. private final com.google.protobuf.UnknownFieldSet unknownFields;
  3236. @java.lang.Override
  3237. public final com.google.protobuf.UnknownFieldSet
  3238. getUnknownFields() {
  3239. return this.unknownFields;
  3240. }
  3241. private TransactionOutput(
  3242. com.google.protobuf.CodedInputStream input,
  3243. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3244. throws com.google.protobuf.InvalidProtocolBufferException {
  3245. initFields();
  3246. int mutable_bitField0_ = 0;
  3247. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  3248. com.google.protobuf.UnknownFieldSet.newBuilder();
  3249. try {
  3250. boolean done = false;
  3251. while (!done) {
  3252. int tag = input.readTag();
  3253. switch (tag) {
  3254. case 0:
  3255. done = true;
  3256. break;
  3257. default: {
  3258. if (!parseUnknownField(input, unknownFields,
  3259. extensionRegistry, tag)) {
  3260. done = true;
  3261. }
  3262. break;
  3263. }
  3264. case 8: {
  3265. bitField0_ |= 0x00000001;
  3266. value_ = input.readInt64();
  3267. break;
  3268. }
  3269. case 18: {
  3270. bitField0_ |= 0x00000002;
  3271. scriptBytes_ = input.readBytes();
  3272. break;
  3273. }
  3274. case 26: {
  3275. bitField0_ |= 0x00000004;
  3276. spentByTransactionHash_ = input.readBytes();
  3277. break;
  3278. }
  3279. case 32: {
  3280. bitField0_ |= 0x00000008;
  3281. spentByTransactionIndex_ = input.readInt32();
  3282. break;
  3283. }
  3284. }
  3285. }
  3286. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  3287. throw e.setUnfinishedMessage(this);
  3288. } catch (java.io.IOException e) {
  3289. throw new com.google.protobuf.InvalidProtocolBufferException(
  3290. e.getMessage()).setUnfinishedMessage(this);
  3291. } finally {
  3292. this.unknownFields = unknownFields.build();
  3293. makeExtensionsImmutable();
  3294. }
  3295. }
  3296. public static final com.google.protobuf.Descriptors.Descriptor
  3297. getDescriptor() {
  3298. return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionOutput_descriptor;
  3299. }
  3300. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  3301. internalGetFieldAccessorTable() {
  3302. return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionOutput_fieldAccessorTable
  3303. .ensureFieldAccessorsInitialized(
  3304. org.bitcoinj.wallet.Protos.TransactionOutput.class, org.bitcoinj.wallet.Protos.TransactionOutput.Builder.class);
  3305. }
  3306. public static com.google.protobuf.Parser<TransactionOutput> PARSER =
  3307. new com.google.protobuf.AbstractParser<TransactionOutput>() {
  3308. public TransactionOutput parsePartialFrom(
  3309. com.google.protobuf.CodedInputStream input,
  3310. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3311. throws com.google.protobuf.InvalidProtocolBufferException {
  3312. return new TransactionOutput(input, extensionRegistry);
  3313. }
  3314. };
  3315. @java.lang.Override
  3316. public com.google.protobuf.Parser<TransactionOutput> getParserForType() {
  3317. return PARSER;
  3318. }
  3319. private int bitField0_;
  3320. // required int64 value = 1;
  3321. public static final int VALUE_FIELD_NUMBER = 1;
  3322. private long value_;
  3323. /**
  3324. * <code>required int64 value = 1;</code>
  3325. */
  3326. public boolean hasValue() {
  3327. return ((bitField0_ & 0x00000001) == 0x00000001);
  3328. }
  3329. /**
  3330. * <code>required int64 value = 1;</code>
  3331. */
  3332. public long getValue() {
  3333. return value_;
  3334. }
  3335. // required bytes script_bytes = 2;
  3336. public static final int SCRIPT_BYTES_FIELD_NUMBER = 2;
  3337. private com.google.protobuf.ByteString scriptBytes_;
  3338. /**
  3339. * <code>required bytes script_bytes = 2;</code>
  3340. *
  3341. * <pre>
  3342. * script of transaction output
  3343. * </pre>
  3344. */
  3345. public boolean hasScriptBytes() {
  3346. return ((bitField0_ & 0x00000002) == 0x00000002);
  3347. }
  3348. /**
  3349. * <code>required bytes script_bytes = 2;</code>
  3350. *
  3351. * <pre>
  3352. * script of transaction output
  3353. * </pre>
  3354. */
  3355. public com.google.protobuf.ByteString getScriptBytes() {
  3356. return scriptBytes_;
  3357. }
  3358. // optional bytes spent_by_transaction_hash = 3;
  3359. public static final int SPENT_BY_TRANSACTION_HASH_FIELD_NUMBER = 3;
  3360. private com.google.protobuf.ByteString spentByTransactionHash_;
  3361. /**
  3362. * <code>optional bytes spent_by_transaction_hash = 3;</code>
  3363. *
  3364. * <pre>
  3365. * If spent, the hash of the transaction doing the spend.
  3366. * </pre>
  3367. */
  3368. public boolean hasSpentByTransactionHash() {
  3369. return ((bitField0_ & 0x00000004) == 0x00000004);
  3370. }
  3371. /**
  3372. * <code>optional bytes spent_by_transaction_hash = 3;</code>
  3373. *
  3374. * <pre>
  3375. * If spent, the hash of the transaction doing the spend.
  3376. * </pre>
  3377. */
  3378. public com.google.protobuf.ByteString getSpentByTransactionHash() {
  3379. return spentByTransactionHash_;
  3380. }
  3381. // optional int32 spent_by_transaction_index = 4;
  3382. public static final int SPENT_BY_TRANSACTION_INDEX_FIELD_NUMBER = 4;
  3383. private int spentByTransactionIndex_;
  3384. /**
  3385. * <code>optional int32 spent_by_transaction_index = 4;</code>
  3386. *
  3387. * <pre>
  3388. * If spent, the index of the transaction input of the transaction doing the spend.
  3389. * </pre>
  3390. */
  3391. public boolean hasSpentByTransactionIndex() {
  3392. return ((bitField0_ & 0x00000008) == 0x00000008);
  3393. }
  3394. /**
  3395. * <code>optional int32 spent_by_transaction_index = 4;</code>
  3396. *
  3397. * <pre>
  3398. * If spent, the index of the transaction input of the transaction doing the spend.
  3399. * </pre>
  3400. */
  3401. public int getSpentByTransactionIndex() {
  3402. return spentByTransactionIndex_;
  3403. }
  3404. private void initFields() {
  3405. value_ = 0L;
  3406. scriptBytes_ = com.google.protobuf.ByteString.EMPTY;
  3407. spentByTransactionHash_ = com.google.protobuf.ByteString.EMPTY;
  3408. spentByTransactionIndex_ = 0;
  3409. }
  3410. private byte memoizedIsInitialized = -1;
  3411. public final boolean isInitialized() {
  3412. byte isInitialized = memoizedIsInitialized;
  3413. if (isInitialized != -1) return isInitialized == 1;
  3414. if (!hasValue()) {
  3415. memoizedIsInitialized = 0;
  3416. return false;
  3417. }
  3418. if (!hasScriptBytes()) {
  3419. memoizedIsInitialized = 0;
  3420. return false;
  3421. }
  3422. memoizedIsInitialized = 1;
  3423. return true;
  3424. }
  3425. public void writeTo(com.google.protobuf.CodedOutputStream output)
  3426. throws java.io.IOException {
  3427. getSerializedSize();
  3428. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  3429. output.writeInt64(1, value_);
  3430. }
  3431. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  3432. output.writeBytes(2, scriptBytes_);
  3433. }
  3434. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  3435. output.writeBytes(3, spentByTransactionHash_);
  3436. }
  3437. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  3438. output.writeInt32(4, spentByTransactionIndex_);
  3439. }
  3440. getUnknownFields().writeTo(output);
  3441. }
  3442. private int memoizedSerializedSize = -1;
  3443. public int getSerializedSize() {
  3444. int size = memoizedSerializedSize;
  3445. if (size != -1) return size;
  3446. size = 0;
  3447. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  3448. size += com.google.protobuf.CodedOutputStream
  3449. .computeInt64Size(1, value_);
  3450. }
  3451. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  3452. size += com.google.protobuf.CodedOutputStream
  3453. .computeBytesSize(2, scriptBytes_);
  3454. }
  3455. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  3456. size += com.google.protobuf.CodedOutputStream
  3457. .computeBytesSize(3, spentByTransactionHash_);
  3458. }
  3459. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  3460. size += com.google.protobuf.CodedOutputStream
  3461. .computeInt32Size(4, spentByTransactionIndex_);
  3462. }
  3463. size += getUnknownFields().getSerializedSize();
  3464. memoizedSerializedSize = size;
  3465. return size;
  3466. }
  3467. private static final long serialVersionUID = 0L;
  3468. @java.lang.Override
  3469. protected java.lang.Object writeReplace()
  3470. throws java.io.ObjectStreamException {
  3471. return super.writeReplace();
  3472. }
  3473. public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom(
  3474. com.google.protobuf.ByteString data)
  3475. throws com.google.protobuf.InvalidProtocolBufferException {
  3476. return PARSER.parseFrom(data);
  3477. }
  3478. public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom(
  3479. com.google.protobuf.ByteString data,
  3480. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3481. throws com.google.protobuf.InvalidProtocolBufferException {
  3482. return PARSER.parseFrom(data, extensionRegistry);
  3483. }
  3484. public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom(byte[] data)
  3485. throws com.google.protobuf.InvalidProtocolBufferException {
  3486. return PARSER.parseFrom(data);
  3487. }
  3488. public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom(
  3489. byte[] data,
  3490. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3491. throws com.google.protobuf.InvalidProtocolBufferException {
  3492. return PARSER.parseFrom(data, extensionRegistry);
  3493. }
  3494. public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom(java.io.InputStream input)
  3495. throws java.io.IOException {
  3496. return PARSER.parseFrom(input);
  3497. }
  3498. public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom(
  3499. java.io.InputStream input,
  3500. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3501. throws java.io.IOException {
  3502. return PARSER.parseFrom(input, extensionRegistry);
  3503. }
  3504. public static org.bitcoinj.wallet.Protos.TransactionOutput parseDelimitedFrom(java.io.InputStream input)
  3505. throws java.io.IOException {
  3506. return PARSER.parseDelimitedFrom(input);
  3507. }
  3508. public static org.bitcoinj.wallet.Protos.TransactionOutput parseDelimitedFrom(
  3509. java.io.InputStream input,
  3510. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3511. throws java.io.IOException {
  3512. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  3513. }
  3514. public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom(
  3515. com.google.protobuf.CodedInputStream input)
  3516. throws java.io.IOException {
  3517. return PARSER.parseFrom(input);
  3518. }
  3519. public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom(
  3520. com.google.protobuf.CodedInputStream input,
  3521. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3522. throws java.io.IOException {
  3523. return PARSER.parseFrom(input, extensionRegistry);
  3524. }
  3525. public static Builder newBuilder() { return Builder.create(); }
  3526. public Builder newBuilderForType() { return newBuilder(); }
  3527. public static Builder newBuilder(org.bitcoinj.wallet.Protos.TransactionOutput prototype) {
  3528. return newBuilder().mergeFrom(prototype);
  3529. }
  3530. public Builder toBuilder() { return newBuilder(this); }
  3531. @java.lang.Override
  3532. protected Builder newBuilderForType(
  3533. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  3534. Builder builder = new Builder(parent);
  3535. return builder;
  3536. }
  3537. /**
  3538. * Protobuf type {@code wallet.TransactionOutput}
  3539. */
  3540. public static final class Builder extends
  3541. com.google.protobuf.GeneratedMessage.Builder<Builder>
  3542. implements org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder {
  3543. public static final com.google.protobuf.Descriptors.Descriptor
  3544. getDescriptor() {
  3545. return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionOutput_descriptor;
  3546. }
  3547. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  3548. internalGetFieldAccessorTable() {
  3549. return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionOutput_fieldAccessorTable
  3550. .ensureFieldAccessorsInitialized(
  3551. org.bitcoinj.wallet.Protos.TransactionOutput.class, org.bitcoinj.wallet.Protos.TransactionOutput.Builder.class);
  3552. }
  3553. // Construct using org.bitcoinj.wallet.Protos.TransactionOutput.newBuilder()
  3554. private Builder() {
  3555. maybeForceBuilderInitialization();
  3556. }
  3557. private Builder(
  3558. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  3559. super(parent);
  3560. maybeForceBuilderInitialization();
  3561. }
  3562. private void maybeForceBuilderInitialization() {
  3563. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  3564. }
  3565. }
  3566. private static Builder create() {
  3567. return new Builder();
  3568. }
  3569. public Builder clear() {
  3570. super.clear();
  3571. value_ = 0L;
  3572. bitField0_ = (bitField0_ & ~0x00000001);
  3573. scriptBytes_ = com.google.protobuf.ByteString.EMPTY;
  3574. bitField0_ = (bitField0_ & ~0x00000002);
  3575. spentByTransactionHash_ = com.google.protobuf.ByteString.EMPTY;
  3576. bitField0_ = (bitField0_ & ~0x00000004);
  3577. spentByTransactionIndex_ = 0;
  3578. bitField0_ = (bitField0_ & ~0x00000008);
  3579. return this;
  3580. }
  3581. public Builder clone() {
  3582. return create().mergeFrom(buildPartial());
  3583. }
  3584. public com.google.protobuf.Descriptors.Descriptor
  3585. getDescriptorForType() {
  3586. return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionOutput_descriptor;
  3587. }
  3588. public org.bitcoinj.wallet.Protos.TransactionOutput getDefaultInstanceForType() {
  3589. return org.bitcoinj.wallet.Protos.TransactionOutput.getDefaultInstance();
  3590. }
  3591. public org.bitcoinj.wallet.Protos.TransactionOutput build() {
  3592. org.bitcoinj.wallet.Protos.TransactionOutput result = buildPartial();
  3593. if (!result.isInitialized()) {
  3594. throw newUninitializedMessageException(result);
  3595. }
  3596. return result;
  3597. }
  3598. public org.bitcoinj.wallet.Protos.TransactionOutput buildPartial() {
  3599. org.bitcoinj.wallet.Protos.TransactionOutput result = new org.bitcoinj.wallet.Protos.TransactionOutput(this);
  3600. int from_bitField0_ = bitField0_;
  3601. int to_bitField0_ = 0;
  3602. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  3603. to_bitField0_ |= 0x00000001;
  3604. }
  3605. result.value_ = value_;
  3606. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  3607. to_bitField0_ |= 0x00000002;
  3608. }
  3609. result.scriptBytes_ = scriptBytes_;
  3610. if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
  3611. to_bitField0_ |= 0x00000004;
  3612. }
  3613. result.spentByTransactionHash_ = spentByTransactionHash_;
  3614. if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
  3615. to_bitField0_ |= 0x00000008;
  3616. }
  3617. result.spentByTransactionIndex_ = spentByTransactionIndex_;
  3618. result.bitField0_ = to_bitField0_;
  3619. onBuilt();
  3620. return result;
  3621. }
  3622. public Builder mergeFrom(com.google.protobuf.Message other) {
  3623. if (other instanceof org.bitcoinj.wallet.Protos.TransactionOutput) {
  3624. return mergeFrom((org.bitcoinj.wallet.Protos.TransactionOutput)other);
  3625. } else {
  3626. super.mergeFrom(other);
  3627. return this;
  3628. }
  3629. }
  3630. public Builder mergeFrom(org.bitcoinj.wallet.Protos.TransactionOutput other) {
  3631. if (other == org.bitcoinj.wallet.Protos.TransactionOutput.getDefaultInstance()) return this;
  3632. if (other.hasValue()) {
  3633. setValue(other.getValue());
  3634. }
  3635. if (other.hasScriptBytes()) {
  3636. setScriptBytes(other.getScriptBytes());
  3637. }
  3638. if (other.hasSpentByTransactionHash()) {
  3639. setSpentByTransactionHash(other.getSpentByTransactionHash());
  3640. }
  3641. if (other.hasSpentByTransactionIndex()) {
  3642. setSpentByTransactionIndex(other.getSpentByTransactionIndex());
  3643. }
  3644. this.mergeUnknownFields(other.getUnknownFields());
  3645. return this;
  3646. }
  3647. public final boolean isInitialized() {
  3648. if (!hasValue()) {
  3649. return false;
  3650. }
  3651. if (!hasScriptBytes()) {
  3652. return false;
  3653. }
  3654. return true;
  3655. }
  3656. public Builder mergeFrom(
  3657. com.google.protobuf.CodedInputStream input,
  3658. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3659. throws java.io.IOException {
  3660. org.bitcoinj.wallet.Protos.TransactionOutput parsedMessage = null;
  3661. try {
  3662. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  3663. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  3664. parsedMessage = (org.bitcoinj.wallet.Protos.TransactionOutput) e.getUnfinishedMessage();
  3665. throw e;
  3666. } finally {
  3667. if (parsedMessage != null) {
  3668. mergeFrom(parsedMessage);
  3669. }
  3670. }
  3671. return this;
  3672. }
  3673. private int bitField0_;
  3674. // required int64 value = 1;
  3675. private long value_ ;
  3676. /**
  3677. * <code>required int64 value = 1;</code>
  3678. */
  3679. public boolean hasValue() {
  3680. return ((bitField0_ & 0x00000001) == 0x00000001);
  3681. }
  3682. /**
  3683. * <code>required int64 value = 1;</code>
  3684. */
  3685. public long getValue() {
  3686. return value_;
  3687. }
  3688. /**
  3689. * <code>required int64 value = 1;</code>
  3690. */
  3691. public Builder setValue(long value) {
  3692. bitField0_ |= 0x00000001;
  3693. value_ = value;
  3694. onChanged();
  3695. return this;
  3696. }
  3697. /**
  3698. * <code>required int64 value = 1;</code>
  3699. */
  3700. public Builder clearValue() {
  3701. bitField0_ = (bitField0_ & ~0x00000001);
  3702. value_ = 0L;
  3703. onChanged();
  3704. return this;
  3705. }
  3706. // required bytes script_bytes = 2;
  3707. private com.google.protobuf.ByteString scriptBytes_ = com.google.protobuf.ByteString.EMPTY;
  3708. /**
  3709. * <code>required bytes script_bytes = 2;</code>
  3710. *
  3711. * <pre>
  3712. * script of transaction output
  3713. * </pre>
  3714. */
  3715. public boolean hasScriptBytes() {
  3716. return ((bitField0_ & 0x00000002) == 0x00000002);
  3717. }
  3718. /**
  3719. * <code>required bytes script_bytes = 2;</code>
  3720. *
  3721. * <pre>
  3722. * script of transaction output
  3723. * </pre>
  3724. */
  3725. public com.google.protobuf.ByteString getScriptBytes() {
  3726. return scriptBytes_;
  3727. }
  3728. /**
  3729. * <code>required bytes script_bytes = 2;</code>
  3730. *
  3731. * <pre>
  3732. * script of transaction output
  3733. * </pre>
  3734. */
  3735. public Builder setScriptBytes(com.google.protobuf.ByteString value) {
  3736. if (value == null) {
  3737. throw new NullPointerException();
  3738. }
  3739. bitField0_ |= 0x00000002;
  3740. scriptBytes_ = value;
  3741. onChanged();
  3742. return this;
  3743. }
  3744. /**
  3745. * <code>required bytes script_bytes = 2;</code>
  3746. *
  3747. * <pre>
  3748. * script of transaction output
  3749. * </pre>
  3750. */
  3751. public Builder clearScriptBytes() {
  3752. bitField0_ = (bitField0_ & ~0x00000002);
  3753. scriptBytes_ = getDefaultInstance().getScriptBytes();
  3754. onChanged();
  3755. return this;
  3756. }
  3757. // optional bytes spent_by_transaction_hash = 3;
  3758. private com.google.protobuf.ByteString spentByTransactionHash_ = com.google.protobuf.ByteString.EMPTY;
  3759. /**
  3760. * <code>optional bytes spent_by_transaction_hash = 3;</code>
  3761. *
  3762. * <pre>
  3763. * If spent, the hash of the transaction doing the spend.
  3764. * </pre>
  3765. */
  3766. public boolean hasSpentByTransactionHash() {
  3767. return ((bitField0_ & 0x00000004) == 0x00000004);
  3768. }
  3769. /**
  3770. * <code>optional bytes spent_by_transaction_hash = 3;</code>
  3771. *
  3772. * <pre>
  3773. * If spent, the hash of the transaction doing the spend.
  3774. * </pre>
  3775. */
  3776. public com.google.protobuf.ByteString getSpentByTransactionHash() {
  3777. return spentByTransactionHash_;
  3778. }
  3779. /**
  3780. * <code>optional bytes spent_by_transaction_hash = 3;</code>
  3781. *
  3782. * <pre>
  3783. * If spent, the hash of the transaction doing the spend.
  3784. * </pre>
  3785. */
  3786. public Builder setSpentByTransactionHash(com.google.protobuf.ByteString value) {
  3787. if (value == null) {
  3788. throw new NullPointerException();
  3789. }
  3790. bitField0_ |= 0x00000004;
  3791. spentByTransactionHash_ = value;
  3792. onChanged();
  3793. return this;
  3794. }
  3795. /**
  3796. * <code>optional bytes spent_by_transaction_hash = 3;</code>
  3797. *
  3798. * <pre>
  3799. * If spent, the hash of the transaction doing the spend.
  3800. * </pre>
  3801. */
  3802. public Builder clearSpentByTransactionHash() {
  3803. bitField0_ = (bitField0_ & ~0x00000004);
  3804. spentByTransactionHash_ = getDefaultInstance().getSpentByTransactionHash();
  3805. onChanged();
  3806. return this;
  3807. }
  3808. // optional int32 spent_by_transaction_index = 4;
  3809. private int spentByTransactionIndex_ ;
  3810. /**
  3811. * <code>optional int32 spent_by_transaction_index = 4;</code>
  3812. *
  3813. * <pre>
  3814. * If spent, the index of the transaction input of the transaction doing the spend.
  3815. * </pre>
  3816. */
  3817. public boolean hasSpentByTransactionIndex() {
  3818. return ((bitField0_ & 0x00000008) == 0x00000008);
  3819. }
  3820. /**
  3821. * <code>optional int32 spent_by_transaction_index = 4;</code>
  3822. *
  3823. * <pre>
  3824. * If spent, the index of the transaction input of the transaction doing the spend.
  3825. * </pre>
  3826. */
  3827. public int getSpentByTransactionIndex() {
  3828. return spentByTransactionIndex_;
  3829. }
  3830. /**
  3831. * <code>optional int32 spent_by_transaction_index = 4;</code>
  3832. *
  3833. * <pre>
  3834. * If spent, the index of the transaction input of the transaction doing the spend.
  3835. * </pre>
  3836. */
  3837. public Builder setSpentByTransactionIndex(int value) {
  3838. bitField0_ |= 0x00000008;
  3839. spentByTransactionIndex_ = value;
  3840. onChanged();
  3841. return this;
  3842. }
  3843. /**
  3844. * <code>optional int32 spent_by_transaction_index = 4;</code>
  3845. *
  3846. * <pre>
  3847. * If spent, the index of the transaction input of the transaction doing the spend.
  3848. * </pre>
  3849. */
  3850. public Builder clearSpentByTransactionIndex() {
  3851. bitField0_ = (bitField0_ & ~0x00000008);
  3852. spentByTransactionIndex_ = 0;
  3853. onChanged();
  3854. return this;
  3855. }
  3856. // @@protoc_insertion_point(builder_scope:wallet.TransactionOutput)
  3857. }
  3858. static {
  3859. defaultInstance = new TransactionOutput(true);
  3860. defaultInstance.initFields();
  3861. }
  3862. // @@protoc_insertion_point(class_scope:wallet.TransactionOutput)
  3863. }
  3864. public interface TransactionConfidenceOrBuilder
  3865. extends com.google.protobuf.MessageOrBuilder {
  3866. // optional .wallet.TransactionConfidence.Type type = 1;
  3867. /**
  3868. * <code>optional .wallet.TransactionConfidence.Type type = 1;</code>
  3869. *
  3870. * <pre>
  3871. * This is optional in case we add confidence types to prevent parse errors - backwards compatible.
  3872. * </pre>
  3873. */
  3874. boolean hasType();
  3875. /**
  3876. * <code>optional .wallet.TransactionConfidence.Type type = 1;</code>
  3877. *
  3878. * <pre>
  3879. * This is optional in case we add confidence types to prevent parse errors - backwards compatible.
  3880. * </pre>
  3881. */
  3882. org.bitcoinj.wallet.Protos.TransactionConfidence.Type getType();
  3883. // optional int32 appeared_at_height = 2;
  3884. /**
  3885. * <code>optional int32 appeared_at_height = 2;</code>
  3886. *
  3887. * <pre>
  3888. * If type == BUILDING then this is the chain height at which the transaction was included.
  3889. * </pre>
  3890. */
  3891. boolean hasAppearedAtHeight();
  3892. /**
  3893. * <code>optional int32 appeared_at_height = 2;</code>
  3894. *
  3895. * <pre>
  3896. * If type == BUILDING then this is the chain height at which the transaction was included.
  3897. * </pre>
  3898. */
  3899. int getAppearedAtHeight();
  3900. // optional bytes overriding_transaction = 3;
  3901. /**
  3902. * <code>optional bytes overriding_transaction = 3;</code>
  3903. *
  3904. * <pre>
  3905. * If set, hash of the transaction that double spent this one into oblivion. A transaction can be double spent by
  3906. * multiple transactions in the case of several inputs being re-spent by several transactions but we don't
  3907. * bother to track them all, just the first. This only makes sense if type = DEAD.
  3908. * </pre>
  3909. */
  3910. boolean hasOverridingTransaction();
  3911. /**
  3912. * <code>optional bytes overriding_transaction = 3;</code>
  3913. *
  3914. * <pre>
  3915. * If set, hash of the transaction that double spent this one into oblivion. A transaction can be double spent by
  3916. * multiple transactions in the case of several inputs being re-spent by several transactions but we don't
  3917. * bother to track them all, just the first. This only makes sense if type = DEAD.
  3918. * </pre>
  3919. */
  3920. com.google.protobuf.ByteString getOverridingTransaction();
  3921. // optional int32 depth = 4;
  3922. /**
  3923. * <code>optional int32 depth = 4;</code>
  3924. *
  3925. * <pre>
  3926. * If type == BUILDING then this is the depth of the transaction in the blockchain.
  3927. * Zero confirmations: depth = 0, one confirmation: depth = 1 etc.
  3928. * </pre>
  3929. */
  3930. boolean hasDepth();
  3931. /**
  3932. * <code>optional int32 depth = 4;</code>
  3933. *
  3934. * <pre>
  3935. * If type == BUILDING then this is the depth of the transaction in the blockchain.
  3936. * Zero confirmations: depth = 0, one confirmation: depth = 1 etc.
  3937. * </pre>
  3938. */
  3939. int getDepth();
  3940. // optional int64 work_done = 5;
  3941. /**
  3942. * <code>optional int64 work_done = 5;</code>
  3943. *
  3944. * <pre>
  3945. * If type == BUILDING then this is the cumulative workDone for the block the transaction appears in, together with
  3946. * all blocks that bury it.
  3947. * </pre>
  3948. */
  3949. boolean hasWorkDone();
  3950. /**
  3951. * <code>optional int64 work_done = 5;</code>
  3952. *
  3953. * <pre>
  3954. * If type == BUILDING then this is the cumulative workDone for the block the transaction appears in, together with
  3955. * all blocks that bury it.
  3956. * </pre>
  3957. */
  3958. long getWorkDone();
  3959. // repeated .wallet.PeerAddress broadcast_by = 6;
  3960. /**
  3961. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  3962. */
  3963. java.util.List<org.bitcoinj.wallet.Protos.PeerAddress>
  3964. getBroadcastByList();
  3965. /**
  3966. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  3967. */
  3968. org.bitcoinj.wallet.Protos.PeerAddress getBroadcastBy(int index);
  3969. /**
  3970. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  3971. */
  3972. int getBroadcastByCount();
  3973. /**
  3974. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  3975. */
  3976. java.util.List<? extends org.bitcoinj.wallet.Protos.PeerAddressOrBuilder>
  3977. getBroadcastByOrBuilderList();
  3978. /**
  3979. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  3980. */
  3981. org.bitcoinj.wallet.Protos.PeerAddressOrBuilder getBroadcastByOrBuilder(
  3982. int index);
  3983. // optional .wallet.TransactionConfidence.Source source = 7;
  3984. /**
  3985. * <code>optional .wallet.TransactionConfidence.Source source = 7;</code>
  3986. */
  3987. boolean hasSource();
  3988. /**
  3989. * <code>optional .wallet.TransactionConfidence.Source source = 7;</code>
  3990. */
  3991. org.bitcoinj.wallet.Protos.TransactionConfidence.Source getSource();
  3992. }
  3993. /**
  3994. * Protobuf type {@code wallet.TransactionConfidence}
  3995. *
  3996. * <pre>
  3997. **
  3998. * A description of the confidence we have that a transaction cannot be reversed in the future.
  3999. *
  4000. * Parsing should be lenient, since this could change for different applications yet we should
  4001. * maintain backward compatibility.
  4002. * </pre>
  4003. */
  4004. public static final class TransactionConfidence extends
  4005. com.google.protobuf.GeneratedMessage
  4006. implements TransactionConfidenceOrBuilder {
  4007. // Use TransactionConfidence.newBuilder() to construct.
  4008. private TransactionConfidence(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  4009. super(builder);
  4010. this.unknownFields = builder.getUnknownFields();
  4011. }
  4012. private TransactionConfidence(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  4013. private static final TransactionConfidence defaultInstance;
  4014. public static TransactionConfidence getDefaultInstance() {
  4015. return defaultInstance;
  4016. }
  4017. public TransactionConfidence getDefaultInstanceForType() {
  4018. return defaultInstance;
  4019. }
  4020. private final com.google.protobuf.UnknownFieldSet unknownFields;
  4021. @java.lang.Override
  4022. public final com.google.protobuf.UnknownFieldSet
  4023. getUnknownFields() {
  4024. return this.unknownFields;
  4025. }
  4026. private TransactionConfidence(
  4027. com.google.protobuf.CodedInputStream input,
  4028. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  4029. throws com.google.protobuf.InvalidProtocolBufferException {
  4030. initFields();
  4031. int mutable_bitField0_ = 0;
  4032. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  4033. com.google.protobuf.UnknownFieldSet.newBuilder();
  4034. try {
  4035. boolean done = false;
  4036. while (!done) {
  4037. int tag = input.readTag();
  4038. switch (tag) {
  4039. case 0:
  4040. done = true;
  4041. break;
  4042. default: {
  4043. if (!parseUnknownField(input, unknownFields,
  4044. extensionRegistry, tag)) {
  4045. done = true;
  4046. }
  4047. break;
  4048. }
  4049. case 8: {
  4050. int rawValue = input.readEnum();
  4051. org.bitcoinj.wallet.Protos.TransactionConfidence.Type value = org.bitcoinj.wallet.Protos.TransactionConfidence.Type.valueOf(rawValue);
  4052. if (value == null) {
  4053. unknownFields.mergeVarintField(1, rawValue);
  4054. } else {
  4055. bitField0_ |= 0x00000001;
  4056. type_ = value;
  4057. }
  4058. break;
  4059. }
  4060. case 16: {
  4061. bitField0_ |= 0x00000002;
  4062. appearedAtHeight_ = input.readInt32();
  4063. break;
  4064. }
  4065. case 26: {
  4066. bitField0_ |= 0x00000004;
  4067. overridingTransaction_ = input.readBytes();
  4068. break;
  4069. }
  4070. case 32: {
  4071. bitField0_ |= 0x00000008;
  4072. depth_ = input.readInt32();
  4073. break;
  4074. }
  4075. case 40: {
  4076. bitField0_ |= 0x00000010;
  4077. workDone_ = input.readInt64();
  4078. break;
  4079. }
  4080. case 50: {
  4081. if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
  4082. broadcastBy_ = new java.util.ArrayList<org.bitcoinj.wallet.Protos.PeerAddress>();
  4083. mutable_bitField0_ |= 0x00000020;
  4084. }
  4085. broadcastBy_.add(input.readMessage(org.bitcoinj.wallet.Protos.PeerAddress.PARSER, extensionRegistry));
  4086. break;
  4087. }
  4088. case 56: {
  4089. int rawValue = input.readEnum();
  4090. org.bitcoinj.wallet.Protos.TransactionConfidence.Source value = org.bitcoinj.wallet.Protos.TransactionConfidence.Source.valueOf(rawValue);
  4091. if (value == null) {
  4092. unknownFields.mergeVarintField(7, rawValue);
  4093. } else {
  4094. bitField0_ |= 0x00000020;
  4095. source_ = value;
  4096. }
  4097. break;
  4098. }
  4099. }
  4100. }
  4101. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  4102. throw e.setUnfinishedMessage(this);
  4103. } catch (java.io.IOException e) {
  4104. throw new com.google.protobuf.InvalidProtocolBufferException(
  4105. e.getMessage()).setUnfinishedMessage(this);
  4106. } finally {
  4107. if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
  4108. broadcastBy_ = java.util.Collections.unmodifiableList(broadcastBy_);
  4109. }
  4110. this.unknownFields = unknownFields.build();
  4111. makeExtensionsImmutable();
  4112. }
  4113. }
  4114. public static final com.google.protobuf.Descriptors.Descriptor
  4115. getDescriptor() {
  4116. return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionConfidence_descriptor;
  4117. }
  4118. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  4119. internalGetFieldAccessorTable() {
  4120. return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionConfidence_fieldAccessorTable
  4121. .ensureFieldAccessorsInitialized(
  4122. org.bitcoinj.wallet.Protos.TransactionConfidence.class, org.bitcoinj.wallet.Protos.TransactionConfidence.Builder.class);
  4123. }
  4124. public static com.google.protobuf.Parser<TransactionConfidence> PARSER =
  4125. new com.google.protobuf.AbstractParser<TransactionConfidence>() {
  4126. public TransactionConfidence parsePartialFrom(
  4127. com.google.protobuf.CodedInputStream input,
  4128. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  4129. throws com.google.protobuf.InvalidProtocolBufferException {
  4130. return new TransactionConfidence(input, extensionRegistry);
  4131. }
  4132. };
  4133. @java.lang.Override
  4134. public com.google.protobuf.Parser<TransactionConfidence> getParserForType() {
  4135. return PARSER;
  4136. }
  4137. /**
  4138. * Protobuf enum {@code wallet.TransactionConfidence.Type}
  4139. */
  4140. public enum Type
  4141. implements com.google.protobuf.ProtocolMessageEnum {
  4142. /**
  4143. * <code>UNKNOWN = 0;</code>
  4144. */
  4145. UNKNOWN(0, 0),
  4146. /**
  4147. * <code>BUILDING = 1;</code>
  4148. *
  4149. * <pre>
  4150. * In best chain. If and only if appeared_at_height is present.
  4151. * </pre>
  4152. */
  4153. BUILDING(1, 1),
  4154. /**
  4155. * <code>PENDING = 2;</code>
  4156. *
  4157. * <pre>
  4158. * Unconfirmed and sitting in the networks memory pools, waiting to be included in the chain.
  4159. * </pre>
  4160. */
  4161. PENDING(2, 2),
  4162. /**
  4163. * <code>NOT_IN_BEST_CHAIN = 3;</code>
  4164. *
  4165. * <pre>
  4166. * Deprecated: equivalent to PENDING.
  4167. * </pre>
  4168. */
  4169. NOT_IN_BEST_CHAIN(3, 3),
  4170. /**
  4171. * <code>DEAD = 4;</code>
  4172. *
  4173. * <pre>
  4174. * Either if overriding_transaction is present or transaction is dead coinbase
  4175. * </pre>
  4176. */
  4177. DEAD(4, 4),
  4178. ;
  4179. /**
  4180. * <code>UNKNOWN = 0;</code>
  4181. */
  4182. public static final int UNKNOWN_VALUE = 0;
  4183. /**
  4184. * <code>BUILDING = 1;</code>
  4185. *
  4186. * <pre>
  4187. * In best chain. If and only if appeared_at_height is present.
  4188. * </pre>
  4189. */
  4190. public static final int BUILDING_VALUE = 1;
  4191. /**
  4192. * <code>PENDING = 2;</code>
  4193. *
  4194. * <pre>
  4195. * Unconfirmed and sitting in the networks memory pools, waiting to be included in the chain.
  4196. * </pre>
  4197. */
  4198. public static final int PENDING_VALUE = 2;
  4199. /**
  4200. * <code>NOT_IN_BEST_CHAIN = 3;</code>
  4201. *
  4202. * <pre>
  4203. * Deprecated: equivalent to PENDING.
  4204. * </pre>
  4205. */
  4206. public static final int NOT_IN_BEST_CHAIN_VALUE = 3;
  4207. /**
  4208. * <code>DEAD = 4;</code>
  4209. *
  4210. * <pre>
  4211. * Either if overriding_transaction is present or transaction is dead coinbase
  4212. * </pre>
  4213. */
  4214. public static final int DEAD_VALUE = 4;
  4215. public final int getNumber() { return value; }
  4216. public static Type valueOf(int value) {
  4217. switch (value) {
  4218. case 0: return UNKNOWN;
  4219. case 1: return BUILDING;
  4220. case 2: return PENDING;
  4221. case 3: return NOT_IN_BEST_CHAIN;
  4222. case 4: return DEAD;
  4223. default: return null;
  4224. }
  4225. }
  4226. public static com.google.protobuf.Internal.EnumLiteMap<Type>
  4227. internalGetValueMap() {
  4228. return internalValueMap;
  4229. }
  4230. private static com.google.protobuf.Internal.EnumLiteMap<Type>
  4231. internalValueMap =
  4232. new com.google.protobuf.Internal.EnumLiteMap<Type>() {
  4233. public Type findValueByNumber(int number) {
  4234. return Type.valueOf(number);
  4235. }
  4236. };
  4237. public final com.google.protobuf.Descriptors.EnumValueDescriptor
  4238. getValueDescriptor() {
  4239. return getDescriptor().getValues().get(index);
  4240. }
  4241. public final com.google.protobuf.Descriptors.EnumDescriptor
  4242. getDescriptorForType() {
  4243. return getDescriptor();
  4244. }
  4245. public static final com.google.protobuf.Descriptors.EnumDescriptor
  4246. getDescriptor() {
  4247. return org.bitcoinj.wallet.Protos.TransactionConfidence.getDescriptor().getEnumTypes().get(0);
  4248. }
  4249. private static final Type[] VALUES = values();
  4250. public static Type valueOf(
  4251. com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
  4252. if (desc.getType() != getDescriptor()) {
  4253. throw new java.lang.IllegalArgumentException(
  4254. "EnumValueDescriptor is not for this type.");
  4255. }
  4256. return VALUES[desc.getIndex()];
  4257. }
  4258. private final int index;
  4259. private final int value;
  4260. private Type(int index, int value) {
  4261. this.index = index;
  4262. this.value = value;
  4263. }
  4264. // @@protoc_insertion_point(enum_scope:wallet.TransactionConfidence.Type)
  4265. }
  4266. /**
  4267. * Protobuf enum {@code wallet.TransactionConfidence.Source}
  4268. *
  4269. * <pre>
  4270. * Where did we get this transaction from? Knowing the source may help us to risk analyze pending transactions.
  4271. * </pre>
  4272. */
  4273. public enum Source
  4274. implements com.google.protobuf.ProtocolMessageEnum {
  4275. /**
  4276. * <code>SOURCE_UNKNOWN = 0;</code>
  4277. *
  4278. * <pre>
  4279. * We don't know where it came from, or this is a wallet from the future.
  4280. * </pre>
  4281. */
  4282. SOURCE_UNKNOWN(0, 0),
  4283. /**
  4284. * <code>SOURCE_NETWORK = 1;</code>
  4285. *
  4286. * <pre>
  4287. * We received it from a network broadcast. This is the normal way to get payments.
  4288. * </pre>
  4289. */
  4290. SOURCE_NETWORK(1, 1),
  4291. /**
  4292. * <code>SOURCE_SELF = 2;</code>
  4293. *
  4294. * <pre>
  4295. * We made it ourselves, so we know it should be valid.
  4296. * </pre>
  4297. */
  4298. SOURCE_SELF(2, 2),
  4299. ;
  4300. /**
  4301. * <code>SOURCE_UNKNOWN = 0;</code>
  4302. *
  4303. * <pre>
  4304. * We don't know where it came from, or this is a wallet from the future.
  4305. * </pre>
  4306. */
  4307. public static final int SOURCE_UNKNOWN_VALUE = 0;
  4308. /**
  4309. * <code>SOURCE_NETWORK = 1;</code>
  4310. *
  4311. * <pre>
  4312. * We received it from a network broadcast. This is the normal way to get payments.
  4313. * </pre>
  4314. */
  4315. public static final int SOURCE_NETWORK_VALUE = 1;
  4316. /**
  4317. * <code>SOURCE_SELF = 2;</code>
  4318. *
  4319. * <pre>
  4320. * We made it ourselves, so we know it should be valid.
  4321. * </pre>
  4322. */
  4323. public static final int SOURCE_SELF_VALUE = 2;
  4324. public final int getNumber() { return value; }
  4325. public static Source valueOf(int value) {
  4326. switch (value) {
  4327. case 0: return SOURCE_UNKNOWN;
  4328. case 1: return SOURCE_NETWORK;
  4329. case 2: return SOURCE_SELF;
  4330. default: return null;
  4331. }
  4332. }
  4333. public static com.google.protobuf.Internal.EnumLiteMap<Source>
  4334. internalGetValueMap() {
  4335. return internalValueMap;
  4336. }
  4337. private static com.google.protobuf.Internal.EnumLiteMap<Source>
  4338. internalValueMap =
  4339. new com.google.protobuf.Internal.EnumLiteMap<Source>() {
  4340. public Source findValueByNumber(int number) {
  4341. return Source.valueOf(number);
  4342. }
  4343. };
  4344. public final com.google.protobuf.Descriptors.EnumValueDescriptor
  4345. getValueDescriptor() {
  4346. return getDescriptor().getValues().get(index);
  4347. }
  4348. public final com.google.protobuf.Descriptors.EnumDescriptor
  4349. getDescriptorForType() {
  4350. return getDescriptor();
  4351. }
  4352. public static final com.google.protobuf.Descriptors.EnumDescriptor
  4353. getDescriptor() {
  4354. return org.bitcoinj.wallet.Protos.TransactionConfidence.getDescriptor().getEnumTypes().get(1);
  4355. }
  4356. private static final Source[] VALUES = values();
  4357. public static Source valueOf(
  4358. com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
  4359. if (desc.getType() != getDescriptor()) {
  4360. throw new java.lang.IllegalArgumentException(
  4361. "EnumValueDescriptor is not for this type.");
  4362. }
  4363. return VALUES[desc.getIndex()];
  4364. }
  4365. private final int index;
  4366. private final int value;
  4367. private Source(int index, int value) {
  4368. this.index = index;
  4369. this.value = value;
  4370. }
  4371. // @@protoc_insertion_point(enum_scope:wallet.TransactionConfidence.Source)
  4372. }
  4373. private int bitField0_;
  4374. // optional .wallet.TransactionConfidence.Type type = 1;
  4375. public static final int TYPE_FIELD_NUMBER = 1;
  4376. private org.bitcoinj.wallet.Protos.TransactionConfidence.Type type_;
  4377. /**
  4378. * <code>optional .wallet.TransactionConfidence.Type type = 1;</code>
  4379. *
  4380. * <pre>
  4381. * This is optional in case we add confidence types to prevent parse errors - backwards compatible.
  4382. * </pre>
  4383. */
  4384. public boolean hasType() {
  4385. return ((bitField0_ & 0x00000001) == 0x00000001);
  4386. }
  4387. /**
  4388. * <code>optional .wallet.TransactionConfidence.Type type = 1;</code>
  4389. *
  4390. * <pre>
  4391. * This is optional in case we add confidence types to prevent parse errors - backwards compatible.
  4392. * </pre>
  4393. */
  4394. public org.bitcoinj.wallet.Protos.TransactionConfidence.Type getType() {
  4395. return type_;
  4396. }
  4397. // optional int32 appeared_at_height = 2;
  4398. public static final int APPEARED_AT_HEIGHT_FIELD_NUMBER = 2;
  4399. private int appearedAtHeight_;
  4400. /**
  4401. * <code>optional int32 appeared_at_height = 2;</code>
  4402. *
  4403. * <pre>
  4404. * If type == BUILDING then this is the chain height at which the transaction was included.
  4405. * </pre>
  4406. */
  4407. public boolean hasAppearedAtHeight() {
  4408. return ((bitField0_ & 0x00000002) == 0x00000002);
  4409. }
  4410. /**
  4411. * <code>optional int32 appeared_at_height = 2;</code>
  4412. *
  4413. * <pre>
  4414. * If type == BUILDING then this is the chain height at which the transaction was included.
  4415. * </pre>
  4416. */
  4417. public int getAppearedAtHeight() {
  4418. return appearedAtHeight_;
  4419. }
  4420. // optional bytes overriding_transaction = 3;
  4421. public static final int OVERRIDING_TRANSACTION_FIELD_NUMBER = 3;
  4422. private com.google.protobuf.ByteString overridingTransaction_;
  4423. /**
  4424. * <code>optional bytes overriding_transaction = 3;</code>
  4425. *
  4426. * <pre>
  4427. * If set, hash of the transaction that double spent this one into oblivion. A transaction can be double spent by
  4428. * multiple transactions in the case of several inputs being re-spent by several transactions but we don't
  4429. * bother to track them all, just the first. This only makes sense if type = DEAD.
  4430. * </pre>
  4431. */
  4432. public boolean hasOverridingTransaction() {
  4433. return ((bitField0_ & 0x00000004) == 0x00000004);
  4434. }
  4435. /**
  4436. * <code>optional bytes overriding_transaction = 3;</code>
  4437. *
  4438. * <pre>
  4439. * If set, hash of the transaction that double spent this one into oblivion. A transaction can be double spent by
  4440. * multiple transactions in the case of several inputs being re-spent by several transactions but we don't
  4441. * bother to track them all, just the first. This only makes sense if type = DEAD.
  4442. * </pre>
  4443. */
  4444. public com.google.protobuf.ByteString getOverridingTransaction() {
  4445. return overridingTransaction_;
  4446. }
  4447. // optional int32 depth = 4;
  4448. public static final int DEPTH_FIELD_NUMBER = 4;
  4449. private int depth_;
  4450. /**
  4451. * <code>optional int32 depth = 4;</code>
  4452. *
  4453. * <pre>
  4454. * If type == BUILDING then this is the depth of the transaction in the blockchain.
  4455. * Zero confirmations: depth = 0, one confirmation: depth = 1 etc.
  4456. * </pre>
  4457. */
  4458. public boolean hasDepth() {
  4459. return ((bitField0_ & 0x00000008) == 0x00000008);
  4460. }
  4461. /**
  4462. * <code>optional int32 depth = 4;</code>
  4463. *
  4464. * <pre>
  4465. * If type == BUILDING then this is the depth of the transaction in the blockchain.
  4466. * Zero confirmations: depth = 0, one confirmation: depth = 1 etc.
  4467. * </pre>
  4468. */
  4469. public int getDepth() {
  4470. return depth_;
  4471. }
  4472. // optional int64 work_done = 5;
  4473. public static final int WORK_DONE_FIELD_NUMBER = 5;
  4474. private long workDone_;
  4475. /**
  4476. * <code>optional int64 work_done = 5;</code>
  4477. *
  4478. * <pre>
  4479. * If type == BUILDING then this is the cumulative workDone for the block the transaction appears in, together with
  4480. * all blocks that bury it.
  4481. * </pre>
  4482. */
  4483. public boolean hasWorkDone() {
  4484. return ((bitField0_ & 0x00000010) == 0x00000010);
  4485. }
  4486. /**
  4487. * <code>optional int64 work_done = 5;</code>
  4488. *
  4489. * <pre>
  4490. * If type == BUILDING then this is the cumulative workDone for the block the transaction appears in, together with
  4491. * all blocks that bury it.
  4492. * </pre>
  4493. */
  4494. public long getWorkDone() {
  4495. return workDone_;
  4496. }
  4497. // repeated .wallet.PeerAddress broadcast_by = 6;
  4498. public static final int BROADCAST_BY_FIELD_NUMBER = 6;
  4499. private java.util.List<org.bitcoinj.wallet.Protos.PeerAddress> broadcastBy_;
  4500. /**
  4501. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  4502. */
  4503. public java.util.List<org.bitcoinj.wallet.Protos.PeerAddress> getBroadcastByList() {
  4504. return broadcastBy_;
  4505. }
  4506. /**
  4507. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  4508. */
  4509. public java.util.List<? extends org.bitcoinj.wallet.Protos.PeerAddressOrBuilder>
  4510. getBroadcastByOrBuilderList() {
  4511. return broadcastBy_;
  4512. }
  4513. /**
  4514. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  4515. */
  4516. public int getBroadcastByCount() {
  4517. return broadcastBy_.size();
  4518. }
  4519. /**
  4520. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  4521. */
  4522. public org.bitcoinj.wallet.Protos.PeerAddress getBroadcastBy(int index) {
  4523. return broadcastBy_.get(index);
  4524. }
  4525. /**
  4526. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  4527. */
  4528. public org.bitcoinj.wallet.Protos.PeerAddressOrBuilder getBroadcastByOrBuilder(
  4529. int index) {
  4530. return broadcastBy_.get(index);
  4531. }
  4532. // optional .wallet.TransactionConfidence.Source source = 7;
  4533. public static final int SOURCE_FIELD_NUMBER = 7;
  4534. private org.bitcoinj.wallet.Protos.TransactionConfidence.Source source_;
  4535. /**
  4536. * <code>optional .wallet.TransactionConfidence.Source source = 7;</code>
  4537. */
  4538. public boolean hasSource() {
  4539. return ((bitField0_ & 0x00000020) == 0x00000020);
  4540. }
  4541. /**
  4542. * <code>optional .wallet.TransactionConfidence.Source source = 7;</code>
  4543. */
  4544. public org.bitcoinj.wallet.Protos.TransactionConfidence.Source getSource() {
  4545. return source_;
  4546. }
  4547. private void initFields() {
  4548. type_ = org.bitcoinj.wallet.Protos.TransactionConfidence.Type.UNKNOWN;
  4549. appearedAtHeight_ = 0;
  4550. overridingTransaction_ = com.google.protobuf.ByteString.EMPTY;
  4551. depth_ = 0;
  4552. workDone_ = 0L;
  4553. broadcastBy_ = java.util.Collections.emptyList();
  4554. source_ = org.bitcoinj.wallet.Protos.TransactionConfidence.Source.SOURCE_UNKNOWN;
  4555. }
  4556. private byte memoizedIsInitialized = -1;
  4557. public final boolean isInitialized() {
  4558. byte isInitialized = memoizedIsInitialized;
  4559. if (isInitialized != -1) return isInitialized == 1;
  4560. for (int i = 0; i < getBroadcastByCount(); i++) {
  4561. if (!getBroadcastBy(i).isInitialized()) {
  4562. memoizedIsInitialized = 0;
  4563. return false;
  4564. }
  4565. }
  4566. memoizedIsInitialized = 1;
  4567. return true;
  4568. }
  4569. public void writeTo(com.google.protobuf.CodedOutputStream output)
  4570. throws java.io.IOException {
  4571. getSerializedSize();
  4572. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  4573. output.writeEnum(1, type_.getNumber());
  4574. }
  4575. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  4576. output.writeInt32(2, appearedAtHeight_);
  4577. }
  4578. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  4579. output.writeBytes(3, overridingTransaction_);
  4580. }
  4581. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  4582. output.writeInt32(4, depth_);
  4583. }
  4584. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  4585. output.writeInt64(5, workDone_);
  4586. }
  4587. for (int i = 0; i < broadcastBy_.size(); i++) {
  4588. output.writeMessage(6, broadcastBy_.get(i));
  4589. }
  4590. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  4591. output.writeEnum(7, source_.getNumber());
  4592. }
  4593. getUnknownFields().writeTo(output);
  4594. }
  4595. private int memoizedSerializedSize = -1;
  4596. public int getSerializedSize() {
  4597. int size = memoizedSerializedSize;
  4598. if (size != -1) return size;
  4599. size = 0;
  4600. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  4601. size += com.google.protobuf.CodedOutputStream
  4602. .computeEnumSize(1, type_.getNumber());
  4603. }
  4604. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  4605. size += com.google.protobuf.CodedOutputStream
  4606. .computeInt32Size(2, appearedAtHeight_);
  4607. }
  4608. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  4609. size += com.google.protobuf.CodedOutputStream
  4610. .computeBytesSize(3, overridingTransaction_);
  4611. }
  4612. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  4613. size += com.google.protobuf.CodedOutputStream
  4614. .computeInt32Size(4, depth_);
  4615. }
  4616. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  4617. size += com.google.protobuf.CodedOutputStream
  4618. .computeInt64Size(5, workDone_);
  4619. }
  4620. for (int i = 0; i < broadcastBy_.size(); i++) {
  4621. size += com.google.protobuf.CodedOutputStream
  4622. .computeMessageSize(6, broadcastBy_.get(i));
  4623. }
  4624. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  4625. size += com.google.protobuf.CodedOutputStream
  4626. .computeEnumSize(7, source_.getNumber());
  4627. }
  4628. size += getUnknownFields().getSerializedSize();
  4629. memoizedSerializedSize = size;
  4630. return size;
  4631. }
  4632. private static final long serialVersionUID = 0L;
  4633. @java.lang.Override
  4634. protected java.lang.Object writeReplace()
  4635. throws java.io.ObjectStreamException {
  4636. return super.writeReplace();
  4637. }
  4638. public static org.bitcoinj.wallet.Protos.TransactionConfidence parseFrom(
  4639. com.google.protobuf.ByteString data)
  4640. throws com.google.protobuf.InvalidProtocolBufferException {
  4641. return PARSER.parseFrom(data);
  4642. }
  4643. public static org.bitcoinj.wallet.Protos.TransactionConfidence parseFrom(
  4644. com.google.protobuf.ByteString data,
  4645. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  4646. throws com.google.protobuf.InvalidProtocolBufferException {
  4647. return PARSER.parseFrom(data, extensionRegistry);
  4648. }
  4649. public static org.bitcoinj.wallet.Protos.TransactionConfidence parseFrom(byte[] data)
  4650. throws com.google.protobuf.InvalidProtocolBufferException {
  4651. return PARSER.parseFrom(data);
  4652. }
  4653. public static org.bitcoinj.wallet.Protos.TransactionConfidence parseFrom(
  4654. byte[] data,
  4655. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  4656. throws com.google.protobuf.InvalidProtocolBufferException {
  4657. return PARSER.parseFrom(data, extensionRegistry);
  4658. }
  4659. public static org.bitcoinj.wallet.Protos.TransactionConfidence parseFrom(java.io.InputStream input)
  4660. throws java.io.IOException {
  4661. return PARSER.parseFrom(input);
  4662. }
  4663. public static org.bitcoinj.wallet.Protos.TransactionConfidence parseFrom(
  4664. java.io.InputStream input,
  4665. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  4666. throws java.io.IOException {
  4667. return PARSER.parseFrom(input, extensionRegistry);
  4668. }
  4669. public static org.bitcoinj.wallet.Protos.TransactionConfidence parseDelimitedFrom(java.io.InputStream input)
  4670. throws java.io.IOException {
  4671. return PARSER.parseDelimitedFrom(input);
  4672. }
  4673. public static org.bitcoinj.wallet.Protos.TransactionConfidence parseDelimitedFrom(
  4674. java.io.InputStream input,
  4675. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  4676. throws java.io.IOException {
  4677. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  4678. }
  4679. public static org.bitcoinj.wallet.Protos.TransactionConfidence parseFrom(
  4680. com.google.protobuf.CodedInputStream input)
  4681. throws java.io.IOException {
  4682. return PARSER.parseFrom(input);
  4683. }
  4684. public static org.bitcoinj.wallet.Protos.TransactionConfidence parseFrom(
  4685. com.google.protobuf.CodedInputStream input,
  4686. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  4687. throws java.io.IOException {
  4688. return PARSER.parseFrom(input, extensionRegistry);
  4689. }
  4690. public static Builder newBuilder() { return Builder.create(); }
  4691. public Builder newBuilderForType() { return newBuilder(); }
  4692. public static Builder newBuilder(org.bitcoinj.wallet.Protos.TransactionConfidence prototype) {
  4693. return newBuilder().mergeFrom(prototype);
  4694. }
  4695. public Builder toBuilder() { return newBuilder(this); }
  4696. @java.lang.Override
  4697. protected Builder newBuilderForType(
  4698. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  4699. Builder builder = new Builder(parent);
  4700. return builder;
  4701. }
  4702. /**
  4703. * Protobuf type {@code wallet.TransactionConfidence}
  4704. *
  4705. * <pre>
  4706. **
  4707. * A description of the confidence we have that a transaction cannot be reversed in the future.
  4708. *
  4709. * Parsing should be lenient, since this could change for different applications yet we should
  4710. * maintain backward compatibility.
  4711. * </pre>
  4712. */
  4713. public static final class Builder extends
  4714. com.google.protobuf.GeneratedMessage.Builder<Builder>
  4715. implements org.bitcoinj.wallet.Protos.TransactionConfidenceOrBuilder {
  4716. public static final com.google.protobuf.Descriptors.Descriptor
  4717. getDescriptor() {
  4718. return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionConfidence_descriptor;
  4719. }
  4720. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  4721. internalGetFieldAccessorTable() {
  4722. return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionConfidence_fieldAccessorTable
  4723. .ensureFieldAccessorsInitialized(
  4724. org.bitcoinj.wallet.Protos.TransactionConfidence.class, org.bitcoinj.wallet.Protos.TransactionConfidence.Builder.class);
  4725. }
  4726. // Construct using org.bitcoinj.wallet.Protos.TransactionConfidence.newBuilder()
  4727. private Builder() {
  4728. maybeForceBuilderInitialization();
  4729. }
  4730. private Builder(
  4731. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  4732. super(parent);
  4733. maybeForceBuilderInitialization();
  4734. }
  4735. private void maybeForceBuilderInitialization() {
  4736. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  4737. getBroadcastByFieldBuilder();
  4738. }
  4739. }
  4740. private static Builder create() {
  4741. return new Builder();
  4742. }
  4743. public Builder clear() {
  4744. super.clear();
  4745. type_ = org.bitcoinj.wallet.Protos.TransactionConfidence.Type.UNKNOWN;
  4746. bitField0_ = (bitField0_ & ~0x00000001);
  4747. appearedAtHeight_ = 0;
  4748. bitField0_ = (bitField0_ & ~0x00000002);
  4749. overridingTransaction_ = com.google.protobuf.ByteString.EMPTY;
  4750. bitField0_ = (bitField0_ & ~0x00000004);
  4751. depth_ = 0;
  4752. bitField0_ = (bitField0_ & ~0x00000008);
  4753. workDone_ = 0L;
  4754. bitField0_ = (bitField0_ & ~0x00000010);
  4755. if (broadcastByBuilder_ == null) {
  4756. broadcastBy_ = java.util.Collections.emptyList();
  4757. bitField0_ = (bitField0_ & ~0x00000020);
  4758. } else {
  4759. broadcastByBuilder_.clear();
  4760. }
  4761. source_ = org.bitcoinj.wallet.Protos.TransactionConfidence.Source.SOURCE_UNKNOWN;
  4762. bitField0_ = (bitField0_ & ~0x00000040);
  4763. return this;
  4764. }
  4765. public Builder clone() {
  4766. return create().mergeFrom(buildPartial());
  4767. }
  4768. public com.google.protobuf.Descriptors.Descriptor
  4769. getDescriptorForType() {
  4770. return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionConfidence_descriptor;
  4771. }
  4772. public org.bitcoinj.wallet.Protos.TransactionConfidence getDefaultInstanceForType() {
  4773. return org.bitcoinj.wallet.Protos.TransactionConfidence.getDefaultInstance();
  4774. }
  4775. public org.bitcoinj.wallet.Protos.TransactionConfidence build() {
  4776. org.bitcoinj.wallet.Protos.TransactionConfidence result = buildPartial();
  4777. if (!result.isInitialized()) {
  4778. throw newUninitializedMessageException(result);
  4779. }
  4780. return result;
  4781. }
  4782. public org.bitcoinj.wallet.Protos.TransactionConfidence buildPartial() {
  4783. org.bitcoinj.wallet.Protos.TransactionConfidence result = new org.bitcoinj.wallet.Protos.TransactionConfidence(this);
  4784. int from_bitField0_ = bitField0_;
  4785. int to_bitField0_ = 0;
  4786. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  4787. to_bitField0_ |= 0x00000001;
  4788. }
  4789. result.type_ = type_;
  4790. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  4791. to_bitField0_ |= 0x00000002;
  4792. }
  4793. result.appearedAtHeight_ = appearedAtHeight_;
  4794. if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
  4795. to_bitField0_ |= 0x00000004;
  4796. }
  4797. result.overridingTransaction_ = overridingTransaction_;
  4798. if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
  4799. to_bitField0_ |= 0x00000008;
  4800. }
  4801. result.depth_ = depth_;
  4802. if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
  4803. to_bitField0_ |= 0x00000010;
  4804. }
  4805. result.workDone_ = workDone_;
  4806. if (broadcastByBuilder_ == null) {
  4807. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  4808. broadcastBy_ = java.util.Collections.unmodifiableList(broadcastBy_);
  4809. bitField0_ = (bitField0_ & ~0x00000020);
  4810. }
  4811. result.broadcastBy_ = broadcastBy_;
  4812. } else {
  4813. result.broadcastBy_ = broadcastByBuilder_.build();
  4814. }
  4815. if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
  4816. to_bitField0_ |= 0x00000020;
  4817. }
  4818. result.source_ = source_;
  4819. result.bitField0_ = to_bitField0_;
  4820. onBuilt();
  4821. return result;
  4822. }
  4823. public Builder mergeFrom(com.google.protobuf.Message other) {
  4824. if (other instanceof org.bitcoinj.wallet.Protos.TransactionConfidence) {
  4825. return mergeFrom((org.bitcoinj.wallet.Protos.TransactionConfidence)other);
  4826. } else {
  4827. super.mergeFrom(other);
  4828. return this;
  4829. }
  4830. }
  4831. public Builder mergeFrom(org.bitcoinj.wallet.Protos.TransactionConfidence other) {
  4832. if (other == org.bitcoinj.wallet.Protos.TransactionConfidence.getDefaultInstance()) return this;
  4833. if (other.hasType()) {
  4834. setType(other.getType());
  4835. }
  4836. if (other.hasAppearedAtHeight()) {
  4837. setAppearedAtHeight(other.getAppearedAtHeight());
  4838. }
  4839. if (other.hasOverridingTransaction()) {
  4840. setOverridingTransaction(other.getOverridingTransaction());
  4841. }
  4842. if (other.hasDepth()) {
  4843. setDepth(other.getDepth());
  4844. }
  4845. if (other.hasWorkDone()) {
  4846. setWorkDone(other.getWorkDone());
  4847. }
  4848. if (broadcastByBuilder_ == null) {
  4849. if (!other.broadcastBy_.isEmpty()) {
  4850. if (broadcastBy_.isEmpty()) {
  4851. broadcastBy_ = other.broadcastBy_;
  4852. bitField0_ = (bitField0_ & ~0x00000020);
  4853. } else {
  4854. ensureBroadcastByIsMutable();
  4855. broadcastBy_.addAll(other.broadcastBy_);
  4856. }
  4857. onChanged();
  4858. }
  4859. } else {
  4860. if (!other.broadcastBy_.isEmpty()) {
  4861. if (broadcastByBuilder_.isEmpty()) {
  4862. broadcastByBuilder_.dispose();
  4863. broadcastByBuilder_ = null;
  4864. broadcastBy_ = other.broadcastBy_;
  4865. bitField0_ = (bitField0_ & ~0x00000020);
  4866. broadcastByBuilder_ =
  4867. com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
  4868. getBroadcastByFieldBuilder() : null;
  4869. } else {
  4870. broadcastByBuilder_.addAllMessages(other.broadcastBy_);
  4871. }
  4872. }
  4873. }
  4874. if (other.hasSource()) {
  4875. setSource(other.getSource());
  4876. }
  4877. this.mergeUnknownFields(other.getUnknownFields());
  4878. return this;
  4879. }
  4880. public final boolean isInitialized() {
  4881. for (int i = 0; i < getBroadcastByCount(); i++) {
  4882. if (!getBroadcastBy(i).isInitialized()) {
  4883. return false;
  4884. }
  4885. }
  4886. return true;
  4887. }
  4888. public Builder mergeFrom(
  4889. com.google.protobuf.CodedInputStream input,
  4890. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  4891. throws java.io.IOException {
  4892. org.bitcoinj.wallet.Protos.TransactionConfidence parsedMessage = null;
  4893. try {
  4894. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  4895. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  4896. parsedMessage = (org.bitcoinj.wallet.Protos.TransactionConfidence) e.getUnfinishedMessage();
  4897. throw e;
  4898. } finally {
  4899. if (parsedMessage != null) {
  4900. mergeFrom(parsedMessage);
  4901. }
  4902. }
  4903. return this;
  4904. }
  4905. private int bitField0_;
  4906. // optional .wallet.TransactionConfidence.Type type = 1;
  4907. private org.bitcoinj.wallet.Protos.TransactionConfidence.Type type_ = org.bitcoinj.wallet.Protos.TransactionConfidence.Type.UNKNOWN;
  4908. /**
  4909. * <code>optional .wallet.TransactionConfidence.Type type = 1;</code>
  4910. *
  4911. * <pre>
  4912. * This is optional in case we add confidence types to prevent parse errors - backwards compatible.
  4913. * </pre>
  4914. */
  4915. public boolean hasType() {
  4916. return ((bitField0_ & 0x00000001) == 0x00000001);
  4917. }
  4918. /**
  4919. * <code>optional .wallet.TransactionConfidence.Type type = 1;</code>
  4920. *
  4921. * <pre>
  4922. * This is optional in case we add confidence types to prevent parse errors - backwards compatible.
  4923. * </pre>
  4924. */
  4925. public org.bitcoinj.wallet.Protos.TransactionConfidence.Type getType() {
  4926. return type_;
  4927. }
  4928. /**
  4929. * <code>optional .wallet.TransactionConfidence.Type type = 1;</code>
  4930. *
  4931. * <pre>
  4932. * This is optional in case we add confidence types to prevent parse errors - backwards compatible.
  4933. * </pre>
  4934. */
  4935. public Builder setType(org.bitcoinj.wallet.Protos.TransactionConfidence.Type value) {
  4936. if (value == null) {
  4937. throw new NullPointerException();
  4938. }
  4939. bitField0_ |= 0x00000001;
  4940. type_ = value;
  4941. onChanged();
  4942. return this;
  4943. }
  4944. /**
  4945. * <code>optional .wallet.TransactionConfidence.Type type = 1;</code>
  4946. *
  4947. * <pre>
  4948. * This is optional in case we add confidence types to prevent parse errors - backwards compatible.
  4949. * </pre>
  4950. */
  4951. public Builder clearType() {
  4952. bitField0_ = (bitField0_ & ~0x00000001);
  4953. type_ = org.bitcoinj.wallet.Protos.TransactionConfidence.Type.UNKNOWN;
  4954. onChanged();
  4955. return this;
  4956. }
  4957. // optional int32 appeared_at_height = 2;
  4958. private int appearedAtHeight_ ;
  4959. /**
  4960. * <code>optional int32 appeared_at_height = 2;</code>
  4961. *
  4962. * <pre>
  4963. * If type == BUILDING then this is the chain height at which the transaction was included.
  4964. * </pre>
  4965. */
  4966. public boolean hasAppearedAtHeight() {
  4967. return ((bitField0_ & 0x00000002) == 0x00000002);
  4968. }
  4969. /**
  4970. * <code>optional int32 appeared_at_height = 2;</code>
  4971. *
  4972. * <pre>
  4973. * If type == BUILDING then this is the chain height at which the transaction was included.
  4974. * </pre>
  4975. */
  4976. public int getAppearedAtHeight() {
  4977. return appearedAtHeight_;
  4978. }
  4979. /**
  4980. * <code>optional int32 appeared_at_height = 2;</code>
  4981. *
  4982. * <pre>
  4983. * If type == BUILDING then this is the chain height at which the transaction was included.
  4984. * </pre>
  4985. */
  4986. public Builder setAppearedAtHeight(int value) {
  4987. bitField0_ |= 0x00000002;
  4988. appearedAtHeight_ = value;
  4989. onChanged();
  4990. return this;
  4991. }
  4992. /**
  4993. * <code>optional int32 appeared_at_height = 2;</code>
  4994. *
  4995. * <pre>
  4996. * If type == BUILDING then this is the chain height at which the transaction was included.
  4997. * </pre>
  4998. */
  4999. public Builder clearAppearedAtHeight() {
  5000. bitField0_ = (bitField0_ & ~0x00000002);
  5001. appearedAtHeight_ = 0;
  5002. onChanged();
  5003. return this;
  5004. }
  5005. // optional bytes overriding_transaction = 3;
  5006. private com.google.protobuf.ByteString overridingTransaction_ = com.google.protobuf.ByteString.EMPTY;
  5007. /**
  5008. * <code>optional bytes overriding_transaction = 3;</code>
  5009. *
  5010. * <pre>
  5011. * If set, hash of the transaction that double spent this one into oblivion. A transaction can be double spent by
  5012. * multiple transactions in the case of several inputs being re-spent by several transactions but we don't
  5013. * bother to track them all, just the first. This only makes sense if type = DEAD.
  5014. * </pre>
  5015. */
  5016. public boolean hasOverridingTransaction() {
  5017. return ((bitField0_ & 0x00000004) == 0x00000004);
  5018. }
  5019. /**
  5020. * <code>optional bytes overriding_transaction = 3;</code>
  5021. *
  5022. * <pre>
  5023. * If set, hash of the transaction that double spent this one into oblivion. A transaction can be double spent by
  5024. * multiple transactions in the case of several inputs being re-spent by several transactions but we don't
  5025. * bother to track them all, just the first. This only makes sense if type = DEAD.
  5026. * </pre>
  5027. */
  5028. public com.google.protobuf.ByteString getOverridingTransaction() {
  5029. return overridingTransaction_;
  5030. }
  5031. /**
  5032. * <code>optional bytes overriding_transaction = 3;</code>
  5033. *
  5034. * <pre>
  5035. * If set, hash of the transaction that double spent this one into oblivion. A transaction can be double spent by
  5036. * multiple transactions in the case of several inputs being re-spent by several transactions but we don't
  5037. * bother to track them all, just the first. This only makes sense if type = DEAD.
  5038. * </pre>
  5039. */
  5040. public Builder setOverridingTransaction(com.google.protobuf.ByteString value) {
  5041. if (value == null) {
  5042. throw new NullPointerException();
  5043. }
  5044. bitField0_ |= 0x00000004;
  5045. overridingTransaction_ = value;
  5046. onChanged();
  5047. return this;
  5048. }
  5049. /**
  5050. * <code>optional bytes overriding_transaction = 3;</code>
  5051. *
  5052. * <pre>
  5053. * If set, hash of the transaction that double spent this one into oblivion. A transaction can be double spent by
  5054. * multiple transactions in the case of several inputs being re-spent by several transactions but we don't
  5055. * bother to track them all, just the first. This only makes sense if type = DEAD.
  5056. * </pre>
  5057. */
  5058. public Builder clearOverridingTransaction() {
  5059. bitField0_ = (bitField0_ & ~0x00000004);
  5060. overridingTransaction_ = getDefaultInstance().getOverridingTransaction();
  5061. onChanged();
  5062. return this;
  5063. }
  5064. // optional int32 depth = 4;
  5065. private int depth_ ;
  5066. /**
  5067. * <code>optional int32 depth = 4;</code>
  5068. *
  5069. * <pre>
  5070. * If type == BUILDING then this is the depth of the transaction in the blockchain.
  5071. * Zero confirmations: depth = 0, one confirmation: depth = 1 etc.
  5072. * </pre>
  5073. */
  5074. public boolean hasDepth() {
  5075. return ((bitField0_ & 0x00000008) == 0x00000008);
  5076. }
  5077. /**
  5078. * <code>optional int32 depth = 4;</code>
  5079. *
  5080. * <pre>
  5081. * If type == BUILDING then this is the depth of the transaction in the blockchain.
  5082. * Zero confirmations: depth = 0, one confirmation: depth = 1 etc.
  5083. * </pre>
  5084. */
  5085. public int getDepth() {
  5086. return depth_;
  5087. }
  5088. /**
  5089. * <code>optional int32 depth = 4;</code>
  5090. *
  5091. * <pre>
  5092. * If type == BUILDING then this is the depth of the transaction in the blockchain.
  5093. * Zero confirmations: depth = 0, one confirmation: depth = 1 etc.
  5094. * </pre>
  5095. */
  5096. public Builder setDepth(int value) {
  5097. bitField0_ |= 0x00000008;
  5098. depth_ = value;
  5099. onChanged();
  5100. return this;
  5101. }
  5102. /**
  5103. * <code>optional int32 depth = 4;</code>
  5104. *
  5105. * <pre>
  5106. * If type == BUILDING then this is the depth of the transaction in the blockchain.
  5107. * Zero confirmations: depth = 0, one confirmation: depth = 1 etc.
  5108. * </pre>
  5109. */
  5110. public Builder clearDepth() {
  5111. bitField0_ = (bitField0_ & ~0x00000008);
  5112. depth_ = 0;
  5113. onChanged();
  5114. return this;
  5115. }
  5116. // optional int64 work_done = 5;
  5117. private long workDone_ ;
  5118. /**
  5119. * <code>optional int64 work_done = 5;</code>
  5120. *
  5121. * <pre>
  5122. * If type == BUILDING then this is the cumulative workDone for the block the transaction appears in, together with
  5123. * all blocks that bury it.
  5124. * </pre>
  5125. */
  5126. public boolean hasWorkDone() {
  5127. return ((bitField0_ & 0x00000010) == 0x00000010);
  5128. }
  5129. /**
  5130. * <code>optional int64 work_done = 5;</code>
  5131. *
  5132. * <pre>
  5133. * If type == BUILDING then this is the cumulative workDone for the block the transaction appears in, together with
  5134. * all blocks that bury it.
  5135. * </pre>
  5136. */
  5137. public long getWorkDone() {
  5138. return workDone_;
  5139. }
  5140. /**
  5141. * <code>optional int64 work_done = 5;</code>
  5142. *
  5143. * <pre>
  5144. * If type == BUILDING then this is the cumulative workDone for the block the transaction appears in, together with
  5145. * all blocks that bury it.
  5146. * </pre>
  5147. */
  5148. public Builder setWorkDone(long value) {
  5149. bitField0_ |= 0x00000010;
  5150. workDone_ = value;
  5151. onChanged();
  5152. return this;
  5153. }
  5154. /**
  5155. * <code>optional int64 work_done = 5;</code>
  5156. *
  5157. * <pre>
  5158. * If type == BUILDING then this is the cumulative workDone for the block the transaction appears in, together with
  5159. * all blocks that bury it.
  5160. * </pre>
  5161. */
  5162. public Builder clearWorkDone() {
  5163. bitField0_ = (bitField0_ & ~0x00000010);
  5164. workDone_ = 0L;
  5165. onChanged();
  5166. return this;
  5167. }
  5168. // repeated .wallet.PeerAddress broadcast_by = 6;
  5169. private java.util.List<org.bitcoinj.wallet.Protos.PeerAddress> broadcastBy_ =
  5170. java.util.Collections.emptyList();
  5171. private void ensureBroadcastByIsMutable() {
  5172. if (!((bitField0_ & 0x00000020) == 0x00000020)) {
  5173. broadcastBy_ = new java.util.ArrayList<org.bitcoinj.wallet.Protos.PeerAddress>(broadcastBy_);
  5174. bitField0_ |= 0x00000020;
  5175. }
  5176. }
  5177. private com.google.protobuf.RepeatedFieldBuilder<
  5178. org.bitcoinj.wallet.Protos.PeerAddress, org.bitcoinj.wallet.Protos.PeerAddress.Builder, org.bitcoinj.wallet.Protos.PeerAddressOrBuilder> broadcastByBuilder_;
  5179. /**
  5180. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  5181. */
  5182. public java.util.List<org.bitcoinj.wallet.Protos.PeerAddress> getBroadcastByList() {
  5183. if (broadcastByBuilder_ == null) {
  5184. return java.util.Collections.unmodifiableList(broadcastBy_);
  5185. } else {
  5186. return broadcastByBuilder_.getMessageList();
  5187. }
  5188. }
  5189. /**
  5190. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  5191. */
  5192. public int getBroadcastByCount() {
  5193. if (broadcastByBuilder_ == null) {
  5194. return broadcastBy_.size();
  5195. } else {
  5196. return broadcastByBuilder_.getCount();
  5197. }
  5198. }
  5199. /**
  5200. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  5201. */
  5202. public org.bitcoinj.wallet.Protos.PeerAddress getBroadcastBy(int index) {
  5203. if (broadcastByBuilder_ == null) {
  5204. return broadcastBy_.get(index);
  5205. } else {
  5206. return broadcastByBuilder_.getMessage(index);
  5207. }
  5208. }
  5209. /**
  5210. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  5211. */
  5212. public Builder setBroadcastBy(
  5213. int index, org.bitcoinj.wallet.Protos.PeerAddress value) {
  5214. if (broadcastByBuilder_ == null) {
  5215. if (value == null) {
  5216. throw new NullPointerException();
  5217. }
  5218. ensureBroadcastByIsMutable();
  5219. broadcastBy_.set(index, value);
  5220. onChanged();
  5221. } else {
  5222. broadcastByBuilder_.setMessage(index, value);
  5223. }
  5224. return this;
  5225. }
  5226. /**
  5227. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  5228. */
  5229. public Builder setBroadcastBy(
  5230. int index, org.bitcoinj.wallet.Protos.PeerAddress.Builder builderForValue) {
  5231. if (broadcastByBuilder_ == null) {
  5232. ensureBroadcastByIsMutable();
  5233. broadcastBy_.set(index, builderForValue.build());
  5234. onChanged();
  5235. } else {
  5236. broadcastByBuilder_.setMessage(index, builderForValue.build());
  5237. }
  5238. return this;
  5239. }
  5240. /**
  5241. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  5242. */
  5243. public Builder addBroadcastBy(org.bitcoinj.wallet.Protos.PeerAddress value) {
  5244. if (broadcastByBuilder_ == null) {
  5245. if (value == null) {
  5246. throw new NullPointerException();
  5247. }
  5248. ensureBroadcastByIsMutable();
  5249. broadcastBy_.add(value);
  5250. onChanged();
  5251. } else {
  5252. broadcastByBuilder_.addMessage(value);
  5253. }
  5254. return this;
  5255. }
  5256. /**
  5257. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  5258. */
  5259. public Builder addBroadcastBy(
  5260. int index, org.bitcoinj.wallet.Protos.PeerAddress value) {
  5261. if (broadcastByBuilder_ == null) {
  5262. if (value == null) {
  5263. throw new NullPointerException();
  5264. }
  5265. ensureBroadcastByIsMutable();
  5266. broadcastBy_.add(index, value);
  5267. onChanged();
  5268. } else {
  5269. broadcastByBuilder_.addMessage(index, value);
  5270. }
  5271. return this;
  5272. }
  5273. /**
  5274. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  5275. */
  5276. public Builder addBroadcastBy(
  5277. org.bitcoinj.wallet.Protos.PeerAddress.Builder builderForValue) {
  5278. if (broadcastByBuilder_ == null) {
  5279. ensureBroadcastByIsMutable();
  5280. broadcastBy_.add(builderForValue.build());
  5281. onChanged();
  5282. } else {
  5283. broadcastByBuilder_.addMessage(builderForValue.build());
  5284. }
  5285. return this;
  5286. }
  5287. /**
  5288. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  5289. */
  5290. public Builder addBroadcastBy(
  5291. int index, org.bitcoinj.wallet.Protos.PeerAddress.Builder builderForValue) {
  5292. if (broadcastByBuilder_ == null) {
  5293. ensureBroadcastByIsMutable();
  5294. broadcastBy_.add(index, builderForValue.build());
  5295. onChanged();
  5296. } else {
  5297. broadcastByBuilder_.addMessage(index, builderForValue.build());
  5298. }
  5299. return this;
  5300. }
  5301. /**
  5302. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  5303. */
  5304. public Builder addAllBroadcastBy(
  5305. java.lang.Iterable<? extends org.bitcoinj.wallet.Protos.PeerAddress> values) {
  5306. if (broadcastByBuilder_ == null) {
  5307. ensureBroadcastByIsMutable();
  5308. super.addAll(values, broadcastBy_);
  5309. onChanged();
  5310. } else {
  5311. broadcastByBuilder_.addAllMessages(values);
  5312. }
  5313. return this;
  5314. }
  5315. /**
  5316. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  5317. */
  5318. public Builder clearBroadcastBy() {
  5319. if (broadcastByBuilder_ == null) {
  5320. broadcastBy_ = java.util.Collections.emptyList();
  5321. bitField0_ = (bitField0_ & ~0x00000020);
  5322. onChanged();
  5323. } else {
  5324. broadcastByBuilder_.clear();
  5325. }
  5326. return this;
  5327. }
  5328. /**
  5329. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  5330. */
  5331. public Builder removeBroadcastBy(int index) {
  5332. if (broadcastByBuilder_ == null) {
  5333. ensureBroadcastByIsMutable();
  5334. broadcastBy_.remove(index);
  5335. onChanged();
  5336. } else {
  5337. broadcastByBuilder_.remove(index);
  5338. }
  5339. return this;
  5340. }
  5341. /**
  5342. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  5343. */
  5344. public org.bitcoinj.wallet.Protos.PeerAddress.Builder getBroadcastByBuilder(
  5345. int index) {
  5346. return getBroadcastByFieldBuilder().getBuilder(index);
  5347. }
  5348. /**
  5349. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  5350. */
  5351. public org.bitcoinj.wallet.Protos.PeerAddressOrBuilder getBroadcastByOrBuilder(
  5352. int index) {
  5353. if (broadcastByBuilder_ == null) {
  5354. return broadcastBy_.get(index); } else {
  5355. return broadcastByBuilder_.getMessageOrBuilder(index);
  5356. }
  5357. }
  5358. /**
  5359. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  5360. */
  5361. public java.util.List<? extends org.bitcoinj.wallet.Protos.PeerAddressOrBuilder>
  5362. getBroadcastByOrBuilderList() {
  5363. if (broadcastByBuilder_ != null) {
  5364. return broadcastByBuilder_.getMessageOrBuilderList();
  5365. } else {
  5366. return java.util.Collections.unmodifiableList(broadcastBy_);
  5367. }
  5368. }
  5369. /**
  5370. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  5371. */
  5372. public org.bitcoinj.wallet.Protos.PeerAddress.Builder addBroadcastByBuilder() {
  5373. return getBroadcastByFieldBuilder().addBuilder(
  5374. org.bitcoinj.wallet.Protos.PeerAddress.getDefaultInstance());
  5375. }
  5376. /**
  5377. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  5378. */
  5379. public org.bitcoinj.wallet.Protos.PeerAddress.Builder addBroadcastByBuilder(
  5380. int index) {
  5381. return getBroadcastByFieldBuilder().addBuilder(
  5382. index, org.bitcoinj.wallet.Protos.PeerAddress.getDefaultInstance());
  5383. }
  5384. /**
  5385. * <code>repeated .wallet.PeerAddress broadcast_by = 6;</code>
  5386. */
  5387. public java.util.List<org.bitcoinj.wallet.Protos.PeerAddress.Builder>
  5388. getBroadcastByBuilderList() {
  5389. return getBroadcastByFieldBuilder().getBuilderList();
  5390. }
  5391. private com.google.protobuf.RepeatedFieldBuilder<
  5392. org.bitcoinj.wallet.Protos.PeerAddress, org.bitcoinj.wallet.Protos.PeerAddress.Builder, org.bitcoinj.wallet.Protos.PeerAddressOrBuilder>
  5393. getBroadcastByFieldBuilder() {
  5394. if (broadcastByBuilder_ == null) {
  5395. broadcastByBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
  5396. org.bitcoinj.wallet.Protos.PeerAddress, org.bitcoinj.wallet.Protos.PeerAddress.Builder, org.bitcoinj.wallet.Protos.PeerAddressOrBuilder>(
  5397. broadcastBy_,
  5398. ((bitField0_ & 0x00000020) == 0x00000020),
  5399. getParentForChildren(),
  5400. isClean());
  5401. broadcastBy_ = null;
  5402. }
  5403. return broadcastByBuilder_;
  5404. }
  5405. // optional .wallet.TransactionConfidence.Source source = 7;
  5406. private org.bitcoinj.wallet.Protos.TransactionConfidence.Source source_ = org.bitcoinj.wallet.Protos.TransactionConfidence.Source.SOURCE_UNKNOWN;
  5407. /**
  5408. * <code>optional .wallet.TransactionConfidence.Source source = 7;</code>
  5409. */
  5410. public boolean hasSource() {
  5411. return ((bitField0_ & 0x00000040) == 0x00000040);
  5412. }
  5413. /**
  5414. * <code>optional .wallet.TransactionConfidence.Source source = 7;</code>
  5415. */
  5416. public org.bitcoinj.wallet.Protos.TransactionConfidence.Source getSource() {
  5417. return source_;
  5418. }
  5419. /**
  5420. * <code>optional .wallet.TransactionConfidence.Source source = 7;</code>
  5421. */
  5422. public Builder setSource(org.bitcoinj.wallet.Protos.TransactionConfidence.Source value) {
  5423. if (value == null) {
  5424. throw new NullPointerException();
  5425. }
  5426. bitField0_ |= 0x00000040;
  5427. source_ = value;
  5428. onChanged();
  5429. return this;
  5430. }
  5431. /**
  5432. * <code>optional .wallet.TransactionConfidence.Source source = 7;</code>
  5433. */
  5434. public Builder clearSource() {
  5435. bitField0_ = (bitField0_ & ~0x00000040);
  5436. source_ = org.bitcoinj.wallet.Protos.TransactionConfidence.Source.SOURCE_UNKNOWN;
  5437. onChanged();
  5438. return this;
  5439. }
  5440. // @@protoc_insertion_point(builder_scope:wallet.TransactionConfidence)
  5441. }
  5442. static {
  5443. defaultInstance = new TransactionConfidence(true);
  5444. defaultInstance.initFields();
  5445. }
  5446. // @@protoc_insertion_point(class_scope:wallet.TransactionConfidence)
  5447. }
  5448. public interface TransactionOrBuilder
  5449. extends com.google.protobuf.MessageOrBuilder {
  5450. // required int32 version = 1;
  5451. /**
  5452. * <code>required int32 version = 1;</code>
  5453. *
  5454. * <pre>
  5455. * See Wallet.java for detailed description of pool semantics
  5456. * </pre>
  5457. */
  5458. boolean hasVersion();
  5459. /**
  5460. * <code>required int32 version = 1;</code>
  5461. *
  5462. * <pre>
  5463. * See Wallet.java for detailed description of pool semantics
  5464. * </pre>
  5465. */
  5466. int getVersion();
  5467. // required bytes hash = 2;
  5468. /**
  5469. * <code>required bytes hash = 2;</code>
  5470. */
  5471. boolean hasHash();
  5472. /**
  5473. * <code>required bytes hash = 2;</code>
  5474. */
  5475. com.google.protobuf.ByteString getHash();
  5476. // optional .wallet.Transaction.Pool pool = 3;
  5477. /**
  5478. * <code>optional .wallet.Transaction.Pool pool = 3;</code>
  5479. *
  5480. * <pre>
  5481. * If pool is not present, that means either:
  5482. * - This Transaction is either not in a wallet at all (the proto is re-used elsewhere)
  5483. * - Or it is stored but for other purposes, for example, because it is the overriding transaction of a double spend.
  5484. * - Or the Pool enum got a new value which your software is too old to parse.
  5485. * </pre>
  5486. */
  5487. boolean hasPool();
  5488. /**
  5489. * <code>optional .wallet.Transaction.Pool pool = 3;</code>
  5490. *
  5491. * <pre>
  5492. * If pool is not present, that means either:
  5493. * - This Transaction is either not in a wallet at all (the proto is re-used elsewhere)
  5494. * - Or it is stored but for other purposes, for example, because it is the overriding transaction of a double spend.
  5495. * - Or the Pool enum got a new value which your software is too old to parse.
  5496. * </pre>
  5497. */
  5498. org.bitcoinj.wallet.Protos.Transaction.Pool getPool();
  5499. // optional uint32 lock_time = 4;
  5500. /**
  5501. * <code>optional uint32 lock_time = 4;</code>
  5502. *
  5503. * <pre>
  5504. * The nLockTime field is useful for contracts.
  5505. * </pre>
  5506. */
  5507. boolean hasLockTime();
  5508. /**
  5509. * <code>optional uint32 lock_time = 4;</code>
  5510. *
  5511. * <pre>
  5512. * The nLockTime field is useful for contracts.
  5513. * </pre>
  5514. */
  5515. int getLockTime();
  5516. // optional int64 updated_at = 5;
  5517. /**
  5518. * <code>optional int64 updated_at = 5;</code>
  5519. *
  5520. * <pre>
  5521. * millis since epoch the transaction was last updated
  5522. * </pre>
  5523. */
  5524. boolean hasUpdatedAt();
  5525. /**
  5526. * <code>optional int64 updated_at = 5;</code>
  5527. *
  5528. * <pre>
  5529. * millis since epoch the transaction was last updated
  5530. * </pre>
  5531. */
  5532. long getUpdatedAt();
  5533. // repeated .wallet.TransactionInput transaction_input = 6;
  5534. /**
  5535. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  5536. */
  5537. java.util.List<org.bitcoinj.wallet.Protos.TransactionInput>
  5538. getTransactionInputList();
  5539. /**
  5540. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  5541. */
  5542. org.bitcoinj.wallet.Protos.TransactionInput getTransactionInput(int index);
  5543. /**
  5544. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  5545. */
  5546. int getTransactionInputCount();
  5547. /**
  5548. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  5549. */
  5550. java.util.List<? extends org.bitcoinj.wallet.Protos.TransactionInputOrBuilder>
  5551. getTransactionInputOrBuilderList();
  5552. /**
  5553. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  5554. */
  5555. org.bitcoinj.wallet.Protos.TransactionInputOrBuilder getTransactionInputOrBuilder(
  5556. int index);
  5557. // repeated .wallet.TransactionOutput transaction_output = 7;
  5558. /**
  5559. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  5560. */
  5561. java.util.List<org.bitcoinj.wallet.Protos.TransactionOutput>
  5562. getTransactionOutputList();
  5563. /**
  5564. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  5565. */
  5566. org.bitcoinj.wallet.Protos.TransactionOutput getTransactionOutput(int index);
  5567. /**
  5568. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  5569. */
  5570. int getTransactionOutputCount();
  5571. /**
  5572. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  5573. */
  5574. java.util.List<? extends org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder>
  5575. getTransactionOutputOrBuilderList();
  5576. /**
  5577. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  5578. */
  5579. org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder getTransactionOutputOrBuilder(
  5580. int index);
  5581. // repeated bytes block_hash = 8;
  5582. /**
  5583. * <code>repeated bytes block_hash = 8;</code>
  5584. *
  5585. * <pre>
  5586. * A list of blocks in which the transaction has been observed (on any chain).
  5587. * </pre>
  5588. */
  5589. java.util.List<com.google.protobuf.ByteString> getBlockHashList();
  5590. /**
  5591. * <code>repeated bytes block_hash = 8;</code>
  5592. *
  5593. * <pre>
  5594. * A list of blocks in which the transaction has been observed (on any chain).
  5595. * </pre>
  5596. */
  5597. int getBlockHashCount();
  5598. /**
  5599. * <code>repeated bytes block_hash = 8;</code>
  5600. *
  5601. * <pre>
  5602. * A list of blocks in which the transaction has been observed (on any chain).
  5603. * </pre>
  5604. */
  5605. com.google.protobuf.ByteString getBlockHash(int index);
  5606. // optional .wallet.TransactionConfidence confidence = 9;
  5607. /**
  5608. * <code>optional .wallet.TransactionConfidence confidence = 9;</code>
  5609. *
  5610. * <pre>
  5611. * Data describing where the transaction is in the chain.
  5612. * </pre>
  5613. */
  5614. boolean hasConfidence();
  5615. /**
  5616. * <code>optional .wallet.TransactionConfidence confidence = 9;</code>
  5617. *
  5618. * <pre>
  5619. * Data describing where the transaction is in the chain.
  5620. * </pre>
  5621. */
  5622. org.bitcoinj.wallet.Protos.TransactionConfidence getConfidence();
  5623. /**
  5624. * <code>optional .wallet.TransactionConfidence confidence = 9;</code>
  5625. *
  5626. * <pre>
  5627. * Data describing where the transaction is in the chain.
  5628. * </pre>
  5629. */
  5630. org.bitcoinj.wallet.Protos.TransactionConfidenceOrBuilder getConfidenceOrBuilder();
  5631. // optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN];
  5632. /**
  5633. * <code>optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN];</code>
  5634. */
  5635. boolean hasPurpose();
  5636. /**
  5637. * <code>optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN];</code>
  5638. */
  5639. org.bitcoinj.wallet.Protos.Transaction.Purpose getPurpose();
  5640. }
  5641. /**
  5642. * Protobuf type {@code wallet.Transaction}
  5643. */
  5644. public static final class Transaction extends
  5645. com.google.protobuf.GeneratedMessage
  5646. implements TransactionOrBuilder {
  5647. // Use Transaction.newBuilder() to construct.
  5648. private Transaction(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  5649. super(builder);
  5650. this.unknownFields = builder.getUnknownFields();
  5651. }
  5652. private Transaction(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  5653. private static final Transaction defaultInstance;
  5654. public static Transaction getDefaultInstance() {
  5655. return defaultInstance;
  5656. }
  5657. public Transaction getDefaultInstanceForType() {
  5658. return defaultInstance;
  5659. }
  5660. private final com.google.protobuf.UnknownFieldSet unknownFields;
  5661. @java.lang.Override
  5662. public final com.google.protobuf.UnknownFieldSet
  5663. getUnknownFields() {
  5664. return this.unknownFields;
  5665. }
  5666. private Transaction(
  5667. com.google.protobuf.CodedInputStream input,
  5668. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  5669. throws com.google.protobuf.InvalidProtocolBufferException {
  5670. initFields();
  5671. int mutable_bitField0_ = 0;
  5672. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  5673. com.google.protobuf.UnknownFieldSet.newBuilder();
  5674. try {
  5675. boolean done = false;
  5676. while (!done) {
  5677. int tag = input.readTag();
  5678. switch (tag) {
  5679. case 0:
  5680. done = true;
  5681. break;
  5682. default: {
  5683. if (!parseUnknownField(input, unknownFields,
  5684. extensionRegistry, tag)) {
  5685. done = true;
  5686. }
  5687. break;
  5688. }
  5689. case 8: {
  5690. bitField0_ |= 0x00000001;
  5691. version_ = input.readInt32();
  5692. break;
  5693. }
  5694. case 18: {
  5695. bitField0_ |= 0x00000002;
  5696. hash_ = input.readBytes();
  5697. break;
  5698. }
  5699. case 24: {
  5700. int rawValue = input.readEnum();
  5701. org.bitcoinj.wallet.Protos.Transaction.Pool value = org.bitcoinj.wallet.Protos.Transaction.Pool.valueOf(rawValue);
  5702. if (value == null) {
  5703. unknownFields.mergeVarintField(3, rawValue);
  5704. } else {
  5705. bitField0_ |= 0x00000004;
  5706. pool_ = value;
  5707. }
  5708. break;
  5709. }
  5710. case 32: {
  5711. bitField0_ |= 0x00000008;
  5712. lockTime_ = input.readUInt32();
  5713. break;
  5714. }
  5715. case 40: {
  5716. bitField0_ |= 0x00000010;
  5717. updatedAt_ = input.readInt64();
  5718. break;
  5719. }
  5720. case 50: {
  5721. if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
  5722. transactionInput_ = new java.util.ArrayList<org.bitcoinj.wallet.Protos.TransactionInput>();
  5723. mutable_bitField0_ |= 0x00000020;
  5724. }
  5725. transactionInput_.add(input.readMessage(org.bitcoinj.wallet.Protos.TransactionInput.PARSER, extensionRegistry));
  5726. break;
  5727. }
  5728. case 58: {
  5729. if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
  5730. transactionOutput_ = new java.util.ArrayList<org.bitcoinj.wallet.Protos.TransactionOutput>();
  5731. mutable_bitField0_ |= 0x00000040;
  5732. }
  5733. transactionOutput_.add(input.readMessage(org.bitcoinj.wallet.Protos.TransactionOutput.PARSER, extensionRegistry));
  5734. break;
  5735. }
  5736. case 66: {
  5737. if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) {
  5738. blockHash_ = new java.util.ArrayList<com.google.protobuf.ByteString>();
  5739. mutable_bitField0_ |= 0x00000080;
  5740. }
  5741. blockHash_.add(input.readBytes());
  5742. break;
  5743. }
  5744. case 74: {
  5745. org.bitcoinj.wallet.Protos.TransactionConfidence.Builder subBuilder = null;
  5746. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  5747. subBuilder = confidence_.toBuilder();
  5748. }
  5749. confidence_ = input.readMessage(org.bitcoinj.wallet.Protos.TransactionConfidence.PARSER, extensionRegistry);
  5750. if (subBuilder != null) {
  5751. subBuilder.mergeFrom(confidence_);
  5752. confidence_ = subBuilder.buildPartial();
  5753. }
  5754. bitField0_ |= 0x00000020;
  5755. break;
  5756. }
  5757. case 80: {
  5758. int rawValue = input.readEnum();
  5759. org.bitcoinj.wallet.Protos.Transaction.Purpose value = org.bitcoinj.wallet.Protos.Transaction.Purpose.valueOf(rawValue);
  5760. if (value == null) {
  5761. unknownFields.mergeVarintField(10, rawValue);
  5762. } else {
  5763. bitField0_ |= 0x00000040;
  5764. purpose_ = value;
  5765. }
  5766. break;
  5767. }
  5768. }
  5769. }
  5770. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  5771. throw e.setUnfinishedMessage(this);
  5772. } catch (java.io.IOException e) {
  5773. throw new com.google.protobuf.InvalidProtocolBufferException(
  5774. e.getMessage()).setUnfinishedMessage(this);
  5775. } finally {
  5776. if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
  5777. transactionInput_ = java.util.Collections.unmodifiableList(transactionInput_);
  5778. }
  5779. if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
  5780. transactionOutput_ = java.util.Collections.unmodifiableList(transactionOutput_);
  5781. }
  5782. if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) {
  5783. blockHash_ = java.util.Collections.unmodifiableList(blockHash_);
  5784. }
  5785. this.unknownFields = unknownFields.build();
  5786. makeExtensionsImmutable();
  5787. }
  5788. }
  5789. public static final com.google.protobuf.Descriptors.Descriptor
  5790. getDescriptor() {
  5791. return org.bitcoinj.wallet.Protos.internal_static_wallet_Transaction_descriptor;
  5792. }
  5793. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  5794. internalGetFieldAccessorTable() {
  5795. return org.bitcoinj.wallet.Protos.internal_static_wallet_Transaction_fieldAccessorTable
  5796. .ensureFieldAccessorsInitialized(
  5797. org.bitcoinj.wallet.Protos.Transaction.class, org.bitcoinj.wallet.Protos.Transaction.Builder.class);
  5798. }
  5799. public static com.google.protobuf.Parser<Transaction> PARSER =
  5800. new com.google.protobuf.AbstractParser<Transaction>() {
  5801. public Transaction parsePartialFrom(
  5802. com.google.protobuf.CodedInputStream input,
  5803. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  5804. throws com.google.protobuf.InvalidProtocolBufferException {
  5805. return new Transaction(input, extensionRegistry);
  5806. }
  5807. };
  5808. @java.lang.Override
  5809. public com.google.protobuf.Parser<Transaction> getParserForType() {
  5810. return PARSER;
  5811. }
  5812. /**
  5813. * Protobuf enum {@code wallet.Transaction.Pool}
  5814. *
  5815. * <pre>
  5816. **
  5817. * This is a bitfield oriented enum, with the following bits:
  5818. *
  5819. * bit 0 - spent
  5820. * bit 1 - appears in alt chain
  5821. * bit 2 - appears in best chain
  5822. * bit 3 - double-spent
  5823. * bit 4 - pending (we would like the tx to go into the best chain)
  5824. *
  5825. * Not all combinations are interesting, just the ones actually used in the enum.
  5826. * </pre>
  5827. */
  5828. public enum Pool
  5829. implements com.google.protobuf.ProtocolMessageEnum {
  5830. /**
  5831. * <code>UNSPENT = 4;</code>
  5832. *
  5833. * <pre>
  5834. * In best chain, not all outputs spent
  5835. * </pre>
  5836. */
  5837. UNSPENT(0, 4),
  5838. /**
  5839. * <code>SPENT = 5;</code>
  5840. *
  5841. * <pre>
  5842. * In best chain, all outputs spent
  5843. * </pre>
  5844. */
  5845. SPENT(1, 5),
  5846. /**
  5847. * <code>INACTIVE = 2;</code>
  5848. *
  5849. * <pre>
  5850. * In non-best chain, not our transaction
  5851. * </pre>
  5852. */
  5853. INACTIVE(2, 2),
  5854. /**
  5855. * <code>DEAD = 10;</code>
  5856. *
  5857. * <pre>
  5858. * Double-spent by a transaction in the best chain
  5859. * </pre>
  5860. */
  5861. DEAD(3, 10),
  5862. /**
  5863. * <code>PENDING = 16;</code>
  5864. *
  5865. * <pre>
  5866. * Our transaction, not in any chain
  5867. * </pre>
  5868. */
  5869. PENDING(4, 16),
  5870. /**
  5871. * <code>PENDING_INACTIVE = 18;</code>
  5872. *
  5873. * <pre>
  5874. * In non-best chain, our transaction
  5875. * </pre>
  5876. */
  5877. PENDING_INACTIVE(5, 18),
  5878. ;
  5879. /**
  5880. * <code>UNSPENT = 4;</code>
  5881. *
  5882. * <pre>
  5883. * In best chain, not all outputs spent
  5884. * </pre>
  5885. */
  5886. public static final int UNSPENT_VALUE = 4;
  5887. /**
  5888. * <code>SPENT = 5;</code>
  5889. *
  5890. * <pre>
  5891. * In best chain, all outputs spent
  5892. * </pre>
  5893. */
  5894. public static final int SPENT_VALUE = 5;
  5895. /**
  5896. * <code>INACTIVE = 2;</code>
  5897. *
  5898. * <pre>
  5899. * In non-best chain, not our transaction
  5900. * </pre>
  5901. */
  5902. public static final int INACTIVE_VALUE = 2;
  5903. /**
  5904. * <code>DEAD = 10;</code>
  5905. *
  5906. * <pre>
  5907. * Double-spent by a transaction in the best chain
  5908. * </pre>
  5909. */
  5910. public static final int DEAD_VALUE = 10;
  5911. /**
  5912. * <code>PENDING = 16;</code>
  5913. *
  5914. * <pre>
  5915. * Our transaction, not in any chain
  5916. * </pre>
  5917. */
  5918. public static final int PENDING_VALUE = 16;
  5919. /**
  5920. * <code>PENDING_INACTIVE = 18;</code>
  5921. *
  5922. * <pre>
  5923. * In non-best chain, our transaction
  5924. * </pre>
  5925. */
  5926. public static final int PENDING_INACTIVE_VALUE = 18;
  5927. public final int getNumber() { return value; }
  5928. public static Pool valueOf(int value) {
  5929. switch (value) {
  5930. case 4: return UNSPENT;
  5931. case 5: return SPENT;
  5932. case 2: return INACTIVE;
  5933. case 10: return DEAD;
  5934. case 16: return PENDING;
  5935. case 18: return PENDING_INACTIVE;
  5936. default: return null;
  5937. }
  5938. }
  5939. public static com.google.protobuf.Internal.EnumLiteMap<Pool>
  5940. internalGetValueMap() {
  5941. return internalValueMap;
  5942. }
  5943. private static com.google.protobuf.Internal.EnumLiteMap<Pool>
  5944. internalValueMap =
  5945. new com.google.protobuf.Internal.EnumLiteMap<Pool>() {
  5946. public Pool findValueByNumber(int number) {
  5947. return Pool.valueOf(number);
  5948. }
  5949. };
  5950. public final com.google.protobuf.Descriptors.EnumValueDescriptor
  5951. getValueDescriptor() {
  5952. return getDescriptor().getValues().get(index);
  5953. }
  5954. public final com.google.protobuf.Descriptors.EnumDescriptor
  5955. getDescriptorForType() {
  5956. return getDescriptor();
  5957. }
  5958. public static final com.google.protobuf.Descriptors.EnumDescriptor
  5959. getDescriptor() {
  5960. return org.bitcoinj.wallet.Protos.Transaction.getDescriptor().getEnumTypes().get(0);
  5961. }
  5962. private static final Pool[] VALUES = values();
  5963. public static Pool valueOf(
  5964. com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
  5965. if (desc.getType() != getDescriptor()) {
  5966. throw new java.lang.IllegalArgumentException(
  5967. "EnumValueDescriptor is not for this type.");
  5968. }
  5969. return VALUES[desc.getIndex()];
  5970. }
  5971. private final int index;
  5972. private final int value;
  5973. private Pool(int index, int value) {
  5974. this.index = index;
  5975. this.value = value;
  5976. }
  5977. // @@protoc_insertion_point(enum_scope:wallet.Transaction.Pool)
  5978. }
  5979. /**
  5980. * Protobuf enum {@code wallet.Transaction.Purpose}
  5981. *
  5982. * <pre>
  5983. * For what purpose the transaction was created.
  5984. * </pre>
  5985. */
  5986. public enum Purpose
  5987. implements com.google.protobuf.ProtocolMessageEnum {
  5988. /**
  5989. * <code>UNKNOWN = 0;</code>
  5990. *
  5991. * <pre>
  5992. * Old wallets or the purpose genuinely is a mystery (e.g. imported from some external source).
  5993. * </pre>
  5994. */
  5995. UNKNOWN(0, 0),
  5996. /**
  5997. * <code>USER_PAYMENT = 1;</code>
  5998. *
  5999. * <pre>
  6000. * Created in response to a user request for payment. This is the normal case.
  6001. * </pre>
  6002. */
  6003. USER_PAYMENT(1, 1),
  6004. /**
  6005. * <code>KEY_ROTATION = 2;</code>
  6006. *
  6007. * <pre>
  6008. * Created automatically to move money from rotated keys.
  6009. * </pre>
  6010. */
  6011. KEY_ROTATION(2, 2),
  6012. ;
  6013. /**
  6014. * <code>UNKNOWN = 0;</code>
  6015. *
  6016. * <pre>
  6017. * Old wallets or the purpose genuinely is a mystery (e.g. imported from some external source).
  6018. * </pre>
  6019. */
  6020. public static final int UNKNOWN_VALUE = 0;
  6021. /**
  6022. * <code>USER_PAYMENT = 1;</code>
  6023. *
  6024. * <pre>
  6025. * Created in response to a user request for payment. This is the normal case.
  6026. * </pre>
  6027. */
  6028. public static final int USER_PAYMENT_VALUE = 1;
  6029. /**
  6030. * <code>KEY_ROTATION = 2;</code>
  6031. *
  6032. * <pre>
  6033. * Created automatically to move money from rotated keys.
  6034. * </pre>
  6035. */
  6036. public static final int KEY_ROTATION_VALUE = 2;
  6037. public final int getNumber() { return value; }
  6038. public static Purpose valueOf(int value) {
  6039. switch (value) {
  6040. case 0: return UNKNOWN;
  6041. case 1: return USER_PAYMENT;
  6042. case 2: return KEY_ROTATION;
  6043. default: return null;
  6044. }
  6045. }
  6046. public static com.google.protobuf.Internal.EnumLiteMap<Purpose>
  6047. internalGetValueMap() {
  6048. return internalValueMap;
  6049. }
  6050. private static com.google.protobuf.Internal.EnumLiteMap<Purpose>
  6051. internalValueMap =
  6052. new com.google.protobuf.Internal.EnumLiteMap<Purpose>() {
  6053. public Purpose findValueByNumber(int number) {
  6054. return Purpose.valueOf(number);
  6055. }
  6056. };
  6057. public final com.google.protobuf.Descriptors.EnumValueDescriptor
  6058. getValueDescriptor() {
  6059. return getDescriptor().getValues().get(index);
  6060. }
  6061. public final com.google.protobuf.Descriptors.EnumDescriptor
  6062. getDescriptorForType() {
  6063. return getDescriptor();
  6064. }
  6065. public static final com.google.protobuf.Descriptors.EnumDescriptor
  6066. getDescriptor() {
  6067. return org.bitcoinj.wallet.Protos.Transaction.getDescriptor().getEnumTypes().get(1);
  6068. }
  6069. private static final Purpose[] VALUES = values();
  6070. public static Purpose valueOf(
  6071. com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
  6072. if (desc.getType() != getDescriptor()) {
  6073. throw new java.lang.IllegalArgumentException(
  6074. "EnumValueDescriptor is not for this type.");
  6075. }
  6076. return VALUES[desc.getIndex()];
  6077. }
  6078. private final int index;
  6079. private final int value;
  6080. private Purpose(int index, int value) {
  6081. this.index = index;
  6082. this.value = value;
  6083. }
  6084. // @@protoc_insertion_point(enum_scope:wallet.Transaction.Purpose)
  6085. }
  6086. private int bitField0_;
  6087. // required int32 version = 1;
  6088. public static final int VERSION_FIELD_NUMBER = 1;
  6089. private int version_;
  6090. /**
  6091. * <code>required int32 version = 1;</code>
  6092. *
  6093. * <pre>
  6094. * See Wallet.java for detailed description of pool semantics
  6095. * </pre>
  6096. */
  6097. public boolean hasVersion() {
  6098. return ((bitField0_ & 0x00000001) == 0x00000001);
  6099. }
  6100. /**
  6101. * <code>required int32 version = 1;</code>
  6102. *
  6103. * <pre>
  6104. * See Wallet.java for detailed description of pool semantics
  6105. * </pre>
  6106. */
  6107. public int getVersion() {
  6108. return version_;
  6109. }
  6110. // required bytes hash = 2;
  6111. public static final int HASH_FIELD_NUMBER = 2;
  6112. private com.google.protobuf.ByteString hash_;
  6113. /**
  6114. * <code>required bytes hash = 2;</code>
  6115. */
  6116. public boolean hasHash() {
  6117. return ((bitField0_ & 0x00000002) == 0x00000002);
  6118. }
  6119. /**
  6120. * <code>required bytes hash = 2;</code>
  6121. */
  6122. public com.google.protobuf.ByteString getHash() {
  6123. return hash_;
  6124. }
  6125. // optional .wallet.Transaction.Pool pool = 3;
  6126. public static final int POOL_FIELD_NUMBER = 3;
  6127. private org.bitcoinj.wallet.Protos.Transaction.Pool pool_;
  6128. /**
  6129. * <code>optional .wallet.Transaction.Pool pool = 3;</code>
  6130. *
  6131. * <pre>
  6132. * If pool is not present, that means either:
  6133. * - This Transaction is either not in a wallet at all (the proto is re-used elsewhere)
  6134. * - Or it is stored but for other purposes, for example, because it is the overriding transaction of a double spend.
  6135. * - Or the Pool enum got a new value which your software is too old to parse.
  6136. * </pre>
  6137. */
  6138. public boolean hasPool() {
  6139. return ((bitField0_ & 0x00000004) == 0x00000004);
  6140. }
  6141. /**
  6142. * <code>optional .wallet.Transaction.Pool pool = 3;</code>
  6143. *
  6144. * <pre>
  6145. * If pool is not present, that means either:
  6146. * - This Transaction is either not in a wallet at all (the proto is re-used elsewhere)
  6147. * - Or it is stored but for other purposes, for example, because it is the overriding transaction of a double spend.
  6148. * - Or the Pool enum got a new value which your software is too old to parse.
  6149. * </pre>
  6150. */
  6151. public org.bitcoinj.wallet.Protos.Transaction.Pool getPool() {
  6152. return pool_;
  6153. }
  6154. // optional uint32 lock_time = 4;
  6155. public static final int LOCK_TIME_FIELD_NUMBER = 4;
  6156. private int lockTime_;
  6157. /**
  6158. * <code>optional uint32 lock_time = 4;</code>
  6159. *
  6160. * <pre>
  6161. * The nLockTime field is useful for contracts.
  6162. * </pre>
  6163. */
  6164. public boolean hasLockTime() {
  6165. return ((bitField0_ & 0x00000008) == 0x00000008);
  6166. }
  6167. /**
  6168. * <code>optional uint32 lock_time = 4;</code>
  6169. *
  6170. * <pre>
  6171. * The nLockTime field is useful for contracts.
  6172. * </pre>
  6173. */
  6174. public int getLockTime() {
  6175. return lockTime_;
  6176. }
  6177. // optional int64 updated_at = 5;
  6178. public static final int UPDATED_AT_FIELD_NUMBER = 5;
  6179. private long updatedAt_;
  6180. /**
  6181. * <code>optional int64 updated_at = 5;</code>
  6182. *
  6183. * <pre>
  6184. * millis since epoch the transaction was last updated
  6185. * </pre>
  6186. */
  6187. public boolean hasUpdatedAt() {
  6188. return ((bitField0_ & 0x00000010) == 0x00000010);
  6189. }
  6190. /**
  6191. * <code>optional int64 updated_at = 5;</code>
  6192. *
  6193. * <pre>
  6194. * millis since epoch the transaction was last updated
  6195. * </pre>
  6196. */
  6197. public long getUpdatedAt() {
  6198. return updatedAt_;
  6199. }
  6200. // repeated .wallet.TransactionInput transaction_input = 6;
  6201. public static final int TRANSACTION_INPUT_FIELD_NUMBER = 6;
  6202. private java.util.List<org.bitcoinj.wallet.Protos.TransactionInput> transactionInput_;
  6203. /**
  6204. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  6205. */
  6206. public java.util.List<org.bitcoinj.wallet.Protos.TransactionInput> getTransactionInputList() {
  6207. return transactionInput_;
  6208. }
  6209. /**
  6210. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  6211. */
  6212. public java.util.List<? extends org.bitcoinj.wallet.Protos.TransactionInputOrBuilder>
  6213. getTransactionInputOrBuilderList() {
  6214. return transactionInput_;
  6215. }
  6216. /**
  6217. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  6218. */
  6219. public int getTransactionInputCount() {
  6220. return transactionInput_.size();
  6221. }
  6222. /**
  6223. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  6224. */
  6225. public org.bitcoinj.wallet.Protos.TransactionInput getTransactionInput(int index) {
  6226. return transactionInput_.get(index);
  6227. }
  6228. /**
  6229. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  6230. */
  6231. public org.bitcoinj.wallet.Protos.TransactionInputOrBuilder getTransactionInputOrBuilder(
  6232. int index) {
  6233. return transactionInput_.get(index);
  6234. }
  6235. // repeated .wallet.TransactionOutput transaction_output = 7;
  6236. public static final int TRANSACTION_OUTPUT_FIELD_NUMBER = 7;
  6237. private java.util.List<org.bitcoinj.wallet.Protos.TransactionOutput> transactionOutput_;
  6238. /**
  6239. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  6240. */
  6241. public java.util.List<org.bitcoinj.wallet.Protos.TransactionOutput> getTransactionOutputList() {
  6242. return transactionOutput_;
  6243. }
  6244. /**
  6245. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  6246. */
  6247. public java.util.List<? extends org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder>
  6248. getTransactionOutputOrBuilderList() {
  6249. return transactionOutput_;
  6250. }
  6251. /**
  6252. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  6253. */
  6254. public int getTransactionOutputCount() {
  6255. return transactionOutput_.size();
  6256. }
  6257. /**
  6258. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  6259. */
  6260. public org.bitcoinj.wallet.Protos.TransactionOutput getTransactionOutput(int index) {
  6261. return transactionOutput_.get(index);
  6262. }
  6263. /**
  6264. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  6265. */
  6266. public org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder getTransactionOutputOrBuilder(
  6267. int index) {
  6268. return transactionOutput_.get(index);
  6269. }
  6270. // repeated bytes block_hash = 8;
  6271. public static final int BLOCK_HASH_FIELD_NUMBER = 8;
  6272. private java.util.List<com.google.protobuf.ByteString> blockHash_;
  6273. /**
  6274. * <code>repeated bytes block_hash = 8;</code>
  6275. *
  6276. * <pre>
  6277. * A list of blocks in which the transaction has been observed (on any chain).
  6278. * </pre>
  6279. */
  6280. public java.util.List<com.google.protobuf.ByteString>
  6281. getBlockHashList() {
  6282. return blockHash_;
  6283. }
  6284. /**
  6285. * <code>repeated bytes block_hash = 8;</code>
  6286. *
  6287. * <pre>
  6288. * A list of blocks in which the transaction has been observed (on any chain).
  6289. * </pre>
  6290. */
  6291. public int getBlockHashCount() {
  6292. return blockHash_.size();
  6293. }
  6294. /**
  6295. * <code>repeated bytes block_hash = 8;</code>
  6296. *
  6297. * <pre>
  6298. * A list of blocks in which the transaction has been observed (on any chain).
  6299. * </pre>
  6300. */
  6301. public com.google.protobuf.ByteString getBlockHash(int index) {
  6302. return blockHash_.get(index);
  6303. }
  6304. // optional .wallet.TransactionConfidence confidence = 9;
  6305. public static final int CONFIDENCE_FIELD_NUMBER = 9;
  6306. private org.bitcoinj.wallet.Protos.TransactionConfidence confidence_;
  6307. /**
  6308. * <code>optional .wallet.TransactionConfidence confidence = 9;</code>
  6309. *
  6310. * <pre>
  6311. * Data describing where the transaction is in the chain.
  6312. * </pre>
  6313. */
  6314. public boolean hasConfidence() {
  6315. return ((bitField0_ & 0x00000020) == 0x00000020);
  6316. }
  6317. /**
  6318. * <code>optional .wallet.TransactionConfidence confidence = 9;</code>
  6319. *
  6320. * <pre>
  6321. * Data describing where the transaction is in the chain.
  6322. * </pre>
  6323. */
  6324. public org.bitcoinj.wallet.Protos.TransactionConfidence getConfidence() {
  6325. return confidence_;
  6326. }
  6327. /**
  6328. * <code>optional .wallet.TransactionConfidence confidence = 9;</code>
  6329. *
  6330. * <pre>
  6331. * Data describing where the transaction is in the chain.
  6332. * </pre>
  6333. */
  6334. public org.bitcoinj.wallet.Protos.TransactionConfidenceOrBuilder getConfidenceOrBuilder() {
  6335. return confidence_;
  6336. }
  6337. // optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN];
  6338. public static final int PURPOSE_FIELD_NUMBER = 10;
  6339. private org.bitcoinj.wallet.Protos.Transaction.Purpose purpose_;
  6340. /**
  6341. * <code>optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN];</code>
  6342. */
  6343. public boolean hasPurpose() {
  6344. return ((bitField0_ & 0x00000040) == 0x00000040);
  6345. }
  6346. /**
  6347. * <code>optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN];</code>
  6348. */
  6349. public org.bitcoinj.wallet.Protos.Transaction.Purpose getPurpose() {
  6350. return purpose_;
  6351. }
  6352. private void initFields() {
  6353. version_ = 0;
  6354. hash_ = com.google.protobuf.ByteString.EMPTY;
  6355. pool_ = org.bitcoinj.wallet.Protos.Transaction.Pool.UNSPENT;
  6356. lockTime_ = 0;
  6357. updatedAt_ = 0L;
  6358. transactionInput_ = java.util.Collections.emptyList();
  6359. transactionOutput_ = java.util.Collections.emptyList();
  6360. blockHash_ = java.util.Collections.emptyList();
  6361. confidence_ = org.bitcoinj.wallet.Protos.TransactionConfidence.getDefaultInstance();
  6362. purpose_ = org.bitcoinj.wallet.Protos.Transaction.Purpose.UNKNOWN;
  6363. }
  6364. private byte memoizedIsInitialized = -1;
  6365. public final boolean isInitialized() {
  6366. byte isInitialized = memoizedIsInitialized;
  6367. if (isInitialized != -1) return isInitialized == 1;
  6368. if (!hasVersion()) {
  6369. memoizedIsInitialized = 0;
  6370. return false;
  6371. }
  6372. if (!hasHash()) {
  6373. memoizedIsInitialized = 0;
  6374. return false;
  6375. }
  6376. for (int i = 0; i < getTransactionInputCount(); i++) {
  6377. if (!getTransactionInput(i).isInitialized()) {
  6378. memoizedIsInitialized = 0;
  6379. return false;
  6380. }
  6381. }
  6382. for (int i = 0; i < getTransactionOutputCount(); i++) {
  6383. if (!getTransactionOutput(i).isInitialized()) {
  6384. memoizedIsInitialized = 0;
  6385. return false;
  6386. }
  6387. }
  6388. if (hasConfidence()) {
  6389. if (!getConfidence().isInitialized()) {
  6390. memoizedIsInitialized = 0;
  6391. return false;
  6392. }
  6393. }
  6394. memoizedIsInitialized = 1;
  6395. return true;
  6396. }
  6397. public void writeTo(com.google.protobuf.CodedOutputStream output)
  6398. throws java.io.IOException {
  6399. getSerializedSize();
  6400. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  6401. output.writeInt32(1, version_);
  6402. }
  6403. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  6404. output.writeBytes(2, hash_);
  6405. }
  6406. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  6407. output.writeEnum(3, pool_.getNumber());
  6408. }
  6409. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  6410. output.writeUInt32(4, lockTime_);
  6411. }
  6412. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  6413. output.writeInt64(5, updatedAt_);
  6414. }
  6415. for (int i = 0; i < transactionInput_.size(); i++) {
  6416. output.writeMessage(6, transactionInput_.get(i));
  6417. }
  6418. for (int i = 0; i < transactionOutput_.size(); i++) {
  6419. output.writeMessage(7, transactionOutput_.get(i));
  6420. }
  6421. for (int i = 0; i < blockHash_.size(); i++) {
  6422. output.writeBytes(8, blockHash_.get(i));
  6423. }
  6424. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  6425. output.writeMessage(9, confidence_);
  6426. }
  6427. if (((bitField0_ & 0x00000040) == 0x00000040)) {
  6428. output.writeEnum(10, purpose_.getNumber());
  6429. }
  6430. getUnknownFields().writeTo(output);
  6431. }
  6432. private int memoizedSerializedSize = -1;
  6433. public int getSerializedSize() {
  6434. int size = memoizedSerializedSize;
  6435. if (size != -1) return size;
  6436. size = 0;
  6437. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  6438. size += com.google.protobuf.CodedOutputStream
  6439. .computeInt32Size(1, version_);
  6440. }
  6441. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  6442. size += com.google.protobuf.CodedOutputStream
  6443. .computeBytesSize(2, hash_);
  6444. }
  6445. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  6446. size += com.google.protobuf.CodedOutputStream
  6447. .computeEnumSize(3, pool_.getNumber());
  6448. }
  6449. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  6450. size += com.google.protobuf.CodedOutputStream
  6451. .computeUInt32Size(4, lockTime_);
  6452. }
  6453. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  6454. size += com.google.protobuf.CodedOutputStream
  6455. .computeInt64Size(5, updatedAt_);
  6456. }
  6457. for (int i = 0; i < transactionInput_.size(); i++) {
  6458. size += com.google.protobuf.CodedOutputStream
  6459. .computeMessageSize(6, transactionInput_.get(i));
  6460. }
  6461. for (int i = 0; i < transactionOutput_.size(); i++) {
  6462. size += com.google.protobuf.CodedOutputStream
  6463. .computeMessageSize(7, transactionOutput_.get(i));
  6464. }
  6465. {
  6466. int dataSize = 0;
  6467. for (int i = 0; i < blockHash_.size(); i++) {
  6468. dataSize += com.google.protobuf.CodedOutputStream
  6469. .computeBytesSizeNoTag(blockHash_.get(i));
  6470. }
  6471. size += dataSize;
  6472. size += 1 * getBlockHashList().size();
  6473. }
  6474. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  6475. size += com.google.protobuf.CodedOutputStream
  6476. .computeMessageSize(9, confidence_);
  6477. }
  6478. if (((bitField0_ & 0x00000040) == 0x00000040)) {
  6479. size += com.google.protobuf.CodedOutputStream
  6480. .computeEnumSize(10, purpose_.getNumber());
  6481. }
  6482. size += getUnknownFields().getSerializedSize();
  6483. memoizedSerializedSize = size;
  6484. return size;
  6485. }
  6486. private static final long serialVersionUID = 0L;
  6487. @java.lang.Override
  6488. protected java.lang.Object writeReplace()
  6489. throws java.io.ObjectStreamException {
  6490. return super.writeReplace();
  6491. }
  6492. public static org.bitcoinj.wallet.Protos.Transaction parseFrom(
  6493. com.google.protobuf.ByteString data)
  6494. throws com.google.protobuf.InvalidProtocolBufferException {
  6495. return PARSER.parseFrom(data);
  6496. }
  6497. public static org.bitcoinj.wallet.Protos.Transaction parseFrom(
  6498. com.google.protobuf.ByteString data,
  6499. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6500. throws com.google.protobuf.InvalidProtocolBufferException {
  6501. return PARSER.parseFrom(data, extensionRegistry);
  6502. }
  6503. public static org.bitcoinj.wallet.Protos.Transaction parseFrom(byte[] data)
  6504. throws com.google.protobuf.InvalidProtocolBufferException {
  6505. return PARSER.parseFrom(data);
  6506. }
  6507. public static org.bitcoinj.wallet.Protos.Transaction parseFrom(
  6508. byte[] data,
  6509. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6510. throws com.google.protobuf.InvalidProtocolBufferException {
  6511. return PARSER.parseFrom(data, extensionRegistry);
  6512. }
  6513. public static org.bitcoinj.wallet.Protos.Transaction parseFrom(java.io.InputStream input)
  6514. throws java.io.IOException {
  6515. return PARSER.parseFrom(input);
  6516. }
  6517. public static org.bitcoinj.wallet.Protos.Transaction parseFrom(
  6518. java.io.InputStream input,
  6519. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6520. throws java.io.IOException {
  6521. return PARSER.parseFrom(input, extensionRegistry);
  6522. }
  6523. public static org.bitcoinj.wallet.Protos.Transaction parseDelimitedFrom(java.io.InputStream input)
  6524. throws java.io.IOException {
  6525. return PARSER.parseDelimitedFrom(input);
  6526. }
  6527. public static org.bitcoinj.wallet.Protos.Transaction parseDelimitedFrom(
  6528. java.io.InputStream input,
  6529. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6530. throws java.io.IOException {
  6531. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  6532. }
  6533. public static org.bitcoinj.wallet.Protos.Transaction parseFrom(
  6534. com.google.protobuf.CodedInputStream input)
  6535. throws java.io.IOException {
  6536. return PARSER.parseFrom(input);
  6537. }
  6538. public static org.bitcoinj.wallet.Protos.Transaction parseFrom(
  6539. com.google.protobuf.CodedInputStream input,
  6540. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6541. throws java.io.IOException {
  6542. return PARSER.parseFrom(input, extensionRegistry);
  6543. }
  6544. public static Builder newBuilder() { return Builder.create(); }
  6545. public Builder newBuilderForType() { return newBuilder(); }
  6546. public static Builder newBuilder(org.bitcoinj.wallet.Protos.Transaction prototype) {
  6547. return newBuilder().mergeFrom(prototype);
  6548. }
  6549. public Builder toBuilder() { return newBuilder(this); }
  6550. @java.lang.Override
  6551. protected Builder newBuilderForType(
  6552. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  6553. Builder builder = new Builder(parent);
  6554. return builder;
  6555. }
  6556. /**
  6557. * Protobuf type {@code wallet.Transaction}
  6558. */
  6559. public static final class Builder extends
  6560. com.google.protobuf.GeneratedMessage.Builder<Builder>
  6561. implements org.bitcoinj.wallet.Protos.TransactionOrBuilder {
  6562. public static final com.google.protobuf.Descriptors.Descriptor
  6563. getDescriptor() {
  6564. return org.bitcoinj.wallet.Protos.internal_static_wallet_Transaction_descriptor;
  6565. }
  6566. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  6567. internalGetFieldAccessorTable() {
  6568. return org.bitcoinj.wallet.Protos.internal_static_wallet_Transaction_fieldAccessorTable
  6569. .ensureFieldAccessorsInitialized(
  6570. org.bitcoinj.wallet.Protos.Transaction.class, org.bitcoinj.wallet.Protos.Transaction.Builder.class);
  6571. }
  6572. // Construct using org.bitcoinj.wallet.Protos.Transaction.newBuilder()
  6573. private Builder() {
  6574. maybeForceBuilderInitialization();
  6575. }
  6576. private Builder(
  6577. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  6578. super(parent);
  6579. maybeForceBuilderInitialization();
  6580. }
  6581. private void maybeForceBuilderInitialization() {
  6582. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  6583. getTransactionInputFieldBuilder();
  6584. getTransactionOutputFieldBuilder();
  6585. getConfidenceFieldBuilder();
  6586. }
  6587. }
  6588. private static Builder create() {
  6589. return new Builder();
  6590. }
  6591. public Builder clear() {
  6592. super.clear();
  6593. version_ = 0;
  6594. bitField0_ = (bitField0_ & ~0x00000001);
  6595. hash_ = com.google.protobuf.ByteString.EMPTY;
  6596. bitField0_ = (bitField0_ & ~0x00000002);
  6597. pool_ = org.bitcoinj.wallet.Protos.Transaction.Pool.UNSPENT;
  6598. bitField0_ = (bitField0_ & ~0x00000004);
  6599. lockTime_ = 0;
  6600. bitField0_ = (bitField0_ & ~0x00000008);
  6601. updatedAt_ = 0L;
  6602. bitField0_ = (bitField0_ & ~0x00000010);
  6603. if (transactionInputBuilder_ == null) {
  6604. transactionInput_ = java.util.Collections.emptyList();
  6605. bitField0_ = (bitField0_ & ~0x00000020);
  6606. } else {
  6607. transactionInputBuilder_.clear();
  6608. }
  6609. if (transactionOutputBuilder_ == null) {
  6610. transactionOutput_ = java.util.Collections.emptyList();
  6611. bitField0_ = (bitField0_ & ~0x00000040);
  6612. } else {
  6613. transactionOutputBuilder_.clear();
  6614. }
  6615. blockHash_ = java.util.Collections.emptyList();
  6616. bitField0_ = (bitField0_ & ~0x00000080);
  6617. if (confidenceBuilder_ == null) {
  6618. confidence_ = org.bitcoinj.wallet.Protos.TransactionConfidence.getDefaultInstance();
  6619. } else {
  6620. confidenceBuilder_.clear();
  6621. }
  6622. bitField0_ = (bitField0_ & ~0x00000100);
  6623. purpose_ = org.bitcoinj.wallet.Protos.Transaction.Purpose.UNKNOWN;
  6624. bitField0_ = (bitField0_ & ~0x00000200);
  6625. return this;
  6626. }
  6627. public Builder clone() {
  6628. return create().mergeFrom(buildPartial());
  6629. }
  6630. public com.google.protobuf.Descriptors.Descriptor
  6631. getDescriptorForType() {
  6632. return org.bitcoinj.wallet.Protos.internal_static_wallet_Transaction_descriptor;
  6633. }
  6634. public org.bitcoinj.wallet.Protos.Transaction getDefaultInstanceForType() {
  6635. return org.bitcoinj.wallet.Protos.Transaction.getDefaultInstance();
  6636. }
  6637. public org.bitcoinj.wallet.Protos.Transaction build() {
  6638. org.bitcoinj.wallet.Protos.Transaction result = buildPartial();
  6639. if (!result.isInitialized()) {
  6640. throw newUninitializedMessageException(result);
  6641. }
  6642. return result;
  6643. }
  6644. public org.bitcoinj.wallet.Protos.Transaction buildPartial() {
  6645. org.bitcoinj.wallet.Protos.Transaction result = new org.bitcoinj.wallet.Protos.Transaction(this);
  6646. int from_bitField0_ = bitField0_;
  6647. int to_bitField0_ = 0;
  6648. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  6649. to_bitField0_ |= 0x00000001;
  6650. }
  6651. result.version_ = version_;
  6652. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  6653. to_bitField0_ |= 0x00000002;
  6654. }
  6655. result.hash_ = hash_;
  6656. if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
  6657. to_bitField0_ |= 0x00000004;
  6658. }
  6659. result.pool_ = pool_;
  6660. if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
  6661. to_bitField0_ |= 0x00000008;
  6662. }
  6663. result.lockTime_ = lockTime_;
  6664. if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
  6665. to_bitField0_ |= 0x00000010;
  6666. }
  6667. result.updatedAt_ = updatedAt_;
  6668. if (transactionInputBuilder_ == null) {
  6669. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  6670. transactionInput_ = java.util.Collections.unmodifiableList(transactionInput_);
  6671. bitField0_ = (bitField0_ & ~0x00000020);
  6672. }
  6673. result.transactionInput_ = transactionInput_;
  6674. } else {
  6675. result.transactionInput_ = transactionInputBuilder_.build();
  6676. }
  6677. if (transactionOutputBuilder_ == null) {
  6678. if (((bitField0_ & 0x00000040) == 0x00000040)) {
  6679. transactionOutput_ = java.util.Collections.unmodifiableList(transactionOutput_);
  6680. bitField0_ = (bitField0_ & ~0x00000040);
  6681. }
  6682. result.transactionOutput_ = transactionOutput_;
  6683. } else {
  6684. result.transactionOutput_ = transactionOutputBuilder_.build();
  6685. }
  6686. if (((bitField0_ & 0x00000080) == 0x00000080)) {
  6687. blockHash_ = java.util.Collections.unmodifiableList(blockHash_);
  6688. bitField0_ = (bitField0_ & ~0x00000080);
  6689. }
  6690. result.blockHash_ = blockHash_;
  6691. if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
  6692. to_bitField0_ |= 0x00000020;
  6693. }
  6694. if (confidenceBuilder_ == null) {
  6695. result.confidence_ = confidence_;
  6696. } else {
  6697. result.confidence_ = confidenceBuilder_.build();
  6698. }
  6699. if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
  6700. to_bitField0_ |= 0x00000040;
  6701. }
  6702. result.purpose_ = purpose_;
  6703. result.bitField0_ = to_bitField0_;
  6704. onBuilt();
  6705. return result;
  6706. }
  6707. public Builder mergeFrom(com.google.protobuf.Message other) {
  6708. if (other instanceof org.bitcoinj.wallet.Protos.Transaction) {
  6709. return mergeFrom((org.bitcoinj.wallet.Protos.Transaction)other);
  6710. } else {
  6711. super.mergeFrom(other);
  6712. return this;
  6713. }
  6714. }
  6715. public Builder mergeFrom(org.bitcoinj.wallet.Protos.Transaction other) {
  6716. if (other == org.bitcoinj.wallet.Protos.Transaction.getDefaultInstance()) return this;
  6717. if (other.hasVersion()) {
  6718. setVersion(other.getVersion());
  6719. }
  6720. if (other.hasHash()) {
  6721. setHash(other.getHash());
  6722. }
  6723. if (other.hasPool()) {
  6724. setPool(other.getPool());
  6725. }
  6726. if (other.hasLockTime()) {
  6727. setLockTime(other.getLockTime());
  6728. }
  6729. if (other.hasUpdatedAt()) {
  6730. setUpdatedAt(other.getUpdatedAt());
  6731. }
  6732. if (transactionInputBuilder_ == null) {
  6733. if (!other.transactionInput_.isEmpty()) {
  6734. if (transactionInput_.isEmpty()) {
  6735. transactionInput_ = other.transactionInput_;
  6736. bitField0_ = (bitField0_ & ~0x00000020);
  6737. } else {
  6738. ensureTransactionInputIsMutable();
  6739. transactionInput_.addAll(other.transactionInput_);
  6740. }
  6741. onChanged();
  6742. }
  6743. } else {
  6744. if (!other.transactionInput_.isEmpty()) {
  6745. if (transactionInputBuilder_.isEmpty()) {
  6746. transactionInputBuilder_.dispose();
  6747. transactionInputBuilder_ = null;
  6748. transactionInput_ = other.transactionInput_;
  6749. bitField0_ = (bitField0_ & ~0x00000020);
  6750. transactionInputBuilder_ =
  6751. com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
  6752. getTransactionInputFieldBuilder() : null;
  6753. } else {
  6754. transactionInputBuilder_.addAllMessages(other.transactionInput_);
  6755. }
  6756. }
  6757. }
  6758. if (transactionOutputBuilder_ == null) {
  6759. if (!other.transactionOutput_.isEmpty()) {
  6760. if (transactionOutput_.isEmpty()) {
  6761. transactionOutput_ = other.transactionOutput_;
  6762. bitField0_ = (bitField0_ & ~0x00000040);
  6763. } else {
  6764. ensureTransactionOutputIsMutable();
  6765. transactionOutput_.addAll(other.transactionOutput_);
  6766. }
  6767. onChanged();
  6768. }
  6769. } else {
  6770. if (!other.transactionOutput_.isEmpty()) {
  6771. if (transactionOutputBuilder_.isEmpty()) {
  6772. transactionOutputBuilder_.dispose();
  6773. transactionOutputBuilder_ = null;
  6774. transactionOutput_ = other.transactionOutput_;
  6775. bitField0_ = (bitField0_ & ~0x00000040);
  6776. transactionOutputBuilder_ =
  6777. com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
  6778. getTransactionOutputFieldBuilder() : null;
  6779. } else {
  6780. transactionOutputBuilder_.addAllMessages(other.transactionOutput_);
  6781. }
  6782. }
  6783. }
  6784. if (!other.blockHash_.isEmpty()) {
  6785. if (blockHash_.isEmpty()) {
  6786. blockHash_ = other.blockHash_;
  6787. bitField0_ = (bitField0_ & ~0x00000080);
  6788. } else {
  6789. ensureBlockHashIsMutable();
  6790. blockHash_.addAll(other.blockHash_);
  6791. }
  6792. onChanged();
  6793. }
  6794. if (other.hasConfidence()) {
  6795. mergeConfidence(other.getConfidence());
  6796. }
  6797. if (other.hasPurpose()) {
  6798. setPurpose(other.getPurpose());
  6799. }
  6800. this.mergeUnknownFields(other.getUnknownFields());
  6801. return this;
  6802. }
  6803. public final boolean isInitialized() {
  6804. if (!hasVersion()) {
  6805. return false;
  6806. }
  6807. if (!hasHash()) {
  6808. return false;
  6809. }
  6810. for (int i = 0; i < getTransactionInputCount(); i++) {
  6811. if (!getTransactionInput(i).isInitialized()) {
  6812. return false;
  6813. }
  6814. }
  6815. for (int i = 0; i < getTransactionOutputCount(); i++) {
  6816. if (!getTransactionOutput(i).isInitialized()) {
  6817. return false;
  6818. }
  6819. }
  6820. if (hasConfidence()) {
  6821. if (!getConfidence().isInitialized()) {
  6822. return false;
  6823. }
  6824. }
  6825. return true;
  6826. }
  6827. public Builder mergeFrom(
  6828. com.google.protobuf.CodedInputStream input,
  6829. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6830. throws java.io.IOException {
  6831. org.bitcoinj.wallet.Protos.Transaction parsedMessage = null;
  6832. try {
  6833. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  6834. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  6835. parsedMessage = (org.bitcoinj.wallet.Protos.Transaction) e.getUnfinishedMessage();
  6836. throw e;
  6837. } finally {
  6838. if (parsedMessage != null) {
  6839. mergeFrom(parsedMessage);
  6840. }
  6841. }
  6842. return this;
  6843. }
  6844. private int bitField0_;
  6845. // required int32 version = 1;
  6846. private int version_ ;
  6847. /**
  6848. * <code>required int32 version = 1;</code>
  6849. *
  6850. * <pre>
  6851. * See Wallet.java for detailed description of pool semantics
  6852. * </pre>
  6853. */
  6854. public boolean hasVersion() {
  6855. return ((bitField0_ & 0x00000001) == 0x00000001);
  6856. }
  6857. /**
  6858. * <code>required int32 version = 1;</code>
  6859. *
  6860. * <pre>
  6861. * See Wallet.java for detailed description of pool semantics
  6862. * </pre>
  6863. */
  6864. public int getVersion() {
  6865. return version_;
  6866. }
  6867. /**
  6868. * <code>required int32 version = 1;</code>
  6869. *
  6870. * <pre>
  6871. * See Wallet.java for detailed description of pool semantics
  6872. * </pre>
  6873. */
  6874. public Builder setVersion(int value) {
  6875. bitField0_ |= 0x00000001;
  6876. version_ = value;
  6877. onChanged();
  6878. return this;
  6879. }
  6880. /**
  6881. * <code>required int32 version = 1;</code>
  6882. *
  6883. * <pre>
  6884. * See Wallet.java for detailed description of pool semantics
  6885. * </pre>
  6886. */
  6887. public Builder clearVersion() {
  6888. bitField0_ = (bitField0_ & ~0x00000001);
  6889. version_ = 0;
  6890. onChanged();
  6891. return this;
  6892. }
  6893. // required bytes hash = 2;
  6894. private com.google.protobuf.ByteString hash_ = com.google.protobuf.ByteString.EMPTY;
  6895. /**
  6896. * <code>required bytes hash = 2;</code>
  6897. */
  6898. public boolean hasHash() {
  6899. return ((bitField0_ & 0x00000002) == 0x00000002);
  6900. }
  6901. /**
  6902. * <code>required bytes hash = 2;</code>
  6903. */
  6904. public com.google.protobuf.ByteString getHash() {
  6905. return hash_;
  6906. }
  6907. /**
  6908. * <code>required bytes hash = 2;</code>
  6909. */
  6910. public Builder setHash(com.google.protobuf.ByteString value) {
  6911. if (value == null) {
  6912. throw new NullPointerException();
  6913. }
  6914. bitField0_ |= 0x00000002;
  6915. hash_ = value;
  6916. onChanged();
  6917. return this;
  6918. }
  6919. /**
  6920. * <code>required bytes hash = 2;</code>
  6921. */
  6922. public Builder clearHash() {
  6923. bitField0_ = (bitField0_ & ~0x00000002);
  6924. hash_ = getDefaultInstance().getHash();
  6925. onChanged();
  6926. return this;
  6927. }
  6928. // optional .wallet.Transaction.Pool pool = 3;
  6929. private org.bitcoinj.wallet.Protos.Transaction.Pool pool_ = org.bitcoinj.wallet.Protos.Transaction.Pool.UNSPENT;
  6930. /**
  6931. * <code>optional .wallet.Transaction.Pool pool = 3;</code>
  6932. *
  6933. * <pre>
  6934. * If pool is not present, that means either:
  6935. * - This Transaction is either not in a wallet at all (the proto is re-used elsewhere)
  6936. * - Or it is stored but for other purposes, for example, because it is the overriding transaction of a double spend.
  6937. * - Or the Pool enum got a new value which your software is too old to parse.
  6938. * </pre>
  6939. */
  6940. public boolean hasPool() {
  6941. return ((bitField0_ & 0x00000004) == 0x00000004);
  6942. }
  6943. /**
  6944. * <code>optional .wallet.Transaction.Pool pool = 3;</code>
  6945. *
  6946. * <pre>
  6947. * If pool is not present, that means either:
  6948. * - This Transaction is either not in a wallet at all (the proto is re-used elsewhere)
  6949. * - Or it is stored but for other purposes, for example, because it is the overriding transaction of a double spend.
  6950. * - Or the Pool enum got a new value which your software is too old to parse.
  6951. * </pre>
  6952. */
  6953. public org.bitcoinj.wallet.Protos.Transaction.Pool getPool() {
  6954. return pool_;
  6955. }
  6956. /**
  6957. * <code>optional .wallet.Transaction.Pool pool = 3;</code>
  6958. *
  6959. * <pre>
  6960. * If pool is not present, that means either:
  6961. * - This Transaction is either not in a wallet at all (the proto is re-used elsewhere)
  6962. * - Or it is stored but for other purposes, for example, because it is the overriding transaction of a double spend.
  6963. * - Or the Pool enum got a new value which your software is too old to parse.
  6964. * </pre>
  6965. */
  6966. public Builder setPool(org.bitcoinj.wallet.Protos.Transaction.Pool value) {
  6967. if (value == null) {
  6968. throw new NullPointerException();
  6969. }
  6970. bitField0_ |= 0x00000004;
  6971. pool_ = value;
  6972. onChanged();
  6973. return this;
  6974. }
  6975. /**
  6976. * <code>optional .wallet.Transaction.Pool pool = 3;</code>
  6977. *
  6978. * <pre>
  6979. * If pool is not present, that means either:
  6980. * - This Transaction is either not in a wallet at all (the proto is re-used elsewhere)
  6981. * - Or it is stored but for other purposes, for example, because it is the overriding transaction of a double spend.
  6982. * - Or the Pool enum got a new value which your software is too old to parse.
  6983. * </pre>
  6984. */
  6985. public Builder clearPool() {
  6986. bitField0_ = (bitField0_ & ~0x00000004);
  6987. pool_ = org.bitcoinj.wallet.Protos.Transaction.Pool.UNSPENT;
  6988. onChanged();
  6989. return this;
  6990. }
  6991. // optional uint32 lock_time = 4;
  6992. private int lockTime_ ;
  6993. /**
  6994. * <code>optional uint32 lock_time = 4;</code>
  6995. *
  6996. * <pre>
  6997. * The nLockTime field is useful for contracts.
  6998. * </pre>
  6999. */
  7000. public boolean hasLockTime() {
  7001. return ((bitField0_ & 0x00000008) == 0x00000008);
  7002. }
  7003. /**
  7004. * <code>optional uint32 lock_time = 4;</code>
  7005. *
  7006. * <pre>
  7007. * The nLockTime field is useful for contracts.
  7008. * </pre>
  7009. */
  7010. public int getLockTime() {
  7011. return lockTime_;
  7012. }
  7013. /**
  7014. * <code>optional uint32 lock_time = 4;</code>
  7015. *
  7016. * <pre>
  7017. * The nLockTime field is useful for contracts.
  7018. * </pre>
  7019. */
  7020. public Builder setLockTime(int value) {
  7021. bitField0_ |= 0x00000008;
  7022. lockTime_ = value;
  7023. onChanged();
  7024. return this;
  7025. }
  7026. /**
  7027. * <code>optional uint32 lock_time = 4;</code>
  7028. *
  7029. * <pre>
  7030. * The nLockTime field is useful for contracts.
  7031. * </pre>
  7032. */
  7033. public Builder clearLockTime() {
  7034. bitField0_ = (bitField0_ & ~0x00000008);
  7035. lockTime_ = 0;
  7036. onChanged();
  7037. return this;
  7038. }
  7039. // optional int64 updated_at = 5;
  7040. private long updatedAt_ ;
  7041. /**
  7042. * <code>optional int64 updated_at = 5;</code>
  7043. *
  7044. * <pre>
  7045. * millis since epoch the transaction was last updated
  7046. * </pre>
  7047. */
  7048. public boolean hasUpdatedAt() {
  7049. return ((bitField0_ & 0x00000010) == 0x00000010);
  7050. }
  7051. /**
  7052. * <code>optional int64 updated_at = 5;</code>
  7053. *
  7054. * <pre>
  7055. * millis since epoch the transaction was last updated
  7056. * </pre>
  7057. */
  7058. public long getUpdatedAt() {
  7059. return updatedAt_;
  7060. }
  7061. /**
  7062. * <code>optional int64 updated_at = 5;</code>
  7063. *
  7064. * <pre>
  7065. * millis since epoch the transaction was last updated
  7066. * </pre>
  7067. */
  7068. public Builder setUpdatedAt(long value) {
  7069. bitField0_ |= 0x00000010;
  7070. updatedAt_ = value;
  7071. onChanged();
  7072. return this;
  7073. }
  7074. /**
  7075. * <code>optional int64 updated_at = 5;</code>
  7076. *
  7077. * <pre>
  7078. * millis since epoch the transaction was last updated
  7079. * </pre>
  7080. */
  7081. public Builder clearUpdatedAt() {
  7082. bitField0_ = (bitField0_ & ~0x00000010);
  7083. updatedAt_ = 0L;
  7084. onChanged();
  7085. return this;
  7086. }
  7087. // repeated .wallet.TransactionInput transaction_input = 6;
  7088. private java.util.List<org.bitcoinj.wallet.Protos.TransactionInput> transactionInput_ =
  7089. java.util.Collections.emptyList();
  7090. private void ensureTransactionInputIsMutable() {
  7091. if (!((bitField0_ & 0x00000020) == 0x00000020)) {
  7092. transactionInput_ = new java.util.ArrayList<org.bitcoinj.wallet.Protos.TransactionInput>(transactionInput_);
  7093. bitField0_ |= 0x00000020;
  7094. }
  7095. }
  7096. private com.google.protobuf.RepeatedFieldBuilder<
  7097. org.bitcoinj.wallet.Protos.TransactionInput, org.bitcoinj.wallet.Protos.TransactionInput.Builder, org.bitcoinj.wallet.Protos.TransactionInputOrBuilder> transactionInputBuilder_;
  7098. /**
  7099. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  7100. */
  7101. public java.util.List<org.bitcoinj.wallet.Protos.TransactionInput> getTransactionInputList() {
  7102. if (transactionInputBuilder_ == null) {
  7103. return java.util.Collections.unmodifiableList(transactionInput_);
  7104. } else {
  7105. return transactionInputBuilder_.getMessageList();
  7106. }
  7107. }
  7108. /**
  7109. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  7110. */
  7111. public int getTransactionInputCount() {
  7112. if (transactionInputBuilder_ == null) {
  7113. return transactionInput_.size();
  7114. } else {
  7115. return transactionInputBuilder_.getCount();
  7116. }
  7117. }
  7118. /**
  7119. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  7120. */
  7121. public org.bitcoinj.wallet.Protos.TransactionInput getTransactionInput(int index) {
  7122. if (transactionInputBuilder_ == null) {
  7123. return transactionInput_.get(index);
  7124. } else {
  7125. return transactionInputBuilder_.getMessage(index);
  7126. }
  7127. }
  7128. /**
  7129. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  7130. */
  7131. public Builder setTransactionInput(
  7132. int index, org.bitcoinj.wallet.Protos.TransactionInput value) {
  7133. if (transactionInputBuilder_ == null) {
  7134. if (value == null) {
  7135. throw new NullPointerException();
  7136. }
  7137. ensureTransactionInputIsMutable();
  7138. transactionInput_.set(index, value);
  7139. onChanged();
  7140. } else {
  7141. transactionInputBuilder_.setMessage(index, value);
  7142. }
  7143. return this;
  7144. }
  7145. /**
  7146. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  7147. */
  7148. public Builder setTransactionInput(
  7149. int index, org.bitcoinj.wallet.Protos.TransactionInput.Builder builderForValue) {
  7150. if (transactionInputBuilder_ == null) {
  7151. ensureTransactionInputIsMutable();
  7152. transactionInput_.set(index, builderForValue.build());
  7153. onChanged();
  7154. } else {
  7155. transactionInputBuilder_.setMessage(index, builderForValue.build());
  7156. }
  7157. return this;
  7158. }
  7159. /**
  7160. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  7161. */
  7162. public Builder addTransactionInput(org.bitcoinj.wallet.Protos.TransactionInput value) {
  7163. if (transactionInputBuilder_ == null) {
  7164. if (value == null) {
  7165. throw new NullPointerException();
  7166. }
  7167. ensureTransactionInputIsMutable();
  7168. transactionInput_.add(value);
  7169. onChanged();
  7170. } else {
  7171. transactionInputBuilder_.addMessage(value);
  7172. }
  7173. return this;
  7174. }
  7175. /**
  7176. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  7177. */
  7178. public Builder addTransactionInput(
  7179. int index, org.bitcoinj.wallet.Protos.TransactionInput value) {
  7180. if (transactionInputBuilder_ == null) {
  7181. if (value == null) {
  7182. throw new NullPointerException();
  7183. }
  7184. ensureTransactionInputIsMutable();
  7185. transactionInput_.add(index, value);
  7186. onChanged();
  7187. } else {
  7188. transactionInputBuilder_.addMessage(index, value);
  7189. }
  7190. return this;
  7191. }
  7192. /**
  7193. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  7194. */
  7195. public Builder addTransactionInput(
  7196. org.bitcoinj.wallet.Protos.TransactionInput.Builder builderForValue) {
  7197. if (transactionInputBuilder_ == null) {
  7198. ensureTransactionInputIsMutable();
  7199. transactionInput_.add(builderForValue.build());
  7200. onChanged();
  7201. } else {
  7202. transactionInputBuilder_.addMessage(builderForValue.build());
  7203. }
  7204. return this;
  7205. }
  7206. /**
  7207. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  7208. */
  7209. public Builder addTransactionInput(
  7210. int index, org.bitcoinj.wallet.Protos.TransactionInput.Builder builderForValue) {
  7211. if (transactionInputBuilder_ == null) {
  7212. ensureTransactionInputIsMutable();
  7213. transactionInput_.add(index, builderForValue.build());
  7214. onChanged();
  7215. } else {
  7216. transactionInputBuilder_.addMessage(index, builderForValue.build());
  7217. }
  7218. return this;
  7219. }
  7220. /**
  7221. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  7222. */
  7223. public Builder addAllTransactionInput(
  7224. java.lang.Iterable<? extends org.bitcoinj.wallet.Protos.TransactionInput> values) {
  7225. if (transactionInputBuilder_ == null) {
  7226. ensureTransactionInputIsMutable();
  7227. super.addAll(values, transactionInput_);
  7228. onChanged();
  7229. } else {
  7230. transactionInputBuilder_.addAllMessages(values);
  7231. }
  7232. return this;
  7233. }
  7234. /**
  7235. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  7236. */
  7237. public Builder clearTransactionInput() {
  7238. if (transactionInputBuilder_ == null) {
  7239. transactionInput_ = java.util.Collections.emptyList();
  7240. bitField0_ = (bitField0_ & ~0x00000020);
  7241. onChanged();
  7242. } else {
  7243. transactionInputBuilder_.clear();
  7244. }
  7245. return this;
  7246. }
  7247. /**
  7248. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  7249. */
  7250. public Builder removeTransactionInput(int index) {
  7251. if (transactionInputBuilder_ == null) {
  7252. ensureTransactionInputIsMutable();
  7253. transactionInput_.remove(index);
  7254. onChanged();
  7255. } else {
  7256. transactionInputBuilder_.remove(index);
  7257. }
  7258. return this;
  7259. }
  7260. /**
  7261. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  7262. */
  7263. public org.bitcoinj.wallet.Protos.TransactionInput.Builder getTransactionInputBuilder(
  7264. int index) {
  7265. return getTransactionInputFieldBuilder().getBuilder(index);
  7266. }
  7267. /**
  7268. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  7269. */
  7270. public org.bitcoinj.wallet.Protos.TransactionInputOrBuilder getTransactionInputOrBuilder(
  7271. int index) {
  7272. if (transactionInputBuilder_ == null) {
  7273. return transactionInput_.get(index); } else {
  7274. return transactionInputBuilder_.getMessageOrBuilder(index);
  7275. }
  7276. }
  7277. /**
  7278. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  7279. */
  7280. public java.util.List<? extends org.bitcoinj.wallet.Protos.TransactionInputOrBuilder>
  7281. getTransactionInputOrBuilderList() {
  7282. if (transactionInputBuilder_ != null) {
  7283. return transactionInputBuilder_.getMessageOrBuilderList();
  7284. } else {
  7285. return java.util.Collections.unmodifiableList(transactionInput_);
  7286. }
  7287. }
  7288. /**
  7289. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  7290. */
  7291. public org.bitcoinj.wallet.Protos.TransactionInput.Builder addTransactionInputBuilder() {
  7292. return getTransactionInputFieldBuilder().addBuilder(
  7293. org.bitcoinj.wallet.Protos.TransactionInput.getDefaultInstance());
  7294. }
  7295. /**
  7296. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  7297. */
  7298. public org.bitcoinj.wallet.Protos.TransactionInput.Builder addTransactionInputBuilder(
  7299. int index) {
  7300. return getTransactionInputFieldBuilder().addBuilder(
  7301. index, org.bitcoinj.wallet.Protos.TransactionInput.getDefaultInstance());
  7302. }
  7303. /**
  7304. * <code>repeated .wallet.TransactionInput transaction_input = 6;</code>
  7305. */
  7306. public java.util.List<org.bitcoinj.wallet.Protos.TransactionInput.Builder>
  7307. getTransactionInputBuilderList() {
  7308. return getTransactionInputFieldBuilder().getBuilderList();
  7309. }
  7310. private com.google.protobuf.RepeatedFieldBuilder<
  7311. org.bitcoinj.wallet.Protos.TransactionInput, org.bitcoinj.wallet.Protos.TransactionInput.Builder, org.bitcoinj.wallet.Protos.TransactionInputOrBuilder>
  7312. getTransactionInputFieldBuilder() {
  7313. if (transactionInputBuilder_ == null) {
  7314. transactionInputBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
  7315. org.bitcoinj.wallet.Protos.TransactionInput, org.bitcoinj.wallet.Protos.TransactionInput.Builder, org.bitcoinj.wallet.Protos.TransactionInputOrBuilder>(
  7316. transactionInput_,
  7317. ((bitField0_ & 0x00000020) == 0x00000020),
  7318. getParentForChildren(),
  7319. isClean());
  7320. transactionInput_ = null;
  7321. }
  7322. return transactionInputBuilder_;
  7323. }
  7324. // repeated .wallet.TransactionOutput transaction_output = 7;
  7325. private java.util.List<org.bitcoinj.wallet.Protos.TransactionOutput> transactionOutput_ =
  7326. java.util.Collections.emptyList();
  7327. private void ensureTransactionOutputIsMutable() {
  7328. if (!((bitField0_ & 0x00000040) == 0x00000040)) {
  7329. transactionOutput_ = new java.util.ArrayList<org.bitcoinj.wallet.Protos.TransactionOutput>(transactionOutput_);
  7330. bitField0_ |= 0x00000040;
  7331. }
  7332. }
  7333. private com.google.protobuf.RepeatedFieldBuilder<
  7334. org.bitcoinj.wallet.Protos.TransactionOutput, org.bitcoinj.wallet.Protos.TransactionOutput.Builder, org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder> transactionOutputBuilder_;
  7335. /**
  7336. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  7337. */
  7338. public java.util.List<org.bitcoinj.wallet.Protos.TransactionOutput> getTransactionOutputList() {
  7339. if (transactionOutputBuilder_ == null) {
  7340. return java.util.Collections.unmodifiableList(transactionOutput_);
  7341. } else {
  7342. return transactionOutputBuilder_.getMessageList();
  7343. }
  7344. }
  7345. /**
  7346. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  7347. */
  7348. public int getTransactionOutputCount() {
  7349. if (transactionOutputBuilder_ == null) {
  7350. return transactionOutput_.size();
  7351. } else {
  7352. return transactionOutputBuilder_.getCount();
  7353. }
  7354. }
  7355. /**
  7356. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  7357. */
  7358. public org.bitcoinj.wallet.Protos.TransactionOutput getTransactionOutput(int index) {
  7359. if (transactionOutputBuilder_ == null) {
  7360. return transactionOutput_.get(index);
  7361. } else {
  7362. return transactionOutputBuilder_.getMessage(index);
  7363. }
  7364. }
  7365. /**
  7366. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  7367. */
  7368. public Builder setTransactionOutput(
  7369. int index, org.bitcoinj.wallet.Protos.TransactionOutput value) {
  7370. if (transactionOutputBuilder_ == null) {
  7371. if (value == null) {
  7372. throw new NullPointerException();
  7373. }
  7374. ensureTransactionOutputIsMutable();
  7375. transactionOutput_.set(index, value);
  7376. onChanged();
  7377. } else {
  7378. transactionOutputBuilder_.setMessage(index, value);
  7379. }
  7380. return this;
  7381. }
  7382. /**
  7383. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  7384. */
  7385. public Builder setTransactionOutput(
  7386. int index, org.bitcoinj.wallet.Protos.TransactionOutput.Builder builderForValue) {
  7387. if (transactionOutputBuilder_ == null) {
  7388. ensureTransactionOutputIsMutable();
  7389. transactionOutput_.set(index, builderForValue.build());
  7390. onChanged();
  7391. } else {
  7392. transactionOutputBuilder_.setMessage(index, builderForValue.build());
  7393. }
  7394. return this;
  7395. }
  7396. /**
  7397. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  7398. */
  7399. public Builder addTransactionOutput(org.bitcoinj.wallet.Protos.TransactionOutput value) {
  7400. if (transactionOutputBuilder_ == null) {
  7401. if (value == null) {
  7402. throw new NullPointerException();
  7403. }
  7404. ensureTransactionOutputIsMutable();
  7405. transactionOutput_.add(value);
  7406. onChanged();
  7407. } else {
  7408. transactionOutputBuilder_.addMessage(value);
  7409. }
  7410. return this;
  7411. }
  7412. /**
  7413. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  7414. */
  7415. public Builder addTransactionOutput(
  7416. int index, org.bitcoinj.wallet.Protos.TransactionOutput value) {
  7417. if (transactionOutputBuilder_ == null) {
  7418. if (value == null) {
  7419. throw new NullPointerException();
  7420. }
  7421. ensureTransactionOutputIsMutable();
  7422. transactionOutput_.add(index, value);
  7423. onChanged();
  7424. } else {
  7425. transactionOutputBuilder_.addMessage(index, value);
  7426. }
  7427. return this;
  7428. }
  7429. /**
  7430. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  7431. */
  7432. public Builder addTransactionOutput(
  7433. org.bitcoinj.wallet.Protos.TransactionOutput.Builder builderForValue) {
  7434. if (transactionOutputBuilder_ == null) {
  7435. ensureTransactionOutputIsMutable();
  7436. transactionOutput_.add(builderForValue.build());
  7437. onChanged();
  7438. } else {
  7439. transactionOutputBuilder_.addMessage(builderForValue.build());
  7440. }
  7441. return this;
  7442. }
  7443. /**
  7444. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  7445. */
  7446. public Builder addTransactionOutput(
  7447. int index, org.bitcoinj.wallet.Protos.TransactionOutput.Builder builderForValue) {
  7448. if (transactionOutputBuilder_ == null) {
  7449. ensureTransactionOutputIsMutable();
  7450. transactionOutput_.add(index, builderForValue.build());
  7451. onChanged();
  7452. } else {
  7453. transactionOutputBuilder_.addMessage(index, builderForValue.build());
  7454. }
  7455. return this;
  7456. }
  7457. /**
  7458. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  7459. */
  7460. public Builder addAllTransactionOutput(
  7461. java.lang.Iterable<? extends org.bitcoinj.wallet.Protos.TransactionOutput> values) {
  7462. if (transactionOutputBuilder_ == null) {
  7463. ensureTransactionOutputIsMutable();
  7464. super.addAll(values, transactionOutput_);
  7465. onChanged();
  7466. } else {
  7467. transactionOutputBuilder_.addAllMessages(values);
  7468. }
  7469. return this;
  7470. }
  7471. /**
  7472. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  7473. */
  7474. public Builder clearTransactionOutput() {
  7475. if (transactionOutputBuilder_ == null) {
  7476. transactionOutput_ = java.util.Collections.emptyList();
  7477. bitField0_ = (bitField0_ & ~0x00000040);
  7478. onChanged();
  7479. } else {
  7480. transactionOutputBuilder_.clear();
  7481. }
  7482. return this;
  7483. }
  7484. /**
  7485. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  7486. */
  7487. public Builder removeTransactionOutput(int index) {
  7488. if (transactionOutputBuilder_ == null) {
  7489. ensureTransactionOutputIsMutable();
  7490. transactionOutput_.remove(index);
  7491. onChanged();
  7492. } else {
  7493. transactionOutputBuilder_.remove(index);
  7494. }
  7495. return this;
  7496. }
  7497. /**
  7498. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  7499. */
  7500. public org.bitcoinj.wallet.Protos.TransactionOutput.Builder getTransactionOutputBuilder(
  7501. int index) {
  7502. return getTransactionOutputFieldBuilder().getBuilder(index);
  7503. }
  7504. /**
  7505. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  7506. */
  7507. public org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder getTransactionOutputOrBuilder(
  7508. int index) {
  7509. if (transactionOutputBuilder_ == null) {
  7510. return transactionOutput_.get(index); } else {
  7511. return transactionOutputBuilder_.getMessageOrBuilder(index);
  7512. }
  7513. }
  7514. /**
  7515. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  7516. */
  7517. public java.util.List<? extends org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder>
  7518. getTransactionOutputOrBuilderList() {
  7519. if (transactionOutputBuilder_ != null) {
  7520. return transactionOutputBuilder_.getMessageOrBuilderList();
  7521. } else {
  7522. return java.util.Collections.unmodifiableList(transactionOutput_);
  7523. }
  7524. }
  7525. /**
  7526. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  7527. */
  7528. public org.bitcoinj.wallet.Protos.TransactionOutput.Builder addTransactionOutputBuilder() {
  7529. return getTransactionOutputFieldBuilder().addBuilder(
  7530. org.bitcoinj.wallet.Protos.TransactionOutput.getDefaultInstance());
  7531. }
  7532. /**
  7533. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  7534. */
  7535. public org.bitcoinj.wallet.Protos.TransactionOutput.Builder addTransactionOutputBuilder(
  7536. int index) {
  7537. return getTransactionOutputFieldBuilder().addBuilder(
  7538. index, org.bitcoinj.wallet.Protos.TransactionOutput.getDefaultInstance());
  7539. }
  7540. /**
  7541. * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code>
  7542. */
  7543. public java.util.List<org.bitcoinj.wallet.Protos.TransactionOutput.Builder>
  7544. getTransactionOutputBuilderList() {
  7545. return getTransactionOutputFieldBuilder().getBuilderList();
  7546. }
  7547. private com.google.protobuf.RepeatedFieldBuilder<
  7548. org.bitcoinj.wallet.Protos.TransactionOutput, org.bitcoinj.wallet.Protos.TransactionOutput.Builder, org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder>
  7549. getTransactionOutputFieldBuilder() {
  7550. if (transactionOutputBuilder_ == null) {
  7551. transactionOutputBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
  7552. org.bitcoinj.wallet.Protos.TransactionOutput, org.bitcoinj.wallet.Protos.TransactionOutput.Builder, org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder>(
  7553. transactionOutput_,
  7554. ((bitField0_ & 0x00000040) == 0x00000040),
  7555. getParentForChildren(),
  7556. isClean());
  7557. transactionOutput_ = null;
  7558. }
  7559. return transactionOutputBuilder_;
  7560. }
  7561. // repeated bytes block_hash = 8;
  7562. private java.util.List<com.google.protobuf.ByteString> blockHash_ = java.util.Collections.emptyList();
  7563. private void ensureBlockHashIsMutable() {
  7564. if (!((bitField0_ & 0x00000080) == 0x00000080)) {
  7565. blockHash_ = new java.util.ArrayList<com.google.protobuf.ByteString>(blockHash_);
  7566. bitField0_ |= 0x00000080;
  7567. }
  7568. }
  7569. /**
  7570. * <code>repeated bytes block_hash = 8;</code>
  7571. *
  7572. * <pre>
  7573. * A list of blocks in which the transaction has been observed (on any chain).
  7574. * </pre>
  7575. */
  7576. public java.util.List<com.google.protobuf.ByteString>
  7577. getBlockHashList() {
  7578. return java.util.Collections.unmodifiableList(blockHash_);
  7579. }
  7580. /**
  7581. * <code>repeated bytes block_hash = 8;</code>
  7582. *
  7583. * <pre>
  7584. * A list of blocks in which the transaction has been observed (on any chain).
  7585. * </pre>
  7586. */
  7587. public int getBlockHashCount() {
  7588. return blockHash_.size();
  7589. }
  7590. /**
  7591. * <code>repeated bytes block_hash = 8;</code>
  7592. *
  7593. * <pre>
  7594. * A list of blocks in which the transaction has been observed (on any chain).
  7595. * </pre>
  7596. */
  7597. public com.google.protobuf.ByteString getBlockHash(int index) {
  7598. return blockHash_.get(index);
  7599. }
  7600. /**
  7601. * <code>repeated bytes block_hash = 8;</code>
  7602. *
  7603. * <pre>
  7604. * A list of blocks in which the transaction has been observed (on any chain).
  7605. * </pre>
  7606. */
  7607. public Builder setBlockHash(
  7608. int index, com.google.protobuf.ByteString value) {
  7609. if (value == null) {
  7610. throw new NullPointerException();
  7611. }
  7612. ensureBlockHashIsMutable();
  7613. blockHash_.set(index, value);
  7614. onChanged();
  7615. return this;
  7616. }
  7617. /**
  7618. * <code>repeated bytes block_hash = 8;</code>
  7619. *
  7620. * <pre>
  7621. * A list of blocks in which the transaction has been observed (on any chain).
  7622. * </pre>
  7623. */
  7624. public Builder addBlockHash(com.google.protobuf.ByteString value) {
  7625. if (value == null) {
  7626. throw new NullPointerException();
  7627. }
  7628. ensureBlockHashIsMutable();
  7629. blockHash_.add(value);
  7630. onChanged();
  7631. return this;
  7632. }
  7633. /**
  7634. * <code>repeated bytes block_hash = 8;</code>
  7635. *
  7636. * <pre>
  7637. * A list of blocks in which the transaction has been observed (on any chain).
  7638. * </pre>
  7639. */
  7640. public Builder addAllBlockHash(
  7641. java.lang.Iterable<? extends com.google.protobuf.ByteString> values) {
  7642. ensureBlockHashIsMutable();
  7643. super.addAll(values, blockHash_);
  7644. onChanged();
  7645. return this;
  7646. }
  7647. /**
  7648. * <code>repeated bytes block_hash = 8;</code>
  7649. *
  7650. * <pre>
  7651. * A list of blocks in which the transaction has been observed (on any chain).
  7652. * </pre>
  7653. */
  7654. public Builder clearBlockHash() {
  7655. blockHash_ = java.util.Collections.emptyList();
  7656. bitField0_ = (bitField0_ & ~0x00000080);
  7657. onChanged();
  7658. return this;
  7659. }
  7660. // optional .wallet.TransactionConfidence confidence = 9;
  7661. private org.bitcoinj.wallet.Protos.TransactionConfidence confidence_ = org.bitcoinj.wallet.Protos.TransactionConfidence.getDefaultInstance();
  7662. private com.google.protobuf.SingleFieldBuilder<
  7663. org.bitcoinj.wallet.Protos.TransactionConfidence, org.bitcoinj.wallet.Protos.TransactionConfidence.Builder, org.bitcoinj.wallet.Protos.TransactionConfidenceOrBuilder> confidenceBuilder_;
  7664. /**
  7665. * <code>optional .wallet.TransactionConfidence confidence = 9;</code>
  7666. *
  7667. * <pre>
  7668. * Data describing where the transaction is in the chain.
  7669. * </pre>
  7670. */
  7671. public boolean hasConfidence() {
  7672. return ((bitField0_ & 0x00000100) == 0x00000100);
  7673. }
  7674. /**
  7675. * <code>optional .wallet.TransactionConfidence confidence = 9;</code>
  7676. *
  7677. * <pre>
  7678. * Data describing where the transaction is in the chain.
  7679. * </pre>
  7680. */
  7681. public org.bitcoinj.wallet.Protos.TransactionConfidence getConfidence() {
  7682. if (confidenceBuilder_ == null) {
  7683. return confidence_;
  7684. } else {
  7685. return confidenceBuilder_.getMessage();
  7686. }
  7687. }
  7688. /**
  7689. * <code>optional .wallet.TransactionConfidence confidence = 9;</code>
  7690. *
  7691. * <pre>
  7692. * Data describing where the transaction is in the chain.
  7693. * </pre>
  7694. */
  7695. public Builder setConfidence(org.bitcoinj.wallet.Protos.TransactionConfidence value) {
  7696. if (confidenceBuilder_ == null) {
  7697. if (value == null) {
  7698. throw new NullPointerException();
  7699. }
  7700. confidence_ = value;
  7701. onChanged();
  7702. } else {
  7703. confidenceBuilder_.setMessage(value);
  7704. }
  7705. bitField0_ |= 0x00000100;
  7706. return this;
  7707. }
  7708. /**
  7709. * <code>optional .wallet.TransactionConfidence confidence = 9;</code>
  7710. *
  7711. * <pre>
  7712. * Data describing where the transaction is in the chain.
  7713. * </pre>
  7714. */
  7715. public Builder setConfidence(
  7716. org.bitcoinj.wallet.Protos.TransactionConfidence.Builder builderForValue) {
  7717. if (confidenceBuilder_ == null) {
  7718. confidence_ = builderForValue.build();
  7719. onChanged();
  7720. } else {
  7721. confidenceBuilder_.setMessage(builderForValue.build());
  7722. }
  7723. bitField0_ |= 0x00000100;
  7724. return this;
  7725. }
  7726. /**
  7727. * <code>optional .wallet.TransactionConfidence confidence = 9;</code>
  7728. *
  7729. * <pre>
  7730. * Data describing where the transaction is in the chain.
  7731. * </pre>
  7732. */
  7733. public Builder mergeConfidence(org.bitcoinj.wallet.Protos.TransactionConfidence value) {
  7734. if (confidenceBuilder_ == null) {
  7735. if (((bitField0_ & 0x00000100) == 0x00000100) &&
  7736. confidence_ != org.bitcoinj.wallet.Protos.TransactionConfidence.getDefaultInstance()) {
  7737. confidence_ =
  7738. org.bitcoinj.wallet.Protos.TransactionConfidence.newBuilder(confidence_).mergeFrom(value).buildPartial();
  7739. } else {
  7740. confidence_ = value;
  7741. }
  7742. onChanged();
  7743. } else {
  7744. confidenceBuilder_.mergeFrom(value);
  7745. }
  7746. bitField0_ |= 0x00000100;
  7747. return this;
  7748. }
  7749. /**
  7750. * <code>optional .wallet.TransactionConfidence confidence = 9;</code>
  7751. *
  7752. * <pre>
  7753. * Data describing where the transaction is in the chain.
  7754. * </pre>
  7755. */
  7756. public Builder clearConfidence() {
  7757. if (confidenceBuilder_ == null) {
  7758. confidence_ = org.bitcoinj.wallet.Protos.TransactionConfidence.getDefaultInstance();
  7759. onChanged();
  7760. } else {
  7761. confidenceBuilder_.clear();
  7762. }
  7763. bitField0_ = (bitField0_ & ~0x00000100);
  7764. return this;
  7765. }
  7766. /**
  7767. * <code>optional .wallet.TransactionConfidence confidence = 9;</code>
  7768. *
  7769. * <pre>
  7770. * Data describing where the transaction is in the chain.
  7771. * </pre>
  7772. */
  7773. public org.bitcoinj.wallet.Protos.TransactionConfidence.Builder getConfidenceBuilder() {
  7774. bitField0_ |= 0x00000100;
  7775. onChanged();
  7776. return getConfidenceFieldBuilder().getBuilder();
  7777. }
  7778. /**
  7779. * <code>optional .wallet.TransactionConfidence confidence = 9;</code>
  7780. *
  7781. * <pre>
  7782. * Data describing where the transaction is in the chain.
  7783. * </pre>
  7784. */
  7785. public org.bitcoinj.wallet.Protos.TransactionConfidenceOrBuilder getConfidenceOrBuilder() {
  7786. if (confidenceBuilder_ != null) {
  7787. return confidenceBuilder_.getMessageOrBuilder();
  7788. } else {
  7789. return confidence_;
  7790. }
  7791. }
  7792. /**
  7793. * <code>optional .wallet.TransactionConfidence confidence = 9;</code>
  7794. *
  7795. * <pre>
  7796. * Data describing where the transaction is in the chain.
  7797. * </pre>
  7798. */
  7799. private com.google.protobuf.SingleFieldBuilder<
  7800. org.bitcoinj.wallet.Protos.TransactionConfidence, org.bitcoinj.wallet.Protos.TransactionConfidence.Builder, org.bitcoinj.wallet.Protos.TransactionConfidenceOrBuilder>
  7801. getConfidenceFieldBuilder() {
  7802. if (confidenceBuilder_ == null) {
  7803. confidenceBuilder_ = new com.google.protobuf.SingleFieldBuilder<
  7804. org.bitcoinj.wallet.Protos.TransactionConfidence, org.bitcoinj.wallet.Protos.TransactionConfidence.Builder, org.bitcoinj.wallet.Protos.TransactionConfidenceOrBuilder>(
  7805. confidence_,
  7806. getParentForChildren(),
  7807. isClean());
  7808. confidence_ = null;
  7809. }
  7810. return confidenceBuilder_;
  7811. }
  7812. // optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN];
  7813. private org.bitcoinj.wallet.Protos.Transaction.Purpose purpose_ = org.bitcoinj.wallet.Protos.Transaction.Purpose.UNKNOWN;
  7814. /**
  7815. * <code>optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN];</code>
  7816. */
  7817. public boolean hasPurpose() {
  7818. return ((bitField0_ & 0x00000200) == 0x00000200);
  7819. }
  7820. /**
  7821. * <code>optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN];</code>
  7822. */
  7823. public org.bitcoinj.wallet.Protos.Transaction.Purpose getPurpose() {
  7824. return purpose_;
  7825. }
  7826. /**
  7827. * <code>optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN];</code>
  7828. */
  7829. public Builder setPurpose(org.bitcoinj.wallet.Protos.Transaction.Purpose value) {
  7830. if (value == null) {
  7831. throw new NullPointerException();
  7832. }
  7833. bitField0_ |= 0x00000200;
  7834. purpose_ = value;
  7835. onChanged();
  7836. return this;
  7837. }
  7838. /**
  7839. * <code>optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN];</code>
  7840. */
  7841. public Builder clearPurpose() {
  7842. bitField0_ = (bitField0_ & ~0x00000200);
  7843. purpose_ = org.bitcoinj.wallet.Protos.Transaction.Purpose.UNKNOWN;
  7844. onChanged();
  7845. return this;
  7846. }
  7847. // @@protoc_insertion_point(builder_scope:wallet.Transaction)
  7848. }
  7849. static {
  7850. defaultInstance = new Transaction(true);
  7851. defaultInstance.initFields();
  7852. }
  7853. // @@protoc_insertion_point(class_scope:wallet.Transaction)
  7854. }
  7855. public interface ScryptParametersOrBuilder
  7856. extends com.google.protobuf.MessageOrBuilder {
  7857. // required bytes salt = 1;
  7858. /**
  7859. * <code>required bytes salt = 1;</code>
  7860. *
  7861. * <pre>
  7862. * Salt to use in generation of the wallet password (8 bytes)
  7863. * </pre>
  7864. */
  7865. boolean hasSalt();
  7866. /**
  7867. * <code>required bytes salt = 1;</code>
  7868. *
  7869. * <pre>
  7870. * Salt to use in generation of the wallet password (8 bytes)
  7871. * </pre>
  7872. */
  7873. com.google.protobuf.ByteString getSalt();
  7874. // optional int64 n = 2 [default = 16384];
  7875. /**
  7876. * <code>optional int64 n = 2 [default = 16384];</code>
  7877. *
  7878. * <pre>
  7879. * CPU/ memory cost parameter
  7880. * </pre>
  7881. */
  7882. boolean hasN();
  7883. /**
  7884. * <code>optional int64 n = 2 [default = 16384];</code>
  7885. *
  7886. * <pre>
  7887. * CPU/ memory cost parameter
  7888. * </pre>
  7889. */
  7890. long getN();
  7891. // optional int32 r = 3 [default = 8];
  7892. /**
  7893. * <code>optional int32 r = 3 [default = 8];</code>
  7894. *
  7895. * <pre>
  7896. * Block size parameter
  7897. * </pre>
  7898. */
  7899. boolean hasR();
  7900. /**
  7901. * <code>optional int32 r = 3 [default = 8];</code>
  7902. *
  7903. * <pre>
  7904. * Block size parameter
  7905. * </pre>
  7906. */
  7907. int getR();
  7908. // optional int32 p = 4 [default = 1];
  7909. /**
  7910. * <code>optional int32 p = 4 [default = 1];</code>
  7911. *
  7912. * <pre>
  7913. * Parallelisation parameter
  7914. * </pre>
  7915. */
  7916. boolean hasP();
  7917. /**
  7918. * <code>optional int32 p = 4 [default = 1];</code>
  7919. *
  7920. * <pre>
  7921. * Parallelisation parameter
  7922. * </pre>
  7923. */
  7924. int getP();
  7925. }
  7926. /**
  7927. * Protobuf type {@code wallet.ScryptParameters}
  7928. *
  7929. * <pre>
  7930. ** The parameters used in the scrypt key derivation function.
  7931. * The default values are taken from http://www.tarsnap.com/scrypt/scrypt-slides.pdf.
  7932. * They can be increased - n is the number of iterations performed and
  7933. * r and p can be used to tweak the algorithm - see:
  7934. * http://stackoverflow.com/questions/11126315/what-are-optimal-scrypt-work-factors
  7935. * </pre>
  7936. */
  7937. public static final class ScryptParameters extends
  7938. com.google.protobuf.GeneratedMessage
  7939. implements ScryptParametersOrBuilder {
  7940. // Use ScryptParameters.newBuilder() to construct.
  7941. private ScryptParameters(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  7942. super(builder);
  7943. this.unknownFields = builder.getUnknownFields();
  7944. }
  7945. private ScryptParameters(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  7946. private static final ScryptParameters defaultInstance;
  7947. public static ScryptParameters getDefaultInstance() {
  7948. return defaultInstance;
  7949. }
  7950. public ScryptParameters getDefaultInstanceForType() {
  7951. return defaultInstance;
  7952. }
  7953. private final com.google.protobuf.UnknownFieldSet unknownFields;
  7954. @java.lang.Override
  7955. public final com.google.protobuf.UnknownFieldSet
  7956. getUnknownFields() {
  7957. return this.unknownFields;
  7958. }
  7959. private ScryptParameters(
  7960. com.google.protobuf.CodedInputStream input,
  7961. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  7962. throws com.google.protobuf.InvalidProtocolBufferException {
  7963. initFields();
  7964. int mutable_bitField0_ = 0;
  7965. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  7966. com.google.protobuf.UnknownFieldSet.newBuilder();
  7967. try {
  7968. boolean done = false;
  7969. while (!done) {
  7970. int tag = input.readTag();
  7971. switch (tag) {
  7972. case 0:
  7973. done = true;
  7974. break;
  7975. default: {
  7976. if (!parseUnknownField(input, unknownFields,
  7977. extensionRegistry, tag)) {
  7978. done = true;
  7979. }
  7980. break;
  7981. }
  7982. case 10: {
  7983. bitField0_ |= 0x00000001;
  7984. salt_ = input.readBytes();
  7985. break;
  7986. }
  7987. case 16: {
  7988. bitField0_ |= 0x00000002;
  7989. n_ = input.readInt64();
  7990. break;
  7991. }
  7992. case 24: {
  7993. bitField0_ |= 0x00000004;
  7994. r_ = input.readInt32();
  7995. break;
  7996. }
  7997. case 32: {
  7998. bitField0_ |= 0x00000008;
  7999. p_ = input.readInt32();
  8000. break;
  8001. }
  8002. }
  8003. }
  8004. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  8005. throw e.setUnfinishedMessage(this);
  8006. } catch (java.io.IOException e) {
  8007. throw new com.google.protobuf.InvalidProtocolBufferException(
  8008. e.getMessage()).setUnfinishedMessage(this);
  8009. } finally {
  8010. this.unknownFields = unknownFields.build();
  8011. makeExtensionsImmutable();
  8012. }
  8013. }
  8014. public static final com.google.protobuf.Descriptors.Descriptor
  8015. getDescriptor() {
  8016. return org.bitcoinj.wallet.Protos.internal_static_wallet_ScryptParameters_descriptor;
  8017. }
  8018. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  8019. internalGetFieldAccessorTable() {
  8020. return org.bitcoinj.wallet.Protos.internal_static_wallet_ScryptParameters_fieldAccessorTable
  8021. .ensureFieldAccessorsInitialized(
  8022. org.bitcoinj.wallet.Protos.ScryptParameters.class, org.bitcoinj.wallet.Protos.ScryptParameters.Builder.class);
  8023. }
  8024. public static com.google.protobuf.Parser<ScryptParameters> PARSER =
  8025. new com.google.protobuf.AbstractParser<ScryptParameters>() {
  8026. public ScryptParameters parsePartialFrom(
  8027. com.google.protobuf.CodedInputStream input,
  8028. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  8029. throws com.google.protobuf.InvalidProtocolBufferException {
  8030. return new ScryptParameters(input, extensionRegistry);
  8031. }
  8032. };
  8033. @java.lang.Override
  8034. public com.google.protobuf.Parser<ScryptParameters> getParserForType() {
  8035. return PARSER;
  8036. }
  8037. private int bitField0_;
  8038. // required bytes salt = 1;
  8039. public static final int SALT_FIELD_NUMBER = 1;
  8040. private com.google.protobuf.ByteString salt_;
  8041. /**
  8042. * <code>required bytes salt = 1;</code>
  8043. *
  8044. * <pre>
  8045. * Salt to use in generation of the wallet password (8 bytes)
  8046. * </pre>
  8047. */
  8048. public boolean hasSalt() {
  8049. return ((bitField0_ & 0x00000001) == 0x00000001);
  8050. }
  8051. /**
  8052. * <code>required bytes salt = 1;</code>
  8053. *
  8054. * <pre>
  8055. * Salt to use in generation of the wallet password (8 bytes)
  8056. * </pre>
  8057. */
  8058. public com.google.protobuf.ByteString getSalt() {
  8059. return salt_;
  8060. }
  8061. // optional int64 n = 2 [default = 16384];
  8062. public static final int N_FIELD_NUMBER = 2;
  8063. private long n_;
  8064. /**
  8065. * <code>optional int64 n = 2 [default = 16384];</code>
  8066. *
  8067. * <pre>
  8068. * CPU/ memory cost parameter
  8069. * </pre>
  8070. */
  8071. public boolean hasN() {
  8072. return ((bitField0_ & 0x00000002) == 0x00000002);
  8073. }
  8074. /**
  8075. * <code>optional int64 n = 2 [default = 16384];</code>
  8076. *
  8077. * <pre>
  8078. * CPU/ memory cost parameter
  8079. * </pre>
  8080. */
  8081. public long getN() {
  8082. return n_;
  8083. }
  8084. // optional int32 r = 3 [default = 8];
  8085. public static final int R_FIELD_NUMBER = 3;
  8086. private int r_;
  8087. /**
  8088. * <code>optional int32 r = 3 [default = 8];</code>
  8089. *
  8090. * <pre>
  8091. * Block size parameter
  8092. * </pre>
  8093. */
  8094. public boolean hasR() {
  8095. return ((bitField0_ & 0x00000004) == 0x00000004);
  8096. }
  8097. /**
  8098. * <code>optional int32 r = 3 [default = 8];</code>
  8099. *
  8100. * <pre>
  8101. * Block size parameter
  8102. * </pre>
  8103. */
  8104. public int getR() {
  8105. return r_;
  8106. }
  8107. // optional int32 p = 4 [default = 1];
  8108. public static final int P_FIELD_NUMBER = 4;
  8109. private int p_;
  8110. /**
  8111. * <code>optional int32 p = 4 [default = 1];</code>
  8112. *
  8113. * <pre>
  8114. * Parallelisation parameter
  8115. * </pre>
  8116. */
  8117. public boolean hasP() {
  8118. return ((bitField0_ & 0x00000008) == 0x00000008);
  8119. }
  8120. /**
  8121. * <code>optional int32 p = 4 [default = 1];</code>
  8122. *
  8123. * <pre>
  8124. * Parallelisation parameter
  8125. * </pre>
  8126. */
  8127. public int getP() {
  8128. return p_;
  8129. }
  8130. private void initFields() {
  8131. salt_ = com.google.protobuf.ByteString.EMPTY;
  8132. n_ = 16384L;
  8133. r_ = 8;
  8134. p_ = 1;
  8135. }
  8136. private byte memoizedIsInitialized = -1;
  8137. public final boolean isInitialized() {
  8138. byte isInitialized = memoizedIsInitialized;
  8139. if (isInitialized != -1) return isInitialized == 1;
  8140. if (!hasSalt()) {
  8141. memoizedIsInitialized = 0;
  8142. return false;
  8143. }
  8144. memoizedIsInitialized = 1;
  8145. return true;
  8146. }
  8147. public void writeTo(com.google.protobuf.CodedOutputStream output)
  8148. throws java.io.IOException {
  8149. getSerializedSize();
  8150. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  8151. output.writeBytes(1, salt_);
  8152. }
  8153. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  8154. output.writeInt64(2, n_);
  8155. }
  8156. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  8157. output.writeInt32(3, r_);
  8158. }
  8159. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  8160. output.writeInt32(4, p_);
  8161. }
  8162. getUnknownFields().writeTo(output);
  8163. }
  8164. private int memoizedSerializedSize = -1;
  8165. public int getSerializedSize() {
  8166. int size = memoizedSerializedSize;
  8167. if (size != -1) return size;
  8168. size = 0;
  8169. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  8170. size += com.google.protobuf.CodedOutputStream
  8171. .computeBytesSize(1, salt_);
  8172. }
  8173. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  8174. size += com.google.protobuf.CodedOutputStream
  8175. .computeInt64Size(2, n_);
  8176. }
  8177. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  8178. size += com.google.protobuf.CodedOutputStream
  8179. .computeInt32Size(3, r_);
  8180. }
  8181. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  8182. size += com.google.protobuf.CodedOutputStream
  8183. .computeInt32Size(4, p_);
  8184. }
  8185. size += getUnknownFields().getSerializedSize();
  8186. memoizedSerializedSize = size;
  8187. return size;
  8188. }
  8189. private static final long serialVersionUID = 0L;
  8190. @java.lang.Override
  8191. protected java.lang.Object writeReplace()
  8192. throws java.io.ObjectStreamException {
  8193. return super.writeReplace();
  8194. }
  8195. public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom(
  8196. com.google.protobuf.ByteString data)
  8197. throws com.google.protobuf.InvalidProtocolBufferException {
  8198. return PARSER.parseFrom(data);
  8199. }
  8200. public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom(
  8201. com.google.protobuf.ByteString data,
  8202. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  8203. throws com.google.protobuf.InvalidProtocolBufferException {
  8204. return PARSER.parseFrom(data, extensionRegistry);
  8205. }
  8206. public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom(byte[] data)
  8207. throws com.google.protobuf.InvalidProtocolBufferException {
  8208. return PARSER.parseFrom(data);
  8209. }
  8210. public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom(
  8211. byte[] data,
  8212. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  8213. throws com.google.protobuf.InvalidProtocolBufferException {
  8214. return PARSER.parseFrom(data, extensionRegistry);
  8215. }
  8216. public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom(java.io.InputStream input)
  8217. throws java.io.IOException {
  8218. return PARSER.parseFrom(input);
  8219. }
  8220. public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom(
  8221. java.io.InputStream input,
  8222. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  8223. throws java.io.IOException {
  8224. return PARSER.parseFrom(input, extensionRegistry);
  8225. }
  8226. public static org.bitcoinj.wallet.Protos.ScryptParameters parseDelimitedFrom(java.io.InputStream input)
  8227. throws java.io.IOException {
  8228. return PARSER.parseDelimitedFrom(input);
  8229. }
  8230. public static org.bitcoinj.wallet.Protos.ScryptParameters parseDelimitedFrom(
  8231. java.io.InputStream input,
  8232. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  8233. throws java.io.IOException {
  8234. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  8235. }
  8236. public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom(
  8237. com.google.protobuf.CodedInputStream input)
  8238. throws java.io.IOException {
  8239. return PARSER.parseFrom(input);
  8240. }
  8241. public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom(
  8242. com.google.protobuf.CodedInputStream input,
  8243. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  8244. throws java.io.IOException {
  8245. return PARSER.parseFrom(input, extensionRegistry);
  8246. }
  8247. public static Builder newBuilder() { return Builder.create(); }
  8248. public Builder newBuilderForType() { return newBuilder(); }
  8249. public static Builder newBuilder(org.bitcoinj.wallet.Protos.ScryptParameters prototype) {
  8250. return newBuilder().mergeFrom(prototype);
  8251. }
  8252. public Builder toBuilder() { return newBuilder(this); }
  8253. @java.lang.Override
  8254. protected Builder newBuilderForType(
  8255. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  8256. Builder builder = new Builder(parent);
  8257. return builder;
  8258. }
  8259. /**
  8260. * Protobuf type {@code wallet.ScryptParameters}
  8261. *
  8262. * <pre>
  8263. ** The parameters used in the scrypt key derivation function.
  8264. * The default values are taken from http://www.tarsnap.com/scrypt/scrypt-slides.pdf.
  8265. * They can be increased - n is the number of iterations performed and
  8266. * r and p can be used to tweak the algorithm - see:
  8267. * http://stackoverflow.com/questions/11126315/what-are-optimal-scrypt-work-factors
  8268. * </pre>
  8269. */
  8270. public static final class Builder extends
  8271. com.google.protobuf.GeneratedMessage.Builder<Builder>
  8272. implements org.bitcoinj.wallet.Protos.ScryptParametersOrBuilder {
  8273. public static final com.google.protobuf.Descriptors.Descriptor
  8274. getDescriptor() {
  8275. return org.bitcoinj.wallet.Protos.internal_static_wallet_ScryptParameters_descriptor;
  8276. }
  8277. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  8278. internalGetFieldAccessorTable() {
  8279. return org.bitcoinj.wallet.Protos.internal_static_wallet_ScryptParameters_fieldAccessorTable
  8280. .ensureFieldAccessorsInitialized(
  8281. org.bitcoinj.wallet.Protos.ScryptParameters.class, org.bitcoinj.wallet.Protos.ScryptParameters.Builder.class);
  8282. }
  8283. // Construct using org.bitcoinj.wallet.Protos.ScryptParameters.newBuilder()
  8284. private Builder() {
  8285. maybeForceBuilderInitialization();
  8286. }
  8287. private Builder(
  8288. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  8289. super(parent);
  8290. maybeForceBuilderInitialization();
  8291. }
  8292. private void maybeForceBuilderInitialization() {
  8293. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  8294. }
  8295. }
  8296. private static Builder create() {
  8297. return new Builder();
  8298. }
  8299. public Builder clear() {
  8300. super.clear();
  8301. salt_ = com.google.protobuf.ByteString.EMPTY;
  8302. bitField0_ = (bitField0_ & ~0x00000001);
  8303. n_ = 16384L;
  8304. bitField0_ = (bitField0_ & ~0x00000002);
  8305. r_ = 8;
  8306. bitField0_ = (bitField0_ & ~0x00000004);
  8307. p_ = 1;
  8308. bitField0_ = (bitField0_ & ~0x00000008);
  8309. return this;
  8310. }
  8311. public Builder clone() {
  8312. return create().mergeFrom(buildPartial());
  8313. }
  8314. public com.google.protobuf.Descriptors.Descriptor
  8315. getDescriptorForType() {
  8316. return org.bitcoinj.wallet.Protos.internal_static_wallet_ScryptParameters_descriptor;
  8317. }
  8318. public org.bitcoinj.wallet.Protos.ScryptParameters getDefaultInstanceForType() {
  8319. return org.bitcoinj.wallet.Protos.ScryptParameters.getDefaultInstance();
  8320. }
  8321. public org.bitcoinj.wallet.Protos.ScryptParameters build() {
  8322. org.bitcoinj.wallet.Protos.ScryptParameters result = buildPartial();
  8323. if (!result.isInitialized()) {
  8324. throw newUninitializedMessageException(result);
  8325. }
  8326. return result;
  8327. }
  8328. public org.bitcoinj.wallet.Protos.ScryptParameters buildPartial() {
  8329. org.bitcoinj.wallet.Protos.ScryptParameters result = new org.bitcoinj.wallet.Protos.ScryptParameters(this);
  8330. int from_bitField0_ = bitField0_;
  8331. int to_bitField0_ = 0;
  8332. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  8333. to_bitField0_ |= 0x00000001;
  8334. }
  8335. result.salt_ = salt_;
  8336. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  8337. to_bitField0_ |= 0x00000002;
  8338. }
  8339. result.n_ = n_;
  8340. if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
  8341. to_bitField0_ |= 0x00000004;
  8342. }
  8343. result.r_ = r_;
  8344. if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
  8345. to_bitField0_ |= 0x00000008;
  8346. }
  8347. result.p_ = p_;
  8348. result.bitField0_ = to_bitField0_;
  8349. onBuilt();
  8350. return result;
  8351. }
  8352. public Builder mergeFrom(com.google.protobuf.Message other) {
  8353. if (other instanceof org.bitcoinj.wallet.Protos.ScryptParameters) {
  8354. return mergeFrom((org.bitcoinj.wallet.Protos.ScryptParameters)other);
  8355. } else {
  8356. super.mergeFrom(other);
  8357. return this;
  8358. }
  8359. }
  8360. public Builder mergeFrom(org.bitcoinj.wallet.Protos.ScryptParameters other) {
  8361. if (other == org.bitcoinj.wallet.Protos.ScryptParameters.getDefaultInstance()) return this;
  8362. if (other.hasSalt()) {
  8363. setSalt(other.getSalt());
  8364. }
  8365. if (other.hasN()) {
  8366. setN(other.getN());
  8367. }
  8368. if (other.hasR()) {
  8369. setR(other.getR());
  8370. }
  8371. if (other.hasP()) {
  8372. setP(other.getP());
  8373. }
  8374. this.mergeUnknownFields(other.getUnknownFields());
  8375. return this;
  8376. }
  8377. public final boolean isInitialized() {
  8378. if (!hasSalt()) {
  8379. return false;
  8380. }
  8381. return true;
  8382. }
  8383. public Builder mergeFrom(
  8384. com.google.protobuf.CodedInputStream input,
  8385. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  8386. throws java.io.IOException {
  8387. org.bitcoinj.wallet.Protos.ScryptParameters parsedMessage = null;
  8388. try {
  8389. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  8390. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  8391. parsedMessage = (org.bitcoinj.wallet.Protos.ScryptParameters) e.getUnfinishedMessage();
  8392. throw e;
  8393. } finally {
  8394. if (parsedMessage != null) {
  8395. mergeFrom(parsedMessage);
  8396. }
  8397. }
  8398. return this;
  8399. }
  8400. private int bitField0_;
  8401. // required bytes salt = 1;
  8402. private com.google.protobuf.ByteString salt_ = com.google.protobuf.ByteString.EMPTY;
  8403. /**
  8404. * <code>required bytes salt = 1;</code>
  8405. *
  8406. * <pre>
  8407. * Salt to use in generation of the wallet password (8 bytes)
  8408. * </pre>
  8409. */
  8410. public boolean hasSalt() {
  8411. return ((bitField0_ & 0x00000001) == 0x00000001);
  8412. }
  8413. /**
  8414. * <code>required bytes salt = 1;</code>
  8415. *
  8416. * <pre>
  8417. * Salt to use in generation of the wallet password (8 bytes)
  8418. * </pre>
  8419. */
  8420. public com.google.protobuf.ByteString getSalt() {
  8421. return salt_;
  8422. }
  8423. /**
  8424. * <code>required bytes salt = 1;</code>
  8425. *
  8426. * <pre>
  8427. * Salt to use in generation of the wallet password (8 bytes)
  8428. * </pre>
  8429. */
  8430. public Builder setSalt(com.google.protobuf.ByteString value) {
  8431. if (value == null) {
  8432. throw new NullPointerException();
  8433. }
  8434. bitField0_ |= 0x00000001;
  8435. salt_ = value;
  8436. onChanged();
  8437. return this;
  8438. }
  8439. /**
  8440. * <code>required bytes salt = 1;</code>
  8441. *
  8442. * <pre>
  8443. * Salt to use in generation of the wallet password (8 bytes)
  8444. * </pre>
  8445. */
  8446. public Builder clearSalt() {
  8447. bitField0_ = (bitField0_ & ~0x00000001);
  8448. salt_ = getDefaultInstance().getSalt();
  8449. onChanged();
  8450. return this;
  8451. }
  8452. // optional int64 n = 2 [default = 16384];
  8453. private long n_ = 16384L;
  8454. /**
  8455. * <code>optional int64 n = 2 [default = 16384];</code>
  8456. *
  8457. * <pre>
  8458. * CPU/ memory cost parameter
  8459. * </pre>
  8460. */
  8461. public boolean hasN() {
  8462. return ((bitField0_ & 0x00000002) == 0x00000002);
  8463. }
  8464. /**
  8465. * <code>optional int64 n = 2 [default = 16384];</code>
  8466. *
  8467. * <pre>
  8468. * CPU/ memory cost parameter
  8469. * </pre>
  8470. */
  8471. public long getN() {
  8472. return n_;
  8473. }
  8474. /**
  8475. * <code>optional int64 n = 2 [default = 16384];</code>
  8476. *
  8477. * <pre>
  8478. * CPU/ memory cost parameter
  8479. * </pre>
  8480. */
  8481. public Builder setN(long value) {
  8482. bitField0_ |= 0x00000002;
  8483. n_ = value;
  8484. onChanged();
  8485. return this;
  8486. }
  8487. /**
  8488. * <code>optional int64 n = 2 [default = 16384];</code>
  8489. *
  8490. * <pre>
  8491. * CPU/ memory cost parameter
  8492. * </pre>
  8493. */
  8494. public Builder clearN() {
  8495. bitField0_ = (bitField0_ & ~0x00000002);
  8496. n_ = 16384L;
  8497. onChanged();
  8498. return this;
  8499. }
  8500. // optional int32 r = 3 [default = 8];
  8501. private int r_ = 8;
  8502. /**
  8503. * <code>optional int32 r = 3 [default = 8];</code>
  8504. *
  8505. * <pre>
  8506. * Block size parameter
  8507. * </pre>
  8508. */
  8509. public boolean hasR() {
  8510. return ((bitField0_ & 0x00000004) == 0x00000004);
  8511. }
  8512. /**
  8513. * <code>optional int32 r = 3 [default = 8];</code>
  8514. *
  8515. * <pre>
  8516. * Block size parameter
  8517. * </pre>
  8518. */
  8519. public int getR() {
  8520. return r_;
  8521. }
  8522. /**
  8523. * <code>optional int32 r = 3 [default = 8];</code>
  8524. *
  8525. * <pre>
  8526. * Block size parameter
  8527. * </pre>
  8528. */
  8529. public Builder setR(int value) {
  8530. bitField0_ |= 0x00000004;
  8531. r_ = value;
  8532. onChanged();
  8533. return this;
  8534. }
  8535. /**
  8536. * <code>optional int32 r = 3 [default = 8];</code>
  8537. *
  8538. * <pre>
  8539. * Block size parameter
  8540. * </pre>
  8541. */
  8542. public Builder clearR() {
  8543. bitField0_ = (bitField0_ & ~0x00000004);
  8544. r_ = 8;
  8545. onChanged();
  8546. return this;
  8547. }
  8548. // optional int32 p = 4 [default = 1];
  8549. private int p_ = 1;
  8550. /**
  8551. * <code>optional int32 p = 4 [default = 1];</code>
  8552. *
  8553. * <pre>
  8554. * Parallelisation parameter
  8555. * </pre>
  8556. */
  8557. public boolean hasP() {
  8558. return ((bitField0_ & 0x00000008) == 0x00000008);
  8559. }
  8560. /**
  8561. * <code>optional int32 p = 4 [default = 1];</code>
  8562. *
  8563. * <pre>
  8564. * Parallelisation parameter
  8565. * </pre>
  8566. */
  8567. public int getP() {
  8568. return p_;
  8569. }
  8570. /**
  8571. * <code>optional int32 p = 4 [default = 1];</code>
  8572. *
  8573. * <pre>
  8574. * Parallelisation parameter
  8575. * </pre>
  8576. */
  8577. public Builder setP(int value) {
  8578. bitField0_ |= 0x00000008;
  8579. p_ = value;
  8580. onChanged();
  8581. return this;
  8582. }
  8583. /**
  8584. * <code>optional int32 p = 4 [default = 1];</code>
  8585. *
  8586. * <pre>
  8587. * Parallelisation parameter
  8588. * </pre>
  8589. */
  8590. public Builder clearP() {
  8591. bitField0_ = (bitField0_ & ~0x00000008);
  8592. p_ = 1;
  8593. onChanged();
  8594. return this;
  8595. }
  8596. // @@protoc_insertion_point(builder_scope:wallet.ScryptParameters)
  8597. }
  8598. static {
  8599. defaultInstance = new ScryptParameters(true);
  8600. defaultInstance.initFields();
  8601. }
  8602. // @@protoc_insertion_point(class_scope:wallet.ScryptParameters)
  8603. }
  8604. public interface ExtensionOrBuilder
  8605. extends com.google.protobuf.MessageOrBuilder {
  8606. // required string id = 1;
  8607. /**
  8608. * <code>required string id = 1;</code>
  8609. *
  8610. * <pre>
  8611. * like org.whatever.foo.bar
  8612. * </pre>
  8613. */
  8614. boolean hasId();
  8615. /**
  8616. * <code>required string id = 1;</code>
  8617. *
  8618. * <pre>
  8619. * like org.whatever.foo.bar
  8620. * </pre>
  8621. */
  8622. java.lang.String getId();
  8623. /**
  8624. * <code>required string id = 1;</code>
  8625. *
  8626. * <pre>
  8627. * like org.whatever.foo.bar
  8628. * </pre>
  8629. */
  8630. com.google.protobuf.ByteString
  8631. getIdBytes();
  8632. // required bytes data = 2;
  8633. /**
  8634. * <code>required bytes data = 2;</code>
  8635. */
  8636. boolean hasData();
  8637. /**
  8638. * <code>required bytes data = 2;</code>
  8639. */
  8640. com.google.protobuf.ByteString getData();
  8641. // required bool mandatory = 3;
  8642. /**
  8643. * <code>required bool mandatory = 3;</code>
  8644. *
  8645. * <pre>
  8646. * If we do not understand a mandatory extension, abort to prevent data loss.
  8647. * For example, this could be applied to a new type of holding, such as a contract, where
  8648. * dropping of an extension in a read/write cycle could cause loss of value.
  8649. * </pre>
  8650. */
  8651. boolean hasMandatory();
  8652. /**
  8653. * <code>required bool mandatory = 3;</code>
  8654. *
  8655. * <pre>
  8656. * If we do not understand a mandatory extension, abort to prevent data loss.
  8657. * For example, this could be applied to a new type of holding, such as a contract, where
  8658. * dropping of an extension in a read/write cycle could cause loss of value.
  8659. * </pre>
  8660. */
  8661. boolean getMandatory();
  8662. }
  8663. /**
  8664. * Protobuf type {@code wallet.Extension}
  8665. *
  8666. * <pre>
  8667. ** An extension to the wallet
  8668. * </pre>
  8669. */
  8670. public static final class Extension extends
  8671. com.google.protobuf.GeneratedMessage
  8672. implements ExtensionOrBuilder {
  8673. // Use Extension.newBuilder() to construct.
  8674. private Extension(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  8675. super(builder);
  8676. this.unknownFields = builder.getUnknownFields();
  8677. }
  8678. private Extension(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  8679. private static final Extension defaultInstance;
  8680. public static Extension getDefaultInstance() {
  8681. return defaultInstance;
  8682. }
  8683. public Extension getDefaultInstanceForType() {
  8684. return defaultInstance;
  8685. }
  8686. private final com.google.protobuf.UnknownFieldSet unknownFields;
  8687. @java.lang.Override
  8688. public final com.google.protobuf.UnknownFieldSet
  8689. getUnknownFields() {
  8690. return this.unknownFields;
  8691. }
  8692. private Extension(
  8693. com.google.protobuf.CodedInputStream input,
  8694. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  8695. throws com.google.protobuf.InvalidProtocolBufferException {
  8696. initFields();
  8697. int mutable_bitField0_ = 0;
  8698. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  8699. com.google.protobuf.UnknownFieldSet.newBuilder();
  8700. try {
  8701. boolean done = false;
  8702. while (!done) {
  8703. int tag = input.readTag();
  8704. switch (tag) {
  8705. case 0:
  8706. done = true;
  8707. break;
  8708. default: {
  8709. if (!parseUnknownField(input, unknownFields,
  8710. extensionRegistry, tag)) {
  8711. done = true;
  8712. }
  8713. break;
  8714. }
  8715. case 10: {
  8716. bitField0_ |= 0x00000001;
  8717. id_ = input.readBytes();
  8718. break;
  8719. }
  8720. case 18: {
  8721. bitField0_ |= 0x00000002;
  8722. data_ = input.readBytes();
  8723. break;
  8724. }
  8725. case 24: {
  8726. bitField0_ |= 0x00000004;
  8727. mandatory_ = input.readBool();
  8728. break;
  8729. }
  8730. }
  8731. }
  8732. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  8733. throw e.setUnfinishedMessage(this);
  8734. } catch (java.io.IOException e) {
  8735. throw new com.google.protobuf.InvalidProtocolBufferException(
  8736. e.getMessage()).setUnfinishedMessage(this);
  8737. } finally {
  8738. this.unknownFields = unknownFields.build();
  8739. makeExtensionsImmutable();
  8740. }
  8741. }
  8742. public static final com.google.protobuf.Descriptors.Descriptor
  8743. getDescriptor() {
  8744. return org.bitcoinj.wallet.Protos.internal_static_wallet_Extension_descriptor;
  8745. }
  8746. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  8747. internalGetFieldAccessorTable() {
  8748. return org.bitcoinj.wallet.Protos.internal_static_wallet_Extension_fieldAccessorTable
  8749. .ensureFieldAccessorsInitialized(
  8750. org.bitcoinj.wallet.Protos.Extension.class, org.bitcoinj.wallet.Protos.Extension.Builder.class);
  8751. }
  8752. public static com.google.protobuf.Parser<Extension> PARSER =
  8753. new com.google.protobuf.AbstractParser<Extension>() {
  8754. public Extension parsePartialFrom(
  8755. com.google.protobuf.CodedInputStream input,
  8756. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  8757. throws com.google.protobuf.InvalidProtocolBufferException {
  8758. return new Extension(input, extensionRegistry);
  8759. }
  8760. };
  8761. @java.lang.Override
  8762. public com.google.protobuf.Parser<Extension> getParserForType() {
  8763. return PARSER;
  8764. }
  8765. private int bitField0_;
  8766. // required string id = 1;
  8767. public static final int ID_FIELD_NUMBER = 1;
  8768. private java.lang.Object id_;
  8769. /**
  8770. * <code>required string id = 1;</code>
  8771. *
  8772. * <pre>
  8773. * like org.whatever.foo.bar
  8774. * </pre>
  8775. */
  8776. public boolean hasId() {
  8777. return ((bitField0_ & 0x00000001) == 0x00000001);
  8778. }
  8779. /**
  8780. * <code>required string id = 1;</code>
  8781. *
  8782. * <pre>
  8783. * like org.whatever.foo.bar
  8784. * </pre>
  8785. */
  8786. public java.lang.String getId() {
  8787. java.lang.Object ref = id_;
  8788. if (ref instanceof java.lang.String) {
  8789. return (java.lang.String) ref;
  8790. } else {
  8791. com.google.protobuf.ByteString bs =
  8792. (com.google.protobuf.ByteString) ref;
  8793. java.lang.String s = bs.toStringUtf8();
  8794. if (bs.isValidUtf8()) {
  8795. id_ = s;
  8796. }
  8797. return s;
  8798. }
  8799. }
  8800. /**
  8801. * <code>required string id = 1;</code>
  8802. *
  8803. * <pre>
  8804. * like org.whatever.foo.bar
  8805. * </pre>
  8806. */
  8807. public com.google.protobuf.ByteString
  8808. getIdBytes() {
  8809. java.lang.Object ref = id_;
  8810. if (ref instanceof java.lang.String) {
  8811. com.google.protobuf.ByteString b =
  8812. com.google.protobuf.ByteString.copyFromUtf8(
  8813. (java.lang.String) ref);
  8814. id_ = b;
  8815. return b;
  8816. } else {
  8817. return (com.google.protobuf.ByteString) ref;
  8818. }
  8819. }
  8820. // required bytes data = 2;
  8821. public static final int DATA_FIELD_NUMBER = 2;
  8822. private com.google.protobuf.ByteString data_;
  8823. /**
  8824. * <code>required bytes data = 2;</code>
  8825. */
  8826. public boolean hasData() {
  8827. return ((bitField0_ & 0x00000002) == 0x00000002);
  8828. }
  8829. /**
  8830. * <code>required bytes data = 2;</code>
  8831. */
  8832. public com.google.protobuf.ByteString getData() {
  8833. return data_;
  8834. }
  8835. // required bool mandatory = 3;
  8836. public static final int MANDATORY_FIELD_NUMBER = 3;
  8837. private boolean mandatory_;
  8838. /**
  8839. * <code>required bool mandatory = 3;</code>
  8840. *
  8841. * <pre>
  8842. * If we do not understand a mandatory extension, abort to prevent data loss.
  8843. * For example, this could be applied to a new type of holding, such as a contract, where
  8844. * dropping of an extension in a read/write cycle could cause loss of value.
  8845. * </pre>
  8846. */
  8847. public boolean hasMandatory() {
  8848. return ((bitField0_ & 0x00000004) == 0x00000004);
  8849. }
  8850. /**
  8851. * <code>required bool mandatory = 3;</code>
  8852. *
  8853. * <pre>
  8854. * If we do not understand a mandatory extension, abort to prevent data loss.
  8855. * For example, this could be applied to a new type of holding, such as a contract, where
  8856. * dropping of an extension in a read/write cycle could cause loss of value.
  8857. * </pre>
  8858. */
  8859. public boolean getMandatory() {
  8860. return mandatory_;
  8861. }
  8862. private void initFields() {
  8863. id_ = "";
  8864. data_ = com.google.protobuf.ByteString.EMPTY;
  8865. mandatory_ = false;
  8866. }
  8867. private byte memoizedIsInitialized = -1;
  8868. public final boolean isInitialized() {
  8869. byte isInitialized = memoizedIsInitialized;
  8870. if (isInitialized != -1) return isInitialized == 1;
  8871. if (!hasId()) {
  8872. memoizedIsInitialized = 0;
  8873. return false;
  8874. }
  8875. if (!hasData()) {
  8876. memoizedIsInitialized = 0;
  8877. return false;
  8878. }
  8879. if (!hasMandatory()) {
  8880. memoizedIsInitialized = 0;
  8881. return false;
  8882. }
  8883. memoizedIsInitialized = 1;
  8884. return true;
  8885. }
  8886. public void writeTo(com.google.protobuf.CodedOutputStream output)
  8887. throws java.io.IOException {
  8888. getSerializedSize();
  8889. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  8890. output.writeBytes(1, getIdBytes());
  8891. }
  8892. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  8893. output.writeBytes(2, data_);
  8894. }
  8895. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  8896. output.writeBool(3, mandatory_);
  8897. }
  8898. getUnknownFields().writeTo(output);
  8899. }
  8900. private int memoizedSerializedSize = -1;
  8901. public int getSerializedSize() {
  8902. int size = memoizedSerializedSize;
  8903. if (size != -1) return size;
  8904. size = 0;
  8905. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  8906. size += com.google.protobuf.CodedOutputStream
  8907. .computeBytesSize(1, getIdBytes());
  8908. }
  8909. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  8910. size += com.google.protobuf.CodedOutputStream
  8911. .computeBytesSize(2, data_);
  8912. }
  8913. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  8914. size += com.google.protobuf.CodedOutputStream
  8915. .computeBoolSize(3, mandatory_);
  8916. }
  8917. size += getUnknownFields().getSerializedSize();
  8918. memoizedSerializedSize = size;
  8919. return size;
  8920. }
  8921. private static final long serialVersionUID = 0L;
  8922. @java.lang.Override
  8923. protected java.lang.Object writeReplace()
  8924. throws java.io.ObjectStreamException {
  8925. return super.writeReplace();
  8926. }
  8927. public static org.bitcoinj.wallet.Protos.Extension parseFrom(
  8928. com.google.protobuf.ByteString data)
  8929. throws com.google.protobuf.InvalidProtocolBufferException {
  8930. return PARSER.parseFrom(data);
  8931. }
  8932. public static org.bitcoinj.wallet.Protos.Extension parseFrom(
  8933. com.google.protobuf.ByteString data,
  8934. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  8935. throws com.google.protobuf.InvalidProtocolBufferException {
  8936. return PARSER.parseFrom(data, extensionRegistry);
  8937. }
  8938. public static org.bitcoinj.wallet.Protos.Extension parseFrom(byte[] data)
  8939. throws com.google.protobuf.InvalidProtocolBufferException {
  8940. return PARSER.parseFrom(data);
  8941. }
  8942. public static org.bitcoinj.wallet.Protos.Extension parseFrom(
  8943. byte[] data,
  8944. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  8945. throws com.google.protobuf.InvalidProtocolBufferException {
  8946. return PARSER.parseFrom(data, extensionRegistry);
  8947. }
  8948. public static org.bitcoinj.wallet.Protos.Extension parseFrom(java.io.InputStream input)
  8949. throws java.io.IOException {
  8950. return PARSER.parseFrom(input);
  8951. }
  8952. public static org.bitcoinj.wallet.Protos.Extension parseFrom(
  8953. java.io.InputStream input,
  8954. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  8955. throws java.io.IOException {
  8956. return PARSER.parseFrom(input, extensionRegistry);
  8957. }
  8958. public static org.bitcoinj.wallet.Protos.Extension parseDelimitedFrom(java.io.InputStream input)
  8959. throws java.io.IOException {
  8960. return PARSER.parseDelimitedFrom(input);
  8961. }
  8962. public static org.bitcoinj.wallet.Protos.Extension parseDelimitedFrom(
  8963. java.io.InputStream input,
  8964. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  8965. throws java.io.IOException {
  8966. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  8967. }
  8968. public static org.bitcoinj.wallet.Protos.Extension parseFrom(
  8969. com.google.protobuf.CodedInputStream input)
  8970. throws java.io.IOException {
  8971. return PARSER.parseFrom(input);
  8972. }
  8973. public static org.bitcoinj.wallet.Protos.Extension parseFrom(
  8974. com.google.protobuf.CodedInputStream input,
  8975. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  8976. throws java.io.IOException {
  8977. return PARSER.parseFrom(input, extensionRegistry);
  8978. }
  8979. public static Builder newBuilder() { return Builder.create(); }
  8980. public Builder newBuilderForType() { return newBuilder(); }
  8981. public static Builder newBuilder(org.bitcoinj.wallet.Protos.Extension prototype) {
  8982. return newBuilder().mergeFrom(prototype);
  8983. }
  8984. public Builder toBuilder() { return newBuilder(this); }
  8985. @java.lang.Override
  8986. protected Builder newBuilderForType(
  8987. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  8988. Builder builder = new Builder(parent);
  8989. return builder;
  8990. }
  8991. /**
  8992. * Protobuf type {@code wallet.Extension}
  8993. *
  8994. * <pre>
  8995. ** An extension to the wallet
  8996. * </pre>
  8997. */
  8998. public static final class Builder extends
  8999. com.google.protobuf.GeneratedMessage.Builder<Builder>
  9000. implements org.bitcoinj.wallet.Protos.ExtensionOrBuilder {
  9001. public static final com.google.protobuf.Descriptors.Descriptor
  9002. getDescriptor() {
  9003. return org.bitcoinj.wallet.Protos.internal_static_wallet_Extension_descriptor;
  9004. }
  9005. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  9006. internalGetFieldAccessorTable() {
  9007. return org.bitcoinj.wallet.Protos.internal_static_wallet_Extension_fieldAccessorTable
  9008. .ensureFieldAccessorsInitialized(
  9009. org.bitcoinj.wallet.Protos.Extension.class, org.bitcoinj.wallet.Protos.Extension.Builder.class);
  9010. }
  9011. // Construct using org.bitcoinj.wallet.Protos.Extension.newBuilder()
  9012. private Builder() {
  9013. maybeForceBuilderInitialization();
  9014. }
  9015. private Builder(
  9016. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  9017. super(parent);
  9018. maybeForceBuilderInitialization();
  9019. }
  9020. private void maybeForceBuilderInitialization() {
  9021. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  9022. }
  9023. }
  9024. private static Builder create() {
  9025. return new Builder();
  9026. }
  9027. public Builder clear() {
  9028. super.clear();
  9029. id_ = "";
  9030. bitField0_ = (bitField0_ & ~0x00000001);
  9031. data_ = com.google.protobuf.ByteString.EMPTY;
  9032. bitField0_ = (bitField0_ & ~0x00000002);
  9033. mandatory_ = false;
  9034. bitField0_ = (bitField0_ & ~0x00000004);
  9035. return this;
  9036. }
  9037. public Builder clone() {
  9038. return create().mergeFrom(buildPartial());
  9039. }
  9040. public com.google.protobuf.Descriptors.Descriptor
  9041. getDescriptorForType() {
  9042. return org.bitcoinj.wallet.Protos.internal_static_wallet_Extension_descriptor;
  9043. }
  9044. public org.bitcoinj.wallet.Protos.Extension getDefaultInstanceForType() {
  9045. return org.bitcoinj.wallet.Protos.Extension.getDefaultInstance();
  9046. }
  9047. public org.bitcoinj.wallet.Protos.Extension build() {
  9048. org.bitcoinj.wallet.Protos.Extension result = buildPartial();
  9049. if (!result.isInitialized()) {
  9050. throw newUninitializedMessageException(result);
  9051. }
  9052. return result;
  9053. }
  9054. public org.bitcoinj.wallet.Protos.Extension buildPartial() {
  9055. org.bitcoinj.wallet.Protos.Extension result = new org.bitcoinj.wallet.Protos.Extension(this);
  9056. int from_bitField0_ = bitField0_;
  9057. int to_bitField0_ = 0;
  9058. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  9059. to_bitField0_ |= 0x00000001;
  9060. }
  9061. result.id_ = id_;
  9062. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  9063. to_bitField0_ |= 0x00000002;
  9064. }
  9065. result.data_ = data_;
  9066. if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
  9067. to_bitField0_ |= 0x00000004;
  9068. }
  9069. result.mandatory_ = mandatory_;
  9070. result.bitField0_ = to_bitField0_;
  9071. onBuilt();
  9072. return result;
  9073. }
  9074. public Builder mergeFrom(com.google.protobuf.Message other) {
  9075. if (other instanceof org.bitcoinj.wallet.Protos.Extension) {
  9076. return mergeFrom((org.bitcoinj.wallet.Protos.Extension)other);
  9077. } else {
  9078. super.mergeFrom(other);
  9079. return this;
  9080. }
  9081. }
  9082. public Builder mergeFrom(org.bitcoinj.wallet.Protos.Extension other) {
  9083. if (other == org.bitcoinj.wallet.Protos.Extension.getDefaultInstance()) return this;
  9084. if (other.hasId()) {
  9085. bitField0_ |= 0x00000001;
  9086. id_ = other.id_;
  9087. onChanged();
  9088. }
  9089. if (other.hasData()) {
  9090. setData(other.getData());
  9091. }
  9092. if (other.hasMandatory()) {
  9093. setMandatory(other.getMandatory());
  9094. }
  9095. this.mergeUnknownFields(other.getUnknownFields());
  9096. return this;
  9097. }
  9098. public final boolean isInitialized() {
  9099. if (!hasId()) {
  9100. return false;
  9101. }
  9102. if (!hasData()) {
  9103. return false;
  9104. }
  9105. if (!hasMandatory()) {
  9106. return false;
  9107. }
  9108. return true;
  9109. }
  9110. public Builder mergeFrom(
  9111. com.google.protobuf.CodedInputStream input,
  9112. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  9113. throws java.io.IOException {
  9114. org.bitcoinj.wallet.Protos.Extension parsedMessage = null;
  9115. try {
  9116. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  9117. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  9118. parsedMessage = (org.bitcoinj.wallet.Protos.Extension) e.getUnfinishedMessage();
  9119. throw e;
  9120. } finally {
  9121. if (parsedMessage != null) {
  9122. mergeFrom(parsedMessage);
  9123. }
  9124. }
  9125. return this;
  9126. }
  9127. private int bitField0_;
  9128. // required string id = 1;
  9129. private java.lang.Object id_ = "";
  9130. /**
  9131. * <code>required string id = 1;</code>
  9132. *
  9133. * <pre>
  9134. * like org.whatever.foo.bar
  9135. * </pre>
  9136. */
  9137. public boolean hasId() {
  9138. return ((bitField0_ & 0x00000001) == 0x00000001);
  9139. }
  9140. /**
  9141. * <code>required string id = 1;</code>
  9142. *
  9143. * <pre>
  9144. * like org.whatever.foo.bar
  9145. * </pre>
  9146. */
  9147. public java.lang.String getId() {
  9148. java.lang.Object ref = id_;
  9149. if (!(ref instanceof java.lang.String)) {
  9150. java.lang.String s = ((com.google.protobuf.ByteString) ref)
  9151. .toStringUtf8();
  9152. id_ = s;
  9153. return s;
  9154. } else {
  9155. return (java.lang.String) ref;
  9156. }
  9157. }
  9158. /**
  9159. * <code>required string id = 1;</code>
  9160. *
  9161. * <pre>
  9162. * like org.whatever.foo.bar
  9163. * </pre>
  9164. */
  9165. public com.google.protobuf.ByteString
  9166. getIdBytes() {
  9167. java.lang.Object ref = id_;
  9168. if (ref instanceof String) {
  9169. com.google.protobuf.ByteString b =
  9170. com.google.protobuf.ByteString.copyFromUtf8(
  9171. (java.lang.String) ref);
  9172. id_ = b;
  9173. return b;
  9174. } else {
  9175. return (com.google.protobuf.ByteString) ref;
  9176. }
  9177. }
  9178. /**
  9179. * <code>required string id = 1;</code>
  9180. *
  9181. * <pre>
  9182. * like org.whatever.foo.bar
  9183. * </pre>
  9184. */
  9185. public Builder setId(
  9186. java.lang.String value) {
  9187. if (value == null) {
  9188. throw new NullPointerException();
  9189. }
  9190. bitField0_ |= 0x00000001;
  9191. id_ = value;
  9192. onChanged();
  9193. return this;
  9194. }
  9195. /**
  9196. * <code>required string id = 1;</code>
  9197. *
  9198. * <pre>
  9199. * like org.whatever.foo.bar
  9200. * </pre>
  9201. */
  9202. public Builder clearId() {
  9203. bitField0_ = (bitField0_ & ~0x00000001);
  9204. id_ = getDefaultInstance().getId();
  9205. onChanged();
  9206. return this;
  9207. }
  9208. /**
  9209. * <code>required string id = 1;</code>
  9210. *
  9211. * <pre>
  9212. * like org.whatever.foo.bar
  9213. * </pre>
  9214. */
  9215. public Builder setIdBytes(
  9216. com.google.protobuf.ByteString value) {
  9217. if (value == null) {
  9218. throw new NullPointerException();
  9219. }
  9220. bitField0_ |= 0x00000001;
  9221. id_ = value;
  9222. onChanged();
  9223. return this;
  9224. }
  9225. // required bytes data = 2;
  9226. private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY;
  9227. /**
  9228. * <code>required bytes data = 2;</code>
  9229. */
  9230. public boolean hasData() {
  9231. return ((bitField0_ & 0x00000002) == 0x00000002);
  9232. }
  9233. /**
  9234. * <code>required bytes data = 2;</code>
  9235. */
  9236. public com.google.protobuf.ByteString getData() {
  9237. return data_;
  9238. }
  9239. /**
  9240. * <code>required bytes data = 2;</code>
  9241. */
  9242. public Builder setData(com.google.protobuf.ByteString value) {
  9243. if (value == null) {
  9244. throw new NullPointerException();
  9245. }
  9246. bitField0_ |= 0x00000002;
  9247. data_ = value;
  9248. onChanged();
  9249. return this;
  9250. }
  9251. /**
  9252. * <code>required bytes data = 2;</code>
  9253. */
  9254. public Builder clearData() {
  9255. bitField0_ = (bitField0_ & ~0x00000002);
  9256. data_ = getDefaultInstance().getData();
  9257. onChanged();
  9258. return this;
  9259. }
  9260. // required bool mandatory = 3;
  9261. private boolean mandatory_ ;
  9262. /**
  9263. * <code>required bool mandatory = 3;</code>
  9264. *
  9265. * <pre>
  9266. * If we do not understand a mandatory extension, abort to prevent data loss.
  9267. * For example, this could be applied to a new type of holding, such as a contract, where
  9268. * dropping of an extension in a read/write cycle could cause loss of value.
  9269. * </pre>
  9270. */
  9271. public boolean hasMandatory() {
  9272. return ((bitField0_ & 0x00000004) == 0x00000004);
  9273. }
  9274. /**
  9275. * <code>required bool mandatory = 3;</code>
  9276. *
  9277. * <pre>
  9278. * If we do not understand a mandatory extension, abort to prevent data loss.
  9279. * For example, this could be applied to a new type of holding, such as a contract, where
  9280. * dropping of an extension in a read/write cycle could cause loss of value.
  9281. * </pre>
  9282. */
  9283. public boolean getMandatory() {
  9284. return mandatory_;
  9285. }
  9286. /**
  9287. * <code>required bool mandatory = 3;</code>
  9288. *
  9289. * <pre>
  9290. * If we do not understand a mandatory extension, abort to prevent data loss.
  9291. * For example, this could be applied to a new type of holding, such as a contract, where
  9292. * dropping of an extension in a read/write cycle could cause loss of value.
  9293. * </pre>
  9294. */
  9295. public Builder setMandatory(boolean value) {
  9296. bitField0_ |= 0x00000004;
  9297. mandatory_ = value;
  9298. onChanged();
  9299. return this;
  9300. }
  9301. /**
  9302. * <code>required bool mandatory = 3;</code>
  9303. *
  9304. * <pre>
  9305. * If we do not understand a mandatory extension, abort to prevent data loss.
  9306. * For example, this could be applied to a new type of holding, such as a contract, where
  9307. * dropping of an extension in a read/write cycle could cause loss of value.
  9308. * </pre>
  9309. */
  9310. public Builder clearMandatory() {
  9311. bitField0_ = (bitField0_ & ~0x00000004);
  9312. mandatory_ = false;
  9313. onChanged();
  9314. return this;
  9315. }
  9316. // @@protoc_insertion_point(builder_scope:wallet.Extension)
  9317. }
  9318. static {
  9319. defaultInstance = new Extension(true);
  9320. defaultInstance.initFields();
  9321. }
  9322. // @@protoc_insertion_point(class_scope:wallet.Extension)
  9323. }
  9324. public interface WalletOrBuilder
  9325. extends com.google.protobuf.MessageOrBuilder {
  9326. // required string network_identifier = 1;
  9327. /**
  9328. * <code>required string network_identifier = 1;</code>
  9329. *
  9330. * <pre>
  9331. * the network used by this wallet
  9332. * </pre>
  9333. */
  9334. boolean hasNetworkIdentifier();
  9335. /**
  9336. * <code>required string network_identifier = 1;</code>
  9337. *
  9338. * <pre>
  9339. * the network used by this wallet
  9340. * </pre>
  9341. */
  9342. java.lang.String getNetworkIdentifier();
  9343. /**
  9344. * <code>required string network_identifier = 1;</code>
  9345. *
  9346. * <pre>
  9347. * the network used by this wallet
  9348. * </pre>
  9349. */
  9350. com.google.protobuf.ByteString
  9351. getNetworkIdentifierBytes();
  9352. // optional bytes last_seen_block_hash = 2;
  9353. /**
  9354. * <code>optional bytes last_seen_block_hash = 2;</code>
  9355. *
  9356. * <pre>
  9357. * The SHA256 hash of the head of the best chain seen by this wallet.
  9358. * </pre>
  9359. */
  9360. boolean hasLastSeenBlockHash();
  9361. /**
  9362. * <code>optional bytes last_seen_block_hash = 2;</code>
  9363. *
  9364. * <pre>
  9365. * The SHA256 hash of the head of the best chain seen by this wallet.
  9366. * </pre>
  9367. */
  9368. com.google.protobuf.ByteString getLastSeenBlockHash();
  9369. // optional uint32 last_seen_block_height = 12;
  9370. /**
  9371. * <code>optional uint32 last_seen_block_height = 12;</code>
  9372. *
  9373. * <pre>
  9374. * The height in the chain of the last seen block.
  9375. * </pre>
  9376. */
  9377. boolean hasLastSeenBlockHeight();
  9378. /**
  9379. * <code>optional uint32 last_seen_block_height = 12;</code>
  9380. *
  9381. * <pre>
  9382. * The height in the chain of the last seen block.
  9383. * </pre>
  9384. */
  9385. int getLastSeenBlockHeight();
  9386. // repeated .wallet.Key key = 3;
  9387. /**
  9388. * <code>repeated .wallet.Key key = 3;</code>
  9389. */
  9390. java.util.List<org.bitcoinj.wallet.Protos.Key>
  9391. getKeyList();
  9392. /**
  9393. * <code>repeated .wallet.Key key = 3;</code>
  9394. */
  9395. org.bitcoinj.wallet.Protos.Key getKey(int index);
  9396. /**
  9397. * <code>repeated .wallet.Key key = 3;</code>
  9398. */
  9399. int getKeyCount();
  9400. /**
  9401. * <code>repeated .wallet.Key key = 3;</code>
  9402. */
  9403. java.util.List<? extends org.bitcoinj.wallet.Protos.KeyOrBuilder>
  9404. getKeyOrBuilderList();
  9405. /**
  9406. * <code>repeated .wallet.Key key = 3;</code>
  9407. */
  9408. org.bitcoinj.wallet.Protos.KeyOrBuilder getKeyOrBuilder(
  9409. int index);
  9410. // repeated .wallet.Transaction transaction = 4;
  9411. /**
  9412. * <code>repeated .wallet.Transaction transaction = 4;</code>
  9413. */
  9414. java.util.List<org.bitcoinj.wallet.Protos.Transaction>
  9415. getTransactionList();
  9416. /**
  9417. * <code>repeated .wallet.Transaction transaction = 4;</code>
  9418. */
  9419. org.bitcoinj.wallet.Protos.Transaction getTransaction(int index);
  9420. /**
  9421. * <code>repeated .wallet.Transaction transaction = 4;</code>
  9422. */
  9423. int getTransactionCount();
  9424. /**
  9425. * <code>repeated .wallet.Transaction transaction = 4;</code>
  9426. */
  9427. java.util.List<? extends org.bitcoinj.wallet.Protos.TransactionOrBuilder>
  9428. getTransactionOrBuilderList();
  9429. /**
  9430. * <code>repeated .wallet.Transaction transaction = 4;</code>
  9431. */
  9432. org.bitcoinj.wallet.Protos.TransactionOrBuilder getTransactionOrBuilder(
  9433. int index);
  9434. // optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED];
  9435. /**
  9436. * <code>optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED];</code>
  9437. */
  9438. boolean hasEncryptionType();
  9439. /**
  9440. * <code>optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED];</code>
  9441. */
  9442. org.bitcoinj.wallet.Protos.Wallet.EncryptionType getEncryptionType();
  9443. // optional .wallet.ScryptParameters encryption_parameters = 6;
  9444. /**
  9445. * <code>optional .wallet.ScryptParameters encryption_parameters = 6;</code>
  9446. */
  9447. boolean hasEncryptionParameters();
  9448. /**
  9449. * <code>optional .wallet.ScryptParameters encryption_parameters = 6;</code>
  9450. */
  9451. org.bitcoinj.wallet.Protos.ScryptParameters getEncryptionParameters();
  9452. /**
  9453. * <code>optional .wallet.ScryptParameters encryption_parameters = 6;</code>
  9454. */
  9455. org.bitcoinj.wallet.Protos.ScryptParametersOrBuilder getEncryptionParametersOrBuilder();
  9456. // optional int32 version = 7;
  9457. /**
  9458. * <code>optional int32 version = 7;</code>
  9459. *
  9460. * <pre>
  9461. * The version number of the wallet - used to detect wallets that were produced in the future
  9462. * (i.e the wallet may contain some future format this protobuf/ code does not know about)
  9463. * </pre>
  9464. */
  9465. boolean hasVersion();
  9466. /**
  9467. * <code>optional int32 version = 7;</code>
  9468. *
  9469. * <pre>
  9470. * The version number of the wallet - used to detect wallets that were produced in the future
  9471. * (i.e the wallet may contain some future format this protobuf/ code does not know about)
  9472. * </pre>
  9473. */
  9474. int getVersion();
  9475. // repeated .wallet.Extension extension = 10;
  9476. /**
  9477. * <code>repeated .wallet.Extension extension = 10;</code>
  9478. */
  9479. java.util.List<org.bitcoinj.wallet.Protos.Extension>
  9480. getExtensionList();
  9481. /**
  9482. * <code>repeated .wallet.Extension extension = 10;</code>
  9483. */
  9484. org.bitcoinj.wallet.Protos.Extension getExtension(int index);
  9485. /**
  9486. * <code>repeated .wallet.Extension extension = 10;</code>
  9487. */
  9488. int getExtensionCount();
  9489. /**
  9490. * <code>repeated .wallet.Extension extension = 10;</code>
  9491. */
  9492. java.util.List<? extends org.bitcoinj.wallet.Protos.ExtensionOrBuilder>
  9493. getExtensionOrBuilderList();
  9494. /**
  9495. * <code>repeated .wallet.Extension extension = 10;</code>
  9496. */
  9497. org.bitcoinj.wallet.Protos.ExtensionOrBuilder getExtensionOrBuilder(
  9498. int index);
  9499. // optional string description = 11;
  9500. /**
  9501. * <code>optional string description = 11;</code>
  9502. *
  9503. * <pre>
  9504. * A UTF8 encoded text description of the wallet that is intended for end user provided text.
  9505. * </pre>
  9506. */
  9507. boolean hasDescription();
  9508. /**
  9509. * <code>optional string description = 11;</code>
  9510. *
  9511. * <pre>
  9512. * A UTF8 encoded text description of the wallet that is intended for end user provided text.
  9513. * </pre>
  9514. */
  9515. java.lang.String getDescription();
  9516. /**
  9517. * <code>optional string description = 11;</code>
  9518. *
  9519. * <pre>
  9520. * A UTF8 encoded text description of the wallet that is intended for end user provided text.
  9521. * </pre>
  9522. */
  9523. com.google.protobuf.ByteString
  9524. getDescriptionBytes();
  9525. // optional uint64 key_rotation_time = 13;
  9526. /**
  9527. * <code>optional uint64 key_rotation_time = 13;</code>
  9528. *
  9529. * <pre>
  9530. * UNIX time in seconds since the epoch. If set, then any keys created before this date are assumed to be no longer
  9531. * wanted. Money sent to them will be re-spent automatically to the first key that was created after this time. It
  9532. * can be used to recover a compromised wallet, or just as part of preventative defence-in-depth measures.
  9533. * </pre>
  9534. */
  9535. boolean hasKeyRotationTime();
  9536. /**
  9537. * <code>optional uint64 key_rotation_time = 13;</code>
  9538. *
  9539. * <pre>
  9540. * UNIX time in seconds since the epoch. If set, then any keys created before this date are assumed to be no longer
  9541. * wanted. Money sent to them will be re-spent automatically to the first key that was created after this time. It
  9542. * can be used to recover a compromised wallet, or just as part of preventative defence-in-depth measures.
  9543. * </pre>
  9544. */
  9545. long getKeyRotationTime();
  9546. }
  9547. /**
  9548. * Protobuf type {@code wallet.Wallet}
  9549. *
  9550. * <pre>
  9551. ** A bitcoin wallet
  9552. * </pre>
  9553. */
  9554. public static final class Wallet extends
  9555. com.google.protobuf.GeneratedMessage
  9556. implements WalletOrBuilder {
  9557. // Use Wallet.newBuilder() to construct.
  9558. private Wallet(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  9559. super(builder);
  9560. this.unknownFields = builder.getUnknownFields();
  9561. }
  9562. private Wallet(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  9563. private static final Wallet defaultInstance;
  9564. public static Wallet getDefaultInstance() {
  9565. return defaultInstance;
  9566. }
  9567. public Wallet getDefaultInstanceForType() {
  9568. return defaultInstance;
  9569. }
  9570. private final com.google.protobuf.UnknownFieldSet unknownFields;
  9571. @java.lang.Override
  9572. public final com.google.protobuf.UnknownFieldSet
  9573. getUnknownFields() {
  9574. return this.unknownFields;
  9575. }
  9576. private Wallet(
  9577. com.google.protobuf.CodedInputStream input,
  9578. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  9579. throws com.google.protobuf.InvalidProtocolBufferException {
  9580. initFields();
  9581. int mutable_bitField0_ = 0;
  9582. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  9583. com.google.protobuf.UnknownFieldSet.newBuilder();
  9584. try {
  9585. boolean done = false;
  9586. while (!done) {
  9587. int tag = input.readTag();
  9588. switch (tag) {
  9589. case 0:
  9590. done = true;
  9591. break;
  9592. default: {
  9593. if (!parseUnknownField(input, unknownFields,
  9594. extensionRegistry, tag)) {
  9595. done = true;
  9596. }
  9597. break;
  9598. }
  9599. case 10: {
  9600. bitField0_ |= 0x00000001;
  9601. networkIdentifier_ = input.readBytes();
  9602. break;
  9603. }
  9604. case 18: {
  9605. bitField0_ |= 0x00000002;
  9606. lastSeenBlockHash_ = input.readBytes();
  9607. break;
  9608. }
  9609. case 26: {
  9610. if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
  9611. key_ = new java.util.ArrayList<org.bitcoinj.wallet.Protos.Key>();
  9612. mutable_bitField0_ |= 0x00000008;
  9613. }
  9614. key_.add(input.readMessage(org.bitcoinj.wallet.Protos.Key.PARSER, extensionRegistry));
  9615. break;
  9616. }
  9617. case 34: {
  9618. if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
  9619. transaction_ = new java.util.ArrayList<org.bitcoinj.wallet.Protos.Transaction>();
  9620. mutable_bitField0_ |= 0x00000010;
  9621. }
  9622. transaction_.add(input.readMessage(org.bitcoinj.wallet.Protos.Transaction.PARSER, extensionRegistry));
  9623. break;
  9624. }
  9625. case 40: {
  9626. int rawValue = input.readEnum();
  9627. org.bitcoinj.wallet.Protos.Wallet.EncryptionType value = org.bitcoinj.wallet.Protos.Wallet.EncryptionType.valueOf(rawValue);
  9628. if (value == null) {
  9629. unknownFields.mergeVarintField(5, rawValue);
  9630. } else {
  9631. bitField0_ |= 0x00000008;
  9632. encryptionType_ = value;
  9633. }
  9634. break;
  9635. }
  9636. case 50: {
  9637. org.bitcoinj.wallet.Protos.ScryptParameters.Builder subBuilder = null;
  9638. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  9639. subBuilder = encryptionParameters_.toBuilder();
  9640. }
  9641. encryptionParameters_ = input.readMessage(org.bitcoinj.wallet.Protos.ScryptParameters.PARSER, extensionRegistry);
  9642. if (subBuilder != null) {
  9643. subBuilder.mergeFrom(encryptionParameters_);
  9644. encryptionParameters_ = subBuilder.buildPartial();
  9645. }
  9646. bitField0_ |= 0x00000010;
  9647. break;
  9648. }
  9649. case 56: {
  9650. bitField0_ |= 0x00000020;
  9651. version_ = input.readInt32();
  9652. break;
  9653. }
  9654. case 82: {
  9655. if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) {
  9656. extension_ = new java.util.ArrayList<org.bitcoinj.wallet.Protos.Extension>();
  9657. mutable_bitField0_ |= 0x00000100;
  9658. }
  9659. extension_.add(input.readMessage(org.bitcoinj.wallet.Protos.Extension.PARSER, extensionRegistry));
  9660. break;
  9661. }
  9662. case 90: {
  9663. bitField0_ |= 0x00000040;
  9664. description_ = input.readBytes();
  9665. break;
  9666. }
  9667. case 96: {
  9668. bitField0_ |= 0x00000004;
  9669. lastSeenBlockHeight_ = input.readUInt32();
  9670. break;
  9671. }
  9672. case 104: {
  9673. bitField0_ |= 0x00000080;
  9674. keyRotationTime_ = input.readUInt64();
  9675. break;
  9676. }
  9677. }
  9678. }
  9679. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  9680. throw e.setUnfinishedMessage(this);
  9681. } catch (java.io.IOException e) {
  9682. throw new com.google.protobuf.InvalidProtocolBufferException(
  9683. e.getMessage()).setUnfinishedMessage(this);
  9684. } finally {
  9685. if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
  9686. key_ = java.util.Collections.unmodifiableList(key_);
  9687. }
  9688. if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
  9689. transaction_ = java.util.Collections.unmodifiableList(transaction_);
  9690. }
  9691. if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) {
  9692. extension_ = java.util.Collections.unmodifiableList(extension_);
  9693. }
  9694. this.unknownFields = unknownFields.build();
  9695. makeExtensionsImmutable();
  9696. }
  9697. }
  9698. public static final com.google.protobuf.Descriptors.Descriptor
  9699. getDescriptor() {
  9700. return org.bitcoinj.wallet.Protos.internal_static_wallet_Wallet_descriptor;
  9701. }
  9702. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  9703. internalGetFieldAccessorTable() {
  9704. return org.bitcoinj.wallet.Protos.internal_static_wallet_Wallet_fieldAccessorTable
  9705. .ensureFieldAccessorsInitialized(
  9706. org.bitcoinj.wallet.Protos.Wallet.class, org.bitcoinj.wallet.Protos.Wallet.Builder.class);
  9707. }
  9708. public static com.google.protobuf.Parser<Wallet> PARSER =
  9709. new com.google.protobuf.AbstractParser<Wallet>() {
  9710. public Wallet parsePartialFrom(
  9711. com.google.protobuf.CodedInputStream input,
  9712. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  9713. throws com.google.protobuf.InvalidProtocolBufferException {
  9714. return new Wallet(input, extensionRegistry);
  9715. }
  9716. };
  9717. @java.lang.Override
  9718. public com.google.protobuf.Parser<Wallet> getParserForType() {
  9719. return PARSER;
  9720. }
  9721. /**
  9722. * Protobuf enum {@code wallet.Wallet.EncryptionType}
  9723. *
  9724. * <pre>
  9725. **
  9726. * The encryption type of the wallet.
  9727. *
  9728. * The encryption type is UNENCRYPTED for wallets where the wallet does not support encryption - wallets prior to
  9729. * encryption support are grandfathered in as this wallet type.
  9730. * When a wallet is ENCRYPTED_SCRYPT_AES the keys are either encrypted with the wallet password or are unencrypted.
  9731. * </pre>
  9732. */
  9733. public enum EncryptionType
  9734. implements com.google.protobuf.ProtocolMessageEnum {
  9735. /**
  9736. * <code>UNENCRYPTED = 1;</code>
  9737. *
  9738. * <pre>
  9739. * All keys in the wallet are unencrypted
  9740. * </pre>
  9741. */
  9742. UNENCRYPTED(0, 1),
  9743. /**
  9744. * <code>ENCRYPTED_SCRYPT_AES = 2;</code>
  9745. *
  9746. * <pre>
  9747. * All keys are encrypted with a passphrase based KDF of scrypt and AES encryption
  9748. * </pre>
  9749. */
  9750. ENCRYPTED_SCRYPT_AES(1, 2),
  9751. ;
  9752. /**
  9753. * <code>UNENCRYPTED = 1;</code>
  9754. *
  9755. * <pre>
  9756. * All keys in the wallet are unencrypted
  9757. * </pre>
  9758. */
  9759. public static final int UNENCRYPTED_VALUE = 1;
  9760. /**
  9761. * <code>ENCRYPTED_SCRYPT_AES = 2;</code>
  9762. *
  9763. * <pre>
  9764. * All keys are encrypted with a passphrase based KDF of scrypt and AES encryption
  9765. * </pre>
  9766. */
  9767. public static final int ENCRYPTED_SCRYPT_AES_VALUE = 2;
  9768. public final int getNumber() { return value; }
  9769. public static EncryptionType valueOf(int value) {
  9770. switch (value) {
  9771. case 1: return UNENCRYPTED;
  9772. case 2: return ENCRYPTED_SCRYPT_AES;
  9773. default: return null;
  9774. }
  9775. }
  9776. public static com.google.protobuf.Internal.EnumLiteMap<EncryptionType>
  9777. internalGetValueMap() {
  9778. return internalValueMap;
  9779. }
  9780. private static com.google.protobuf.Internal.EnumLiteMap<EncryptionType>
  9781. internalValueMap =
  9782. new com.google.protobuf.Internal.EnumLiteMap<EncryptionType>() {
  9783. public EncryptionType findValueByNumber(int number) {
  9784. return EncryptionType.valueOf(number);
  9785. }
  9786. };
  9787. public final com.google.protobuf.Descriptors.EnumValueDescriptor
  9788. getValueDescriptor() {
  9789. return getDescriptor().getValues().get(index);
  9790. }
  9791. public final com.google.protobuf.Descriptors.EnumDescriptor
  9792. getDescriptorForType() {
  9793. return getDescriptor();
  9794. }
  9795. public static final com.google.protobuf.Descriptors.EnumDescriptor
  9796. getDescriptor() {
  9797. return org.bitcoinj.wallet.Protos.Wallet.getDescriptor().getEnumTypes().get(0);
  9798. }
  9799. private static final EncryptionType[] VALUES = values();
  9800. public static EncryptionType valueOf(
  9801. com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
  9802. if (desc.getType() != getDescriptor()) {
  9803. throw new java.lang.IllegalArgumentException(
  9804. "EnumValueDescriptor is not for this type.");
  9805. }
  9806. return VALUES[desc.getIndex()];
  9807. }
  9808. private final int index;
  9809. private final int value;
  9810. private EncryptionType(int index, int value) {
  9811. this.index = index;
  9812. this.value = value;
  9813. }
  9814. // @@protoc_insertion_point(enum_scope:wallet.Wallet.EncryptionType)
  9815. }
  9816. private int bitField0_;
  9817. // required string network_identifier = 1;
  9818. public static final int NETWORK_IDENTIFIER_FIELD_NUMBER = 1;
  9819. private java.lang.Object networkIdentifier_;
  9820. /**
  9821. * <code>required string network_identifier = 1;</code>
  9822. *
  9823. * <pre>
  9824. * the network used by this wallet
  9825. * </pre>
  9826. */
  9827. public boolean hasNetworkIdentifier() {
  9828. return ((bitField0_ & 0x00000001) == 0x00000001);
  9829. }
  9830. /**
  9831. * <code>required string network_identifier = 1;</code>
  9832. *
  9833. * <pre>
  9834. * the network used by this wallet
  9835. * </pre>
  9836. */
  9837. public java.lang.String getNetworkIdentifier() {
  9838. java.lang.Object ref = networkIdentifier_;
  9839. if (ref instanceof java.lang.String) {
  9840. return (java.lang.String) ref;
  9841. } else {
  9842. com.google.protobuf.ByteString bs =
  9843. (com.google.protobuf.ByteString) ref;
  9844. java.lang.String s = bs.toStringUtf8();
  9845. if (bs.isValidUtf8()) {
  9846. networkIdentifier_ = s;
  9847. }
  9848. return s;
  9849. }
  9850. }
  9851. /**
  9852. * <code>required string network_identifier = 1;</code>
  9853. *
  9854. * <pre>
  9855. * the network used by this wallet
  9856. * </pre>
  9857. */
  9858. public com.google.protobuf.ByteString
  9859. getNetworkIdentifierBytes() {
  9860. java.lang.Object ref = networkIdentifier_;
  9861. if (ref instanceof java.lang.String) {
  9862. com.google.protobuf.ByteString b =
  9863. com.google.protobuf.ByteString.copyFromUtf8(
  9864. (java.lang.String) ref);
  9865. networkIdentifier_ = b;
  9866. return b;
  9867. } else {
  9868. return (com.google.protobuf.ByteString) ref;
  9869. }
  9870. }
  9871. // optional bytes last_seen_block_hash = 2;
  9872. public static final int LAST_SEEN_BLOCK_HASH_FIELD_NUMBER = 2;
  9873. private com.google.protobuf.ByteString lastSeenBlockHash_;
  9874. /**
  9875. * <code>optional bytes last_seen_block_hash = 2;</code>
  9876. *
  9877. * <pre>
  9878. * The SHA256 hash of the head of the best chain seen by this wallet.
  9879. * </pre>
  9880. */
  9881. public boolean hasLastSeenBlockHash() {
  9882. return ((bitField0_ & 0x00000002) == 0x00000002);
  9883. }
  9884. /**
  9885. * <code>optional bytes last_seen_block_hash = 2;</code>
  9886. *
  9887. * <pre>
  9888. * The SHA256 hash of the head of the best chain seen by this wallet.
  9889. * </pre>
  9890. */
  9891. public com.google.protobuf.ByteString getLastSeenBlockHash() {
  9892. return lastSeenBlockHash_;
  9893. }
  9894. // optional uint32 last_seen_block_height = 12;
  9895. public static final int LAST_SEEN_BLOCK_HEIGHT_FIELD_NUMBER = 12;
  9896. private int lastSeenBlockHeight_;
  9897. /**
  9898. * <code>optional uint32 last_seen_block_height = 12;</code>
  9899. *
  9900. * <pre>
  9901. * The height in the chain of the last seen block.
  9902. * </pre>
  9903. */
  9904. public boolean hasLastSeenBlockHeight() {
  9905. return ((bitField0_ & 0x00000004) == 0x00000004);
  9906. }
  9907. /**
  9908. * <code>optional uint32 last_seen_block_height = 12;</code>
  9909. *
  9910. * <pre>
  9911. * The height in the chain of the last seen block.
  9912. * </pre>
  9913. */
  9914. public int getLastSeenBlockHeight() {
  9915. return lastSeenBlockHeight_;
  9916. }
  9917. // repeated .wallet.Key key = 3;
  9918. public static final int KEY_FIELD_NUMBER = 3;
  9919. private java.util.List<org.bitcoinj.wallet.Protos.Key> key_;
  9920. /**
  9921. * <code>repeated .wallet.Key key = 3;</code>
  9922. */
  9923. public java.util.List<org.bitcoinj.wallet.Protos.Key> getKeyList() {
  9924. return key_;
  9925. }
  9926. /**
  9927. * <code>repeated .wallet.Key key = 3;</code>
  9928. */
  9929. public java.util.List<? extends org.bitcoinj.wallet.Protos.KeyOrBuilder>
  9930. getKeyOrBuilderList() {
  9931. return key_;
  9932. }
  9933. /**
  9934. * <code>repeated .wallet.Key key = 3;</code>
  9935. */
  9936. public int getKeyCount() {
  9937. return key_.size();
  9938. }
  9939. /**
  9940. * <code>repeated .wallet.Key key = 3;</code>
  9941. */
  9942. public org.bitcoinj.wallet.Protos.Key getKey(int index) {
  9943. return key_.get(index);
  9944. }
  9945. /**
  9946. * <code>repeated .wallet.Key key = 3;</code>
  9947. */
  9948. public org.bitcoinj.wallet.Protos.KeyOrBuilder getKeyOrBuilder(
  9949. int index) {
  9950. return key_.get(index);
  9951. }
  9952. // repeated .wallet.Transaction transaction = 4;
  9953. public static final int TRANSACTION_FIELD_NUMBER = 4;
  9954. private java.util.List<org.bitcoinj.wallet.Protos.Transaction> transaction_;
  9955. /**
  9956. * <code>repeated .wallet.Transaction transaction = 4;</code>
  9957. */
  9958. public java.util.List<org.bitcoinj.wallet.Protos.Transaction> getTransactionList() {
  9959. return transaction_;
  9960. }
  9961. /**
  9962. * <code>repeated .wallet.Transaction transaction = 4;</code>
  9963. */
  9964. public java.util.List<? extends org.bitcoinj.wallet.Protos.TransactionOrBuilder>
  9965. getTransactionOrBuilderList() {
  9966. return transaction_;
  9967. }
  9968. /**
  9969. * <code>repeated .wallet.Transaction transaction = 4;</code>
  9970. */
  9971. public int getTransactionCount() {
  9972. return transaction_.size();
  9973. }
  9974. /**
  9975. * <code>repeated .wallet.Transaction transaction = 4;</code>
  9976. */
  9977. public org.bitcoinj.wallet.Protos.Transaction getTransaction(int index) {
  9978. return transaction_.get(index);
  9979. }
  9980. /**
  9981. * <code>repeated .wallet.Transaction transaction = 4;</code>
  9982. */
  9983. public org.bitcoinj.wallet.Protos.TransactionOrBuilder getTransactionOrBuilder(
  9984. int index) {
  9985. return transaction_.get(index);
  9986. }
  9987. // optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED];
  9988. public static final int ENCRYPTION_TYPE_FIELD_NUMBER = 5;
  9989. private org.bitcoinj.wallet.Protos.Wallet.EncryptionType encryptionType_;
  9990. /**
  9991. * <code>optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED];</code>
  9992. */
  9993. public boolean hasEncryptionType() {
  9994. return ((bitField0_ & 0x00000008) == 0x00000008);
  9995. }
  9996. /**
  9997. * <code>optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED];</code>
  9998. */
  9999. public org.bitcoinj.wallet.Protos.Wallet.EncryptionType getEncryptionType() {
  10000. return encryptionType_;
  10001. }
  10002. // optional .wallet.ScryptParameters encryption_parameters = 6;
  10003. public static final int ENCRYPTION_PARAMETERS_FIELD_NUMBER = 6;
  10004. private org.bitcoinj.wallet.Protos.ScryptParameters encryptionParameters_;
  10005. /**
  10006. * <code>optional .wallet.ScryptParameters encryption_parameters = 6;</code>
  10007. */
  10008. public boolean hasEncryptionParameters() {
  10009. return ((bitField0_ & 0x00000010) == 0x00000010);
  10010. }
  10011. /**
  10012. * <code>optional .wallet.ScryptParameters encryption_parameters = 6;</code>
  10013. */
  10014. public org.bitcoinj.wallet.Protos.ScryptParameters getEncryptionParameters() {
  10015. return encryptionParameters_;
  10016. }
  10017. /**
  10018. * <code>optional .wallet.ScryptParameters encryption_parameters = 6;</code>
  10019. */
  10020. public org.bitcoinj.wallet.Protos.ScryptParametersOrBuilder getEncryptionParametersOrBuilder() {
  10021. return encryptionParameters_;
  10022. }
  10023. // optional int32 version = 7;
  10024. public static final int VERSION_FIELD_NUMBER = 7;
  10025. private int version_;
  10026. /**
  10027. * <code>optional int32 version = 7;</code>
  10028. *
  10029. * <pre>
  10030. * The version number of the wallet - used to detect wallets that were produced in the future
  10031. * (i.e the wallet may contain some future format this protobuf/ code does not know about)
  10032. * </pre>
  10033. */
  10034. public boolean hasVersion() {
  10035. return ((bitField0_ & 0x00000020) == 0x00000020);
  10036. }
  10037. /**
  10038. * <code>optional int32 version = 7;</code>
  10039. *
  10040. * <pre>
  10041. * The version number of the wallet - used to detect wallets that were produced in the future
  10042. * (i.e the wallet may contain some future format this protobuf/ code does not know about)
  10043. * </pre>
  10044. */
  10045. public int getVersion() {
  10046. return version_;
  10047. }
  10048. // repeated .wallet.Extension extension = 10;
  10049. public static final int EXTENSION_FIELD_NUMBER = 10;
  10050. private java.util.List<org.bitcoinj.wallet.Protos.Extension> extension_;
  10051. /**
  10052. * <code>repeated .wallet.Extension extension = 10;</code>
  10053. */
  10054. public java.util.List<org.bitcoinj.wallet.Protos.Extension> getExtensionList() {
  10055. return extension_;
  10056. }
  10057. /**
  10058. * <code>repeated .wallet.Extension extension = 10;</code>
  10059. */
  10060. public java.util.List<? extends org.bitcoinj.wallet.Protos.ExtensionOrBuilder>
  10061. getExtensionOrBuilderList() {
  10062. return extension_;
  10063. }
  10064. /**
  10065. * <code>repeated .wallet.Extension extension = 10;</code>
  10066. */
  10067. public int getExtensionCount() {
  10068. return extension_.size();
  10069. }
  10070. /**
  10071. * <code>repeated .wallet.Extension extension = 10;</code>
  10072. */
  10073. public org.bitcoinj.wallet.Protos.Extension getExtension(int index) {
  10074. return extension_.get(index);
  10075. }
  10076. /**
  10077. * <code>repeated .wallet.Extension extension = 10;</code>
  10078. */
  10079. public org.bitcoinj.wallet.Protos.ExtensionOrBuilder getExtensionOrBuilder(
  10080. int index) {
  10081. return extension_.get(index);
  10082. }
  10083. // optional string description = 11;
  10084. public static final int DESCRIPTION_FIELD_NUMBER = 11;
  10085. private java.lang.Object description_;
  10086. /**
  10087. * <code>optional string description = 11;</code>
  10088. *
  10089. * <pre>
  10090. * A UTF8 encoded text description of the wallet that is intended for end user provided text.
  10091. * </pre>
  10092. */
  10093. public boolean hasDescription() {
  10094. return ((bitField0_ & 0x00000040) == 0x00000040);
  10095. }
  10096. /**
  10097. * <code>optional string description = 11;</code>
  10098. *
  10099. * <pre>
  10100. * A UTF8 encoded text description of the wallet that is intended for end user provided text.
  10101. * </pre>
  10102. */
  10103. public java.lang.String getDescription() {
  10104. java.lang.Object ref = description_;
  10105. if (ref instanceof java.lang.String) {
  10106. return (java.lang.String) ref;
  10107. } else {
  10108. com.google.protobuf.ByteString bs =
  10109. (com.google.protobuf.ByteString) ref;
  10110. java.lang.String s = bs.toStringUtf8();
  10111. if (bs.isValidUtf8()) {
  10112. description_ = s;
  10113. }
  10114. return s;
  10115. }
  10116. }
  10117. /**
  10118. * <code>optional string description = 11;</code>
  10119. *
  10120. * <pre>
  10121. * A UTF8 encoded text description of the wallet that is intended for end user provided text.
  10122. * </pre>
  10123. */
  10124. public com.google.protobuf.ByteString
  10125. getDescriptionBytes() {
  10126. java.lang.Object ref = description_;
  10127. if (ref instanceof java.lang.String) {
  10128. com.google.protobuf.ByteString b =
  10129. com.google.protobuf.ByteString.copyFromUtf8(
  10130. (java.lang.String) ref);
  10131. description_ = b;
  10132. return b;
  10133. } else {
  10134. return (com.google.protobuf.ByteString) ref;
  10135. }
  10136. }
  10137. // optional uint64 key_rotation_time = 13;
  10138. public static final int KEY_ROTATION_TIME_FIELD_NUMBER = 13;
  10139. private long keyRotationTime_;
  10140. /**
  10141. * <code>optional uint64 key_rotation_time = 13;</code>
  10142. *
  10143. * <pre>
  10144. * UNIX time in seconds since the epoch. If set, then any keys created before this date are assumed to be no longer
  10145. * wanted. Money sent to them will be re-spent automatically to the first key that was created after this time. It
  10146. * can be used to recover a compromised wallet, or just as part of preventative defence-in-depth measures.
  10147. * </pre>
  10148. */
  10149. public boolean hasKeyRotationTime() {
  10150. return ((bitField0_ & 0x00000080) == 0x00000080);
  10151. }
  10152. /**
  10153. * <code>optional uint64 key_rotation_time = 13;</code>
  10154. *
  10155. * <pre>
  10156. * UNIX time in seconds since the epoch. If set, then any keys created before this date are assumed to be no longer
  10157. * wanted. Money sent to them will be re-spent automatically to the first key that was created after this time. It
  10158. * can be used to recover a compromised wallet, or just as part of preventative defence-in-depth measures.
  10159. * </pre>
  10160. */
  10161. public long getKeyRotationTime() {
  10162. return keyRotationTime_;
  10163. }
  10164. private void initFields() {
  10165. networkIdentifier_ = "";
  10166. lastSeenBlockHash_ = com.google.protobuf.ByteString.EMPTY;
  10167. lastSeenBlockHeight_ = 0;
  10168. key_ = java.util.Collections.emptyList();
  10169. transaction_ = java.util.Collections.emptyList();
  10170. encryptionType_ = org.bitcoinj.wallet.Protos.Wallet.EncryptionType.UNENCRYPTED;
  10171. encryptionParameters_ = org.bitcoinj.wallet.Protos.ScryptParameters.getDefaultInstance();
  10172. version_ = 0;
  10173. extension_ = java.util.Collections.emptyList();
  10174. description_ = "";
  10175. keyRotationTime_ = 0L;
  10176. }
  10177. private byte memoizedIsInitialized = -1;
  10178. public final boolean isInitialized() {
  10179. byte isInitialized = memoizedIsInitialized;
  10180. if (isInitialized != -1) return isInitialized == 1;
  10181. if (!hasNetworkIdentifier()) {
  10182. memoizedIsInitialized = 0;
  10183. return false;
  10184. }
  10185. for (int i = 0; i < getKeyCount(); i++) {
  10186. if (!getKey(i).isInitialized()) {
  10187. memoizedIsInitialized = 0;
  10188. return false;
  10189. }
  10190. }
  10191. for (int i = 0; i < getTransactionCount(); i++) {
  10192. if (!getTransaction(i).isInitialized()) {
  10193. memoizedIsInitialized = 0;
  10194. return false;
  10195. }
  10196. }
  10197. if (hasEncryptionParameters()) {
  10198. if (!getEncryptionParameters().isInitialized()) {
  10199. memoizedIsInitialized = 0;
  10200. return false;
  10201. }
  10202. }
  10203. for (int i = 0; i < getExtensionCount(); i++) {
  10204. if (!getExtension(i).isInitialized()) {
  10205. memoizedIsInitialized = 0;
  10206. return false;
  10207. }
  10208. }
  10209. memoizedIsInitialized = 1;
  10210. return true;
  10211. }
  10212. public void writeTo(com.google.protobuf.CodedOutputStream output)
  10213. throws java.io.IOException {
  10214. getSerializedSize();
  10215. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  10216. output.writeBytes(1, getNetworkIdentifierBytes());
  10217. }
  10218. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  10219. output.writeBytes(2, lastSeenBlockHash_);
  10220. }
  10221. for (int i = 0; i < key_.size(); i++) {
  10222. output.writeMessage(3, key_.get(i));
  10223. }
  10224. for (int i = 0; i < transaction_.size(); i++) {
  10225. output.writeMessage(4, transaction_.get(i));
  10226. }
  10227. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  10228. output.writeEnum(5, encryptionType_.getNumber());
  10229. }
  10230. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  10231. output.writeMessage(6, encryptionParameters_);
  10232. }
  10233. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  10234. output.writeInt32(7, version_);
  10235. }
  10236. for (int i = 0; i < extension_.size(); i++) {
  10237. output.writeMessage(10, extension_.get(i));
  10238. }
  10239. if (((bitField0_ & 0x00000040) == 0x00000040)) {
  10240. output.writeBytes(11, getDescriptionBytes());
  10241. }
  10242. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  10243. output.writeUInt32(12, lastSeenBlockHeight_);
  10244. }
  10245. if (((bitField0_ & 0x00000080) == 0x00000080)) {
  10246. output.writeUInt64(13, keyRotationTime_);
  10247. }
  10248. getUnknownFields().writeTo(output);
  10249. }
  10250. private int memoizedSerializedSize = -1;
  10251. public int getSerializedSize() {
  10252. int size = memoizedSerializedSize;
  10253. if (size != -1) return size;
  10254. size = 0;
  10255. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  10256. size += com.google.protobuf.CodedOutputStream
  10257. .computeBytesSize(1, getNetworkIdentifierBytes());
  10258. }
  10259. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  10260. size += com.google.protobuf.CodedOutputStream
  10261. .computeBytesSize(2, lastSeenBlockHash_);
  10262. }
  10263. for (int i = 0; i < key_.size(); i++) {
  10264. size += com.google.protobuf.CodedOutputStream
  10265. .computeMessageSize(3, key_.get(i));
  10266. }
  10267. for (int i = 0; i < transaction_.size(); i++) {
  10268. size += com.google.protobuf.CodedOutputStream
  10269. .computeMessageSize(4, transaction_.get(i));
  10270. }
  10271. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  10272. size += com.google.protobuf.CodedOutputStream
  10273. .computeEnumSize(5, encryptionType_.getNumber());
  10274. }
  10275. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  10276. size += com.google.protobuf.CodedOutputStream
  10277. .computeMessageSize(6, encryptionParameters_);
  10278. }
  10279. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  10280. size += com.google.protobuf.CodedOutputStream
  10281. .computeInt32Size(7, version_);
  10282. }
  10283. for (int i = 0; i < extension_.size(); i++) {
  10284. size += com.google.protobuf.CodedOutputStream
  10285. .computeMessageSize(10, extension_.get(i));
  10286. }
  10287. if (((bitField0_ & 0x00000040) == 0x00000040)) {
  10288. size += com.google.protobuf.CodedOutputStream
  10289. .computeBytesSize(11, getDescriptionBytes());
  10290. }
  10291. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  10292. size += com.google.protobuf.CodedOutputStream
  10293. .computeUInt32Size(12, lastSeenBlockHeight_);
  10294. }
  10295. if (((bitField0_ & 0x00000080) == 0x00000080)) {
  10296. size += com.google.protobuf.CodedOutputStream
  10297. .computeUInt64Size(13, keyRotationTime_);
  10298. }
  10299. size += getUnknownFields().getSerializedSize();
  10300. memoizedSerializedSize = size;
  10301. return size;
  10302. }
  10303. private static final long serialVersionUID = 0L;
  10304. @java.lang.Override
  10305. protected java.lang.Object writeReplace()
  10306. throws java.io.ObjectStreamException {
  10307. return super.writeReplace();
  10308. }
  10309. public static org.bitcoinj.wallet.Protos.Wallet parseFrom(
  10310. com.google.protobuf.ByteString data)
  10311. throws com.google.protobuf.InvalidProtocolBufferException {
  10312. return PARSER.parseFrom(data);
  10313. }
  10314. public static org.bitcoinj.wallet.Protos.Wallet parseFrom(
  10315. com.google.protobuf.ByteString data,
  10316. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  10317. throws com.google.protobuf.InvalidProtocolBufferException {
  10318. return PARSER.parseFrom(data, extensionRegistry);
  10319. }
  10320. public static org.bitcoinj.wallet.Protos.Wallet parseFrom(byte[] data)
  10321. throws com.google.protobuf.InvalidProtocolBufferException {
  10322. return PARSER.parseFrom(data);
  10323. }
  10324. public static org.bitcoinj.wallet.Protos.Wallet parseFrom(
  10325. byte[] data,
  10326. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  10327. throws com.google.protobuf.InvalidProtocolBufferException {
  10328. return PARSER.parseFrom(data, extensionRegistry);
  10329. }
  10330. public static org.bitcoinj.wallet.Protos.Wallet parseFrom(java.io.InputStream input)
  10331. throws java.io.IOException {
  10332. return PARSER.parseFrom(input);
  10333. }
  10334. public static org.bitcoinj.wallet.Protos.Wallet parseFrom(
  10335. java.io.InputStream input,
  10336. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  10337. throws java.io.IOException {
  10338. return PARSER.parseFrom(input, extensionRegistry);
  10339. }
  10340. public static org.bitcoinj.wallet.Protos.Wallet parseDelimitedFrom(java.io.InputStream input)
  10341. throws java.io.IOException {
  10342. return PARSER.parseDelimitedFrom(input);
  10343. }
  10344. public static org.bitcoinj.wallet.Protos.Wallet parseDelimitedFrom(
  10345. java.io.InputStream input,
  10346. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  10347. throws java.io.IOException {
  10348. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  10349. }
  10350. public static org.bitcoinj.wallet.Protos.Wallet parseFrom(
  10351. com.google.protobuf.CodedInputStream input)
  10352. throws java.io.IOException {
  10353. return PARSER.parseFrom(input);
  10354. }
  10355. public static org.bitcoinj.wallet.Protos.Wallet parseFrom(
  10356. com.google.protobuf.CodedInputStream input,
  10357. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  10358. throws java.io.IOException {
  10359. return PARSER.parseFrom(input, extensionRegistry);
  10360. }
  10361. public static Builder newBuilder() { return Builder.create(); }
  10362. public Builder newBuilderForType() { return newBuilder(); }
  10363. public static Builder newBuilder(org.bitcoinj.wallet.Protos.Wallet prototype) {
  10364. return newBuilder().mergeFrom(prototype);
  10365. }
  10366. public Builder toBuilder() { return newBuilder(this); }
  10367. @java.lang.Override
  10368. protected Builder newBuilderForType(
  10369. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  10370. Builder builder = new Builder(parent);
  10371. return builder;
  10372. }
  10373. /**
  10374. * Protobuf type {@code wallet.Wallet}
  10375. *
  10376. * <pre>
  10377. ** A bitcoin wallet
  10378. * </pre>
  10379. */
  10380. public static final class Builder extends
  10381. com.google.protobuf.GeneratedMessage.Builder<Builder>
  10382. implements org.bitcoinj.wallet.Protos.WalletOrBuilder {
  10383. public static final com.google.protobuf.Descriptors.Descriptor
  10384. getDescriptor() {
  10385. return org.bitcoinj.wallet.Protos.internal_static_wallet_Wallet_descriptor;
  10386. }
  10387. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  10388. internalGetFieldAccessorTable() {
  10389. return org.bitcoinj.wallet.Protos.internal_static_wallet_Wallet_fieldAccessorTable
  10390. .ensureFieldAccessorsInitialized(
  10391. org.bitcoinj.wallet.Protos.Wallet.class, org.bitcoinj.wallet.Protos.Wallet.Builder.class);
  10392. }
  10393. // Construct using org.bitcoinj.wallet.Protos.Wallet.newBuilder()
  10394. private Builder() {
  10395. maybeForceBuilderInitialization();
  10396. }
  10397. private Builder(
  10398. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  10399. super(parent);
  10400. maybeForceBuilderInitialization();
  10401. }
  10402. private void maybeForceBuilderInitialization() {
  10403. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  10404. getKeyFieldBuilder();
  10405. getTransactionFieldBuilder();
  10406. getEncryptionParametersFieldBuilder();
  10407. getExtensionFieldBuilder();
  10408. }
  10409. }
  10410. private static Builder create() {
  10411. return new Builder();
  10412. }
  10413. public Builder clear() {
  10414. super.clear();
  10415. networkIdentifier_ = "";
  10416. bitField0_ = (bitField0_ & ~0x00000001);
  10417. lastSeenBlockHash_ = com.google.protobuf.ByteString.EMPTY;
  10418. bitField0_ = (bitField0_ & ~0x00000002);
  10419. lastSeenBlockHeight_ = 0;
  10420. bitField0_ = (bitField0_ & ~0x00000004);
  10421. if (keyBuilder_ == null) {
  10422. key_ = java.util.Collections.emptyList();
  10423. bitField0_ = (bitField0_ & ~0x00000008);
  10424. } else {
  10425. keyBuilder_.clear();
  10426. }
  10427. if (transactionBuilder_ == null) {
  10428. transaction_ = java.util.Collections.emptyList();
  10429. bitField0_ = (bitField0_ & ~0x00000010);
  10430. } else {
  10431. transactionBuilder_.clear();
  10432. }
  10433. encryptionType_ = org.bitcoinj.wallet.Protos.Wallet.EncryptionType.UNENCRYPTED;
  10434. bitField0_ = (bitField0_ & ~0x00000020);
  10435. if (encryptionParametersBuilder_ == null) {
  10436. encryptionParameters_ = org.bitcoinj.wallet.Protos.ScryptParameters.getDefaultInstance();
  10437. } else {
  10438. encryptionParametersBuilder_.clear();
  10439. }
  10440. bitField0_ = (bitField0_ & ~0x00000040);
  10441. version_ = 0;
  10442. bitField0_ = (bitField0_ & ~0x00000080);
  10443. if (extensionBuilder_ == null) {
  10444. extension_ = java.util.Collections.emptyList();
  10445. bitField0_ = (bitField0_ & ~0x00000100);
  10446. } else {
  10447. extensionBuilder_.clear();
  10448. }
  10449. description_ = "";
  10450. bitField0_ = (bitField0_ & ~0x00000200);
  10451. keyRotationTime_ = 0L;
  10452. bitField0_ = (bitField0_ & ~0x00000400);
  10453. return this;
  10454. }
  10455. public Builder clone() {
  10456. return create().mergeFrom(buildPartial());
  10457. }
  10458. public com.google.protobuf.Descriptors.Descriptor
  10459. getDescriptorForType() {
  10460. return org.bitcoinj.wallet.Protos.internal_static_wallet_Wallet_descriptor;
  10461. }
  10462. public org.bitcoinj.wallet.Protos.Wallet getDefaultInstanceForType() {
  10463. return org.bitcoinj.wallet.Protos.Wallet.getDefaultInstance();
  10464. }
  10465. public org.bitcoinj.wallet.Protos.Wallet build() {
  10466. org.bitcoinj.wallet.Protos.Wallet result = buildPartial();
  10467. if (!result.isInitialized()) {
  10468. throw newUninitializedMessageException(result);
  10469. }
  10470. return result;
  10471. }
  10472. public org.bitcoinj.wallet.Protos.Wallet buildPartial() {
  10473. org.bitcoinj.wallet.Protos.Wallet result = new org.bitcoinj.wallet.Protos.Wallet(this);
  10474. int from_bitField0_ = bitField0_;
  10475. int to_bitField0_ = 0;
  10476. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  10477. to_bitField0_ |= 0x00000001;
  10478. }
  10479. result.networkIdentifier_ = networkIdentifier_;
  10480. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  10481. to_bitField0_ |= 0x00000002;
  10482. }
  10483. result.lastSeenBlockHash_ = lastSeenBlockHash_;
  10484. if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
  10485. to_bitField0_ |= 0x00000004;
  10486. }
  10487. result.lastSeenBlockHeight_ = lastSeenBlockHeight_;
  10488. if (keyBuilder_ == null) {
  10489. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  10490. key_ = java.util.Collections.unmodifiableList(key_);
  10491. bitField0_ = (bitField0_ & ~0x00000008);
  10492. }
  10493. result.key_ = key_;
  10494. } else {
  10495. result.key_ = keyBuilder_.build();
  10496. }
  10497. if (transactionBuilder_ == null) {
  10498. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  10499. transaction_ = java.util.Collections.unmodifiableList(transaction_);
  10500. bitField0_ = (bitField0_ & ~0x00000010);
  10501. }
  10502. result.transaction_ = transaction_;
  10503. } else {
  10504. result.transaction_ = transactionBuilder_.build();
  10505. }
  10506. if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
  10507. to_bitField0_ |= 0x00000008;
  10508. }
  10509. result.encryptionType_ = encryptionType_;
  10510. if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
  10511. to_bitField0_ |= 0x00000010;
  10512. }
  10513. if (encryptionParametersBuilder_ == null) {
  10514. result.encryptionParameters_ = encryptionParameters_;
  10515. } else {
  10516. result.encryptionParameters_ = encryptionParametersBuilder_.build();
  10517. }
  10518. if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
  10519. to_bitField0_ |= 0x00000020;
  10520. }
  10521. result.version_ = version_;
  10522. if (extensionBuilder_ == null) {
  10523. if (((bitField0_ & 0x00000100) == 0x00000100)) {
  10524. extension_ = java.util.Collections.unmodifiableList(extension_);
  10525. bitField0_ = (bitField0_ & ~0x00000100);
  10526. }
  10527. result.extension_ = extension_;
  10528. } else {
  10529. result.extension_ = extensionBuilder_.build();
  10530. }
  10531. if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
  10532. to_bitField0_ |= 0x00000040;
  10533. }
  10534. result.description_ = description_;
  10535. if (((from_bitField0_ & 0x00000400) == 0x00000400)) {
  10536. to_bitField0_ |= 0x00000080;
  10537. }
  10538. result.keyRotationTime_ = keyRotationTime_;
  10539. result.bitField0_ = to_bitField0_;
  10540. onBuilt();
  10541. return result;
  10542. }
  10543. public Builder mergeFrom(com.google.protobuf.Message other) {
  10544. if (other instanceof org.bitcoinj.wallet.Protos.Wallet) {
  10545. return mergeFrom((org.bitcoinj.wallet.Protos.Wallet)other);
  10546. } else {
  10547. super.mergeFrom(other);
  10548. return this;
  10549. }
  10550. }
  10551. public Builder mergeFrom(org.bitcoinj.wallet.Protos.Wallet other) {
  10552. if (other == org.bitcoinj.wallet.Protos.Wallet.getDefaultInstance()) return this;
  10553. if (other.hasNetworkIdentifier()) {
  10554. bitField0_ |= 0x00000001;
  10555. networkIdentifier_ = other.networkIdentifier_;
  10556. onChanged();
  10557. }
  10558. if (other.hasLastSeenBlockHash()) {
  10559. setLastSeenBlockHash(other.getLastSeenBlockHash());
  10560. }
  10561. if (other.hasLastSeenBlockHeight()) {
  10562. setLastSeenBlockHeight(other.getLastSeenBlockHeight());
  10563. }
  10564. if (keyBuilder_ == null) {
  10565. if (!other.key_.isEmpty()) {
  10566. if (key_.isEmpty()) {
  10567. key_ = other.key_;
  10568. bitField0_ = (bitField0_ & ~0x00000008);
  10569. } else {
  10570. ensureKeyIsMutable();
  10571. key_.addAll(other.key_);
  10572. }
  10573. onChanged();
  10574. }
  10575. } else {
  10576. if (!other.key_.isEmpty()) {
  10577. if (keyBuilder_.isEmpty()) {
  10578. keyBuilder_.dispose();
  10579. keyBuilder_ = null;
  10580. key_ = other.key_;
  10581. bitField0_ = (bitField0_ & ~0x00000008);
  10582. keyBuilder_ =
  10583. com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
  10584. getKeyFieldBuilder() : null;
  10585. } else {
  10586. keyBuilder_.addAllMessages(other.key_);
  10587. }
  10588. }
  10589. }
  10590. if (transactionBuilder_ == null) {
  10591. if (!other.transaction_.isEmpty()) {
  10592. if (transaction_.isEmpty()) {
  10593. transaction_ = other.transaction_;
  10594. bitField0_ = (bitField0_ & ~0x00000010);
  10595. } else {
  10596. ensureTransactionIsMutable();
  10597. transaction_.addAll(other.transaction_);
  10598. }
  10599. onChanged();
  10600. }
  10601. } else {
  10602. if (!other.transaction_.isEmpty()) {
  10603. if (transactionBuilder_.isEmpty()) {
  10604. transactionBuilder_.dispose();
  10605. transactionBuilder_ = null;
  10606. transaction_ = other.transaction_;
  10607. bitField0_ = (bitField0_ & ~0x00000010);
  10608. transactionBuilder_ =
  10609. com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
  10610. getTransactionFieldBuilder() : null;
  10611. } else {
  10612. transactionBuilder_.addAllMessages(other.transaction_);
  10613. }
  10614. }
  10615. }
  10616. if (other.hasEncryptionType()) {
  10617. setEncryptionType(other.getEncryptionType());
  10618. }
  10619. if (other.hasEncryptionParameters()) {
  10620. mergeEncryptionParameters(other.getEncryptionParameters());
  10621. }
  10622. if (other.hasVersion()) {
  10623. setVersion(other.getVersion());
  10624. }
  10625. if (extensionBuilder_ == null) {
  10626. if (!other.extension_.isEmpty()) {
  10627. if (extension_.isEmpty()) {
  10628. extension_ = other.extension_;
  10629. bitField0_ = (bitField0_ & ~0x00000100);
  10630. } else {
  10631. ensureExtensionIsMutable();
  10632. extension_.addAll(other.extension_);
  10633. }
  10634. onChanged();
  10635. }
  10636. } else {
  10637. if (!other.extension_.isEmpty()) {
  10638. if (extensionBuilder_.isEmpty()) {
  10639. extensionBuilder_.dispose();
  10640. extensionBuilder_ = null;
  10641. extension_ = other.extension_;
  10642. bitField0_ = (bitField0_ & ~0x00000100);
  10643. extensionBuilder_ =
  10644. com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
  10645. getExtensionFieldBuilder() : null;
  10646. } else {
  10647. extensionBuilder_.addAllMessages(other.extension_);
  10648. }
  10649. }
  10650. }
  10651. if (other.hasDescription()) {
  10652. bitField0_ |= 0x00000200;
  10653. description_ = other.description_;
  10654. onChanged();
  10655. }
  10656. if (other.hasKeyRotationTime()) {
  10657. setKeyRotationTime(other.getKeyRotationTime());
  10658. }
  10659. this.mergeUnknownFields(other.getUnknownFields());
  10660. return this;
  10661. }
  10662. public final boolean isInitialized() {
  10663. if (!hasNetworkIdentifier()) {
  10664. return false;
  10665. }
  10666. for (int i = 0; i < getKeyCount(); i++) {
  10667. if (!getKey(i).isInitialized()) {
  10668. return false;
  10669. }
  10670. }
  10671. for (int i = 0; i < getTransactionCount(); i++) {
  10672. if (!getTransaction(i).isInitialized()) {
  10673. return false;
  10674. }
  10675. }
  10676. if (hasEncryptionParameters()) {
  10677. if (!getEncryptionParameters().isInitialized()) {
  10678. return false;
  10679. }
  10680. }
  10681. for (int i = 0; i < getExtensionCount(); i++) {
  10682. if (!getExtension(i).isInitialized()) {
  10683. return false;
  10684. }
  10685. }
  10686. return true;
  10687. }
  10688. public Builder mergeFrom(
  10689. com.google.protobuf.CodedInputStream input,
  10690. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  10691. throws java.io.IOException {
  10692. org.bitcoinj.wallet.Protos.Wallet parsedMessage = null;
  10693. try {
  10694. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  10695. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  10696. parsedMessage = (org.bitcoinj.wallet.Protos.Wallet) e.getUnfinishedMessage();
  10697. throw e;
  10698. } finally {
  10699. if (parsedMessage != null) {
  10700. mergeFrom(parsedMessage);
  10701. }
  10702. }
  10703. return this;
  10704. }
  10705. private int bitField0_;
  10706. // required string network_identifier = 1;
  10707. private java.lang.Object networkIdentifier_ = "";
  10708. /**
  10709. * <code>required string network_identifier = 1;</code>
  10710. *
  10711. * <pre>
  10712. * the network used by this wallet
  10713. * </pre>
  10714. */
  10715. public boolean hasNetworkIdentifier() {
  10716. return ((bitField0_ & 0x00000001) == 0x00000001);
  10717. }
  10718. /**
  10719. * <code>required string network_identifier = 1;</code>
  10720. *
  10721. * <pre>
  10722. * the network used by this wallet
  10723. * </pre>
  10724. */
  10725. public java.lang.String getNetworkIdentifier() {
  10726. java.lang.Object ref = networkIdentifier_;
  10727. if (!(ref instanceof java.lang.String)) {
  10728. java.lang.String s = ((com.google.protobuf.ByteString) ref)
  10729. .toStringUtf8();
  10730. networkIdentifier_ = s;
  10731. return s;
  10732. } else {
  10733. return (java.lang.String) ref;
  10734. }
  10735. }
  10736. /**
  10737. * <code>required string network_identifier = 1;</code>
  10738. *
  10739. * <pre>
  10740. * the network used by this wallet
  10741. * </pre>
  10742. */
  10743. public com.google.protobuf.ByteString
  10744. getNetworkIdentifierBytes() {
  10745. java.lang.Object ref = networkIdentifier_;
  10746. if (ref instanceof String) {
  10747. com.google.protobuf.ByteString b =
  10748. com.google.protobuf.ByteString.copyFromUtf8(
  10749. (java.lang.String) ref);
  10750. networkIdentifier_ = b;
  10751. return b;
  10752. } else {
  10753. return (com.google.protobuf.ByteString) ref;
  10754. }
  10755. }
  10756. /**
  10757. * <code>required string network_identifier = 1;</code>
  10758. *
  10759. * <pre>
  10760. * the network used by this wallet
  10761. * </pre>
  10762. */
  10763. public Builder setNetworkIdentifier(
  10764. java.lang.String value) {
  10765. if (value == null) {
  10766. throw new NullPointerException();
  10767. }
  10768. bitField0_ |= 0x00000001;
  10769. networkIdentifier_ = value;
  10770. onChanged();
  10771. return this;
  10772. }
  10773. /**
  10774. * <code>required string network_identifier = 1;</code>
  10775. *
  10776. * <pre>
  10777. * the network used by this wallet
  10778. * </pre>
  10779. */
  10780. public Builder clearNetworkIdentifier() {
  10781. bitField0_ = (bitField0_ & ~0x00000001);
  10782. networkIdentifier_ = getDefaultInstance().getNetworkIdentifier();
  10783. onChanged();
  10784. return this;
  10785. }
  10786. /**
  10787. * <code>required string network_identifier = 1;</code>
  10788. *
  10789. * <pre>
  10790. * the network used by this wallet
  10791. * </pre>
  10792. */
  10793. public Builder setNetworkIdentifierBytes(
  10794. com.google.protobuf.ByteString value) {
  10795. if (value == null) {
  10796. throw new NullPointerException();
  10797. }
  10798. bitField0_ |= 0x00000001;
  10799. networkIdentifier_ = value;
  10800. onChanged();
  10801. return this;
  10802. }
  10803. // optional bytes last_seen_block_hash = 2;
  10804. private com.google.protobuf.ByteString lastSeenBlockHash_ = com.google.protobuf.ByteString.EMPTY;
  10805. /**
  10806. * <code>optional bytes last_seen_block_hash = 2;</code>
  10807. *
  10808. * <pre>
  10809. * The SHA256 hash of the head of the best chain seen by this wallet.
  10810. * </pre>
  10811. */
  10812. public boolean hasLastSeenBlockHash() {
  10813. return ((bitField0_ & 0x00000002) == 0x00000002);
  10814. }
  10815. /**
  10816. * <code>optional bytes last_seen_block_hash = 2;</code>
  10817. *
  10818. * <pre>
  10819. * The SHA256 hash of the head of the best chain seen by this wallet.
  10820. * </pre>
  10821. */
  10822. public com.google.protobuf.ByteString getLastSeenBlockHash() {
  10823. return lastSeenBlockHash_;
  10824. }
  10825. /**
  10826. * <code>optional bytes last_seen_block_hash = 2;</code>
  10827. *
  10828. * <pre>
  10829. * The SHA256 hash of the head of the best chain seen by this wallet.
  10830. * </pre>
  10831. */
  10832. public Builder setLastSeenBlockHash(com.google.protobuf.ByteString value) {
  10833. if (value == null) {
  10834. throw new NullPointerException();
  10835. }
  10836. bitField0_ |= 0x00000002;
  10837. lastSeenBlockHash_ = value;
  10838. onChanged();
  10839. return this;
  10840. }
  10841. /**
  10842. * <code>optional bytes last_seen_block_hash = 2;</code>
  10843. *
  10844. * <pre>
  10845. * The SHA256 hash of the head of the best chain seen by this wallet.
  10846. * </pre>
  10847. */
  10848. public Builder clearLastSeenBlockHash() {
  10849. bitField0_ = (bitField0_ & ~0x00000002);
  10850. lastSeenBlockHash_ = getDefaultInstance().getLastSeenBlockHash();
  10851. onChanged();
  10852. return this;
  10853. }
  10854. // optional uint32 last_seen_block_height = 12;
  10855. private int lastSeenBlockHeight_ ;
  10856. /**
  10857. * <code>optional uint32 last_seen_block_height = 12;</code>
  10858. *
  10859. * <pre>
  10860. * The height in the chain of the last seen block.
  10861. * </pre>
  10862. */
  10863. public boolean hasLastSeenBlockHeight() {
  10864. return ((bitField0_ & 0x00000004) == 0x00000004);
  10865. }
  10866. /**
  10867. * <code>optional uint32 last_seen_block_height = 12;</code>
  10868. *
  10869. * <pre>
  10870. * The height in the chain of the last seen block.
  10871. * </pre>
  10872. */
  10873. public int getLastSeenBlockHeight() {
  10874. return lastSeenBlockHeight_;
  10875. }
  10876. /**
  10877. * <code>optional uint32 last_seen_block_height = 12;</code>
  10878. *
  10879. * <pre>
  10880. * The height in the chain of the last seen block.
  10881. * </pre>
  10882. */
  10883. public Builder setLastSeenBlockHeight(int value) {
  10884. bitField0_ |= 0x00000004;
  10885. lastSeenBlockHeight_ = value;
  10886. onChanged();
  10887. return this;
  10888. }
  10889. /**
  10890. * <code>optional uint32 last_seen_block_height = 12;</code>
  10891. *
  10892. * <pre>
  10893. * The height in the chain of the last seen block.
  10894. * </pre>
  10895. */
  10896. public Builder clearLastSeenBlockHeight() {
  10897. bitField0_ = (bitField0_ & ~0x00000004);
  10898. lastSeenBlockHeight_ = 0;
  10899. onChanged();
  10900. return this;
  10901. }
  10902. // repeated .wallet.Key key = 3;
  10903. private java.util.List<org.bitcoinj.wallet.Protos.Key> key_ =
  10904. java.util.Collections.emptyList();
  10905. private void ensureKeyIsMutable() {
  10906. if (!((bitField0_ & 0x00000008) == 0x00000008)) {
  10907. key_ = new java.util.ArrayList<org.bitcoinj.wallet.Protos.Key>(key_);
  10908. bitField0_ |= 0x00000008;
  10909. }
  10910. }
  10911. private com.google.protobuf.RepeatedFieldBuilder<
  10912. org.bitcoinj.wallet.Protos.Key, org.bitcoinj.wallet.Protos.Key.Builder, org.bitcoinj.wallet.Protos.KeyOrBuilder> keyBuilder_;
  10913. /**
  10914. * <code>repeated .wallet.Key key = 3;</code>
  10915. */
  10916. public java.util.List<org.bitcoinj.wallet.Protos.Key> getKeyList() {
  10917. if (keyBuilder_ == null) {
  10918. return java.util.Collections.unmodifiableList(key_);
  10919. } else {
  10920. return keyBuilder_.getMessageList();
  10921. }
  10922. }
  10923. /**
  10924. * <code>repeated .wallet.Key key = 3;</code>
  10925. */
  10926. public int getKeyCount() {
  10927. if (keyBuilder_ == null) {
  10928. return key_.size();
  10929. } else {
  10930. return keyBuilder_.getCount();
  10931. }
  10932. }
  10933. /**
  10934. * <code>repeated .wallet.Key key = 3;</code>
  10935. */
  10936. public org.bitcoinj.wallet.Protos.Key getKey(int index) {
  10937. if (keyBuilder_ == null) {
  10938. return key_.get(index);
  10939. } else {
  10940. return keyBuilder_.getMessage(index);
  10941. }
  10942. }
  10943. /**
  10944. * <code>repeated .wallet.Key key = 3;</code>
  10945. */
  10946. public Builder setKey(
  10947. int index, org.bitcoinj.wallet.Protos.Key value) {
  10948. if (keyBuilder_ == null) {
  10949. if (value == null) {
  10950. throw new NullPointerException();
  10951. }
  10952. ensureKeyIsMutable();
  10953. key_.set(index, value);
  10954. onChanged();
  10955. } else {
  10956. keyBuilder_.setMessage(index, value);
  10957. }
  10958. return this;
  10959. }
  10960. /**
  10961. * <code>repeated .wallet.Key key = 3;</code>
  10962. */
  10963. public Builder setKey(
  10964. int index, org.bitcoinj.wallet.Protos.Key.Builder builderForValue) {
  10965. if (keyBuilder_ == null) {
  10966. ensureKeyIsMutable();
  10967. key_.set(index, builderForValue.build());
  10968. onChanged();
  10969. } else {
  10970. keyBuilder_.setMessage(index, builderForValue.build());
  10971. }
  10972. return this;
  10973. }
  10974. /**
  10975. * <code>repeated .wallet.Key key = 3;</code>
  10976. */
  10977. public Builder addKey(org.bitcoinj.wallet.Protos.Key value) {
  10978. if (keyBuilder_ == null) {
  10979. if (value == null) {
  10980. throw new NullPointerException();
  10981. }
  10982. ensureKeyIsMutable();
  10983. key_.add(value);
  10984. onChanged();
  10985. } else {
  10986. keyBuilder_.addMessage(value);
  10987. }
  10988. return this;
  10989. }
  10990. /**
  10991. * <code>repeated .wallet.Key key = 3;</code>
  10992. */
  10993. public Builder addKey(
  10994. int index, org.bitcoinj.wallet.Protos.Key value) {
  10995. if (keyBuilder_ == null) {
  10996. if (value == null) {
  10997. throw new NullPointerException();
  10998. }
  10999. ensureKeyIsMutable();
  11000. key_.add(index, value);
  11001. onChanged();
  11002. } else {
  11003. keyBuilder_.addMessage(index, value);
  11004. }
  11005. return this;
  11006. }
  11007. /**
  11008. * <code>repeated .wallet.Key key = 3;</code>
  11009. */
  11010. public Builder addKey(
  11011. org.bitcoinj.wallet.Protos.Key.Builder builderForValue) {
  11012. if (keyBuilder_ == null) {
  11013. ensureKeyIsMutable();
  11014. key_.add(builderForValue.build());
  11015. onChanged();
  11016. } else {
  11017. keyBuilder_.addMessage(builderForValue.build());
  11018. }
  11019. return this;
  11020. }
  11021. /**
  11022. * <code>repeated .wallet.Key key = 3;</code>
  11023. */
  11024. public Builder addKey(
  11025. int index, org.bitcoinj.wallet.Protos.Key.Builder builderForValue) {
  11026. if (keyBuilder_ == null) {
  11027. ensureKeyIsMutable();
  11028. key_.add(index, builderForValue.build());
  11029. onChanged();
  11030. } else {
  11031. keyBuilder_.addMessage(index, builderForValue.build());
  11032. }
  11033. return this;
  11034. }
  11035. /**
  11036. * <code>repeated .wallet.Key key = 3;</code>
  11037. */
  11038. public Builder addAllKey(
  11039. java.lang.Iterable<? extends org.bitcoinj.wallet.Protos.Key> values) {
  11040. if (keyBuilder_ == null) {
  11041. ensureKeyIsMutable();
  11042. super.addAll(values, key_);
  11043. onChanged();
  11044. } else {
  11045. keyBuilder_.addAllMessages(values);
  11046. }
  11047. return this;
  11048. }
  11049. /**
  11050. * <code>repeated .wallet.Key key = 3;</code>
  11051. */
  11052. public Builder clearKey() {
  11053. if (keyBuilder_ == null) {
  11054. key_ = java.util.Collections.emptyList();
  11055. bitField0_ = (bitField0_ & ~0x00000008);
  11056. onChanged();
  11057. } else {
  11058. keyBuilder_.clear();
  11059. }
  11060. return this;
  11061. }
  11062. /**
  11063. * <code>repeated .wallet.Key key = 3;</code>
  11064. */
  11065. public Builder removeKey(int index) {
  11066. if (keyBuilder_ == null) {
  11067. ensureKeyIsMutable();
  11068. key_.remove(index);
  11069. onChanged();
  11070. } else {
  11071. keyBuilder_.remove(index);
  11072. }
  11073. return this;
  11074. }
  11075. /**
  11076. * <code>repeated .wallet.Key key = 3;</code>
  11077. */
  11078. public org.bitcoinj.wallet.Protos.Key.Builder getKeyBuilder(
  11079. int index) {
  11080. return getKeyFieldBuilder().getBuilder(index);
  11081. }
  11082. /**
  11083. * <code>repeated .wallet.Key key = 3;</code>
  11084. */
  11085. public org.bitcoinj.wallet.Protos.KeyOrBuilder getKeyOrBuilder(
  11086. int index) {
  11087. if (keyBuilder_ == null) {
  11088. return key_.get(index); } else {
  11089. return keyBuilder_.getMessageOrBuilder(index);
  11090. }
  11091. }
  11092. /**
  11093. * <code>repeated .wallet.Key key = 3;</code>
  11094. */
  11095. public java.util.List<? extends org.bitcoinj.wallet.Protos.KeyOrBuilder>
  11096. getKeyOrBuilderList() {
  11097. if (keyBuilder_ != null) {
  11098. return keyBuilder_.getMessageOrBuilderList();
  11099. } else {
  11100. return java.util.Collections.unmodifiableList(key_);
  11101. }
  11102. }
  11103. /**
  11104. * <code>repeated .wallet.Key key = 3;</code>
  11105. */
  11106. public org.bitcoinj.wallet.Protos.Key.Builder addKeyBuilder() {
  11107. return getKeyFieldBuilder().addBuilder(
  11108. org.bitcoinj.wallet.Protos.Key.getDefaultInstance());
  11109. }
  11110. /**
  11111. * <code>repeated .wallet.Key key = 3;</code>
  11112. */
  11113. public org.bitcoinj.wallet.Protos.Key.Builder addKeyBuilder(
  11114. int index) {
  11115. return getKeyFieldBuilder().addBuilder(
  11116. index, org.bitcoinj.wallet.Protos.Key.getDefaultInstance());
  11117. }
  11118. /**
  11119. * <code>repeated .wallet.Key key = 3;</code>
  11120. */
  11121. public java.util.List<org.bitcoinj.wallet.Protos.Key.Builder>
  11122. getKeyBuilderList() {
  11123. return getKeyFieldBuilder().getBuilderList();
  11124. }
  11125. private com.google.protobuf.RepeatedFieldBuilder<
  11126. org.bitcoinj.wallet.Protos.Key, org.bitcoinj.wallet.Protos.Key.Builder, org.bitcoinj.wallet.Protos.KeyOrBuilder>
  11127. getKeyFieldBuilder() {
  11128. if (keyBuilder_ == null) {
  11129. keyBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
  11130. org.bitcoinj.wallet.Protos.Key, org.bitcoinj.wallet.Protos.Key.Builder, org.bitcoinj.wallet.Protos.KeyOrBuilder>(
  11131. key_,
  11132. ((bitField0_ & 0x00000008) == 0x00000008),
  11133. getParentForChildren(),
  11134. isClean());
  11135. key_ = null;
  11136. }
  11137. return keyBuilder_;
  11138. }
  11139. // repeated .wallet.Transaction transaction = 4;
  11140. private java.util.List<org.bitcoinj.wallet.Protos.Transaction> transaction_ =
  11141. java.util.Collections.emptyList();
  11142. private void ensureTransactionIsMutable() {
  11143. if (!((bitField0_ & 0x00000010) == 0x00000010)) {
  11144. transaction_ = new java.util.ArrayList<org.bitcoinj.wallet.Protos.Transaction>(transaction_);
  11145. bitField0_ |= 0x00000010;
  11146. }
  11147. }
  11148. private com.google.protobuf.RepeatedFieldBuilder<
  11149. org.bitcoinj.wallet.Protos.Transaction, org.bitcoinj.wallet.Protos.Transaction.Builder, org.bitcoinj.wallet.Protos.TransactionOrBuilder> transactionBuilder_;
  11150. /**
  11151. * <code>repeated .wallet.Transaction transaction = 4;</code>
  11152. */
  11153. public java.util.List<org.bitcoinj.wallet.Protos.Transaction> getTransactionList() {
  11154. if (transactionBuilder_ == null) {
  11155. return java.util.Collections.unmodifiableList(transaction_);
  11156. } else {
  11157. return transactionBuilder_.getMessageList();
  11158. }
  11159. }
  11160. /**
  11161. * <code>repeated .wallet.Transaction transaction = 4;</code>
  11162. */
  11163. public int getTransactionCount() {
  11164. if (transactionBuilder_ == null) {
  11165. return transaction_.size();
  11166. } else {
  11167. return transactionBuilder_.getCount();
  11168. }
  11169. }
  11170. /**
  11171. * <code>repeated .wallet.Transaction transaction = 4;</code>
  11172. */
  11173. public org.bitcoinj.wallet.Protos.Transaction getTransaction(int index) {
  11174. if (transactionBuilder_ == null) {
  11175. return transaction_.get(index);
  11176. } else {
  11177. return transactionBuilder_.getMessage(index);
  11178. }
  11179. }
  11180. /**
  11181. * <code>repeated .wallet.Transaction transaction = 4;</code>
  11182. */
  11183. public Builder setTransaction(
  11184. int index, org.bitcoinj.wallet.Protos.Transaction value) {
  11185. if (transactionBuilder_ == null) {
  11186. if (value == null) {
  11187. throw new NullPointerException();
  11188. }
  11189. ensureTransactionIsMutable();
  11190. transaction_.set(index, value);
  11191. onChanged();
  11192. } else {
  11193. transactionBuilder_.setMessage(index, value);
  11194. }
  11195. return this;
  11196. }
  11197. /**
  11198. * <code>repeated .wallet.Transaction transaction = 4;</code>
  11199. */
  11200. public Builder setTransaction(
  11201. int index, org.bitcoinj.wallet.Protos.Transaction.Builder builderForValue) {
  11202. if (transactionBuilder_ == null) {
  11203. ensureTransactionIsMutable();
  11204. transaction_.set(index, builderForValue.build());
  11205. onChanged();
  11206. } else {
  11207. transactionBuilder_.setMessage(index, builderForValue.build());
  11208. }
  11209. return this;
  11210. }
  11211. /**
  11212. * <code>repeated .wallet.Transaction transaction = 4;</code>
  11213. */
  11214. public Builder addTransaction(org.bitcoinj.wallet.Protos.Transaction value) {
  11215. if (transactionBuilder_ == null) {
  11216. if (value == null) {
  11217. throw new NullPointerException();
  11218. }
  11219. ensureTransactionIsMutable();
  11220. transaction_.add(value);
  11221. onChanged();
  11222. } else {
  11223. transactionBuilder_.addMessage(value);
  11224. }
  11225. return this;
  11226. }
  11227. /**
  11228. * <code>repeated .wallet.Transaction transaction = 4;</code>
  11229. */
  11230. public Builder addTransaction(
  11231. int index, org.bitcoinj.wallet.Protos.Transaction value) {
  11232. if (transactionBuilder_ == null) {
  11233. if (value == null) {
  11234. throw new NullPointerException();
  11235. }
  11236. ensureTransactionIsMutable();
  11237. transaction_.add(index, value);
  11238. onChanged();
  11239. } else {
  11240. transactionBuilder_.addMessage(index, value);
  11241. }
  11242. return this;
  11243. }
  11244. /**
  11245. * <code>repeated .wallet.Transaction transaction = 4;</code>
  11246. */
  11247. public Builder addTransaction(
  11248. org.bitcoinj.wallet.Protos.Transaction.Builder builderForValue) {
  11249. if (transactionBuilder_ == null) {
  11250. ensureTransactionIsMutable();
  11251. transaction_.add(builderForValue.build());
  11252. onChanged();
  11253. } else {
  11254. transactionBuilder_.addMessage(builderForValue.build());
  11255. }
  11256. return this;
  11257. }
  11258. /**
  11259. * <code>repeated .wallet.Transaction transaction = 4;</code>
  11260. */
  11261. public Builder addTransaction(
  11262. int index, org.bitcoinj.wallet.Protos.Transaction.Builder builderForValue) {
  11263. if (transactionBuilder_ == null) {
  11264. ensureTransactionIsMutable();
  11265. transaction_.add(index, builderForValue.build());
  11266. onChanged();
  11267. } else {
  11268. transactionBuilder_.addMessage(index, builderForValue.build());
  11269. }
  11270. return this;
  11271. }
  11272. /**
  11273. * <code>repeated .wallet.Transaction transaction = 4;</code>
  11274. */
  11275. public Builder addAllTransaction(
  11276. java.lang.Iterable<? extends org.bitcoinj.wallet.Protos.Transaction> values) {
  11277. if (transactionBuilder_ == null) {
  11278. ensureTransactionIsMutable();
  11279. super.addAll(values, transaction_);
  11280. onChanged();
  11281. } else {
  11282. transactionBuilder_.addAllMessages(values);
  11283. }
  11284. return this;
  11285. }
  11286. /**
  11287. * <code>repeated .wallet.Transaction transaction = 4;</code>
  11288. */
  11289. public Builder clearTransaction() {
  11290. if (transactionBuilder_ == null) {
  11291. transaction_ = java.util.Collections.emptyList();
  11292. bitField0_ = (bitField0_ & ~0x00000010);
  11293. onChanged();
  11294. } else {
  11295. transactionBuilder_.clear();
  11296. }
  11297. return this;
  11298. }
  11299. /**
  11300. * <code>repeated .wallet.Transaction transaction = 4;</code>
  11301. */
  11302. public Builder removeTransaction(int index) {
  11303. if (transactionBuilder_ == null) {
  11304. ensureTransactionIsMutable();
  11305. transaction_.remove(index);
  11306. onChanged();
  11307. } else {
  11308. transactionBuilder_.remove(index);
  11309. }
  11310. return this;
  11311. }
  11312. /**
  11313. * <code>repeated .wallet.Transaction transaction = 4;</code>
  11314. */
  11315. public org.bitcoinj.wallet.Protos.Transaction.Builder getTransactionBuilder(
  11316. int index) {
  11317. return getTransactionFieldBuilder().getBuilder(index);
  11318. }
  11319. /**
  11320. * <code>repeated .wallet.Transaction transaction = 4;</code>
  11321. */
  11322. public org.bitcoinj.wallet.Protos.TransactionOrBuilder getTransactionOrBuilder(
  11323. int index) {
  11324. if (transactionBuilder_ == null) {
  11325. return transaction_.get(index); } else {
  11326. return transactionBuilder_.getMessageOrBuilder(index);
  11327. }
  11328. }
  11329. /**
  11330. * <code>repeated .wallet.Transaction transaction = 4;</code>
  11331. */
  11332. public java.util.List<? extends org.bitcoinj.wallet.Protos.TransactionOrBuilder>
  11333. getTransactionOrBuilderList() {
  11334. if (transactionBuilder_ != null) {
  11335. return transactionBuilder_.getMessageOrBuilderList();
  11336. } else {
  11337. return java.util.Collections.unmodifiableList(transaction_);
  11338. }
  11339. }
  11340. /**
  11341. * <code>repeated .wallet.Transaction transaction = 4;</code>
  11342. */
  11343. public org.bitcoinj.wallet.Protos.Transaction.Builder addTransactionBuilder() {
  11344. return getTransactionFieldBuilder().addBuilder(
  11345. org.bitcoinj.wallet.Protos.Transaction.getDefaultInstance());
  11346. }
  11347. /**
  11348. * <code>repeated .wallet.Transaction transaction = 4;</code>
  11349. */
  11350. public org.bitcoinj.wallet.Protos.Transaction.Builder addTransactionBuilder(
  11351. int index) {
  11352. return getTransactionFieldBuilder().addBuilder(
  11353. index, org.bitcoinj.wallet.Protos.Transaction.getDefaultInstance());
  11354. }
  11355. /**
  11356. * <code>repeated .wallet.Transaction transaction = 4;</code>
  11357. */
  11358. public java.util.List<org.bitcoinj.wallet.Protos.Transaction.Builder>
  11359. getTransactionBuilderList() {
  11360. return getTransactionFieldBuilder().getBuilderList();
  11361. }
  11362. private com.google.protobuf.RepeatedFieldBuilder<
  11363. org.bitcoinj.wallet.Protos.Transaction, org.bitcoinj.wallet.Protos.Transaction.Builder, org.bitcoinj.wallet.Protos.TransactionOrBuilder>
  11364. getTransactionFieldBuilder() {
  11365. if (transactionBuilder_ == null) {
  11366. transactionBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
  11367. org.bitcoinj.wallet.Protos.Transaction, org.bitcoinj.wallet.Protos.Transaction.Builder, org.bitcoinj.wallet.Protos.TransactionOrBuilder>(
  11368. transaction_,
  11369. ((bitField0_ & 0x00000010) == 0x00000010),
  11370. getParentForChildren(),
  11371. isClean());
  11372. transaction_ = null;
  11373. }
  11374. return transactionBuilder_;
  11375. }
  11376. // optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED];
  11377. private org.bitcoinj.wallet.Protos.Wallet.EncryptionType encryptionType_ = org.bitcoinj.wallet.Protos.Wallet.EncryptionType.UNENCRYPTED;
  11378. /**
  11379. * <code>optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED];</code>
  11380. */
  11381. public boolean hasEncryptionType() {
  11382. return ((bitField0_ & 0x00000020) == 0x00000020);
  11383. }
  11384. /**
  11385. * <code>optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED];</code>
  11386. */
  11387. public org.bitcoinj.wallet.Protos.Wallet.EncryptionType getEncryptionType() {
  11388. return encryptionType_;
  11389. }
  11390. /**
  11391. * <code>optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED];</code>
  11392. */
  11393. public Builder setEncryptionType(org.bitcoinj.wallet.Protos.Wallet.EncryptionType value) {
  11394. if (value == null) {
  11395. throw new NullPointerException();
  11396. }
  11397. bitField0_ |= 0x00000020;
  11398. encryptionType_ = value;
  11399. onChanged();
  11400. return this;
  11401. }
  11402. /**
  11403. * <code>optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED];</code>
  11404. */
  11405. public Builder clearEncryptionType() {
  11406. bitField0_ = (bitField0_ & ~0x00000020);
  11407. encryptionType_ = org.bitcoinj.wallet.Protos.Wallet.EncryptionType.UNENCRYPTED;
  11408. onChanged();
  11409. return this;
  11410. }
  11411. // optional .wallet.ScryptParameters encryption_parameters = 6;
  11412. private org.bitcoinj.wallet.Protos.ScryptParameters encryptionParameters_ = org.bitcoinj.wallet.Protos.ScryptParameters.getDefaultInstance();
  11413. private com.google.protobuf.SingleFieldBuilder<
  11414. org.bitcoinj.wallet.Protos.ScryptParameters, org.bitcoinj.wallet.Protos.ScryptParameters.Builder, org.bitcoinj.wallet.Protos.ScryptParametersOrBuilder> encryptionParametersBuilder_;
  11415. /**
  11416. * <code>optional .wallet.ScryptParameters encryption_parameters = 6;</code>
  11417. */
  11418. public boolean hasEncryptionParameters() {
  11419. return ((bitField0_ & 0x00000040) == 0x00000040);
  11420. }
  11421. /**
  11422. * <code>optional .wallet.ScryptParameters encryption_parameters = 6;</code>
  11423. */
  11424. public org.bitcoinj.wallet.Protos.ScryptParameters getEncryptionParameters() {
  11425. if (encryptionParametersBuilder_ == null) {
  11426. return encryptionParameters_;
  11427. } else {
  11428. return encryptionParametersBuilder_.getMessage();
  11429. }
  11430. }
  11431. /**
  11432. * <code>optional .wallet.ScryptParameters encryption_parameters = 6;</code>
  11433. */
  11434. public Builder setEncryptionParameters(org.bitcoinj.wallet.Protos.ScryptParameters value) {
  11435. if (encryptionParametersBuilder_ == null) {
  11436. if (value == null) {
  11437. throw new NullPointerException();
  11438. }
  11439. encryptionParameters_ = value;
  11440. onChanged();
  11441. } else {
  11442. encryptionParametersBuilder_.setMessage(value);
  11443. }
  11444. bitField0_ |= 0x00000040;
  11445. return this;
  11446. }
  11447. /**
  11448. * <code>optional .wallet.ScryptParameters encryption_parameters = 6;</code>
  11449. */
  11450. public Builder setEncryptionParameters(
  11451. org.bitcoinj.wallet.Protos.ScryptParameters.Builder builderForValue) {
  11452. if (encryptionParametersBuilder_ == null) {
  11453. encryptionParameters_ = builderForValue.build();
  11454. onChanged();
  11455. } else {
  11456. encryptionParametersBuilder_.setMessage(builderForValue.build());
  11457. }
  11458. bitField0_ |= 0x00000040;
  11459. return this;
  11460. }
  11461. /**
  11462. * <code>optional .wallet.ScryptParameters encryption_parameters = 6;</code>
  11463. */
  11464. public Builder mergeEncryptionParameters(org.bitcoinj.wallet.Protos.ScryptParameters value) {
  11465. if (encryptionParametersBuilder_ == null) {
  11466. if (((bitField0_ & 0x00000040) == 0x00000040) &&
  11467. encryptionParameters_ != org.bitcoinj.wallet.Protos.ScryptParameters.getDefaultInstance()) {
  11468. encryptionParameters_ =
  11469. org.bitcoinj.wallet.Protos.ScryptParameters.newBuilder(encryptionParameters_).mergeFrom(value).buildPartial();
  11470. } else {
  11471. encryptionParameters_ = value;
  11472. }
  11473. onChanged();
  11474. } else {
  11475. encryptionParametersBuilder_.mergeFrom(value);
  11476. }
  11477. bitField0_ |= 0x00000040;
  11478. return this;
  11479. }
  11480. /**
  11481. * <code>optional .wallet.ScryptParameters encryption_parameters = 6;</code>
  11482. */
  11483. public Builder clearEncryptionParameters() {
  11484. if (encryptionParametersBuilder_ == null) {
  11485. encryptionParameters_ = org.bitcoinj.wallet.Protos.ScryptParameters.getDefaultInstance();
  11486. onChanged();
  11487. } else {
  11488. encryptionParametersBuilder_.clear();
  11489. }
  11490. bitField0_ = (bitField0_ & ~0x00000040);
  11491. return this;
  11492. }
  11493. /**
  11494. * <code>optional .wallet.ScryptParameters encryption_parameters = 6;</code>
  11495. */
  11496. public org.bitcoinj.wallet.Protos.ScryptParameters.Builder getEncryptionParametersBuilder() {
  11497. bitField0_ |= 0x00000040;
  11498. onChanged();
  11499. return getEncryptionParametersFieldBuilder().getBuilder();
  11500. }
  11501. /**
  11502. * <code>optional .wallet.ScryptParameters encryption_parameters = 6;</code>
  11503. */
  11504. public org.bitcoinj.wallet.Protos.ScryptParametersOrBuilder getEncryptionParametersOrBuilder() {
  11505. if (encryptionParametersBuilder_ != null) {
  11506. return encryptionParametersBuilder_.getMessageOrBuilder();
  11507. } else {
  11508. return encryptionParameters_;
  11509. }
  11510. }
  11511. /**
  11512. * <code>optional .wallet.ScryptParameters encryption_parameters = 6;</code>
  11513. */
  11514. private com.google.protobuf.SingleFieldBuilder<
  11515. org.bitcoinj.wallet.Protos.ScryptParameters, org.bitcoinj.wallet.Protos.ScryptParameters.Builder, org.bitcoinj.wallet.Protos.ScryptParametersOrBuilder>
  11516. getEncryptionParametersFieldBuilder() {
  11517. if (encryptionParametersBuilder_ == null) {
  11518. encryptionParametersBuilder_ = new com.google.protobuf.SingleFieldBuilder<
  11519. org.bitcoinj.wallet.Protos.ScryptParameters, org.bitcoinj.wallet.Protos.ScryptParameters.Builder, org.bitcoinj.wallet.Protos.ScryptParametersOrBuilder>(
  11520. encryptionParameters_,
  11521. getParentForChildren(),
  11522. isClean());
  11523. encryptionParameters_ = null;
  11524. }
  11525. return encryptionParametersBuilder_;
  11526. }
  11527. // optional int32 version = 7;
  11528. private int version_ ;
  11529. /**
  11530. * <code>optional int32 version = 7;</code>
  11531. *
  11532. * <pre>
  11533. * The version number of the wallet - used to detect wallets that were produced in the future
  11534. * (i.e the wallet may contain some future format this protobuf/ code does not know about)
  11535. * </pre>
  11536. */
  11537. public boolean hasVersion() {
  11538. return ((bitField0_ & 0x00000080) == 0x00000080);
  11539. }
  11540. /**
  11541. * <code>optional int32 version = 7;</code>
  11542. *
  11543. * <pre>
  11544. * The version number of the wallet - used to detect wallets that were produced in the future
  11545. * (i.e the wallet may contain some future format this protobuf/ code does not know about)
  11546. * </pre>
  11547. */
  11548. public int getVersion() {
  11549. return version_;
  11550. }
  11551. /**
  11552. * <code>optional int32 version = 7;</code>
  11553. *
  11554. * <pre>
  11555. * The version number of the wallet - used to detect wallets that were produced in the future
  11556. * (i.e the wallet may contain some future format this protobuf/ code does not know about)
  11557. * </pre>
  11558. */
  11559. public Builder setVersion(int value) {
  11560. bitField0_ |= 0x00000080;
  11561. version_ = value;
  11562. onChanged();
  11563. return this;
  11564. }
  11565. /**
  11566. * <code>optional int32 version = 7;</code>
  11567. *
  11568. * <pre>
  11569. * The version number of the wallet - used to detect wallets that were produced in the future
  11570. * (i.e the wallet may contain some future format this protobuf/ code does not know about)
  11571. * </pre>
  11572. */
  11573. public Builder clearVersion() {
  11574. bitField0_ = (bitField0_ & ~0x00000080);
  11575. version_ = 0;
  11576. onChanged();
  11577. return this;
  11578. }
  11579. // repeated .wallet.Extension extension = 10;
  11580. private java.util.List<org.bitcoinj.wallet.Protos.Extension> extension_ =
  11581. java.util.Collections.emptyList();
  11582. private void ensureExtensionIsMutable() {
  11583. if (!((bitField0_ & 0x00000100) == 0x00000100)) {
  11584. extension_ = new java.util.ArrayList<org.bitcoinj.wallet.Protos.Extension>(extension_);
  11585. bitField0_ |= 0x00000100;
  11586. }
  11587. }
  11588. private com.google.protobuf.RepeatedFieldBuilder<
  11589. org.bitcoinj.wallet.Protos.Extension, org.bitcoinj.wallet.Protos.Extension.Builder, org.bitcoinj.wallet.Protos.ExtensionOrBuilder> extensionBuilder_;
  11590. /**
  11591. * <code>repeated .wallet.Extension extension = 10;</code>
  11592. */
  11593. public java.util.List<org.bitcoinj.wallet.Protos.Extension> getExtensionList() {
  11594. if (extensionBuilder_ == null) {
  11595. return java.util.Collections.unmodifiableList(extension_);
  11596. } else {
  11597. return extensionBuilder_.getMessageList();
  11598. }
  11599. }
  11600. /**
  11601. * <code>repeated .wallet.Extension extension = 10;</code>
  11602. */
  11603. public int getExtensionCount() {
  11604. if (extensionBuilder_ == null) {
  11605. return extension_.size();
  11606. } else {
  11607. return extensionBuilder_.getCount();
  11608. }
  11609. }
  11610. /**
  11611. * <code>repeated .wallet.Extension extension = 10;</code>
  11612. */
  11613. public org.bitcoinj.wallet.Protos.Extension getExtension(int index) {
  11614. if (extensionBuilder_ == null) {
  11615. return extension_.get(index);
  11616. } else {
  11617. return extensionBuilder_.getMessage(index);
  11618. }
  11619. }
  11620. /**
  11621. * <code>repeated .wallet.Extension extension = 10;</code>
  11622. */
  11623. public Builder setExtension(
  11624. int index, org.bitcoinj.wallet.Protos.Extension value) {
  11625. if (extensionBuilder_ == null) {
  11626. if (value == null) {
  11627. throw new NullPointerException();
  11628. }
  11629. ensureExtensionIsMutable();
  11630. extension_.set(index, value);
  11631. onChanged();
  11632. } else {
  11633. extensionBuilder_.setMessage(index, value);
  11634. }
  11635. return this;
  11636. }
  11637. /**
  11638. * <code>repeated .wallet.Extension extension = 10;</code>
  11639. */
  11640. public Builder setExtension(
  11641. int index, org.bitcoinj.wallet.Protos.Extension.Builder builderForValue) {
  11642. if (extensionBuilder_ == null) {
  11643. ensureExtensionIsMutable();
  11644. extension_.set(index, builderForValue.build());
  11645. onChanged();
  11646. } else {
  11647. extensionBuilder_.setMessage(index, builderForValue.build());
  11648. }
  11649. return this;
  11650. }
  11651. /**
  11652. * <code>repeated .wallet.Extension extension = 10;</code>
  11653. */
  11654. public Builder addExtension(org.bitcoinj.wallet.Protos.Extension value) {
  11655. if (extensionBuilder_ == null) {
  11656. if (value == null) {
  11657. throw new NullPointerException();
  11658. }
  11659. ensureExtensionIsMutable();
  11660. extension_.add(value);
  11661. onChanged();
  11662. } else {
  11663. extensionBuilder_.addMessage(value);
  11664. }
  11665. return this;
  11666. }
  11667. /**
  11668. * <code>repeated .wallet.Extension extension = 10;</code>
  11669. */
  11670. public Builder addExtension(
  11671. int index, org.bitcoinj.wallet.Protos.Extension value) {
  11672. if (extensionBuilder_ == null) {
  11673. if (value == null) {
  11674. throw new NullPointerException();
  11675. }
  11676. ensureExtensionIsMutable();
  11677. extension_.add(index, value);
  11678. onChanged();
  11679. } else {
  11680. extensionBuilder_.addMessage(index, value);
  11681. }
  11682. return this;
  11683. }
  11684. /**
  11685. * <code>repeated .wallet.Extension extension = 10;</code>
  11686. */
  11687. public Builder addExtension(
  11688. org.bitcoinj.wallet.Protos.Extension.Builder builderForValue) {
  11689. if (extensionBuilder_ == null) {
  11690. ensureExtensionIsMutable();
  11691. extension_.add(builderForValue.build());
  11692. onChanged();
  11693. } else {
  11694. extensionBuilder_.addMessage(builderForValue.build());
  11695. }
  11696. return this;
  11697. }
  11698. /**
  11699. * <code>repeated .wallet.Extension extension = 10;</code>
  11700. */
  11701. public Builder addExtension(
  11702. int index, org.bitcoinj.wallet.Protos.Extension.Builder builderForValue) {
  11703. if (extensionBuilder_ == null) {
  11704. ensureExtensionIsMutable();
  11705. extension_.add(index, builderForValue.build());
  11706. onChanged();
  11707. } else {
  11708. extensionBuilder_.addMessage(index, builderForValue.build());
  11709. }
  11710. return this;
  11711. }
  11712. /**
  11713. * <code>repeated .wallet.Extension extension = 10;</code>
  11714. */
  11715. public Builder addAllExtension(
  11716. java.lang.Iterable<? extends org.bitcoinj.wallet.Protos.Extension> values) {
  11717. if (extensionBuilder_ == null) {
  11718. ensureExtensionIsMutable();
  11719. super.addAll(values, extension_);
  11720. onChanged();
  11721. } else {
  11722. extensionBuilder_.addAllMessages(values);
  11723. }
  11724. return this;
  11725. }
  11726. /**
  11727. * <code>repeated .wallet.Extension extension = 10;</code>
  11728. */
  11729. public Builder clearExtension() {
  11730. if (extensionBuilder_ == null) {
  11731. extension_ = java.util.Collections.emptyList();
  11732. bitField0_ = (bitField0_ & ~0x00000100);
  11733. onChanged();
  11734. } else {
  11735. extensionBuilder_.clear();
  11736. }
  11737. return this;
  11738. }
  11739. /**
  11740. * <code>repeated .wallet.Extension extension = 10;</code>
  11741. */
  11742. public Builder removeExtension(int index) {
  11743. if (extensionBuilder_ == null) {
  11744. ensureExtensionIsMutable();
  11745. extension_.remove(index);
  11746. onChanged();
  11747. } else {
  11748. extensionBuilder_.remove(index);
  11749. }
  11750. return this;
  11751. }
  11752. /**
  11753. * <code>repeated .wallet.Extension extension = 10;</code>
  11754. */
  11755. public org.bitcoinj.wallet.Protos.Extension.Builder getExtensionBuilder(
  11756. int index) {
  11757. return getExtensionFieldBuilder().getBuilder(index);
  11758. }
  11759. /**
  11760. * <code>repeated .wallet.Extension extension = 10;</code>
  11761. */
  11762. public org.bitcoinj.wallet.Protos.ExtensionOrBuilder getExtensionOrBuilder(
  11763. int index) {
  11764. if (extensionBuilder_ == null) {
  11765. return extension_.get(index); } else {
  11766. return extensionBuilder_.getMessageOrBuilder(index);
  11767. }
  11768. }
  11769. /**
  11770. * <code>repeated .wallet.Extension extension = 10;</code>
  11771. */
  11772. public java.util.List<? extends org.bitcoinj.wallet.Protos.ExtensionOrBuilder>
  11773. getExtensionOrBuilderList() {
  11774. if (extensionBuilder_ != null) {
  11775. return extensionBuilder_.getMessageOrBuilderList();
  11776. } else {
  11777. return java.util.Collections.unmodifiableList(extension_);
  11778. }
  11779. }
  11780. /**
  11781. * <code>repeated .wallet.Extension extension = 10;</code>
  11782. */
  11783. public org.bitcoinj.wallet.Protos.Extension.Builder addExtensionBuilder() {
  11784. return getExtensionFieldBuilder().addBuilder(
  11785. org.bitcoinj.wallet.Protos.Extension.getDefaultInstance());
  11786. }
  11787. /**
  11788. * <code>repeated .wallet.Extension extension = 10;</code>
  11789. */
  11790. public org.bitcoinj.wallet.Protos.Extension.Builder addExtensionBuilder(
  11791. int index) {
  11792. return getExtensionFieldBuilder().addBuilder(
  11793. index, org.bitcoinj.wallet.Protos.Extension.getDefaultInstance());
  11794. }
  11795. /**
  11796. * <code>repeated .wallet.Extension extension = 10;</code>
  11797. */
  11798. public java.util.List<org.bitcoinj.wallet.Protos.Extension.Builder>
  11799. getExtensionBuilderList() {
  11800. return getExtensionFieldBuilder().getBuilderList();
  11801. }
  11802. private com.google.protobuf.RepeatedFieldBuilder<
  11803. org.bitcoinj.wallet.Protos.Extension, org.bitcoinj.wallet.Protos.Extension.Builder, org.bitcoinj.wallet.Protos.ExtensionOrBuilder>
  11804. getExtensionFieldBuilder() {
  11805. if (extensionBuilder_ == null) {
  11806. extensionBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
  11807. org.bitcoinj.wallet.Protos.Extension, org.bitcoinj.wallet.Protos.Extension.Builder, org.bitcoinj.wallet.Protos.ExtensionOrBuilder>(
  11808. extension_,
  11809. ((bitField0_ & 0x00000100) == 0x00000100),
  11810. getParentForChildren(),
  11811. isClean());
  11812. extension_ = null;
  11813. }
  11814. return extensionBuilder_;
  11815. }
  11816. // optional string description = 11;
  11817. private java.lang.Object description_ = "";
  11818. /**
  11819. * <code>optional string description = 11;</code>
  11820. *
  11821. * <pre>
  11822. * A UTF8 encoded text description of the wallet that is intended for end user provided text.
  11823. * </pre>
  11824. */
  11825. public boolean hasDescription() {
  11826. return ((bitField0_ & 0x00000200) == 0x00000200);
  11827. }
  11828. /**
  11829. * <code>optional string description = 11;</code>
  11830. *
  11831. * <pre>
  11832. * A UTF8 encoded text description of the wallet that is intended for end user provided text.
  11833. * </pre>
  11834. */
  11835. public java.lang.String getDescription() {
  11836. java.lang.Object ref = description_;
  11837. if (!(ref instanceof java.lang.String)) {
  11838. java.lang.String s = ((com.google.protobuf.ByteString) ref)
  11839. .toStringUtf8();
  11840. description_ = s;
  11841. return s;
  11842. } else {
  11843. return (java.lang.String) ref;
  11844. }
  11845. }
  11846. /**
  11847. * <code>optional string description = 11;</code>
  11848. *
  11849. * <pre>
  11850. * A UTF8 encoded text description of the wallet that is intended for end user provided text.
  11851. * </pre>
  11852. */
  11853. public com.google.protobuf.ByteString
  11854. getDescriptionBytes() {
  11855. java.lang.Object ref = description_;
  11856. if (ref instanceof String) {
  11857. com.google.protobuf.ByteString b =
  11858. com.google.protobuf.ByteString.copyFromUtf8(
  11859. (java.lang.String) ref);
  11860. description_ = b;
  11861. return b;
  11862. } else {
  11863. return (com.google.protobuf.ByteString) ref;
  11864. }
  11865. }
  11866. /**
  11867. * <code>optional string description = 11;</code>
  11868. *
  11869. * <pre>
  11870. * A UTF8 encoded text description of the wallet that is intended for end user provided text.
  11871. * </pre>
  11872. */
  11873. public Builder setDescription(
  11874. java.lang.String value) {
  11875. if (value == null) {
  11876. throw new NullPointerException();
  11877. }
  11878. bitField0_ |= 0x00000200;
  11879. description_ = value;
  11880. onChanged();
  11881. return this;
  11882. }
  11883. /**
  11884. * <code>optional string description = 11;</code>
  11885. *
  11886. * <pre>
  11887. * A UTF8 encoded text description of the wallet that is intended for end user provided text.
  11888. * </pre>
  11889. */
  11890. public Builder clearDescription() {
  11891. bitField0_ = (bitField0_ & ~0x00000200);
  11892. description_ = getDefaultInstance().getDescription();
  11893. onChanged();
  11894. return this;
  11895. }
  11896. /**
  11897. * <code>optional string description = 11;</code>
  11898. *
  11899. * <pre>
  11900. * A UTF8 encoded text description of the wallet that is intended for end user provided text.
  11901. * </pre>
  11902. */
  11903. public Builder setDescriptionBytes(
  11904. com.google.protobuf.ByteString value) {
  11905. if (value == null) {
  11906. throw new NullPointerException();
  11907. }
  11908. bitField0_ |= 0x00000200;
  11909. description_ = value;
  11910. onChanged();
  11911. return this;
  11912. }
  11913. // optional uint64 key_rotation_time = 13;
  11914. private long keyRotationTime_ ;
  11915. /**
  11916. * <code>optional uint64 key_rotation_time = 13;</code>
  11917. *
  11918. * <pre>
  11919. * UNIX time in seconds since the epoch. If set, then any keys created before this date are assumed to be no longer
  11920. * wanted. Money sent to them will be re-spent automatically to the first key that was created after this time. It
  11921. * can be used to recover a compromised wallet, or just as part of preventative defence-in-depth measures.
  11922. * </pre>
  11923. */
  11924. public boolean hasKeyRotationTime() {
  11925. return ((bitField0_ & 0x00000400) == 0x00000400);
  11926. }
  11927. /**
  11928. * <code>optional uint64 key_rotation_time = 13;</code>
  11929. *
  11930. * <pre>
  11931. * UNIX time in seconds since the epoch. If set, then any keys created before this date are assumed to be no longer
  11932. * wanted. Money sent to them will be re-spent automatically to the first key that was created after this time. It
  11933. * can be used to recover a compromised wallet, or just as part of preventative defence-in-depth measures.
  11934. * </pre>
  11935. */
  11936. public long getKeyRotationTime() {
  11937. return keyRotationTime_;
  11938. }
  11939. /**
  11940. * <code>optional uint64 key_rotation_time = 13;</code>
  11941. *
  11942. * <pre>
  11943. * UNIX time in seconds since the epoch. If set, then any keys created before this date are assumed to be no longer
  11944. * wanted. Money sent to them will be re-spent automatically to the first key that was created after this time. It
  11945. * can be used to recover a compromised wallet, or just as part of preventative defence-in-depth measures.
  11946. * </pre>
  11947. */
  11948. public Builder setKeyRotationTime(long value) {
  11949. bitField0_ |= 0x00000400;
  11950. keyRotationTime_ = value;
  11951. onChanged();
  11952. return this;
  11953. }
  11954. /**
  11955. * <code>optional uint64 key_rotation_time = 13;</code>
  11956. *
  11957. * <pre>
  11958. * UNIX time in seconds since the epoch. If set, then any keys created before this date are assumed to be no longer
  11959. * wanted. Money sent to them will be re-spent automatically to the first key that was created after this time. It
  11960. * can be used to recover a compromised wallet, or just as part of preventative defence-in-depth measures.
  11961. * </pre>
  11962. */
  11963. public Builder clearKeyRotationTime() {
  11964. bitField0_ = (bitField0_ & ~0x00000400);
  11965. keyRotationTime_ = 0L;
  11966. onChanged();
  11967. return this;
  11968. }
  11969. // @@protoc_insertion_point(builder_scope:wallet.Wallet)
  11970. }
  11971. static {
  11972. defaultInstance = new Wallet(true);
  11973. defaultInstance.initFields();
  11974. }
  11975. // @@protoc_insertion_point(class_scope:wallet.Wallet)
  11976. }
  11977. private static com.google.protobuf.Descriptors.Descriptor
  11978. internal_static_wallet_PeerAddress_descriptor;
  11979. private static
  11980. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  11981. internal_static_wallet_PeerAddress_fieldAccessorTable;
  11982. private static com.google.protobuf.Descriptors.Descriptor
  11983. internal_static_wallet_EncryptedPrivateKey_descriptor;
  11984. private static
  11985. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  11986. internal_static_wallet_EncryptedPrivateKey_fieldAccessorTable;
  11987. private static com.google.protobuf.Descriptors.Descriptor
  11988. internal_static_wallet_Key_descriptor;
  11989. private static
  11990. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  11991. internal_static_wallet_Key_fieldAccessorTable;
  11992. private static com.google.protobuf.Descriptors.Descriptor
  11993. internal_static_wallet_TransactionInput_descriptor;
  11994. private static
  11995. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  11996. internal_static_wallet_TransactionInput_fieldAccessorTable;
  11997. private static com.google.protobuf.Descriptors.Descriptor
  11998. internal_static_wallet_TransactionOutput_descriptor;
  11999. private static
  12000. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  12001. internal_static_wallet_TransactionOutput_fieldAccessorTable;
  12002. private static com.google.protobuf.Descriptors.Descriptor
  12003. internal_static_wallet_TransactionConfidence_descriptor;
  12004. private static
  12005. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  12006. internal_static_wallet_TransactionConfidence_fieldAccessorTable;
  12007. private static com.google.protobuf.Descriptors.Descriptor
  12008. internal_static_wallet_Transaction_descriptor;
  12009. private static
  12010. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  12011. internal_static_wallet_Transaction_fieldAccessorTable;
  12012. private static com.google.protobuf.Descriptors.Descriptor
  12013. internal_static_wallet_ScryptParameters_descriptor;
  12014. private static
  12015. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  12016. internal_static_wallet_ScryptParameters_fieldAccessorTable;
  12017. private static com.google.protobuf.Descriptors.Descriptor
  12018. internal_static_wallet_Extension_descriptor;
  12019. private static
  12020. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  12021. internal_static_wallet_Extension_fieldAccessorTable;
  12022. private static com.google.protobuf.Descriptors.Descriptor
  12023. internal_static_wallet_Wallet_descriptor;
  12024. private static
  12025. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  12026. internal_static_wallet_Wallet_fieldAccessorTable;
  12027. public static com.google.protobuf.Descriptors.FileDescriptor
  12028. getDescriptor() {
  12029. return descriptor;
  12030. }
  12031. private static com.google.protobuf.Descriptors.FileDescriptor
  12032. descriptor;
  12033. static {
  12034. java.lang.String[] descriptorData = {
  12035. "\n\rbitcoin.proto\022\006wallet\"A\n\013PeerAddress\022\022" +
  12036. "\n\nip_address\030\001 \002(\014\022\014\n\004port\030\002 \002(\r\022\020\n\010serv" +
  12037. "ices\030\003 \002(\004\"S\n\023EncryptedPrivateKey\022\035\n\025ini" +
  12038. "tialisation_vector\030\001 \002(\014\022\035\n\025encrypted_pr" +
  12039. "ivate_key\030\002 \002(\014\"\345\001\n\003Key\022\036\n\004type\030\001 \002(\0162\020." +
  12040. "wallet.Key.Type\022\023\n\013private_key\030\002 \001(\014\022:\n\025" +
  12041. "encrypted_private_key\030\006 \001(\0132\033.wallet.Enc" +
  12042. "ryptedPrivateKey\022\022\n\npublic_key\030\003 \001(\014\022\r\n\005" +
  12043. "label\030\004 \001(\t\022\032\n\022creation_timestamp\030\005 \001(\003\"" +
  12044. ".\n\004Type\022\014\n\010ORIGINAL\020\001\022\030\n\024ENCRYPTED_SCRYP",
  12045. "T_AES\020\002\"\203\001\n\020TransactionInput\022\"\n\032transact" +
  12046. "ion_out_point_hash\030\001 \002(\014\022#\n\033transaction_" +
  12047. "out_point_index\030\002 \002(\r\022\024\n\014script_bytes\030\003 " +
  12048. "\002(\014\022\020\n\010sequence\030\004 \001(\r\"\177\n\021TransactionOutp" +
  12049. "ut\022\r\n\005value\030\001 \002(\003\022\024\n\014script_bytes\030\002 \002(\014\022" +
  12050. "!\n\031spent_by_transaction_hash\030\003 \001(\014\022\"\n\032sp" +
  12051. "ent_by_transaction_index\030\004 \001(\005\"\234\003\n\025Trans" +
  12052. "actionConfidence\0220\n\004type\030\001 \001(\0162\".wallet." +
  12053. "TransactionConfidence.Type\022\032\n\022appeared_a" +
  12054. "t_height\030\002 \001(\005\022\036\n\026overriding_transaction",
  12055. "\030\003 \001(\014\022\r\n\005depth\030\004 \001(\005\022\021\n\twork_done\030\005 \001(\003" +
  12056. "\022)\n\014broadcast_by\030\006 \003(\0132\023.wallet.PeerAddr" +
  12057. "ess\0224\n\006source\030\007 \001(\0162$.wallet.Transaction" +
  12058. "Confidence.Source\"O\n\004Type\022\013\n\007UNKNOWN\020\000\022\014" +
  12059. "\n\010BUILDING\020\001\022\013\n\007PENDING\020\002\022\025\n\021NOT_IN_BEST" +
  12060. "_CHAIN\020\003\022\010\n\004DEAD\020\004\"A\n\006Source\022\022\n\016SOURCE_U" +
  12061. "NKNOWN\020\000\022\022\n\016SOURCE_NETWORK\020\001\022\017\n\013SOURCE_S" +
  12062. "ELF\020\002\"\374\003\n\013Transaction\022\017\n\007version\030\001 \002(\005\022\014" +
  12063. "\n\004hash\030\002 \002(\014\022&\n\004pool\030\003 \001(\0162\030.wallet.Tran" +
  12064. "saction.Pool\022\021\n\tlock_time\030\004 \001(\r\022\022\n\nupdat",
  12065. "ed_at\030\005 \001(\003\0223\n\021transaction_input\030\006 \003(\0132\030" +
  12066. ".wallet.TransactionInput\0225\n\022transaction_" +
  12067. "output\030\007 \003(\0132\031.wallet.TransactionOutput\022" +
  12068. "\022\n\nblock_hash\030\010 \003(\014\0221\n\nconfidence\030\t \001(\0132" +
  12069. "\035.wallet.TransactionConfidence\0225\n\007purpos" +
  12070. "e\030\n \001(\0162\033.wallet.Transaction.Purpose:\007UN" +
  12071. "KNOWN\"Y\n\004Pool\022\013\n\007UNSPENT\020\004\022\t\n\005SPENT\020\005\022\014\n" +
  12072. "\010INACTIVE\020\002\022\010\n\004DEAD\020\n\022\013\n\007PENDING\020\020\022\024\n\020PE" +
  12073. "NDING_INACTIVE\020\022\":\n\007Purpose\022\013\n\007UNKNOWN\020\000" +
  12074. "\022\020\n\014USER_PAYMENT\020\001\022\020\n\014KEY_ROTATION\020\002\"N\n\020",
  12075. "ScryptParameters\022\014\n\004salt\030\001 \002(\014\022\020\n\001n\030\002 \001(" +
  12076. "\003:\00516384\022\014\n\001r\030\003 \001(\005:\0018\022\014\n\001p\030\004 \001(\005:\0011\"8\n\t" +
  12077. "Extension\022\n\n\002id\030\001 \002(\t\022\014\n\004data\030\002 \002(\014\022\021\n\tm" +
  12078. "andatory\030\003 \002(\010\"\310\003\n\006Wallet\022\032\n\022network_ide" +
  12079. "ntifier\030\001 \002(\t\022\034\n\024last_seen_block_hash\030\002 " +
  12080. "\001(\014\022\036\n\026last_seen_block_height\030\014 \001(\r\022\030\n\003k" +
  12081. "ey\030\003 \003(\0132\013.wallet.Key\022(\n\013transaction\030\004 \003" +
  12082. "(\0132\023.wallet.Transaction\022C\n\017encryption_ty" +
  12083. "pe\030\005 \001(\0162\035.wallet.Wallet.EncryptionType:" +
  12084. "\013UNENCRYPTED\0227\n\025encryption_parameters\030\006 ",
  12085. "\001(\0132\030.wallet.ScryptParameters\022\017\n\007version" +
  12086. "\030\007 \001(\005\022$\n\textension\030\n \003(\0132\021.wallet.Exten" +
  12087. "sion\022\023\n\013description\030\013 \001(\t\022\031\n\021key_rotatio" +
  12088. "n_time\030\r \001(\004\";\n\016EncryptionType\022\017\n\013UNENCR" +
  12089. "YPTED\020\001\022\030\n\024ENCRYPTED_SCRYPT_AES\020\002B\035\n\023org" +
  12090. ".bitcoinj.walletB\006Protos"
  12091. };
  12092. com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
  12093. new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
  12094. public com.google.protobuf.ExtensionRegistry assignDescriptors(
  12095. com.google.protobuf.Descriptors.FileDescriptor root) {
  12096. descriptor = root;
  12097. internal_static_wallet_PeerAddress_descriptor =
  12098. getDescriptor().getMessageTypes().get(0);
  12099. internal_static_wallet_PeerAddress_fieldAccessorTable = new
  12100. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  12101. internal_static_wallet_PeerAddress_descriptor,
  12102. new java.lang.String[] { "IpAddress", "Port", "Services", });
  12103. internal_static_wallet_EncryptedPrivateKey_descriptor =
  12104. getDescriptor().getMessageTypes().get(1);
  12105. internal_static_wallet_EncryptedPrivateKey_fieldAccessorTable = new
  12106. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  12107. internal_static_wallet_EncryptedPrivateKey_descriptor,
  12108. new java.lang.String[] { "InitialisationVector", "EncryptedPrivateKey", });
  12109. internal_static_wallet_Key_descriptor =
  12110. getDescriptor().getMessageTypes().get(2);
  12111. internal_static_wallet_Key_fieldAccessorTable = new
  12112. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  12113. internal_static_wallet_Key_descriptor,
  12114. new java.lang.String[] { "Type", "PrivateKey", "EncryptedPrivateKey", "PublicKey", "Label", "CreationTimestamp", });
  12115. internal_static_wallet_TransactionInput_descriptor =
  12116. getDescriptor().getMessageTypes().get(3);
  12117. internal_static_wallet_TransactionInput_fieldAccessorTable = new
  12118. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  12119. internal_static_wallet_TransactionInput_descriptor,
  12120. new java.lang.String[] { "TransactionOutPointHash", "TransactionOutPointIndex", "ScriptBytes", "Sequence", });
  12121. internal_static_wallet_TransactionOutput_descriptor =
  12122. getDescriptor().getMessageTypes().get(4);
  12123. internal_static_wallet_TransactionOutput_fieldAccessorTable = new
  12124. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  12125. internal_static_wallet_TransactionOutput_descriptor,
  12126. new java.lang.String[] { "Value", "ScriptBytes", "SpentByTransactionHash", "SpentByTransactionIndex", });
  12127. internal_static_wallet_TransactionConfidence_descriptor =
  12128. getDescriptor().getMessageTypes().get(5);
  12129. internal_static_wallet_TransactionConfidence_fieldAccessorTable = new
  12130. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  12131. internal_static_wallet_TransactionConfidence_descriptor,
  12132. new java.lang.String[] { "Type", "AppearedAtHeight", "OverridingTransaction", "Depth", "WorkDone", "BroadcastBy", "Source", });
  12133. internal_static_wallet_Transaction_descriptor =
  12134. getDescriptor().getMessageTypes().get(6);
  12135. internal_static_wallet_Transaction_fieldAccessorTable = new
  12136. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  12137. internal_static_wallet_Transaction_descriptor,
  12138. new java.lang.String[] { "Version", "Hash", "Pool", "LockTime", "UpdatedAt", "TransactionInput", "TransactionOutput", "BlockHash", "Confidence", "Purpose", });
  12139. internal_static_wallet_ScryptParameters_descriptor =
  12140. getDescriptor().getMessageTypes().get(7);
  12141. internal_static_wallet_ScryptParameters_fieldAccessorTable = new
  12142. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  12143. internal_static_wallet_ScryptParameters_descriptor,
  12144. new java.lang.String[] { "Salt", "N", "R", "P", });
  12145. internal_static_wallet_Extension_descriptor =
  12146. getDescriptor().getMessageTypes().get(8);
  12147. internal_static_wallet_Extension_fieldAccessorTable = new
  12148. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  12149. internal_static_wallet_Extension_descriptor,
  12150. new java.lang.String[] { "Id", "Data", "Mandatory", });
  12151. internal_static_wallet_Wallet_descriptor =
  12152. getDescriptor().getMessageTypes().get(9);
  12153. internal_static_wallet_Wallet_fieldAccessorTable = new
  12154. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  12155. internal_static_wallet_Wallet_descriptor,
  12156. new java.lang.String[] { "NetworkIdentifier", "LastSeenBlockHash", "LastSeenBlockHeight", "Key", "Transaction", "EncryptionType", "EncryptionParameters", "Version", "Extension", "Description", "KeyRotationTime", });
  12157. return null;
  12158. }
  12159. };
  12160. com.google.protobuf.Descriptors.FileDescriptor
  12161. .internalBuildGeneratedFileFrom(descriptorData,
  12162. new com.google.protobuf.Descriptors.FileDescriptor[] {
  12163. }, assigner);
  12164. }
  12165. // @@protoc_insertion_point(outer_class_scope)
  12166. }