@dashevo/dapi-grpc 0.24.0-dev.6 → 0.25.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/browser.js +13 -5
- package/clients/core/v0/nodejs/CorePromiseClient.js +2 -1
- package/clients/core/v0/nodejs/core_protoc.js +33 -33
- package/clients/core/v0/web/CorePromiseClient.js +159 -0
- package/clients/core/v0/web/core_pb.d.ts +783 -0
- package/clients/core/v0/web/core_pb.js +33 -33
- package/clients/core/v0/web/core_pb_service.d.ts +161 -0
- package/clients/core/v0/web/core_pb_service.js +317 -0
- package/clients/platform/v0/nodejs/PlatformPromiseClient.js +2 -1
- package/clients/platform/v0/nodejs/platform_pbjs.js +348 -20
- package/clients/platform/v0/nodejs/platform_protoc.js +131 -39
- package/clients/platform/v0/web/PlatformPromiseClient.js +130 -0
- package/clients/platform/v0/web/platform_pb.d.ts +608 -0
- package/clients/platform/v0/web/platform_pb.js +131 -39
- package/clients/platform/v0/web/platform_pb_service.d.ts +177 -0
- package/clients/platform/v0/web/platform_pb_service.js +301 -0
- package/lib/utils/parseMetadata.js +27 -0
- package/node.js +4 -0
- package/package.json +4 -4
- package/protos/platform/v0/platform.proto +6 -1
- package/scripts/build.sh +3 -3
- package/scripts/patch-protobuf-js.sh +30 -0
- package/clients/core/v0/web/core_grpc_web_pb.js +0 -499
- package/clients/platform/v0/web/platform_grpc_web_pb.js +0 -509
|
@@ -327,8 +327,9 @@ $root.org = (function() {
|
|
|
327
327
|
* @memberof org.dash.platform.dapi.v0
|
|
328
328
|
* @interface IProof
|
|
329
329
|
* @property {Uint8Array|null} [merkleProof] Proof merkleProof
|
|
330
|
-
* @property {Uint8Array|null} [
|
|
330
|
+
* @property {Uint8Array|null} [quorumHash] Proof quorumHash
|
|
331
331
|
* @property {Uint8Array|null} [signature] Proof signature
|
|
332
|
+
* @property {number|null} [round] Proof round
|
|
332
333
|
*/
|
|
333
334
|
|
|
334
335
|
/**
|
|
@@ -355,12 +356,12 @@ $root.org = (function() {
|
|
|
355
356
|
Proof.prototype.merkleProof = $util.newBuffer([]);
|
|
356
357
|
|
|
357
358
|
/**
|
|
358
|
-
* Proof
|
|
359
|
-
* @member {Uint8Array}
|
|
359
|
+
* Proof quorumHash.
|
|
360
|
+
* @member {Uint8Array} quorumHash
|
|
360
361
|
* @memberof org.dash.platform.dapi.v0.Proof
|
|
361
362
|
* @instance
|
|
362
363
|
*/
|
|
363
|
-
Proof.prototype.
|
|
364
|
+
Proof.prototype.quorumHash = $util.newBuffer([]);
|
|
364
365
|
|
|
365
366
|
/**
|
|
366
367
|
* Proof signature.
|
|
@@ -370,6 +371,14 @@ $root.org = (function() {
|
|
|
370
371
|
*/
|
|
371
372
|
Proof.prototype.signature = $util.newBuffer([]);
|
|
372
373
|
|
|
374
|
+
/**
|
|
375
|
+
* Proof round.
|
|
376
|
+
* @member {number} round
|
|
377
|
+
* @memberof org.dash.platform.dapi.v0.Proof
|
|
378
|
+
* @instance
|
|
379
|
+
*/
|
|
380
|
+
Proof.prototype.round = 0;
|
|
381
|
+
|
|
373
382
|
/**
|
|
374
383
|
* Creates a new Proof instance using the specified properties.
|
|
375
384
|
* @function create
|
|
@@ -396,10 +405,12 @@ $root.org = (function() {
|
|
|
396
405
|
writer = $Writer.create();
|
|
397
406
|
if (message.merkleProof != null && Object.hasOwnProperty.call(message, "merkleProof"))
|
|
398
407
|
writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.merkleProof);
|
|
399
|
-
if (message.
|
|
400
|
-
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.
|
|
408
|
+
if (message.quorumHash != null && Object.hasOwnProperty.call(message, "quorumHash"))
|
|
409
|
+
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.quorumHash);
|
|
401
410
|
if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
|
|
402
411
|
writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signature);
|
|
412
|
+
if (message.round != null && Object.hasOwnProperty.call(message, "round"))
|
|
413
|
+
writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.round);
|
|
403
414
|
return writer;
|
|
404
415
|
};
|
|
405
416
|
|
|
@@ -438,11 +449,14 @@ $root.org = (function() {
|
|
|
438
449
|
message.merkleProof = reader.bytes();
|
|
439
450
|
break;
|
|
440
451
|
case 2:
|
|
441
|
-
message.
|
|
452
|
+
message.quorumHash = reader.bytes();
|
|
442
453
|
break;
|
|
443
454
|
case 3:
|
|
444
455
|
message.signature = reader.bytes();
|
|
445
456
|
break;
|
|
457
|
+
case 4:
|
|
458
|
+
message.round = reader.uint32();
|
|
459
|
+
break;
|
|
446
460
|
default:
|
|
447
461
|
reader.skipType(tag & 7);
|
|
448
462
|
break;
|
|
@@ -481,12 +495,15 @@ $root.org = (function() {
|
|
|
481
495
|
if (message.merkleProof != null && message.hasOwnProperty("merkleProof"))
|
|
482
496
|
if (!(message.merkleProof && typeof message.merkleProof.length === "number" || $util.isString(message.merkleProof)))
|
|
483
497
|
return "merkleProof: buffer expected";
|
|
484
|
-
if (message.
|
|
485
|
-
if (!(message.
|
|
486
|
-
return "
|
|
498
|
+
if (message.quorumHash != null && message.hasOwnProperty("quorumHash"))
|
|
499
|
+
if (!(message.quorumHash && typeof message.quorumHash.length === "number" || $util.isString(message.quorumHash)))
|
|
500
|
+
return "quorumHash: buffer expected";
|
|
487
501
|
if (message.signature != null && message.hasOwnProperty("signature"))
|
|
488
502
|
if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature)))
|
|
489
503
|
return "signature: buffer expected";
|
|
504
|
+
if (message.round != null && message.hasOwnProperty("round"))
|
|
505
|
+
if (!$util.isInteger(message.round))
|
|
506
|
+
return "round: integer expected";
|
|
490
507
|
return null;
|
|
491
508
|
};
|
|
492
509
|
|
|
@@ -507,16 +524,18 @@ $root.org = (function() {
|
|
|
507
524
|
$util.base64.decode(object.merkleProof, message.merkleProof = $util.newBuffer($util.base64.length(object.merkleProof)), 0);
|
|
508
525
|
else if (object.merkleProof.length >= 0)
|
|
509
526
|
message.merkleProof = object.merkleProof;
|
|
510
|
-
if (object.
|
|
511
|
-
if (typeof object.
|
|
512
|
-
$util.base64.decode(object.
|
|
513
|
-
else if (object.
|
|
514
|
-
message.
|
|
527
|
+
if (object.quorumHash != null)
|
|
528
|
+
if (typeof object.quorumHash === "string")
|
|
529
|
+
$util.base64.decode(object.quorumHash, message.quorumHash = $util.newBuffer($util.base64.length(object.quorumHash)), 0);
|
|
530
|
+
else if (object.quorumHash.length >= 0)
|
|
531
|
+
message.quorumHash = object.quorumHash;
|
|
515
532
|
if (object.signature != null)
|
|
516
533
|
if (typeof object.signature === "string")
|
|
517
534
|
$util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0);
|
|
518
535
|
else if (object.signature.length >= 0)
|
|
519
536
|
message.signature = object.signature;
|
|
537
|
+
if (object.round != null)
|
|
538
|
+
message.round = object.round >>> 0;
|
|
520
539
|
return message;
|
|
521
540
|
};
|
|
522
541
|
|
|
@@ -542,11 +561,11 @@ $root.org = (function() {
|
|
|
542
561
|
object.merkleProof = $util.newBuffer(object.merkleProof);
|
|
543
562
|
}
|
|
544
563
|
if (options.bytes === String)
|
|
545
|
-
object.
|
|
564
|
+
object.quorumHash = "";
|
|
546
565
|
else {
|
|
547
|
-
object.
|
|
566
|
+
object.quorumHash = [];
|
|
548
567
|
if (options.bytes !== Array)
|
|
549
|
-
object.
|
|
568
|
+
object.quorumHash = $util.newBuffer(object.quorumHash);
|
|
550
569
|
}
|
|
551
570
|
if (options.bytes === String)
|
|
552
571
|
object.signature = "";
|
|
@@ -555,13 +574,16 @@ $root.org = (function() {
|
|
|
555
574
|
if (options.bytes !== Array)
|
|
556
575
|
object.signature = $util.newBuffer(object.signature);
|
|
557
576
|
}
|
|
577
|
+
object.round = 0;
|
|
558
578
|
}
|
|
559
579
|
if (message.merkleProof != null && message.hasOwnProperty("merkleProof"))
|
|
560
580
|
object.merkleProof = options.bytes === String ? $util.base64.encode(message.merkleProof, 0, message.merkleProof.length) : options.bytes === Array ? Array.prototype.slice.call(message.merkleProof) : message.merkleProof;
|
|
561
|
-
if (message.
|
|
562
|
-
object.
|
|
581
|
+
if (message.quorumHash != null && message.hasOwnProperty("quorumHash"))
|
|
582
|
+
object.quorumHash = options.bytes === String ? $util.base64.encode(message.quorumHash, 0, message.quorumHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorumHash) : message.quorumHash;
|
|
563
583
|
if (message.signature != null && message.hasOwnProperty("signature"))
|
|
564
584
|
object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature;
|
|
585
|
+
if (message.round != null && message.hasOwnProperty("round"))
|
|
586
|
+
object.round = message.round;
|
|
565
587
|
return object;
|
|
566
588
|
};
|
|
567
589
|
|
|
@@ -587,6 +609,8 @@ $root.org = (function() {
|
|
|
587
609
|
* @interface IResponseMetadata
|
|
588
610
|
* @property {number|Long|null} [height] ResponseMetadata height
|
|
589
611
|
* @property {number|null} [coreChainLockedHeight] ResponseMetadata coreChainLockedHeight
|
|
612
|
+
* @property {number|Long|null} [timeMs] ResponseMetadata timeMs
|
|
613
|
+
* @property {number|null} [protocolVersion] ResponseMetadata protocolVersion
|
|
590
614
|
*/
|
|
591
615
|
|
|
592
616
|
/**
|
|
@@ -620,6 +644,22 @@ $root.org = (function() {
|
|
|
620
644
|
*/
|
|
621
645
|
ResponseMetadata.prototype.coreChainLockedHeight = 0;
|
|
622
646
|
|
|
647
|
+
/**
|
|
648
|
+
* ResponseMetadata timeMs.
|
|
649
|
+
* @member {number|Long} timeMs
|
|
650
|
+
* @memberof org.dash.platform.dapi.v0.ResponseMetadata
|
|
651
|
+
* @instance
|
|
652
|
+
*/
|
|
653
|
+
ResponseMetadata.prototype.timeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* ResponseMetadata protocolVersion.
|
|
657
|
+
* @member {number} protocolVersion
|
|
658
|
+
* @memberof org.dash.platform.dapi.v0.ResponseMetadata
|
|
659
|
+
* @instance
|
|
660
|
+
*/
|
|
661
|
+
ResponseMetadata.prototype.protocolVersion = 0;
|
|
662
|
+
|
|
623
663
|
/**
|
|
624
664
|
* Creates a new ResponseMetadata instance using the specified properties.
|
|
625
665
|
* @function create
|
|
@@ -648,6 +688,10 @@ $root.org = (function() {
|
|
|
648
688
|
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height);
|
|
649
689
|
if (message.coreChainLockedHeight != null && Object.hasOwnProperty.call(message, "coreChainLockedHeight"))
|
|
650
690
|
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.coreChainLockedHeight);
|
|
691
|
+
if (message.timeMs != null && Object.hasOwnProperty.call(message, "timeMs"))
|
|
692
|
+
writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.timeMs);
|
|
693
|
+
if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion"))
|
|
694
|
+
writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.protocolVersion);
|
|
651
695
|
return writer;
|
|
652
696
|
};
|
|
653
697
|
|
|
@@ -688,6 +732,12 @@ $root.org = (function() {
|
|
|
688
732
|
case 2:
|
|
689
733
|
message.coreChainLockedHeight = reader.uint32();
|
|
690
734
|
break;
|
|
735
|
+
case 3:
|
|
736
|
+
message.timeMs = reader.uint64();
|
|
737
|
+
break;
|
|
738
|
+
case 4:
|
|
739
|
+
message.protocolVersion = reader.uint32();
|
|
740
|
+
break;
|
|
691
741
|
default:
|
|
692
742
|
reader.skipType(tag & 7);
|
|
693
743
|
break;
|
|
@@ -729,6 +779,12 @@ $root.org = (function() {
|
|
|
729
779
|
if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight"))
|
|
730
780
|
if (!$util.isInteger(message.coreChainLockedHeight))
|
|
731
781
|
return "coreChainLockedHeight: integer expected";
|
|
782
|
+
if (message.timeMs != null && message.hasOwnProperty("timeMs"))
|
|
783
|
+
if (!$util.isInteger(message.timeMs) && !(message.timeMs && $util.isInteger(message.timeMs.low) && $util.isInteger(message.timeMs.high)))
|
|
784
|
+
return "timeMs: integer|Long expected";
|
|
785
|
+
if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion"))
|
|
786
|
+
if (!$util.isInteger(message.protocolVersion))
|
|
787
|
+
return "protocolVersion: integer expected";
|
|
732
788
|
return null;
|
|
733
789
|
};
|
|
734
790
|
|
|
@@ -755,6 +811,17 @@ $root.org = (function() {
|
|
|
755
811
|
message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber();
|
|
756
812
|
if (object.coreChainLockedHeight != null)
|
|
757
813
|
message.coreChainLockedHeight = object.coreChainLockedHeight >>> 0;
|
|
814
|
+
if (object.timeMs != null)
|
|
815
|
+
if ($util.Long)
|
|
816
|
+
(message.timeMs = $util.Long.fromValue(object.timeMs)).unsigned = true;
|
|
817
|
+
else if (typeof object.timeMs === "string")
|
|
818
|
+
message.timeMs = parseInt(object.timeMs, 10);
|
|
819
|
+
else if (typeof object.timeMs === "number")
|
|
820
|
+
message.timeMs = object.timeMs;
|
|
821
|
+
else if (typeof object.timeMs === "object")
|
|
822
|
+
message.timeMs = new $util.LongBits(object.timeMs.low >>> 0, object.timeMs.high >>> 0).toNumber(true);
|
|
823
|
+
if (object.protocolVersion != null)
|
|
824
|
+
message.protocolVersion = object.protocolVersion >>> 0;
|
|
758
825
|
return message;
|
|
759
826
|
};
|
|
760
827
|
|
|
@@ -778,6 +845,12 @@ $root.org = (function() {
|
|
|
778
845
|
} else
|
|
779
846
|
object.height = options.longs === String ? "0" : 0;
|
|
780
847
|
object.coreChainLockedHeight = 0;
|
|
848
|
+
if ($util.Long) {
|
|
849
|
+
var long = new $util.Long(0, 0, true);
|
|
850
|
+
object.timeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
851
|
+
} else
|
|
852
|
+
object.timeMs = options.longs === String ? "0" : 0;
|
|
853
|
+
object.protocolVersion = 0;
|
|
781
854
|
}
|
|
782
855
|
if (message.height != null && message.hasOwnProperty("height"))
|
|
783
856
|
if (typeof message.height === "number")
|
|
@@ -786,6 +859,13 @@ $root.org = (function() {
|
|
|
786
859
|
object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height;
|
|
787
860
|
if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight"))
|
|
788
861
|
object.coreChainLockedHeight = message.coreChainLockedHeight;
|
|
862
|
+
if (message.timeMs != null && message.hasOwnProperty("timeMs"))
|
|
863
|
+
if (typeof message.timeMs === "number")
|
|
864
|
+
object.timeMs = options.longs === String ? String(message.timeMs) : message.timeMs;
|
|
865
|
+
else
|
|
866
|
+
object.timeMs = options.longs === String ? $util.Long.prototype.toString.call(message.timeMs) : options.longs === Number ? new $util.LongBits(message.timeMs.low >>> 0, message.timeMs.high >>> 0).toNumber(true) : message.timeMs;
|
|
867
|
+
if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion"))
|
|
868
|
+
object.protocolVersion = message.protocolVersion;
|
|
789
869
|
return object;
|
|
790
870
|
};
|
|
791
871
|
|
|
@@ -4908,4 +4988,252 @@ $root.org = (function() {
|
|
|
4908
4988
|
return org;
|
|
4909
4989
|
})();
|
|
4910
4990
|
|
|
4991
|
+
$root.google = (function() {
|
|
4992
|
+
|
|
4993
|
+
/**
|
|
4994
|
+
* Namespace google.
|
|
4995
|
+
* @exports google
|
|
4996
|
+
* @namespace
|
|
4997
|
+
*/
|
|
4998
|
+
var google = {};
|
|
4999
|
+
|
|
5000
|
+
google.protobuf = (function() {
|
|
5001
|
+
|
|
5002
|
+
/**
|
|
5003
|
+
* Namespace protobuf.
|
|
5004
|
+
* @memberof google
|
|
5005
|
+
* @namespace
|
|
5006
|
+
*/
|
|
5007
|
+
var protobuf = {};
|
|
5008
|
+
|
|
5009
|
+
protobuf.Timestamp = (function() {
|
|
5010
|
+
|
|
5011
|
+
/**
|
|
5012
|
+
* Properties of a Timestamp.
|
|
5013
|
+
* @memberof google.protobuf
|
|
5014
|
+
* @interface ITimestamp
|
|
5015
|
+
* @property {number|Long|null} [seconds] Timestamp seconds
|
|
5016
|
+
* @property {number|null} [nanos] Timestamp nanos
|
|
5017
|
+
*/
|
|
5018
|
+
|
|
5019
|
+
/**
|
|
5020
|
+
* Constructs a new Timestamp.
|
|
5021
|
+
* @memberof google.protobuf
|
|
5022
|
+
* @classdesc Represents a Timestamp.
|
|
5023
|
+
* @implements ITimestamp
|
|
5024
|
+
* @constructor
|
|
5025
|
+
* @param {google.protobuf.ITimestamp=} [properties] Properties to set
|
|
5026
|
+
*/
|
|
5027
|
+
function Timestamp(properties) {
|
|
5028
|
+
if (properties)
|
|
5029
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
5030
|
+
if (properties[keys[i]] != null)
|
|
5031
|
+
this[keys[i]] = properties[keys[i]];
|
|
5032
|
+
}
|
|
5033
|
+
|
|
5034
|
+
/**
|
|
5035
|
+
* Timestamp seconds.
|
|
5036
|
+
* @member {number|Long} seconds
|
|
5037
|
+
* @memberof google.protobuf.Timestamp
|
|
5038
|
+
* @instance
|
|
5039
|
+
*/
|
|
5040
|
+
Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
5041
|
+
|
|
5042
|
+
/**
|
|
5043
|
+
* Timestamp nanos.
|
|
5044
|
+
* @member {number} nanos
|
|
5045
|
+
* @memberof google.protobuf.Timestamp
|
|
5046
|
+
* @instance
|
|
5047
|
+
*/
|
|
5048
|
+
Timestamp.prototype.nanos = 0;
|
|
5049
|
+
|
|
5050
|
+
/**
|
|
5051
|
+
* Creates a new Timestamp instance using the specified properties.
|
|
5052
|
+
* @function create
|
|
5053
|
+
* @memberof google.protobuf.Timestamp
|
|
5054
|
+
* @static
|
|
5055
|
+
* @param {google.protobuf.ITimestamp=} [properties] Properties to set
|
|
5056
|
+
* @returns {google.protobuf.Timestamp} Timestamp instance
|
|
5057
|
+
*/
|
|
5058
|
+
Timestamp.create = function create(properties) {
|
|
5059
|
+
return new Timestamp(properties);
|
|
5060
|
+
};
|
|
5061
|
+
|
|
5062
|
+
/**
|
|
5063
|
+
* Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
|
|
5064
|
+
* @function encode
|
|
5065
|
+
* @memberof google.protobuf.Timestamp
|
|
5066
|
+
* @static
|
|
5067
|
+
* @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode
|
|
5068
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
5069
|
+
* @returns {$protobuf.Writer} Writer
|
|
5070
|
+
*/
|
|
5071
|
+
Timestamp.encode = function encode(message, writer) {
|
|
5072
|
+
if (!writer)
|
|
5073
|
+
writer = $Writer.create();
|
|
5074
|
+
if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds"))
|
|
5075
|
+
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds);
|
|
5076
|
+
if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos"))
|
|
5077
|
+
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos);
|
|
5078
|
+
return writer;
|
|
5079
|
+
};
|
|
5080
|
+
|
|
5081
|
+
/**
|
|
5082
|
+
* Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
|
|
5083
|
+
* @function encodeDelimited
|
|
5084
|
+
* @memberof google.protobuf.Timestamp
|
|
5085
|
+
* @static
|
|
5086
|
+
* @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode
|
|
5087
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
5088
|
+
* @returns {$protobuf.Writer} Writer
|
|
5089
|
+
*/
|
|
5090
|
+
Timestamp.encodeDelimited = function encodeDelimited(message, writer) {
|
|
5091
|
+
return this.encode(message, writer).ldelim();
|
|
5092
|
+
};
|
|
5093
|
+
|
|
5094
|
+
/**
|
|
5095
|
+
* Decodes a Timestamp message from the specified reader or buffer.
|
|
5096
|
+
* @function decode
|
|
5097
|
+
* @memberof google.protobuf.Timestamp
|
|
5098
|
+
* @static
|
|
5099
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
5100
|
+
* @param {number} [length] Message length if known beforehand
|
|
5101
|
+
* @returns {google.protobuf.Timestamp} Timestamp
|
|
5102
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
5103
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
5104
|
+
*/
|
|
5105
|
+
Timestamp.decode = function decode(reader, length) {
|
|
5106
|
+
if (!(reader instanceof $Reader))
|
|
5107
|
+
reader = $Reader.create(reader);
|
|
5108
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp();
|
|
5109
|
+
while (reader.pos < end) {
|
|
5110
|
+
var tag = reader.uint32();
|
|
5111
|
+
switch (tag >>> 3) {
|
|
5112
|
+
case 1:
|
|
5113
|
+
message.seconds = reader.int64();
|
|
5114
|
+
break;
|
|
5115
|
+
case 2:
|
|
5116
|
+
message.nanos = reader.int32();
|
|
5117
|
+
break;
|
|
5118
|
+
default:
|
|
5119
|
+
reader.skipType(tag & 7);
|
|
5120
|
+
break;
|
|
5121
|
+
}
|
|
5122
|
+
}
|
|
5123
|
+
return message;
|
|
5124
|
+
};
|
|
5125
|
+
|
|
5126
|
+
/**
|
|
5127
|
+
* Decodes a Timestamp message from the specified reader or buffer, length delimited.
|
|
5128
|
+
* @function decodeDelimited
|
|
5129
|
+
* @memberof google.protobuf.Timestamp
|
|
5130
|
+
* @static
|
|
5131
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
5132
|
+
* @returns {google.protobuf.Timestamp} Timestamp
|
|
5133
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
5134
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
5135
|
+
*/
|
|
5136
|
+
Timestamp.decodeDelimited = function decodeDelimited(reader) {
|
|
5137
|
+
if (!(reader instanceof $Reader))
|
|
5138
|
+
reader = new $Reader(reader);
|
|
5139
|
+
return this.decode(reader, reader.uint32());
|
|
5140
|
+
};
|
|
5141
|
+
|
|
5142
|
+
/**
|
|
5143
|
+
* Verifies a Timestamp message.
|
|
5144
|
+
* @function verify
|
|
5145
|
+
* @memberof google.protobuf.Timestamp
|
|
5146
|
+
* @static
|
|
5147
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
5148
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
5149
|
+
*/
|
|
5150
|
+
Timestamp.verify = function verify(message) {
|
|
5151
|
+
if (typeof message !== "object" || message === null)
|
|
5152
|
+
return "object expected";
|
|
5153
|
+
if (message.seconds != null && message.hasOwnProperty("seconds"))
|
|
5154
|
+
if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high)))
|
|
5155
|
+
return "seconds: integer|Long expected";
|
|
5156
|
+
if (message.nanos != null && message.hasOwnProperty("nanos"))
|
|
5157
|
+
if (!$util.isInteger(message.nanos))
|
|
5158
|
+
return "nanos: integer expected";
|
|
5159
|
+
return null;
|
|
5160
|
+
};
|
|
5161
|
+
|
|
5162
|
+
/**
|
|
5163
|
+
* Creates a Timestamp message from a plain object. Also converts values to their respective internal types.
|
|
5164
|
+
* @function fromObject
|
|
5165
|
+
* @memberof google.protobuf.Timestamp
|
|
5166
|
+
* @static
|
|
5167
|
+
* @param {Object.<string,*>} object Plain object
|
|
5168
|
+
* @returns {google.protobuf.Timestamp} Timestamp
|
|
5169
|
+
*/
|
|
5170
|
+
Timestamp.fromObject = function fromObject(object) {
|
|
5171
|
+
if (object instanceof $root.google.protobuf.Timestamp)
|
|
5172
|
+
return object;
|
|
5173
|
+
var message = new $root.google.protobuf.Timestamp();
|
|
5174
|
+
if (object.seconds != null)
|
|
5175
|
+
if ($util.Long)
|
|
5176
|
+
(message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false;
|
|
5177
|
+
else if (typeof object.seconds === "string")
|
|
5178
|
+
message.seconds = parseInt(object.seconds, 10);
|
|
5179
|
+
else if (typeof object.seconds === "number")
|
|
5180
|
+
message.seconds = object.seconds;
|
|
5181
|
+
else if (typeof object.seconds === "object")
|
|
5182
|
+
message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber();
|
|
5183
|
+
if (object.nanos != null)
|
|
5184
|
+
message.nanos = object.nanos | 0;
|
|
5185
|
+
return message;
|
|
5186
|
+
};
|
|
5187
|
+
|
|
5188
|
+
/**
|
|
5189
|
+
* Creates a plain object from a Timestamp message. Also converts values to other types if specified.
|
|
5190
|
+
* @function toObject
|
|
5191
|
+
* @memberof google.protobuf.Timestamp
|
|
5192
|
+
* @static
|
|
5193
|
+
* @param {google.protobuf.Timestamp} message Timestamp
|
|
5194
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
5195
|
+
* @returns {Object.<string,*>} Plain object
|
|
5196
|
+
*/
|
|
5197
|
+
Timestamp.toObject = function toObject(message, options) {
|
|
5198
|
+
if (!options)
|
|
5199
|
+
options = {};
|
|
5200
|
+
var object = {};
|
|
5201
|
+
if (options.defaults) {
|
|
5202
|
+
if ($util.Long) {
|
|
5203
|
+
var long = new $util.Long(0, 0, false);
|
|
5204
|
+
object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
5205
|
+
} else
|
|
5206
|
+
object.seconds = options.longs === String ? "0" : 0;
|
|
5207
|
+
object.nanos = 0;
|
|
5208
|
+
}
|
|
5209
|
+
if (message.seconds != null && message.hasOwnProperty("seconds"))
|
|
5210
|
+
if (typeof message.seconds === "number")
|
|
5211
|
+
object.seconds = options.longs === String ? String(message.seconds) : message.seconds;
|
|
5212
|
+
else
|
|
5213
|
+
object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds;
|
|
5214
|
+
if (message.nanos != null && message.hasOwnProperty("nanos"))
|
|
5215
|
+
object.nanos = message.nanos;
|
|
5216
|
+
return object;
|
|
5217
|
+
};
|
|
5218
|
+
|
|
5219
|
+
/**
|
|
5220
|
+
* Converts this Timestamp to JSON.
|
|
5221
|
+
* @function toJSON
|
|
5222
|
+
* @memberof google.protobuf.Timestamp
|
|
5223
|
+
* @instance
|
|
5224
|
+
* @returns {Object.<string,*>} JSON object
|
|
5225
|
+
*/
|
|
5226
|
+
Timestamp.prototype.toJSON = function toJSON() {
|
|
5227
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
5228
|
+
};
|
|
5229
|
+
|
|
5230
|
+
return Timestamp;
|
|
5231
|
+
})();
|
|
5232
|
+
|
|
5233
|
+
return protobuf;
|
|
5234
|
+
})();
|
|
5235
|
+
|
|
5236
|
+
return google;
|
|
5237
|
+
})();
|
|
5238
|
+
|
|
4911
5239
|
module.exports = $root;
|