@trustwallet/wallet-core 4.1.8-rc1 → 4.1.8
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 +313 -4
- package/dist/generated/core_proto.js +1189 -80
- package/dist/lib/wallet-core.js +1 -1
- package/dist/lib/wallet-core.wasm +0 -0
- package/dist/src/keystore/default-impl.d.ts +0 -1
- package/dist/src/keystore/default-impl.js +3 -33
- package/dist/src/keystore/types.d.ts +1 -3
- package/dist/src/keystore/types.js +0 -1
- package/dist/src/wallet-core.d.ts +5 -8
- package/package.json +1 -1
@@ -23100,6 +23100,7 @@
|
|
23100
23100
|
* @interface IChainInfo
|
23101
23101
|
* @property {number|null} [p2pkhPrefix] ChainInfo p2pkhPrefix
|
23102
23102
|
* @property {number|null} [p2shPrefix] ChainInfo p2shPrefix
|
23103
|
+
* @property {string|null} [hrp] ChainInfo hrp
|
23103
23104
|
*/
|
23104
23105
|
|
23105
23106
|
/**
|
@@ -23133,6 +23134,14 @@
|
|
23133
23134
|
*/
|
23134
23135
|
ChainInfo.prototype.p2shPrefix = 0;
|
23135
23136
|
|
23137
|
+
/**
|
23138
|
+
* ChainInfo hrp.
|
23139
|
+
* @member {string} hrp
|
23140
|
+
* @memberof TW.BitcoinV2.Proto.ChainInfo
|
23141
|
+
* @instance
|
23142
|
+
*/
|
23143
|
+
ChainInfo.prototype.hrp = "";
|
23144
|
+
|
23136
23145
|
/**
|
23137
23146
|
* Creates a new ChainInfo instance using the specified properties.
|
23138
23147
|
* @function create
|
@@ -23161,6 +23170,8 @@
|
|
23161
23170
|
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.p2pkhPrefix);
|
23162
23171
|
if (message.p2shPrefix != null && Object.hasOwnProperty.call(message, "p2shPrefix"))
|
23163
23172
|
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.p2shPrefix);
|
23173
|
+
if (message.hrp != null && Object.hasOwnProperty.call(message, "hrp"))
|
23174
|
+
writer.uint32(/* id 3, wireType 2 =*/26).string(message.hrp);
|
23164
23175
|
return writer;
|
23165
23176
|
};
|
23166
23177
|
|
@@ -23188,6 +23199,9 @@
|
|
23188
23199
|
case 2:
|
23189
23200
|
message.p2shPrefix = reader.uint32();
|
23190
23201
|
break;
|
23202
|
+
case 3:
|
23203
|
+
message.hrp = reader.string();
|
23204
|
+
break;
|
23191
23205
|
default:
|
23192
23206
|
reader.skipType(tag & 7);
|
23193
23207
|
break;
|
@@ -23213,6 +23227,9 @@
|
|
23213
23227
|
if (message.p2shPrefix != null && message.hasOwnProperty("p2shPrefix"))
|
23214
23228
|
if (!$util.isInteger(message.p2shPrefix))
|
23215
23229
|
return "p2shPrefix: integer expected";
|
23230
|
+
if (message.hrp != null && message.hasOwnProperty("hrp"))
|
23231
|
+
if (!$util.isString(message.hrp))
|
23232
|
+
return "hrp: string expected";
|
23216
23233
|
return null;
|
23217
23234
|
};
|
23218
23235
|
|
@@ -23232,6 +23249,8 @@
|
|
23232
23249
|
message.p2pkhPrefix = object.p2pkhPrefix >>> 0;
|
23233
23250
|
if (object.p2shPrefix != null)
|
23234
23251
|
message.p2shPrefix = object.p2shPrefix >>> 0;
|
23252
|
+
if (object.hrp != null)
|
23253
|
+
message.hrp = String(object.hrp);
|
23235
23254
|
return message;
|
23236
23255
|
};
|
23237
23256
|
|
@@ -23251,11 +23270,14 @@
|
|
23251
23270
|
if (options.defaults) {
|
23252
23271
|
object.p2pkhPrefix = 0;
|
23253
23272
|
object.p2shPrefix = 0;
|
23273
|
+
object.hrp = "";
|
23254
23274
|
}
|
23255
23275
|
if (message.p2pkhPrefix != null && message.hasOwnProperty("p2pkhPrefix"))
|
23256
23276
|
object.p2pkhPrefix = message.p2pkhPrefix;
|
23257
23277
|
if (message.p2shPrefix != null && message.hasOwnProperty("p2shPrefix"))
|
23258
23278
|
object.p2shPrefix = message.p2shPrefix;
|
23279
|
+
if (message.hrp != null && message.hasOwnProperty("hrp"))
|
23280
|
+
object.hrp = message.hrp;
|
23259
23281
|
return object;
|
23260
23282
|
};
|
23261
23283
|
|
@@ -24632,7 +24654,7 @@
|
|
24632
24654
|
* @memberof TW.BitcoinV2.Proto
|
24633
24655
|
* @interface ITransactionPlan
|
24634
24656
|
* @property {TW.Common.Proto.SigningError|null} [error] TransactionPlan error
|
24635
|
-
* @property {string|null} [errorMessage]
|
24657
|
+
* @property {string|null} [errorMessage] TransactionPlan errorMessage
|
24636
24658
|
* @property {Array.<TW.BitcoinV2.Proto.IInput>|null} [inputs] TransactionPlan inputs
|
24637
24659
|
* @property {Array.<TW.BitcoinV2.Proto.IOutput>|null} [outputs] TransactionPlan outputs
|
24638
24660
|
* @property {Long|null} [availableAmount] TransactionPlan availableAmount
|
@@ -24668,7 +24690,7 @@
|
|
24668
24690
|
TransactionPlan.prototype.error = 0;
|
24669
24691
|
|
24670
24692
|
/**
|
24671
|
-
*
|
24693
|
+
* TransactionPlan errorMessage.
|
24672
24694
|
* @member {string} errorMessage
|
24673
24695
|
* @memberof TW.BitcoinV2.Proto.TransactionPlan
|
24674
24696
|
* @instance
|
@@ -25215,7 +25237,7 @@
|
|
25215
25237
|
* @interface IPreSigningOutput
|
25216
25238
|
* @property {TW.Common.Proto.SigningError|null} [error] PreSigningOutput error
|
25217
25239
|
* @property {string|null} [errorMessage] PreSigningOutput errorMessage
|
25218
|
-
* @property {Array.<TW.BitcoinV2.Proto.PreSigningOutput.ISighash>|null} [sighashes]
|
25240
|
+
* @property {Array.<TW.BitcoinV2.Proto.PreSigningOutput.ISighash>|null} [sighashes] PreSigningOutput sighashes
|
25219
25241
|
*/
|
25220
25242
|
|
25221
25243
|
/**
|
@@ -25251,7 +25273,7 @@
|
|
25251
25273
|
PreSigningOutput.prototype.errorMessage = "";
|
25252
25274
|
|
25253
25275
|
/**
|
25254
|
-
*
|
25276
|
+
* PreSigningOutput sighashes.
|
25255
25277
|
* @member {Array.<TW.BitcoinV2.Proto.PreSigningOutput.ISighash>} sighashes
|
25256
25278
|
* @memberof TW.BitcoinV2.Proto.PreSigningOutput
|
25257
25279
|
* @instance
|
@@ -26008,37 +26030,850 @@
|
|
26008
26030
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
26009
26031
|
};
|
26010
26032
|
|
26011
|
-
return TaprootTweak;
|
26012
|
-
})();
|
26033
|
+
return TaprootTweak;
|
26034
|
+
})();
|
26035
|
+
|
26036
|
+
return PreSigningOutput;
|
26037
|
+
})();
|
26038
|
+
|
26039
|
+
Proto.SigningOutput = (function() {
|
26040
|
+
|
26041
|
+
/**
|
26042
|
+
* Properties of a SigningOutput.
|
26043
|
+
* @memberof TW.BitcoinV2.Proto
|
26044
|
+
* @interface ISigningOutput
|
26045
|
+
* @property {TW.Common.Proto.SigningError|null} [error] SigningOutput error
|
26046
|
+
* @property {string|null} [errorMessage] SigningOutput errorMessage
|
26047
|
+
* @property {TW.BitcoinV2.Proto.ITransaction|null} [transaction] SigningOutput transaction
|
26048
|
+
* @property {Uint8Array|null} [encoded] SigningOutput encoded
|
26049
|
+
* @property {Uint8Array|null} [txid] SigningOutput txid
|
26050
|
+
* @property {Long|null} [vsize] SigningOutput vsize
|
26051
|
+
* @property {Long|null} [weight] SigningOutput weight
|
26052
|
+
* @property {Long|null} [fee] SigningOutput fee
|
26053
|
+
*/
|
26054
|
+
|
26055
|
+
/**
|
26056
|
+
* Constructs a new SigningOutput.
|
26057
|
+
* @memberof TW.BitcoinV2.Proto
|
26058
|
+
* @classdesc Represents a SigningOutput.
|
26059
|
+
* @implements ISigningOutput
|
26060
|
+
* @constructor
|
26061
|
+
* @param {TW.BitcoinV2.Proto.ISigningOutput=} [properties] Properties to set
|
26062
|
+
*/
|
26063
|
+
function SigningOutput(properties) {
|
26064
|
+
if (properties)
|
26065
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
26066
|
+
if (properties[keys[i]] != null)
|
26067
|
+
this[keys[i]] = properties[keys[i]];
|
26068
|
+
}
|
26069
|
+
|
26070
|
+
/**
|
26071
|
+
* SigningOutput error.
|
26072
|
+
* @member {TW.Common.Proto.SigningError} error
|
26073
|
+
* @memberof TW.BitcoinV2.Proto.SigningOutput
|
26074
|
+
* @instance
|
26075
|
+
*/
|
26076
|
+
SigningOutput.prototype.error = 0;
|
26077
|
+
|
26078
|
+
/**
|
26079
|
+
* SigningOutput errorMessage.
|
26080
|
+
* @member {string} errorMessage
|
26081
|
+
* @memberof TW.BitcoinV2.Proto.SigningOutput
|
26082
|
+
* @instance
|
26083
|
+
*/
|
26084
|
+
SigningOutput.prototype.errorMessage = "";
|
26085
|
+
|
26086
|
+
/**
|
26087
|
+
* SigningOutput transaction.
|
26088
|
+
* @member {TW.BitcoinV2.Proto.ITransaction|null|undefined} transaction
|
26089
|
+
* @memberof TW.BitcoinV2.Proto.SigningOutput
|
26090
|
+
* @instance
|
26091
|
+
*/
|
26092
|
+
SigningOutput.prototype.transaction = null;
|
26093
|
+
|
26094
|
+
/**
|
26095
|
+
* SigningOutput encoded.
|
26096
|
+
* @member {Uint8Array} encoded
|
26097
|
+
* @memberof TW.BitcoinV2.Proto.SigningOutput
|
26098
|
+
* @instance
|
26099
|
+
*/
|
26100
|
+
SigningOutput.prototype.encoded = $util.newBuffer([]);
|
26101
|
+
|
26102
|
+
/**
|
26103
|
+
* SigningOutput txid.
|
26104
|
+
* @member {Uint8Array} txid
|
26105
|
+
* @memberof TW.BitcoinV2.Proto.SigningOutput
|
26106
|
+
* @instance
|
26107
|
+
*/
|
26108
|
+
SigningOutput.prototype.txid = $util.newBuffer([]);
|
26109
|
+
|
26110
|
+
/**
|
26111
|
+
* SigningOutput vsize.
|
26112
|
+
* @member {Long} vsize
|
26113
|
+
* @memberof TW.BitcoinV2.Proto.SigningOutput
|
26114
|
+
* @instance
|
26115
|
+
*/
|
26116
|
+
SigningOutput.prototype.vsize = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
26117
|
+
|
26118
|
+
/**
|
26119
|
+
* SigningOutput weight.
|
26120
|
+
* @member {Long} weight
|
26121
|
+
* @memberof TW.BitcoinV2.Proto.SigningOutput
|
26122
|
+
* @instance
|
26123
|
+
*/
|
26124
|
+
SigningOutput.prototype.weight = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
26125
|
+
|
26126
|
+
/**
|
26127
|
+
* SigningOutput fee.
|
26128
|
+
* @member {Long} fee
|
26129
|
+
* @memberof TW.BitcoinV2.Proto.SigningOutput
|
26130
|
+
* @instance
|
26131
|
+
*/
|
26132
|
+
SigningOutput.prototype.fee = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
26133
|
+
|
26134
|
+
/**
|
26135
|
+
* Creates a new SigningOutput instance using the specified properties.
|
26136
|
+
* @function create
|
26137
|
+
* @memberof TW.BitcoinV2.Proto.SigningOutput
|
26138
|
+
* @static
|
26139
|
+
* @param {TW.BitcoinV2.Proto.ISigningOutput=} [properties] Properties to set
|
26140
|
+
* @returns {TW.BitcoinV2.Proto.SigningOutput} SigningOutput instance
|
26141
|
+
*/
|
26142
|
+
SigningOutput.create = function create(properties) {
|
26143
|
+
return new SigningOutput(properties);
|
26144
|
+
};
|
26145
|
+
|
26146
|
+
/**
|
26147
|
+
* Encodes the specified SigningOutput message. Does not implicitly {@link TW.BitcoinV2.Proto.SigningOutput.verify|verify} messages.
|
26148
|
+
* @function encode
|
26149
|
+
* @memberof TW.BitcoinV2.Proto.SigningOutput
|
26150
|
+
* @static
|
26151
|
+
* @param {TW.BitcoinV2.Proto.ISigningOutput} message SigningOutput message or plain object to encode
|
26152
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
26153
|
+
* @returns {$protobuf.Writer} Writer
|
26154
|
+
*/
|
26155
|
+
SigningOutput.encode = function encode(message, writer) {
|
26156
|
+
if (!writer)
|
26157
|
+
writer = $Writer.create();
|
26158
|
+
if (message.error != null && Object.hasOwnProperty.call(message, "error"))
|
26159
|
+
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.error);
|
26160
|
+
if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage"))
|
26161
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMessage);
|
26162
|
+
if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction"))
|
26163
|
+
$root.TW.BitcoinV2.Proto.Transaction.encode(message.transaction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
26164
|
+
if (message.encoded != null && Object.hasOwnProperty.call(message, "encoded"))
|
26165
|
+
writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.encoded);
|
26166
|
+
if (message.txid != null && Object.hasOwnProperty.call(message, "txid"))
|
26167
|
+
writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.txid);
|
26168
|
+
if (message.vsize != null && Object.hasOwnProperty.call(message, "vsize"))
|
26169
|
+
writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.vsize);
|
26170
|
+
if (message.weight != null && Object.hasOwnProperty.call(message, "weight"))
|
26171
|
+
writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.weight);
|
26172
|
+
if (message.fee != null && Object.hasOwnProperty.call(message, "fee"))
|
26173
|
+
writer.uint32(/* id 8, wireType 0 =*/64).int64(message.fee);
|
26174
|
+
return writer;
|
26175
|
+
};
|
26176
|
+
|
26177
|
+
/**
|
26178
|
+
* Decodes a SigningOutput message from the specified reader or buffer.
|
26179
|
+
* @function decode
|
26180
|
+
* @memberof TW.BitcoinV2.Proto.SigningOutput
|
26181
|
+
* @static
|
26182
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26183
|
+
* @param {number} [length] Message length if known beforehand
|
26184
|
+
* @returns {TW.BitcoinV2.Proto.SigningOutput} SigningOutput
|
26185
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
26186
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26187
|
+
*/
|
26188
|
+
SigningOutput.decode = function decode(reader, length) {
|
26189
|
+
if (!(reader instanceof $Reader))
|
26190
|
+
reader = $Reader.create(reader);
|
26191
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.BitcoinV2.Proto.SigningOutput();
|
26192
|
+
while (reader.pos < end) {
|
26193
|
+
var tag = reader.uint32();
|
26194
|
+
switch (tag >>> 3) {
|
26195
|
+
case 1:
|
26196
|
+
message.error = reader.int32();
|
26197
|
+
break;
|
26198
|
+
case 2:
|
26199
|
+
message.errorMessage = reader.string();
|
26200
|
+
break;
|
26201
|
+
case 3:
|
26202
|
+
message.transaction = $root.TW.BitcoinV2.Proto.Transaction.decode(reader, reader.uint32());
|
26203
|
+
break;
|
26204
|
+
case 4:
|
26205
|
+
message.encoded = reader.bytes();
|
26206
|
+
break;
|
26207
|
+
case 5:
|
26208
|
+
message.txid = reader.bytes();
|
26209
|
+
break;
|
26210
|
+
case 6:
|
26211
|
+
message.vsize = reader.uint64();
|
26212
|
+
break;
|
26213
|
+
case 7:
|
26214
|
+
message.weight = reader.uint64();
|
26215
|
+
break;
|
26216
|
+
case 8:
|
26217
|
+
message.fee = reader.int64();
|
26218
|
+
break;
|
26219
|
+
default:
|
26220
|
+
reader.skipType(tag & 7);
|
26221
|
+
break;
|
26222
|
+
}
|
26223
|
+
}
|
26224
|
+
return message;
|
26225
|
+
};
|
26226
|
+
|
26227
|
+
/**
|
26228
|
+
* Verifies a SigningOutput message.
|
26229
|
+
* @function verify
|
26230
|
+
* @memberof TW.BitcoinV2.Proto.SigningOutput
|
26231
|
+
* @static
|
26232
|
+
* @param {Object.<string,*>} message Plain object to verify
|
26233
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
26234
|
+
*/
|
26235
|
+
SigningOutput.verify = function verify(message) {
|
26236
|
+
if (typeof message !== "object" || message === null)
|
26237
|
+
return "object expected";
|
26238
|
+
if (message.error != null && message.hasOwnProperty("error"))
|
26239
|
+
switch (message.error) {
|
26240
|
+
default:
|
26241
|
+
return "error: enum value expected";
|
26242
|
+
case 0:
|
26243
|
+
case 1:
|
26244
|
+
case 2:
|
26245
|
+
case 3:
|
26246
|
+
case 4:
|
26247
|
+
case 5:
|
26248
|
+
case 15:
|
26249
|
+
case 16:
|
26250
|
+
case 17:
|
26251
|
+
case 18:
|
26252
|
+
case 6:
|
26253
|
+
case 7:
|
26254
|
+
case 8:
|
26255
|
+
case 9:
|
26256
|
+
case 10:
|
26257
|
+
case 11:
|
26258
|
+
case 12:
|
26259
|
+
case 13:
|
26260
|
+
case 14:
|
26261
|
+
case 19:
|
26262
|
+
case 20:
|
26263
|
+
case 21:
|
26264
|
+
case 22:
|
26265
|
+
case 23:
|
26266
|
+
case 24:
|
26267
|
+
case 25:
|
26268
|
+
break;
|
26269
|
+
}
|
26270
|
+
if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
|
26271
|
+
if (!$util.isString(message.errorMessage))
|
26272
|
+
return "errorMessage: string expected";
|
26273
|
+
if (message.transaction != null && message.hasOwnProperty("transaction")) {
|
26274
|
+
var error = $root.TW.BitcoinV2.Proto.Transaction.verify(message.transaction);
|
26275
|
+
if (error)
|
26276
|
+
return "transaction." + error;
|
26277
|
+
}
|
26278
|
+
if (message.encoded != null && message.hasOwnProperty("encoded"))
|
26279
|
+
if (!(message.encoded && typeof message.encoded.length === "number" || $util.isString(message.encoded)))
|
26280
|
+
return "encoded: buffer expected";
|
26281
|
+
if (message.txid != null && message.hasOwnProperty("txid"))
|
26282
|
+
if (!(message.txid && typeof message.txid.length === "number" || $util.isString(message.txid)))
|
26283
|
+
return "txid: buffer expected";
|
26284
|
+
if (message.vsize != null && message.hasOwnProperty("vsize"))
|
26285
|
+
if (!$util.isInteger(message.vsize) && !(message.vsize && $util.isInteger(message.vsize.low) && $util.isInteger(message.vsize.high)))
|
26286
|
+
return "vsize: integer|Long expected";
|
26287
|
+
if (message.weight != null && message.hasOwnProperty("weight"))
|
26288
|
+
if (!$util.isInteger(message.weight) && !(message.weight && $util.isInteger(message.weight.low) && $util.isInteger(message.weight.high)))
|
26289
|
+
return "weight: integer|Long expected";
|
26290
|
+
if (message.fee != null && message.hasOwnProperty("fee"))
|
26291
|
+
if (!$util.isInteger(message.fee) && !(message.fee && $util.isInteger(message.fee.low) && $util.isInteger(message.fee.high)))
|
26292
|
+
return "fee: integer|Long expected";
|
26293
|
+
return null;
|
26294
|
+
};
|
26295
|
+
|
26296
|
+
/**
|
26297
|
+
* Creates a SigningOutput message from a plain object. Also converts values to their respective internal types.
|
26298
|
+
* @function fromObject
|
26299
|
+
* @memberof TW.BitcoinV2.Proto.SigningOutput
|
26300
|
+
* @static
|
26301
|
+
* @param {Object.<string,*>} object Plain object
|
26302
|
+
* @returns {TW.BitcoinV2.Proto.SigningOutput} SigningOutput
|
26303
|
+
*/
|
26304
|
+
SigningOutput.fromObject = function fromObject(object) {
|
26305
|
+
if (object instanceof $root.TW.BitcoinV2.Proto.SigningOutput)
|
26306
|
+
return object;
|
26307
|
+
var message = new $root.TW.BitcoinV2.Proto.SigningOutput();
|
26308
|
+
switch (object.error) {
|
26309
|
+
case "OK":
|
26310
|
+
case 0:
|
26311
|
+
message.error = 0;
|
26312
|
+
break;
|
26313
|
+
case "Error_general":
|
26314
|
+
case 1:
|
26315
|
+
message.error = 1;
|
26316
|
+
break;
|
26317
|
+
case "Error_internal":
|
26318
|
+
case 2:
|
26319
|
+
message.error = 2;
|
26320
|
+
break;
|
26321
|
+
case "Error_low_balance":
|
26322
|
+
case 3:
|
26323
|
+
message.error = 3;
|
26324
|
+
break;
|
26325
|
+
case "Error_zero_amount_requested":
|
26326
|
+
case 4:
|
26327
|
+
message.error = 4;
|
26328
|
+
break;
|
26329
|
+
case "Error_missing_private_key":
|
26330
|
+
case 5:
|
26331
|
+
message.error = 5;
|
26332
|
+
break;
|
26333
|
+
case "Error_invalid_private_key":
|
26334
|
+
case 15:
|
26335
|
+
message.error = 15;
|
26336
|
+
break;
|
26337
|
+
case "Error_invalid_address":
|
26338
|
+
case 16:
|
26339
|
+
message.error = 16;
|
26340
|
+
break;
|
26341
|
+
case "Error_invalid_utxo":
|
26342
|
+
case 17:
|
26343
|
+
message.error = 17;
|
26344
|
+
break;
|
26345
|
+
case "Error_invalid_utxo_amount":
|
26346
|
+
case 18:
|
26347
|
+
message.error = 18;
|
26348
|
+
break;
|
26349
|
+
case "Error_wrong_fee":
|
26350
|
+
case 6:
|
26351
|
+
message.error = 6;
|
26352
|
+
break;
|
26353
|
+
case "Error_signing":
|
26354
|
+
case 7:
|
26355
|
+
message.error = 7;
|
26356
|
+
break;
|
26357
|
+
case "Error_tx_too_big":
|
26358
|
+
case 8:
|
26359
|
+
message.error = 8;
|
26360
|
+
break;
|
26361
|
+
case "Error_missing_input_utxos":
|
26362
|
+
case 9:
|
26363
|
+
message.error = 9;
|
26364
|
+
break;
|
26365
|
+
case "Error_not_enough_utxos":
|
26366
|
+
case 10:
|
26367
|
+
message.error = 10;
|
26368
|
+
break;
|
26369
|
+
case "Error_script_redeem":
|
26370
|
+
case 11:
|
26371
|
+
message.error = 11;
|
26372
|
+
break;
|
26373
|
+
case "Error_script_output":
|
26374
|
+
case 12:
|
26375
|
+
message.error = 12;
|
26376
|
+
break;
|
26377
|
+
case "Error_script_witness_program":
|
26378
|
+
case 13:
|
26379
|
+
message.error = 13;
|
26380
|
+
break;
|
26381
|
+
case "Error_invalid_memo":
|
26382
|
+
case 14:
|
26383
|
+
message.error = 14;
|
26384
|
+
break;
|
26385
|
+
case "Error_input_parse":
|
26386
|
+
case 19:
|
26387
|
+
message.error = 19;
|
26388
|
+
break;
|
26389
|
+
case "Error_no_support_n2n":
|
26390
|
+
case 20:
|
26391
|
+
message.error = 20;
|
26392
|
+
break;
|
26393
|
+
case "Error_signatures_count":
|
26394
|
+
case 21:
|
26395
|
+
message.error = 21;
|
26396
|
+
break;
|
26397
|
+
case "Error_invalid_params":
|
26398
|
+
case 22:
|
26399
|
+
message.error = 22;
|
26400
|
+
break;
|
26401
|
+
case "Error_invalid_requested_token_amount":
|
26402
|
+
case 23:
|
26403
|
+
message.error = 23;
|
26404
|
+
break;
|
26405
|
+
case "Error_not_supported":
|
26406
|
+
case 24:
|
26407
|
+
message.error = 24;
|
26408
|
+
break;
|
26409
|
+
case "Error_dust_amount_requested":
|
26410
|
+
case 25:
|
26411
|
+
message.error = 25;
|
26412
|
+
break;
|
26413
|
+
}
|
26414
|
+
if (object.errorMessage != null)
|
26415
|
+
message.errorMessage = String(object.errorMessage);
|
26416
|
+
if (object.transaction != null) {
|
26417
|
+
if (typeof object.transaction !== "object")
|
26418
|
+
throw TypeError(".TW.BitcoinV2.Proto.SigningOutput.transaction: object expected");
|
26419
|
+
message.transaction = $root.TW.BitcoinV2.Proto.Transaction.fromObject(object.transaction);
|
26420
|
+
}
|
26421
|
+
if (object.encoded != null)
|
26422
|
+
if (typeof object.encoded === "string")
|
26423
|
+
$util.base64.decode(object.encoded, message.encoded = $util.newBuffer($util.base64.length(object.encoded)), 0);
|
26424
|
+
else if (object.encoded.length)
|
26425
|
+
message.encoded = object.encoded;
|
26426
|
+
if (object.txid != null)
|
26427
|
+
if (typeof object.txid === "string")
|
26428
|
+
$util.base64.decode(object.txid, message.txid = $util.newBuffer($util.base64.length(object.txid)), 0);
|
26429
|
+
else if (object.txid.length)
|
26430
|
+
message.txid = object.txid;
|
26431
|
+
if (object.vsize != null)
|
26432
|
+
if ($util.Long)
|
26433
|
+
(message.vsize = $util.Long.fromValue(object.vsize)).unsigned = true;
|
26434
|
+
else if (typeof object.vsize === "string")
|
26435
|
+
message.vsize = parseInt(object.vsize, 10);
|
26436
|
+
else if (typeof object.vsize === "number")
|
26437
|
+
message.vsize = object.vsize;
|
26438
|
+
else if (typeof object.vsize === "object")
|
26439
|
+
message.vsize = new $util.LongBits(object.vsize.low >>> 0, object.vsize.high >>> 0).toNumber(true);
|
26440
|
+
if (object.weight != null)
|
26441
|
+
if ($util.Long)
|
26442
|
+
(message.weight = $util.Long.fromValue(object.weight)).unsigned = true;
|
26443
|
+
else if (typeof object.weight === "string")
|
26444
|
+
message.weight = parseInt(object.weight, 10);
|
26445
|
+
else if (typeof object.weight === "number")
|
26446
|
+
message.weight = object.weight;
|
26447
|
+
else if (typeof object.weight === "object")
|
26448
|
+
message.weight = new $util.LongBits(object.weight.low >>> 0, object.weight.high >>> 0).toNumber(true);
|
26449
|
+
if (object.fee != null)
|
26450
|
+
if ($util.Long)
|
26451
|
+
(message.fee = $util.Long.fromValue(object.fee)).unsigned = false;
|
26452
|
+
else if (typeof object.fee === "string")
|
26453
|
+
message.fee = parseInt(object.fee, 10);
|
26454
|
+
else if (typeof object.fee === "number")
|
26455
|
+
message.fee = object.fee;
|
26456
|
+
else if (typeof object.fee === "object")
|
26457
|
+
message.fee = new $util.LongBits(object.fee.low >>> 0, object.fee.high >>> 0).toNumber();
|
26458
|
+
return message;
|
26459
|
+
};
|
26460
|
+
|
26461
|
+
/**
|
26462
|
+
* Creates a plain object from a SigningOutput message. Also converts values to other types if specified.
|
26463
|
+
* @function toObject
|
26464
|
+
* @memberof TW.BitcoinV2.Proto.SigningOutput
|
26465
|
+
* @static
|
26466
|
+
* @param {TW.BitcoinV2.Proto.SigningOutput} message SigningOutput
|
26467
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
26468
|
+
* @returns {Object.<string,*>} Plain object
|
26469
|
+
*/
|
26470
|
+
SigningOutput.toObject = function toObject(message, options) {
|
26471
|
+
if (!options)
|
26472
|
+
options = {};
|
26473
|
+
var object = {};
|
26474
|
+
if (options.defaults) {
|
26475
|
+
object.error = options.enums === String ? "OK" : 0;
|
26476
|
+
object.errorMessage = "";
|
26477
|
+
object.transaction = null;
|
26478
|
+
if (options.bytes === String)
|
26479
|
+
object.encoded = "";
|
26480
|
+
else {
|
26481
|
+
object.encoded = [];
|
26482
|
+
if (options.bytes !== Array)
|
26483
|
+
object.encoded = $util.newBuffer(object.encoded);
|
26484
|
+
}
|
26485
|
+
if (options.bytes === String)
|
26486
|
+
object.txid = "";
|
26487
|
+
else {
|
26488
|
+
object.txid = [];
|
26489
|
+
if (options.bytes !== Array)
|
26490
|
+
object.txid = $util.newBuffer(object.txid);
|
26491
|
+
}
|
26492
|
+
if ($util.Long) {
|
26493
|
+
var long = new $util.Long(0, 0, true);
|
26494
|
+
object.vsize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
26495
|
+
} else
|
26496
|
+
object.vsize = options.longs === String ? "0" : 0;
|
26497
|
+
if ($util.Long) {
|
26498
|
+
var long = new $util.Long(0, 0, true);
|
26499
|
+
object.weight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
26500
|
+
} else
|
26501
|
+
object.weight = options.longs === String ? "0" : 0;
|
26502
|
+
if ($util.Long) {
|
26503
|
+
var long = new $util.Long(0, 0, false);
|
26504
|
+
object.fee = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
26505
|
+
} else
|
26506
|
+
object.fee = options.longs === String ? "0" : 0;
|
26507
|
+
}
|
26508
|
+
if (message.error != null && message.hasOwnProperty("error"))
|
26509
|
+
object.error = options.enums === String ? $root.TW.Common.Proto.SigningError[message.error] : message.error;
|
26510
|
+
if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
|
26511
|
+
object.errorMessage = message.errorMessage;
|
26512
|
+
if (message.transaction != null && message.hasOwnProperty("transaction"))
|
26513
|
+
object.transaction = $root.TW.BitcoinV2.Proto.Transaction.toObject(message.transaction, options);
|
26514
|
+
if (message.encoded != null && message.hasOwnProperty("encoded"))
|
26515
|
+
object.encoded = options.bytes === String ? $util.base64.encode(message.encoded, 0, message.encoded.length) : options.bytes === Array ? Array.prototype.slice.call(message.encoded) : message.encoded;
|
26516
|
+
if (message.txid != null && message.hasOwnProperty("txid"))
|
26517
|
+
object.txid = options.bytes === String ? $util.base64.encode(message.txid, 0, message.txid.length) : options.bytes === Array ? Array.prototype.slice.call(message.txid) : message.txid;
|
26518
|
+
if (message.vsize != null && message.hasOwnProperty("vsize"))
|
26519
|
+
if (typeof message.vsize === "number")
|
26520
|
+
object.vsize = options.longs === String ? String(message.vsize) : message.vsize;
|
26521
|
+
else
|
26522
|
+
object.vsize = options.longs === String ? $util.Long.prototype.toString.call(message.vsize) : options.longs === Number ? new $util.LongBits(message.vsize.low >>> 0, message.vsize.high >>> 0).toNumber(true) : message.vsize;
|
26523
|
+
if (message.weight != null && message.hasOwnProperty("weight"))
|
26524
|
+
if (typeof message.weight === "number")
|
26525
|
+
object.weight = options.longs === String ? String(message.weight) : message.weight;
|
26526
|
+
else
|
26527
|
+
object.weight = options.longs === String ? $util.Long.prototype.toString.call(message.weight) : options.longs === Number ? new $util.LongBits(message.weight.low >>> 0, message.weight.high >>> 0).toNumber(true) : message.weight;
|
26528
|
+
if (message.fee != null && message.hasOwnProperty("fee"))
|
26529
|
+
if (typeof message.fee === "number")
|
26530
|
+
object.fee = options.longs === String ? String(message.fee) : message.fee;
|
26531
|
+
else
|
26532
|
+
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;
|
26533
|
+
return object;
|
26534
|
+
};
|
26535
|
+
|
26536
|
+
/**
|
26537
|
+
* Converts this SigningOutput to JSON.
|
26538
|
+
* @function toJSON
|
26539
|
+
* @memberof TW.BitcoinV2.Proto.SigningOutput
|
26540
|
+
* @instance
|
26541
|
+
* @returns {Object.<string,*>} JSON object
|
26542
|
+
*/
|
26543
|
+
SigningOutput.prototype.toJSON = function toJSON() {
|
26544
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
26545
|
+
};
|
26546
|
+
|
26547
|
+
return SigningOutput;
|
26548
|
+
})();
|
26549
|
+
|
26550
|
+
Proto.PsbtSigningInput = (function() {
|
26551
|
+
|
26552
|
+
/**
|
26553
|
+
* Properties of a PsbtSigningInput.
|
26554
|
+
* @memberof TW.BitcoinV2.Proto
|
26555
|
+
* @interface IPsbtSigningInput
|
26556
|
+
* @property {Uint8Array|null} [psbt] PsbtSigningInput psbt
|
26557
|
+
* @property {Array.<Uint8Array>|null} [privateKeys] PsbtSigningInput privateKeys
|
26558
|
+
* @property {Array.<Uint8Array>|null} [publicKeys] PsbtSigningInput publicKeys
|
26559
|
+
* @property {TW.BitcoinV2.Proto.IChainInfo|null} [chainInfo] PsbtSigningInput chainInfo
|
26560
|
+
* @property {boolean|null} [dangerousUseFixedSchnorrRng] PsbtSigningInput dangerousUseFixedSchnorrRng
|
26561
|
+
*/
|
26562
|
+
|
26563
|
+
/**
|
26564
|
+
* Constructs a new PsbtSigningInput.
|
26565
|
+
* @memberof TW.BitcoinV2.Proto
|
26566
|
+
* @classdesc Represents a PsbtSigningInput.
|
26567
|
+
* @implements IPsbtSigningInput
|
26568
|
+
* @constructor
|
26569
|
+
* @param {TW.BitcoinV2.Proto.IPsbtSigningInput=} [properties] Properties to set
|
26570
|
+
*/
|
26571
|
+
function PsbtSigningInput(properties) {
|
26572
|
+
this.privateKeys = [];
|
26573
|
+
this.publicKeys = [];
|
26574
|
+
if (properties)
|
26575
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
26576
|
+
if (properties[keys[i]] != null)
|
26577
|
+
this[keys[i]] = properties[keys[i]];
|
26578
|
+
}
|
26579
|
+
|
26580
|
+
/**
|
26581
|
+
* PsbtSigningInput psbt.
|
26582
|
+
* @member {Uint8Array} psbt
|
26583
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningInput
|
26584
|
+
* @instance
|
26585
|
+
*/
|
26586
|
+
PsbtSigningInput.prototype.psbt = $util.newBuffer([]);
|
26587
|
+
|
26588
|
+
/**
|
26589
|
+
* PsbtSigningInput privateKeys.
|
26590
|
+
* @member {Array.<Uint8Array>} privateKeys
|
26591
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningInput
|
26592
|
+
* @instance
|
26593
|
+
*/
|
26594
|
+
PsbtSigningInput.prototype.privateKeys = $util.emptyArray;
|
26595
|
+
|
26596
|
+
/**
|
26597
|
+
* PsbtSigningInput publicKeys.
|
26598
|
+
* @member {Array.<Uint8Array>} publicKeys
|
26599
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningInput
|
26600
|
+
* @instance
|
26601
|
+
*/
|
26602
|
+
PsbtSigningInput.prototype.publicKeys = $util.emptyArray;
|
26603
|
+
|
26604
|
+
/**
|
26605
|
+
* PsbtSigningInput chainInfo.
|
26606
|
+
* @member {TW.BitcoinV2.Proto.IChainInfo|null|undefined} chainInfo
|
26607
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningInput
|
26608
|
+
* @instance
|
26609
|
+
*/
|
26610
|
+
PsbtSigningInput.prototype.chainInfo = null;
|
26611
|
+
|
26612
|
+
/**
|
26613
|
+
* PsbtSigningInput dangerousUseFixedSchnorrRng.
|
26614
|
+
* @member {boolean} dangerousUseFixedSchnorrRng
|
26615
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningInput
|
26616
|
+
* @instance
|
26617
|
+
*/
|
26618
|
+
PsbtSigningInput.prototype.dangerousUseFixedSchnorrRng = false;
|
26619
|
+
|
26620
|
+
/**
|
26621
|
+
* Creates a new PsbtSigningInput instance using the specified properties.
|
26622
|
+
* @function create
|
26623
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningInput
|
26624
|
+
* @static
|
26625
|
+
* @param {TW.BitcoinV2.Proto.IPsbtSigningInput=} [properties] Properties to set
|
26626
|
+
* @returns {TW.BitcoinV2.Proto.PsbtSigningInput} PsbtSigningInput instance
|
26627
|
+
*/
|
26628
|
+
PsbtSigningInput.create = function create(properties) {
|
26629
|
+
return new PsbtSigningInput(properties);
|
26630
|
+
};
|
26631
|
+
|
26632
|
+
/**
|
26633
|
+
* Encodes the specified PsbtSigningInput message. Does not implicitly {@link TW.BitcoinV2.Proto.PsbtSigningInput.verify|verify} messages.
|
26634
|
+
* @function encode
|
26635
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningInput
|
26636
|
+
* @static
|
26637
|
+
* @param {TW.BitcoinV2.Proto.IPsbtSigningInput} message PsbtSigningInput message or plain object to encode
|
26638
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
26639
|
+
* @returns {$protobuf.Writer} Writer
|
26640
|
+
*/
|
26641
|
+
PsbtSigningInput.encode = function encode(message, writer) {
|
26642
|
+
if (!writer)
|
26643
|
+
writer = $Writer.create();
|
26644
|
+
if (message.psbt != null && Object.hasOwnProperty.call(message, "psbt"))
|
26645
|
+
writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.psbt);
|
26646
|
+
if (message.privateKeys != null && message.privateKeys.length)
|
26647
|
+
for (var i = 0; i < message.privateKeys.length; ++i)
|
26648
|
+
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.privateKeys[i]);
|
26649
|
+
if (message.publicKeys != null && message.publicKeys.length)
|
26650
|
+
for (var i = 0; i < message.publicKeys.length; ++i)
|
26651
|
+
writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.publicKeys[i]);
|
26652
|
+
if (message.chainInfo != null && Object.hasOwnProperty.call(message, "chainInfo"))
|
26653
|
+
$root.TW.BitcoinV2.Proto.ChainInfo.encode(message.chainInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
26654
|
+
if (message.dangerousUseFixedSchnorrRng != null && Object.hasOwnProperty.call(message, "dangerousUseFixedSchnorrRng"))
|
26655
|
+
writer.uint32(/* id 5, wireType 0 =*/40).bool(message.dangerousUseFixedSchnorrRng);
|
26656
|
+
return writer;
|
26657
|
+
};
|
26658
|
+
|
26659
|
+
/**
|
26660
|
+
* Decodes a PsbtSigningInput message from the specified reader or buffer.
|
26661
|
+
* @function decode
|
26662
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningInput
|
26663
|
+
* @static
|
26664
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26665
|
+
* @param {number} [length] Message length if known beforehand
|
26666
|
+
* @returns {TW.BitcoinV2.Proto.PsbtSigningInput} PsbtSigningInput
|
26667
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
26668
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26669
|
+
*/
|
26670
|
+
PsbtSigningInput.decode = function decode(reader, length) {
|
26671
|
+
if (!(reader instanceof $Reader))
|
26672
|
+
reader = $Reader.create(reader);
|
26673
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.BitcoinV2.Proto.PsbtSigningInput();
|
26674
|
+
while (reader.pos < end) {
|
26675
|
+
var tag = reader.uint32();
|
26676
|
+
switch (tag >>> 3) {
|
26677
|
+
case 1:
|
26678
|
+
message.psbt = reader.bytes();
|
26679
|
+
break;
|
26680
|
+
case 2:
|
26681
|
+
if (!(message.privateKeys && message.privateKeys.length))
|
26682
|
+
message.privateKeys = [];
|
26683
|
+
message.privateKeys.push(reader.bytes());
|
26684
|
+
break;
|
26685
|
+
case 3:
|
26686
|
+
if (!(message.publicKeys && message.publicKeys.length))
|
26687
|
+
message.publicKeys = [];
|
26688
|
+
message.publicKeys.push(reader.bytes());
|
26689
|
+
break;
|
26690
|
+
case 4:
|
26691
|
+
message.chainInfo = $root.TW.BitcoinV2.Proto.ChainInfo.decode(reader, reader.uint32());
|
26692
|
+
break;
|
26693
|
+
case 5:
|
26694
|
+
message.dangerousUseFixedSchnorrRng = reader.bool();
|
26695
|
+
break;
|
26696
|
+
default:
|
26697
|
+
reader.skipType(tag & 7);
|
26698
|
+
break;
|
26699
|
+
}
|
26700
|
+
}
|
26701
|
+
return message;
|
26702
|
+
};
|
26703
|
+
|
26704
|
+
/**
|
26705
|
+
* Verifies a PsbtSigningInput message.
|
26706
|
+
* @function verify
|
26707
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningInput
|
26708
|
+
* @static
|
26709
|
+
* @param {Object.<string,*>} message Plain object to verify
|
26710
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
26711
|
+
*/
|
26712
|
+
PsbtSigningInput.verify = function verify(message) {
|
26713
|
+
if (typeof message !== "object" || message === null)
|
26714
|
+
return "object expected";
|
26715
|
+
if (message.psbt != null && message.hasOwnProperty("psbt"))
|
26716
|
+
if (!(message.psbt && typeof message.psbt.length === "number" || $util.isString(message.psbt)))
|
26717
|
+
return "psbt: buffer expected";
|
26718
|
+
if (message.privateKeys != null && message.hasOwnProperty("privateKeys")) {
|
26719
|
+
if (!Array.isArray(message.privateKeys))
|
26720
|
+
return "privateKeys: array expected";
|
26721
|
+
for (var i = 0; i < message.privateKeys.length; ++i)
|
26722
|
+
if (!(message.privateKeys[i] && typeof message.privateKeys[i].length === "number" || $util.isString(message.privateKeys[i])))
|
26723
|
+
return "privateKeys: buffer[] expected";
|
26724
|
+
}
|
26725
|
+
if (message.publicKeys != null && message.hasOwnProperty("publicKeys")) {
|
26726
|
+
if (!Array.isArray(message.publicKeys))
|
26727
|
+
return "publicKeys: array expected";
|
26728
|
+
for (var i = 0; i < message.publicKeys.length; ++i)
|
26729
|
+
if (!(message.publicKeys[i] && typeof message.publicKeys[i].length === "number" || $util.isString(message.publicKeys[i])))
|
26730
|
+
return "publicKeys: buffer[] expected";
|
26731
|
+
}
|
26732
|
+
if (message.chainInfo != null && message.hasOwnProperty("chainInfo")) {
|
26733
|
+
var error = $root.TW.BitcoinV2.Proto.ChainInfo.verify(message.chainInfo);
|
26734
|
+
if (error)
|
26735
|
+
return "chainInfo." + error;
|
26736
|
+
}
|
26737
|
+
if (message.dangerousUseFixedSchnorrRng != null && message.hasOwnProperty("dangerousUseFixedSchnorrRng"))
|
26738
|
+
if (typeof message.dangerousUseFixedSchnorrRng !== "boolean")
|
26739
|
+
return "dangerousUseFixedSchnorrRng: boolean expected";
|
26740
|
+
return null;
|
26741
|
+
};
|
26742
|
+
|
26743
|
+
/**
|
26744
|
+
* Creates a PsbtSigningInput message from a plain object. Also converts values to their respective internal types.
|
26745
|
+
* @function fromObject
|
26746
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningInput
|
26747
|
+
* @static
|
26748
|
+
* @param {Object.<string,*>} object Plain object
|
26749
|
+
* @returns {TW.BitcoinV2.Proto.PsbtSigningInput} PsbtSigningInput
|
26750
|
+
*/
|
26751
|
+
PsbtSigningInput.fromObject = function fromObject(object) {
|
26752
|
+
if (object instanceof $root.TW.BitcoinV2.Proto.PsbtSigningInput)
|
26753
|
+
return object;
|
26754
|
+
var message = new $root.TW.BitcoinV2.Proto.PsbtSigningInput();
|
26755
|
+
if (object.psbt != null)
|
26756
|
+
if (typeof object.psbt === "string")
|
26757
|
+
$util.base64.decode(object.psbt, message.psbt = $util.newBuffer($util.base64.length(object.psbt)), 0);
|
26758
|
+
else if (object.psbt.length)
|
26759
|
+
message.psbt = object.psbt;
|
26760
|
+
if (object.privateKeys) {
|
26761
|
+
if (!Array.isArray(object.privateKeys))
|
26762
|
+
throw TypeError(".TW.BitcoinV2.Proto.PsbtSigningInput.privateKeys: array expected");
|
26763
|
+
message.privateKeys = [];
|
26764
|
+
for (var i = 0; i < object.privateKeys.length; ++i)
|
26765
|
+
if (typeof object.privateKeys[i] === "string")
|
26766
|
+
$util.base64.decode(object.privateKeys[i], message.privateKeys[i] = $util.newBuffer($util.base64.length(object.privateKeys[i])), 0);
|
26767
|
+
else if (object.privateKeys[i].length)
|
26768
|
+
message.privateKeys[i] = object.privateKeys[i];
|
26769
|
+
}
|
26770
|
+
if (object.publicKeys) {
|
26771
|
+
if (!Array.isArray(object.publicKeys))
|
26772
|
+
throw TypeError(".TW.BitcoinV2.Proto.PsbtSigningInput.publicKeys: array expected");
|
26773
|
+
message.publicKeys = [];
|
26774
|
+
for (var i = 0; i < object.publicKeys.length; ++i)
|
26775
|
+
if (typeof object.publicKeys[i] === "string")
|
26776
|
+
$util.base64.decode(object.publicKeys[i], message.publicKeys[i] = $util.newBuffer($util.base64.length(object.publicKeys[i])), 0);
|
26777
|
+
else if (object.publicKeys[i].length)
|
26778
|
+
message.publicKeys[i] = object.publicKeys[i];
|
26779
|
+
}
|
26780
|
+
if (object.chainInfo != null) {
|
26781
|
+
if (typeof object.chainInfo !== "object")
|
26782
|
+
throw TypeError(".TW.BitcoinV2.Proto.PsbtSigningInput.chainInfo: object expected");
|
26783
|
+
message.chainInfo = $root.TW.BitcoinV2.Proto.ChainInfo.fromObject(object.chainInfo);
|
26784
|
+
}
|
26785
|
+
if (object.dangerousUseFixedSchnorrRng != null)
|
26786
|
+
message.dangerousUseFixedSchnorrRng = Boolean(object.dangerousUseFixedSchnorrRng);
|
26787
|
+
return message;
|
26788
|
+
};
|
26789
|
+
|
26790
|
+
/**
|
26791
|
+
* Creates a plain object from a PsbtSigningInput message. Also converts values to other types if specified.
|
26792
|
+
* @function toObject
|
26793
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningInput
|
26794
|
+
* @static
|
26795
|
+
* @param {TW.BitcoinV2.Proto.PsbtSigningInput} message PsbtSigningInput
|
26796
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
26797
|
+
* @returns {Object.<string,*>} Plain object
|
26798
|
+
*/
|
26799
|
+
PsbtSigningInput.toObject = function toObject(message, options) {
|
26800
|
+
if (!options)
|
26801
|
+
options = {};
|
26802
|
+
var object = {};
|
26803
|
+
if (options.arrays || options.defaults) {
|
26804
|
+
object.privateKeys = [];
|
26805
|
+
object.publicKeys = [];
|
26806
|
+
}
|
26807
|
+
if (options.defaults) {
|
26808
|
+
if (options.bytes === String)
|
26809
|
+
object.psbt = "";
|
26810
|
+
else {
|
26811
|
+
object.psbt = [];
|
26812
|
+
if (options.bytes !== Array)
|
26813
|
+
object.psbt = $util.newBuffer(object.psbt);
|
26814
|
+
}
|
26815
|
+
object.chainInfo = null;
|
26816
|
+
object.dangerousUseFixedSchnorrRng = false;
|
26817
|
+
}
|
26818
|
+
if (message.psbt != null && message.hasOwnProperty("psbt"))
|
26819
|
+
object.psbt = options.bytes === String ? $util.base64.encode(message.psbt, 0, message.psbt.length) : options.bytes === Array ? Array.prototype.slice.call(message.psbt) : message.psbt;
|
26820
|
+
if (message.privateKeys && message.privateKeys.length) {
|
26821
|
+
object.privateKeys = [];
|
26822
|
+
for (var j = 0; j < message.privateKeys.length; ++j)
|
26823
|
+
object.privateKeys[j] = options.bytes === String ? $util.base64.encode(message.privateKeys[j], 0, message.privateKeys[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.privateKeys[j]) : message.privateKeys[j];
|
26824
|
+
}
|
26825
|
+
if (message.publicKeys && message.publicKeys.length) {
|
26826
|
+
object.publicKeys = [];
|
26827
|
+
for (var j = 0; j < message.publicKeys.length; ++j)
|
26828
|
+
object.publicKeys[j] = options.bytes === String ? $util.base64.encode(message.publicKeys[j], 0, message.publicKeys[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.publicKeys[j]) : message.publicKeys[j];
|
26829
|
+
}
|
26830
|
+
if (message.chainInfo != null && message.hasOwnProperty("chainInfo"))
|
26831
|
+
object.chainInfo = $root.TW.BitcoinV2.Proto.ChainInfo.toObject(message.chainInfo, options);
|
26832
|
+
if (message.dangerousUseFixedSchnorrRng != null && message.hasOwnProperty("dangerousUseFixedSchnorrRng"))
|
26833
|
+
object.dangerousUseFixedSchnorrRng = message.dangerousUseFixedSchnorrRng;
|
26834
|
+
return object;
|
26835
|
+
};
|
26836
|
+
|
26837
|
+
/**
|
26838
|
+
* Converts this PsbtSigningInput to JSON.
|
26839
|
+
* @function toJSON
|
26840
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningInput
|
26841
|
+
* @instance
|
26842
|
+
* @returns {Object.<string,*>} JSON object
|
26843
|
+
*/
|
26844
|
+
PsbtSigningInput.prototype.toJSON = function toJSON() {
|
26845
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
26846
|
+
};
|
26013
26847
|
|
26014
|
-
return
|
26848
|
+
return PsbtSigningInput;
|
26015
26849
|
})();
|
26016
26850
|
|
26017
|
-
Proto.
|
26851
|
+
Proto.PsbtSigningOutput = (function() {
|
26018
26852
|
|
26019
26853
|
/**
|
26020
|
-
* Properties of a
|
26854
|
+
* Properties of a PsbtSigningOutput.
|
26021
26855
|
* @memberof TW.BitcoinV2.Proto
|
26022
|
-
* @interface
|
26023
|
-
* @property {TW.Common.Proto.SigningError|null} [error]
|
26024
|
-
* @property {string|null} [errorMessage]
|
26025
|
-
* @property {TW.BitcoinV2.Proto.ITransaction|null} [transaction]
|
26026
|
-
* @property {Uint8Array|null} [encoded]
|
26027
|
-
* @property {Uint8Array|null} [txid]
|
26028
|
-
* @property {Long|null} [vsize]
|
26029
|
-
* @property {Long|null} [weight]
|
26030
|
-
* @property {Long|null} [fee]
|
26856
|
+
* @interface IPsbtSigningOutput
|
26857
|
+
* @property {TW.Common.Proto.SigningError|null} [error] PsbtSigningOutput error
|
26858
|
+
* @property {string|null} [errorMessage] PsbtSigningOutput errorMessage
|
26859
|
+
* @property {TW.BitcoinV2.Proto.ITransaction|null} [transaction] PsbtSigningOutput transaction
|
26860
|
+
* @property {Uint8Array|null} [encoded] PsbtSigningOutput encoded
|
26861
|
+
* @property {Uint8Array|null} [txid] PsbtSigningOutput txid
|
26862
|
+
* @property {Long|null} [vsize] PsbtSigningOutput vsize
|
26863
|
+
* @property {Long|null} [weight] PsbtSigningOutput weight
|
26864
|
+
* @property {Long|null} [fee] PsbtSigningOutput fee
|
26865
|
+
* @property {Uint8Array|null} [psbt] PsbtSigningOutput psbt
|
26031
26866
|
*/
|
26032
26867
|
|
26033
26868
|
/**
|
26034
|
-
* Constructs a new
|
26869
|
+
* Constructs a new PsbtSigningOutput.
|
26035
26870
|
* @memberof TW.BitcoinV2.Proto
|
26036
|
-
* @classdesc Represents a
|
26037
|
-
* @implements
|
26871
|
+
* @classdesc Represents a PsbtSigningOutput.
|
26872
|
+
* @implements IPsbtSigningOutput
|
26038
26873
|
* @constructor
|
26039
|
-
* @param {TW.BitcoinV2.Proto.
|
26874
|
+
* @param {TW.BitcoinV2.Proto.IPsbtSigningOutput=} [properties] Properties to set
|
26040
26875
|
*/
|
26041
|
-
function
|
26876
|
+
function PsbtSigningOutput(properties) {
|
26042
26877
|
if (properties)
|
26043
26878
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
26044
26879
|
if (properties[keys[i]] != null)
|
@@ -26046,91 +26881,99 @@
|
|
26046
26881
|
}
|
26047
26882
|
|
26048
26883
|
/**
|
26049
|
-
*
|
26884
|
+
* PsbtSigningOutput error.
|
26050
26885
|
* @member {TW.Common.Proto.SigningError} error
|
26051
|
-
* @memberof TW.BitcoinV2.Proto.
|
26886
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningOutput
|
26052
26887
|
* @instance
|
26053
26888
|
*/
|
26054
|
-
|
26889
|
+
PsbtSigningOutput.prototype.error = 0;
|
26055
26890
|
|
26056
26891
|
/**
|
26057
|
-
*
|
26892
|
+
* PsbtSigningOutput errorMessage.
|
26058
26893
|
* @member {string} errorMessage
|
26059
|
-
* @memberof TW.BitcoinV2.Proto.
|
26894
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningOutput
|
26060
26895
|
* @instance
|
26061
26896
|
*/
|
26062
|
-
|
26897
|
+
PsbtSigningOutput.prototype.errorMessage = "";
|
26063
26898
|
|
26064
26899
|
/**
|
26065
|
-
*
|
26900
|
+
* PsbtSigningOutput transaction.
|
26066
26901
|
* @member {TW.BitcoinV2.Proto.ITransaction|null|undefined} transaction
|
26067
|
-
* @memberof TW.BitcoinV2.Proto.
|
26902
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningOutput
|
26068
26903
|
* @instance
|
26069
26904
|
*/
|
26070
|
-
|
26905
|
+
PsbtSigningOutput.prototype.transaction = null;
|
26071
26906
|
|
26072
26907
|
/**
|
26073
|
-
*
|
26908
|
+
* PsbtSigningOutput encoded.
|
26074
26909
|
* @member {Uint8Array} encoded
|
26075
|
-
* @memberof TW.BitcoinV2.Proto.
|
26910
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningOutput
|
26076
26911
|
* @instance
|
26077
26912
|
*/
|
26078
|
-
|
26913
|
+
PsbtSigningOutput.prototype.encoded = $util.newBuffer([]);
|
26079
26914
|
|
26080
26915
|
/**
|
26081
|
-
*
|
26916
|
+
* PsbtSigningOutput txid.
|
26082
26917
|
* @member {Uint8Array} txid
|
26083
|
-
* @memberof TW.BitcoinV2.Proto.
|
26918
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningOutput
|
26084
26919
|
* @instance
|
26085
26920
|
*/
|
26086
|
-
|
26921
|
+
PsbtSigningOutput.prototype.txid = $util.newBuffer([]);
|
26087
26922
|
|
26088
26923
|
/**
|
26089
|
-
*
|
26924
|
+
* PsbtSigningOutput vsize.
|
26090
26925
|
* @member {Long} vsize
|
26091
|
-
* @memberof TW.BitcoinV2.Proto.
|
26926
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningOutput
|
26092
26927
|
* @instance
|
26093
26928
|
*/
|
26094
|
-
|
26929
|
+
PsbtSigningOutput.prototype.vsize = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
26095
26930
|
|
26096
26931
|
/**
|
26097
|
-
*
|
26932
|
+
* PsbtSigningOutput weight.
|
26098
26933
|
* @member {Long} weight
|
26099
|
-
* @memberof TW.BitcoinV2.Proto.
|
26934
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningOutput
|
26100
26935
|
* @instance
|
26101
26936
|
*/
|
26102
|
-
|
26937
|
+
PsbtSigningOutput.prototype.weight = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
26103
26938
|
|
26104
26939
|
/**
|
26105
|
-
*
|
26940
|
+
* PsbtSigningOutput fee.
|
26106
26941
|
* @member {Long} fee
|
26107
|
-
* @memberof TW.BitcoinV2.Proto.
|
26942
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningOutput
|
26108
26943
|
* @instance
|
26109
26944
|
*/
|
26110
|
-
|
26945
|
+
PsbtSigningOutput.prototype.fee = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
26111
26946
|
|
26112
26947
|
/**
|
26113
|
-
*
|
26948
|
+
* PsbtSigningOutput psbt.
|
26949
|
+
* @member {Uint8Array} psbt
|
26950
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningOutput
|
26951
|
+
* @instance
|
26952
|
+
*/
|
26953
|
+
PsbtSigningOutput.prototype.psbt = $util.newBuffer([]);
|
26954
|
+
|
26955
|
+
/**
|
26956
|
+
* Creates a new PsbtSigningOutput instance using the specified properties.
|
26114
26957
|
* @function create
|
26115
|
-
* @memberof TW.BitcoinV2.Proto.
|
26958
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningOutput
|
26116
26959
|
* @static
|
26117
|
-
* @param {TW.BitcoinV2.Proto.
|
26118
|
-
* @returns {TW.BitcoinV2.Proto.
|
26960
|
+
* @param {TW.BitcoinV2.Proto.IPsbtSigningOutput=} [properties] Properties to set
|
26961
|
+
* @returns {TW.BitcoinV2.Proto.PsbtSigningOutput} PsbtSigningOutput instance
|
26119
26962
|
*/
|
26120
|
-
|
26121
|
-
return new
|
26963
|
+
PsbtSigningOutput.create = function create(properties) {
|
26964
|
+
return new PsbtSigningOutput(properties);
|
26122
26965
|
};
|
26123
26966
|
|
26124
26967
|
/**
|
26125
|
-
* Encodes the specified
|
26968
|
+
* Encodes the specified PsbtSigningOutput message. Does not implicitly {@link TW.BitcoinV2.Proto.PsbtSigningOutput.verify|verify} messages.
|
26126
26969
|
* @function encode
|
26127
|
-
* @memberof TW.BitcoinV2.Proto.
|
26970
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningOutput
|
26128
26971
|
* @static
|
26129
|
-
* @param {TW.BitcoinV2.Proto.
|
26972
|
+
* @param {TW.BitcoinV2.Proto.IPsbtSigningOutput} message PsbtSigningOutput message or plain object to encode
|
26130
26973
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
26131
26974
|
* @returns {$protobuf.Writer} Writer
|
26132
26975
|
*/
|
26133
|
-
|
26976
|
+
PsbtSigningOutput.encode = function encode(message, writer) {
|
26134
26977
|
if (!writer)
|
26135
26978
|
writer = $Writer.create();
|
26136
26979
|
if (message.error != null && Object.hasOwnProperty.call(message, "error"))
|
@@ -26149,24 +26992,26 @@
|
|
26149
26992
|
writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.weight);
|
26150
26993
|
if (message.fee != null && Object.hasOwnProperty.call(message, "fee"))
|
26151
26994
|
writer.uint32(/* id 8, wireType 0 =*/64).int64(message.fee);
|
26995
|
+
if (message.psbt != null && Object.hasOwnProperty.call(message, "psbt"))
|
26996
|
+
writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.psbt);
|
26152
26997
|
return writer;
|
26153
26998
|
};
|
26154
26999
|
|
26155
27000
|
/**
|
26156
|
-
* Decodes a
|
27001
|
+
* Decodes a PsbtSigningOutput message from the specified reader or buffer.
|
26157
27002
|
* @function decode
|
26158
|
-
* @memberof TW.BitcoinV2.Proto.
|
27003
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningOutput
|
26159
27004
|
* @static
|
26160
27005
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26161
27006
|
* @param {number} [length] Message length if known beforehand
|
26162
|
-
* @returns {TW.BitcoinV2.Proto.
|
27007
|
+
* @returns {TW.BitcoinV2.Proto.PsbtSigningOutput} PsbtSigningOutput
|
26163
27008
|
* @throws {Error} If the payload is not a reader or valid buffer
|
26164
27009
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26165
27010
|
*/
|
26166
|
-
|
27011
|
+
PsbtSigningOutput.decode = function decode(reader, length) {
|
26167
27012
|
if (!(reader instanceof $Reader))
|
26168
27013
|
reader = $Reader.create(reader);
|
26169
|
-
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.BitcoinV2.Proto.
|
27014
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.BitcoinV2.Proto.PsbtSigningOutput();
|
26170
27015
|
while (reader.pos < end) {
|
26171
27016
|
var tag = reader.uint32();
|
26172
27017
|
switch (tag >>> 3) {
|
@@ -26194,6 +27039,9 @@
|
|
26194
27039
|
case 8:
|
26195
27040
|
message.fee = reader.int64();
|
26196
27041
|
break;
|
27042
|
+
case 9:
|
27043
|
+
message.psbt = reader.bytes();
|
27044
|
+
break;
|
26197
27045
|
default:
|
26198
27046
|
reader.skipType(tag & 7);
|
26199
27047
|
break;
|
@@ -26203,14 +27051,14 @@
|
|
26203
27051
|
};
|
26204
27052
|
|
26205
27053
|
/**
|
26206
|
-
* Verifies a
|
27054
|
+
* Verifies a PsbtSigningOutput message.
|
26207
27055
|
* @function verify
|
26208
|
-
* @memberof TW.BitcoinV2.Proto.
|
27056
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningOutput
|
26209
27057
|
* @static
|
26210
27058
|
* @param {Object.<string,*>} message Plain object to verify
|
26211
27059
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
26212
27060
|
*/
|
26213
|
-
|
27061
|
+
PsbtSigningOutput.verify = function verify(message) {
|
26214
27062
|
if (typeof message !== "object" || message === null)
|
26215
27063
|
return "object expected";
|
26216
27064
|
if (message.error != null && message.hasOwnProperty("error"))
|
@@ -26268,21 +27116,24 @@
|
|
26268
27116
|
if (message.fee != null && message.hasOwnProperty("fee"))
|
26269
27117
|
if (!$util.isInteger(message.fee) && !(message.fee && $util.isInteger(message.fee.low) && $util.isInteger(message.fee.high)))
|
26270
27118
|
return "fee: integer|Long expected";
|
27119
|
+
if (message.psbt != null && message.hasOwnProperty("psbt"))
|
27120
|
+
if (!(message.psbt && typeof message.psbt.length === "number" || $util.isString(message.psbt)))
|
27121
|
+
return "psbt: buffer expected";
|
26271
27122
|
return null;
|
26272
27123
|
};
|
26273
27124
|
|
26274
27125
|
/**
|
26275
|
-
* Creates a
|
27126
|
+
* Creates a PsbtSigningOutput message from a plain object. Also converts values to their respective internal types.
|
26276
27127
|
* @function fromObject
|
26277
|
-
* @memberof TW.BitcoinV2.Proto.
|
27128
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningOutput
|
26278
27129
|
* @static
|
26279
27130
|
* @param {Object.<string,*>} object Plain object
|
26280
|
-
* @returns {TW.BitcoinV2.Proto.
|
27131
|
+
* @returns {TW.BitcoinV2.Proto.PsbtSigningOutput} PsbtSigningOutput
|
26281
27132
|
*/
|
26282
|
-
|
26283
|
-
if (object instanceof $root.TW.BitcoinV2.Proto.
|
27133
|
+
PsbtSigningOutput.fromObject = function fromObject(object) {
|
27134
|
+
if (object instanceof $root.TW.BitcoinV2.Proto.PsbtSigningOutput)
|
26284
27135
|
return object;
|
26285
|
-
var message = new $root.TW.BitcoinV2.Proto.
|
27136
|
+
var message = new $root.TW.BitcoinV2.Proto.PsbtSigningOutput();
|
26286
27137
|
switch (object.error) {
|
26287
27138
|
case "OK":
|
26288
27139
|
case 0:
|
@@ -26393,7 +27244,7 @@
|
|
26393
27244
|
message.errorMessage = String(object.errorMessage);
|
26394
27245
|
if (object.transaction != null) {
|
26395
27246
|
if (typeof object.transaction !== "object")
|
26396
|
-
throw TypeError(".TW.BitcoinV2.Proto.
|
27247
|
+
throw TypeError(".TW.BitcoinV2.Proto.PsbtSigningOutput.transaction: object expected");
|
26397
27248
|
message.transaction = $root.TW.BitcoinV2.Proto.Transaction.fromObject(object.transaction);
|
26398
27249
|
}
|
26399
27250
|
if (object.encoded != null)
|
@@ -26433,19 +27284,24 @@
|
|
26433
27284
|
message.fee = object.fee;
|
26434
27285
|
else if (typeof object.fee === "object")
|
26435
27286
|
message.fee = new $util.LongBits(object.fee.low >>> 0, object.fee.high >>> 0).toNumber();
|
27287
|
+
if (object.psbt != null)
|
27288
|
+
if (typeof object.psbt === "string")
|
27289
|
+
$util.base64.decode(object.psbt, message.psbt = $util.newBuffer($util.base64.length(object.psbt)), 0);
|
27290
|
+
else if (object.psbt.length)
|
27291
|
+
message.psbt = object.psbt;
|
26436
27292
|
return message;
|
26437
27293
|
};
|
26438
27294
|
|
26439
27295
|
/**
|
26440
|
-
* Creates a plain object from a
|
27296
|
+
* Creates a plain object from a PsbtSigningOutput message. Also converts values to other types if specified.
|
26441
27297
|
* @function toObject
|
26442
|
-
* @memberof TW.BitcoinV2.Proto.
|
27298
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningOutput
|
26443
27299
|
* @static
|
26444
|
-
* @param {TW.BitcoinV2.Proto.
|
27300
|
+
* @param {TW.BitcoinV2.Proto.PsbtSigningOutput} message PsbtSigningOutput
|
26445
27301
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
26446
27302
|
* @returns {Object.<string,*>} Plain object
|
26447
27303
|
*/
|
26448
|
-
|
27304
|
+
PsbtSigningOutput.toObject = function toObject(message, options) {
|
26449
27305
|
if (!options)
|
26450
27306
|
options = {};
|
26451
27307
|
var object = {};
|
@@ -26482,6 +27338,13 @@
|
|
26482
27338
|
object.fee = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
26483
27339
|
} else
|
26484
27340
|
object.fee = options.longs === String ? "0" : 0;
|
27341
|
+
if (options.bytes === String)
|
27342
|
+
object.psbt = "";
|
27343
|
+
else {
|
27344
|
+
object.psbt = [];
|
27345
|
+
if (options.bytes !== Array)
|
27346
|
+
object.psbt = $util.newBuffer(object.psbt);
|
27347
|
+
}
|
26485
27348
|
}
|
26486
27349
|
if (message.error != null && message.hasOwnProperty("error"))
|
26487
27350
|
object.error = options.enums === String ? $root.TW.Common.Proto.SigningError[message.error] : message.error;
|
@@ -26508,21 +27371,23 @@
|
|
26508
27371
|
object.fee = options.longs === String ? String(message.fee) : message.fee;
|
26509
27372
|
else
|
26510
27373
|
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;
|
27374
|
+
if (message.psbt != null && message.hasOwnProperty("psbt"))
|
27375
|
+
object.psbt = options.bytes === String ? $util.base64.encode(message.psbt, 0, message.psbt.length) : options.bytes === Array ? Array.prototype.slice.call(message.psbt) : message.psbt;
|
26511
27376
|
return object;
|
26512
27377
|
};
|
26513
27378
|
|
26514
27379
|
/**
|
26515
|
-
* Converts this
|
27380
|
+
* Converts this PsbtSigningOutput to JSON.
|
26516
27381
|
* @function toJSON
|
26517
|
-
* @memberof TW.BitcoinV2.Proto.
|
27382
|
+
* @memberof TW.BitcoinV2.Proto.PsbtSigningOutput
|
26518
27383
|
* @instance
|
26519
27384
|
* @returns {Object.<string,*>} JSON object
|
26520
27385
|
*/
|
26521
|
-
|
27386
|
+
PsbtSigningOutput.prototype.toJSON = function toJSON() {
|
26522
27387
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
26523
27388
|
};
|
26524
27389
|
|
26525
|
-
return
|
27390
|
+
return PsbtSigningOutput;
|
26526
27391
|
})();
|
26527
27392
|
|
26528
27393
|
return Proto;
|
@@ -43975,6 +44840,206 @@
|
|
43975
44840
|
return UserOperation;
|
43976
44841
|
})();
|
43977
44842
|
|
44843
|
+
Proto.Access = (function() {
|
44844
|
+
|
44845
|
+
/**
|
44846
|
+
* Properties of an Access.
|
44847
|
+
* @memberof TW.Ethereum.Proto
|
44848
|
+
* @interface IAccess
|
44849
|
+
* @property {string|null} [address] Access address
|
44850
|
+
* @property {Array.<Uint8Array>|null} [storedKeys] Access storedKeys
|
44851
|
+
*/
|
44852
|
+
|
44853
|
+
/**
|
44854
|
+
* Constructs a new Access.
|
44855
|
+
* @memberof TW.Ethereum.Proto
|
44856
|
+
* @classdesc Represents an Access.
|
44857
|
+
* @implements IAccess
|
44858
|
+
* @constructor
|
44859
|
+
* @param {TW.Ethereum.Proto.IAccess=} [properties] Properties to set
|
44860
|
+
*/
|
44861
|
+
function Access(properties) {
|
44862
|
+
this.storedKeys = [];
|
44863
|
+
if (properties)
|
44864
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
44865
|
+
if (properties[keys[i]] != null)
|
44866
|
+
this[keys[i]] = properties[keys[i]];
|
44867
|
+
}
|
44868
|
+
|
44869
|
+
/**
|
44870
|
+
* Access address.
|
44871
|
+
* @member {string} address
|
44872
|
+
* @memberof TW.Ethereum.Proto.Access
|
44873
|
+
* @instance
|
44874
|
+
*/
|
44875
|
+
Access.prototype.address = "";
|
44876
|
+
|
44877
|
+
/**
|
44878
|
+
* Access storedKeys.
|
44879
|
+
* @member {Array.<Uint8Array>} storedKeys
|
44880
|
+
* @memberof TW.Ethereum.Proto.Access
|
44881
|
+
* @instance
|
44882
|
+
*/
|
44883
|
+
Access.prototype.storedKeys = $util.emptyArray;
|
44884
|
+
|
44885
|
+
/**
|
44886
|
+
* Creates a new Access instance using the specified properties.
|
44887
|
+
* @function create
|
44888
|
+
* @memberof TW.Ethereum.Proto.Access
|
44889
|
+
* @static
|
44890
|
+
* @param {TW.Ethereum.Proto.IAccess=} [properties] Properties to set
|
44891
|
+
* @returns {TW.Ethereum.Proto.Access} Access instance
|
44892
|
+
*/
|
44893
|
+
Access.create = function create(properties) {
|
44894
|
+
return new Access(properties);
|
44895
|
+
};
|
44896
|
+
|
44897
|
+
/**
|
44898
|
+
* Encodes the specified Access message. Does not implicitly {@link TW.Ethereum.Proto.Access.verify|verify} messages.
|
44899
|
+
* @function encode
|
44900
|
+
* @memberof TW.Ethereum.Proto.Access
|
44901
|
+
* @static
|
44902
|
+
* @param {TW.Ethereum.Proto.IAccess} message Access message or plain object to encode
|
44903
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
44904
|
+
* @returns {$protobuf.Writer} Writer
|
44905
|
+
*/
|
44906
|
+
Access.encode = function encode(message, writer) {
|
44907
|
+
if (!writer)
|
44908
|
+
writer = $Writer.create();
|
44909
|
+
if (message.address != null && Object.hasOwnProperty.call(message, "address"))
|
44910
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.address);
|
44911
|
+
if (message.storedKeys != null && message.storedKeys.length)
|
44912
|
+
for (var i = 0; i < message.storedKeys.length; ++i)
|
44913
|
+
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.storedKeys[i]);
|
44914
|
+
return writer;
|
44915
|
+
};
|
44916
|
+
|
44917
|
+
/**
|
44918
|
+
* Decodes an Access message from the specified reader or buffer.
|
44919
|
+
* @function decode
|
44920
|
+
* @memberof TW.Ethereum.Proto.Access
|
44921
|
+
* @static
|
44922
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
44923
|
+
* @param {number} [length] Message length if known beforehand
|
44924
|
+
* @returns {TW.Ethereum.Proto.Access} Access
|
44925
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
44926
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
44927
|
+
*/
|
44928
|
+
Access.decode = function decode(reader, length) {
|
44929
|
+
if (!(reader instanceof $Reader))
|
44930
|
+
reader = $Reader.create(reader);
|
44931
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Ethereum.Proto.Access();
|
44932
|
+
while (reader.pos < end) {
|
44933
|
+
var tag = reader.uint32();
|
44934
|
+
switch (tag >>> 3) {
|
44935
|
+
case 1:
|
44936
|
+
message.address = reader.string();
|
44937
|
+
break;
|
44938
|
+
case 2:
|
44939
|
+
if (!(message.storedKeys && message.storedKeys.length))
|
44940
|
+
message.storedKeys = [];
|
44941
|
+
message.storedKeys.push(reader.bytes());
|
44942
|
+
break;
|
44943
|
+
default:
|
44944
|
+
reader.skipType(tag & 7);
|
44945
|
+
break;
|
44946
|
+
}
|
44947
|
+
}
|
44948
|
+
return message;
|
44949
|
+
};
|
44950
|
+
|
44951
|
+
/**
|
44952
|
+
* Verifies an Access message.
|
44953
|
+
* @function verify
|
44954
|
+
* @memberof TW.Ethereum.Proto.Access
|
44955
|
+
* @static
|
44956
|
+
* @param {Object.<string,*>} message Plain object to verify
|
44957
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
44958
|
+
*/
|
44959
|
+
Access.verify = function verify(message) {
|
44960
|
+
if (typeof message !== "object" || message === null)
|
44961
|
+
return "object expected";
|
44962
|
+
if (message.address != null && message.hasOwnProperty("address"))
|
44963
|
+
if (!$util.isString(message.address))
|
44964
|
+
return "address: string expected";
|
44965
|
+
if (message.storedKeys != null && message.hasOwnProperty("storedKeys")) {
|
44966
|
+
if (!Array.isArray(message.storedKeys))
|
44967
|
+
return "storedKeys: array expected";
|
44968
|
+
for (var i = 0; i < message.storedKeys.length; ++i)
|
44969
|
+
if (!(message.storedKeys[i] && typeof message.storedKeys[i].length === "number" || $util.isString(message.storedKeys[i])))
|
44970
|
+
return "storedKeys: buffer[] expected";
|
44971
|
+
}
|
44972
|
+
return null;
|
44973
|
+
};
|
44974
|
+
|
44975
|
+
/**
|
44976
|
+
* Creates an Access message from a plain object. Also converts values to their respective internal types.
|
44977
|
+
* @function fromObject
|
44978
|
+
* @memberof TW.Ethereum.Proto.Access
|
44979
|
+
* @static
|
44980
|
+
* @param {Object.<string,*>} object Plain object
|
44981
|
+
* @returns {TW.Ethereum.Proto.Access} Access
|
44982
|
+
*/
|
44983
|
+
Access.fromObject = function fromObject(object) {
|
44984
|
+
if (object instanceof $root.TW.Ethereum.Proto.Access)
|
44985
|
+
return object;
|
44986
|
+
var message = new $root.TW.Ethereum.Proto.Access();
|
44987
|
+
if (object.address != null)
|
44988
|
+
message.address = String(object.address);
|
44989
|
+
if (object.storedKeys) {
|
44990
|
+
if (!Array.isArray(object.storedKeys))
|
44991
|
+
throw TypeError(".TW.Ethereum.Proto.Access.storedKeys: array expected");
|
44992
|
+
message.storedKeys = [];
|
44993
|
+
for (var i = 0; i < object.storedKeys.length; ++i)
|
44994
|
+
if (typeof object.storedKeys[i] === "string")
|
44995
|
+
$util.base64.decode(object.storedKeys[i], message.storedKeys[i] = $util.newBuffer($util.base64.length(object.storedKeys[i])), 0);
|
44996
|
+
else if (object.storedKeys[i].length)
|
44997
|
+
message.storedKeys[i] = object.storedKeys[i];
|
44998
|
+
}
|
44999
|
+
return message;
|
45000
|
+
};
|
45001
|
+
|
45002
|
+
/**
|
45003
|
+
* Creates a plain object from an Access message. Also converts values to other types if specified.
|
45004
|
+
* @function toObject
|
45005
|
+
* @memberof TW.Ethereum.Proto.Access
|
45006
|
+
* @static
|
45007
|
+
* @param {TW.Ethereum.Proto.Access} message Access
|
45008
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
45009
|
+
* @returns {Object.<string,*>} Plain object
|
45010
|
+
*/
|
45011
|
+
Access.toObject = function toObject(message, options) {
|
45012
|
+
if (!options)
|
45013
|
+
options = {};
|
45014
|
+
var object = {};
|
45015
|
+
if (options.arrays || options.defaults)
|
45016
|
+
object.storedKeys = [];
|
45017
|
+
if (options.defaults)
|
45018
|
+
object.address = "";
|
45019
|
+
if (message.address != null && message.hasOwnProperty("address"))
|
45020
|
+
object.address = message.address;
|
45021
|
+
if (message.storedKeys && message.storedKeys.length) {
|
45022
|
+
object.storedKeys = [];
|
45023
|
+
for (var j = 0; j < message.storedKeys.length; ++j)
|
45024
|
+
object.storedKeys[j] = options.bytes === String ? $util.base64.encode(message.storedKeys[j], 0, message.storedKeys[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.storedKeys[j]) : message.storedKeys[j];
|
45025
|
+
}
|
45026
|
+
return object;
|
45027
|
+
};
|
45028
|
+
|
45029
|
+
/**
|
45030
|
+
* Converts this Access to JSON.
|
45031
|
+
* @function toJSON
|
45032
|
+
* @memberof TW.Ethereum.Proto.Access
|
45033
|
+
* @instance
|
45034
|
+
* @returns {Object.<string,*>} JSON object
|
45035
|
+
*/
|
45036
|
+
Access.prototype.toJSON = function toJSON() {
|
45037
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
45038
|
+
};
|
45039
|
+
|
45040
|
+
return Access;
|
45041
|
+
})();
|
45042
|
+
|
43978
45043
|
Proto.SigningInput = (function() {
|
43979
45044
|
|
43980
45045
|
/**
|
@@ -43992,6 +45057,7 @@
|
|
43992
45057
|
* @property {Uint8Array|null} [privateKey] SigningInput privateKey
|
43993
45058
|
* @property {TW.Ethereum.Proto.ITransaction|null} [transaction] SigningInput transaction
|
43994
45059
|
* @property {TW.Ethereum.Proto.IUserOperation|null} [userOperation] SigningInput userOperation
|
45060
|
+
* @property {Array.<TW.Ethereum.Proto.IAccess>|null} [accessList] SigningInput accessList
|
43995
45061
|
*/
|
43996
45062
|
|
43997
45063
|
/**
|
@@ -44003,6 +45069,7 @@
|
|
44003
45069
|
* @param {TW.Ethereum.Proto.ISigningInput=} [properties] Properties to set
|
44004
45070
|
*/
|
44005
45071
|
function SigningInput(properties) {
|
45072
|
+
this.accessList = [];
|
44006
45073
|
if (properties)
|
44007
45074
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
44008
45075
|
if (properties[keys[i]] != null)
|
@@ -44097,6 +45164,14 @@
|
|
44097
45164
|
*/
|
44098
45165
|
SigningInput.prototype.userOperation = null;
|
44099
45166
|
|
45167
|
+
/**
|
45168
|
+
* SigningInput accessList.
|
45169
|
+
* @member {Array.<TW.Ethereum.Proto.IAccess>} accessList
|
45170
|
+
* @memberof TW.Ethereum.Proto.SigningInput
|
45171
|
+
* @instance
|
45172
|
+
*/
|
45173
|
+
SigningInput.prototype.accessList = $util.emptyArray;
|
45174
|
+
|
44100
45175
|
/**
|
44101
45176
|
* Creates a new SigningInput instance using the specified properties.
|
44102
45177
|
* @function create
|
@@ -44143,6 +45218,9 @@
|
|
44143
45218
|
$root.TW.Ethereum.Proto.Transaction.encode(message.transaction, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
|
44144
45219
|
if (message.userOperation != null && Object.hasOwnProperty.call(message, "userOperation"))
|
44145
45220
|
$root.TW.Ethereum.Proto.UserOperation.encode(message.userOperation, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
|
45221
|
+
if (message.accessList != null && message.accessList.length)
|
45222
|
+
for (var i = 0; i < message.accessList.length; ++i)
|
45223
|
+
$root.TW.Ethereum.Proto.Access.encode(message.accessList[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
|
44146
45224
|
return writer;
|
44147
45225
|
};
|
44148
45226
|
|
@@ -44197,6 +45275,11 @@
|
|
44197
45275
|
case 11:
|
44198
45276
|
message.userOperation = $root.TW.Ethereum.Proto.UserOperation.decode(reader, reader.uint32());
|
44199
45277
|
break;
|
45278
|
+
case 12:
|
45279
|
+
if (!(message.accessList && message.accessList.length))
|
45280
|
+
message.accessList = [];
|
45281
|
+
message.accessList.push($root.TW.Ethereum.Proto.Access.decode(reader, reader.uint32()));
|
45282
|
+
break;
|
44200
45283
|
default:
|
44201
45284
|
reader.skipType(tag & 7);
|
44202
45285
|
break;
|
@@ -44259,6 +45342,15 @@
|
|
44259
45342
|
if (error)
|
44260
45343
|
return "userOperation." + error;
|
44261
45344
|
}
|
45345
|
+
if (message.accessList != null && message.hasOwnProperty("accessList")) {
|
45346
|
+
if (!Array.isArray(message.accessList))
|
45347
|
+
return "accessList: array expected";
|
45348
|
+
for (var i = 0; i < message.accessList.length; ++i) {
|
45349
|
+
var error = $root.TW.Ethereum.Proto.Access.verify(message.accessList[i]);
|
45350
|
+
if (error)
|
45351
|
+
return "accessList." + error;
|
45352
|
+
}
|
45353
|
+
}
|
44262
45354
|
return null;
|
44263
45355
|
};
|
44264
45356
|
|
@@ -44335,6 +45427,16 @@
|
|
44335
45427
|
throw TypeError(".TW.Ethereum.Proto.SigningInput.userOperation: object expected");
|
44336
45428
|
message.userOperation = $root.TW.Ethereum.Proto.UserOperation.fromObject(object.userOperation);
|
44337
45429
|
}
|
45430
|
+
if (object.accessList) {
|
45431
|
+
if (!Array.isArray(object.accessList))
|
45432
|
+
throw TypeError(".TW.Ethereum.Proto.SigningInput.accessList: array expected");
|
45433
|
+
message.accessList = [];
|
45434
|
+
for (var i = 0; i < object.accessList.length; ++i) {
|
45435
|
+
if (typeof object.accessList[i] !== "object")
|
45436
|
+
throw TypeError(".TW.Ethereum.Proto.SigningInput.accessList: object expected");
|
45437
|
+
message.accessList[i] = $root.TW.Ethereum.Proto.Access.fromObject(object.accessList[i]);
|
45438
|
+
}
|
45439
|
+
}
|
44338
45440
|
return message;
|
44339
45441
|
};
|
44340
45442
|
|
@@ -44351,6 +45453,8 @@
|
|
44351
45453
|
if (!options)
|
44352
45454
|
options = {};
|
44353
45455
|
var object = {};
|
45456
|
+
if (options.arrays || options.defaults)
|
45457
|
+
object.accessList = [];
|
44354
45458
|
if (options.defaults) {
|
44355
45459
|
if (options.bytes === String)
|
44356
45460
|
object.chainId = "";
|
@@ -44428,6 +45532,11 @@
|
|
44428
45532
|
object.transaction = $root.TW.Ethereum.Proto.Transaction.toObject(message.transaction, options);
|
44429
45533
|
if (message.userOperation != null && message.hasOwnProperty("userOperation"))
|
44430
45534
|
object.userOperation = $root.TW.Ethereum.Proto.UserOperation.toObject(message.userOperation, options);
|
45535
|
+
if (message.accessList && message.accessList.length) {
|
45536
|
+
object.accessList = [];
|
45537
|
+
for (var j = 0; j < message.accessList.length; ++j)
|
45538
|
+
object.accessList[j] = $root.TW.Ethereum.Proto.Access.toObject(message.accessList[j], options);
|
45539
|
+
}
|
44431
45540
|
return object;
|
44432
45541
|
};
|
44433
45542
|
|