@trustwallet/wallet-core 4.1.19 → 4.1.20
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.
@@ -38216,6 +38216,255 @@ export namespace TW {
|
|
38216
38216
|
*/
|
38217
38217
|
public toJSON(): { [k: string]: any };
|
38218
38218
|
}
|
38219
|
+
|
38220
|
+
/** Properties of a MessageSigningInput. */
|
38221
|
+
interface IMessageSigningInput {
|
38222
|
+
|
38223
|
+
/** MessageSigningInput privateKey */
|
38224
|
+
privateKey?: (Uint8Array|null);
|
38225
|
+
|
38226
|
+
/** MessageSigningInput message */
|
38227
|
+
message?: (string|null);
|
38228
|
+
}
|
38229
|
+
|
38230
|
+
/** Represents a MessageSigningInput. */
|
38231
|
+
class MessageSigningInput implements IMessageSigningInput {
|
38232
|
+
|
38233
|
+
/**
|
38234
|
+
* Constructs a new MessageSigningInput.
|
38235
|
+
* @param [properties] Properties to set
|
38236
|
+
*/
|
38237
|
+
constructor(properties?: TW.Solana.Proto.IMessageSigningInput);
|
38238
|
+
|
38239
|
+
/** MessageSigningInput privateKey. */
|
38240
|
+
public privateKey: Uint8Array;
|
38241
|
+
|
38242
|
+
/** MessageSigningInput message. */
|
38243
|
+
public message: string;
|
38244
|
+
|
38245
|
+
/**
|
38246
|
+
* Creates a new MessageSigningInput instance using the specified properties.
|
38247
|
+
* @param [properties] Properties to set
|
38248
|
+
* @returns MessageSigningInput instance
|
38249
|
+
*/
|
38250
|
+
public static create(properties?: TW.Solana.Proto.IMessageSigningInput): TW.Solana.Proto.MessageSigningInput;
|
38251
|
+
|
38252
|
+
/**
|
38253
|
+
* Encodes the specified MessageSigningInput message. Does not implicitly {@link TW.Solana.Proto.MessageSigningInput.verify|verify} messages.
|
38254
|
+
* @param message MessageSigningInput message or plain object to encode
|
38255
|
+
* @param [writer] Writer to encode to
|
38256
|
+
* @returns Writer
|
38257
|
+
*/
|
38258
|
+
public static encode(message: TW.Solana.Proto.IMessageSigningInput, writer?: $protobuf.Writer): $protobuf.Writer;
|
38259
|
+
|
38260
|
+
/**
|
38261
|
+
* Decodes a MessageSigningInput message from the specified reader or buffer.
|
38262
|
+
* @param reader Reader or buffer to decode from
|
38263
|
+
* @param [length] Message length if known beforehand
|
38264
|
+
* @returns MessageSigningInput
|
38265
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
38266
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
38267
|
+
*/
|
38268
|
+
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): TW.Solana.Proto.MessageSigningInput;
|
38269
|
+
|
38270
|
+
/**
|
38271
|
+
* Verifies a MessageSigningInput message.
|
38272
|
+
* @param message Plain object to verify
|
38273
|
+
* @returns `null` if valid, otherwise the reason why it is not
|
38274
|
+
*/
|
38275
|
+
public static verify(message: { [k: string]: any }): (string|null);
|
38276
|
+
|
38277
|
+
/**
|
38278
|
+
* Creates a MessageSigningInput message from a plain object. Also converts values to their respective internal types.
|
38279
|
+
* @param object Plain object
|
38280
|
+
* @returns MessageSigningInput
|
38281
|
+
*/
|
38282
|
+
public static fromObject(object: { [k: string]: any }): TW.Solana.Proto.MessageSigningInput;
|
38283
|
+
|
38284
|
+
/**
|
38285
|
+
* Creates a plain object from a MessageSigningInput message. Also converts values to other types if specified.
|
38286
|
+
* @param message MessageSigningInput
|
38287
|
+
* @param [options] Conversion options
|
38288
|
+
* @returns Plain object
|
38289
|
+
*/
|
38290
|
+
public static toObject(message: TW.Solana.Proto.MessageSigningInput, options?: $protobuf.IConversionOptions): { [k: string]: any };
|
38291
|
+
|
38292
|
+
/**
|
38293
|
+
* Converts this MessageSigningInput to JSON.
|
38294
|
+
* @returns JSON object
|
38295
|
+
*/
|
38296
|
+
public toJSON(): { [k: string]: any };
|
38297
|
+
}
|
38298
|
+
|
38299
|
+
/** Properties of a MessageSigningOutput. */
|
38300
|
+
interface IMessageSigningOutput {
|
38301
|
+
|
38302
|
+
/** MessageSigningOutput signature */
|
38303
|
+
signature?: (string|null);
|
38304
|
+
|
38305
|
+
/** MessageSigningOutput error */
|
38306
|
+
error?: (TW.Common.Proto.SigningError|null);
|
38307
|
+
|
38308
|
+
/** MessageSigningOutput errorMessage */
|
38309
|
+
errorMessage?: (string|null);
|
38310
|
+
}
|
38311
|
+
|
38312
|
+
/** Represents a MessageSigningOutput. */
|
38313
|
+
class MessageSigningOutput implements IMessageSigningOutput {
|
38314
|
+
|
38315
|
+
/**
|
38316
|
+
* Constructs a new MessageSigningOutput.
|
38317
|
+
* @param [properties] Properties to set
|
38318
|
+
*/
|
38319
|
+
constructor(properties?: TW.Solana.Proto.IMessageSigningOutput);
|
38320
|
+
|
38321
|
+
/** MessageSigningOutput signature. */
|
38322
|
+
public signature: string;
|
38323
|
+
|
38324
|
+
/** MessageSigningOutput error. */
|
38325
|
+
public error: TW.Common.Proto.SigningError;
|
38326
|
+
|
38327
|
+
/** MessageSigningOutput errorMessage. */
|
38328
|
+
public errorMessage: string;
|
38329
|
+
|
38330
|
+
/**
|
38331
|
+
* Creates a new MessageSigningOutput instance using the specified properties.
|
38332
|
+
* @param [properties] Properties to set
|
38333
|
+
* @returns MessageSigningOutput instance
|
38334
|
+
*/
|
38335
|
+
public static create(properties?: TW.Solana.Proto.IMessageSigningOutput): TW.Solana.Proto.MessageSigningOutput;
|
38336
|
+
|
38337
|
+
/**
|
38338
|
+
* Encodes the specified MessageSigningOutput message. Does not implicitly {@link TW.Solana.Proto.MessageSigningOutput.verify|verify} messages.
|
38339
|
+
* @param message MessageSigningOutput message or plain object to encode
|
38340
|
+
* @param [writer] Writer to encode to
|
38341
|
+
* @returns Writer
|
38342
|
+
*/
|
38343
|
+
public static encode(message: TW.Solana.Proto.IMessageSigningOutput, writer?: $protobuf.Writer): $protobuf.Writer;
|
38344
|
+
|
38345
|
+
/**
|
38346
|
+
* Decodes a MessageSigningOutput message from the specified reader or buffer.
|
38347
|
+
* @param reader Reader or buffer to decode from
|
38348
|
+
* @param [length] Message length if known beforehand
|
38349
|
+
* @returns MessageSigningOutput
|
38350
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
38351
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
38352
|
+
*/
|
38353
|
+
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): TW.Solana.Proto.MessageSigningOutput;
|
38354
|
+
|
38355
|
+
/**
|
38356
|
+
* Verifies a MessageSigningOutput message.
|
38357
|
+
* @param message Plain object to verify
|
38358
|
+
* @returns `null` if valid, otherwise the reason why it is not
|
38359
|
+
*/
|
38360
|
+
public static verify(message: { [k: string]: any }): (string|null);
|
38361
|
+
|
38362
|
+
/**
|
38363
|
+
* Creates a MessageSigningOutput message from a plain object. Also converts values to their respective internal types.
|
38364
|
+
* @param object Plain object
|
38365
|
+
* @returns MessageSigningOutput
|
38366
|
+
*/
|
38367
|
+
public static fromObject(object: { [k: string]: any }): TW.Solana.Proto.MessageSigningOutput;
|
38368
|
+
|
38369
|
+
/**
|
38370
|
+
* Creates a plain object from a MessageSigningOutput message. Also converts values to other types if specified.
|
38371
|
+
* @param message MessageSigningOutput
|
38372
|
+
* @param [options] Conversion options
|
38373
|
+
* @returns Plain object
|
38374
|
+
*/
|
38375
|
+
public static toObject(message: TW.Solana.Proto.MessageSigningOutput, options?: $protobuf.IConversionOptions): { [k: string]: any };
|
38376
|
+
|
38377
|
+
/**
|
38378
|
+
* Converts this MessageSigningOutput to JSON.
|
38379
|
+
* @returns JSON object
|
38380
|
+
*/
|
38381
|
+
public toJSON(): { [k: string]: any };
|
38382
|
+
}
|
38383
|
+
|
38384
|
+
/** Properties of a MessageVerifyingInput. */
|
38385
|
+
interface IMessageVerifyingInput {
|
38386
|
+
|
38387
|
+
/** MessageVerifyingInput message */
|
38388
|
+
message?: (string|null);
|
38389
|
+
|
38390
|
+
/** MessageVerifyingInput publicKey */
|
38391
|
+
publicKey?: (Uint8Array|null);
|
38392
|
+
|
38393
|
+
/** MessageVerifyingInput signature */
|
38394
|
+
signature?: (string|null);
|
38395
|
+
}
|
38396
|
+
|
38397
|
+
/** Represents a MessageVerifyingInput. */
|
38398
|
+
class MessageVerifyingInput implements IMessageVerifyingInput {
|
38399
|
+
|
38400
|
+
/**
|
38401
|
+
* Constructs a new MessageVerifyingInput.
|
38402
|
+
* @param [properties] Properties to set
|
38403
|
+
*/
|
38404
|
+
constructor(properties?: TW.Solana.Proto.IMessageVerifyingInput);
|
38405
|
+
|
38406
|
+
/** MessageVerifyingInput message. */
|
38407
|
+
public message: string;
|
38408
|
+
|
38409
|
+
/** MessageVerifyingInput publicKey. */
|
38410
|
+
public publicKey: Uint8Array;
|
38411
|
+
|
38412
|
+
/** MessageVerifyingInput signature. */
|
38413
|
+
public signature: string;
|
38414
|
+
|
38415
|
+
/**
|
38416
|
+
* Creates a new MessageVerifyingInput instance using the specified properties.
|
38417
|
+
* @param [properties] Properties to set
|
38418
|
+
* @returns MessageVerifyingInput instance
|
38419
|
+
*/
|
38420
|
+
public static create(properties?: TW.Solana.Proto.IMessageVerifyingInput): TW.Solana.Proto.MessageVerifyingInput;
|
38421
|
+
|
38422
|
+
/**
|
38423
|
+
* Encodes the specified MessageVerifyingInput message. Does not implicitly {@link TW.Solana.Proto.MessageVerifyingInput.verify|verify} messages.
|
38424
|
+
* @param message MessageVerifyingInput message or plain object to encode
|
38425
|
+
* @param [writer] Writer to encode to
|
38426
|
+
* @returns Writer
|
38427
|
+
*/
|
38428
|
+
public static encode(message: TW.Solana.Proto.IMessageVerifyingInput, writer?: $protobuf.Writer): $protobuf.Writer;
|
38429
|
+
|
38430
|
+
/**
|
38431
|
+
* Decodes a MessageVerifyingInput message from the specified reader or buffer.
|
38432
|
+
* @param reader Reader or buffer to decode from
|
38433
|
+
* @param [length] Message length if known beforehand
|
38434
|
+
* @returns MessageVerifyingInput
|
38435
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
38436
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
38437
|
+
*/
|
38438
|
+
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): TW.Solana.Proto.MessageVerifyingInput;
|
38439
|
+
|
38440
|
+
/**
|
38441
|
+
* Verifies a MessageVerifyingInput message.
|
38442
|
+
* @param message Plain object to verify
|
38443
|
+
* @returns `null` if valid, otherwise the reason why it is not
|
38444
|
+
*/
|
38445
|
+
public static verify(message: { [k: string]: any }): (string|null);
|
38446
|
+
|
38447
|
+
/**
|
38448
|
+
* Creates a MessageVerifyingInput message from a plain object. Also converts values to their respective internal types.
|
38449
|
+
* @param object Plain object
|
38450
|
+
* @returns MessageVerifyingInput
|
38451
|
+
*/
|
38452
|
+
public static fromObject(object: { [k: string]: any }): TW.Solana.Proto.MessageVerifyingInput;
|
38453
|
+
|
38454
|
+
/**
|
38455
|
+
* Creates a plain object from a MessageVerifyingInput message. Also converts values to other types if specified.
|
38456
|
+
* @param message MessageVerifyingInput
|
38457
|
+
* @param [options] Conversion options
|
38458
|
+
* @returns Plain object
|
38459
|
+
*/
|
38460
|
+
public static toObject(message: TW.Solana.Proto.MessageVerifyingInput, options?: $protobuf.IConversionOptions): { [k: string]: any };
|
38461
|
+
|
38462
|
+
/**
|
38463
|
+
* Converts this MessageVerifyingInput to JSON.
|
38464
|
+
* @returns JSON object
|
38465
|
+
*/
|
38466
|
+
public toJSON(): { [k: string]: any };
|
38467
|
+
}
|
38219
38468
|
}
|
38220
38469
|
}
|
38221
38470
|
|
@@ -113336,6 +113336,744 @@
|
|
113336
113336
|
return PreSigningOutput;
|
113337
113337
|
})();
|
113338
113338
|
|
113339
|
+
Proto.MessageSigningInput = (function() {
|
113340
|
+
|
113341
|
+
/**
|
113342
|
+
* Properties of a MessageSigningInput.
|
113343
|
+
* @memberof TW.Solana.Proto
|
113344
|
+
* @interface IMessageSigningInput
|
113345
|
+
* @property {Uint8Array|null} [privateKey] MessageSigningInput privateKey
|
113346
|
+
* @property {string|null} [message] MessageSigningInput message
|
113347
|
+
*/
|
113348
|
+
|
113349
|
+
/**
|
113350
|
+
* Constructs a new MessageSigningInput.
|
113351
|
+
* @memberof TW.Solana.Proto
|
113352
|
+
* @classdesc Represents a MessageSigningInput.
|
113353
|
+
* @implements IMessageSigningInput
|
113354
|
+
* @constructor
|
113355
|
+
* @param {TW.Solana.Proto.IMessageSigningInput=} [properties] Properties to set
|
113356
|
+
*/
|
113357
|
+
function MessageSigningInput(properties) {
|
113358
|
+
if (properties)
|
113359
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
113360
|
+
if (properties[keys[i]] != null)
|
113361
|
+
this[keys[i]] = properties[keys[i]];
|
113362
|
+
}
|
113363
|
+
|
113364
|
+
/**
|
113365
|
+
* MessageSigningInput privateKey.
|
113366
|
+
* @member {Uint8Array} privateKey
|
113367
|
+
* @memberof TW.Solana.Proto.MessageSigningInput
|
113368
|
+
* @instance
|
113369
|
+
*/
|
113370
|
+
MessageSigningInput.prototype.privateKey = $util.newBuffer([]);
|
113371
|
+
|
113372
|
+
/**
|
113373
|
+
* MessageSigningInput message.
|
113374
|
+
* @member {string} message
|
113375
|
+
* @memberof TW.Solana.Proto.MessageSigningInput
|
113376
|
+
* @instance
|
113377
|
+
*/
|
113378
|
+
MessageSigningInput.prototype.message = "";
|
113379
|
+
|
113380
|
+
/**
|
113381
|
+
* Creates a new MessageSigningInput instance using the specified properties.
|
113382
|
+
* @function create
|
113383
|
+
* @memberof TW.Solana.Proto.MessageSigningInput
|
113384
|
+
* @static
|
113385
|
+
* @param {TW.Solana.Proto.IMessageSigningInput=} [properties] Properties to set
|
113386
|
+
* @returns {TW.Solana.Proto.MessageSigningInput} MessageSigningInput instance
|
113387
|
+
*/
|
113388
|
+
MessageSigningInput.create = function create(properties) {
|
113389
|
+
return new MessageSigningInput(properties);
|
113390
|
+
};
|
113391
|
+
|
113392
|
+
/**
|
113393
|
+
* Encodes the specified MessageSigningInput message. Does not implicitly {@link TW.Solana.Proto.MessageSigningInput.verify|verify} messages.
|
113394
|
+
* @function encode
|
113395
|
+
* @memberof TW.Solana.Proto.MessageSigningInput
|
113396
|
+
* @static
|
113397
|
+
* @param {TW.Solana.Proto.IMessageSigningInput} message MessageSigningInput message or plain object to encode
|
113398
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
113399
|
+
* @returns {$protobuf.Writer} Writer
|
113400
|
+
*/
|
113401
|
+
MessageSigningInput.encode = function encode(message, writer) {
|
113402
|
+
if (!writer)
|
113403
|
+
writer = $Writer.create();
|
113404
|
+
if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey"))
|
113405
|
+
writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.privateKey);
|
113406
|
+
if (message.message != null && Object.hasOwnProperty.call(message, "message"))
|
113407
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.message);
|
113408
|
+
return writer;
|
113409
|
+
};
|
113410
|
+
|
113411
|
+
/**
|
113412
|
+
* Decodes a MessageSigningInput message from the specified reader or buffer.
|
113413
|
+
* @function decode
|
113414
|
+
* @memberof TW.Solana.Proto.MessageSigningInput
|
113415
|
+
* @static
|
113416
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
113417
|
+
* @param {number} [length] Message length if known beforehand
|
113418
|
+
* @returns {TW.Solana.Proto.MessageSigningInput} MessageSigningInput
|
113419
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
113420
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
113421
|
+
*/
|
113422
|
+
MessageSigningInput.decode = function decode(reader, length) {
|
113423
|
+
if (!(reader instanceof $Reader))
|
113424
|
+
reader = $Reader.create(reader);
|
113425
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Solana.Proto.MessageSigningInput();
|
113426
|
+
while (reader.pos < end) {
|
113427
|
+
var tag = reader.uint32();
|
113428
|
+
switch (tag >>> 3) {
|
113429
|
+
case 1:
|
113430
|
+
message.privateKey = reader.bytes();
|
113431
|
+
break;
|
113432
|
+
case 2:
|
113433
|
+
message.message = reader.string();
|
113434
|
+
break;
|
113435
|
+
default:
|
113436
|
+
reader.skipType(tag & 7);
|
113437
|
+
break;
|
113438
|
+
}
|
113439
|
+
}
|
113440
|
+
return message;
|
113441
|
+
};
|
113442
|
+
|
113443
|
+
/**
|
113444
|
+
* Verifies a MessageSigningInput message.
|
113445
|
+
* @function verify
|
113446
|
+
* @memberof TW.Solana.Proto.MessageSigningInput
|
113447
|
+
* @static
|
113448
|
+
* @param {Object.<string,*>} message Plain object to verify
|
113449
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
113450
|
+
*/
|
113451
|
+
MessageSigningInput.verify = function verify(message) {
|
113452
|
+
if (typeof message !== "object" || message === null)
|
113453
|
+
return "object expected";
|
113454
|
+
if (message.privateKey != null && message.hasOwnProperty("privateKey"))
|
113455
|
+
if (!(message.privateKey && typeof message.privateKey.length === "number" || $util.isString(message.privateKey)))
|
113456
|
+
return "privateKey: buffer expected";
|
113457
|
+
if (message.message != null && message.hasOwnProperty("message"))
|
113458
|
+
if (!$util.isString(message.message))
|
113459
|
+
return "message: string expected";
|
113460
|
+
return null;
|
113461
|
+
};
|
113462
|
+
|
113463
|
+
/**
|
113464
|
+
* Creates a MessageSigningInput message from a plain object. Also converts values to their respective internal types.
|
113465
|
+
* @function fromObject
|
113466
|
+
* @memberof TW.Solana.Proto.MessageSigningInput
|
113467
|
+
* @static
|
113468
|
+
* @param {Object.<string,*>} object Plain object
|
113469
|
+
* @returns {TW.Solana.Proto.MessageSigningInput} MessageSigningInput
|
113470
|
+
*/
|
113471
|
+
MessageSigningInput.fromObject = function fromObject(object) {
|
113472
|
+
if (object instanceof $root.TW.Solana.Proto.MessageSigningInput)
|
113473
|
+
return object;
|
113474
|
+
var message = new $root.TW.Solana.Proto.MessageSigningInput();
|
113475
|
+
if (object.privateKey != null)
|
113476
|
+
if (typeof object.privateKey === "string")
|
113477
|
+
$util.base64.decode(object.privateKey, message.privateKey = $util.newBuffer($util.base64.length(object.privateKey)), 0);
|
113478
|
+
else if (object.privateKey.length)
|
113479
|
+
message.privateKey = object.privateKey;
|
113480
|
+
if (object.message != null)
|
113481
|
+
message.message = String(object.message);
|
113482
|
+
return message;
|
113483
|
+
};
|
113484
|
+
|
113485
|
+
/**
|
113486
|
+
* Creates a plain object from a MessageSigningInput message. Also converts values to other types if specified.
|
113487
|
+
* @function toObject
|
113488
|
+
* @memberof TW.Solana.Proto.MessageSigningInput
|
113489
|
+
* @static
|
113490
|
+
* @param {TW.Solana.Proto.MessageSigningInput} message MessageSigningInput
|
113491
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
113492
|
+
* @returns {Object.<string,*>} Plain object
|
113493
|
+
*/
|
113494
|
+
MessageSigningInput.toObject = function toObject(message, options) {
|
113495
|
+
if (!options)
|
113496
|
+
options = {};
|
113497
|
+
var object = {};
|
113498
|
+
if (options.defaults) {
|
113499
|
+
if (options.bytes === String)
|
113500
|
+
object.privateKey = "";
|
113501
|
+
else {
|
113502
|
+
object.privateKey = [];
|
113503
|
+
if (options.bytes !== Array)
|
113504
|
+
object.privateKey = $util.newBuffer(object.privateKey);
|
113505
|
+
}
|
113506
|
+
object.message = "";
|
113507
|
+
}
|
113508
|
+
if (message.privateKey != null && message.hasOwnProperty("privateKey"))
|
113509
|
+
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;
|
113510
|
+
if (message.message != null && message.hasOwnProperty("message"))
|
113511
|
+
object.message = message.message;
|
113512
|
+
return object;
|
113513
|
+
};
|
113514
|
+
|
113515
|
+
/**
|
113516
|
+
* Converts this MessageSigningInput to JSON.
|
113517
|
+
* @function toJSON
|
113518
|
+
* @memberof TW.Solana.Proto.MessageSigningInput
|
113519
|
+
* @instance
|
113520
|
+
* @returns {Object.<string,*>} JSON object
|
113521
|
+
*/
|
113522
|
+
MessageSigningInput.prototype.toJSON = function toJSON() {
|
113523
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
113524
|
+
};
|
113525
|
+
|
113526
|
+
return MessageSigningInput;
|
113527
|
+
})();
|
113528
|
+
|
113529
|
+
Proto.MessageSigningOutput = (function() {
|
113530
|
+
|
113531
|
+
/**
|
113532
|
+
* Properties of a MessageSigningOutput.
|
113533
|
+
* @memberof TW.Solana.Proto
|
113534
|
+
* @interface IMessageSigningOutput
|
113535
|
+
* @property {string|null} [signature] MessageSigningOutput signature
|
113536
|
+
* @property {TW.Common.Proto.SigningError|null} [error] MessageSigningOutput error
|
113537
|
+
* @property {string|null} [errorMessage] MessageSigningOutput errorMessage
|
113538
|
+
*/
|
113539
|
+
|
113540
|
+
/**
|
113541
|
+
* Constructs a new MessageSigningOutput.
|
113542
|
+
* @memberof TW.Solana.Proto
|
113543
|
+
* @classdesc Represents a MessageSigningOutput.
|
113544
|
+
* @implements IMessageSigningOutput
|
113545
|
+
* @constructor
|
113546
|
+
* @param {TW.Solana.Proto.IMessageSigningOutput=} [properties] Properties to set
|
113547
|
+
*/
|
113548
|
+
function MessageSigningOutput(properties) {
|
113549
|
+
if (properties)
|
113550
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
113551
|
+
if (properties[keys[i]] != null)
|
113552
|
+
this[keys[i]] = properties[keys[i]];
|
113553
|
+
}
|
113554
|
+
|
113555
|
+
/**
|
113556
|
+
* MessageSigningOutput signature.
|
113557
|
+
* @member {string} signature
|
113558
|
+
* @memberof TW.Solana.Proto.MessageSigningOutput
|
113559
|
+
* @instance
|
113560
|
+
*/
|
113561
|
+
MessageSigningOutput.prototype.signature = "";
|
113562
|
+
|
113563
|
+
/**
|
113564
|
+
* MessageSigningOutput error.
|
113565
|
+
* @member {TW.Common.Proto.SigningError} error
|
113566
|
+
* @memberof TW.Solana.Proto.MessageSigningOutput
|
113567
|
+
* @instance
|
113568
|
+
*/
|
113569
|
+
MessageSigningOutput.prototype.error = 0;
|
113570
|
+
|
113571
|
+
/**
|
113572
|
+
* MessageSigningOutput errorMessage.
|
113573
|
+
* @member {string} errorMessage
|
113574
|
+
* @memberof TW.Solana.Proto.MessageSigningOutput
|
113575
|
+
* @instance
|
113576
|
+
*/
|
113577
|
+
MessageSigningOutput.prototype.errorMessage = "";
|
113578
|
+
|
113579
|
+
/**
|
113580
|
+
* Creates a new MessageSigningOutput instance using the specified properties.
|
113581
|
+
* @function create
|
113582
|
+
* @memberof TW.Solana.Proto.MessageSigningOutput
|
113583
|
+
* @static
|
113584
|
+
* @param {TW.Solana.Proto.IMessageSigningOutput=} [properties] Properties to set
|
113585
|
+
* @returns {TW.Solana.Proto.MessageSigningOutput} MessageSigningOutput instance
|
113586
|
+
*/
|
113587
|
+
MessageSigningOutput.create = function create(properties) {
|
113588
|
+
return new MessageSigningOutput(properties);
|
113589
|
+
};
|
113590
|
+
|
113591
|
+
/**
|
113592
|
+
* Encodes the specified MessageSigningOutput message. Does not implicitly {@link TW.Solana.Proto.MessageSigningOutput.verify|verify} messages.
|
113593
|
+
* @function encode
|
113594
|
+
* @memberof TW.Solana.Proto.MessageSigningOutput
|
113595
|
+
* @static
|
113596
|
+
* @param {TW.Solana.Proto.IMessageSigningOutput} message MessageSigningOutput message or plain object to encode
|
113597
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
113598
|
+
* @returns {$protobuf.Writer} Writer
|
113599
|
+
*/
|
113600
|
+
MessageSigningOutput.encode = function encode(message, writer) {
|
113601
|
+
if (!writer)
|
113602
|
+
writer = $Writer.create();
|
113603
|
+
if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
|
113604
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.signature);
|
113605
|
+
if (message.error != null && Object.hasOwnProperty.call(message, "error"))
|
113606
|
+
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.error);
|
113607
|
+
if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage"))
|
113608
|
+
writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorMessage);
|
113609
|
+
return writer;
|
113610
|
+
};
|
113611
|
+
|
113612
|
+
/**
|
113613
|
+
* Decodes a MessageSigningOutput message from the specified reader or buffer.
|
113614
|
+
* @function decode
|
113615
|
+
* @memberof TW.Solana.Proto.MessageSigningOutput
|
113616
|
+
* @static
|
113617
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
113618
|
+
* @param {number} [length] Message length if known beforehand
|
113619
|
+
* @returns {TW.Solana.Proto.MessageSigningOutput} MessageSigningOutput
|
113620
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
113621
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
113622
|
+
*/
|
113623
|
+
MessageSigningOutput.decode = function decode(reader, length) {
|
113624
|
+
if (!(reader instanceof $Reader))
|
113625
|
+
reader = $Reader.create(reader);
|
113626
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Solana.Proto.MessageSigningOutput();
|
113627
|
+
while (reader.pos < end) {
|
113628
|
+
var tag = reader.uint32();
|
113629
|
+
switch (tag >>> 3) {
|
113630
|
+
case 1:
|
113631
|
+
message.signature = reader.string();
|
113632
|
+
break;
|
113633
|
+
case 2:
|
113634
|
+
message.error = reader.int32();
|
113635
|
+
break;
|
113636
|
+
case 3:
|
113637
|
+
message.errorMessage = reader.string();
|
113638
|
+
break;
|
113639
|
+
default:
|
113640
|
+
reader.skipType(tag & 7);
|
113641
|
+
break;
|
113642
|
+
}
|
113643
|
+
}
|
113644
|
+
return message;
|
113645
|
+
};
|
113646
|
+
|
113647
|
+
/**
|
113648
|
+
* Verifies a MessageSigningOutput message.
|
113649
|
+
* @function verify
|
113650
|
+
* @memberof TW.Solana.Proto.MessageSigningOutput
|
113651
|
+
* @static
|
113652
|
+
* @param {Object.<string,*>} message Plain object to verify
|
113653
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
113654
|
+
*/
|
113655
|
+
MessageSigningOutput.verify = function verify(message) {
|
113656
|
+
if (typeof message !== "object" || message === null)
|
113657
|
+
return "object expected";
|
113658
|
+
if (message.signature != null && message.hasOwnProperty("signature"))
|
113659
|
+
if (!$util.isString(message.signature))
|
113660
|
+
return "signature: string expected";
|
113661
|
+
if (message.error != null && message.hasOwnProperty("error"))
|
113662
|
+
switch (message.error) {
|
113663
|
+
default:
|
113664
|
+
return "error: enum value expected";
|
113665
|
+
case 0:
|
113666
|
+
case 1:
|
113667
|
+
case 2:
|
113668
|
+
case 3:
|
113669
|
+
case 4:
|
113670
|
+
case 5:
|
113671
|
+
case 15:
|
113672
|
+
case 16:
|
113673
|
+
case 17:
|
113674
|
+
case 18:
|
113675
|
+
case 6:
|
113676
|
+
case 7:
|
113677
|
+
case 8:
|
113678
|
+
case 9:
|
113679
|
+
case 10:
|
113680
|
+
case 11:
|
113681
|
+
case 12:
|
113682
|
+
case 13:
|
113683
|
+
case 14:
|
113684
|
+
case 19:
|
113685
|
+
case 20:
|
113686
|
+
case 21:
|
113687
|
+
case 22:
|
113688
|
+
case 23:
|
113689
|
+
case 24:
|
113690
|
+
case 25:
|
113691
|
+
break;
|
113692
|
+
}
|
113693
|
+
if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
|
113694
|
+
if (!$util.isString(message.errorMessage))
|
113695
|
+
return "errorMessage: string expected";
|
113696
|
+
return null;
|
113697
|
+
};
|
113698
|
+
|
113699
|
+
/**
|
113700
|
+
* Creates a MessageSigningOutput message from a plain object. Also converts values to their respective internal types.
|
113701
|
+
* @function fromObject
|
113702
|
+
* @memberof TW.Solana.Proto.MessageSigningOutput
|
113703
|
+
* @static
|
113704
|
+
* @param {Object.<string,*>} object Plain object
|
113705
|
+
* @returns {TW.Solana.Proto.MessageSigningOutput} MessageSigningOutput
|
113706
|
+
*/
|
113707
|
+
MessageSigningOutput.fromObject = function fromObject(object) {
|
113708
|
+
if (object instanceof $root.TW.Solana.Proto.MessageSigningOutput)
|
113709
|
+
return object;
|
113710
|
+
var message = new $root.TW.Solana.Proto.MessageSigningOutput();
|
113711
|
+
if (object.signature != null)
|
113712
|
+
message.signature = String(object.signature);
|
113713
|
+
switch (object.error) {
|
113714
|
+
case "OK":
|
113715
|
+
case 0:
|
113716
|
+
message.error = 0;
|
113717
|
+
break;
|
113718
|
+
case "Error_general":
|
113719
|
+
case 1:
|
113720
|
+
message.error = 1;
|
113721
|
+
break;
|
113722
|
+
case "Error_internal":
|
113723
|
+
case 2:
|
113724
|
+
message.error = 2;
|
113725
|
+
break;
|
113726
|
+
case "Error_low_balance":
|
113727
|
+
case 3:
|
113728
|
+
message.error = 3;
|
113729
|
+
break;
|
113730
|
+
case "Error_zero_amount_requested":
|
113731
|
+
case 4:
|
113732
|
+
message.error = 4;
|
113733
|
+
break;
|
113734
|
+
case "Error_missing_private_key":
|
113735
|
+
case 5:
|
113736
|
+
message.error = 5;
|
113737
|
+
break;
|
113738
|
+
case "Error_invalid_private_key":
|
113739
|
+
case 15:
|
113740
|
+
message.error = 15;
|
113741
|
+
break;
|
113742
|
+
case "Error_invalid_address":
|
113743
|
+
case 16:
|
113744
|
+
message.error = 16;
|
113745
|
+
break;
|
113746
|
+
case "Error_invalid_utxo":
|
113747
|
+
case 17:
|
113748
|
+
message.error = 17;
|
113749
|
+
break;
|
113750
|
+
case "Error_invalid_utxo_amount":
|
113751
|
+
case 18:
|
113752
|
+
message.error = 18;
|
113753
|
+
break;
|
113754
|
+
case "Error_wrong_fee":
|
113755
|
+
case 6:
|
113756
|
+
message.error = 6;
|
113757
|
+
break;
|
113758
|
+
case "Error_signing":
|
113759
|
+
case 7:
|
113760
|
+
message.error = 7;
|
113761
|
+
break;
|
113762
|
+
case "Error_tx_too_big":
|
113763
|
+
case 8:
|
113764
|
+
message.error = 8;
|
113765
|
+
break;
|
113766
|
+
case "Error_missing_input_utxos":
|
113767
|
+
case 9:
|
113768
|
+
message.error = 9;
|
113769
|
+
break;
|
113770
|
+
case "Error_not_enough_utxos":
|
113771
|
+
case 10:
|
113772
|
+
message.error = 10;
|
113773
|
+
break;
|
113774
|
+
case "Error_script_redeem":
|
113775
|
+
case 11:
|
113776
|
+
message.error = 11;
|
113777
|
+
break;
|
113778
|
+
case "Error_script_output":
|
113779
|
+
case 12:
|
113780
|
+
message.error = 12;
|
113781
|
+
break;
|
113782
|
+
case "Error_script_witness_program":
|
113783
|
+
case 13:
|
113784
|
+
message.error = 13;
|
113785
|
+
break;
|
113786
|
+
case "Error_invalid_memo":
|
113787
|
+
case 14:
|
113788
|
+
message.error = 14;
|
113789
|
+
break;
|
113790
|
+
case "Error_input_parse":
|
113791
|
+
case 19:
|
113792
|
+
message.error = 19;
|
113793
|
+
break;
|
113794
|
+
case "Error_no_support_n2n":
|
113795
|
+
case 20:
|
113796
|
+
message.error = 20;
|
113797
|
+
break;
|
113798
|
+
case "Error_signatures_count":
|
113799
|
+
case 21:
|
113800
|
+
message.error = 21;
|
113801
|
+
break;
|
113802
|
+
case "Error_invalid_params":
|
113803
|
+
case 22:
|
113804
|
+
message.error = 22;
|
113805
|
+
break;
|
113806
|
+
case "Error_invalid_requested_token_amount":
|
113807
|
+
case 23:
|
113808
|
+
message.error = 23;
|
113809
|
+
break;
|
113810
|
+
case "Error_not_supported":
|
113811
|
+
case 24:
|
113812
|
+
message.error = 24;
|
113813
|
+
break;
|
113814
|
+
case "Error_dust_amount_requested":
|
113815
|
+
case 25:
|
113816
|
+
message.error = 25;
|
113817
|
+
break;
|
113818
|
+
}
|
113819
|
+
if (object.errorMessage != null)
|
113820
|
+
message.errorMessage = String(object.errorMessage);
|
113821
|
+
return message;
|
113822
|
+
};
|
113823
|
+
|
113824
|
+
/**
|
113825
|
+
* Creates a plain object from a MessageSigningOutput message. Also converts values to other types if specified.
|
113826
|
+
* @function toObject
|
113827
|
+
* @memberof TW.Solana.Proto.MessageSigningOutput
|
113828
|
+
* @static
|
113829
|
+
* @param {TW.Solana.Proto.MessageSigningOutput} message MessageSigningOutput
|
113830
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
113831
|
+
* @returns {Object.<string,*>} Plain object
|
113832
|
+
*/
|
113833
|
+
MessageSigningOutput.toObject = function toObject(message, options) {
|
113834
|
+
if (!options)
|
113835
|
+
options = {};
|
113836
|
+
var object = {};
|
113837
|
+
if (options.defaults) {
|
113838
|
+
object.signature = "";
|
113839
|
+
object.error = options.enums === String ? "OK" : 0;
|
113840
|
+
object.errorMessage = "";
|
113841
|
+
}
|
113842
|
+
if (message.signature != null && message.hasOwnProperty("signature"))
|
113843
|
+
object.signature = message.signature;
|
113844
|
+
if (message.error != null && message.hasOwnProperty("error"))
|
113845
|
+
object.error = options.enums === String ? $root.TW.Common.Proto.SigningError[message.error] : message.error;
|
113846
|
+
if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
|
113847
|
+
object.errorMessage = message.errorMessage;
|
113848
|
+
return object;
|
113849
|
+
};
|
113850
|
+
|
113851
|
+
/**
|
113852
|
+
* Converts this MessageSigningOutput to JSON.
|
113853
|
+
* @function toJSON
|
113854
|
+
* @memberof TW.Solana.Proto.MessageSigningOutput
|
113855
|
+
* @instance
|
113856
|
+
* @returns {Object.<string,*>} JSON object
|
113857
|
+
*/
|
113858
|
+
MessageSigningOutput.prototype.toJSON = function toJSON() {
|
113859
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
113860
|
+
};
|
113861
|
+
|
113862
|
+
return MessageSigningOutput;
|
113863
|
+
})();
|
113864
|
+
|
113865
|
+
Proto.MessageVerifyingInput = (function() {
|
113866
|
+
|
113867
|
+
/**
|
113868
|
+
* Properties of a MessageVerifyingInput.
|
113869
|
+
* @memberof TW.Solana.Proto
|
113870
|
+
* @interface IMessageVerifyingInput
|
113871
|
+
* @property {string|null} [message] MessageVerifyingInput message
|
113872
|
+
* @property {Uint8Array|null} [publicKey] MessageVerifyingInput publicKey
|
113873
|
+
* @property {string|null} [signature] MessageVerifyingInput signature
|
113874
|
+
*/
|
113875
|
+
|
113876
|
+
/**
|
113877
|
+
* Constructs a new MessageVerifyingInput.
|
113878
|
+
* @memberof TW.Solana.Proto
|
113879
|
+
* @classdesc Represents a MessageVerifyingInput.
|
113880
|
+
* @implements IMessageVerifyingInput
|
113881
|
+
* @constructor
|
113882
|
+
* @param {TW.Solana.Proto.IMessageVerifyingInput=} [properties] Properties to set
|
113883
|
+
*/
|
113884
|
+
function MessageVerifyingInput(properties) {
|
113885
|
+
if (properties)
|
113886
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
113887
|
+
if (properties[keys[i]] != null)
|
113888
|
+
this[keys[i]] = properties[keys[i]];
|
113889
|
+
}
|
113890
|
+
|
113891
|
+
/**
|
113892
|
+
* MessageVerifyingInput message.
|
113893
|
+
* @member {string} message
|
113894
|
+
* @memberof TW.Solana.Proto.MessageVerifyingInput
|
113895
|
+
* @instance
|
113896
|
+
*/
|
113897
|
+
MessageVerifyingInput.prototype.message = "";
|
113898
|
+
|
113899
|
+
/**
|
113900
|
+
* MessageVerifyingInput publicKey.
|
113901
|
+
* @member {Uint8Array} publicKey
|
113902
|
+
* @memberof TW.Solana.Proto.MessageVerifyingInput
|
113903
|
+
* @instance
|
113904
|
+
*/
|
113905
|
+
MessageVerifyingInput.prototype.publicKey = $util.newBuffer([]);
|
113906
|
+
|
113907
|
+
/**
|
113908
|
+
* MessageVerifyingInput signature.
|
113909
|
+
* @member {string} signature
|
113910
|
+
* @memberof TW.Solana.Proto.MessageVerifyingInput
|
113911
|
+
* @instance
|
113912
|
+
*/
|
113913
|
+
MessageVerifyingInput.prototype.signature = "";
|
113914
|
+
|
113915
|
+
/**
|
113916
|
+
* Creates a new MessageVerifyingInput instance using the specified properties.
|
113917
|
+
* @function create
|
113918
|
+
* @memberof TW.Solana.Proto.MessageVerifyingInput
|
113919
|
+
* @static
|
113920
|
+
* @param {TW.Solana.Proto.IMessageVerifyingInput=} [properties] Properties to set
|
113921
|
+
* @returns {TW.Solana.Proto.MessageVerifyingInput} MessageVerifyingInput instance
|
113922
|
+
*/
|
113923
|
+
MessageVerifyingInput.create = function create(properties) {
|
113924
|
+
return new MessageVerifyingInput(properties);
|
113925
|
+
};
|
113926
|
+
|
113927
|
+
/**
|
113928
|
+
* Encodes the specified MessageVerifyingInput message. Does not implicitly {@link TW.Solana.Proto.MessageVerifyingInput.verify|verify} messages.
|
113929
|
+
* @function encode
|
113930
|
+
* @memberof TW.Solana.Proto.MessageVerifyingInput
|
113931
|
+
* @static
|
113932
|
+
* @param {TW.Solana.Proto.IMessageVerifyingInput} message MessageVerifyingInput message or plain object to encode
|
113933
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
113934
|
+
* @returns {$protobuf.Writer} Writer
|
113935
|
+
*/
|
113936
|
+
MessageVerifyingInput.encode = function encode(message, writer) {
|
113937
|
+
if (!writer)
|
113938
|
+
writer = $Writer.create();
|
113939
|
+
if (message.message != null && Object.hasOwnProperty.call(message, "message"))
|
113940
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.message);
|
113941
|
+
if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey"))
|
113942
|
+
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.publicKey);
|
113943
|
+
if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
|
113944
|
+
writer.uint32(/* id 3, wireType 2 =*/26).string(message.signature);
|
113945
|
+
return writer;
|
113946
|
+
};
|
113947
|
+
|
113948
|
+
/**
|
113949
|
+
* Decodes a MessageVerifyingInput message from the specified reader or buffer.
|
113950
|
+
* @function decode
|
113951
|
+
* @memberof TW.Solana.Proto.MessageVerifyingInput
|
113952
|
+
* @static
|
113953
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
113954
|
+
* @param {number} [length] Message length if known beforehand
|
113955
|
+
* @returns {TW.Solana.Proto.MessageVerifyingInput} MessageVerifyingInput
|
113956
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
113957
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
113958
|
+
*/
|
113959
|
+
MessageVerifyingInput.decode = function decode(reader, length) {
|
113960
|
+
if (!(reader instanceof $Reader))
|
113961
|
+
reader = $Reader.create(reader);
|
113962
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Solana.Proto.MessageVerifyingInput();
|
113963
|
+
while (reader.pos < end) {
|
113964
|
+
var tag = reader.uint32();
|
113965
|
+
switch (tag >>> 3) {
|
113966
|
+
case 1:
|
113967
|
+
message.message = reader.string();
|
113968
|
+
break;
|
113969
|
+
case 2:
|
113970
|
+
message.publicKey = reader.bytes();
|
113971
|
+
break;
|
113972
|
+
case 3:
|
113973
|
+
message.signature = reader.string();
|
113974
|
+
break;
|
113975
|
+
default:
|
113976
|
+
reader.skipType(tag & 7);
|
113977
|
+
break;
|
113978
|
+
}
|
113979
|
+
}
|
113980
|
+
return message;
|
113981
|
+
};
|
113982
|
+
|
113983
|
+
/**
|
113984
|
+
* Verifies a MessageVerifyingInput message.
|
113985
|
+
* @function verify
|
113986
|
+
* @memberof TW.Solana.Proto.MessageVerifyingInput
|
113987
|
+
* @static
|
113988
|
+
* @param {Object.<string,*>} message Plain object to verify
|
113989
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
113990
|
+
*/
|
113991
|
+
MessageVerifyingInput.verify = function verify(message) {
|
113992
|
+
if (typeof message !== "object" || message === null)
|
113993
|
+
return "object expected";
|
113994
|
+
if (message.message != null && message.hasOwnProperty("message"))
|
113995
|
+
if (!$util.isString(message.message))
|
113996
|
+
return "message: string expected";
|
113997
|
+
if (message.publicKey != null && message.hasOwnProperty("publicKey"))
|
113998
|
+
if (!(message.publicKey && typeof message.publicKey.length === "number" || $util.isString(message.publicKey)))
|
113999
|
+
return "publicKey: buffer expected";
|
114000
|
+
if (message.signature != null && message.hasOwnProperty("signature"))
|
114001
|
+
if (!$util.isString(message.signature))
|
114002
|
+
return "signature: string expected";
|
114003
|
+
return null;
|
114004
|
+
};
|
114005
|
+
|
114006
|
+
/**
|
114007
|
+
* Creates a MessageVerifyingInput message from a plain object. Also converts values to their respective internal types.
|
114008
|
+
* @function fromObject
|
114009
|
+
* @memberof TW.Solana.Proto.MessageVerifyingInput
|
114010
|
+
* @static
|
114011
|
+
* @param {Object.<string,*>} object Plain object
|
114012
|
+
* @returns {TW.Solana.Proto.MessageVerifyingInput} MessageVerifyingInput
|
114013
|
+
*/
|
114014
|
+
MessageVerifyingInput.fromObject = function fromObject(object) {
|
114015
|
+
if (object instanceof $root.TW.Solana.Proto.MessageVerifyingInput)
|
114016
|
+
return object;
|
114017
|
+
var message = new $root.TW.Solana.Proto.MessageVerifyingInput();
|
114018
|
+
if (object.message != null)
|
114019
|
+
message.message = String(object.message);
|
114020
|
+
if (object.publicKey != null)
|
114021
|
+
if (typeof object.publicKey === "string")
|
114022
|
+
$util.base64.decode(object.publicKey, message.publicKey = $util.newBuffer($util.base64.length(object.publicKey)), 0);
|
114023
|
+
else if (object.publicKey.length)
|
114024
|
+
message.publicKey = object.publicKey;
|
114025
|
+
if (object.signature != null)
|
114026
|
+
message.signature = String(object.signature);
|
114027
|
+
return message;
|
114028
|
+
};
|
114029
|
+
|
114030
|
+
/**
|
114031
|
+
* Creates a plain object from a MessageVerifyingInput message. Also converts values to other types if specified.
|
114032
|
+
* @function toObject
|
114033
|
+
* @memberof TW.Solana.Proto.MessageVerifyingInput
|
114034
|
+
* @static
|
114035
|
+
* @param {TW.Solana.Proto.MessageVerifyingInput} message MessageVerifyingInput
|
114036
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
114037
|
+
* @returns {Object.<string,*>} Plain object
|
114038
|
+
*/
|
114039
|
+
MessageVerifyingInput.toObject = function toObject(message, options) {
|
114040
|
+
if (!options)
|
114041
|
+
options = {};
|
114042
|
+
var object = {};
|
114043
|
+
if (options.defaults) {
|
114044
|
+
object.message = "";
|
114045
|
+
if (options.bytes === String)
|
114046
|
+
object.publicKey = "";
|
114047
|
+
else {
|
114048
|
+
object.publicKey = [];
|
114049
|
+
if (options.bytes !== Array)
|
114050
|
+
object.publicKey = $util.newBuffer(object.publicKey);
|
114051
|
+
}
|
114052
|
+
object.signature = "";
|
114053
|
+
}
|
114054
|
+
if (message.message != null && message.hasOwnProperty("message"))
|
114055
|
+
object.message = message.message;
|
114056
|
+
if (message.publicKey != null && message.hasOwnProperty("publicKey"))
|
114057
|
+
object.publicKey = options.bytes === String ? $util.base64.encode(message.publicKey, 0, message.publicKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.publicKey) : message.publicKey;
|
114058
|
+
if (message.signature != null && message.hasOwnProperty("signature"))
|
114059
|
+
object.signature = message.signature;
|
114060
|
+
return object;
|
114061
|
+
};
|
114062
|
+
|
114063
|
+
/**
|
114064
|
+
* Converts this MessageVerifyingInput to JSON.
|
114065
|
+
* @function toJSON
|
114066
|
+
* @memberof TW.Solana.Proto.MessageVerifyingInput
|
114067
|
+
* @instance
|
114068
|
+
* @returns {Object.<string,*>} JSON object
|
114069
|
+
*/
|
114070
|
+
MessageVerifyingInput.prototype.toJSON = function toJSON() {
|
114071
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
114072
|
+
};
|
114073
|
+
|
114074
|
+
return MessageVerifyingInput;
|
114075
|
+
})();
|
114076
|
+
|
113339
114077
|
return Proto;
|
113340
114078
|
})();
|
113341
114079
|
|
package/dist/lib/wallet-core.js
CHANGED
@@ -36,7 +36,7 @@ function $a(a,b){var c=M;return sa||"function"!=typeof WebAssembly.instantiateSt
|
|
36
36
|
function z(a,b){Object.getOwnPropertyDescriptor(g,a)||Object.defineProperty(g,a,{configurable:!0,get:function(){n("Module."+a+" has been replaced with plain "+b+" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}})}
|
37
37
|
function cb(a){return"FS_createPath"===a||"FS_createDataFile"===a||"FS_createPreloadedFile"===a||"FS_unlink"===a||"addRunDependency"===a||"FS_createLazyFile"===a||"FS_createDevice"===a||"removeRunDependency"===a}(function(a,b){"undefined"!==typeof globalThis&&Object.defineProperty(globalThis,a,{configurable:!0,get:function(){ya("`"+a+"` is not longer defined by emscripten. "+b)}})})("buffer","Please use HEAP8.buffer or wasmMemory.buffer");
|
38
38
|
function db(a){Object.getOwnPropertyDescriptor(g,a)||Object.defineProperty(g,a,{configurable:!0,get:function(){var b="'"+a+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";cb(a)&&(b+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you");n(b)}})}
|
39
|
-
var eb={
|
39
|
+
var eb={2087124:()=>{if(void 0===g.fa)try{var a="object"===typeof window?window:self,b="undefined"!==typeof a.crypto?a.crypto:a.msCrypto;a=function(){var d=new Uint32Array(1);b.getRandomValues(d);return d[0]>>>0};a();g.fa=a}catch(d){try{var c=require("crypto");a=function(){var e=c.randomBytes(4);return(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0};a();g.fa=a}catch(e){throw"No secure random number generator found";}}},2087846:()=>g.fa()};
|
40
40
|
function qa(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}function fb(a){for(;0<a.length;)a.shift()(g)}function za(a){assert("number"===typeof a);return"0x"+a.toString(16).padStart(8,"0")}function ya(a){gb||(gb={});gb[a]||(gb[a]=1,w&&(a="warning: "+a),y(a))}var gb,hb=[];function ib(a){var b=hb[a];b||(a>=hb.length&&(hb.length=a+1),hb[a]=b=Ha.get(a));assert(Ha.get(a)==b,"JavaScript-side Wasm function table mirror is out of date!");return b}
|
41
41
|
function jb(a){this.l=a-24;this.Oa=function(b){G[this.l+4>>2]=b};this.Ja=function(b){G[this.l+8>>2]=b};this.Ka=function(){F[this.l>>2]=0};this.Ea=function(){D[this.l+12>>0]=0};this.La=function(){D[this.l+13>>0]=0};this.I=function(b,c){this.Da();this.Oa(b);this.Ja(c);this.Ka();this.Ea();this.La()};this.Da=function(){G[this.l+16>>2]=0}}
|
42
42
|
var kb=0,lb=(a,b)=>{for(var c=0,d=a.length-1;0<=d;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},mb=a=>{var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=lb(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},nb=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b},ob=
|
Binary file
|
@@ -115,6 +115,12 @@ export class Base64 {
|
|
115
115
|
static encode(data: Uint8Array | Buffer): string;
|
116
116
|
static encodeUrl(data: Uint8Array | Buffer): string;
|
117
117
|
}
|
118
|
+
export class Bech32 {
|
119
|
+
static encode(hrp: string, data: Uint8Array | Buffer): string;
|
120
|
+
static decode(string: string): Uint8Array;
|
121
|
+
static encodeM(hrp: string, data: Uint8Array | Buffer): string;
|
122
|
+
static decodeM(string: string): Uint8Array;
|
123
|
+
}
|
118
124
|
export class BitcoinAddress {
|
119
125
|
static equal(lhs: BitcoinAddress, rhs: BitcoinAddress): boolean;
|
120
126
|
static isValid(data: Uint8Array | Buffer): boolean;
|
@@ -780,6 +786,10 @@ export class Hash {
|
|
780
786
|
export class LiquidStaking {
|
781
787
|
static buildRequest(input: Uint8Array | Buffer): Uint8Array;
|
782
788
|
}
|
789
|
+
export class MessageSigner {
|
790
|
+
static sign(coin: CoinType, input: Uint8Array | Buffer): Uint8Array;
|
791
|
+
static verify(coin: CoinType, input: Uint8Array | Buffer): boolean;
|
792
|
+
}
|
783
793
|
export class Mnemonic {
|
784
794
|
static isValid(mnemonic: string): boolean;
|
785
795
|
static isValidWord(word: string): boolean;
|
@@ -1038,6 +1048,7 @@ export interface WalletCore {
|
|
1038
1048
|
Base32: typeof Base32;
|
1039
1049
|
Base58: typeof Base58;
|
1040
1050
|
Base64: typeof Base64;
|
1051
|
+
Bech32: typeof Bech32;
|
1041
1052
|
BitcoinAddress: typeof BitcoinAddress;
|
1042
1053
|
BitcoinMessageSigner: typeof BitcoinMessageSigner;
|
1043
1054
|
BitcoinScript: typeof BitcoinScript;
|
@@ -1071,6 +1082,7 @@ export interface WalletCore {
|
|
1071
1082
|
HRP: typeof HRP;
|
1072
1083
|
Hash: typeof Hash;
|
1073
1084
|
LiquidStaking: typeof LiquidStaking;
|
1085
|
+
MessageSigner: typeof MessageSigner;
|
1074
1086
|
Mnemonic: typeof Mnemonic;
|
1075
1087
|
NEARAccount: typeof NEARAccount;
|
1076
1088
|
NervosAddress: typeof NervosAddress;
|