@trustwallet/wallet-core 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10897,6 +10897,9 @@ export namespace TW {
|
|
10897
10897
|
|
10898
10898
|
/** Transaction contractGeneric */
|
10899
10899
|
contractGeneric?: (TW.Ethereum.Proto.Transaction.IContractGeneric|null);
|
10900
|
+
|
10901
|
+
/** Transaction batch */
|
10902
|
+
batch?: (TW.Ethereum.Proto.Transaction.IBatch|null);
|
10900
10903
|
}
|
10901
10904
|
|
10902
10905
|
/** Represents a Transaction. */
|
@@ -10926,8 +10929,11 @@ export namespace TW {
|
|
10926
10929
|
/** Transaction contractGeneric. */
|
10927
10930
|
public contractGeneric?: (TW.Ethereum.Proto.Transaction.IContractGeneric|null);
|
10928
10931
|
|
10932
|
+
/** Transaction batch. */
|
10933
|
+
public batch?: (TW.Ethereum.Proto.Transaction.IBatch|null);
|
10934
|
+
|
10929
10935
|
/** Transaction transactionOneof. */
|
10930
|
-
public transactionOneof?: ("transfer"|"erc20Transfer"|"erc20Approve"|"erc721Transfer"|"erc1155Transfer"|"contractGeneric");
|
10936
|
+
public transactionOneof?: ("transfer"|"erc20Transfer"|"erc20Approve"|"erc721Transfer"|"erc1155Transfer"|"contractGeneric"|"batch");
|
10931
10937
|
|
10932
10938
|
/**
|
10933
10939
|
* Creates a new Transaction instance using the specified properties.
|
@@ -11482,6 +11488,167 @@ export namespace TW {
|
|
11482
11488
|
*/
|
11483
11489
|
public toJSON(): { [k: string]: any };
|
11484
11490
|
}
|
11491
|
+
|
11492
|
+
/** Properties of a Batch. */
|
11493
|
+
interface IBatch {
|
11494
|
+
|
11495
|
+
/** Batch calls */
|
11496
|
+
calls?: (TW.Ethereum.Proto.Transaction.Batch.IBatchedCall[]|null);
|
11497
|
+
}
|
11498
|
+
|
11499
|
+
/** Represents a Batch. */
|
11500
|
+
class Batch implements IBatch {
|
11501
|
+
|
11502
|
+
/**
|
11503
|
+
* Constructs a new Batch.
|
11504
|
+
* @param [properties] Properties to set
|
11505
|
+
*/
|
11506
|
+
constructor(properties?: TW.Ethereum.Proto.Transaction.IBatch);
|
11507
|
+
|
11508
|
+
/** Batch calls. */
|
11509
|
+
public calls: TW.Ethereum.Proto.Transaction.Batch.IBatchedCall[];
|
11510
|
+
|
11511
|
+
/**
|
11512
|
+
* Creates a new Batch instance using the specified properties.
|
11513
|
+
* @param [properties] Properties to set
|
11514
|
+
* @returns Batch instance
|
11515
|
+
*/
|
11516
|
+
public static create(properties?: TW.Ethereum.Proto.Transaction.IBatch): TW.Ethereum.Proto.Transaction.Batch;
|
11517
|
+
|
11518
|
+
/**
|
11519
|
+
* Encodes the specified Batch message. Does not implicitly {@link TW.Ethereum.Proto.Transaction.Batch.verify|verify} messages.
|
11520
|
+
* @param message Batch message or plain object to encode
|
11521
|
+
* @param [writer] Writer to encode to
|
11522
|
+
* @returns Writer
|
11523
|
+
*/
|
11524
|
+
public static encode(message: TW.Ethereum.Proto.Transaction.IBatch, writer?: $protobuf.Writer): $protobuf.Writer;
|
11525
|
+
|
11526
|
+
/**
|
11527
|
+
* Decodes a Batch message from the specified reader or buffer.
|
11528
|
+
* @param reader Reader or buffer to decode from
|
11529
|
+
* @param [length] Message length if known beforehand
|
11530
|
+
* @returns Batch
|
11531
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
11532
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11533
|
+
*/
|
11534
|
+
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): TW.Ethereum.Proto.Transaction.Batch;
|
11535
|
+
|
11536
|
+
/**
|
11537
|
+
* Verifies a Batch message.
|
11538
|
+
* @param message Plain object to verify
|
11539
|
+
* @returns `null` if valid, otherwise the reason why it is not
|
11540
|
+
*/
|
11541
|
+
public static verify(message: { [k: string]: any }): (string|null);
|
11542
|
+
|
11543
|
+
/**
|
11544
|
+
* Creates a Batch message from a plain object. Also converts values to their respective internal types.
|
11545
|
+
* @param object Plain object
|
11546
|
+
* @returns Batch
|
11547
|
+
*/
|
11548
|
+
public static fromObject(object: { [k: string]: any }): TW.Ethereum.Proto.Transaction.Batch;
|
11549
|
+
|
11550
|
+
/**
|
11551
|
+
* Creates a plain object from a Batch message. Also converts values to other types if specified.
|
11552
|
+
* @param message Batch
|
11553
|
+
* @param [options] Conversion options
|
11554
|
+
* @returns Plain object
|
11555
|
+
*/
|
11556
|
+
public static toObject(message: TW.Ethereum.Proto.Transaction.Batch, options?: $protobuf.IConversionOptions): { [k: string]: any };
|
11557
|
+
|
11558
|
+
/**
|
11559
|
+
* Converts this Batch to JSON.
|
11560
|
+
* @returns JSON object
|
11561
|
+
*/
|
11562
|
+
public toJSON(): { [k: string]: any };
|
11563
|
+
}
|
11564
|
+
|
11565
|
+
namespace Batch {
|
11566
|
+
|
11567
|
+
/** Properties of a BatchedCall. */
|
11568
|
+
interface IBatchedCall {
|
11569
|
+
|
11570
|
+
/** BatchedCall address */
|
11571
|
+
address?: (string|null);
|
11572
|
+
|
11573
|
+
/** BatchedCall amount */
|
11574
|
+
amount?: (Uint8Array|null);
|
11575
|
+
|
11576
|
+
/** BatchedCall payload */
|
11577
|
+
payload?: (Uint8Array|null);
|
11578
|
+
}
|
11579
|
+
|
11580
|
+
/** Represents a BatchedCall. */
|
11581
|
+
class BatchedCall implements IBatchedCall {
|
11582
|
+
|
11583
|
+
/**
|
11584
|
+
* Constructs a new BatchedCall.
|
11585
|
+
* @param [properties] Properties to set
|
11586
|
+
*/
|
11587
|
+
constructor(properties?: TW.Ethereum.Proto.Transaction.Batch.IBatchedCall);
|
11588
|
+
|
11589
|
+
/** BatchedCall address. */
|
11590
|
+
public address: string;
|
11591
|
+
|
11592
|
+
/** BatchedCall amount. */
|
11593
|
+
public amount: Uint8Array;
|
11594
|
+
|
11595
|
+
/** BatchedCall payload. */
|
11596
|
+
public payload: Uint8Array;
|
11597
|
+
|
11598
|
+
/**
|
11599
|
+
* Creates a new BatchedCall instance using the specified properties.
|
11600
|
+
* @param [properties] Properties to set
|
11601
|
+
* @returns BatchedCall instance
|
11602
|
+
*/
|
11603
|
+
public static create(properties?: TW.Ethereum.Proto.Transaction.Batch.IBatchedCall): TW.Ethereum.Proto.Transaction.Batch.BatchedCall;
|
11604
|
+
|
11605
|
+
/**
|
11606
|
+
* Encodes the specified BatchedCall message. Does not implicitly {@link TW.Ethereum.Proto.Transaction.Batch.BatchedCall.verify|verify} messages.
|
11607
|
+
* @param message BatchedCall message or plain object to encode
|
11608
|
+
* @param [writer] Writer to encode to
|
11609
|
+
* @returns Writer
|
11610
|
+
*/
|
11611
|
+
public static encode(message: TW.Ethereum.Proto.Transaction.Batch.IBatchedCall, writer?: $protobuf.Writer): $protobuf.Writer;
|
11612
|
+
|
11613
|
+
/**
|
11614
|
+
* Decodes a BatchedCall message from the specified reader or buffer.
|
11615
|
+
* @param reader Reader or buffer to decode from
|
11616
|
+
* @param [length] Message length if known beforehand
|
11617
|
+
* @returns BatchedCall
|
11618
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
11619
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11620
|
+
*/
|
11621
|
+
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): TW.Ethereum.Proto.Transaction.Batch.BatchedCall;
|
11622
|
+
|
11623
|
+
/**
|
11624
|
+
* Verifies a BatchedCall message.
|
11625
|
+
* @param message Plain object to verify
|
11626
|
+
* @returns `null` if valid, otherwise the reason why it is not
|
11627
|
+
*/
|
11628
|
+
public static verify(message: { [k: string]: any }): (string|null);
|
11629
|
+
|
11630
|
+
/**
|
11631
|
+
* Creates a BatchedCall message from a plain object. Also converts values to their respective internal types.
|
11632
|
+
* @param object Plain object
|
11633
|
+
* @returns BatchedCall
|
11634
|
+
*/
|
11635
|
+
public static fromObject(object: { [k: string]: any }): TW.Ethereum.Proto.Transaction.Batch.BatchedCall;
|
11636
|
+
|
11637
|
+
/**
|
11638
|
+
* Creates a plain object from a BatchedCall message. Also converts values to other types if specified.
|
11639
|
+
* @param message BatchedCall
|
11640
|
+
* @param [options] Conversion options
|
11641
|
+
* @returns Plain object
|
11642
|
+
*/
|
11643
|
+
public static toObject(message: TW.Ethereum.Proto.Transaction.Batch.BatchedCall, options?: $protobuf.IConversionOptions): { [k: string]: any };
|
11644
|
+
|
11645
|
+
/**
|
11646
|
+
* Converts this BatchedCall to JSON.
|
11647
|
+
* @returns JSON object
|
11648
|
+
*/
|
11649
|
+
public toJSON(): { [k: string]: any };
|
11650
|
+
}
|
11651
|
+
}
|
11485
11652
|
}
|
11486
11653
|
|
11487
11654
|
/** TransactionMode enum. */
|
@@ -32644,6 +32644,7 @@
|
|
32644
32644
|
* @property {TW.Ethereum.Proto.Transaction.IERC721Transfer|null} [erc721Transfer] Transaction erc721Transfer
|
32645
32645
|
* @property {TW.Ethereum.Proto.Transaction.IERC1155Transfer|null} [erc1155Transfer] Transaction erc1155Transfer
|
32646
32646
|
* @property {TW.Ethereum.Proto.Transaction.IContractGeneric|null} [contractGeneric] Transaction contractGeneric
|
32647
|
+
* @property {TW.Ethereum.Proto.Transaction.IBatch|null} [batch] Transaction batch
|
32647
32648
|
*/
|
32648
32649
|
|
32649
32650
|
/**
|
@@ -32709,17 +32710,25 @@
|
|
32709
32710
|
*/
|
32710
32711
|
Transaction.prototype.contractGeneric = null;
|
32711
32712
|
|
32713
|
+
/**
|
32714
|
+
* Transaction batch.
|
32715
|
+
* @member {TW.Ethereum.Proto.Transaction.IBatch|null|undefined} batch
|
32716
|
+
* @memberof TW.Ethereum.Proto.Transaction
|
32717
|
+
* @instance
|
32718
|
+
*/
|
32719
|
+
Transaction.prototype.batch = null;
|
32720
|
+
|
32712
32721
|
// OneOf field names bound to virtual getters and setters
|
32713
32722
|
var $oneOfFields;
|
32714
32723
|
|
32715
32724
|
/**
|
32716
32725
|
* Transaction transactionOneof.
|
32717
|
-
* @member {"transfer"|"erc20Transfer"|"erc20Approve"|"erc721Transfer"|"erc1155Transfer"|"contractGeneric"|undefined} transactionOneof
|
32726
|
+
* @member {"transfer"|"erc20Transfer"|"erc20Approve"|"erc721Transfer"|"erc1155Transfer"|"contractGeneric"|"batch"|undefined} transactionOneof
|
32718
32727
|
* @memberof TW.Ethereum.Proto.Transaction
|
32719
32728
|
* @instance
|
32720
32729
|
*/
|
32721
32730
|
Object.defineProperty(Transaction.prototype, "transactionOneof", {
|
32722
|
-
get: $util.oneOfGetter($oneOfFields = ["transfer", "erc20Transfer", "erc20Approve", "erc721Transfer", "erc1155Transfer", "contractGeneric"]),
|
32731
|
+
get: $util.oneOfGetter($oneOfFields = ["transfer", "erc20Transfer", "erc20Approve", "erc721Transfer", "erc1155Transfer", "contractGeneric", "batch"]),
|
32723
32732
|
set: $util.oneOfSetter($oneOfFields)
|
32724
32733
|
});
|
32725
32734
|
|
@@ -32759,6 +32768,8 @@
|
|
32759
32768
|
$root.TW.Ethereum.Proto.Transaction.ERC1155Transfer.encode(message.erc1155Transfer, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
32760
32769
|
if (message.contractGeneric != null && Object.hasOwnProperty.call(message, "contractGeneric"))
|
32761
32770
|
$root.TW.Ethereum.Proto.Transaction.ContractGeneric.encode(message.contractGeneric, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
32771
|
+
if (message.batch != null && Object.hasOwnProperty.call(message, "batch"))
|
32772
|
+
$root.TW.Ethereum.Proto.Transaction.Batch.encode(message.batch, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
32762
32773
|
return writer;
|
32763
32774
|
};
|
32764
32775
|
|
@@ -32798,6 +32809,9 @@
|
|
32798
32809
|
case 6:
|
32799
32810
|
message.contractGeneric = $root.TW.Ethereum.Proto.Transaction.ContractGeneric.decode(reader, reader.uint32());
|
32800
32811
|
break;
|
32812
|
+
case 7:
|
32813
|
+
message.batch = $root.TW.Ethereum.Proto.Transaction.Batch.decode(reader, reader.uint32());
|
32814
|
+
break;
|
32801
32815
|
default:
|
32802
32816
|
reader.skipType(tag & 7);
|
32803
32817
|
break;
|
@@ -32876,6 +32890,16 @@
|
|
32876
32890
|
return "contractGeneric." + error;
|
32877
32891
|
}
|
32878
32892
|
}
|
32893
|
+
if (message.batch != null && message.hasOwnProperty("batch")) {
|
32894
|
+
if (properties.transactionOneof === 1)
|
32895
|
+
return "transactionOneof: multiple values";
|
32896
|
+
properties.transactionOneof = 1;
|
32897
|
+
{
|
32898
|
+
var error = $root.TW.Ethereum.Proto.Transaction.Batch.verify(message.batch);
|
32899
|
+
if (error)
|
32900
|
+
return "batch." + error;
|
32901
|
+
}
|
32902
|
+
}
|
32879
32903
|
return null;
|
32880
32904
|
};
|
32881
32905
|
|
@@ -32921,6 +32945,11 @@
|
|
32921
32945
|
throw TypeError(".TW.Ethereum.Proto.Transaction.contractGeneric: object expected");
|
32922
32946
|
message.contractGeneric = $root.TW.Ethereum.Proto.Transaction.ContractGeneric.fromObject(object.contractGeneric);
|
32923
32947
|
}
|
32948
|
+
if (object.batch != null) {
|
32949
|
+
if (typeof object.batch !== "object")
|
32950
|
+
throw TypeError(".TW.Ethereum.Proto.Transaction.batch: object expected");
|
32951
|
+
message.batch = $root.TW.Ethereum.Proto.Transaction.Batch.fromObject(object.batch);
|
32952
|
+
}
|
32924
32953
|
return message;
|
32925
32954
|
};
|
32926
32955
|
|
@@ -32967,6 +32996,11 @@
|
|
32967
32996
|
if (options.oneofs)
|
32968
32997
|
object.transactionOneof = "contractGeneric";
|
32969
32998
|
}
|
32999
|
+
if (message.batch != null && message.hasOwnProperty("batch")) {
|
33000
|
+
object.batch = $root.TW.Ethereum.Proto.Transaction.Batch.toObject(message.batch, options);
|
33001
|
+
if (options.oneofs)
|
33002
|
+
object.transactionOneof = "batch";
|
33003
|
+
}
|
32970
33004
|
return object;
|
32971
33005
|
};
|
32972
33006
|
|
@@ -34245,6 +34279,406 @@
|
|
34245
34279
|
return ContractGeneric;
|
34246
34280
|
})();
|
34247
34281
|
|
34282
|
+
Transaction.Batch = (function() {
|
34283
|
+
|
34284
|
+
/**
|
34285
|
+
* Properties of a Batch.
|
34286
|
+
* @memberof TW.Ethereum.Proto.Transaction
|
34287
|
+
* @interface IBatch
|
34288
|
+
* @property {Array.<TW.Ethereum.Proto.Transaction.Batch.IBatchedCall>|null} [calls] Batch calls
|
34289
|
+
*/
|
34290
|
+
|
34291
|
+
/**
|
34292
|
+
* Constructs a new Batch.
|
34293
|
+
* @memberof TW.Ethereum.Proto.Transaction
|
34294
|
+
* @classdesc Represents a Batch.
|
34295
|
+
* @implements IBatch
|
34296
|
+
* @constructor
|
34297
|
+
* @param {TW.Ethereum.Proto.Transaction.IBatch=} [properties] Properties to set
|
34298
|
+
*/
|
34299
|
+
function Batch(properties) {
|
34300
|
+
this.calls = [];
|
34301
|
+
if (properties)
|
34302
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
34303
|
+
if (properties[keys[i]] != null)
|
34304
|
+
this[keys[i]] = properties[keys[i]];
|
34305
|
+
}
|
34306
|
+
|
34307
|
+
/**
|
34308
|
+
* Batch calls.
|
34309
|
+
* @member {Array.<TW.Ethereum.Proto.Transaction.Batch.IBatchedCall>} calls
|
34310
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch
|
34311
|
+
* @instance
|
34312
|
+
*/
|
34313
|
+
Batch.prototype.calls = $util.emptyArray;
|
34314
|
+
|
34315
|
+
/**
|
34316
|
+
* Creates a new Batch instance using the specified properties.
|
34317
|
+
* @function create
|
34318
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch
|
34319
|
+
* @static
|
34320
|
+
* @param {TW.Ethereum.Proto.Transaction.IBatch=} [properties] Properties to set
|
34321
|
+
* @returns {TW.Ethereum.Proto.Transaction.Batch} Batch instance
|
34322
|
+
*/
|
34323
|
+
Batch.create = function create(properties) {
|
34324
|
+
return new Batch(properties);
|
34325
|
+
};
|
34326
|
+
|
34327
|
+
/**
|
34328
|
+
* Encodes the specified Batch message. Does not implicitly {@link TW.Ethereum.Proto.Transaction.Batch.verify|verify} messages.
|
34329
|
+
* @function encode
|
34330
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch
|
34331
|
+
* @static
|
34332
|
+
* @param {TW.Ethereum.Proto.Transaction.IBatch} message Batch message or plain object to encode
|
34333
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
34334
|
+
* @returns {$protobuf.Writer} Writer
|
34335
|
+
*/
|
34336
|
+
Batch.encode = function encode(message, writer) {
|
34337
|
+
if (!writer)
|
34338
|
+
writer = $Writer.create();
|
34339
|
+
if (message.calls != null && message.calls.length)
|
34340
|
+
for (var i = 0; i < message.calls.length; ++i)
|
34341
|
+
$root.TW.Ethereum.Proto.Transaction.Batch.BatchedCall.encode(message.calls[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
34342
|
+
return writer;
|
34343
|
+
};
|
34344
|
+
|
34345
|
+
/**
|
34346
|
+
* Decodes a Batch message from the specified reader or buffer.
|
34347
|
+
* @function decode
|
34348
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch
|
34349
|
+
* @static
|
34350
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
34351
|
+
* @param {number} [length] Message length if known beforehand
|
34352
|
+
* @returns {TW.Ethereum.Proto.Transaction.Batch} Batch
|
34353
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
34354
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
34355
|
+
*/
|
34356
|
+
Batch.decode = function decode(reader, length) {
|
34357
|
+
if (!(reader instanceof $Reader))
|
34358
|
+
reader = $Reader.create(reader);
|
34359
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Ethereum.Proto.Transaction.Batch();
|
34360
|
+
while (reader.pos < end) {
|
34361
|
+
var tag = reader.uint32();
|
34362
|
+
switch (tag >>> 3) {
|
34363
|
+
case 1:
|
34364
|
+
if (!(message.calls && message.calls.length))
|
34365
|
+
message.calls = [];
|
34366
|
+
message.calls.push($root.TW.Ethereum.Proto.Transaction.Batch.BatchedCall.decode(reader, reader.uint32()));
|
34367
|
+
break;
|
34368
|
+
default:
|
34369
|
+
reader.skipType(tag & 7);
|
34370
|
+
break;
|
34371
|
+
}
|
34372
|
+
}
|
34373
|
+
return message;
|
34374
|
+
};
|
34375
|
+
|
34376
|
+
/**
|
34377
|
+
* Verifies a Batch message.
|
34378
|
+
* @function verify
|
34379
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch
|
34380
|
+
* @static
|
34381
|
+
* @param {Object.<string,*>} message Plain object to verify
|
34382
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
34383
|
+
*/
|
34384
|
+
Batch.verify = function verify(message) {
|
34385
|
+
if (typeof message !== "object" || message === null)
|
34386
|
+
return "object expected";
|
34387
|
+
if (message.calls != null && message.hasOwnProperty("calls")) {
|
34388
|
+
if (!Array.isArray(message.calls))
|
34389
|
+
return "calls: array expected";
|
34390
|
+
for (var i = 0; i < message.calls.length; ++i) {
|
34391
|
+
var error = $root.TW.Ethereum.Proto.Transaction.Batch.BatchedCall.verify(message.calls[i]);
|
34392
|
+
if (error)
|
34393
|
+
return "calls." + error;
|
34394
|
+
}
|
34395
|
+
}
|
34396
|
+
return null;
|
34397
|
+
};
|
34398
|
+
|
34399
|
+
/**
|
34400
|
+
* Creates a Batch message from a plain object. Also converts values to their respective internal types.
|
34401
|
+
* @function fromObject
|
34402
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch
|
34403
|
+
* @static
|
34404
|
+
* @param {Object.<string,*>} object Plain object
|
34405
|
+
* @returns {TW.Ethereum.Proto.Transaction.Batch} Batch
|
34406
|
+
*/
|
34407
|
+
Batch.fromObject = function fromObject(object) {
|
34408
|
+
if (object instanceof $root.TW.Ethereum.Proto.Transaction.Batch)
|
34409
|
+
return object;
|
34410
|
+
var message = new $root.TW.Ethereum.Proto.Transaction.Batch();
|
34411
|
+
if (object.calls) {
|
34412
|
+
if (!Array.isArray(object.calls))
|
34413
|
+
throw TypeError(".TW.Ethereum.Proto.Transaction.Batch.calls: array expected");
|
34414
|
+
message.calls = [];
|
34415
|
+
for (var i = 0; i < object.calls.length; ++i) {
|
34416
|
+
if (typeof object.calls[i] !== "object")
|
34417
|
+
throw TypeError(".TW.Ethereum.Proto.Transaction.Batch.calls: object expected");
|
34418
|
+
message.calls[i] = $root.TW.Ethereum.Proto.Transaction.Batch.BatchedCall.fromObject(object.calls[i]);
|
34419
|
+
}
|
34420
|
+
}
|
34421
|
+
return message;
|
34422
|
+
};
|
34423
|
+
|
34424
|
+
/**
|
34425
|
+
* Creates a plain object from a Batch message. Also converts values to other types if specified.
|
34426
|
+
* @function toObject
|
34427
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch
|
34428
|
+
* @static
|
34429
|
+
* @param {TW.Ethereum.Proto.Transaction.Batch} message Batch
|
34430
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
34431
|
+
* @returns {Object.<string,*>} Plain object
|
34432
|
+
*/
|
34433
|
+
Batch.toObject = function toObject(message, options) {
|
34434
|
+
if (!options)
|
34435
|
+
options = {};
|
34436
|
+
var object = {};
|
34437
|
+
if (options.arrays || options.defaults)
|
34438
|
+
object.calls = [];
|
34439
|
+
if (message.calls && message.calls.length) {
|
34440
|
+
object.calls = [];
|
34441
|
+
for (var j = 0; j < message.calls.length; ++j)
|
34442
|
+
object.calls[j] = $root.TW.Ethereum.Proto.Transaction.Batch.BatchedCall.toObject(message.calls[j], options);
|
34443
|
+
}
|
34444
|
+
return object;
|
34445
|
+
};
|
34446
|
+
|
34447
|
+
/**
|
34448
|
+
* Converts this Batch to JSON.
|
34449
|
+
* @function toJSON
|
34450
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch
|
34451
|
+
* @instance
|
34452
|
+
* @returns {Object.<string,*>} JSON object
|
34453
|
+
*/
|
34454
|
+
Batch.prototype.toJSON = function toJSON() {
|
34455
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
34456
|
+
};
|
34457
|
+
|
34458
|
+
Batch.BatchedCall = (function() {
|
34459
|
+
|
34460
|
+
/**
|
34461
|
+
* Properties of a BatchedCall.
|
34462
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch
|
34463
|
+
* @interface IBatchedCall
|
34464
|
+
* @property {string|null} [address] BatchedCall address
|
34465
|
+
* @property {Uint8Array|null} [amount] BatchedCall amount
|
34466
|
+
* @property {Uint8Array|null} [payload] BatchedCall payload
|
34467
|
+
*/
|
34468
|
+
|
34469
|
+
/**
|
34470
|
+
* Constructs a new BatchedCall.
|
34471
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch
|
34472
|
+
* @classdesc Represents a BatchedCall.
|
34473
|
+
* @implements IBatchedCall
|
34474
|
+
* @constructor
|
34475
|
+
* @param {TW.Ethereum.Proto.Transaction.Batch.IBatchedCall=} [properties] Properties to set
|
34476
|
+
*/
|
34477
|
+
function BatchedCall(properties) {
|
34478
|
+
if (properties)
|
34479
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
34480
|
+
if (properties[keys[i]] != null)
|
34481
|
+
this[keys[i]] = properties[keys[i]];
|
34482
|
+
}
|
34483
|
+
|
34484
|
+
/**
|
34485
|
+
* BatchedCall address.
|
34486
|
+
* @member {string} address
|
34487
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch.BatchedCall
|
34488
|
+
* @instance
|
34489
|
+
*/
|
34490
|
+
BatchedCall.prototype.address = "";
|
34491
|
+
|
34492
|
+
/**
|
34493
|
+
* BatchedCall amount.
|
34494
|
+
* @member {Uint8Array} amount
|
34495
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch.BatchedCall
|
34496
|
+
* @instance
|
34497
|
+
*/
|
34498
|
+
BatchedCall.prototype.amount = $util.newBuffer([]);
|
34499
|
+
|
34500
|
+
/**
|
34501
|
+
* BatchedCall payload.
|
34502
|
+
* @member {Uint8Array} payload
|
34503
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch.BatchedCall
|
34504
|
+
* @instance
|
34505
|
+
*/
|
34506
|
+
BatchedCall.prototype.payload = $util.newBuffer([]);
|
34507
|
+
|
34508
|
+
/**
|
34509
|
+
* Creates a new BatchedCall instance using the specified properties.
|
34510
|
+
* @function create
|
34511
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch.BatchedCall
|
34512
|
+
* @static
|
34513
|
+
* @param {TW.Ethereum.Proto.Transaction.Batch.IBatchedCall=} [properties] Properties to set
|
34514
|
+
* @returns {TW.Ethereum.Proto.Transaction.Batch.BatchedCall} BatchedCall instance
|
34515
|
+
*/
|
34516
|
+
BatchedCall.create = function create(properties) {
|
34517
|
+
return new BatchedCall(properties);
|
34518
|
+
};
|
34519
|
+
|
34520
|
+
/**
|
34521
|
+
* Encodes the specified BatchedCall message. Does not implicitly {@link TW.Ethereum.Proto.Transaction.Batch.BatchedCall.verify|verify} messages.
|
34522
|
+
* @function encode
|
34523
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch.BatchedCall
|
34524
|
+
* @static
|
34525
|
+
* @param {TW.Ethereum.Proto.Transaction.Batch.IBatchedCall} message BatchedCall message or plain object to encode
|
34526
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
34527
|
+
* @returns {$protobuf.Writer} Writer
|
34528
|
+
*/
|
34529
|
+
BatchedCall.encode = function encode(message, writer) {
|
34530
|
+
if (!writer)
|
34531
|
+
writer = $Writer.create();
|
34532
|
+
if (message.address != null && Object.hasOwnProperty.call(message, "address"))
|
34533
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.address);
|
34534
|
+
if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
|
34535
|
+
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.amount);
|
34536
|
+
if (message.payload != null && Object.hasOwnProperty.call(message, "payload"))
|
34537
|
+
writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.payload);
|
34538
|
+
return writer;
|
34539
|
+
};
|
34540
|
+
|
34541
|
+
/**
|
34542
|
+
* Decodes a BatchedCall message from the specified reader or buffer.
|
34543
|
+
* @function decode
|
34544
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch.BatchedCall
|
34545
|
+
* @static
|
34546
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
34547
|
+
* @param {number} [length] Message length if known beforehand
|
34548
|
+
* @returns {TW.Ethereum.Proto.Transaction.Batch.BatchedCall} BatchedCall
|
34549
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
34550
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
34551
|
+
*/
|
34552
|
+
BatchedCall.decode = function decode(reader, length) {
|
34553
|
+
if (!(reader instanceof $Reader))
|
34554
|
+
reader = $Reader.create(reader);
|
34555
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Ethereum.Proto.Transaction.Batch.BatchedCall();
|
34556
|
+
while (reader.pos < end) {
|
34557
|
+
var tag = reader.uint32();
|
34558
|
+
switch (tag >>> 3) {
|
34559
|
+
case 1:
|
34560
|
+
message.address = reader.string();
|
34561
|
+
break;
|
34562
|
+
case 2:
|
34563
|
+
message.amount = reader.bytes();
|
34564
|
+
break;
|
34565
|
+
case 3:
|
34566
|
+
message.payload = reader.bytes();
|
34567
|
+
break;
|
34568
|
+
default:
|
34569
|
+
reader.skipType(tag & 7);
|
34570
|
+
break;
|
34571
|
+
}
|
34572
|
+
}
|
34573
|
+
return message;
|
34574
|
+
};
|
34575
|
+
|
34576
|
+
/**
|
34577
|
+
* Verifies a BatchedCall message.
|
34578
|
+
* @function verify
|
34579
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch.BatchedCall
|
34580
|
+
* @static
|
34581
|
+
* @param {Object.<string,*>} message Plain object to verify
|
34582
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
34583
|
+
*/
|
34584
|
+
BatchedCall.verify = function verify(message) {
|
34585
|
+
if (typeof message !== "object" || message === null)
|
34586
|
+
return "object expected";
|
34587
|
+
if (message.address != null && message.hasOwnProperty("address"))
|
34588
|
+
if (!$util.isString(message.address))
|
34589
|
+
return "address: string expected";
|
34590
|
+
if (message.amount != null && message.hasOwnProperty("amount"))
|
34591
|
+
if (!(message.amount && typeof message.amount.length === "number" || $util.isString(message.amount)))
|
34592
|
+
return "amount: buffer expected";
|
34593
|
+
if (message.payload != null && message.hasOwnProperty("payload"))
|
34594
|
+
if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload)))
|
34595
|
+
return "payload: buffer expected";
|
34596
|
+
return null;
|
34597
|
+
};
|
34598
|
+
|
34599
|
+
/**
|
34600
|
+
* Creates a BatchedCall message from a plain object. Also converts values to their respective internal types.
|
34601
|
+
* @function fromObject
|
34602
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch.BatchedCall
|
34603
|
+
* @static
|
34604
|
+
* @param {Object.<string,*>} object Plain object
|
34605
|
+
* @returns {TW.Ethereum.Proto.Transaction.Batch.BatchedCall} BatchedCall
|
34606
|
+
*/
|
34607
|
+
BatchedCall.fromObject = function fromObject(object) {
|
34608
|
+
if (object instanceof $root.TW.Ethereum.Proto.Transaction.Batch.BatchedCall)
|
34609
|
+
return object;
|
34610
|
+
var message = new $root.TW.Ethereum.Proto.Transaction.Batch.BatchedCall();
|
34611
|
+
if (object.address != null)
|
34612
|
+
message.address = String(object.address);
|
34613
|
+
if (object.amount != null)
|
34614
|
+
if (typeof object.amount === "string")
|
34615
|
+
$util.base64.decode(object.amount, message.amount = $util.newBuffer($util.base64.length(object.amount)), 0);
|
34616
|
+
else if (object.amount.length)
|
34617
|
+
message.amount = object.amount;
|
34618
|
+
if (object.payload != null)
|
34619
|
+
if (typeof object.payload === "string")
|
34620
|
+
$util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0);
|
34621
|
+
else if (object.payload.length)
|
34622
|
+
message.payload = object.payload;
|
34623
|
+
return message;
|
34624
|
+
};
|
34625
|
+
|
34626
|
+
/**
|
34627
|
+
* Creates a plain object from a BatchedCall message. Also converts values to other types if specified.
|
34628
|
+
* @function toObject
|
34629
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch.BatchedCall
|
34630
|
+
* @static
|
34631
|
+
* @param {TW.Ethereum.Proto.Transaction.Batch.BatchedCall} message BatchedCall
|
34632
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
34633
|
+
* @returns {Object.<string,*>} Plain object
|
34634
|
+
*/
|
34635
|
+
BatchedCall.toObject = function toObject(message, options) {
|
34636
|
+
if (!options)
|
34637
|
+
options = {};
|
34638
|
+
var object = {};
|
34639
|
+
if (options.defaults) {
|
34640
|
+
object.address = "";
|
34641
|
+
if (options.bytes === String)
|
34642
|
+
object.amount = "";
|
34643
|
+
else {
|
34644
|
+
object.amount = [];
|
34645
|
+
if (options.bytes !== Array)
|
34646
|
+
object.amount = $util.newBuffer(object.amount);
|
34647
|
+
}
|
34648
|
+
if (options.bytes === String)
|
34649
|
+
object.payload = "";
|
34650
|
+
else {
|
34651
|
+
object.payload = [];
|
34652
|
+
if (options.bytes !== Array)
|
34653
|
+
object.payload = $util.newBuffer(object.payload);
|
34654
|
+
}
|
34655
|
+
}
|
34656
|
+
if (message.address != null && message.hasOwnProperty("address"))
|
34657
|
+
object.address = message.address;
|
34658
|
+
if (message.amount != null && message.hasOwnProperty("amount"))
|
34659
|
+
object.amount = options.bytes === String ? $util.base64.encode(message.amount, 0, message.amount.length) : options.bytes === Array ? Array.prototype.slice.call(message.amount) : message.amount;
|
34660
|
+
if (message.payload != null && message.hasOwnProperty("payload"))
|
34661
|
+
object.payload = options.bytes === String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.payload) : message.payload;
|
34662
|
+
return object;
|
34663
|
+
};
|
34664
|
+
|
34665
|
+
/**
|
34666
|
+
* Converts this BatchedCall to JSON.
|
34667
|
+
* @function toJSON
|
34668
|
+
* @memberof TW.Ethereum.Proto.Transaction.Batch.BatchedCall
|
34669
|
+
* @instance
|
34670
|
+
* @returns {Object.<string,*>} JSON object
|
34671
|
+
*/
|
34672
|
+
BatchedCall.prototype.toJSON = function toJSON() {
|
34673
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
34674
|
+
};
|
34675
|
+
|
34676
|
+
return BatchedCall;
|
34677
|
+
})();
|
34678
|
+
|
34679
|
+
return Batch;
|
34680
|
+
})();
|
34681
|
+
|
34248
34682
|
return Transaction;
|
34249
34683
|
})();
|
34250
34684
|
|
package/dist/lib/wallet-core.js
CHANGED
@@ -34,7 +34,7 @@ function Ua(){Qa++;g.monitorRunDependencies&&g.monitorRunDependencies(Qa);assert
|
|
34
34
|
function Va(){return G.startsWith("data:application/octet-stream;base64,")}function ma(a){return a.startsWith("file://")}function H(a){return function(){var b=g.asm;assert(Oa,"native function `"+a+"` called before runtime initialization");b[a]||assert(b[a],"exported native function `"+a+"` not found");return b[a].apply(null,arguments)}}var G;G="wallet-core.wasm";if(!Va()){var Wa=G;G=g.locateFile?g.locateFile(Wa,w):w+Wa}
|
35
35
|
function Xa(){var a=G;try{if(a==G&&qa)return new Uint8Array(qa);if(ka)return ka(a);throw"both async and sync fetching of the wasm failed";}catch(b){n(b)}}
|
36
36
|
function Ya(){if(!qa&&(ea||fa)){if("function"==typeof fetch&&!ma(G))return fetch(G,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+G+"'";return a.arrayBuffer()}).catch(function(){return Xa()});if(ja)return new Promise(function(a,b){ja(G,function(c){a(new Uint8Array(c))},b)})}return Promise.resolve().then(function(){return Xa()})}
|
37
|
-
var Za,$a,ab={
|
37
|
+
var Za,$a,ab={1789908:()=>{if(void 0===g.ea)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.ea=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.ea=a}catch(e){throw"No secure random number generator found";}}},1790630:()=>g.ea()};function bb(a){for(;0<a.length;)a.shift()(g)}
|
38
38
|
function va(a){assert("number"===typeof a);return"0x"+a.toString(16).padStart(8,"0")}function pa(a){cb||(cb={});cb[a]||(cb[a]=1,v&&(a="warning: "+a),y(a))}var cb,db=0;
|
39
39
|
function eb(a){this.l=a-24;this.Ta=function(b){F[this.l+4>>2]=b};this.Da=function(){return F[this.l+4>>2]};this.Ja=function(b){F[this.l+8>>2]=b};this.Ka=function(){E[this.l>>2]=0};this.Ia=function(){C[this.l+12>>0]=0};this.Na=function(){C[this.l+13>>0]=0};this.Ea=function(b,c){this.F(0);this.Ta(b);this.Ja(c);this.Ka();this.Ia();this.Na()};this.F=function(b){F[this.l+16>>2]=b}}
|
40
40
|
var fb=0,gb=(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},hb=a=>{var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=gb(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},ib=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},jb=
|
Binary file
|
@@ -364,6 +364,7 @@ export class CoinType {
|
|
364
364
|
static scroll: CoinType;
|
365
365
|
static rootstock: CoinType;
|
366
366
|
static thetaFuel: CoinType;
|
367
|
+
static confluxeSpace: CoinType;
|
367
368
|
}
|
368
369
|
export class CoinTypeConfiguration {
|
369
370
|
static getSymbol(type: CoinType): string;
|
@@ -506,6 +507,7 @@ export class EthereumChainID {
|
|
506
507
|
static polygon: EthereumChainID;
|
507
508
|
static okc: EthereumChainID;
|
508
509
|
static thundertoken: EthereumChainID;
|
510
|
+
static cfxevm: EthereumChainID;
|
509
511
|
static gochain: EthereumChainID;
|
510
512
|
static meter: EthereumChainID;
|
511
513
|
static celo: EthereumChainID;
|