@trustwallet/wallet-core 4.1.16 → 4.1.18
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.
@@ -90644,6 +90644,22 @@
|
|
90644
90644
|
*/
|
90645
90645
|
var Proto = {};
|
90646
90646
|
|
90647
|
+
/**
|
90648
|
+
* NetworkId enum.
|
90649
|
+
* @name TW.Nimiq.Proto.NetworkId
|
90650
|
+
* @enum {number}
|
90651
|
+
* @property {number} UseDefault=0 UseDefault value
|
90652
|
+
* @property {number} Mainnet=42 Mainnet value
|
90653
|
+
* @property {number} MainnetAlbatross=24 MainnetAlbatross value
|
90654
|
+
*/
|
90655
|
+
Proto.NetworkId = (function() {
|
90656
|
+
var valuesById = {}, values = Object.create(valuesById);
|
90657
|
+
values[valuesById[0] = "UseDefault"] = 0;
|
90658
|
+
values[valuesById[42] = "Mainnet"] = 42;
|
90659
|
+
values[valuesById[24] = "MainnetAlbatross"] = 24;
|
90660
|
+
return values;
|
90661
|
+
})();
|
90662
|
+
|
90647
90663
|
Proto.SigningInput = (function() {
|
90648
90664
|
|
90649
90665
|
/**
|
@@ -90655,6 +90671,7 @@
|
|
90655
90671
|
* @property {Long|null} [value] SigningInput value
|
90656
90672
|
* @property {Long|null} [fee] SigningInput fee
|
90657
90673
|
* @property {number|null} [validityStartHeight] SigningInput validityStartHeight
|
90674
|
+
* @property {TW.Nimiq.Proto.NetworkId|null} [networkId] SigningInput networkId
|
90658
90675
|
*/
|
90659
90676
|
|
90660
90677
|
/**
|
@@ -90712,6 +90729,14 @@
|
|
90712
90729
|
*/
|
90713
90730
|
SigningInput.prototype.validityStartHeight = 0;
|
90714
90731
|
|
90732
|
+
/**
|
90733
|
+
* SigningInput networkId.
|
90734
|
+
* @member {TW.Nimiq.Proto.NetworkId} networkId
|
90735
|
+
* @memberof TW.Nimiq.Proto.SigningInput
|
90736
|
+
* @instance
|
90737
|
+
*/
|
90738
|
+
SigningInput.prototype.networkId = 0;
|
90739
|
+
|
90715
90740
|
/**
|
90716
90741
|
* Creates a new SigningInput instance using the specified properties.
|
90717
90742
|
* @function create
|
@@ -90746,6 +90771,8 @@
|
|
90746
90771
|
writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.fee);
|
90747
90772
|
if (message.validityStartHeight != null && Object.hasOwnProperty.call(message, "validityStartHeight"))
|
90748
90773
|
writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.validityStartHeight);
|
90774
|
+
if (message.networkId != null && Object.hasOwnProperty.call(message, "networkId"))
|
90775
|
+
writer.uint32(/* id 6, wireType 0 =*/48).int32(message.networkId);
|
90749
90776
|
return writer;
|
90750
90777
|
};
|
90751
90778
|
|
@@ -90782,6 +90809,9 @@
|
|
90782
90809
|
case 5:
|
90783
90810
|
message.validityStartHeight = reader.uint32();
|
90784
90811
|
break;
|
90812
|
+
case 6:
|
90813
|
+
message.networkId = reader.int32();
|
90814
|
+
break;
|
90785
90815
|
default:
|
90786
90816
|
reader.skipType(tag & 7);
|
90787
90817
|
break;
|
@@ -90816,6 +90846,15 @@
|
|
90816
90846
|
if (message.validityStartHeight != null && message.hasOwnProperty("validityStartHeight"))
|
90817
90847
|
if (!$util.isInteger(message.validityStartHeight))
|
90818
90848
|
return "validityStartHeight: integer expected";
|
90849
|
+
if (message.networkId != null && message.hasOwnProperty("networkId"))
|
90850
|
+
switch (message.networkId) {
|
90851
|
+
default:
|
90852
|
+
return "networkId: enum value expected";
|
90853
|
+
case 0:
|
90854
|
+
case 42:
|
90855
|
+
case 24:
|
90856
|
+
break;
|
90857
|
+
}
|
90819
90858
|
return null;
|
90820
90859
|
};
|
90821
90860
|
|
@@ -90858,6 +90897,20 @@
|
|
90858
90897
|
message.fee = new $util.LongBits(object.fee.low >>> 0, object.fee.high >>> 0).toNumber(true);
|
90859
90898
|
if (object.validityStartHeight != null)
|
90860
90899
|
message.validityStartHeight = object.validityStartHeight >>> 0;
|
90900
|
+
switch (object.networkId) {
|
90901
|
+
case "UseDefault":
|
90902
|
+
case 0:
|
90903
|
+
message.networkId = 0;
|
90904
|
+
break;
|
90905
|
+
case "Mainnet":
|
90906
|
+
case 42:
|
90907
|
+
message.networkId = 42;
|
90908
|
+
break;
|
90909
|
+
case "MainnetAlbatross":
|
90910
|
+
case 24:
|
90911
|
+
message.networkId = 24;
|
90912
|
+
break;
|
90913
|
+
}
|
90861
90914
|
return message;
|
90862
90915
|
};
|
90863
90916
|
|
@@ -90894,6 +90947,7 @@
|
|
90894
90947
|
} else
|
90895
90948
|
object.fee = options.longs === String ? "0" : 0;
|
90896
90949
|
object.validityStartHeight = 0;
|
90950
|
+
object.networkId = options.enums === String ? "UseDefault" : 0;
|
90897
90951
|
}
|
90898
90952
|
if (message.privateKey != null && message.hasOwnProperty("privateKey"))
|
90899
90953
|
object.privateKey = options.bytes === String ? $util.base64.encode(message.privateKey, 0, message.privateKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.privateKey) : message.privateKey;
|
@@ -90911,6 +90965,8 @@
|
|
90911
90965
|
object.fee = options.longs === String ? $util.Long.prototype.toString.call(message.fee) : options.longs === Number ? new $util.LongBits(message.fee.low >>> 0, message.fee.high >>> 0).toNumber(true) : message.fee;
|
90912
90966
|
if (message.validityStartHeight != null && message.hasOwnProperty("validityStartHeight"))
|
90913
90967
|
object.validityStartHeight = message.validityStartHeight;
|
90968
|
+
if (message.networkId != null && message.hasOwnProperty("networkId"))
|
90969
|
+
object.networkId = options.enums === String ? $root.TW.Nimiq.Proto.NetworkId[message.networkId] : message.networkId;
|
90914
90970
|
return object;
|
90915
90971
|
};
|
90916
90972
|
|
@@ -95507,6 +95563,1386 @@
|
|
95507
95563
|
return Ontology;
|
95508
95564
|
})();
|
95509
95565
|
|
95566
|
+
TW.Pactus = (function() {
|
95567
|
+
|
95568
|
+
/**
|
95569
|
+
* Namespace Pactus.
|
95570
|
+
* @memberof TW
|
95571
|
+
* @namespace
|
95572
|
+
*/
|
95573
|
+
var Pactus = {};
|
95574
|
+
|
95575
|
+
Pactus.Proto = (function() {
|
95576
|
+
|
95577
|
+
/**
|
95578
|
+
* Namespace Proto.
|
95579
|
+
* @memberof TW.Pactus
|
95580
|
+
* @namespace
|
95581
|
+
*/
|
95582
|
+
var Proto = {};
|
95583
|
+
|
95584
|
+
Proto.TransactionMessage = (function() {
|
95585
|
+
|
95586
|
+
/**
|
95587
|
+
* Properties of a TransactionMessage.
|
95588
|
+
* @memberof TW.Pactus.Proto
|
95589
|
+
* @interface ITransactionMessage
|
95590
|
+
* @property {number|null} [lockTime] TransactionMessage lockTime
|
95591
|
+
* @property {Long|null} [fee] TransactionMessage fee
|
95592
|
+
* @property {string|null} [memo] TransactionMessage memo
|
95593
|
+
* @property {TW.Pactus.Proto.ITransferPayload|null} [transfer] TransactionMessage transfer
|
95594
|
+
* @property {TW.Pactus.Proto.IBondPayload|null} [bond] TransactionMessage bond
|
95595
|
+
*/
|
95596
|
+
|
95597
|
+
/**
|
95598
|
+
* Constructs a new TransactionMessage.
|
95599
|
+
* @memberof TW.Pactus.Proto
|
95600
|
+
* @classdesc Represents a TransactionMessage.
|
95601
|
+
* @implements ITransactionMessage
|
95602
|
+
* @constructor
|
95603
|
+
* @param {TW.Pactus.Proto.ITransactionMessage=} [properties] Properties to set
|
95604
|
+
*/
|
95605
|
+
function TransactionMessage(properties) {
|
95606
|
+
if (properties)
|
95607
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
95608
|
+
if (properties[keys[i]] != null)
|
95609
|
+
this[keys[i]] = properties[keys[i]];
|
95610
|
+
}
|
95611
|
+
|
95612
|
+
/**
|
95613
|
+
* TransactionMessage lockTime.
|
95614
|
+
* @member {number} lockTime
|
95615
|
+
* @memberof TW.Pactus.Proto.TransactionMessage
|
95616
|
+
* @instance
|
95617
|
+
*/
|
95618
|
+
TransactionMessage.prototype.lockTime = 0;
|
95619
|
+
|
95620
|
+
/**
|
95621
|
+
* TransactionMessage fee.
|
95622
|
+
* @member {Long} fee
|
95623
|
+
* @memberof TW.Pactus.Proto.TransactionMessage
|
95624
|
+
* @instance
|
95625
|
+
*/
|
95626
|
+
TransactionMessage.prototype.fee = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
95627
|
+
|
95628
|
+
/**
|
95629
|
+
* TransactionMessage memo.
|
95630
|
+
* @member {string} memo
|
95631
|
+
* @memberof TW.Pactus.Proto.TransactionMessage
|
95632
|
+
* @instance
|
95633
|
+
*/
|
95634
|
+
TransactionMessage.prototype.memo = "";
|
95635
|
+
|
95636
|
+
/**
|
95637
|
+
* TransactionMessage transfer.
|
95638
|
+
* @member {TW.Pactus.Proto.ITransferPayload|null|undefined} transfer
|
95639
|
+
* @memberof TW.Pactus.Proto.TransactionMessage
|
95640
|
+
* @instance
|
95641
|
+
*/
|
95642
|
+
TransactionMessage.prototype.transfer = null;
|
95643
|
+
|
95644
|
+
/**
|
95645
|
+
* TransactionMessage bond.
|
95646
|
+
* @member {TW.Pactus.Proto.IBondPayload|null|undefined} bond
|
95647
|
+
* @memberof TW.Pactus.Proto.TransactionMessage
|
95648
|
+
* @instance
|
95649
|
+
*/
|
95650
|
+
TransactionMessage.prototype.bond = null;
|
95651
|
+
|
95652
|
+
// OneOf field names bound to virtual getters and setters
|
95653
|
+
var $oneOfFields;
|
95654
|
+
|
95655
|
+
/**
|
95656
|
+
* TransactionMessage payload.
|
95657
|
+
* @member {"transfer"|"bond"|undefined} payload
|
95658
|
+
* @memberof TW.Pactus.Proto.TransactionMessage
|
95659
|
+
* @instance
|
95660
|
+
*/
|
95661
|
+
Object.defineProperty(TransactionMessage.prototype, "payload", {
|
95662
|
+
get: $util.oneOfGetter($oneOfFields = ["transfer", "bond"]),
|
95663
|
+
set: $util.oneOfSetter($oneOfFields)
|
95664
|
+
});
|
95665
|
+
|
95666
|
+
/**
|
95667
|
+
* Creates a new TransactionMessage instance using the specified properties.
|
95668
|
+
* @function create
|
95669
|
+
* @memberof TW.Pactus.Proto.TransactionMessage
|
95670
|
+
* @static
|
95671
|
+
* @param {TW.Pactus.Proto.ITransactionMessage=} [properties] Properties to set
|
95672
|
+
* @returns {TW.Pactus.Proto.TransactionMessage} TransactionMessage instance
|
95673
|
+
*/
|
95674
|
+
TransactionMessage.create = function create(properties) {
|
95675
|
+
return new TransactionMessage(properties);
|
95676
|
+
};
|
95677
|
+
|
95678
|
+
/**
|
95679
|
+
* Encodes the specified TransactionMessage message. Does not implicitly {@link TW.Pactus.Proto.TransactionMessage.verify|verify} messages.
|
95680
|
+
* @function encode
|
95681
|
+
* @memberof TW.Pactus.Proto.TransactionMessage
|
95682
|
+
* @static
|
95683
|
+
* @param {TW.Pactus.Proto.ITransactionMessage} message TransactionMessage message or plain object to encode
|
95684
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
95685
|
+
* @returns {$protobuf.Writer} Writer
|
95686
|
+
*/
|
95687
|
+
TransactionMessage.encode = function encode(message, writer) {
|
95688
|
+
if (!writer)
|
95689
|
+
writer = $Writer.create();
|
95690
|
+
if (message.lockTime != null && Object.hasOwnProperty.call(message, "lockTime"))
|
95691
|
+
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.lockTime);
|
95692
|
+
if (message.fee != null && Object.hasOwnProperty.call(message, "fee"))
|
95693
|
+
writer.uint32(/* id 2, wireType 0 =*/16).int64(message.fee);
|
95694
|
+
if (message.memo != null && Object.hasOwnProperty.call(message, "memo"))
|
95695
|
+
writer.uint32(/* id 3, wireType 2 =*/26).string(message.memo);
|
95696
|
+
if (message.transfer != null && Object.hasOwnProperty.call(message, "transfer"))
|
95697
|
+
$root.TW.Pactus.Proto.TransferPayload.encode(message.transfer, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
|
95698
|
+
if (message.bond != null && Object.hasOwnProperty.call(message, "bond"))
|
95699
|
+
$root.TW.Pactus.Proto.BondPayload.encode(message.bond, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
|
95700
|
+
return writer;
|
95701
|
+
};
|
95702
|
+
|
95703
|
+
/**
|
95704
|
+
* Decodes a TransactionMessage message from the specified reader or buffer.
|
95705
|
+
* @function decode
|
95706
|
+
* @memberof TW.Pactus.Proto.TransactionMessage
|
95707
|
+
* @static
|
95708
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
95709
|
+
* @param {number} [length] Message length if known beforehand
|
95710
|
+
* @returns {TW.Pactus.Proto.TransactionMessage} TransactionMessage
|
95711
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
95712
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
95713
|
+
*/
|
95714
|
+
TransactionMessage.decode = function decode(reader, length) {
|
95715
|
+
if (!(reader instanceof $Reader))
|
95716
|
+
reader = $Reader.create(reader);
|
95717
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.TransactionMessage();
|
95718
|
+
while (reader.pos < end) {
|
95719
|
+
var tag = reader.uint32();
|
95720
|
+
switch (tag >>> 3) {
|
95721
|
+
case 1:
|
95722
|
+
message.lockTime = reader.uint32();
|
95723
|
+
break;
|
95724
|
+
case 2:
|
95725
|
+
message.fee = reader.int64();
|
95726
|
+
break;
|
95727
|
+
case 3:
|
95728
|
+
message.memo = reader.string();
|
95729
|
+
break;
|
95730
|
+
case 10:
|
95731
|
+
message.transfer = $root.TW.Pactus.Proto.TransferPayload.decode(reader, reader.uint32());
|
95732
|
+
break;
|
95733
|
+
case 11:
|
95734
|
+
message.bond = $root.TW.Pactus.Proto.BondPayload.decode(reader, reader.uint32());
|
95735
|
+
break;
|
95736
|
+
default:
|
95737
|
+
reader.skipType(tag & 7);
|
95738
|
+
break;
|
95739
|
+
}
|
95740
|
+
}
|
95741
|
+
return message;
|
95742
|
+
};
|
95743
|
+
|
95744
|
+
/**
|
95745
|
+
* Verifies a TransactionMessage message.
|
95746
|
+
* @function verify
|
95747
|
+
* @memberof TW.Pactus.Proto.TransactionMessage
|
95748
|
+
* @static
|
95749
|
+
* @param {Object.<string,*>} message Plain object to verify
|
95750
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
95751
|
+
*/
|
95752
|
+
TransactionMessage.verify = function verify(message) {
|
95753
|
+
if (typeof message !== "object" || message === null)
|
95754
|
+
return "object expected";
|
95755
|
+
var properties = {};
|
95756
|
+
if (message.lockTime != null && message.hasOwnProperty("lockTime"))
|
95757
|
+
if (!$util.isInteger(message.lockTime))
|
95758
|
+
return "lockTime: integer expected";
|
95759
|
+
if (message.fee != null && message.hasOwnProperty("fee"))
|
95760
|
+
if (!$util.isInteger(message.fee) && !(message.fee && $util.isInteger(message.fee.low) && $util.isInteger(message.fee.high)))
|
95761
|
+
return "fee: integer|Long expected";
|
95762
|
+
if (message.memo != null && message.hasOwnProperty("memo"))
|
95763
|
+
if (!$util.isString(message.memo))
|
95764
|
+
return "memo: string expected";
|
95765
|
+
if (message.transfer != null && message.hasOwnProperty("transfer")) {
|
95766
|
+
properties.payload = 1;
|
95767
|
+
{
|
95768
|
+
var error = $root.TW.Pactus.Proto.TransferPayload.verify(message.transfer);
|
95769
|
+
if (error)
|
95770
|
+
return "transfer." + error;
|
95771
|
+
}
|
95772
|
+
}
|
95773
|
+
if (message.bond != null && message.hasOwnProperty("bond")) {
|
95774
|
+
if (properties.payload === 1)
|
95775
|
+
return "payload: multiple values";
|
95776
|
+
properties.payload = 1;
|
95777
|
+
{
|
95778
|
+
var error = $root.TW.Pactus.Proto.BondPayload.verify(message.bond);
|
95779
|
+
if (error)
|
95780
|
+
return "bond." + error;
|
95781
|
+
}
|
95782
|
+
}
|
95783
|
+
return null;
|
95784
|
+
};
|
95785
|
+
|
95786
|
+
/**
|
95787
|
+
* Creates a TransactionMessage message from a plain object. Also converts values to their respective internal types.
|
95788
|
+
* @function fromObject
|
95789
|
+
* @memberof TW.Pactus.Proto.TransactionMessage
|
95790
|
+
* @static
|
95791
|
+
* @param {Object.<string,*>} object Plain object
|
95792
|
+
* @returns {TW.Pactus.Proto.TransactionMessage} TransactionMessage
|
95793
|
+
*/
|
95794
|
+
TransactionMessage.fromObject = function fromObject(object) {
|
95795
|
+
if (object instanceof $root.TW.Pactus.Proto.TransactionMessage)
|
95796
|
+
return object;
|
95797
|
+
var message = new $root.TW.Pactus.Proto.TransactionMessage();
|
95798
|
+
if (object.lockTime != null)
|
95799
|
+
message.lockTime = object.lockTime >>> 0;
|
95800
|
+
if (object.fee != null)
|
95801
|
+
if ($util.Long)
|
95802
|
+
(message.fee = $util.Long.fromValue(object.fee)).unsigned = false;
|
95803
|
+
else if (typeof object.fee === "string")
|
95804
|
+
message.fee = parseInt(object.fee, 10);
|
95805
|
+
else if (typeof object.fee === "number")
|
95806
|
+
message.fee = object.fee;
|
95807
|
+
else if (typeof object.fee === "object")
|
95808
|
+
message.fee = new $util.LongBits(object.fee.low >>> 0, object.fee.high >>> 0).toNumber();
|
95809
|
+
if (object.memo != null)
|
95810
|
+
message.memo = String(object.memo);
|
95811
|
+
if (object.transfer != null) {
|
95812
|
+
if (typeof object.transfer !== "object")
|
95813
|
+
throw TypeError(".TW.Pactus.Proto.TransactionMessage.transfer: object expected");
|
95814
|
+
message.transfer = $root.TW.Pactus.Proto.TransferPayload.fromObject(object.transfer);
|
95815
|
+
}
|
95816
|
+
if (object.bond != null) {
|
95817
|
+
if (typeof object.bond !== "object")
|
95818
|
+
throw TypeError(".TW.Pactus.Proto.TransactionMessage.bond: object expected");
|
95819
|
+
message.bond = $root.TW.Pactus.Proto.BondPayload.fromObject(object.bond);
|
95820
|
+
}
|
95821
|
+
return message;
|
95822
|
+
};
|
95823
|
+
|
95824
|
+
/**
|
95825
|
+
* Creates a plain object from a TransactionMessage message. Also converts values to other types if specified.
|
95826
|
+
* @function toObject
|
95827
|
+
* @memberof TW.Pactus.Proto.TransactionMessage
|
95828
|
+
* @static
|
95829
|
+
* @param {TW.Pactus.Proto.TransactionMessage} message TransactionMessage
|
95830
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
95831
|
+
* @returns {Object.<string,*>} Plain object
|
95832
|
+
*/
|
95833
|
+
TransactionMessage.toObject = function toObject(message, options) {
|
95834
|
+
if (!options)
|
95835
|
+
options = {};
|
95836
|
+
var object = {};
|
95837
|
+
if (options.defaults) {
|
95838
|
+
object.lockTime = 0;
|
95839
|
+
if ($util.Long) {
|
95840
|
+
var long = new $util.Long(0, 0, false);
|
95841
|
+
object.fee = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
95842
|
+
} else
|
95843
|
+
object.fee = options.longs === String ? "0" : 0;
|
95844
|
+
object.memo = "";
|
95845
|
+
}
|
95846
|
+
if (message.lockTime != null && message.hasOwnProperty("lockTime"))
|
95847
|
+
object.lockTime = message.lockTime;
|
95848
|
+
if (message.fee != null && message.hasOwnProperty("fee"))
|
95849
|
+
if (typeof message.fee === "number")
|
95850
|
+
object.fee = options.longs === String ? String(message.fee) : message.fee;
|
95851
|
+
else
|
95852
|
+
object.fee = options.longs === String ? $util.Long.prototype.toString.call(message.fee) : options.longs === Number ? new $util.LongBits(message.fee.low >>> 0, message.fee.high >>> 0).toNumber() : message.fee;
|
95853
|
+
if (message.memo != null && message.hasOwnProperty("memo"))
|
95854
|
+
object.memo = message.memo;
|
95855
|
+
if (message.transfer != null && message.hasOwnProperty("transfer")) {
|
95856
|
+
object.transfer = $root.TW.Pactus.Proto.TransferPayload.toObject(message.transfer, options);
|
95857
|
+
if (options.oneofs)
|
95858
|
+
object.payload = "transfer";
|
95859
|
+
}
|
95860
|
+
if (message.bond != null && message.hasOwnProperty("bond")) {
|
95861
|
+
object.bond = $root.TW.Pactus.Proto.BondPayload.toObject(message.bond, options);
|
95862
|
+
if (options.oneofs)
|
95863
|
+
object.payload = "bond";
|
95864
|
+
}
|
95865
|
+
return object;
|
95866
|
+
};
|
95867
|
+
|
95868
|
+
/**
|
95869
|
+
* Converts this TransactionMessage to JSON.
|
95870
|
+
* @function toJSON
|
95871
|
+
* @memberof TW.Pactus.Proto.TransactionMessage
|
95872
|
+
* @instance
|
95873
|
+
* @returns {Object.<string,*>} JSON object
|
95874
|
+
*/
|
95875
|
+
TransactionMessage.prototype.toJSON = function toJSON() {
|
95876
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
95877
|
+
};
|
95878
|
+
|
95879
|
+
return TransactionMessage;
|
95880
|
+
})();
|
95881
|
+
|
95882
|
+
Proto.TransferPayload = (function() {
|
95883
|
+
|
95884
|
+
/**
|
95885
|
+
* Properties of a TransferPayload.
|
95886
|
+
* @memberof TW.Pactus.Proto
|
95887
|
+
* @interface ITransferPayload
|
95888
|
+
* @property {string|null} [sender] TransferPayload sender
|
95889
|
+
* @property {string|null} [receiver] TransferPayload receiver
|
95890
|
+
* @property {Long|null} [amount] TransferPayload amount
|
95891
|
+
*/
|
95892
|
+
|
95893
|
+
/**
|
95894
|
+
* Constructs a new TransferPayload.
|
95895
|
+
* @memberof TW.Pactus.Proto
|
95896
|
+
* @classdesc Represents a TransferPayload.
|
95897
|
+
* @implements ITransferPayload
|
95898
|
+
* @constructor
|
95899
|
+
* @param {TW.Pactus.Proto.ITransferPayload=} [properties] Properties to set
|
95900
|
+
*/
|
95901
|
+
function TransferPayload(properties) {
|
95902
|
+
if (properties)
|
95903
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
95904
|
+
if (properties[keys[i]] != null)
|
95905
|
+
this[keys[i]] = properties[keys[i]];
|
95906
|
+
}
|
95907
|
+
|
95908
|
+
/**
|
95909
|
+
* TransferPayload sender.
|
95910
|
+
* @member {string} sender
|
95911
|
+
* @memberof TW.Pactus.Proto.TransferPayload
|
95912
|
+
* @instance
|
95913
|
+
*/
|
95914
|
+
TransferPayload.prototype.sender = "";
|
95915
|
+
|
95916
|
+
/**
|
95917
|
+
* TransferPayload receiver.
|
95918
|
+
* @member {string} receiver
|
95919
|
+
* @memberof TW.Pactus.Proto.TransferPayload
|
95920
|
+
* @instance
|
95921
|
+
*/
|
95922
|
+
TransferPayload.prototype.receiver = "";
|
95923
|
+
|
95924
|
+
/**
|
95925
|
+
* TransferPayload amount.
|
95926
|
+
* @member {Long} amount
|
95927
|
+
* @memberof TW.Pactus.Proto.TransferPayload
|
95928
|
+
* @instance
|
95929
|
+
*/
|
95930
|
+
TransferPayload.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
95931
|
+
|
95932
|
+
/**
|
95933
|
+
* Creates a new TransferPayload instance using the specified properties.
|
95934
|
+
* @function create
|
95935
|
+
* @memberof TW.Pactus.Proto.TransferPayload
|
95936
|
+
* @static
|
95937
|
+
* @param {TW.Pactus.Proto.ITransferPayload=} [properties] Properties to set
|
95938
|
+
* @returns {TW.Pactus.Proto.TransferPayload} TransferPayload instance
|
95939
|
+
*/
|
95940
|
+
TransferPayload.create = function create(properties) {
|
95941
|
+
return new TransferPayload(properties);
|
95942
|
+
};
|
95943
|
+
|
95944
|
+
/**
|
95945
|
+
* Encodes the specified TransferPayload message. Does not implicitly {@link TW.Pactus.Proto.TransferPayload.verify|verify} messages.
|
95946
|
+
* @function encode
|
95947
|
+
* @memberof TW.Pactus.Proto.TransferPayload
|
95948
|
+
* @static
|
95949
|
+
* @param {TW.Pactus.Proto.ITransferPayload} message TransferPayload message or plain object to encode
|
95950
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
95951
|
+
* @returns {$protobuf.Writer} Writer
|
95952
|
+
*/
|
95953
|
+
TransferPayload.encode = function encode(message, writer) {
|
95954
|
+
if (!writer)
|
95955
|
+
writer = $Writer.create();
|
95956
|
+
if (message.sender != null && Object.hasOwnProperty.call(message, "sender"))
|
95957
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.sender);
|
95958
|
+
if (message.receiver != null && Object.hasOwnProperty.call(message, "receiver"))
|
95959
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.receiver);
|
95960
|
+
if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
|
95961
|
+
writer.uint32(/* id 3, wireType 0 =*/24).int64(message.amount);
|
95962
|
+
return writer;
|
95963
|
+
};
|
95964
|
+
|
95965
|
+
/**
|
95966
|
+
* Decodes a TransferPayload message from the specified reader or buffer.
|
95967
|
+
* @function decode
|
95968
|
+
* @memberof TW.Pactus.Proto.TransferPayload
|
95969
|
+
* @static
|
95970
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
95971
|
+
* @param {number} [length] Message length if known beforehand
|
95972
|
+
* @returns {TW.Pactus.Proto.TransferPayload} TransferPayload
|
95973
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
95974
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
95975
|
+
*/
|
95976
|
+
TransferPayload.decode = function decode(reader, length) {
|
95977
|
+
if (!(reader instanceof $Reader))
|
95978
|
+
reader = $Reader.create(reader);
|
95979
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.TransferPayload();
|
95980
|
+
while (reader.pos < end) {
|
95981
|
+
var tag = reader.uint32();
|
95982
|
+
switch (tag >>> 3) {
|
95983
|
+
case 1:
|
95984
|
+
message.sender = reader.string();
|
95985
|
+
break;
|
95986
|
+
case 2:
|
95987
|
+
message.receiver = reader.string();
|
95988
|
+
break;
|
95989
|
+
case 3:
|
95990
|
+
message.amount = reader.int64();
|
95991
|
+
break;
|
95992
|
+
default:
|
95993
|
+
reader.skipType(tag & 7);
|
95994
|
+
break;
|
95995
|
+
}
|
95996
|
+
}
|
95997
|
+
return message;
|
95998
|
+
};
|
95999
|
+
|
96000
|
+
/**
|
96001
|
+
* Verifies a TransferPayload message.
|
96002
|
+
* @function verify
|
96003
|
+
* @memberof TW.Pactus.Proto.TransferPayload
|
96004
|
+
* @static
|
96005
|
+
* @param {Object.<string,*>} message Plain object to verify
|
96006
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
96007
|
+
*/
|
96008
|
+
TransferPayload.verify = function verify(message) {
|
96009
|
+
if (typeof message !== "object" || message === null)
|
96010
|
+
return "object expected";
|
96011
|
+
if (message.sender != null && message.hasOwnProperty("sender"))
|
96012
|
+
if (!$util.isString(message.sender))
|
96013
|
+
return "sender: string expected";
|
96014
|
+
if (message.receiver != null && message.hasOwnProperty("receiver"))
|
96015
|
+
if (!$util.isString(message.receiver))
|
96016
|
+
return "receiver: string expected";
|
96017
|
+
if (message.amount != null && message.hasOwnProperty("amount"))
|
96018
|
+
if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high)))
|
96019
|
+
return "amount: integer|Long expected";
|
96020
|
+
return null;
|
96021
|
+
};
|
96022
|
+
|
96023
|
+
/**
|
96024
|
+
* Creates a TransferPayload message from a plain object. Also converts values to their respective internal types.
|
96025
|
+
* @function fromObject
|
96026
|
+
* @memberof TW.Pactus.Proto.TransferPayload
|
96027
|
+
* @static
|
96028
|
+
* @param {Object.<string,*>} object Plain object
|
96029
|
+
* @returns {TW.Pactus.Proto.TransferPayload} TransferPayload
|
96030
|
+
*/
|
96031
|
+
TransferPayload.fromObject = function fromObject(object) {
|
96032
|
+
if (object instanceof $root.TW.Pactus.Proto.TransferPayload)
|
96033
|
+
return object;
|
96034
|
+
var message = new $root.TW.Pactus.Proto.TransferPayload();
|
96035
|
+
if (object.sender != null)
|
96036
|
+
message.sender = String(object.sender);
|
96037
|
+
if (object.receiver != null)
|
96038
|
+
message.receiver = String(object.receiver);
|
96039
|
+
if (object.amount != null)
|
96040
|
+
if ($util.Long)
|
96041
|
+
(message.amount = $util.Long.fromValue(object.amount)).unsigned = false;
|
96042
|
+
else if (typeof object.amount === "string")
|
96043
|
+
message.amount = parseInt(object.amount, 10);
|
96044
|
+
else if (typeof object.amount === "number")
|
96045
|
+
message.amount = object.amount;
|
96046
|
+
else if (typeof object.amount === "object")
|
96047
|
+
message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber();
|
96048
|
+
return message;
|
96049
|
+
};
|
96050
|
+
|
96051
|
+
/**
|
96052
|
+
* Creates a plain object from a TransferPayload message. Also converts values to other types if specified.
|
96053
|
+
* @function toObject
|
96054
|
+
* @memberof TW.Pactus.Proto.TransferPayload
|
96055
|
+
* @static
|
96056
|
+
* @param {TW.Pactus.Proto.TransferPayload} message TransferPayload
|
96057
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
96058
|
+
* @returns {Object.<string,*>} Plain object
|
96059
|
+
*/
|
96060
|
+
TransferPayload.toObject = function toObject(message, options) {
|
96061
|
+
if (!options)
|
96062
|
+
options = {};
|
96063
|
+
var object = {};
|
96064
|
+
if (options.defaults) {
|
96065
|
+
object.sender = "";
|
96066
|
+
object.receiver = "";
|
96067
|
+
if ($util.Long) {
|
96068
|
+
var long = new $util.Long(0, 0, false);
|
96069
|
+
object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
96070
|
+
} else
|
96071
|
+
object.amount = options.longs === String ? "0" : 0;
|
96072
|
+
}
|
96073
|
+
if (message.sender != null && message.hasOwnProperty("sender"))
|
96074
|
+
object.sender = message.sender;
|
96075
|
+
if (message.receiver != null && message.hasOwnProperty("receiver"))
|
96076
|
+
object.receiver = message.receiver;
|
96077
|
+
if (message.amount != null && message.hasOwnProperty("amount"))
|
96078
|
+
if (typeof message.amount === "number")
|
96079
|
+
object.amount = options.longs === String ? String(message.amount) : message.amount;
|
96080
|
+
else
|
96081
|
+
object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber() : message.amount;
|
96082
|
+
return object;
|
96083
|
+
};
|
96084
|
+
|
96085
|
+
/**
|
96086
|
+
* Converts this TransferPayload to JSON.
|
96087
|
+
* @function toJSON
|
96088
|
+
* @memberof TW.Pactus.Proto.TransferPayload
|
96089
|
+
* @instance
|
96090
|
+
* @returns {Object.<string,*>} JSON object
|
96091
|
+
*/
|
96092
|
+
TransferPayload.prototype.toJSON = function toJSON() {
|
96093
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
96094
|
+
};
|
96095
|
+
|
96096
|
+
return TransferPayload;
|
96097
|
+
})();
|
96098
|
+
|
96099
|
+
Proto.BondPayload = (function() {
|
96100
|
+
|
96101
|
+
/**
|
96102
|
+
* Properties of a BondPayload.
|
96103
|
+
* @memberof TW.Pactus.Proto
|
96104
|
+
* @interface IBondPayload
|
96105
|
+
* @property {string|null} [sender] BondPayload sender
|
96106
|
+
* @property {string|null} [receiver] BondPayload receiver
|
96107
|
+
* @property {Long|null} [stake] BondPayload stake
|
96108
|
+
* @property {string|null} [publicKey] BondPayload publicKey
|
96109
|
+
*/
|
96110
|
+
|
96111
|
+
/**
|
96112
|
+
* Constructs a new BondPayload.
|
96113
|
+
* @memberof TW.Pactus.Proto
|
96114
|
+
* @classdesc Represents a BondPayload.
|
96115
|
+
* @implements IBondPayload
|
96116
|
+
* @constructor
|
96117
|
+
* @param {TW.Pactus.Proto.IBondPayload=} [properties] Properties to set
|
96118
|
+
*/
|
96119
|
+
function BondPayload(properties) {
|
96120
|
+
if (properties)
|
96121
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
96122
|
+
if (properties[keys[i]] != null)
|
96123
|
+
this[keys[i]] = properties[keys[i]];
|
96124
|
+
}
|
96125
|
+
|
96126
|
+
/**
|
96127
|
+
* BondPayload sender.
|
96128
|
+
* @member {string} sender
|
96129
|
+
* @memberof TW.Pactus.Proto.BondPayload
|
96130
|
+
* @instance
|
96131
|
+
*/
|
96132
|
+
BondPayload.prototype.sender = "";
|
96133
|
+
|
96134
|
+
/**
|
96135
|
+
* BondPayload receiver.
|
96136
|
+
* @member {string} receiver
|
96137
|
+
* @memberof TW.Pactus.Proto.BondPayload
|
96138
|
+
* @instance
|
96139
|
+
*/
|
96140
|
+
BondPayload.prototype.receiver = "";
|
96141
|
+
|
96142
|
+
/**
|
96143
|
+
* BondPayload stake.
|
96144
|
+
* @member {Long} stake
|
96145
|
+
* @memberof TW.Pactus.Proto.BondPayload
|
96146
|
+
* @instance
|
96147
|
+
*/
|
96148
|
+
BondPayload.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
96149
|
+
|
96150
|
+
/**
|
96151
|
+
* BondPayload publicKey.
|
96152
|
+
* @member {string} publicKey
|
96153
|
+
* @memberof TW.Pactus.Proto.BondPayload
|
96154
|
+
* @instance
|
96155
|
+
*/
|
96156
|
+
BondPayload.prototype.publicKey = "";
|
96157
|
+
|
96158
|
+
/**
|
96159
|
+
* Creates a new BondPayload instance using the specified properties.
|
96160
|
+
* @function create
|
96161
|
+
* @memberof TW.Pactus.Proto.BondPayload
|
96162
|
+
* @static
|
96163
|
+
* @param {TW.Pactus.Proto.IBondPayload=} [properties] Properties to set
|
96164
|
+
* @returns {TW.Pactus.Proto.BondPayload} BondPayload instance
|
96165
|
+
*/
|
96166
|
+
BondPayload.create = function create(properties) {
|
96167
|
+
return new BondPayload(properties);
|
96168
|
+
};
|
96169
|
+
|
96170
|
+
/**
|
96171
|
+
* Encodes the specified BondPayload message. Does not implicitly {@link TW.Pactus.Proto.BondPayload.verify|verify} messages.
|
96172
|
+
* @function encode
|
96173
|
+
* @memberof TW.Pactus.Proto.BondPayload
|
96174
|
+
* @static
|
96175
|
+
* @param {TW.Pactus.Proto.IBondPayload} message BondPayload message or plain object to encode
|
96176
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
96177
|
+
* @returns {$protobuf.Writer} Writer
|
96178
|
+
*/
|
96179
|
+
BondPayload.encode = function encode(message, writer) {
|
96180
|
+
if (!writer)
|
96181
|
+
writer = $Writer.create();
|
96182
|
+
if (message.sender != null && Object.hasOwnProperty.call(message, "sender"))
|
96183
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.sender);
|
96184
|
+
if (message.receiver != null && Object.hasOwnProperty.call(message, "receiver"))
|
96185
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.receiver);
|
96186
|
+
if (message.stake != null && Object.hasOwnProperty.call(message, "stake"))
|
96187
|
+
writer.uint32(/* id 3, wireType 0 =*/24).int64(message.stake);
|
96188
|
+
if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey"))
|
96189
|
+
writer.uint32(/* id 4, wireType 2 =*/34).string(message.publicKey);
|
96190
|
+
return writer;
|
96191
|
+
};
|
96192
|
+
|
96193
|
+
/**
|
96194
|
+
* Decodes a BondPayload message from the specified reader or buffer.
|
96195
|
+
* @function decode
|
96196
|
+
* @memberof TW.Pactus.Proto.BondPayload
|
96197
|
+
* @static
|
96198
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
96199
|
+
* @param {number} [length] Message length if known beforehand
|
96200
|
+
* @returns {TW.Pactus.Proto.BondPayload} BondPayload
|
96201
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
96202
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
96203
|
+
*/
|
96204
|
+
BondPayload.decode = function decode(reader, length) {
|
96205
|
+
if (!(reader instanceof $Reader))
|
96206
|
+
reader = $Reader.create(reader);
|
96207
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.BondPayload();
|
96208
|
+
while (reader.pos < end) {
|
96209
|
+
var tag = reader.uint32();
|
96210
|
+
switch (tag >>> 3) {
|
96211
|
+
case 1:
|
96212
|
+
message.sender = reader.string();
|
96213
|
+
break;
|
96214
|
+
case 2:
|
96215
|
+
message.receiver = reader.string();
|
96216
|
+
break;
|
96217
|
+
case 3:
|
96218
|
+
message.stake = reader.int64();
|
96219
|
+
break;
|
96220
|
+
case 4:
|
96221
|
+
message.publicKey = reader.string();
|
96222
|
+
break;
|
96223
|
+
default:
|
96224
|
+
reader.skipType(tag & 7);
|
96225
|
+
break;
|
96226
|
+
}
|
96227
|
+
}
|
96228
|
+
return message;
|
96229
|
+
};
|
96230
|
+
|
96231
|
+
/**
|
96232
|
+
* Verifies a BondPayload message.
|
96233
|
+
* @function verify
|
96234
|
+
* @memberof TW.Pactus.Proto.BondPayload
|
96235
|
+
* @static
|
96236
|
+
* @param {Object.<string,*>} message Plain object to verify
|
96237
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
96238
|
+
*/
|
96239
|
+
BondPayload.verify = function verify(message) {
|
96240
|
+
if (typeof message !== "object" || message === null)
|
96241
|
+
return "object expected";
|
96242
|
+
if (message.sender != null && message.hasOwnProperty("sender"))
|
96243
|
+
if (!$util.isString(message.sender))
|
96244
|
+
return "sender: string expected";
|
96245
|
+
if (message.receiver != null && message.hasOwnProperty("receiver"))
|
96246
|
+
if (!$util.isString(message.receiver))
|
96247
|
+
return "receiver: string expected";
|
96248
|
+
if (message.stake != null && message.hasOwnProperty("stake"))
|
96249
|
+
if (!$util.isInteger(message.stake) && !(message.stake && $util.isInteger(message.stake.low) && $util.isInteger(message.stake.high)))
|
96250
|
+
return "stake: integer|Long expected";
|
96251
|
+
if (message.publicKey != null && message.hasOwnProperty("publicKey"))
|
96252
|
+
if (!$util.isString(message.publicKey))
|
96253
|
+
return "publicKey: string expected";
|
96254
|
+
return null;
|
96255
|
+
};
|
96256
|
+
|
96257
|
+
/**
|
96258
|
+
* Creates a BondPayload message from a plain object. Also converts values to their respective internal types.
|
96259
|
+
* @function fromObject
|
96260
|
+
* @memberof TW.Pactus.Proto.BondPayload
|
96261
|
+
* @static
|
96262
|
+
* @param {Object.<string,*>} object Plain object
|
96263
|
+
* @returns {TW.Pactus.Proto.BondPayload} BondPayload
|
96264
|
+
*/
|
96265
|
+
BondPayload.fromObject = function fromObject(object) {
|
96266
|
+
if (object instanceof $root.TW.Pactus.Proto.BondPayload)
|
96267
|
+
return object;
|
96268
|
+
var message = new $root.TW.Pactus.Proto.BondPayload();
|
96269
|
+
if (object.sender != null)
|
96270
|
+
message.sender = String(object.sender);
|
96271
|
+
if (object.receiver != null)
|
96272
|
+
message.receiver = String(object.receiver);
|
96273
|
+
if (object.stake != null)
|
96274
|
+
if ($util.Long)
|
96275
|
+
(message.stake = $util.Long.fromValue(object.stake)).unsigned = false;
|
96276
|
+
else if (typeof object.stake === "string")
|
96277
|
+
message.stake = parseInt(object.stake, 10);
|
96278
|
+
else if (typeof object.stake === "number")
|
96279
|
+
message.stake = object.stake;
|
96280
|
+
else if (typeof object.stake === "object")
|
96281
|
+
message.stake = new $util.LongBits(object.stake.low >>> 0, object.stake.high >>> 0).toNumber();
|
96282
|
+
if (object.publicKey != null)
|
96283
|
+
message.publicKey = String(object.publicKey);
|
96284
|
+
return message;
|
96285
|
+
};
|
96286
|
+
|
96287
|
+
/**
|
96288
|
+
* Creates a plain object from a BondPayload message. Also converts values to other types if specified.
|
96289
|
+
* @function toObject
|
96290
|
+
* @memberof TW.Pactus.Proto.BondPayload
|
96291
|
+
* @static
|
96292
|
+
* @param {TW.Pactus.Proto.BondPayload} message BondPayload
|
96293
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
96294
|
+
* @returns {Object.<string,*>} Plain object
|
96295
|
+
*/
|
96296
|
+
BondPayload.toObject = function toObject(message, options) {
|
96297
|
+
if (!options)
|
96298
|
+
options = {};
|
96299
|
+
var object = {};
|
96300
|
+
if (options.defaults) {
|
96301
|
+
object.sender = "";
|
96302
|
+
object.receiver = "";
|
96303
|
+
if ($util.Long) {
|
96304
|
+
var long = new $util.Long(0, 0, false);
|
96305
|
+
object.stake = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
96306
|
+
} else
|
96307
|
+
object.stake = options.longs === String ? "0" : 0;
|
96308
|
+
object.publicKey = "";
|
96309
|
+
}
|
96310
|
+
if (message.sender != null && message.hasOwnProperty("sender"))
|
96311
|
+
object.sender = message.sender;
|
96312
|
+
if (message.receiver != null && message.hasOwnProperty("receiver"))
|
96313
|
+
object.receiver = message.receiver;
|
96314
|
+
if (message.stake != null && message.hasOwnProperty("stake"))
|
96315
|
+
if (typeof message.stake === "number")
|
96316
|
+
object.stake = options.longs === String ? String(message.stake) : message.stake;
|
96317
|
+
else
|
96318
|
+
object.stake = options.longs === String ? $util.Long.prototype.toString.call(message.stake) : options.longs === Number ? new $util.LongBits(message.stake.low >>> 0, message.stake.high >>> 0).toNumber() : message.stake;
|
96319
|
+
if (message.publicKey != null && message.hasOwnProperty("publicKey"))
|
96320
|
+
object.publicKey = message.publicKey;
|
96321
|
+
return object;
|
96322
|
+
};
|
96323
|
+
|
96324
|
+
/**
|
96325
|
+
* Converts this BondPayload to JSON.
|
96326
|
+
* @function toJSON
|
96327
|
+
* @memberof TW.Pactus.Proto.BondPayload
|
96328
|
+
* @instance
|
96329
|
+
* @returns {Object.<string,*>} JSON object
|
96330
|
+
*/
|
96331
|
+
BondPayload.prototype.toJSON = function toJSON() {
|
96332
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
96333
|
+
};
|
96334
|
+
|
96335
|
+
return BondPayload;
|
96336
|
+
})();
|
96337
|
+
|
96338
|
+
Proto.SigningInput = (function() {
|
96339
|
+
|
96340
|
+
/**
|
96341
|
+
* Properties of a SigningInput.
|
96342
|
+
* @memberof TW.Pactus.Proto
|
96343
|
+
* @interface ISigningInput
|
96344
|
+
* @property {Uint8Array|null} [privateKey] SigningInput privateKey
|
96345
|
+
* @property {TW.Pactus.Proto.ITransactionMessage|null} [transaction] SigningInput transaction
|
96346
|
+
*/
|
96347
|
+
|
96348
|
+
/**
|
96349
|
+
* Constructs a new SigningInput.
|
96350
|
+
* @memberof TW.Pactus.Proto
|
96351
|
+
* @classdesc Represents a SigningInput.
|
96352
|
+
* @implements ISigningInput
|
96353
|
+
* @constructor
|
96354
|
+
* @param {TW.Pactus.Proto.ISigningInput=} [properties] Properties to set
|
96355
|
+
*/
|
96356
|
+
function SigningInput(properties) {
|
96357
|
+
if (properties)
|
96358
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
96359
|
+
if (properties[keys[i]] != null)
|
96360
|
+
this[keys[i]] = properties[keys[i]];
|
96361
|
+
}
|
96362
|
+
|
96363
|
+
/**
|
96364
|
+
* SigningInput privateKey.
|
96365
|
+
* @member {Uint8Array} privateKey
|
96366
|
+
* @memberof TW.Pactus.Proto.SigningInput
|
96367
|
+
* @instance
|
96368
|
+
*/
|
96369
|
+
SigningInput.prototype.privateKey = $util.newBuffer([]);
|
96370
|
+
|
96371
|
+
/**
|
96372
|
+
* SigningInput transaction.
|
96373
|
+
* @member {TW.Pactus.Proto.ITransactionMessage|null|undefined} transaction
|
96374
|
+
* @memberof TW.Pactus.Proto.SigningInput
|
96375
|
+
* @instance
|
96376
|
+
*/
|
96377
|
+
SigningInput.prototype.transaction = null;
|
96378
|
+
|
96379
|
+
/**
|
96380
|
+
* Creates a new SigningInput instance using the specified properties.
|
96381
|
+
* @function create
|
96382
|
+
* @memberof TW.Pactus.Proto.SigningInput
|
96383
|
+
* @static
|
96384
|
+
* @param {TW.Pactus.Proto.ISigningInput=} [properties] Properties to set
|
96385
|
+
* @returns {TW.Pactus.Proto.SigningInput} SigningInput instance
|
96386
|
+
*/
|
96387
|
+
SigningInput.create = function create(properties) {
|
96388
|
+
return new SigningInput(properties);
|
96389
|
+
};
|
96390
|
+
|
96391
|
+
/**
|
96392
|
+
* Encodes the specified SigningInput message. Does not implicitly {@link TW.Pactus.Proto.SigningInput.verify|verify} messages.
|
96393
|
+
* @function encode
|
96394
|
+
* @memberof TW.Pactus.Proto.SigningInput
|
96395
|
+
* @static
|
96396
|
+
* @param {TW.Pactus.Proto.ISigningInput} message SigningInput message or plain object to encode
|
96397
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
96398
|
+
* @returns {$protobuf.Writer} Writer
|
96399
|
+
*/
|
96400
|
+
SigningInput.encode = function encode(message, writer) {
|
96401
|
+
if (!writer)
|
96402
|
+
writer = $Writer.create();
|
96403
|
+
if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey"))
|
96404
|
+
writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.privateKey);
|
96405
|
+
if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction"))
|
96406
|
+
$root.TW.Pactus.Proto.TransactionMessage.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
96407
|
+
return writer;
|
96408
|
+
};
|
96409
|
+
|
96410
|
+
/**
|
96411
|
+
* Decodes a SigningInput message from the specified reader or buffer.
|
96412
|
+
* @function decode
|
96413
|
+
* @memberof TW.Pactus.Proto.SigningInput
|
96414
|
+
* @static
|
96415
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
96416
|
+
* @param {number} [length] Message length if known beforehand
|
96417
|
+
* @returns {TW.Pactus.Proto.SigningInput} SigningInput
|
96418
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
96419
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
96420
|
+
*/
|
96421
|
+
SigningInput.decode = function decode(reader, length) {
|
96422
|
+
if (!(reader instanceof $Reader))
|
96423
|
+
reader = $Reader.create(reader);
|
96424
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.SigningInput();
|
96425
|
+
while (reader.pos < end) {
|
96426
|
+
var tag = reader.uint32();
|
96427
|
+
switch (tag >>> 3) {
|
96428
|
+
case 1:
|
96429
|
+
message.privateKey = reader.bytes();
|
96430
|
+
break;
|
96431
|
+
case 2:
|
96432
|
+
message.transaction = $root.TW.Pactus.Proto.TransactionMessage.decode(reader, reader.uint32());
|
96433
|
+
break;
|
96434
|
+
default:
|
96435
|
+
reader.skipType(tag & 7);
|
96436
|
+
break;
|
96437
|
+
}
|
96438
|
+
}
|
96439
|
+
return message;
|
96440
|
+
};
|
96441
|
+
|
96442
|
+
/**
|
96443
|
+
* Verifies a SigningInput message.
|
96444
|
+
* @function verify
|
96445
|
+
* @memberof TW.Pactus.Proto.SigningInput
|
96446
|
+
* @static
|
96447
|
+
* @param {Object.<string,*>} message Plain object to verify
|
96448
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
96449
|
+
*/
|
96450
|
+
SigningInput.verify = function verify(message) {
|
96451
|
+
if (typeof message !== "object" || message === null)
|
96452
|
+
return "object expected";
|
96453
|
+
if (message.privateKey != null && message.hasOwnProperty("privateKey"))
|
96454
|
+
if (!(message.privateKey && typeof message.privateKey.length === "number" || $util.isString(message.privateKey)))
|
96455
|
+
return "privateKey: buffer expected";
|
96456
|
+
if (message.transaction != null && message.hasOwnProperty("transaction")) {
|
96457
|
+
var error = $root.TW.Pactus.Proto.TransactionMessage.verify(message.transaction);
|
96458
|
+
if (error)
|
96459
|
+
return "transaction." + error;
|
96460
|
+
}
|
96461
|
+
return null;
|
96462
|
+
};
|
96463
|
+
|
96464
|
+
/**
|
96465
|
+
* Creates a SigningInput message from a plain object. Also converts values to their respective internal types.
|
96466
|
+
* @function fromObject
|
96467
|
+
* @memberof TW.Pactus.Proto.SigningInput
|
96468
|
+
* @static
|
96469
|
+
* @param {Object.<string,*>} object Plain object
|
96470
|
+
* @returns {TW.Pactus.Proto.SigningInput} SigningInput
|
96471
|
+
*/
|
96472
|
+
SigningInput.fromObject = function fromObject(object) {
|
96473
|
+
if (object instanceof $root.TW.Pactus.Proto.SigningInput)
|
96474
|
+
return object;
|
96475
|
+
var message = new $root.TW.Pactus.Proto.SigningInput();
|
96476
|
+
if (object.privateKey != null)
|
96477
|
+
if (typeof object.privateKey === "string")
|
96478
|
+
$util.base64.decode(object.privateKey, message.privateKey = $util.newBuffer($util.base64.length(object.privateKey)), 0);
|
96479
|
+
else if (object.privateKey.length)
|
96480
|
+
message.privateKey = object.privateKey;
|
96481
|
+
if (object.transaction != null) {
|
96482
|
+
if (typeof object.transaction !== "object")
|
96483
|
+
throw TypeError(".TW.Pactus.Proto.SigningInput.transaction: object expected");
|
96484
|
+
message.transaction = $root.TW.Pactus.Proto.TransactionMessage.fromObject(object.transaction);
|
96485
|
+
}
|
96486
|
+
return message;
|
96487
|
+
};
|
96488
|
+
|
96489
|
+
/**
|
96490
|
+
* Creates a plain object from a SigningInput message. Also converts values to other types if specified.
|
96491
|
+
* @function toObject
|
96492
|
+
* @memberof TW.Pactus.Proto.SigningInput
|
96493
|
+
* @static
|
96494
|
+
* @param {TW.Pactus.Proto.SigningInput} message SigningInput
|
96495
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
96496
|
+
* @returns {Object.<string,*>} Plain object
|
96497
|
+
*/
|
96498
|
+
SigningInput.toObject = function toObject(message, options) {
|
96499
|
+
if (!options)
|
96500
|
+
options = {};
|
96501
|
+
var object = {};
|
96502
|
+
if (options.defaults) {
|
96503
|
+
if (options.bytes === String)
|
96504
|
+
object.privateKey = "";
|
96505
|
+
else {
|
96506
|
+
object.privateKey = [];
|
96507
|
+
if (options.bytes !== Array)
|
96508
|
+
object.privateKey = $util.newBuffer(object.privateKey);
|
96509
|
+
}
|
96510
|
+
object.transaction = null;
|
96511
|
+
}
|
96512
|
+
if (message.privateKey != null && message.hasOwnProperty("privateKey"))
|
96513
|
+
object.privateKey = options.bytes === String ? $util.base64.encode(message.privateKey, 0, message.privateKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.privateKey) : message.privateKey;
|
96514
|
+
if (message.transaction != null && message.hasOwnProperty("transaction"))
|
96515
|
+
object.transaction = $root.TW.Pactus.Proto.TransactionMessage.toObject(message.transaction, options);
|
96516
|
+
return object;
|
96517
|
+
};
|
96518
|
+
|
96519
|
+
/**
|
96520
|
+
* Converts this SigningInput to JSON.
|
96521
|
+
* @function toJSON
|
96522
|
+
* @memberof TW.Pactus.Proto.SigningInput
|
96523
|
+
* @instance
|
96524
|
+
* @returns {Object.<string,*>} JSON object
|
96525
|
+
*/
|
96526
|
+
SigningInput.prototype.toJSON = function toJSON() {
|
96527
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
96528
|
+
};
|
96529
|
+
|
96530
|
+
return SigningInput;
|
96531
|
+
})();
|
96532
|
+
|
96533
|
+
Proto.SigningOutput = (function() {
|
96534
|
+
|
96535
|
+
/**
|
96536
|
+
* Properties of a SigningOutput.
|
96537
|
+
* @memberof TW.Pactus.Proto
|
96538
|
+
* @interface ISigningOutput
|
96539
|
+
* @property {Uint8Array|null} [transactionId] SigningOutput transactionId
|
96540
|
+
* @property {Uint8Array|null} [signedTransactionData] SigningOutput signedTransactionData
|
96541
|
+
* @property {Uint8Array|null} [signature] SigningOutput signature
|
96542
|
+
* @property {TW.Common.Proto.SigningError|null} [error] SigningOutput error
|
96543
|
+
* @property {string|null} [errorMessage] SigningOutput errorMessage
|
96544
|
+
*/
|
96545
|
+
|
96546
|
+
/**
|
96547
|
+
* Constructs a new SigningOutput.
|
96548
|
+
* @memberof TW.Pactus.Proto
|
96549
|
+
* @classdesc Represents a SigningOutput.
|
96550
|
+
* @implements ISigningOutput
|
96551
|
+
* @constructor
|
96552
|
+
* @param {TW.Pactus.Proto.ISigningOutput=} [properties] Properties to set
|
96553
|
+
*/
|
96554
|
+
function SigningOutput(properties) {
|
96555
|
+
if (properties)
|
96556
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
96557
|
+
if (properties[keys[i]] != null)
|
96558
|
+
this[keys[i]] = properties[keys[i]];
|
96559
|
+
}
|
96560
|
+
|
96561
|
+
/**
|
96562
|
+
* SigningOutput transactionId.
|
96563
|
+
* @member {Uint8Array} transactionId
|
96564
|
+
* @memberof TW.Pactus.Proto.SigningOutput
|
96565
|
+
* @instance
|
96566
|
+
*/
|
96567
|
+
SigningOutput.prototype.transactionId = $util.newBuffer([]);
|
96568
|
+
|
96569
|
+
/**
|
96570
|
+
* SigningOutput signedTransactionData.
|
96571
|
+
* @member {Uint8Array} signedTransactionData
|
96572
|
+
* @memberof TW.Pactus.Proto.SigningOutput
|
96573
|
+
* @instance
|
96574
|
+
*/
|
96575
|
+
SigningOutput.prototype.signedTransactionData = $util.newBuffer([]);
|
96576
|
+
|
96577
|
+
/**
|
96578
|
+
* SigningOutput signature.
|
96579
|
+
* @member {Uint8Array} signature
|
96580
|
+
* @memberof TW.Pactus.Proto.SigningOutput
|
96581
|
+
* @instance
|
96582
|
+
*/
|
96583
|
+
SigningOutput.prototype.signature = $util.newBuffer([]);
|
96584
|
+
|
96585
|
+
/**
|
96586
|
+
* SigningOutput error.
|
96587
|
+
* @member {TW.Common.Proto.SigningError} error
|
96588
|
+
* @memberof TW.Pactus.Proto.SigningOutput
|
96589
|
+
* @instance
|
96590
|
+
*/
|
96591
|
+
SigningOutput.prototype.error = 0;
|
96592
|
+
|
96593
|
+
/**
|
96594
|
+
* SigningOutput errorMessage.
|
96595
|
+
* @member {string} errorMessage
|
96596
|
+
* @memberof TW.Pactus.Proto.SigningOutput
|
96597
|
+
* @instance
|
96598
|
+
*/
|
96599
|
+
SigningOutput.prototype.errorMessage = "";
|
96600
|
+
|
96601
|
+
/**
|
96602
|
+
* Creates a new SigningOutput instance using the specified properties.
|
96603
|
+
* @function create
|
96604
|
+
* @memberof TW.Pactus.Proto.SigningOutput
|
96605
|
+
* @static
|
96606
|
+
* @param {TW.Pactus.Proto.ISigningOutput=} [properties] Properties to set
|
96607
|
+
* @returns {TW.Pactus.Proto.SigningOutput} SigningOutput instance
|
96608
|
+
*/
|
96609
|
+
SigningOutput.create = function create(properties) {
|
96610
|
+
return new SigningOutput(properties);
|
96611
|
+
};
|
96612
|
+
|
96613
|
+
/**
|
96614
|
+
* Encodes the specified SigningOutput message. Does not implicitly {@link TW.Pactus.Proto.SigningOutput.verify|verify} messages.
|
96615
|
+
* @function encode
|
96616
|
+
* @memberof TW.Pactus.Proto.SigningOutput
|
96617
|
+
* @static
|
96618
|
+
* @param {TW.Pactus.Proto.ISigningOutput} message SigningOutput message or plain object to encode
|
96619
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
96620
|
+
* @returns {$protobuf.Writer} Writer
|
96621
|
+
*/
|
96622
|
+
SigningOutput.encode = function encode(message, writer) {
|
96623
|
+
if (!writer)
|
96624
|
+
writer = $Writer.create();
|
96625
|
+
if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId"))
|
96626
|
+
writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transactionId);
|
96627
|
+
if (message.signedTransactionData != null && Object.hasOwnProperty.call(message, "signedTransactionData"))
|
96628
|
+
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.signedTransactionData);
|
96629
|
+
if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
|
96630
|
+
writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signature);
|
96631
|
+
if (message.error != null && Object.hasOwnProperty.call(message, "error"))
|
96632
|
+
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.error);
|
96633
|
+
if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage"))
|
96634
|
+
writer.uint32(/* id 5, wireType 2 =*/42).string(message.errorMessage);
|
96635
|
+
return writer;
|
96636
|
+
};
|
96637
|
+
|
96638
|
+
/**
|
96639
|
+
* Decodes a SigningOutput message from the specified reader or buffer.
|
96640
|
+
* @function decode
|
96641
|
+
* @memberof TW.Pactus.Proto.SigningOutput
|
96642
|
+
* @static
|
96643
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
96644
|
+
* @param {number} [length] Message length if known beforehand
|
96645
|
+
* @returns {TW.Pactus.Proto.SigningOutput} SigningOutput
|
96646
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
96647
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
96648
|
+
*/
|
96649
|
+
SigningOutput.decode = function decode(reader, length) {
|
96650
|
+
if (!(reader instanceof $Reader))
|
96651
|
+
reader = $Reader.create(reader);
|
96652
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.SigningOutput();
|
96653
|
+
while (reader.pos < end) {
|
96654
|
+
var tag = reader.uint32();
|
96655
|
+
switch (tag >>> 3) {
|
96656
|
+
case 1:
|
96657
|
+
message.transactionId = reader.bytes();
|
96658
|
+
break;
|
96659
|
+
case 2:
|
96660
|
+
message.signedTransactionData = reader.bytes();
|
96661
|
+
break;
|
96662
|
+
case 3:
|
96663
|
+
message.signature = reader.bytes();
|
96664
|
+
break;
|
96665
|
+
case 4:
|
96666
|
+
message.error = reader.int32();
|
96667
|
+
break;
|
96668
|
+
case 5:
|
96669
|
+
message.errorMessage = reader.string();
|
96670
|
+
break;
|
96671
|
+
default:
|
96672
|
+
reader.skipType(tag & 7);
|
96673
|
+
break;
|
96674
|
+
}
|
96675
|
+
}
|
96676
|
+
return message;
|
96677
|
+
};
|
96678
|
+
|
96679
|
+
/**
|
96680
|
+
* Verifies a SigningOutput message.
|
96681
|
+
* @function verify
|
96682
|
+
* @memberof TW.Pactus.Proto.SigningOutput
|
96683
|
+
* @static
|
96684
|
+
* @param {Object.<string,*>} message Plain object to verify
|
96685
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
96686
|
+
*/
|
96687
|
+
SigningOutput.verify = function verify(message) {
|
96688
|
+
if (typeof message !== "object" || message === null)
|
96689
|
+
return "object expected";
|
96690
|
+
if (message.transactionId != null && message.hasOwnProperty("transactionId"))
|
96691
|
+
if (!(message.transactionId && typeof message.transactionId.length === "number" || $util.isString(message.transactionId)))
|
96692
|
+
return "transactionId: buffer expected";
|
96693
|
+
if (message.signedTransactionData != null && message.hasOwnProperty("signedTransactionData"))
|
96694
|
+
if (!(message.signedTransactionData && typeof message.signedTransactionData.length === "number" || $util.isString(message.signedTransactionData)))
|
96695
|
+
return "signedTransactionData: buffer expected";
|
96696
|
+
if (message.signature != null && message.hasOwnProperty("signature"))
|
96697
|
+
if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature)))
|
96698
|
+
return "signature: buffer expected";
|
96699
|
+
if (message.error != null && message.hasOwnProperty("error"))
|
96700
|
+
switch (message.error) {
|
96701
|
+
default:
|
96702
|
+
return "error: enum value expected";
|
96703
|
+
case 0:
|
96704
|
+
case 1:
|
96705
|
+
case 2:
|
96706
|
+
case 3:
|
96707
|
+
case 4:
|
96708
|
+
case 5:
|
96709
|
+
case 15:
|
96710
|
+
case 16:
|
96711
|
+
case 17:
|
96712
|
+
case 18:
|
96713
|
+
case 6:
|
96714
|
+
case 7:
|
96715
|
+
case 8:
|
96716
|
+
case 9:
|
96717
|
+
case 10:
|
96718
|
+
case 11:
|
96719
|
+
case 12:
|
96720
|
+
case 13:
|
96721
|
+
case 14:
|
96722
|
+
case 19:
|
96723
|
+
case 20:
|
96724
|
+
case 21:
|
96725
|
+
case 22:
|
96726
|
+
case 23:
|
96727
|
+
case 24:
|
96728
|
+
case 25:
|
96729
|
+
break;
|
96730
|
+
}
|
96731
|
+
if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
|
96732
|
+
if (!$util.isString(message.errorMessage))
|
96733
|
+
return "errorMessage: string expected";
|
96734
|
+
return null;
|
96735
|
+
};
|
96736
|
+
|
96737
|
+
/**
|
96738
|
+
* Creates a SigningOutput message from a plain object. Also converts values to their respective internal types.
|
96739
|
+
* @function fromObject
|
96740
|
+
* @memberof TW.Pactus.Proto.SigningOutput
|
96741
|
+
* @static
|
96742
|
+
* @param {Object.<string,*>} object Plain object
|
96743
|
+
* @returns {TW.Pactus.Proto.SigningOutput} SigningOutput
|
96744
|
+
*/
|
96745
|
+
SigningOutput.fromObject = function fromObject(object) {
|
96746
|
+
if (object instanceof $root.TW.Pactus.Proto.SigningOutput)
|
96747
|
+
return object;
|
96748
|
+
var message = new $root.TW.Pactus.Proto.SigningOutput();
|
96749
|
+
if (object.transactionId != null)
|
96750
|
+
if (typeof object.transactionId === "string")
|
96751
|
+
$util.base64.decode(object.transactionId, message.transactionId = $util.newBuffer($util.base64.length(object.transactionId)), 0);
|
96752
|
+
else if (object.transactionId.length)
|
96753
|
+
message.transactionId = object.transactionId;
|
96754
|
+
if (object.signedTransactionData != null)
|
96755
|
+
if (typeof object.signedTransactionData === "string")
|
96756
|
+
$util.base64.decode(object.signedTransactionData, message.signedTransactionData = $util.newBuffer($util.base64.length(object.signedTransactionData)), 0);
|
96757
|
+
else if (object.signedTransactionData.length)
|
96758
|
+
message.signedTransactionData = object.signedTransactionData;
|
96759
|
+
if (object.signature != null)
|
96760
|
+
if (typeof object.signature === "string")
|
96761
|
+
$util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0);
|
96762
|
+
else if (object.signature.length)
|
96763
|
+
message.signature = object.signature;
|
96764
|
+
switch (object.error) {
|
96765
|
+
case "OK":
|
96766
|
+
case 0:
|
96767
|
+
message.error = 0;
|
96768
|
+
break;
|
96769
|
+
case "Error_general":
|
96770
|
+
case 1:
|
96771
|
+
message.error = 1;
|
96772
|
+
break;
|
96773
|
+
case "Error_internal":
|
96774
|
+
case 2:
|
96775
|
+
message.error = 2;
|
96776
|
+
break;
|
96777
|
+
case "Error_low_balance":
|
96778
|
+
case 3:
|
96779
|
+
message.error = 3;
|
96780
|
+
break;
|
96781
|
+
case "Error_zero_amount_requested":
|
96782
|
+
case 4:
|
96783
|
+
message.error = 4;
|
96784
|
+
break;
|
96785
|
+
case "Error_missing_private_key":
|
96786
|
+
case 5:
|
96787
|
+
message.error = 5;
|
96788
|
+
break;
|
96789
|
+
case "Error_invalid_private_key":
|
96790
|
+
case 15:
|
96791
|
+
message.error = 15;
|
96792
|
+
break;
|
96793
|
+
case "Error_invalid_address":
|
96794
|
+
case 16:
|
96795
|
+
message.error = 16;
|
96796
|
+
break;
|
96797
|
+
case "Error_invalid_utxo":
|
96798
|
+
case 17:
|
96799
|
+
message.error = 17;
|
96800
|
+
break;
|
96801
|
+
case "Error_invalid_utxo_amount":
|
96802
|
+
case 18:
|
96803
|
+
message.error = 18;
|
96804
|
+
break;
|
96805
|
+
case "Error_wrong_fee":
|
96806
|
+
case 6:
|
96807
|
+
message.error = 6;
|
96808
|
+
break;
|
96809
|
+
case "Error_signing":
|
96810
|
+
case 7:
|
96811
|
+
message.error = 7;
|
96812
|
+
break;
|
96813
|
+
case "Error_tx_too_big":
|
96814
|
+
case 8:
|
96815
|
+
message.error = 8;
|
96816
|
+
break;
|
96817
|
+
case "Error_missing_input_utxos":
|
96818
|
+
case 9:
|
96819
|
+
message.error = 9;
|
96820
|
+
break;
|
96821
|
+
case "Error_not_enough_utxos":
|
96822
|
+
case 10:
|
96823
|
+
message.error = 10;
|
96824
|
+
break;
|
96825
|
+
case "Error_script_redeem":
|
96826
|
+
case 11:
|
96827
|
+
message.error = 11;
|
96828
|
+
break;
|
96829
|
+
case "Error_script_output":
|
96830
|
+
case 12:
|
96831
|
+
message.error = 12;
|
96832
|
+
break;
|
96833
|
+
case "Error_script_witness_program":
|
96834
|
+
case 13:
|
96835
|
+
message.error = 13;
|
96836
|
+
break;
|
96837
|
+
case "Error_invalid_memo":
|
96838
|
+
case 14:
|
96839
|
+
message.error = 14;
|
96840
|
+
break;
|
96841
|
+
case "Error_input_parse":
|
96842
|
+
case 19:
|
96843
|
+
message.error = 19;
|
96844
|
+
break;
|
96845
|
+
case "Error_no_support_n2n":
|
96846
|
+
case 20:
|
96847
|
+
message.error = 20;
|
96848
|
+
break;
|
96849
|
+
case "Error_signatures_count":
|
96850
|
+
case 21:
|
96851
|
+
message.error = 21;
|
96852
|
+
break;
|
96853
|
+
case "Error_invalid_params":
|
96854
|
+
case 22:
|
96855
|
+
message.error = 22;
|
96856
|
+
break;
|
96857
|
+
case "Error_invalid_requested_token_amount":
|
96858
|
+
case 23:
|
96859
|
+
message.error = 23;
|
96860
|
+
break;
|
96861
|
+
case "Error_not_supported":
|
96862
|
+
case 24:
|
96863
|
+
message.error = 24;
|
96864
|
+
break;
|
96865
|
+
case "Error_dust_amount_requested":
|
96866
|
+
case 25:
|
96867
|
+
message.error = 25;
|
96868
|
+
break;
|
96869
|
+
}
|
96870
|
+
if (object.errorMessage != null)
|
96871
|
+
message.errorMessage = String(object.errorMessage);
|
96872
|
+
return message;
|
96873
|
+
};
|
96874
|
+
|
96875
|
+
/**
|
96876
|
+
* Creates a plain object from a SigningOutput message. Also converts values to other types if specified.
|
96877
|
+
* @function toObject
|
96878
|
+
* @memberof TW.Pactus.Proto.SigningOutput
|
96879
|
+
* @static
|
96880
|
+
* @param {TW.Pactus.Proto.SigningOutput} message SigningOutput
|
96881
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
96882
|
+
* @returns {Object.<string,*>} Plain object
|
96883
|
+
*/
|
96884
|
+
SigningOutput.toObject = function toObject(message, options) {
|
96885
|
+
if (!options)
|
96886
|
+
options = {};
|
96887
|
+
var object = {};
|
96888
|
+
if (options.defaults) {
|
96889
|
+
if (options.bytes === String)
|
96890
|
+
object.transactionId = "";
|
96891
|
+
else {
|
96892
|
+
object.transactionId = [];
|
96893
|
+
if (options.bytes !== Array)
|
96894
|
+
object.transactionId = $util.newBuffer(object.transactionId);
|
96895
|
+
}
|
96896
|
+
if (options.bytes === String)
|
96897
|
+
object.signedTransactionData = "";
|
96898
|
+
else {
|
96899
|
+
object.signedTransactionData = [];
|
96900
|
+
if (options.bytes !== Array)
|
96901
|
+
object.signedTransactionData = $util.newBuffer(object.signedTransactionData);
|
96902
|
+
}
|
96903
|
+
if (options.bytes === String)
|
96904
|
+
object.signature = "";
|
96905
|
+
else {
|
96906
|
+
object.signature = [];
|
96907
|
+
if (options.bytes !== Array)
|
96908
|
+
object.signature = $util.newBuffer(object.signature);
|
96909
|
+
}
|
96910
|
+
object.error = options.enums === String ? "OK" : 0;
|
96911
|
+
object.errorMessage = "";
|
96912
|
+
}
|
96913
|
+
if (message.transactionId != null && message.hasOwnProperty("transactionId"))
|
96914
|
+
object.transactionId = options.bytes === String ? $util.base64.encode(message.transactionId, 0, message.transactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.transactionId) : message.transactionId;
|
96915
|
+
if (message.signedTransactionData != null && message.hasOwnProperty("signedTransactionData"))
|
96916
|
+
object.signedTransactionData = options.bytes === String ? $util.base64.encode(message.signedTransactionData, 0, message.signedTransactionData.length) : options.bytes === Array ? Array.prototype.slice.call(message.signedTransactionData) : message.signedTransactionData;
|
96917
|
+
if (message.signature != null && message.hasOwnProperty("signature"))
|
96918
|
+
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;
|
96919
|
+
if (message.error != null && message.hasOwnProperty("error"))
|
96920
|
+
object.error = options.enums === String ? $root.TW.Common.Proto.SigningError[message.error] : message.error;
|
96921
|
+
if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
|
96922
|
+
object.errorMessage = message.errorMessage;
|
96923
|
+
return object;
|
96924
|
+
};
|
96925
|
+
|
96926
|
+
/**
|
96927
|
+
* Converts this SigningOutput to JSON.
|
96928
|
+
* @function toJSON
|
96929
|
+
* @memberof TW.Pactus.Proto.SigningOutput
|
96930
|
+
* @instance
|
96931
|
+
* @returns {Object.<string,*>} JSON object
|
96932
|
+
*/
|
96933
|
+
SigningOutput.prototype.toJSON = function toJSON() {
|
96934
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
96935
|
+
};
|
96936
|
+
|
96937
|
+
return SigningOutput;
|
96938
|
+
})();
|
96939
|
+
|
96940
|
+
return Proto;
|
96941
|
+
})();
|
96942
|
+
|
96943
|
+
return Pactus;
|
96944
|
+
})();
|
96945
|
+
|
95510
96946
|
TW.Polkadot = (function() {
|
95511
96947
|
|
95512
96948
|
/**
|