@trustwallet/wallet-core 3.1.9 → 3.1.10
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/dist/generated/core_proto.d.ts +242 -0
- package/dist/generated/core_proto.js +577 -0
- package/dist/lib/wallet-core.js +138 -135
- package/dist/lib/wallet-core.wasm +0 -0
- package/dist/src/wallet-core.d.ts +7 -0
- package/package.json +1 -1
@@ -72633,6 +72633,583 @@
|
|
72633
72633
|
return Stellar;
|
72634
72634
|
})();
|
72635
72635
|
|
72636
|
+
TW.Sui = (function() {
|
72637
|
+
|
72638
|
+
/**
|
72639
|
+
* Namespace Sui.
|
72640
|
+
* @memberof TW
|
72641
|
+
* @namespace
|
72642
|
+
*/
|
72643
|
+
var Sui = {};
|
72644
|
+
|
72645
|
+
Sui.Proto = (function() {
|
72646
|
+
|
72647
|
+
/**
|
72648
|
+
* Namespace Proto.
|
72649
|
+
* @memberof TW.Sui
|
72650
|
+
* @namespace
|
72651
|
+
*/
|
72652
|
+
var Proto = {};
|
72653
|
+
|
72654
|
+
Proto.SignDirect = (function() {
|
72655
|
+
|
72656
|
+
/**
|
72657
|
+
* Properties of a SignDirect.
|
72658
|
+
* @memberof TW.Sui.Proto
|
72659
|
+
* @interface ISignDirect
|
72660
|
+
* @property {string|null} [unsignedTxMsg] SignDirect unsignedTxMsg
|
72661
|
+
*/
|
72662
|
+
|
72663
|
+
/**
|
72664
|
+
* Constructs a new SignDirect.
|
72665
|
+
* @memberof TW.Sui.Proto
|
72666
|
+
* @classdesc Represents a SignDirect.
|
72667
|
+
* @implements ISignDirect
|
72668
|
+
* @constructor
|
72669
|
+
* @param {TW.Sui.Proto.ISignDirect=} [properties] Properties to set
|
72670
|
+
*/
|
72671
|
+
function SignDirect(properties) {
|
72672
|
+
if (properties)
|
72673
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
72674
|
+
if (properties[keys[i]] != null)
|
72675
|
+
this[keys[i]] = properties[keys[i]];
|
72676
|
+
}
|
72677
|
+
|
72678
|
+
/**
|
72679
|
+
* SignDirect unsignedTxMsg.
|
72680
|
+
* @member {string} unsignedTxMsg
|
72681
|
+
* @memberof TW.Sui.Proto.SignDirect
|
72682
|
+
* @instance
|
72683
|
+
*/
|
72684
|
+
SignDirect.prototype.unsignedTxMsg = "";
|
72685
|
+
|
72686
|
+
/**
|
72687
|
+
* Creates a new SignDirect instance using the specified properties.
|
72688
|
+
* @function create
|
72689
|
+
* @memberof TW.Sui.Proto.SignDirect
|
72690
|
+
* @static
|
72691
|
+
* @param {TW.Sui.Proto.ISignDirect=} [properties] Properties to set
|
72692
|
+
* @returns {TW.Sui.Proto.SignDirect} SignDirect instance
|
72693
|
+
*/
|
72694
|
+
SignDirect.create = function create(properties) {
|
72695
|
+
return new SignDirect(properties);
|
72696
|
+
};
|
72697
|
+
|
72698
|
+
/**
|
72699
|
+
* Encodes the specified SignDirect message. Does not implicitly {@link TW.Sui.Proto.SignDirect.verify|verify} messages.
|
72700
|
+
* @function encode
|
72701
|
+
* @memberof TW.Sui.Proto.SignDirect
|
72702
|
+
* @static
|
72703
|
+
* @param {TW.Sui.Proto.ISignDirect} message SignDirect message or plain object to encode
|
72704
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
72705
|
+
* @returns {$protobuf.Writer} Writer
|
72706
|
+
*/
|
72707
|
+
SignDirect.encode = function encode(message, writer) {
|
72708
|
+
if (!writer)
|
72709
|
+
writer = $Writer.create();
|
72710
|
+
if (message.unsignedTxMsg != null && Object.hasOwnProperty.call(message, "unsignedTxMsg"))
|
72711
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.unsignedTxMsg);
|
72712
|
+
return writer;
|
72713
|
+
};
|
72714
|
+
|
72715
|
+
/**
|
72716
|
+
* Decodes a SignDirect message from the specified reader or buffer.
|
72717
|
+
* @function decode
|
72718
|
+
* @memberof TW.Sui.Proto.SignDirect
|
72719
|
+
* @static
|
72720
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
72721
|
+
* @param {number} [length] Message length if known beforehand
|
72722
|
+
* @returns {TW.Sui.Proto.SignDirect} SignDirect
|
72723
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
72724
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
72725
|
+
*/
|
72726
|
+
SignDirect.decode = function decode(reader, length) {
|
72727
|
+
if (!(reader instanceof $Reader))
|
72728
|
+
reader = $Reader.create(reader);
|
72729
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Sui.Proto.SignDirect();
|
72730
|
+
while (reader.pos < end) {
|
72731
|
+
var tag = reader.uint32();
|
72732
|
+
switch (tag >>> 3) {
|
72733
|
+
case 1:
|
72734
|
+
message.unsignedTxMsg = reader.string();
|
72735
|
+
break;
|
72736
|
+
default:
|
72737
|
+
reader.skipType(tag & 7);
|
72738
|
+
break;
|
72739
|
+
}
|
72740
|
+
}
|
72741
|
+
return message;
|
72742
|
+
};
|
72743
|
+
|
72744
|
+
/**
|
72745
|
+
* Verifies a SignDirect message.
|
72746
|
+
* @function verify
|
72747
|
+
* @memberof TW.Sui.Proto.SignDirect
|
72748
|
+
* @static
|
72749
|
+
* @param {Object.<string,*>} message Plain object to verify
|
72750
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
72751
|
+
*/
|
72752
|
+
SignDirect.verify = function verify(message) {
|
72753
|
+
if (typeof message !== "object" || message === null)
|
72754
|
+
return "object expected";
|
72755
|
+
if (message.unsignedTxMsg != null && message.hasOwnProperty("unsignedTxMsg"))
|
72756
|
+
if (!$util.isString(message.unsignedTxMsg))
|
72757
|
+
return "unsignedTxMsg: string expected";
|
72758
|
+
return null;
|
72759
|
+
};
|
72760
|
+
|
72761
|
+
/**
|
72762
|
+
* Creates a SignDirect message from a plain object. Also converts values to their respective internal types.
|
72763
|
+
* @function fromObject
|
72764
|
+
* @memberof TW.Sui.Proto.SignDirect
|
72765
|
+
* @static
|
72766
|
+
* @param {Object.<string,*>} object Plain object
|
72767
|
+
* @returns {TW.Sui.Proto.SignDirect} SignDirect
|
72768
|
+
*/
|
72769
|
+
SignDirect.fromObject = function fromObject(object) {
|
72770
|
+
if (object instanceof $root.TW.Sui.Proto.SignDirect)
|
72771
|
+
return object;
|
72772
|
+
var message = new $root.TW.Sui.Proto.SignDirect();
|
72773
|
+
if (object.unsignedTxMsg != null)
|
72774
|
+
message.unsignedTxMsg = String(object.unsignedTxMsg);
|
72775
|
+
return message;
|
72776
|
+
};
|
72777
|
+
|
72778
|
+
/**
|
72779
|
+
* Creates a plain object from a SignDirect message. Also converts values to other types if specified.
|
72780
|
+
* @function toObject
|
72781
|
+
* @memberof TW.Sui.Proto.SignDirect
|
72782
|
+
* @static
|
72783
|
+
* @param {TW.Sui.Proto.SignDirect} message SignDirect
|
72784
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
72785
|
+
* @returns {Object.<string,*>} Plain object
|
72786
|
+
*/
|
72787
|
+
SignDirect.toObject = function toObject(message, options) {
|
72788
|
+
if (!options)
|
72789
|
+
options = {};
|
72790
|
+
var object = {};
|
72791
|
+
if (options.defaults)
|
72792
|
+
object.unsignedTxMsg = "";
|
72793
|
+
if (message.unsignedTxMsg != null && message.hasOwnProperty("unsignedTxMsg"))
|
72794
|
+
object.unsignedTxMsg = message.unsignedTxMsg;
|
72795
|
+
return object;
|
72796
|
+
};
|
72797
|
+
|
72798
|
+
/**
|
72799
|
+
* Converts this SignDirect to JSON.
|
72800
|
+
* @function toJSON
|
72801
|
+
* @memberof TW.Sui.Proto.SignDirect
|
72802
|
+
* @instance
|
72803
|
+
* @returns {Object.<string,*>} JSON object
|
72804
|
+
*/
|
72805
|
+
SignDirect.prototype.toJSON = function toJSON() {
|
72806
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
72807
|
+
};
|
72808
|
+
|
72809
|
+
return SignDirect;
|
72810
|
+
})();
|
72811
|
+
|
72812
|
+
Proto.SigningInput = (function() {
|
72813
|
+
|
72814
|
+
/**
|
72815
|
+
* Properties of a SigningInput.
|
72816
|
+
* @memberof TW.Sui.Proto
|
72817
|
+
* @interface ISigningInput
|
72818
|
+
* @property {Uint8Array|null} [privateKey] SigningInput privateKey
|
72819
|
+
* @property {TW.Sui.Proto.ISignDirect|null} [signDirectMessage] SigningInput signDirectMessage
|
72820
|
+
*/
|
72821
|
+
|
72822
|
+
/**
|
72823
|
+
* Constructs a new SigningInput.
|
72824
|
+
* @memberof TW.Sui.Proto
|
72825
|
+
* @classdesc Represents a SigningInput.
|
72826
|
+
* @implements ISigningInput
|
72827
|
+
* @constructor
|
72828
|
+
* @param {TW.Sui.Proto.ISigningInput=} [properties] Properties to set
|
72829
|
+
*/
|
72830
|
+
function SigningInput(properties) {
|
72831
|
+
if (properties)
|
72832
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
72833
|
+
if (properties[keys[i]] != null)
|
72834
|
+
this[keys[i]] = properties[keys[i]];
|
72835
|
+
}
|
72836
|
+
|
72837
|
+
/**
|
72838
|
+
* SigningInput privateKey.
|
72839
|
+
* @member {Uint8Array} privateKey
|
72840
|
+
* @memberof TW.Sui.Proto.SigningInput
|
72841
|
+
* @instance
|
72842
|
+
*/
|
72843
|
+
SigningInput.prototype.privateKey = $util.newBuffer([]);
|
72844
|
+
|
72845
|
+
/**
|
72846
|
+
* SigningInput signDirectMessage.
|
72847
|
+
* @member {TW.Sui.Proto.ISignDirect|null|undefined} signDirectMessage
|
72848
|
+
* @memberof TW.Sui.Proto.SigningInput
|
72849
|
+
* @instance
|
72850
|
+
*/
|
72851
|
+
SigningInput.prototype.signDirectMessage = null;
|
72852
|
+
|
72853
|
+
// OneOf field names bound to virtual getters and setters
|
72854
|
+
var $oneOfFields;
|
72855
|
+
|
72856
|
+
/**
|
72857
|
+
* SigningInput transactionPayload.
|
72858
|
+
* @member {"signDirectMessage"|undefined} transactionPayload
|
72859
|
+
* @memberof TW.Sui.Proto.SigningInput
|
72860
|
+
* @instance
|
72861
|
+
*/
|
72862
|
+
Object.defineProperty(SigningInput.prototype, "transactionPayload", {
|
72863
|
+
get: $util.oneOfGetter($oneOfFields = ["signDirectMessage"]),
|
72864
|
+
set: $util.oneOfSetter($oneOfFields)
|
72865
|
+
});
|
72866
|
+
|
72867
|
+
/**
|
72868
|
+
* Creates a new SigningInput instance using the specified properties.
|
72869
|
+
* @function create
|
72870
|
+
* @memberof TW.Sui.Proto.SigningInput
|
72871
|
+
* @static
|
72872
|
+
* @param {TW.Sui.Proto.ISigningInput=} [properties] Properties to set
|
72873
|
+
* @returns {TW.Sui.Proto.SigningInput} SigningInput instance
|
72874
|
+
*/
|
72875
|
+
SigningInput.create = function create(properties) {
|
72876
|
+
return new SigningInput(properties);
|
72877
|
+
};
|
72878
|
+
|
72879
|
+
/**
|
72880
|
+
* Encodes the specified SigningInput message. Does not implicitly {@link TW.Sui.Proto.SigningInput.verify|verify} messages.
|
72881
|
+
* @function encode
|
72882
|
+
* @memberof TW.Sui.Proto.SigningInput
|
72883
|
+
* @static
|
72884
|
+
* @param {TW.Sui.Proto.ISigningInput} message SigningInput message or plain object to encode
|
72885
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
72886
|
+
* @returns {$protobuf.Writer} Writer
|
72887
|
+
*/
|
72888
|
+
SigningInput.encode = function encode(message, writer) {
|
72889
|
+
if (!writer)
|
72890
|
+
writer = $Writer.create();
|
72891
|
+
if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey"))
|
72892
|
+
writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.privateKey);
|
72893
|
+
if (message.signDirectMessage != null && Object.hasOwnProperty.call(message, "signDirectMessage"))
|
72894
|
+
$root.TW.Sui.Proto.SignDirect.encode(message.signDirectMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
72895
|
+
return writer;
|
72896
|
+
};
|
72897
|
+
|
72898
|
+
/**
|
72899
|
+
* Decodes a SigningInput message from the specified reader or buffer.
|
72900
|
+
* @function decode
|
72901
|
+
* @memberof TW.Sui.Proto.SigningInput
|
72902
|
+
* @static
|
72903
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
72904
|
+
* @param {number} [length] Message length if known beforehand
|
72905
|
+
* @returns {TW.Sui.Proto.SigningInput} SigningInput
|
72906
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
72907
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
72908
|
+
*/
|
72909
|
+
SigningInput.decode = function decode(reader, length) {
|
72910
|
+
if (!(reader instanceof $Reader))
|
72911
|
+
reader = $Reader.create(reader);
|
72912
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Sui.Proto.SigningInput();
|
72913
|
+
while (reader.pos < end) {
|
72914
|
+
var tag = reader.uint32();
|
72915
|
+
switch (tag >>> 3) {
|
72916
|
+
case 1:
|
72917
|
+
message.privateKey = reader.bytes();
|
72918
|
+
break;
|
72919
|
+
case 2:
|
72920
|
+
message.signDirectMessage = $root.TW.Sui.Proto.SignDirect.decode(reader, reader.uint32());
|
72921
|
+
break;
|
72922
|
+
default:
|
72923
|
+
reader.skipType(tag & 7);
|
72924
|
+
break;
|
72925
|
+
}
|
72926
|
+
}
|
72927
|
+
return message;
|
72928
|
+
};
|
72929
|
+
|
72930
|
+
/**
|
72931
|
+
* Verifies a SigningInput message.
|
72932
|
+
* @function verify
|
72933
|
+
* @memberof TW.Sui.Proto.SigningInput
|
72934
|
+
* @static
|
72935
|
+
* @param {Object.<string,*>} message Plain object to verify
|
72936
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
72937
|
+
*/
|
72938
|
+
SigningInput.verify = function verify(message) {
|
72939
|
+
if (typeof message !== "object" || message === null)
|
72940
|
+
return "object expected";
|
72941
|
+
var properties = {};
|
72942
|
+
if (message.privateKey != null && message.hasOwnProperty("privateKey"))
|
72943
|
+
if (!(message.privateKey && typeof message.privateKey.length === "number" || $util.isString(message.privateKey)))
|
72944
|
+
return "privateKey: buffer expected";
|
72945
|
+
if (message.signDirectMessage != null && message.hasOwnProperty("signDirectMessage")) {
|
72946
|
+
properties.transactionPayload = 1;
|
72947
|
+
{
|
72948
|
+
var error = $root.TW.Sui.Proto.SignDirect.verify(message.signDirectMessage);
|
72949
|
+
if (error)
|
72950
|
+
return "signDirectMessage." + error;
|
72951
|
+
}
|
72952
|
+
}
|
72953
|
+
return null;
|
72954
|
+
};
|
72955
|
+
|
72956
|
+
/**
|
72957
|
+
* Creates a SigningInput message from a plain object. Also converts values to their respective internal types.
|
72958
|
+
* @function fromObject
|
72959
|
+
* @memberof TW.Sui.Proto.SigningInput
|
72960
|
+
* @static
|
72961
|
+
* @param {Object.<string,*>} object Plain object
|
72962
|
+
* @returns {TW.Sui.Proto.SigningInput} SigningInput
|
72963
|
+
*/
|
72964
|
+
SigningInput.fromObject = function fromObject(object) {
|
72965
|
+
if (object instanceof $root.TW.Sui.Proto.SigningInput)
|
72966
|
+
return object;
|
72967
|
+
var message = new $root.TW.Sui.Proto.SigningInput();
|
72968
|
+
if (object.privateKey != null)
|
72969
|
+
if (typeof object.privateKey === "string")
|
72970
|
+
$util.base64.decode(object.privateKey, message.privateKey = $util.newBuffer($util.base64.length(object.privateKey)), 0);
|
72971
|
+
else if (object.privateKey.length)
|
72972
|
+
message.privateKey = object.privateKey;
|
72973
|
+
if (object.signDirectMessage != null) {
|
72974
|
+
if (typeof object.signDirectMessage !== "object")
|
72975
|
+
throw TypeError(".TW.Sui.Proto.SigningInput.signDirectMessage: object expected");
|
72976
|
+
message.signDirectMessage = $root.TW.Sui.Proto.SignDirect.fromObject(object.signDirectMessage);
|
72977
|
+
}
|
72978
|
+
return message;
|
72979
|
+
};
|
72980
|
+
|
72981
|
+
/**
|
72982
|
+
* Creates a plain object from a SigningInput message. Also converts values to other types if specified.
|
72983
|
+
* @function toObject
|
72984
|
+
* @memberof TW.Sui.Proto.SigningInput
|
72985
|
+
* @static
|
72986
|
+
* @param {TW.Sui.Proto.SigningInput} message SigningInput
|
72987
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
72988
|
+
* @returns {Object.<string,*>} Plain object
|
72989
|
+
*/
|
72990
|
+
SigningInput.toObject = function toObject(message, options) {
|
72991
|
+
if (!options)
|
72992
|
+
options = {};
|
72993
|
+
var object = {};
|
72994
|
+
if (options.defaults)
|
72995
|
+
if (options.bytes === String)
|
72996
|
+
object.privateKey = "";
|
72997
|
+
else {
|
72998
|
+
object.privateKey = [];
|
72999
|
+
if (options.bytes !== Array)
|
73000
|
+
object.privateKey = $util.newBuffer(object.privateKey);
|
73001
|
+
}
|
73002
|
+
if (message.privateKey != null && message.hasOwnProperty("privateKey"))
|
73003
|
+
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;
|
73004
|
+
if (message.signDirectMessage != null && message.hasOwnProperty("signDirectMessage")) {
|
73005
|
+
object.signDirectMessage = $root.TW.Sui.Proto.SignDirect.toObject(message.signDirectMessage, options);
|
73006
|
+
if (options.oneofs)
|
73007
|
+
object.transactionPayload = "signDirectMessage";
|
73008
|
+
}
|
73009
|
+
return object;
|
73010
|
+
};
|
73011
|
+
|
73012
|
+
/**
|
73013
|
+
* Converts this SigningInput to JSON.
|
73014
|
+
* @function toJSON
|
73015
|
+
* @memberof TW.Sui.Proto.SigningInput
|
73016
|
+
* @instance
|
73017
|
+
* @returns {Object.<string,*>} JSON object
|
73018
|
+
*/
|
73019
|
+
SigningInput.prototype.toJSON = function toJSON() {
|
73020
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
73021
|
+
};
|
73022
|
+
|
73023
|
+
return SigningInput;
|
73024
|
+
})();
|
73025
|
+
|
73026
|
+
Proto.SigningOutput = (function() {
|
73027
|
+
|
73028
|
+
/**
|
73029
|
+
* Properties of a SigningOutput.
|
73030
|
+
* @memberof TW.Sui.Proto
|
73031
|
+
* @interface ISigningOutput
|
73032
|
+
* @property {string|null} [unsignedTx] The raw transaction without indent in base64
|
73033
|
+
* @property {string|null} [signature] The signature encoded in base64
|
73034
|
+
*/
|
73035
|
+
|
73036
|
+
/**
|
73037
|
+
* Constructs a new SigningOutput.
|
73038
|
+
* @memberof TW.Sui.Proto
|
73039
|
+
* @classdesc Represents a SigningOutput.
|
73040
|
+
* @implements ISigningOutput
|
73041
|
+
* @constructor
|
73042
|
+
* @param {TW.Sui.Proto.ISigningOutput=} [properties] Properties to set
|
73043
|
+
*/
|
73044
|
+
function SigningOutput(properties) {
|
73045
|
+
if (properties)
|
73046
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
73047
|
+
if (properties[keys[i]] != null)
|
73048
|
+
this[keys[i]] = properties[keys[i]];
|
73049
|
+
}
|
73050
|
+
|
73051
|
+
/**
|
73052
|
+
* The raw transaction without indent in base64
|
73053
|
+
* @member {string} unsignedTx
|
73054
|
+
* @memberof TW.Sui.Proto.SigningOutput
|
73055
|
+
* @instance
|
73056
|
+
*/
|
73057
|
+
SigningOutput.prototype.unsignedTx = "";
|
73058
|
+
|
73059
|
+
/**
|
73060
|
+
* The signature encoded in base64
|
73061
|
+
* @member {string} signature
|
73062
|
+
* @memberof TW.Sui.Proto.SigningOutput
|
73063
|
+
* @instance
|
73064
|
+
*/
|
73065
|
+
SigningOutput.prototype.signature = "";
|
73066
|
+
|
73067
|
+
/**
|
73068
|
+
* Creates a new SigningOutput instance using the specified properties.
|
73069
|
+
* @function create
|
73070
|
+
* @memberof TW.Sui.Proto.SigningOutput
|
73071
|
+
* @static
|
73072
|
+
* @param {TW.Sui.Proto.ISigningOutput=} [properties] Properties to set
|
73073
|
+
* @returns {TW.Sui.Proto.SigningOutput} SigningOutput instance
|
73074
|
+
*/
|
73075
|
+
SigningOutput.create = function create(properties) {
|
73076
|
+
return new SigningOutput(properties);
|
73077
|
+
};
|
73078
|
+
|
73079
|
+
/**
|
73080
|
+
* Encodes the specified SigningOutput message. Does not implicitly {@link TW.Sui.Proto.SigningOutput.verify|verify} messages.
|
73081
|
+
* @function encode
|
73082
|
+
* @memberof TW.Sui.Proto.SigningOutput
|
73083
|
+
* @static
|
73084
|
+
* @param {TW.Sui.Proto.ISigningOutput} message SigningOutput message or plain object to encode
|
73085
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
73086
|
+
* @returns {$protobuf.Writer} Writer
|
73087
|
+
*/
|
73088
|
+
SigningOutput.encode = function encode(message, writer) {
|
73089
|
+
if (!writer)
|
73090
|
+
writer = $Writer.create();
|
73091
|
+
if (message.unsignedTx != null && Object.hasOwnProperty.call(message, "unsignedTx"))
|
73092
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.unsignedTx);
|
73093
|
+
if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
|
73094
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.signature);
|
73095
|
+
return writer;
|
73096
|
+
};
|
73097
|
+
|
73098
|
+
/**
|
73099
|
+
* Decodes a SigningOutput message from the specified reader or buffer.
|
73100
|
+
* @function decode
|
73101
|
+
* @memberof TW.Sui.Proto.SigningOutput
|
73102
|
+
* @static
|
73103
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
73104
|
+
* @param {number} [length] Message length if known beforehand
|
73105
|
+
* @returns {TW.Sui.Proto.SigningOutput} SigningOutput
|
73106
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
73107
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
73108
|
+
*/
|
73109
|
+
SigningOutput.decode = function decode(reader, length) {
|
73110
|
+
if (!(reader instanceof $Reader))
|
73111
|
+
reader = $Reader.create(reader);
|
73112
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Sui.Proto.SigningOutput();
|
73113
|
+
while (reader.pos < end) {
|
73114
|
+
var tag = reader.uint32();
|
73115
|
+
switch (tag >>> 3) {
|
73116
|
+
case 1:
|
73117
|
+
message.unsignedTx = reader.string();
|
73118
|
+
break;
|
73119
|
+
case 2:
|
73120
|
+
message.signature = reader.string();
|
73121
|
+
break;
|
73122
|
+
default:
|
73123
|
+
reader.skipType(tag & 7);
|
73124
|
+
break;
|
73125
|
+
}
|
73126
|
+
}
|
73127
|
+
return message;
|
73128
|
+
};
|
73129
|
+
|
73130
|
+
/**
|
73131
|
+
* Verifies a SigningOutput message.
|
73132
|
+
* @function verify
|
73133
|
+
* @memberof TW.Sui.Proto.SigningOutput
|
73134
|
+
* @static
|
73135
|
+
* @param {Object.<string,*>} message Plain object to verify
|
73136
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
73137
|
+
*/
|
73138
|
+
SigningOutput.verify = function verify(message) {
|
73139
|
+
if (typeof message !== "object" || message === null)
|
73140
|
+
return "object expected";
|
73141
|
+
if (message.unsignedTx != null && message.hasOwnProperty("unsignedTx"))
|
73142
|
+
if (!$util.isString(message.unsignedTx))
|
73143
|
+
return "unsignedTx: string expected";
|
73144
|
+
if (message.signature != null && message.hasOwnProperty("signature"))
|
73145
|
+
if (!$util.isString(message.signature))
|
73146
|
+
return "signature: string expected";
|
73147
|
+
return null;
|
73148
|
+
};
|
73149
|
+
|
73150
|
+
/**
|
73151
|
+
* Creates a SigningOutput message from a plain object. Also converts values to their respective internal types.
|
73152
|
+
* @function fromObject
|
73153
|
+
* @memberof TW.Sui.Proto.SigningOutput
|
73154
|
+
* @static
|
73155
|
+
* @param {Object.<string,*>} object Plain object
|
73156
|
+
* @returns {TW.Sui.Proto.SigningOutput} SigningOutput
|
73157
|
+
*/
|
73158
|
+
SigningOutput.fromObject = function fromObject(object) {
|
73159
|
+
if (object instanceof $root.TW.Sui.Proto.SigningOutput)
|
73160
|
+
return object;
|
73161
|
+
var message = new $root.TW.Sui.Proto.SigningOutput();
|
73162
|
+
if (object.unsignedTx != null)
|
73163
|
+
message.unsignedTx = String(object.unsignedTx);
|
73164
|
+
if (object.signature != null)
|
73165
|
+
message.signature = String(object.signature);
|
73166
|
+
return message;
|
73167
|
+
};
|
73168
|
+
|
73169
|
+
/**
|
73170
|
+
* Creates a plain object from a SigningOutput message. Also converts values to other types if specified.
|
73171
|
+
* @function toObject
|
73172
|
+
* @memberof TW.Sui.Proto.SigningOutput
|
73173
|
+
* @static
|
73174
|
+
* @param {TW.Sui.Proto.SigningOutput} message SigningOutput
|
73175
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
73176
|
+
* @returns {Object.<string,*>} Plain object
|
73177
|
+
*/
|
73178
|
+
SigningOutput.toObject = function toObject(message, options) {
|
73179
|
+
if (!options)
|
73180
|
+
options = {};
|
73181
|
+
var object = {};
|
73182
|
+
if (options.defaults) {
|
73183
|
+
object.unsignedTx = "";
|
73184
|
+
object.signature = "";
|
73185
|
+
}
|
73186
|
+
if (message.unsignedTx != null && message.hasOwnProperty("unsignedTx"))
|
73187
|
+
object.unsignedTx = message.unsignedTx;
|
73188
|
+
if (message.signature != null && message.hasOwnProperty("signature"))
|
73189
|
+
object.signature = message.signature;
|
73190
|
+
return object;
|
73191
|
+
};
|
73192
|
+
|
73193
|
+
/**
|
73194
|
+
* Converts this SigningOutput to JSON.
|
73195
|
+
* @function toJSON
|
73196
|
+
* @memberof TW.Sui.Proto.SigningOutput
|
73197
|
+
* @instance
|
73198
|
+
* @returns {Object.<string,*>} JSON object
|
73199
|
+
*/
|
73200
|
+
SigningOutput.prototype.toJSON = function toJSON() {
|
73201
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
73202
|
+
};
|
73203
|
+
|
73204
|
+
return SigningOutput;
|
73205
|
+
})();
|
73206
|
+
|
73207
|
+
return Proto;
|
73208
|
+
})();
|
73209
|
+
|
73210
|
+
return Sui;
|
73211
|
+
})();
|
73212
|
+
|
72636
73213
|
TW.Tezos = (function() {
|
72637
73214
|
|
72638
73215
|
/**
|